@aplus-frontend/ui 0.2.10 → 0.2.12

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 (145) hide show
  1. package/es/index.mjs +41 -39
  2. package/es/src/ap-form/ap-form.vue.d.ts +4 -0
  3. package/es/src/ap-form/ap-form.vue2.mjs +131 -108
  4. package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  5. package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
  6. package/es/src/ap-form/interface.d.ts +8 -0
  7. package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
  8. package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
  9. package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
  10. package/es/src/ap-form/search-form/index.vue.mjs +37 -31
  11. package/es/src/ap-form/utils/params.d.ts +17 -0
  12. package/es/src/ap-form/utils/params.mjs +19 -0
  13. package/es/src/ap-list/index.vue.d.ts +1 -0
  14. package/es/src/ap-list/index.vue.mjs +85 -79
  15. package/es/src/ap-list/interface.d.ts +7 -0
  16. package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
  17. package/es/src/ap-table/interface.d.ts +1 -0
  18. package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  19. package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
  20. package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  21. package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
  22. package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  23. package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
  24. package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  25. package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
  26. package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
  27. package/es/src/business/ap-group-search/index.d.ts +28 -0
  28. package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  29. package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
  30. package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
  31. package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
  32. package/es/src/business/ap-image/ApImage.vue2.mjs +16 -14
  33. package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
  34. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  35. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
  36. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
  37. package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  38. package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  39. package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  40. package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  41. package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  42. package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
  43. package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  44. package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
  45. package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  46. package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
  47. package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  48. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
  49. package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  50. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
  51. package/es/src/business/ap-upload-file/index.d.ts +3 -0
  52. package/es/src/business/ap-upload-file/index.mjs +2 -0
  53. package/es/src/business/ap-upload-file/interface.d.ts +29 -0
  54. package/es/src/business/ap-upload-file/interface.mjs +1 -0
  55. package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  56. package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
  57. package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  58. package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
  59. package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  60. package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
  61. package/es/src/business/index.d.ts +1 -0
  62. package/es/src/business/index.mjs +43 -42
  63. package/es/src/config-provider/config-provider.d.ts +8 -0
  64. package/es/src/config-provider/css-var.d.ts +8 -0
  65. package/es/src/config-provider/css-var.mjs +25 -9
  66. package/es/src/config-provider/index.d.ts +48 -0
  67. package/es/src/index.mjs +33 -31
  68. package/es/src/locale/lang/en.mjs +1 -1
  69. package/es/src/locale/lang/zh-cn.mjs +1 -1
  70. package/es/src/path-map.mjs +3 -1
  71. package/es/src/utils/index.d.ts +12 -0
  72. package/es/src/utils/index.mjs +27 -18
  73. package/lib/index.js +1 -1
  74. package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
  75. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  76. package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  77. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  78. package/lib/src/ap-form/interface.d.ts +8 -0
  79. package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
  80. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  81. package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
  82. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  83. package/lib/src/ap-form/utils/params.d.ts +17 -0
  84. package/lib/src/ap-form/utils/params.js +1 -0
  85. package/lib/src/ap-list/index.vue.d.ts +1 -0
  86. package/lib/src/ap-list/index.vue.js +1 -1
  87. package/lib/src/ap-list/interface.d.ts +7 -0
  88. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  89. package/lib/src/ap-table/interface.d.ts +1 -0
  90. package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  91. package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
  92. package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  93. package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
  94. package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  95. package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
  96. package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  97. package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
  98. package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
  99. package/lib/src/business/ap-group-search/index.d.ts +28 -0
  100. package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  101. package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
  102. package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
  103. package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
  104. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  105. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  106. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  107. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
  108. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
  109. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  110. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  111. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  112. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  113. package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  114. package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
  115. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  116. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
  117. package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  118. package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
  119. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  120. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
  121. package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  122. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
  123. package/lib/src/business/ap-upload-file/index.d.ts +3 -0
  124. package/lib/src/business/ap-upload-file/index.js +1 -0
  125. package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
  126. package/lib/src/business/ap-upload-file/interface.js +1 -0
  127. package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  128. package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
  129. package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  130. package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
  131. package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  132. package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
  133. package/lib/src/business/index.d.ts +1 -0
  134. package/lib/src/business/index.js +1 -1
  135. package/lib/src/config-provider/config-provider.d.ts +8 -0
  136. package/lib/src/config-provider/css-var.d.ts +8 -0
  137. package/lib/src/config-provider/css-var.js +1 -1
  138. package/lib/src/config-provider/index.d.ts +48 -0
  139. package/lib/src/index.js +1 -1
  140. package/lib/src/locale/lang/en.js +1 -1
  141. package/lib/src/locale/lang/zh-cn.js +1 -1
  142. package/lib/src/path-map.js +1 -1
  143. package/lib/src/utils/index.d.ts +12 -0
  144. package/lib/src/utils/index.js +1 -1
  145. package/package.json +4 -4
package/es/index.mjs CHANGED
@@ -4,15 +4,15 @@ import "./src/hooks/index.mjs";
4
4
  import { configProviderProps as d } from "./src/config-provider/config-provider-props.mjs";
5
5
  import { configProviderContextKey as u } from "./src/config-provider/constants.mjs";
6
6
  import { keysOf as i, provideGlobalConfig as n, useGlobalConfig as c } from "./src/config-provider/hooks/use-global-config.mjs";
7
- import { buildLocaleContext as b, buildTranslator as T, localeContextKey as I, translate as C, useLocale as g } from "./src/config-provider/hooks/use-locale.mjs";
7
+ import { buildLocaleContext as b, buildTranslator as T, localeContextKey as I, translate as g, useLocale as C } from "./src/config-provider/hooks/use-locale.mjs";
8
8
  import { defaultNamespace as S, namespaceContextKey as h, useGetDerivedNamespace as G, useNamespace as y } from "./src/config-provider/hooks/use-namespace.mjs";
9
9
  import { ConfigProvider as P, globalConfigCached as L } from "./src/config-provider/config-provider.mjs";
10
10
  import { APConfigProvider as k } from "./src/config-provider/index.mjs";
11
11
  import { ApFormItemText as R } from "./src/ap-form/items/text/index.mjs";
12
12
  import { default as E } from "./src/ap-form/items/text-area/index.vue.mjs";
13
13
  import { default as K } from "./src/ap-form/items/number/index.vue.mjs";
14
- import { default as W } from "./src/ap-form/items/date/index.vue.mjs";
15
- import { default as U } from "./src/ap-form/items/date-range/index.vue.mjs";
14
+ import { default as U } from "./src/ap-form/items/date/index.vue.mjs";
15
+ import { default as H } from "./src/ap-form/items/date-range/index.vue.mjs";
16
16
  import { default as $ } from "./src/ap-form/items/radio/index.vue.mjs";
17
17
  import { default as q } from "./src/ap-form/items/select/index.vue.mjs";
18
18
  import { default as J } from "./src/ap-form/items/switch/index.vue.mjs";
@@ -29,7 +29,7 @@ import { default as ie } from "./src/ap-form/set/index.vue.mjs";
29
29
  import { default as ce } from "./src/ap-form/drawer-form/index.vue.mjs";
30
30
  import { ApField as be } from "./src/ap-field/index.mjs";
31
31
  import { ApFieldText as Ie } from "./src/ap-field/text/index.mjs";
32
- import { default as ge } from "./src/ap-field/checkbox/index.vue.mjs";
32
+ import { default as Ce } from "./src/ap-field/checkbox/index.vue.mjs";
33
33
  import { default as Se } from "./src/ap-field/date/index.vue.mjs";
34
34
  import { default as Ge } from "./src/ap-field/number/index.vue.mjs";
35
35
  import { default as Ne } from "./src/ap-field/radio/index.vue.mjs";
@@ -38,8 +38,8 @@ import { default as ke } from "./src/ap-field/text-area/index.vue.mjs";
38
38
  import { default as Re } from "./src/ap-field/date-range/index.vue.mjs";
39
39
  import { default as Ee } from "./src/ap-field/select/index.vue.mjs";
40
40
  import { default as Ke } from "./src/ap-field/text/password.vue.mjs";
41
- import { default as We } from "./src/ap-field/slider/index.vue.mjs";
42
- import { default as Ue } from "./src/ap-field/segmented/index.vue.mjs";
41
+ import { default as Ue } from "./src/ap-field/slider/index.vue.mjs";
42
+ import { default as He } from "./src/ap-field/segmented/index.vue.mjs";
43
43
  import { default as $e } from "./src/ap-field/rate/index.vue.mjs";
44
44
  import { adminToken as qe, aplusToken as ze } from "./src/design-token/index.mjs";
45
45
  import { ApActionItem as Qe } from "./src/ap-action/index.mjs";
@@ -54,7 +54,7 @@ import { default as Ao } from "./src/ap-tag/ap-tag.vue.mjs";
54
54
  import { default as no } from "./src/ap-tag/ap-tag-group.vue.mjs";
55
55
  import { default as Fo } from "./src/ap-info-layout/ApInfoLayout.vue.mjs";
56
56
  import { NeedNameKeyDefault as To } from "./src/ap-upload/apUploadTypes.mjs";
57
- import { default as Co } from "./src/ap-upload/apUpload.vue.mjs";
57
+ import { default as go } from "./src/ap-upload/apUpload.vue.mjs";
58
58
  import { ApDownLoadNeedNameKeyDefault as Do } from "./src/ap-download/interface.mjs";
59
59
  import { default as ho } from "./src/ap-download/ap-download.vue.mjs";
60
60
  import { CheckCard as yo } from "./src/check-card/index.mjs";
@@ -64,7 +64,7 @@ import { default as wo } from "./src/ap-list/index.vue.mjs";
64
64
  import { default as vo } from "./src/ap-button/ap-button.vue.mjs";
65
65
  import { default as Bo } from "./src/ap-button/ap-action-button.vue.mjs";
66
66
  import { ApTransformDataHelper as Oo } from "./src/utils/ap-trans-data/index.mjs";
67
- import { default as Ho } from "./src/business/ap-table-modal/index.mjs";
67
+ import { default as Wo } from "./src/business/ap-table-modal/index.mjs";
68
68
  import { useTableModal as Vo } from "./src/business/ap-table-modal/hooks/use-table-modal.mjs";
69
69
  import { useTableSelectModal as jo } from "./src/business/ap-table-modal/hooks/use-table-select-modal.mjs";
70
70
  import { ApAttachment as zo } from "./src/business/ap-attachment/index.mjs";
@@ -81,24 +81,25 @@ import { ApInputRadio as Ar } from "./src/business/ap-input-radio/index.mjs";
81
81
  import { ApLabel as nr, ApLabelGroup as cr } from "./src/business/ap-label/index.mjs";
82
82
  import { locales as br } from "./src/business/ap-ladder/interface.mjs";
83
83
  import { ApLadder as Ir } from "./src/business/ap-ladder/index.mjs";
84
- import { ApSelectLayout as gr } from "./src/business/ap-select-layout/index.mjs";
84
+ import { ApSelectLayout as Cr } from "./src/business/ap-select-layout/index.mjs";
85
85
  import { ApStatus as Sr, ApStatusGroup as hr } from "./src/business/ap-status/index.mjs";
86
86
  import { ApTitle as yr } from "./src/business/ap-title/index.mjs";
87
87
  import { usePageListApTable as Pr } from "./src/business/hooks/usePageListApTable.mjs";
88
88
  import { useTableRefresh as Mr } from "./src/business/hooks/useTableRefresh.mjs";
89
89
  import { computedRecords as wr, flattenColumns as Rr, formatDataIndex as vr, formatNumber as Er } from "./src/business/ap-summary/utils.mjs";
90
90
  import { ApSummary as Kr } from "./src/business/ap-summary/index.mjs";
91
- import { ApNeedNameKeyDefault as Wr } from "./src/business/ap-appendix/interface.mjs";
92
- import { ApAppendix as Ur } from "./src/business/ap-appendix/index.mjs";
91
+ import { ApNeedNameKeyDefault as Ur } from "./src/business/ap-appendix/interface.mjs";
92
+ import { ApAppendix as Hr } from "./src/business/ap-appendix/index.mjs";
93
93
  import { ApExtensionSelect as $r, ApGroupSearch as jr, ApPopoverSelect as qr } from "./src/business/ap-group-search/index.mjs";
94
- import { useTablePaging as Jr } from "./src/ap-table/hooks/use-table-paging.mjs";
95
- import { ApTable as Xr } from "./src/ap-table/index.mjs";
96
- import { default as Zr } from "./src/editable-table/index.vue.mjs";
97
- import { default as et } from "./src/editable-table/form-item.vue.mjs";
98
- import { default as rt } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
99
- import { ApScrollBar as pt } from "./src/ap-scroll-bar/index.mjs";
100
- import { useMessage as ft } from "./src/hooks/useMessage.mjs";
101
- import { useControllableValue as lt } from "./src/hooks/useControllableValue.mjs";
94
+ import { default as Jr } from "./src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs";
95
+ import { useTablePaging as Xr } from "./src/ap-table/hooks/use-table-paging.mjs";
96
+ import { ApTable as Zr } from "./src/ap-table/index.mjs";
97
+ import { default as et } from "./src/editable-table/index.vue.mjs";
98
+ import { default as rt } from "./src/editable-table/form-item.vue.mjs";
99
+ import { default as pt } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
100
+ import { ApScrollBar as ft } from "./src/ap-scroll-bar/index.mjs";
101
+ import { useMessage as lt } from "./src/hooks/useMessage.mjs";
102
+ import { useControllableValue as dt } from "./src/hooks/useControllableValue.mjs";
102
103
  const a = {
103
104
  install: (r) => {
104
105
  for (const t in o) {
@@ -115,14 +116,14 @@ export {
115
116
  oo as ApActionItemDropdown,
116
117
  Ye as ApActionItemModal,
117
118
  _e as ApActionItemPopconfirm,
118
- Ur as ApAppendix,
119
+ Hr as ApAppendix,
119
120
  zo as ApAttachment,
120
121
  Qo as ApBatchAction,
121
122
  Yo as ApBatchActionGroup,
122
123
  vo as ApButton,
123
124
  _o as ApButtonGroup,
124
125
  or as ApCard,
125
- rt as ApDescriptions,
126
+ pt as ApDescriptions,
126
127
  Do as ApDownLoadNeedNameKeyDefault,
127
128
  ho as ApDownload,
128
129
  tr as ApExpandAlert,
@@ -130,16 +131,16 @@ export {
130
131
  ar as ApExportGroupActionType,
131
132
  $r as ApExtensionSelect,
132
133
  be as ApField,
133
- ge as ApFieldCheckbox,
134
+ Ce as ApFieldCheckbox,
134
135
  Se as ApFieldDate,
135
136
  Re as ApFieldDateRange,
136
137
  Ge as ApFieldNumber,
137
138
  Ke as ApFieldPassword,
138
139
  Ne as ApFieldRadio,
139
140
  $e as ApFieldRate,
140
- Ue as ApFieldSegmented,
141
+ He as ApFieldSegmented,
141
142
  Ee as ApFieldSelect,
142
- We as ApFieldSlider,
143
+ Ue as ApFieldSlider,
143
144
  Le as ApFieldSwitch,
144
145
  Ie as ApFieldText,
145
146
  ke as ApFieldTextArea,
@@ -148,8 +149,8 @@ export {
148
149
  ce as ApFormDrawerForm,
149
150
  re as ApFormItem,
150
151
  X as ApFormItemCheckbox,
151
- W as ApFormItemDate,
152
- U as ApFormItemDateRange,
152
+ U as ApFormItemDate,
153
+ H as ApFormItemDateRange,
153
154
  pe as ApFormItemGroup,
154
155
  K as ApFormItemNumber,
155
156
  $ as ApFormItemRadio,
@@ -171,26 +172,27 @@ export {
171
172
  Ir as ApLadder,
172
173
  wo as ApList,
173
174
  Mo as ApModal,
174
- Wr as ApNeedNameKeyDefault,
175
+ Ur as ApNeedNameKeyDefault,
175
176
  qr as ApPopoverSelect,
176
- pt as ApScrollBar,
177
- gr as ApSelectLayout,
177
+ ft as ApScrollBar,
178
+ Cr as ApSelectLayout,
178
179
  Sr as ApStatus,
179
180
  hr as ApStatusGroup,
180
181
  Kr as ApSummary,
181
- Xr as ApTable,
182
- Ho as ApTableModal,
182
+ Zr as ApTable,
183
+ Wo as ApTableModal,
183
184
  Ao as ApTag,
184
185
  no as ApTagGroup,
185
186
  yr as ApTitle,
186
187
  Oo as ApTransformDataHelper,
187
- Co as ApUpload,
188
+ go as ApUpload,
189
+ Jr as ApUploadSingle,
188
190
  yo as CheckCard,
189
191
  Po as CheckCardGroup,
190
192
  P as ConfigProvider,
191
193
  ao as DictCode,
192
- Zr as EditableTable,
193
- et as EditableTableFormItem,
194
+ et as EditableTable,
195
+ rt as EditableTableFormItem,
194
196
  To as NeedNameKeyDefault,
195
197
  so as WorkOrderModal,
196
198
  qe as adminToken,
@@ -215,16 +217,16 @@ export {
215
217
  h as namespaceContextKey,
216
218
  l as pathMap,
217
219
  n as provideGlobalConfig,
218
- C as translate,
219
- lt as useControllableValue,
220
+ g as translate,
221
+ dt as useControllableValue,
220
222
  G as useGetDerivedNamespace,
221
223
  c as useGlobalConfig,
222
- g as useLocale,
223
- ft as useMessage,
224
+ C as useLocale,
225
+ lt as useMessage,
224
226
  y as useNamespace,
225
227
  Pr as usePageListApTable,
226
228
  Vo as useTableModal,
227
- Jr as useTablePaging,
229
+ Xr as useTablePaging,
228
230
  Mr as useTableRefresh,
229
231
  jo as useTableSelectModal
230
232
  };
@@ -1,5 +1,6 @@
1
1
  import { ApFormProps, RegistedFieldType, WatchFunc } from './interface';
2
2
  import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, RuleObject, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
3
+ import { Recordable } from '../type';
3
4
  import { CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, DefineComponent, PublicProps } from 'vue';
4
5
  import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
5
6
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
@@ -895,6 +896,7 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
895
896
  labelAlign: string;
896
897
  validateOnRuleChange: boolean;
897
898
  validateTrigger: string;
899
+ syncToUrl: boolean;
898
900
  }>, {
899
901
  resetFields: () => Promise<void>;
900
902
  clearValidate: (name?: NamePath | NamePath[]) => void;
@@ -921,6 +923,7 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
921
923
  labelAlign: string;
922
924
  validateOnRuleChange: boolean;
923
925
  validateTrigger: string;
926
+ syncToUrl: boolean;
924
927
  }>>>, {
925
928
  layout: string;
926
929
  colon: boolean;
@@ -928,6 +931,7 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
928
931
  validateTrigger: string | string[];
929
932
  hideRequiredMark: boolean;
930
933
  validateOnRuleChange: boolean;
934
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
931
935
  }, {}>;
932
936
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
933
937
  export default _default;
@@ -1,11 +1,13 @@
1
- import { defineComponent as D, ref as L, reactive as k, nextTick as K, toRaw as b, computed as $, openBlock as G, createBlock as H, unref as B, mergeProps as J, withCtx as Q, renderSlot as U } from "vue";
2
- import { Form as X } from "@aplus-frontend/antdv";
3
- import { useProvideForm as Y } from "./context.mjs";
4
- import { isArray as f, cloneDeep as I, isFunction as m, isPlainObject as _, omit as Z } from "lodash-unified";
5
- import { INTERNAL_FORM_INSTANCE_MARK as ee } from "./constant.mjs";
6
- import { isDef as y } from "../utils/index.mjs";
7
- import te from "./utils/set.mjs";
8
- const ue = /* @__PURE__ */ D({
1
+ import { defineComponent as $, ref as M, reactive as G, unref as m, nextTick as H, toRaw as O, computed as J, openBlock as Q, createBlock as X, mergeProps as Y, withCtx as Z, renderSlot as ee } from "vue";
2
+ import { Form as te } from "@aplus-frontend/antdv";
3
+ import { useProvideForm as le } from "./context.mjs";
4
+ import { isArray as f, cloneDeep as oe, isFunction as V, isPlainObject as R, omit as re } from "lodash-unified";
5
+ import { useUrlSearchParams as se } from "@vueuse/core";
6
+ import { INTERNAL_FORM_INSTANCE_MARK as ie } from "./constant.mjs";
7
+ import { getRouteType as ne, isDef as U } from "../utils/index.mjs";
8
+ import ae from "./utils/set.mjs";
9
+ import { genParams as _, setToParams as w } from "./utils/params.mjs";
10
+ const ye = /* @__PURE__ */ $({
9
11
  __name: "ap-form",
10
12
  props: {
11
13
  layout: { default: "horizontal" },
@@ -31,101 +33,122 @@ const ue = /* @__PURE__ */ D({
31
33
  onFinish: {},
32
34
  onFinishFailed: {},
33
35
  onValidate: {},
34
- initialValues: {}
36
+ initialValues: {},
37
+ syncToUrl: { type: [Boolean, Function], default: !1 },
38
+ syncToUrlPriority: { type: Boolean }
35
39
  },
36
- setup(M, { expose: O }) {
37
- const a = M;
38
- function g(e, t, l = !0) {
39
- var s;
40
+ setup(E, { expose: j }) {
41
+ const s = E;
42
+ function y(e, t, l = !0) {
43
+ var i;
40
44
  if (f(e)) {
41
- let o = r;
45
+ let r = n;
42
46
  for (let u = 0; u < e.length - 1; u++)
43
- e[u] in o || (o[e[u]] = {}), o = o[e[u]];
44
- o[e[e.length - 1]] = t;
47
+ e[u] in r || (r[e[u]] = {}), r = r[e[u]];
48
+ r[e[e.length - 1]] = t;
45
49
  } else
46
- r[e] = t;
47
- let i = f(e) ? e[0] : e;
48
- l && ((s = a.onValuesChange) == null || s.call(a, { [i]: r[i] }, r)), h();
50
+ n[e] = t;
51
+ let o = f(e) ? e[0] : e;
52
+ l && ((i = s.onValuesChange) == null || i.call(s, { [o]: n[o] }, n)), g();
53
+ }
54
+ const a = M(), v = se(ne()), B = M(
55
+ s.syncToUrl ? _(s.syncToUrl, v, "get") : {}
56
+ );
57
+ let h = oe(I()), d = {};
58
+ const n = G(I());
59
+ let F = [];
60
+ function I() {
61
+ const e = s.initialValues || {};
62
+ return s.syncToUrlPriority ? {
63
+ ...e,
64
+ ...m(B)
65
+ } : {
66
+ ...m(B),
67
+ ...e
68
+ };
49
69
  }
50
- function w(e) {
70
+ function x(e) {
51
71
  var l;
52
- const t = p(e, c);
53
- (l = a.onFinish) == null || l.call(a, t);
72
+ const t = p(e, d);
73
+ s.syncToUrl && w(v, _(s.syncToUrl, t, "set")), (l = s.onFinish) == null || l.call(s, t);
54
74
  }
55
- const n = L();
56
- let v = a.initialValues ? I(a.initialValues) : {}, c = {};
57
- const r = k(a.initialValues || {});
58
- let F = [];
59
- const E = async () => {
75
+ const A = async () => {
60
76
  var e;
61
- (e = n.value) == null || e.resetFields(), await K(() => {
62
- Object.keys(r).forEach((t) => delete r[t]), Object.assign(r, I(v)), h();
77
+ (e = a.value) == null || e.resetFields(), await H(() => {
78
+ Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, h), g(), s.syncToUrl && w(
79
+ v,
80
+ _(
81
+ s.syncToUrl,
82
+ p(h, d),
83
+ "set"
84
+ )
85
+ );
63
86
  });
64
- }, j = (e) => {
87
+ }, N = (e) => {
65
88
  var t;
66
- (t = n.value) == null || t.clearValidate(e);
67
- }, x = (e, t) => {
89
+ (t = a.value) == null || t.clearValidate(e);
90
+ }, S = (e, t) => {
68
91
  var l;
69
- return (l = n.value) == null ? void 0 : l.validateFields(e, t);
70
- }, A = async (e, t) => {
71
- var i;
72
- const l = await ((i = n.value) == null ? void 0 : i.validateFields(
92
+ return (l = a.value) == null ? void 0 : l.validateFields(e, t);
93
+ }, W = async (e, t) => {
94
+ var o;
95
+ const l = await ((o = a.value) == null ? void 0 : o.validateFields(
73
96
  e,
74
97
  t
75
98
  ));
76
- return p(l, c);
77
- }, N = (e) => {
99
+ return p(l, d);
100
+ }, q = (e) => {
78
101
  var t;
79
- return (t = n.value) == null ? void 0 : t.getFieldsValue(e);
80
- }, P = (e) => {
102
+ return (t = a.value) == null ? void 0 : t.getFieldsValue(e);
103
+ }, z = (e) => {
81
104
  var l;
82
- const t = (l = n.value) == null ? void 0 : l.getFieldsValue(e);
83
- return p(t, c);
84
- }, S = (e, t) => {
105
+ const t = (l = a.value) == null ? void 0 : l.getFieldsValue(e);
106
+ return p(t, d);
107
+ }, C = (e, t) => {
85
108
  var l;
86
- return (l = n.value) == null ? void 0 : l.validate(e, t);
87
- }, W = (e, t = {}) => {
109
+ return (l = a.value) == null ? void 0 : l.validate(e, t);
110
+ }, D = (e, t = {}) => {
88
111
  var l;
89
- (l = n.value) == null || l.scrollToField(e, t);
90
- }, q = (e) => {
91
- Object.assign(r, e), h();
92
- }, R = (e, t) => {
93
- g(e, t), h();
112
+ (l = a.value) == null || l.scrollToField(e, t);
113
+ }, L = (e) => {
114
+ Object.assign(n, e), g();
115
+ }, P = (e, t) => {
116
+ y(e, t), g();
94
117
  };
95
- function V(e, t) {
96
- return t || e(b(r)), F.push(e), () => {
118
+ function T(e, t) {
119
+ return t || e(O(n)), F.push(e), () => {
97
120
  F = F.filter((l) => l !== e);
98
121
  };
99
122
  }
100
- function T({ initialValue: e, name: t, transform: l }) {
101
- if (y(e) && y(t))
102
- if (g(t, e, !1), f(t)) {
103
- let i = v;
104
- for (let s = 0; s < t.length - 1; s++)
105
- y(i[t[s]]) || (i[t[s]] = {}), i = i[t[s]];
106
- i[t[t.length - 1]] = e;
123
+ function b({ initialValue: e, name: t, transform: l }) {
124
+ if (U(e) && U(t))
125
+ if (y(t, e, !1), f(t)) {
126
+ let o = h;
127
+ for (let i = 0; i < t.length - 1; i++)
128
+ U(o[t[i]]) || (o[t[i]] = {}), o = o[t[i]];
129
+ o[t[t.length - 1]] = e;
107
130
  } else
108
- v[t] = e;
109
- l && (c = te(
110
- c,
131
+ h[t] = e;
132
+ l && (d = ae(
133
+ d,
111
134
  [t].flat(1),
112
135
  l,
113
136
  !0
114
137
  ));
115
138
  }
116
- function z(e) {
117
- if (e !== ee) {
139
+ function k(e) {
140
+ if (e !== ie) {
118
141
  console.warn("getInternalInstance should only used at internal");
119
142
  return;
120
143
  }
121
144
  return {
122
- registerField: T,
123
- registerWatch: V
145
+ registerField: b,
146
+ registerWatch: T
124
147
  };
125
148
  }
126
- function h() {
149
+ function g() {
127
150
  if (F.length) {
128
- const e = b(r);
151
+ const e = O(n);
129
152
  F.forEach((t) => {
130
153
  t(e);
131
154
  });
@@ -135,59 +158,59 @@ const ue = /* @__PURE__ */ D({
135
158
  if (e == null)
136
159
  return;
137
160
  let l = f(e) ? [] : {};
138
- return Object.keys(e).forEach((i) => {
139
- const s = e[i], o = t == null ? void 0 : t[i], u = m(o) ? o : o == null ? void 0 : o.transformer, C = m(o) ? !0 : o == null ? void 0 : o.flat;
140
- if (m(u)) {
141
- const d = u(s);
142
- C ? f(d) && f(l) ? l = [...l, ...d] : _(d) && _(l) ? l = {
161
+ return Object.keys(e).forEach((o) => {
162
+ const i = e[o], r = t == null ? void 0 : t[o], u = V(r) ? r : r == null ? void 0 : r.transformer, K = V(r) ? !0 : r == null ? void 0 : r.flat;
163
+ if (V(u)) {
164
+ const c = u(i);
165
+ K ? f(c) && f(l) ? l = [...l, ...c] : R(c) && R(l) ? l = {
143
166
  ...l,
144
- ...d
145
- } : l[i] = d : l[i] = d;
146
- } else if (_(s) || f(s)) {
147
- const d = p(
148
- s,
149
- o
167
+ ...c
168
+ } : l[o] = c : l[o] = c;
169
+ } else if (R(i) || f(i)) {
170
+ const c = p(
171
+ i,
172
+ r
150
173
  );
151
- l[i] = d;
174
+ l[o] = c;
152
175
  } else
153
- l[i] = s;
176
+ l[o] = i;
154
177
  }), l;
155
178
  }
156
- return Y({
157
- model: $(() => r),
158
- updateModel: g,
179
+ return le({
180
+ model: J(() => n),
181
+ updateModel: y,
159
182
  internalInstance: {
160
- registerWatch: V,
161
- registerField: T,
162
- setFieldValue: R
183
+ registerWatch: T,
184
+ registerField: b,
185
+ setFieldValue: P
163
186
  }
164
- }), O({
165
- resetFields: E,
166
- clearValidate: j,
167
- validateFields: x,
168
- getFieldsValue: N,
169
- validate: S,
170
- scrollToField: W,
171
- setFieldsValue: q,
172
- setFieldValue: R,
173
- registerWatch: V,
174
- validateFieldsReturnTransformed: A,
175
- getFieldsValueTransformed: P,
176
- getInternalInstance: z
177
- }), (e, t) => (G(), H(B(X), J({
187
+ }), j({
188
+ resetFields: A,
189
+ clearValidate: N,
190
+ validateFields: S,
191
+ getFieldsValue: q,
192
+ validate: C,
193
+ scrollToField: D,
194
+ setFieldsValue: L,
195
+ setFieldValue: P,
196
+ registerWatch: T,
197
+ validateFieldsReturnTransformed: W,
198
+ getFieldsValueTransformed: z,
199
+ getInternalInstance: k
200
+ }), (e, t) => (Q(), X(m(te), Y({
178
201
  ref_key: "formRef",
179
- ref: n
180
- }, B(Z)(a, ["initialValues", "onValuesChange", "onFinish"]), {
181
- onFinish: w,
182
- model: r
202
+ ref: a
203
+ }, m(re)(s, ["initialValues", "onValuesChange", "onFinish"]), {
204
+ onFinish: x,
205
+ model: n
183
206
  }), {
184
- default: Q(() => [
185
- U(e.$slots, "default")
207
+ default: Z(() => [
208
+ ee(e.$slots, "default")
186
209
  ]),
187
210
  _: 3
188
211
  }, 16, ["model"]));
189
212
  }
190
213
  });
191
214
  export {
192
- ue as default
215
+ ye as default
193
216
  };
@@ -1,11 +1,11 @@
1
1
  import { ApFormDrawerFormProps, CustomizeResizeType } from '../interface';
2
2
  import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, PublicProps, CSSProperties } from 'vue';
3
3
  import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
4
+ import { Recordable } from '../../type';
4
5
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
5
6
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
6
7
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
7
8
  import { Options } from '../../../node_modules/scroll-into-view-if-needed';
8
- import { Recordable } from '../../type';
9
9
  import { WatchFunc, RegistedFieldType, ApFormInternalInstance, ApFormSubmitterConfig } from '..';
10
10
  import { VueTypeValidableDef, VueTypeDef } from '../../../node_modules/vue-types';
11
11
  import { PushState } from '@aplus-frontend/antdv/es/drawer';
@@ -29,6 +29,7 @@ declare function __VLS_template(): {
29
29
  validateTrigger: string | string[];
30
30
  hideRequiredMark: boolean;
31
31
  validateOnRuleChange: boolean;
32
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
32
33
  }> & Omit<{
33
34
  readonly layout: string;
34
35
  readonly colon: boolean;
@@ -36,6 +37,7 @@ declare function __VLS_template(): {
36
37
  readonly validateTrigger: string | string[];
37
38
  readonly hideRequiredMark: boolean;
38
39
  readonly validateOnRuleChange: boolean;
40
+ readonly syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
39
41
  readonly size?: "small" | "large" | "middle" | undefined;
40
42
  readonly onSubmit?: ((e: Event) => void) | undefined;
41
43
  readonly disabled?: boolean | undefined;
@@ -120,6 +122,7 @@ declare function __VLS_template(): {
120
122
  readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
121
123
  readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
122
124
  readonly initialValues?: Recordable | undefined;
125
+ readonly syncToUrlPriority?: boolean | undefined;
123
126
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
124
127
  size: {
125
128
  type: PropType<"small" | "large" | "middle">;
@@ -265,7 +268,14 @@ declare function __VLS_template(): {
265
268
  initialValues: {
266
269
  type: PropType<Recordable>;
267
270
  };
268
- }>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange">;
271
+ syncToUrl: {
272
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
273
+ default: boolean;
274
+ };
275
+ syncToUrlPriority: {
276
+ type: PropType<boolean>;
277
+ };
278
+ }>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl">;
269
279
  $attrs: {
270
280
  [x: string]: unknown;
271
281
  };
@@ -424,6 +434,13 @@ declare function __VLS_template(): {
424
434
  initialValues: {
425
435
  type: PropType<Recordable>;
426
436
  };
437
+ syncToUrl: {
438
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
439
+ default: boolean;
440
+ };
441
+ syncToUrlPriority: {
442
+ type: PropType<boolean>;
443
+ };
427
444
  }>>, {
428
445
  resetFields: () => Promise<void>;
429
446
  clearValidate: (name?: NamePath | NamePath[]) => void;
@@ -453,6 +470,7 @@ declare function __VLS_template(): {
453
470
  validateTrigger: string | string[];
454
471
  hideRequiredMark: boolean;
455
472
  validateOnRuleChange: boolean;
473
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
456
474
  }, {}, string, {}> & {
457
475
  beforeCreate?: (() => void) | (() => void)[];
458
476
  created?: (() => void) | (() => void)[];
@@ -618,6 +636,13 @@ declare function __VLS_template(): {
618
636
  initialValues: {
619
637
  type: PropType<Recordable>;
620
638
  };
639
+ syncToUrl: {
640
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
641
+ default: boolean;
642
+ };
643
+ syncToUrlPriority: {
644
+ type: PropType<boolean>;
645
+ };
621
646
  }>>, "validate" | "setFieldValue" | "setFieldsValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "registerWatch"> & ShallowUnwrapRef<{
622
647
  resetFields: () => Promise<void>;
623
648
  clearValidate: (name?: NamePath | NamePath[]) => void;