@nmorph/nmorph-ui-kit 2.2.36 → 2.2.37

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 (89) hide show
  1. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +8 -8
  2. package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +3 -3
  3. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +14 -13
  4. package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +1 -1
  5. package/dist/components/basic/nmorph-scroll/NmorphScroll.css +1 -0
  6. package/dist/components/basic/nmorph-scroll/NmorphScroll.vue.js +6 -4
  7. package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +1 -0
  8. package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +15 -19
  9. package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -1
  10. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +5 -5
  11. package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +37 -36
  12. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +41 -40
  13. package/dist/components/data/nmorph-card/NmorphCard.vue2.js +15 -14
  14. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +5 -9
  15. package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +3 -3
  16. package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +17 -14
  17. package/dist/components/data/nmorph-image/NmorphImage.css +1 -0
  18. package/dist/components/data/nmorph-image/NmorphImage.vue.js +14 -12
  19. package/dist/components/data/nmorph-image/NmorphImage.vue2.js +3 -2
  20. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +36 -35
  21. package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +1 -1
  22. package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +19 -18
  23. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +20 -19
  24. package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +1 -1
  25. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +39 -43
  26. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +34 -33
  27. package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +1 -1
  28. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +7 -6
  29. package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
  30. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +25 -20
  31. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +37 -37
  32. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +22 -21
  33. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +26 -25
  34. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +54 -62
  35. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +5 -5
  36. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +5 -5
  37. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +20 -19
  38. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +7 -7
  39. package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +2 -2
  40. package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +1 -1
  41. package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +3 -6
  42. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +6 -6
  43. package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
  44. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +65 -73
  45. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +4 -4
  46. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +18 -17
  47. package/dist/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue2.js +1 -1
  48. package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +25 -24
  49. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +23 -22
  50. package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
  51. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +4 -2
  52. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +17 -19
  53. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +9 -9
  54. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +43 -42
  55. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +1 -1
  56. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +32 -31
  57. package/dist/components/navigation/nmorph-tabs/NmorphTabs.vue2.js +1 -1
  58. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +1 -1
  59. package/dist/hooks/use-common-styles.js +18 -278
  60. package/dist/hooks/use-virtual-list.js +38 -32
  61. package/dist/index.umd.js +21 -281
  62. package/dist/package.json.js +1 -1
  63. package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +1 -1
  64. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
  65. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
  66. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
  67. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -4
  68. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
  69. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +1 -1
  70. package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
  71. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +1 -1
  72. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +1 -1
  73. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +1 -1
  74. package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
  75. package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
  76. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +1 -1
  77. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +1 -1
  78. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +1 -1
  79. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
  80. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +1 -1
  81. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
  82. package/dist/src/hooks/use-virtual-list.d.ts +6 -0
  83. package/dist/src/types/index.d.ts +2 -1
  84. package/dist/src/utils/common.d.ts +5 -0
  85. package/dist/src/utils/create-modifiers.d.ts +4 -2
  86. package/dist/style.css +1 -1
  87. package/dist/utils/common.js +9 -2
  88. package/dist/utils/create-modifiers.js +6 -6
  89. package/package.json +1 -1
@@ -28,7 +28,7 @@ const x = /* @__PURE__ */ u({
28
28
  i();
29
29
  const e = n, r = s, a = l(
30
30
  () => y({
31
- "nmorph-alert": [e.type, `${e.bordered && "bordered"}`, `${e.fill && "fill"}`]
31
+ "nmorph-alert": [e.type, e.bordered && "bordered", e.fill && "fill"]
32
32
  })
33
33
  ), d = l(() => ({
34
34
  "--nmorph-alert-close-align": e.closeIconPosition,
@@ -1,6 +1,7 @@
1
1
  import './NmorphCallout.css';
2
- import { defineComponent as l, computed as d } from "vue";
3
- const s = /* @__PURE__ */ l({
2
+ import { defineComponent as o, computed as l } from "vue";
3
+ import { toCssSize as t } from "../../../utils/common.js";
4
+ const s = /* @__PURE__ */ o({
4
5
  __name: "NmorphCallout",
5
6
  props: {
6
7
  type: { type: String, required: !1, default: "info" },
@@ -14,9 +15,9 @@ const s = /* @__PURE__ */ l({
14
15
  titleFontSize: { type: [Number, String], required: !1, default: "var(--font-size-medium)" },
15
16
  contentFontSize: { type: [Number, String], required: !1, default: "var(--font-size-extra-small)" }
16
17
  },
17
- setup(n, { expose: a }) {
18
+ setup(i, { expose: a }) {
18
19
  a();
19
- const e = n, t = (r) => typeof r == "number" ? `${r}px` : r, o = d(() => ({
20
+ const e = i, n = l(() => ({
20
21
  "--callout-padding": t(e.padding),
21
22
  "--callout-border-radius": t(e.borderRadius),
22
23
  "--callout-accent-width": t(e.accentWidth),
@@ -24,8 +25,8 @@ const s = /* @__PURE__ */ l({
24
25
  "--callout-title-font-size": t(e.titleFontSize),
25
26
  "--callout-content-font-size": t(e.contentFontSize),
26
27
  ...e.color !== void 0 && { "--callout-color": e.color }
27
- })), i = { props: e, getCssSize: t, styles: o };
28
- return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
28
+ })), r = { props: e, styles: n };
29
+ return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
29
30
  }
30
31
  });
31
32
  export {
@@ -1 +1 @@
1
- .nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-03);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--indentation-02);font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{flex:0 0 auto;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{flex:1 1 auto;box-sizing:border-box;min-height:0;padding:var(--indentation-02);overflow:hidden auto}
1
+ .nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-03);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--indentation-02);font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:32px;height:32px;padding:0;color:inherit;background:transparent;border:0;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{flex:1 1 auto;box-sizing:border-box;min-height:0;padding:var(--indentation-02);overflow:hidden auto}
@@ -1,38 +1,43 @@
1
1
  import './NmorphDialog.css';
2
- import s from "./NmorphDialog.vue2.js";
3
- import { openBlock as r, createBlock as c, withCtx as a, createElementVNode as e, normalizeStyle as d, normalizeClass as t, renderSlot as i, toDisplayString as m, createElementBlock as _, createVNode as n, createCommentVNode as p } from "vue";
2
+ import c from "./NmorphDialog.vue2.js";
3
+ import { openBlock as e, createBlock as d, withCtx as a, createElementVNode as l, normalizeStyle as m, normalizeClass as _, createElementBlock as i, renderSlot as s, toDisplayString as p, createVNode as n, createCommentVNode as t } from "vue";
4
4
  /* empty css */
5
5
  import h from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const f = ["aria-label"], g = { class: "nmorph-dialog__header" }, v = { class: "nmorph-dialog__title" }, k = { class: "nmorph-dialog__content" };
7
- function y(l, N, C, o, O, b) {
8
- return r(), c(o.NmorphOverlay, {
6
+ const f = ["aria-label"], g = {
7
+ key: 0,
8
+ class: "nmorph-dialog__header"
9
+ }, y = { class: "nmorph-dialog__title" }, b = ["aria-label"], k = { class: "nmorph-dialog__content" };
10
+ function v(r, C, N, o, w, x) {
11
+ return e(), d(o.NmorphOverlay, {
9
12
  show: o.isVisible,
10
13
  "z-index": o.props.zIndex,
11
14
  "close-on-escape": o.props.closeOnEscape,
12
15
  "trap-focus": "",
13
- onOnOutsideClick: o.clickOnOverlay,
16
+ onOnOutsideClick: o.overlayClickHandler,
14
17
  onOnEscapeKeydown: o.closeHandler
15
18
  }, {
16
19
  default: a(() => [
17
- e("div", {
18
- class: t(o.modifiers),
19
- style: d(o.dialogStyle),
20
+ l("div", {
21
+ class: _(o.modifiers),
22
+ style: m(o.dialogStyle),
20
23
  role: "dialog",
21
24
  "aria-modal": "true",
22
25
  "aria-label": o.props.title || void 0
23
26
  }, [
24
- e("div", g, [
25
- i(l.$slots, "header", {}, () => [
26
- e(
27
+ o.hasHeader ? (e(), i("div", g, [
28
+ s(r.$slots, "header", {}, () => [
29
+ l(
27
30
  "div",
28
- v,
29
- m(o.props.title),
31
+ y,
32
+ p(o.props.title),
30
33
  1
31
34
  /* TEXT */
32
35
  ),
33
- o.props.showClose ? (r(), _("div", {
36
+ o.props.showClose ? (e(), i("button", {
34
37
  key: 0,
35
38
  class: "nmorph-dialog__close-icon",
39
+ type: "button",
40
+ "aria-label": o.props.title ? `Close ${o.props.title}` : "Close dialog",
36
41
  onClick: o.closeHandler
37
42
  }, [
38
43
  n(o.NmorphIcon, null, {
@@ -42,11 +47,11 @@ function y(l, N, C, o, O, b) {
42
47
  _: 1
43
48
  /* STABLE */
44
49
  })
45
- ])) : p("v-if", !0)
50
+ ], 8, b)) : t("v-if", !0)
46
51
  ])
47
- ]),
48
- e("div", k, [
49
- i(l.$slots, "default")
52
+ ])) : t("v-if", !0),
53
+ l("div", k, [
54
+ s(r.$slots, "default")
50
55
  ])
51
56
  ], 14, f)
52
57
  ]),
@@ -54,7 +59,7 @@ function y(l, N, C, o, O, b) {
54
59
  /* FORWARDED */
55
60
  }, 8, ["show", "z-index", "close-on-escape"]);
56
61
  }
57
- const S = /* @__PURE__ */ h(s, [["render", y], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-dialog/NmorphDialog.vue"]]);
62
+ const S = /* @__PURE__ */ h(c, [["render", v], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-dialog/NmorphDialog.vue"]]);
58
63
  export {
59
64
  S as default
60
65
  };
@@ -1,10 +1,10 @@
1
1
  import './NmorphDialog.css';
2
- import { defineComponent as c, computed as s, ref as y, watch as h } from "vue";
3
- import { useModifiers as g } from "../../../utils/create-modifiers.js";
4
- import v from "../../basic/nmorph-icon/NmorphIcon.vue.js";
5
- import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
- import T from "../../../assets/icons/cross.svg.js";
7
- const C = /* @__PURE__ */ c({
2
+ import { defineComponent as g, useSlots as v, computed as r, ref as O, watch as T } from "vue";
3
+ import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
+ import C from "../../basic/nmorph-icon/NmorphIcon.vue.js";
5
+ import N from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
+ import _ from "../../../assets/icons/cross.svg.js";
7
+ const B = /* @__PURE__ */ g({
8
8
  __name: "NmorphDialog",
9
9
  props: {
10
10
  modelValue: { type: Boolean, required: !1, default: !1 },
@@ -20,54 +20,54 @@ const C = /* @__PURE__ */ c({
20
20
  closeOnEscape: { type: Boolean, required: !1, default: !0 }
21
21
  },
22
22
  emits: ["on-close", "update:model-value"],
23
- setup(n, { expose: m, emit: d }) {
24
- m();
25
- const e = n, r = d, p = s(
26
- () => g({
23
+ setup(d, { expose: p, emit: c }) {
24
+ p();
25
+ const e = d, a = c, i = v(), f = r(
26
+ () => q({
27
27
  "nmorph-dialog": []
28
28
  })
29
- ), f = s(() => ({
29
+ ), y = r(() => ({
30
30
  "--nmorph-dialog-width": e.width,
31
31
  ...e.maxHeight && { "--nmorph-dialog-max-height": e.maxHeight }
32
- })), a = y(e.modelValue);
33
- let o = null, l = null;
34
- h(
32
+ })), h = r(() => !!(i.header || e.title || e.showClose)), u = r(() => e.closeOnOverlay && e.closeOnClickModal), s = O(e.modelValue);
33
+ let t = null, l = null;
34
+ T(
35
35
  () => e.modelValue,
36
- (t) => {
37
- t ? (l && clearTimeout(l), o = setTimeout(() => {
38
- a.value = !0;
39
- }, e.openDelay)) : (o && clearTimeout(o), l = setTimeout(() => {
40
- a.value = !1;
36
+ (o) => {
37
+ o ? (l && clearTimeout(l), t = setTimeout(() => {
38
+ s.value = !0;
39
+ }, e.openDelay)) : (t && clearTimeout(t), l = setTimeout(() => {
40
+ s.value = !1;
41
41
  }, e.closeDelay));
42
42
  },
43
43
  { immediate: !0 }
44
44
  );
45
- const i = () => {
46
- r("on-close"), o && clearTimeout(o);
47
- const t = () => {
48
- r("update:model-value", !1);
45
+ const n = () => {
46
+ a("on-close"), t && clearTimeout(t);
47
+ const o = () => {
48
+ a("update:model-value", !1);
49
49
  };
50
- e.closeDelay <= 0 ? t() : l = setTimeout(t, e.closeDelay);
51
- }, u = { props: e, emit: r, modifiers: p, dialogStyle: f, isVisible: a, get openTimeout() {
52
- return o;
53
- }, set openTimeout(t) {
54
- o = t;
50
+ e.closeDelay <= 0 ? o() : l = setTimeout(o, e.closeDelay);
51
+ }, m = { props: e, emit: a, slots: i, modifiers: f, dialogStyle: y, hasHeader: h, shouldCloseOnOverlay: u, isVisible: s, get openTimeout() {
52
+ return t;
53
+ }, set openTimeout(o) {
54
+ t = o;
55
55
  }, get closeTimeout() {
56
56
  return l;
57
- }, set closeTimeout(t) {
58
- l = t;
59
- }, closeHandler: i, clickOnOverlay: () => {
60
- e.closeOnOverlay && i();
57
+ }, set closeTimeout(o) {
58
+ l = o;
59
+ }, closeHandler: n, overlayClickHandler: () => {
60
+ u.value && n();
61
61
  }, get NmorphOverlay() {
62
- return O;
62
+ return N;
63
63
  }, get NmorphIcon() {
64
- return v;
64
+ return C;
65
65
  }, get NmorphIconCross() {
66
- return T;
66
+ return _;
67
67
  } };
68
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
68
+ return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
69
69
  }
70
70
  });
71
71
  export {
72
- C as default
72
+ B as default
73
73
  };
@@ -1,10 +1,11 @@
1
1
  import './NmorphDrawer.css';
2
- import { defineComponent as y, useSlots as h, computed as o } from "vue";
3
- import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
- import _ from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
5
- import g from "../../basic/nmorph-icon/NmorphIcon.vue.js";
6
- import N from "../../../assets/icons/cross.svg.js";
7
- const w = /* @__PURE__ */ y({
2
+ import { defineComponent as m, useSlots as c, computed as o } from "vue";
3
+ import { useModifiers as y } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as h } from "../../../utils/common.js";
5
+ import q from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
+ import _ from "../../basic/nmorph-icon/NmorphIcon.vue.js";
7
+ import v from "../../../assets/icons/cross.svg.js";
8
+ const w = /* @__PURE__ */ m({
8
9
  __name: "NmorphDrawer",
9
10
  props: {
10
11
  modelValue: { type: Boolean, required: !1, default: !1 },
@@ -20,26 +21,26 @@ const w = /* @__PURE__ */ y({
20
21
  contentClass: { type: String, required: !1, default: "" }
21
22
  },
22
23
  emits: ["on-close", "update:model-value"],
23
- setup(p, { expose: u, emit: d }) {
24
- u();
25
- const e = p, r = d, l = h(), i = o(
26
- () => q({
27
- "nmorph-drawer": [e.placement, `${e.modelValue && "open"}`]
24
+ setup(a, { expose: n, emit: u }) {
25
+ n();
26
+ const e = a, r = u, t = c(), d = o(
27
+ () => y({
28
+ "nmorph-drawer": [e.placement, e.modelValue && "open"]
28
29
  })
29
- ), s = (t) => typeof t == "number" ? `${t}px` : t, f = o(() => ({
30
- "--nmorph-drawer-size": s(e.size)
31
- })), a = () => {
30
+ ), p = o(() => ({
31
+ "--nmorph-drawer-size": h(e.size)
32
+ })), l = () => {
32
33
  r("on-close"), r("update:model-value", !1);
33
- }, m = () => {
34
- e.closeOnOverlay && a();
35
- }, c = o(() => !!(l.header || e.title || e.showClose)), n = { props: e, emit: r, slots: l, modifiers: i, getCssSize: s, drawerStyle: f, closeHandler: a, overlayClickHandler: m, hasHeader: c, get NmorphIcon() {
36
- return g;
34
+ }, i = () => {
35
+ e.closeOnOverlay && l();
36
+ }, f = o(() => !!(t.header || e.title || e.showClose)), s = { props: e, emit: r, slots: t, modifiers: d, drawerStyle: p, closeHandler: l, overlayClickHandler: i, hasHeader: f, get NmorphIcon() {
37
+ return _;
37
38
  }, get NmorphIconCross() {
38
- return N;
39
+ return v;
39
40
  }, get NmorphOverlay() {
40
- return _;
41
+ return q;
41
42
  } };
42
- return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
43
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
43
44
  }
44
45
  });
45
46
  export {
@@ -1,9 +1,10 @@
1
1
  import './NmorphTooltip.css';
2
- import { defineComponent as w, ref as r, computed as n } from "vue";
3
- import { useModifiers as S } from "../../../utils/create-modifiers.js";
4
- import { usePlacement as _ } from "../../../hooks/use-placement.js";
5
- import { useZIndex as g } from "../../../hooks/use-z-index.js";
6
- const z = /* @__PURE__ */ w({
2
+ import { defineComponent as y, ref as o, computed as r } from "vue";
3
+ import { useModifiers as w } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as i } from "../../../utils/common.js";
5
+ import { usePlacement as S } from "../../../hooks/use-placement.js";
6
+ import { useZIndex as _ } from "../../../hooks/use-z-index.js";
7
+ const z = /* @__PURE__ */ y({
7
8
  __name: "NmorphTooltip",
8
9
  props: {
9
10
  text: { type: String, required: !1, default: "" },
@@ -15,35 +16,35 @@ const z = /* @__PURE__ */ w({
15
16
  maxWidth: { type: [Number, String], required: !1, default: void 0 },
16
17
  height: { type: [Number, String], required: !1, default: void 0 }
17
18
  },
18
- setup(c, { expose: m }) {
19
- const e = c, t = r(e.forceShow), l = r(null), d = r(null), { placement: a } = _({
19
+ setup(p, { expose: m }) {
20
+ const e = p, t = o(e.forceShow), n = o(null), l = o(null), { placement: d } = S({
20
21
  initialPlacement: e.position,
21
- contentDOMElement: l,
22
- relativeElement: d
23
- }), h = n(
24
- () => S({
22
+ contentDOMElement: n,
23
+ relativeElement: l
24
+ }), c = r(
25
+ () => w({
25
26
  "nmorph-tooltip": [
26
- a.value,
27
- `${!!e.forceCoordinate?.x && !!e.forceCoordinate?.y && "force-coords"}`
27
+ d.value,
28
+ !!e.forceCoordinate?.x && !!e.forceCoordinate?.y && "force-coords"
28
29
  ]
29
30
  })
30
- ), v = () => {
31
+ ), h = () => {
31
32
  t.value = !0;
32
- }, x = () => {
33
+ }, v = () => {
33
34
  e.forceShow || (t.value = !1);
34
- }, o = (i) => typeof i == "number" ? `${i}px` : i, s = n(() => e.forceCoordinate ? "100%" : "auto"), u = g(
35
+ }, a = r(() => e.forceCoordinate ? "100%" : "auto"), u = _(
35
36
  () => t.value,
36
37
  () => e.zIndex
37
- ), y = n(() => ({
38
- "--nmorph-tooltip-width": s.value,
38
+ ), x = r(() => ({
39
+ "--nmorph-tooltip-width": a.value,
39
40
  "--nmorph-tooltip-z-index": u.value,
40
- ...e.width !== void 0 && { "--width": o(e.width) },
41
- ...e.maxWidth !== void 0 && { "--max-width": o(e.maxWidth) },
42
- ...e.height !== void 0 && { "--height": o(e.height) }
43
- })), f = r(null);
44
- m({ tooltipBody: f });
45
- const p = { props: e, showTooltip: t, tooltipDOMRef: l, slotDOMRef: d, placement: a, modifiers: h, handleMouseEnter: v, handleMouseLeave: x, getCssSize: o, rootWidth: s, zIndex: u, styles: y, tooltipBody: f };
46
- return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
41
+ ...e.width !== void 0 && { "--width": i(e.width) },
42
+ ...e.maxWidth !== void 0 && { "--max-width": i(e.maxWidth) },
43
+ ...e.height !== void 0 && { "--height": i(e.height) }
44
+ })), s = o(null);
45
+ m({ tooltipBody: s });
46
+ const f = { props: e, showTooltip: t, tooltipDOMRef: n, slotDOMRef: l, placement: d, modifiers: c, handleMouseEnter: h, handleMouseLeave: v, rootWidth: a, zIndex: u, styles: x, tooltipBody: s };
47
+ return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
47
48
  }
48
49
  });
49
50
  export {
@@ -1,14 +1,15 @@
1
1
  import './NmorphAutocomplete.css';
2
- import { defineComponent as K, ref as s, computed as t, watch as c, nextTick as Q } from "vue";
3
- import { useModifiers as M } from "../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as W } from "../../../types/index.js";
5
- import { useVirtualList as X } from "../../../hooks/use-virtual-list.js";
2
+ import { defineComponent as G, ref as s, computed as l, watch as c, nextTick as J } from "vue";
3
+ import { useModifiers as C } from "../../../utils/create-modifiers.js";
4
+ import { getNmorphOptionHeight as K, toCssSize as Q, resolveDomElement as W } from "../../../utils/common.js";
5
+ import { NmorphComponentHeight as X } from "../../../types/index.js";
6
+ import { useVirtualList as Y } from "../../../hooks/use-virtual-list.js";
6
7
  import { useZIndex as ee } from "../../../hooks/use-z-index.js";
7
8
  import te from "../nmorph-text-input/NmorphTextInput.vue.js";
8
9
  import ae from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
10
  import le from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
11
  import re from "../../../assets/icons/loader.svg.js";
11
- const ve = /* @__PURE__ */ K({
12
+ const fe = /* @__PURE__ */ G({
12
13
  __name: "NmorphAutocomplete",
13
14
  props: {
14
15
  modelValue: { type: String, required: !1, default: "" },
@@ -30,81 +31,72 @@ const ve = /* @__PURE__ */ K({
30
31
  tabindex: { type: Number, required: !1 }
31
32
  },
32
33
  emits: ["update:model-value", "select"],
33
- setup(O, { expose: $, emit: L }) {
34
- $();
35
- const a = O, o = s(a.modelValue), p = L, T = t(
36
- () => M({
37
- "nmorph-autocomplete": [`${l.value && "open"}`]
34
+ setup(_, { expose: O, emit: L }) {
35
+ O();
36
+ const t = _, o = s(t.modelValue), d = L, V = l(
37
+ () => C({
38
+ "nmorph-autocomplete": [a.value && "open"]
38
39
  })
39
40
  ), i = s(!1), y = (e) => {
40
- i.value = e === "", o.value = e, l.value = !i.value && r.value.length > 0, u.value = 0, p("update:model-value", o.value);
41
- }, V = t({
41
+ i.value = e === "", o.value = e, a.value = !i.value && r.value.length > 0, u.value = 0, d("update:model-value", o.value);
42
+ }, A = l({
42
43
  get: () => o.value,
43
44
  set: y
44
- }), l = s(!1), A = s(null), b = () => {
45
- i.value = !0, l.value = !1;
46
- }, r = t(() => a.list.filter((e) => Object.keys(e).some((g) => String(e[g]).toLowerCase().includes(o.value.toLowerCase())))), f = t(() => a.virtual && r.value.length > 0), x = t(() => ({
47
- basic: 30,
48
- thick: 38,
49
- thin: 22
50
- })[a.height || "basic"]), I = t(() => a.virtualItemHeight || x.value), H = t(() => a.virtualOverscan), q = t(() => a.virtualDynamicHeight), n = X(r, {
51
- enabled: f,
52
- itemHeight: I,
53
- overscan: H,
54
- dynamic: q
55
- }), z = t(() => n.virtualItems.value), B = t(() => ({
56
- height: `${n.totalHeight.value}px`
57
- })), E = t(() => ({
58
- transform: `translateY(${n.offsetTop.value}px)`
59
- })), N = (e) => typeof e == "number" ? `${e}px` : e, j = t(() => N(a.virtualMaxHeight)), u = s(0), v = t(() => r.value[u.value]), m = t(() => `${a.id || a.name || "nmorph-autocomplete"}-listbox`), w = (e) => `${m.value}-option-${e}`;
45
+ }), a = s(!1), M = s(null), I = () => {
46
+ i.value = !0, a.value = !1;
47
+ }, r = l(() => t.list.filter((e) => Object.keys(e).some((g) => String(e[g]).toLowerCase().includes(o.value.toLowerCase())))), m = l(() => t.virtual && r.value.length > 0), b = l(() => t.virtualItemHeight || K(t.height)), x = l(() => t.virtualOverscan), H = l(() => t.virtualDynamicHeight), n = Y(r, {
48
+ enabled: m,
49
+ itemHeight: b,
50
+ overscan: x,
51
+ dynamic: H
52
+ }), T = l(() => n.virtualItems.value), z = n.spacerStyle, B = n.contentStyle, E = l(() => Q(t.virtualMaxHeight)), u = s(0), v = l(() => r.value[u.value]), f = l(() => `${t.id || t.name || "nmorph-autocomplete"}-listbox`), q = (e) => `${f.value}-option-${e}`;
60
53
  c(
61
- () => a.modelValue,
54
+ () => t.modelValue,
62
55
  (e) => {
63
56
  e !== o.value && (o.value = e);
64
57
  }
65
58
  ), c(r, async (e) => {
66
- l.value = !i.value && o.value !== "" && e.length > 0, u.value = 0, await Q(), n.scrollToIndex(0), n.refresh();
59
+ a.value = !i.value && o.value !== "" && e.length > 0, u.value = 0, await J(), n.scrollToIndex(0), n.refresh();
67
60
  });
68
61
  const h = (e) => {
69
- p("select", e), o.value = e.value, p("update:model-value", o.value), setTimeout(() => {
70
- i.value = !0, l.value = !1;
62
+ d("select", e), o.value = e.value, d("update:model-value", o.value), setTimeout(() => {
63
+ i.value = !0, a.value = !1;
71
64
  });
72
- }, R = (e) => {
65
+ }, $ = (e) => {
73
66
  h(e);
74
- }, U = () => {
75
- i.value = !1, l.value = r.value.length > 0;
76
- }, d = s(!1);
67
+ }, j = () => {
68
+ i.value = !1, a.value = r.value.length > 0;
69
+ }, p = s(!1);
77
70
  c(o, async (e) => {
78
- e !== "" && a.actionCallback && (d.value = !0, await a.actionCallback(), d.value = !1);
79
- }), c(d, (e) => {
80
- e && (l.value = !0);
71
+ e !== "" && t.actionCallback && (p.value = !0, await t.actionCallback(), p.value = !1);
72
+ }), c(p, (e) => {
73
+ e && (a.value = !0);
81
74
  }), c(u, (e) => {
82
- f.value && n.scrollToIndex(e);
75
+ m.value && n.scrollToIndex(e);
83
76
  });
84
- const D = () => {
85
- r.value.length && (l.value = !0, u.value = (u.value + 1) % r.value.length);
77
+ const N = () => {
78
+ r.value.length && (a.value = !0, u.value = (u.value + 1) % r.value.length);
79
+ }, D = () => {
80
+ r.value.length && (a.value = !0, u.value = (u.value - 1 + r.value.length) % r.value.length);
86
81
  }, S = () => {
87
- r.value.length && (l.value = !0, u.value = (u.value - 1 + r.value.length) % r.value.length);
88
- }, k = () => {
89
- !l.value || !v.value || h(v.value);
90
- }, Z = (e) => {
91
- e.key === "ArrowDown" ? (e.preventDefault(), D()) : e.key === "ArrowUp" ? (e.preventDefault(), S()) : e.key === "Enter" ? (e.preventDefault(), k()) : e.key === "Escape" && (e.preventDefault(), b());
92
- }, F = t(() => ({
82
+ !a.value || !v.value || h(v.value);
83
+ }, R = (e) => {
84
+ e.key === "ArrowDown" ? (e.preventDefault(), N()) : e.key === "ArrowUp" ? (e.preventDefault(), D()) : e.key === "Enter" ? (e.preventDefault(), S()) : e.key === "Escape" && (e.preventDefault(), I());
85
+ }, U = l(() => ({
93
86
  role: "combobox",
94
87
  "aria-autocomplete": "list",
95
- "aria-expanded": l.value,
96
- "aria-controls": m.value,
97
- "aria-activedescendant": l.value ? w(u.value) : void 0
98
- })), P = (e, g) => {
99
- const J = e instanceof Element ? e : e?.$el;
100
- n.measureElement(g, J);
101
- }, C = ee(l, () => a.zIndex), Y = t(() => ({
102
- "--nmorph-autocomplete-input-z-index": C.value + 1
103
- })), G = t(
104
- () => M({
105
- nmorph: [W[a.height]]
88
+ "aria-expanded": a.value,
89
+ "aria-controls": f.value,
90
+ "aria-activedescendant": a.value ? q(u.value) : void 0
91
+ })), Z = (e, g) => {
92
+ n.measureElement(g, W(e));
93
+ }, w = ee(a, () => t.zIndex), F = l(() => ({
94
+ "--nmorph-autocomplete-input-z-index": w.value + 1
95
+ })), P = l(
96
+ () => C({
97
+ nmorph: [X[t.height]]
106
98
  })
107
- ), _ = { props: a, initialValue: o, emit: p, modifiers: T, userClosed: i, updateValueHandler: y, inputValue: V, open: l, nmorphAutocompleteDOMRef: A, closeHandler: b, filteredList: r, virtualEnabled: f, defaultOptionHeight: x, virtualItemHeight: I, virtualOverscan: H, virtualDynamicHeight: q, virtualList: n, virtualItems: z, virtualSpacerStyle: B, virtualContentStyle: E, getCssSize: N, virtualMaxHeight: j, currentIndex: u, activeItem: v, listboxId: m, getOptionId: w, selectItem: h, clickHandler: R, focusHandler: U, loader: d, arrowDownHandler: D, arrowUpHandler: S, enterHandler: k, keydownHandler: Z, inputAttrs: F, setVirtualItemRef: P, dropdownZIndex: C, styles: Y, optionHeightModifiers: G, get NmorphIcon() {
99
+ ), k = { props: t, initialValue: o, emit: d, modifiers: V, userClosed: i, updateValueHandler: y, inputValue: A, open: a, nmorphAutocompleteDOMRef: M, closeHandler: I, filteredList: r, virtualEnabled: m, virtualItemHeight: b, virtualOverscan: x, virtualDynamicHeight: H, virtualList: n, virtualItems: T, virtualSpacerStyle: z, virtualContentStyle: B, virtualMaxHeight: E, currentIndex: u, activeItem: v, listboxId: f, getOptionId: q, selectItem: h, clickHandler: $, focusHandler: j, loader: p, arrowDownHandler: N, arrowUpHandler: D, enterHandler: S, keydownHandler: R, inputAttrs: U, setVirtualItemRef: Z, dropdownZIndex: w, styles: F, optionHeightModifiers: P, get NmorphIcon() {
108
100
  return le;
109
101
  }, get NmorphDropdown() {
110
102
  return ae;
@@ -113,9 +105,9 @@ const ve = /* @__PURE__ */ K({
113
105
  }, get NmorphIconLoaderDots() {
114
106
  return re;
115
107
  } };
116
- return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
108
+ return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
117
109
  }
118
110
  });
119
111
  export {
120
- ve as default
112
+ fe as default
121
113
  };
@@ -2,7 +2,7 @@ import './NmorphCheckbox.css';
2
2
  import { defineComponent as y, inject as u, watch as k, ref as i, computed as r } from "vue";
3
3
  import { useModifiers as x } from "../../../utils/create-modifiers.js";
4
4
  import { NmorphSelectionControlHeight as S } from "../../../types/index.js";
5
- const $ = /* @__PURE__ */ y({
5
+ const j = /* @__PURE__ */ y({
6
6
  __name: "NmorphCheckbox",
7
7
  props: {
8
8
  id: { type: String, required: !1, default: "" },
@@ -41,9 +41,9 @@ const $ = /* @__PURE__ */ y({
41
41
  () => x({
42
42
  nmorph: [S[c.value]],
43
43
  "nmorph-checkbox": [
44
- `${s.value && "checked"}`,
45
- `${e.disabled && "disabled"}`,
46
- `${e.design === "button" && "button"}`
44
+ s.value && "checked",
45
+ e.disabled && "disabled",
46
+ e.design === "button" && "button"
47
47
  ]
48
48
  })
49
49
  ), h = { groupSelectedValue: l, changeValue: a, groupHeight: n, props: e, inputDOMRef: d, hasGroup: o, initialValue: t, checked: s, height: c, emit: p, handleChange: g, modifiers: b };
@@ -51,5 +51,5 @@ const $ = /* @__PURE__ */ y({
51
51
  }
52
52
  });
53
53
  export {
54
- $ as default
54
+ j as default
55
55
  };
@@ -42,7 +42,7 @@ const E = /* @__PURE__ */ R({
42
42
  ], y = (e) => {
43
43
  const [r, t, n] = p(e);
44
44
  return `rgb(${r}, ${t}, ${n})`;
45
- }, $ = (e) => {
45
+ }, v = (e) => {
46
46
  const [r, t, n] = p(e).map((P) => P / 255), l = Math.max(r, t, n), u = Math.min(r, t, n), f = (l + u) / 2;
47
47
  if (l === u)
48
48
  return `hsl(0, 0%, ${Math.round(f * 100)}%)`;
@@ -55,11 +55,11 @@ const E = /* @__PURE__ */ R({
55
55
  }), q({ inputDOMRef: c });
56
56
  const F = C(
57
57
  () => H({
58
- nmorph: [B[o.height], `${b.value && "focused"}`],
59
- "nmorph-color-picker": [`${o.disabled && "disabled"}`, o.displayFormat]
58
+ nmorph: [B[o.height], b.value && "focused"],
59
+ "nmorph-color-picker": [o.disabled && "disabled", o.displayFormat]
60
60
  })
61
- ), w = C(() => o.displayFormat === "rgb" ? y(a.value) : o.displayFormat === "hsl" ? $(a.value) : a.value.toUpperCase()), v = { props: o, emit: g, id: V, name: S, tabindex: x, normalizeColor: s, inputDOMRef: c, resolveAccentColor: m, currentValue: a, focused: b, handleInput: I, hexToRgb: p, formatRgb: y, formatHsl: $, modifiers: F, displayValue: w };
62
- return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
61
+ ), w = C(() => o.displayFormat === "rgb" ? y(a.value) : o.displayFormat === "hsl" ? v(a.value) : a.value.toUpperCase()), $ = { props: o, emit: g, id: V, name: S, tabindex: x, normalizeColor: s, inputDOMRef: c, resolveAccentColor: m, currentValue: a, focused: b, handleInput: I, hexToRgb: p, formatRgb: y, formatHsl: v, modifiers: F, displayValue: w };
62
+ return Object.defineProperty($, "__isScriptSetup", { enumerable: !1, value: !0 }), $;
63
63
  }
64
64
  });
65
65
  export {