@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.
Files changed (124) hide show
  1. package/dist/assets/icons/baseball.svg.js +28 -0
  2. package/dist/assets/icons/basketball.svg.js +21 -0
  3. package/dist/assets/icons/bowl.svg.js +21 -0
  4. package/dist/assets/icons/box.svg.js +35 -0
  5. package/dist/assets/icons/briefcase.svg.js +21 -0
  6. package/dist/assets/icons/brush-filled.svg.js +21 -0
  7. package/dist/assets/icons/brush.svg.js +21 -0
  8. package/dist/assets/icons/camera-filled.svg.js +21 -0
  9. package/dist/assets/icons/chevron-double-left.svg.js +28 -0
  10. package/dist/assets/icons/chevron-double-right.svg.js +28 -0
  11. package/dist/assets/icons/chevron-double-up.svg.js +28 -0
  12. package/dist/assets/icons/chevron-left.svg.js +21 -0
  13. package/dist/assets/icons/chevron-right.svg.js +21 -0
  14. package/dist/assets/icons/chevron-up.svg.js +21 -0
  15. package/dist/assets/icons/chicken.svg.js +21 -0
  16. package/dist/assets/icons/clipboard-check.svg.js +25 -0
  17. package/dist/assets/icons/clipboard.svg.js +25 -0
  18. package/dist/assets/icons/close-bold.svg.js +21 -0
  19. package/dist/assets/icons/cold-drink.svg.js +21 -0
  20. package/dist/assets/icons/comment.svg.js +21 -0
  21. package/dist/assets/icons/database.svg.js +25 -0
  22. package/dist/assets/icons/drag-handle.svg.js +21 -0
  23. package/dist/assets/icons/external-link.svg.js +28 -0
  24. package/dist/assets/icons/filter-off.svg.js +28 -0
  25. package/dist/assets/icons/fingerprint.svg.js +44 -0
  26. package/dist/assets/icons/folder-remove.svg.js +21 -0
  27. package/dist/assets/icons/goblet.svg.js +21 -0
  28. package/dist/assets/icons/ice-tea.svg.js +21 -0
  29. package/dist/assets/icons/inbox.svg.js +25 -0
  30. package/dist/assets/icons/mail.svg.js +25 -0
  31. package/dist/assets/icons/odometer.svg.js +35 -0
  32. package/dist/assets/icons/open.svg.js +28 -0
  33. package/dist/assets/icons/pagination.svg.js +8 -0
  34. package/dist/assets/icons/pin.svg.js +21 -0
  35. package/dist/assets/icons/redo.svg.js +21 -0
  36. package/dist/assets/icons/save.svg.js +25 -0
  37. package/dist/assets/icons/server.svg.js +32 -0
  38. package/dist/assets/icons/shield-check.svg.js +25 -0
  39. package/dist/assets/icons/shield.svg.js +25 -0
  40. package/dist/assets/icons/sliders.svg.js +31 -0
  41. package/dist/assets/icons/stopwatch.svg.js +28 -0
  42. package/dist/assets/icons/suitcase-line.svg.js +22 -0
  43. package/dist/assets/icons/undo.svg.js +21 -0
  44. package/dist/assets/icons/video-camera.svg.js +21 -0
  45. package/dist/components/basic/nmorph-button/NmorphButton.vue.js +10 -10
  46. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +5 -5
  47. package/dist/components/basic/nmorph-icon/NmorphIcons.js +617 -527
  48. package/dist/components/basic/nmorph-layout/NmorphLayout.css +1 -0
  49. package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +50 -0
  50. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +28 -0
  51. package/dist/components/basic/nmorph-space/NmorphSpace.css +1 -0
  52. package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +21 -0
  53. package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +45 -0
  54. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +15 -15
  55. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +1 -1
  56. package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -1
  57. package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +31 -31
  58. package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +36 -38
  59. package/dist/components/data/nmorph-qr-code/NmorphQRCode.css +1 -0
  60. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue.js +59 -0
  61. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +50 -0
  62. package/dist/components/data/nmorph-qr-code/qr-code.js +568 -0
  63. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.css +1 -0
  64. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue.js +86 -0
  65. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +60 -0
  66. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.css +1 -0
  67. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +81 -0
  68. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +47 -0
  69. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
  70. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -27
  71. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +75 -63
  72. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.js +13 -13
  73. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +28 -27
  74. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.js +16 -16
  75. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue2.js +20 -17
  76. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +34 -30
  77. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +94 -62
  78. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue.js +21 -21
  79. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +92 -84
  80. package/dist/components/form/nmorph-select/NmorphSelect.vue.js +5 -5
  81. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +53 -53
  82. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +24 -21
  83. package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +1 -1
  84. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +16 -16
  85. package/dist/components/form/nmorph-textarea/NmorphTextarea.css +1 -0
  86. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +41 -0
  87. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +67 -0
  88. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
  89. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +40 -31
  90. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +45 -41
  91. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +20 -25
  92. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +41 -27
  93. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +11 -10
  94. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +10 -9
  95. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
  96. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
  97. package/dist/hooks/use-common-styles.js +2 -1
  98. package/dist/icons.js +621 -531
  99. package/dist/index.es.js +781 -677
  100. package/dist/index.umd.js +31 -30
  101. package/dist/package.json.js +1 -1
  102. package/dist/src/components/basic/index.d.ts +2 -0
  103. package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +49 -3
  104. package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +22 -0
  105. package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +33 -0
  106. package/dist/src/components/data/index.d.ts +4 -0
  107. package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +34 -0
  108. package/dist/src/components/data/nmorph-qr-code/qr-code.d.ts +12 -0
  109. package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +46 -0
  110. package/dist/src/components/data/nmorph-virtual-list/types.d.ts +4 -0
  111. package/dist/src/components/feedback/index.d.ts +1 -0
  112. package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +40 -0
  113. package/dist/src/components/form/index.d.ts +1 -0
  114. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +1 -1
  115. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +2 -2
  116. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +2 -2
  117. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +1 -1
  118. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +0 -1
  119. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +48 -0
  120. package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
  121. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -1
  122. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +3 -1
  123. package/dist/style.css +1 -1
  124. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
1
  import './NmorphYearMonthPicker.css';
2
- import i from "./NmorphYearMonthPicker.vue2.js";
3
- import { openBlock as l, createElementBlock as m, normalizeClass as c, createElementVNode as t, createVNode as e, withCtx as n } from "vue";
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 h from "../../../../../_virtual/_plugin-vue_export-helper.js";
6
- const d = { class: "nmorph-year-month-picker__header" }, p = { class: "nmorph-year-month-picker__value" }, s = { class: "nmorph-year-month-picker__values" };
7
- function _(k, r, v, o, f, N) {
8
- return l(), m(
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
- t("div", d, [
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] = (a) => o.buttonClickHandler("decrease"))
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
- t("div", p, [
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] = (a) => o.buttonClickHandler("increase"))
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
- t("div", s, [
59
+ a("div", s, [
60
60
  e(o.NmorphRadioGroup, {
61
- "model-value": o.selectedValue,
62
- options: o.values,
63
- "onUpdate:modelValue": o.updateModelValue
64
- }, null, 8, ["model-value", "options"])
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__ */ h(i, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue"]]);
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 h } from "vue";
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(), c = m.map((t, o) => ({
20
+ const { months: m } = C(), d = m.map((t, n) => ({
21
21
  label: t.substring(0, 3),
22
- value: String(o),
22
+ value: String(n),
23
23
  tabindex: -1
24
- })), e = f, r = p(c), u = p(String(e.currentDate.getMonth())), a = p(e.currentDate.getFullYear()), d = () => {
25
- const t = e.currentDate.getFullYear(), o = I(t).map((n) => ({ label: String(n), value: String(n) }));
26
- r.value = o;
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" && (d(), u.value = String(e.currentDate.getFullYear()));
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 = h(
38
+ const l = y, b = c(
39
39
  () => k({
40
40
  "nmorph-year-month-picker": []
41
41
  })
42
- ), D = (t) => {
43
- u.value = t, e.type === "month" ? l("update-month", u.value) : l("update-year", u.value);
44
- }, s = (t) => {
45
- r.value = r.value.map((o) => {
46
- const n = String(t === "decrease" ? Number(o.value) - 10 : Number(o.value) + 10);
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: n,
49
- value: n
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 = h(() => e.type === "year" ? `${r.value[0].label} - ${r.value[r.value.length - 1].label}` : String(a.value)), v = { months: m, initialMonthData: c, props: e, values: r, selectedValue: u, selectedYear: a, setInitialYearsData: d, emit: l, modifiers: b, updateModelValue: D, updateYearValues: s, updateYear: i, buttonClickHandler: N, value: S, goToYearsHandler: () => {
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(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
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 d from "./NmorphFileUpload.vue2.js";
3
- import { openBlock as l, createElementBlock as r, normalizeClass as p, createElementVNode as i, renderSlot as m, createVNode as o, TransitionGroup as c, withCtx as t, Fragment as _, renderList as h, createBlock as f, resolveDynamicComponent as u, toDisplayString as v, createCommentVNode as g } from "vue";
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 N = { class: "nmorph-file-upload__trigger" }, k = ["multiple", "disabled"], C = {
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(a, I, w, e, D, S) {
11
- return l(), r(
10
+ function B(s, I, w, e, D, S) {
11
+ return o(), r(
12
12
  "div",
13
13
  {
14
- class: p(e.modifiers)
14
+ class: d(e.modifiers)
15
15
  },
16
16
  [
17
- i("div", N, [
18
- i("input", {
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, k),
26
- m(a.$slots, "trigger", {}, () => [
27
- o(e.NmorphButton, {
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 ? (l(), r("div", C, [
36
- o(c, {
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
- (l(!0), r(
42
- _,
42
+ (o(!0), r(
43
+ f,
43
44
  null,
44
- h(e.files, ({ data: n, previewUrl: s }) => (l(), r("div", {
45
- key: n.name,
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
- o(e.NmorphImagePreview, { src: s }, null, 8, ["src"]),
49
- i("div", b, [
50
- o(
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
- (l(), f(u(e.typeFileIconMap(n.type))))
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
- i(
70
+ l(
67
71
  "span",
68
72
  x,
69
- v(n.name),
73
+ g(i.name),
70
74
  1
71
75
  /* TEXT */
72
76
  )
73
77
  ]),
74
- i("div", F, [
75
- o(e.NmorphButton, {
78
+ l("div", F, [
79
+ n(e.NmorphButton, {
76
80
  height: "thin",
77
81
  "style-type": "transparent",
78
- onClick: (U) => e.removeFile(n.name)
82
+ onClick: (U) => e.removeFile(i.name)
79
83
  }, {
80
84
  "icon-only": t(() => [
81
- o(e.NmorphIconCross)
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
- ])) : g("v-if", !0)
99
+ ])) : p("v-if", !0)
96
100
  ],
97
101
  2
98
102
  /* CLASS */
99
103
  );
100
104
  }
101
- const j = /* @__PURE__ */ y(d, [["render", B], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-file-upload/NmorphFileUpload.vue"]]);
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
- j as default
107
+ T as default
104
108
  };
@@ -1,94 +1,126 @@
1
1
  import './NmorphFileUpload.css';
2
- import { defineComponent as V, computed as N, ref as g, watch as B, onBeforeUnmount as T } from "vue";
3
- import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
- import { useI18n as S } from "vue-i18n";
5
- import j from "../../../assets/icons/doc.svg.js";
6
- import k from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
7
- import C from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
- import L from "../../basic/nmorph-button/NmorphButton.vue.js";
9
- import { NmorphImageResolution as O, NmorphAudioResolution as E, NmorphVideoResolution as M, NmorphArchiveResolution as D } from "./types.js";
10
- import W from "../../../assets/icons/audio.svg.js";
11
- import $ from "../../../assets/icons/video.svg.js";
12
- import z from "../../../assets/icons/archive.svg.js";
13
- import G from "../../../assets/icons/cross.svg.js";
14
- import H from "../../../assets/icons/image.svg.js";
15
- const se = /* @__PURE__ */ V({
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: () => ["jpg", "jpeg", "png"] },
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(I, { expose: b, emit: w }) {
27
- const { t: f } = S(), r = I, m = w, x = N(() => r.buttonText ? r.buttonText : f("selectFile")), d = (e) => e.split("/")[1], R = (e) => {
28
- const o = d(e);
29
- let t = j;
30
- return o in O && (t = H), o in E && (t = W), o in M && (t = $), o in D && (t = z), t;
31
- }, s = g(null), n = g([...r.modelValue]), i = /* @__PURE__ */ new Set(), a = () => {
32
- const e = s.value;
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
- }, u = (e) => {
35
- i.has(e) && (URL.revokeObjectURL(e), i.delete(e));
36
- }, h = (e) => {
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(i).forEach((t) => {
39
- o.has(t) || u(t);
71
+ Array.from(l).forEach((t) => {
72
+ o.has(t) || c(t);
40
73
  });
41
- }, c = (e) => {
74
+ }, h = (e) => {
42
75
  const o = [...e];
43
- n.value = o, m("update:model-value", o);
44
- }, U = () => {
45
- r.disabled || !s.value || s.value.click();
46
- }, _ = (e) => {
47
- if (r.disabled) return;
48
- const o = e.target, t = Array.from(o.files || []), p = [];
49
- t.forEach((l) => {
50
- const P = d(l.type);
51
- if (!r.allowedTypes.includes(P)) {
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 y = URL.createObjectURL(l);
56
- i.add(y), p.push({ data: l, previewUrl: y });
57
- }), a(), p.length > 0 && c([...n.value, ...p]);
58
- }, A = (e) => {
59
- if (r.disabled) return;
60
- const o = n.value.findIndex((t) => t.data.name === e);
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 = n.value[o];
63
- u(t.previewUrl), a(), c(n.value.filter((p, l) => l !== o));
94
+ const t = a.value[o];
95
+ c(t.previewUrl), m(), h(a.value.filter((r, s) => s !== o));
64
96
  }
65
97
  };
66
- B(
67
- () => r.modelValue,
98
+ E(
99
+ () => n.modelValue,
68
100
  (e) => {
69
101
  const o = [...e];
70
- h(o), n.value = o, o.length === 0 && a();
102
+ N(o), a.value = o, o.length === 0 && m();
71
103
  },
72
104
  { deep: !0 }
73
- ), T(() => {
74
- Array.from(i).forEach((e) => u(e));
75
- }), b({ inputDOMRef: s });
76
- const F = N(
77
- () => q({
78
- "nmorph-file-upload": [`${r.disabled && "disabled"}`]
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
- ), v = { t: f, props: r, emit: m, computedButtonText: x, getPlainType: d, typeFileIconMap: R, inputDOMRef: s, files: n, createdPreviewUrls: i, resetInputValue: a, revokePreviewUrl: u, revokeRemovedPreviewUrls: h, filesChanged: c, openFileSelector: U, handleFileUpload: _, removeFile: A, modifiers: F, get NmorphButton() {
81
- return L;
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 C;
115
+ return Q;
84
116
  }, get NmorphImagePreview() {
85
- return k;
117
+ return J;
86
118
  }, get NmorphIconCross() {
87
- return G;
119
+ return oe;
88
120
  } };
89
- return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
121
+ return Object.defineProperty(x, "__isScriptSetup", { enumerable: !1, value: !0 }), x;
90
122
  }
91
123
  });
92
124
  export {
93
- se as default
125
+ ye as default
94
126
  };
@@ -1,14 +1,14 @@
1
1
  import './NmorphOTPInput.css';
2
- import p from "./NmorphOTPInput.vue2.js";
3
- import { openBlock as a, createElementBlock as d, normalizeClass as m, createElementVNode as i, Fragment as c, renderList as s, createBlock as f, withModifiers as t, withKeys as r } from "vue";
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, l, H, e, g, y) {
8
- return a(), d(
7
+ function _(b, a, g, e, H, y) {
8
+ return l(), d(
9
9
  "div",
10
10
  {
11
- class: m(e.modifiers)
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
- (a(!0), d(
21
+ (l(!0), d(
22
22
  c,
23
23
  null,
24
- s(e.otpValue, (k, o) => (a(), f(e.NmorphTextInput, {
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: (n) => e.setInputRef(n, o),
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
- l[0] || (l[0] = (n) => e.keydownHandler(n)),
49
- r(t((n) => e.deleteKeyHandler(n, o), ["prevent"]), ["delete"]),
50
- r(t((n) => e.arrowLeftHandler(o), ["prevent"]), ["left"]),
51
- r(t((n) => e.arrowRightHandler(o), ["prevent"]), ["right"]),
52
- r(t(e.homeHandler, ["prevent"]), ["home"]),
53
- r(t(e.endHandler, ["prevent"]), ["end"])
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: t((n) => e.pasteHandler(n, o), ["prevent"]),
56
- onFocus: (n) => e.focusHandler(o),
55
+ onPaste: n((t) => e.pasteHandler(t, o), ["prevent"]),
56
+ onFocus: (t) => e.focusHandler(o),
57
57
  onBlur: e.blurHandler
58
- }, null, 8, ["id", "model-value", "height", "disabled", "autocomplete", "tabindex", "input-attrs", "onUpdate:modelValue", "onKeydown", "onPaste", "onFocus"]))),
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 T = /* @__PURE__ */ h(p, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-otp-input/NmorphOTPInput.vue"]]);
68
+ const P = /* @__PURE__ */ h(m, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-otp-input/NmorphOTPInput.vue"]]);
69
69
  export {
70
- T as default
70
+ P as default
71
71
  };