@aplus-frontend/ui 7.5.0 → 7.6.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 (87) hide show
  1. package/es/index.mjs +200 -198
  2. package/es/src/ag-grid/editable/form-item.vue.mjs +14 -14
  3. package/es/src/ag-grid/editable/index.vue.mjs +20 -20
  4. package/es/src/ag-grid/index.vue.mjs +15 -15
  5. package/es/src/ap-field/date/index.vue.mjs +14 -14
  6. package/es/src/ap-field/date/read.vue2.mjs +3 -3
  7. package/es/src/ap-field/date-range/index.vue.mjs +8 -8
  8. package/es/src/ap-field/date-range/read.vue2.mjs +3 -3
  9. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  10. package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
  11. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  12. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  13. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  14. package/es/src/ap-grid/editable/form-item.vue.mjs +7 -7
  15. package/es/src/ap-grid/editable/index.vue.mjs +38 -38
  16. package/es/src/ap-grid/index.vue.mjs +1 -1
  17. package/es/src/ap-table/constants.d.ts +5 -5
  18. package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
  19. package/es/src/business/ap-descriptions/style/index.mjs +2 -1
  20. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +6 -6
  21. package/es/src/business/ap-tag/ap-tag-group.vue.mjs +2 -2
  22. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
  23. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
  24. package/es/src/business/ap-view/icons/line-delete.vue.mjs +2 -2
  25. package/es/src/business/ap-view/icons/line-down.vue.mjs +2 -2
  26. package/es/src/business/ap-view/icons/line-eye.vue.mjs +2 -2
  27. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  28. package/es/src/design-token/interface.d.ts +2 -0
  29. package/es/src/highlight/index.d.ts +3 -0
  30. package/es/src/highlight/index.mjs +2 -0
  31. package/es/src/highlight/index.vue.d.ts +31 -0
  32. package/es/src/highlight/index.vue.mjs +49 -0
  33. package/es/src/highlight/index.vue2.mjs +4 -0
  34. package/es/src/highlight/interface.d.ts +14 -0
  35. package/es/src/highlight/interface.mjs +1 -0
  36. package/es/src/highlight/style/index.d.ts +8 -0
  37. package/es/src/highlight/style/index.mjs +23 -0
  38. package/es/src/index.d.ts +1 -0
  39. package/es/src/index.mjs +296 -293
  40. package/es/src/time-ago/index.vue.mjs +17 -16
  41. package/es/src/time-ago/useTimeAgo.mjs +31 -30
  42. package/es/src/version.d.ts +1 -1
  43. package/es/src/version.mjs +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  46. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  47. package/lib/src/ag-grid/index.vue.js +1 -1
  48. package/lib/src/ap-field/date/index.vue.js +1 -1
  49. package/lib/src/ap-field/date/read.vue2.js +1 -1
  50. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  51. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  52. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  53. package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
  54. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  55. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  56. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  57. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  58. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  59. package/lib/src/ap-grid/index.vue.js +1 -1
  60. package/lib/src/ap-table/constants.d.ts +5 -5
  61. package/lib/src/business/ap-appendix/icons/file-icon.vue.js +1 -1
  62. package/lib/src/business/ap-descriptions/style/index.js +1 -1
  63. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
  64. package/lib/src/business/ap-tag/ap-tag-group.vue.js +1 -1
  65. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -1
  66. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -1
  67. package/lib/src/business/ap-view/icons/line-delete.vue.js +1 -1
  68. package/lib/src/business/ap-view/icons/line-down.vue.js +1 -1
  69. package/lib/src/business/ap-view/icons/line-eye.vue.js +1 -1
  70. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  71. package/lib/src/design-token/interface.d.ts +2 -0
  72. package/lib/src/highlight/index.d.ts +3 -0
  73. package/lib/src/highlight/index.js +1 -0
  74. package/lib/src/highlight/index.vue.d.ts +31 -0
  75. package/lib/src/highlight/index.vue.js +1 -0
  76. package/lib/src/highlight/index.vue2.js +1 -0
  77. package/lib/src/highlight/interface.d.ts +14 -0
  78. package/lib/src/highlight/interface.js +1 -0
  79. package/lib/src/highlight/style/index.d.ts +8 -0
  80. package/lib/src/highlight/style/index.js +1 -0
  81. package/lib/src/index.d.ts +1 -0
  82. package/lib/src/index.js +1 -1
  83. package/lib/src/time-ago/index.vue.js +1 -1
  84. package/lib/src/time-ago/useTimeAgo.js +1 -1
  85. package/lib/src/version.d.ts +1 -1
  86. package/lib/src/version.js +1 -1
  87. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as W, useSlots as U, ref as y, watch as C, unref as s, createBlock as $, openBlock as q, withCtx as p, createVNode as w, mergeProps as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as M } from "vue";
2
2
  import { ApForm as m } from "../../ap-form/index.mjs";
3
- import { isEqual as ee, isArray as c, isUndefined as ae, isNumber as g, cloneDeep as te, omit as oe } from "lodash-unified";
3
+ import { isEqual as ee, isArray as c, isUndefined as te, isNumber as g, cloneDeep as ae, omit as oe } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
6
  import { isDef as b } from "../../utils/index.mjs";
@@ -115,7 +115,7 @@ const Fe = /* @__PURE__ */ W({
115
115
  type: Boolean
116
116
  },
117
117
  rowSelection: {
118
- type: Boolean,
118
+ type: [Boolean, Object],
119
119
  default: void 0
120
120
  },
121
121
  onLoadingChange: {},
@@ -168,55 +168,55 @@ const Fe = /* @__PURE__ */ W({
168
168
  expose: x,
169
169
  emit: R
170
170
  }) {
171
- const B = U(), a = v, {
171
+ const B = U(), t = v, {
172
172
  b: S
173
173
  } = re("editable-grid"), F = se("editable-grid"), E = R;
174
174
  le("EditableGrid")(!1, "breaking", "EditableGrid has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
175
175
  const h = y(), {
176
176
  value: u,
177
177
  updateValue: N
178
- } = ie(a, E), i = y(), V = ue("valueTypeMap"), f = m.useWatch(a.name, i);
178
+ } = ie(t, E), i = y(), V = ue("valueTypeMap"), f = m.useWatch(t.name, i);
179
179
  C(() => f.value, (e) => {
180
- N(e), a.onChange?.(e);
180
+ N(e), t.onChange?.(e);
181
181
  }, {
182
182
  deep: !0,
183
183
  flush: "post"
184
184
  }), C(u, (e) => {
185
- e !== s(f) && (ee(e, s(f)) || i.value?.setFieldValue(a.name, e));
185
+ e !== s(f) && (ee(e, s(f)) || i.value?.setFieldValue(t.name, e));
186
186
  }, {
187
187
  deep: !0
188
188
  });
189
- const k = ne(a, V);
189
+ const k = ne(t, V);
190
190
  function L() {
191
191
  i.value?.resetFields();
192
192
  }
193
193
  function _(e) {
194
- return e ? (c(e) ? e : [e]).map((l) => c(l) ? [a.name, ...l] : [a.name, l]) : void 0;
194
+ return e ? (c(e) ? e : [e]).map((l) => c(l) ? [t.name, ...l] : [t.name, l]) : void 0;
195
195
  }
196
196
  async function D(e, n) {
197
- return (await i.value?.validateFields(_(e), n))?.[a.name];
197
+ return (await i.value?.validateFields(_(e), n))?.[t.name];
198
198
  }
199
- function T(e, n) {
199
+ function O(e, n) {
200
200
  const l = s(u)?.length || 0;
201
- if (b(a.maxLength) && l >= a.maxLength)
201
+ if (b(t.maxLength) && l >= t.maxLength)
202
202
  return;
203
- const t = {
203
+ const a = {
204
204
  ...e || {}
205
205
  };
206
- i.value?.setFieldValue?.(a.name, t, !0, (o, r) => {
206
+ i.value?.setFieldValue?.(t.name, a, !0, (o, r) => {
207
207
  if (!o[r]) {
208
- o[r] = [t];
208
+ o[r] = [a];
209
209
  return;
210
210
  }
211
- ae(n) ? o[r].push(t) : o[r].splice(n, 0, t);
211
+ te(n) ? o[r].push(a) : o[r].splice(n, 0, a);
212
212
  });
213
213
  }
214
- function O(e, n = "suffix") {
215
- const l = s(u)?.length || 0, t = g(e) ? e : e.length;
216
- if (b(a.maxLength) && l + t > a.maxLength)
214
+ function T(e, n = "suffix") {
215
+ const l = s(u)?.length || 0, a = g(e) ? e : e.length;
216
+ if (b(t.maxLength) && l + a > t.maxLength)
217
217
  return;
218
- const o = g(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
219
- i.value?.setFieldValue?.(a.name, o, !0, (r, d) => {
218
+ const o = g(e) ? new Array(e).fill(0).map(() => ({})) : ae(e);
219
+ i.value?.setFieldValue?.(t.name, o, !0, (r, d) => {
220
220
  if (!r[d]) {
221
221
  r[d] = [...o];
222
222
  return;
@@ -226,34 +226,34 @@ const Fe = /* @__PURE__ */ W({
226
226
  }
227
227
  function j(e) {
228
228
  const n = new Set(g(e) ? [e] : e);
229
- i.value?.setFieldValue?.(a.name, void 0, !0, (l, t) => {
230
- l[t] = l[t].filter((o, r) => !n.has(r));
229
+ i.value?.setFieldValue?.(t.name, void 0, !0, (l, a) => {
230
+ l[a] = l[a].filter((o, r) => !n.has(r));
231
231
  });
232
232
  }
233
233
  function A(e) {
234
234
  const n = new Set(c(e) ? e : [e]);
235
- n.size !== 0 && i.value?.setFieldValue?.(a.name, void 0, !0, (l, t) => {
236
- l[t] = l[t].filter((o) => !n.has(o[a.rowKey]));
235
+ n.size !== 0 && i.value?.setFieldValue?.(t.name, void 0, !0, (l, a) => {
236
+ l[a] = l[a].filter((o) => !n.has(o[t.rowKey]));
237
237
  });
238
238
  }
239
239
  function z() {
240
240
  return s(u);
241
241
  }
242
242
  function G(e) {
243
- i.value?.setFieldValue(a.name, e);
243
+ i.value?.setFieldValue(t.name, e);
244
244
  }
245
245
  function I(e) {
246
246
  return s(u)?.[e];
247
247
  }
248
248
  function K(e, n, l = !0) {
249
- i.value?.setFieldValue?.(a.name, void 0, !0, (t, o) => {
250
- if (!(!t[o] || !t[o][e])) {
249
+ i.value?.setFieldValue?.(t.name, void 0, !0, (a, o) => {
250
+ if (!(!a[o] || !a[o][e])) {
251
251
  if (!l) {
252
- const r = Object.keys(t[o][e]);
252
+ const r = Object.keys(a[o][e]);
253
253
  for (const d of r)
254
- d !== a.rowKey && delete t[o][e][d];
254
+ d !== t.rowKey && delete a[o][e][d];
255
255
  }
256
- Object.assign(t[o][e], {
256
+ Object.assign(a[o][e], {
257
257
  ...n
258
258
  });
259
259
  }
@@ -264,17 +264,17 @@ const Fe = /* @__PURE__ */ W({
264
264
  h.value?.scrollToRow(n);
265
265
  }
266
266
  function H() {
267
- i.value?.setFieldValue?.(a.name, []);
267
+ i.value?.setFieldValue?.(t.name, []);
268
268
  }
269
269
  return x({
270
270
  resetFields: L,
271
271
  validateFields: D,
272
- add: T,
272
+ add: O,
273
273
  remove: j,
274
274
  getRowData: I,
275
275
  getRowsData: z,
276
276
  setRowData: K,
277
- addMultiple: O,
277
+ addMultiple: T,
278
278
  scrollTo: P,
279
279
  clear: H,
280
280
  setTableData: G,
@@ -283,7 +283,7 @@ const Fe = /* @__PURE__ */ W({
283
283
  ref_key: "formRef",
284
284
  ref: i,
285
285
  "initial-values": {
286
- [a.name]: s(u)
286
+ [t.name]: s(u)
287
287
  },
288
288
  style: {
289
289
  height: "100%"
@@ -293,7 +293,7 @@ const Fe = /* @__PURE__ */ W({
293
293
  name: e.name,
294
294
  "no-style": ""
295
295
  }, {
296
- default: p(() => [w(de, J(s(oe)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
296
+ default: p(() => [w(de, J(s(oe)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
297
297
  ref_key: "tableRef",
298
298
  ref: h,
299
299
  class: [s(S)(), s(F)],
@@ -302,9 +302,9 @@ const Fe = /* @__PURE__ */ W({
302
302
  "search-form": !1
303
303
  }), Q({
304
304
  _: 2
305
- }, [X(B, (l, t) => ({
306
- name: t,
307
- fn: p((o) => [Y(e.$slots, t, Z(M(o || {})))])
305
+ }, [X(B, (l, a) => ({
306
+ name: a,
307
+ fn: p((o) => [Y(e.$slots, a, Z(M(o || {})))])
308
308
  }))]), 1040, ["class", "columns", "data-source"])]),
309
309
  _: 3
310
310
  }, 8, ["name"])]),
@@ -90,7 +90,7 @@ const so = /* @__PURE__ */ Qe({
90
90
  footerCellConfig: {},
91
91
  round: { type: Boolean, default: void 0 },
92
92
  columns: {},
93
- rowSelection: { type: Boolean },
93
+ rowSelection: { type: [Boolean, Object] },
94
94
  card: { type: Boolean, default: !1 },
95
95
  params: {},
96
96
  request: {},
@@ -209,9 +209,9 @@ export declare const apTableFormItemMap: {
209
209
  type: "up" | "down";
210
210
  }) => void) | undefined;
211
211
  readonly type?: string | undefined;
212
+ readonly placeholder?: string | undefined;
212
213
  readonly name?: string | undefined;
213
214
  readonly id?: string | undefined;
214
- readonly placeholder?: string | undefined;
215
215
  readonly valueModifiers?: Record<string, any> | undefined;
216
216
  readonly addonBefore?: any;
217
217
  readonly addonAfter?: any;
@@ -918,6 +918,7 @@ export declare const apTableFormItemMap: {
918
918
  readonly direction?: "ltr" | "rtl" | undefined;
919
919
  readonly animation?: string | undefined;
920
920
  readonly children?: VueNode[] | undefined;
921
+ readonly placeholder?: any;
921
922
  readonly prefixCls?: string | undefined;
922
923
  readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
923
924
  readonly loading?: boolean | undefined;
@@ -928,7 +929,6 @@ export declare const apTableFormItemMap: {
928
929
  readonly getPopupContainer?: RenderDOMFunc | undefined;
929
930
  readonly virtual?: boolean | undefined;
930
931
  readonly dropdownMatchSelectWidth?: number | boolean | undefined;
931
- readonly placeholder?: any;
932
932
  readonly status?: "" | "error" | "warning" | undefined;
933
933
  readonly defaultValue?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
934
934
  readonly prefix?: any;
@@ -1679,6 +1679,7 @@ export declare const apTableFormItemMap: {
1679
1679
  readonly onMousedown?: MouseEventHandler | undefined;
1680
1680
  readonly value?: string | number | undefined;
1681
1681
  readonly disabled?: boolean | undefined;
1682
+ readonly placeholder?: string | number | undefined;
1682
1683
  readonly prefixCls?: string | undefined;
1683
1684
  readonly name?: string | undefined;
1684
1685
  readonly loading?: boolean | undefined;
@@ -1689,7 +1690,6 @@ export declare const apTableFormItemMap: {
1689
1690
  readonly focused?: boolean | undefined;
1690
1691
  readonly readonly?: boolean | undefined;
1691
1692
  readonly autocomplete?: string | undefined;
1692
- readonly placeholder?: string | number | undefined;
1693
1693
  readonly maxlength?: number | undefined;
1694
1694
  readonly showCount?: boolean | ShowCountProps | undefined;
1695
1695
  readonly htmlSize?: number | undefined;
@@ -2301,6 +2301,7 @@ export declare const apTableFormItemMap: {
2301
2301
  readonly onMousedown?: MouseEventHandler | undefined;
2302
2302
  readonly value?: string | number | undefined;
2303
2303
  readonly disabled?: boolean | undefined;
2304
+ readonly placeholder?: string | number | undefined;
2304
2305
  readonly prefixCls?: string | undefined;
2305
2306
  readonly name?: string | undefined;
2306
2307
  readonly loading?: boolean | undefined;
@@ -2311,7 +2312,6 @@ export declare const apTableFormItemMap: {
2311
2312
  readonly focused?: boolean | undefined;
2312
2313
  readonly readonly?: boolean | undefined;
2313
2314
  readonly autocomplete?: string | undefined;
2314
- readonly placeholder?: string | number | undefined;
2315
2315
  readonly maxlength?: number | undefined;
2316
2316
  readonly showCount?: boolean | ShowCountProps | undefined;
2317
2317
  readonly htmlSize?: number | undefined;
@@ -2515,6 +2515,7 @@ export declare const apTableFormItemMap: {
2515
2515
  readonly direction?: "ltr" | "rtl" | undefined;
2516
2516
  readonly animation?: string | undefined;
2517
2517
  readonly children?: VueNode[] | undefined;
2518
+ readonly placeholder?: any;
2518
2519
  readonly prefixCls?: string | undefined;
2519
2520
  readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
2520
2521
  readonly loading?: boolean | undefined;
@@ -2526,7 +2527,6 @@ export declare const apTableFormItemMap: {
2526
2527
  readonly getPopupContainer?: RenderDOMFunc | undefined;
2527
2528
  readonly virtual?: boolean | undefined;
2528
2529
  readonly dropdownMatchSelectWidth?: number | boolean | undefined;
2529
- readonly placeholder?: any;
2530
2530
  readonly status?: "" | "error" | "warning" | undefined;
2531
2531
  readonly defaultValue?: unknown;
2532
2532
  readonly prefix?: any;
@@ -8,9 +8,9 @@ const i = {}, o = {
8
8
  viewBox: "0 0 16 16"
9
9
  };
10
10
  function c(n, Q) {
11
- return e(), t("svg", o, Q[0] || (Q[0] = [
11
+ return e(), t("svg", o, [...Q[0] || (Q[0] = [
12
12
  r('<defs><clipPath id="master_svg0_183_82058/183_76208"><rect x="0" y="0" width="16" height="16" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_183_82058/183_76208)"><g><rect x="0" y="0" width="16" height="16" rx="0" fill="#FFFFFF" fill-opacity="0.009999999776482582" style="mix-blend-mode:passthrough;"></rect></g><g><path d="M6.4678965625,11.32002357421875L11.4176265625,6.37025357421875Q11.4879565625,6.29993357421875,11.5260165625,6.20804357421875Q11.5640765625,6.11616357421875,11.5640765625,6.0167035742187505Q11.5640765625,5.967463574218749,11.5544665625,5.91916357421875Q11.5448565625,5.87086357421875,11.5260165625,5.82536357421875Q11.5071665625,5.77986357421875,11.4798065625,5.7389235742187505Q11.4524465625,5.69797357421875,11.4176265625,5.66315357421875Q11.3828065625,5.62833357421875,11.3418565625,5.6009735742187505Q11.3009165625,5.57361357421875,11.2554165625,5.55476357421875Q11.2099165625,5.535923574218749,11.1616165625,5.52631357421875Q11.1133165625,5.5167035742187505,11.0640765625,5.5167035742187505Q10.9646165625,5.5167035742187505,10.8727365625,5.55476357421875Q10.7808465625,5.59282357421875,10.7105265625,5.66315357421875L10.7102665625,5.66341357421875L5.7607865625,10.612923574218751Q5.4072265625,10.96648357421875,5.0536665625,10.612923574218751Q4.7001265624999995,10.25935357421875,5.0536765625,9.905773574218749L10.9462265625,4.01326057421875Q11.3855665625,3.57391357421875,12.0068765625,3.57391357421875Q12.6282265625,3.57391357421875,13.0675265625,4.01326157421875Q13.5069265625,4.45258357421875,13.5069265625,5.07391357421875Q13.5069265625,5.69523357421875,13.0675265625,6.13459357421875L7.1749865625,12.02712357421875Q6.4427665625,12.75934357421875,5.4072265625,12.75934357421875Q4.3716865625,12.75934357421875,3.6394565625,12.02712357421875Q2.9072265625,11.29489357421875,2.9072265625,10.25935357421875Q2.9072265625,9.22382357421875,3.6394565625,8.49159357421875L8.5891965625,3.5418455742187502Q8.6595265625,3.47151957421875,8.6975865625,3.37963357421875Q8.735646562500001,3.28774857421875,8.735646562500001,3.18829257421875Q8.735646562500001,3.13904677421875,8.7260365625,3.09074737421875Q8.7164265625,3.04244787421875,8.6975865625,2.99695077421875Q8.6787365625,2.95145357421875,8.651376562500001,2.91050757421875Q8.6240165625,2.86956157421875,8.5891965625,2.83473957421875Q8.5543765625,2.79991757421875,8.513426562500001,2.77255757421875Q8.472476562499999,2.74519857421875,8.4269865625,2.72635257421875Q8.381486562500001,2.70750757421875,8.3331865625,2.69789957421875Q8.284886562499999,2.68829257421875,8.235646562500001,2.68829257421875Q8.1361865625,2.68829257421875,8.0442965625,2.72635257421875Q7.9524165625,2.76441257421875,7.8820865625,2.83473957421875L7.8816965625,2.83512857421875L2.9323545625,7.78448357421875Q1.9072265625,8.80960357421875,1.9072265625,10.25935357421875Q1.9072265625,11.70910357421875,2.9323525625,12.73422357421875Q3.9574765625,13.75931357421875,5.4072265625,13.75931357421875Q6.8569765625,13.75931357421875,7.8820965625,12.73422357421875L13.7746265625,6.8416835742187505Q14.5069265625,6.10944357421875,14.5069265625,5.07391357421875Q14.5069265625,4.03837257421875,13.7746265625,3.30615057421875Q13.0424265625,2.57391357421875,12.0068765625,2.57391357421875Q10.9713365625,2.57391357421875,10.239126562500001,3.30615157421875L4.3465365625,9.19870357421875Q3.9072365625,9.638043574218749,3.9072365625,10.25935357421875Q3.9072365625,10.880663574218751,4.3465565625,11.32002357421875Q4.7859065625,11.75937357421875,5.4072265625,11.75937357421875Q6.0285465625,11.75937357421875,6.4678965625,11.32002357421875Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"></path></g></g>', 2)
13
- ]));
13
+ ])]);
14
14
  }
15
15
  const _ = /* @__PURE__ */ l(i, [["render", c]]);
16
16
  export {
@@ -30,7 +30,8 @@ const e = (t) => {
30
30
  flexShrink: 1,
31
31
  minWidth: 0,
32
32
  ".ant-typography": {
33
- marginBlockEnd: 0
33
+ marginBlockEnd: 0,
34
+ flex: 1
34
35
  },
35
36
  ".ant-typography-ellipsis": {
36
37
  maxWidth: "100%"
@@ -57,9 +57,9 @@ const X = ["onClick"], se = /* @__PURE__ */ D({
57
57
  open: k.value,
58
58
  "onUpdate:open": n[0] || (n[0] = (l) => k.value = l)
59
59
  }, {
60
- title: c(() => n[3] || (n[3] = [
61
- A("收起")
62
- ])),
60
+ title: c(() => [...n[3] || (n[3] = [
61
+ A("收起", -1)
62
+ ])]),
63
63
  default: c(() => [
64
64
  u(e(G), { onClick: F })
65
65
  ]),
@@ -118,9 +118,9 @@ const X = ["onClick"], se = /* @__PURE__ */ D({
118
118
  open: T.value,
119
119
  "onUpdate:open": n[2] || (n[2] = (l) => T.value = l)
120
120
  }, {
121
- title: c(() => n[4] || (n[4] = [
122
- A("展开")
123
- ])),
121
+ title: c(() => [...n[4] || (n[4] = [
122
+ A("展开", -1)
123
+ ])]),
124
124
  default: c(() => [
125
125
  u(e(H), { onClick: F })
126
126
  ]),
@@ -106,7 +106,7 @@ const xe = /* @__PURE__ */ j({
106
106
  cursor: "pointer"
107
107
  })
108
108
  }, {
109
- component: v(() => o[0] || (o[0] = [
109
+ component: v(() => [...o[0] || (o[0] = [
110
110
  t("svg", {
111
111
  xmlns: "http://www.w3.org/2000/svg",
112
112
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -160,7 +160,7 @@ const xe = /* @__PURE__ */ j({
160
160
  ])
161
161
  ])
162
162
  ], -1)
163
- ])),
163
+ ])]),
164
164
  _: 1
165
165
  }, 8, ["style"])) : c.value && r.value.symbol === "text" ? (a(), _("span", {
166
166
  key: 1,
@@ -8,7 +8,7 @@ const r = {}, L = {
8
8
  viewBox: "0 0 20 20"
9
9
  };
10
10
  function i(c, o) {
11
- return n(), l("svg", L, o[0] || (o[0] = [
11
+ return n(), l("svg", L, [...o[0] || (o[0] = [
12
12
  e("g", null, [
13
13
  e("g", null, [
14
14
  e("path", {
@@ -19,7 +19,7 @@ function i(c, o) {
19
19
  })
20
20
  ])
21
21
  ], -1)
22
- ]));
22
+ ])]);
23
23
  }
24
24
  const f = /* @__PURE__ */ t(r, [["render", i]]);
25
25
  export {
@@ -8,9 +8,9 @@ const r = {}, s = {
8
8
  viewBox: "0 0 56 56"
9
9
  };
10
10
  function p(a, t) {
11
- return i(), o("svg", s, t[0] || (t[0] = [
11
+ return i(), o("svg", s, [...t[0] || (t[0] = [
12
12
  e('<defs><clipPath id="master_svg0_693_19001"><rect x="0" y="0" width="56" height="56" rx="7"></rect></clipPath><linearGradient id="master_svg1_693_19025" x1="0.5" y1="0" x2="0.5" y2="0.7987817525863647"><stop offset="0%" stop-color="#AED1FF" stop-opacity="1"></stop><stop offset="100%" stop-color="#74B1FF" stop-opacity="1"></stop></linearGradient><linearGradient id="master_svg2_693_19014" x1="0.5" y1="0" x2="0.5" y2="1"><stop offset="0.7142857182770967%" stop-color="#DBEBFF" stop-opacity="1"></stop><stop offset="100%" stop-color="#98C5FF" stop-opacity="1"></stop></linearGradient></defs><g clip-path="url(#master_svg0_693_19001)"><g><g><path d="M49.4644,10.22729L35.1706,10.22729C34.2282,10.22729,33.316,9.89456,32.595,9.287759999999999L29.1746,6.4093C28.0931,5.499102,26.7249,5,25.3113,5L5.5,5C3.29086,5,1.5,6.79086,1.5,9L1.5,45L54.4995,45L54.5,15.2852C54.5,12.49165,52.2455,10.22729,49.4644,10.22729Z" fill="url(#master_svg1_693_19025)" fill-opacity="1"></path></g><g><path d="M10.5,13L45.5,13C46.6046,13,47.5,13.895431,47.5,15L47.5,35.9999L8.5,36L8.5,15C8.5,13.895431,9.395431,13,10.5,13" fill="#FFFFFF" fill-opacity="0.30000001192092896"></path></g><g><path d="M8.5,17L47.5,17C48.6046,17,49.5,17.895431,49.5,19L49.5,41.9998L6.5,42L6.5,19C6.5,17.895431,7.395431,17,8.5,17" fill="#F9FCFF" fill-opacity="1"></path></g><g><rect x="14.5" y="21" width="15" height="2" rx="1" fill="#8DBFFF" fill-opacity="0.30000001192092896"></rect></g><g><rect x="14.5" y="27" width="28" height="2" rx="1" fill="#8DBFFF" fill-opacity="0.6000000238418579"></rect></g><g><path d="M1.5,37L1.5,48C1.5,50.2091,3.29086,52,5.5,52L50.5,52C52.7091,52,54.5,50.2091,54.5,48L54.5,37C54.5,35.34315,53.1569,34,51.5,34L4.5,34C2.84315,34,1.5,35.34315,1.5,37Z" fill="url(#master_svg2_693_19014)" fill-opacity="1"></path></g></g></g>', 2)
13
- ]));
13
+ ])]);
14
14
  }
15
15
  const g = /* @__PURE__ */ l(r, [["render", p]]);
16
16
  export {
@@ -10,7 +10,7 @@ const r = {}, L = {
10
10
  viewBox: "0 0 14 14"
11
11
  };
12
12
  function i(s, t) {
13
- return n(), l("svg", L, t[0] || (t[0] = [
13
+ return n(), l("svg", L, [...t[0] || (t[0] = [
14
14
  e("g", null, [
15
15
  e("g", null, [
16
16
  e("path", {
@@ -21,7 +21,7 @@ function i(s, t) {
21
21
  })
22
22
  ])
23
23
  ], -1)
24
- ]));
24
+ ])]);
25
25
  }
26
26
  const f = /* @__PURE__ */ o(r, [["render", i]]);
27
27
  export {
@@ -10,7 +10,7 @@ const r = {}, i = {
10
10
  viewBox: "0 0 14 14"
11
11
  };
12
12
  function s(c, n) {
13
- return t(), o("svg", i, n[0] || (n[0] = [
13
+ return t(), o("svg", i, [...n[0] || (n[0] = [
14
14
  e("g", null, [
15
15
  e("g", null, [
16
16
  e("path", {
@@ -21,7 +21,7 @@ function s(c, n) {
21
21
  })
22
22
  ])
23
23
  ], -1)
24
- ]));
24
+ ])]);
25
25
  }
26
26
  const d = /* @__PURE__ */ l(r, [["render", s]]);
27
27
  export {
@@ -10,7 +10,7 @@ const l = {}, r = {
10
10
  viewBox: "0 0 16 16"
11
11
  };
12
12
  function i(s, t) {
13
- return o(), n("svg", r, t[0] || (t[0] = [
13
+ return o(), n("svg", r, [...t[0] || (t[0] = [
14
14
  e("g", null, [
15
15
  e("g", null, [
16
16
  e("path", {
@@ -21,7 +21,7 @@ function i(s, t) {
21
21
  })
22
22
  ])
23
23
  ], -1)
24
- ]));
24
+ ])]);
25
25
  }
26
26
  const w = /* @__PURE__ */ Q(l, [["render", i]]);
27
27
  export {
@@ -45,6 +45,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
45
45
  readonly onMousedown?: MouseEventHandler | undefined;
46
46
  readonly value?: string | number | undefined;
47
47
  readonly disabled?: boolean | undefined;
48
+ readonly placeholder?: string | number | undefined;
48
49
  readonly prefixCls?: string | undefined;
49
50
  readonly name?: string | undefined;
50
51
  readonly loading?: boolean | undefined;
@@ -55,7 +56,6 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
55
56
  readonly focused?: boolean | undefined;
56
57
  readonly readonly?: boolean | undefined;
57
58
  readonly autocomplete?: string | undefined;
58
- readonly placeholder?: string | number | undefined;
59
59
  readonly maxlength?: number | undefined;
60
60
  readonly showCount?: boolean | ShowCountProps | undefined;
61
61
  readonly htmlSize?: number | undefined;
@@ -14,6 +14,7 @@ import { ApRadioGroupToken } from '../business/ap-radio-group/style';
14
14
  import { ApGridToken } from '../ap-grid/style';
15
15
  import { TokenUtil } from '../utils/cssinjs/TokenUtil';
16
16
  import { LoadingBarToken } from '../loading-bar/style';
17
+ import { HighlightToken } from '../highlight/style';
17
18
  /** 基础token */
18
19
  export type BaseToken = {
19
20
  /**
@@ -154,6 +155,7 @@ export type ComponentsToken = {
154
155
  ApRadioGroup: ApRadioGroupToken;
155
156
  ApGrid: ApGridToken;
156
157
  LoadingBar: LoadingBarToken;
158
+ Highlight: HighlightToken;
157
159
  };
158
160
  /** 全量token */
159
161
  export type FullToken = BaseToken & {
@@ -0,0 +1,3 @@
1
+ import { default as Highlight } from './index.vue';
2
+ export * from './interface';
3
+ export { Highlight };
@@ -0,0 +1,2 @@
1
+ import "./index.vue2.mjs";
2
+ import "./interface.mjs";
@@ -0,0 +1,31 @@
1
+ import { HighlightProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: Readonly<Partial<{
6
+ default: (options: {
7
+ text: string;
8
+ }) => any;
9
+ keywords: (options: {
10
+ text: string;
11
+ }) => any;
12
+ }>> & Partial<{
13
+ default: (options: {
14
+ text: string;
15
+ }) => any;
16
+ keywords: (options: {
17
+ text: string;
18
+ }) => any;
19
+ }>;
20
+ refs: {};
21
+ rootEl: HTMLDivElement;
22
+ };
23
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
+ declare const __VLS_component: DefineComponent<HighlightProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<HighlightProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
25
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
+ export default _default;
27
+ type __VLS_WithTemplateSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -0,0 +1,49 @@
1
+ import { defineComponent as v, computed as c, createElementBlock as s, openBlock as n, normalizeClass as p, unref as i, Fragment as u, renderList as C, renderSlot as d, createTextVNode as m, toDisplayString as y } from "vue";
2
+ import "../config-provider/index.mjs";
3
+ import S from "./style/index.mjs";
4
+ import { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
5
+ const B = { key: 1 }, N = /* @__PURE__ */ v({
6
+ name: "Highlight",
7
+ __name: "index",
8
+ props: {
9
+ content: {},
10
+ keywords: {},
11
+ ignoreCase: { type: Boolean }
12
+ },
13
+ setup(g) {
14
+ const o = g, { b: h, e: k } = $("highlight"), f = S("highlight"), l = c(() => {
15
+ const e = o.keywords;
16
+ if (!e)
17
+ return null;
18
+ let t = Array.isArray(e) ? e : [e];
19
+ return t = t.sort((r, a) => a.length - r.length), new RegExp(
20
+ `(${t.join("|")})`,
21
+ `${o.ignoreCase ? "i" : ""}g`
22
+ );
23
+ }), w = c(() => {
24
+ const e = o.content;
25
+ return !l.value || !e ? [{ keywords: !1, text: e }] : e.split(l.value).map((t) => ({ keywords: l.value.test(t), text: t }));
26
+ });
27
+ return (e, t) => (n(), s("div", {
28
+ class: p([i(h)(), i(f)])
29
+ }, [
30
+ (n(!0), s(u, null, C(w.value, ({ text: r, keywords: a }, _) => (n(), s(u, { key: _ }, [
31
+ a ? (n(), s("span", {
32
+ key: 0,
33
+ class: p(i(k)("keywords"))
34
+ }, [
35
+ d(e.$slots, "keywords", { text: r }, () => [
36
+ m(y(r), 1)
37
+ ])
38
+ ], 2)) : (n(), s("span", B, [
39
+ d(e.$slots, "default", { text: r }, () => [
40
+ m(y(r), 1)
41
+ ])
42
+ ]))
43
+ ], 64))), 128))
44
+ ], 2));
45
+ }
46
+ });
47
+ export {
48
+ N as default
49
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,14 @@
1
+ export type HighlightProps = {
2
+ /**
3
+ * 当前渲染的段落内容
4
+ */
5
+ content: string;
6
+ /**
7
+ * 需要高亮的关键字
8
+ */
9
+ keywords?: string | string[];
10
+ /**
11
+ * 是否忽略大小写
12
+ */
13
+ ignoreCase?: boolean;
14
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,8 @@
1
+ import { ComputedRef } from 'vue';
2
+ export type HighlightToken = {
3
+ highlightKeywordsColor: string;
4
+ highlightKeywordsBackground: string;
5
+ highlightKeywordsPadding: string | number;
6
+ };
7
+ declare const _default: (prefixCls: string) => ComputedRef<string>;
8
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { resetComponent as g } from "../../style/index.mjs";
2
+ import { genComponentStyleHook as h } from "../../utils/cssinjs/index.mjs";
3
+ const i = (o) => ({
4
+ [o.componentCls]: {
5
+ ...g(o),
6
+ [`${o.componentCls}__keywords`]: {
7
+ color: o.highlightKeywordsColor,
8
+ background: o.highlightKeywordsBackground,
9
+ paddingInline: o.highlightKeywordsPadding
10
+ }
11
+ }
12
+ }), d = h(
13
+ "Highlight",
14
+ (o) => [i(o)],
15
+ {
16
+ highlightKeywordsColor: "#faad14",
17
+ highlightKeywordsBackground: "transparent",
18
+ highlightKeywordsPadding: 2
19
+ }
20
+ );
21
+ export {
22
+ d as default
23
+ };
package/es/src/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './ap-pro-card';
12
12
  export * from './loading-bar';
13
13
  export * from './render';
14
14
  export * from './time-ago';
15
+ export * from './highlight';
15
16
  export * from './business';
16
17
  export * from './ap-table';
17
18
  export * from './editable-table';