@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.
Files changed (108) 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/redo.svg.js +21 -0
  35. package/dist/assets/icons/save.svg.js +25 -0
  36. package/dist/assets/icons/server.svg.js +32 -0
  37. package/dist/assets/icons/shield-check.svg.js +25 -0
  38. package/dist/assets/icons/shield.svg.js +25 -0
  39. package/dist/assets/icons/sliders.svg.js +31 -0
  40. package/dist/assets/icons/stopwatch.svg.js +28 -0
  41. package/dist/assets/icons/suitcase-line.svg.js +22 -0
  42. package/dist/assets/icons/undo.svg.js +21 -0
  43. package/dist/assets/icons/video-camera.svg.js +21 -0
  44. package/dist/components/basic/nmorph-button/NmorphButton.vue.js +10 -10
  45. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +5 -5
  46. package/dist/components/basic/nmorph-icon/NmorphIcons.js +617 -529
  47. package/dist/components/basic/nmorph-layout/NmorphLayout.css +1 -0
  48. package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +50 -0
  49. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +28 -0
  50. package/dist/components/basic/nmorph-space/NmorphSpace.css +1 -0
  51. package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +21 -0
  52. package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +45 -0
  53. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +15 -15
  54. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +1 -1
  55. package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +31 -31
  56. package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +36 -38
  57. package/dist/components/data/nmorph-qr-code/NmorphQRCode.css +1 -0
  58. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue.js +59 -0
  59. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +50 -0
  60. package/dist/components/data/nmorph-qr-code/qr-code.js +568 -0
  61. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.css +1 -0
  62. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue.js +86 -0
  63. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +60 -0
  64. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.css +1 -0
  65. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +81 -0
  66. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +47 -0
  67. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -30
  68. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +57 -54
  69. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.js +13 -13
  70. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +28 -27
  71. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.js +16 -16
  72. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue2.js +20 -17
  73. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue.js +21 -21
  74. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +92 -84
  75. package/dist/components/form/nmorph-select/NmorphSelect.vue.js +5 -5
  76. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +1 -1
  77. package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +1 -1
  78. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +16 -16
  79. package/dist/components/form/nmorph-textarea/NmorphTextarea.css +1 -0
  80. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +41 -0
  81. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +67 -0
  82. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
  83. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +38 -28
  84. package/dist/icons.js +621 -533
  85. package/dist/index.es.js +780 -678
  86. package/dist/index.umd.js +27 -27
  87. package/dist/package.json.js +1 -1
  88. package/dist/src/components/basic/index.d.ts +2 -0
  89. package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +48 -3
  90. package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +22 -0
  91. package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +33 -0
  92. package/dist/src/components/data/index.d.ts +4 -0
  93. package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +34 -0
  94. package/dist/src/components/data/nmorph-qr-code/qr-code.d.ts +12 -0
  95. package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +46 -0
  96. package/dist/src/components/data/nmorph-virtual-list/types.d.ts +4 -0
  97. package/dist/src/components/feedback/index.d.ts +1 -0
  98. package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +40 -0
  99. package/dist/src/components/form/index.d.ts +1 -0
  100. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +1 -1
  101. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +2 -2
  102. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +1 -1
  103. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +48 -0
  104. package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
  105. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +1 -1
  106. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +1 -1
  107. package/dist/style.css +1 -1
  108. 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,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
  };
@@ -1,10 +1,10 @@
1
1
  import './NmorphOTPInput.css';
2
- import { defineComponent as Y, ref as b, computed as i, watch as z, nextTick as D } from "vue";
3
- import { useModifiers as ee } from "../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as te } from "../../../types/index.js";
5
- import { useFormItemInput as ae } from "../nmorph-form/use-form-item-input.js";
6
- import le from "../nmorph-text-input/NmorphTextInput.vue.js";
7
- const ce = /* @__PURE__ */ Y({
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(F, { expose: O, emit: I }) {
24
- const a = F, d = I, { id: V, name: R, autocomplete: q, tabindex: p } = ae(a), s = b([]), n = b([]), c = b(!1), r = b([]), u = i(() => Math.max(1, a.length)), v = (e = "") => {
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 a.mode === "numeric" ? Array.from(t.replace(/\D/g, "")) : a.mode === "alphanumeric" ? Array.from(t.replace(/[^a-zA-Z0-9]/g, "")) : Array.from(t);
27
- }, A = (e = a.modelValue) => {
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 }, (l, m) => t[m] || "");
30
- }, h = (e, t = !1) => {
31
- if (r.value = Array.from({ length: u.value }, (m, y) => e[y] || ""), !t) return;
32
- const l = r.value.join("");
33
- d("update:model-value", l), r.value.includes("") || d("complete", l);
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
- z(
36
- [() => a.modelValue, () => a.mode, u],
35
+ D(
36
+ [() => l.modelValue, () => l.mode, u],
37
37
  () => {
38
- const e = A(a.modelValue);
39
- (e.join("") !== r.value.join("") || e.length !== r.value.length) && h(e);
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 j = i(
44
- () => ee({
45
- nmorph: [te[a.height], `${c.value && "focused"}`],
46
- "nmorph-otp-input": [`${a.disabled && "disabled"}`]
43
+ const N = c(
44
+ () => ae({
45
+ nmorph: [le[l.height], `${d.value && "focused"}`],
46
+ "nmorph-otp-input": [`${l.disabled && "disabled"}`]
47
47
  })
48
- ), N = i(
48
+ ), T = c(
49
49
  () => Array.from({ length: u.value }, (e, t) => t === 0 ? V.value : `${V.value}-${t + 1}`)
50
- ), T = i(() => a.mode === "numeric" ? "numeric" : "text"), $ = i(() => q.value || "one-time-code"), w = i(() => {
51
- if (a.mode === "numeric") return "[0-9]*";
52
- if (a.mode === "alphanumeric") return "[A-Za-z0-9]*";
53
- }), g = (e) => {
54
- n.value[e] = s.value[e]?.inputDOMRef ?? null;
55
- }, x = (e, t) => {
56
- s.value[t] = e, D(() => {
57
- g(t);
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
- g(e), s.value[e]?.select?.(), n.value[e]?.select();
61
- }, o = (e = 0) => {
62
- D(() => {
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
- g(t), s.value[t]?.focus?.(), n.value[t]?.focus(), _(t);
64
+ h(t), i.value[t]?.focus?.(), n.value[t]?.focus(), _(t);
65
65
  });
66
- }, M = () => {
67
- s.value.forEach((e, t) => {
66
+ }, F = () => {
67
+ i.value.forEach((e, t) => {
68
68
  e?.blur?.(), n.value[t]?.blur();
69
69
  });
70
70
  };
71
- O({
71
+ R({
72
72
  inputDOMRefs: n,
73
- focus: o,
74
- blur: M
73
+ focus: r,
74
+ blur: F
75
75
  });
76
- const f = (e, t = "") => {
77
- const l = [...r.value];
78
- l[e] = t, h(l, !0);
76
+ const m = (e, t = "") => {
77
+ const a = [...o.value];
78
+ a[e] = t, g(a, !0);
79
79
  }, H = (e, t) => {
80
- const l = v(e).slice(0, u.value - t);
81
- if (!l.length) {
82
- f(t, "");
80
+ const a = v(e).slice(0, u.value - t);
81
+ if (!a.length) {
82
+ m(t, "");
83
83
  return;
84
84
  }
85
- const m = [...r.value];
86
- l.forEach((W, X) => {
87
- m[t + X] = W;
88
- }), h(m, !0);
89
- const y = t + l.length;
90
- y < u.value ? o(y) : o(u.value - 1);
91
- }, E = (e, t) => {
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
- }, S = (e) => {
94
- if (r.value[e]) {
95
- f(e);
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 && (f(e - 1), o(e - 1));
99
- }, B = (e, t) => {
106
+ e > 0 && (m(e - 1), r(e - 1));
107
+ }, x = (e, t) => {
100
108
  if (e.key === "Backspace") {
101
- S(t);
109
+ k(t);
102
110
  return;
103
111
  }
104
- f(t);
105
- }, C = (e) => {
106
- o(e - 1);
107
- }, P = (e) => {
108
- o(e + 1);
109
- }, L = () => {
110
- o(0);
111
- }, Z = () => {
112
- o(u.value - 1);
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
- c.value || (c.value = !0, d("focus")), _(e);
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((l) => l === e) && c.value && (c.value = !1, d("blur"));
131
+ !n.value.some((a) => a === e) && d.value && (d.value = !1, f("blur"));
124
132
  });
125
- }, U = (e) => p.value > 0 ? p.value + e : p.value;
126
- z(
127
- () => a.autofocus,
133
+ }, X = (e) => p.value > 0 ? p.value + e : p.value;
134
+ D(
135
+ () => l.autofocus,
128
136
  (e) => {
129
- e && !a.disabled && o(0);
137
+ e && !l.disabled && r(0);
130
138
  },
131
139
  { immediate: !0 }
132
140
  );
133
- const k = { props: a, emit: d, id: V, name: R, autocomplete: q, tabindex: p, inputRefs: s, inputDOMRefs: n, focused: c, otpValue: r, normalizedLength: u, sanitizeValue: v, normalizeOtpValue: A, syncOtpValue: h, modifiers: j, fieldIds: N, inputMode: T, resolvedAutocomplete: $, inputPattern: w, syncInputDOMRef: g, setInputRef: x, selectField: _, focusField: o, blurFields: M, updateCharAt: f, insertValue: H, inputHandler: E, backspaceHandler: S, deleteKeyHandler: B, arrowLeftHandler: C, arrowRightHandler: P, homeHandler: L, endHandler: Z, keydownHandler: K, pasteHandler: G, focusHandler: J, blurHandler: Q, getFieldTabindex: U, NmorphTextInput: le };
134
- return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
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
- ce as default
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
- }, C = {
12
+ }, D = {
13
13
  key: 2,
14
14
  class: "nmorph-select__selected-value"
15
- }, D = ["id"];
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", C, [
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.NmorphIconLoader, { key: 0 })) : (r(), i(e.NmorphIconChevronDown, { key: 1 }))
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, D)
209
+ ], 8, C)
210
210
  ]),
211
211
  _: 3
212
212
  /* FORWARDED */
@@ -158,7 +158,7 @@ const ke = /* @__PURE__ */ ue({
158
158
  return he;
159
159
  }, get NmorphDropdown() {
160
160
  return me;
161
- }, get NmorphIconLoader() {
161
+ }, get NmorphIconLoaderDots() {
162
162
  return be;
163
163
  }, get NmorphIconChevronDown() {
164
164
  return He;
@@ -47,7 +47,7 @@ function p(e, _, k, o, y, v) {
47
47
  height: "14px"
48
48
  }, {
49
49
  default: s(() => [
50
- h(o.NmorphIconLoader)
50
+ h(o.NmorphIconLoaderDots)
51
51
  ]),
52
52
  _: 1
53
53
  /* STABLE */
@@ -1,10 +1,10 @@
1
1
  import './NmorphSwitch.css';
2
- import { defineComponent as q, ref as o, computed as n, watch as N } from "vue";
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 L = /* @__PURE__ */ q({
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, i = o(!1), g = () => {
27
- i.value = !0;
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
- i.value = !1;
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
- `${i.value && "focus"}`
36
+ `${a.value && "focus"}`
37
37
  ]
38
38
  })
39
- ), r = o(e.modelValue === e.activeValue), y = () => {
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 = o(null);
44
+ }, l = i(null);
45
45
  f({ inputDOMRef: l });
46
- const a = (t) => typeof t == "number" ? `${t}px` : t, S = n(() => ({
47
- ...e.width !== void 0 && { "--width": a(e.width) },
48
- ...e.height !== void 0 && { "--height": a(e.height) },
49
- ...e.offset !== void 0 && { "--offset": a(e.offset) },
50
- ...e.thumbHeight !== void 0 && { "--thumb-height": a(e.thumbHeight) }
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: i, focusHandler: g, blurHandler: v, modifiers: b, initialValue: r, changeHandler: y, inputDOMRef: l, getCssSize: a, styles: S, get NmorphIcon() {
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 NmorphIconLoader() {
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
- L as default
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
+ };