or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

api-services.mdbase-classes.mdcomposables.mdconfiguration.mdindex.mdutilities.md
tile.json

tessl/npm-primevue--core

Core utilities and base functionality for PrimeVue UI component library

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@primevue/core@4.3.x

To install, run

npx @tessl/cli install tessl/npm-primevue--core@4.3.0

index.mddocs/

@primevue/core

@primevue/core provides the foundational infrastructure for PrimeVue, a comprehensive Vue.js UI component library. It contains essential utilities, base components, services, and configuration systems that power the entire PrimeVue ecosystem, including filtering services, icon constants, component base classes, styling utilities, and Vue composables.

Package Information

  • Package Name: @primevue/core
  • Package Type: npm
  • Language: JavaScript/TypeScript
  • Installation: npm install @primevue/core

Core Imports

import { FilterService, PrimeIcons, PrimeVue } from "@primevue/core";
import { BaseComponent, BaseDirective } from "@primevue/core";
import { useStyle, useId } from "@primevue/core";

Modular imports:

import { FilterService, FilterMatchMode } from "@primevue/core/api";
import PrimeVue from "@primevue/core/config";
import BaseComponent from "@primevue/core/basecomponent";
import { useStyle } from "@primevue/core/usestyle";

Basic Usage

import { createApp } from 'vue';
import PrimeVue from '@primevue/core/config';
import { FilterService, FilterMatchMode, PrimeIcons } from '@primevue/core/api';

// Configure PrimeVue
const app = createApp(App);
app.use(PrimeVue, {
  theme: 'aura-light-green',
  ripple: true
});

// Use filtering service
const filteredData = FilterService.filter(
  users,
  ['name', 'email'],
  'john',
  FilterMatchMode.CONTAINS
);

// Use icon constants
const searchIcon = PrimeIcons.SEARCH; // 'pi pi-search'

Architecture

@primevue/core is organized into several key areas:

  • API Services: Data filtering, icon constants, and severity levels
  • Configuration System: PrimeVue plugin with theming and localization
  • Base Classes: Foundation classes for components and directives
  • Styling System: Dynamic style loading and theme management
  • Vue Composables: Utilities for ID generation, styling, and more
  • Utility Functions: Helper classes and core functionality

Capabilities

Data Filtering and Constants

Core API services for data manipulation and UI constants. Essential for building data-driven components with filtering capabilities.

declare namespace FilterService {
  function filter(
    value: any[], 
    fields: string[], 
    filterValue: any, 
    filterMatchMode: string, 
    filterLocale?: string
  ): any[];
}

declare const FilterMatchMode: {
  readonly CONTAINS: string;
  readonly STARTS_WITH: string;
  readonly ENDS_WITH: string;
  // ... more filter modes
};

declare const PrimeIcons: {
  readonly SEARCH: string;
  readonly CHECK: string;
  readonly TIMES: string;
  // ... 200+ icon constants
};

API Services

Configuration and Plugin System

PrimeVue configuration plugin providing theming, localization, and global settings management.

declare const PrimeVue: {
  install(app: any, options?: PrimeVueConfiguration): void;
};

interface PrimeVueConfiguration {
  theme?: any;
  ripple?: boolean;
  locale?: PrimeVueLocaleOptions;
  unstyled?: boolean;
  pt?: any;
  // ... more configuration options
}

declare function usePrimeVue(): {
  config: PrimeVueConfiguration;
};

Configuration

Base Component Infrastructure

Foundation classes for building PrimeVue components with consistent behavior, styling, and theming support.

declare const BaseComponent: DefineComponent<{
  pt?: Object;
  ptOptions?: Object;
  unstyled?: Boolean;
  dt?: Object;
}>;

declare const BaseDirective: {
  extend(name: string, options?: any): any;
};

Base Classes

Vue Composables

Utility composables for common functionality like ID generation, dynamic styling, and attribute selection.

declare function useId(initialValue?: string): string;

declare function useStyle(css: string, options?: UseStyleOptions): {
  load: (css?: string, props?: any) => void;
  unload: () => void;
  isLoaded: Readonly<Ref<boolean>>;
};

Composables

Utility Functions

Helper classes and utility functions for component development and data manipulation.

declare class ConnectedOverlayScrollHandler {
  constructor(element: any, listener?: () => void);
  bindScrollListener(): void;
  unbindScrollListener(): void;
  destroy(): void;
}

declare function getVNodeProp(vnode: any, prop: string): any;

Utilities

Types

type Booleanish = boolean | 'true' | 'false';
type Numberish = number | string;
type Nullable<T = void> = T | null | undefined;
type PassThrough<T = void> = T | object | undefined;
type DesignToken<T = void> = T | object | undefined;

type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> =
  Options extends Array<infer V>
    ? (e: V, ...args: any[]) => void
    : {} extends Options
      ? (e: string, ...args: any[]) => void
      : UnionToIntersection<{
          [key in Event]: Options[key] extends (...args: infer Args) => any 
            ? (e: key, ...args: Args) => void 
            : (e: key, ...args: any[]) => void;
        }[Event]>;

type DefineComponent<P = {}, S = {}, E = {}, M = {}> = {
  new (): {
    $props: P & PublicProps;
    $slots: S;
    $emit: E;
  } & M;
};