@robot-admin/naive-ui-components 0.14.2 → 0.15.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 +30 -0
- package/README.md +130 -721
- package/README_EN.md +137 -658
- package/dist/C_ActionBar.css +57 -58
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV.css +215 -222
- package/dist/C_AntV2.cjs +2 -2
- package/dist/C_AntV2.js +2 -2
- package/dist/C_AudioPlayer.css +11 -12
- package/dist/C_AvatarGroup.css +5 -6
- package/dist/C_Barcode.css +1 -1
- package/dist/C_Breadcrumb.css +15 -17
- package/dist/C_Breadcrumb2.cjs +1 -1
- package/dist/C_Breadcrumb2.js +1 -1
- package/dist/C_Captcha.css +45 -47
- package/dist/C_Captcha2.cjs +1 -1
- package/dist/C_Captcha2.js +1 -1
- package/dist/C_Cascade.css +2 -2
- package/dist/C_Chat.css +8 -8
- package/dist/C_City.css +6 -7
- package/dist/C_Code.css +14 -15
- package/dist/C_CollapsePanel.css +12 -13
- package/dist/C_ContextMenu.css +31 -31
- package/dist/C_Cron.css +272 -275
- package/dist/C_Date.css +1 -1
- package/dist/C_Draggable.css +10 -11
- package/dist/C_Editor.css +2 -2
- package/dist/C_FilePreview.css +193 -193
- package/dist/C_Form.base.css +607 -601
- package/dist/C_Form.cjs +1 -1
- package/dist/C_Form.css +609 -603
- package/dist/C_Form.d.cts +2 -2
- package/dist/C_Form.d.ts +2 -2
- package/dist/C_Form.js +1 -1
- package/dist/C_FormModal.cjs +1 -1
- package/dist/C_FormModal.css +14 -20
- package/dist/C_FormModal.js +1 -1
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +53 -55
- package/dist/C_FormSearch2.cjs +1 -1
- package/dist/C_FormSearch2.js +1 -1
- package/dist/C_FormulaEditor.css +314 -315
- package/dist/C_FullCalendar.css +14 -16
- package/dist/C_FullCalendar2.cjs +1 -1
- package/dist/C_FullCalendar2.js +1 -1
- package/dist/C_GlobalSearch.css +2 -2
- package/dist/C_Guide.css +14 -15
- package/dist/C_Icon.css +7 -8
- package/dist/C_ImageCropper.css +69 -69
- package/dist/C_Language.css +8 -8
- package/dist/C_Loading.css +20 -22
- package/dist/C_Loading2.cjs +1 -1
- package/dist/C_Loading2.js +1 -1
- package/dist/C_Login.css +130 -135
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Map.css +22 -23
- package/dist/C_Markdown.css +2 -2
- package/dist/C_Menu.css +2 -5
- package/dist/C_Menu2.cjs +1 -1
- package/dist/C_Menu2.js +1 -1
- package/dist/C_NotificationCenter.css +300 -301
- package/dist/C_OrgChart.css +3 -3
- package/dist/C_PageLoading.css +35 -39
- package/dist/C_QRCode.css +5 -6
- package/dist/C_Signature.css +5 -6
- package/dist/C_Skeleton.css +6 -7
- package/dist/C_SplitPane.css +2 -2
- package/dist/C_Steps.css +2 -2
- package/dist/C_Table.base.css +1097 -870
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +1101 -874
- package/dist/C_Table.d.cts +1 -1
- package/dist/C_Table.d.ts +1 -1
- package/dist/C_Table.js +1 -1
- package/dist/C_Tabs.css +2 -2
- package/dist/C_TagsView.css +72 -76
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Theme.css +7 -8
- package/dist/C_Time.css +1 -1
- package/dist/C_Timeline.css +8 -8
- package/dist/C_Transfer.css +10 -11
- package/dist/C_Tree.css +16 -17
- package/dist/C_Upload.css +147 -148
- package/dist/C_VideoPlayer.css +280 -281
- package/dist/C_VtableGantt.css +2 -2
- package/dist/C_WaterFall.css +17 -18
- package/dist/C_WorkFlow.css +453 -457
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -0
- package/dist/Card.js +1 -0
- package/dist/Custom.cjs +1 -0
- package/dist/Custom.js +1 -0
- package/dist/Dynamic.cjs +1 -0
- package/dist/Dynamic.js +1 -0
- package/dist/Steps.cjs +1 -0
- package/dist/Steps.js +1 -0
- package/dist/Tabs.cjs +1 -0
- package/dist/Tabs.js +1 -0
- package/dist/cascader.cjs +1 -0
- package/dist/cascader.js +1 -0
- package/dist/color-picker.cjs +1 -0
- package/dist/color-picker.js +1 -0
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants3.d.cts +5 -5
- package/dist/constants3.d.ts +5 -5
- package/dist/constants4.d.cts +4 -4
- package/dist/constants4.d.ts +4 -4
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/context.cjs +1 -0
- package/dist/context.js +1 -0
- package/dist/contracts.d.cts +24 -0
- package/dist/contracts.d.ts +24 -0
- package/dist/createPageLoading.cjs +1 -1
- package/dist/createPageLoading.js +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.cts +9 -9
- package/dist/data.d.ts +9 -9
- package/dist/data.js +1 -1
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.js +1 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.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 +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.cts +3 -3
- package/dist/index11.vue.d.ts +2 -2
- package/dist/index12.vue.d.cts +2 -2
- package/dist/index12.vue.d.ts +1 -1
- package/dist/index13.vue.d.cts +1 -1
- package/dist/index13.vue.d.ts +3 -3
- package/dist/index14.vue.d.cts +3 -3
- package/dist/index14.vue.d.ts +7 -7
- package/dist/index15.vue.d.cts +7 -7
- package/dist/index16.vue.d.ts +1 -1
- package/dist/index17.vue.d.cts +1 -1
- package/dist/index17.vue.d.ts +1 -1
- package/dist/index18.vue.d.cts +1 -1
- package/dist/index18.vue.d.ts +1 -1
- package/dist/index19.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +2 -9
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +1 -1
- package/dist/index21.vue.d.cts +1 -1
- package/dist/index21.vue.d.ts +1 -1
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index22.vue.d.ts +2 -2
- package/dist/index23.vue.d.cts +1 -1
- package/dist/index23.vue.d.ts +1 -1
- package/dist/index25.vue.d.cts +4 -4
- package/dist/index25.vue.d.ts +4 -4
- package/dist/index26.vue.d.cts +1 -1
- package/dist/index26.vue.d.ts +1 -1
- package/dist/index27.vue.d.cts +4 -4
- package/dist/index27.vue.d.ts +4 -4
- package/dist/index28.vue.d.cts +1 -1
- package/dist/index28.vue.d.ts +1 -1
- package/dist/index3.vue.d.cts +4 -4
- package/dist/index3.vue.d.ts +4 -4
- package/dist/index4.vue.d.cts +2 -9
- package/dist/index6.vue.d.ts +3 -3
- package/dist/index7.vue.d.cts +3 -3
- package/dist/index8.vue.d.ts +2 -2
- package/dist/index9.vue.d.cts +2 -2
- package/dist/index9.vue.d.ts +3 -3
- package/dist/mapUtils.d.cts +2 -2
- package/dist/mapUtils.d.ts +2 -2
- package/dist/presets.d.cts +8 -2
- package/dist/presets.d.ts +8 -2
- package/dist/rate.cjs +1 -0
- package/dist/rate.js +1 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +1 -0
- package/dist/style.css +10898 -10915
- package/dist/time-picker.cjs +1 -0
- package/dist/time-picker.js +1 -0
- package/dist/upload.cjs +1 -0
- package/dist/upload.js +1 -0
- package/dist/useActionTask.cjs +1 -0
- package/dist/useActionTask.js +1 -0
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +4 -4
- package/dist/useCollapsePanel.d.ts +4 -4
- package/dist/useComponentLocale.cjs +1 -0
- package/dist/useComponentLocale.js +1 -0
- package/dist/useCropperCore.d.cts +6 -6
- package/dist/useCropperCore.d.ts +6 -6
- package/dist/useDraggableLayout.d.cts +1 -1
- package/dist/useDraggableLayout.d.ts +1 -1
- package/dist/useDynamicFormState.cjs +1 -0
- package/dist/useDynamicFormState.d.cts +64 -40
- package/dist/useDynamicFormState.d.ts +64 -40
- package/dist/useDynamicFormState.js +1 -0
- package/dist/useEdgeInteraction.d.cts +3 -3
- package/dist/useEdgeInteraction.d.ts +3 -3
- package/dist/useGlobalSearch.d.cts +1 -1
- package/dist/useGlobalSearch.d.ts +1 -1
- package/dist/useQRCode.d.cts +2 -2
- package/dist/useQRCode.d.ts +2 -2
- package/dist/useSearchState.d.cts +15 -725
- package/dist/useSearchState.d.ts +15 -834
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +3 -3
- package/dist/useSplitResize.d.ts +3 -3
- package/dist/useTableQuery.cjs +3 -3
- package/dist/useTableQuery.d.cts +73 -34
- package/dist/useTableQuery.d.ts +73 -34
- package/dist/useTableQuery.js +3 -3
- package/dist/useTimeSelection.d.cts +1 -1
- package/dist/useTimeSelection.d.ts +1 -1
- package/dist/useTreeOperations.d.cts +5 -5
- package/dist/useTreeOperations.d.ts +5 -5
- package/dist/useWorkflowValidation.d.cts +3 -3
- package/dist/useWorkflowValidation.d.ts +3 -3
- package/dist/verification.d.cts +4 -4
- package/dist/verification.d.ts +4 -4
- package/docs/architecture.en.md +83 -0
- package/docs/architecture.md +83 -0
- package/docs/assets/README.md +47 -0
- package/docs/assets/naive-ui-components-banner.png +0 -0
- package/docs/assets/naive-ui-components-banner.svg +69 -0
- package/docs/assets/naive-ui-components-logo.png +0 -0
- package/docs/assets/naive-ui-components-logo.svg +22 -0
- package/docs/components.en.md +118 -0
- package/docs/components.md +118 -0
- package/docs/engineering.en.md +132 -0
- package/docs/engineering.md +133 -0
- package/docs/guides/usage.en.md +638 -0
- package/docs/guides/usage.md +699 -0
- package/docs/performance-0.15.0.md +20 -0
- package/docs/security-scan-2026-10-06.md +11 -0
- package/docs/security-scan-2026-10-18.md +16 -0
- package/package.json +35 -12
- package/dist/C_Form2.cjs +0 -1
- package/dist/C_Form2.js +0 -1
- package/dist/config.cjs +0 -1
- package/dist/config.d.cts +0 -33
- package/dist/config.d.ts +0 -33
- package/dist/config.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`naive-ui`);Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return e.NTimePicker}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NTimePicker as e}from"naive-ui";export{e as default};
|
package/dist/upload.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`naive-ui`);Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return e.NUpload}});
|
package/dist/upload.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NUpload as e}from"naive-ui";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`vue`);function t(){let t=(0,e.shallowReactive)(new Set),n=!1,r=e=>t.has(e),i=async(e,r,i=()=>!0)=>{if(n||t.has(e)||!i())return{executed:!1};t.add(e);try{return{executed:!0,value:await r()}}finally{t.delete(e)}},a=()=>{n=!0,t.clear()};return(0,e.getCurrentScope)()&&(0,e.onScopeDispose)(a),{isRunning:r,run:i,dispose:a}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentScope as e,onScopeDispose as t,shallowReactive as n}from"vue";function r(){let r=n(new Set),i=!1,a=e=>r.has(e),o=async(e,t,n=()=>!0)=>{if(i||r.has(e)||!n())return{executed:!1};r.add(e);try{return{executed:!0,value:await t()}}finally{r.delete(e)}},s=()=>{i=!0,r.clear()};return e()&&t(s),{isRunning:a,run:o,dispose:s}}export{r as t};
|
|
@@ -66,9 +66,9 @@ declare const __VLS_export: vue.DefineComponent<CalendarProps, CalendarExpose, {
|
|
|
66
66
|
}) => any) | undefined;
|
|
67
67
|
"onEvent-dropped"?: ((event: Partial<CalendarEvent>) => any) | undefined;
|
|
68
68
|
}>, {
|
|
69
|
+
editable: boolean;
|
|
69
70
|
events: CalendarEvent[];
|
|
70
71
|
initialView: CalendarViewType;
|
|
71
|
-
editable: boolean;
|
|
72
72
|
showAddDialog: boolean;
|
|
73
73
|
showEditDialog: boolean;
|
|
74
74
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -66,9 +66,9 @@ declare const __VLS_export: vue.DefineComponent<CalendarProps, CalendarExpose, {
|
|
|
66
66
|
}) => any) | undefined;
|
|
67
67
|
"onEvent-dropped"?: ((event: Partial<CalendarEvent>) => any) | undefined;
|
|
68
68
|
}>, {
|
|
69
|
+
editable: boolean;
|
|
69
70
|
events: CalendarEvent[];
|
|
70
71
|
initialView: CalendarViewType;
|
|
71
|
-
editable: boolean;
|
|
72
72
|
showAddDialog: boolean;
|
|
73
73
|
showEditDialog: boolean;
|
|
74
74
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -71,22 +71,22 @@ declare var __VLS_7: `header-${string}`, __VLS_8: {
|
|
|
71
71
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any } & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any } & { [K in NonNullable<typeof __VLS_31>]?: (props: typeof __VLS_32) => any };
|
|
72
72
|
declare const __VLS_base: vue.DefineComponent<Props, CollapsePanelExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
73
73
|
change: (activeKeys: string[]) => any;
|
|
74
|
+
"update:activeKeys": (keys: string[]) => any;
|
|
74
75
|
expand: (key: string) => any;
|
|
75
76
|
collapse: (key: string) => any;
|
|
76
|
-
"update:activeKeys": (keys: string[]) => any;
|
|
77
77
|
}, string, vue.PublicProps, Readonly<Props> & Readonly<{
|
|
78
78
|
onChange?: ((activeKeys: string[]) => any) | undefined;
|
|
79
|
+
"onUpdate:activeKeys"?: ((keys: string[]) => any) | undefined;
|
|
79
80
|
onExpand?: ((key: string) => any) | undefined;
|
|
80
81
|
onCollapse?: ((key: string) => any) | undefined;
|
|
81
|
-
"onUpdate:activeKeys"?: ((keys: string[]) => any) | undefined;
|
|
82
82
|
}>, {
|
|
83
|
-
bordered: boolean;
|
|
84
83
|
activeKeys: string[];
|
|
85
|
-
persistKey: string;
|
|
86
84
|
defaultActiveKeys: string[];
|
|
87
85
|
accordion: boolean;
|
|
88
86
|
variant: CollapsePanelVariant;
|
|
89
87
|
expandIconPosition: ExpandIconPosition;
|
|
88
|
+
bordered: boolean;
|
|
89
|
+
persistKey: string;
|
|
90
90
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
91
91
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
92
92
|
declare const _default: typeof __VLS_export;
|
|
@@ -71,22 +71,22 @@ declare var __VLS_7: `header-${string}`, __VLS_8: {
|
|
|
71
71
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any } & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any } & { [K in NonNullable<typeof __VLS_31>]?: (props: typeof __VLS_32) => any };
|
|
72
72
|
declare const __VLS_base: vue.DefineComponent<Props, CollapsePanelExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
73
73
|
change: (activeKeys: string[]) => any;
|
|
74
|
+
"update:activeKeys": (keys: string[]) => any;
|
|
74
75
|
expand: (key: string) => any;
|
|
75
76
|
collapse: (key: string) => any;
|
|
76
|
-
"update:activeKeys": (keys: string[]) => any;
|
|
77
77
|
}, string, vue.PublicProps, Readonly<Props> & Readonly<{
|
|
78
78
|
onChange?: ((activeKeys: string[]) => any) | undefined;
|
|
79
|
+
"onUpdate:activeKeys"?: ((keys: string[]) => any) | undefined;
|
|
79
80
|
onExpand?: ((key: string) => any) | undefined;
|
|
80
81
|
onCollapse?: ((key: string) => any) | undefined;
|
|
81
|
-
"onUpdate:activeKeys"?: ((keys: string[]) => any) | undefined;
|
|
82
82
|
}>, {
|
|
83
|
-
bordered: boolean;
|
|
84
83
|
activeKeys: string[];
|
|
85
|
-
persistKey: string;
|
|
86
84
|
defaultActiveKeys: string[];
|
|
87
85
|
accordion: boolean;
|
|
88
86
|
variant: CollapsePanelVariant;
|
|
89
87
|
expandIconPosition: ExpandIconPosition;
|
|
88
|
+
bordered: boolean;
|
|
89
|
+
persistKey: string;
|
|
90
90
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
91
91
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
92
92
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./context.cjs`);let t=require(`vue`);const n=Object.freeze({"common.confirm":`确定`,"common.cancel":`取消`,"common.save":`保存`,"common.submit":`提交`,"common.reset":`重置`,"common.retry":`重试`,"common.edit":`编辑`,"common.detail":`详情`,"common.delete":`删除`,"common.select":`选择`,"common.print":`打印`,"common.loading":`正在加载`,"table.loading":`正在加载数据`,"table.loadFailed":`数据加载失败`,"table.deleteTitle":`确认删除`,"table.deleteContent":`确定要删除这条记录吗?`,"table.deleteSuccess":`删除成功`,"table.deleteFailed":`删除失败`,"table.detailFailed":`获取详情失败`,"table.moreActions":`更多操作`,"table.actionFailed":`{action}失败`,"table.cancelSelection":`取消选择`,"table.columnSettings":`列设置`,"table.export":`导出`,"table.settings":`表格设置`,"table.selectedCount":`已选择 {count} 项`,"table.addRow":`增行`,"table.insertRow":`插行`,"table.deleteRow":`删除行`,"table.copyRow":`复制行`,"table.moveUp":`上移`,"table.moveDown":`下移`,"table.addRowSuccess":`添加行成功`,"table.insertRowSuccess":`插入行成功`,"table.deleteRowSuccess":`删除行成功`,"table.copyRowSuccess":`复制行成功`,"table.moveUpSuccess":`行已上移`,"table.moveDownSuccess":`行已下移`,"table.selectRowFirst":`请先选择一行数据`,"table.selectDeleteRowFirst":`请先选择要删除的行`,"table.selectCopyRowFirst":`请先选择要复制的行`,"table.firstRow":`已经是第一行`,"table.lastRow":`已经是最后一行`,"table.deleteRowContent":`确定要删除选中的行吗?此操作不可撤销。`,"table.confirmDeleteRow":`确认删除`,"table.printTargetMissing":`打印元素未找到`,"table.downloadTargetMissing":`下载元素未找到`,"table.invalidRowKeys":`表格存在 {count} 个缺失或重复的行键`,"form.required":`{label}不能为空`,"search.valueRequired":`请输入搜索内容,或选择筛选条件`,"search.failed":`搜索失败`,"captcha.trigger":`点击进行人机验证`,"captcha.verifying":`正在验证…`,"captcha.success":`验证成功`,"captcha.failed":`验证失败,请重试`,"captcha.reset":`重新验证`,"captcha.puzzleFailed":`拼图验证失败`,"captcha.verifyFailed":`服务端验证失败`,"captcha.loadFailed":`验证码加载失败`}),r=Object.freeze({"common.confirm":`Confirm`,"common.cancel":`Cancel`,"common.save":`Save`,"common.submit":`Submit`,"common.reset":`Reset`,"common.retry":`Retry`,"common.edit":`Edit`,"common.detail":`Details`,"common.delete":`Delete`,"common.select":`Select`,"common.print":`Print`,"common.loading":`Loading`,"table.loading":`Loading data`,"table.loadFailed":`Failed to load data`,"table.deleteTitle":`Confirm deletion`,"table.deleteContent":`Are you sure you want to delete this record?`,"table.deleteSuccess":`Deleted successfully`,"table.deleteFailed":`Delete failed`,"table.detailFailed":`Failed to load details`,"table.moreActions":`More actions`,"table.actionFailed":`{action} failed`,"table.cancelSelection":`Clear selection`,"table.columnSettings":`Column settings`,"table.export":`Export`,"table.settings":`Table settings`,"table.selectedCount":`{count} selected`,"table.addRow":`Add row`,"table.insertRow":`Insert row`,"table.deleteRow":`Delete row`,"table.copyRow":`Copy row`,"table.moveUp":`Move up`,"table.moveDown":`Move down`,"table.addRowSuccess":`Row added`,"table.insertRowSuccess":`Row inserted`,"table.deleteRowSuccess":`Row deleted`,"table.copyRowSuccess":`Row copied`,"table.moveUpSuccess":`Row moved up`,"table.moveDownSuccess":`Row moved down`,"table.selectRowFirst":`Select a row first`,"table.selectDeleteRowFirst":`Select a row to delete first`,"table.selectCopyRowFirst":`Select a row to copy first`,"table.firstRow":`This is already the first row`,"table.lastRow":`This is already the last row`,"table.deleteRowContent":`Are you sure you want to delete the selected row? This cannot be undone.`,"table.confirmDeleteRow":`Delete row`,"table.printTargetMissing":`Print target was not found`,"table.downloadTargetMissing":`Download target was not found`,"table.invalidRowKeys":`{count} table row keys are missing or duplicated`,"form.required":`{label} is required`,"search.valueRequired":`Enter a search term or choose a filter`,"search.failed":`Search failed`,"captcha.trigger":`Click to verify`,"captcha.verifying":`Verifying…`,"captcha.success":`Verified`,"captcha.failed":`Verification failed. Try again.`,"captcha.reset":`Verify again`,"captcha.puzzleFailed":`Puzzle verification failed`,"captcha.verifyFailed":`Server verification failed`,"captcha.loadFailed":`Failed to load captcha`}),i=(e,t)=>t?e.replace(/\{([^{}]+)\}/g,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?String(t[n]):e):e;function a(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function o(e){return e===`en-US`?r:n}function s(e,t={},n={},r){let s=t.t??n.t;if(s)return s(e,r);let c=o(t.locale??n.locale);return i(a(t.messages,e)??a(n.messages,e)??a(c,e)??e,r)}function c(n){let r=(0,t.getCurrentInstance)()?(0,t.inject)(e.n,{}):{};return{t:(e,i)=>s(e,(0,t.toValue)(n),r,i)}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./context.js";import{getCurrentInstance as t,inject as n,toValue as r}from"vue";const i=Object.freeze({"common.confirm":`确定`,"common.cancel":`取消`,"common.save":`保存`,"common.submit":`提交`,"common.reset":`重置`,"common.retry":`重试`,"common.edit":`编辑`,"common.detail":`详情`,"common.delete":`删除`,"common.select":`选择`,"common.print":`打印`,"common.loading":`正在加载`,"table.loading":`正在加载数据`,"table.loadFailed":`数据加载失败`,"table.deleteTitle":`确认删除`,"table.deleteContent":`确定要删除这条记录吗?`,"table.deleteSuccess":`删除成功`,"table.deleteFailed":`删除失败`,"table.detailFailed":`获取详情失败`,"table.moreActions":`更多操作`,"table.actionFailed":`{action}失败`,"table.cancelSelection":`取消选择`,"table.columnSettings":`列设置`,"table.export":`导出`,"table.settings":`表格设置`,"table.selectedCount":`已选择 {count} 项`,"table.addRow":`增行`,"table.insertRow":`插行`,"table.deleteRow":`删除行`,"table.copyRow":`复制行`,"table.moveUp":`上移`,"table.moveDown":`下移`,"table.addRowSuccess":`添加行成功`,"table.insertRowSuccess":`插入行成功`,"table.deleteRowSuccess":`删除行成功`,"table.copyRowSuccess":`复制行成功`,"table.moveUpSuccess":`行已上移`,"table.moveDownSuccess":`行已下移`,"table.selectRowFirst":`请先选择一行数据`,"table.selectDeleteRowFirst":`请先选择要删除的行`,"table.selectCopyRowFirst":`请先选择要复制的行`,"table.firstRow":`已经是第一行`,"table.lastRow":`已经是最后一行`,"table.deleteRowContent":`确定要删除选中的行吗?此操作不可撤销。`,"table.confirmDeleteRow":`确认删除`,"table.printTargetMissing":`打印元素未找到`,"table.downloadTargetMissing":`下载元素未找到`,"table.invalidRowKeys":`表格存在 {count} 个缺失或重复的行键`,"form.required":`{label}不能为空`,"search.valueRequired":`请输入搜索内容,或选择筛选条件`,"search.failed":`搜索失败`,"captcha.trigger":`点击进行人机验证`,"captcha.verifying":`正在验证…`,"captcha.success":`验证成功`,"captcha.failed":`验证失败,请重试`,"captcha.reset":`重新验证`,"captcha.puzzleFailed":`拼图验证失败`,"captcha.verifyFailed":`服务端验证失败`,"captcha.loadFailed":`验证码加载失败`}),a=Object.freeze({"common.confirm":`Confirm`,"common.cancel":`Cancel`,"common.save":`Save`,"common.submit":`Submit`,"common.reset":`Reset`,"common.retry":`Retry`,"common.edit":`Edit`,"common.detail":`Details`,"common.delete":`Delete`,"common.select":`Select`,"common.print":`Print`,"common.loading":`Loading`,"table.loading":`Loading data`,"table.loadFailed":`Failed to load data`,"table.deleteTitle":`Confirm deletion`,"table.deleteContent":`Are you sure you want to delete this record?`,"table.deleteSuccess":`Deleted successfully`,"table.deleteFailed":`Delete failed`,"table.detailFailed":`Failed to load details`,"table.moreActions":`More actions`,"table.actionFailed":`{action} failed`,"table.cancelSelection":`Clear selection`,"table.columnSettings":`Column settings`,"table.export":`Export`,"table.settings":`Table settings`,"table.selectedCount":`{count} selected`,"table.addRow":`Add row`,"table.insertRow":`Insert row`,"table.deleteRow":`Delete row`,"table.copyRow":`Copy row`,"table.moveUp":`Move up`,"table.moveDown":`Move down`,"table.addRowSuccess":`Row added`,"table.insertRowSuccess":`Row inserted`,"table.deleteRowSuccess":`Row deleted`,"table.copyRowSuccess":`Row copied`,"table.moveUpSuccess":`Row moved up`,"table.moveDownSuccess":`Row moved down`,"table.selectRowFirst":`Select a row first`,"table.selectDeleteRowFirst":`Select a row to delete first`,"table.selectCopyRowFirst":`Select a row to copy first`,"table.firstRow":`This is already the first row`,"table.lastRow":`This is already the last row`,"table.deleteRowContent":`Are you sure you want to delete the selected row? This cannot be undone.`,"table.confirmDeleteRow":`Delete row`,"table.printTargetMissing":`Print target was not found`,"table.downloadTargetMissing":`Download target was not found`,"table.invalidRowKeys":`{count} table row keys are missing or duplicated`,"form.required":`{label} is required`,"search.valueRequired":`Enter a search term or choose a filter`,"search.failed":`Search failed`,"captcha.trigger":`Click to verify`,"captcha.verifying":`Verifying…`,"captcha.success":`Verified`,"captcha.failed":`Verification failed. Try again.`,"captcha.reset":`Verify again`,"captcha.puzzleFailed":`Puzzle verification failed`,"captcha.verifyFailed":`Server verification failed`,"captcha.loadFailed":`Failed to load captcha`}),o=(e,t)=>t?e.replace(/\{([^{}]+)\}/g,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?String(t[n]):e):e;function s(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function c(e){return e===`en-US`?a:i}function l(e,t={},n={},r){let i=t.t??n.t;if(i)return i(e,r);let a=c(t.locale??n.locale);return o(s(t.messages,e)??s(n.messages,e)??s(a,e)??e,r)}function u(i){let a=t()?n(e,{}):{};return{t:(e,t)=>l(e,r(i),a,t)}}export{u as t};
|
|
@@ -52,19 +52,20 @@ interface ImageCropperEmits {
|
|
|
52
52
|
//#region src/components/C_ImageCropper/index.vue.d.ts
|
|
53
53
|
declare const __VLS_export: vue.DefineComponent<ImageCropperProps, ImageCropperExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
54
54
|
error: (error: Error) => any;
|
|
55
|
-
cancel: () => any;
|
|
56
|
-
crop: (result: CropResult) => any;
|
|
57
55
|
ready: () => any;
|
|
56
|
+
crop: (result: CropResult) => any;
|
|
58
57
|
confirm: (result: CropResult) => any;
|
|
58
|
+
cancel: () => any;
|
|
59
59
|
}, string, vue.PublicProps, Readonly<ImageCropperProps> & Readonly<{
|
|
60
60
|
onError?: ((error: Error) => any) | undefined;
|
|
61
|
-
onCancel?: (() => any) | undefined;
|
|
62
|
-
onCrop?: ((result: CropResult) => any) | undefined;
|
|
63
61
|
onReady?: (() => any) | undefined;
|
|
62
|
+
onCrop?: ((result: CropResult) => any) | undefined;
|
|
64
63
|
onConfirm?: ((result: CropResult) => any) | undefined;
|
|
64
|
+
onCancel?: (() => any) | undefined;
|
|
65
65
|
}>, {
|
|
66
|
-
disabled: boolean;
|
|
67
66
|
height: string | number;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
showPreview: boolean;
|
|
68
69
|
showToolbar: boolean;
|
|
69
70
|
src: string;
|
|
70
71
|
aspectRatio: number;
|
|
@@ -72,7 +73,6 @@ declare const __VLS_export: vue.DefineComponent<ImageCropperProps, ImageCropperE
|
|
|
72
73
|
outputQuality: number;
|
|
73
74
|
maxOutputWidth: number;
|
|
74
75
|
maxOutputHeight: number;
|
|
75
|
-
showPreview: boolean;
|
|
76
76
|
circular: boolean;
|
|
77
77
|
modal: boolean;
|
|
78
78
|
modalTitle: string;
|
package/dist/useCropperCore.d.ts
CHANGED
|
@@ -52,19 +52,20 @@ interface ImageCropperEmits {
|
|
|
52
52
|
//#region src/components/C_ImageCropper/index.vue.d.ts
|
|
53
53
|
declare const __VLS_export: vue.DefineComponent<ImageCropperProps, ImageCropperExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
54
54
|
error: (error: Error) => any;
|
|
55
|
-
cancel: () => any;
|
|
56
|
-
crop: (result: CropResult) => any;
|
|
57
55
|
ready: () => any;
|
|
56
|
+
crop: (result: CropResult) => any;
|
|
58
57
|
confirm: (result: CropResult) => any;
|
|
58
|
+
cancel: () => any;
|
|
59
59
|
}, string, vue.PublicProps, Readonly<ImageCropperProps> & Readonly<{
|
|
60
60
|
onError?: ((error: Error) => any) | undefined;
|
|
61
|
-
onCancel?: (() => any) | undefined;
|
|
62
|
-
onCrop?: ((result: CropResult) => any) | undefined;
|
|
63
61
|
onReady?: (() => any) | undefined;
|
|
62
|
+
onCrop?: ((result: CropResult) => any) | undefined;
|
|
64
63
|
onConfirm?: ((result: CropResult) => any) | undefined;
|
|
64
|
+
onCancel?: (() => any) | undefined;
|
|
65
65
|
}>, {
|
|
66
|
-
disabled: boolean;
|
|
67
66
|
height: string | number;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
showPreview: boolean;
|
|
68
69
|
showToolbar: boolean;
|
|
69
70
|
src: string;
|
|
70
71
|
aspectRatio: number;
|
|
@@ -72,7 +73,6 @@ declare const __VLS_export: vue.DefineComponent<ImageCropperProps, ImageCropperE
|
|
|
72
73
|
outputQuality: number;
|
|
73
74
|
maxOutputWidth: number;
|
|
74
75
|
maxOutputHeight: number;
|
|
75
|
-
showPreview: boolean;
|
|
76
76
|
circular: boolean;
|
|
77
77
|
modal: boolean;
|
|
78
78
|
modalTitle: string;
|
|
@@ -119,6 +119,7 @@ declare const __VLS_base: vue.DefineComponent<DraggableProps, {
|
|
|
119
119
|
sort: boolean;
|
|
120
120
|
modelValue: DraggableItem[];
|
|
121
121
|
disabled: boolean;
|
|
122
|
+
direction: "vertical" | "horizontal";
|
|
122
123
|
group: string | GroupOptions;
|
|
123
124
|
animation: number;
|
|
124
125
|
delay: number;
|
|
@@ -134,7 +135,6 @@ declare const __VLS_base: vue.DefineComponent<DraggableProps, {
|
|
|
134
135
|
emptyText: string;
|
|
135
136
|
swapThreshold: number;
|
|
136
137
|
invertSwap: boolean;
|
|
137
|
-
direction: "vertical" | "horizontal";
|
|
138
138
|
layout: LayoutMode;
|
|
139
139
|
gridColumns: number;
|
|
140
140
|
gridRows: number;
|
|
@@ -119,6 +119,7 @@ declare const __VLS_base: vue.DefineComponent<DraggableProps, {
|
|
|
119
119
|
sort: boolean;
|
|
120
120
|
modelValue: DraggableItem[];
|
|
121
121
|
disabled: boolean;
|
|
122
|
+
direction: "vertical" | "horizontal";
|
|
122
123
|
group: string | GroupOptions;
|
|
123
124
|
animation: number;
|
|
124
125
|
delay: number;
|
|
@@ -134,7 +135,6 @@ declare const __VLS_base: vue.DefineComponent<DraggableProps, {
|
|
|
134
135
|
emptyText: string;
|
|
135
136
|
swapThreshold: number;
|
|
136
137
|
invertSwap: boolean;
|
|
137
|
-
direction: "vertical" | "horizontal";
|
|
138
138
|
layout: LayoutMode;
|
|
139
139
|
gridColumns: number;
|
|
140
140
|
gridRows: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`vue`);const t={maxFields:20,autoSave:!1,enableSort:!0,showControls:!0,showItemControls:!0},n=[{label:`文本输入`,value:`input`},{label:`数字输入`,value:`inputNumber`},{label:`多行文本`,value:`textarea`},{label:`下拉选择`,value:`select`},{label:`开关切换`,value:`switch`},{label:`评分组件`,value:`rate`}];function r(e,t){let r=t.label||`动态字段 ${e}`;return{...t,id:t.id?.trim()||`dynamic_field_${e}`,type:t.type||n[0].value,prop:t.prop?.trim()||`dynamic_${e}`,label:r,placeholder:t.placeholder||`请输入${r||`内容`}`,visible:t.visible??!0,removable:t.removable??!0,created:t.created??Date.now(),layout:t.layout||{span:12}}}const i=()=>{let i=(0,e.reactive)({config:{...t},baseFields:[],dynamicFields:[],hiddenFieldIds:new Set,fieldCounter:0,isInitialized:!1}),a=(0,e.computed)(()=>[...i.baseFields,...i.dynamicFields.map(e=>({...e,show:!i.hiddenFieldIds.has(e.prop)}))]),o=(0,e.computed)(()=>a.value.filter(e=>e.show!==!1)),s=(0,e.computed)(()=>i.dynamicFields.length),c=(0,e.computed)(()=>i.hiddenFieldIds.size),l=(0,e.computed)(()=>i.dynamicFields.length<i.config.maxFields),u=(0,e.computed)(()=>i.hiddenFieldIds.size===0),d=(e={})=>{if(!l.value)return null;i.fieldCounter++;let t=r(i.fieldCounter,e);return a.value.some(e=>e.prop===t.prop)?null:(i.dynamicFields.push(t),t)},f=e=>{if(i.dynamicFields.length===0)return null;let t=e??i.dynamicFields.length-1;if(t<0||t>=i.dynamicFields.length||i.dynamicFields[t]?.removable===!1)return null;let n=i.dynamicFields.splice(t,1)[0];return n&&i.hiddenFieldIds.delete(n.prop),n??null},p=()=>{let e=i.dynamicFields.length;return i.dynamicFields.forEach(e=>i.hiddenFieldIds.delete(e.prop)),i.dynamicFields.length=0,i.fieldCounter=0,e},m=e=>a.value.some(t=>t.prop===e)?(i.hiddenFieldIds.has(e)?i.hiddenFieldIds.delete(e):i.hiddenFieldIds.add(e),!i.hiddenFieldIds.has(e)):!1,h=()=>(u.value?i.dynamicFields.forEach(e=>{i.hiddenFieldIds.add(e.prop)}):i.hiddenFieldIds.clear(),u.value),g=e=>{let t={...e};t.maxFields!==void 0&&(t.maxFields=Math.max(0,Math.trunc(t.maxFields))),Object.assign(i.config,t)};return{state:(0,e.readonly)(i),allFields:a,visibleFields:o,dynamicFieldsCount:s,hiddenFieldsCount:c,canAddMoreFields:l,allVisible:u,FIELD_TYPE_OPTIONS:n,addField:d,removeField:f,clearDynamicFields:p,toggleFieldVisibility:m,toggleAllVisibility:h,updateConfig:g,exportConfig:()=>{let e={baseFields:i.baseFields,dynamicFields:i.dynamicFields,config:i.config,hiddenFields:Array.from(i.hiddenFieldIds),timestamp:Date.now()};return JSON.stringify(e,null,2)},initialize:(e,n={})=>{i.baseFields=[...e],i.dynamicFields.length=0,i.hiddenFieldIds.clear(),i.fieldCounter=0,Object.assign(i.config,t),g(n),i.isInitialized=!0}}},a=Symbol(`dynamicFormState`);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ComponentLocale, t as ComponentFeedback } from "./contracts.cjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
|
-
import { CSSProperties, Component, ComputedRef, DeepReadonly, InjectionKey, MaybeRefOrGetter, Ref, Slots, VNode } from "vue";
|
|
3
|
+
import { CSSProperties, Component, ComputedRef, DeepReadonly, InjectionKey, MaybeRefOrGetter, Ref, ShallowRef, Slots, VNode } from "vue";
|
|
4
4
|
import { FormInst, FormItemInst, FormItemRule, FormRules } from "naive-ui";
|
|
5
|
-
import * as naive_ui_es_form_src_interface0 from "naive-ui/es/form/src/interface";
|
|
6
5
|
import { NAIVE_COMBOS, NaiveRule, PRESET_RULES, RuleSpec, RuleSpec as RuleSpec$1, SPEC_RULES } from "@robot-admin/form-validate";
|
|
7
|
-
import * as _vue_shared0 from "@vue/shared";
|
|
8
6
|
|
|
9
7
|
//#region src/components/C_Form/utils/formValidation.d.ts
|
|
10
8
|
/** 原生规则、验证库规则和框架无关规则均可直接作为字段配置。 */
|
|
@@ -139,6 +137,13 @@ interface ItemLayoutConfig {
|
|
|
139
137
|
class?: string;
|
|
140
138
|
style?: CSSProperties | Record<string, unknown>;
|
|
141
139
|
hidden?: boolean;
|
|
140
|
+
suffix?: boolean;
|
|
141
|
+
/** Legacy nested grid attributes; top-level layout values take precedence. */
|
|
142
|
+
grid?: {
|
|
143
|
+
span?: number;
|
|
144
|
+
offset?: number;
|
|
145
|
+
suffix?: boolean;
|
|
146
|
+
};
|
|
142
147
|
}
|
|
143
148
|
/**
|
|
144
149
|
* 网格布局配置
|
|
@@ -150,6 +155,9 @@ interface GridLayoutConfig {
|
|
|
150
155
|
yGutter?: number;
|
|
151
156
|
xGap?: number;
|
|
152
157
|
yGap?: number;
|
|
158
|
+
responsive?: boolean;
|
|
159
|
+
showConfigPanel?: boolean;
|
|
160
|
+
showStats?: boolean;
|
|
153
161
|
}
|
|
154
162
|
/**
|
|
155
163
|
* 内联布局配置
|
|
@@ -157,6 +165,8 @@ interface GridLayoutConfig {
|
|
|
157
165
|
*/
|
|
158
166
|
interface InlineLayoutConfig {
|
|
159
167
|
gap?: number;
|
|
168
|
+
rowGap?: number;
|
|
169
|
+
itemWidth?: number;
|
|
160
170
|
align?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
161
171
|
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
162
172
|
}
|
|
@@ -168,6 +178,10 @@ interface CardLayoutConfig {
|
|
|
168
178
|
groups?: GroupConfig[];
|
|
169
179
|
spacing?: number;
|
|
170
180
|
bordered?: boolean;
|
|
181
|
+
direction?: 'vertical' | 'horizontal';
|
|
182
|
+
showLayoutConfig?: boolean;
|
|
183
|
+
showActionPanel?: boolean;
|
|
184
|
+
showProgress?: boolean;
|
|
171
185
|
}
|
|
172
186
|
/**
|
|
173
187
|
* 标签页布局配置
|
|
@@ -301,7 +315,7 @@ interface SubmitEventPayload<T extends object = FormRecord> {
|
|
|
301
315
|
interface FormInstance<T extends object = FormRecord> {
|
|
302
316
|
validate(): Promise<void>;
|
|
303
317
|
validateField(field: FieldPath<T> | FieldPath<T>[]): Promise<void>;
|
|
304
|
-
validateStep(
|
|
318
|
+
validateStep(step: number | string): Promise<boolean>;
|
|
305
319
|
validateTab(tabKey: string): Promise<boolean>;
|
|
306
320
|
validateDynamicFields(): Promise<boolean>;
|
|
307
321
|
validateCustomGroup(groupKey: string): Promise<boolean>;
|
|
@@ -315,10 +329,10 @@ interface FormInstance<T extends object = FormRecord> {
|
|
|
315
329
|
formRef: FormInst | null;
|
|
316
330
|
formModel: FormModel<T>;
|
|
317
331
|
initialize(): void;
|
|
318
|
-
layoutType:
|
|
319
|
-
shouldShowDefaultActions:
|
|
332
|
+
layoutType: LayoutType;
|
|
333
|
+
shouldShowDefaultActions: boolean;
|
|
320
334
|
/** 表单是否被修改过 */
|
|
321
|
-
isDirty:
|
|
335
|
+
isDirty: boolean;
|
|
322
336
|
/** 获取被修改的字段列表 */
|
|
323
337
|
getChangedFields(): FieldPath<T>[];
|
|
324
338
|
/** 检查某字段是否被修改 */
|
|
@@ -326,13 +340,13 @@ interface FormInstance<T extends object = FormRecord> {
|
|
|
326
340
|
/** 将当前值设为初始快照(常用于编辑模式加载数据后) */
|
|
327
341
|
markAsClean(): void;
|
|
328
342
|
/** 字段异步选项的 loading 状态 */
|
|
329
|
-
asyncLoadingMap:
|
|
343
|
+
asyncLoadingMap: Record<string, boolean>;
|
|
330
344
|
/** 字段异步选项加载错误 */
|
|
331
|
-
asyncErrorMap:
|
|
345
|
+
asyncErrorMap: Record<string, unknown>;
|
|
332
346
|
/** 重新加载全部或指定字段的异步选项 */
|
|
333
347
|
reloadOptions(field?: FieldPath<T>): Promise<void>;
|
|
334
348
|
/** 是否正在提交 */
|
|
335
|
-
isSubmitting:
|
|
349
|
+
isSubmitting: boolean;
|
|
336
350
|
/** 验证并提交,成功返回 true */
|
|
337
351
|
submit(): Promise<boolean>;
|
|
338
352
|
}
|
|
@@ -561,6 +575,15 @@ interface FormRendererContext {
|
|
|
561
575
|
components: ComponentMap;
|
|
562
576
|
}
|
|
563
577
|
type FormRenderer = (baseProps: RendererProps, item: FormOption, config: ResolvedFormConfig, context: FormRendererContext) => VNode | null;
|
|
578
|
+
/** A renderer collection owned by one application or explicitly shared scope. */
|
|
579
|
+
interface FormRendererRegistry {
|
|
580
|
+
get(type: string): FormRenderer | undefined;
|
|
581
|
+
register(type: string, renderer: FormRenderer): () => boolean;
|
|
582
|
+
unregister(type: string, renderer?: FormRenderer): boolean;
|
|
583
|
+
}
|
|
584
|
+
declare const FORM_RENDERER_REGISTRY_KEY: InjectionKey<FormRendererRegistry>;
|
|
585
|
+
/** Create an isolated, reactive registry without copying legacy registrations. */
|
|
586
|
+
declare function createFormRendererRegistry(initial?: Readonly<Record<string, FormRenderer>>): FormRendererRegistry;
|
|
564
587
|
interface UseFormRendererOptions {
|
|
565
588
|
formModel: FormModel;
|
|
566
589
|
visibleOptions: ComputedRef<FormOption[]>;
|
|
@@ -571,14 +594,20 @@ interface UseFormRendererOptions {
|
|
|
571
594
|
asyncOptionsCache: Ref<Record<string, OptionItem[]>>;
|
|
572
595
|
asyncLoadingMap: Ref<Record<string, boolean>>;
|
|
573
596
|
renderers?: ComputedRef<Record<string, FormRenderer> | undefined>;
|
|
597
|
+
/** Overrides application injection. An isolated registry never reads legacy globals. */
|
|
598
|
+
registry?: FormRendererRegistry;
|
|
574
599
|
setFormItemRef?: (field: string, instance: FormItemInst | null) => void;
|
|
575
600
|
onError?: (error: unknown, field: string) => void;
|
|
576
601
|
}
|
|
577
602
|
/**
|
|
578
|
-
*
|
|
603
|
+
* Register a legacy process-wide renderer, used only without an isolated registry.
|
|
604
|
+
* @deprecated Prefer createFormRendererRegistry and application injection.
|
|
579
605
|
*/
|
|
580
606
|
declare function registerRenderer(type: string, renderer: FormRenderer): () => boolean;
|
|
581
|
-
/**
|
|
607
|
+
/**
|
|
608
|
+
* Remove a legacy process-wide renderer, optionally checking its function identity.
|
|
609
|
+
* @deprecated Prefer an application-owned FormRendererRegistry.
|
|
610
|
+
*/
|
|
582
611
|
declare function unregisterRenderer(type: string, renderer?: FormRenderer): boolean;
|
|
583
612
|
/**
|
|
584
613
|
* 渲染引擎 Composable — 生成 formItems VNode 数组
|
|
@@ -607,15 +636,15 @@ declare const __VLS_export: <T extends object = FormRecord>(__VLS_props: NonNull
|
|
|
607
636
|
} & {
|
|
608
637
|
"onUpdate:modelValue"?: ((model: T) => any) | undefined;
|
|
609
638
|
onSubmit?: ((payload: SubmitEventPayload<T>) => any) | undefined;
|
|
610
|
-
"onValidate-success"?: ((model: T) => any) | undefined;
|
|
611
639
|
"onValidate-error"?: ((errors: unknown) => any) | undefined;
|
|
640
|
+
"onValidate-success"?: ((model: T) => any) | undefined;
|
|
612
641
|
}> & (typeof globalThis extends {
|
|
613
642
|
__VLS_PROPS_FALLBACK: infer P;
|
|
614
643
|
} ? P : {});
|
|
615
644
|
expose: (exposed: vue.ShallowUnwrapRef<{
|
|
616
645
|
validate: () => Promise<void>;
|
|
617
646
|
validateField: (field: string | string[]) => Promise<void>;
|
|
618
|
-
validateStep: (
|
|
647
|
+
validateStep: (step: number | string) => Promise<boolean>;
|
|
619
648
|
validateTab: (tabKey: string) => Promise<boolean>;
|
|
620
649
|
validateDynamicFields: () => Promise<boolean>;
|
|
621
650
|
validateCustomGroup: (groupKey: string) => Promise<boolean>;
|
|
@@ -626,32 +655,24 @@ declare const __VLS_export: <T extends object = FormRecord>(__VLS_props: NonNull
|
|
|
626
655
|
setFieldValue: (field: string, value: unknown, shouldValidate?: boolean) => Promise<void>;
|
|
627
656
|
getFieldValue: (field: string) => unknown;
|
|
628
657
|
setFieldsValue: (fields: FormModel, shouldValidate?: boolean) => Promise<void>;
|
|
629
|
-
formRef:
|
|
630
|
-
validate: naive_ui_es_form_src_interface0.FormValidate;
|
|
631
|
-
restoreValidation: () => void;
|
|
632
|
-
invalidateLabelWidth: () => void;
|
|
633
|
-
} | null, FormInst | {
|
|
634
|
-
validate: naive_ui_es_form_src_interface0.FormValidate;
|
|
635
|
-
restoreValidation: () => void;
|
|
636
|
-
invalidateLabelWidth: () => void;
|
|
637
|
-
} | null>;
|
|
658
|
+
formRef: Ref<FormInst | null, FormInst | null>;
|
|
638
659
|
formModel: FormRecord;
|
|
639
660
|
initialize: () => void;
|
|
640
661
|
layoutType: ComputedRef<LayoutType>;
|
|
641
662
|
shouldShowDefaultActions: ComputedRef<boolean>;
|
|
642
|
-
isDirty:
|
|
663
|
+
isDirty: Ref<boolean, boolean>;
|
|
643
664
|
getChangedFields: () => string[];
|
|
644
665
|
isFieldDirty: (field: string) => boolean;
|
|
645
666
|
markAsClean: () => void;
|
|
646
|
-
asyncLoadingMap:
|
|
647
|
-
asyncErrorMap:
|
|
667
|
+
asyncLoadingMap: Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
668
|
+
asyncErrorMap: Ref<Record<string, unknown>, Record<string, unknown>>;
|
|
648
669
|
reloadOptions: (field?: string) => Promise<void>;
|
|
649
|
-
isSubmitting:
|
|
670
|
+
isSubmitting: Ref<boolean, boolean>;
|
|
650
671
|
submit: () => Promise<boolean>;
|
|
651
672
|
}>) => void;
|
|
652
673
|
attrs: any;
|
|
653
674
|
slots: FormSlots<T>;
|
|
654
|
-
emit: ((evt: "update:modelValue", model: T) => void) & ((evt: "submit", payload: SubmitEventPayload<T>) => void) & ((evt: "validate-
|
|
675
|
+
emit: ((evt: "update:modelValue", model: T) => void) & ((evt: "submit", payload: SubmitEventPayload<T>) => void) & ((evt: "validate-error", errors: unknown) => void) & ((evt: "validate-success", model: T) => void);
|
|
655
676
|
}>) => vue.VNode & {
|
|
656
677
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
657
678
|
};
|
|
@@ -668,20 +689,23 @@ interface UseCFormOptions<T extends object> {
|
|
|
668
689
|
options: MaybeRefOrGetter<FormOption<T>[]>;
|
|
669
690
|
config?: MaybeRefOrGetter<FormConfig<T> | undefined>;
|
|
670
691
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
modelValue: any;
|
|
692
|
+
interface UseCFormReturn<T extends object> {
|
|
693
|
+
model: ShallowRef<FormModel<T>>;
|
|
694
|
+
formRef: ShallowRef<FormInstance<T> | null>;
|
|
695
|
+
bindings: ComputedRef<{
|
|
696
|
+
modelValue: FormModel<T>;
|
|
677
697
|
options: FormOption<T>[];
|
|
678
698
|
config: FormConfig<T> | undefined;
|
|
679
699
|
'onUpdate:modelValue': (value: FormModel<T>) => void;
|
|
680
700
|
}>;
|
|
681
701
|
validate: () => Promise<void>;
|
|
682
702
|
submit: () => Promise<boolean>;
|
|
683
|
-
reset: () => void
|
|
684
|
-
|
|
703
|
+
reset: () => void;
|
|
704
|
+
getValues: () => FormModel<T>;
|
|
705
|
+
setValues: (values: Partial<FormModel<T>>, shouldValidate?: boolean) => Promise<void>;
|
|
706
|
+
}
|
|
707
|
+
/** Small binding helper for the common controlled C_Form setup. */
|
|
708
|
+
declare function useCForm<T extends object>(setup: UseCFormOptions<T>): UseCFormReturn<T>;
|
|
685
709
|
//#endregion
|
|
686
710
|
//#region src/components/C_Form/composables/useFormState.d.ts
|
|
687
711
|
type FormEmit = {
|
|
@@ -691,7 +715,7 @@ type FormEmit = {
|
|
|
691
715
|
(event: 'submit', payload: SubmitEventPayload): void;
|
|
692
716
|
};
|
|
693
717
|
/** C_Form state, validation, async options and model synchronization engine. */
|
|
694
|
-
declare function useFormState(options: ComputedRef<FormOption[]>, config: ComputedRef<ResolvedFormConfig>, formRef: Ref<FormInst | null>, emit: FormEmit, externalModel?: ComputedRef<FormModel | undefined>): {
|
|
718
|
+
declare function useFormState(options: ComputedRef<FormOption[]>, config: ComputedRef<ResolvedFormConfig>, formRef: Ref<FormInst | null>, emit: FormEmit, externalModel?: ComputedRef<FormModel | undefined>, validationReady?: ComputedRef<boolean>): {
|
|
695
719
|
formModel: FormRecord;
|
|
696
720
|
formRules: FormRules;
|
|
697
721
|
visibleOptions: ComputedRef<FormOption<FormRecord>[]>;
|
|
@@ -700,7 +724,7 @@ declare function useFormState(options: ComputedRef<FormOption[]>, config: Comput
|
|
|
700
724
|
setFormItemRef: (field: string, instance: FormItemInst | null) => void;
|
|
701
725
|
validate: () => Promise<void>;
|
|
702
726
|
validateField: (field: string | string[]) => Promise<void>;
|
|
703
|
-
validateStep: (
|
|
727
|
+
validateStep: (step: number | string) => Promise<boolean>;
|
|
704
728
|
validateTab: (tabKey: string) => Promise<boolean>;
|
|
705
729
|
validateDynamicFields: () => Promise<boolean>;
|
|
706
730
|
validateCustomGroup: (groupKey: string) => Promise<boolean>;
|
|
@@ -781,4 +805,4 @@ type DynamicFormStateType = DynamicFormController;
|
|
|
781
805
|
*/
|
|
782
806
|
declare const DYNAMIC_FORM_STATE_KEY: unique symbol;
|
|
783
807
|
//#endregion
|
|
784
|
-
export {
|
|
808
|
+
export { FormStepActionsSlotProps as $, ResolvedFormConfig as A, DynamicFormConfig as B, unregisterRenderer as C, FormConfig as D, FORM_GLOBAL_CONFIG_KEY as E, AsyncOptionsContext as F, FormActionSlotProps as G, DynamicFormState as H, CardLayoutConfig as I, FormMode as J, FormErrorContext as K, ComponentType as L, resolveFormConfig as M, shouldShowActions as N, LAYOUTS_WITH_OWN_CONTROLS as O, useFormGlobalConfig as P, FormSlots as Q, CustomLayoutConfig as R, registerRenderer as S, FORM_DEFAULTS as T, FieldPath as U, DynamicFormController as V, FieldPathValue as W, FormOption as X, FormModel as Y, FormRecord as Z, FormRendererContext as _, UseFormDirtyReturn as a, LayoutConfig as at, UseFormRendererOptions as b, UseCFormOptions as c, OptionItem as ct, defineFormOptions as d, TabsLayoutConfig as dt, FormSubmitContext as et, useCForm as f, FormValidationRule as ft, FormRenderer as g, SPEC_RULES as gt, FORM_RENDERER_REGISTRY_KEY as h, RuleSpec$1 as ht, useDynamicFormState as i, LabelPlacement as it, mergeFormConfig as j, LayoutCallbacks as k, UseCFormReturn as l, StepsLayoutConfig as lt, ComponentMap as m, PRESET_RULES$1 as mt, DynamicFormStateType as n, GridLayoutConfig as nt, useFormDirty as o, LayoutType as ot, _default as p, NAIVE_COMBOS$1 as pt, FormInstance as q, FIELD_TYPE_OPTIONS as r, InlineLayoutConfig as rt, useFormState as s, MaybePromise as st, DYNAMIC_FORM_STATE_KEY as t, FormTabActionsSlotProps as tt, defineFormConfig as u, SubmitEventPayload as ut, FormRendererRegistry as v, useFormRenderer as w, createFormRendererRegistry as x, RendererProps as y, DynamicFieldConfig as z };
|