@nmorph/nmorph-ui-kit 2.2.34 → 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/pin.svg.js +21 -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 -527
- 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-empty/NmorphEmpty.css +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.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -27
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +75 -63
- 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-file-upload/NmorphFileUpload.vue.js +34 -30
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +94 -62
- 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 +53 -53
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +24 -21
- 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/form/nmorph-time-picker/NmorphTimePicker.vue.js +40 -31
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +45 -41
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +20 -25
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +41 -27
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +11 -10
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +10 -9
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
- package/dist/hooks/use-common-styles.js +2 -1
- package/dist/icons.js +621 -531
- package/dist/index.es.js +781 -677
- package/dist/index.umd.js +31 -30
- 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 +49 -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-file-upload/NmorphFileUpload.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-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +0 -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 +3 -1
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +3 -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,30 +1,31 @@
|
|
|
1
1
|
import './NmorphFileUpload.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import m from "./NmorphFileUpload.vue2.js";
|
|
3
|
+
import { openBlock as o, createElementBlock as r, normalizeClass as d, createElementVNode as l, renderSlot as _, createVNode as n, TransitionGroup as h, withCtx as t, Fragment as f, renderList as v, createBlock as a, createCommentVNode as p, resolveDynamicComponent as u, toDisplayString as g } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import y from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const
|
|
6
|
+
const k = { class: "nmorph-file-upload__trigger" }, N = ["multiple", "disabled", "accept"], C = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "nmorph-file-upload__list"
|
|
9
9
|
}, b = { class: "nmorph-file-upload__file-info" }, x = { class: "nmorph-file-upload__file-name" }, F = { class: "nmorph-file-upload__remove-file" };
|
|
10
|
-
function B(
|
|
11
|
-
return
|
|
10
|
+
function B(s, I, w, e, D, S) {
|
|
11
|
+
return o(), r(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
|
-
class:
|
|
14
|
+
class: d(e.modifiers)
|
|
15
15
|
},
|
|
16
16
|
[
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
l("div", k, [
|
|
18
|
+
l("input", {
|
|
19
19
|
ref: "inputDOMRef",
|
|
20
20
|
type: "file",
|
|
21
21
|
multiple: e.props.multiple,
|
|
22
22
|
disabled: e.props.disabled,
|
|
23
|
+
accept: e.inputAccept,
|
|
23
24
|
class: "nmorph-native-input",
|
|
24
25
|
onChange: e.handleFileUpload
|
|
25
|
-
}, null, 40,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
}, null, 40, N),
|
|
27
|
+
_(s.$slots, "trigger", {}, () => [
|
|
28
|
+
n(e.NmorphButton, {
|
|
28
29
|
text: e.computedButtonText,
|
|
29
30
|
fill: "",
|
|
30
31
|
disabled: e.props.disabled,
|
|
@@ -32,22 +33,25 @@ function B(a, I, w, e, D, S) {
|
|
|
32
33
|
}, null, 8, ["text", "disabled"])
|
|
33
34
|
])
|
|
34
35
|
]),
|
|
35
|
-
e.files.length > 0 ? (
|
|
36
|
-
|
|
36
|
+
e.files.length > 0 ? (o(), r("div", C, [
|
|
37
|
+
n(h, {
|
|
37
38
|
name: "list",
|
|
38
39
|
tag: "div"
|
|
39
40
|
}, {
|
|
40
41
|
default: t(() => [
|
|
41
|
-
(
|
|
42
|
-
|
|
42
|
+
(o(!0), r(
|
|
43
|
+
f,
|
|
43
44
|
null,
|
|
44
|
-
|
|
45
|
-
key:
|
|
45
|
+
v(e.files, ({ data: i, previewUrl: c }) => (o(), r("div", {
|
|
46
|
+
key: i.name,
|
|
46
47
|
class: "nmorph-file-upload__file"
|
|
47
48
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
e.props.photoWithPreview && e.isImageFile(i) ? (o(), a(e.NmorphImagePreview, {
|
|
50
|
+
key: 0,
|
|
51
|
+
src: c
|
|
52
|
+
}, null, 8, ["src"])) : p("v-if", !0),
|
|
53
|
+
l("div", b, [
|
|
54
|
+
n(
|
|
51
55
|
e.NmorphIcon,
|
|
52
56
|
{
|
|
53
57
|
width: "14px",
|
|
@@ -55,7 +59,7 @@ function B(a, I, w, e, D, S) {
|
|
|
55
59
|
},
|
|
56
60
|
{
|
|
57
61
|
default: t(() => [
|
|
58
|
-
(
|
|
62
|
+
(o(), a(u(e.typeFileIconMap(i))))
|
|
59
63
|
]),
|
|
60
64
|
_: 2
|
|
61
65
|
/* DYNAMIC */
|
|
@@ -63,22 +67,22 @@ function B(a, I, w, e, D, S) {
|
|
|
63
67
|
1024
|
|
64
68
|
/* DYNAMIC_SLOTS */
|
|
65
69
|
),
|
|
66
|
-
|
|
70
|
+
l(
|
|
67
71
|
"span",
|
|
68
72
|
x,
|
|
69
|
-
|
|
73
|
+
g(i.name),
|
|
70
74
|
1
|
|
71
75
|
/* TEXT */
|
|
72
76
|
)
|
|
73
77
|
]),
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
l("div", F, [
|
|
79
|
+
n(e.NmorphButton, {
|
|
76
80
|
height: "thin",
|
|
77
81
|
"style-type": "transparent",
|
|
78
|
-
onClick: (U) => e.removeFile(
|
|
82
|
+
onClick: (U) => e.removeFile(i.name)
|
|
79
83
|
}, {
|
|
80
84
|
"icon-only": t(() => [
|
|
81
|
-
|
|
85
|
+
n(e.NmorphIconCross)
|
|
82
86
|
]),
|
|
83
87
|
_: 1
|
|
84
88
|
/* STABLE */
|
|
@@ -92,13 +96,13 @@ function B(a, I, w, e, D, S) {
|
|
|
92
96
|
_: 1
|
|
93
97
|
/* STABLE */
|
|
94
98
|
})
|
|
95
|
-
])) :
|
|
99
|
+
])) : p("v-if", !0)
|
|
96
100
|
],
|
|
97
101
|
2
|
|
98
102
|
/* CLASS */
|
|
99
103
|
);
|
|
100
104
|
}
|
|
101
|
-
const
|
|
105
|
+
const T = /* @__PURE__ */ y(m, [["render", B], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-file-upload/NmorphFileUpload.vue"]]);
|
|
102
106
|
export {
|
|
103
|
-
|
|
107
|
+
T as default
|
|
104
108
|
};
|
|
@@ -1,94 +1,126 @@
|
|
|
1
1
|
import './NmorphFileUpload.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
2
|
+
import { defineComponent as M, computed as y, ref as F, watch as E, onBeforeUnmount as W } from "vue";
|
|
3
|
+
import { useModifiers as $ } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useI18n as D } from "vue-i18n";
|
|
5
|
+
import { resolution as T, NmorphImageResolution as A, NmorphAudioResolution as K, NmorphVideoResolution as z, NmorphArchiveResolution as G } from "./types.js";
|
|
6
|
+
import H from "../../../assets/icons/doc.svg.js";
|
|
7
|
+
import J from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
|
|
8
|
+
import Q from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
9
|
+
import X from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
10
|
+
import Y from "../../../assets/icons/audio.svg.js";
|
|
11
|
+
import Z from "../../../assets/icons/video.svg.js";
|
|
12
|
+
import ee from "../../../assets/icons/archive.svg.js";
|
|
13
|
+
import oe from "../../../assets/icons/cross.svg.js";
|
|
14
|
+
import te from "../../../assets/icons/image.svg.js";
|
|
15
|
+
const ye = /* @__PURE__ */ M({
|
|
16
16
|
__name: "NmorphFileUpload",
|
|
17
17
|
props: {
|
|
18
18
|
modelValue: { type: Array, required: !1, default: () => [] },
|
|
19
19
|
disabled: { type: Boolean, required: !1, default: !1 },
|
|
20
20
|
multiple: { type: Boolean, required: !1, default: !1 },
|
|
21
|
-
allowedTypes: { type: Array, required: !1, default: () => [
|
|
21
|
+
allowedTypes: { type: Array, required: !1, default: () => [] },
|
|
22
22
|
photoWithPreview: { type: Boolean, required: !1, default: !0 },
|
|
23
23
|
buttonText: { type: String, required: !1, default: "" }
|
|
24
24
|
},
|
|
25
25
|
emits: ["update:model-value", "on-unsupported-file-type-error"],
|
|
26
|
-
setup(
|
|
27
|
-
const { t:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
const
|
|
26
|
+
setup(R, { expose: U, emit: _ }) {
|
|
27
|
+
const { t: w } = D(), n = R, d = _, B = y(() => n.buttonText ? n.buttonText : w("selectFile")), g = Object.entries(T), v = {
|
|
28
|
+
"svg-xml": "svg",
|
|
29
|
+
"audio-ogg": "ogg",
|
|
30
|
+
"wideo-ogg": "ogg"
|
|
31
|
+
}, C = (e) => e.split("/")[1]?.toLowerCase() || "", f = (e) => {
|
|
32
|
+
const o = e.split(".").pop()?.toLowerCase();
|
|
33
|
+
return o && o !== e.toLowerCase() ? o : "";
|
|
34
|
+
}, I = (e) => g.find(([, o]) => o.toLowerCase() === e.toLowerCase())?.[0] || "", u = (e) => Array.from(
|
|
35
|
+
new Set(
|
|
36
|
+
[
|
|
37
|
+
e.type.toLowerCase(),
|
|
38
|
+
I(e.type),
|
|
39
|
+
f(e.name),
|
|
40
|
+
C(e.type)
|
|
41
|
+
].filter(Boolean).map((o) => o.toLowerCase())
|
|
42
|
+
)
|
|
43
|
+
), i = (e, o) => Object.prototype.hasOwnProperty.call(o, e), P = (e) => {
|
|
44
|
+
const o = u(e);
|
|
45
|
+
return e.type.toLowerCase().startsWith("image/") || o.some((t) => i(t, A));
|
|
46
|
+
}, L = (e) => {
|
|
47
|
+
if (n.allowedTypes.length === 0) return !0;
|
|
48
|
+
const o = u(e);
|
|
49
|
+
return n.allowedTypes.some((t) => o.includes(String(t).toLowerCase()));
|
|
50
|
+
}, S = y(() => {
|
|
51
|
+
if (n.allowedTypes.length !== 0)
|
|
52
|
+
return Array.from(
|
|
53
|
+
new Set(
|
|
54
|
+
n.allowedTypes.flatMap((e) => {
|
|
55
|
+
const o = String(e).toLowerCase(), t = T[o], r = v[o] || o;
|
|
56
|
+
return o.includes("/") ? o : t ? [`.${r}`, t] : `.${r}`;
|
|
57
|
+
})
|
|
58
|
+
)
|
|
59
|
+
).join(",");
|
|
60
|
+
}), V = (e) => {
|
|
61
|
+
const o = u(e);
|
|
62
|
+
let t = H;
|
|
63
|
+
return (e.type.toLowerCase().startsWith("image/") || o.some((r) => i(r, A))) && (t = te), (e.type.toLowerCase().startsWith("audio/") || o.some((r) => i(r, K))) && (t = Y), (e.type.toLowerCase().startsWith("video/") || o.some((r) => i(r, z))) && (t = Z), o.some((r) => i(r, G)) && (t = ee), t;
|
|
64
|
+
}, p = F(null), a = F([...n.modelValue]), l = /* @__PURE__ */ new Set(), m = () => {
|
|
65
|
+
const e = p.value;
|
|
33
66
|
e && (e.value = "");
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
},
|
|
67
|
+
}, c = (e) => {
|
|
68
|
+
l.has(e) && (URL.revokeObjectURL(e), l.delete(e));
|
|
69
|
+
}, N = (e) => {
|
|
37
70
|
const o = new Set(e.map((t) => t.previewUrl));
|
|
38
|
-
Array.from(
|
|
39
|
-
o.has(t) ||
|
|
71
|
+
Array.from(l).forEach((t) => {
|
|
72
|
+
o.has(t) || c(t);
|
|
40
73
|
});
|
|
41
|
-
},
|
|
74
|
+
}, h = (e) => {
|
|
42
75
|
const o = [...e];
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (
|
|
48
|
-
const o = e.target, t = Array.from(o.files || []),
|
|
49
|
-
t.forEach((
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
m("on-unsupported-file-type-error", l.type);
|
|
76
|
+
a.value = o, d("update:model-value", o);
|
|
77
|
+
}, O = () => {
|
|
78
|
+
n.disabled || !p.value || p.value.click();
|
|
79
|
+
}, j = (e) => {
|
|
80
|
+
if (n.disabled) return;
|
|
81
|
+
const o = e.target, t = Array.from(o.files || []), r = [];
|
|
82
|
+
t.forEach((s) => {
|
|
83
|
+
if (!L(s)) {
|
|
84
|
+
d("on-unsupported-file-type-error", s.type || f(s.name) || s.name);
|
|
53
85
|
return;
|
|
54
86
|
}
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}),
|
|
58
|
-
},
|
|
59
|
-
if (
|
|
60
|
-
const o =
|
|
87
|
+
const b = URL.createObjectURL(s);
|
|
88
|
+
l.add(b), r.push({ data: s, previewUrl: b });
|
|
89
|
+
}), m(), r.length > 0 && h([...a.value, ...r]);
|
|
90
|
+
}, k = (e) => {
|
|
91
|
+
if (n.disabled) return;
|
|
92
|
+
const o = a.value.findIndex((t) => t.data.name === e);
|
|
61
93
|
if (o !== -1) {
|
|
62
|
-
const t =
|
|
63
|
-
|
|
94
|
+
const t = a.value[o];
|
|
95
|
+
c(t.previewUrl), m(), h(a.value.filter((r, s) => s !== o));
|
|
64
96
|
}
|
|
65
97
|
};
|
|
66
|
-
|
|
67
|
-
() =>
|
|
98
|
+
E(
|
|
99
|
+
() => n.modelValue,
|
|
68
100
|
(e) => {
|
|
69
101
|
const o = [...e];
|
|
70
|
-
|
|
102
|
+
N(o), a.value = o, o.length === 0 && m();
|
|
71
103
|
},
|
|
72
104
|
{ deep: !0 }
|
|
73
|
-
),
|
|
74
|
-
Array.from(
|
|
75
|
-
}),
|
|
76
|
-
const
|
|
77
|
-
() =>
|
|
78
|
-
"nmorph-file-upload": [`${
|
|
105
|
+
), W(() => {
|
|
106
|
+
Array.from(l).forEach((e) => c(e));
|
|
107
|
+
}), U({ inputDOMRef: p });
|
|
108
|
+
const q = y(
|
|
109
|
+
() => $({
|
|
110
|
+
"nmorph-file-upload": [`${n.disabled && "disabled"}`]
|
|
79
111
|
})
|
|
80
|
-
),
|
|
81
|
-
return
|
|
112
|
+
), x = { t: w, props: n, emit: d, computedButtonText: B, knownResolutionEntries: g, extensionByResolution: v, getPlainType: C, getFileExtension: f, getKnownResolutionByMime: I, getFileTypeCandidates: u, isKnownFileType: i, isImageFile: P, isFileAllowed: L, inputAccept: S, typeFileIconMap: V, inputDOMRef: p, files: a, createdPreviewUrls: l, resetInputValue: m, revokePreviewUrl: c, revokeRemovedPreviewUrls: N, filesChanged: h, openFileSelector: O, handleFileUpload: j, removeFile: k, modifiers: q, get NmorphButton() {
|
|
113
|
+
return X;
|
|
82
114
|
}, get NmorphIcon() {
|
|
83
|
-
return
|
|
115
|
+
return Q;
|
|
84
116
|
}, get NmorphImagePreview() {
|
|
85
|
-
return
|
|
117
|
+
return J;
|
|
86
118
|
}, get NmorphIconCross() {
|
|
87
|
-
return
|
|
119
|
+
return oe;
|
|
88
120
|
} };
|
|
89
|
-
return Object.defineProperty(
|
|
121
|
+
return Object.defineProperty(x, "__isScriptSetup", { enumerable: !1, value: !0 }), x;
|
|
90
122
|
}
|
|
91
123
|
});
|
|
92
124
|
export {
|
|
93
|
-
|
|
125
|
+
ye as default
|
|
94
126
|
};
|
|
@@ -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
|
};
|