@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
@@ -1,14 +1,15 @@
1
1
  import './NmorphTimePicker.css';
2
- import { defineComponent as ee, ref as g, computed as n, watch as te } from "vue";
3
- import { NmorphComponentHeight as _ } from "../../../types/index.js";
4
- import { useI18n as oe } from "vue-i18n";
5
- import { useModifiers as $ } from "../../../utils/create-modifiers.js";
6
- import { useFormItemInput as re } from "../nmorph-form/use-form-item-input.js";
7
- import ne from "../../../assets/icons/clock.svg.js";
8
- import le from "../../../assets/icons/circle-close.svg.js";
9
- import ue from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
- import se from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
11
- const Se = /* @__PURE__ */ ee({
2
+ import { defineComponent as te, ref as y, computed as n, watch as oe } from "vue";
3
+ import { NmorphComponentHeight as O } from "../../../types/index.js";
4
+ import { useI18n as re } from "vue-i18n";
5
+ import { useModifiers as H } from "../../../utils/create-modifiers.js";
6
+ import { toCssSize as ne } from "../../../utils/common.js";
7
+ import { useFormItemInput as le, useFormItemModel as ue } from "../nmorph-form/use-form-item-input.js";
8
+ import se from "../../../assets/icons/clock.svg.js";
9
+ import ae from "../../../assets/icons/circle-close.svg.js";
10
+ import ie from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
+ import de from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
12
+ const Ne = /* @__PURE__ */ te({
12
13
  __name: "NmorphTimePicker",
13
14
  props: {
14
15
  modelValue: { type: [String, null], required: !1, default: null },
@@ -30,86 +31,87 @@ const Se = /* @__PURE__ */ ee({
30
31
  tabindex: { type: Number, required: !1 }
31
32
  },
32
33
  emits: ["update:model-value", "focus", "blur"],
33
- setup(O, { expose: H, emit: k }) {
34
- const t = O, s = k, { t: T } = oe(), { id: B, name: M, autocomplete: P, tabindex: z } = re(t), a = g(!1), c = g(!1), w = g(null), m = (e) => String(e).padStart(2, "0"), p = (e) => Math.max(1, Math.floor(Number.isFinite(e) ? e : 1)), i = (e) => {
34
+ setup(M, { expose: k, emit: B }) {
35
+ const t = M, m = B, { t: I } = re(), { id: P, name: $, autocomplete: z, tabindex: D } = le(t), { modelValue: s, updateModelValue: p } = ue(
36
+ t,
37
+ (e) => m("update:model-value", e),
38
+ null
39
+ ), a = y(!1), f = y(!1), x = y(null), c = (e) => String(e).padStart(2, "0"), h = (e) => Math.max(1, Math.floor(Number.isFinite(e) ? e : 1)), i = (e) => {
35
40
  if (!e) return null;
36
41
  const o = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
37
42
  if (!o) return null;
38
- const r = Number(o[1]), S = Number(o[2]), d = Number(o[3] || 0);
39
- return r > 23 || S > 59 || d > 59 ? null : { hour: r, minute: S, second: d };
40
- }, v = (e) => {
41
- const o = `${m(e.hour)}:${m(e.minute)}`;
42
- return t.showSeconds ? `${o}:${m(e.second)}` : o;
43
- }, f = (e) => e.hour * 3600 + e.minute * 60 + e.second, y = n(() => i(t.minTime)), N = n(() => i(t.maxTime)), x = n(() => i(t.modelValue)), u = g(x.value || { hour: 0, minute: 0, second: 0 }), V = n(() => t.placeholder || T("pickATime"));
44
- te(
45
- () => t.modelValue,
46
- (e) => {
47
- const o = i(e);
48
- o && (u.value = o);
49
- }
50
- );
51
- const h = (e) => {
52
- const o = f(e);
53
- return !!(y.value && o < f(y.value) || N.value && o > f(N.value));
43
+ const r = Number(o[1]), g = Number(o[2]), d = Number(o[3] || 0);
44
+ return r > 23 || g > 59 || d > 59 ? null : { hour: r, minute: g, second: d };
45
+ }, N = (e) => {
46
+ const o = `${c(e.hour)}:${c(e.minute)}`;
47
+ return t.showSeconds ? `${o}:${c(e.second)}` : o;
48
+ }, v = (e) => e.hour * 3600 + e.minute * 60 + e.second, q = n(() => i(t.minTime)), T = n(() => i(t.maxTime)), C = n(() => i(s.value)), u = y(C.value || { hour: 0, minute: 0, second: 0 }), _ = n(() => t.placeholder || I("pickATime"));
49
+ oe(s, (e) => {
50
+ const o = i(e);
51
+ o && (u.value = o);
52
+ });
53
+ const S = (e) => {
54
+ const o = v(e);
55
+ return !!(q.value && o < v(q.value) || T.value && o > v(T.value));
54
56
  }, b = (e, o, r) => {
55
- const S = p(r), d = /* @__PURE__ */ new Set();
56
- for (let l = 0; l <= o; l += S) d.add(l);
57
- return d.add(u.value[e]), Array.from(d).filter((l) => l >= 0 && l <= o).sort((l, q) => l - q).map((l) => {
58
- const q = { ...u.value, [e]: l };
57
+ const g = h(r), d = /* @__PURE__ */ new Set();
58
+ for (let l = 0; l <= o; l += g) d.add(l);
59
+ return d.add(u.value[e]), Array.from(d).filter((l) => l >= 0 && l <= o).sort((l, w) => l - w).map((l) => {
60
+ const w = { ...u.value, [e]: l };
59
61
  return {
60
- label: m(l),
62
+ label: c(l),
61
63
  value: l,
62
- disabled: h(q)
64
+ disabled: S(w)
63
65
  };
64
66
  });
65
- }, D = n(() => b("hour", 23, t.hourStep)), A = n(() => b("minute", 59, t.minuteStep)), F = n(() => b("second", 59, t.secondStep)), R = (e, o) => {
67
+ }, F = n(() => b("hour", 23, t.hourStep)), A = n(() => b("minute", 59, t.minuteStep)), R = n(() => b("second", 59, t.secondStep)), U = (e, o) => {
66
68
  const r = { ...u.value, [e]: o };
67
- h(r) || (u.value = r, s("update:model-value", v(r)));
68
- }, U = () => {
69
- s("update:model-value", null), a.value = !1;
69
+ S(r) || (u.value = r, p(N(r)));
70
70
  }, j = () => {
71
- a.value = !1;
71
+ p(null), a.value = !1;
72
72
  }, E = () => {
73
- t.disabled || (a.value = !a.value);
73
+ a.value = !1;
74
74
  }, G = () => {
75
- c.value = !0, s("focus");
75
+ t.disabled || (a.value = !a.value);
76
76
  }, J = () => {
77
- c.value = !1, s("blur");
78
- }, K = (e) => {
77
+ f.value = !0, m("focus");
78
+ }, K = () => {
79
+ f.value = !1, m("blur");
80
+ }, L = (e) => {
79
81
  const o = e.target, r = i(o.value);
80
- !r || h(r) || (u.value = r, s("update:model-value", v(r)));
81
- }, L = n(() => t.modelValue || V.value), Q = n(
82
- () => t.showSeconds ? p(t.secondStep) : p(t.minuteStep) * 60
83
- ), W = n(() => t.clearable && !!t.modelValue && !t.disabled), X = n(
84
- () => $({
85
- nmorph: [_[t.height]],
82
+ !r || S(r) || (u.value = r, p(N(r)));
83
+ }, Q = n(() => s.value || _.value), W = n(
84
+ () => t.showSeconds ? h(t.secondStep) : h(t.minuteStep) * 60
85
+ ), X = n(() => t.clearable && !!s.value && !t.disabled), Y = n(
86
+ () => H({
87
+ nmorph: [O[t.height]],
86
88
  "nmorph-time-picker": [
87
- `${t.disabled && "disabled"}`,
88
- `${a.value && "open"}`,
89
- `${c.value && "focus"}`,
90
- `${!t.modelValue && "placeholder"}`
89
+ t.disabled && "disabled",
90
+ a.value && "open",
91
+ f.value && "focus",
92
+ !s.value && "placeholder"
91
93
  ]
92
94
  })
93
- ), Y = n(
94
- () => $({
95
- nmorph: [_[t.height]]
95
+ ), Z = n(
96
+ () => H({
97
+ nmorph: [O[t.height]]
96
98
  })
97
- ), I = (e) => typeof e == "number" ? `${e}px` : e, Z = n(() => ({
98
- ...t.width !== void 0 && { "--width": I(t.width) }
99
+ ), ee = n(() => ({
100
+ ...t.width !== void 0 && { "--width": ne(t.width) }
99
101
  }));
100
- H({ inputDOMRef: w });
101
- const C = { props: t, emit: s, t: T, id: B, name: M, autocomplete: P, tabindex: z, open: a, focused: c, inputDOMRef: w, pad: m, normalizeStep: p, parseTime: i, formatTime: v, timeToSeconds: f, minTimeParts: y, maxTimeParts: N, modelTimeParts: x, pickerValue: u, placeholderText: V, isOutsideRange: h, getUnitOptions: b, hourOptions: D, minuteOptions: A, secondOptions: F, selectUnit: R, clearHandler: U, closeHandler: j, toggleOpen: E, focusHandler: G, blurHandler: J, nativeInputHandler: K, displayValue: L, inputStep: Q, showClearButton: W, modifiers: X, optionHeightModifiers: Y, getCssSize: I, styles: Z, get NmorphDropdown() {
102
- return se;
102
+ k({ inputDOMRef: x });
103
+ const V = { props: t, emit: m, t: I, id: P, name: $, autocomplete: z, tabindex: D, modelValue: s, updateModelValue: p, open: a, focused: f, inputDOMRef: x, pad: c, normalizeStep: h, parseTime: i, formatTime: N, timeToSeconds: v, minTimeParts: q, maxTimeParts: T, modelTimeParts: C, pickerValue: u, placeholderText: _, isOutsideRange: S, getUnitOptions: b, hourOptions: F, minuteOptions: A, secondOptions: R, selectUnit: U, clearHandler: j, closeHandler: E, toggleOpen: G, focusHandler: J, blurHandler: K, nativeInputHandler: L, displayValue: Q, inputStep: W, showClearButton: X, modifiers: Y, optionHeightModifiers: Z, styles: ee, get NmorphDropdown() {
104
+ return de;
103
105
  }, get NmorphIcon() {
104
- return ue;
106
+ return ie;
105
107
  }, get NmorphIconCircleClose() {
106
- return le;
108
+ return ae;
107
109
  }, get NmorphIconClock() {
108
- return ne;
110
+ return se;
109
111
  } };
110
- return Object.defineProperty(C, "__isScriptSetup", { enumerable: !1, value: !0 }), C;
112
+ return Object.defineProperty(V, "__isScriptSetup", { enumerable: !1, value: !0 }), V;
111
113
  }
112
114
  });
113
115
  export {
114
- Se as default
116
+ Ne as default
115
117
  };
@@ -20,7 +20,7 @@ const Y = /* @__PURE__ */ E({
20
20
  w();
21
21
  const t = b, s = y, g = v(
22
22
  () => q({
23
- "nmorph-backtop": [`${n.value && "show"}`, t.design]
23
+ "nmorph-backtop": [n.value && "show", t.design]
24
24
  })
25
25
  ), N = v(() => ({
26
26
  "--nmorph-backtop-right": `${t.right}px`,
@@ -1,9 +1,10 @@
1
1
  import './NmorphDropdown.css';
2
- import { defineComponent as w, ref as q, toRef as r, computed as n, watch as b } from "vue";
3
- import { useModifiers as v } from "../../../utils/create-modifiers.js";
2
+ import { defineComponent as w, ref as q, toRef as t, computed as l, watch as v } from "vue";
3
+ import { useModifiers as b } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as d } from "../../../utils/common.js";
4
5
  import { usePlacement as x } from "../../../hooks/use-placement.js";
5
6
  import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
- const k = /* @__PURE__ */ w({
7
+ const B = /* @__PURE__ */ w({
7
8
  __name: "NmorphDropdown",
8
9
  props: {
9
10
  open: { type: Boolean, required: !0 },
@@ -25,46 +26,46 @@ const k = /* @__PURE__ */ w({
25
26
  hideShadow: { type: Boolean, required: !1, default: !1 }
26
27
  },
27
28
  emits: ["on-outside-click", "on-escape-keydown"],
28
- setup(f, { expose: m, emit: c }) {
29
- m();
30
- const e = f, l = c, i = q(null), { placementCoords: d, placementReady: a, adjustPlacement: s } = x({
31
- initialPlacement: r(e, "placement"),
29
+ setup(p, { expose: f, emit: m }) {
30
+ f();
31
+ const e = p, r = m, i = q(null), { placementCoords: o, placementReady: n, adjustPlacement: a } = x({
32
+ initialPlacement: t(e, "placement"),
32
33
  contentDOMElement: i,
33
- relativeElement: r(e, "relativeElement"),
34
- yOffset: r(e, "yOffset"),
35
- xOffset: r(e, "xOffset"),
36
- enabled: r(e, "open")
37
- }), y = n(
38
- () => v({
39
- "nmorph-dropdown": [`${!e.open && "closed"}`, `${e.hideShadow && "hide-shadow"}`]
34
+ relativeElement: t(e, "relativeElement"),
35
+ yOffset: t(e, "yOffset"),
36
+ xOffset: t(e, "xOffset"),
37
+ enabled: t(e, "open")
38
+ }), c = l(
39
+ () => b({
40
+ "nmorph-dropdown": [!e.open && "closed", e.hideShadow && "hide-shadow"]
40
41
  })
41
- ), o = (t) => typeof t == "number" ? `${t}px` : t, u = n(
42
- () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : o(e.width)
43
- ), h = n(() => ({
44
- "--nmorph-dropdown-width": u.value,
45
- "--nmorph-dropdown-min-width": o(e.minWidth) || "auto",
46
- "--nmorph-dropdown-max-width": o(e.maxWidth) || "none",
47
- left: d.value.x,
48
- top: d.value.y,
49
- visibility: e.open && a.value ? "visible" : "hidden"
42
+ ), s = l(
43
+ () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : d(e.width)
44
+ ), h = l(() => ({
45
+ "--nmorph-dropdown-width": s.value,
46
+ "--nmorph-dropdown-min-width": d(e.minWidth) || "auto",
47
+ "--nmorph-dropdown-max-width": d(e.maxWidth) || "none",
48
+ left: o.value.x,
49
+ top: o.value.y,
50
+ visibility: e.open && n.value ? "visible" : "hidden"
50
51
  }));
51
- b(
52
+ v(
52
53
  () => e.open,
53
- (t) => {
54
- t && s();
54
+ (y) => {
55
+ y && a();
55
56
  },
56
57
  { flush: "post" }
57
58
  );
58
- const p = { props: e, emit: l, dropdownDOMRef: i, placementCoords: d, placementReady: a, adjustPlacement: s, modifiers: y, getCssSize: o, width: u, dropdownStyle: h, outsideClickHandler: () => {
59
- l("on-outside-click");
59
+ const u = { props: e, emit: r, dropdownDOMRef: i, placementCoords: o, placementReady: n, adjustPlacement: a, modifiers: c, width: s, dropdownStyle: h, outsideClickHandler: () => {
60
+ r("on-outside-click");
60
61
  }, escapeHandler: () => {
61
- l("on-escape-keydown");
62
+ r("on-escape-keydown");
62
63
  }, get NmorphOverlay() {
63
64
  return O;
64
65
  } };
65
- return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
66
+ return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
66
67
  }
67
68
  });
68
69
  export {
69
- k as default
70
+ B as default
70
71
  };
@@ -15,7 +15,7 @@ const D = /* @__PURE__ */ b({
15
15
  d();
16
16
  const e = u, t = i, l = p(
17
17
  () => I({
18
- "nmorph-tabs": [`${e.stretch && "stretch"}`]
18
+ "nmorph-tabs": [e.stretch && "stretch"]
19
19
  })
20
20
  ), m = (n) => {
21
21
  if (n.disabled) return;
@@ -22,7 +22,7 @@ const L = /* @__PURE__ */ _({
22
22
  () => t.zIndex
23
23
  ), w = i(
24
24
  () => F({
25
- "nmorph-overlay": [`${t.show && "show"}`, `${t.transparent && "transparent"}`]
25
+ "nmorph-overlay": [t.show && "show", t.transparent && "transparent"]
26
26
  })
27
27
  ), k = i(() => t.disabledTeleport || !t.show || typeof document > "u"), x = () => {
28
28
  s("on-outside-click");
@@ -1,17 +1,17 @@
1
- import { nmorphCombined as p, nmorphInset as r, nmorphOutset as n, title1 as s, title2 as l, title3 as d, title4 as m, body1 as e, body2 as c, body3 as a, body4 as b } from "../utils/theme-style.js";
2
- const u = {
3
- "nmorph-body-4": b,
4
- "nmorph-body-3": a,
5
- "nmorph-body-2": c,
1
+ import { nmorphCombined as i, nmorphInset as s, nmorphOutset as h, title1 as d, title2 as l, title3 as p, title4 as c, body1 as e, body2 as b, body3 as r, body4 as m } from "../utils/theme-style.js";
2
+ const v = {
3
+ "nmorph-body-4": m,
4
+ "nmorph-body-3": r,
5
+ "nmorph-body-2": b,
6
6
  "nmorph-body-1": e,
7
- "nmorph-title-4": m,
8
- "nmorph-title-3": d,
7
+ "nmorph-title-4": c,
8
+ "nmorph-title-3": p,
9
9
  "nmorph-title-2": l,
10
- "nmorph-title-1": s,
11
- "nmorph--shadow-outset": n,
12
- "nmorph--shadow-inset": r,
13
- "nmorph--shadow-combined": p
14
- }, v = () => {
10
+ "nmorph-title-1": d,
11
+ "nmorph--shadow-outset": h,
12
+ "nmorph--shadow-inset": s,
13
+ "nmorph--shadow-combined": i
14
+ }, u = () => {
15
15
  let t = `
16
16
  :root {
17
17
  --font-size-tiny: 10px;
@@ -284,7 +284,7 @@ const u = {
284
284
  }
285
285
 
286
286
  .nmorph--thin-component.nmorph-native-input {
287
- ${a()}
287
+ ${r()}
288
288
  }
289
289
 
290
290
  .nmorph-native-input:focus {
@@ -316,212 +316,6 @@ const u = {
316
316
  }
317
317
  }
318
318
 
319
- .nmorph-avatar {
320
- position: relative;
321
- overflow: hidden;
322
- display: flex;
323
- align-items: center;
324
- justify-content: center;
325
- }
326
-
327
- .nmorph-avatar--circle {
328
- border-radius: var(--border-radius-circular);
329
- }
330
-
331
- .nmorph-avatar--square {
332
- border-radius: var(--default-border-radius);
333
- }
334
-
335
- .nmorph-avatar > .nmorph-image {
336
- position: absolute;
337
- --width: var(--nmorph-avatar-size);
338
- --height: var(--nmorph-avatar-size);
339
- padding: var(--nmorph-avatar-image-padding);
340
- border-radius: var(--nmorph-avatar-radius);
341
- }
342
-
343
- .nmorph-avatar.nmorph--shadow-combined {
344
- border: var(--nmorph-avatar-frame-border) solid var(--nmorph-main-color);
345
- background: var(--nmorph-main-color);
346
- box-shadow: var(--nmorph-shadow-combined-dark);
347
- }
348
-
349
- .nmorph-avatar > .nmorph-image > img {
350
- border-radius: var(--nmorph-avatar-image-radius);
351
- }
352
-
353
- .nmorph-avatar__initials {
354
- color: var(--nmorph-text-color);
355
- font-weight: 600;
356
- line-height: 1;
357
- }
358
-
359
- .nmorph-avatar--preview {
360
- cursor: pointer;
361
- }
362
-
363
- .nmorph-avatar--preview:hover > .nmorph-image {
364
- filter: brightness(0.8);
365
- }
366
-
367
- .nmorph-image {
368
- --width: auto;
369
- --height: 100%;
370
- width: var(--width);
371
- height: var(--height);
372
- display: flex;
373
- align-items: center;
374
- justify-content: center;
375
- }
376
-
377
- .nmorph-image.nmorph--shadow-combined {
378
- border: var(--nmorph-image-frame-border) solid var(--nmorph-main-color);
379
- }
380
-
381
- .nmorph-image img {
382
- width: 100%;
383
- height: 100%;
384
- object-fit: var(--nmorph-image-fit);
385
- }
386
-
387
- .nmorph-image__loading,
388
- .nmorph-image__load-failed {
389
- padding: 1rem;
390
- }
391
-
392
- .nmorph-image--hide img {
393
- width: 0;
394
- height: 0;
395
- opacity: 0;
396
- }
397
-
398
- .nmorph-text-input {
399
- display: flex;
400
- flex: 1 1 auto;
401
- flex-direction: column;
402
- align-items: flex-start;
403
- min-width: 0;
404
- --prepend-icon-indent: 8px;
405
- --prepend-icon-size: 14px;
406
- }
407
-
408
- .nmorph-text-input__input-side {
409
- position: relative;
410
- display: flex;
411
- align-items: center;
412
- justify-content: flex-end;
413
- width: 100%;
414
- }
415
-
416
- .nmorph-text-input__prepend-icon {
417
- position: absolute;
418
- left: 0;
419
- z-index: 1;
420
- display: flex;
421
- align-items: center;
422
- justify-content: center;
423
- width: var(--prepend-icon-size);
424
- min-width: var(--prepend-icon-size);
425
- height: var(--prepend-icon-size);
426
- min-height: var(--prepend-icon-size);
427
- margin-left: var(--prepend-icon-indent);
428
- pointer-events: none;
429
- }
430
-
431
- .nmorph-text-input__prepend-icon svg,
432
- .nmorph-text-input__prepend-icon .nmorph-icon,
433
- .nmorph-text-input__prepend-icon .nmorph-icon__content {
434
- width: 100%;
435
- min-width: 100%;
436
- height: 100%;
437
- min-height: 100%;
438
- }
439
-
440
- .nmorph-text-input__prepend-icon svg {
441
- fill: var(--nmorph-text-color);
442
- stroke-width: 0;
443
- }
444
-
445
- .nmorph-text-input__prepend-icon path {
446
- stroke: var(--nmorph-text-color);
447
- }
448
-
449
- .nmorph-text-input input {
450
- width: 100%;
451
- height: var(--height);
452
- text-indent: var(--nmorph-text-input-indentation);
453
- border: none;
454
- border-radius: var(--default-border-radius);
455
- ${r()}
456
- }
457
-
458
- .nmorph-text-input--with-action input {
459
- padding-right: calc(var(--height) + var(--indentation-03));
460
- }
461
-
462
- .nmorph-text-input input:focus {
463
- ${n()}
464
- background: var(--nmorph-accent-color);
465
- outline: none;
466
- }
467
-
468
- .nmorph-text-input.nmorph--focused .nmorph-text-input__prepend-icon svg {
469
- fill: var(--nmorph-focus-text-color);
470
- }
471
-
472
- .nmorph-text-input.nmorph--focused .nmorph-text-input__prepend-icon path {
473
- stroke: var(--nmorph-focus-text-color);
474
- }
475
-
476
- .nmorph-text-input input:-webkit-autofill,
477
- .nmorph-text-input input:-webkit-autofill:hover,
478
- .nmorph-text-input input:-webkit-autofill:active {
479
- -webkit-text-fill-color: var(--nmorph-text-color);
480
- caret-color: var(--nmorph-text-color);
481
- box-shadow: var(--nmorph-shadow-inset), inset 0 0 0 1000px var(--nmorph-main-color);
482
- }
483
-
484
- .nmorph-text-input input:-webkit-autofill:focus {
485
- -webkit-text-fill-color: var(--nmorph-focus-text-color);
486
- caret-color: var(--nmorph-focus-text-color);
487
- box-shadow: var(--nmorph-shadow-outset), inset 0 0 0 1000px var(--nmorph-accent-color);
488
- outline: none;
489
- }
490
-
491
- .nmorph-text-input input:disabled {
492
- cursor: not-allowed;
493
- opacity: 0.6;
494
- }
495
-
496
- .nmorph-text-input__password-btn {
497
- position: absolute;
498
- right: 0;
499
- height: 100%;
500
- }
501
-
502
- .nmorph-text-input__password-btn .nmorph-button__content {
503
- padding: var(--indentation-03);
504
- }
505
-
506
- .nmorph-text-input.nmorph-button.nmorph--thin-component .nmorph-text-input__password-btn {
507
- margin-top: var(--indentation-00);
508
- }
509
-
510
- .nmorph-text-input.nmorph-button.nmorph--thin-component .nmorph-text-input__password-btn .nmorph-button {
511
- --height: var(--thin-component);
512
- }
513
-
514
- .nmorph-text-input.nmorph-button.nmorph--focused .nmorph-text-input__password-btn .nmorph-icon {
515
- --color: var(--nmorph-white-color);
516
- }
517
-
518
- .nmorph-text-input.nmorph-button.nmorph--focused
519
- .nmorph-text-input__password-btn
520
- .nmorph-button:not(:disabled, [loading='true']):hover
521
- .nmorph-icon {
522
- --color: var(--nmorph-white-color);
523
- }
524
-
525
319
  .list-enter-active,
526
320
  .list-leave-active {
527
321
  transition: all var(--transition-02) ease;
@@ -563,74 +357,20 @@ const u = {
563
357
  }
564
358
  }
565
359
 
566
- .nmorph-scroll {
567
- --thumb-color: var(--nmorph-scroll-thumb-color, var(--nmorph-text-color));
568
- color-scheme: var(--nmorph-scroll-color-scheme, light);
569
- }
570
-
571
- @-moz-document url-prefix() {
572
- .nmorph-scroll {
573
- scrollbar-color: var(--thumb-color) transparent;
574
- scrollbar-width: thin;
575
- }
576
- }
577
-
578
- .nmorph-scroll::-webkit-scrollbar {
579
- width: var(--bar-width);
580
- height: var(--bar-height);
581
- background-color: transparent;
582
- cursor: pointer;
583
- transition: width ease-in-out 0.2s;
584
- }
585
-
586
- .nmorph-scroll::-webkit-scrollbar-button,
587
- .nmorph-scroll::-webkit-scrollbar-button:single-button,
588
- .nmorph-scroll::-webkit-scrollbar-button:double-button,
589
- .nmorph-scroll::-webkit-scrollbar-button:vertical:start:decrement,
590
- .nmorph-scroll::-webkit-scrollbar-button:vertical:end:increment,
591
- .nmorph-scroll::-webkit-scrollbar-button:horizontal:start:decrement,
592
- .nmorph-scroll::-webkit-scrollbar-button:horizontal:end:increment {
593
- display: none !important;
594
- width: 0 !important;
595
- min-width: 0 !important;
596
- max-width: 0 !important;
597
- height: 0 !important;
598
- min-height: 0 !important;
599
- max-height: 0 !important;
600
- border: 0 !important;
601
- background: transparent !important;
602
- background-image: none !important;
603
- -webkit-appearance: none;
604
- appearance: none;
605
- }
606
-
607
- .nmorph-scroll::-webkit-scrollbar-track {
608
- border-radius: var(--border-radius-40);
609
- ${r()}
610
- }
611
-
612
- .nmorph-scroll::-webkit-scrollbar-thumb {
613
- background-color: var(--thumb-color);
614
- border-radius: var(--border-radius-40);
615
- }
616
-
617
- .nmorph-scroll::-webkit-scrollbar-corner {
618
- background-color: transparent;
619
- }
620
360
  `;
621
- for (const [i, h] of Object.entries(u))
361
+ for (const [a, n] of Object.entries(v))
622
362
  t += `
623
- .${i} {
624
- ${h()}
363
+ .${a} {
364
+ ${n()}
625
365
  }
626
366
  `;
627
367
  return t;
628
368
  }, g = () => {
629
369
  if (typeof document > "u" || document.getElementById("nmorph-common-styles")) return;
630
370
  const o = document.createElement("style");
631
- o.id = "nmorph-common-styles", o.innerHTML = v(), document.head.appendChild(o);
371
+ o.id = "nmorph-common-styles", o.innerHTML = u(), document.head.appendChild(o);
632
372
  };
633
373
  export {
634
- v as getCommonStyles,
374
+ u as getCommonStyles,
635
375
  g as useCommonStyles
636
376
  };