@robot-admin/naive-ui-components 0.22.1 → 0.23.0
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/CHANGELOG.md +10 -0
- package/README.md +7 -5
- package/README_EN.md +7 -5
- package/dist/C_ActionBar.d.cts +2 -1
- package/dist/C_ActionBar.d.ts +2 -1
- package/dist/C_AntV2.cjs +3 -3
- package/dist/C_AntV2.js +3 -3
- package/dist/C_BatchResult.cjs +1 -0
- package/dist/C_BatchResult.css +32 -0
- package/dist/C_BatchResult.d.cts +2 -0
- package/dist/C_BatchResult.d.ts +2 -0
- package/dist/C_BatchResult.js +1 -0
- package/dist/C_BatchResult2.cjs +1 -0
- package/dist/C_BatchResult2.js +1 -0
- package/dist/C_Breadcrumb.d.cts +2 -2
- package/dist/C_Breadcrumb.d.ts +1 -1
- package/dist/C_Cascade.d.cts +1 -1
- package/dist/C_Cascade.d.ts +1 -1
- package/dist/C_Chat.d.cts +1 -1
- package/dist/C_Chat.d.ts +1 -1
- package/dist/C_City.d.cts +1 -1
- package/dist/C_City.d.ts +1 -1
- package/dist/C_Code.d.cts +1 -1
- package/dist/C_Code.d.ts +1 -1
- package/dist/C_ContextMenu.d.cts +1 -1
- package/dist/C_ContextMenu.d.ts +1 -1
- package/dist/C_DataPicker.cjs +1 -0
- package/dist/C_DataPicker.css +54 -0
- package/dist/C_DataPicker.d.cts +2 -0
- package/dist/C_DataPicker.d.ts +5 -0
- package/dist/C_DataPicker.js +1 -0
- package/dist/C_DataPicker2.cjs +1 -0
- package/dist/C_DataPicker2.js +1 -0
- package/dist/C_Date.d.cts +1 -1
- package/dist/C_Date.d.ts +1 -1
- package/dist/C_Density.cjs +1 -0
- package/dist/C_Density.css +1 -0
- package/dist/C_Density.d.cts +3 -0
- package/dist/C_Density.d.ts +3 -0
- package/dist/C_Density.js +1 -0
- package/dist/C_Density2.cjs +1 -0
- package/dist/C_Density2.js +1 -0
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_ErrorSummary.cjs +1 -0
- package/dist/C_ErrorSummary.css +29 -0
- package/dist/C_ErrorSummary.d.cts +3 -0
- package/dist/C_ErrorSummary.d.ts +3 -0
- package/dist/C_ErrorSummary.js +1 -0
- package/dist/C_ErrorSummary2.cjs +1 -0
- package/dist/C_ErrorSummary2.js +1 -0
- package/dist/C_Form.base.css +150 -148
- package/dist/C_Form.css +151 -253
- package/dist/C_Form.d.cts +1 -1
- package/dist/C_Form.d.ts +19 -2
- package/dist/C_FormModal.css +1 -2
- package/dist/C_FormModal.d.cts +1 -1
- package/dist/C_FormModal.d.ts +17 -2
- package/dist/C_FormSearch.cjs +1 -1
- package/dist/C_FormSearch.css +124 -52
- package/dist/C_FormSearch.d.cts +3 -3
- package/dist/C_FormSearch.d.ts +5 -4
- package/dist/C_FormSearch.js +1 -1
- package/dist/C_FormulaEditor.d.cts +1 -1
- package/dist/C_FormulaEditor.d.ts +1 -1
- package/dist/C_Guide.d.cts +1 -1
- package/dist/C_Guide.d.ts +1 -1
- package/dist/C_Icon.d.cts +1 -1
- package/dist/C_Icon.d.ts +1 -1
- package/dist/C_Language.d.cts +1 -1
- package/dist/C_Language.d.ts +1 -1
- package/dist/C_Loading.d.cts +1 -1
- package/dist/C_Loading.d.ts +1 -1
- package/dist/C_Login.d.cts +1 -1
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Markdown.d.cts +1 -1
- package/dist/C_Markdown.d.ts +1 -1
- package/dist/C_Menu.d.cts +2 -2
- package/dist/C_Menu.d.ts +1 -1
- package/dist/C_OrgChart.d.cts +1 -1
- package/dist/C_OrgChart.d.ts +1 -1
- package/dist/C_Progress.d.cts +1 -1
- package/dist/C_Progress.d.ts +1 -1
- package/dist/C_SectionNav.cjs +1 -0
- package/dist/C_SectionNav.css +46 -0
- package/dist/C_SectionNav.d.cts +2 -0
- package/dist/C_SectionNav.d.ts +2 -0
- package/dist/C_SectionNav.js +1 -0
- package/dist/C_SectionNav2.cjs +1 -0
- package/dist/C_SectionNav2.js +1 -0
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Table.base.css +258 -256
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +109 -1283
- package/dist/C_Table.d.cts +2 -1
- package/dist/C_Table.d.ts +9 -8
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +3 -0
- package/dist/C_Table2.js +3 -0
- package/dist/C_Tabs.cjs +1 -1
- package/dist/C_Tabs.d.cts +1 -1
- package/dist/C_Tabs.d.ts +1 -1
- package/dist/C_Tabs.js +1 -1
- package/dist/C_TagsView.d.cts +1 -1
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.d.ts +1 -1
- package/dist/C_Transfer.d.cts +1 -1
- package/dist/C_Transfer.d.ts +1 -1
- package/dist/C_Tree.d.cts +1 -1
- package/dist/C_Tree.d.ts +9 -8
- package/dist/C_Upload.d.cts +1 -1
- package/dist/C_Upload.d.ts +1 -1
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.js +1 -1
- package/dist/Steps.cjs +1 -1
- package/dist/Steps.js +1 -1
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/batchPatch.cjs +1 -0
- package/dist/batchPatch.d.cts +26 -0
- package/dist/batchPatch.d.ts +26 -0
- package/dist/batchPatch.js +1 -0
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +4 -1
- package/dist/config.d.ts +6 -2
- package/dist/config.js +1 -1
- package/dist/config2.d.ts +1 -1
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants2.d.cts +402 -173
- package/dist/constants2.d.ts +402 -173
- package/dist/constants3.d.cts +4 -4
- package/dist/constants3.d.ts +4 -4
- package/dist/constants4.d.cts +173 -402
- package/dist/constants4.d.ts +173 -402
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/contracts.d.ts +24 -0
- package/dist/data.cjs +1 -1
- package/dist/data.d.cts +5 -108
- package/dist/data.d.ts +5 -108
- package/dist/data.js +1 -1
- package/dist/data2.cjs +1 -1
- package/dist/data2.d.cts +108 -0
- package/dist/data2.d.ts +108 -0
- package/dist/data2.js +1 -1
- package/dist/data3.cjs +1 -0
- package/dist/data3.js +1 -0
- package/dist/dateRange.d.cts +108 -13
- package/dist/dateRange.d.ts +110 -14
- package/dist/density.d.ts +15 -0
- package/dist/dictionary.cjs +1 -0
- package/dist/dictionary.d.cts +38 -0
- package/dist/dictionary.d.ts +38 -0
- package/dist/dictionary.js +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +63 -52
- package/dist/index.d.ts +71 -57
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +5 -5
- package/dist/index.vue.d.ts +5 -5
- package/dist/index10.vue.d.cts +37 -80
- package/dist/index10.vue.d.ts +77 -53
- package/dist/index11.vue.d.cts +77 -53
- package/dist/index11.vue.d.ts +1117 -45
- package/dist/index12.vue.d.cts +1117 -45
- package/dist/index12.vue.d.ts +17 -128
- package/dist/index13.vue.d.cts +17 -128
- package/dist/index13.vue.d.ts +57 -53
- package/dist/index14.vue.d.cts +57 -53
- package/dist/index14.vue.d.ts +16 -25
- package/dist/index15.vue.d.cts +16 -25
- package/dist/index15.vue.d.ts +52 -12
- package/dist/index16.vue.d.cts +52 -12
- package/dist/index16.vue.d.ts +13 -129
- package/dist/index17.vue.d.cts +13 -129
- package/dist/index17.vue.d.ts +123 -74
- package/dist/index18.vue.d.cts +123 -74
- package/dist/index18.vue.d.ts +48 -71
- package/dist/index19.vue.d.cts +40 -91
- package/dist/index19.vue.d.ts +36 -96
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +38 -47
- package/dist/index20.vue.d.ts +13 -48
- package/dist/index21.vue.d.cts +12 -96
- package/dist/index21.vue.d.ts +25 -95
- package/dist/index22.vue.d.cts +20 -32
- package/dist/index22.vue.d.ts +75 -37
- package/dist/index23.vue.d.cts +77 -13
- package/dist/index23.vue.d.ts +71 -13
- package/dist/index24.vue.d.cts +1 -1
- package/dist/index25.vue.d.cts +116 -90
- package/dist/index25.vue.d.ts +116 -90
- package/dist/index26.vue.d.cts +94 -59
- package/dist/index26.vue.d.ts +94 -59
- package/dist/index27.vue.d.cts +75 -0
- package/dist/index27.vue.d.ts +75 -0
- package/dist/index28.vue.d.cts +103 -0
- package/dist/index28.vue.d.ts +103 -0
- package/dist/index29.vue.d.cts +105 -0
- package/dist/index29.vue.d.ts +105 -0
- package/dist/index3.vue.d.cts +5 -5
- package/dist/index3.vue.d.ts +5 -5
- package/dist/index30.vue.d.cts +28 -0
- package/dist/index30.vue.d.ts +28 -0
- package/dist/index4.vue.d.cts +19 -128
- package/dist/index4.vue.d.ts +17 -34
- package/dist/index5.vue.d.cts +127 -35
- package/dist/index5.vue.d.ts +30 -19
- package/dist/index6.vue.d.cts +30 -19
- package/dist/index6.vue.d.ts +22 -118
- package/dist/index7.vue.d.cts +22 -118
- package/dist/index7.vue.d.ts +112 -18
- package/dist/index8.vue.d.cts +112 -18
- package/dist/index8.vue.d.ts +24 -35
- package/dist/index9.vue.d.cts +24 -35
- package/dist/index9.vue.d.ts +37 -80
- package/dist/mapUtils.d.cts +4 -4
- package/dist/mapUtils.d.ts +4 -4
- package/dist/numberCodec.cjs +1 -0
- package/dist/numberCodec.d.cts +25 -0
- package/dist/numberCodec.d.ts +25 -0
- package/dist/numberCodec.js +1 -0
- package/dist/observer.cjs +1 -0
- package/dist/observer.js +1 -0
- package/dist/presets.d.cts +3 -66
- package/dist/presets.d.ts +3 -66
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.cts +1 -1
- package/dist/resolver.d.ts +1 -1
- package/dist/resolver.js +1 -1
- package/dist/serializeSearch.cjs +1 -0
- package/dist/serializeSearch.js +1 -0
- package/dist/style.css +547 -308
- package/dist/types.d.cts +60 -103
- package/dist/types.d.ts +62 -52
- package/dist/types2.d.cts +104 -51
- package/dist/types2.d.ts +56 -0
- package/dist/types3.d.cts +56 -0
- package/dist/useCollapsePanel.d.cts +6 -6
- package/dist/useCollapsePanel.d.ts +6 -6
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +13 -13
- package/dist/useCropperCore.d.ts +13 -13
- package/dist/useDataResource.cjs +1 -0
- package/dist/useDataResource.js +1 -0
- package/dist/useDictionary.cjs +1 -0
- package/dist/useDictionary.js +1 -0
- package/dist/useDynamicFormState.d.cts +960 -10
- package/dist/useDynamicFormState.d.ts +951 -11
- package/dist/useEdgeInteraction.d.cts +3 -3
- package/dist/useEdgeInteraction.d.ts +3 -3
- package/dist/useFormArray.cjs +1 -0
- package/dist/useFormArray.d.cts +69 -0
- package/dist/useFormArray.d.ts +69 -0
- package/dist/useFormArray.js +1 -0
- package/dist/useFormConfig.d.cts +14 -0
- package/dist/useFormConfig.d.ts +17 -38
- package/dist/useGridWidth.cjs +1 -0
- package/dist/useGridWidth.js +1 -0
- package/dist/useInfiniteScroll.d.cts +3 -3
- package/dist/useInfiniteScroll.d.ts +3 -3
- package/dist/useQRCode.d.cts +5 -5
- package/dist/useQRCode.d.ts +5 -5
- package/dist/useSignatureHistory.d.cts +7 -7
- package/dist/useSignatureHistory.d.ts +7 -7
- package/dist/useSplitResize.d.cts +9 -9
- package/dist/useSplitResize.d.ts +9 -9
- package/dist/useTableGlobalConfig.cjs +1 -0
- package/dist/useTableGlobalConfig.js +1 -0
- package/dist/useTableQuery.cjs +1 -3
- package/dist/useTableQuery.js +1 -3
- package/dist/useWorkflowValidation.d.cts +5 -5
- package/dist/useWorkflowValidation.d.ts +5 -5
- package/dist/validation.cjs +1 -0
- package/dist/validation.d.cts +18 -0
- package/dist/validation.d.ts +18 -0
- package/dist/validation.js +1 -0
- package/dist/verification.d.cts +4 -4
- package/dist/verification.d.ts +5 -5
- package/dist/workflows.cjs +1 -0
- package/dist/workflows.d.cts +2 -0
- package/dist/workflows.d.ts +2 -0
- package/dist/workflows.js +1 -0
- package/docs/components.en.md +13 -1
- package/docs/components.md +13 -1
- package/docs/guides/batch-results.md +47 -0
- package/docs/guides/data-picker.md +65 -0
- package/docs/guides/data-workflows.md +123 -0
- package/docs/guides/form-density.en.md +39 -0
- package/docs/guides/form-density.md +39 -0
- package/docs/guides/search-workflows.md +164 -0
- package/package.json +21 -1
- package/dist/C_FormSearch2.cjs +0 -1
- package/dist/C_FormSearch2.js +0 -1
- package/dist/useTableQuery.d.cts +0 -1957
- package/dist/useTableQuery.d.ts +0 -1946
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/core/contracts.d.ts
|
|
2
|
+
/** UI-independent feedback and locale protocols. No framework runtime is imported here. */
|
|
3
|
+
interface ConfirmOptions {
|
|
4
|
+
title: string;
|
|
5
|
+
content: string;
|
|
6
|
+
positiveText?: string;
|
|
7
|
+
negativeText?: string;
|
|
8
|
+
type?: 'warning' | 'error' | 'info' | 'success';
|
|
9
|
+
}
|
|
10
|
+
interface ComponentFeedback {
|
|
11
|
+
success?: (message: string) => void;
|
|
12
|
+
error?: (message: string, cause?: unknown) => void;
|
|
13
|
+
warning?: (message: string) => void;
|
|
14
|
+
info?: (message: string) => void;
|
|
15
|
+
confirm?: (options: ConfirmOptions) => boolean | Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
type ComponentLocaleName = 'zh-CN' | 'en-US';
|
|
18
|
+
interface ComponentLocale {
|
|
19
|
+
locale?: ComponentLocaleName;
|
|
20
|
+
messages?: Record<string, string>;
|
|
21
|
+
t?: (key: string, params?: Record<string, string | number>) => string;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ConfirmOptions as i, ComponentLocale as n, ComponentLocaleName as r, ComponentFeedback as t };
|
package/dist/data.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./numberCodec.cjs`),t=require(`./validation.cjs`),n=require(`./batchPatch.cjs`),r=require(`./dictionary.cjs`);exports.collectValidationIssues=t.t,exports.createBatchPatch=n.t,exports.createDictionaryLabelResolver=r.t,exports.createNumberCodec=e.t,exports.getDictionaryLabel=r.i,exports.getRetryableKeys=n.n,exports.parseDictionaryValue=r.a;
|
package/dist/data.d.cts
CHANGED
|
@@ -1,108 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
type TabsType = 'line' | 'card' | 'bar' | 'segment';
|
|
7
|
-
type TabsSize = 'small' | 'medium' | 'large';
|
|
8
|
-
type TabsPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
-
type TabsJustifyContent = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
10
|
-
type TabsDisplayDirective = 'if' | 'show' | 'show:lazy';
|
|
11
|
-
type TabsBadgeType = 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
12
|
-
interface TabsItem {
|
|
13
|
-
key: TabsValue;
|
|
14
|
-
label: string;
|
|
15
|
-
icon?: string;
|
|
16
|
-
badge?: string | number;
|
|
17
|
-
badgeType?: TabsBadgeType;
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
closable?: boolean;
|
|
20
|
-
/** 数据驱动的标签渲染;常规场景只传 label/icon/badge。 */
|
|
21
|
-
renderTab?: (item: TabsItem) => VNodeChild;
|
|
22
|
-
/** 数据驱动的内容渲染;复杂页面也可以改用 pane 或 pane-{key} 插槽。 */
|
|
23
|
-
render?: (item: TabsItem) => VNodeChild;
|
|
24
|
-
}
|
|
25
|
-
interface CTabsProps {
|
|
26
|
-
modelValue?: TabsValue | null;
|
|
27
|
-
defaultValue?: TabsValue | null;
|
|
28
|
-
items?: readonly TabsItem[];
|
|
29
|
-
type?: TabsType;
|
|
30
|
-
size?: TabsSize;
|
|
31
|
-
placement?: TabsPlacement;
|
|
32
|
-
justifyContent?: TabsJustifyContent;
|
|
33
|
-
animated?: boolean;
|
|
34
|
-
closable?: boolean;
|
|
35
|
-
addable?: boolean;
|
|
36
|
-
tabsOnly?: boolean;
|
|
37
|
-
displayDirective?: TabsDisplayDirective;
|
|
38
|
-
paneClass?: string;
|
|
39
|
-
paneStyle?: string | CSSProperties;
|
|
40
|
-
beforeChange?: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
41
|
-
}
|
|
42
|
-
interface CTabsEmits {
|
|
43
|
-
(event: 'update:modelValue', value: TabsValue): void;
|
|
44
|
-
(event: 'change', value: TabsValue, item: TabsItem | undefined): void;
|
|
45
|
-
(event: 'close', value: TabsValue): void;
|
|
46
|
-
(event: 'add'): void;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/components/C_Tabs/index.vue.d.ts
|
|
50
|
-
declare var __VLS_19: {
|
|
51
|
-
item: TabsItem;
|
|
52
|
-
active: boolean;
|
|
53
|
-
}, __VLS_37: string, __VLS_38: {
|
|
54
|
-
item: TabsItem;
|
|
55
|
-
active: boolean;
|
|
56
|
-
}, __VLS_45: {
|
|
57
|
-
item: TabsItem;
|
|
58
|
-
active: boolean;
|
|
59
|
-
};
|
|
60
|
-
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof __VLS_38) => any } & {
|
|
61
|
-
tab?: (props: typeof __VLS_19) => any;
|
|
62
|
-
} & {
|
|
63
|
-
pane?: (props: typeof __VLS_45) => any;
|
|
64
|
-
};
|
|
65
|
-
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
|
-
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
-
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
-
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
70
|
-
close: (value: TabsValue) => any;
|
|
71
|
-
add: () => any;
|
|
72
|
-
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
-
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
-
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
75
|
-
onClose?: ((value: TabsValue) => any) | undefined;
|
|
76
|
-
onAdd?: (() => any) | undefined;
|
|
77
|
-
}>, {
|
|
78
|
-
modelValue: TabsValue | null;
|
|
79
|
-
type: TabsType;
|
|
80
|
-
defaultValue: TabsValue | null;
|
|
81
|
-
items: readonly TabsItem[];
|
|
82
|
-
size: TabsSize;
|
|
83
|
-
placement: TabsPlacement;
|
|
84
|
-
justifyContent: TabsJustifyContent;
|
|
85
|
-
animated: boolean;
|
|
86
|
-
closable: boolean;
|
|
87
|
-
addable: boolean;
|
|
88
|
-
tabsOnly: boolean;
|
|
89
|
-
displayDirective: TabsDisplayDirective;
|
|
90
|
-
paneClass: string;
|
|
91
|
-
paneStyle: string | vue.CSSProperties;
|
|
92
|
-
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
93
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
94
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
95
|
-
declare const _default: typeof __VLS_export;
|
|
96
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
97
|
-
new (): {
|
|
98
|
-
$slots: S;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/components/C_Tabs/data.d.ts
|
|
103
|
-
/**
|
|
104
|
-
* 提供轻量的运行时校验并保持调用侧扁平;返回原数组,不复制、不注入隐藏字段。
|
|
105
|
-
*/
|
|
106
|
-
declare function defineTabs<const T extends readonly TabsItem[]>(items: T): T;
|
|
107
|
-
//#endregion
|
|
108
|
-
export { TabsBadgeType as a, TabsJustifyContent as c, TabsType as d, TabsValue as f, CTabsProps as i, TabsPlacement as l, _default as n, TabsDisplayDirective as o, CTabsEmits as r, TabsItem as s, defineTabs as t, TabsSize as u };
|
|
1
|
+
import { a as getRetryableKeys, i as createBatchPatch, n as BatchOperationResult, r as PatchScalar, t as BatchFieldChange } from "./batchPatch.cjs";
|
|
2
|
+
import { a as DictionarySource, c as getDictionaryLabel, i as DictionaryProvider, l as parseDictionaryValue, n as DictionaryOption, o as DictionaryValue, r as DictionaryParseResult, s as createDictionaryLabelResolver, t as DictionaryBinding } from "./dictionary.cjs";
|
|
3
|
+
import { n as ValidationTarget, r as collectValidationIssues, t as ValidationIssue } from "./validation.cjs";
|
|
4
|
+
import { n as ValueCodec, r as createNumberCodec, t as NumberCodecOptions } from "./numberCodec.cjs";
|
|
5
|
+
export { type BatchFieldChange, type BatchOperationResult, type DictionaryBinding, type DictionaryOption, type DictionaryParseResult, type DictionaryProvider, type DictionarySource, type DictionaryValue, type NumberCodecOptions, type PatchScalar, type ValidationIssue, type ValidationTarget, type ValueCodec, collectValidationIssues, createBatchPatch, createDictionaryLabelResolver, createNumberCodec, getDictionaryLabel, getRetryableKeys, parseDictionaryValue };
|
package/dist/data.d.ts
CHANGED
|
@@ -1,108 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
type TabsType = 'line' | 'card' | 'bar' | 'segment';
|
|
7
|
-
type TabsSize = 'small' | 'medium' | 'large';
|
|
8
|
-
type TabsPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
-
type TabsJustifyContent = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
10
|
-
type TabsDisplayDirective = 'if' | 'show' | 'show:lazy';
|
|
11
|
-
type TabsBadgeType = 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
12
|
-
interface TabsItem {
|
|
13
|
-
key: TabsValue;
|
|
14
|
-
label: string;
|
|
15
|
-
icon?: string;
|
|
16
|
-
badge?: string | number;
|
|
17
|
-
badgeType?: TabsBadgeType;
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
closable?: boolean;
|
|
20
|
-
/** 数据驱动的标签渲染;常规场景只传 label/icon/badge。 */
|
|
21
|
-
renderTab?: (item: TabsItem) => VNodeChild;
|
|
22
|
-
/** 数据驱动的内容渲染;复杂页面也可以改用 pane 或 pane-{key} 插槽。 */
|
|
23
|
-
render?: (item: TabsItem) => VNodeChild;
|
|
24
|
-
}
|
|
25
|
-
interface CTabsProps {
|
|
26
|
-
modelValue?: TabsValue | null;
|
|
27
|
-
defaultValue?: TabsValue | null;
|
|
28
|
-
items?: readonly TabsItem[];
|
|
29
|
-
type?: TabsType;
|
|
30
|
-
size?: TabsSize;
|
|
31
|
-
placement?: TabsPlacement;
|
|
32
|
-
justifyContent?: TabsJustifyContent;
|
|
33
|
-
animated?: boolean;
|
|
34
|
-
closable?: boolean;
|
|
35
|
-
addable?: boolean;
|
|
36
|
-
tabsOnly?: boolean;
|
|
37
|
-
displayDirective?: TabsDisplayDirective;
|
|
38
|
-
paneClass?: string;
|
|
39
|
-
paneStyle?: string | CSSProperties;
|
|
40
|
-
beforeChange?: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
41
|
-
}
|
|
42
|
-
interface CTabsEmits {
|
|
43
|
-
(event: 'update:modelValue', value: TabsValue): void;
|
|
44
|
-
(event: 'change', value: TabsValue, item: TabsItem | undefined): void;
|
|
45
|
-
(event: 'close', value: TabsValue): void;
|
|
46
|
-
(event: 'add'): void;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/components/C_Tabs/index.vue.d.ts
|
|
50
|
-
declare var __VLS_19: {
|
|
51
|
-
item: TabsItem;
|
|
52
|
-
active: boolean;
|
|
53
|
-
}, __VLS_37: string, __VLS_38: {
|
|
54
|
-
item: TabsItem;
|
|
55
|
-
active: boolean;
|
|
56
|
-
}, __VLS_45: {
|
|
57
|
-
item: TabsItem;
|
|
58
|
-
active: boolean;
|
|
59
|
-
};
|
|
60
|
-
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof __VLS_38) => any } & {
|
|
61
|
-
tab?: (props: typeof __VLS_19) => any;
|
|
62
|
-
} & {
|
|
63
|
-
pane?: (props: typeof __VLS_45) => any;
|
|
64
|
-
};
|
|
65
|
-
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
|
-
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
-
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
-
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
70
|
-
close: (value: TabsValue) => any;
|
|
71
|
-
add: () => any;
|
|
72
|
-
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
-
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
-
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
75
|
-
onClose?: ((value: TabsValue) => any) | undefined;
|
|
76
|
-
onAdd?: (() => any) | undefined;
|
|
77
|
-
}>, {
|
|
78
|
-
modelValue: TabsValue | null;
|
|
79
|
-
type: TabsType;
|
|
80
|
-
defaultValue: TabsValue | null;
|
|
81
|
-
items: readonly TabsItem[];
|
|
82
|
-
size: TabsSize;
|
|
83
|
-
placement: TabsPlacement;
|
|
84
|
-
justifyContent: TabsJustifyContent;
|
|
85
|
-
animated: boolean;
|
|
86
|
-
closable: boolean;
|
|
87
|
-
addable: boolean;
|
|
88
|
-
tabsOnly: boolean;
|
|
89
|
-
displayDirective: TabsDisplayDirective;
|
|
90
|
-
paneClass: string;
|
|
91
|
-
paneStyle: string | vue.CSSProperties;
|
|
92
|
-
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
93
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
94
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
95
|
-
declare const _default: typeof __VLS_export;
|
|
96
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
97
|
-
new (): {
|
|
98
|
-
$slots: S;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/components/C_Tabs/data.d.ts
|
|
103
|
-
/**
|
|
104
|
-
* 提供轻量的运行时校验并保持调用侧扁平;返回原数组,不复制、不注入隐藏字段。
|
|
105
|
-
*/
|
|
106
|
-
declare function defineTabs<const T extends readonly TabsItem[]>(items: T): T;
|
|
107
|
-
//#endregion
|
|
108
|
-
export { TabsBadgeType as a, TabsJustifyContent as c, TabsType as d, TabsValue as f, CTabsProps as i, TabsPlacement as l, _default as n, TabsDisplayDirective as o, CTabsEmits as r, TabsItem as s, defineTabs as t, TabsSize as u };
|
|
1
|
+
import { a as getRetryableKeys, i as createBatchPatch, n as BatchOperationResult, r as PatchScalar, t as BatchFieldChange } from "./batchPatch.js";
|
|
2
|
+
import { a as DictionarySource, c as getDictionaryLabel, i as DictionaryProvider, l as parseDictionaryValue, n as DictionaryOption, o as DictionaryValue, r as DictionaryParseResult, s as createDictionaryLabelResolver, t as DictionaryBinding } from "./dictionary.js";
|
|
3
|
+
import { n as ValidationTarget, r as collectValidationIssues, t as ValidationIssue } from "./validation.js";
|
|
4
|
+
import { n as ValueCodec, r as createNumberCodec, t as NumberCodecOptions } from "./numberCodec.js";
|
|
5
|
+
export { type BatchFieldChange, type BatchOperationResult, type DictionaryBinding, type DictionaryOption, type DictionaryParseResult, type DictionaryProvider, type DictionarySource, type DictionaryValue, type NumberCodecOptions, type PatchScalar, type ValidationIssue, type ValidationTarget, type ValueCodec, collectValidationIssues, createBatchPatch, createDictionaryLabelResolver, createNumberCodec, getDictionaryLabel, getRetryableKeys, parseDictionaryValue };
|
package/dist/data.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./numberCodec.js";import{t}from"./validation.js";import{n,t as r}from"./batchPatch.js";import{a as i,i as a,t as o}from"./dictionary.js";export{t as collectValidationIssues,r as createBatchPatch,o as createDictionaryLabelResolver,e as createNumberCodec,a as getDictionaryLabel,n as getRetryableKeys,i as parseDictionaryValue};
|
package/dist/data2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`vue`);const t=new Set([`__proto__`,`prototype`,`constructor`]);function n(e){let n=e.replace(/\[([^\]]+)\]/g,`.$1`).split(`.`).map(e=>e.trim().replace(/^['"]|['"]$/g,``)).filter(Boolean);if(n.length===0)throw TypeError(`Data path cannot be empty`);if(n.some(e=>t.has(e)))throw TypeError(`Unsafe data path: ${e}`);return n}function r(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return!0;let r=e;for(let e of n(t)){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:n(t).reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e)}function a(e,t,r){if(Object.prototype.hasOwnProperty.call(e,t)){e[t]=r;return}let i=n(t),a=e;i.forEach((e,t)=>{if(t===i.length-1){a[e]=r;return}let n=a[e];(typeof n!=`object`||!n)&&(a[e]=/^\d+$/.test(i[t+1])?[]:{}),a=a[e]})}function o(e,t){if(Object.prototype.hasOwnProperty.call(e,t)){delete e[t];return}let r=n(t),i=r.pop();if(!i)return;let a=r.reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e);a&&typeof a==`object`&&delete a[i]}function s(t){return(0,e.isProxy)(t)?(0,e.toRaw)(t):t}function c(e,t){let n=s(e);if(typeof n!=`object`||!n)return n;if(t.has(n))return t.get(n);if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp)return new RegExp(n);if(n instanceof ArrayBuffer)return n.slice(0);if(Array.isArray(n)){let e=[];return t.set(n,e),n.forEach(n=>e.push(c(n,t))),e}if(n instanceof Map){let e=new Map;return t.set(n,e),n.forEach((n,r)=>{e.set(c(r,t),c(n,t))}),e}if(n instanceof Set){let e=new Set;return t.set(n,e),n.forEach(n=>e.add(c(n,t))),e}let r=Object.getPrototypeOf(n);if(r!==Object.prototype&&r!==null)return n;let i={};return t.set(n,i),Reflect.ownKeys(n).forEach(e=>{typeof e==`string`&&(i[e]=c(n[e],t))}),i}function l(e){let t=s(e);if(typeof structuredClone==`function`)try{return structuredClone(t)}catch{}return c(t,new WeakMap)}const u=e=>typeof e==`object`&&!!e;function d(e,t){let n=e.additions.length;if(t())return!0;for(;e.additions.length>n;){let[t,n]=e.additions.pop();e.pairs.get(t)?.delete(n)}return!1}function f(e,t,n,r){return n.has(e)&&g(t,n.get(e),r)}function p(e,t,n){if(e.size!==t.size)return!1;let r=new Set,i;for(let[a,o]of e){if(!u(a)){if(!f(a,o,t,n))return!1;continue}if(!r.has(a)&&d(n,()=>f(a,o,t,n))){r.add(a);continue}i??=[...t].filter(e=>u(e[0]));let e=i.find(([e,t])=>e!==a&&!r.has(e)&&d(n,()=>g(a,e,n)&&g(o,t,n)));if(!e)return!1;r.add(e[0])}return!0}function m(e,t,n){if(e.size!==t.size)return!1;let r=new Set,i;for(let a of e){if(!u(a)){if(!t.has(a))return!1;continue}if(!r.has(a)&&t.has(a)){r.add(a);continue}i??=[...t].filter(u);let e=i.find(e=>!r.has(e)&&d(n,()=>g(a,e,n)));if(!e)return!1;r.add(e)}return!0}function h(e,t,n){let r=n.pairs.get(e);if(r?.has(t))return!0;if(r||(r=new WeakSet,n.pairs.set(e,r)),r.add(t),n.additions.push([e,t]),e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.source===t.source&&e.flags===t.flags;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,r)=>g(e,t[r],n));if(e instanceof Map||t instanceof Map)return!(e instanceof Map)||!(t instanceof Map)?!1:p(e,t,n);if(e instanceof Set||t instanceof Set)return!(e instanceof Set)||!(t instanceof Set)?!1:m(e,t,n);let i=Object.keys(e),a=Object.keys(t);return i.length===a.length?i.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&g(e[r],t[r],n)):!1}function g(e,t,n){let r=s(e),i=s(t);return Object.is(r,i)?!0:r===null||i===null||typeof r!=`object`||typeof i!=`object`?!1:h(r,i,n)}function _(e,t){return g(e,t,{pairs:new WeakMap,additions:[]})}function v(e,t){let n=l(t);Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(n,t)||delete e[t]}),Object.assign(e,n)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
package/dist/data2.d.cts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { CSSProperties, VNodeChild } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/C_Tabs/types.d.ts
|
|
5
|
+
type TabsValue = string | number;
|
|
6
|
+
type TabsType = 'line' | 'card' | 'bar' | 'segment';
|
|
7
|
+
type TabsSize = 'small' | 'medium' | 'large';
|
|
8
|
+
type TabsPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
+
type TabsJustifyContent = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
10
|
+
type TabsDisplayDirective = 'if' | 'show' | 'show:lazy';
|
|
11
|
+
type TabsBadgeType = 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
12
|
+
interface TabsItem {
|
|
13
|
+
key: TabsValue;
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
badge?: string | number;
|
|
17
|
+
badgeType?: TabsBadgeType;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
/** 数据驱动的标签渲染;常规场景只传 label/icon/badge。 */
|
|
21
|
+
renderTab?: (item: TabsItem) => VNodeChild;
|
|
22
|
+
/** 数据驱动的内容渲染;复杂页面也可以改用 pane 或 pane-{key} 插槽。 */
|
|
23
|
+
render?: (item: TabsItem) => VNodeChild;
|
|
24
|
+
}
|
|
25
|
+
interface CTabsProps {
|
|
26
|
+
modelValue?: TabsValue | null;
|
|
27
|
+
defaultValue?: TabsValue | null;
|
|
28
|
+
items?: readonly TabsItem[];
|
|
29
|
+
type?: TabsType;
|
|
30
|
+
size?: TabsSize;
|
|
31
|
+
placement?: TabsPlacement;
|
|
32
|
+
justifyContent?: TabsJustifyContent;
|
|
33
|
+
animated?: boolean;
|
|
34
|
+
closable?: boolean;
|
|
35
|
+
addable?: boolean;
|
|
36
|
+
tabsOnly?: boolean;
|
|
37
|
+
displayDirective?: TabsDisplayDirective;
|
|
38
|
+
paneClass?: string;
|
|
39
|
+
paneStyle?: string | CSSProperties;
|
|
40
|
+
beforeChange?: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
interface CTabsEmits {
|
|
43
|
+
(event: 'update:modelValue', value: TabsValue): void;
|
|
44
|
+
(event: 'change', value: TabsValue, item: TabsItem | undefined): void;
|
|
45
|
+
(event: 'close', value: TabsValue): void;
|
|
46
|
+
(event: 'add'): void;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/C_Tabs/index.vue.d.ts
|
|
50
|
+
declare var __VLS_19: {
|
|
51
|
+
item: TabsItem;
|
|
52
|
+
active: boolean;
|
|
53
|
+
}, __VLS_37: string, __VLS_38: {
|
|
54
|
+
item: TabsItem;
|
|
55
|
+
active: boolean;
|
|
56
|
+
}, __VLS_45: {
|
|
57
|
+
item: TabsItem;
|
|
58
|
+
active: boolean;
|
|
59
|
+
};
|
|
60
|
+
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof __VLS_38) => any } & {
|
|
61
|
+
tab?: (props: typeof __VLS_19) => any;
|
|
62
|
+
} & {
|
|
63
|
+
pane?: (props: typeof __VLS_45) => any;
|
|
64
|
+
};
|
|
65
|
+
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
|
+
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
+
close: (value: TabsValue) => any;
|
|
69
|
+
add: () => any;
|
|
70
|
+
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
71
|
+
"update:modelValue": (value: TabsValue) => any;
|
|
72
|
+
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
+
onClose?: ((value: TabsValue) => any) | undefined;
|
|
74
|
+
onAdd?: (() => any) | undefined;
|
|
75
|
+
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
76
|
+
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
77
|
+
}>, {
|
|
78
|
+
type: TabsType;
|
|
79
|
+
size: TabsSize;
|
|
80
|
+
defaultValue: TabsValue | null;
|
|
81
|
+
items: readonly TabsItem[];
|
|
82
|
+
modelValue: TabsValue | null;
|
|
83
|
+
placement: TabsPlacement;
|
|
84
|
+
displayDirective: TabsDisplayDirective;
|
|
85
|
+
animated: boolean;
|
|
86
|
+
addable: boolean;
|
|
87
|
+
closable: boolean;
|
|
88
|
+
justifyContent: TabsJustifyContent;
|
|
89
|
+
tabsOnly: boolean;
|
|
90
|
+
paneClass: string;
|
|
91
|
+
paneStyle: string | vue.CSSProperties;
|
|
92
|
+
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
93
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
94
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
95
|
+
declare const _default: typeof __VLS_export;
|
|
96
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
97
|
+
new (): {
|
|
98
|
+
$slots: S;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/components/C_Tabs/data.d.ts
|
|
103
|
+
/**
|
|
104
|
+
* 提供轻量的运行时校验并保持调用侧扁平;返回原数组,不复制、不注入隐藏字段。
|
|
105
|
+
*/
|
|
106
|
+
declare function defineTabs<const T extends readonly TabsItem[]>(items: T): T;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { TabsBadgeType as a, TabsJustifyContent as c, TabsType as d, TabsValue as f, CTabsProps as i, TabsPlacement as l, _default as n, TabsDisplayDirective as o, CTabsEmits as r, TabsItem as s, defineTabs as t, TabsSize as u };
|
package/dist/data2.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { CSSProperties, VNodeChild } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/C_Tabs/types.d.ts
|
|
5
|
+
type TabsValue = string | number;
|
|
6
|
+
type TabsType = 'line' | 'card' | 'bar' | 'segment';
|
|
7
|
+
type TabsSize = 'small' | 'medium' | 'large';
|
|
8
|
+
type TabsPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
+
type TabsJustifyContent = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
10
|
+
type TabsDisplayDirective = 'if' | 'show' | 'show:lazy';
|
|
11
|
+
type TabsBadgeType = 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
12
|
+
interface TabsItem {
|
|
13
|
+
key: TabsValue;
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
badge?: string | number;
|
|
17
|
+
badgeType?: TabsBadgeType;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
/** 数据驱动的标签渲染;常规场景只传 label/icon/badge。 */
|
|
21
|
+
renderTab?: (item: TabsItem) => VNodeChild;
|
|
22
|
+
/** 数据驱动的内容渲染;复杂页面也可以改用 pane 或 pane-{key} 插槽。 */
|
|
23
|
+
render?: (item: TabsItem) => VNodeChild;
|
|
24
|
+
}
|
|
25
|
+
interface CTabsProps {
|
|
26
|
+
modelValue?: TabsValue | null;
|
|
27
|
+
defaultValue?: TabsValue | null;
|
|
28
|
+
items?: readonly TabsItem[];
|
|
29
|
+
type?: TabsType;
|
|
30
|
+
size?: TabsSize;
|
|
31
|
+
placement?: TabsPlacement;
|
|
32
|
+
justifyContent?: TabsJustifyContent;
|
|
33
|
+
animated?: boolean;
|
|
34
|
+
closable?: boolean;
|
|
35
|
+
addable?: boolean;
|
|
36
|
+
tabsOnly?: boolean;
|
|
37
|
+
displayDirective?: TabsDisplayDirective;
|
|
38
|
+
paneClass?: string;
|
|
39
|
+
paneStyle?: string | CSSProperties;
|
|
40
|
+
beforeChange?: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
interface CTabsEmits {
|
|
43
|
+
(event: 'update:modelValue', value: TabsValue): void;
|
|
44
|
+
(event: 'change', value: TabsValue, item: TabsItem | undefined): void;
|
|
45
|
+
(event: 'close', value: TabsValue): void;
|
|
46
|
+
(event: 'add'): void;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/C_Tabs/index.vue.d.ts
|
|
50
|
+
declare var __VLS_19: {
|
|
51
|
+
item: TabsItem;
|
|
52
|
+
active: boolean;
|
|
53
|
+
}, __VLS_37: string, __VLS_38: {
|
|
54
|
+
item: TabsItem;
|
|
55
|
+
active: boolean;
|
|
56
|
+
}, __VLS_45: {
|
|
57
|
+
item: TabsItem;
|
|
58
|
+
active: boolean;
|
|
59
|
+
};
|
|
60
|
+
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof __VLS_38) => any } & {
|
|
61
|
+
tab?: (props: typeof __VLS_19) => any;
|
|
62
|
+
} & {
|
|
63
|
+
pane?: (props: typeof __VLS_45) => any;
|
|
64
|
+
};
|
|
65
|
+
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
|
+
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
+
close: (value: TabsValue) => any;
|
|
69
|
+
add: () => any;
|
|
70
|
+
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
71
|
+
"update:modelValue": (value: TabsValue) => any;
|
|
72
|
+
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
+
onClose?: ((value: TabsValue) => any) | undefined;
|
|
74
|
+
onAdd?: (() => any) | undefined;
|
|
75
|
+
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
76
|
+
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
77
|
+
}>, {
|
|
78
|
+
type: TabsType;
|
|
79
|
+
size: TabsSize;
|
|
80
|
+
defaultValue: TabsValue | null;
|
|
81
|
+
items: readonly TabsItem[];
|
|
82
|
+
modelValue: TabsValue | null;
|
|
83
|
+
placement: TabsPlacement;
|
|
84
|
+
displayDirective: TabsDisplayDirective;
|
|
85
|
+
animated: boolean;
|
|
86
|
+
addable: boolean;
|
|
87
|
+
closable: boolean;
|
|
88
|
+
justifyContent: TabsJustifyContent;
|
|
89
|
+
tabsOnly: boolean;
|
|
90
|
+
paneClass: string;
|
|
91
|
+
paneStyle: string | vue.CSSProperties;
|
|
92
|
+
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
|
93
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
94
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
95
|
+
declare const _default: typeof __VLS_export;
|
|
96
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
97
|
+
new (): {
|
|
98
|
+
$slots: S;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/components/C_Tabs/data.d.ts
|
|
103
|
+
/**
|
|
104
|
+
* 提供轻量的运行时校验并保持调用侧扁平;返回原数组,不复制、不注入隐藏字段。
|
|
105
|
+
*/
|
|
106
|
+
declare function defineTabs<const T extends readonly TabsItem[]>(items: T): T;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { TabsBadgeType as a, TabsJustifyContent as c, TabsType as d, TabsValue as f, CTabsProps as i, TabsPlacement as l, _default as n, TabsDisplayDirective as o, CTabsEmits as r, TabsItem as s, defineTabs as t, TabsSize as u };
|
package/dist/data2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isProxy as e,toRaw as t}from"vue";const n=new Set([`__proto__`,`prototype`,`constructor`]);function r(e){let t=e.replace(/\[([^\]]+)\]/g,`.$1`).split(`.`).map(e=>e.trim().replace(/^['"]|['"]$/g,``)).filter(Boolean);if(t.length===0)throw TypeError(`Data path cannot be empty`);if(t.some(e=>n.has(e)))throw TypeError(`Unsafe data path: ${e}`);return t}function i(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return!0;let n=e;for(let e of r(t)){if(typeof n!=`object`||!n||!Object.prototype.hasOwnProperty.call(n,e))return!1;n=n[e]}return!0}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r(t).reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e)}function o(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)){e[t]=n;return}let i=r(t),a=e;i.forEach((e,t)=>{if(t===i.length-1){a[e]=n;return}let r=a[e];(typeof r!=`object`||!r)&&(a[e]=/^\d+$/.test(i[t+1])?[]:{}),a=a[e]})}function s(e,t){if(Object.prototype.hasOwnProperty.call(e,t)){delete e[t];return}let n=r(t),i=n.pop();if(!i)return;let a=n.reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e);a&&typeof a==`object`&&delete a[i]}function c(n){return e(n)?t(n):n}function l(e,t){let n=c(e);if(typeof n!=`object`||!n)return n;if(t.has(n))return t.get(n);if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp)return new RegExp(n);if(n instanceof ArrayBuffer)return n.slice(0);if(Array.isArray(n)){let e=[];return t.set(n,e),n.forEach(n=>e.push(l(n,t))),e}if(n instanceof Map){let e=new Map;return t.set(n,e),n.forEach((n,r)=>{e.set(l(r,t),l(n,t))}),e}if(n instanceof Set){let e=new Set;return t.set(n,e),n.forEach(n=>e.add(l(n,t))),e}let r=Object.getPrototypeOf(n);if(r!==Object.prototype&&r!==null)return n;let i={};return t.set(n,i),Reflect.ownKeys(n).forEach(e=>{typeof e==`string`&&(i[e]=l(n[e],t))}),i}function u(e){let t=c(e);if(typeof structuredClone==`function`)try{return structuredClone(t)}catch{}return l(t,new WeakMap)}const d=e=>typeof e==`object`&&!!e;function f(e,t){let n=e.additions.length;if(t())return!0;for(;e.additions.length>n;){let[t,n]=e.additions.pop();e.pairs.get(t)?.delete(n)}return!1}function p(e,t,n,r){return n.has(e)&&_(t,n.get(e),r)}function m(e,t,n){if(e.size!==t.size)return!1;let r=new Set,i;for(let[a,o]of e){if(!d(a)){if(!p(a,o,t,n))return!1;continue}if(!r.has(a)&&f(n,()=>p(a,o,t,n))){r.add(a);continue}i??=[...t].filter(e=>d(e[0]));let e=i.find(([e,t])=>e!==a&&!r.has(e)&&f(n,()=>_(a,e,n)&&_(o,t,n)));if(!e)return!1;r.add(e[0])}return!0}function h(e,t,n){if(e.size!==t.size)return!1;let r=new Set,i;for(let a of e){if(!d(a)){if(!t.has(a))return!1;continue}if(!r.has(a)&&t.has(a)){r.add(a);continue}i??=[...t].filter(d);let e=i.find(e=>!r.has(e)&&f(n,()=>_(a,e,n)));if(!e)return!1;r.add(e)}return!0}function g(e,t,n){let r=n.pairs.get(e);if(r?.has(t))return!0;if(r||(r=new WeakSet,n.pairs.set(e,r)),r.add(t),n.additions.push([e,t]),e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.source===t.source&&e.flags===t.flags;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,r)=>_(e,t[r],n));if(e instanceof Map||t instanceof Map)return!(e instanceof Map)||!(t instanceof Map)?!1:m(e,t,n);if(e instanceof Set||t instanceof Set)return!(e instanceof Set)||!(t instanceof Set)?!1:h(e,t,n);let i=Object.keys(e),a=Object.keys(t);return i.length===a.length?i.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&_(e[r],t[r],n)):!1}function _(e,t,n){let r=c(e),i=c(t);return Object.is(r,i)?!0:r===null||i===null||typeof r!=`object`||typeof i!=`object`?!1:g(r,i,n)}function v(e,t){return _(e,t,{pairs:new WeakMap,additions:[]})}function y(e,t){let n=u(t);Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(n,t)||delete e[t]}),Object.assign(e,n)}export{v as a,o as c,i,s as n,r as o,a as r,y as s,u as t};
|
package/dist/data3.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);const i={key:1,class:`c-tabs__label`},a=(0,n.defineComponent)({name:`C_Tabs`,__name:`index`,props:{modelValue:{default:void 0},defaultValue:{default:void 0},items:{default:()=>[]},type:{default:`line`},size:{default:`small`},placement:{default:`top`},justifyContent:{default:`start`},animated:{type:Boolean,default:!0},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},tabsOnly:{type:Boolean,default:!1},displayDirective:{default:`show:lazy`},paneClass:{default:void 0},paneStyle:{default:void 0},beforeChange:{type:Function,default:void 0}},emits:[`update:modelValue`,`change`,`close`,`add`],setup(t,{expose:a,emit:o}){let s=t,c=o,l=(0,n.defineComponent)({name:`CTabsRenderNode`,props:{render:{type:Function,required:!0},item:{type:Object,required:!0}},setup(e){return()=>e.render(e.item)}}),u=e=>e!=null&&s.items.some(t=>t.key===e&&!t.disabled),d=()=>u(s.defaultValue)?s.defaultValue:s.items.find(e=>!e.disabled)?.key??null,f=(0,n.ref)(d()),p=0,m=!1,h=(0,n.computed)({get:()=>{let e=s.modelValue===void 0?f.value:s.modelValue;return e===null||u(e)?e:d()},set:e=>{e!==null&&!u(e)||h.value!==e&&(s.modelValue===void 0&&(f.value=e),e!==null&&(c(`update:modelValue`,e),c(`change`,e,s.items.find(t=>t.key===e))))}}),g=(0,n.computed)(()=>h.value),_=e=>{h.value=e},v=async(e,t)=>{let n=++p;if(!u(e))return!1;try{return(!s.beforeChange||await s.beforeChange(e,t??null)!==!1)&&!m&&n===p&&u(e)&&h.value===(t??null)}catch{return!1}},y=e=>`pane-${String(e.key)}`;return(0,n.watch)([()=>s.modelValue,()=>s.defaultValue,()=>s.items.map(e=>[e.key,e.disabled])],()=>{let e=s.modelValue===void 0?f.value:s.modelValue;if(s.modelValue!==void 0&&(f.value=s.modelValue),e===null&&s.modelValue===null||u(e))return;let t=d();e!==t&&(p+=1,s.modelValue===void 0&&(f.value=t),t!==null&&(c(`update:modelValue`,t),c(`change`,t,s.items.find(e=>e.key===t))))},{deep:!0,immediate:!0}),(0,n.onBeforeUnmount)(()=>{m=!0,p+=1}),a({activeValue:h}),(a,o)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NTabs),{value:g.value,"onUpdate:value":_,class:(0,n.normalizeClass)([`c-tabs`,[`is-${t.type}`,{"is-tabs-only":t.tabsOnly}]]),type:t.type,size:t.size,placement:t.placement,"justify-content":t.justifyContent,animated:t.animated,closable:t.closable,addable:t.addable,"on-before-leave":v,onClose:o[0]||=e=>c(`close`,e),onAdd:o[1]||=e=>c(`add`)},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t.items,o=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NTabPane),{key:o.key,name:o.key,disabled:o.disabled,closable:o.closable,"display-directive":t.displayDirective,class:(0,n.normalizeClass)(t.paneClass),style:(0,n.normalizeStyle)(t.paneStyle)},{tab:(0,n.withCtx)(()=>[(0,n.renderSlot)(a.$slots,`tab`,{item:o,active:h.value===o.key},()=>[o.renderTab?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(l),{key:0,render:o.renderTab,item:o},null,8,[`render`,`item`])):((0,n.openBlock)(),(0,n.createElementBlock)(`span`,i,[o.icon?((0,n.openBlock)(),(0,n.createBlock)(e.t,{key:0,class:`c-tabs__icon`,name:o.icon,size:14},null,8,[`name`])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`span`,null,(0,n.toDisplayString)(o.label),1),o.badge===void 0?(0,n.createCommentVNode)(`v-if`,!0):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NBadge),{key:1,class:`c-tabs__badge`,value:o.badge,type:o.badgeType||`info`},null,8,[`value`,`type`]))]))],!0)]),default:(0,n.withCtx)(()=>[t.tabsOnly?(0,n.createCommentVNode)(`v-if`,!0):(0,n.renderSlot)(a.$slots,y(o),{item:o,active:h.value===o.key},()=>[o.render?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(l),{key:0,render:o.render,item:o},null,8,[`render`,`item`])):(0,n.renderSlot)(a.$slots,`pane`,{item:o,active:h.value===o.key},void 0,!0,1)],!0,0)]),_:2},1032,[`name`,`disabled`,`closable`,`display-directive`,`class`,`style`]))),128))]),_:3},8,[`value`,`class`,`type`,`size`,`placement`,`justify-content`,`animated`,`closable`,`addable`]))}});var o=t.t(a,[[`__scopeId`,`data-v-2d475220`]]);function s(e){let t=new Set;for(let n of e){if(typeof n.key!=`string`&&typeof n.key!=`number`)throw TypeError(`C_Tabs 的 item.key 必须是字符串或数字`);if(typeof n.key==`string`&&n.key.trim().length===0)throw TypeError(`C_Tabs 的 item.key 不能为空`);if(t.has(n.key))throw RangeError(`C_Tabs 存在重复 key: ${String(n.key)}`);if(typeof n.label!=`string`||n.label.trim().length===0)throw TypeError(`C_Tabs 的 ${String(n.key)} 缺少有效 label`);t.add(n.key)}return e}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
package/dist/data3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,defineComponent as c,normalizeClass as l,normalizeStyle as u,onBeforeUnmount as d,openBlock as f,ref as p,renderList as m,renderSlot as h,toDisplayString as g,unref as _,watch as v,withCtx as y}from"vue";import{NBadge as b,NTabPane as x,NTabs as S}from"naive-ui";const C={key:1,class:`c-tabs__label`};var w=t(c({name:`C_Tabs`,__name:`index`,props:{modelValue:{default:void 0},defaultValue:{default:void 0},items:{default:()=>[]},type:{default:`line`},size:{default:`small`},placement:{default:`top`},justifyContent:{default:`start`},animated:{type:Boolean,default:!0},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},tabsOnly:{type:Boolean,default:!1},displayDirective:{default:`show:lazy`},paneClass:{default:void 0},paneStyle:{default:void 0},beforeChange:{type:Function,default:void 0}},emits:[`update:modelValue`,`change`,`close`,`add`],setup(t,{expose:w,emit:T}){let E=t,D=T,O=c({name:`CTabsRenderNode`,props:{render:{type:Function,required:!0},item:{type:Object,required:!0}},setup(e){return()=>e.render(e.item)}}),k=e=>e!=null&&E.items.some(t=>t.key===e&&!t.disabled),A=()=>k(E.defaultValue)?E.defaultValue:E.items.find(e=>!e.disabled)?.key??null,j=p(A()),M=0,N=!1,P=r({get:()=>{let e=E.modelValue===void 0?j.value:E.modelValue;return e===null||k(e)?e:A()},set:e=>{e!==null&&!k(e)||P.value!==e&&(E.modelValue===void 0&&(j.value=e),e!==null&&(D(`update:modelValue`,e),D(`change`,e,E.items.find(t=>t.key===e))))}}),F=r(()=>P.value),I=e=>{P.value=e},L=async(e,t)=>{let n=++M;if(!k(e))return!1;try{return(!E.beforeChange||await E.beforeChange(e,t??null)!==!1)&&!N&&n===M&&k(e)&&P.value===(t??null)}catch{return!1}},R=e=>`pane-${String(e.key)}`;return v([()=>E.modelValue,()=>E.defaultValue,()=>E.items.map(e=>[e.key,e.disabled])],()=>{let e=E.modelValue===void 0?j.value:E.modelValue;if(E.modelValue!==void 0&&(j.value=E.modelValue),e===null&&E.modelValue===null||k(e))return;let t=A();e!==t&&(M+=1,E.modelValue===void 0&&(j.value=t),t!==null&&(D(`update:modelValue`,t),D(`change`,t,E.items.find(e=>e.key===t))))},{deep:!0,immediate:!0}),d(()=>{N=!0,M+=1}),w({activeValue:P}),(r,c)=>(f(),i(_(S),{value:F.value,"onUpdate:value":I,class:l([`c-tabs`,[`is-${t.type}`,{"is-tabs-only":t.tabsOnly}]]),type:t.type,size:t.size,placement:t.placement,"justify-content":t.justifyContent,animated:t.animated,closable:t.closable,addable:t.addable,"on-before-leave":L,onClose:c[0]||=e=>D(`close`,e),onAdd:c[1]||=e=>D(`add`)},{default:y(()=>[(f(!0),o(n,null,m(t.items,n=>(f(),i(_(x),{key:n.key,name:n.key,disabled:n.disabled,closable:n.closable,"display-directive":t.displayDirective,class:l(t.paneClass),style:u(t.paneStyle)},{tab:y(()=>[h(r.$slots,`tab`,{item:n,active:P.value===n.key},()=>[n.renderTab?(f(),i(_(O),{key:0,render:n.renderTab,item:n},null,8,[`render`,`item`])):(f(),o(`span`,C,[n.icon?(f(),i(e,{key:0,class:`c-tabs__icon`,name:n.icon,size:14},null,8,[`name`])):a(`v-if`,!0),s(`span`,null,g(n.label),1),n.badge===void 0?a(`v-if`,!0):(f(),i(_(b),{key:1,class:`c-tabs__badge`,value:n.badge,type:n.badgeType||`info`},null,8,[`value`,`type`]))]))],!0)]),default:y(()=>[t.tabsOnly?a(`v-if`,!0):h(r.$slots,R(n),{item:n,active:P.value===n.key},()=>[n.render?(f(),i(_(O),{key:0,render:n.render,item:n},null,8,[`render`,`item`])):h(r.$slots,`pane`,{item:n,active:P.value===n.key},void 0,!0,1)],!0,0)]),_:2},1032,[`name`,`disabled`,`closable`,`display-directive`,`class`,`style`]))),128))]),_:3},8,[`value`,`class`,`type`,`size`,`placement`,`justify-content`,`animated`,`closable`,`addable`]))}}),[[`__scopeId`,`data-v-2d475220`]]);function T(e){let t=new Set;for(let n of e){if(typeof n.key!=`string`&&typeof n.key!=`number`)throw TypeError(`C_Tabs 的 item.key 必须是字符串或数字`);if(typeof n.key==`string`&&n.key.trim().length===0)throw TypeError(`C_Tabs 的 item.key 不能为空`);if(t.has(n.key))throw RangeError(`C_Tabs 存在重复 key: ${String(n.key)}`);if(typeof n.label!=`string`||n.label.trim().length===0)throw TypeError(`C_Tabs 的 ${String(n.key)} 缺少有效 label`);t.add(n.key)}return e}export{w as n,T as t};
|