@itguy614/clean-ui 1.3.0 → 1.3.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 (30) hide show
  1. package/dist/clean-ui.css +1 -1
  2. package/dist/components/CuiCombobox.vue.d.ts.map +1 -1
  3. package/dist/components/CuiCombobox.vue.js +2 -2
  4. package/dist/components/CuiCombobox.vue2.js +96 -97
  5. package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
  6. package/dist/components/CuiDataGridTable.vue.js +212 -190
  7. package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
  8. package/dist/components/CuiDataGridViewManager.vue.js +5 -4
  9. package/dist/components/CuiDivider.vue.d.ts +1 -3
  10. package/dist/components/CuiDivider.vue.d.ts.map +1 -1
  11. package/dist/components/CuiDivider.vue.js +44 -60
  12. package/dist/components/CuiPagination.vue.d.ts.map +1 -1
  13. package/dist/components/CuiPagination.vue.js +2 -2
  14. package/dist/components/CuiPagination.vue2.js +28 -25
  15. package/dist/components/CuiPopover.vue.d.ts.map +1 -1
  16. package/dist/components/CuiPopover.vue.js +77 -74
  17. package/dist/components/CuiSlider.vue.d.ts.map +1 -1
  18. package/dist/components/CuiSlider.vue.js +5 -167
  19. package/dist/components/CuiSlider.vue2.js +171 -2
  20. package/dist/components/CuiTabs.vue.d.ts.map +1 -1
  21. package/dist/components/CuiTabs.vue.js +2 -2
  22. package/dist/components/CuiTabs.vue2.js +80 -76
  23. package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
  24. package/dist/components/CuiTagInput.vue.js +1 -1
  25. package/dist/components/CuiTagInput.vue2.js +98 -99
  26. package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
  27. package/dist/components/CuiTooltip.vue.js +2 -2
  28. package/dist/components/CuiTooltip.vue2.js +2 -1
  29. package/dist/version.js +1 -1
  30. package/package.json +1 -1
@@ -1,169 +1,7 @@
1
- import { defineComponent as F, computed as s, ref as R, useTemplateRef as $, withDirectives as B, openBlock as r, createElementBlock as d, normalizeStyle as i, toDisplayString as c, createCommentVNode as m, createElementVNode as u, renderSlot as C, createBlock as E, vShow as D } from "vue";
2
- import { clampSize as H } from "../utils/sizing.js";
3
- import q from "./CuiIcon.vue.js";
4
- const T = {
5
- key: 0,
6
- style: { display: "flex", "justify-content": "space-between", "align-items": "baseline", "margin-bottom": "calc(0.375rem * var(--cui-density-scale, 1))" }
7
- }, j = ["id", "name", "autocomplete", "aria-describedby", "aria-required", "aria-labelledby", "value", "min", "max", "step", "disabled"], N = {
8
- key: 1,
9
- style: { display: "flex", "justify-content": "space-between", "margin-top": "calc(0.25rem * var(--cui-density-scale, 1))" }
10
- }, W = /* @__PURE__ */ F({
11
- __name: "CuiSlider",
12
- props: {
13
- modelValue: { default: 0 },
14
- min: { default: 0 },
15
- max: { default: 100 },
16
- step: { default: 1 },
17
- label: {},
18
- showValue: { type: Boolean, default: !1 },
19
- formatValue: {},
20
- showRange: { type: Boolean, default: !1 },
21
- thumbIcon: {},
22
- name: {},
23
- autocomplete: {},
24
- id: {},
25
- ariaDescribedby: {},
26
- ariaLabelledby: {},
27
- ariaRequired: { type: Boolean },
28
- hidden: { type: Boolean, default: !1 },
29
- color: { default: "primary" },
30
- size: { default: "md" },
31
- disabled: { type: Boolean, default: !1 }
32
- },
33
- emits: ["update:modelValue"],
34
- setup(e, { expose: y, emit: h }) {
35
- const t = e, g = h, v = s(
36
- () => (t.modelValue - t.min) / (t.max - t.min) * 100
37
- ), x = s(
38
- () => t.formatValue ? t.formatValue(t.modelValue) : String(t.modelValue)
39
- ), o = R(!1);
40
- function S(n) {
41
- const a = parseFloat(n.target.value);
42
- g("update:modelValue", a);
43
- }
44
- const V = ["sm", "md", "lg"], z = {
45
- sm: { trackHeight: "4px", thumbSize: "16px", thumbIcon: "0.5rem", labelFont: "0.8125rem", valueFont: "0.75rem" },
46
- md: { trackHeight: "6px", thumbSize: "20px", thumbIcon: "0.625rem", labelFont: "0.875rem", valueFont: "0.8125rem" },
47
- lg: { trackHeight: "8px", thumbSize: "26px", thumbIcon: "0.75rem", labelFont: "1rem", valueFont: "0.875rem" }
48
- }, l = s(() => z[H(t.size, V)]), w = s(() => t.disabled ? "var(--cui-text-tertiary)" : `var(--cui-${t.color})`), k = s(() => t.disabled ? "var(--cui-text-tertiary)" : `var(--cui-${t.color})`), b = $("inputEl");
49
- function p(n) {
50
- var a;
51
- (a = b.value) == null || a.focus(n);
52
- }
53
- function I() {
54
- var n;
55
- (n = b.value) == null || n.blur();
56
- }
57
- return y({ el: b, focus: p, blur: I }), (n, a) => B((r(), d("div", {
58
- class: "cui-slider",
59
- style: i({ opacity: e.disabled ? 0.5 : 1 })
60
- }, [
61
- e.label || e.showValue ? (r(), d("div", T, [
62
- e.label ? (r(), d("label", {
63
- key: 0,
64
- style: i({ fontSize: l.value.labelFont, fontWeight: "500", color: "var(--cui-text-secondary)" })
65
- }, c(e.label), 5)) : m("", !0),
66
- e.showValue ? (r(), d("span", {
67
- key: 1,
68
- style: i({ fontSize: l.value.valueFont, fontWeight: "600", color: "var(--cui-text-body)", fontVariantNumeric: "tabular-nums" })
69
- }, c(x.value), 5)) : m("", !0)
70
- ])) : m("", !0),
71
- u("div", {
72
- style: i({ position: "relative", height: l.value.thumbSize, display: "flex", alignItems: "center" })
73
- }, [
74
- u("div", {
75
- style: i({
76
- position: "absolute",
77
- left: "0",
78
- right: "0",
79
- height: l.value.trackHeight,
80
- borderRadius: "9999px",
81
- background: "var(--cui-border)"
82
- })
83
- }, null, 4),
84
- u("div", {
85
- style: i({
86
- position: "absolute",
87
- left: "0",
88
- height: l.value.trackHeight,
89
- width: `${v.value}%`,
90
- borderRadius: "9999px",
91
- background: k.value,
92
- transition: o.value ? "none" : "width 0.1s ease"
93
- })
94
- }, null, 4),
95
- u("div", {
96
- style: i({
97
- position: "absolute",
98
- left: `${v.value}%`,
99
- transform: "translateX(-50%)",
100
- width: l.value.thumbSize,
101
- height: l.value.thumbSize,
102
- borderRadius: "50%",
103
- background: w.value,
104
- border: "2px solid var(--cui-surface-base, white)",
105
- boxShadow: o.value ? "0 2px 8px rgba(0,0,0,0.25)" : "0 1px 3px rgba(0,0,0,0.15)",
106
- display: "flex",
107
- alignItems: "center",
108
- justifyContent: "center",
109
- color: "var(--cui-surface-base, white)",
110
- transition: o.value ? "none" : "left 0.1s ease, box-shadow 0.15s ease, transform 0.15s ease",
111
- pointerEvents: "none",
112
- zIndex: 2
113
- })
114
- }, [
115
- C(n.$slots, "thumb", {}, () => [
116
- e.thumbIcon ? (r(), E(q, {
117
- key: 0,
118
- name: e.thumbIcon,
119
- size: l.value.thumbIcon
120
- }, null, 8, ["name", "size"])) : m("", !0)
121
- ])
122
- ], 4),
123
- u("input", {
124
- ref: "inputEl",
125
- id: e.id,
126
- name: e.name,
127
- autocomplete: e.autocomplete,
128
- "aria-describedby": e.ariaDescribedby,
129
- "aria-required": e.ariaRequired || void 0,
130
- "aria-labelledby": e.ariaLabelledby,
131
- type: "range",
132
- value: e.modelValue,
133
- min: e.min,
134
- max: e.max,
135
- step: e.step,
136
- disabled: e.disabled,
137
- style: i({
138
- position: "absolute",
139
- left: "0",
140
- width: "100%",
141
- height: "100%",
142
- margin: "0",
143
- opacity: "0",
144
- cursor: e.disabled ? "default" : "pointer",
145
- zIndex: 3
146
- }),
147
- onInput: S,
148
- onMousedown: a[0] || (a[0] = (f) => o.value = !0),
149
- onMouseup: a[1] || (a[1] = (f) => o.value = !1),
150
- onTouchstart: a[2] || (a[2] = (f) => o.value = !0),
151
- onTouchend: a[3] || (a[3] = (f) => o.value = !1)
152
- }, null, 44, j)
153
- ], 4),
154
- e.showRange ? (r(), d("div", N, [
155
- u("span", {
156
- style: i({ fontSize: l.value.valueFont, color: "var(--cui-text-tertiary)" })
157
- }, c(e.formatValue ? e.formatValue(e.min) : e.min), 5),
158
- u("span", {
159
- style: i({ fontSize: l.value.valueFont, color: "var(--cui-text-tertiary)" })
160
- }, c(e.formatValue ? e.formatValue(e.max) : e.max), 5)
161
- ])) : m("", !0)
162
- ], 4)), [
163
- [D, !e.hidden]
164
- ]);
165
- }
166
- });
1
+ import o from "./CuiSlider.vue2.js";
2
+ /* empty css */
3
+ import r from "../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c846e888"]]);
167
5
  export {
168
- W as default
6
+ m as default
169
7
  };
@@ -1,4 +1,173 @@
1
- import f from "./CuiSlider.vue.js";
1
+ import { defineComponent as R, computed as r, ref as B, useId as C, useTemplateRef as E, withDirectives as D, openBlock as s, createElementBlock as d, normalizeStyle as i, toDisplayString as c, createCommentVNode as m, createElementVNode as n, renderSlot as H, createBlock as q, vShow as T } from "vue";
2
+ import { clampSize as j } from "../utils/sizing.js";
3
+ import N from "./CuiIcon.vue.js";
4
+ const L = {
5
+ key: 0,
6
+ style: { display: "flex", "justify-content": "space-between", "align-items": "baseline", "margin-bottom": "calc(0.375rem * var(--cui-density-scale, 1))" }
7
+ }, M = ["for"], P = ["id", "name", "autocomplete", "aria-describedby", "aria-required", "aria-labelledby", "aria-valuetext", "value", "min", "max", "step", "disabled"], W = {
8
+ key: 1,
9
+ style: { display: "flex", "justify-content": "space-between", "margin-top": "calc(0.25rem * var(--cui-density-scale, 1))" }
10
+ }, Z = /* @__PURE__ */ R({
11
+ __name: "CuiSlider",
12
+ props: {
13
+ modelValue: { default: 0 },
14
+ min: { default: 0 },
15
+ max: { default: 100 },
16
+ step: { default: 1 },
17
+ label: {},
18
+ showValue: { type: Boolean, default: !1 },
19
+ formatValue: {},
20
+ showRange: { type: Boolean, default: !1 },
21
+ thumbIcon: {},
22
+ name: {},
23
+ autocomplete: {},
24
+ id: {},
25
+ ariaDescribedby: {},
26
+ ariaLabelledby: {},
27
+ ariaRequired: { type: Boolean },
28
+ hidden: { type: Boolean, default: !1 },
29
+ color: { default: "primary" },
30
+ size: { default: "md" },
31
+ disabled: { type: Boolean, default: !1 }
32
+ },
33
+ emits: ["update:modelValue"],
34
+ setup(e, { expose: g, emit: x }) {
35
+ const t = e, V = x, v = r(
36
+ () => (t.modelValue - t.min) / (t.max - t.min) * 100
37
+ ), y = r(
38
+ () => t.formatValue ? t.formatValue(t.modelValue) : String(t.modelValue)
39
+ ), o = B(!1), S = `cui-slider-${C()}`, h = r(() => t.id || S);
40
+ function z(u) {
41
+ const a = parseFloat(u.target.value);
42
+ V("update:modelValue", a);
43
+ }
44
+ const w = ["sm", "md", "lg"], I = {
45
+ sm: { trackHeight: "4px", thumbSize: "16px", thumbIcon: "0.5rem", labelFont: "0.8125rem", valueFont: "0.75rem" },
46
+ md: { trackHeight: "6px", thumbSize: "20px", thumbIcon: "0.625rem", labelFont: "0.875rem", valueFont: "0.8125rem" },
47
+ lg: { trackHeight: "8px", thumbSize: "26px", thumbIcon: "0.75rem", labelFont: "1rem", valueFont: "0.875rem" }
48
+ }, l = r(() => I[j(t.size, w)]), k = r(() => t.disabled ? "var(--cui-text-tertiary)" : `var(--cui-${t.color})`), p = r(() => t.disabled ? "var(--cui-text-tertiary)" : `var(--cui-${t.color})`), b = E("inputEl");
49
+ function F(u) {
50
+ var a;
51
+ (a = b.value) == null || a.focus(u);
52
+ }
53
+ function $() {
54
+ var u;
55
+ (u = b.value) == null || u.blur();
56
+ }
57
+ return g({ el: b, focus: F, blur: $ }), (u, a) => D((s(), d("div", {
58
+ class: "cui-slider",
59
+ style: i({ opacity: e.disabled ? 0.5 : 1, "--_slider-focus-ring": `var(--cui-${e.color}-focus-ring)` })
60
+ }, [
61
+ e.label || e.showValue ? (s(), d("div", L, [
62
+ e.label ? (s(), d("label", {
63
+ key: 0,
64
+ for: h.value,
65
+ style: i({ fontSize: l.value.labelFont, fontWeight: "500", color: "var(--cui-text-secondary)" })
66
+ }, c(e.label), 13, M)) : m("", !0),
67
+ e.showValue ? (s(), d("span", {
68
+ key: 1,
69
+ style: i({ fontSize: l.value.valueFont, fontWeight: "600", color: "var(--cui-text-body)", fontVariantNumeric: "tabular-nums" })
70
+ }, c(y.value), 5)) : m("", !0)
71
+ ])) : m("", !0),
72
+ n("div", {
73
+ style: i({ position: "relative", height: l.value.thumbSize, display: "flex", alignItems: "center" })
74
+ }, [
75
+ n("div", {
76
+ style: i({
77
+ position: "absolute",
78
+ left: "0",
79
+ right: "0",
80
+ height: l.value.trackHeight,
81
+ borderRadius: "9999px",
82
+ background: "var(--cui-border)"
83
+ })
84
+ }, null, 4),
85
+ n("div", {
86
+ style: i({
87
+ position: "absolute",
88
+ left: "0",
89
+ height: l.value.trackHeight,
90
+ width: `${v.value}%`,
91
+ borderRadius: "9999px",
92
+ background: p.value,
93
+ transition: o.value ? "none" : "width 0.1s ease"
94
+ })
95
+ }, null, 4),
96
+ n("input", {
97
+ ref: "inputEl",
98
+ id: h.value,
99
+ name: e.name,
100
+ autocomplete: e.autocomplete,
101
+ "aria-describedby": e.ariaDescribedby,
102
+ "aria-required": e.ariaRequired || void 0,
103
+ "aria-labelledby": e.ariaLabelledby,
104
+ "aria-valuetext": e.formatValue ? y.value : void 0,
105
+ class: "cui-slider__input",
106
+ type: "range",
107
+ value: e.modelValue,
108
+ min: e.min,
109
+ max: e.max,
110
+ step: e.step,
111
+ disabled: e.disabled,
112
+ style: i({
113
+ position: "absolute",
114
+ left: "0",
115
+ width: "100%",
116
+ height: "100%",
117
+ margin: "0",
118
+ opacity: "0",
119
+ cursor: e.disabled ? "default" : "pointer",
120
+ zIndex: 3
121
+ }),
122
+ onInput: z,
123
+ onMousedown: a[0] || (a[0] = (f) => o.value = !0),
124
+ onMouseup: a[1] || (a[1] = (f) => o.value = !1),
125
+ onTouchstart: a[2] || (a[2] = (f) => o.value = !0),
126
+ onTouchend: a[3] || (a[3] = (f) => o.value = !1)
127
+ }, null, 44, P),
128
+ n("div", {
129
+ class: "cui-slider__thumb",
130
+ style: i({
131
+ position: "absolute",
132
+ left: `${v.value}%`,
133
+ transform: "translateX(-50%)",
134
+ width: l.value.thumbSize,
135
+ height: l.value.thumbSize,
136
+ borderRadius: "50%",
137
+ background: k.value,
138
+ border: "2px solid var(--cui-surface-base, white)",
139
+ boxShadow: o.value ? "0 2px 8px rgba(0,0,0,0.25)" : "0 1px 3px rgba(0,0,0,0.15)",
140
+ display: "flex",
141
+ alignItems: "center",
142
+ justifyContent: "center",
143
+ color: "var(--cui-surface-base, white)",
144
+ transition: o.value ? "none" : "left 0.1s ease, box-shadow 0.15s ease, transform 0.15s ease",
145
+ pointerEvents: "none",
146
+ zIndex: 2
147
+ })
148
+ }, [
149
+ H(u.$slots, "thumb", {}, () => [
150
+ e.thumbIcon ? (s(), q(N, {
151
+ key: 0,
152
+ name: e.thumbIcon,
153
+ size: l.value.thumbIcon
154
+ }, null, 8, ["name", "size"])) : m("", !0)
155
+ ], !0)
156
+ ], 4)
157
+ ], 4),
158
+ e.showRange ? (s(), d("div", W, [
159
+ n("span", {
160
+ style: i({ fontSize: l.value.valueFont, color: "var(--cui-text-tertiary)" })
161
+ }, c(e.formatValue ? e.formatValue(e.min) : e.min), 5),
162
+ n("span", {
163
+ style: i({ fontSize: l.value.valueFont, color: "var(--cui-text-tertiary)" })
164
+ }, c(e.formatValue ? e.formatValue(e.max) : e.max), 5)
165
+ ])) : m("", !0)
166
+ ], 4)), [
167
+ [T, !e.hidden]
168
+ ]);
169
+ }
170
+ });
2
171
  export {
3
- f as default
172
+ Z as default
4
173
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"AA4fA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGrE,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,cAAc;IACjE,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,C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AAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAgC/C,QAAA,MAAM,eAAe;;;;;;;;;aAlaT,UAAU;iBAEN,cAAc;gBAIf,aAAa;eAFd,OAAO;6EAsanB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CuiTabs.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1bdb751f"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3da0079d"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as H, ref as b, watch as _, provide as K, toRef as m, onMounted as M, nextTick as S, onBeforeUnmount as N, computed as L, withDirectives as O, openBlock as v, createElementBlock as h, normalizeClass as T, createElementVNode as k, Fragment as $, renderList as U, normalizeStyle as W, createBlock as q, resolveDynamicComponent as F, createTextVNode as j, toDisplayString as G, withModifiers as J, unref as P, createVNode as Q, createCommentVNode as X, renderSlot as Y, vShow as Z } from "vue";
2
- import ee from "./CuiIcon.vue.js";
3
- import { TabsContextKey as te } from "./tabs-context.js";
4
- import { useMessages as ae } from "../composables/useMessages.js";
5
- const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-overflow"], ne = ["data-cui-tab-value", "aria-selected", "aria-disabled", "tabindex", "onClick"], ie = { class: "cui-tabs__tab-content" }, re = ["aria-label", "onClick"], ue = { class: "cui-tabs__panels" }, fe = /* @__PURE__ */ H({
1
+ import { defineComponent as M, ref as b, watch as _, provide as N, toRef as m, onMounted as L, nextTick as z, onBeforeUnmount as O, computed as U, withDirectives as W, openBlock as v, createElementBlock as h, normalizeClass as T, createElementVNode as k, Fragment as A, renderList as q, normalizeStyle as F, createBlock as j, resolveDynamicComponent as G, createTextVNode as J, toDisplayString as P, withModifiers as Q, unref as X, createVNode as Y, createCommentVNode as Z, renderSlot as ee, vShow as te } from "vue";
2
+ import ae from "./CuiIcon.vue.js";
3
+ import { TabsContextKey as oe } from "./tabs-context.js";
4
+ import { useMessages as le } from "../composables/useMessages.js";
5
+ const ne = { class: "cui-tabs__bar-outer" }, ie = ["aria-orientation", "data-overflow"], re = ["data-cui-tab-value", "aria-selected", "aria-disabled", "tabindex", "onClick"], se = { class: "cui-tabs__tab-content" }, ue = ["aria-label", "onClick"], ce = { class: "cui-tabs__panels" }, me = /* @__PURE__ */ M({
6
6
  __name: "CuiTabs",
7
7
  props: {
8
8
  modelValue: {},
@@ -14,29 +14,29 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
14
14
  color: { default: "primary" }
15
15
  },
16
16
  emits: ["update:modelValue", "close"],
17
- setup(r, { emit: A }) {
18
- const n = r, x = A, o = b(n.modelValue ?? ""), p = b(""), l = b([]), f = b(null);
17
+ setup(i, { emit: D }) {
18
+ const n = i, g = D, o = b(n.modelValue ?? ""), p = b(""), l = b([]), f = b(null);
19
19
  _(
20
20
  () => n.modelValue,
21
21
  (e) => {
22
22
  e !== void 0 && e !== o.value && (p.value = o.value, o.value = e);
23
23
  }
24
24
  );
25
- function D(e) {
25
+ function B(e) {
26
26
  const a = l.value.findIndex((t) => t.value === e.value);
27
- a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value, x("update:modelValue", e.value));
27
+ a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value, g("update:modelValue", e.value));
28
28
  }
29
- function B(e) {
29
+ function E(e) {
30
30
  l.value = l.value.filter((a) => a.value !== e);
31
31
  }
32
- function w(e) {
32
+ function x(e) {
33
33
  const a = l.value.find((t) => t.value === e);
34
- a != null && a.disabled || (p.value = o.value, o.value = e, x("update:modelValue", e));
34
+ a != null && a.disabled || (p.value = o.value, o.value = e, g("update:modelValue", e));
35
35
  }
36
- function V(e) {
37
- x("close", e);
36
+ function C(e) {
37
+ g("close", e);
38
38
  }
39
- K(te, {
39
+ N(oe, {
40
40
  activeTab: o,
41
41
  variant: m(n, "variant"),
42
42
  orientation: m(n, "orientation"),
@@ -44,73 +44,77 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
44
44
  keepAlive: m(n, "keepAlive"),
45
45
  transition: m(n, "transition"),
46
46
  previousTab: p,
47
- register: D,
48
- unregister: B,
49
- activate: w,
50
- close: V
47
+ register: B,
48
+ unregister: E,
49
+ activate: x,
50
+ close: C
51
51
  });
52
- function E(e) {
53
- const a = l.value.filter((d) => !d.disabled), t = a.findIndex((d) => d.value === o.value);
52
+ function R(e) {
53
+ const a = l.value.filter((u) => !u.disabled), t = a.findIndex((u) => u.value === o.value);
54
54
  if (t < 0) return;
55
- const u = n.orientation === "horizontal", y = u ? "ArrowRight" : "ArrowDown", I = u ? "ArrowLeft" : "ArrowUp";
56
- let i = -1;
57
- e.key === y ? (e.preventDefault(), i = t < a.length - 1 ? t + 1 : 0) : e.key === I ? (e.preventDefault(), i = t > 0 ? t - 1 : a.length - 1) : e.key === "Home" ? (e.preventDefault(), i = 0) : e.key === "End" && (e.preventDefault(), i = a.length - 1), i >= 0 && (w(a[i].value), S(() => {
58
- var d;
59
- (d = C(a[i].value)) == null || d.focus();
60
- }));
55
+ const s = n.orientation === "horizontal", y = s ? "ArrowRight" : "ArrowDown", V = s ? "ArrowLeft" : "ArrowUp";
56
+ let r = -1;
57
+ if (e.key === y ? (e.preventDefault(), r = t < a.length - 1 ? t + 1 : 0) : e.key === V ? (e.preventDefault(), r = t > 0 ? t - 1 : a.length - 1) : e.key === "Home" ? (e.preventDefault(), r = 0) : e.key === "End" && (e.preventDefault(), r = a.length - 1), r >= 0) {
58
+ const u = a[r].value, K = u !== o.value;
59
+ x(u), z(() => {
60
+ var $;
61
+ ($ = S(u)) == null || $.focus({ preventScroll: !0 }), K || I();
62
+ });
63
+ }
61
64
  }
62
- function C(e) {
63
- var a;
64
- return ((a = f.value) == null ? void 0 : a.querySelector(`[data-cui-tab-value="${e}"]`)) ?? null;
65
+ function S(e) {
66
+ var t;
67
+ const a = e.replace(/["\\]/g, "\\$&");
68
+ return ((t = f.value) == null ? void 0 : t.querySelector(`[data-cui-tab-value="${a}"]`)) ?? null;
65
69
  }
66
- const g = b("none");
67
- function s() {
70
+ const w = b("none");
71
+ function c() {
68
72
  const e = f.value;
69
73
  if (!e) return;
70
- const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight, u = a ? e.scrollWidth : e.scrollHeight, y = Math.abs(a ? e.scrollLeft : e.scrollTop);
71
- if (u - t <= 1) {
72
- g.value = "none";
74
+ const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight, s = a ? e.scrollWidth : e.scrollHeight, y = Math.abs(a ? e.scrollLeft : e.scrollTop);
75
+ if (s - t <= 1) {
76
+ w.value = "none";
73
77
  return;
74
78
  }
75
- const I = y <= 1, i = y >= u - t - 1;
76
- g.value = I ? "end" : i ? "start" : "both";
79
+ const V = y <= 1, r = y >= s - t - 1;
80
+ w.value = V ? "end" : r ? "start" : "both";
77
81
  }
78
- function z() {
82
+ function I() {
79
83
  var e, a;
80
- (a = (e = C(o.value)) == null ? void 0 : e.scrollIntoView) == null || a.call(e, { inline: "nearest", block: "nearest" });
84
+ (a = (e = S(o.value)) == null ? void 0 : e.scrollIntoView) == null || a.call(e, { inline: "nearest", block: "nearest" });
81
85
  }
82
- let c;
83
- M(() => {
84
- S(() => {
85
- z(), s();
86
- }), typeof ResizeObserver < "u" && f.value && (c = new ResizeObserver(s), c.observe(f.value));
87
- }), N(() => {
88
- c == null || c.disconnect(), c = void 0;
86
+ let d;
87
+ L(() => {
88
+ z(() => {
89
+ I(), c();
90
+ }), typeof ResizeObserver < "u" && f.value && (d = new ResizeObserver(c), d.observe(f.value));
91
+ }), O(() => {
92
+ d == null || d.disconnect(), d = void 0;
89
93
  }), _(o, () => {
90
- z(), s();
91
- }, { flush: "post" }), _(() => l.value.length, s, { flush: "post" }), _(() => n.orientation, s, { flush: "post" }), L(() => {
94
+ I(), c();
95
+ }, { flush: "post" }), _(() => l.value.length, c, { flush: "post" }), _(() => n.orientation, c, { flush: "post" }), U(() => {
92
96
  const e = l.value.findIndex((t) => t.value === p.value);
93
97
  return l.value.findIndex((t) => t.value === o.value) >= e ? "left" : "right";
94
98
  });
95
- const R = ae();
96
- return (e, a) => O((v(), h("div", {
99
+ const H = le();
100
+ return (e, a) => W((v(), h("div", {
97
101
  class: T(["cui-tabs", [
98
- `cui-tabs--${r.variant}`,
99
- `cui-tabs--${r.orientation}`
102
+ `cui-tabs--${i.variant}`,
103
+ `cui-tabs--${i.orientation}`
100
104
  ]])
101
105
  }, [
102
- k("div", oe, [
106
+ k("div", ne, [
103
107
  k("div", {
104
108
  ref_key: "barRef",
105
109
  ref: f,
106
110
  class: "cui-tabs__bar",
107
111
  role: "tablist",
108
- "aria-orientation": r.orientation,
109
- "data-overflow": g.value,
110
- onKeydown: E,
111
- onScroll: s
112
+ "aria-orientation": i.orientation,
113
+ "data-overflow": w.value,
114
+ onKeydown: R,
115
+ onScroll: c
112
116
  }, [
113
- (v(!0), h($, null, U(l.value, (t) => (v(), h("button", {
117
+ (v(!0), h(A, null, q(l.value, (t) => (v(), h("button", {
114
118
  key: t.value,
115
119
  type: "button",
116
120
  "data-cui-tab-value": t.value,
@@ -118,46 +122,46 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
118
122
  "cui-tabs__tab--active": o.value === t.value,
119
123
  "cui-tabs__tab--disabled": t.disabled
120
124
  }]),
121
- style: W({
122
- "--_tab-color": `var(--cui-${r.color})`,
123
- "--_tab-hover": `var(--cui-${r.color}-hover)`,
124
- "--_tab-bg": `var(--cui-${r.color}-bg)`
125
+ style: F({
126
+ "--_tab-color": `var(--cui-${i.color})`,
127
+ "--_tab-hover": `var(--cui-${i.color}-hover)`,
128
+ "--_tab-bg": `var(--cui-${i.color}-bg)`
125
129
  }),
126
130
  role: "tab",
127
131
  "aria-selected": o.value === t.value,
128
132
  "aria-disabled": t.disabled || void 0,
129
133
  tabindex: o.value === t.value ? 0 : -1,
130
- onClick: (u) => w(t.value)
134
+ onClick: (s) => x(t.value)
131
135
  }, [
132
- k("span", ie, [
133
- t.labelSlot ? (v(), q(F(t.labelSlot), { key: 0 })) : (v(), h($, { key: 1 }, [
134
- j(G(t.label), 1)
136
+ k("span", se, [
137
+ t.labelSlot ? (v(), j(G(t.labelSlot), { key: 0 })) : (v(), h(A, { key: 1 }, [
138
+ J(P(t.label), 1)
135
139
  ], 64))
136
140
  ]),
137
141
  t.closeable ? (v(), h("button", {
138
142
  key: 0,
139
143
  type: "button",
140
144
  class: "cui-tabs__tab-close",
141
- "aria-label": P(R).tabs.closeTab,
145
+ "aria-label": X(H).tabs.closeTab,
142
146
  tabindex: "-1",
143
- onClick: J((u) => V(t.value), ["stop"])
147
+ onClick: Q((s) => C(t.value), ["stop"])
144
148
  }, [
145
- Q(ee, {
149
+ Y(ae, {
146
150
  name: "x",
147
151
  size: "0.75rem"
148
152
  })
149
- ], 8, re)) : X("", !0)
150
- ], 14, ne))), 128))
151
- ], 40, le)
153
+ ], 8, ue)) : Z("", !0)
154
+ ], 14, re))), 128))
155
+ ], 40, ie)
152
156
  ]),
153
- k("div", ue, [
154
- Y(e.$slots, "default", {}, void 0, !0)
157
+ k("div", ce, [
158
+ ee(e.$slots, "default", {}, void 0, !0)
155
159
  ])
156
160
  ], 2)), [
157
- [Z, !r.hidden]
161
+ [te, !i.hidden]
158
162
  ]);
159
163
  }
160
164
  });
161
165
  export {
162
- fe as default
166
+ me as default
163
167
  };
@@ -1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M;gBAdP,MAAM,EAAE;cAQV,MAAM;cAEN,MAAM;iBARH,SAAS,EAAE;iBAIX,OAAO;aAMX,MAAM;uBAUI,MAAM;gBAEb,MAAM;6EA+iBnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CuiTagInput.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ca6016d3"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-532a086a"]]);
5
5
  export {
6
6
  m as default
7
7
  };