@aplus-frontend/ui 0.5.19 → 0.5.21

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 (83) hide show
  1. package/es/index.mjs +231 -227
  2. package/es/src/ap-field/index.d.ts +3 -1
  3. package/es/src/ap-field/index.mjs +34 -30
  4. package/es/src/ap-field/interface.d.ts +39 -1
  5. package/es/src/ap-field/text/index.vue2.mjs +45 -39
  6. package/es/src/ap-field/tree-select/index.vue.d.ts +1155 -0
  7. package/es/src/ap-field/tree-select/index.vue.mjs +251 -0
  8. package/es/src/ap-field/tree-select/index.vue2.mjs +4 -0
  9. package/es/src/ap-field/tree-select/style/css.d.ts +1 -0
  10. package/es/src/ap-field/tree-select/style/css.js +1 -0
  11. package/es/src/ap-field/tree-select/style/index.d.ts +1 -0
  12. package/es/src/ap-field/tree-select/style/index.js +1 -0
  13. package/es/src/ap-field/tree-select/use-request.d.ts +41 -0
  14. package/es/src/ap-field/tree-select/use-request.mjs +66 -0
  15. package/es/src/ap-form/item-tree-select/style/css.d.ts +1 -0
  16. package/es/src/ap-form/item-tree-select/style/css.js +1 -0
  17. package/es/src/ap-form/item-tree-select/style/index.d.ts +1 -0
  18. package/es/src/ap-form/item-tree-select/style/index.js +1 -0
  19. package/es/src/ap-form/items/index.d.ts +2 -1
  20. package/es/src/ap-form/items/index.mjs +3 -2
  21. package/es/src/ap-form/items/interface.d.ts +6 -1
  22. package/es/src/ap-form/items/select/index.vue.d.ts +1244 -4
  23. package/es/src/ap-form/items/select/index.vue.mjs +25 -22
  24. package/es/src/ap-form/items/text/index.vue.d.ts +2 -0
  25. package/es/src/ap-form/items/tree-select/index.vue.d.ts +1589 -0
  26. package/es/src/ap-form/items/tree-select/index.vue.mjs +107 -0
  27. package/es/src/ap-form/items/tree-select/index.vue2.mjs +4 -0
  28. package/es/src/ap-grid/editable/form-item.vue.mjs +32 -31
  29. package/es/src/ap-grid/editable/index.vue.mjs +9 -8
  30. package/es/src/ap-grid/index.vue.mjs +102 -99
  31. package/es/src/ap-grid/interface.d.ts +1 -1
  32. package/es/src/ap-table/constants.d.ts +4056 -1945
  33. package/es/src/ap-table/constants.mjs +47 -43
  34. package/es/src/ap-table/interface.d.ts +5 -1
  35. package/es/src/ap-table/utils.d.ts +1463 -6
  36. package/es/src/business/ap-ladder/components/ValueGroupMode.vue2.mjs +51 -47
  37. package/es/src/business/ap-ladder/interface.d.ts +4 -0
  38. package/es/src/business/batch-input-group/index.vue.d.ts +1 -0
  39. package/es/src/business/batch-input-group/index.vue.mjs +2 -1
  40. package/es/src/index.mjs +230 -226
  41. package/es/src/path-map.mjs +2 -0
  42. package/lib/index.js +1 -1
  43. package/lib/src/ap-field/index.d.ts +3 -1
  44. package/lib/src/ap-field/index.js +1 -1
  45. package/lib/src/ap-field/interface.d.ts +39 -1
  46. package/lib/src/ap-field/text/index.vue2.js +1 -1
  47. package/lib/src/ap-field/tree-select/index.vue.d.ts +1155 -0
  48. package/lib/src/ap-field/tree-select/index.vue.js +1 -0
  49. package/lib/src/ap-field/tree-select/index.vue2.js +1 -0
  50. package/lib/src/ap-field/tree-select/style/css.cjs +1 -0
  51. package/lib/src/ap-field/tree-select/style/css.d.ts +1 -0
  52. package/lib/src/ap-field/tree-select/style/index.cjs +1 -0
  53. package/lib/src/ap-field/tree-select/style/index.d.ts +1 -0
  54. package/lib/src/ap-field/tree-select/use-request.d.ts +41 -0
  55. package/lib/src/ap-field/tree-select/use-request.js +1 -0
  56. package/lib/src/ap-form/item-tree-select/style/css.cjs +1 -0
  57. package/lib/src/ap-form/item-tree-select/style/css.d.ts +1 -0
  58. package/lib/src/ap-form/item-tree-select/style/index.cjs +1 -0
  59. package/lib/src/ap-form/item-tree-select/style/index.d.ts +1 -0
  60. package/lib/src/ap-form/items/index.d.ts +2 -1
  61. package/lib/src/ap-form/items/index.js +1 -1
  62. package/lib/src/ap-form/items/interface.d.ts +6 -1
  63. package/lib/src/ap-form/items/select/index.vue.d.ts +1244 -4
  64. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  65. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -0
  66. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +1589 -0
  67. package/lib/src/ap-form/items/tree-select/index.vue.js +1 -0
  68. package/lib/src/ap-form/items/tree-select/index.vue2.js +1 -0
  69. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  70. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  71. package/lib/src/ap-grid/index.vue.js +1 -1
  72. package/lib/src/ap-grid/interface.d.ts +1 -1
  73. package/lib/src/ap-table/constants.d.ts +4056 -1945
  74. package/lib/src/ap-table/constants.js +1 -1
  75. package/lib/src/ap-table/interface.d.ts +5 -1
  76. package/lib/src/ap-table/utils.d.ts +1463 -6
  77. package/lib/src/business/ap-ladder/components/ValueGroupMode.vue2.js +1 -1
  78. package/lib/src/business/ap-ladder/interface.d.ts +4 -0
  79. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -0
  80. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  81. package/lib/src/index.js +1 -1
  82. package/lib/src/path-map.js +1 -1
  83. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { InputProps, CheckboxGroupProps, DatePickerProps, InputNumberProps, RadioGroupProps, SwitchProps, TextAreaProps, SelectProps, PopconfirmProps, SliderProps, SegmentedProps, RateProps } from '@aplus-frontend/antdv';
1
+ import { InputProps, CheckboxGroupProps, DatePickerProps, InputNumberProps, RadioGroupProps, SwitchProps, TextAreaProps, SelectProps, PopconfirmProps, SliderProps, SegmentedProps, RateProps, TreeSelectProps } from '@aplus-frontend/antdv';
2
2
  import { InputFocusOptions } from '@aplus-frontend/antdv/es/vc-input/utils/commonUtils';
3
3
  import { ApFormatPresetType } from './date/interface';
4
4
  import { RangeValue } from '@aplus-frontend/antdv/es/vc-picker/interface';
@@ -6,6 +6,7 @@ import { RangePickerProps } from '@aplus-frontend/antdv/es/date-picker/dayjs';
6
6
  import { LiteralUnion, Recordable } from '../type';
7
7
  import { InputPasswordProps } from './text/input-password-props';
8
8
  import { ZoneAlias } from '@aplus-frontend/utils';
9
+ import { LegacyDataNode } from '@aplus-frontend/antdv/es/vc-tree-select/interface';
9
10
  export type FieldMode = 'read' | 'edit';
10
11
  export type BasicApFieldProps<FieldPropsType = any> = {
11
12
  mode?: FieldMode;
@@ -14,6 +15,12 @@ export type BasicApFieldProps<FieldPropsType = any> = {
14
15
  } & FieldPropsType;
15
16
  export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
16
17
  emptyText?: string;
18
+ /**
19
+ * 输入生效前的事件,受控输入拦截
20
+ * @param nextVal
21
+ * @returns
22
+ */
23
+ beforeInput?: (nextVal: string) => string;
17
24
  };
18
25
  export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
19
26
  emptyText?: string;
@@ -151,11 +158,42 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
151
158
  */
152
159
  searchDelay?: number;
153
160
  };
161
+ export type ApFieldTreeSelectProps = BasicApFieldProps<Omit<TreeSelectProps, 'loadData'>> & {
162
+ emptyText?: string;
163
+ /**
164
+ * 用于请求treeNode
165
+ * @param currentNode 异步加载时表示当前节点,非异步请求时为undefined
166
+ * @param extraParams 额外的响应式参数
167
+ * @returns
168
+ */
169
+ request?: (currentNode?: LegacyDataNode, extraParams?: Recordable) => Promise<TreeSelectProps['treeData']>;
170
+ /**
171
+ * 是否跳过首次加载数据
172
+ */
173
+ lazy?: boolean;
174
+ /**
175
+ * 发起request额外的请求,变更后会自动重新发器请求
176
+ */
177
+ params?: Recordable;
178
+ /**
179
+ * 是否懒加载子树
180
+ */
181
+ loadData?: boolean;
182
+ };
154
183
  export type ApFieldSelectExpose = {
155
184
  focus: () => void;
156
185
  blur: () => void;
157
186
  request: (clear?: boolean) => Promise<void>;
158
187
  };
188
+ export type ApFieldTreeSelectExpose = Omit<ApFieldSelectExpose, 'request'> & {
189
+ /**
190
+ * 手动请求treeData
191
+ * @param currentNode 当前树节点(用于请求子树,如果不需要请求子树传入undefined)
192
+ * @param clear 请求数据前是否清空treeData
193
+ * @returns
194
+ */
195
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
196
+ };
159
197
  export type ApFieldSliderProps = BasicApFieldProps<SliderProps> & {
160
198
  emptyText?: string;
161
199
  defaultValue?: number | [number, number];
@@ -1,13 +1,13 @@
1
- import { isVNode as v, defineComponent as B, ref as h, useSlots as b, computed as g, createVNode as d, mergeProps as C, unref as u, createBlock as S, openBlock as _, resolveDynamicComponent as R } from "vue";
2
- import { Input as w } from "@aplus-frontend/antdv";
1
+ import { isVNode as g, defineComponent as I, ref as C, useSlots as S, computed as _, createVNode as s, mergeProps as R, unref as p, createBlock as V, openBlock as w, resolveDynamicComponent as T } from "vue";
2
+ import { Input as j } from "@aplus-frontend/antdv";
3
3
  import "../../hooks/index.mjs";
4
- import { omit as T } from "lodash-unified";
5
- import { useDefaultPlaceholder as V } from "../hooks/use-default-placeholder.mjs";
6
- import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
7
- function I(l) {
8
- return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !v(l);
4
+ import { omit as U } from "lodash-unified";
5
+ import { useDefaultPlaceholder as z } from "../hooks/use-default-placeholder.mjs";
6
+ import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
7
+ function M(a) {
8
+ return typeof a == "function" || Object.prototype.toString.call(a) === "[object Object]" && !g(a);
9
9
  }
10
- const E = /* @__PURE__ */ B({
10
+ const G = /* @__PURE__ */ I({
11
11
  name: "ApFieldText",
12
12
  __name: "index",
13
13
  props: {
@@ -88,54 +88,60 @@ const E = /* @__PURE__ */ B({
88
88
  },
89
89
  emptyText: {
90
90
  default: "--"
91
- }
91
+ },
92
+ beforeInput: {}
92
93
  },
93
94
  emits: ["update:value"],
94
- setup(l, {
95
- expose: i,
96
- emit: c
95
+ setup(a, {
96
+ expose: m,
97
+ emit: y
97
98
  }) {
98
- const a = h(), o = b();
99
- i({
99
+ const u = C(), t = S();
100
+ m({
100
101
  focus: (e) => {
101
- var t;
102
- (t = a.value) == null || t.focus(e);
102
+ var n;
103
+ (n = u.value) == null || n.focus(e);
103
104
  },
104
105
  blur: () => {
105
106
  var e;
106
- (e = a.value) == null || e.blur();
107
+ (e = u.value) == null || e.blur();
107
108
  },
108
- setSelectionRange: (e, t, x) => {
109
- var p;
110
- (p = a.value) == null || p.setSelectionRange(e, t, x);
109
+ setSelectionRange: (e, n, r) => {
110
+ var l;
111
+ (l = u.value) == null || l.setSelectionRange(e, n, r);
111
112
  },
112
113
  select: () => {
113
114
  var e;
114
- (e = a.value) == null || e.select();
115
+ (e = u.value) == null || e.select();
115
116
  },
116
- input: g(() => {
117
+ input: _(() => {
117
118
  var e;
118
- return (e = a.value) == null ? void 0 : e.input;
119
+ return (e = u.value) == null ? void 0 : e.input;
119
120
  })
120
121
  });
121
- const f = c, n = l, {
122
- value: r,
123
- updateValue: s
124
- } = j(n, f), m = V("Text", n);
125
- function y() {
126
- var e, t;
127
- return n.mode === "edit" ? d(w, C(T(n, ["mode", "emptyText", "value", "onUpdate:value"]), {
128
- placeholder: u(m),
129
- value: u(r),
130
- "onUpdate:value": s,
131
- ref: a
132
- }), I(o) ? o : {
133
- default: () => [o]
134
- }) : d("span", null, [n.prefix || ((e = o == null ? void 0 : o.prefix) == null ? void 0 : e.call(o)), u(r) || n.emptyText, n.suffix || ((t = o == null ? void 0 : o.suffix) == null ? void 0 : t.call(o))]);
122
+ const x = y, o = a, {
123
+ value: i,
124
+ updateValue: v
125
+ } = F(o, x), B = z("Text", o);
126
+ function b(e) {
127
+ var c, d, f;
128
+ const n = e.target.value || "", r = o.beforeInput ? (c = o.beforeInput) == null ? void 0 : c.call(o, n) : n, l = (f = (d = u.value) == null ? void 0 : d.$el) == null ? void 0 : f.querySelector("input");
129
+ l && (l.value = r), v(r);
130
+ }
131
+ function h() {
132
+ var e, n;
133
+ return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value"]), {
134
+ placeholder: p(B),
135
+ value: p(i),
136
+ onInput: b,
137
+ ref: u
138
+ }), M(t) ? t : {
139
+ default: () => [t]
140
+ }) : s("span", null, [o.prefix || ((e = t == null ? void 0 : t.prefix) == null ? void 0 : e.call(t)), p(i) || o.emptyText, o.suffix || ((n = t == null ? void 0 : t.suffix) == null ? void 0 : n.call(t))]);
135
141
  }
136
- return (e, t) => (_(), S(R(y())));
142
+ return (e, n) => (w(), V(T(h())));
137
143
  }
138
144
  });
139
145
  export {
140
- E as default
146
+ G as default
141
147
  };