@aplus-frontend/ui 7.12.5 → 7.13.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 (244) hide show
  1. package/es/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  2. package/es/src/ag-grid/components/loading/index.vue.mjs +4 -0
  3. package/es/src/ag-grid/components/loading/index.vue2.mjs +18 -0
  4. package/es/src/ag-grid/context.mjs +1 -1
  5. package/es/src/ag-grid/editable/form-item.vue.d.ts +2 -4
  6. package/es/src/ag-grid/editable/form-item.vue.mjs +30 -27
  7. package/es/src/ag-grid/editable/index.vue.d.ts +2 -4
  8. package/es/src/ag-grid/editable/index.vue.mjs +10 -8
  9. package/es/src/ag-grid/editable/interface.d.ts +2 -1
  10. package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
  11. package/es/src/ag-grid/index.vue.d.ts +2 -4
  12. package/es/src/ag-grid/index.vue.mjs +209 -202
  13. package/es/src/ag-grid/interface.d.ts +4 -0
  14. package/es/src/ag-grid/style/index.mjs +8 -5
  15. package/es/src/ap-drawer/interface.d.ts +13 -2
  16. package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
  17. package/es/src/ap-field/select/index.vue.d.ts +1 -2
  18. package/es/src/ap-field/select/index.vue.mjs +126 -88
  19. package/es/src/ap-field/select/use-select-options.d.ts +2 -2
  20. package/es/src/ap-field/style/index.mjs +8 -6
  21. package/es/src/ap-field/style/select.d.ts +2 -0
  22. package/es/src/ap-field/style/select.mjs +43 -0
  23. package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
  24. package/es/src/ap-form/ap-form.vue.d.ts +1 -2
  25. package/es/src/ap-form/context.mjs +1 -1
  26. package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  27. package/es/src/ap-form/item-group/helper.mjs +2 -2
  28. package/es/src/ap-form/items/number/index.vue.d.ts +4 -5
  29. package/es/src/ap-form/items/select/index.vue.d.ts +12 -16
  30. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  31. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  32. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  33. package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
  34. package/es/src/ap-form/provider/context.mjs +1 -1
  35. package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
  36. package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  37. package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
  38. package/es/src/ap-grid/index.vue.d.ts +2 -4
  39. package/es/src/ap-grid/utils/table.mjs +2 -2
  40. package/es/src/ap-list/index.vue.d.ts +2 -4
  41. package/es/src/ap-modal/utils/confirm.d.ts +1 -1
  42. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  43. package/es/src/ap-table/ap-table.vue.d.ts +2 -4
  44. package/es/src/ap-table/ap-table.vue2.mjs +15 -16
  45. package/es/src/ap-table/components/setting/context.d.ts +17 -0
  46. package/es/src/ap-table/components/setting/context.mjs +18 -0
  47. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  48. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +217 -88
  49. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  50. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
  51. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  52. package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
  53. package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
  54. package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  55. package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
  56. package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
  57. package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  58. package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
  59. package/es/src/ap-table/components/setting/template/item.vue2.mjs +77 -0
  60. package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  61. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
  62. package/es/src/ap-table/components/setting/utils.d.ts +1 -0
  63. package/es/src/ap-table/components/setting/utils.mjs +22 -15
  64. package/es/src/ap-table/constants.d.ts +13 -15
  65. package/es/src/ap-table/context.mjs +1 -1
  66. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  67. package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
  68. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  69. package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
  70. package/es/src/ap-table/interface.d.ts +26 -3
  71. package/es/src/ap-table/style/index.d.ts +1 -0
  72. package/es/src/ap-table/style/index.mjs +2 -1
  73. package/es/src/ap-table/style/setting.d.ts +2 -0
  74. package/es/src/ap-table/style/setting.mjs +114 -19
  75. package/es/src/ap-table/utils.mjs +1 -1
  76. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  77. package/es/src/business/ag-grid-modal/style/index.mjs +7 -7
  78. package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
  79. package/es/src/business/ap-attachment/style/index.mjs +33 -16
  80. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
  81. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  82. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
  83. package/es/src/business/ap-batch-action-group/index.d.ts +6 -6
  84. package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
  85. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  86. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  87. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
  88. package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
  89. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  90. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  91. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  92. package/es/src/business/ap-select-layout/index.d.ts +2 -4
  93. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  94. package/es/src/business/ap-table-modal/index.d.ts +17 -5
  95. package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  96. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +19 -19
  97. package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
  98. package/es/src/business/ap-upload/style/single-file.mjs +2 -2
  99. package/es/src/business/ap-upload-file/ap-upload-single/style/index.mjs +2 -2
  100. package/es/src/business/ap-value-select-card/index.vue.d.ts +2 -4
  101. package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
  102. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +3 -4
  103. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  104. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
  105. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  106. package/es/src/business/ap-view/style/index.mjs +2 -2
  107. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  108. package/es/src/check-card/context.mjs +1 -1
  109. package/es/src/config-provider/constants.mjs +1 -1
  110. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  111. package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
  112. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  113. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  114. package/es/src/design-token/index.mjs +5 -5
  115. package/es/src/editable-table/form-item.vue.d.ts +2 -4
  116. package/es/src/editable-table/index.vue.d.ts +2 -4
  117. package/es/src/editable-table/utils.mjs +1 -1
  118. package/es/src/locale/lang/en.mjs +15 -4
  119. package/es/src/locale/lang/zh-cn.mjs +18 -7
  120. package/es/src/scroll-view/index.vue.d.ts +5 -5
  121. package/es/src/tests/wrapper.d.ts +4 -4
  122. package/es/src/text/context.mjs +1 -1
  123. package/es/src/time-ago/useTimeAgo.mjs +26 -27
  124. package/es/src/utils/data-range-persets.d.ts +13 -1
  125. package/es/src/utils/data-range-persets.mjs +80 -60
  126. package/es/src/utils/index.d.ts +1 -0
  127. package/es/src/utils/index.mjs +56 -48
  128. package/es/src/utils/retry.d.ts +12 -0
  129. package/es/src/utils/retry.mjs +27 -0
  130. package/es/src/utils/slot.mjs +1 -1
  131. package/es/src/version.d.ts +1 -1
  132. package/es/src/version.mjs +1 -1
  133. package/lib/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  134. package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
  135. package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
  136. package/lib/src/ag-grid/editable/form-item.vue.d.ts +2 -4
  137. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  138. package/lib/src/ag-grid/editable/index.vue.d.ts +2 -4
  139. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  140. package/lib/src/ag-grid/editable/interface.d.ts +2 -1
  141. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  142. package/lib/src/ag-grid/index.vue.d.ts +2 -4
  143. package/lib/src/ag-grid/index.vue.js +1 -1
  144. package/lib/src/ag-grid/interface.d.ts +4 -0
  145. package/lib/src/ag-grid/style/index.js +1 -1
  146. package/lib/src/ap-drawer/interface.d.ts +13 -2
  147. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  148. package/lib/src/ap-field/select/index.vue.d.ts +1 -2
  149. package/lib/src/ap-field/select/index.vue.js +1 -1
  150. package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
  151. package/lib/src/ap-field/style/index.js +1 -1
  152. package/lib/src/ap-field/style/select.d.ts +2 -0
  153. package/lib/src/ap-field/style/select.js +1 -0
  154. package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
  155. package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
  156. package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  157. package/lib/src/ap-form/items/number/index.vue.d.ts +4 -5
  158. package/lib/src/ap-form/items/select/index.vue.d.ts +12 -16
  159. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  160. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  161. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  162. package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
  163. package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
  164. package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  165. package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
  166. package/lib/src/ap-grid/index.vue.d.ts +2 -4
  167. package/lib/src/ap-grid/utils/table.js +1 -1
  168. package/lib/src/ap-list/index.vue.d.ts +2 -4
  169. package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
  170. package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
  171. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  172. package/lib/src/ap-table/components/setting/context.d.ts +17 -0
  173. package/lib/src/ap-table/components/setting/context.js +1 -0
  174. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  175. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  176. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
  177. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  178. package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
  179. package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
  180. package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  181. package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
  182. package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
  183. package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  184. package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
  185. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
  186. package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  187. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  188. package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
  189. package/lib/src/ap-table/components/setting/utils.js +1 -1
  190. package/lib/src/ap-table/constants.d.ts +13 -15
  191. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  192. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  193. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  194. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
  195. package/lib/src/ap-table/interface.d.ts +26 -3
  196. package/lib/src/ap-table/style/index.d.ts +1 -0
  197. package/lib/src/ap-table/style/index.js +1 -1
  198. package/lib/src/ap-table/style/setting.d.ts +2 -0
  199. package/lib/src/ap-table/style/setting.js +1 -1
  200. package/lib/src/business/ag-grid-modal/style/index.js +1 -1
  201. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  202. package/lib/src/business/ap-attachment/style/index.js +1 -1
  203. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  204. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  205. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
  206. package/lib/src/business/ap-batch-action-group/index.d.ts +6 -6
  207. package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
  208. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  209. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  210. package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
  211. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  212. package/lib/src/business/ap-select-layout/index.d.ts +2 -4
  213. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  214. package/lib/src/business/ap-table-modal/index.d.ts +17 -5
  215. package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  216. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  217. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  218. package/lib/src/business/ap-upload/style/single-file.js +1 -1
  219. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -1
  220. package/lib/src/business/ap-value-select-card/index.vue.d.ts +2 -4
  221. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  222. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +3 -4
  223. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  224. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  225. package/lib/src/business/ap-view/style/index.js +1 -1
  226. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  227. package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
  228. package/lib/src/design-token/index.js +1 -1
  229. package/lib/src/editable-table/form-item.vue.d.ts +2 -4
  230. package/lib/src/editable-table/index.vue.d.ts +2 -4
  231. package/lib/src/locale/lang/en.js +1 -1
  232. package/lib/src/locale/lang/zh-cn.js +1 -1
  233. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  234. package/lib/src/tests/wrapper.d.ts +4 -4
  235. package/lib/src/time-ago/useTimeAgo.js +1 -1
  236. package/lib/src/utils/data-range-persets.d.ts +13 -1
  237. package/lib/src/utils/data-range-persets.js +1 -1
  238. package/lib/src/utils/index.d.ts +1 -0
  239. package/lib/src/utils/index.js +1 -1
  240. package/lib/src/utils/retry.d.ts +12 -0
  241. package/lib/src/utils/retry.js +1 -0
  242. package/lib/src/version.d.ts +1 -1
  243. package/lib/src/version.js +1 -1
  244. package/package.json +2 -2
@@ -335,6 +335,10 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
335
335
  * @since 6.41.0
336
336
  */
337
337
  theme?: Partial<ThemeDefaultParams>;
338
+ /**
339
+ * 自定义数据为空时展示的组件
340
+ */
341
+ emptyComponent?: any;
338
342
  };
339
343
  export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
340
344
  /**
@@ -1,7 +1,7 @@
1
1
  import { genSettingTriggerBtnStyle as a } from "../../ap-table/style/index.mjs";
2
2
  import { multiRows as l, resetScrollbar as r } from "../../style/index.mjs";
3
- import { genComponentStyleHook as d } from "../../utils/cssinjs/index.mjs";
4
- const t = {
3
+ import { genComponentStyleHook as t } from "../../utils/cssinjs/index.mjs";
4
+ const d = {
5
5
  agGridSearchFormWrapperMarginBlockEnd: 10,
6
6
  agGridCellPaddingBlockMedium: 9,
7
7
  agGridCellPaddingBlockMini: 6,
@@ -152,19 +152,22 @@ const t = {
152
152
  },
153
153
  ".ag-checkbox.ag-labeled[disabled] .ag-input-field-input[disabled]": {
154
154
  cursor: "not-allowed"
155
+ },
156
+ ".ag-overlay": {
157
+ pointerEvents: "auto"
155
158
  }
156
159
  }
157
160
  };
158
- }, s = d(
161
+ }, s = t(
159
162
  "AgGrid",
160
163
  (i) => [n(i)],
161
- t,
164
+ d,
162
165
  {
163
166
  skipUnit: ["agGridLineClamp"]
164
167
  }
165
168
  );
166
169
  export {
167
170
  s as default,
168
- t as defaultToken,
171
+ d as defaultToken,
169
172
  n as genAgGridStyle
170
173
  };
@@ -1,11 +1,22 @@
1
1
  import { DrawerProps } from '@aplus-frontend/antdv';
2
- import { AppContext } from 'vue';
2
+ import { AppContext, VNodeChild } from 'vue';
3
3
  export type CreateDrawerFuncProps<ContentRecord = any> = Omit<DrawerProps, 'visible' | 'onUpdate:visible' | 'afterVisibleChange' | 'onAfterVisibleOChange' | 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onClose' | 'getContainer' | 'extra' | 'footer'> & Partial<{
4
4
  onClose: (params: ContentRecord) => any | Promise<any>;
5
5
  getContainer: HTMLElement;
6
6
  content: any;
7
7
  destroyOnClose: boolean;
8
- extra: (params: ContentRecord, close: () => void) => any;
8
+ extra: (params: ContentRecord, close: () => void, node: {
9
+ /**
10
+ * 原始的操作区域内容
11
+ */
12
+ originNode: VNodeChild;
13
+ /**
14
+ * 操作区域按钮
15
+ */
16
+ extra: {
17
+ cancelBtn: VNodeChild;
18
+ };
19
+ }) => any;
9
20
  footer: (params: ContentRecord, close: () => void) => any;
10
21
  /**
11
22
  * 抽屉的上下文,一般用于获取全局注册组件、vuex 等内容
@@ -1,33 +1,33 @@
1
- import { render as m, defineComponent as g, createVNode as l, mergeProps as b, h as v } from "vue";
2
- import { Drawer as w } from "@aplus-frontend/antdv";
3
- import { omit as P } from "lodash-unified";
4
- import { getModalGlobalAppContext as y } from "../../ap-modal/utils/util.mjs";
5
- import { ConfigProvider as A, globalConfigCached as D } from "../../config-provider/config-provider.mjs";
1
+ import { render as f, defineComponent as v, createVNode as r, Fragment as w, mergeProps as P, h as y } from "vue";
2
+ import { Drawer as A } from "@aplus-frontend/antdv";
3
+ import { omit as D } from "lodash-unified";
4
+ import { getModalGlobalAppContext as E } from "../../ap-modal/utils/util.mjs";
5
+ import { ConfigProvider as N, globalConfigCached as O } from "../../config-provider/config-provider.mjs";
6
6
  import "../components/ApDrawerClose.vue.mjs";
7
- import O from "../components/ApDrawerClose.vue2.mjs";
8
- const N = (n) => {
7
+ import V from "../components/ApDrawerClose.vue2.mjs";
8
+ const T = (n) => {
9
9
  let o, s;
10
10
  const {
11
- destroyOnClose: r = !0
11
+ destroyOnClose: p = !0
12
12
  } = n;
13
- function p() {
13
+ function i() {
14
14
  o && o(!1), setTimeout(() => {
15
- m(null, t), t.parentElement?.removeChild(t);
15
+ f(null, t), t.parentElement?.removeChild(t);
16
16
  }, 500);
17
17
  }
18
- function f() {
18
+ function h() {
19
19
  o && o(!0);
20
20
  }
21
- function i() {
21
+ function a() {
22
22
  o && o(!1);
23
23
  }
24
- function h(e) {
24
+ function C(e) {
25
25
  s && s(e);
26
26
  }
27
- const C = /* @__PURE__ */ g({
27
+ const u = /* @__PURE__ */ v({
28
28
  data() {
29
29
  return {
30
- open: r,
30
+ open: p,
31
31
  props: n
32
32
  };
33
33
  },
@@ -47,35 +47,40 @@ const N = (n) => {
47
47
  const e = this.props?.content?.component?.exposed ?? void 0;
48
48
  await this.props?.onClose(e);
49
49
  }
50
- r ? p() : i();
50
+ p ? i() : a();
51
51
  }
52
52
  },
53
53
  render() {
54
- const e = P(this.props, ["onClose", "extra", "footer", "visible", "onUpdate:visible", "afterVisibleChange", "onAfterVisibleOChange", "open", "onUpdate:open", "getContainer"]), d = this.props?.content?.component?.exposed ?? void 0, c = () => r ? p() : i();
55
- return l(A, D.value, {
56
- default: () => [l(w, b({
54
+ const e = D(this.props, ["onClose", "extra", "footer", "visible", "onUpdate:visible", "afterVisibleChange", "onAfterVisibleOChange", "open", "onUpdate:open", "getContainer"]), c = this.props?.content?.component?.exposed ?? void 0, m = () => p ? i() : a(), d = r(V, {
55
+ onClose: this.handleClose
56
+ }, null), b = r(w, null, [d]);
57
+ return r(N, O.value, {
58
+ default: () => [r(A, P({
57
59
  open: this.open,
58
60
  onClose: this.handleClose,
59
61
  closeIcon: this.props?.closeIcon ?? null,
60
- extra: this.props?.extra ? this.props?.extra?.(d, c) : l(O, {
61
- onClose: this.handleClose
62
- }, null),
63
- footer: this.props?.footer?.(d, c)
62
+ extra: this.props?.extra ? this.props?.extra?.(c, m, {
63
+ originNode: b,
64
+ extra: {
65
+ cancelBtn: d
66
+ }
67
+ }) : d,
68
+ footer: this.props?.footer?.(c, m)
64
69
  }, e), {
65
70
  default: () => [this.props?.content]
66
71
  })]
67
72
  });
68
73
  }
69
- }), u = n.getContainer || document.body, t = document.createElement("div");
70
- u.appendChild(t);
71
- const a = v(C), x = y();
72
- return a.appContext = n.appContext || x || a.appContext, m(a, t), {
73
- destroy: p,
74
- update: h,
75
- open: f,
76
- close: i
74
+ }), x = n.getContainer || document.body, t = document.createElement("div");
75
+ x.appendChild(t);
76
+ const l = y(u), g = E();
77
+ return l.appContext = n.appContext || g || l.appContext, f(l, t), {
78
+ destroy: i,
79
+ update: C,
80
+ open: h,
81
+ close: a
77
82
  };
78
83
  };
79
84
  export {
80
- N as createDrawer
85
+ T as createDrawer
81
86
  };
@@ -14,13 +14,12 @@ type ApFieldSelectSlots = {
14
14
  itemIcon: any;
15
15
  removeIcon: any;
16
16
  clearIcon: any;
17
- dropdownRender: any;
18
- option: any;
19
17
  placeholder: any;
20
18
  tagRender: any;
21
19
  maxTagPlaceholder: any;
22
20
  optionLabel: any;
23
21
  default: any;
22
+ dropdownRender: any;
24
23
  };
25
24
  declare function __VLS_template(): {
26
25
  attrs: Partial<{}>;
@@ -1,11 +1,15 @@
1
- import { defineComponent as q, ref as D, shallowRef as R, computed as s, onMounted as z, watch as E, unref as a, createElementBlock as U, createBlock as K, openBlock as g, toDisplayString as H, mergeProps as $, createSlots as j, renderList as W, withCtx as S, renderSlot as Y, normalizeProps as G, guardReactiveProps as J, createVNode as Q } from "vue";
2
- import { Select as X, Spin as Z } from "@aplus-frontend/antdv";
3
- import { debounce as ee, isFunction as B, isArray as te, isNil as oe, omit as le } from "lodash-unified";
1
+ import { defineComponent as Y, ref as N, shallowRef as G, computed as u, onMounted as J, watch as Q, unref as a, createElementBlock as O, createBlock as X, openBlock as C, toDisplayString as S, mergeProps as Z, h as ee, createSlots as oe, withCtx as v, createVNode as x, normalizeClass as w, createElementVNode as te, createCommentVNode as le, withModifiers as ae, renderList as ne, renderSlot as re, normalizeProps as se, guardReactiveProps as ie } from "vue";
2
+ import { Select as ue, Flex as pe, Spin as de } from "@aplus-frontend/antdv";
3
+ import { debounce as ce, isFunction as V, isArray as fe, isNil as me, omit as ve } from "lodash-unified";
4
+ import "../../config-provider/index.mjs";
4
5
  import "../../hooks/index.mjs";
5
- import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
6
- import { useSelectOptions as ne, SELECT_ALL_VALUE_KEY as f } from "./use-select-options.mjs";
7
- import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
8
- const ue = { key: 0 }, ve = /* @__PURE__ */ q({
6
+ import { useDefaultPlaceholder as he } from "../hooks/use-default-placeholder.mjs";
7
+ import ye from "../style/index.mjs";
8
+ import { useSelectOptions as ge, SELECT_ALL_VALUE_KEY as h } from "./use-select-options.mjs";
9
+ import { useNamespace as Ce } from "../../config-provider/hooks/use-namespace.mjs";
10
+ import { useLocale as Se } from "../../config-provider/hooks/use-locale.mjs";
11
+ import { useControllableValue as we } from "../../hooks/useControllableValue.mjs";
12
+ const be = { key: 0 }, Be = ["onClick"], Pe = /* @__PURE__ */ Y({
9
13
  name: "ApFieldSelect",
10
14
  __name: "index",
11
15
  props: {
@@ -101,45 +105,45 @@ const ue = { key: 0 }, ve = /* @__PURE__ */ q({
101
105
  searchDelay: { default: 300 }
102
106
  },
103
107
  emits: ["update:value"],
104
- setup(C, { expose: w, emit: F }) {
108
+ setup(I, { expose: k, emit: A }) {
105
109
  let r = 0;
106
- const e = C, b = ee((t) => {
107
- if (!B(e.request))
110
+ const o = I, { b: p } = Ce("field-select"), _ = ye("field"), b = N(!1), { t: L } = Se(), M = ce((e) => {
111
+ if (!V(o.request))
108
112
  return;
109
113
  r += 1;
110
- const l = r;
111
- d([]), n.value = !0, e.request(t).then((o) => {
112
- r === l && (d(o), n.value = !1);
114
+ const t = r;
115
+ d([]), n.value = !0, o.request(e).then((l) => {
116
+ r === t && (d(l), n.value = !1);
113
117
  });
114
- }, e.searchDelay), x = (t, l) => {
115
- const o = e.fieldNames?.label || "label";
116
- return typeof l?.[o] == "string" && l[o].toLowerCase().indexOf(t.toLowerCase()) > -1;
117
- }, { options: u, updateOptions: d } = ne(e), m = R(), n = D(e?.loading || !1), N = F, O = s(() => {
118
- if (e.multiple)
119
- return e.tokenSeparators ? "tags" : "multiple";
118
+ }, o.searchDelay), P = (e, t) => {
119
+ const l = o.fieldNames?.label || "label";
120
+ return typeof t?.[l] == "string" && t[l].toLowerCase().indexOf(e.toLowerCase()) > -1;
121
+ }, { options: s, updateOptions: d } = ge(o), y = G(), n = N(o?.loading || !1), T = A, q = u(() => {
122
+ if (o.multiple)
123
+ return o.tokenSeparators ? "tags" : "multiple";
120
124
  });
121
- async function c(t = !0) {
122
- if (!B(e.request))
125
+ async function c(e = !0) {
126
+ if (!V(o.request))
123
127
  return;
124
128
  n.value = !0, r += 1;
125
- const l = r;
129
+ const t = r;
126
130
  try {
127
- t && d([]);
128
- const o = await e.request(void 0, e.params);
129
- if (l !== r)
131
+ e && d([]);
132
+ const l = await o.request(void 0, o.params);
133
+ if (t !== r)
130
134
  return;
131
- d(o);
135
+ d(l);
132
136
  } finally {
133
137
  n.value = !1;
134
138
  }
135
139
  }
136
- function I(t) {
137
- e.onFocus?.(t), e.refetchOnFocus && r > 0 && !n.value && c(!0);
140
+ function D(e) {
141
+ o.onFocus?.(e), o.refetchOnFocus && r > 0 && !n.value && c(!0);
138
142
  }
139
- z(() => {
140
- e.lazy || c();
141
- }), E(
142
- () => e.params,
143
+ J(() => {
144
+ o.lazy || c();
145
+ }), Q(
146
+ () => o.params,
143
147
  () => {
144
148
  c();
145
149
  },
@@ -147,29 +151,29 @@ const ue = { key: 0 }, ve = /* @__PURE__ */ q({
147
151
  deep: !0
148
152
  }
149
153
  );
150
- const { value: p, updateValue: v } = re(e, N), V = ae("Select", e), A = s(() => {
151
- const t = a(p);
152
- if (!t)
153
- return e.emptyText;
154
- const l = e.fieldNames?.label || "label", o = e.fieldNames?.value || "value";
155
- return te(t) ? t.map(
156
- (i) => a(u).find((T) => T[o] === i)?.[l]
157
- ).filter(Boolean).join("、") || e.emptyText : a(u).find(
158
- (i) => i[o] === t
159
- )?.[l] || e.emptyText;
160
- }), _ = s(() => {
161
- const t = !!e?.showSearch, l = e.searchMode;
162
- let o = {};
163
- return t && (o = l === "request" ? {
154
+ const { value: f, updateValue: m } = we(o, T), R = he("Select", o), z = u(() => {
155
+ const e = a(f);
156
+ if (!e)
157
+ return o.emptyText;
158
+ const t = o.fieldNames?.label || "label", l = o.fieldNames?.value || "value";
159
+ return fe(e) ? e.map(
160
+ (i) => a(s).find((W) => W[l] === i)?.[t]
161
+ ).filter(Boolean).join("、") || o.emptyText : a(s).find(
162
+ (i) => i[l] === e
163
+ )?.[t] || o.emptyText;
164
+ }), E = u(() => {
165
+ const e = !!o?.showSearch, t = o.searchMode;
166
+ let l = {};
167
+ return e && (l = t === "request" ? {
164
168
  defaultActiveFirstOption: !1,
165
- onSearch: b,
169
+ onSearch: M,
166
170
  notFoundContent: n.value ? void 0 : null,
167
171
  filterOption: !1,
168
172
  suffixIcon: null
169
173
  } : {
170
- filterOption: oe(e?.filterOption) ? x : e?.filterOption
174
+ filterOption: me(o?.filterOption) ? P : o?.filterOption
171
175
  }), {
172
- ...le(e, [
176
+ ...ve(o, [
173
177
  "mode",
174
178
  "value",
175
179
  "onUpdate:value",
@@ -179,65 +183,99 @@ const ue = { key: 0 }, ve = /* @__PURE__ */ q({
179
183
  "onFocus",
180
184
  "onBeforeSelect"
181
185
  ]),
182
- placeholder: a(V),
183
- ...o
186
+ placeholder: a(R),
187
+ ...l
184
188
  };
185
- }), y = s(
186
- () => u.value.map((t) => t[e.fieldNames?.value || "value"]).filter((t) => t !== f)
187
- ), k = s(() => {
188
- if (!e.multiple || !e.addAll)
189
- return a(p);
190
- if (u.value.some(
191
- (t) => t[e.fieldNames?.value || "value"] === f
189
+ }), B = u(
190
+ () => s.value.map((e) => e[o.fieldNames?.value || "value"]).filter((e) => e !== h)
191
+ ), U = u(() => {
192
+ if (!o.multiple || !o.addAll)
193
+ return a(f);
194
+ if (s.value.some(
195
+ (e) => e[o.fieldNames?.value || "value"] === h
192
196
  )) {
193
- const t = a(y), l = a(p) || [];
194
- if (t.length && t.every((o) => l?.includes(o)))
195
- return [f];
197
+ const e = a(B), t = a(f) || [];
198
+ if (e.length && e.every((l) => t?.includes(l)))
199
+ return [h];
196
200
  }
197
- return a(p);
201
+ return a(f);
198
202
  });
199
- function P(t) {
200
- return e.multiple && t.includes(f) ? v(a(y)) : v(t);
203
+ function K(e) {
204
+ return o.multiple && e.includes(h) ? m(a(B)) : m(e);
201
205
  }
202
- function L() {
203
- m.value?.focus();
206
+ function $() {
207
+ y.value?.focus();
204
208
  }
205
- function M() {
206
- m.value?.blur();
209
+ function j() {
210
+ y.value?.blur();
207
211
  }
208
- return w({
209
- focus: L,
210
- blur: M,
212
+ function F(e, t) {
213
+ const l = o.fieldNames?.[t] ?? t;
214
+ return e[l];
215
+ }
216
+ function H(e) {
217
+ const t = F(e, "value");
218
+ m(o.multiple ? [t] : t);
219
+ }
220
+ return k({
221
+ focus: $,
222
+ blur: j,
211
223
  request: c
212
- }), (t, l) => t.mode === "read" ? (g(), U("span", ue, H(A.value), 1)) : (g(), K(a(X), $({
224
+ }), (e, t) => e.mode === "read" ? (C(), O("span", be, S(z.value), 1)) : (C(), X(a(ue), Z({
213
225
  key: 1,
214
226
  ref_key: "selectRef",
215
- ref: m,
227
+ ref: y,
216
228
  "allow-clear": ""
217
- }, _.value, {
218
- mode: O.value,
219
- value: k.value,
220
- options: a(u),
229
+ }, E.value, {
230
+ mode: q.value,
231
+ value: U.value,
232
+ options: a(s),
221
233
  loading: n.value,
222
- "onUpdate:value": P,
223
- onFocus: I
224
- }), j({ _: 2 }, [
225
- W(t.$slots, (o, h) => ({
226
- name: h,
227
- fn: S((i) => [
228
- Y(t.$slots, h, G(J(i || {})))
234
+ "menu-item-selected-icon": ee("span"),
235
+ "popup-class-name": `${a(p)("popup")} ${a(_)}`,
236
+ open: b.value,
237
+ "onUpdate:value": K,
238
+ onFocus: D,
239
+ onDropdownVisibleChange: t[0] || (t[0] = (l) => b.value = l)
240
+ }), oe({
241
+ option: v((l) => [
242
+ x(a(pe), {
243
+ justify: "space-between",
244
+ align: "center",
245
+ class: w(a(p)("popup-option-wrapper")),
246
+ gap: 8
247
+ }, {
248
+ default: v(() => [
249
+ te("span", {
250
+ class: w(a(p)("popup-option-label"))
251
+ }, S(F(l, "label")), 3),
252
+ e.multiple ? (C(), O("span", {
253
+ key: 0,
254
+ class: w(a(p)("popup-option-action")),
255
+ onClick: ae(() => H(l), ["stop"])
256
+ }, S(a(L)("ap.field.chooseOnly")), 11, Be)) : le("", !0)
257
+ ]),
258
+ _: 2
259
+ }, 1032, ["class"])
260
+ ]),
261
+ _: 2
262
+ }, [
263
+ ne(e.$slots, (l, g) => ({
264
+ name: g,
265
+ fn: v((i) => [
266
+ re(e.$slots, g, se(ie(i || {})))
229
267
  ])
230
268
  })),
231
269
  n.value ? {
232
270
  name: "notFoundContent",
233
- fn: S(() => [
234
- Q(a(Z), { size: "small" })
271
+ fn: v(() => [
272
+ x(a(de), { size: "small" })
235
273
  ]),
236
274
  key: "0"
237
275
  } : void 0
238
- ]), 1040, ["mode", "value", "options", "loading"]));
276
+ ]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "open"]));
239
277
  }
240
278
  });
241
279
  export {
242
- ve as default
280
+ Pe as default
243
281
  };
@@ -6,13 +6,13 @@ export declare const useSelectOptions: (props: ApFieldSelectProps) => {
6
6
  options: Ref<{
7
7
  [x: string]: any;
8
8
  label?: any;
9
- value?: (string | number | null) | undefined;
9
+ value?: string | number | null | undefined;
10
10
  children?: Omit<DefaultOptionType, "children">[] | undefined;
11
11
  disabled?: boolean | undefined;
12
12
  }[], DefaultOptionType[] | {
13
13
  [x: string]: any;
14
14
  label?: any;
15
- value?: (string | number | null) | undefined;
15
+ value?: string | number | null | undefined;
16
16
  children?: Omit<DefaultOptionType, "children">[] | undefined;
17
17
  disabled?: boolean | undefined;
18
18
  }[]>;
@@ -1,14 +1,16 @@
1
- import { genComponentStyleHook as o } from "../../utils/cssinjs/index.mjs";
2
- import { genCheckboxStyle as r } from "./checkbox.mjs";
1
+ import { genComponentStyleHook as r } from "../../utils/cssinjs/index.mjs";
2
+ import { genCheckboxStyle as o } from "./checkbox.mjs";
3
3
  import { genNumberStyle as t } from "./number.mjs";
4
4
  import { genRadioStyle as m } from "./radio.mjs";
5
- import { genTextareaStyle as l } from "./textarea.mjs";
6
- const S = o("ApField", (e) => [
7
- r(e),
5
+ import { genSelectStyle as l } from "./select.mjs";
6
+ import { genTextareaStyle as p } from "./textarea.mjs";
7
+ const a = r("ApField", (e) => [
8
+ o(e),
8
9
  t(e),
9
10
  m(e),
11
+ p(e),
10
12
  l(e)
11
13
  ]);
12
14
  export {
13
- S as default
15
+ a as default
14
16
  };
@@ -0,0 +1,2 @@
1
+ import { GenStyleFunc } from '../../design-token/interface';
2
+ export declare const genSelectStyle: GenStyleFunc;
@@ -0,0 +1,43 @@
1
+ import { singleRow as p } from "../../style/index.mjs";
2
+ const r = (o) => {
3
+ const { componentCls: e } = o, i = `${e}-select-popup`;
4
+ return {
5
+ [`${i}`]: {
6
+ [`${i}-option-wrapper`]: {
7
+ height: "22px"
8
+ },
9
+ [`${i}-option-label`]: {
10
+ ...p(o),
11
+ color: "inherit"
12
+ },
13
+ [`${i}-option-action`]: {
14
+ display: "none",
15
+ color: o.colorPrimary,
16
+ paddingInline: o.spaceSM,
17
+ paddingBlock: o.spaceXXS,
18
+ "&:hover": {
19
+ background: o.colorPrimary,
20
+ color: "#fff",
21
+ borderRadius: "2px"
22
+ }
23
+ },
24
+ "div.ant-select-item": {
25
+ paddingInline: o.space,
26
+ paddingBlock: o.spaceXS,
27
+ fontWeight: "normal !important",
28
+ marginBottom: o.spaceXS,
29
+ "&:hover": {
30
+ [`${i}-option-action`]: {
31
+ display: "inline"
32
+ }
33
+ },
34
+ "&.ant-select-item-option-selected:not(.ant-select-item-option-disabled)": {
35
+ color: o.colorPrimary
36
+ }
37
+ }
38
+ }
39
+ };
40
+ };
41
+ export {
42
+ r as genSelectStyle
43
+ };
@@ -8,14 +8,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
8
8
  disabled?: boolean | undefined;
9
9
  checkable?: boolean | undefined;
10
10
  disableCheckbox?: boolean | undefined;
11
- children?: any[] | undefined;
11
+ children?: /*elided*/ any[] | undefined;
12
12
  } | {
13
13
  [x: string]: any;
14
14
  value?: RawValueType | undefined;
15
15
  title?: any;
16
16
  label?: any;
17
17
  key?: Key | undefined;
18
- children?: any[] | undefined;
18
+ children?: /*elided*/ any[] | undefined;
19
19
  disabled?: boolean | undefined;
20
20
  checkable?: boolean | undefined;
21
21
  disableCheckbox?: boolean | undefined;
@@ -24,14 +24,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
24
24
  disabled?: boolean | undefined;
25
25
  checkable?: boolean | undefined;
26
26
  disableCheckbox?: boolean | undefined;
27
- children?: any[] | undefined;
27
+ children?: /*elided*/ any[] | undefined;
28
28
  } | {
29
29
  [x: string]: any;
30
30
  value?: RawValueType | undefined;
31
31
  title?: any;
32
32
  label?: any;
33
33
  key?: Key | undefined;
34
- children?: any[] | undefined;
34
+ children?: /*elided*/ any[] | undefined;
35
35
  disabled?: boolean | undefined;
36
36
  checkable?: boolean | undefined;
37
37
  disableCheckbox?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, RuleObject, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
1
+ import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
2
2
  import { Recordable } from '../type';
3
3
  import { ApFormProps, UpdateModelOptimizeFn, WatchFunc, ApFormInternalInstance } from './interface';
4
4
  import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
@@ -7,7 +7,6 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
7
7
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
8
8
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
9
9
  import { Options } from '../../node_modules/scroll-into-view-if-needed';
10
- import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
11
10
  import { SizeType } from '@aplus-frontend/antdv/es/button';
12
11
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
13
12
  declare function __VLS_template(): {
@@ -1,5 +1,5 @@
1
1
  import { provide as t, inject as r, computed as n } from "vue";
2
- const o = Symbol("formContextKey");
2
+ const o = /* @__PURE__ */ Symbol("formContextKey");
3
3
  function u(e) {
4
4
  t(o, e);
5
5
  }