@aplus-frontend/ui 7.12.6 → 7.13.1

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 (168) 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.mjs +33 -31
  6. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  7. package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
  8. package/es/src/ag-grid/index.vue.mjs +209 -202
  9. package/es/src/ag-grid/interface.d.ts +4 -0
  10. package/es/src/ag-grid/style/index.mjs +8 -5
  11. package/es/src/ap-drawer/interface.d.ts +13 -2
  12. package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
  13. package/es/src/ap-field/select/index.vue.d.ts +1 -2
  14. package/es/src/ap-field/select/index.vue.mjs +126 -88
  15. package/es/src/ap-field/style/index.mjs +8 -6
  16. package/es/src/ap-field/style/select.d.ts +2 -0
  17. package/es/src/ap-field/style/select.mjs +43 -0
  18. package/es/src/ap-form/context.mjs +1 -1
  19. package/es/src/ap-form/item-group/helper.mjs +2 -2
  20. package/es/src/ap-form/items/select/index.vue.d.ts +4 -8
  21. package/es/src/ap-form/provider/context.mjs +1 -1
  22. package/es/src/ap-grid/utils/table.mjs +2 -2
  23. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  24. package/es/src/ap-table/ap-table.vue2.mjs +15 -16
  25. package/es/src/ap-table/components/setting/context.d.ts +17 -0
  26. package/es/src/ap-table/components/setting/context.mjs +18 -0
  27. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  28. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +220 -88
  29. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  30. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
  31. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  32. package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
  33. package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
  34. package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  35. package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
  36. package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
  37. package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  38. package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
  39. package/es/src/ap-table/components/setting/template/item.vue2.mjs +78 -0
  40. package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  41. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
  42. package/es/src/ap-table/components/setting/utils.d.ts +1 -0
  43. package/es/src/ap-table/components/setting/utils.mjs +22 -15
  44. package/es/src/ap-table/constants.d.ts +2 -4
  45. package/es/src/ap-table/context.mjs +1 -1
  46. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  47. package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
  48. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  49. package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
  50. package/es/src/ap-table/interface.d.ts +26 -3
  51. package/es/src/ap-table/style/index.d.ts +1 -0
  52. package/es/src/ap-table/style/index.mjs +2 -1
  53. package/es/src/ap-table/style/setting.d.ts +2 -0
  54. package/es/src/ap-table/style/setting.mjs +114 -19
  55. package/es/src/ap-table/utils.mjs +1 -1
  56. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  57. package/es/src/business/ag-grid-modal/style/index.mjs +7 -7
  58. package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
  59. package/es/src/business/ap-attachment/style/index.mjs +33 -16
  60. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
  61. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  62. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
  63. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  64. package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
  65. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  66. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
  67. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  68. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  69. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +19 -19
  70. package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
  71. package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
  72. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
  73. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  74. package/es/src/business/ap-view/style/index.mjs +2 -2
  75. package/es/src/check-card/context.mjs +1 -1
  76. package/es/src/config-provider/constants.mjs +1 -1
  77. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  78. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  79. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  80. package/es/src/design-token/index.mjs +5 -5
  81. package/es/src/editable-table/utils.mjs +1 -1
  82. package/es/src/locale/lang/en.mjs +15 -4
  83. package/es/src/locale/lang/zh-cn.mjs +18 -7
  84. package/es/src/text/context.mjs +1 -1
  85. package/es/src/time-ago/useTimeAgo.mjs +26 -27
  86. package/es/src/utils/data-range-persets.d.ts +13 -1
  87. package/es/src/utils/data-range-persets.mjs +80 -60
  88. package/es/src/utils/index.d.ts +1 -0
  89. package/es/src/utils/index.mjs +56 -48
  90. package/es/src/utils/retry.d.ts +12 -0
  91. package/es/src/utils/retry.mjs +27 -0
  92. package/es/src/utils/slot.mjs +1 -1
  93. package/es/src/version.d.ts +1 -1
  94. package/es/src/version.mjs +1 -1
  95. package/lib/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  96. package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
  97. package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
  98. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  99. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  100. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  101. package/lib/src/ag-grid/index.vue.js +1 -1
  102. package/lib/src/ag-grid/interface.d.ts +4 -0
  103. package/lib/src/ag-grid/style/index.js +1 -1
  104. package/lib/src/ap-drawer/interface.d.ts +13 -2
  105. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  106. package/lib/src/ap-field/select/index.vue.d.ts +1 -2
  107. package/lib/src/ap-field/select/index.vue.js +1 -1
  108. package/lib/src/ap-field/style/index.js +1 -1
  109. package/lib/src/ap-field/style/select.d.ts +2 -0
  110. package/lib/src/ap-field/style/select.js +1 -0
  111. package/lib/src/ap-form/items/select/index.vue.d.ts +4 -8
  112. package/lib/src/ap-grid/utils/table.js +1 -1
  113. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  114. package/lib/src/ap-table/components/setting/context.d.ts +17 -0
  115. package/lib/src/ap-table/components/setting/context.js +1 -0
  116. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  117. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  118. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
  119. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  120. package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
  121. package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
  122. package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  123. package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
  124. package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
  125. package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  126. package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
  127. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
  128. package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  129. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  130. package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
  131. package/lib/src/ap-table/components/setting/utils.js +1 -1
  132. package/lib/src/ap-table/constants.d.ts +2 -4
  133. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  134. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  135. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  136. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
  137. package/lib/src/ap-table/interface.d.ts +26 -3
  138. package/lib/src/ap-table/style/index.d.ts +1 -0
  139. package/lib/src/ap-table/style/index.js +1 -1
  140. package/lib/src/ap-table/style/setting.d.ts +2 -0
  141. package/lib/src/ap-table/style/setting.js +1 -1
  142. package/lib/src/business/ag-grid-modal/style/index.js +1 -1
  143. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  144. package/lib/src/business/ap-attachment/style/index.js +1 -1
  145. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  146. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  147. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
  148. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  149. package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
  150. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  151. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  152. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  153. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  154. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  155. package/lib/src/business/ap-view/style/index.js +1 -1
  156. package/lib/src/design-token/index.js +1 -1
  157. package/lib/src/locale/lang/en.js +1 -1
  158. package/lib/src/locale/lang/zh-cn.js +1 -1
  159. package/lib/src/time-ago/useTimeAgo.js +1 -1
  160. package/lib/src/utils/data-range-persets.d.ts +13 -1
  161. package/lib/src/utils/data-range-persets.js +1 -1
  162. package/lib/src/utils/index.d.ts +1 -0
  163. package/lib/src/utils/index.js +1 -1
  164. package/lib/src/utils/retry.d.ts +12 -0
  165. package/lib/src/utils/retry.js +1 -0
  166. package/lib/src/version.d.ts +1 -1
  167. package/lib/src/version.js +1 -1
  168. 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
  };
@@ -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
+ };
@@ -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
  }
@@ -17,10 +17,10 @@ function i(r) {
17
17
  }
18
18
  function f(r) {
19
19
  const t = [], n = r.filter(
20
- (e) => e && i(e) && e.type !== Symbol.for("v-cmt")
20
+ (e) => e && i(e) && e.type !== /* @__PURE__ */ Symbol.for("v-cmt")
21
21
  );
22
22
  for (const e of n)
23
- if (e.type === Symbol.for("v-fgt")) {
23
+ if (e.type === /* @__PURE__ */ Symbol.for("v-fgt")) {
24
24
  const l = f(e.children);
25
25
  t.push(...l);
26
26
  } else if (u(e)) {
@@ -661,26 +661,24 @@ declare function __VLS_template(): {
661
661
  itemIcon: any;
662
662
  removeIcon: any;
663
663
  clearIcon: any;
664
- dropdownRender: any;
665
- option: any;
666
664
  placeholder: any;
667
665
  tagRender: any;
668
666
  maxTagPlaceholder: any;
669
667
  optionLabel: any;
670
668
  default: any;
669
+ dropdownRender: any;
671
670
  }> & {
672
671
  notFoundContent: any;
673
672
  suffixIcon: any;
674
673
  itemIcon: any;
675
674
  removeIcon: any;
676
675
  clearIcon: any;
677
- dropdownRender: any;
678
- option: any;
679
676
  placeholder: any;
680
677
  tagRender: any;
681
678
  maxTagPlaceholder: any;
682
679
  optionLabel: any;
683
680
  default: any;
681
+ dropdownRender: any;
684
682
  };
685
683
  }) | null;
686
684
  };
@@ -1319,26 +1317,24 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
1319
1317
  itemIcon: any;
1320
1318
  removeIcon: any;
1321
1319
  clearIcon: any;
1322
- dropdownRender: any;
1323
- option: any;
1324
1320
  placeholder: any;
1325
1321
  tagRender: any;
1326
1322
  maxTagPlaceholder: any;
1327
1323
  optionLabel: any;
1328
1324
  default: any;
1325
+ dropdownRender: any;
1329
1326
  }> & {
1330
1327
  notFoundContent: any;
1331
1328
  suffixIcon: any;
1332
1329
  itemIcon: any;
1333
1330
  removeIcon: any;
1334
1331
  clearIcon: any;
1335
- dropdownRender: any;
1336
- option: any;
1337
1332
  placeholder: any;
1338
1333
  tagRender: any;
1339
1334
  maxTagPlaceholder: any;
1340
1335
  optionLabel: any;
1341
1336
  default: any;
1337
+ dropdownRender: any;
1342
1338
  };
1343
1339
  }) | null;
1344
1340
  }, any>;
@@ -1,5 +1,5 @@
1
1
  import { provide as e, inject as t } from "vue";
2
- const r = Symbol("InternalContextProps"), m = (o) => {
2
+ const r = /* @__PURE__ */ Symbol("InternalContextProps"), m = (o) => {
3
3
  e(r, o);
4
4
  }, n = {
5
5
  triggerFormChange: () => {
@@ -74,7 +74,7 @@ function x(e) {
74
74
  return e === !0 ? "left" : e;
75
75
  }
76
76
  function F(e, i, t) {
77
- const n = e === !0 || !e.type ? "checkbox" : e.type, r = (t === "mini" ? 9 * 2 : 12 * 2) + 16, a = e === !0 ? r : e.columnWidth || r;
77
+ const n = e === !0 || !e.type ? "checkbox" : e.type, r = (t === "mini" ? 18 : 24) + 16, a = e === !0 ? r : e.columnWidth || r;
78
78
  let o = e === !0 ? void 0 : x(e.fixed);
79
79
  return o || (o === !1 ? o = void 0 : o = i.some(
80
80
  (u) => u.fixed === "left" || u.fixed === !0
@@ -102,7 +102,7 @@ function R(e, i) {
102
102
  if (!e)
103
103
  return "auto";
104
104
  const t = getComputedStyle(e);
105
- let n = i === "medium" ? 12 * 2 : 9 * 2;
105
+ let n = i === "medium" ? 24 : 18;
106
106
  const r = (Number.parseFloat(t.fontSize) || 14) * 1.6;
107
107
  return n += r, e.querySelector("span.anticon-question-circle") && (n += 20), n += h(e.querySelector(".vxe-cell--sort")) + h(e.querySelector(".vxe-cell--filter")), Math.ceil(n);
108
108
  }