@dicehub/kappa 0.5.0 → 0.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.
- package/CHANGELOG.md +48 -0
- package/THIRD_PARTY_NOTICES.md +32 -1
- package/dist/{DropdownSubTrigger-CBmdRDUH.js → DropdownSubTrigger-DrZmNIcU.js} +15 -13
- package/dist/DropdownSubTrigger-DrZmNIcU.js.map +1 -0
- package/dist/{InlineCopyText-C5laww5W.js → InlineCopyText-Bosrszdf.js} +38 -40
- package/dist/InlineCopyText-Bosrszdf.js.map +1 -0
- package/dist/{SidebarLayout-Cs6OnqU2.js → SidebarLayout-D9RT-MdT.js} +18 -8
- package/dist/SidebarLayout-D9RT-MdT.js.map +1 -0
- package/dist/WorkspaceSwitcher-DBWdKZbM.js +265 -0
- package/dist/WorkspaceSwitcher-DBWdKZbM.js.map +1 -0
- package/dist/blocks/file-browser.js +1 -1
- package/dist/blocks/index.d.ts +2 -0
- package/dist/blocks/settings-layout/SettingsLayout.vue.d.ts +11 -0
- package/dist/blocks/settings-layout/SettingsSection.vue.d.ts +30 -0
- package/dist/blocks/settings-layout/index.d.ts +7 -0
- package/dist/blocks/settings-layout/settings-layout.d.ts +42 -0
- package/dist/blocks/settings-layout.js +2 -0
- package/dist/blocks/sidebar-layout/SidebarLayout.vue.d.ts +2 -0
- package/dist/blocks/sidebar-layout/index.d.ts +1 -1
- package/dist/blocks/sidebar-layout/sidebar-layout.d.ts +4 -0
- package/dist/blocks/sidebar-layout.js +1 -1
- package/dist/blocks/workspace-switcher/WorkspaceSwitcher.vue.d.ts +33 -0
- package/dist/blocks/workspace-switcher/WorkspaceSwitcherActions.vue.d.ts +12 -0
- package/dist/blocks/workspace-switcher/WorkspaceSwitcherBadge.vue.d.ts +8 -0
- package/dist/blocks/workspace-switcher/index.d.ts +3 -0
- package/dist/blocks/workspace-switcher/workspace-switcher.d.ts +63 -0
- package/dist/blocks/workspace-switcher.js +2 -0
- package/dist/{clipboard-text-Ob056Gly.js → clipboard-text-Clp3y-6f.js} +10 -14
- package/dist/{clipboard-text-Ob056Gly.js.map → clipboard-text-Clp3y-6f.js.map} +1 -1
- package/dist/{command-palette-CGREegfE.js → command-palette-BHFB86Gc.js} +9 -3
- package/dist/command-palette-BHFB86Gc.js.map +1 -0
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/code-highlighted/CodeHighlighted.vue.d.ts +6 -1
- package/dist/components/code-highlighted/CodeHighlightedCopy.vue.d.ts +8 -0
- package/dist/components/code-highlighted/code-highlighted.d.ts +9 -0
- package/dist/components/code-highlighted/index.d.ts +1 -1
- package/dist/components/code-highlighted.js +185 -116
- package/dist/components/code-highlighted.js.map +1 -1
- package/dist/components/command-palette/command-palette.d.ts +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/context-menu/ContextMenu.vue.d.ts +2 -2
- package/dist/components/context-menu.js +2 -2
- package/dist/components/data-grid.js +1 -1
- package/dist/components/dialog/Dialog.vue.d.ts +2 -2
- package/dist/components/dialog-layout/DialogLayoutAlert.vue.d.ts +2 -2
- package/dist/components/diff-viewer.js +1 -1
- package/dist/components/drawer/Drawer.vue.d.ts +2 -2
- package/dist/components/dropdown/Dropdown.vue.d.ts +2 -2
- package/dist/components/dropdown/DropdownSub.vue.d.ts +2 -2
- package/dist/components/dropdown.js +2 -2
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/hover-card/HoverCard.vue.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inline-copy-text.js +1 -1
- package/dist/components/menu-bar.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.vue.d.ts +23 -0
- package/dist/components/navigation-menu/NavigationMenuArrow.vue.d.ts +13 -0
- package/dist/components/navigation-menu/NavigationMenuContent.vue.d.ts +14 -0
- package/dist/components/navigation-menu/NavigationMenuContext.vue.d.ts +11 -0
- package/dist/components/navigation-menu/NavigationMenuIndicator.vue.d.ts +13 -0
- package/dist/components/navigation-menu/NavigationMenuItem.vue.d.ts +15 -0
- package/dist/components/navigation-menu/NavigationMenuItemIndicator.vue.d.ts +13 -0
- package/dist/components/navigation-menu/NavigationMenuLink.vue.d.ts +16 -0
- package/dist/components/navigation-menu/NavigationMenuList.vue.d.ts +13 -0
- package/dist/components/navigation-menu/NavigationMenuRootProvider.vue.d.ts +13 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +15 -0
- package/dist/components/navigation-menu/NavigationMenuViewport.vue.d.ts +13 -0
- package/dist/components/navigation-menu/NavigationMenuViewportPositioner.vue.d.ts +15 -0
- package/dist/components/navigation-menu/index.d.ts +34 -0
- package/dist/components/navigation-menu/navigation-menu-attrs.d.ts +4 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +36 -0
- package/dist/components/navigation-menu/use-navigation-menu.d.ts +9 -0
- package/dist/components/navigation-menu.js +2 -0
- package/dist/components/number-input/NumberInput.vue.d.ts +1 -1
- package/dist/components/number-input/NumberInputRootProvider.vue.d.ts +1 -1
- package/dist/components/number-input/index.d.ts +2 -1
- package/dist/components/number-input/number-input-cursor.d.ts +11 -0
- package/dist/components/number-input/number-input-machine.d.ts +5 -0
- package/dist/components/number-input/use-number-input.d.ts +2 -0
- package/dist/components/number-input.js +2 -2
- package/dist/components/popover/Popover.vue.d.ts +2 -2
- package/dist/components/sidebar/SidebarProvider.vue.d.ts +1 -0
- package/dist/components/sidebar/SidebarTrigger.vue.d.ts +1 -0
- package/dist/components/sidebar/sidebar-context.d.ts +1 -0
- package/dist/components/sidebar/sidebar-peek.d.ts +1 -1
- package/dist/components/sidebar/sidebar-resize.d.ts +1 -0
- package/dist/components/sidebar/sidebar.d.ts +6 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/{context-menu-C_XGS00V.js → context-menu-B_noSd5p.js} +2 -2
- package/dist/{context-menu-C_XGS00V.js.map → context-menu-B_noSd5p.js.map} +1 -1
- package/dist/{data-grid-C7ZyN-nX.js → data-grid-BWXpMwCT.js} +2 -2
- package/dist/{data-grid-C7ZyN-nX.js.map → data-grid-BWXpMwCT.js.map} +1 -1
- package/dist/{diff-viewer-DpDGXsGd.js → diff-viewer-fDKJ-67E.js} +2 -2
- package/dist/{diff-viewer-DpDGXsGd.js.map → diff-viewer-fDKJ-67E.js.map} +1 -1
- package/dist/{dropdown-B4YZ7mck.js → dropdown-Dedb1tk8.js} +2 -2
- package/dist/{dropdown-B4YZ7mck.js.map → dropdown-Dedb1tk8.js.map} +1 -1
- package/dist/{file-browser-BU08V7Lh.js → file-browser-tqo1PirD.js} +4 -4
- package/dist/{file-browser-BU08V7Lh.js.map → file-browser-tqo1PirD.js.map} +1 -1
- package/dist/{filter-bar-yEkaxil8.js → filter-bar-COAlDQE4.js} +2 -2
- package/dist/{filter-bar-yEkaxil8.js.map → filter-bar-COAlDQE4.js.map} +1 -1
- package/dist/index.js +55 -52
- package/dist/{menu-bar-CraWEpaF.js → menu-bar-C-qQn2L1.js} +2 -2
- package/dist/{menu-bar-CraWEpaF.js.map → menu-bar-C-qQn2L1.js.map} +1 -1
- package/dist/navigation-menu-DbfnBaTw.js +379 -0
- package/dist/navigation-menu-DbfnBaTw.js.map +1 -0
- package/dist/{number-input-D59rbYIn.js → number-input-B3Xkb5sT.js} +258 -146
- package/dist/number-input-B3Xkb5sT.js.map +1 -0
- package/dist/registry/component-registry.json +23 -3
- package/dist/registry/generated.d.ts +146 -5
- package/dist/{registry-Cm6z1POX.js → registry-Bt3InMf5.js} +178 -5
- package/dist/registry-Bt3InMf5.js.map +1 -0
- package/dist/registry.js +1 -1
- package/dist/settings-layout-RlKrLGUx.js +170 -0
- package/dist/settings-layout-RlKrLGUx.js.map +1 -0
- package/dist/{sidebar-DkQJmgBd.js → sidebar-tcrbUrk_.js} +279 -222
- package/dist/sidebar-tcrbUrk_.js.map +1 -0
- package/dist/styles/kappa.css +1 -1
- package/dist/styles/theme-kappa.css +6 -1
- package/dist/styles/tokens.json +22 -0
- package/licenses/zag-number-input.LICENSE +21 -0
- package/package.json +3 -2
- package/dist/DropdownSubTrigger-CBmdRDUH.js.map +0 -1
- package/dist/InlineCopyText-C5laww5W.js.map +0 -1
- package/dist/SidebarLayout-Cs6OnqU2.js.map +0 -1
- package/dist/command-palette-CGREegfE.js.map +0 -1
- package/dist/number-input-D59rbYIn.js.map +0 -1
- package/dist/registry-Cm6z1POX.js.map +0 -1
- package/dist/sidebar-DkQJmgBd.js.map +0 -1
|
@@ -1,32 +1,144 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, guardReactiveProps as s, inject as c, mergeProps as l, nextTick as u, normalizeProps as d, onBeforeUnmount as f,
|
|
2
|
-
import { DEFAULT_LOCALE as
|
|
3
|
-
import {
|
|
1
|
+
import { computed as e, createBlock as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, guardReactiveProps as s, inject as c, mergeProps as l, nextTick as u, normalizeProps as d, onBeforeUnmount as f, onScopeDispose as p, openBlock as m, provide as h, ref as g, renderSlot as _, toDisplayString as v, toValue as y, unref as b, useAttrs as x, useId as S, watch as C, withCtx as w } from "vue";
|
|
2
|
+
import { DEFAULT_LOCALE as T, LocaleProvider as E, useLocaleContext as D } from "@ark-ui/vue/locale";
|
|
3
|
+
import { useFieldContext as ee } from "@ark-ui/vue/field";
|
|
4
|
+
import { DEFAULT_ENVIRONMENT as O, useEnvironmentContext as te } from "@ark-ui/vue/environment";
|
|
5
|
+
import * as k from "@zag-js/number-input";
|
|
6
|
+
import { machine as A } from "@zag-js/number-input";
|
|
7
|
+
import { normalizeProps as ne, useMachine as j } from "@zag-js/vue";
|
|
8
|
+
import { setElementValue as M } from "@zag-js/dom-query";
|
|
9
|
+
import { NumberInput as N, numberInputAnatomy as P, useNumberInputContext as F, useNumberInputContext as I } from "@ark-ui/vue/number-input";
|
|
10
|
+
//#region src/components/number-input/number-input-cursor.ts
|
|
11
|
+
function L(e, t) {
|
|
12
|
+
if (!(!e || !t.isActiveElement(e))) try {
|
|
13
|
+
let { selectionStart: t, selectionEnd: n, value: r } = e;
|
|
14
|
+
return t == null || n == null ? void 0 : {
|
|
15
|
+
start: t,
|
|
16
|
+
end: n,
|
|
17
|
+
value: r
|
|
18
|
+
};
|
|
19
|
+
} catch {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function R(e, t, n) {
|
|
24
|
+
if (n.isActiveElement(e)) {
|
|
25
|
+
if (!t) {
|
|
26
|
+
e.setSelectionRange(e.value.length, e.value.length);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
let { start: n, end: r, value: i } = t, a = e.value;
|
|
31
|
+
if (a === i) {
|
|
32
|
+
e.setSelectionRange(n, r);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let o = z(i, a, n), s = n === r ? o : z(i, a, r), c = Math.max(0, Math.min(o, a.length));
|
|
36
|
+
e.setSelectionRange(c, Math.max(c, Math.min(s, a.length)));
|
|
37
|
+
} catch {
|
|
38
|
+
e.setSelectionRange(e.value.length, e.value.length);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function z(e, t, n) {
|
|
43
|
+
let r = e.slice(0, n), i = e.slice(n), a = 0;
|
|
44
|
+
for (let e = 0; e < Math.min(r.length, t.length) && r[e] === t[e]; e++) a = e + 1;
|
|
45
|
+
let o = 0;
|
|
46
|
+
for (let e = 0; e < Math.min(i.length, t.length - a) && i[i.length - 1 - e] === t[t.length - 1 - e]; e++) o = e + 1;
|
|
47
|
+
return r.length > 0 && a >= r.length ? a : o >= i.length ? t.length - o : a > 0 ? a : o > 0 ? t.length - o : n === 0 ? t.length : e.length > 0 ? Math.round(n / e.length * t.length) : t.length;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/number-input/number-input-machine.ts
|
|
51
|
+
function B() {
|
|
52
|
+
let e = A.implementations, t = e?.actions;
|
|
53
|
+
if (!t?.syncInputElement) throw Error("Review the Number Input synchronization repair after upgrading Zag.");
|
|
54
|
+
let n = 0, r = !1;
|
|
55
|
+
return {
|
|
56
|
+
machine: {
|
|
57
|
+
...A,
|
|
58
|
+
implementations: {
|
|
59
|
+
...e,
|
|
60
|
+
actions: {
|
|
61
|
+
...t,
|
|
62
|
+
syncInputElement({ context: e, event: t, computed: i, scope: a }) {
|
|
63
|
+
let o = ++n, s = a.ids?.input ?? `number-input:${a.id}:input`, c = a.getById(s);
|
|
64
|
+
if (!c) return;
|
|
65
|
+
let l = t.selection ?? L(c, a), d = t.type.endsWith("CHANGE");
|
|
66
|
+
u(() => u(() => {
|
|
67
|
+
if (r || o !== n || !c.isConnected || a.getById(s) !== c) return;
|
|
68
|
+
let t = d ? e.get("value") : i("formattedValue");
|
|
69
|
+
M(c, t), R(c, l, a);
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
dispose: () => {
|
|
76
|
+
r = !0, n++;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/number-input/use-number-input.ts
|
|
82
|
+
function V(...[t = {}, n]) {
|
|
83
|
+
let r = S(), i = te(O), a = D(T), o = ee(), s = e(() => {
|
|
84
|
+
let e = y(t) ?? {}, s = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
85
|
+
return {
|
|
86
|
+
id: r,
|
|
87
|
+
ids: {
|
|
88
|
+
label: o?.value.ids.label,
|
|
89
|
+
input: o?.value.ids.control
|
|
90
|
+
},
|
|
91
|
+
disabled: o?.value.disabled,
|
|
92
|
+
readOnly: o?.value.readOnly,
|
|
93
|
+
required: o?.value.required,
|
|
94
|
+
invalid: o?.value.invalid,
|
|
95
|
+
dir: a.value.dir,
|
|
96
|
+
locale: a.value.locale,
|
|
97
|
+
value: e.modelValue,
|
|
98
|
+
getRootNode: i?.value.getRootNode,
|
|
99
|
+
...s,
|
|
100
|
+
onValueChange: (t) => {
|
|
101
|
+
n?.("valueChange", t), n?.("update:modelValue", t.value), e.onValueChange?.(t);
|
|
102
|
+
},
|
|
103
|
+
onFocusChange: (t) => {
|
|
104
|
+
n?.("focusChange", t), e.onFocusChange?.(t);
|
|
105
|
+
},
|
|
106
|
+
onValueInvalid: (t) => {
|
|
107
|
+
n?.("valueInvalid", t), e.onValueInvalid?.(t);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}), c = B();
|
|
111
|
+
p(c.dispose);
|
|
112
|
+
let l = j(c.machine, s);
|
|
113
|
+
return e(() => k.connect(l, ne));
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
4
116
|
//#region src/components/number-input/number-input-scrub-steps.ts
|
|
5
|
-
var
|
|
117
|
+
var H = Symbol("kappa-number-input-scrub-steps"), U = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, re = (e, t, n) => {
|
|
6
118
|
if (n) {
|
|
7
119
|
let r = e.ctrlKey ? n.control : e.shiftKey ? n.shift : e.altKey ? n.alt : 1;
|
|
8
|
-
return
|
|
120
|
+
return U(t.step * U(r, 1), t.step);
|
|
9
121
|
}
|
|
10
122
|
return e.ctrlKey || e.altKey ? t.smallStep : e.shiftKey ? t.largeStep : t.step;
|
|
11
|
-
},
|
|
12
|
-
let t = e.formatOptions?.style === "percent" ? .01 : 1, n =
|
|
123
|
+
}, W = (e) => {
|
|
124
|
+
let t = e.formatOptions?.style === "percent" ? .01 : 1, n = U(e.step, t);
|
|
13
125
|
return {
|
|
14
126
|
step: n,
|
|
15
|
-
smallStep:
|
|
16
|
-
largeStep:
|
|
127
|
+
smallStep: U(e.smallStep, n / 10),
|
|
128
|
+
largeStep: U(e.largeStep, n * 10)
|
|
17
129
|
};
|
|
18
|
-
},
|
|
19
|
-
let n = c(
|
|
20
|
-
let e =
|
|
21
|
-
return e.step !== void 0 || e.smallStep !== void 0 || e.largeStep !== void 0 || e.formatOptions !== void 0 || n === void 0 ?
|
|
130
|
+
}, G = (t) => {
|
|
131
|
+
let n = c(H, void 0), r = e(() => {
|
|
132
|
+
let e = y(t);
|
|
133
|
+
return e.step !== void 0 || e.smallStep !== void 0 || e.largeStep !== void 0 || e.formatOptions !== void 0 || n === void 0 ? W(e) : n.value;
|
|
22
134
|
});
|
|
23
|
-
return
|
|
24
|
-
},
|
|
135
|
+
return h(H, r), r;
|
|
136
|
+
}, ie = () => c(H, e(() => W({}))), K = [
|
|
25
137
|
"xs",
|
|
26
138
|
"sm",
|
|
27
139
|
"default",
|
|
28
140
|
"lg"
|
|
29
|
-
],
|
|
141
|
+
], q = "default", J = ["start", "center"], Y = "start", X = (e) => typeof e == "string" && K.includes(e), ae = (e) => X(e) ? e : q, oe = (e) => typeof e == "string" && J.includes(e), se = (e) => oe(e) ? e : Y, Z = /* @__PURE__ */ o({
|
|
30
142
|
inheritAttrs: !1,
|
|
31
143
|
__name: "NumberInputRootProvider",
|
|
32
144
|
props: {
|
|
@@ -40,13 +152,13 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
40
152
|
default: void 0
|
|
41
153
|
},
|
|
42
154
|
largeStep: { default: void 0 },
|
|
43
|
-
size: { default:
|
|
155
|
+
size: { default: q },
|
|
44
156
|
smallStep: { default: void 0 },
|
|
45
157
|
step: { default: void 0 }
|
|
46
158
|
},
|
|
47
159
|
setup(n) {
|
|
48
|
-
let r = n, i = e(() =>
|
|
49
|
-
|
|
160
|
+
let r = n, i = e(() => ae(r.size)), a = e(() => r.value.getInputProps());
|
|
161
|
+
G(() => ({
|
|
50
162
|
largeStep: r.largeStep,
|
|
51
163
|
smallStep: r.smallStep,
|
|
52
164
|
step: r.step
|
|
@@ -56,7 +168,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
56
168
|
let t = e.target;
|
|
57
169
|
!(t instanceof Element) || !t.closest("[data-slot=\"number-input-input\"], [data-slot=\"number-input-scrubbable-input\"]") || (e.preventDefault(), e.deltaY < 0 ? r.value.increment() : r.value.decrement());
|
|
58
170
|
};
|
|
59
|
-
return (e, n) => (
|
|
171
|
+
return (e, n) => (m(), t(b(N).RootProvider, l(e.$attrs, {
|
|
60
172
|
class: "kappa-number-input",
|
|
61
173
|
"data-slot": "number-input",
|
|
62
174
|
"as-child": r.asChild,
|
|
@@ -66,7 +178,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
66
178
|
value: r.value,
|
|
67
179
|
onWheel: o
|
|
68
180
|
}), {
|
|
69
|
-
default:
|
|
181
|
+
default: w(() => [_(e.$slots, "default")]),
|
|
70
182
|
_: 3
|
|
71
183
|
}, 16, [
|
|
72
184
|
"as-child",
|
|
@@ -76,7 +188,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
76
188
|
"value"
|
|
77
189
|
]));
|
|
78
190
|
}
|
|
79
|
-
}),
|
|
191
|
+
}), ce = /* @__PURE__ */ o({
|
|
80
192
|
inheritAttrs: !1,
|
|
81
193
|
__name: "NumberInputMachine",
|
|
82
194
|
props: {
|
|
@@ -86,14 +198,14 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
86
198
|
size: {}
|
|
87
199
|
},
|
|
88
200
|
setup(n) {
|
|
89
|
-
let r = n, i =
|
|
90
|
-
return (e, n) => (
|
|
201
|
+
let r = n, i = V(e(() => r.machineProps));
|
|
202
|
+
return (e, n) => (m(), t(Z, l(e.$attrs, {
|
|
91
203
|
"allow-mouse-wheel": r.allowMouseWheel,
|
|
92
204
|
"as-child": r.asChild,
|
|
93
205
|
size: r.size,
|
|
94
|
-
value:
|
|
206
|
+
value: b(i)
|
|
95
207
|
}), {
|
|
96
|
-
default:
|
|
208
|
+
default: w(() => [_(e.$slots, "default")]),
|
|
97
209
|
_: 3
|
|
98
210
|
}, 16, [
|
|
99
211
|
"allow-mouse-wheel",
|
|
@@ -102,7 +214,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
102
214
|
"value"
|
|
103
215
|
]));
|
|
104
216
|
}
|
|
105
|
-
}),
|
|
217
|
+
}), Q = /* @__PURE__ */ o({
|
|
106
218
|
inheritAttrs: !1,
|
|
107
219
|
__name: "NumberInput",
|
|
108
220
|
props: {
|
|
@@ -156,7 +268,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
156
268
|
type: Boolean,
|
|
157
269
|
default: void 0
|
|
158
270
|
},
|
|
159
|
-
size: { default:
|
|
271
|
+
size: { default: q },
|
|
160
272
|
smallStep: { default: void 0 },
|
|
161
273
|
spinOnPress: {
|
|
162
274
|
type: Boolean,
|
|
@@ -173,8 +285,8 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
173
285
|
"update:modelValue"
|
|
174
286
|
],
|
|
175
287
|
setup(n, { emit: r }) {
|
|
176
|
-
let i = n, o = r, s = T
|
|
177
|
-
|
|
288
|
+
let i = n, o = r, s = D(T), c = e(() => i.locale ?? s.value.locale), u = e(() => i.dir === void 0 ? c.value : i.dir === "rtl" ? "ar" : "en-US");
|
|
289
|
+
G(() => ({
|
|
178
290
|
formatOptions: i.formatOptions,
|
|
179
291
|
largeStep: i.largeStep,
|
|
180
292
|
smallStep: i.smallStep,
|
|
@@ -182,7 +294,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
182
294
|
}));
|
|
183
295
|
let d = (e) => o("focusChange", e), f = (e) => {
|
|
184
296
|
o("valueChange", e), o("update:modelValue", e.value);
|
|
185
|
-
},
|
|
297
|
+
}, p = (e) => o("valueCommit", e), h = (e) => o("valueInvalid", e), g = e(() => ({
|
|
186
298
|
allowMouseWheel: i.allowMouseWheel,
|
|
187
299
|
allowOverflow: i.allowOverflow,
|
|
188
300
|
clampValueOnBlur: i.clampValueOnBlur,
|
|
@@ -203,7 +315,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
203
315
|
name: i.name,
|
|
204
316
|
onFocusChange: d,
|
|
205
317
|
onValueChange: f,
|
|
206
|
-
onValueCommit:
|
|
318
|
+
onValueCommit: p,
|
|
207
319
|
onValueInvalid: h,
|
|
208
320
|
pattern: i.pattern,
|
|
209
321
|
readOnly: i.readOnly,
|
|
@@ -213,14 +325,14 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
213
325
|
step: i.step,
|
|
214
326
|
translations: i.translations
|
|
215
327
|
}));
|
|
216
|
-
return (e, n) => (
|
|
217
|
-
default:
|
|
328
|
+
return (e, n) => (m(), t(b(E), { locale: u.value }, {
|
|
329
|
+
default: w(() => [a(ce, l(e.$attrs, {
|
|
218
330
|
"allow-mouse-wheel": i.allowMouseWheel,
|
|
219
331
|
"as-child": i.asChild,
|
|
220
|
-
"machine-props":
|
|
332
|
+
"machine-props": g.value,
|
|
221
333
|
size: i.size
|
|
222
334
|
}), {
|
|
223
|
-
default:
|
|
335
|
+
default: w(() => [_(e.$slots, "default")]),
|
|
224
336
|
_: 3
|
|
225
337
|
}, 16, [
|
|
226
338
|
"allow-mouse-wheel",
|
|
@@ -231,15 +343,15 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
231
343
|
_: 3
|
|
232
344
|
}, 8, ["locale"]));
|
|
233
345
|
}
|
|
234
|
-
}),
|
|
346
|
+
}), le = /* @__PURE__ */ o({
|
|
235
347
|
__name: "NumberInputContext",
|
|
236
348
|
setup(e) {
|
|
237
|
-
return (e, n) => (
|
|
238
|
-
default:
|
|
349
|
+
return (e, n) => (m(), t(b(N).Context, null, {
|
|
350
|
+
default: w((t) => [_(e.$slots, "default", d(s(t)))]),
|
|
239
351
|
_: 3
|
|
240
352
|
}));
|
|
241
353
|
}
|
|
242
|
-
}),
|
|
354
|
+
}), ue = /* @__PURE__ */ o({
|
|
243
355
|
inheritAttrs: !1,
|
|
244
356
|
__name: "NumberInputControl",
|
|
245
357
|
props: { asChild: {
|
|
@@ -248,16 +360,16 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
248
360
|
} },
|
|
249
361
|
setup(e) {
|
|
250
362
|
let n = e;
|
|
251
|
-
return (e, r) => (
|
|
363
|
+
return (e, r) => (m(), t(b(N).Control, l(e.$attrs, {
|
|
252
364
|
class: "kappa-number-input__control",
|
|
253
365
|
"data-slot": "number-input-control",
|
|
254
366
|
"as-child": n.asChild
|
|
255
367
|
}), {
|
|
256
|
-
default:
|
|
368
|
+
default: w(() => [_(e.$slots, "default")]),
|
|
257
369
|
_: 3
|
|
258
370
|
}, 16, ["as-child"]));
|
|
259
371
|
}
|
|
260
|
-
}),
|
|
372
|
+
}), de = /* @__PURE__ */ o({
|
|
261
373
|
inheritAttrs: !1,
|
|
262
374
|
__name: "NumberInputDecrementTrigger",
|
|
263
375
|
props: { asChild: {
|
|
@@ -266,12 +378,12 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
266
378
|
} },
|
|
267
379
|
setup(e) {
|
|
268
380
|
let n = e;
|
|
269
|
-
return (e, i) => (
|
|
381
|
+
return (e, i) => (m(), t(b(N).DecrementTrigger, l(e.$attrs, {
|
|
270
382
|
class: "kappa-number-input__trigger kappa-number-input__trigger--decrement",
|
|
271
383
|
"data-slot": "number-input-decrement-trigger",
|
|
272
384
|
"as-child": n.asChild
|
|
273
385
|
}), {
|
|
274
|
-
default:
|
|
386
|
+
default: w(() => [_(e.$slots, "default", {}, () => [i[0] ||= r("svg", {
|
|
275
387
|
"aria-hidden": "true",
|
|
276
388
|
class: "kappa-number-input__trigger-icon",
|
|
277
389
|
"data-slot": "number-input-decrement-icon",
|
|
@@ -287,7 +399,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
287
399
|
_: 3
|
|
288
400
|
}, 16, ["as-child"]));
|
|
289
401
|
}
|
|
290
|
-
}),
|
|
402
|
+
}), fe = /* @__PURE__ */ o({
|
|
291
403
|
inheritAttrs: !1,
|
|
292
404
|
__name: "NumberInputIncrementTrigger",
|
|
293
405
|
props: { asChild: {
|
|
@@ -296,12 +408,12 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
296
408
|
} },
|
|
297
409
|
setup(e) {
|
|
298
410
|
let n = e;
|
|
299
|
-
return (e, i) => (
|
|
411
|
+
return (e, i) => (m(), t(b(N).IncrementTrigger, l(e.$attrs, {
|
|
300
412
|
class: "kappa-number-input__trigger kappa-number-input__trigger--increment",
|
|
301
413
|
"data-slot": "number-input-increment-trigger",
|
|
302
414
|
"as-child": n.asChild
|
|
303
415
|
}), {
|
|
304
|
-
default:
|
|
416
|
+
default: w(() => [_(e.$slots, "default", {}, () => [i[0] ||= r("svg", {
|
|
305
417
|
"aria-hidden": "true",
|
|
306
418
|
class: "kappa-number-input__trigger-icon",
|
|
307
419
|
"data-slot": "number-input-increment-icon",
|
|
@@ -317,7 +429,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
317
429
|
_: 3
|
|
318
430
|
}, 16, ["as-child"]));
|
|
319
431
|
}
|
|
320
|
-
}),
|
|
432
|
+
}), pe = /* @__PURE__ */ o({
|
|
321
433
|
inheritAttrs: !1,
|
|
322
434
|
__name: "NumberInputInput",
|
|
323
435
|
props: { asChild: {
|
|
@@ -326,16 +438,16 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
326
438
|
} },
|
|
327
439
|
setup(e) {
|
|
328
440
|
let n = e;
|
|
329
|
-
return (e, r) => (
|
|
441
|
+
return (e, r) => (m(), t(b(N).Input, l(e.$attrs, {
|
|
330
442
|
class: "kappa-number-input__input",
|
|
331
443
|
"data-slot": "number-input-input",
|
|
332
444
|
"as-child": n.asChild
|
|
333
445
|
}), {
|
|
334
|
-
default:
|
|
446
|
+
default: w(() => [_(e.$slots, "default")]),
|
|
335
447
|
_: 3
|
|
336
448
|
}, 16, ["as-child"]));
|
|
337
449
|
}
|
|
338
|
-
}),
|
|
450
|
+
}), me = /* @__PURE__ */ o({
|
|
339
451
|
inheritAttrs: !1,
|
|
340
452
|
__name: "NumberInputLabel",
|
|
341
453
|
props: { asChild: {
|
|
@@ -344,16 +456,16 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
344
456
|
} },
|
|
345
457
|
setup(e) {
|
|
346
458
|
let n = e;
|
|
347
|
-
return (e, r) => (
|
|
459
|
+
return (e, r) => (m(), t(b(N).Label, l(e.$attrs, {
|
|
348
460
|
class: "kappa-number-input__label",
|
|
349
461
|
"data-slot": "number-input-label",
|
|
350
462
|
"as-child": n.asChild
|
|
351
463
|
}), {
|
|
352
|
-
default:
|
|
464
|
+
default: w(() => [_(e.$slots, "default")]),
|
|
353
465
|
_: 3
|
|
354
466
|
}, 16, ["as-child"]));
|
|
355
467
|
}
|
|
356
|
-
}),
|
|
468
|
+
}), he = /* @__PURE__ */ o({
|
|
357
469
|
inheritAttrs: !1,
|
|
358
470
|
__name: "NumberInputScrubber",
|
|
359
471
|
props: { asChild: {
|
|
@@ -361,10 +473,10 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
361
473
|
default: void 0
|
|
362
474
|
} },
|
|
363
475
|
setup(n) {
|
|
364
|
-
let i = n, a =
|
|
476
|
+
let i = n, a = F(), o = e(() => !!a.value.getInputProps().readonly), s = (e) => {
|
|
365
477
|
o.value && (e.preventDefault(), e.stopImmediatePropagation());
|
|
366
478
|
};
|
|
367
|
-
return (e, n) => (
|
|
479
|
+
return (e, n) => (m(), t(b(N).Scrubber, l(e.$attrs, {
|
|
368
480
|
class: "kappa-number-input__scrubber",
|
|
369
481
|
"data-slot": "number-input-scrubber",
|
|
370
482
|
"as-child": i.asChild,
|
|
@@ -372,7 +484,7 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
372
484
|
style: o.value ? { cursor: "default" } : void 0,
|
|
373
485
|
onMousedownCapture: s
|
|
374
486
|
}), {
|
|
375
|
-
default:
|
|
487
|
+
default: w(() => [_(e.$slots, "default", {}, () => [n[0] ||= r("svg", {
|
|
376
488
|
"aria-hidden": "true",
|
|
377
489
|
class: "kappa-number-input__scrubber-icon",
|
|
378
490
|
"data-slot": "number-input-scrubber-icon",
|
|
@@ -400,46 +512,46 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
400
512
|
coefficient: BigInt(`${r ? "-" : ""}${o}`),
|
|
401
513
|
exponent: Number(n) - a.length
|
|
402
514
|
};
|
|
403
|
-
},
|
|
515
|
+
}, ge = (e, t) => e.coefficient * 10n ** BigInt(e.exponent - t), _e = (e, t, n) => {
|
|
404
516
|
let r = $(e), i = $(t), a = $(n);
|
|
405
517
|
if (!r || !i || !a) return e + t * n;
|
|
406
518
|
let o = {
|
|
407
519
|
coefficient: i.coefficient * a.coefficient,
|
|
408
520
|
exponent: i.exponent + a.exponent
|
|
409
|
-
}, s = Math.min(r.exponent, o.exponent), c =
|
|
521
|
+
}, s = Math.min(r.exponent, o.exponent), c = ge(r, s) + ge(o, s);
|
|
410
522
|
return Number(`${c}e${s}`);
|
|
411
|
-
},
|
|
412
|
-
let i =
|
|
523
|
+
}, ve = ({ dragThreshold: t, root: n, scrubSensitivity: r }) => {
|
|
524
|
+
let i = F(), a = ie(), o = g(!1), s = g(!1), c = g(!1), l = null, d = 0, p = 0, m = "", h = NaN, _ = 0, v = null, y = null, b = 0, x = !1, S = !1, w = null, T = () => n.value?.querySelector("input") ?? null, E = e(() => i.value.getInputProps()), D = e(() => s.value && !o.value), ee = e(() => i.value.value), O = () => {
|
|
413
525
|
s.value = !1;
|
|
414
|
-
},
|
|
526
|
+
}, te = () => {
|
|
415
527
|
s.value = !0;
|
|
416
|
-
},
|
|
528
|
+
}, k = () => {
|
|
417
529
|
i.value.focus(), u(() => T()?.select());
|
|
418
|
-
},
|
|
419
|
-
v?.removeEventListener("pointermove",
|
|
420
|
-
},
|
|
530
|
+
}, A = () => {
|
|
531
|
+
v?.removeEventListener("pointermove", P), v?.removeEventListener("pointerup", I), v?.removeEventListener("pointercancel", L), v?.removeEventListener("pointerlockchange", R), v?.removeEventListener("keydown", z, !0), v?.removeEventListener("visibilitychange", B), y?.removeEventListener("blur", V);
|
|
532
|
+
}, ne = () => {
|
|
421
533
|
let e = n.value ?? w, t = v ?? e?.ownerDocument;
|
|
422
|
-
e && l !== null && e.hasPointerCapture?.(l) && e.releasePointerCapture(l), e && t?.pointerLockElement === e && t.exitPointerLock?.(),
|
|
423
|
-
},
|
|
534
|
+
e && l !== null && e.hasPointerCapture?.(l) && e.releasePointerCapture(l), e && t?.pointerLockElement === e && t.exitPointerLock?.(), S = !1, w = null, l = null;
|
|
535
|
+
}, j = () => {
|
|
424
536
|
if (m === "") {
|
|
425
537
|
i.value.clearValue();
|
|
426
538
|
return;
|
|
427
539
|
}
|
|
428
|
-
Number.isNaN(
|
|
429
|
-
},
|
|
540
|
+
Number.isNaN(h) || i.value.setValue(h);
|
|
541
|
+
}, M = ({ edit: e = !1, restore: t = !1 } = {}) => {
|
|
430
542
|
if (!c.value && !o.value) return;
|
|
431
543
|
let n = o.value;
|
|
432
|
-
t &&
|
|
433
|
-
},
|
|
434
|
-
if (typeof e.requestPointerLock != "function" ||
|
|
544
|
+
t && j(), c.value = !1, o.value = !1, _ += 1, A(), ne(), v = null, y = null, e && !n ? k() : n && T()?.blur();
|
|
545
|
+
}, N = (e) => {
|
|
546
|
+
if (typeof e.requestPointerLock != "function" || x) return;
|
|
435
547
|
let t = e.ownerDocument, n = _, r = !1;
|
|
436
|
-
|
|
548
|
+
x = !0, w = e, b = n;
|
|
437
549
|
let i = () => {
|
|
438
|
-
r || (r = !0,
|
|
550
|
+
r || (r = !0, x = !1, t.removeEventListener("pointerlockchange", a), t.removeEventListener("pointerlockerror", s));
|
|
439
551
|
}, a = () => {
|
|
440
552
|
t.pointerLockElement === e && (i(), (n !== _ || !o.value) && t.exitPointerLock?.());
|
|
441
553
|
}, s = () => {
|
|
442
|
-
i(), n === b && w === e && !
|
|
554
|
+
i(), n === b && w === e && !S && (w = null);
|
|
443
555
|
};
|
|
444
556
|
t.addEventListener("pointerlockchange", a), t.addEventListener("pointerlockerror", s);
|
|
445
557
|
try {
|
|
@@ -451,10 +563,10 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
451
563
|
i(), w = null;
|
|
452
564
|
}
|
|
453
565
|
};
|
|
454
|
-
function
|
|
566
|
+
function P(e) {
|
|
455
567
|
if (l !== e.pointerId) return;
|
|
456
568
|
if (E.value.disabled || E.value.readonly) {
|
|
457
|
-
|
|
569
|
+
M({ restore: !0 });
|
|
458
570
|
return;
|
|
459
571
|
}
|
|
460
572
|
if (!o.value) {
|
|
@@ -462,74 +574,74 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
462
574
|
o.value = !0, p = e.clientX, i.value.focus();
|
|
463
575
|
let r = n.value;
|
|
464
576
|
if (!r) return;
|
|
465
|
-
|
|
577
|
+
N(r);
|
|
466
578
|
return;
|
|
467
579
|
}
|
|
468
580
|
let s = e.movementX || e.clientX - p;
|
|
469
581
|
if (p = e.clientX, s === 0) return;
|
|
470
|
-
let c =
|
|
582
|
+
let c = re(e, a.value, r.value), u = E.value.dir === "rtl" ? -1 : 1, f = _e(Number.isNaN(i.value.valueAsNumber) ? 0 : i.value.valueAsNumber, c, s * u);
|
|
471
583
|
i.value.setValue(f);
|
|
472
584
|
}
|
|
473
|
-
function
|
|
474
|
-
l === e.pointerId &&
|
|
585
|
+
function I(e) {
|
|
586
|
+
l === e.pointerId && M({ edit: !o.value });
|
|
475
587
|
}
|
|
476
|
-
function
|
|
477
|
-
l === e.pointerId &&
|
|
588
|
+
function L(e) {
|
|
589
|
+
l === e.pointerId && M();
|
|
478
590
|
}
|
|
479
|
-
function
|
|
591
|
+
function R() {
|
|
480
592
|
let e = w;
|
|
481
593
|
if (!e) return;
|
|
482
594
|
let t = v ?? e.ownerDocument;
|
|
483
595
|
if (t.pointerLockElement === e) {
|
|
484
|
-
|
|
596
|
+
S = !0, (!o.value || b !== _) && t.exitPointerLock?.();
|
|
485
597
|
return;
|
|
486
598
|
}
|
|
487
|
-
|
|
599
|
+
S && o.value && (S = !1, M({ restore: !0 }));
|
|
488
600
|
}
|
|
489
|
-
function
|
|
490
|
-
e.key !== "Escape" || !o.value || (e.preventDefault(), e.stopPropagation(),
|
|
601
|
+
function z(e) {
|
|
602
|
+
e.key !== "Escape" || !o.value || (e.preventDefault(), e.stopPropagation(), M({ restore: !0 }));
|
|
491
603
|
}
|
|
492
|
-
function
|
|
493
|
-
v?.visibilityState === "hidden" &&
|
|
604
|
+
function B() {
|
|
605
|
+
v?.visibilityState === "hidden" && M();
|
|
494
606
|
}
|
|
495
|
-
function
|
|
496
|
-
|
|
607
|
+
function V() {
|
|
608
|
+
M();
|
|
497
609
|
}
|
|
498
|
-
return
|
|
499
|
-
e &&
|
|
500
|
-
}), f(() =>
|
|
501
|
-
displayValue:
|
|
610
|
+
return C(() => E.value.disabled || E.value.readonly, (e) => {
|
|
611
|
+
e && M({ restore: !0 });
|
|
612
|
+
}), f(() => M()), {
|
|
613
|
+
displayValue: ee,
|
|
502
614
|
dragging: o,
|
|
503
615
|
editing: D,
|
|
504
|
-
handleInputBlur:
|
|
505
|
-
handleInputFocus:
|
|
616
|
+
handleInputBlur: O,
|
|
617
|
+
handleInputFocus: te,
|
|
506
618
|
handlePointerDown: (e) => {
|
|
507
619
|
if (e.button !== 0 || !e.isPrimary || E.value.disabled || D.value) return;
|
|
508
620
|
if (E.value.readonly) {
|
|
509
|
-
e.preventDefault(),
|
|
621
|
+
e.preventDefault(), k();
|
|
510
622
|
return;
|
|
511
623
|
}
|
|
512
624
|
if (e.pointerType === "touch") {
|
|
513
|
-
e.preventDefault(),
|
|
625
|
+
e.preventDefault(), k();
|
|
514
626
|
return;
|
|
515
627
|
}
|
|
516
628
|
let t = n.value;
|
|
517
|
-
t && (e.preventDefault(), c.value = !0, o.value = !1, _ += 1, l = e.pointerId, d = e.clientX, p = e.clientX, m = i.value.value,
|
|
629
|
+
t && (e.preventDefault(), c.value = !0, o.value = !1, _ += 1, l = e.pointerId, d = e.clientX, p = e.clientX, m = i.value.value, h = i.value.valueAsNumber, v = t.ownerDocument, y = v.defaultView, t.setPointerCapture?.(e.pointerId), v.addEventListener("pointermove", P), v.addEventListener("pointerup", I), v.addEventListener("pointercancel", L), v.addEventListener("pointerlockchange", R), v.addEventListener("keydown", z, !0), v.addEventListener("visibilitychange", B), y?.addEventListener("blur", V));
|
|
518
630
|
},
|
|
519
631
|
inputProps: E,
|
|
520
632
|
numberInput: i
|
|
521
633
|
};
|
|
522
|
-
},
|
|
634
|
+
}, ye = [
|
|
523
635
|
"data-edit-alignment",
|
|
524
636
|
"data-dragging",
|
|
525
637
|
"data-disabled",
|
|
526
638
|
"data-editing",
|
|
527
639
|
"data-readonly"
|
|
528
|
-
],
|
|
640
|
+
], be = {
|
|
529
641
|
"aria-hidden": "true",
|
|
530
642
|
class: "kappa-number-input__scrubbable-display",
|
|
531
643
|
"data-slot": "number-input-scrubbable-display"
|
|
532
|
-
},
|
|
644
|
+
}, xe = /* @__PURE__ */ o({
|
|
533
645
|
inheritAttrs: !1,
|
|
534
646
|
__name: "NumberInputScrubbableInput",
|
|
535
647
|
props: {
|
|
@@ -538,44 +650,44 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
538
650
|
scrubSensitivity: {}
|
|
539
651
|
},
|
|
540
652
|
setup(t) {
|
|
541
|
-
let o = t, s =
|
|
653
|
+
let o = t, s = x(), c = g(null), u = e(() => Number.isFinite(o.dragThreshold) && o.dragThreshold >= 0 ? o.dragThreshold : 10), d = e(() => se(o.editAlignment)), { displayValue: f, dragging: p, editing: h, handleInputBlur: y, handleInputFocus: S, handlePointerDown: C, inputProps: w, numberInput: T } = ve({
|
|
542
654
|
dragThreshold: u,
|
|
543
655
|
root: c,
|
|
544
656
|
scrubSensitivity: e(() => o.scrubSensitivity)
|
|
545
|
-
}),
|
|
546
|
-
return (e, t) => (
|
|
657
|
+
}), E = e(() => f.value === "" ? typeof s.placeholder == "string" ? s.placeholder : "" : f.value);
|
|
658
|
+
return (e, t) => (m(), n("div", {
|
|
547
659
|
ref_key: "root",
|
|
548
660
|
ref: c,
|
|
549
661
|
class: "kappa-number-input__scrubbable-input",
|
|
550
662
|
"data-slot": "number-input-scrubbable-input",
|
|
551
663
|
"data-edit-alignment": d.value,
|
|
552
|
-
"data-dragging":
|
|
553
|
-
"data-disabled":
|
|
554
|
-
"data-editing":
|
|
555
|
-
"data-readonly":
|
|
556
|
-
onPointerdown: t[0] ||= (...e) =>
|
|
557
|
-
}, [a(
|
|
664
|
+
"data-dragging": b(p) ? "" : void 0,
|
|
665
|
+
"data-disabled": b(w).disabled ? "" : void 0,
|
|
666
|
+
"data-editing": b(h) ? "" : void 0,
|
|
667
|
+
"data-readonly": b(w).readonly ? "" : void 0,
|
|
668
|
+
onPointerdown: t[0] ||= (...e) => b(C) && b(C)(...e)
|
|
669
|
+
}, [a(b(N).Input, l(e.$attrs, {
|
|
558
670
|
class: "kappa-number-input__input kappa-number-input__scrubbable-editor",
|
|
559
671
|
"data-slot": "number-input-input",
|
|
560
|
-
onBlur: y
|
|
561
|
-
onFocus:
|
|
562
|
-
}), null, 16, ["onBlur", "onFocus"]), r("span",
|
|
563
|
-
dragging:
|
|
564
|
-
editing:
|
|
565
|
-
value:
|
|
566
|
-
valueAsNumber:
|
|
567
|
-
}, () => [i(
|
|
672
|
+
onBlur: b(y),
|
|
673
|
+
onFocus: b(S)
|
|
674
|
+
}), null, 16, ["onBlur", "onFocus"]), r("span", be, [_(e.$slots, "default", {
|
|
675
|
+
dragging: b(p),
|
|
676
|
+
editing: b(h),
|
|
677
|
+
value: b(T).value,
|
|
678
|
+
valueAsNumber: b(T).valueAsNumber
|
|
679
|
+
}, () => [i(v(E.value), 1)])])], 40, ye));
|
|
568
680
|
}
|
|
569
|
-
}),
|
|
681
|
+
}), Se = /* @__PURE__ */ o({
|
|
570
682
|
inheritAttrs: !1,
|
|
571
683
|
__name: "NumberInputUnit",
|
|
572
684
|
setup(e) {
|
|
573
|
-
return (e, t) => (
|
|
685
|
+
return (e, t) => (m(), n("span", l(e.$attrs, {
|
|
574
686
|
class: "kappa-number-input__unit",
|
|
575
687
|
"data-slot": "number-input-unit"
|
|
576
|
-
}), [
|
|
688
|
+
}), [_(e.$slots, "default")], 16));
|
|
577
689
|
}
|
|
578
|
-
}),
|
|
690
|
+
}), Ce = /* @__PURE__ */ o({
|
|
579
691
|
inheritAttrs: !1,
|
|
580
692
|
__name: "NumberInputValueText",
|
|
581
693
|
props: { asChild: {
|
|
@@ -583,34 +695,34 @@ var M = Symbol("kappa-number-input-scrub-steps"), N = (e, t) => typeof e == "num
|
|
|
583
695
|
default: void 0
|
|
584
696
|
} },
|
|
585
697
|
setup(n) {
|
|
586
|
-
let r = n, a =
|
|
587
|
-
return (e, n) => (
|
|
698
|
+
let r = n, a = F(), o = e(() => a.value.value), s = e(() => a.value.valueAsNumber);
|
|
699
|
+
return (e, n) => (m(), t(b(N).ValueText, l(e.$attrs, {
|
|
588
700
|
class: "kappa-number-input__value-text",
|
|
589
701
|
"data-slot": "number-input-value-text",
|
|
590
702
|
"as-child": r.asChild
|
|
591
703
|
}), {
|
|
592
|
-
default:
|
|
704
|
+
default: w(() => [_(e.$slots, "default", {
|
|
593
705
|
value: o.value,
|
|
594
706
|
valueAsNumber: s.value
|
|
595
|
-
}, () => [i(
|
|
707
|
+
}, () => [i(v(o.value), 1)])]),
|
|
596
708
|
_: 3
|
|
597
709
|
}, 16, ["as-child"]));
|
|
598
710
|
}
|
|
599
|
-
}),
|
|
600
|
-
Root:
|
|
601
|
-
RootProvider:
|
|
602
|
-
Label:
|
|
603
|
-
Control:
|
|
604
|
-
Input:
|
|
605
|
-
ValueText:
|
|
606
|
-
IncrementTrigger:
|
|
607
|
-
DecrementTrigger:
|
|
608
|
-
Scrubber:
|
|
609
|
-
ScrubbableInput:
|
|
610
|
-
Unit:
|
|
611
|
-
Context:
|
|
711
|
+
}), we = Object.assign(Q, {
|
|
712
|
+
Root: Q,
|
|
713
|
+
RootProvider: Z,
|
|
714
|
+
Label: me,
|
|
715
|
+
Control: ue,
|
|
716
|
+
Input: pe,
|
|
717
|
+
ValueText: Ce,
|
|
718
|
+
IncrementTrigger: fe,
|
|
719
|
+
DecrementTrigger: de,
|
|
720
|
+
Scrubber: he,
|
|
721
|
+
ScrubbableInput: xe,
|
|
722
|
+
Unit: Se,
|
|
723
|
+
Context: le
|
|
612
724
|
});
|
|
613
725
|
//#endregion
|
|
614
|
-
export {
|
|
726
|
+
export { ae as C, se as S, q as _, Se as a, oe as b, me as c, de as d, ue as f, Y as g, Z as h, Ce as i, pe as l, Q as m, P as n, xe as o, le as p, I as r, he as s, we as t, fe as u, J as v, V as w, X as x, K as y };
|
|
615
727
|
|
|
616
|
-
//# sourceMappingURL=number-input-
|
|
728
|
+
//# sourceMappingURL=number-input-B3Xkb5sT.js.map
|