@youcan/celeste 0.6.38 → 0.6.39
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/dist/celeste.css +70 -0
- package/dist/cjs/chunks/index.js +203 -1
- package/dist/cjs/chunks/index2.js +35 -1448
- package/dist/cjs/chunks/index3.js +1336 -16336
- package/dist/cjs/chunks/index4.js +16457 -0
- package/dist/cjs/digit-input-group.js +31 -0
- package/dist/cjs/digit-input-slot.js +28 -0
- package/dist/cjs/digit-input.js +46 -0
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/link-bubble.js +1 -1
- package/dist/cjs/rich-editor.js +1 -1
- package/dist/components/digit-input/digit-input-group.d.ts +22 -0
- package/dist/components/digit-input/digit-input-slot.d.ts +7 -0
- package/dist/components/digit-input/digit-input.d.ts +32 -0
- package/dist/components/digit-input/index.d.ts +6 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/es/chunks/index.js +241 -39
- package/dist/es/chunks/index2.js +36 -1448
- package/dist/es/chunks/index3.js +1335 -16336
- package/dist/es/chunks/index4.js +16458 -0
- package/dist/es/digit-input-group.js +32 -0
- package/dist/es/digit-input-slot.js +29 -0
- package/dist/es/digit-input.js +47 -0
- package/dist/es/dropdown-menu-content.js +1 -1
- package/dist/es/dropdown-menu-group.js +1 -1
- package/dist/es/dropdown-menu-item.js +1 -1
- package/dist/es/dropdown-menu-label.js +1 -1
- package/dist/es/dropdown-menu-separator.js +1 -1
- package/dist/es/dropdown-menu-sub-content.js +1 -1
- package/dist/es/dropdown-menu-sub-trigger.js +1 -1
- package/dist/es/dropdown-menu-trigger.js +1 -1
- package/dist/es/dropdown-menu.js +1 -1
- package/dist/es/index.js +9 -0
- package/dist/es/link-bubble.js +1 -1
- package/dist/es/modal-content.js +1 -1
- package/dist/es/modal-header.js +1 -1
- package/dist/es/popover-content.js +1 -1
- package/dist/es/popover-trigger.js +1 -1
- package/dist/es/progress-bar.js +1 -1
- package/dist/es/progress-circle.js +1 -1
- package/dist/es/rich-editor.js +1 -1
- package/dist/es/select-content.js +1 -1
- package/dist/es/select-item.js +1 -1
- package/dist/es/select-trigger.js +1 -1
- package/dist/es/select-value.js +1 -1
- package/dist/es/tooltip.js +1 -1
- package/package.json +4 -3
- package/src/components/digit-input/digit-input-group.vue +24 -0
- package/src/components/digit-input/digit-input-slot.vue +86 -0
- package/src/components/digit-input/digit-input.vue +37 -0
- package/src/components/digit-input/index.ts +8 -0
- package/src/components/digit-input/stories/digit-input.stories.ts +220 -0
- package/src/components/index.ts +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const clsx = require("./chunks/clsx.js");
|
|
4
|
+
const index$1 = require("./chunks/index.js");
|
|
5
|
+
const index = require("./chunks/index2.js");
|
|
6
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
8
|
+
__name: "digit-input-group",
|
|
9
|
+
props: {
|
|
10
|
+
asChild: { type: Boolean },
|
|
11
|
+
as: {},
|
|
12
|
+
class: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const delegatedProps = index.reactiveOmit(props, "class");
|
|
17
|
+
const forwardedProps = index$1.At(delegatedProps);
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(index$1.O), Mo.mergeProps(Mo.unref(forwardedProps), {
|
|
20
|
+
class: Mo.unref(clsx.clsx)("celeste-digit-input-group", props.class)
|
|
21
|
+
}), {
|
|
22
|
+
default: Mo.withCtx(() => [
|
|
23
|
+
Mo.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
24
|
+
]),
|
|
25
|
+
_: 3
|
|
26
|
+
}, 16, ["class"]);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const digitInputGroup = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-1a28428d"]]);
|
|
31
|
+
module.exports = digitInputGroup;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const clsx = require("./chunks/clsx.js");
|
|
4
|
+
const index$1 = require("./chunks/index.js");
|
|
5
|
+
const index = require("./chunks/index2.js");
|
|
6
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
8
|
+
__name: "digit-input-slot",
|
|
9
|
+
props: {
|
|
10
|
+
index: {},
|
|
11
|
+
disabled: { type: Boolean },
|
|
12
|
+
asChild: { type: Boolean },
|
|
13
|
+
as: {},
|
|
14
|
+
class: {}
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const delegatedProps = index.reactiveOmit(props, "class");
|
|
19
|
+
const forwardedProps = index$1.At(delegatedProps);
|
|
20
|
+
return (_ctx, _cache) => {
|
|
21
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(index$1.$y), Mo.mergeProps(Mo.unref(forwardedProps), {
|
|
22
|
+
class: Mo.unref(clsx.clsx)("celeste-digit-input-slot", props.class)
|
|
23
|
+
}), null, 16, ["class"]);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const digitInputSlot = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-5b5299e2"]]);
|
|
28
|
+
module.exports = digitInputSlot;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const clsx = require("./chunks/clsx.js");
|
|
4
|
+
const index$1 = require("./chunks/index.js");
|
|
5
|
+
const index = require("./chunks/index2.js");
|
|
6
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
8
|
+
__name: "digit-input",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: { default: () => [] },
|
|
11
|
+
defaultValue: {},
|
|
12
|
+
placeholder: {},
|
|
13
|
+
mask: { type: Boolean },
|
|
14
|
+
otp: { type: Boolean },
|
|
15
|
+
type: {},
|
|
16
|
+
dir: {},
|
|
17
|
+
name: {},
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
required: { type: Boolean },
|
|
20
|
+
id: {},
|
|
21
|
+
asChild: { type: Boolean },
|
|
22
|
+
as: {},
|
|
23
|
+
class: {},
|
|
24
|
+
hasError: { type: Boolean, default: false }
|
|
25
|
+
},
|
|
26
|
+
emits: ["update:modelValue", "complete"],
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const emits = __emit;
|
|
30
|
+
const delegatedProps = index.reactiveOmit(props, "class", "hasError");
|
|
31
|
+
const forwarded = index$1.xe(delegatedProps, emits);
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(index$1.Dy), Mo.mergeProps(Mo.unref(forwarded), {
|
|
34
|
+
class: Mo.unref(clsx.clsx)("celeste-digit-input", props.class),
|
|
35
|
+
"data-error": _ctx.hasError
|
|
36
|
+
}), {
|
|
37
|
+
default: Mo.withCtx(() => [
|
|
38
|
+
Mo.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
39
|
+
]),
|
|
40
|
+
_: 3
|
|
41
|
+
}, 16, ["class", "data-error"]);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const digitInput = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-be93d7bf"]]);
|
|
46
|
+
module.exports = digitInput;
|
package/dist/cjs/index.js
CHANGED
|
@@ -21,6 +21,9 @@ const comboboxSeparator = require("./combobox-separator.js");
|
|
|
21
21
|
const comboboxTrigger = require("./combobox-trigger.js");
|
|
22
22
|
const combobox = require("./combobox.js");
|
|
23
23
|
const contentDivider_vue_vue_type_style_index_0_lang = require("./chunks/content-divider.vue_vue_type_style_index_0_lang.js");
|
|
24
|
+
const digitInputGroup = require("./digit-input-group.js");
|
|
25
|
+
const digitInputSlot = require("./digit-input-slot.js");
|
|
26
|
+
const digitInput = require("./digit-input.js");
|
|
24
27
|
const contextMenuItem = require("./context-menu-item.js");
|
|
25
28
|
const dropdownItem = require("./dropdown-item.js");
|
|
26
29
|
const dropdown = require("./dropdown.js");
|
|
@@ -97,6 +100,9 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
97
100
|
CompactButton: compactButton,
|
|
98
101
|
ContentDivider: contentDivider_vue_vue_type_style_index_0_lang._sfc_main,
|
|
99
102
|
ContextMenuItem: contextMenuItem,
|
|
103
|
+
DigitInput: digitInput,
|
|
104
|
+
DigitInputGroup: digitInputGroup,
|
|
105
|
+
DigitInputSlot: digitInputSlot,
|
|
100
106
|
Dropdown: dropdown,
|
|
101
107
|
DropdownItem: dropdownItem,
|
|
102
108
|
DropdownMenu: dropdownMenu,
|
|
@@ -231,6 +237,9 @@ exports.ComboboxSeparator = comboboxSeparator;
|
|
|
231
237
|
exports.ComboboxTrigger = comboboxTrigger;
|
|
232
238
|
exports.Combobox = combobox;
|
|
233
239
|
exports.ContentDivider = contentDivider_vue_vue_type_style_index_0_lang._sfc_main;
|
|
240
|
+
exports.DigitInputGroup = digitInputGroup;
|
|
241
|
+
exports.DigitInputSlot = digitInputSlot;
|
|
242
|
+
exports.DigitInput = digitInput;
|
|
234
243
|
exports.ContextMenuItem = contextMenuItem;
|
|
235
244
|
exports.DropdownItem = dropdownItem;
|
|
236
245
|
exports.Dropdown = dropdown;
|
package/dist/cjs/link-bubble.js
CHANGED
|
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
29
29
|
const props = __props;
|
|
30
30
|
const emit = __emit;
|
|
31
31
|
const BubbleMenu = Mo.defineAsyncComponent(
|
|
32
|
-
() => Promise.resolve().then(() => require("./chunks/
|
|
32
|
+
() => Promise.resolve().then(() => require("./chunks/index3.js")).then((m) => m.BubbleMenu)
|
|
33
33
|
);
|
|
34
34
|
const href = Mo.ref("");
|
|
35
35
|
const openInNewTab = Mo.ref(false);
|
package/dist/cjs/rich-editor.js
CHANGED
|
@@ -8,7 +8,7 @@ const selectTrigger = require("./select-trigger.js");
|
|
|
8
8
|
const selectValue = require("./select-value.js");
|
|
9
9
|
const select_vue_vue_type_script_setup_true_lang = require("./chunks/select.js");
|
|
10
10
|
const tooltip = require("./tooltip.js");
|
|
11
|
-
const index = require("./chunks/
|
|
11
|
+
const index = require("./chunks/index4.js");
|
|
12
12
|
const config = require("./config.js");
|
|
13
13
|
const extraSettings = require("./extra-settings.js");
|
|
14
14
|
const linkBubble = require("./link-bubble.js");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { PrimitiveProps } from 'radix-vue';
|
|
3
|
+
type __VLS_Props = PrimitiveProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { PinInputInputProps } from 'radix-vue';
|
|
3
|
+
type __VLS_Props = PinInputInputProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { PinInputRootProps } from 'radix-vue';
|
|
3
|
+
type __VLS_Props = PinInputRootProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
hasError?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: string[]) => any;
|
|
18
|
+
complete: (value: string[]) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
21
|
+
onComplete?: ((value: string[]) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
modelValue: string[];
|
|
24
|
+
hasError: boolean;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './digit-input-group';
|
|
2
|
+
export { default as DigitInputGroup } from './digit-input-group';
|
|
3
|
+
export * from './digit-input-slot';
|
|
4
|
+
export { default as DigitInputSlot } from './digit-input-slot';
|
|
5
|
+
export * from './digit-input';
|
|
6
|
+
export { default as DigitInput } from './digit-input';
|
package/dist/es/chunks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Mo from "vue";
|
|
2
|
-
import { computed, ref, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, unref, getCurrentInstance, toRef, camelize, defineComponent, Comment, mergeProps, cloneVNode, h, toRefs, renderSlot, onMounted, openBlock, createBlock, withCtx, normalizeProps, guardReactiveProps, reactive, createVNode, createCommentVNode, createElementBlock, Fragment, withKeys, withModifiers, watchEffect, markRaw, nextTick, watchSyncEffect, withDirectives, vShow, createTextVNode, toDisplayString, isRef,
|
|
2
|
+
import { computed, ref, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, unref, getCurrentInstance, toRef, camelize, defineComponent, Comment, mergeProps, cloneVNode, h, toRefs, renderSlot, onMounted, openBlock, createBlock, withCtx, normalizeProps, guardReactiveProps, reactive, createVNode, createCommentVNode, createElementBlock, Fragment, withKeys, withModifiers, watchEffect, markRaw, nextTick, watchSyncEffect, withDirectives, vShow, createTextVNode, toDisplayString, isRef, createElementVNode, onUnmounted, resolveDynamicComponent, normalizeStyle, renderList, Teleport, onBeforeUnmount, useSlots, onBeforeMount, toHandlers, effectScope, readonly, toHandlerKey, vModelSelect, toRaw, inject, provide, customRef, onBeforeUpdate, onUpdated, mergeDefaults, watchPostEffect } from "vue";
|
|
3
3
|
const sides = ["top", "right", "bottom", "left"];
|
|
4
4
|
const alignments = ["start", "end"];
|
|
5
5
|
const placements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
@@ -6085,7 +6085,207 @@ const Oh = /* @__PURE__ */ defineComponent({
|
|
|
6085
6085
|
}, 16));
|
|
6086
6086
|
}
|
|
6087
6087
|
});
|
|
6088
|
-
const [
|
|
6088
|
+
const Gc = ["id", "value", "name", "disabled", "required"], [qc, Yc] = Q("PinInputRoot"), Dy = /* @__PURE__ */ defineComponent({
|
|
6089
|
+
inheritAttrs: false,
|
|
6090
|
+
__name: "PinInputRoot",
|
|
6091
|
+
props: {
|
|
6092
|
+
modelValue: {},
|
|
6093
|
+
defaultValue: {},
|
|
6094
|
+
placeholder: { default: "" },
|
|
6095
|
+
mask: { type: Boolean },
|
|
6096
|
+
otp: { type: Boolean },
|
|
6097
|
+
type: { default: "text" },
|
|
6098
|
+
dir: {},
|
|
6099
|
+
name: {},
|
|
6100
|
+
disabled: { type: Boolean },
|
|
6101
|
+
required: { type: Boolean },
|
|
6102
|
+
id: {},
|
|
6103
|
+
asChild: { type: Boolean },
|
|
6104
|
+
as: {}
|
|
6105
|
+
},
|
|
6106
|
+
emits: ["update:modelValue", "complete"],
|
|
6107
|
+
setup(a2, { emit: t }) {
|
|
6108
|
+
const e = a2, n = t, { mask: l, otp: s, placeholder: r, type: i, disabled: u, dir: d } = toRefs(e), { forwardRef: c } = R(), f = be(d), v = ne(e, "modelValue", n, {
|
|
6109
|
+
defaultValue: e.defaultValue ?? [],
|
|
6110
|
+
passive: e.modelValue === void 0
|
|
6111
|
+
}), p = ref(/* @__PURE__ */ new Set());
|
|
6112
|
+
function g(_) {
|
|
6113
|
+
p.value.add(_);
|
|
6114
|
+
}
|
|
6115
|
+
const m = computed(() => v.value.filter((C) => !!C).length === p.value.size);
|
|
6116
|
+
return watch(v, () => {
|
|
6117
|
+
m.value && n("complete", v.value);
|
|
6118
|
+
}, { deep: true }), Yc({
|
|
6119
|
+
modelValue: v,
|
|
6120
|
+
mask: l,
|
|
6121
|
+
otp: s,
|
|
6122
|
+
placeholder: r,
|
|
6123
|
+
type: i,
|
|
6124
|
+
dir: f,
|
|
6125
|
+
disabled: u,
|
|
6126
|
+
isCompleted: m,
|
|
6127
|
+
inputElements: p,
|
|
6128
|
+
onInputElementChange: g
|
|
6129
|
+
}), (_, C) => (openBlock(), createElementBlock(Fragment, null, [
|
|
6130
|
+
createVNode(unref(O), mergeProps(_.$attrs, {
|
|
6131
|
+
ref: unref(c),
|
|
6132
|
+
dir: unref(f),
|
|
6133
|
+
"data-complete": m.value ? "" : void 0,
|
|
6134
|
+
"data-disabled": unref(u) ? "" : void 0
|
|
6135
|
+
}), {
|
|
6136
|
+
default: withCtx(() => [
|
|
6137
|
+
renderSlot(_.$slots, "default", { modelValue: unref(v) })
|
|
6138
|
+
]),
|
|
6139
|
+
_: 3
|
|
6140
|
+
}, 16, ["dir", "data-complete", "data-disabled"]),
|
|
6141
|
+
createElementVNode("input", {
|
|
6142
|
+
id: _.id,
|
|
6143
|
+
type: "text",
|
|
6144
|
+
tabindex: "-1",
|
|
6145
|
+
"aria-hidden": "true",
|
|
6146
|
+
value: unref(v).join(""),
|
|
6147
|
+
name: _.name,
|
|
6148
|
+
disabled: unref(u),
|
|
6149
|
+
required: _.required,
|
|
6150
|
+
style: {
|
|
6151
|
+
transform: "translateX(-100%)",
|
|
6152
|
+
position: "absolute",
|
|
6153
|
+
pointerEvents: "none",
|
|
6154
|
+
opacity: 0,
|
|
6155
|
+
margin: 0
|
|
6156
|
+
},
|
|
6157
|
+
onFocus: C[0] || (C[0] = ($) => {
|
|
6158
|
+
var h2, E;
|
|
6159
|
+
return (E = (h2 = Array.from(p.value)) == null ? void 0 : h2[0]) == null ? void 0 : E.focus();
|
|
6160
|
+
})
|
|
6161
|
+
}, null, 40, Gc)
|
|
6162
|
+
], 64));
|
|
6163
|
+
}
|
|
6164
|
+
}), $y = /* @__PURE__ */ defineComponent({
|
|
6165
|
+
__name: "PinInputInput",
|
|
6166
|
+
props: {
|
|
6167
|
+
index: {},
|
|
6168
|
+
disabled: { type: Boolean },
|
|
6169
|
+
asChild: { type: Boolean },
|
|
6170
|
+
as: { default: "input" }
|
|
6171
|
+
},
|
|
6172
|
+
setup(a2) {
|
|
6173
|
+
const t = a2, e = qc(), n = computed(() => Array.from(e.inputElements.value)), l = computed(() => e.modelValue.value[t.index]), s = computed(() => t.disabled || e.disabled.value), r = computed(() => e.otp.value), i = computed(() => e.type.value === "number"), u = computed(() => e.mask.value), { primitiveElement: d, currentElement: c } = Ie();
|
|
6174
|
+
function f(D) {
|
|
6175
|
+
var V;
|
|
6176
|
+
const I = D.target;
|
|
6177
|
+
if ((((V = D.data) == null ? void 0 : V.length) ?? 0) > 1) {
|
|
6178
|
+
h2(I.value);
|
|
6179
|
+
return;
|
|
6180
|
+
}
|
|
6181
|
+
if (i.value && !/^\d*$/.test(I.value)) {
|
|
6182
|
+
I.value = I.value.replace(/\D/g, "");
|
|
6183
|
+
return;
|
|
6184
|
+
}
|
|
6185
|
+
I.value = I.value.slice(-1), P(t.index, I.value);
|
|
6186
|
+
const M = n.value[t.index + 1];
|
|
6187
|
+
M && M.focus();
|
|
6188
|
+
}
|
|
6189
|
+
function v() {
|
|
6190
|
+
const D = c.value;
|
|
6191
|
+
nextTick(() => {
|
|
6192
|
+
D.value || (D.placeholder = e.placeholder.value);
|
|
6193
|
+
});
|
|
6194
|
+
}
|
|
6195
|
+
function p(D) {
|
|
6196
|
+
Rt(D, document.activeElement, void 0, {
|
|
6197
|
+
itemsArray: n.value,
|
|
6198
|
+
focus: true,
|
|
6199
|
+
loop: false,
|
|
6200
|
+
arrowKeyOptions: "horizontal",
|
|
6201
|
+
dir: e.dir.value
|
|
6202
|
+
});
|
|
6203
|
+
}
|
|
6204
|
+
function g(D) {
|
|
6205
|
+
if (D.preventDefault(), D.target.value)
|
|
6206
|
+
P(t.index, "");
|
|
6207
|
+
else {
|
|
6208
|
+
const V = n.value[t.index - 1];
|
|
6209
|
+
V && (V.focus(), P(t.index - 1, ""));
|
|
6210
|
+
}
|
|
6211
|
+
}
|
|
6212
|
+
function m(D) {
|
|
6213
|
+
D.key === "Delete" && (D.preventDefault(), P(t.index, ""));
|
|
6214
|
+
}
|
|
6215
|
+
function _(D) {
|
|
6216
|
+
const I = D.target;
|
|
6217
|
+
I.setSelectionRange(1, 1), I.value || (I.placeholder = "");
|
|
6218
|
+
}
|
|
6219
|
+
function C(D) {
|
|
6220
|
+
v();
|
|
6221
|
+
}
|
|
6222
|
+
function $(D) {
|
|
6223
|
+
D.preventDefault();
|
|
6224
|
+
const I = D.clipboardData;
|
|
6225
|
+
if (!I)
|
|
6226
|
+
return;
|
|
6227
|
+
const M = I.getData("text");
|
|
6228
|
+
h2(M);
|
|
6229
|
+
}
|
|
6230
|
+
function h2(D) {
|
|
6231
|
+
var A;
|
|
6232
|
+
const I = [...e.modelValue.value], M = D.length >= n.value.length ? 0 : t.index, V = Math.min(M + D.length, n.value.length);
|
|
6233
|
+
for (let F = M; F < V; F++) {
|
|
6234
|
+
const j = n.value[F], W = D[F - M];
|
|
6235
|
+
i.value && !/^\d*$/.test(W) || (I[F] = W, j.focus());
|
|
6236
|
+
}
|
|
6237
|
+
e.modelValue.value = I, (A = n.value[V]) == null || A.focus();
|
|
6238
|
+
}
|
|
6239
|
+
function E(D) {
|
|
6240
|
+
let I = D.length - 1;
|
|
6241
|
+
for (; I >= 0 && D[I] === ""; )
|
|
6242
|
+
D.pop(), I--;
|
|
6243
|
+
return D;
|
|
6244
|
+
}
|
|
6245
|
+
function P(D, I) {
|
|
6246
|
+
const M = [...e.modelValue.value];
|
|
6247
|
+
M[D] = I, e.modelValue.value = E(M);
|
|
6248
|
+
}
|
|
6249
|
+
return watch(l, () => {
|
|
6250
|
+
l.value || v();
|
|
6251
|
+
}), onMounted(() => {
|
|
6252
|
+
e.onInputElementChange(c.value);
|
|
6253
|
+
}), onUnmounted(() => {
|
|
6254
|
+
var D;
|
|
6255
|
+
(D = e.inputElements) == null || D.value.delete(c.value);
|
|
6256
|
+
}), (D, I) => (openBlock(), createBlock(unref(O), {
|
|
6257
|
+
ref_key: "primitiveElement",
|
|
6258
|
+
ref: d,
|
|
6259
|
+
autocapitalize: "none",
|
|
6260
|
+
as: D.as,
|
|
6261
|
+
"as-child": D.asChild,
|
|
6262
|
+
autocomplete: r.value ? "one-time-code" : "false",
|
|
6263
|
+
type: u.value ? "password" : "text",
|
|
6264
|
+
inputmode: i.value ? "numeric" : "text",
|
|
6265
|
+
pattern: i.value ? "[0-9]*" : void 0,
|
|
6266
|
+
placeholder: unref(e).placeholder.value,
|
|
6267
|
+
value: l.value,
|
|
6268
|
+
disabled: s.value,
|
|
6269
|
+
"data-disabled": s.value ? "" : void 0,
|
|
6270
|
+
"data-complete": unref(e).isCompleted.value ? "" : void 0,
|
|
6271
|
+
"aria-label": `pin input ${D.index + 1} of ${n.value.length}`,
|
|
6272
|
+
onInput: I[0] || (I[0] = (M) => f(M)),
|
|
6273
|
+
onKeydown: [
|
|
6274
|
+
withKeys(p, ["left", "right", "up", "down", "home", "end"]),
|
|
6275
|
+
withKeys(g, ["backspace"]),
|
|
6276
|
+
withKeys(m, ["delete"])
|
|
6277
|
+
],
|
|
6278
|
+
onFocus: _,
|
|
6279
|
+
onBlur: C,
|
|
6280
|
+
onPaste: $
|
|
6281
|
+
}, {
|
|
6282
|
+
default: withCtx(() => [
|
|
6283
|
+
renderSlot(D.$slots, "default")
|
|
6284
|
+
]),
|
|
6285
|
+
_: 3
|
|
6286
|
+
}, 8, ["as", "as-child", "autocomplete", "type", "inputmode", "pattern", "placeholder", "value", "disabled", "data-disabled", "data-complete", "aria-label"]));
|
|
6287
|
+
}
|
|
6288
|
+
}), [Nt, Xc] = Q("PopoverRoot"), ys = /* @__PURE__ */ defineComponent({
|
|
6089
6289
|
__name: "PopoverRoot",
|
|
6090
6290
|
props: {
|
|
6091
6291
|
defaultOpen: { type: Boolean, default: false },
|
|
@@ -9315,43 +9515,45 @@ export {
|
|
|
9315
9515
|
Zv as Z,
|
|
9316
9516
|
tm as _,
|
|
9317
9517
|
Gl as a,
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9518
|
+
$y as a0,
|
|
9519
|
+
Dy as a1,
|
|
9520
|
+
ih as a2,
|
|
9521
|
+
uh as a3,
|
|
9522
|
+
fh as a4,
|
|
9523
|
+
ch as a5,
|
|
9524
|
+
hh as a6,
|
|
9525
|
+
ph as a7,
|
|
9526
|
+
Ch as a8,
|
|
9527
|
+
wh as a9,
|
|
9528
|
+
jg as aA,
|
|
9529
|
+
Hg as aB,
|
|
9530
|
+
Wg as aC,
|
|
9531
|
+
rh as aa,
|
|
9532
|
+
sh as ab,
|
|
9533
|
+
Dv as ac,
|
|
9534
|
+
Eu as ad,
|
|
9535
|
+
xu as ae,
|
|
9536
|
+
Pu as af,
|
|
9537
|
+
Du as ag,
|
|
9538
|
+
bs as ah,
|
|
9539
|
+
ws as ai,
|
|
9540
|
+
_s as aj,
|
|
9541
|
+
xs as ak,
|
|
9542
|
+
gs as al,
|
|
9543
|
+
By as am,
|
|
9544
|
+
Iy as an,
|
|
9545
|
+
zy as ao,
|
|
9546
|
+
Ky as ap,
|
|
9547
|
+
Xy as aq,
|
|
9548
|
+
jy as ar,
|
|
9549
|
+
Yy as as,
|
|
9550
|
+
Uy as at,
|
|
9551
|
+
Ly as au,
|
|
9552
|
+
eg as av,
|
|
9553
|
+
Qy as aw,
|
|
9554
|
+
Lg as ax,
|
|
9555
|
+
zg as ay,
|
|
9556
|
+
Kg as az,
|
|
9355
9557
|
bh as b,
|
|
9356
9558
|
tg as c,
|
|
9357
9559
|
ag as d,
|