@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.
Files changed (266) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +9 -5
  3. package/README_EN.md +9 -5
  4. package/dist/C_AutoComplete.cjs +1 -0
  5. package/dist/C_AutoComplete.css +36 -0
  6. package/dist/C_AutoComplete.d.cts +4 -0
  7. package/dist/C_AutoComplete.d.ts +4 -0
  8. package/dist/C_AutoComplete.js +1 -0
  9. package/dist/C_AutoComplete2.cjs +1 -0
  10. package/dist/C_AutoComplete2.js +1 -0
  11. package/dist/C_AvatarGroup.d.cts +1 -1
  12. package/dist/C_AvatarGroup.d.ts +1 -1
  13. package/dist/C_Barcode.d.cts +1 -1
  14. package/dist/C_Barcode.d.ts +1 -1
  15. package/dist/C_BatchResult.d.cts +1 -1
  16. package/dist/C_BatchResult.d.ts +1 -1
  17. package/dist/C_Breadcrumb.d.cts +2 -2
  18. package/dist/C_Breadcrumb.d.ts +1 -1
  19. package/dist/C_Cascade.d.cts +1 -1
  20. package/dist/C_Cascade.d.ts +1 -1
  21. package/dist/C_Chat.d.cts +1 -1
  22. package/dist/C_Chat.d.ts +1 -1
  23. package/dist/C_City.d.cts +1 -1
  24. package/dist/C_City.d.ts +1 -1
  25. package/dist/C_Code.d.cts +1 -1
  26. package/dist/C_Code.d.ts +1 -1
  27. package/dist/C_ContextMenu.d.cts +1 -1
  28. package/dist/C_ContextMenu.d.ts +1 -1
  29. package/dist/C_DataPicker.css +198 -31
  30. package/dist/C_DataPicker.d.cts +2 -2
  31. package/dist/C_DataPicker.d.ts +2 -2
  32. package/dist/C_Date.d.cts +1 -1
  33. package/dist/C_Date.d.ts +1 -1
  34. package/dist/C_Density.d.cts +1 -1
  35. package/dist/C_Density.d.ts +1 -1
  36. package/dist/C_Editor.d.cts +1 -1
  37. package/dist/C_Editor.d.ts +1 -1
  38. package/dist/C_ErrorSummary.d.cts +1 -1
  39. package/dist/C_ErrorSummary.d.ts +1 -1
  40. package/dist/C_Form.base.css +68 -1
  41. package/dist/C_Form.cjs +1 -1
  42. package/dist/C_Form.css +68 -1
  43. package/dist/C_Form.d.cts +3 -3
  44. package/dist/C_Form.d.ts +5 -3
  45. package/dist/C_Form.js +1 -1
  46. package/dist/C_FormModal.cjs +1 -1
  47. package/dist/C_FormModal.d.cts +1 -1
  48. package/dist/C_FormModal.d.ts +3 -1
  49. package/dist/C_FormModal.js +1 -1
  50. package/dist/C_FormModal2.cjs +1 -1
  51. package/dist/C_FormModal2.js +1 -1
  52. package/dist/C_FormSearch.css +139 -72
  53. package/dist/C_FormSearch.d.cts +1 -1
  54. package/dist/C_FormSearch.d.ts +1 -1
  55. package/dist/C_Guide.d.cts +1 -1
  56. package/dist/C_Guide.d.ts +1 -1
  57. package/dist/C_Icon.d.cts +1 -1
  58. package/dist/C_Icon.d.ts +1 -1
  59. package/dist/C_Language.d.cts +1 -1
  60. package/dist/C_Language.d.ts +1 -1
  61. package/dist/C_Loading.d.cts +1 -1
  62. package/dist/C_Loading.d.ts +1 -1
  63. package/dist/C_Login.d.cts +1 -1
  64. package/dist/C_Login.d.ts +1 -1
  65. package/dist/C_Markdown.d.cts +1 -1
  66. package/dist/C_Markdown.d.ts +1 -1
  67. package/dist/C_Menu.d.cts +2 -2
  68. package/dist/C_Menu.d.ts +1 -1
  69. package/dist/C_OrgChart.d.cts +1 -1
  70. package/dist/C_OrgChart.d.ts +1 -1
  71. package/dist/C_Progress.d.cts +1 -1
  72. package/dist/C_Progress.d.ts +1 -1
  73. package/dist/C_SectionNav.d.cts +1 -1
  74. package/dist/C_SectionNav.d.ts +1 -1
  75. package/dist/C_Select.css +32 -1
  76. package/dist/C_Select.d.cts +4 -2
  77. package/dist/C_Select.d.ts +4 -2
  78. package/dist/C_Select2.cjs +1 -1
  79. package/dist/C_Select2.js +1 -1
  80. package/dist/C_Skeleton.d.cts +1 -1
  81. package/dist/C_Skeleton.d.ts +1 -1
  82. package/dist/C_Steps.d.cts +1 -1
  83. package/dist/C_Steps.d.ts +1 -1
  84. package/dist/C_Table.base.css +68 -1
  85. package/dist/C_Table.cjs +1 -1
  86. package/dist/C_Table.d.cts +1 -1
  87. package/dist/C_Table.d.ts +11 -8
  88. package/dist/C_Table.js +1 -1
  89. package/dist/C_Table2.cjs +1 -1
  90. package/dist/C_Table2.js +1 -1
  91. package/dist/C_TagsView.d.cts +2 -2
  92. package/dist/C_TagsView.d.ts +1 -1
  93. package/dist/C_Theme.d.cts +1 -1
  94. package/dist/C_Theme.d.ts +1 -1
  95. package/dist/C_Timeline.d.cts +1 -1
  96. package/dist/C_Timeline.d.ts +1 -1
  97. package/dist/C_Transfer.d.cts +1 -1
  98. package/dist/C_Transfer.d.ts +1 -1
  99. package/dist/C_Tree.cjs +1 -1
  100. package/dist/C_Tree.d.ts +10 -7
  101. package/dist/C_Tree.js +1 -1
  102. package/dist/C_Tree2.cjs +1 -1
  103. package/dist/C_Tree2.js +1 -1
  104. package/dist/OptionStatus.cjs +1 -0
  105. package/dist/OptionStatus.js +1 -0
  106. package/dist/constants.d.cts +2 -2
  107. package/dist/constants.d.ts +2 -2
  108. package/dist/constants2.d.cts +2 -2
  109. package/dist/constants2.d.ts +2 -2
  110. package/dist/constants4.d.cts +5 -5
  111. package/dist/constants4.d.ts +5 -5
  112. package/dist/constants5.d.cts +4 -4
  113. package/dist/constants5.d.ts +4 -4
  114. package/dist/data.d.cts +2 -1
  115. package/dist/data.d.ts +2 -1
  116. package/dist/data2.d.cts +6 -6
  117. package/dist/data2.d.ts +6 -6
  118. package/dist/dateRange.d.cts +9 -4
  119. package/dist/dateRange.d.ts +9 -4
  120. package/dist/fieldRenderers.cjs +1 -0
  121. package/dist/fieldRenderers.js +1 -0
  122. package/dist/formField.cjs +1 -1
  123. package/dist/formField.d.cts +46 -19
  124. package/dist/formField.d.ts +46 -19
  125. package/dist/formField.js +1 -1
  126. package/dist/helpers.cjs +1 -1
  127. package/dist/helpers.js +1 -1
  128. package/dist/index.cjs +1 -1
  129. package/dist/index.d.cts +62 -58
  130. package/dist/index.d.ts +62 -57
  131. package/dist/index.js +1 -1
  132. package/dist/index.vue.d.cts +4 -4
  133. package/dist/index.vue.d.ts +4 -4
  134. package/dist/index10.vue.d.cts +27 -35
  135. package/dist/index10.vue.d.ts +37 -80
  136. package/dist/index11.vue.d.cts +37 -80
  137. package/dist/index11.vue.d.ts +83 -16
  138. package/dist/index12.vue.d.cts +83 -16
  139. package/dist/index12.vue.d.ts +16 -59
  140. package/dist/index13.vue.d.cts +16 -59
  141. package/dist/index13.vue.d.ts +57 -17
  142. package/dist/index14.vue.d.cts +57 -17
  143. package/dist/index14.vue.d.ts +18 -55
  144. package/dist/index15.vue.d.cts +18 -55
  145. package/dist/index15.vue.d.ts +53 -124
  146. package/dist/index16.vue.d.cts +53 -124
  147. package/dist/index16.vue.d.ts +123 -51
  148. package/dist/index17.vue.d.cts +123 -51
  149. package/dist/index17.vue.d.ts +52 -25
  150. package/dist/index18.vue.d.cts +52 -25
  151. package/dist/index18.vue.d.ts +25 -12
  152. package/dist/index19.vue.d.cts +25 -12
  153. package/dist/index19.vue.d.ts +13 -129
  154. package/dist/index2.vue.d.cts +26 -82
  155. package/dist/index2.vue.d.ts +26 -82
  156. package/dist/index20.vue.d.cts +13 -129
  157. package/dist/index20.vue.d.ts +129 -76
  158. package/dist/index21.vue.d.cts +129 -76
  159. package/dist/index21.vue.d.ts +78 -72
  160. package/dist/index22.vue.d.cts +75 -97
  161. package/dist/index22.vue.d.ts +68 -96
  162. package/dist/index23.vue.d.cts +91 -40
  163. package/dist/index23.vue.d.ts +91 -40
  164. package/dist/index24.vue.d.cts +49 -23
  165. package/dist/index24.vue.d.ts +49 -23
  166. package/dist/index25.vue.d.cts +19 -46
  167. package/dist/index25.vue.d.ts +19 -46
  168. package/dist/index26.vue.d.cts +25 -98
  169. package/dist/index26.vue.d.ts +25 -98
  170. package/dist/index27.vue.d.cts +95 -37
  171. package/dist/index27.vue.d.ts +95 -37
  172. package/dist/index28.vue.d.cts +34 -8
  173. package/dist/index28.vue.d.ts +34 -8
  174. package/dist/index29.vue.d.cts +9 -86
  175. package/dist/index29.vue.d.ts +9 -86
  176. package/dist/index3.vue.d.cts +80 -30
  177. package/dist/index3.vue.d.ts +80 -30
  178. package/dist/index30.vue.d.cts +85 -99
  179. package/dist/index30.vue.d.ts +85 -99
  180. package/dist/index31.vue.d.cts +94 -63
  181. package/dist/index31.vue.d.ts +94 -63
  182. package/dist/index32.vue.d.cts +79 -0
  183. package/dist/index32.vue.d.ts +79 -0
  184. package/dist/index4.vue.d.cts +30 -19
  185. package/dist/index4.vue.d.ts +30 -19
  186. package/dist/index5.vue.d.cts +19 -128
  187. package/dist/index5.vue.d.ts +17 -34
  188. package/dist/index6.vue.d.cts +127 -35
  189. package/dist/index6.vue.d.ts +30 -22
  190. package/dist/index7.vue.d.cts +30 -22
  191. package/dist/index7.vue.d.ts +25 -118
  192. package/dist/index8.vue.d.cts +25 -118
  193. package/dist/index8.vue.d.ts +112 -21
  194. package/dist/index9.vue.d.cts +112 -21
  195. package/dist/index9.vue.d.ts +27 -35
  196. package/dist/mapUtils.d.cts +3 -3
  197. package/dist/mapUtils.d.ts +3 -3
  198. package/dist/optionSource.d.cts +30 -0
  199. package/dist/optionSource.d.ts +30 -0
  200. package/dist/presets.d.cts +1 -1
  201. package/dist/presets.d.ts +1 -1
  202. package/dist/resolver.cjs +1 -1
  203. package/dist/resolver.d.cts +1 -1
  204. package/dist/resolver.d.ts +1 -1
  205. package/dist/resolver.js +1 -1
  206. package/dist/serializeSearch.cjs +1 -1
  207. package/dist/serializeSearch.js +1 -1
  208. package/dist/style.css +234 -103
  209. package/dist/types2.d.cts +29 -103
  210. package/dist/types2.d.ts +30 -55
  211. package/dist/types3.d.cts +104 -55
  212. package/dist/types3.d.ts +60 -0
  213. package/dist/types4.d.cts +60 -0
  214. package/dist/types4.d.ts +42 -0
  215. package/dist/types5.d.cts +42 -0
  216. package/dist/useCalendarEvents.d.cts +1 -1
  217. package/dist/useCalendarEvents.d.ts +1 -1
  218. package/dist/useCollapsePanel.d.cts +5 -5
  219. package/dist/useCollapsePanel.d.ts +5 -5
  220. package/dist/useComponentLocale.cjs +1 -1
  221. package/dist/useComponentLocale.js +1 -1
  222. package/dist/useCropperCore.d.cts +9 -9
  223. package/dist/useCropperCore.d.ts +9 -9
  224. package/dist/useDataResource.cjs +1 -1
  225. package/dist/useDataResource.js +1 -1
  226. package/dist/useDraggableLayout.d.cts +2 -2
  227. package/dist/useDraggableLayout.d.ts +2 -2
  228. package/dist/useDynamicFormState.d.cts +15 -1
  229. package/dist/useDynamicFormState.d.ts +15 -1
  230. package/dist/useEdgeInteraction.d.cts +2 -2
  231. package/dist/useEdgeInteraction.d.ts +2 -2
  232. package/dist/useFormConfig.d.cts +5 -2
  233. package/dist/useFormConfig.d.ts +5 -2
  234. package/dist/useFormRenderer.d.cts +1 -1
  235. package/dist/useFormRenderer.d.ts +1 -1
  236. package/dist/useFullscreen.d.cts +1 -1
  237. package/dist/useFullscreen.d.ts +1 -1
  238. package/dist/useGridWidth.cjs +1 -1
  239. package/dist/useGridWidth.js +1 -1
  240. package/dist/useInfiniteScroll.d.cts +2 -2
  241. package/dist/useInfiniteScroll.d.ts +2 -2
  242. package/dist/useQRCode.d.cts +3 -3
  243. package/dist/useQRCode.d.ts +3 -3
  244. package/dist/useSignatureHistory.d.cts +4 -4
  245. package/dist/useSignatureHistory.d.ts +4 -4
  246. package/dist/useSplitResize.d.cts +2 -2
  247. package/dist/useSplitResize.d.ts +2 -2
  248. package/dist/useTableQuery.d.cts +9 -11
  249. package/dist/useTableQuery.d.ts +9 -11
  250. package/dist/useWorkflowValidation.d.cts +33 -33
  251. package/dist/useWorkflowValidation.d.ts +33 -33
  252. package/dist/verification.d.cts +5 -5
  253. package/dist/verification.d.ts +5 -5
  254. package/docs/architecture.md +3 -1
  255. package/docs/components.en.md +2 -1
  256. package/docs/components.md +2 -1
  257. package/docs/engineering.en.md +11 -1
  258. package/docs/engineering.md +11 -1
  259. package/docs/guides/data-picker.md +37 -1
  260. package/docs/guides/remote-options.md +93 -0
  261. package/docs/guides/search-workflows.md +99 -2
  262. package/docs/search-selection-coverage.md +59 -0
  263. package/docs/wl-ui-produce-coverage.md +2 -0
  264. package/package.json +6 -3
  265. package/dist/helpers2.cjs +0 -1
  266. package/dist/helpers2.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import "./types.js";
2
2
  import "./useFormConfig.js";
3
3
  import "./config2.js";
4
- import { a as DataPickerRequest, c as DataPickerValue, i as DataPickerProps, n as _default, o as DataPickerSource, r as DataPickerEmits, s as DataPickerSourceInput, t as createDataPickerField } from "./formField.js";
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 "./types3.cjs";
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 "./types2.js";
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
@@ -1,3 +1,3 @@
1
1
  import { t as ComponentDensity } from "./density.cjs";
2
- import { t as _default } from "./index12.vue.cjs";
2
+ import { t as _default } from "./index13.vue.cjs";
3
3
  export { _default as C_Density, type ComponentDensity };
@@ -1,3 +1,3 @@
1
1
  import { t as ComponentDensity } from "./density.js";
2
- import { t as _default } from "./index11.vue.js";
2
+ import { t as _default } from "./index12.vue.js";
3
3
  export { _default as C_Density, type ComponentDensity };
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./index13.vue.cjs";
1
+ import { t as _default } from "./index14.vue.cjs";
2
2
  export { _default as C_Editor };
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./index12.vue.js";
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 "./index14.vue.cjs";
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 };
@@ -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 "./index13.vue.js";
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 };
@@ -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-e82176d6]{--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);}
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(`./helpers.cjs`),r=require(`./useDynamicFormState.cjs`);let i=require(`@robot-admin/form-validate`);exports.C_Form=n.i,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.a,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.createFormRendererRegistry=n.o,exports.defineFormConfig=n.t,exports.defineFormOptions=n.n,exports.mergeFormConfig=t.r,exports.registerRenderer=n.s,exports.resolveFormConfig=t.i,exports.shouldShowActions=t.a,exports.unregisterRenderer=n.c,exports.useCForm=n.r,exports.useDynamicFormState=r.r,exports.useFormDirty=n.d,exports.useFormGlobalConfig=t.o,exports.useFormRenderer=n.l,exports.useFormState=n.u;
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-e82176d6]{--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);}
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 UseCFormOptions, d as defineFormOptions, f as useCForm, i as useDynamicFormState, l as UseCFormReturn, n as DynamicFormStateType, o as useFormDirty, p as _default, r as FIELD_TYPE_OPTIONS, s as useFormState, t as DYNAMIC_FORM_STATE_KEY, u as defineFormConfig } 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, 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 UseCFormOptions, d as defineFormOptions, f as useCForm, i as useDynamicFormState, l as UseCFormReturn, n as DynamicFormStateType, o as useFormDirty, p as _default, r as FIELD_TYPE_OPTIONS, s as useFormState, t as DYNAMIC_FORM_STATE_KEY, u as defineFormConfig } from "./useDynamicFormState.js";
6
- 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.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,i as u,l as d,n as f,o as p,r as m,s as h,t as g,u as _}from"./helpers.js";import{n as v,r as y,t as b}from"./formValidation.js";import{n as x,r as S,t as C}from"./useDynamicFormState.js";export{u as C_Form,C as DYNAMIC_FORM_STATE_KEY,x as FIELD_TYPE_OPTIONS,o as FORM_DEFAULTS,e as FORM_GLOBAL_CONFIG_KEY,s as FORM_RENDERER_REGISTRY_KEY,r as LAYOUTS_WITH_OWN_CONTROLS,b as NAIVE_COMBOS,v as PRESET_RULES,y as SPEC_RULES,p as createFormRendererRegistry,g as defineFormConfig,f as defineFormOptions,a as mergeFormConfig,h as registerRenderer,n as resolveFormConfig,t as shouldShowActions,c as unregisterRenderer,m as useCForm,S as useDynamicFormState,l as useFormDirty,i as useFormGlobalConfig,d as useFormRenderer,_ as useFormState};
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};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`),require(`./C_ActionBar2.cjs`),require(`./helpers.cjs`);const e=require(`./C_FormModal2.cjs`);exports.C_FormModal=e.t;
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;
@@ -1,2 +1,2 @@
1
- import { a as FormModalProps, i as FormModalMode, n as FormModalEditor, r as FormModalEmits, t as _default } from "./index15.vue.cjs";
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 };
@@ -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 { a as FormModalProps, i as FormModalMode, n as FormModalEditor, r as FormModalEmits, t as _default } from "./index14.vue.js";
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 };
@@ -1 +1 @@
1
- import"./C_Icon2.js";import"./C_ActionBar2.js";import"./helpers.js";import{t as e}from"./C_FormModal2.js";export{e as C_FormModal};
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};
@@ -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(`./helpers.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.i),{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}});
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}});
@@ -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{i as d}from"./helpers.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};
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};