@nmorph/nmorph-ui-kit 2.2.36 → 2.2.38

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 (114) 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 +19 -15
  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 +65 -71
  35. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
  36. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +30 -28
  37. package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +25 -20
  38. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +43 -42
  39. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +53 -40
  40. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +20 -16
  41. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +113 -86
  42. package/dist/components/form/nmorph-form/NmorphForm.vue2.js +9 -9
  43. package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +33 -24
  44. package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +1 -1
  45. package/dist/components/form/nmorph-form/use-form-item-input.js +29 -8
  46. package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +42 -39
  47. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +66 -62
  48. package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
  49. package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
  50. package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +24 -22
  51. package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
  52. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +83 -81
  53. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +4 -4
  54. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -25
  55. package/dist/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue2.js +1 -1
  56. package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +51 -49
  57. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +35 -33
  58. package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
  59. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +5 -3
  60. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
  61. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +1 -1
  62. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +30 -26
  63. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +1 -1
  64. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +68 -66
  65. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +1 -1
  66. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +32 -31
  67. package/dist/components/navigation/nmorph-tabs/NmorphTabs.vue2.js +1 -1
  68. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +1 -1
  69. package/dist/hooks/use-common-styles.js +18 -278
  70. package/dist/hooks/use-field-validation.js +71 -42
  71. package/dist/hooks/use-form-validation.js +62 -24
  72. package/dist/hooks/use-virtual-list.js +38 -32
  73. package/dist/index.umd.js +26 -286
  74. package/dist/package.json.js +1 -1
  75. package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +2 -2
  76. package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +1 -1
  77. package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -1
  78. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
  79. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
  80. package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +1 -1
  81. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
  82. package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +1 -1
  83. package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +1 -1
  84. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
  85. package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +1 -1
  86. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -4
  87. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
  88. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +3 -3
  89. package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
  90. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +3 -3
  91. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +6 -3
  92. package/dist/src/components/form/nmorph-file-upload/types.d.ts +4 -0
  93. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +1 -1
  94. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +1 -1
  95. package/dist/src/components/form/nmorph-form/types.d.ts +15 -5
  96. package/dist/src/components/form/nmorph-form/use-form-item-input.d.ts +10 -0
  97. package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
  98. package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
  99. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +3 -3
  100. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +1 -1
  101. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +1 -1
  102. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
  103. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +1 -1
  104. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
  105. package/dist/src/hooks/use-field-validation.d.ts +15 -0
  106. package/dist/src/hooks/use-form-validation.d.ts +5 -0
  107. package/dist/src/hooks/use-virtual-list.d.ts +6 -0
  108. package/dist/src/types/index.d.ts +2 -1
  109. package/dist/src/utils/common.d.ts +5 -0
  110. package/dist/src/utils/create-modifiers.d.ts +4 -2
  111. package/dist/style.css +1 -1
  112. package/dist/utils/common.js +9 -3
  113. package/dist/utils/create-modifiers.js +6 -6
  114. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { NmorphComponentHeight as y } from "../../../types/index.js";
4
4
  import { useModifiers as b } from "../../../utils/create-modifiers.js";
5
5
  import g from "../../../assets/icons/loading.svg.js";
6
6
  import q from "../nmorph-icon/NmorphIcon.vue.js";
7
- const $ = /* @__PURE__ */ c({
7
+ const x = /* @__PURE__ */ c({
8
8
  __name: "NmorphButton",
9
9
  props: {
10
10
  styleType: { type: null, required: !1, default: "default" },
@@ -26,15 +26,15 @@ const $ = /* @__PURE__ */ c({
26
26
  setup(i, { expose: u }) {
27
27
  const e = i, t = m(), s = o(() => !!t.icon), r = o(() => !!t["icon-only"]), p = o(
28
28
  () => b({
29
- nmorph: [y[e.height], `${e.fill && "fill"}`],
29
+ nmorph: [y[e.height], e.fill && "fill"],
30
30
  "nmorph-button": [
31
31
  e.styleType,
32
32
  e.shape,
33
- `${e.disabled && "disabled"}`,
34
- `${e.accentBgOnHover && "accent-bg-on-hover"}`,
35
- `${e.ripple && "ripple"}`,
36
- `${r.value && "icon-only"}`,
37
- `${e.color && "custom-color"}`
33
+ e.disabled && "disabled",
34
+ e.accentBgOnHover && "accent-bg-on-hover",
35
+ e.ripple && "ripple",
36
+ r.value && "icon-only",
37
+ e.color && "custom-color"
38
38
  ]
39
39
  })
40
40
  ), l = h(null), n = {
@@ -56,5 +56,5 @@ const $ = /* @__PURE__ */ c({
56
56
  }
57
57
  });
58
58
  export {
59
- $ as default
59
+ x as default
60
60
  };
@@ -14,9 +14,9 @@ const p = /* @__PURE__ */ h({
14
14
  const e = r, d = i(
15
15
  () => l({
16
16
  "nmorph-icon": [
17
- `${!e.width && !e.height && e.size}`,
18
- `${e.width && "custom-width"}`,
19
- `${e.height && "custom-height"}`
17
+ !e.width && !e.height && e.size,
18
+ e.width && "custom-width",
19
+ e.height && "custom-height"
20
20
  ]
21
21
  })
22
22
  ), n = i(() => {
@@ -1,7 +1,8 @@
1
1
  import './NmorphLayout.css';
2
- import { defineComponent as l, useSlots as d, computed as r } from "vue";
3
- import { useModifiers as f } from "../../../utils/create-modifiers.js";
4
- const g = /* @__PURE__ */ l({
2
+ import { defineComponent as p, useSlots as d, computed as o } from "vue";
3
+ import { useModifiers as n } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as r } from "../../../utils/common.js";
5
+ const g = /* @__PURE__ */ p({
5
6
  __name: "NmorphLayout",
6
7
  props: {
7
8
  tag: { type: String, required: !1, default: "section" },
@@ -10,17 +11,17 @@ const g = /* @__PURE__ */ l({
10
11
  asidePosition: { type: String, required: !1, default: "left" },
11
12
  fullHeight: { type: Boolean, required: !1, default: !1 }
12
13
  },
13
- setup(i, { expose: a }) {
14
- a();
15
- const e = i, p = d(), u = r(
16
- () => f({
17
- "nmorph-layout": [`aside-${e.asidePosition}`, `${e.fullHeight && "full-height"}`]
14
+ setup(s, { expose: i }) {
15
+ i();
16
+ const e = s, a = d(), u = o(
17
+ () => n({
18
+ "nmorph-layout": [`aside-${e.asidePosition}`, e.fullHeight && "full-height"]
18
19
  })
19
- ), t = (s) => typeof s == "number" ? `${s}px` : s, n = r(() => ({
20
- "--nmorph-layout-gap": t(e.gap),
21
- "--nmorph-layout-aside-width": t(e.asideWidth)
22
- })), o = { props: e, slots: p, modifiers: u, getCssSize: t, styles: n };
23
- return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
20
+ ), l = o(() => ({
21
+ "--nmorph-layout-gap": r(e.gap),
22
+ "--nmorph-layout-aside-width": r(e.asideWidth)
23
+ })), t = { props: e, slots: a, modifiers: u, styles: l };
24
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
24
25
  }
25
26
  });
26
27
  export {
@@ -23,7 +23,7 @@ const b = /* @__PURE__ */ c({
23
23
  return e.iconName in o ? o[e.iconName] : o[`NmorphIcon${t(e.iconName)}`];
24
24
  }), d = r(
25
25
  () => y({
26
- "nmorph-link": [e.type, `${e.underline && "underline"}`, `${e.disabled && "disabled"}`]
26
+ "nmorph-link": [e.type, e.underline && "underline", e.disabled && "disabled"]
27
27
  })
28
28
  ), u = r(() => ({
29
29
  ...e.color !== void 0 && { "--link-color": e.color }
@@ -0,0 +1 @@
1
+ .nmorph-scroll{--thumb-color: var(--nmorph-scroll-thumb-color, var(--nmorph-text-color));color-scheme:var(--nmorph-scroll-color-scheme, light);scrollbar-color:var(--thumb-color) transparent;scrollbar-width:thin}.nmorph-scroll::-webkit-scrollbar{width:var(--bar-width);height:var(--bar-height);background-color:transparent;cursor:pointer;transition:width ease-in-out .2s}.nmorph-scroll::-webkit-scrollbar-button,.nmorph-scroll::-webkit-scrollbar-button:single-button,.nmorph-scroll::-webkit-scrollbar-button:double-button,.nmorph-scroll::-webkit-scrollbar-button:vertical:start:decrement,.nmorph-scroll::-webkit-scrollbar-button:vertical:end:increment,.nmorph-scroll::-webkit-scrollbar-button:horizontal:start:decrement,.nmorph-scroll::-webkit-scrollbar-button:horizontal:end:increment{display:none!important;width:0!important;min-width:0!important;max-width:0!important;height:0!important;min-height:0!important;max-height:0!important;background:transparent!important;background-image:none!important;border:0!important;appearance:none}.nmorph-scroll::-webkit-scrollbar-track{background:transparent;border-radius:var(--border-radius-40);box-shadow:var(--nmorph-shadow-inset)}.nmorph-scroll::-webkit-scrollbar-thumb{background-color:var(--thumb-color);border-radius:var(--border-radius-40)}.nmorph-scroll::-webkit-scrollbar-corner{background-color:transparent}
@@ -1,7 +1,9 @@
1
+ import './NmorphScroll.css';
1
2
  import e from "./NmorphScroll.vue2.js";
2
3
  import { openBlock as l, createElementBlock as i, normalizeStyle as n, normalizeClass as a, renderSlot as t } from "vue";
3
- import d from "../../../_virtual/_plugin-vue_export-helper.js";
4
- function m(r, c, h, o, s, f) {
4
+ /* empty css */
5
+ import m from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ function d(r, c, h, o, s, f) {
5
7
  return l(), i(
6
8
  "div",
7
9
  {
@@ -32,7 +34,7 @@ function m(r, c, h, o, s, f) {
32
34
  /* CLASS, STYLE, NEED_HYDRATION */
33
35
  );
34
36
  }
35
- const _ = /* @__PURE__ */ d(e, [["render", m], ["__file", "/builds/ketjo/nmorph/library/src/components/basic/nmorph-scroll/NmorphScroll.vue"]]);
37
+ const H = /* @__PURE__ */ m(e, [["render", d], ["__file", "/builds/ketjo/nmorph/library/src/components/basic/nmorph-scroll/NmorphScroll.vue"]]);
36
38
  export {
37
- _ as default
39
+ H as default
38
40
  };
@@ -1,3 +1,4 @@
1
+ import './NmorphScroll.css';
1
2
  import { defineComponent as C, ref as d, computed as t, inject as G, onUnmounted as X, onMounted as Y, nextTick as P, watch as S } from "vue";
2
3
  import { useModifiers as $ } from "../../../utils/create-modifiers.js";
3
4
  const k = /* @__PURE__ */ C({
@@ -1,7 +1,8 @@
1
1
  import './NmorphSpace.css';
2
- import { defineComponent as d, computed as r } from "vue";
2
+ import { defineComponent as d, computed as t } from "vue";
3
3
  import { useModifiers as m } from "../../../utils/create-modifiers.js";
4
- const g = /* @__PURE__ */ d({
4
+ import { toCssSize as c } from "../../../utils/common.js";
5
+ const _ = /* @__PURE__ */ d({
5
6
  __name: "NmorphSpace",
6
7
  props: {
7
8
  tag: { type: String, required: !1, default: "div" },
@@ -13,33 +14,28 @@ const g = /* @__PURE__ */ d({
13
14
  inline: { type: Boolean, required: !1, default: !1 },
14
15
  fill: { type: Boolean, required: !1, default: !1 }
15
16
  },
16
- setup(f, { expose: p }) {
17
+ setup(o, { expose: p }) {
17
18
  p();
18
- const e = f, i = {
19
+ const e = o, r = {
19
20
  small: "4px",
20
21
  medium: "8px",
21
22
  large: "16px"
22
- }, o = r(
23
+ }, f = t(
23
24
  () => m({
24
- "nmorph-space": [
25
- e.direction,
26
- `${e.wrap && "wrap"}`,
27
- `${e.inline && "inline"}`,
28
- `${e.fill && "fill"}`
29
- ]
25
+ "nmorph-space": [e.direction, e.wrap && "wrap", e.inline && "inline", e.fill && "fill"]
30
26
  })
31
- ), s = (t) => typeof t == "number" ? `${t}px` : i[t] || t, a = r(
27
+ ), i = (n) => c(r[n] || n), s = t(
32
28
  () => e.align === "start" || e.align === "end" ? `flex-${e.align}` : e.align
33
- ), n = r(
29
+ ), a = t(
34
30
  () => e.justify === "start" || e.justify === "end" ? `flex-${e.justify}` : e.justify
35
- ), u = r(() => ({
36
- "--nmorph-space-gap": s(e.size),
37
- "--nmorph-space-align": a.value,
38
- "--nmorph-space-justify": n.value
39
- })), l = { props: e, sizeMap: i, modifiers: o, getCssSize: s, alignItems: a, justifyContent: n, styles: u };
31
+ ), u = t(() => ({
32
+ "--nmorph-space-gap": i(e.size),
33
+ "--nmorph-space-align": s.value,
34
+ "--nmorph-space-justify": a.value
35
+ })), l = { props: e, sizeMap: r, modifiers: f, resolveSpaceSize: i, alignItems: s, justifyContent: a, styles: u };
40
36
  return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
41
37
  }
42
38
  });
43
39
  export {
44
- g as default
40
+ _ as default
45
41
  };
@@ -1 +1 @@
1
- .nmorph-avatar--preview:hover>.nmorph-image{filter:brightness(.8)}
1
+ .nmorph-avatar{position:relative;display:flex;justify-content:center;align-items:center;overflow:hidden}.nmorph-avatar--circle{border-radius:var(--border-radius-circular)}.nmorph-avatar--square{border-radius:var(--default-border-radius)}.nmorph-avatar>.nmorph-image{--width: var(--nmorph-avatar-size);--height: var(--nmorph-avatar-size);position:absolute;padding:var(--nmorph-avatar-image-padding);border-radius:var(--nmorph-avatar-radius)}.nmorph-avatar.nmorph--shadow-combined{background:var(--nmorph-main-color);border:var(--nmorph-avatar-frame-border) solid var(--nmorph-main-color);box-shadow:var(--nmorph-shadow-combined-dark)}.nmorph-avatar>.nmorph-image>img{border-radius:var(--nmorph-avatar-image-radius)}.nmorph-avatar__initials{color:var(--nmorph-text-color);font-weight:600;line-height:1}.nmorph-avatar--preview{cursor:pointer}.nmorph-avatar--preview:hover>.nmorph-image{filter:brightness(.8)}
@@ -1,12 +1,12 @@
1
1
  import './NmorphAvatar.css';
2
- import { defineComponent as $, ref as z, computed as a } from "vue";
2
+ import { defineComponent as z, ref as $, computed as a } from "vue";
3
3
  import { useModifiers as B } from "../../../utils/create-modifiers.js";
4
4
  import L from "../nmorph-image-preview/NmorphImagePreview.vue.js";
5
5
  import v from "../../../assets/icons/avatar.svg.js";
6
6
  import M from "../../../assets/icons/loader.svg.js";
7
7
  import k from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
8
  import C from "../nmorph-image/NmorphImage.vue.js";
9
- const J = /* @__PURE__ */ $({
9
+ const J = /* @__PURE__ */ z({
10
10
  __name: "NmorphAvatar",
11
11
  props: {
12
12
  src: { type: [String, Array], required: !1, default: void 0 },
@@ -33,7 +33,7 @@ const J = /* @__PURE__ */ $({
33
33
  o("error", e);
34
34
  }, w = (e) => {
35
35
  o("load", e);
36
- }, l = z(!1), p = (e, t = 0) => Array.isArray(e) ? e[t] : e, u = a(() => `${r.imagePadding}px`), i = a(() => `${r.size}px`), b = a(() => p(r.src)), n = a(() => r.previewSrc || r.src), m = a(() => {
36
+ }, l = $(!1), p = (e, t = 0) => Array.isArray(e) ? e[t] : e, u = a(() => `${r.imagePadding}px`), i = a(() => `${r.size}px`), b = a(() => p(r.src)), n = a(() => r.previewSrc || r.src), m = a(() => {
37
37
  const e = n.value;
38
38
  return Array.isArray(e) ? e.length > 0 : !!e;
39
39
  }), q = a(() => {
@@ -41,8 +41,8 @@ const J = /* @__PURE__ */ $({
41
41
  return Array.isArray(e) ? e : e || "";
42
42
  }), s = a(() => r.preview && m.value), N = a(
43
43
  () => B({
44
- nmorph: [`${r.frameBorder > 0 && "shadow-combined"}`],
45
- "nmorph-avatar": [r.shape, `${s.value && "preview"}`]
44
+ nmorph: [r.frameBorder > 0 && "shadow-combined"],
45
+ "nmorph-avatar": [r.shape, s.value && "preview"]
46
46
  })
47
47
  ), I = a(() => `${r.size / 100 * 60}px`), x = a(() => `${Math.max(12, r.size * 0.38)}px`), c = a(() => r.shape === "circle" ? "50%" : "4px"), d = a(() => r.shape === "circle" ? "50%" : "2px"), A = a(() => ({
48
48
  width: i.value,
@@ -1,7 +1,8 @@
1
1
  import './NmorphBadge.css';
2
- import { defineComponent as C, computed as t, ref as b, onMounted as N, watch as I, nextTick as V } from "vue";
3
- import { useModifiers as p } from "../../../utils/create-modifiers.js";
4
- const F = /* @__PURE__ */ C({
2
+ import { defineComponent as N, computed as t, ref as d, onMounted as I, watch as V, nextTick as M } from "vue";
3
+ import { useModifiers as f } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as y } from "../../../utils/common.js";
5
+ const $ = /* @__PURE__ */ N({
5
6
  __name: "NmorphBadge",
6
7
  props: {
7
8
  value: { type: [Number, String], required: !1, default: void 0 },
@@ -22,66 +23,66 @@ const F = /* @__PURE__ */ C({
22
23
  },
23
24
  setup(m, { expose: g }) {
24
25
  g();
25
- const e = m, o = t(() => e.type !== "default" ? e.type : e.isDot ? "dot" : e.isTag ? "tag" : "default"), c = t(() => o.value === "dot"), n = t(() => o.value === "tag"), r = t(() => o.value === "ribbon"), h = t(
26
- () => p({
26
+ const e = m, r = t(() => e.type !== "default" ? e.type : e.isDot ? "dot" : e.isTag ? "tag" : "default"), b = t(() => r.value === "dot"), o = t(() => r.value === "tag"), a = t(() => r.value === "ribbon"), h = t(
27
+ () => f({
27
28
  "nmorph-badge": [
28
- `${e.hidden && "hidden"}`,
29
- `${n.value && "tag"}`,
30
- `${r.value && "ribbon"}`,
31
- `${r.value && `ribbon-${e.ribbonCorner}`}`,
29
+ e.hidden && "hidden",
30
+ o.value && "tag",
31
+ a.value && "ribbon",
32
+ a.value && `ribbon-${e.ribbonCorner}`,
32
33
  e.size
33
34
  ]
34
35
  })
35
36
  ), x = t(
36
- () => p({
37
+ () => f({
37
38
  "nmorph-badge__container": [
38
- `${e.hidden && "hidden"}`,
39
- `${n.value && "tag"}`,
40
- `${r.value && "ribbon"}`,
41
- `${r.value && `ribbon-${e.ribbonCorner}`}`
39
+ e.hidden && "hidden",
40
+ o.value && "tag",
41
+ a.value && "ribbon",
42
+ a.value && `ribbon-${e.ribbonCorner}`
42
43
  ]
43
44
  })
44
- ), $ = t(
45
- () => p({
46
- "nmorph-badge__ribbon-corner": [`${e.ribbonCorner}`, `${!e.ribbonTilt && "flat"}`]
45
+ ), q = t(
46
+ () => f({
47
+ "nmorph-badge__ribbon-corner": [e.ribbonCorner, !e.ribbonTilt && "flat"]
47
48
  })
48
- ), q = t(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), v = t(() => e.hideOnFalsyValue && !e.value), _ = t(() => (c.value || e.value !== void 0) && !v.value), u = t(() => {
49
- const a = `${(s?.value / 2 + e.offsetX) * -1}px`, B = `${(d?.value / 2 + e.offsetY) * -1}px`;
49
+ ), _ = t(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), p = t(() => e.hideOnFalsyValue && !e.value), z = t(() => (b.value || e.value !== void 0) && !p.value), l = t(() => {
50
+ const v = `${(u?.value / 2 + e.offsetX) * -1}px`, C = `${(i?.value / 2 + e.offsetY) * -1}px`;
50
51
  return {
51
- x: a,
52
- y: B
52
+ x: v,
53
+ y: C
53
54
  };
54
- }), z = t(() => n.value || r.value ? {
55
+ }), S = t(() => o.value || a.value ? {
55
56
  zIndex: e.zIndex
56
57
  } : {
57
- right: u.value.x,
58
- top: u.value.y,
58
+ right: l.value.x,
59
+ top: l.value.y,
59
60
  zIndex: e.zIndex
60
- }), i = (a) => typeof a == "number" ? `${a}px` : a, l = b(null), s = b(0), d = b(0), S = t(() => ({
61
+ }), n = d(null), u = d(0), i = d(0), T = t(() => ({
61
62
  "--nmorph-badge-color": e.color,
62
- ...e.offsetX !== 0 && { "--nmorph-badge-ribbon-offset-x": i(e.offsetX) },
63
- ...e.offsetY !== 0 && { "--nmorph-badge-ribbon-offset-y": i(e.offsetY) }
64
- })), f = async () => {
65
- await V(), !(!l.value || n.value || r.value) && (s.value = l.value.clientWidth, d.value = l.value.clientHeight);
66
- }, T = t(() => ({
63
+ ...e.offsetX !== 0 && { "--nmorph-badge-ribbon-offset-x": y(e.offsetX) },
64
+ ...e.offsetY !== 0 && { "--nmorph-badge-ribbon-offset-y": y(e.offsetY) }
65
+ })), s = async () => {
66
+ await M(), !(!n.value || o.value || a.value) && (u.value = n.value.clientWidth, i.value = n.value.clientHeight);
67
+ }, B = t(() => ({
67
68
  zIndex: e.zIndex
68
69
  }));
69
- N(f), I(
70
+ I(s), V(
70
71
  () => [
71
72
  e.value,
72
73
  e.max,
73
- o.value,
74
+ r.value,
74
75
  e.ribbonCorner,
75
76
  e.ribbonTilt,
76
77
  e.size,
77
78
  e.hideOnFalsyValue
78
79
  ],
79
- f
80
+ s
80
81
  );
81
- const y = { props: e, resolvedType: o, isDotType: c, isTagType: n, isRibbon: r, modifiers: h, containerModifiers: x, ribbonCornerModifiers: $, displayValue: q, shouldHideOnFalsyValue: v, shouldShowBadge: _, appliedOffset: u, containerStyle: z, getCssSize: i, badge: l, badgeWidth: s, badgeHeight: d, styles: S, updateBadgeSize: f, ribbonFrameStyle: T };
82
- return Object.defineProperty(y, "__isScriptSetup", { enumerable: !1, value: !0 }), y;
82
+ const c = { props: e, resolvedType: r, isDotType: b, isTagType: o, isRibbon: a, modifiers: h, containerModifiers: x, ribbonCornerModifiers: q, displayValue: _, shouldHideOnFalsyValue: p, shouldShowBadge: z, appliedOffset: l, containerStyle: S, badge: n, badgeWidth: u, badgeHeight: i, styles: T, updateBadgeSize: s, ribbonFrameStyle: B };
83
+ return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
83
84
  }
84
85
  });
85
86
  export {
86
- F as default
87
+ $ as default
87
88
  };
@@ -1,13 +1,14 @@
1
1
  import './NmorphCalendar.css';
2
- import { defineComponent as O, ref as N, onMounted as k, reactive as j, watch as h, computed as i } from "vue";
3
- import { useModifiers as z } from "../../../utils/create-modifiers.js";
2
+ import { defineComponent as R, ref as x, onMounted as O, reactive as k, watch as v, computed as s } from "vue";
3
+ import { useModifiers as j } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as z } from "../../../utils/common.js";
4
5
  import W from "./inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.js";
5
6
  import { useCalendarTexts as Z } from "./hooks/use-calendar-texts.js";
6
- import { hasAnyRangeDateInPrevMonth as $, hasAnyRangeDateInNextMonth as F, isTodayInMonthRange as G, resetTimeToZero as d, getMonthDaysByWeek as J } from "./utils.js";
7
- import K from "../nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.js";
8
- import L from "../nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.js";
9
- import Q from "../nmorph-table/NmorphTable.vue.js";
10
- const le = /* @__PURE__ */ O({
7
+ import { hasAnyRangeDateInPrevMonth as F, hasAnyRangeDateInNextMonth as G, isTodayInMonthRange as J, resetTimeToZero as d, getMonthDaysByWeek as K } from "./utils.js";
8
+ import L from "../nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.js";
9
+ import Q from "../nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.js";
10
+ import U from "../nmorph-table/NmorphTable.vue.js";
11
+ const ue = /* @__PURE__ */ R({
11
12
  __name: "NmorphCalendar",
12
13
  props: {
13
14
  markToday: { type: Boolean, required: !1, default: !0 },
@@ -18,11 +19,11 @@ const le = /* @__PURE__ */ O({
18
19
  cellHeight: { type: [Number, String], required: !1, default: void 0 }
19
20
  },
20
21
  emits: ["update:model-value", "update-initial-date"],
21
- setup(b, { expose: _, emit: C }) {
22
- _();
23
- const a = b, s = C, { days: v } = Z(), y = () => {
22
+ setup(N, { expose: b, emit: _ }) {
23
+ b();
24
+ const a = N, i = _, { days: h } = Z(), y = () => {
24
25
  o.value = M.value;
25
- }, B = () => {
26
+ }, C = () => {
26
27
  o.value = /* @__PURE__ */ new Date();
27
28
  }, g = () => {
28
29
  o.value = A.value;
@@ -46,25 +47,25 @@ const le = /* @__PURE__ */ O({
46
47
  return e.map((r) => d(r)).slice(0, 2);
47
48
  u();
48
49
  }
49
- }, q = (e) => {
50
+ }, B = (e) => {
50
51
  if (t.value === null) return;
51
52
  const { monthType: l, hidden: r } = e;
52
53
  if (r) return;
53
54
  l === "next" && g(), l === "previous" && y();
54
55
  const { date: n } = e;
55
- if (a.type === "date" && (t.value = n, s("update:model-value", t.value)), a.type === "dates") {
56
+ if (a.type === "date" && (t.value = n, i("update:model-value", t.value)), a.type === "dates") {
56
57
  if (!Array.isArray(t.value)) return u();
57
- const m = n.toDateString(), w = t.value.map((R) => R.toDateString()).indexOf(m);
58
- w !== -1 ? t.value.splice(w, 1) : t.value.push(n), s("update:model-value", t.value);
58
+ const m = n.toDateString(), w = t.value.map((P) => P.toDateString()).indexOf(m);
59
+ w !== -1 ? t.value.splice(w, 1) : t.value.push(n), i("update:model-value", t.value);
59
60
  }
60
61
  if (a.type === "daterange") {
61
62
  if (!Array.isArray(t.value)) return u();
62
- t.value.length === 0 ? t.value.push(n) : t.value.length === 1 ? n < t.value[0] ? t.value = [n, t.value[0]] : t.value.push(n) : t.value = [n], s("update:model-value", t.value.slice(0, 2));
63
+ t.value.length === 0 ? t.value.push(n) : t.value.length === 1 ? n < t.value[0] ? t.value = [n, t.value[0]] : t.value.push(n) : t.value = [n], i("update:model-value", t.value.slice(0, 2));
63
64
  }
64
65
  }, D = (e, l) => {
65
66
  const [r, n] = l;
66
67
  return l.length === 1 ? e.toDateString() === r.toDateString() : r && n ? e >= d(r) && e <= d(n) : !1;
67
- }, V = (e) => {
68
+ }, q = (e) => {
68
69
  if (t.value === null) return !1;
69
70
  if (a.type === "date")
70
71
  return Array.isArray(t.value) ? u() : t.value.toDateString() === e.toDateString();
@@ -72,21 +73,21 @@ const le = /* @__PURE__ */ O({
72
73
  return Array.isArray(t.value) ? !!t.value.find((r) => r.toDateString() === e.toDateString()) : u();
73
74
  if (a.type === "daterange")
74
75
  return Array.isArray(t.value) ? D(e, t.value) : u();
75
- }, o = N(a.initialDate), t = N(c(a.modelValue));
76
- k(() => {
77
- s("update:model-value", t.value);
76
+ }, o = x(a.initialDate), t = x(c(a.modelValue));
77
+ O(() => {
78
+ i("update:model-value", t.value);
78
79
  });
79
- let p = j([]);
80
+ let p = k([]);
80
81
  const f = () => {
81
- p = [], J(o, a.range).forEach((l) => {
82
+ p = [], K(o, a.range).forEach((l) => {
82
83
  const r = {};
83
84
  l.forEach((n, m) => {
84
- const T = v[m];
85
+ const T = h[m];
85
86
  r[T] = n;
86
87
  }), p.push(r);
87
88
  });
88
89
  };
89
- h(
90
+ v(
90
91
  () => a.initialDate,
91
92
  (e) => {
92
93
  o.value = e;
@@ -94,43 +95,43 @@ const le = /* @__PURE__ */ O({
94
95
  {
95
96
  deep: !0
96
97
  }
97
- ), h(o, () => {
98
- f(), s("update-initial-date", o.value);
99
- }), h(
98
+ ), v(o, () => {
99
+ f(), i("update-initial-date", o.value);
100
+ }), v(
100
101
  () => a.modelValue,
101
102
  (e) => {
102
103
  t.value = c(e);
103
104
  }
104
105
  );
105
- const M = i(() => new Date(o.value.setMonth(o.value.getMonth() - 1))), A = i(() => new Date(o.value.setMonth(o.value.getMonth() + 1))), E = i(() => {
106
- const { range: e } = a, l = e ? $(o.value, e[0]) : !0, r = e ? F(o.value, e[1]) : !0, n = G(e);
106
+ const M = s(() => new Date(o.value.setMonth(o.value.getMonth() - 1))), A = s(() => new Date(o.value.setMonth(o.value.getMonth() + 1))), V = s(() => {
107
+ const { range: e } = a, l = e ? F(o.value, e[0]) : !0, r = e ? G(o.value, e[1]) : !0, n = J(e);
107
108
  return {
108
109
  showPreviousMonthButton: l,
109
110
  showNextMonthButton: r,
110
111
  showTodayButton: n
111
112
  };
112
- }), H = i(
113
- () => z({
113
+ }), E = s(
114
+ () => j({
114
115
  "nmorph-calendar": []
115
116
  })
116
- ), x = (e) => typeof e == "number" ? `${e}px` : e, I = i(() => ({
117
- ...a.cellHeight !== void 0 && { "--table-data-cell-height": x(a.cellHeight) }
118
- })), P = (e) => e;
117
+ ), H = s(() => ({
118
+ ...a.cellHeight !== void 0 && { "--table-data-cell-height": z(a.cellHeight) }
119
+ })), I = (e) => e;
119
120
  f();
120
- const S = { props: a, emit: s, days: v, setPreviousMonth: y, setTodayMonth: B, setNextMonth: g, wrongType: u, convertValue: c, clickDate: q, isDateInRange: D, isValueSelected: V, initialDate: o, selectedValue: t, get calendar() {
121
+ const S = { props: a, emit: i, days: h, setPreviousMonth: y, setTodayMonth: C, setNextMonth: g, wrongType: u, convertValue: c, clickDate: B, isDateInRange: D, isValueSelected: q, initialDate: o, selectedValue: t, get calendar() {
121
122
  return p;
122
123
  }, set calendar(e) {
123
124
  p = e;
124
- }, updateCalendar: f, prevMonth: M, nextMonth: A, showHeaderButtons: E, modifiers: H, getCssSize: x, styles: I, dateData: P, get NmorphTable() {
125
- return Q;
125
+ }, updateCalendar: f, prevMonth: M, nextMonth: A, showHeaderButtons: V, modifiers: E, styles: H, dateData: I, get NmorphTable() {
126
+ return U;
126
127
  }, get NmorphTableColumn() {
127
- return L;
128
+ return Q;
128
129
  }, get NmorphTableCell() {
129
- return K;
130
+ return L;
130
131
  }, NmorphCalendarHeader: W };
131
132
  return Object.defineProperty(S, "__isScriptSetup", { enumerable: !1, value: !0 }), S;
132
133
  }
133
134
  });
134
135
  export {
135
- le as default
136
+ ue as default
136
137
  };
@@ -1,8 +1,9 @@
1
1
  import './NmorphCard.css';
2
- import { defineComponent as f, useSlots as l, computed as o } from "vue";
2
+ import { defineComponent as p, useSlots as l, computed as o } from "vue";
3
3
  import { NmorphShadowType as u } from "../../../types/index.js";
4
- import { useModifiers as m } from "../../../utils/create-modifiers.js";
5
- const b = /* @__PURE__ */ f({
4
+ import { useModifiers as f } from "../../../utils/create-modifiers.js";
5
+ import { toCssSize as m } from "../../../utils/common.js";
6
+ const S = /* @__PURE__ */ p({
6
7
  __name: "NmorphCard",
7
8
  props: {
8
9
  shadowType: { type: null, required: !1, default: "outset" },
@@ -12,22 +13,25 @@ const b = /* @__PURE__ */ f({
12
13
  fill: { type: Boolean, required: !1, default: !0 },
13
14
  tag: { type: String, required: !1, default: "div" }
14
15
  },
15
- setup(i, { expose: s }) {
16
- s();
17
- const e = i, a = l(), n = o(
18
- () => m({
16
+ setup(t, { expose: i }) {
17
+ i();
18
+ const e = t, a = l(), n = o(
19
+ () => f({
19
20
  nmorph: [u[e.shadowType]],
20
21
  "nmorph-card": [e.shadowType, e.fill ? "fill" : "fit-content"]
21
22
  })
22
- ), d = (r) => typeof r == "number" ? `${r}px` : r, p = o(() => ({
23
- ...e.shadowType === "combined" && {
24
- "--nmorph-card-combined-border-width": `${e.combinedShadowBorderWidth}px`
25
- },
26
- ...e.cardPadding !== void 0 && { "--card-padding": d(e.cardPadding) }
27
- })), t = { props: e, slots: a, modifiers: n, getCssSize: d, styles: p };
28
- return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
23
+ ), s = o(() => {
24
+ const d = e.cardPadding !== void 0 ? m(e.cardPadding) : void 0;
25
+ return {
26
+ ...e.shadowType === "combined" && {
27
+ "--nmorph-card-combined-border-width": `${e.combinedShadowBorderWidth}px`
28
+ },
29
+ ...d !== void 0 && { "--card-padding": d, padding: d }
30
+ };
31
+ }), r = { props: e, slots: a, modifiers: n, styles: s };
32
+ return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
29
33
  }
30
34
  });
31
35
  export {
32
- b as default
36
+ S as default
33
37
  };
@@ -1,8 +1,8 @@
1
1
  import './NmorphCollapseItem.css';
2
2
  import { defineComponent as H, ref as u, computed as d, inject as b, onMounted as z, onBeforeUnmount as M, watch as h, nextTick as w } from "vue";
3
3
  import { useModifiers as g } from "../../../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as $ } from "../../../../../types/index.js";
5
- const D = /* @__PURE__ */ H({
4
+ import { NmorphComponentHeight as x } from "../../../../../types/index.js";
5
+ const N = /* @__PURE__ */ H({
6
6
  __name: "NmorphCollapseItem",
7
7
  props: {
8
8
  height: { type: null, required: !1, default: "basic" },
@@ -17,15 +17,11 @@ const D = /* @__PURE__ */ H({
17
17
  O();
18
18
  const e = y, p = _, n = u(!1), k = d(
19
19
  () => g({
20
- "nmorph-collapse-item": [
21
- `${e.disabled && "disabled"}`,
22
- `${e.block && "block"}`,
23
- `${n.value && "is-open"}`
24
- ]
20
+ "nmorph-collapse-item": [e.disabled && "disabled", e.block && "block", n.value && "is-open"]
25
21
  })
26
22
  ), S = d(
27
23
  () => g({
28
- nmorph: [$[e.height]]
24
+ nmorph: [x[e.height]]
29
25
  })
30
26
  ), c = (t) => typeof t == "number" ? `${t}ms` : t, C = d(() => ({
31
27
  ...e.transitionSpeed !== void 0 && { "--transition-speed": c(e.transitionSpeed) }
@@ -56,5 +52,5 @@ const D = /* @__PURE__ */ H({
56
52
  }
57
53
  });
58
54
  export {
59
- D as default
55
+ N as default
60
56
  };
@@ -14,7 +14,7 @@ const y = ["role", "aria-label"], f = {
14
14
  key: 2,
15
15
  class: "nmorph-empty__action"
16
16
  };
17
- function k(e, z, b, o, g, C) {
17
+ function k(e, z, b, o, C, E) {
18
18
  return t(), i("div", {
19
19
  class: d(o.modifiers),
20
20
  style: m(o.styles),
@@ -24,8 +24,8 @@ function k(e, z, b, o, g, C) {
24
24
  o.hasIcon ? (t(), i("div", f, [
25
25
  r(e.$slots, "icon", {}, () => [
26
26
  n(o.NmorphIcon, {
27
- width: o.getCssSize(o.props.iconSize),
28
- height: o.getCssSize(o.props.iconSize)
27
+ width: o.toCssSize(o.props.iconSize),
28
+ height: o.toCssSize(o.props.iconSize)
29
29
  }, {
30
30
  default: p(() => [
31
31
  n(o.NmorphIconFolderOpened)