x-next 1.9.0 → 1.10.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 (51) hide show
  1. package/AI_USAGE.md +69 -7
  2. package/CHANGELOG.md +36 -0
  3. package/dist/_utils/chart/scale.d.ts +1 -1
  4. package/dist/components/_components/chart/axis-labels.d.ts +8 -0
  5. package/dist/components/_components/select-view/select-view.d.ts +9 -0
  6. package/dist/components/form-select/Select.d.ts +18 -5
  7. package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
  8. package/dist/components/form-select/hooks/use-options.d.ts +1 -1
  9. package/dist/components/form-select/hooks/use-select.d.ts +1 -1
  10. package/dist/components/form-select/index.d.ts +42 -11
  11. package/dist/components/form-select/interface.d.ts +8 -0
  12. package/dist/components/link/Link.vue.d.ts +1 -1
  13. package/dist/components/link/index.d.ts +3 -3
  14. package/dist/components/pagination/page-options.vue.d.ts +60 -32
  15. package/dist/components/trigger/interface.d.ts +2 -0
  16. package/dist/components/virtual-list-v2/interface.d.ts +3 -0
  17. package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +336 -1
  18. package/dist/es/_hooks/use-component-ref.js +9 -9
  19. package/dist/es/_utils/chart/scale.js +44 -39
  20. package/dist/es/components/_components/chart/ChartAxis.js +61 -36
  21. package/dist/es/components/_components/chart/axis-labels.js +26 -0
  22. package/dist/es/components/_components/select-view/select-view.js +89 -78
  23. package/dist/es/components/button/Button.js +23 -23
  24. package/dist/es/components/form-input-tag/InputTag.js +1 -1
  25. package/dist/es/components/form-select/Select.js +367 -318
  26. package/dist/es/components/form-select/SelectOption.vue.js +5 -3
  27. package/dist/es/components/form-select/SelectOption.vue2.js +54 -49
  28. package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
  29. package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
  30. package/dist/es/components/form-select/hooks/use-options.js +40 -40
  31. package/dist/es/components/form-select/hooks/use-select.js +76 -71
  32. package/dist/es/components/trigger/Trigger.js +174 -183
  33. package/dist/es/components/virtual-list-v2/virtual-list.vue.js +22 -23
  34. package/dist/es/components/virtual-list-v2/virtual-list.vue2.js +67 -53
  35. package/dist/es/icons/icon.js +37 -36
  36. package/dist/es/icons/index.js +6 -8
  37. package/dist/es/icons/public/lucide-names.js +167 -0
  38. package/dist/es/icons/public/lucide.js +75 -188
  39. package/dist/es/index.js +152 -148
  40. package/dist/es/style.css +1 -1
  41. package/dist/icons/index.d.ts +3 -3
  42. package/dist/icons/names.d.ts +2 -2
  43. package/dist/icons/public/lucide-names.d.ts +32 -0
  44. package/dist/icons/public/lucide.d.ts +2 -2
  45. package/dist/index.cjs +3 -62
  46. package/dist/index.umd.js +3 -62
  47. package/dist/style/base.css +1 -1
  48. package/dist/style/button.css +1 -1
  49. package/dist/style/form-select.css +1 -1
  50. package/dist/style.css +1 -1
  51. package/package.json +3 -2
@@ -1,11 +1,14 @@
1
- import { defineComponent as P, toRefs as R, computed as i, ref as y, nextTick as S } from "vue";
2
- import { useSize as H } from "./hooks/use-size.js";
3
- import M from "./virtual-list-item.js";
4
- import { isObject as V, isNumber as b } from "../../_utils/is.js";
5
- import { getClassNameMixin as w } from "../../_utils/config.js";
6
- const J = P({
1
+ import { defineComponent as K, toRefs as g, computed as i, ref as M, watch as V, nextTick as y } from "vue";
2
+ import { useSize as $ } from "./hooks/use-size.js";
3
+ import q from "./virtual-list-item.js";
4
+ import { isObject as D, isNumber as S } from "../../_utils/is.js";
5
+ import { getClassNameMixin as E } from "../../_utils/config.js";
6
+ import { Scrollbar as F } from "../scrollbar-v2/index.js";
7
+ import { useComponentRef as G } from "../../_hooks/use-component-ref.js";
8
+ import { useScrollbar as J } from "../../_hooks/use-scrollbar.js";
9
+ const le = K({
7
10
  name: "VirtualList",
8
- components: { VirtualListItem: M },
11
+ components: { VirtualListItem: q, ScrollbarComponent: F },
9
12
  props: {
10
13
  height: {
11
14
  type: [Number, String],
@@ -48,79 +51,90 @@ const J = P({
48
51
  paddingPosition: {
49
52
  type: String,
50
53
  default: "content"
54
+ },
55
+ scrollbar: {
56
+ type: [Boolean, Object],
57
+ default: !1
51
58
  }
52
59
  },
53
60
  emits: {
54
- scroll: (e) => !0,
55
- reachBottom: (e) => !0
61
+ scroll: (t) => !0,
62
+ reachBottom: (t) => !0
56
63
  },
57
- setup(e, { emit: u }) {
58
- const { data: r, itemKey: x, fixedSize: T, estimatedSize: z, buffer: f, height: s } = R(e), N = w("virtual-list"), O = i(() => V(e.component) ? {
64
+ setup(t, { emit: m }) {
65
+ const { data: a, itemKey: x, fixedSize: T, estimatedSize: R, buffer: d, height: c } = g(t), { displayScrollbar: z, scrollbarProps: N } = J(g(t).scrollbar), O = E("virtual-list"), C = i(() => D(t.component) ? {
59
66
  container: "div",
60
67
  list: "div",
61
68
  content: "div",
62
- ...e.component
69
+ ...t.component
63
70
  } : {
64
- container: e.component,
71
+ container: t.component,
65
72
  list: "div",
66
73
  content: "div"
67
- }), o = y(), d = y(), _ = i(() => ({
68
- height: b(s.value) ? `${s.value}px` : s.value,
74
+ }), { componentRef: j, elementRef: o } = G("containerRef"), p = M(), B = i(() => ({
75
+ height: S(c.value) ? `${c.value}px` : c.value,
69
76
  overflow: "auto"
70
- })), m = i(
71
- () => r.value.map((t, l) => t[x.value] ?? l)
77
+ })), s = i(
78
+ () => a.value.map((e, l) => e[x.value] ?? l)
72
79
  ), {
73
- frontPadding: j,
74
- behindPadding: B,
75
- start: c,
76
- end: k,
80
+ frontPadding: _,
81
+ behindPadding: P,
82
+ start: u,
83
+ end: w,
77
84
  getStartByScroll: A,
78
- setItemSize: C,
79
- hasItemSize: I,
80
- setStart: v,
81
- getScrollOffset: p
82
- } = H({
83
- dataKeys: m,
84
- contentRef: d,
85
+ setItemSize: I,
86
+ hasItemSize: L,
87
+ setStart: f,
88
+ getScrollOffset: v
89
+ } = $({
90
+ dataKeys: s,
91
+ contentRef: p,
85
92
  fixedSize: T,
86
- estimatedSize: z,
87
- buffer: f
88
- }), K = i(() => e.threshold && r.value.length <= e.threshold ? r.value : r.value.slice(c.value, k.value)), L = (t) => {
89
- const { scrollTop: l, scrollHeight: n, offsetHeight: a } = t.target, g = A(l);
90
- g !== c.value && (v(g), S(() => {
93
+ estimatedSize: R,
94
+ buffer: d
95
+ }), k = i(() => t.threshold && a.value.length <= t.threshold ? a.value : a.value.slice(u.value, w.value));
96
+ V(s, (e, l) => {
97
+ e.length >= l.length && l.every((r, n) => e[n] === r) || (f(0), o.value && (o.value.scrollTop = 0));
98
+ });
99
+ const H = (e) => {
100
+ const { scrollTop: l, scrollHeight: r, clientHeight: n } = e.target, b = A(l);
101
+ b !== u.value && (f(b), y(() => {
91
102
  h(l);
92
- })), u("scroll", t), Math.floor(n - (l + a)) <= 0 && u("reachBottom", t);
93
- }, h = (t) => {
103
+ })), m("scroll", e), Math.floor(r - (l + n)) <= 0 && m("reachBottom", e);
104
+ }, h = (e) => {
94
105
  if (o.value)
95
- if (b(t))
96
- o.value.scrollTop = t;
106
+ if (S(e))
107
+ o.value.scrollTop = e;
97
108
  else {
98
- const { align: l = "top" } = t, n = t.index ?? m.value.indexOf(t.key ?? "");
99
- v(n - f.value), o.value.scrollTop = p(n), S(() => {
109
+ const { align: l = "top" } = e, r = e.index ?? s.value.indexOf(e.key ?? "");
110
+ f(r - d.value), o.value.scrollTop = v(r), y(() => {
100
111
  if (o.value) {
101
- const a = p(n);
102
- a !== o.value.scrollTop && (o.value.scrollTop = a);
112
+ const n = v(r);
113
+ n !== o.value.scrollTop && (o.value.scrollTop = n);
103
114
  }
104
115
  });
105
116
  }
106
117
  };
107
118
  return {
108
- className: N,
119
+ className: O,
109
120
  containerRef: o,
110
- contentRef: d,
111
- frontPadding: j,
112
- currentList: K,
113
- behindPadding: B,
114
- onScroll: L,
115
- setItemSize: C,
116
- hasItemSize: I,
117
- start: c,
121
+ wrapperComRef: j,
122
+ displayScrollbar: z,
123
+ scrollbarProps: N,
124
+ contentRef: p,
125
+ frontPadding: _,
126
+ currentList: k,
127
+ behindPadding: P,
128
+ onScroll: H,
129
+ setItemSize: I,
130
+ hasItemSize: L,
131
+ start: u,
118
132
  scrollTo: h,
119
- style: _,
120
- mergedComponent: O
133
+ style: B,
134
+ mergedComponent: C
121
135
  };
122
136
  }
123
137
  });
124
138
  export {
125
- J as default
139
+ le as default
126
140
  };
@@ -1,14 +1,14 @@
1
- import { defineComponent as u, computed as d, createVNode as c, mergeProps as m, isVNode as b, cloneVNode as g } from "vue";
1
+ import { defineComponent as u, computed as d, createVNode as a, mergeProps as m, isVNode as b, cloneVNode as g } from "vue";
2
2
  import { getClassPrefix as h, getComponentPrefix as S } from "../_utils/config.js";
3
3
  import { isString as x } from "../_utils/is.js";
4
- import { addIcon as $, iconRegistryVersion as z, getIcon as C } from "./registry.js";
5
- function I(t) {
4
+ import { hasIcon as $, addIcon as z, iconRegistryVersion as C, getIcon as I } from "./registry.js";
5
+ function N(t) {
6
6
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !b(t);
7
7
  }
8
- const L = (t) => x(t) ? t.split("-").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join("") : "", N = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), y = (t, n = "px") => {
8
+ const L = (t) => x(t) ? t.split("-").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join("") : "", k = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), y = (t, n = "px") => {
9
9
  if (t === void 0) return "";
10
- const e = typeof t == "number" ? `${t}` : t;
11
- return e ? /^-?\d*\.?\d+(px|%|em|rem|ch|ex|vw|vh|vmin|vmax|cm|mm|in|pt|pc)$/i.test(e) || /^calc\(.+\)$/i.test(e) || /^var\(.+\)$/i.test(e) ? e : e + n : void 0;
10
+ const i = typeof t == "number" ? `${t}` : t;
11
+ return i ? /^-?\d*\.?\d+(px|%|em|rem|ch|ex|vw|vh|vmin|vmax|cm|mm|in|pt|pc)$/i.test(i) || /^calc\(.+\)$/i.test(i) || /^var\(.+\)$/i.test(i) ? i : i + n : void 0;
12
12
  }, v = {
13
13
  name: {
14
14
  type: String,
@@ -42,53 +42,54 @@ const L = (t) => x(t) ? t.split("-").map((n) => n.charAt(0).toUpperCase() + n.sl
42
42
  type: [Number, String],
43
43
  default: void 0
44
44
  }
45
- }, k = (t) => {
45
+ }, V = (t) => {
46
46
  if (!t) return null;
47
47
  if (typeof t == "string")
48
- return c("span", {
48
+ return a("span", {
49
49
  class: "x-icon--raw",
50
50
  innerHTML: t
51
51
  }, null);
52
52
  const n = typeof t == "function" ? t() : t;
53
53
  return g(n);
54
- }, V = (t) => {
55
- }, A = /* @__PURE__ */ u({
54
+ }, A = (t) => {
55
+ }, P = /* @__PURE__ */ u({
56
56
  name: S("Icon"),
57
57
  inheritAttrs: !1,
58
58
  props: v,
59
59
  setup(t, {
60
60
  attrs: n,
61
- slots: e
61
+ slots: i
62
62
  }) {
63
- const o = "x-icon", l = d(() => {
64
- const i = {}, a = y(t.size);
65
- return a && (i.fontSize = a), t.rotate && (i["--x-icon-rotate"] = `${t.rotate}deg`), t.color && (i.color = t.color), t.strokeWidth !== void 0 && (i["--x-icon-stroke-width"] = String(t.strokeWidth)), i;
66
- }), r = d(() => [o, {
67
- [`${o}-spin`]: t.spin,
68
- [`${o}-loading`]: t.spin
63
+ const e = "x-icon", c = d(() => {
64
+ const o = {}, r = y(t.size);
65
+ return r && (o.fontSize = r), t.rotate && (o["--x-icon-rotate"] = `${t.rotate}deg`), t.color && (o.color = t.color), t.strokeWidth !== void 0 && (o["--x-icon-stroke-width"] = String(t.strokeWidth)), o;
66
+ }), l = d(() => [e, {
67
+ [`${e}-spin`]: t.spin,
68
+ [`${e}-loading`]: t.spin
69
69
  }]);
70
70
  return () => {
71
71
  var f;
72
- z.value;
73
- const i = t.name ? C(t.name) : void 0;
74
- t.name && !i && V(t.name);
75
- const a = ((f = e.default) == null ? void 0 : f.call(e)) ?? k(i), s = t.ariaLabel || t.title;
76
- return c("span", m(n, {
77
- class: r.value,
78
- style: l.value,
72
+ C.value;
73
+ const o = t.name ? I(t.name) : void 0;
74
+ t.name && !o && A(t.name);
75
+ const r = ((f = i.default) == null ? void 0 : f.call(i)) ?? V(o), s = t.ariaLabel || t.title;
76
+ return a("span", m(n, {
77
+ class: l.value,
78
+ style: c.value,
79
79
  role: s ? "img" : void 0,
80
80
  "aria-label": s,
81
81
  "aria-hidden": s ? void 0 : "true",
82
82
  "data-icon": t.name
83
- }), [t.spin ? c("span", {
84
- class: `${o}--spin-layer`
85
- }, [a]) : a]);
83
+ }), [t.spin ? a("span", {
84
+ class: `${e}--spin-layer`
85
+ }, [r]) : r]);
86
86
  };
87
87
  }
88
88
  });
89
89
  // @__NO_SIDE_EFFECTS__
90
- function U(t, n) {
91
- return $(N(t), () => g(n)), /* @__PURE__ */ u({
90
+ function M(t, n) {
91
+ const i = k(t);
92
+ return $(i) || z(i, () => g(n)), /* @__PURE__ */ u({
92
93
  name: h(`Icon${L(t)}`),
93
94
  inheritAttrs: !1,
94
95
  props: {
@@ -99,13 +100,13 @@ function U(t, n) {
99
100
  }
100
101
  },
101
102
  setup(e, {
102
- attrs: o
103
+ attrs: c
103
104
  }) {
104
105
  const l = d(() => {
105
- const r = {}, i = y(e.size);
106
- return i && (r.fontSize = i), e.rotate && (r["--x-icon-rotate"] = `${e.rotate}deg`), e.color && (r.color = e.color), r;
106
+ const o = {}, r = y(e.size);
107
+ return r && (o.fontSize = r), e.rotate && (o["--x-icon-rotate"] = `${e.rotate}deg`), e.color && (o.color = e.color), o;
107
108
  });
108
- return () => c(A, m(o, {
109
+ return () => a(P, m(c, {
109
110
  size: e.size,
110
111
  rotate: e.rotate,
111
112
  spin: e.spin,
@@ -114,14 +115,14 @@ function U(t, n) {
114
115
  ariaLabel: e.ariaLabel,
115
116
  strokeWidth: e.strokeWidth,
116
117
  style: l.value
117
- }), I(n) ? n : {
118
+ }), N(n) ? n : {
118
119
  default: () => [n]
119
120
  });
120
121
  }
121
122
  });
122
123
  }
123
124
  export {
124
- A as default,
125
- U as generateIcon,
125
+ P as default,
126
+ M as generateIcon,
126
127
  v as iconProps
127
128
  };
@@ -1,12 +1,10 @@
1
1
  import o from "./icon.js";
2
2
  import { generateComponent as r } from "../_utils/vue-eco.js";
3
- import { getComponentPrefix as e } from "../_utils/config.js";
4
- import { registerPublicIcons as m } from "./public/lucide.js";
5
- import { publicIconNames as s } from "./public/lucide.js";
6
- m();
7
- const i = r(e("Icon"), o);
3
+ import { getComponentPrefix as t } from "../_utils/config.js";
4
+ import { registerPublicIcons as e } from "./public/lucide.js";
5
+ e();
6
+ const c = r(t("Icon"), o);
8
7
  export {
9
- i as Icon,
10
- s as publicIconNames,
11
- m as registerPublicIcons
8
+ c as Icon,
9
+ e as registerPublicIcons
12
10
  };
@@ -0,0 +1,167 @@
1
+ const t = [
2
+ "x",
3
+ "close",
4
+ "check",
5
+ "search",
6
+ "plus",
7
+ "minus",
8
+ "left",
9
+ "right",
10
+ "up",
11
+ "down",
12
+ "chevron-left",
13
+ "chevron-right",
14
+ "chevron-up",
15
+ "chevron-down",
16
+ "check-circle",
17
+ "close-circle",
18
+ "info-circle",
19
+ "alert-circle",
20
+ "minus-circle",
21
+ "circle-check",
22
+ "circle-x",
23
+ "info",
24
+ "circle-alert",
25
+ "circle-minus",
26
+ "link",
27
+ "loading",
28
+ "loading-circle",
29
+ "settings",
30
+ "user",
31
+ "calendar",
32
+ "clock",
33
+ "trash",
34
+ "edit",
35
+ "download",
36
+ "upload",
37
+ "copy",
38
+ "eye",
39
+ "eye-off",
40
+ "menu",
41
+ "more-horizontal",
42
+ "filter",
43
+ "arrow-up-down",
44
+ "star",
45
+ "heart",
46
+ "home",
47
+ "bell",
48
+ "mail",
49
+ "phone",
50
+ "lock",
51
+ "unlock",
52
+ "refresh-cw",
53
+ "rotate-ccw",
54
+ "zoom-in",
55
+ "zoom-out",
56
+ "maximize",
57
+ "image",
58
+ "file",
59
+ "folder",
60
+ "save",
61
+ "external-link",
62
+ "arrow-left",
63
+ "arrow-right",
64
+ "arrow-up",
65
+ "arrow-down",
66
+ "chevrons-left",
67
+ "chevrons-right",
68
+ "circle-question-mark",
69
+ "ellipsis-vertical",
70
+ "rotate-cw"
71
+ ], i = [
72
+ "x",
73
+ "check",
74
+ "search",
75
+ "plus",
76
+ "minus",
77
+ "chevron-left",
78
+ "chevron-right",
79
+ "chevron-up",
80
+ "chevron-down",
81
+ "circle-check",
82
+ "circle-x",
83
+ "info",
84
+ "circle-alert",
85
+ "circle-minus",
86
+ "link",
87
+ "loading",
88
+ "loader-circle",
89
+ "settings",
90
+ "user",
91
+ "calendar",
92
+ "clock",
93
+ "trash",
94
+ "pencil",
95
+ "download",
96
+ "upload",
97
+ "copy",
98
+ "eye",
99
+ "eye-off",
100
+ "menu",
101
+ "ellipsis",
102
+ "filter",
103
+ "arrow-up-down",
104
+ "star",
105
+ "heart",
106
+ "home",
107
+ "bell",
108
+ "mail",
109
+ "phone",
110
+ "lock",
111
+ "lock-open",
112
+ "refresh-cw",
113
+ "rotate-ccw",
114
+ "zoom-in",
115
+ "zoom-out",
116
+ "maximize",
117
+ "image",
118
+ "file",
119
+ "folder",
120
+ "save",
121
+ "external-link",
122
+ "arrow-left",
123
+ "arrow-right",
124
+ "arrow-up",
125
+ "arrow-down",
126
+ "chevrons-left",
127
+ "chevrons-right",
128
+ "circle-question-mark",
129
+ "ellipsis-vertical",
130
+ "rotate-cw"
131
+ ], n = {
132
+ close: "x",
133
+ left: "chevron-left",
134
+ right: "chevron-right",
135
+ up: "chevron-up",
136
+ down: "chevron-down",
137
+ "check-circle": "circle-check",
138
+ "close-circle": "circle-x",
139
+ "info-circle": "info",
140
+ "alert-circle": "circle-alert",
141
+ "minus-circle": "circle-minus",
142
+ "loading-circle": "loader-circle",
143
+ edit: "pencil",
144
+ unlock: "lock-open",
145
+ "more-horizontal": "ellipsis",
146
+ "double-left": "chevrons-left",
147
+ "double-right": "chevrons-right",
148
+ "question-circle": "circle-question-mark",
149
+ "circle-question": "circle-question-mark",
150
+ "eye-invisible": "eye-off",
151
+ "clock-circle": "clock",
152
+ "rotate-left": "rotate-ccw",
153
+ "rotate-right": "rotate-cw"
154
+ }, a = (r) => {
155
+ const e = r.trim().toLowerCase();
156
+ return i.filter(
157
+ (c) => c.includes(e) || Object.entries(n).some(
158
+ ([o, l]) => l === c && o.includes(e)
159
+ )
160
+ );
161
+ };
162
+ export {
163
+ i as canonicalIconNames,
164
+ n as publicIconAliases,
165
+ t as publicIconNames,
166
+ a as searchPublicIcons
167
+ };