@robot-admin/naive-ui-components 0.31.5 → 0.32.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 +9 -5
- package/README_EN.md +9 -5
- package/dist/C_AutoComplete.cjs +1 -0
- package/dist/C_AutoComplete.css +36 -0
- package/dist/C_AutoComplete.d.cts +4 -0
- package/dist/C_AutoComplete.d.ts +4 -0
- package/dist/C_AutoComplete.js +1 -0
- package/dist/C_AutoComplete2.cjs +1 -0
- package/dist/C_AutoComplete2.js +1 -0
- package/dist/C_AvatarGroup.d.cts +1 -1
- package/dist/C_AvatarGroup.d.ts +1 -1
- package/dist/C_Barcode.d.cts +1 -1
- package/dist/C_Barcode.d.ts +1 -1
- package/dist/C_BatchResult.d.cts +1 -1
- package/dist/C_BatchResult.d.ts +1 -1
- 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.css +198 -31
- package/dist/C_DataPicker.d.cts +2 -2
- package/dist/C_DataPicker.d.ts +2 -2
- package/dist/C_Date.d.cts +1 -1
- package/dist/C_Date.d.ts +1 -1
- package/dist/C_Density.d.cts +1 -1
- package/dist/C_Density.d.ts +1 -1
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_ErrorSummary.d.cts +1 -1
- package/dist/C_ErrorSummary.d.ts +1 -1
- package/dist/C_Form.base.css +68 -1
- package/dist/C_Form.cjs +1 -1
- package/dist/C_Form.css +68 -1
- package/dist/C_Form.d.cts +3 -3
- package/dist/C_Form.d.ts +5 -3
- package/dist/C_Form.js +1 -1
- package/dist/C_FormModal.cjs +1 -1
- package/dist/C_FormModal.d.cts +1 -1
- package/dist/C_FormModal.d.ts +3 -1
- 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 +139 -72
- package/dist/C_FormSearch.d.cts +1 -1
- package/dist/C_FormSearch.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.d.cts +1 -1
- package/dist/C_SectionNav.d.ts +1 -1
- package/dist/C_Select.css +32 -1
- package/dist/C_Select.d.cts +4 -2
- package/dist/C_Select.d.ts +4 -2
- package/dist/C_Select2.cjs +1 -1
- package/dist/C_Select2.js +1 -1
- 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 +68 -1
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.d.cts +1 -1
- package/dist/C_Table.d.ts +11 -8
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +1 -1
- package/dist/C_Table2.js +1 -1
- package/dist/C_TagsView.d.cts +2 -2
- package/dist/C_TagsView.d.ts +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.cjs +1 -1
- package/dist/C_Tree.d.ts +10 -7
- package/dist/C_Tree.js +1 -1
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/OptionStatus.cjs +1 -0
- package/dist/OptionStatus.js +1 -0
- package/dist/constants.d.cts +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/constants5.d.cts +4 -4
- package/dist/constants5.d.ts +4 -4
- package/dist/data.d.cts +2 -1
- package/dist/data.d.ts +2 -1
- package/dist/data2.d.cts +6 -6
- package/dist/data2.d.ts +6 -6
- package/dist/dateRange.d.cts +9 -4
- package/dist/dateRange.d.ts +9 -4
- package/dist/fieldRenderers.cjs +1 -0
- package/dist/fieldRenderers.js +1 -0
- package/dist/formField.cjs +1 -1
- package/dist/formField.d.cts +46 -19
- package/dist/formField.d.ts +46 -19
- package/dist/formField.js +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +62 -58
- package/dist/index.d.ts +62 -57
- 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 +27 -35
- package/dist/index10.vue.d.ts +37 -80
- package/dist/index11.vue.d.cts +37 -80
- package/dist/index11.vue.d.ts +83 -16
- package/dist/index12.vue.d.cts +83 -16
- package/dist/index12.vue.d.ts +16 -59
- package/dist/index13.vue.d.cts +16 -59
- package/dist/index13.vue.d.ts +57 -17
- package/dist/index14.vue.d.cts +57 -17
- package/dist/index14.vue.d.ts +18 -55
- package/dist/index15.vue.d.cts +18 -55
- package/dist/index15.vue.d.ts +53 -124
- package/dist/index16.vue.d.cts +53 -124
- package/dist/index16.vue.d.ts +123 -51
- package/dist/index17.vue.d.cts +123 -51
- package/dist/index17.vue.d.ts +52 -25
- package/dist/index18.vue.d.cts +52 -25
- package/dist/index18.vue.d.ts +25 -12
- package/dist/index19.vue.d.cts +25 -12
- package/dist/index19.vue.d.ts +13 -129
- package/dist/index2.vue.d.cts +26 -82
- package/dist/index2.vue.d.ts +26 -82
- package/dist/index20.vue.d.cts +13 -129
- package/dist/index20.vue.d.ts +129 -76
- package/dist/index21.vue.d.cts +129 -76
- package/dist/index21.vue.d.ts +78 -72
- package/dist/index22.vue.d.cts +75 -97
- package/dist/index22.vue.d.ts +68 -96
- package/dist/index23.vue.d.cts +91 -40
- package/dist/index23.vue.d.ts +91 -40
- package/dist/index24.vue.d.cts +49 -23
- package/dist/index24.vue.d.ts +49 -23
- package/dist/index25.vue.d.cts +19 -46
- package/dist/index25.vue.d.ts +19 -46
- package/dist/index26.vue.d.cts +25 -98
- package/dist/index26.vue.d.ts +25 -98
- package/dist/index27.vue.d.cts +95 -37
- package/dist/index27.vue.d.ts +95 -37
- package/dist/index28.vue.d.cts +34 -8
- package/dist/index28.vue.d.ts +34 -8
- package/dist/index29.vue.d.cts +9 -86
- package/dist/index29.vue.d.ts +9 -86
- package/dist/index3.vue.d.cts +80 -30
- package/dist/index3.vue.d.ts +80 -30
- package/dist/index30.vue.d.cts +85 -99
- package/dist/index30.vue.d.ts +85 -99
- package/dist/index31.vue.d.cts +94 -63
- package/dist/index31.vue.d.ts +94 -63
- package/dist/index32.vue.d.cts +79 -0
- package/dist/index32.vue.d.ts +79 -0
- package/dist/index4.vue.d.cts +30 -19
- package/dist/index4.vue.d.ts +30 -19
- package/dist/index5.vue.d.cts +19 -128
- package/dist/index5.vue.d.ts +17 -34
- package/dist/index6.vue.d.cts +127 -35
- package/dist/index6.vue.d.ts +30 -22
- package/dist/index7.vue.d.cts +30 -22
- package/dist/index7.vue.d.ts +25 -118
- package/dist/index8.vue.d.cts +25 -118
- package/dist/index8.vue.d.ts +112 -21
- package/dist/index9.vue.d.cts +112 -21
- package/dist/index9.vue.d.ts +27 -35
- package/dist/mapUtils.d.cts +3 -3
- package/dist/mapUtils.d.ts +3 -3
- package/dist/optionSource.d.cts +30 -0
- package/dist/optionSource.d.ts +30 -0
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- 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 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/style.css +234 -103
- package/dist/types2.d.cts +29 -103
- package/dist/types2.d.ts +30 -55
- package/dist/types3.d.cts +104 -55
- package/dist/types3.d.ts +60 -0
- package/dist/types4.d.cts +60 -0
- package/dist/types4.d.ts +42 -0
- package/dist/types5.d.cts +42 -0
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +5 -5
- package/dist/useCollapsePanel.d.ts +5 -5
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +9 -9
- package/dist/useCropperCore.d.ts +9 -9
- package/dist/useDataResource.cjs +1 -1
- package/dist/useDataResource.js +1 -1
- package/dist/useDraggableLayout.d.cts +2 -2
- package/dist/useDraggableLayout.d.ts +2 -2
- package/dist/useDynamicFormState.d.cts +15 -1
- package/dist/useDynamicFormState.d.ts +15 -1
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFormConfig.d.cts +5 -2
- package/dist/useFormConfig.d.ts +5 -2
- package/dist/useFormRenderer.d.cts +1 -1
- package/dist/useFormRenderer.d.ts +1 -1
- package/dist/useFullscreen.d.cts +1 -1
- package/dist/useFullscreen.d.ts +1 -1
- package/dist/useGridWidth.cjs +1 -1
- package/dist/useGridWidth.js +1 -1
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +2 -2
- package/dist/useSplitResize.d.ts +2 -2
- package/dist/useTableQuery.d.cts +9 -11
- package/dist/useTableQuery.d.ts +9 -11
- package/dist/useWorkflowValidation.d.cts +33 -33
- package/dist/useWorkflowValidation.d.ts +33 -33
- package/dist/verification.d.cts +5 -5
- package/dist/verification.d.ts +5 -5
- package/docs/architecture.md +3 -1
- package/docs/components.en.md +2 -1
- package/docs/components.md +2 -1
- package/docs/engineering.en.md +11 -1
- package/docs/engineering.md +11 -1
- package/docs/guides/data-picker.md +37 -1
- package/docs/guides/remote-options.md +93 -0
- package/docs/guides/search-workflows.md +99 -2
- package/docs/search-selection-coverage.md +59 -0
- package/docs/wl-ui-produce-coverage.md +2 -0
- package/package.json +6 -3
- package/dist/helpers2.cjs +0 -1
- package/dist/helpers2.js +0 -1
package/dist/C_DataPicker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./types.js";
|
|
2
2
|
import "./useFormConfig.js";
|
|
3
3
|
import "./config2.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as DataPickerNavigation, c as DataPickerRequest, d as DataPickerValue, i as DataPickerHistoryOptions, l as DataPickerSource, n as _default, o as DataPickerNavigationNode, r as DataPickerEmits, s as DataPickerProps, t as createDataPickerField, u as DataPickerSourceInput } from "./formField.js";
|
|
5
5
|
import "./useFormRenderer.js";
|
|
6
|
-
export { _default as C_DataPicker, type DataPickerEmits, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue, createDataPickerField };
|
|
6
|
+
export { _default as C_DataPicker, type DataPickerEmits, type DataPickerHistoryOptions, type DataPickerNavigation, type DataPickerNavigationNode, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue, createDataPickerField };
|
package/dist/C_Date.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DateProps, i as DatePickerMode, n as DateExpose, o as DateRangeValue, r as DateModelValue, s as DateValue, t as DateEmits } from "./
|
|
1
|
+
import { a as DateProps, i as DatePickerMode, n as DateExpose, o as DateRangeValue, r as DateModelValue, s as DateValue, t as DateEmits } from "./types4.cjs";
|
|
2
2
|
import { AllowedComponentProps, ComponentCustomProps, EmitFn, VNode, VNodeProps } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/C_Date/index.d.ts
|
package/dist/C_Date.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DateProps, i as DatePickerMode, n as DateExpose, o as DateRangeValue, r as DateModelValue, s as DateValue, t as DateEmits } from "./
|
|
1
|
+
import { a as DateProps, i as DatePickerMode, n as DateExpose, o as DateRangeValue, r as DateModelValue, s as DateValue, t as DateEmits } from "./types3.js";
|
|
2
2
|
import { AllowedComponentProps, ComponentCustomProps, EmitFn, VNode, VNodeProps } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/C_Date/index.d.ts
|
package/dist/C_Density.d.cts
CHANGED
package/dist/C_Density.d.ts
CHANGED
package/dist/C_Editor.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./
|
|
1
|
+
import { t as _default } from "./index14.vue.cjs";
|
|
2
2
|
export { _default as C_Editor };
|
package/dist/C_Editor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./
|
|
1
|
+
import { t as _default } from "./index13.vue.js";
|
|
2
2
|
export { _default as C_Editor };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as ValidationTarget, t as ValidationIssue } from "./validation.cjs";
|
|
2
|
-
import { n as ErrorSummaryProps, t as _default } from "./
|
|
2
|
+
import { n as ErrorSummaryProps, t as _default } from "./index15.vue.cjs";
|
|
3
3
|
export { _default as C_ErrorSummary, type ErrorSummaryProps, type ValidationIssue, type ValidationTarget };
|
package/dist/C_ErrorSummary.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as ValidationTarget, t as ValidationIssue } from "./validation.js";
|
|
2
|
-
import { n as ErrorSummaryProps, t as _default } from "./
|
|
2
|
+
import { n as ErrorSummaryProps, t as _default } from "./index14.vue.js";
|
|
3
3
|
export { _default as C_ErrorSummary, type ErrorSummaryProps, type ValidationIssue, type ValidationTarget };
|
package/dist/C_Form.base.css
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
@import "./shared-tokens.css";
|
|
2
|
+
.c-option-status {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: 6px 2px;
|
|
8
|
+
color: inherit;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
line-height: 1.5;
|
|
11
|
+
}
|
|
12
|
+
.c-option-status--compact {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
padding: 0;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
.c-option-status button {
|
|
18
|
+
border: 0;
|
|
19
|
+
padding: 0 2px;
|
|
20
|
+
background: transparent;
|
|
21
|
+
color: var(--n-loading-color, var(--n-caret-color, var(--c-primary, #18a058)));
|
|
22
|
+
font: inherit;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
.c-option-status button:focus-visible {
|
|
26
|
+
outline: 2px solid currentColor;
|
|
27
|
+
outline-offset: 2px;
|
|
28
|
+
}
|
|
29
|
+
.c-select-field {
|
|
30
|
+
min-width: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
2
33
|
.c-select {
|
|
3
34
|
min-width: 0;
|
|
4
35
|
max-width: 100%;
|
|
@@ -27,7 +58,43 @@
|
|
|
27
58
|
}
|
|
28
59
|
|
|
29
60
|
/* layer: default */
|
|
30
|
-
.blur[data-v-
|
|
61
|
+
.blur[data-v-cefd9bda]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
62
|
+
|
|
63
|
+
.c-option-status {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
padding: 6px 2px;
|
|
69
|
+
color: inherit;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
line-height: 1.5;
|
|
72
|
+
}
|
|
73
|
+
.c-option-status--compact {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
padding: 0;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
78
|
+
.c-option-status button {
|
|
79
|
+
border: 0;
|
|
80
|
+
padding: 0 2px;
|
|
81
|
+
background: transparent;
|
|
82
|
+
color: var(--n-loading-color, var(--n-caret-color, var(--c-primary, #18a058)));
|
|
83
|
+
font: inherit;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
.c-option-status button:focus-visible {
|
|
87
|
+
outline: 2px solid currentColor;
|
|
88
|
+
outline-offset: 2px;
|
|
89
|
+
}
|
|
90
|
+
.c-auto-complete {
|
|
91
|
+
min-width: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* layer: default */
|
|
96
|
+
.fixed[data-v-52f22b9b]{position:fixed;}
|
|
97
|
+
.blur[data-v-52f22b9b]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
31
98
|
|
|
32
99
|
.c-form[data-v-75867577] .c-form-option-state {
|
|
33
100
|
width: 100%;
|
package/dist/C_Form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk.cjs`);const e=require(`./config.cjs`);require(`./C_Icon2.cjs`);const t=require(`./useFormConfig.cjs`),n=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk.cjs`);const e=require(`./config.cjs`);require(`./C_Icon2.cjs`);const t=require(`./useFormConfig.cjs`),n=require(`./fieldRenderers.cjs`),r=require(`./useDynamicFormState.cjs`);let i=require(`@robot-admin/form-validate`);exports.C_Form=n.o,exports.DYNAMIC_FORM_STATE_KEY=r.t,exports.FIELD_TYPE_OPTIONS=r.n,exports.FORM_DEFAULTS=t.t,exports.FORM_GLOBAL_CONFIG_KEY=e.FORM_GLOBAL_CONFIG_KEY,exports.FORM_RENDERER_REGISTRY_KEY=n.s,exports.LAYOUTS_WITH_OWN_CONTROLS=t.n,Object.defineProperty(exports,`NAIVE_COMBOS`,{enumerable:!0,get:function(){return i.NAIVE_COMBOS}}),Object.defineProperty(exports,`PRESET_RULES`,{enumerable:!0,get:function(){return i.PRESET_RULES}}),Object.defineProperty(exports,`SPEC_RULES`,{enumerable:!0,get:function(){return i.SPEC_RULES}}),exports.createAutoCompleteField=n.t,exports.createFormRendererRegistry=n.c,exports.createSelectField=n.n,exports.defineFormConfig=n.r,exports.defineFormOptions=n.i,exports.mergeFormConfig=t.r,exports.registerRenderer=n.l,exports.resolveFormConfig=t.i,exports.shouldShowActions=t.a,exports.unregisterRenderer=n.u,exports.useCForm=n.a,exports.useDynamicFormState=r.r,exports.useFormDirty=n.p,exports.useFormGlobalConfig=t.o,exports.useFormRenderer=n.d,exports.useFormState=n.f;
|
package/dist/C_Form.css
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
@import "./C_Editor.css";
|
|
2
|
+
.c-option-status {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: 6px 2px;
|
|
8
|
+
color: inherit;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
line-height: 1.5;
|
|
11
|
+
}
|
|
12
|
+
.c-option-status--compact {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
padding: 0;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
.c-option-status button {
|
|
18
|
+
border: 0;
|
|
19
|
+
padding: 0 2px;
|
|
20
|
+
background: transparent;
|
|
21
|
+
color: var(--n-loading-color, var(--n-caret-color, var(--c-primary, #18a058)));
|
|
22
|
+
font: inherit;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
.c-option-status button:focus-visible {
|
|
26
|
+
outline: 2px solid currentColor;
|
|
27
|
+
outline-offset: 2px;
|
|
28
|
+
}
|
|
29
|
+
.c-select-field {
|
|
30
|
+
min-width: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
2
33
|
.c-select {
|
|
3
34
|
min-width: 0;
|
|
4
35
|
max-width: 100%;
|
|
@@ -27,7 +58,43 @@
|
|
|
27
58
|
}
|
|
28
59
|
|
|
29
60
|
/* layer: default */
|
|
30
|
-
.blur[data-v-
|
|
61
|
+
.blur[data-v-cefd9bda]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
62
|
+
|
|
63
|
+
.c-option-status {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
padding: 6px 2px;
|
|
69
|
+
color: inherit;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
line-height: 1.5;
|
|
72
|
+
}
|
|
73
|
+
.c-option-status--compact {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
padding: 0;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
78
|
+
.c-option-status button {
|
|
79
|
+
border: 0;
|
|
80
|
+
padding: 0 2px;
|
|
81
|
+
background: transparent;
|
|
82
|
+
color: var(--n-loading-color, var(--n-caret-color, var(--c-primary, #18a058)));
|
|
83
|
+
font: inherit;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
.c-option-status button:focus-visible {
|
|
87
|
+
outline: 2px solid currentColor;
|
|
88
|
+
outline-offset: 2px;
|
|
89
|
+
}
|
|
90
|
+
.c-auto-complete {
|
|
91
|
+
min-width: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* layer: default */
|
|
96
|
+
.fixed[data-v-52f22b9b]{position:fixed;}
|
|
97
|
+
.blur[data-v-52f22b9b]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
31
98
|
|
|
32
99
|
.c-form[data-v-75867577] .c-form-option-state {
|
|
33
100
|
width: 100%;
|
package/dist/C_Form.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { t as ComponentDensity } from "./density.cjs";
|
|
1
2
|
import { t as OptionsState } from "./options.cjs";
|
|
2
3
|
import { A as FormTabActionsSlotProps, B as TabsLayoutConfig, C as FormMode, D as FormSlots, E as FormRecord, F as LayoutType, G as SPEC_RULES, H as NAIVE_COMBOS, I as MaybePromise, L as OptionItem, M as InlineLayoutConfig, N as LabelPlacement, O as FormStepActionsSlotProps, P as LayoutConfig, R as StepsLayoutConfig, S as FormInstance, T as FormOption, U as PRESET_RULES, V as FormValidationRule, W as RuleSpec, _ as DynamicFormState, a as ResolvedFormConfig, b as FormActionSlotProps, c as shouldShowActions, d as CardLayoutConfig, f as ComponentType, g as DynamicFormController, h as DynamicFormConfig, i as LayoutCallbacks, j as GridLayoutConfig, k as FormSubmitContext, l as useFormGlobalConfig, m as DynamicFieldConfig, n as FormConfig, o as mergeFormConfig, p as CustomLayoutConfig, r as LAYOUTS_WITH_OWN_CONTROLS, s as resolveFormConfig, t as FORM_DEFAULTS, u as AsyncOptionsContext, v as FieldPath, w as FormModel, x as FormErrorContext, y as FieldPathValue, z as SubmitEventPayload } from "./useFormConfig.cjs";
|
|
3
|
-
import { t as ComponentDensity } from "./density.cjs";
|
|
4
4
|
import { FORM_GLOBAL_CONFIG_KEY } from "./config.cjs";
|
|
5
5
|
import { a as FormRendererRegistry, c as createFormRendererRegistry, d as useFormRenderer, i as FormRendererContext, l as registerRenderer, n as FORM_RENDERER_REGISTRY_KEY, o as RendererProps, r as FormRenderer, s as UseFormRendererOptions, t as ComponentMap, u as unregisterRenderer } from "./useFormRenderer.cjs";
|
|
6
|
-
import { a as UseFormDirtyReturn, c as
|
|
7
|
-
export { type AsyncOptionsContext, _default as C_Form, type CardLayoutConfig, type ComponentDensity, type ComponentMap, type ComponentType, type CustomLayoutConfig, DYNAMIC_FORM_STATE_KEY, type DynamicFieldConfig, type DynamicFormConfig, type DynamicFormController, type DynamicFormState, type DynamicFormStateType, FIELD_TYPE_OPTIONS, FORM_DEFAULTS, FORM_GLOBAL_CONFIG_KEY, FORM_RENDERER_REGISTRY_KEY, type FieldPath, type FieldPathValue, type FormActionSlotProps, type FormConfig, type FormErrorContext, type FormInstance, type FormMode, type FormModel, type FormOption, type FormRecord, type FormRenderer, type FormRendererContext, type FormRendererRegistry, type FormSlots, type FormStepActionsSlotProps, type FormSubmitContext, type FormTabActionsSlotProps, type FormValidationRule, type GridLayoutConfig, type InlineLayoutConfig, LAYOUTS_WITH_OWN_CONTROLS, type LabelPlacement, type LayoutCallbacks, type LayoutConfig, type LayoutType, type MaybePromise, NAIVE_COMBOS, type OptionItem, type OptionsState, PRESET_RULES, type RendererProps, type ResolvedFormConfig, type RuleSpec, SPEC_RULES, type StepsLayoutConfig, type SubmitEventPayload, type TabsLayoutConfig, type UseCFormOptions, type UseCFormReturn, type UseFormDirtyReturn, type UseFormRendererOptions, createFormRendererRegistry, defineFormConfig, defineFormOptions, mergeFormConfig, registerRenderer, resolveFormConfig, shouldShowActions, unregisterRenderer, useCForm, useDynamicFormState, useFormDirty, useFormGlobalConfig, useFormRenderer, useFormState };
|
|
6
|
+
import { a as UseFormDirtyReturn, c as createAutoCompleteField, d as UseCFormReturn, f as defineFormConfig, h as _default, i as useDynamicFormState, l as createSelectField, m as useCForm, n as DynamicFormStateType, o as useFormDirty, p as defineFormOptions, r as FIELD_TYPE_OPTIONS, s as useFormState, t as DYNAMIC_FORM_STATE_KEY, u as UseCFormOptions } from "./useDynamicFormState.cjs";
|
|
7
|
+
export { type AsyncOptionsContext, _default as C_Form, type CardLayoutConfig, type ComponentDensity, type ComponentMap, type ComponentType, type CustomLayoutConfig, DYNAMIC_FORM_STATE_KEY, type DynamicFieldConfig, type DynamicFormConfig, type DynamicFormController, type DynamicFormState, type DynamicFormStateType, FIELD_TYPE_OPTIONS, FORM_DEFAULTS, FORM_GLOBAL_CONFIG_KEY, FORM_RENDERER_REGISTRY_KEY, type FieldPath, type FieldPathValue, type FormActionSlotProps, type FormConfig, type FormErrorContext, type FormInstance, type FormMode, type FormModel, type FormOption, type FormRecord, type FormRenderer, type FormRendererContext, type FormRendererRegistry, type FormSlots, type FormStepActionsSlotProps, type FormSubmitContext, type FormTabActionsSlotProps, type FormValidationRule, type GridLayoutConfig, type InlineLayoutConfig, LAYOUTS_WITH_OWN_CONTROLS, type LabelPlacement, type LayoutCallbacks, type LayoutConfig, type LayoutType, type MaybePromise, NAIVE_COMBOS, type OptionItem, type OptionsState, PRESET_RULES, type RendererProps, type ResolvedFormConfig, type RuleSpec, SPEC_RULES, type StepsLayoutConfig, type SubmitEventPayload, type TabsLayoutConfig, type UseCFormOptions, type UseCFormReturn, type UseFormDirtyReturn, type UseFormRendererOptions, createAutoCompleteField, createFormRendererRegistry, createSelectField, defineFormConfig, defineFormOptions, mergeFormConfig, registerRenderer, resolveFormConfig, shouldShowActions, unregisterRenderer, useCForm, useDynamicFormState, useFormDirty, useFormGlobalConfig, useFormRenderer, useFormState };
|
package/dist/C_Form.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { A as FormTabActionsSlotProps, B as TabsLayoutConfig, C as FormMode, D as FormSlots, E as FormRecord, F as LayoutType, G as SPEC_RULES, H as NAIVE_COMBOS, I as MaybePromise, K as OptionsState, L as OptionItem, M as InlineLayoutConfig, N as LabelPlacement, O as FormStepActionsSlotProps, P as LayoutConfig, R as StepsLayoutConfig, S as FormInstance, T as FormOption, U as PRESET_RULES, V as FormValidationRule, W as RuleSpec, _ as DynamicFormState, a as ResolvedFormConfig, b as FormActionSlotProps, c as shouldShowActions, d as CardLayoutConfig, f as ComponentType, g as DynamicFormController, h as DynamicFormConfig, i as LayoutCallbacks, j as GridLayoutConfig, k as FormSubmitContext, l as useFormGlobalConfig, m as DynamicFieldConfig, n as FormConfig, o as mergeFormConfig, p as CustomLayoutConfig, r as LAYOUTS_WITH_OWN_CONTROLS, s as resolveFormConfig, t as FORM_DEFAULTS, u as AsyncOptionsContext, v as FieldPath, w as FormModel, x as FormErrorContext, y as FieldPathValue, z as SubmitEventPayload } from "./useFormConfig.js";
|
|
2
1
|
import { t as ComponentDensity } from "./density.js";
|
|
2
|
+
import "./types2.js";
|
|
3
|
+
import { A as FormTabActionsSlotProps, B as TabsLayoutConfig, C as FormMode, D as FormSlots, E as FormRecord, F as LayoutType, G as SPEC_RULES, H as NAIVE_COMBOS, I as MaybePromise, K as OptionsState, L as OptionItem, M as InlineLayoutConfig, N as LabelPlacement, O as FormStepActionsSlotProps, P as LayoutConfig, R as StepsLayoutConfig, S as FormInstance, T as FormOption, U as PRESET_RULES, V as FormValidationRule, W as RuleSpec, _ as DynamicFormState, a as ResolvedFormConfig, b as FormActionSlotProps, c as shouldShowActions, d as CardLayoutConfig, f as ComponentType, g as DynamicFormController, h as DynamicFormConfig, i as LayoutCallbacks, j as GridLayoutConfig, k as FormSubmitContext, l as useFormGlobalConfig, m as DynamicFieldConfig, n as FormConfig, o as mergeFormConfig, p as CustomLayoutConfig, r as LAYOUTS_WITH_OWN_CONTROLS, s as resolveFormConfig, t as FORM_DEFAULTS, u as AsyncOptionsContext, v as FieldPath, w as FormModel, x as FormErrorContext, y as FieldPathValue, z as SubmitEventPayload } from "./useFormConfig.js";
|
|
3
4
|
import { FORM_GLOBAL_CONFIG_KEY } from "./config.js";
|
|
4
5
|
import { a as FormRendererRegistry, c as createFormRendererRegistry, d as useFormRenderer, i as FormRendererContext, l as registerRenderer, n as FORM_RENDERER_REGISTRY_KEY, o as RendererProps, r as FormRenderer, s as UseFormRendererOptions, t as ComponentMap, u as unregisterRenderer } from "./useFormRenderer.js";
|
|
5
|
-
import { a as UseFormDirtyReturn, c as
|
|
6
|
-
|
|
6
|
+
import { a as UseFormDirtyReturn, c as createAutoCompleteField, d as UseCFormReturn, f as defineFormConfig, h as _default, i as useDynamicFormState, l as createSelectField, m as useCForm, n as DynamicFormStateType, o as useFormDirty, p as defineFormOptions, r as FIELD_TYPE_OPTIONS, s as useFormState, t as DYNAMIC_FORM_STATE_KEY, u as UseCFormOptions } from "./useDynamicFormState.js";
|
|
7
|
+
import "./types4.js";
|
|
8
|
+
export { type AsyncOptionsContext, _default as C_Form, type CardLayoutConfig, type ComponentDensity, type ComponentMap, type ComponentType, type CustomLayoutConfig, DYNAMIC_FORM_STATE_KEY, type DynamicFieldConfig, type DynamicFormConfig, type DynamicFormController, type DynamicFormState, type DynamicFormStateType, FIELD_TYPE_OPTIONS, FORM_DEFAULTS, FORM_GLOBAL_CONFIG_KEY, FORM_RENDERER_REGISTRY_KEY, type FieldPath, type FieldPathValue, type FormActionSlotProps, type FormConfig, type FormErrorContext, type FormInstance, type FormMode, type FormModel, type FormOption, type FormRecord, type FormRenderer, type FormRendererContext, type FormRendererRegistry, type FormSlots, type FormStepActionsSlotProps, type FormSubmitContext, type FormTabActionsSlotProps, type FormValidationRule, type GridLayoutConfig, type InlineLayoutConfig, LAYOUTS_WITH_OWN_CONTROLS, type LabelPlacement, type LayoutCallbacks, type LayoutConfig, type LayoutType, type MaybePromise, NAIVE_COMBOS, type OptionItem, type OptionsState, PRESET_RULES, type RendererProps, type ResolvedFormConfig, type RuleSpec, SPEC_RULES, type StepsLayoutConfig, type SubmitEventPayload, type TabsLayoutConfig, type UseCFormOptions, type UseCFormReturn, type UseFormDirtyReturn, type UseFormRendererOptions, createAutoCompleteField, createFormRendererRegistry, createSelectField, defineFormConfig, defineFormOptions, mergeFormConfig, registerRenderer, resolveFormConfig, shouldShowActions, unregisterRenderer, useCForm, useDynamicFormState, useFormDirty, useFormGlobalConfig, useFormRenderer, useFormState };
|
package/dist/C_Form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FORM_GLOBAL_CONFIG_KEY as e}from"./config.js";import"./C_Icon2.js";import{a as t,i as n,n as r,o as i,r as a,t as o}from"./useFormConfig.js";import{a as s,c,d as l,
|
|
1
|
+
import{FORM_GLOBAL_CONFIG_KEY as e}from"./config.js";import"./C_Icon2.js";import{a as t,i as n,n as r,o as i,r as a,t as o}from"./useFormConfig.js";import{a as s,c,d as l,f as u,i as d,l as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./fieldRenderers.js";import{n as b,r as x,t as S}from"./formValidation.js";import{n as C,r as w,t as T}from"./useDynamicFormState.js";export{m as C_Form,T as DYNAMIC_FORM_STATE_KEY,C as FIELD_TYPE_OPTIONS,o as FORM_DEFAULTS,e as FORM_GLOBAL_CONFIG_KEY,_ as FORM_RENDERER_REGISTRY_KEY,r as LAYOUTS_WITH_OWN_CONTROLS,S as NAIVE_COMBOS,b as PRESET_RULES,x as SPEC_RULES,v as createAutoCompleteField,c as createFormRendererRegistry,p as createSelectField,g as defineFormConfig,d as defineFormOptions,a as mergeFormConfig,f as registerRenderer,n as resolveFormConfig,t as shouldShowActions,y as unregisterRenderer,s as useCForm,w as useDynamicFormState,h as useFormDirty,i as useFormGlobalConfig,l as useFormRenderer,u as useFormState};
|
package/dist/C_FormModal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`),require(`./C_ActionBar2.cjs`),require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`),require(`./C_ActionBar2.cjs`),require(`./fieldRenderers.cjs`);const e=require(`./C_FormModal2.cjs`);exports.C_FormModal=e.t;
|
package/dist/C_FormModal.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FormModalProps, i as FormModalMode, n as FormModalEditor, r as FormModalEmits, t as _default } from "./
|
|
1
|
+
import { a as FormModalProps, i as FormModalMode, n as FormModalEditor, r as FormModalEmits, t as _default } from "./index16.vue.cjs";
|
|
2
2
|
export { _default as C_FormModal, type FormModalEditor, type FormModalEmits, type FormModalMode, type FormModalProps };
|
package/dist/C_FormModal.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import "./types2.js";
|
|
1
2
|
import "./useFormConfig.js";
|
|
2
3
|
import "./useFormRenderer.js";
|
|
3
4
|
import "./useDynamicFormState.js";
|
|
4
|
-
import
|
|
5
|
+
import "./types4.js";
|
|
6
|
+
import { a as FormModalProps, i as FormModalMode, n as FormModalEditor, r as FormModalEmits, t as _default } from "./index15.vue.js";
|
|
5
7
|
export { _default as C_FormModal, type FormModalEditor, type FormModalEmits, type FormModalMode, type FormModalProps };
|
package/dist/C_FormModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./C_Icon2.js";import"./C_ActionBar2.js";import"./
|
|
1
|
+
import"./C_Icon2.js";import"./C_ActionBar2.js";import"./fieldRenderers.js";import{t as e}from"./C_FormModal2.js";export{e as C_FormModal};
|
package/dist/C_FormModal2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./observer.cjs`),n=require(`./data2.cjs`),r=require(`./feedback.cjs`),i=require(`./export-helper.cjs`),a=require(`./useActionTask.cjs`),o=require(`./C_ActionBar2.cjs`),s=require(`./useFormConfig.cjs`),c=require(`./
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./observer.cjs`),n=require(`./data2.cjs`),r=require(`./feedback.cjs`),i=require(`./export-helper.cjs`),a=require(`./useActionTask.cjs`),o=require(`./C_ActionBar2.cjs`),s=require(`./useFormConfig.cjs`),c=require(`./fieldRenderers.cjs`),l=require(`./formModal.cjs`);let u=require(`vue`),d=require(`naive-ui`);const f={key:0,role:`status`,style:{margin:`0 0 8px`}},p=(0,u.defineComponent)({name:`C_FormModal`,__name:`index`,props:{editor:{},options:{},config:{default:()=>({})},renderers:{},width:{default:`min(620px, calc(100vw - 24px))`},createText:{default:`创建`},saveText:{default:`保存`},cancelText:{default:`取消`},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0}},emits:[`submit`,`close`],setup(i,{emit:p}){let m=i,h=p,g=(0,u.ref)(null),_=s.o(),v=(0,u.computed)(()=>s.r(m.config,_)),y=r.t(()=>v.value.feedback),b=(0,u.computed)(()=>m.config?.density??_.density??`compact`),x=(0,u.computed)({get:()=>m.editor.visible.value,set:e=>{e||M()}}),S=(0,u.computed)(()=>m.editor.title.value),C=(0,u.ref)(0),w=(0,u.ref)(!1),T=a.t(),E=(0,u.computed)(()=>T.isRunning(C.value)),D=(0,u.computed)(()=>E.value||m.editor.loading.value||!!g.value?.isSubmitting);(0,u.watch)([()=>m.editor,()=>m.editor.visible.value],([e,t],[n])=>{(t||e!==n)&&(C.value++,w.value=!1)},{flush:`sync`}),(0,u.onScopeDispose)(()=>{C.value++});let O=(0,u.computed)(()=>l.t(m.width,b.value)),k=(0,u.computed)({get:()=>m.editor.model.value??{},set:e=>{E.value||m.editor.setModel(e)}}),A=e=>e===void 0||n.a(e,g.value?.getModel())?!0:(w.value=!0,!1),j=(0,u.computed)(()=>({...m.config,...E.value?{disabled:!0}:{},density:b.value,mode:m.editor.mode.value,showActions:!1,submitSuccessText:``,onSubmit:async(e,r)=>{let{editor:i,config:a}=m,o=C.value;w.value=!1;let s=()=>o===C.value&&!r?.signal.aborted&&i.visible.value,c;a?.onSubmit&&(c=n.t(e.model),await a.onSubmit(e,r));let l=await T.run(o,()=>i.submit(e.model),()=>s()&&A(c));if(!l.executed)return;let u=l.value;if(o!==C.value||!u&&!s())return;h(`submit`,e,u);let d=v.value.submitSuccessText;u&&d&&t.t(()=>y.success(d))}})),M=()=>{D.value||!x.value||(m.editor.close(),h(`close`))},N=(0,u.computed)(()=>{let t=e.t(b.value);return{align:`right`,size:v.value.size??(b.value===`compact`?`tiny`:t.size),gap:t.gap,compact:b.value===`compact`}}),P=(0,u.computed)(()=>o.a([{key:`cancel`,label:m.cancelText,disabled:D,onClick:M},{key:m.editor.mode.value===`create`?`create`:`save`,label:m.editor.mode.value===`create`?m.createText:m.saveText,loading:D,onClick:async()=>{await g.value?.submit()}}]));return(e,t)=>((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(d.NModal),{show:x.value,"onUpdate:show":t[1]||=e=>x.value=e,preset:`card`,title:S.value,"aria-label":S.value,style:(0,u.normalizeStyle)(O.value.shell),"header-style":O.value.header,"content-style":O.value.content,"footer-style":O.value.footer,"footer-class":`c-form-modal__footer`,"mask-closable":i.maskClosable&&!D.value,"close-on-esc":i.closeOnEsc&&!D.value,closable:i.closable&&!D.value,class:(0,u.normalizeClass)([`c-form-modal`,`c-form-modal--${b.value}`])},{footer:(0,u.withCtx)(()=>[w.value?((0,u.openBlock)(),(0,u.createElementBlock)(`p`,f,` 表单已修改,请重新保存。 `)):(0,u.createCommentVNode)(`v-if`,!0),((0,u.openBlock)(),(0,u.createBlock)(o.t,{key:C.value,actions:P.value,config:N.value},null,8,[`actions`,`config`]))]),default:(0,u.withCtx)(()=>[x.value&&i.editor.model.value?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(c.o),{key:C.value,ref_key:`formRef`,ref:g,modelValue:k.value,"onUpdate:modelValue":t[0]||=e=>k.value=e,options:i.options,config:j.value,renderers:i.renderers,inert:E.value},(0,u.createSlots)({_:2},[(0,u.renderList)(e.$slots,(t,n)=>({name:n,fn:(0,u.withCtx)(t=>[(0,u.renderSlot)(e.$slots,n,(0,u.normalizeProps)((0,u.guardReactiveProps)(t)),void 0,!0)])}))]),1032,[`modelValue`,`options`,`config`,`renderers`,`inert`])):(0,u.createCommentVNode)(`v-if`,!0)]),_:3},8,[`show`,`title`,`aria-label`,`style`,`header-style`,`content-style`,`footer-style`,`mask-closable`,`close-on-esc`,`closable`,`class`]))}});var m=i.t(p,[[`__scopeId`,`data-v-ac918c0a`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|
package/dist/C_FormModal2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./density.js";import{t}from"./observer.js";import{a as n,t as r}from"./data2.js";import{t as i}from"./feedback.js";import{t as a}from"./export-helper.js";import{t as o}from"./useActionTask.js";import{a as s,t as c}from"./C_ActionBar2.js";import{o as l,r as u}from"./useFormConfig.js";import{
|
|
1
|
+
import{t as e}from"./density.js";import{t}from"./observer.js";import{a as n,t as r}from"./data2.js";import{t as i}from"./feedback.js";import{t as a}from"./export-helper.js";import{t as o}from"./useActionTask.js";import{a as s,t as c}from"./C_ActionBar2.js";import{o as l,r as u}from"./useFormConfig.js";import{o as d}from"./fieldRenderers.js";import{t as f}from"./formModal.js";import{computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createSlots as _,defineComponent as v,guardReactiveProps as y,normalizeClass as b,normalizeProps as x,normalizeStyle as S,onScopeDispose as C,openBlock as w,ref as T,renderList as E,renderSlot as D,unref as O,watch as k,withCtx as A}from"vue";import{NModal as j}from"naive-ui";const M={key:0,role:`status`,style:{margin:`0 0 8px`}};var N=a(v({name:`C_FormModal`,__name:`index`,props:{editor:{},options:{},config:{default:()=>({})},renderers:{},width:{default:`min(620px, calc(100vw - 24px))`},createText:{default:`创建`},saveText:{default:`保存`},cancelText:{default:`取消`},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0}},emits:[`submit`,`close`],setup(a,{emit:v}){let N=a,P=v,F=T(null),I=l(),L=p(()=>u(N.config,I)),R=i(()=>L.value.feedback),z=p(()=>N.config?.density??I.density??`compact`),B=p({get:()=>N.editor.visible.value,set:e=>{e||Z()}}),V=p(()=>N.editor.title.value),H=T(0),U=T(!1),W=o(),G=p(()=>W.isRunning(H.value)),K=p(()=>G.value||N.editor.loading.value||!!F.value?.isSubmitting);k([()=>N.editor,()=>N.editor.visible.value],([e,t],[n])=>{(t||e!==n)&&(H.value++,U.value=!1)},{flush:`sync`}),C(()=>{H.value++});let q=p(()=>f(N.width,z.value)),J=p({get:()=>N.editor.model.value??{},set:e=>{G.value||N.editor.setModel(e)}}),Y=e=>e===void 0||n(e,F.value?.getModel())?!0:(U.value=!0,!1),X=p(()=>({...N.config,...G.value?{disabled:!0}:{},density:z.value,mode:N.editor.mode.value,showActions:!1,submitSuccessText:``,onSubmit:async(e,n)=>{let{editor:i,config:a}=N,o=H.value;U.value=!1;let s=()=>o===H.value&&!n?.signal.aborted&&i.visible.value,c;a?.onSubmit&&(c=r(e.model),await a.onSubmit(e,n));let l=await W.run(o,()=>i.submit(e.model),()=>s()&&Y(c));if(!l.executed)return;let u=l.value;if(o!==H.value||!u&&!s())return;P(`submit`,e,u);let d=L.value.submitSuccessText;u&&d&&t(()=>R.success(d))}})),Z=()=>{K.value||!B.value||(N.editor.close(),P(`close`))},Q=p(()=>{let t=e(z.value);return{align:`right`,size:L.value.size??(z.value===`compact`?`tiny`:t.size),gap:t.gap,compact:z.value===`compact`}}),$=p(()=>s([{key:`cancel`,label:N.cancelText,disabled:K,onClick:Z},{key:N.editor.mode.value===`create`?`create`:`save`,label:N.editor.mode.value===`create`?N.createText:N.saveText,loading:K,onClick:async()=>{await F.value?.submit()}}]));return(e,t)=>(w(),m(O(j),{show:B.value,"onUpdate:show":t[1]||=e=>B.value=e,preset:`card`,title:V.value,"aria-label":V.value,style:S(q.value.shell),"header-style":q.value.header,"content-style":q.value.content,"footer-style":q.value.footer,"footer-class":`c-form-modal__footer`,"mask-closable":a.maskClosable&&!K.value,"close-on-esc":a.closeOnEsc&&!K.value,closable:a.closable&&!K.value,class:b([`c-form-modal`,`c-form-modal--${z.value}`])},{footer:A(()=>[U.value?(w(),g(`p`,M,` 表单已修改,请重新保存。 `)):h(`v-if`,!0),(w(),m(c,{key:H.value,actions:$.value,config:Q.value},null,8,[`actions`,`config`]))]),default:A(()=>[B.value&&a.editor.model.value?(w(),m(O(d),{key:H.value,ref_key:`formRef`,ref:F,modelValue:J.value,"onUpdate:modelValue":t[0]||=e=>J.value=e,options:a.options,config:X.value,renderers:a.renderers,inert:G.value},_({_:2},[E(e.$slots,(t,n)=>({name:n,fn:A(t=>[D(e.$slots,n,x(y(t)),void 0,!0)])}))]),1032,[`modelValue`,`options`,`config`,`renderers`,`inert`])):h(`v-if`,!0)]),_:3},8,[`show`,`title`,`aria-label`,`style`,`header-style`,`content-style`,`footer-style`,`mask-closable`,`close-on-esc`,`closable`,`class`]))}}),[[`__scopeId`,`data-v-ac918c0a`]]);export{N as t};
|