hys-ui 0.3.0 → 0.4.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 (93) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +68 -73
  3. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
  4. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
  5. package/dist/components/HysButton/HysButton.vue.js +2 -2
  6. package/dist/components/HysButton/HysButton2.vue.js +227 -60
  7. package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
  8. package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
  9. package/dist/components/HysMention/HysMention.vue.js +1 -1
  10. package/dist/components/HysMention/HysMention2.vue.js +1092 -154
  11. package/dist/components/HysModal/HysModal.vue.js +3 -3
  12. package/dist/components/HysModal/HysModal2.vue.js +81 -80
  13. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  14. package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
  15. package/dist/components/HysSearch/HysSearch.vue.js +5 -82
  16. package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
  17. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  18. package/dist/components/HysSelect/HysSelect2.vue.js +472 -443
  19. package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
  20. package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
  21. package/dist/components/HysTable/HysTable.vue.js +2 -2
  22. package/dist/components/HysTable/HysTable2.vue.js +1418 -1150
  23. package/dist/components/HysTour/HysTour.vue.js +291 -67
  24. package/dist/components/HysTour/HysTour3.vue.js +5 -0
  25. package/dist/composables/buttonGroup.js +12 -0
  26. package/dist/composables/floatingPosition.js +18 -0
  27. package/dist/composables/mentionDocument.js +79 -0
  28. package/dist/composables/mentionEditor.js +58 -0
  29. package/dist/composables/selectOptions.js +44 -38
  30. package/dist/composables/splitPaneSizes.js +58 -0
  31. package/dist/composables/table.js +128 -105
  32. package/dist/composables/useDialog.js +50 -50
  33. package/dist/composables/useFloating.js +107 -103
  34. package/dist/composables/useMentionCaret.js +81 -0
  35. package/dist/composables/useMentionList.js +81 -0
  36. package/dist/composables/useMentionModel.js +90 -0
  37. package/dist/composables/useMentionOptions.js +421 -0
  38. package/dist/composables/useSplitPaneDrag.js +52 -0
  39. package/dist/composables/useSplitPaneStorage.js +38 -0
  40. package/dist/composables/useTable.js +344 -312
  41. package/dist/composables/useTableSticky.js +79 -0
  42. package/dist/composables/useTourLayout.js +129 -0
  43. package/dist/config.js +11 -11
  44. package/dist/index.js +175 -156
  45. package/dist/internal/MultiSplitPane.vue.js +305 -0
  46. package/dist/internal/MultiSplitPane2.vue.js +4 -0
  47. package/dist/style.css +1 -1
  48. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
  49. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +1 -1
  50. package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
  51. package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
  52. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
  53. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +2 -2
  54. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +2 -2
  55. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +2 -2
  56. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -1
  57. package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -40
  58. package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
  59. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  60. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
  61. package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
  62. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
  63. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +6 -1
  64. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
  65. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  66. package/dist/types/components/HysTable/HysTable.vue.d.ts +1740 -3
  67. package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -9
  68. package/dist/types/composables/buttonGroup.d.ts +9 -0
  69. package/dist/types/composables/floatingPosition.d.ts +14 -0
  70. package/dist/types/composables/mention.d.ts +284 -0
  71. package/dist/types/composables/mentionDocument.d.ts +15 -0
  72. package/dist/types/composables/mentionEditor.d.ts +7 -0
  73. package/dist/types/composables/modal.d.ts +2 -0
  74. package/dist/types/composables/selectOptions.d.ts +5 -0
  75. package/dist/types/composables/splitPaneSizes.d.ts +11 -0
  76. package/dist/types/composables/table.d.ts +116 -6
  77. package/dist/types/composables/tour.d.ts +68 -0
  78. package/dist/types/composables/useFloating.d.ts +1 -1
  79. package/dist/types/composables/useMentionCaret.d.ts +6 -0
  80. package/dist/types/composables/useMentionList.d.ts +23 -0
  81. package/dist/types/composables/useMentionModel.d.ts +14 -0
  82. package/dist/types/composables/useMentionOptions.d.ts +26 -0
  83. package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
  84. package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
  85. package/dist/types/composables/useTable.d.ts +7 -3
  86. package/dist/types/composables/useTableSticky.d.ts +22 -0
  87. package/dist/types/composables/useTourLayout.d.ts +33 -0
  88. package/dist/types/config.d.ts +1 -0
  89. package/dist/types/index.d.ts +36 -1
  90. package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
  91. package/package.json +3 -2
  92. package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
  93. package/dist/components/HysTour/HysTour2.vue.js +0 -4
@@ -1,215 +1,278 @@
1
- import { defineComponent as O, computed as s, ref as I, watch as P, openBlock as v, createElementBlock as c, mergeProps as Q, unref as C, toDisplayString as g, createCommentVNode as w, createElementVNode as B, createVNode as o, withCtx as S, Fragment as F, renderList as U, createBlock as q, normalizeClass as G, createTextVNode as V, withModifiers as K } from "vue";
2
- import { useHysRootAttrs as W } from "../../config.js";
3
- import { ChevronsLeft as X, ChevronLeft as Y, ChevronRight as Z, ChevronsRight as _ } from "lucide-vue-next";
4
- import ee from "../HysSelect/HysSelect.vue.js";
5
- import ae from "../HysNumberInput/HysNumberInput.vue.js";
6
- import M from "../HysButton/HysButton.vue.js";
7
- const te = ["aria-busy"], le = {
1
+ import { defineComponent as ne, useSlots as se, ref as N, computed as u, watch as V, openBlock as s, createElementBlock as o, mergeProps as ue, unref as oe, Fragment as h, renderList as P, normalizeClass as j, renderSlot as w, createTextVNode as B, toDisplayString as b, createBlock as $, withCtx as F, createCommentVNode as A, createElementVNode as W, resolveDynamicComponent as re, createVNode as R, withModifiers as pe } from "vue";
2
+ import { ChevronsRight as ve, ChevronRight as de, ChevronLeft as ge, ChevronsLeft as ce } from "lucide-vue-next";
3
+ import { useHysRootAttrs as fe } from "../../config.js";
4
+ import H from "../HysButton/HysButton.vue.js";
5
+ import me from "../HysNumberInput/HysNumberInput.vue.js";
6
+ import he from "../HysSelect/HysSelect.vue.js";
7
+ const be = ["data-size", "aria-label", "aria-busy"], ye = {
8
8
  key: 0,
9
9
  class: "hys-ui-pf-pagination-total",
10
10
  "aria-live": "polite"
11
- }, ie = { class: "hys-ui-pf-pagination-actions" }, ne = { class: "hys-ui-pf-pagination-controls" }, ue = {
11
+ }, Se = {
12
+ key: 1,
13
+ class: "hys-ui-pf-pagination-controls"
14
+ }, ze = {
12
15
  key: 1,
13
16
  class: "hys-ui-pf-pagination-gap",
14
17
  "aria-hidden": "true"
15
- }, se = {
16
- key: 1,
17
- class: "hys-ui-pf-pagination-indicator"
18
- }, oe = {
18
+ }, ke = {
19
19
  key: 2,
20
- class: "hys-ui-pf-pagination-mobile-indicator"
21
- }, re = {
22
- key: 0,
23
20
  class: "hys-ui-pf-pagination-size"
24
- }, ge = /* @__PURE__ */ O({
21
+ }, Be = /* @__PURE__ */ ne({
25
22
  __name: "HysPagination",
26
23
  props: {
27
24
  page: {},
28
25
  total: {},
29
- pageSize: { default: 10 },
26
+ pageCount: {},
27
+ pageSize: {},
28
+ defaultPage: { default: 1 },
29
+ defaultPageSize: { default: 10 },
30
30
  pageSizeOptions: {},
31
31
  siblingCount: { default: 1 },
32
32
  showSizeChanger: { type: Boolean, default: !1 },
33
33
  showQuickJumper: { type: Boolean, default: !1 },
34
34
  showTotal: { type: Boolean, default: !0 },
35
+ hideOnSinglePage: { type: Boolean, default: !1 },
35
36
  disabled: { type: Boolean, default: !1 },
36
37
  loading: { type: Boolean, default: !1 },
37
38
  compact: { type: Boolean, default: !1 },
39
+ responsive: { type: Boolean, default: !0 },
40
+ size: { default: "md" },
41
+ layout: {},
38
42
  labels: {}
39
43
  },
40
44
  emits: ["change", "update:page", "pageSizeChange", "update:pageSize"],
41
- setup(d, { emit: H }) {
42
- const $ = W(), u = d, b = H, h = s(() => Number.isFinite(u.pageSize) && u.pageSize > 0 ? Math.floor(u.pageSize) : 10), k = s(() => Number.isFinite(u.total) ? Math.max(0, Math.floor(u.total)) : 0), p = s(() => Math.max(1, Math.ceil(k.value / h.value))), a = s(() => Math.min(p.value, Math.max(1, Number.isFinite(u.page) ? Math.floor(u.page) : 1))), r = s(() => u.disabled || u.loading), E = s(() => k.value === 0 ? 0 : (a.value - 1) * h.value + 1), J = s(() => Math.min(k.value, a.value * h.value)), n = s(() => ({ total: "共 {total} 条({start}–{end})", perPage: "每页条数", jump: "跳转到", page: "页", first: "首页", previous: "上一页", next: "下一页", last: "末页", ...u.labels })), L = s(() => n.value.total.replace("{total}", String(k.value)).replace("{start}", String(E.value)).replace("{end}", String(J.value))), R = s(() => [...new Set([...u.pageSizeOptions ?? [10, 20, 50, 100], h.value].filter((l) => Number.isInteger(l) && l > 0))].sort((l, e) => l - e)), T = s(() => {
43
- const l = p.value, e = Math.max(0, Math.min(5, Math.floor(u.siblingCount))), t = /* @__PURE__ */ new Set([1, l]);
44
- for (let i = Math.max(1, a.value - e); i <= Math.min(l, a.value + e); i++) t.add(i);
45
- if (a.value <= e + 3) for (let i = 1; i <= Math.min(l, 2 * e + 3); i++) t.add(i);
46
- if (a.value >= l - e - 2) for (let i = Math.max(1, l - (2 * e + 2)); i <= l; i++) t.add(i);
47
- const f = [...t].sort((i, z) => i - z), N = [];
48
- return f.forEach((i, z) => {
49
- z && i - f[z - 1] > 1 && (i - f[z - 1] === 2 ? N.push(i - 1) : N.push(z === 1 ? "left-gap" : "right-gap")), N.push(i);
50
- }), N;
51
- }), x = I(a.value), m = I(a.value), j = s(() => m.value !== null && Number.isInteger(m.value) && m.value > 0 && m.value !== a.value);
52
- P(a, () => {
53
- x.value = a.value, m.value = a.value;
54
- }), P(x, (l) => m.value = l);
55
- function y(l) {
56
- if (r.value || !Number.isFinite(l)) return;
57
- const e = Math.min(p.value, Math.max(1, Math.floor(l)));
58
- e !== a.value && (b("update:page", e), b("change", e));
45
+ setup(c, { emit: Y }) {
46
+ const Z = fe(), l = c, C = Y, _ = se();
47
+ function y(e, t) {
48
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, Math.floor(e))) : t;
49
+ }
50
+ const J = N(y(l.defaultPageSize, 10)), S = u(() => y(l.pageSize, J.value)), z = u(() => l.total === void 0 ? void 0 : Number.isFinite(l.total) ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(l.total))) : 0), r = u(() => l.pageCount === void 0 ? Math.max(1, Math.ceil((z.value ?? 0) / S.value)) : y(l.pageCount, 1)), L = N(Math.min(y(l.defaultPage, 1), r.value)), T = u(() => y(l.page, L.value)), i = u(() => Math.min(T.value, r.value)), m = u(() => l.disabled || l.loading), D = u(() => (i.value - 1) * S.value), x = u(() => D.value < (z.value ?? 0) ? D.value + 1 : 0), O = u(() => x.value ? Math.min(z.value ?? 0, i.value * S.value) : 0), v = u(() => {
51
+ var e;
52
+ return {
53
+ total: "共 {total} 条({start}–{end})",
54
+ perPage: "每页条数",
55
+ jump: "跳转到",
56
+ page: "页",
57
+ pageItem: "第 {page} " + (((e = l.labels) == null ? void 0 : e.page) ?? "页"),
58
+ navigation: "分页导航",
59
+ confirm: "确定",
60
+ first: "首页",
61
+ previous: "上一页",
62
+ next: "下一页",
63
+ last: "末页",
64
+ ...l.labels
65
+ };
66
+ }), ee = u(() => v.value.total.replace("{total}", String(z.value ?? 0)).replace("{start}", String(x.value)).replace("{end}", String(O.value))), ae = u(() => [...new Set([
67
+ ...l.pageSizeOptions ?? [10, 20, 50, 100],
68
+ S.value
69
+ ].filter((e) => Number.isSafeInteger(e) && e > 0))].sort((e, t) => e - t).map((e) => ({ label: String(e), value: String(e) }))), k = u(() => ({
70
+ first: { page: 1, label: v.value.first, icon: ce },
71
+ prev: { page: i.value - 1, label: v.value.previous, icon: ge },
72
+ next: { page: i.value + 1, label: v.value.next, icon: de },
73
+ last: { page: r.value, label: v.value.last, icon: ve }
74
+ }));
75
+ function q(e) {
76
+ return m.value || (e === "first" || e === "prev" ? i.value === 1 : i.value === r.value);
77
+ }
78
+ function G(e) {
79
+ return e === "first" || e === "prev" || e === "pager" || e === "next" || e === "last";
59
80
  }
60
- function A(l) {
61
- if (r.value) return;
62
- const e = Number(l);
63
- if (!Number.isInteger(e) || e < 1 || e === h.value) return;
64
- const t = a.value, f = Math.max(1, Math.ceil(k.value / e));
65
- b("update:pageSize", e), t > f && (b("update:page", f), b("change", f)), b("pageSizeChange", e);
81
+ const Q = u(() => {
82
+ const e = [
83
+ l.showTotal ? "total" : "",
84
+ "->",
85
+ "first",
86
+ "prev",
87
+ "pager",
88
+ "next",
89
+ "last",
90
+ l.showSizeChanger ? "sizes" : "",
91
+ l.showQuickJumper ? "jumper" : ""
92
+ ].join(","), t = [
93
+ { side: "leading", groups: [] },
94
+ { side: "trailing", groups: [] }
95
+ ], d = /* @__PURE__ */ new Set();
96
+ let p = t[0].groups;
97
+ for (const g of (l.layout ?? e).split(",")) {
98
+ const a = g.trim();
99
+ if (a === "->") {
100
+ p = t[1].groups;
101
+ continue;
102
+ }
103
+ if (!(!G(a) && a !== "total" && a !== "sizes" && a !== "jumper") && !(d.has(a) || a === "jumper" && l.compact) && !(a === "total" && z.value === void 0 && !_.total))
104
+ if (d.add(a), G(a)) {
105
+ const n = p.at(-1);
106
+ (n == null ? void 0 : n.kind) === "controls" ? n.controls.push(a) : p.push({ kind: "controls", controls: [a] });
107
+ } else
108
+ p.push({ kind: a });
109
+ }
110
+ return t.filter((g) => g.groups.length);
111
+ }), te = u(() => {
112
+ const e = r.value, t = Number.isFinite(l.siblingCount) ? Math.max(0, Math.min(5, Math.floor(l.siblingCount))) : 1, d = /* @__PURE__ */ new Set([1, e]);
113
+ for (let a = Math.max(1, i.value - t); a <= Math.min(e, i.value + t); a++) d.add(a);
114
+ if (i.value <= t + 3)
115
+ for (let a = 1; a <= Math.min(e, 2 * t + 3); a++) d.add(a);
116
+ if (i.value >= e - t - 2)
117
+ for (let a = Math.max(1, e - (2 * t + 2)); a <= e; a++) d.add(a);
118
+ const p = [...d].sort((a, n) => a - n), g = [];
119
+ for (const [a, n] of p.entries()) {
120
+ const E = a ? n - p[a - 1] : 0;
121
+ E === 2 && g.push(n - 1), E > 2 && g.push(a === 1 ? "left-gap" : "right-gap"), g.push(n);
122
+ }
123
+ return g;
124
+ }), M = N(i.value), f = N(i.value), U = u(() => f.value !== null && Number.isInteger(f.value) && f.value > 0 && Math.min(r.value, f.value) !== i.value);
125
+ function X() {
126
+ M.value = i.value, f.value = i.value;
66
127
  }
67
- function D() {
68
- const l = Number(m.value);
69
- j.value && Number.isInteger(l) && y(l), x.value = a.value, m.value = a.value;
128
+ V(i, X), V(M, (e) => f.value = e);
129
+ function K(e) {
130
+ l.page === void 0 && (L.value = e), C("update:page", e), C("change", e);
70
131
  }
71
- return (l, e) => (v(), c("nav", Q(C($), {
72
- class: ["hys-ui-pf-pagination", { "hys-ui-pf-pagination-compact": d.compact }],
73
- "aria-label": "分页导航",
74
- "aria-busy": d.loading
132
+ function I(e) {
133
+ if (m.value || !Number.isFinite(e)) return;
134
+ const t = Math.min(r.value, y(e, 1));
135
+ t !== i.value && K(t);
136
+ }
137
+ function le(e) {
138
+ if (m.value) return;
139
+ const t = Number(e);
140
+ !Number.isSafeInteger(t) || t < 1 || t === S.value || (l.pageSize === void 0 && (J.value = t), C("update:pageSize", t), C("pageSizeChange", t));
141
+ }
142
+ V(r, (e, t) => {
143
+ e < t && T.value > e && K(e);
144
+ });
145
+ function ie() {
146
+ U.value && f.value !== null && I(f.value), X();
147
+ }
148
+ return (e, t) => Q.value.length && (!c.hideOnSinglePage || r.value > 1) ? (s(), o("nav", ue({ key: 0 }, oe(Z), {
149
+ class: ["hys-ui-pf-pagination", {
150
+ "hys-ui-pf-pagination-compact": c.compact,
151
+ "hys-ui-pf-pagination-responsive": c.responsive
152
+ }],
153
+ "data-size": c.size,
154
+ "aria-label": v.value.navigation,
155
+ "aria-busy": c.loading
75
156
  }), [
76
- d.showTotal ? (v(), c("span", le, g(L.value), 1)) : w("", !0),
77
- B("div", ie, [
78
- B("div", ne, [
79
- o(M, {
80
- variant: "secondary",
81
- size: "sm",
82
- type: "button",
83
- disabled: r.value || a.value === 1,
84
- "aria-label": n.value.first,
85
- title: n.value.first,
86
- onClick: e[0] || (e[0] = (t) => y(1))
87
- }, {
88
- default: S(() => [
89
- o(C(X), {
90
- size: 16,
91
- "aria-hidden": "true"
92
- })
93
- ]),
94
- _: 1
95
- }, 8, ["disabled", "aria-label", "title"]),
96
- o(M, {
97
- variant: "secondary",
98
- size: "sm",
99
- type: "button",
100
- disabled: r.value || a.value === 1,
101
- "aria-label": n.value.previous,
102
- title: n.value.previous,
103
- onClick: e[1] || (e[1] = (t) => y(a.value - 1))
104
- }, {
105
- default: S(() => [
106
- o(C(Y), {
107
- size: 16,
108
- "aria-hidden": "true"
109
- })
110
- ]),
111
- _: 1
112
- }, 8, ["disabled", "aria-label", "title"]),
113
- d.compact ? (v(), c("span", se, g(a.value) + " / " + g(p.value), 1)) : (v(!0), c(F, { key: 0 }, U(T.value, (t) => (v(), c(F, { key: t }, [
114
- typeof t == "number" ? (v(), q(M, {
115
- key: 0,
157
+ (s(!0), o(h, null, P(Q.value, (d) => (s(), o("div", {
158
+ key: d.side,
159
+ class: j(d.side === "trailing" ? "hys-ui-pf-pagination-actions" : "hys-ui-pf-pagination-leading")
160
+ }, [
161
+ (s(!0), o(h, null, P(d.groups, (p, g) => (s(), o(h, { key: g }, [
162
+ p.kind === "total" ? (s(), o("span", ye, [
163
+ w(e.$slots, "total", {
164
+ total: z.value,
165
+ start: x.value,
166
+ end: O.value,
167
+ pageCount: r.value
168
+ }, () => [
169
+ B(b(ee.value), 1)
170
+ ], !0)
171
+ ])) : p.kind === "controls" ? (s(), o("div", Se, [
172
+ (s(!0), o(h, null, P(p.controls, (a) => (s(), o(h, { key: a }, [
173
+ a === "pager" ? (s(), o(h, { key: 0 }, [
174
+ c.compact ? A("", !0) : (s(!0), o(h, { key: 0 }, P(te.value, (n) => (s(), o(h, { key: n }, [
175
+ typeof n == "number" ? (s(), $(H, {
176
+ key: 0,
177
+ variant: "secondary",
178
+ size: "sm",
179
+ class: j(["hys-ui-pf-pagination-page", { "hys-ui-is-current": n === i.value, "hys-ui-pf-pagination-custom-item": e.$slots.item }]),
180
+ disabled: m.value,
181
+ "aria-label": v.value.pageItem.replace("{page}", String(n)),
182
+ "aria-current": n === i.value ? "page" : void 0,
183
+ onClick: (E) => I(n)
184
+ }, {
185
+ default: F(() => [
186
+ w(e.$slots, "item", {
187
+ type: "page",
188
+ page: n,
189
+ active: n === i.value,
190
+ disabled: m.value
191
+ }, () => [
192
+ B(b(n), 1)
193
+ ], !0)
194
+ ]),
195
+ _: 2
196
+ }, 1032, ["class", "disabled", "aria-label", "aria-current", "onClick"])) : (s(), o("span", ze, "…"))
197
+ ], 64))), 128)),
198
+ W("span", {
199
+ class: j(c.compact ? "hys-ui-pf-pagination-indicator" : "hys-ui-pf-pagination-mobile-indicator"),
200
+ "aria-live": "polite"
201
+ }, b(i.value) + " / " + b(r.value), 3)
202
+ ], 64)) : (s(), $(H, {
203
+ key: 1,
204
+ variant: "secondary",
205
+ size: "sm",
206
+ class: j({ "hys-ui-pf-pagination-custom-item": e.$slots.item }),
207
+ disabled: q(a),
208
+ "aria-label": k.value[a].label,
209
+ title: k.value[a].label,
210
+ onClick: (n) => I(k.value[a].page)
211
+ }, {
212
+ default: F(() => [
213
+ w(e.$slots, "item", {
214
+ type: a,
215
+ page: Math.max(1, Math.min(r.value, k.value[a].page)),
216
+ active: !1,
217
+ disabled: q(a)
218
+ }, () => [
219
+ (s(), $(re(k.value[a].icon), {
220
+ size: 16,
221
+ "aria-hidden": "true"
222
+ }))
223
+ ], !0)
224
+ ]),
225
+ _: 2
226
+ }, 1032, ["class", "disabled", "aria-label", "title", "onClick"]))
227
+ ], 64))), 128))
228
+ ])) : p.kind === "sizes" ? (s(), o("label", ke, [
229
+ B(b(v.value.perPage) + " ", 1),
230
+ R(he, {
231
+ size: c.size === "lg" ? "md" : "sm",
232
+ "model-value": String(S.value),
233
+ options: ae.value,
234
+ disabled: m.value,
235
+ "aria-label": v.value.perPage,
236
+ "onUpdate:modelValue": le
237
+ }, null, 8, ["size", "model-value", "options", "disabled", "aria-label"])
238
+ ])) : p.kind === "jumper" ? (s(), o("form", {
239
+ key: 3,
240
+ class: "hys-ui-pf-pagination-jump",
241
+ onSubmit: pe(ie, ["prevent", "stop"])
242
+ }, [
243
+ W("span", null, b(v.value.jump), 1),
244
+ R(me, {
245
+ modelValue: M.value,
246
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => M.value = a),
247
+ size: "sm",
248
+ class: "hys-ui-pf-pagination-jump-input",
249
+ min: 1,
250
+ max: r.value,
251
+ "show-controls": !1,
252
+ "select-on-focus": "",
253
+ disabled: m.value,
254
+ "aria-label": v.value.jump,
255
+ onInput: t[1] || (t[1] = (a) => f.value = a)
256
+ }, null, 8, ["modelValue", "max", "disabled", "aria-label"]),
257
+ R(H, {
116
258
  variant: "secondary",
117
259
  size: "sm",
118
- class: G(["hys-ui-pf-pagination-page", { "hys-ui-is-current": t === a.value }]),
119
- type: "button",
120
- disabled: r.value,
121
- "aria-label": "第 " + t + " 页",
122
- "aria-current": t === a.value ? "page" : void 0,
123
- onClick: (f) => y(t)
260
+ type: "submit",
261
+ disabled: m.value || !U.value
124
262
  }, {
125
- default: S(() => [
126
- V(g(t), 1)
263
+ default: F(() => [
264
+ w(e.$slots, "jump-button", {}, () => [
265
+ B(b(v.value.confirm), 1)
266
+ ], !0)
127
267
  ]),
128
- _: 2
129
- }, 1032, ["disabled", "aria-label", "aria-current", "class", "onClick"])) : (v(), c("span", ue, "…"))
130
- ], 64))), 128)),
131
- d.compact ? w("", !0) : (v(), c("span", oe, g(a.value) + " / " + g(p.value), 1)),
132
- o(M, {
133
- variant: "secondary",
134
- size: "sm",
135
- type: "button",
136
- disabled: r.value || a.value === p.value,
137
- "aria-label": n.value.next,
138
- title: n.value.next,
139
- onClick: e[2] || (e[2] = (t) => y(a.value + 1))
140
- }, {
141
- default: S(() => [
142
- o(C(Z), {
143
- size: 16,
144
- "aria-hidden": "true"
145
- })
146
- ]),
147
- _: 1
148
- }, 8, ["disabled", "aria-label", "title"]),
149
- o(M, {
150
- variant: "secondary",
151
- size: "sm",
152
- type: "button",
153
- disabled: r.value || a.value === p.value,
154
- "aria-label": n.value.last,
155
- title: n.value.last,
156
- onClick: e[3] || (e[3] = (t) => y(p.value))
157
- }, {
158
- default: S(() => [
159
- o(C(_), {
160
- size: 16,
161
- "aria-hidden": "true"
162
- })
163
- ]),
164
- _: 1
165
- }, 8, ["disabled", "aria-label", "title"])
166
- ]),
167
- d.showSizeChanger ? (v(), c("label", re, [
168
- V(g(n.value.perPage) + " ", 1),
169
- o(ee, {
170
- size: "sm",
171
- "model-value": String(h.value),
172
- options: R.value.map((t) => ({ label: String(t), value: String(t) })),
173
- disabled: r.value,
174
- "aria-label": n.value.perPage,
175
- "onUpdate:modelValue": A
176
- }, null, 8, ["model-value", "options", "disabled", "aria-label"])
177
- ])) : w("", !0),
178
- d.showQuickJumper && !d.compact ? (v(), c("form", {
179
- key: 1,
180
- class: "hys-ui-pf-pagination-jump",
181
- onSubmit: K(D, ["prevent"])
182
- }, [
183
- B("span", null, g(n.value.jump), 1),
184
- o(ae, {
185
- size: "sm",
186
- modelValue: x.value,
187
- "onUpdate:modelValue": e[4] || (e[4] = (t) => x.value = t),
188
- onInput: e[5] || (e[5] = (t) => m.value = t),
189
- class: "hys-ui-pf-pagination-jump-input",
190
- min: 1,
191
- max: p.value,
192
- "show-controls": !1,
193
- "select-on-focus": "",
194
- disabled: r.value,
195
- "aria-label": n.value.jump
196
- }, null, 8, ["modelValue", "max", "disabled", "aria-label"]),
197
- o(M, {
198
- variant: "secondary",
199
- size: "sm",
200
- type: "submit",
201
- disabled: r.value || !j.value
202
- }, {
203
- default: S(() => [...e[6] || (e[6] = [
204
- V("确定", -1)
205
- ])]),
206
- _: 1
207
- }, 8, ["disabled"])
208
- ], 32)) : w("", !0)
209
- ])
210
- ], 16, te));
268
+ _: 3
269
+ }, 8, ["disabled"])
270
+ ], 32)) : A("", !0)
271
+ ], 64))), 128))
272
+ ], 2))), 128))
273
+ ], 16, be)) : A("", !0);
211
274
  }
212
275
  });
213
276
  export {
214
- ge as default
277
+ Be as default
215
278
  };
@@ -1,84 +1,7 @@
1
- import { defineComponent as L, ref as v, watch as V, onBeforeUnmount as N, onDeactivated as w, openBlock as f, createElementBlock as g, mergeProps as z, unref as n, createBlock as k, createElementVNode as H, withKeys as S, createVNode as A, createCommentVNode as D } from "vue";
2
- import { useHysControlState as E } from "../../composables/formContext.js";
3
- import { LoaderCircle as F, Search as K, X as R } from "lucide-vue-next";
4
- import { useHysRootAttrs as T } from "../../config.js";
5
- const I = ["value", "placeholder", "disabled", "readonly", "aria-label"], $ = /* @__PURE__ */ L({
6
- __name: "HysSearch",
7
- props: {
8
- modelValue: {},
9
- placeholder: { default: "搜索…" },
10
- delay: { default: 300 },
11
- disabled: { type: Boolean },
12
- readonly: { type: Boolean },
13
- clearable: { type: Boolean, default: !0 },
14
- loading: { type: Boolean },
15
- ariaLabel: {}
16
- },
17
- emits: ["update:modelValue", "search", "clear", "focus", "blur"],
18
- setup(a, { expose: B, emit: C }) {
19
- const r = a, { disabled: u, label: h } = E(r), i = C, x = T(), d = v(), s = v(!1);
20
- let y, m;
21
- function t() {
22
- clearTimeout(y), y = void 0, m = void 0;
23
- }
24
- function b(e) {
25
- t(), u.value || i("search", e);
26
- }
27
- function c(e) {
28
- u.value || r.readonly || s.value || (t(), m = e, i("update:modelValue", e), y = setTimeout(() => b(e), Number.isFinite(r.delay) ? Math.max(0, r.delay) : 300));
29
- }
30
- return V(() => [u.value, r.readonly], t, { flush: "sync" }), V(() => r.modelValue, (e) => {
31
- m !== void 0 && e !== m && t();
32
- }), N(t), w(t), B({ focus: () => {
33
- var e;
34
- return (e = d.value) == null ? void 0 : e.focus();
35
- }, blur: () => {
36
- var e;
37
- return (e = d.value) == null ? void 0 : e.blur();
38
- } }), (e, l) => (f(), g("div", z(n(x), { class: "hys-ui-ex-search" }), [
39
- a.loading ? (f(), k(n(F), {
40
- key: 0,
41
- class: "hys-ui-icon-spin",
42
- size: 16
43
- })) : (f(), k(n(K), {
44
- key: 1,
45
- size: 16,
46
- "aria-hidden": "true"
47
- })),
48
- H("input", {
49
- ref_key: "input",
50
- ref: d,
51
- type: "search",
52
- value: a.modelValue,
53
- placeholder: a.placeholder,
54
- disabled: n(u),
55
- readonly: a.readonly,
56
- "aria-label": a.ariaLabel || n(h) || "搜索",
57
- onInput: l[0] || (l[0] = (o) => c(o.target.value)),
58
- onCompositionstart: l[1] || (l[1] = (o) => {
59
- s.value = !0, t();
60
- }),
61
- onCompositionend: l[2] || (l[2] = (o) => {
62
- s.value = !1, c(o.target.value);
63
- }),
64
- onKeydown: l[3] || (l[3] = S((o) => !o.isComposing && o.keyCode !== 229 && !s.value && b(a.modelValue), ["enter"])),
65
- onFocus: l[4] || (l[4] = (o) => i("focus", o)),
66
- onBlur: l[5] || (l[5] = (o) => i("blur", o))
67
- }, null, 40, I),
68
- a.clearable && a.modelValue && !n(u) && !a.readonly ? (f(), g("button", {
69
- key: 2,
70
- type: "button",
71
- "aria-label": "清空搜索",
72
- onClick: l[6] || (l[6] = (o) => {
73
- var p;
74
- c(""), i("clear"), (p = d.value) == null || p.focus();
75
- })
76
- }, [
77
- A(n(R), { size: 14 })
78
- ])) : D("", !0)
79
- ], 16));
80
- }
81
- });
1
+ import o from "./HysSearch2.vue.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-b415aa18"]]);
82
5
  export {
83
- $ as default
6
+ p as default
84
7
  };