@nmorph/nmorph-ui-kit 2.2.35 → 2.2.36
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/assets/icons/baseball.svg.js +28 -0
- package/dist/assets/icons/basketball.svg.js +21 -0
- package/dist/assets/icons/bowl.svg.js +21 -0
- package/dist/assets/icons/box.svg.js +35 -0
- package/dist/assets/icons/briefcase.svg.js +21 -0
- package/dist/assets/icons/brush-filled.svg.js +21 -0
- package/dist/assets/icons/brush.svg.js +21 -0
- package/dist/assets/icons/camera-filled.svg.js +21 -0
- package/dist/assets/icons/chevron-double-left.svg.js +28 -0
- package/dist/assets/icons/chevron-double-right.svg.js +28 -0
- package/dist/assets/icons/chevron-double-up.svg.js +28 -0
- package/dist/assets/icons/chevron-left.svg.js +21 -0
- package/dist/assets/icons/chevron-right.svg.js +21 -0
- package/dist/assets/icons/chevron-up.svg.js +21 -0
- package/dist/assets/icons/chicken.svg.js +21 -0
- package/dist/assets/icons/clipboard-check.svg.js +25 -0
- package/dist/assets/icons/clipboard.svg.js +25 -0
- package/dist/assets/icons/close-bold.svg.js +21 -0
- package/dist/assets/icons/cold-drink.svg.js +21 -0
- package/dist/assets/icons/comment.svg.js +21 -0
- package/dist/assets/icons/database.svg.js +25 -0
- package/dist/assets/icons/drag-handle.svg.js +21 -0
- package/dist/assets/icons/external-link.svg.js +28 -0
- package/dist/assets/icons/filter-off.svg.js +28 -0
- package/dist/assets/icons/fingerprint.svg.js +44 -0
- package/dist/assets/icons/folder-remove.svg.js +21 -0
- package/dist/assets/icons/goblet.svg.js +21 -0
- package/dist/assets/icons/ice-tea.svg.js +21 -0
- package/dist/assets/icons/inbox.svg.js +25 -0
- package/dist/assets/icons/mail.svg.js +25 -0
- package/dist/assets/icons/odometer.svg.js +35 -0
- package/dist/assets/icons/open.svg.js +28 -0
- package/dist/assets/icons/pagination.svg.js +8 -0
- package/dist/assets/icons/redo.svg.js +21 -0
- package/dist/assets/icons/save.svg.js +25 -0
- package/dist/assets/icons/server.svg.js +32 -0
- package/dist/assets/icons/shield-check.svg.js +25 -0
- package/dist/assets/icons/shield.svg.js +25 -0
- package/dist/assets/icons/sliders.svg.js +31 -0
- package/dist/assets/icons/stopwatch.svg.js +28 -0
- package/dist/assets/icons/suitcase-line.svg.js +22 -0
- package/dist/assets/icons/undo.svg.js +21 -0
- package/dist/assets/icons/video-camera.svg.js +21 -0
- package/dist/components/basic/nmorph-button/NmorphButton.vue.js +10 -10
- package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +5 -5
- package/dist/components/basic/nmorph-icon/NmorphIcons.js +617 -529
- package/dist/components/basic/nmorph-layout/NmorphLayout.css +1 -0
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +50 -0
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +28 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.css +1 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +21 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +45 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +15 -15
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +31 -31
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +36 -38
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.css +1 -0
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue.js +59 -0
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +50 -0
- package/dist/components/data/nmorph-qr-code/qr-code.js +568 -0
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.css +1 -0
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue.js +86 -0
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +60 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.css +1 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +81 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +47 -0
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -30
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +57 -54
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.js +13 -13
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +28 -27
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.js +16 -16
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue2.js +20 -17
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue.js +21 -21
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +92 -84
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +5 -5
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +1 -1
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +1 -1
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +16 -16
- package/dist/components/form/nmorph-textarea/NmorphTextarea.css +1 -0
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +41 -0
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +67 -0
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +38 -28
- package/dist/icons.js +621 -533
- package/dist/index.es.js +780 -678
- package/dist/index.umd.js +27 -27
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/index.d.ts +2 -0
- package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +48 -3
- package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +22 -0
- package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +33 -0
- package/dist/src/components/data/index.d.ts +4 -0
- package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +34 -0
- package/dist/src/components/data/nmorph-qr-code/qr-code.d.ts +12 -0
- package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +46 -0
- package/dist/src/components/data/nmorph-virtual-list/types.d.ts +4 -0
- package/dist/src/components/feedback/index.d.ts +1 -0
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +40 -0
- package/dist/src/components/form/index.d.ts +1 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +48 -0
- package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import './NmorphYearMonthPicker.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import l from "./NmorphYearMonthPicker.vue2.js";
|
|
3
|
+
import { openBlock as i, createElementBlock as m, normalizeClass as c, createElementVNode as a, createVNode as e, withCtx as n } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
function _(k, r,
|
|
8
|
-
return
|
|
5
|
+
import d from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const h = { class: "nmorph-year-month-picker__header" }, p = { class: "nmorph-year-month-picker__value" }, s = { class: "nmorph-year-month-picker__values" };
|
|
7
|
+
function _(k, r, f, o, v, N) {
|
|
8
|
+
return i(), m(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
class: c(o.modifiers)
|
|
12
12
|
},
|
|
13
13
|
[
|
|
14
|
-
|
|
14
|
+
a("div", h, [
|
|
15
15
|
e(o.NmorphButton, {
|
|
16
16
|
class: "nmorph-year-month-picker__action-btn",
|
|
17
17
|
tabindex: -1,
|
|
18
|
-
onClick: r[0] || (r[0] = (
|
|
18
|
+
onClick: r[0] || (r[0] = (t) => o.buttonClickHandler("decrease"))
|
|
19
19
|
}, {
|
|
20
20
|
default: n(() => [
|
|
21
21
|
e(o.NmorphIcon, { class: "nmorph-year-month-picker__chevron-left" }, {
|
|
@@ -29,7 +29,7 @@ function _(k, r, v, o, f, N) {
|
|
|
29
29
|
_: 1
|
|
30
30
|
/* STABLE */
|
|
31
31
|
}),
|
|
32
|
-
|
|
32
|
+
a("div", p, [
|
|
33
33
|
e(o.NmorphButton, {
|
|
34
34
|
text: o.value,
|
|
35
35
|
tabindex: -1,
|
|
@@ -40,7 +40,7 @@ function _(k, r, v, o, f, N) {
|
|
|
40
40
|
e(o.NmorphButton, {
|
|
41
41
|
class: "nmorph-year-month-picker__action-btn",
|
|
42
42
|
tabindex: -1,
|
|
43
|
-
onClick: r[1] || (r[1] = (
|
|
43
|
+
onClick: r[1] || (r[1] = (t) => o.buttonClickHandler("increase"))
|
|
44
44
|
}, {
|
|
45
45
|
default: n(() => [
|
|
46
46
|
e(o.NmorphIcon, { class: "nmorph-year-month-picker__chevron-right" }, {
|
|
@@ -56,19 +56,19 @@ function _(k, r, v, o, f, N) {
|
|
|
56
56
|
})
|
|
57
57
|
]),
|
|
58
58
|
e(o.NmorphDivider),
|
|
59
|
-
|
|
59
|
+
a("div", s, [
|
|
60
60
|
e(o.NmorphRadioGroup, {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, null, 8, ["
|
|
61
|
+
modelValue: o.selectedValueModel,
|
|
62
|
+
"onUpdate:modelValue": r[2] || (r[2] = (t) => o.selectedValueModel = t),
|
|
63
|
+
options: o.values
|
|
64
|
+
}, null, 8, ["modelValue", "options"])
|
|
65
65
|
])
|
|
66
66
|
],
|
|
67
67
|
2
|
|
68
68
|
/* CLASS */
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
const C = /* @__PURE__ */
|
|
71
|
+
const C = /* @__PURE__ */ d(l, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue"]]);
|
|
72
72
|
export {
|
|
73
73
|
C as default
|
|
74
74
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './NmorphYearMonthPicker.css';
|
|
2
|
-
import { defineComponent as Y, ref as p, watch as _, computed as
|
|
2
|
+
import { defineComponent as Y, ref as p, watch as _, computed as c } from "vue";
|
|
3
3
|
import { useModifiers as k } from "../../../../../utils/create-modifiers.js";
|
|
4
4
|
import { useCalendarTexts as C } from "../../../../data/nmorph-calendar/hooks/use-calendar-texts.js";
|
|
5
5
|
import { getDecadeYears as I } from "../../../../data/nmorph-calendar/utils.js";
|
|
@@ -17,43 +17,46 @@ const z = /* @__PURE__ */ Y({
|
|
|
17
17
|
emits: ["update-year", "update-month", "back-to-years"],
|
|
18
18
|
setup(f, { expose: g, emit: y }) {
|
|
19
19
|
g();
|
|
20
|
-
const { months: m } = C(),
|
|
20
|
+
const { months: m } = C(), d = m.map((t, n) => ({
|
|
21
21
|
label: t.substring(0, 3),
|
|
22
|
-
value: String(
|
|
22
|
+
value: String(n),
|
|
23
23
|
tabindex: -1
|
|
24
|
-
})), e = f, r = p(
|
|
25
|
-
const t = e.currentDate.getFullYear(),
|
|
26
|
-
r.value =
|
|
24
|
+
})), e = f, r = p(d), o = p(String(e.currentDate.getMonth())), a = p(e.currentDate.getFullYear()), v = () => {
|
|
25
|
+
const t = e.currentDate.getFullYear(), n = I(t).map((u) => ({ label: String(u), value: String(u) }));
|
|
26
|
+
r.value = n;
|
|
27
27
|
};
|
|
28
28
|
_(
|
|
29
29
|
() => e.currentDate,
|
|
30
30
|
() => {
|
|
31
|
-
e.type === "year" && (
|
|
31
|
+
e.type === "year" && (v(), o.value = String(e.currentDate.getFullYear()));
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
immediate: !0,
|
|
35
35
|
deep: !0
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
const l = y, b =
|
|
38
|
+
const l = y, b = c(
|
|
39
39
|
() => k({
|
|
40
40
|
"nmorph-year-month-picker": []
|
|
41
41
|
})
|
|
42
|
-
), D = (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
), D = c({
|
|
43
|
+
get: () => o.value,
|
|
44
|
+
set: (t) => {
|
|
45
|
+
o.value = t, e.type === "month" ? l("update-month", o.value) : l("update-year", o.value);
|
|
46
|
+
}
|
|
47
|
+
}), s = (t) => {
|
|
48
|
+
r.value = r.value.map((n) => {
|
|
49
|
+
const u = String(t === "decrease" ? Number(n.value) - 10 : Number(n.value) + 10);
|
|
47
50
|
return {
|
|
48
|
-
label:
|
|
49
|
-
value:
|
|
51
|
+
label: u,
|
|
52
|
+
value: u
|
|
50
53
|
};
|
|
51
54
|
});
|
|
52
55
|
}, i = (t) => {
|
|
53
56
|
t === "decrease" ? a.value = a.value - 1 : a.value = a.value + 1, l("update-year", String(a.value));
|
|
54
57
|
}, N = (t) => {
|
|
55
58
|
t === "decrease" ? e.type === "year" ? s("decrease") : i("decrease") : e.type === "year" ? s("increase") : i("increase");
|
|
56
|
-
}, S =
|
|
59
|
+
}, S = c(() => e.type === "year" ? `${r.value[0].label} - ${r.value[r.value.length - 1].label}` : String(a.value)), h = { months: m, initialMonthData: d, props: e, values: r, selectedValue: o, selectedYear: a, setInitialYearsData: v, emit: l, modifiers: b, selectedValueModel: D, updateYearValues: s, updateYear: i, buttonClickHandler: N, value: S, goToYearsHandler: () => {
|
|
57
60
|
e.type === "month" && l("back-to-years");
|
|
58
61
|
}, get NmorphButton() {
|
|
59
62
|
return F;
|
|
@@ -66,7 +69,7 @@ const z = /* @__PURE__ */ Y({
|
|
|
66
69
|
}, get NmorphIconChevronDown() {
|
|
67
70
|
return H;
|
|
68
71
|
} };
|
|
69
|
-
return Object.defineProperty(
|
|
72
|
+
return Object.defineProperty(h, "__isScriptSetup", { enumerable: !1, value: !0 }), h;
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
75
|
export {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import './NmorphOTPInput.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import m from "./NmorphOTPInput.vue2.js";
|
|
3
|
+
import { openBlock as l, createElementBlock as d, normalizeClass as p, createElementVNode as i, Fragment as c, renderList as s, createBlock as f, withModifiers as n, withKeys as r } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const u = ["name", "value", "disabled"], v = { class: "nmorph-otp-input__content" };
|
|
7
|
-
function _(b,
|
|
8
|
-
return
|
|
7
|
+
function _(b, a, g, e, H, y) {
|
|
8
|
+
return l(), d(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
class:
|
|
11
|
+
class: p(e.modifiers)
|
|
12
12
|
},
|
|
13
13
|
[
|
|
14
14
|
i("input", {
|
|
@@ -18,16 +18,17 @@ function _(b, l, H, e, g, y) {
|
|
|
18
18
|
disabled: e.props.disabled
|
|
19
19
|
}, null, 8, u),
|
|
20
20
|
i("div", v, [
|
|
21
|
-
(
|
|
21
|
+
(l(!0), d(
|
|
22
22
|
c,
|
|
23
23
|
null,
|
|
24
|
-
s(e.otpValue, (k, o) => (
|
|
24
|
+
s(e.otpValue, (k, o) => (l(), f(e.NmorphTextInput, {
|
|
25
25
|
id: e.fieldIds[o],
|
|
26
26
|
key: e.fieldIds[o],
|
|
27
27
|
ref_for: !0,
|
|
28
|
-
ref: (
|
|
28
|
+
ref: (t) => e.setInputRef(t, o),
|
|
29
|
+
modelValue: e.getFieldModel(o).value,
|
|
30
|
+
"onUpdate:modelValue": (t) => e.getFieldModel(o).value = t,
|
|
29
31
|
class: "nmorph-otp-input__field",
|
|
30
|
-
"model-value": e.otpValue[o],
|
|
31
32
|
height: e.props.height,
|
|
32
33
|
disabled: e.props.disabled,
|
|
33
34
|
autocomplete: e.resolvedAutocomplete,
|
|
@@ -43,19 +44,18 @@ function _(b, l, H, e, g, y) {
|
|
|
43
44
|
autofocus: e.props.autofocus && o === 0,
|
|
44
45
|
"aria-label": `OTP ${o + 1}`
|
|
45
46
|
},
|
|
46
|
-
"onUpdate:modelValue": (n) => e.inputHandler(n, o),
|
|
47
47
|
onKeydown: [
|
|
48
|
-
|
|
49
|
-
r(
|
|
50
|
-
r(
|
|
51
|
-
r(
|
|
52
|
-
r(
|
|
53
|
-
r(
|
|
48
|
+
a[0] || (a[0] = (t) => e.keydownHandler(t)),
|
|
49
|
+
r(n((t) => e.deleteKeyHandler(t, o), ["prevent"]), ["delete"]),
|
|
50
|
+
r(n((t) => e.arrowLeftHandler(o), ["prevent"]), ["left"]),
|
|
51
|
+
r(n((t) => e.arrowRightHandler(o), ["prevent"]), ["right"]),
|
|
52
|
+
r(n(e.homeHandler, ["prevent"]), ["home"]),
|
|
53
|
+
r(n(e.endHandler, ["prevent"]), ["end"])
|
|
54
54
|
],
|
|
55
|
-
onPaste:
|
|
56
|
-
onFocus: (
|
|
55
|
+
onPaste: n((t) => e.pasteHandler(t, o), ["prevent"]),
|
|
56
|
+
onFocus: (t) => e.focusHandler(o),
|
|
57
57
|
onBlur: e.blurHandler
|
|
58
|
-
}, null, 8, ["id", "
|
|
58
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "height", "disabled", "autocomplete", "tabindex", "input-attrs", "onKeydown", "onPaste", "onFocus"]))),
|
|
59
59
|
128
|
|
60
60
|
/* KEYED_FRAGMENT */
|
|
61
61
|
))
|
|
@@ -65,7 +65,7 @@ function _(b, l, H, e, g, y) {
|
|
|
65
65
|
/* CLASS */
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const P = /* @__PURE__ */ h(m, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-otp-input/NmorphOTPInput.vue"]]);
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
P as default
|
|
71
71
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphOTPInput.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { NmorphComponentHeight as
|
|
5
|
-
import { useFormItemInput as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
2
|
+
import { defineComponent as te, ref as b, computed as c, watch as D, nextTick as O } from "vue";
|
|
3
|
+
import { useModifiers as ae } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { NmorphComponentHeight as le } from "../../../types/index.js";
|
|
5
|
+
import { useFormItemInput as ue } from "../nmorph-form/use-form-item-input.js";
|
|
6
|
+
import oe from "../nmorph-text-input/NmorphTextInput.vue.js";
|
|
7
|
+
const de = /* @__PURE__ */ te({
|
|
8
8
|
__name: "NmorphOTPInput",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: String, required: !1, default: "" },
|
|
@@ -20,120 +20,128 @@ const ce = /* @__PURE__ */ Y({
|
|
|
20
20
|
tabindex: { type: Number, required: !1 }
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:model-value", "focus", "blur", "complete"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
23
|
+
setup(I, { expose: R, emit: j }) {
|
|
24
|
+
const l = I, f = j, { id: V, name: w, autocomplete: q, tabindex: p } = ue(l), i = b([]), n = b([]), d = b(!1), o = b([]), u = c(() => Math.max(1, l.length)), v = (e = "") => {
|
|
25
25
|
const t = `${e ?? ""}`;
|
|
26
|
-
return
|
|
27
|
-
}, A = (e =
|
|
26
|
+
return l.mode === "numeric" ? Array.from(t.replace(/\D/g, "")) : l.mode === "alphanumeric" ? Array.from(t.replace(/[^a-zA-Z0-9]/g, "")) : Array.from(t);
|
|
27
|
+
}, A = (e = l.modelValue) => {
|
|
28
28
|
const t = v(e).slice(0, u.value);
|
|
29
|
-
return Array.from({ length: u.value }, (
|
|
30
|
-
},
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
|
|
29
|
+
return Array.from({ length: u.value }, (a, s) => t[s] || "");
|
|
30
|
+
}, g = (e, t = !1) => {
|
|
31
|
+
if (o.value = Array.from({ length: u.value }, (s, y) => e[y] || ""), !t) return;
|
|
32
|
+
const a = o.value.join("");
|
|
33
|
+
f("update:model-value", a), o.value.includes("") || f("complete", a);
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
[() =>
|
|
35
|
+
D(
|
|
36
|
+
[() => l.modelValue, () => l.mode, u],
|
|
37
37
|
() => {
|
|
38
|
-
const e = A(
|
|
39
|
-
(e.join("") !==
|
|
38
|
+
const e = A(l.modelValue);
|
|
39
|
+
(e.join("") !== o.value.join("") || e.length !== o.value.length) && g(e);
|
|
40
40
|
},
|
|
41
41
|
{ immediate: !0 }
|
|
42
42
|
);
|
|
43
|
-
const
|
|
44
|
-
() =>
|
|
45
|
-
nmorph: [
|
|
46
|
-
"nmorph-otp-input": [`${
|
|
43
|
+
const N = c(
|
|
44
|
+
() => ae({
|
|
45
|
+
nmorph: [le[l.height], `${d.value && "focused"}`],
|
|
46
|
+
"nmorph-otp-input": [`${l.disabled && "disabled"}`]
|
|
47
47
|
})
|
|
48
|
-
),
|
|
48
|
+
), T = c(
|
|
49
49
|
() => Array.from({ length: u.value }, (e, t) => t === 0 ? V.value : `${V.value}-${t + 1}`)
|
|
50
|
-
),
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
}),
|
|
54
|
-
n.value[e] =
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
), $ = c(() => l.mode === "numeric" ? "numeric" : "text"), E = c(() => q.value || "one-time-code"), B = c(() => {
|
|
51
|
+
if (l.mode === "numeric") return "[0-9]*";
|
|
52
|
+
if (l.mode === "alphanumeric") return "[A-Za-z0-9]*";
|
|
53
|
+
}), h = (e) => {
|
|
54
|
+
n.value[e] = i.value[e]?.inputDOMRef ?? null;
|
|
55
|
+
}, C = (e, t) => {
|
|
56
|
+
i.value[t] = e, O(() => {
|
|
57
|
+
h(t);
|
|
58
58
|
});
|
|
59
59
|
}, _ = (e) => {
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
60
|
+
h(e), i.value[e]?.select?.(), n.value[e]?.select();
|
|
61
|
+
}, r = (e = 0) => {
|
|
62
|
+
O(() => {
|
|
63
63
|
const t = Math.min(Math.max(e, 0), u.value - 1);
|
|
64
|
-
|
|
64
|
+
h(t), i.value[t]?.focus?.(), n.value[t]?.focus(), _(t);
|
|
65
65
|
});
|
|
66
|
-
},
|
|
67
|
-
|
|
66
|
+
}, F = () => {
|
|
67
|
+
i.value.forEach((e, t) => {
|
|
68
68
|
e?.blur?.(), n.value[t]?.blur();
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
-
|
|
71
|
+
R({
|
|
72
72
|
inputDOMRefs: n,
|
|
73
|
-
focus:
|
|
74
|
-
blur:
|
|
73
|
+
focus: r,
|
|
74
|
+
blur: F
|
|
75
75
|
});
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
76
|
+
const m = (e, t = "") => {
|
|
77
|
+
const a = [...o.value];
|
|
78
|
+
a[e] = t, g(a, !0);
|
|
79
79
|
}, H = (e, t) => {
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
82
|
-
|
|
80
|
+
const a = v(e).slice(0, u.value - t);
|
|
81
|
+
if (!a.length) {
|
|
82
|
+
m(t, "");
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}),
|
|
89
|
-
const y = t +
|
|
90
|
-
y < u.value ?
|
|
91
|
-
},
|
|
85
|
+
const s = [...o.value];
|
|
86
|
+
a.forEach((Y, ee) => {
|
|
87
|
+
s[t + ee] = Y;
|
|
88
|
+
}), g(s, !0);
|
|
89
|
+
const y = t + a.length;
|
|
90
|
+
y < u.value ? r(y) : r(u.value - 1);
|
|
91
|
+
}, S = (e, t) => {
|
|
92
92
|
H(e, t);
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
}, M = /* @__PURE__ */ new Map(), P = (e) => {
|
|
94
|
+
const t = M.get(e);
|
|
95
|
+
if (t) return t;
|
|
96
|
+
const a = c({
|
|
97
|
+
get: () => o.value[e] || "",
|
|
98
|
+
set: (s) => S(s, e)
|
|
99
|
+
});
|
|
100
|
+
return M.set(e, a), a;
|
|
101
|
+
}, k = (e) => {
|
|
102
|
+
if (o.value[e]) {
|
|
103
|
+
m(e);
|
|
96
104
|
return;
|
|
97
105
|
}
|
|
98
|
-
e > 0 && (
|
|
99
|
-
},
|
|
106
|
+
e > 0 && (m(e - 1), r(e - 1));
|
|
107
|
+
}, x = (e, t) => {
|
|
100
108
|
if (e.key === "Backspace") {
|
|
101
|
-
|
|
109
|
+
k(t);
|
|
102
110
|
return;
|
|
103
111
|
}
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
}, K = (e) => {
|
|
114
|
-
e.key.length === 1 && !v(e.key).length && e.preventDefault();
|
|
115
|
-
}, G = (e, t) => {
|
|
116
|
-
const l = e.clipboardData?.getData("text") || "";
|
|
117
|
-
H(l, t);
|
|
112
|
+
m(t);
|
|
113
|
+
}, L = (e) => {
|
|
114
|
+
r(e - 1);
|
|
115
|
+
}, Z = (e) => {
|
|
116
|
+
r(e + 1);
|
|
117
|
+
}, K = () => {
|
|
118
|
+
r(0);
|
|
119
|
+
}, G = () => {
|
|
120
|
+
r(u.value - 1);
|
|
118
121
|
}, J = (e) => {
|
|
119
|
-
|
|
120
|
-
}, Q = () => {
|
|
122
|
+
e.key.length === 1 && !v(e.key).length && e.preventDefault();
|
|
123
|
+
}, Q = (e, t) => {
|
|
124
|
+
const a = e.clipboardData?.getData("text") || "";
|
|
125
|
+
H(a, t);
|
|
126
|
+
}, U = (e) => {
|
|
127
|
+
d.value || (d.value = !0, f("focus")), _(e);
|
|
128
|
+
}, W = () => {
|
|
121
129
|
setTimeout(() => {
|
|
122
130
|
const e = document.activeElement;
|
|
123
|
-
!n.value.some((
|
|
131
|
+
!n.value.some((a) => a === e) && d.value && (d.value = !1, f("blur"));
|
|
124
132
|
});
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
() =>
|
|
133
|
+
}, X = (e) => p.value > 0 ? p.value + e : p.value;
|
|
134
|
+
D(
|
|
135
|
+
() => l.autofocus,
|
|
128
136
|
(e) => {
|
|
129
|
-
e && !
|
|
137
|
+
e && !l.disabled && r(0);
|
|
130
138
|
},
|
|
131
139
|
{ immediate: !0 }
|
|
132
140
|
);
|
|
133
|
-
const
|
|
134
|
-
return Object.defineProperty(
|
|
141
|
+
const z = { props: l, emit: f, id: V, name: w, autocomplete: q, tabindex: p, inputRefs: i, inputDOMRefs: n, focused: d, otpValue: o, normalizedLength: u, sanitizeValue: v, normalizeOtpValue: A, syncOtpValue: g, modifiers: N, fieldIds: T, inputMode: $, resolvedAutocomplete: E, inputPattern: B, syncInputDOMRef: h, setInputRef: C, selectField: _, focusField: r, blurFields: F, updateCharAt: m, insertValue: H, inputHandler: S, fieldModels: M, getFieldModel: P, backspaceHandler: k, deleteKeyHandler: x, arrowLeftHandler: L, arrowRightHandler: Z, homeHandler: K, endHandler: G, keydownHandler: J, pasteHandler: Q, focusHandler: U, blurHandler: W, getFieldTabindex: X, NmorphTextInput: oe };
|
|
142
|
+
return Object.defineProperty(z, "__isScriptSetup", { enumerable: !1, value: !0 }), z;
|
|
135
143
|
}
|
|
136
144
|
});
|
|
137
145
|
export {
|
|
138
|
-
|
|
146
|
+
de as default
|
|
139
147
|
};
|
|
@@ -9,10 +9,10 @@ const N = { class: "nmorph-select__content" }, S = ["id", "name", "autocomplete"
|
|
|
9
9
|
}, u = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "nmorph-select__selected-value"
|
|
12
|
-
},
|
|
12
|
+
}, D = {
|
|
13
13
|
key: 2,
|
|
14
14
|
class: "nmorph-select__selected-value"
|
|
15
|
-
},
|
|
15
|
+
}, C = ["id"];
|
|
16
16
|
function E(y, v, p, e, M, R) {
|
|
17
17
|
return r(), l(
|
|
18
18
|
"div",
|
|
@@ -76,7 +76,7 @@ function E(y, v, p, e, M, R) {
|
|
|
76
76
|
_(e.computedNoElementPlaceholder),
|
|
77
77
|
1
|
|
78
78
|
/* TEXT */
|
|
79
|
-
)) : (r(), l("div",
|
|
79
|
+
)) : (r(), l("div", D, [
|
|
80
80
|
(r(!0), l(
|
|
81
81
|
d,
|
|
82
82
|
null,
|
|
@@ -94,7 +94,7 @@ function E(y, v, p, e, M, R) {
|
|
|
94
94
|
])),
|
|
95
95
|
f(e.NmorphIcon, { class: "nmorph-select__chevron" }, {
|
|
96
96
|
default: s(() => [
|
|
97
|
-
e.props.loading ? (r(), i(e.
|
|
97
|
+
e.props.loading ? (r(), i(e.NmorphIconLoaderDots, { key: 0 })) : (r(), i(e.NmorphIconChevronDown, { key: 1 }))
|
|
98
98
|
]),
|
|
99
99
|
_: 1
|
|
100
100
|
/* STABLE */
|
|
@@ -206,7 +206,7 @@ function E(y, v, p, e, M, R) {
|
|
|
206
206
|
64
|
|
207
207
|
/* STABLE_FRAGMENT */
|
|
208
208
|
))
|
|
209
|
-
], 8,
|
|
209
|
+
], 8, C)
|
|
210
210
|
]),
|
|
211
211
|
_: 3
|
|
212
212
|
/* FORWARDED */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphSwitch.css';
|
|
2
|
-
import { defineComponent as q, ref as
|
|
2
|
+
import { defineComponent as q, ref as i, computed as n, watch as N } from "vue";
|
|
3
3
|
import { useModifiers as V } from "../../../utils/create-modifiers.js";
|
|
4
4
|
import { useFormItemInput as _ } from "../nmorph-form/use-form-item-input.js";
|
|
5
5
|
import w from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
6
6
|
import H from "../../../assets/icons/loader.svg.js";
|
|
7
|
-
const
|
|
7
|
+
const C = /* @__PURE__ */ q({
|
|
8
8
|
__name: "NmorphSwitch",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: [Boolean, String, Number], required: !1, default: !1 },
|
|
@@ -23,31 +23,31 @@ const L = /* @__PURE__ */ q({
|
|
|
23
23
|
},
|
|
24
24
|
emits: ["update:model-value"],
|
|
25
25
|
setup(s, { expose: f, emit: m }) {
|
|
26
|
-
const e = s, { id: p, name: c, tabindex: h } = _(e), u = m,
|
|
27
|
-
|
|
26
|
+
const e = s, { id: p, name: c, tabindex: h } = _(e), u = m, a = i(!1), g = () => {
|
|
27
|
+
a.value = !0;
|
|
28
28
|
}, v = () => {
|
|
29
|
-
|
|
29
|
+
a.value = !1;
|
|
30
30
|
}, b = n(
|
|
31
31
|
() => V({
|
|
32
32
|
"nmorph-switch": [
|
|
33
33
|
`${e.disabled && "disabled"}`,
|
|
34
34
|
`${r.value ? "on" : "off"}`,
|
|
35
35
|
`${e.loading && "loading"}`,
|
|
36
|
-
`${
|
|
36
|
+
`${a.value && "focus"}`
|
|
37
37
|
]
|
|
38
38
|
})
|
|
39
|
-
), r =
|
|
39
|
+
), r = i(e.modelValue === e.activeValue), y = () => {
|
|
40
40
|
if (e.disabled) return;
|
|
41
41
|
r.value = !r.value;
|
|
42
42
|
const t = r.value ? e.activeValue : e.inactiveValue;
|
|
43
43
|
u("update:model-value", t);
|
|
44
|
-
}, l =
|
|
44
|
+
}, l = i(null);
|
|
45
45
|
f({ inputDOMRef: l });
|
|
46
|
-
const
|
|
47
|
-
...e.width !== void 0 && { "--width":
|
|
48
|
-
...e.height !== void 0 && { "--height":
|
|
49
|
-
...e.offset !== void 0 && { "--offset":
|
|
50
|
-
...e.thumbHeight !== void 0 && { "--thumb-height":
|
|
46
|
+
const o = (t) => typeof t == "number" ? `${t}px` : t, S = n(() => ({
|
|
47
|
+
...e.width !== void 0 && { "--width": o(e.width) },
|
|
48
|
+
...e.height !== void 0 && { "--height": o(e.height) },
|
|
49
|
+
...e.offset !== void 0 && { "--offset": o(e.offset) },
|
|
50
|
+
...e.thumbHeight !== void 0 && { "--thumb-height": o(e.thumbHeight) }
|
|
51
51
|
}));
|
|
52
52
|
N(
|
|
53
53
|
() => e.modelValue,
|
|
@@ -55,14 +55,14 @@ const L = /* @__PURE__ */ q({
|
|
|
55
55
|
r.value = t === e.activeValue;
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
|
-
const d = { props: e, id: p, name: c, tabindex: h, emit: u, focus:
|
|
58
|
+
const d = { props: e, id: p, name: c, tabindex: h, emit: u, focus: a, focusHandler: g, blurHandler: v, modifiers: b, initialValue: r, changeHandler: y, inputDOMRef: l, getCssSize: o, styles: S, get NmorphIcon() {
|
|
59
59
|
return w;
|
|
60
|
-
}, get
|
|
60
|
+
}, get NmorphIconLoaderDots() {
|
|
61
61
|
return H;
|
|
62
62
|
} };
|
|
63
63
|
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
export {
|
|
67
|
-
|
|
67
|
+
C as default
|
|
68
68
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.nmorph-textarea{height:auto}.nmorph-textarea textarea{display:block;box-sizing:border-box;width:100%;min-width:0;padding:var(--indentation-03) var(--indentation-03) var(--indentation-03) var(--nmorph-textarea-indentation);color:var(--nmorph-text-color);font:inherit;line-height:var(--line-height-regular);background:var(--nmorph-main-color);border:none;border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset);transition:background var(--transition-02) ease,box-shadow var(--transition-02) ease,color var(--transition-02) ease;resize:var(--nmorph-textarea-resize)}.nmorph-textarea textarea:focus{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color);outline:none;box-shadow:var(--nmorph-shadow-outset)}.nmorph-textarea textarea:disabled{cursor:not-allowed;opacity:.6;resize:none}.nmorph-textarea.nmorph-textarea--auto-size textarea{overflow-y:hidden}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import './NmorphTextarea.css';
|
|
2
|
+
import a from "./NmorphTextarea.vue2.js";
|
|
3
|
+
import { openBlock as n, createElementBlock as t, normalizeStyle as l, normalizeClass as d, createElementVNode as i, mergeProps as m, withKeys as s } from "vue";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const c = ["id", "name", "autocomplete", "tabindex", "placeholder", "disabled", "value", "rows"];
|
|
7
|
+
function f(x, o, h, e, b, y) {
|
|
8
|
+
return n(), t(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
class: d(e.modifiers),
|
|
12
|
+
style: l(e.styles)
|
|
13
|
+
},
|
|
14
|
+
[
|
|
15
|
+
i("textarea", m({
|
|
16
|
+
id: e.id,
|
|
17
|
+
ref: "textareaDOMRef",
|
|
18
|
+
name: e.name,
|
|
19
|
+
autocomplete: e.autocomplete,
|
|
20
|
+
tabindex: e.tabindex,
|
|
21
|
+
class: "nmorph-native-input",
|
|
22
|
+
placeholder: e.props.placeholder,
|
|
23
|
+
disabled: e.props.disabled,
|
|
24
|
+
value: e.props.modelValue,
|
|
25
|
+
rows: e.rows
|
|
26
|
+
}, e.props.textareaAttrs, {
|
|
27
|
+
onInput: e.handleInput,
|
|
28
|
+
onFocus: e.handleFocus,
|
|
29
|
+
onBlur: e.handleBlur,
|
|
30
|
+
onKeydown: o[0] || (o[0] = (r) => e.emit("keydown", r)),
|
|
31
|
+
onKeyup: o[1] || (o[1] = s((r) => e.emit("on-enter"), ["enter"]))
|
|
32
|
+
}), null, 16, c)
|
|
33
|
+
],
|
|
34
|
+
6
|
|
35
|
+
/* CLASS, STYLE */
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const k = /* @__PURE__ */ p(a, [["render", f], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-textarea/NmorphTextarea.vue"]]);
|
|
39
|
+
export {
|
|
40
|
+
k as default
|
|
41
|
+
};
|