@aplus-frontend/ui 7.4.5 → 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 (121) hide show
  1. package/es/index.mjs +208 -202
  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/item/index.vue.mjs +20 -20
  10. package/es/src/ap-form/item-group/helper.mjs +8 -8
  11. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  12. package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
  13. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  14. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  15. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  16. package/es/src/ap-grid/editable/form-item.vue.mjs +7 -7
  17. package/es/src/ap-grid/editable/index.vue.mjs +38 -38
  18. package/es/src/ap-grid/index.vue.mjs +1 -1
  19. package/es/src/ap-table/ap-table.vue2.mjs +37 -36
  20. package/es/src/ap-table/constants.d.ts +5 -5
  21. package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
  22. package/es/src/business/ap-descriptions/style/index.mjs +2 -1
  23. package/es/src/business/ap-label/group/ApLabelGroup.mjs +14 -14
  24. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +6 -6
  25. package/es/src/business/ap-tag/ap-tag-group.vue.mjs +2 -2
  26. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
  27. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
  28. package/es/src/business/ap-view/icons/line-delete.vue.mjs +2 -2
  29. package/es/src/business/ap-view/icons/line-down.vue.mjs +2 -2
  30. package/es/src/business/ap-view/icons/line-eye.vue.mjs +2 -2
  31. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  32. package/es/src/design-token/interface.d.ts +2 -0
  33. package/es/src/highlight/index.d.ts +3 -0
  34. package/es/src/highlight/index.mjs +2 -0
  35. package/es/src/highlight/index.vue.d.ts +31 -0
  36. package/es/src/highlight/index.vue.mjs +49 -0
  37. package/es/src/highlight/index.vue2.mjs +4 -0
  38. package/es/src/highlight/interface.d.ts +14 -0
  39. package/es/src/highlight/interface.mjs +1 -0
  40. package/es/src/highlight/style/index.d.ts +8 -0
  41. package/es/src/highlight/style/index.mjs +23 -0
  42. package/es/src/index.d.ts +2 -0
  43. package/es/src/index.mjs +309 -301
  44. package/es/src/locale/lang/en.mjs +17 -0
  45. package/es/src/locale/lang/zh-cn.mjs +17 -0
  46. package/es/src/time-ago/index.d.ts +4 -0
  47. package/es/src/time-ago/index.mjs +6 -0
  48. package/es/src/time-ago/index.vue.d.ts +10 -0
  49. package/es/src/time-ago/index.vue.mjs +47 -0
  50. package/es/src/time-ago/index.vue2.mjs +4 -0
  51. package/es/src/time-ago/interface.d.ts +16 -0
  52. package/es/src/time-ago/interface.mjs +1 -0
  53. package/es/src/time-ago/style/index.d.ts +3 -0
  54. package/es/src/time-ago/style/index.mjs +12 -0
  55. package/es/src/time-ago/useTimeAgo.d.ts +42 -0
  56. package/es/src/time-ago/useTimeAgo.mjs +57 -0
  57. package/es/src/time-ago/utils.d.ts +4 -0
  58. package/es/src/time-ago/utils.mjs +23 -0
  59. package/es/src/version.d.ts +1 -1
  60. package/es/src/version.mjs +1 -1
  61. package/lib/index.js +1 -1
  62. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  63. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  64. package/lib/src/ag-grid/index.vue.js +1 -1
  65. package/lib/src/ap-field/date/index.vue.js +1 -1
  66. package/lib/src/ap-field/date/read.vue2.js +1 -1
  67. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  68. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  69. package/lib/src/ap-form/item/index.vue.js +1 -1
  70. package/lib/src/ap-form/item-group/helper.js +1 -1
  71. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  72. package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
  73. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  74. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  75. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  76. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  77. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  78. package/lib/src/ap-grid/index.vue.js +1 -1
  79. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  80. package/lib/src/ap-table/constants.d.ts +5 -5
  81. package/lib/src/business/ap-appendix/icons/file-icon.vue.js +1 -1
  82. package/lib/src/business/ap-descriptions/style/index.js +1 -1
  83. package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
  84. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
  85. package/lib/src/business/ap-tag/ap-tag-group.vue.js +1 -1
  86. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -1
  87. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -1
  88. package/lib/src/business/ap-view/icons/line-delete.vue.js +1 -1
  89. package/lib/src/business/ap-view/icons/line-down.vue.js +1 -1
  90. package/lib/src/business/ap-view/icons/line-eye.vue.js +1 -1
  91. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  92. package/lib/src/design-token/interface.d.ts +2 -0
  93. package/lib/src/highlight/index.d.ts +3 -0
  94. package/lib/src/highlight/index.js +1 -0
  95. package/lib/src/highlight/index.vue.d.ts +31 -0
  96. package/lib/src/highlight/index.vue.js +1 -0
  97. package/lib/src/highlight/index.vue2.js +1 -0
  98. package/lib/src/highlight/interface.d.ts +14 -0
  99. package/lib/src/highlight/interface.js +1 -0
  100. package/lib/src/highlight/style/index.d.ts +8 -0
  101. package/lib/src/highlight/style/index.js +1 -0
  102. package/lib/src/index.d.ts +2 -0
  103. package/lib/src/index.js +1 -1
  104. package/lib/src/locale/lang/en.js +1 -1
  105. package/lib/src/locale/lang/zh-cn.js +1 -1
  106. package/lib/src/time-ago/index.d.ts +4 -0
  107. package/lib/src/time-ago/index.js +1 -0
  108. package/lib/src/time-ago/index.vue.d.ts +10 -0
  109. package/lib/src/time-ago/index.vue.js +1 -0
  110. package/lib/src/time-ago/index.vue2.js +1 -0
  111. package/lib/src/time-ago/interface.d.ts +16 -0
  112. package/lib/src/time-ago/interface.js +1 -0
  113. package/lib/src/time-ago/style/index.d.ts +3 -0
  114. package/lib/src/time-ago/style/index.js +1 -0
  115. package/lib/src/time-ago/useTimeAgo.d.ts +42 -0
  116. package/lib/src/time-ago/useTimeAgo.js +1 -0
  117. package/lib/src/time-ago/utils.d.ts +4 -0
  118. package/lib/src/time-ago/utils.js +1 -0
  119. package/lib/src/version.d.ts +1 -1
  120. package/lib/src/version.js +1 -1
  121. package/package.json +3 -3
@@ -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
@@ -11,6 +11,8 @@ export * from './ap-drawer';
11
11
  export * from './ap-pro-card';
12
12
  export * from './loading-bar';
13
13
  export * from './render';
14
+ export * from './time-ago';
15
+ export * from './highlight';
14
16
  export * from './business';
15
17
  export * from './ap-table';
16
18
  export * from './editable-table';