@amirjalili1374/ui-kit 1.10.8 → 1.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +9 -0
  2. package/dist/components/common/AppStepper.vue.d.ts +1 -1
  3. package/dist/components/form/UiField.vue.d.ts +57 -0
  4. package/dist/components/form/UiFieldMessage.vue.d.ts +29 -0
  5. package/dist/components/form/UiFormActions.vue.d.ts +45 -0
  6. package/dist/components/form/types.d.ts +2 -0
  7. package/dist/components/layout/AppCustomizer.vue.d.ts +2 -0
  8. package/dist/components/layout/AppCustomizerControls.vue.d.ts +2 -2
  9. package/dist/components/layout/AppCustomizerPanel.vue.d.ts +13 -4
  10. package/dist/components/layout/AppHeaderMenu.vue.d.ts +12 -1
  11. package/dist/components/permissions/PermissionGuard.vue.d.ts +30 -0
  12. package/dist/components/shared/AppConfirmAction.vue.d.ts +4 -4
  13. package/dist/components/shared/AppFilePreview.vue.d.ts +2 -2
  14. package/dist/components/shared/BaseBreadcrumb.vue.d.ts +2 -1
  15. package/dist/components/shared/BaseIcon.vue.d.ts +3 -0
  16. package/dist/components/shared/ConfirmDialog.vue.d.ts +4 -4
  17. package/dist/components/shared/DownloadButton.vue.d.ts +3 -3
  18. package/dist/components/shared/MoneyInput.vue.d.ts +2 -2
  19. package/dist/components/shared/PdfViewer.vue.d.ts +7 -7
  20. package/dist/components/shared/ShamsiDatePicker.vue.d.ts +2 -2
  21. package/dist/components/shared/data-table-v2/CustomDataTableV2.vue.d.ts +13 -2
  22. package/dist/components/shared/data-table-v2/types.d.ts +4 -0
  23. package/dist/components/state/UiAsyncState.vue.d.ts +33 -0
  24. package/dist/components/state/UiEmptyState.vue.d.ts +34 -0
  25. package/dist/components/state/UiErrorState.vue.d.ts +34 -0
  26. package/dist/components/state/UiLoadingState.vue.d.ts +28 -0
  27. package/dist/components/state/UiPermissionDenied.vue.d.ts +29 -0
  28. package/dist/index.d.ts +23 -2
  29. package/dist/platform/defaults.d.ts +7 -0
  30. package/dist/platform/themes.d.ts +8 -0
  31. package/dist/platform/types/actions.d.ts +23 -0
  32. package/dist/platform/types/async.d.ts +12 -0
  33. package/dist/platform/types/core.d.ts +19 -0
  34. package/dist/platform/types/icons.d.ts +32 -0
  35. package/dist/platform/types/index.d.ts +8 -0
  36. package/dist/platform/types/locale.d.ts +4 -0
  37. package/dist/platform/types/messages.d.ts +41 -0
  38. package/dist/platform/types/permissions.d.ts +12 -0
  39. package/dist/platform/types/themes.d.ts +8 -0
  40. package/dist/platform/types.d.ts +1 -0
  41. package/dist/platform/uiKit.d.ts +33 -0
  42. package/dist/stores/customizer.d.ts +9 -1
  43. package/dist/style.css +1 -1
  44. package/dist/ui-kit.cjs +2 -2
  45. package/dist/ui-kit.es.js +2 -2
  46. package/dist/utils/customizerPreferences.d.ts +4 -0
  47. package/package.json +2 -1
@@ -0,0 +1,34 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ description?: string;
4
+ retryLabel?: string;
5
+ error?: unknown;
6
+ showDetails?: boolean;
7
+ variant?: 'compact' | 'full';
8
+ };
9
+ declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {
10
+ retry: () => void;
11
+ };
12
+ type __VLS_Slots = {} & {
13
+ icon?: (props: typeof __VLS_1) => any;
14
+ } & {
15
+ default?: (props: typeof __VLS_8) => any;
16
+ } & {
17
+ actions?: (props: typeof __VLS_10) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ retry: () => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onRetry?: () => any;
23
+ }>, {
24
+ variant: "compact" | "full";
25
+ showDetails: boolean;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,28 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ description?: string;
4
+ inline?: boolean;
5
+ variant?: 'compact' | 'full';
6
+ progress?: number;
7
+ };
8
+ declare var __VLS_1: {}, __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ icon?: (props: typeof __VLS_1) => any;
11
+ } & {
12
+ default?: (props: typeof __VLS_8) => any;
13
+ };
14
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ description: string;
16
+ title: string;
17
+ variant: "compact" | "full";
18
+ progress: number;
19
+ inline: boolean;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,29 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ description?: string;
4
+ actionLabel?: string;
5
+ variant?: 'compact' | 'full';
6
+ };
7
+ declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {};
8
+ type __VLS_Slots = {} & {
9
+ icon?: (props: typeof __VLS_1) => any;
10
+ } & {
11
+ default?: (props: typeof __VLS_8) => any;
12
+ } & {
13
+ actions?: (props: typeof __VLS_10) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ action: () => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onAction?: () => any;
19
+ }>, {
20
+ variant: "compact" | "full";
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
package/dist/index.d.ts CHANGED
@@ -32,6 +32,16 @@ export { default as AppNotificationCenter } from './components/shared/AppNotific
32
32
  export type { AppNotification } from './components/shared/AppNotificationCenter.vue';
33
33
  export { default as AppStepper } from './components/common/AppStepper.vue';
34
34
  export { default as Loading } from './components/Loading.vue';
35
+ export { default as UiLoadingState } from './components/state/UiLoadingState.vue';
36
+ export { default as UiEmptyState } from './components/state/UiEmptyState.vue';
37
+ export { default as UiErrorState } from './components/state/UiErrorState.vue';
38
+ export { default as UiPermissionDenied } from './components/state/UiPermissionDenied.vue';
39
+ export { default as UiAsyncState } from './components/state/UiAsyncState.vue';
40
+ export { default as PermissionGuard } from './components/permissions/PermissionGuard.vue';
41
+ export { default as UiField } from './components/form/UiField.vue';
42
+ export { default as UiFieldMessage } from './components/form/UiFieldMessage.vue';
43
+ export { default as UiFormActions } from './components/form/UiFormActions.vue';
44
+ export type { UiFieldMessageVariant, UiFormActionsAlign } from './components/form/types';
35
45
  export { default as AppSidebar } from './components/layout/AppSidebar.vue';
36
46
  export { default as AppHeader } from './components/layout/AppHeader.vue';
37
47
  export { default as AppHeaderMenu } from './components/layout/AppHeaderMenu.vue';
@@ -42,7 +52,7 @@ export type { CustomizerThemeOption } from './components/layout/AppCustomizerPan
42
52
  export { default as AppCustomizerSubmit } from './components/layout/AppCustomizerSubmit.vue';
43
53
  export type { TextFieldHeight, TextFieldVariant } from './components/layout/AppCustomizerControls.vue';
44
54
  export { parseCustomizerPreferences, serializeCustomizerPreferences, customizerPreferenceDefaults } from './utils/customizerPreferences';
45
- export type { ContentWidth, CustomizerPreferences, MenuOrientation, SurfaceStyle } from './utils/customizerPreferences';
55
+ export type { AppDirection, AppLanguage, ContentWidth, CustomizerPreferences, MenuOrientation, SurfaceStyle } from './utils/customizerPreferences';
46
56
  export { default as AppLayout } from './components/layout/AppLayout.vue';
47
57
  export type { MenuItem, HeaderAction } from './types/components/layout/menu';
48
58
  export { useDataTable } from './composables/useDataTable';
@@ -71,12 +81,23 @@ export { useCustomizerStore } from './stores/customizer';
71
81
  export * from './types/componentTypes/DataTableType';
72
82
  export * from './types/componentTypes/DataTableTypes';
73
83
  export * from './constants/enums/booleanEnum';
84
+ export { createUiKit, useUiKit, useUiKitConfig, useUiKitLocale, useUiKitMessages, useUiKitIcons, usePermission } from './platform/uiKit';
85
+ export { defaultThemes, mergeThemes, createUiKitThemes } from './platform/themes';
86
+ export type { UiKitThemeName } from './platform/themes';
87
+ export type * from './platform/types';
88
+ export type { UiAsyncState as UiAsyncStateModel } from './platform/types';
89
+ export { isUiAsyncLoading, isUiAsyncError, hasUiAsyncData } from './platform/types';
90
+ export type { UiKitContext } from './platform/uiKit';
74
91
  import type { App } from 'vue';
92
+ import type { UiKitConfig } from './platform/types';
75
93
  /**
76
94
  * Install the UI Kit library in a Vue application
77
95
  * @param app - Vue application instance
78
96
  */
79
- export declare function install(app: App): void;
97
+ export declare function install(app: App, options?: UiKitConfig): void;
98
+ export declare const UiKitPlugin: {
99
+ install: typeof install;
100
+ };
80
101
  declare const _default: {
81
102
  install: typeof install;
82
103
  };
@@ -0,0 +1,7 @@
1
+ import type { UiMessages, UiSemanticIcons } from './types';
2
+ export declare const defaultMessages: Record<'fa-IR' | 'en-US', UiMessages>;
3
+ export declare const defaultIcons: UiSemanticIcons;
4
+ export declare const defaultThemes: {
5
+ modern: import("../types/themeTypes/ThemeType").ThemeTypes;
6
+ 'modern-dark': import("../types/themeTypes/ThemeType").ThemeTypes;
7
+ };
@@ -0,0 +1,8 @@
1
+ import type { UiThemeRegistry } from './types';
2
+ import { defaultThemes } from './defaults';
3
+ export { defaultThemes };
4
+ export type UiKitThemeName = keyof typeof defaultThemes;
5
+ export declare function mergeThemes<T extends Record<string, unknown>>(base: T, overrides: Partial<T>): T;
6
+ export declare function createUiKitThemes(options?: {
7
+ overrides?: UiThemeRegistry;
8
+ }): UiThemeRegistry;
@@ -0,0 +1,23 @@
1
+ import type { UiIconSource } from './icons';
2
+ export type UiComponentSize = 'x-small' | 'small' | 'default' | 'large' | 'x-large';
3
+ export type UiDensity = 'default' | 'comfortable' | 'compact';
4
+ export interface UiActionDefinition<T = unknown> {
5
+ id: string;
6
+ label: string;
7
+ icon?: UiIconSource;
8
+ disabled?: boolean;
9
+ handler?: (item: T) => void;
10
+ }
11
+ /** @deprecated Prefer the table-specific pagination contract for DataTable features. */
12
+ export interface UiPaginationState {
13
+ page: number;
14
+ itemsPerPage: number;
15
+ total?: number;
16
+ }
17
+ export interface UiSortState {
18
+ key: string;
19
+ order: 'asc' | 'desc';
20
+ }
21
+ export interface UiFilterState {
22
+ [key: string]: unknown;
23
+ }
@@ -0,0 +1,12 @@
1
+ export type UiAsyncStatus = 'idle' | 'loading' | 'empty' | 'error' | 'success' | 'permission-denied';
2
+ export interface UiAsyncState<T = unknown, E = unknown> {
3
+ status: UiAsyncStatus;
4
+ data?: T;
5
+ error?: E;
6
+ message?: string;
7
+ }
8
+ export declare const isUiAsyncLoading: (state: UiAsyncState) => boolean;
9
+ export declare const isUiAsyncError: (state: UiAsyncState) => boolean;
10
+ export declare const hasUiAsyncData: <T>(state: UiAsyncState<T>) => state is UiAsyncState<T> & {
11
+ data: T;
12
+ };
@@ -0,0 +1,19 @@
1
+ import type { UiDirection, UiLocale } from './locale';
2
+ import type { UiMessageCatalog } from './messages';
3
+ import type { UiSemanticIcons } from './icons';
4
+ import type { UiPermissionEvaluator, UiPermissionOptions } from './permissions';
5
+ import type { UiThemeOptions } from './themes';
6
+ export interface UiKitOptions {
7
+ locale: UiLocale;
8
+ direction: UiDirection;
9
+ theme: UiThemeOptions;
10
+ messages: UiMessageCatalog;
11
+ icons: Partial<UiSemanticIcons>;
12
+ permissions: UiPermissionOptions;
13
+ }
14
+ export type UiKitConfig = Partial<Omit<UiKitOptions, 'theme' | 'messages' | 'icons' | 'permissions'>> & {
15
+ theme?: UiThemeOptions;
16
+ messages?: UiMessageCatalog;
17
+ icons?: Partial<UiSemanticIcons>;
18
+ permissions?: UiPermissionOptions | UiPermissionEvaluator;
19
+ };
@@ -0,0 +1,32 @@
1
+ import type { Component } from 'vue';
2
+ export type UiIconSource = string | Component;
3
+ export interface UiSemanticIcons {
4
+ close: UiIconSource;
5
+ confirm: UiIconSource;
6
+ cancel: UiIconSource;
7
+ loading: UiIconSource;
8
+ empty: UiIconSource;
9
+ error: UiIconSource;
10
+ permissionDenied: UiIconSource;
11
+ retry: UiIconSource;
12
+ menu: UiIconSource;
13
+ theme: UiIconSource;
14
+ notifications: UiIconSource;
15
+ profile: UiIconSource;
16
+ chevronDown: UiIconSource;
17
+ search: UiIconSource;
18
+ clear: UiIconSource;
19
+ delete: UiIconSource;
20
+ edit: UiIconSource;
21
+ create: UiIconSource;
22
+ download: UiIconSource;
23
+ upload: UiIconSource;
24
+ print: UiIconSource;
25
+ previous: UiIconSource;
26
+ next: UiIconSource;
27
+ warning: UiIconSource;
28
+ success: UiIconSource;
29
+ expand: UiIconSource;
30
+ collapse: UiIconSource;
31
+ }
32
+ export type UiSemanticIconName = keyof UiSemanticIcons;
@@ -0,0 +1,8 @@
1
+ export type * from './core';
2
+ export type * from './locale';
3
+ export type * from './messages';
4
+ export type * from './icons';
5
+ export type * from './permissions';
6
+ export * from './async';
7
+ export type * from './themes';
8
+ export type * from './actions';
@@ -0,0 +1,4 @@
1
+ export type UiLocale = 'fa-IR' | 'en-US' | (string & {});
2
+ export type UiDirection = 'rtl' | 'ltr' | 'auto';
3
+ export type ResolvedUiDirection = Exclude<UiDirection, 'auto'>;
4
+ export type UiLocalizedText = string | Partial<Record<UiLocale, string>>;
@@ -0,0 +1,41 @@
1
+ import type { UiLocale } from './locale';
2
+ export interface UiMessages {
3
+ close: string;
4
+ loading: string;
5
+ emptyTitle: string;
6
+ emptyDescription: string;
7
+ errorTitle: string;
8
+ errorDescription: string;
9
+ retry: string;
10
+ permissionDeniedTitle: string;
11
+ permissionDeniedDescription: string;
12
+ confirm: string;
13
+ cancel: string;
14
+ noData: string;
15
+ empty: string;
16
+ error: string;
17
+ permissionDenied: string;
18
+ search: string;
19
+ clear: string;
20
+ select: string;
21
+ delete: string;
22
+ deleteConfirmation: string;
23
+ download: string;
24
+ upload: string;
25
+ print: string;
26
+ previous: string;
27
+ next: string;
28
+ create: string;
29
+ edit: string;
30
+ save: string;
31
+ actions: string;
32
+ navigationMenu: string;
33
+ compactSidebar: string;
34
+ themeCustomizer: string;
35
+ notifications: string;
36
+ profileSettings: string;
37
+ }
38
+ export type UiMessageKey = keyof UiMessages;
39
+ export type UiMessageOverrides = Partial<UiMessages>;
40
+ export type UiMessageCatalog = Partial<Record<UiLocale, UiMessageOverrides>>;
41
+ export type UiMessageParams = Record<string, string | number | boolean>;
@@ -0,0 +1,12 @@
1
+ export type UiPermissionEvaluator = (permission: string) => boolean;
2
+ export type UiMissingPermissionEvaluatorPolicy = 'allow' | 'deny';
3
+ export interface UiPermissionOptions {
4
+ evaluator?: UiPermissionEvaluator;
5
+ missingEvaluator?: UiMissingPermissionEvaluatorPolicy;
6
+ }
7
+ export interface UiPermissionRequirement {
8
+ permission?: string;
9
+ any?: string[];
10
+ all?: string[];
11
+ }
12
+ export type UiPermissionInput = string | string[] | UiPermissionRequirement;
@@ -0,0 +1,8 @@
1
+ import type { ThemeDefinition } from 'vuetify';
2
+ export interface UiThemeRegistry {
3
+ [name: string]: ThemeDefinition;
4
+ }
5
+ export interface UiThemeOptions {
6
+ defaultTheme?: string;
7
+ themes?: UiThemeRegistry;
8
+ }
@@ -0,0 +1 @@
1
+ export * from './types/index';
@@ -0,0 +1,33 @@
1
+ import { type App, type ComputedRef, type Plugin } from 'vue';
2
+ import type { ResolvedUiDirection, UiKitConfig, UiKitOptions, UiMessageKey, UiMessageParams, UiPermissionInput, UiSemanticIconName } from './types';
3
+ export interface UiKitContext {
4
+ config: Readonly<UiKitOptions>;
5
+ locale: ComputedRef<string>;
6
+ direction: ComputedRef<ResolvedUiDirection>;
7
+ t: (key: UiMessageKey, params?: UiMessageParams) => string;
8
+ icon: (name: UiSemanticIconName) => UiKitOptions['icons'][UiSemanticIconName];
9
+ can: (requirement?: UiPermissionInput) => boolean;
10
+ update: (options: UiKitConfig) => void;
11
+ reset: () => void;
12
+ }
13
+ export declare function createUiKit(options?: UiKitConfig): UiKitContext;
14
+ export declare function provideUiKit(app: App, options?: UiKitConfig): UiKitContext;
15
+ export declare function useUiKit(): UiKitContext;
16
+ export declare function useUiKitConfig(): Readonly<UiKitOptions>;
17
+ export declare function useUiKitLocale(): {
18
+ locale: ComputedRef<string>;
19
+ direction: ComputedRef<ResolvedUiDirection>;
20
+ };
21
+ export declare function useUiKitMessages(): {
22
+ t: (key: UiMessageKey, params?: UiMessageParams) => string;
23
+ locale: ComputedRef<string>;
24
+ };
25
+ export declare function useUiKitIcons(): {
26
+ resolveIcon: (name: UiSemanticIconName) => UiKitOptions["icons"][UiSemanticIconName];
27
+ };
28
+ export declare function usePermission(): {
29
+ can: (requirement?: UiPermissionInput) => boolean;
30
+ any: (permissions: string[]) => boolean;
31
+ all: (permissions: string[]) => boolean;
32
+ };
33
+ export declare const UiKitPlugin: Plugin<[UiKitConfig?]>;
@@ -1,4 +1,4 @@
1
- import { type ContentWidth, type CustomizerPreferences, type MenuOrientation, type SurfaceStyle } from '../utils/customizerPreferences';
1
+ import { type AppDirection, type AppLanguage, type ContentWidth, type CustomizerPreferences, type MenuOrientation, type SurfaceStyle } from '../utils/customizerPreferences';
2
2
  export declare const useCustomizerStore: import("pinia").StoreDefinition<"customizer", {
3
3
  Sidebar_drawer: boolean;
4
4
  Customizer_drawer: boolean;
@@ -16,6 +16,8 @@ export declare const useCustomizerStore: import("pinia").StoreDefinition<"custom
16
16
  loading: boolean;
17
17
  themeMode: string;
18
18
  menuOrientation: MenuOrientation;
19
+ language: AppLanguage;
20
+ direction: AppDirection;
19
21
  }, {
20
22
  getActTheme: (state: {
21
23
  Sidebar_drawer: boolean;
@@ -34,6 +36,8 @@ export declare const useCustomizerStore: import("pinia").StoreDefinition<"custom
34
36
  loading: boolean;
35
37
  themeMode: string;
36
38
  menuOrientation: MenuOrientation;
39
+ language: AppLanguage;
40
+ direction: AppDirection;
37
41
  } & import("pinia").PiniaCustomStateProperties<{
38
42
  Sidebar_drawer: boolean;
39
43
  Customizer_drawer: boolean;
@@ -51,6 +55,8 @@ export declare const useCustomizerStore: import("pinia").StoreDefinition<"custom
51
55
  loading: boolean;
52
56
  themeMode: string;
53
57
  menuOrientation: MenuOrientation;
58
+ language: AppLanguage;
59
+ direction: AppDirection;
54
60
  }>) => string;
55
61
  }, {
56
62
  SET_SIDEBAR_DRAWER(payload?: boolean): void;
@@ -70,4 +76,6 @@ export declare const useCustomizerStore: import("pinia").StoreDefinition<"custom
70
76
  SET_LAYOUT_TYPE(payload: string): void;
71
77
  SET_THEME_MODE(payload: string): void;
72
78
  SET_MENU_ORIENTATION(payload: string): void;
79
+ SET_LANGUAGE(payload: string): void;
80
+ SET_DIRECTION(payload: string): void;
73
81
  }>;