@amirjalili1374/ui-kit 1.10.9 → 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.
- package/README.md +9 -0
- package/dist/components/common/AppStepper.vue.d.ts +1 -1
- package/dist/components/form/UiField.vue.d.ts +57 -0
- package/dist/components/form/UiFieldMessage.vue.d.ts +29 -0
- package/dist/components/form/UiFormActions.vue.d.ts +45 -0
- package/dist/components/form/types.d.ts +2 -0
- package/dist/components/layout/AppCustomizer.vue.d.ts +2 -2
- package/dist/components/layout/AppCustomizerControls.vue.d.ts +2 -2
- package/dist/components/layout/AppCustomizerPanel.vue.d.ts +5 -5
- package/dist/components/layout/AppHeaderMenu.vue.d.ts +1 -1
- package/dist/components/permissions/PermissionGuard.vue.d.ts +30 -0
- package/dist/components/shared/AppConfirmAction.vue.d.ts +4 -4
- package/dist/components/shared/AppFilePreview.vue.d.ts +2 -2
- package/dist/components/shared/BaseBreadcrumb.vue.d.ts +2 -1
- package/dist/components/shared/BaseIcon.vue.d.ts +3 -0
- package/dist/components/shared/ConfirmDialog.vue.d.ts +4 -4
- package/dist/components/shared/DownloadButton.vue.d.ts +3 -3
- package/dist/components/shared/MoneyInput.vue.d.ts +2 -2
- package/dist/components/shared/PdfViewer.vue.d.ts +7 -7
- package/dist/components/shared/ShamsiDatePicker.vue.d.ts +2 -2
- package/dist/components/state/UiAsyncState.vue.d.ts +33 -0
- package/dist/components/state/UiEmptyState.vue.d.ts +34 -0
- package/dist/components/state/UiErrorState.vue.d.ts +34 -0
- package/dist/components/state/UiLoadingState.vue.d.ts +28 -0
- package/dist/components/state/UiPermissionDenied.vue.d.ts +29 -0
- package/dist/index.d.ts +22 -1
- package/dist/platform/defaults.d.ts +7 -0
- package/dist/platform/themes.d.ts +8 -0
- package/dist/platform/types/actions.d.ts +23 -0
- package/dist/platform/types/async.d.ts +12 -0
- package/dist/platform/types/core.d.ts +19 -0
- package/dist/platform/types/icons.d.ts +32 -0
- package/dist/platform/types/index.d.ts +8 -0
- package/dist/platform/types/locale.d.ts +4 -0
- package/dist/platform/types/messages.d.ts +41 -0
- package/dist/platform/types/permissions.d.ts +12 -0
- package/dist/platform/types/themes.d.ts +8 -0
- package/dist/platform/types.d.ts +1 -0
- package/dist/platform/uiKit.d.ts +33 -0
- package/dist/style.css +1 -1
- package/dist/ui-kit.cjs +2 -2
- package/dist/ui-kit.es.js +2 -2
- package/package.json +1 -1
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';
|
|
@@ -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,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 @@
|
|
|
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?]>;
|