@nmorph/nmorph-ui-kit 2.2.35 → 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 (176) hide show
  1. package/dist/assets/icons/baseball.svg.js +28 -0
  2. package/dist/assets/icons/basketball.svg.js +21 -0
  3. package/dist/assets/icons/bowl.svg.js +21 -0
  4. package/dist/assets/icons/box.svg.js +35 -0
  5. package/dist/assets/icons/briefcase.svg.js +21 -0
  6. package/dist/assets/icons/brush-filled.svg.js +21 -0
  7. package/dist/assets/icons/brush.svg.js +21 -0
  8. package/dist/assets/icons/camera-filled.svg.js +21 -0
  9. package/dist/assets/icons/chevron-double-left.svg.js +28 -0
  10. package/dist/assets/icons/chevron-double-right.svg.js +28 -0
  11. package/dist/assets/icons/chevron-double-up.svg.js +28 -0
  12. package/dist/assets/icons/chevron-left.svg.js +21 -0
  13. package/dist/assets/icons/chevron-right.svg.js +21 -0
  14. package/dist/assets/icons/chevron-up.svg.js +21 -0
  15. package/dist/assets/icons/chicken.svg.js +21 -0
  16. package/dist/assets/icons/clipboard-check.svg.js +25 -0
  17. package/dist/assets/icons/clipboard.svg.js +25 -0
  18. package/dist/assets/icons/close-bold.svg.js +21 -0
  19. package/dist/assets/icons/cold-drink.svg.js +21 -0
  20. package/dist/assets/icons/comment.svg.js +21 -0
  21. package/dist/assets/icons/database.svg.js +25 -0
  22. package/dist/assets/icons/drag-handle.svg.js +21 -0
  23. package/dist/assets/icons/external-link.svg.js +28 -0
  24. package/dist/assets/icons/filter-off.svg.js +28 -0
  25. package/dist/assets/icons/fingerprint.svg.js +44 -0
  26. package/dist/assets/icons/folder-remove.svg.js +21 -0
  27. package/dist/assets/icons/goblet.svg.js +21 -0
  28. package/dist/assets/icons/ice-tea.svg.js +21 -0
  29. package/dist/assets/icons/inbox.svg.js +25 -0
  30. package/dist/assets/icons/mail.svg.js +25 -0
  31. package/dist/assets/icons/odometer.svg.js +35 -0
  32. package/dist/assets/icons/open.svg.js +28 -0
  33. package/dist/assets/icons/pagination.svg.js +8 -0
  34. package/dist/assets/icons/redo.svg.js +21 -0
  35. package/dist/assets/icons/save.svg.js +25 -0
  36. package/dist/assets/icons/server.svg.js +32 -0
  37. package/dist/assets/icons/shield-check.svg.js +25 -0
  38. package/dist/assets/icons/shield.svg.js +25 -0
  39. package/dist/assets/icons/sliders.svg.js +31 -0
  40. package/dist/assets/icons/stopwatch.svg.js +28 -0
  41. package/dist/assets/icons/suitcase-line.svg.js +22 -0
  42. package/dist/assets/icons/undo.svg.js +21 -0
  43. package/dist/assets/icons/video-camera.svg.js +21 -0
  44. package/dist/components/basic/nmorph-button/NmorphButton.vue.js +10 -10
  45. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +13 -13
  46. package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +3 -3
  47. package/dist/components/basic/nmorph-icon/NmorphIcons.js +617 -529
  48. package/dist/components/basic/nmorph-layout/NmorphLayout.css +1 -0
  49. package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +50 -0
  50. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +29 -0
  51. package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +1 -1
  52. package/dist/components/basic/nmorph-scroll/NmorphScroll.css +1 -0
  53. package/dist/components/basic/nmorph-scroll/NmorphScroll.vue.js +6 -4
  54. package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +1 -0
  55. package/dist/components/basic/nmorph-space/NmorphSpace.css +1 -0
  56. package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +21 -0
  57. package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +41 -0
  58. package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -1
  59. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +15 -15
  60. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +6 -6
  61. package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +37 -36
  62. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +41 -40
  63. package/dist/components/data/nmorph-card/NmorphCard.vue2.js +15 -14
  64. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +5 -9
  65. package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +3 -3
  66. package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +17 -14
  67. package/dist/components/data/nmorph-image/NmorphImage.css +1 -0
  68. package/dist/components/data/nmorph-image/NmorphImage.vue.js +14 -12
  69. package/dist/components/data/nmorph-image/NmorphImage.vue2.js +3 -2
  70. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +36 -35
  71. package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +31 -31
  72. package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +36 -38
  73. package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +19 -18
  74. package/dist/components/data/nmorph-qr-code/NmorphQRCode.css +1 -0
  75. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue.js +59 -0
  76. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +51 -0
  77. package/dist/components/data/nmorph-qr-code/qr-code.js +568 -0
  78. package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +1 -1
  79. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +39 -43
  80. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.css +1 -0
  81. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue.js +86 -0
  82. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +61 -0
  83. package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +1 -1
  84. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +7 -6
  85. package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
  86. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +25 -20
  87. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +37 -37
  88. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.css +1 -0
  89. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +81 -0
  90. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +48 -0
  91. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +26 -25
  92. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -30
  93. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +59 -64
  94. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +5 -5
  95. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +5 -5
  96. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +20 -19
  97. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.js +13 -13
  98. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +28 -27
  99. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.js +16 -16
  100. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue2.js +20 -17
  101. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +7 -7
  102. package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +2 -2
  103. package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +1 -1
  104. package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +3 -6
  105. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue.js +21 -21
  106. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +92 -84
  107. package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
  108. package/dist/components/form/nmorph-select/NmorphSelect.vue.js +5 -5
  109. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +66 -74
  110. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +4 -4
  111. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +18 -17
  112. package/dist/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue2.js +1 -1
  113. package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +25 -24
  114. package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +1 -1
  115. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +22 -21
  116. package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
  117. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +4 -2
  118. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +17 -19
  119. package/dist/components/form/nmorph-textarea/NmorphTextarea.css +1 -0
  120. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +41 -0
  121. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +67 -0
  122. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
  123. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +43 -42
  124. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +38 -28
  125. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +32 -31
  126. package/dist/components/navigation/nmorph-tabs/NmorphTabs.vue2.js +1 -1
  127. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +1 -1
  128. package/dist/hooks/use-common-styles.js +18 -278
  129. package/dist/hooks/use-virtual-list.js +38 -32
  130. package/dist/icons.js +621 -533
  131. package/dist/index.es.js +780 -678
  132. package/dist/index.umd.js +25 -285
  133. package/dist/package.json.js +1 -1
  134. package/dist/src/components/basic/index.d.ts +2 -0
  135. package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +1 -1
  136. package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +48 -3
  137. package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +22 -0
  138. package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +33 -0
  139. package/dist/src/components/data/index.d.ts +4 -0
  140. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
  141. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
  142. package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +34 -0
  143. package/dist/src/components/data/nmorph-qr-code/qr-code.d.ts +12 -0
  144. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
  145. package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +46 -0
  146. package/dist/src/components/data/nmorph-virtual-list/types.d.ts +4 -0
  147. package/dist/src/components/feedback/index.d.ts +1 -0
  148. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -4
  149. package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +40 -0
  150. package/dist/src/components/form/index.d.ts +1 -0
  151. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
  152. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +2 -2
  153. package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
  154. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +1 -1
  155. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +2 -2
  156. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +1 -1
  157. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +1 -1
  158. package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
  159. package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
  160. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +2 -2
  161. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +1 -1
  162. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +1 -1
  163. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
  164. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +48 -0
  165. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
  166. package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
  167. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +1 -1
  168. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +1 -1
  169. package/dist/src/hooks/use-virtual-list.d.ts +6 -0
  170. package/dist/src/types/index.d.ts +2 -1
  171. package/dist/src/utils/common.d.ts +5 -0
  172. package/dist/src/utils/create-modifiers.d.ts +4 -2
  173. package/dist/style.css +1 -1
  174. package/dist/utils/common.js +9 -2
  175. package/dist/utils/create-modifiers.js +6 -6
  176. package/package.json +1 -1
@@ -0,0 +1,67 @@
1
+ import './NmorphTextarea.css';
2
+ import { defineComponent as F, ref as h, computed as l, watch as B, onMounted as I, nextTick as T } from "vue";
3
+ import { NmorphComponentHeight as O } from "../../../types/index.js";
4
+ import { useModifiers as V } from "../../../utils/create-modifiers.js";
5
+ import { useFormItemInput as j } from "../nmorph-form/use-form-item-input.js";
6
+ const Y = /* @__PURE__ */ F({
7
+ __name: "NmorphTextarea",
8
+ props: {
9
+ placeholder: { type: String, required: !1, default: "" },
10
+ modelValue: { type: String, required: !1, default: "" },
11
+ rows: { type: Number, required: !1, default: 3 },
12
+ minRows: { type: Number, required: !1, default: 2 },
13
+ maxRows: { type: Number, required: !1, default: void 0 },
14
+ resize: { type: String, required: !1, default: "vertical" },
15
+ autoSize: { type: Boolean, required: !1, default: !1 },
16
+ indentation: { type: String, required: !1, default: "12px" },
17
+ textareaAttrs: { type: Object, required: !1, default: () => ({}) },
18
+ id: { type: String, required: !1 },
19
+ name: { type: String, required: !1 },
20
+ autocomplete: { type: String, required: !1 },
21
+ height: { type: null, required: !1, default: "basic" },
22
+ disabled: { type: Boolean, required: !1, default: !1 },
23
+ tabindex: { type: Number, required: !1 }
24
+ },
25
+ emits: ["update:model-value", "focus", "blur", "on-enter", "keydown"],
26
+ setup(y, { expose: g, emit: x }) {
27
+ const e = y, n = x, { id: b, name: w, autocomplete: q, tabindex: v } = j(e), a = h(null), s = h(!1), S = l(
28
+ () => V({
29
+ nmorph: [O[e.height], s.value && "focused"],
30
+ "nmorph-textarea": [e.disabled && "disabled", e.autoSize && "auto-size"]
31
+ })
32
+ ), i = (t) => {
33
+ const o = window.getComputedStyle(t);
34
+ return parseFloat(o.paddingTop) + parseFloat(o.paddingBottom);
35
+ }, r = async () => {
36
+ if (!e.autoSize) return;
37
+ await T();
38
+ const t = a.value;
39
+ if (!t) return;
40
+ t.style.height = "auto";
41
+ const o = window.getComputedStyle(t), N = parseFloat(o.lineHeight) || 20, c = e.maxRows ? e.maxRows * N + i(t) : 1 / 0, C = Math.min(t.scrollHeight, c);
42
+ t.style.height = `${C}px`, t.style.overflowY = t.scrollHeight > c ? "auto" : "hidden";
43
+ }, _ = (t) => {
44
+ const o = t.target;
45
+ n("update:model-value", o.value), r();
46
+ }, z = () => {
47
+ n("focus"), s.value = !0;
48
+ }, H = () => {
49
+ n("blur"), s.value = !1;
50
+ }, u = () => {
51
+ a.value?.focus();
52
+ }, d = () => {
53
+ a.value?.blur();
54
+ }, p = () => {
55
+ a.value?.select();
56
+ };
57
+ B(() => e.modelValue, r), I(r), g({ textareaDOMRef: a, focus: u, blur: d, select: p, resizeToContent: r });
58
+ const f = l(() => Math.max(e.minRows, 1)), R = l(() => Math.max(e.rows, f.value)), M = l(() => ({
59
+ "--nmorph-textarea-resize": e.autoSize ? "none" : e.resize,
60
+ "--nmorph-textarea-indentation": e.indentation
61
+ })), m = { props: e, emit: n, id: b, name: w, autocomplete: q, tabindex: v, textareaDOMRef: a, focused: s, modifiers: S, getVerticalPadding: i, resizeToContent: r, handleInput: _, handleFocus: z, handleBlur: H, focus: u, blur: d, select: p, minRows: f, rows: R, styles: M };
62
+ return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
63
+ }
64
+ });
65
+ export {
66
+ Y as default
67
+ };
@@ -1 +1 @@
1
- .nmorph-time-picker{--width: 160px;position:relative;width:var(--width);height:var(--height)}.nmorph-time-picker .nmorph-time-picker__input{display:flex;align-items:center;height:100%;padding:0 var(--default-indentation-input);overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);cursor:pointer}.nmorph-time-picker .nmorph-time-picker__native{position:absolute;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.nmorph-time-picker .nmorph-time-picker__clock-icon{flex:0 0 auto;margin-right:6px}.nmorph-time-picker .nmorph-time-picker__selected-value{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-time-picker .nmorph-time-picker__clear{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:18px;height:18px;padding:0;color:var(--nmorph-text-color);background:transparent;border:0;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__panel{display:grid;grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr);gap:4px;padding:8px}.nmorph-time-picker .nmorph-time-picker__panel--with-seconds{grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr)}.nmorph-time-picker .nmorph-time-picker__column{display:grid;max-height:220px;overflow-y:auto}.nmorph-time-picker .nmorph-time-picker__separator{display:flex;justify-content:center;align-items:center;color:var(--nmorph-semi-contrast-text-color);font-weight:700}.nmorph-time-picker .nmorph-time-picker__option{padding:0 8px;color:var(--nmorph-text-color);background:transparent;border:0;border-radius:4px;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__option:hover,.nmorph-time-picker .nmorph-time-picker__option--active{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color)}.nmorph-time-picker .nmorph-time-picker__option:disabled{cursor:not-allowed;opacity:.35}.nmorph-time-picker.nmorph-time-picker--open .nmorph-time-picker__input{box-shadow:var(--nmorph-shadow-inset)}.nmorph-time-picker.nmorph-time-picker--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-time-picker.nmorph-time-picker--placeholder .nmorph-time-picker__selected-value{color:var(--nmorph-placeholder-text-color)}.nmorph-time-picker.nmorph-time-picker--disabled{cursor:not-allowed;opacity:.6}.nmorph-time-picker.nmorph-time-picker--disabled .nmorph-time-picker__input{pointer-events:none}
1
+ .nmorph-time-picker{--width: 160px;position:relative;width:var(--width);height:var(--height)}.nmorph-time-picker .nmorph-time-picker__input{display:flex;align-items:center;height:100%;padding:0 var(--default-indentation-input);overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);cursor:pointer}.nmorph-time-picker .nmorph-time-picker__native{position:absolute;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.nmorph-time-picker .nmorph-time-picker__clock-icon{flex:0 0 auto;margin-right:6px}.nmorph-time-picker .nmorph-time-picker__selected-value{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-time-picker .nmorph-time-picker__clear{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:18px;height:18px;padding:0;color:var(--nmorph-text-color);background:transparent;border:0;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__panel{display:grid;grid-template-columns:minmax(0,1fr) 8px minmax(0,1fr);gap:6px;align-items:start;padding:8px;color:var(--nmorph-text-color)}.nmorph-time-picker .nmorph-time-picker__panel--with-seconds{grid-template-columns:minmax(0,1fr) 8px minmax(0,1fr) 8px minmax(0,1fr)}.nmorph-time-picker .nmorph-time-picker__column{display:grid;grid-auto-flow:row;grid-auto-rows:var(--height);grid-template-columns:minmax(0,1fr);gap:4px;align-content:start;max-height:220px;padding:2px;overflow:hidden auto;scrollbar-gutter:stable}.nmorph-time-picker .nmorph-time-picker__separator{display:flex;justify-content:center;align-items:flex-start;min-width:8px;padding-top:calc((var(--height) - 1em) / 2 + 2px);color:var(--nmorph-semi-contrast-text-color);font-weight:700;line-height:1}.nmorph-time-picker .nmorph-time-picker__option{display:flex;justify-content:center;align-items:center;width:100%;min-width:0;min-height:var(--height);margin:0;padding:0 8px;color:var(--nmorph-text-color);font:inherit;line-height:1;background:transparent;border:0;border-radius:4px;box-shadow:none;cursor:pointer;appearance:none}.nmorph-time-picker .nmorph-time-picker__option:hover:not(:disabled),.nmorph-time-picker .nmorph-time-picker__option--active{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color)}.nmorph-time-picker .nmorph-time-picker__option:focus-visible{outline:2px solid var(--nmorph-accent-color);outline-offset:1px}.nmorph-time-picker .nmorph-time-picker__option:disabled{cursor:not-allowed;opacity:.35}.nmorph-time-picker.nmorph-time-picker--open .nmorph-time-picker__input{box-shadow:var(--nmorph-shadow-inset)}.nmorph-time-picker.nmorph-time-picker--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-time-picker.nmorph-time-picker--placeholder .nmorph-time-picker__selected-value{color:var(--nmorph-placeholder-text-color)}.nmorph-time-picker.nmorph-time-picker--disabled{cursor:not-allowed;opacity:.6}.nmorph-time-picker.nmorph-time-picker--disabled .nmorph-time-picker__input{pointer-events:none}
@@ -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";
2
+ import { defineComponent as Z, ref as v, computed as n, watch as ee } from "vue";
3
+ import { NmorphComponentHeight as C } from "../../../types/index.js";
4
+ import { useI18n as te } from "vue-i18n";
5
+ import { useModifiers as _ } from "../../../utils/create-modifiers.js";
6
+ import { toCssSize as oe } from "../../../utils/common.js";
6
7
  import { useFormItemInput as re } from "../nmorph-form/use-form-item-input.js";
7
8
  import ne from "../../../assets/icons/clock.svg.js";
8
9
  import le from "../../../assets/icons/circle-close.svg.js";
9
10
  import ue from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
- import se from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
11
- const Se = /* @__PURE__ */ ee({
11
+ import ae from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
12
+ const ve = /* @__PURE__ */ Z({
12
13
  __name: "NmorphTimePicker",
13
14
  props: {
14
15
  modelValue: { type: [String, null], required: !1, default: null },
@@ -31,17 +32,17 @@ const Se = /* @__PURE__ */ ee({
31
32
  },
32
33
  emits: ["update:model-value", "focus", "blur"],
33
34
  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) => {
35
+ const t = O, a = k, { t: T } = te(), { id: B, name: M, autocomplete: P, tabindex: $ } = re(t), s = v(!1), c = v(!1), w = v(null), m = (e) => String(e).padStart(2, "0"), p = (e) => Math.max(1, Math.floor(Number.isFinite(e) ? e : 1)), i = (e) => {
35
36
  if (!e) return null;
36
37
  const o = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
37
38
  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) => {
39
+ const r = Number(o[1]), b = Number(o[2]), d = Number(o[3] || 0);
40
+ return r > 23 || b > 59 || d > 59 ? null : { hour: r, minute: b, second: d };
41
+ }, g = (e) => {
41
42
  const o = `${m(e.hour)}:${m(e.minute)}`;
42
43
  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(
44
+ }, f = (e) => e.hour * 3600 + e.minute * 60 + e.second, y = n(() => i(t.minTime)), N = n(() => i(t.maxTime)), V = n(() => i(t.modelValue)), u = v(V.value || { hour: 0, minute: 0, second: 0 }), x = n(() => t.placeholder || T("pickATime"));
45
+ ee(
45
46
  () => t.modelValue,
46
47
  (e) => {
47
48
  const o = i(e);
@@ -51,9 +52,9 @@ const Se = /* @__PURE__ */ ee({
51
52
  const h = (e) => {
52
53
  const o = f(e);
53
54
  return !!(y.value && o < f(y.value) || N.value && o > f(N.value));
54
- }, 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);
55
+ }, S = (e, o, r) => {
56
+ const b = p(r), d = /* @__PURE__ */ new Set();
57
+ for (let l = 0; l <= o; l += b) d.add(l);
57
58
  return d.add(u.value[e]), Array.from(d).filter((l) => l >= 0 && l <= o).sort((l, q) => l - q).map((l) => {
58
59
  const q = { ...u.value, [e]: l };
59
60
  return {
@@ -62,44 +63,44 @@ const Se = /* @__PURE__ */ ee({
62
63
  disabled: h(q)
63
64
  };
64
65
  });
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) => {
66
+ }, z = n(() => S("hour", 23, t.hourStep)), D = n(() => S("minute", 59, t.minuteStep)), A = n(() => S("second", 59, t.secondStep)), F = (e, o) => {
66
67
  const r = { ...u.value, [e]: o };
67
- h(r) || (u.value = r, s("update:model-value", v(r)));
68
+ h(r) || (u.value = r, a("update:model-value", g(r)));
69
+ }, R = () => {
70
+ a("update:model-value", null), s.value = !1;
68
71
  }, U = () => {
69
- s("update:model-value", null), a.value = !1;
72
+ s.value = !1;
70
73
  }, j = () => {
71
- a.value = !1;
74
+ t.disabled || (s.value = !s.value);
72
75
  }, E = () => {
73
- t.disabled || (a.value = !a.value);
76
+ c.value = !0, a("focus");
74
77
  }, G = () => {
75
- c.value = !0, s("focus");
76
- }, J = () => {
77
- c.value = !1, s("blur");
78
- }, K = (e) => {
78
+ c.value = !1, a("blur");
79
+ }, J = (e) => {
79
80
  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(
81
+ !r || h(r) || (u.value = r, a("update:model-value", g(r)));
82
+ }, K = n(() => t.modelValue || x.value), L = n(
82
83
  () => 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]],
84
+ ), Q = n(() => t.clearable && !!t.modelValue && !t.disabled), W = n(
85
+ () => _({
86
+ nmorph: [C[t.height]],
86
87
  "nmorph-time-picker": [
87
- `${t.disabled && "disabled"}`,
88
- `${a.value && "open"}`,
89
- `${c.value && "focus"}`,
90
- `${!t.modelValue && "placeholder"}`
88
+ t.disabled && "disabled",
89
+ s.value && "open",
90
+ c.value && "focus",
91
+ !t.modelValue && "placeholder"
91
92
  ]
92
93
  })
93
- ), Y = n(
94
- () => $({
95
- nmorph: [_[t.height]]
94
+ ), X = n(
95
+ () => _({
96
+ nmorph: [C[t.height]]
96
97
  })
97
- ), I = (e) => typeof e == "number" ? `${e}px` : e, Z = n(() => ({
98
- ...t.width !== void 0 && { "--width": I(t.width) }
98
+ ), Y = n(() => ({
99
+ ...t.width !== void 0 && { "--width": oe(t.width) }
99
100
  }));
100
101
  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
+ const I = { props: t, emit: a, t: T, id: B, name: M, autocomplete: P, tabindex: $, open: s, focused: c, inputDOMRef: w, pad: m, normalizeStep: p, parseTime: i, formatTime: g, timeToSeconds: f, minTimeParts: y, maxTimeParts: N, modelTimeParts: V, pickerValue: u, placeholderText: x, isOutsideRange: h, getUnitOptions: S, hourOptions: z, minuteOptions: D, secondOptions: A, selectUnit: F, clearHandler: R, closeHandler: U, toggleOpen: j, focusHandler: E, blurHandler: G, nativeInputHandler: J, displayValue: K, inputStep: L, showClearButton: Q, modifiers: W, optionHeightModifiers: X, styles: Y, get NmorphDropdown() {
103
+ return ae;
103
104
  }, get NmorphIcon() {
104
105
  return ue;
105
106
  }, get NmorphIconCircleClose() {
@@ -107,9 +108,9 @@ const Se = /* @__PURE__ */ ee({
107
108
  }, get NmorphIconClock() {
108
109
  return ne;
109
110
  } };
110
- return Object.defineProperty(C, "__isScriptSetup", { enumerable: !1, value: !0 }), C;
111
+ return Object.defineProperty(I, "__isScriptSetup", { enumerable: !1, value: !0 }), I;
111
112
  }
112
113
  });
113
114
  export {
114
- Se as default
115
+ ve as default
115
116
  };
@@ -1,10 +1,10 @@
1
1
  import './NmorphBacktop.css';
2
- import { defineComponent as y, computed as m, ref as o, onMounted as N, onUnmounted as _ } from "vue";
3
- import { useModifiers as k } from "../../../utils/create-modifiers.js";
4
- import q from "../../basic/nmorph-icon/NmorphIcon.vue.js";
5
- import x from "../../basic/nmorph-button/NmorphButton.vue.js";
6
- import E from "../../../assets/icons/chevron-down.svg.js";
7
- const M = /* @__PURE__ */ y({
2
+ import { defineComponent as E, computed as v, ref as l, onMounted as T, onUnmounted as k } from "vue";
3
+ import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
+ import x from "../../basic/nmorph-icon/NmorphIcon.vue.js";
5
+ import I from "../../basic/nmorph-button/NmorphButton.vue.js";
6
+ import B from "../../../assets/icons/chevron-down.svg.js";
7
+ const Y = /* @__PURE__ */ E({
8
8
  __name: "NmorphBacktop",
9
9
  props: {
10
10
  right: { type: Number, required: !1, default: 40 },
@@ -16,42 +16,52 @@ const M = /* @__PURE__ */ y({
16
16
  teleportDisabled: { type: Boolean, required: !1, default: !1 }
17
17
  },
18
18
  emits: ["click"],
19
- setup(c, { expose: d, emit: f }) {
20
- d();
21
- const t = c, n = f, h = m(
22
- () => k({
23
- "nmorph-backtop": [`${r.value && "show"}`, t.design]
19
+ setup(b, { expose: w, emit: y }) {
20
+ w();
21
+ const t = b, s = y, g = v(
22
+ () => q({
23
+ "nmorph-backtop": [n.value && "show", t.design]
24
24
  })
25
- ), v = m(() => ({
25
+ ), N = v(() => ({
26
26
  "--nmorph-backtop-right": `${t.right}px`,
27
27
  "--nmorph-backtop-bottom": `${t.bottom}px`,
28
28
  "--nmorph-backtop-z-index": t.zIndex
29
- })), e = o(null), i = o(null), s = o(null), r = o(!1), u = o(!1), l = (p) => {
30
- if (!p) return;
31
- const g = p.target;
32
- r.value = g.scrollTop > t.visibilityHeight;
33
- }, b = () => {
34
- n("click"), e.value && e.value.scrollTo({
29
+ })), u = (r) => r === window, c = (r) => u(r) ? window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0 : r.scrollTop, a = (r) => {
30
+ let o = r?.parentElement ?? null;
31
+ for (; o; ) {
32
+ const h = window.getComputedStyle(o), _ = h.overflowY || h.overflow;
33
+ if (["auto", "scroll", "overlay"].includes(_) && o.scrollHeight > o.clientHeight) return o;
34
+ o = o.parentElement;
35
+ }
36
+ return window;
37
+ }, e = l(null), p = l(null), m = l(null), n = l(!1), d = l(!1), i = () => {
38
+ if (!e.value) {
39
+ n.value = !1;
40
+ return;
41
+ }
42
+ n.value = c(e.value) > t.visibilityHeight;
43
+ }, S = () => {
44
+ s("click"), e.value && e.value.scrollTo({
35
45
  top: 0,
36
46
  left: 0,
37
47
  behavior: "smooth"
38
48
  });
39
49
  };
40
- N(() => {
41
- e.value = i.value?.parentElement ?? s.value?.parentElement?.parentElement ?? null, e.value?.addEventListener("scroll", l), r.value = (e.value?.scrollTop ?? 0) > t.visibilityHeight, u.value = !0;
42
- }), _(() => {
43
- e.value && e.value?.removeEventListener("scroll", l);
50
+ T(() => {
51
+ e.value = a(p.value ?? m.value), e.value.addEventListener("scroll", i), i(), d.value = !0;
52
+ }), k(() => {
53
+ e.value && e.value.removeEventListener("scroll", i);
44
54
  });
45
- const a = { props: t, emit: n, modifiers: h, styles: v, container: e, placeholderDOMEl: i, selfDOMEl: s, showButton: r, isMounted: u, scrollHandler: l, scrollToTopHandler: b, get NmorphButton() {
46
- return x;
55
+ const f = { props: t, emit: s, modifiers: g, styles: N, isWindow: u, getScrollTop: c, findScrollableAncestor: a, container: e, placeholderDOMEl: p, selfDOMEl: m, showButton: n, isMounted: d, updateVisibility: i, scrollToTopHandler: S, get NmorphButton() {
56
+ return I;
47
57
  }, get NmorphIcon() {
48
- return q;
58
+ return x;
49
59
  }, get NmorphIconChevronDown() {
50
- return E;
60
+ return B;
51
61
  } };
52
- return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
62
+ return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
53
63
  }
54
64
  });
55
65
  export {
56
- M as default
66
+ Y as default
57
67
  };
@@ -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");