@nmorph/nmorph-ui-kit 2.2.38 → 2.2.39

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 (226) hide show
  1. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +4 -4
  2. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +12 -10
  3. package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +19 -16
  4. package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
  5. package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +30 -26
  6. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +42 -40
  7. package/dist/components/data/nmorph-card/NmorphCard.vue2.js +6 -6
  8. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +24 -21
  9. package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +23 -21
  10. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +43 -42
  11. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +47 -45
  12. package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +18 -14
  13. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +15 -11
  14. package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
  15. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +44 -40
  16. package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue2.js +1 -1
  17. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +21 -19
  18. package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +27 -24
  19. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +19 -15
  20. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +10 -8
  21. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +25 -23
  22. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +8 -8
  23. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +4 -4
  24. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue.js +18 -22
  25. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +42 -33
  26. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +32 -32
  27. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.css +1 -1
  28. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +77 -106
  29. package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.css +1 -1
  30. package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +4 -4
  31. package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +7 -7
  32. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +6 -6
  33. package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
  34. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +51 -49
  35. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -18
  36. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -24
  37. package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +30 -30
  38. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +34 -32
  39. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +16 -16
  40. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
  41. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +12 -12
  42. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +34 -32
  43. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +16 -16
  44. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +64 -57
  45. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +25 -23
  46. package/dist/hooks/use-field-validation.js +50 -66
  47. package/dist/hooks/use-focusable-input.js +27 -0
  48. package/dist/hooks/use-nmorph-translation.js +4 -4
  49. package/dist/index.es.js +842 -837
  50. package/dist/index.umd.js +32 -32
  51. package/dist/package.json.js +1 -1
  52. package/dist/plugin.js +47 -42
  53. package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +4 -17
  54. package/dist/src/components/basic/nmorph-button/types.d.ts +13 -0
  55. package/dist/src/components/basic/nmorph-icon/NmorphIcon.vue.d.ts +3 -9
  56. package/dist/src/components/basic/nmorph-icon/types.d.ts +6 -0
  57. package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +2 -9
  58. package/dist/src/components/basic/nmorph-layout/types.d.ts +8 -0
  59. package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +3 -14
  60. package/dist/src/components/basic/nmorph-link/types.d.ts +11 -0
  61. package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +2 -2
  62. package/dist/src/components/basic/nmorph-scroll/types.d.ts +5 -0
  63. package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +2 -15
  64. package/dist/src/components/basic/nmorph-space/types.d.ts +14 -0
  65. package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +5 -20
  66. package/dist/src/components/data/nmorph-avatar/types.d.ts +21 -0
  67. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +5 -40
  68. package/dist/src/components/data/nmorph-badge/types.d.ts +34 -0
  69. package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +4 -12
  70. package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.d.ts +3 -9
  71. package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/types.d.ts +12 -0
  72. package/dist/src/components/data/nmorph-calendar/types.d.ts +13 -0
  73. package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +2 -10
  74. package/dist/src/components/data/nmorph-card/types.d.ts +9 -0
  75. package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -5
  76. package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.d.ts +2 -4
  77. package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/types.d.ts +3 -0
  78. package/dist/src/components/data/nmorph-carousel/types.d.ts +6 -0
  79. package/dist/src/components/data/nmorph-collapse/NmorphCollapse.vue.d.ts +3 -7
  80. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +4 -10
  81. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/types.d.ts +13 -0
  82. package/dist/src/components/data/nmorph-collapse/types.d.ts +7 -0
  83. package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +3 -12
  84. package/dist/src/components/data/nmorph-empty/types.d.ts +11 -0
  85. package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -8
  86. package/dist/src/components/data/nmorph-image/types.d.ts +10 -0
  87. package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +3 -18
  88. package/dist/src/components/data/nmorph-image-preview/types.d.ts +19 -0
  89. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -13
  90. package/dist/src/components/data/nmorph-pagination/types.d.ts +14 -0
  91. package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +3 -15
  92. package/dist/src/components/data/nmorph-progress/types.d.ts +12 -0
  93. package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +5 -15
  94. package/dist/src/components/data/nmorph-qr-code/types.d.ts +12 -0
  95. package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -7
  96. package/dist/src/components/data/nmorph-skeleton/components/NmorphSkeletonItem.vue.d.ts +3 -9
  97. package/dist/src/components/data/nmorph-skeleton/components/types.d.ts +8 -0
  98. package/dist/src/components/data/nmorph-skeleton/types.d.ts +6 -0
  99. package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +4 -18
  100. package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.d.ts +2 -4
  101. package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/types.d.ts +3 -0
  102. package/dist/src/components/data/nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.d.ts +4 -5
  103. package/dist/src/components/data/nmorph-table/components/nmorph-table-column/types.d.ts +3 -0
  104. package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/NmorphSortButton.vue.d.ts +4 -6
  105. package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/types.d.ts +7 -0
  106. package/dist/src/components/data/nmorph-table/types.d.ts +15 -0
  107. package/dist/src/components/data/nmorph-tag-list/NmorphTagList.vue.d.ts +5 -8
  108. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +3 -5
  109. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/types.d.ts +6 -0
  110. package/dist/src/components/data/nmorph-tag-list/types.d.ts +7 -0
  111. package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +3 -14
  112. package/dist/src/components/data/nmorph-virtual-list/types.d.ts +15 -0
  113. package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +5 -7
  114. package/dist/src/components/feedback/nmorph-alert/types.d.ts +5 -0
  115. package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +4 -16
  116. package/dist/src/components/feedback/nmorph-callout/types.d.ts +12 -0
  117. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -19
  118. package/dist/src/components/feedback/nmorph-dialog/types.d.ts +20 -0
  119. package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +4 -17
  120. package/dist/src/components/feedback/nmorph-drawer/types.d.ts +18 -0
  121. package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +5 -14
  122. package/dist/src/components/feedback/nmorph-tooltip/types.d.ts +11 -0
  123. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +6 -19
  124. package/dist/src/components/form/nmorph-autocomplete/types.d.ts +18 -0
  125. package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -1
  126. package/dist/src/components/form/nmorph-checkbox/types.d.ts +3 -0
  127. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -10
  128. package/dist/src/components/form/nmorph-checkbox-group/types.d.ts +11 -0
  129. package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +6 -11
  130. package/dist/src/components/form/nmorph-color-picker/types.d.ts +11 -0
  131. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -20
  132. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-clear-button/types.d.ts +3 -0
  133. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +3 -8
  134. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/types.d.ts +10 -0
  135. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/NmorphDatePickerHeader.vue.d.ts +3 -6
  136. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/types.d.ts +12 -0
  137. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.d.ts +3 -6
  138. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/types.d.ts +9 -0
  139. package/dist/src/components/form/nmorph-date-picker/types.d.ts +21 -0
  140. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +5 -13
  141. package/dist/src/components/form/nmorph-file-upload/types.d.ts +17 -0
  142. package/dist/src/components/form/nmorph-form/NmorphForm.vue.d.ts +4 -8
  143. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +3 -12
  144. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +3 -8
  145. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/types.d.ts +7 -0
  146. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/NmorphValidationIcon.vue.d.ts +3 -6
  147. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/types.d.ts +5 -0
  148. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/types.d.ts +10 -0
  149. package/dist/src/components/form/nmorph-form/types.d.ts +6 -1
  150. package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +3 -10
  151. package/dist/src/components/form/nmorph-number-input/types.d.ts +11 -0
  152. package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +5 -13
  153. package/dist/src/components/form/nmorph-otp-input/types.d.ts +21 -0
  154. package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +4 -9
  155. package/dist/src/components/form/nmorph-radio/types.d.ts +6 -0
  156. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +3 -11
  157. package/dist/src/components/form/nmorph-radio-group/types.d.ts +12 -0
  158. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +3 -21
  159. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -1
  160. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/types.d.ts +3 -0
  161. package/dist/src/components/form/nmorph-select/types.d.ts +21 -0
  162. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +4 -12
  163. package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue.d.ts +3 -6
  164. package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/types.d.ts +4 -0
  165. package/dist/src/components/form/nmorph-select-button/types.d.ts +12 -0
  166. package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +111 -0
  167. package/dist/src/components/form/nmorph-slider/types.d.ts +3 -0
  168. package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +3 -14
  169. package/dist/src/components/form/nmorph-switch/types.d.ts +15 -0
  170. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +6 -14
  171. package/dist/src/components/form/nmorph-text-input/types.d.ts +16 -0
  172. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +6 -18
  173. package/dist/src/components/form/nmorph-textarea/types.d.ts +20 -0
  174. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +6 -20
  175. package/dist/src/components/form/nmorph-time-picker/types.d.ts +24 -0
  176. package/dist/src/components/navigation/index.d.ts +1 -1
  177. package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +4 -12
  178. package/dist/src/components/navigation/nmorph-backtop/types.d.ts +14 -0
  179. package/dist/src/components/navigation/nmorph-breadcrumb/NmorphBreadcrumb.vue.d.ts +2 -4
  180. package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/NmorphBreadcrumbItem.vue.d.ts +2 -4
  181. package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/types.d.ts +3 -0
  182. package/dist/src/components/navigation/nmorph-breadcrumb/types.d.ts +3 -0
  183. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +10 -31
  184. package/dist/src/components/navigation/nmorph-context-menu/types.d.ts +42 -0
  185. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +6 -24
  186. package/dist/src/components/navigation/nmorph-dropdown/types.d.ts +24 -0
  187. package/dist/src/components/navigation/nmorph-tabs/NmorphTabs.vue.d.ts +4 -8
  188. package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/NmorphTabPane.vue.d.ts +4 -5
  189. package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/types.d.ts +3 -0
  190. package/dist/src/components/navigation/nmorph-tabs/{type.d.ts → types.d.ts} +9 -0
  191. package/dist/src/components/navigation/nmorph-tabs/utils.d.ts +1 -1
  192. package/dist/src/components/others/nmorph-divider/NmorphDivider.vue.d.ts +2 -5
  193. package/dist/src/components/others/nmorph-divider/types.d.ts +3 -0
  194. package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +3 -12
  195. package/dist/src/components/others/nmorph-overlay/types.d.ts +14 -0
  196. package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +2 -8
  197. package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +9 -0
  198. package/dist/src/hooks/use-focusable-input.d.ts +16 -0
  199. package/dist/src/hooks/use-form-validation.d.ts +1 -2
  200. package/dist/src/plugin.d.ts +4 -1
  201. package/dist/src/types/app.types.d.ts +21 -0
  202. package/dist/src/types/common.types.d.ts +62 -0
  203. package/dist/src/types/date.types.d.ts +7 -0
  204. package/dist/src/types/image.types.d.ts +17 -0
  205. package/dist/src/types/index.d.ts +8 -206
  206. package/dist/src/types/selection.types.d.ts +26 -0
  207. package/dist/src/types/table.types.d.ts +5 -0
  208. package/dist/src/types/theme.types.d.ts +55 -0
  209. package/dist/src/types/translation.types.d.ts +20 -0
  210. package/dist/src/utils/common.d.ts +3 -0
  211. package/dist/src/utils/file-types.d.ts +8 -0
  212. package/dist/src/utils/index.d.ts +1 -0
  213. package/dist/style.css +1 -1
  214. package/dist/types/common.types.js +14 -0
  215. package/dist/types/date.types.js +4 -0
  216. package/dist/types/image.types.js +5 -0
  217. package/dist/types/selection.types.js +4 -0
  218. package/dist/types/table.types.js +4 -0
  219. package/dist/types/translation.types.js +4 -0
  220. package/dist/utils/common.js +16 -6
  221. package/dist/utils/file-types.js +41 -0
  222. package/package.json +1 -1
  223. package/dist/src/components/data/nmorph-calendar/hooks/index.d.ts +0 -2
  224. package/dist/src/hooks/index.d.ts +0 -9
  225. package/dist/src/outside-hooks/index.d.ts +0 -5
  226. package/dist/types/index.js +0 -20
@@ -1,7 +1,7 @@
1
1
  import './NmorphTagItem.css';
2
2
  import { defineComponent as i, computed as s } from "vue";
3
3
  import { useModifiers as u } from "../../../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as a } from "../../../../../types/index.js";
4
+ import { NmorphComponentHeight as a } from "../../../../../types/common.types.js";
5
5
  import l from "../../../../../assets/icons/error.svg.js";
6
6
  import d from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
7
7
  const N = /* @__PURE__ */ i({
@@ -1,9 +1,9 @@
1
1
  import './NmorphVirtualList.css';
2
- import { defineComponent as K, computed as t } from "vue";
2
+ import { defineComponent as I, computed as t } from "vue";
3
+ import { useVirtualList as K } from "../../../hooks/use-virtual-list.js";
3
4
  import { useModifiers as N } from "../../../utils/create-modifiers.js";
4
- import { toCssSize as p } from "../../../utils/common.js";
5
- import { useVirtualList as T } from "../../../hooks/use-virtual-list.js";
6
- const B = /* @__PURE__ */ K({
5
+ import { createCssSizeVariables as T } from "../../../utils/common.js";
6
+ const j = /* @__PURE__ */ I({
7
7
  __name: "NmorphVirtualList",
8
8
  props: {
9
9
  items: { type: Array, required: !1, default: () => [] },
@@ -17,45 +17,47 @@ const B = /* @__PURE__ */ K({
17
17
  itemTag: { type: String, required: !1, default: "div" }
18
18
  },
19
19
  emits: ["on-scroll"],
20
- setup(y, { expose: h, emit: g }) {
21
- const e = y, n = g, a = t(() => e.items), o = t(() => !e.disabled), l = t(() => e.itemHeight), u = t(() => e.overscan), m = t(() => e.dynamic), r = T(a, {
20
+ setup(p, { expose: y, emit: h }) {
21
+ const e = p, a = h, n = t(() => e.items), o = t(() => !e.disabled), l = t(() => e.itemHeight), u = t(() => e.overscan), m = t(() => e.dynamic), r = K(n, {
22
22
  enabled: o,
23
23
  itemHeight: l,
24
24
  overscan: u,
25
25
  dynamic: m
26
- }), d = r.containerRef, v = t(
26
+ }), d = r.containerRef, g = t(
27
27
  () => N({
28
28
  "nmorph-virtual-list": [e.disabled && "disabled", e.dynamic && "dynamic"]
29
29
  })
30
- ), b = t(() => ({
31
- "--nmorph-virtual-list-height": p(e.height),
32
- "--nmorph-virtual-list-max-height": p(e.maxHeight),
30
+ ), v = t(() => ({
31
+ ...T({
32
+ "--nmorph-virtual-list-height": e.height,
33
+ "--nmorph-virtual-list-max-height": e.maxHeight
34
+ }),
33
35
  "--nmorph-virtual-list-item-height": `${e.itemHeight}px`
34
- })), S = t(() => ({
36
+ })), b = t(() => ({
35
37
  transform: o.value ? `translateY(${r.offsetTop.value}px)` : void 0
36
- })), _ = t(() => ({
38
+ })), S = t(() => ({
37
39
  height: o.value ? `${r.totalHeight.value}px` : void 0
38
- })), q = t(() => r.virtualItems.value), x = (i, s) => {
40
+ })), _ = t(() => r.virtualItems.value), q = (i, s) => {
39
41
  if (typeof e.itemKey == "function") return e.itemKey(i, s);
40
42
  if (typeof e.itemKey == "string" && i && typeof i == "object") {
41
43
  const f = i[e.itemKey];
42
44
  return f === void 0 ? s : String(f);
43
45
  }
44
46
  return s;
45
- }, H = (i) => {
46
- r.scrollHandler(), n("on-scroll", i);
47
- }, I = (i, s) => {
47
+ }, x = (i) => {
48
+ r.scrollHandler(), a("on-scroll", i);
49
+ }, H = (i, s) => {
48
50
  r.measureElement(s, i);
49
51
  };
50
- h({
52
+ y({
51
53
  containerRef: d,
52
54
  refresh: r.refresh,
53
55
  scrollToIndex: r.scrollToIndex
54
56
  });
55
- const c = { props: e, emit: n, items: a, enabled: o, itemHeight: l, overscan: u, dynamic: m, virtualList: r, containerRef: d, modifiers: v, styles: b, contentStyle: S, spacerStyle: _, renderedItems: q, getItemKey: x, scrollHandler: H, setItemRef: I };
57
+ const c = { props: e, emit: a, items: n, enabled: o, itemHeight: l, overscan: u, dynamic: m, virtualList: r, containerRef: d, modifiers: g, styles: v, contentStyle: b, spacerStyle: S, renderedItems: _, getItemKey: q, scrollHandler: x, setItemRef: H };
56
58
  return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
57
59
  }
58
60
  });
59
61
  export {
60
- B as default
62
+ j as default
61
63
  };
@@ -1,14 +1,15 @@
1
1
  import './NmorphAlert.css';
2
- import { defineComponent as u, computed as l, useSlots as m } from "vue";
2
+ import { defineComponent as m, computed as l, useSlots as u } from "vue";
3
3
  import { useModifiers as y } from "../../../utils/create-modifiers.js";
4
- import { NmorphAlertType as o } from "./types.js";
5
- import g from "../../../assets/icons/circle-close-filled.svg.js";
6
- import h from "../../../assets/icons/info-filled.svg.js";
7
- import I from "../../../assets/icons/warn-triangle-filled.svg.js";
8
- import q from "../../../assets/icons/success-filled.svg.js";
9
- import N from "../../../assets/icons/cross.svg.js";
10
- import b from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
- const x = /* @__PURE__ */ u({
4
+ import { createCssVariables as g } from "../../../utils/common.js";
5
+ import { NmorphAlertType as r } from "./types.js";
6
+ import h from "../../../assets/icons/circle-close-filled.svg.js";
7
+ import I from "../../../assets/icons/info-filled.svg.js";
8
+ import q from "../../../assets/icons/warn-triangle-filled.svg.js";
9
+ import N from "../../../assets/icons/success-filled.svg.js";
10
+ import b from "../../../assets/icons/cross.svg.js";
11
+ import S from "../../basic/nmorph-icon/NmorphIcon.vue.js";
12
+ const M = /* @__PURE__ */ m({
12
13
  __name: "NmorphAlert",
13
14
  props: {
14
15
  id: { type: String, required: !1, default: void 0 },
@@ -24,30 +25,32 @@ const x = /* @__PURE__ */ u({
24
25
  backgroundColor: { type: String, required: !1, default: void 0 }
25
26
  },
26
27
  emits: ["close"],
27
- setup(n, { expose: i, emit: s }) {
28
+ setup(s, { expose: i, emit: n }) {
28
29
  i();
29
- const e = n, r = s, a = l(
30
+ const e = s, o = n, a = l(
30
31
  () => y({
31
32
  "nmorph-alert": [e.type, e.bordered && "bordered", e.fill && "fill"]
32
33
  })
33
- ), d = l(() => ({
34
+ ), p = l(() => ({
34
35
  "--nmorph-alert-close-align": e.closeIconPosition,
35
- ...e.backgroundColor !== void 0 && { "--background-color": e.backgroundColor }
36
- })), p = () => {
37
- r("close");
38
- }, f = {
39
- [o.success]: q,
40
- [o.warning]: I,
41
- [o.info]: h,
42
- [o.error]: g
43
- }, c = m(), t = { props: e, emit: r, modifiers: a, styles: d, closeHandler: p, iconNameMap: f, slots: c, get NmorphIcon() {
44
- return b;
36
+ ...g({
37
+ "--background-color": e.backgroundColor
38
+ })
39
+ })), f = () => {
40
+ o("close");
41
+ }, d = {
42
+ [r.success]: N,
43
+ [r.warning]: q,
44
+ [r.info]: I,
45
+ [r.error]: h
46
+ }, c = u(), t = { props: e, emit: o, modifiers: a, styles: p, closeHandler: f, iconNameMap: d, slots: c, get NmorphIcon() {
47
+ return S;
45
48
  }, get NmorphIconCross() {
46
- return N;
49
+ return b;
47
50
  } };
48
51
  return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
49
52
  }
50
53
  });
51
54
  export {
52
- x as default
55
+ M as default
53
56
  };
@@ -1,7 +1,7 @@
1
1
  import './NmorphCallout.css';
2
- import { defineComponent as o, computed as l } from "vue";
3
- import { toCssSize as t } from "../../../utils/common.js";
4
- const s = /* @__PURE__ */ o({
2
+ import { defineComponent as n, computed as l } from "vue";
3
+ import { createCssVariables as o, createCssSizeVariables as u } from "../../../utils/common.js";
4
+ const p = /* @__PURE__ */ n({
5
5
  __name: "NmorphCallout",
6
6
  props: {
7
7
  type: { type: String, required: !1, default: "info" },
@@ -15,20 +15,24 @@ const s = /* @__PURE__ */ o({
15
15
  titleFontSize: { type: [Number, String], required: !1, default: "var(--font-size-medium)" },
16
16
  contentFontSize: { type: [Number, String], required: !1, default: "var(--font-size-extra-small)" }
17
17
  },
18
- setup(i, { expose: a }) {
18
+ setup(r, { expose: a }) {
19
19
  a();
20
- const e = i, n = l(() => ({
21
- "--callout-padding": t(e.padding),
22
- "--callout-border-radius": t(e.borderRadius),
23
- "--callout-accent-width": t(e.accentWidth),
24
- "--callout-title-gap": t(e.titleGap),
25
- "--callout-title-font-size": t(e.titleFontSize),
26
- "--callout-content-font-size": t(e.contentFontSize),
27
- ...e.color !== void 0 && { "--callout-color": e.color }
28
- })), r = { props: e, styles: n };
29
- return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
20
+ const e = r, i = l(() => ({
21
+ ...u({
22
+ "--callout-padding": e.padding,
23
+ "--callout-border-radius": e.borderRadius,
24
+ "--callout-accent-width": e.accentWidth,
25
+ "--callout-title-gap": e.titleGap,
26
+ "--callout-title-font-size": e.titleFontSize,
27
+ "--callout-content-font-size": e.contentFontSize
28
+ }),
29
+ ...o({
30
+ "--callout-color": e.color
31
+ })
32
+ })), t = { props: e, styles: i };
33
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
30
34
  }
31
35
  });
32
36
  export {
33
- s as default
37
+ p as default
34
38
  };
@@ -1,7 +1,7 @@
1
1
  import './NmorphDrawer.css';
2
2
  import { defineComponent as m, useSlots as c, computed as o } from "vue";
3
3
  import { useModifiers as y } from "../../../utils/create-modifiers.js";
4
- import { toCssSize as h } from "../../../utils/common.js";
4
+ import { createCssSizeVariables as h } from "../../../utils/common.js";
5
5
  import q from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
6
  import _ from "../../basic/nmorph-icon/NmorphIcon.vue.js";
7
7
  import v from "../../../assets/icons/cross.svg.js";
@@ -21,26 +21,28 @@ const w = /* @__PURE__ */ m({
21
21
  contentClass: { type: String, required: !1, default: "" }
22
22
  },
23
23
  emits: ["on-close", "update:model-value"],
24
- setup(a, { expose: n, emit: u }) {
24
+ setup(s, { expose: n, emit: u }) {
25
25
  n();
26
- const e = a, r = u, t = c(), d = o(
26
+ const e = s, r = u, t = c(), d = o(
27
27
  () => y({
28
28
  "nmorph-drawer": [e.placement, e.modelValue && "open"]
29
29
  })
30
- ), p = o(() => ({
31
- "--nmorph-drawer-size": h(e.size)
32
- })), l = () => {
30
+ ), p = o(
31
+ () => h({
32
+ "--nmorph-drawer-size": e.size
33
+ })
34
+ ), l = () => {
33
35
  r("on-close"), r("update:model-value", !1);
34
36
  }, i = () => {
35
37
  e.closeOnOverlay && l();
36
- }, f = o(() => !!(t.header || e.title || e.showClose)), s = { props: e, emit: r, slots: t, modifiers: d, drawerStyle: p, closeHandler: l, overlayClickHandler: i, hasHeader: f, get NmorphIcon() {
38
+ }, f = o(() => !!(t.header || e.title || e.showClose)), a = { props: e, emit: r, slots: t, modifiers: d, drawerStyle: p, closeHandler: l, overlayClickHandler: i, hasHeader: f, get NmorphIcon() {
37
39
  return _;
38
40
  }, get NmorphIconCross() {
39
41
  return v;
40
42
  }, get NmorphOverlay() {
41
43
  return q;
42
44
  } };
43
- return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
45
+ return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
44
46
  }
45
47
  });
46
48
  export {
@@ -1,10 +1,10 @@
1
1
  import './NmorphTooltip.css';
2
- import { defineComponent as y, ref as o, computed as r } from "vue";
3
- import { useModifiers as w } from "../../../utils/create-modifiers.js";
4
- import { toCssSize as i } from "../../../utils/common.js";
5
- import { usePlacement as S } from "../../../hooks/use-placement.js";
6
- import { useZIndex as _ } from "../../../hooks/use-z-index.js";
7
- const z = /* @__PURE__ */ y({
2
+ import { defineComponent as x, ref as o, computed as r } from "vue";
3
+ import { usePlacement as y } from "../../../hooks/use-placement.js";
4
+ import { useZIndex as S } from "../../../hooks/use-z-index.js";
5
+ import { useModifiers as _ } from "../../../utils/create-modifiers.js";
6
+ import { createCssSizeVariables as w } from "../../../utils/common.js";
7
+ const z = /* @__PURE__ */ x({
8
8
  __name: "NmorphTooltip",
9
9
  props: {
10
10
  text: { type: String, required: !1, default: "" },
@@ -16,35 +16,37 @@ const z = /* @__PURE__ */ y({
16
16
  maxWidth: { type: [Number, String], required: !1, default: void 0 },
17
17
  height: { type: [Number, String], required: !1, default: void 0 }
18
18
  },
19
- setup(p, { expose: m }) {
20
- const e = p, t = o(e.forceShow), n = o(null), l = o(null), { placement: d } = S({
19
+ setup(f, { expose: p }) {
20
+ const e = f, t = o(e.forceShow), i = o(null), l = o(null), { placement: n } = y({
21
21
  initialPlacement: e.position,
22
- contentDOMElement: n,
22
+ contentDOMElement: i,
23
23
  relativeElement: l
24
24
  }), c = r(
25
- () => w({
25
+ () => _({
26
26
  "nmorph-tooltip": [
27
- d.value,
27
+ n.value,
28
28
  !!e.forceCoordinate?.x && !!e.forceCoordinate?.y && "force-coords"
29
29
  ]
30
30
  })
31
- ), h = () => {
31
+ ), m = () => {
32
32
  t.value = !0;
33
- }, v = () => {
33
+ }, h = () => {
34
34
  e.forceShow || (t.value = !1);
35
- }, a = r(() => e.forceCoordinate ? "100%" : "auto"), u = _(
35
+ }, a = r(() => e.forceCoordinate ? "100%" : "auto"), s = S(
36
36
  () => t.value,
37
37
  () => e.zIndex
38
- ), x = r(() => ({
38
+ ), v = r(() => ({
39
39
  "--nmorph-tooltip-width": a.value,
40
- "--nmorph-tooltip-z-index": u.value,
41
- ...e.width !== void 0 && { "--width": i(e.width) },
42
- ...e.maxWidth !== void 0 && { "--max-width": i(e.maxWidth) },
43
- ...e.height !== void 0 && { "--height": i(e.height) }
44
- })), s = o(null);
45
- m({ tooltipBody: s });
46
- const f = { props: e, showTooltip: t, tooltipDOMRef: n, slotDOMRef: l, placement: d, modifiers: c, handleMouseEnter: h, handleMouseLeave: v, rootWidth: a, zIndex: u, styles: x, tooltipBody: s };
47
- return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
40
+ "--nmorph-tooltip-z-index": s.value,
41
+ ...w({
42
+ "--width": e.width,
43
+ "--max-width": e.maxWidth,
44
+ "--height": e.height
45
+ })
46
+ })), u = o(null);
47
+ p({ tooltipBody: u });
48
+ const d = { props: e, showTooltip: t, tooltipDOMRef: i, slotDOMRef: l, placement: n, modifiers: c, handleMouseEnter: m, handleMouseLeave: h, rootWidth: a, zIndex: s, styles: v, tooltipBody: u };
49
+ return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
48
50
  }
49
51
  });
50
52
  export {
@@ -2,10 +2,10 @@ import './NmorphAutocomplete.css';
2
2
  import { defineComponent as K, ref as s, computed as l, watch as c, nextTick as Q } from "vue";
3
3
  import { useModifiers as M } from "../../../utils/create-modifiers.js";
4
4
  import { getNmorphOptionHeight as W, toCssSize as X, resolveDomElement as Y } from "../../../utils/common.js";
5
- import { NmorphComponentHeight as ee } from "../../../types/index.js";
6
- import { useFormItemModel as te } from "../nmorph-form/use-form-item-input.js";
7
- import { useVirtualList as ae } from "../../../hooks/use-virtual-list.js";
8
- import { useZIndex as le } from "../../../hooks/use-z-index.js";
5
+ import { useZIndex as ee } from "../../../hooks/use-z-index.js";
6
+ import { useVirtualList as te } from "../../../hooks/use-virtual-list.js";
7
+ import { useFormItemModel as ae } from "../nmorph-form/use-form-item-input.js";
8
+ import { NmorphComponentHeight as le } from "../../../types/common.types.js";
9
9
  import re from "../nmorph-text-input/NmorphTextInput.vue.js";
10
10
  import oe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
11
11
  import ue from "../../basic/nmorph-icon/NmorphIcon.vue.js";
@@ -34,7 +34,7 @@ const Ie = /* @__PURE__ */ K({
34
34
  emits: ["update:model-value", "select"],
35
35
  setup(O, { expose: L, emit: V }) {
36
36
  L();
37
- const t = O, p = V, { modelValue: m, updateModelValue: v } = te(
37
+ const t = O, p = V, { modelValue: m, updateModelValue: v } = ae(
38
38
  t,
39
39
  (e) => p("update:model-value", e),
40
40
  ""
@@ -49,7 +49,7 @@ const Ie = /* @__PURE__ */ K({
49
49
  set: b
50
50
  }), a = s(!1), z = s(null), x = () => {
51
51
  i.value = !0, a.value = !1;
52
- }, r = l(() => t.list.filter((e) => Object.keys(e).some((I) => String(e[I]).toLowerCase().includes(o.value.toLowerCase())))), f = l(() => t.virtual && r.value.length > 0), H = l(() => t.virtualItemHeight || W(t.height)), q = l(() => t.virtualOverscan), N = l(() => t.virtualDynamicHeight), n = ae(r, {
52
+ }, r = l(() => t.list.filter((e) => Object.keys(e).some((I) => String(e[I]).toLowerCase().includes(o.value.toLowerCase())))), f = l(() => t.virtual && r.value.length > 0), H = l(() => t.virtualItemHeight || W(t.height)), q = l(() => t.virtualOverscan), N = l(() => t.virtualDynamicHeight), n = te(r, {
53
53
  enabled: f,
54
54
  itemHeight: H,
55
55
  overscan: q,
@@ -92,11 +92,11 @@ const Ie = /* @__PURE__ */ K({
92
92
  "aria-activedescendant": a.value ? D(u.value) : void 0
93
93
  })), P = (e, I) => {
94
94
  n.measureElement(I, Y(e));
95
- }, C = le(a, () => t.zIndex), G = l(() => ({
95
+ }, C = ee(a, () => t.zIndex), G = l(() => ({
96
96
  "--nmorph-autocomplete-input-z-index": C.value + 1
97
97
  })), J = l(
98
98
  () => M({
99
- nmorph: [ee[t.height]]
99
+ nmorph: [le[t.height]]
100
100
  })
101
101
  ), _ = { props: t, emit: p, modelValue: m, updateModelValue: v, initialValue: o, modifiers: A, userClosed: i, updateValueHandler: b, inputValue: T, open: a, nmorphAutocompleteDOMRef: z, closeHandler: x, filteredList: r, virtualEnabled: f, virtualItemHeight: H, virtualOverscan: q, virtualDynamicHeight: N, virtualList: n, virtualItems: B, virtualSpacerStyle: E, virtualContentStyle: $, virtualMaxHeight: j, currentIndex: u, activeItem: h, listboxId: g, getOptionId: D, selectItem: y, clickHandler: F, focusHandler: R, loader: d, arrowDownHandler: S, arrowUpHandler: w, enterHandler: k, keydownHandler: U, inputAttrs: Z, setVirtualItemRef: P, dropdownZIndex: C, styles: G, optionHeightModifiers: J, get NmorphIcon() {
102
102
  return ue;
@@ -1,8 +1,8 @@
1
1
  import './NmorphCheckbox.css';
2
2
  import { defineComponent as x, inject as i, watch as S, ref as n, computed as d } from "vue";
3
3
  import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
- import { NmorphSelectionControlHeight as V } from "../../../types/index.js";
5
- import { useFormItemModel as C } from "../nmorph-form/use-form-item-input.js";
4
+ import { useFormItemModel as V } from "../nmorph-form/use-form-item-input.js";
5
+ import { NmorphSelectionControlHeight as C } from "../../../types/common.types.js";
6
6
  const H = /* @__PURE__ */ x({
7
7
  __name: "NmorphCheckbox",
8
8
  props: {
@@ -21,7 +21,7 @@ const H = /* @__PURE__ */ x({
21
21
  ), u = i(
22
22
  "change-checkbox-value-handler",
23
23
  void 0
24
- ), s = i("checkbox-group-height", void 0), e = g, c = _, { modelValue: l, updateModelValue: p } = C(
24
+ ), s = i("checkbox-group-height", void 0), e = g, c = _, { modelValue: l, updateModelValue: p } = V(
25
25
  e,
26
26
  (r) => c("update:model-value", r),
27
27
  !1
@@ -41,7 +41,7 @@ const H = /* @__PURE__ */ x({
41
41
  }
42
42
  }, k = d(
43
43
  () => q({
44
- nmorph: [V[m.value]],
44
+ nmorph: [C[m.value]],
45
45
  "nmorph-checkbox": [
46
46
  h.value && "checked",
47
47
  e.disabled && "disabled",
@@ -1,21 +1,21 @@
1
1
  import './NmorphColorPicker.css';
2
- import t from "./NmorphColorPicker.vue2.js";
3
- import { openBlock as n, createElementBlock as i, normalizeClass as a, createElementVNode as e, normalizeStyle as c, toDisplayString as s, createCommentVNode as d } from "vue";
2
+ import a from "./NmorphColorPicker.vue2.js";
3
+ import { openBlock as l, createElementBlock as i, normalizeClass as c, createElementVNode as n, normalizeStyle as t, toDisplayString as d, createCommentVNode as s } from "vue";
4
4
  /* empty css */
5
5
  import m from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const p = { class: "nmorph-color-picker__content" }, _ = ["id", "name", "tabindex", "value", "disabled"], f = {
6
+ const p = { class: "nmorph-color-picker__content" }, _ = ["id", "name", "tabindex", "value", "disabled"], h = {
7
7
  key: 0,
8
8
  class: "nmorph-color-picker__value"
9
9
  };
10
- function u(h, r, k, o, v, b) {
11
- return n(), i(
10
+ function u(f, r, k, o, v, b) {
11
+ return l(), i(
12
12
  "div",
13
13
  {
14
- class: a(o.modifiers)
14
+ class: c(o.modifiers)
15
15
  },
16
16
  [
17
- e("div", p, [
18
- e("input", {
17
+ n("div", p, [
18
+ n("input", {
19
19
  id: o.id,
20
20
  ref: "inputDOMRef",
21
21
  name: o.name,
@@ -25,37 +25,33 @@ function u(h, r, k, o, v, b) {
25
25
  value: o.currentValue,
26
26
  disabled: o.props.disabled,
27
27
  onInput: o.handleInput,
28
- onFocus: r[0] || (r[0] = (l) => {
29
- o.focused = !0, o.emit("focus");
30
- }),
31
- onBlur: r[1] || (r[1] = (l) => {
32
- o.focused = !1, o.emit("blur");
33
- })
28
+ onFocus: r[0] || (r[0] = (...e) => o.handleFocus && o.handleFocus(...e)),
29
+ onBlur: r[1] || (r[1] = (...e) => o.handleBlur && o.handleBlur(...e))
34
30
  }, null, 40, _),
35
- e(
31
+ n(
36
32
  "div",
37
33
  {
38
34
  class: "nmorph-color-picker__swatch",
39
- style: c({ background: o.currentValue })
35
+ style: t({ background: o.currentValue })
40
36
  },
41
37
  null,
42
38
  4
43
39
  /* STYLE */
44
40
  ),
45
- o.props.showValue ? (n(), i(
41
+ o.props.showValue ? (l(), i(
46
42
  "span",
47
- f,
48
- s(o.displayValue),
43
+ h,
44
+ d(o.displayValue),
49
45
  1
50
46
  /* TEXT */
51
- )) : d("v-if", !0)
47
+ )) : s("v-if", !0)
52
48
  ])
53
49
  ],
54
50
  2
55
51
  /* CLASS */
56
52
  );
57
53
  }
58
- const N = /* @__PURE__ */ m(t, [["render", u], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-color-picker/NmorphColorPicker.vue"]]);
54
+ const C = /* @__PURE__ */ m(a, [["render", u], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-color-picker/NmorphColorPicker.vue"]]);
59
55
  export {
60
- N as default
56
+ C as default
61
57
  };
@@ -1,9 +1,10 @@
1
1
  import './NmorphColorPicker.css';
2
- import { defineComponent as k, ref as g, watch as B, onMounted as H, computed as _ } from "vue";
3
- import { NmorphComponentHeight as L } from "../../../types/index.js";
4
- import { useModifiers as O } from "../../../utils/create-modifiers.js";
5
- import { useFormItemInput as z, useFormItemModel as A } from "../nmorph-form/use-form-item-input.js";
6
- const G = /* @__PURE__ */ k({
2
+ import { defineComponent as k, ref as H, watch as L, onMounted as O, computed as C } from "vue";
3
+ import { useModifiers as z } from "../../../utils/create-modifiers.js";
4
+ import { useFocusableInput as A } from "../../../hooks/use-focusable-input.js";
5
+ import { useFormItemInput as D, useFormItemModel as E } from "../nmorph-form/use-form-item-input.js";
6
+ import { NmorphComponentHeight as T } from "../../../types/common.types.js";
7
+ const W = /* @__PURE__ */ k({
7
8
  __name: "NmorphColorPicker",
8
9
  props: {
9
10
  modelValue: { type: String, required: !1, default: "" },
@@ -17,52 +18,60 @@ const G = /* @__PURE__ */ k({
17
18
  tabindex: { type: Number, required: !1 }
18
19
  },
19
20
  emits: ["update:model-value", "focus", "blur"],
20
- setup(q, { expose: S, emit: V }) {
21
- const n = q, b = V, { id: x, name: I, tabindex: F } = z(n), { modelValue: d, updateModelValue: y } = A(
21
+ setup(_, { expose: q, emit: F }) {
22
+ const n = _, d = F, { id: I, name: S, tabindex: V } = D(n), { modelValue: c, updateModelValue: g } = E(
22
23
  n,
23
- (e) => b("update:model-value", e),
24
+ (e) => d("update:model-value", e),
24
25
  ""
25
26
  ), l = (e, r = "#000000") => {
26
27
  const t = e?.trim() || "";
27
28
  return /^#[\da-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[\da-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((o) => `${o}${o}`).join("").toLowerCase()}` : r;
28
- }, p = g(null), m = () => {
29
+ }, {
30
+ elementRef: p,
31
+ focused: y,
32
+ handleFocus: x,
33
+ handleBlur: B
34
+ } = A({
35
+ onFocus: () => d("focus"),
36
+ onBlur: () => d("blur")
37
+ }), f = () => {
29
38
  if (typeof document > "u") return "#006cb6";
30
39
  const e = p.value || document.documentElement, r = getComputedStyle(e).getPropertyValue("--nmorph-accent-color").trim();
31
40
  return l(r, "#006cb6");
32
- }, a = g(l(d.value)), v = g(!1);
33
- B(d, (e) => {
34
- a.value = e ? l(e) : m();
41
+ }, a = H(l(c.value));
42
+ L(c, (e) => {
43
+ a.value = e ? l(e) : f();
35
44
  });
36
- const w = (e) => {
45
+ const R = (e) => {
37
46
  const r = e.target, t = l(r.value);
38
- a.value = t, y(t);
39
- }, f = (e) => [
47
+ a.value = t, g(t);
48
+ }, h = (e) => [
40
49
  parseInt(e.slice(1, 3), 16),
41
50
  parseInt(e.slice(3, 5), 16),
42
51
  parseInt(e.slice(5, 7), 16)
43
- ], $ = (e) => {
44
- const [r, t, o] = f(e);
52
+ ], v = (e) => {
53
+ const [r, t, o] = h(e);
45
54
  return `rgb(${r}, ${t}, ${o})`;
46
- }, M = (e) => {
47
- const [r, t, o] = f(e).map((j) => j / 255), s = Math.max(r, t, o), u = Math.min(r, t, o), h = (s + u) / 2;
48
- if (s === u)
49
- return `hsl(0, 0%, ${Math.round(h * 100)}%)`;
50
- const i = s - u, R = h > 0.5 ? i / (2 - s - u) : i / (s + u);
51
- let c = 0;
52
- return s === r ? c = (t - o) / i + (t < o ? 6 : 0) : s === t ? c = (o - r) / i + 2 : c = (r - t) / i + 4, `hsl(${Math.round(c * 60)}, ${Math.round(R * 100)}%, ${Math.round(h * 100)}%)`;
55
+ }, $ = (e) => {
56
+ const [r, t, o] = h(e).map((j) => j / 255), u = Math.max(r, t, o), s = Math.min(r, t, o), b = (u + s) / 2;
57
+ if (u === s)
58
+ return `hsl(0, 0%, ${Math.round(b * 100)}%)`;
59
+ const i = u - s, P = b > 0.5 ? i / (2 - u - s) : i / (u + s);
60
+ let m = 0;
61
+ return u === r ? m = (t - o) / i + (t < o ? 6 : 0) : u === t ? m = (o - r) / i + 2 : m = (r - t) / i + 4, `hsl(${Math.round(m * 60)}, ${Math.round(P * 100)}%, ${Math.round(b * 100)}%)`;
53
62
  };
54
- H(() => {
55
- d.value || (a.value = m());
56
- }), S({ inputDOMRef: p });
57
- const N = _(
58
- () => O({
59
- nmorph: [L[n.height], v.value && "focused"],
63
+ O(() => {
64
+ c.value || (a.value = f());
65
+ }), q({ inputDOMRef: p });
66
+ const w = C(
67
+ () => z({
68
+ nmorph: [T[n.height], y.value && "focused"],
60
69
  "nmorph-color-picker": [n.disabled && "disabled", n.displayFormat]
61
70
  })
62
- ), P = _(() => n.displayFormat === "rgb" ? $(a.value) : n.displayFormat === "hsl" ? M(a.value) : a.value.toUpperCase()), C = { props: n, emit: b, id: x, name: I, tabindex: F, modelValue: d, updateModelValue: y, normalizeColor: l, inputDOMRef: p, resolveAccentColor: m, currentValue: a, focused: v, handleInput: w, hexToRgb: f, formatRgb: $, formatHsl: M, modifiers: N, displayValue: P };
63
- return Object.defineProperty(C, "__isScriptSetup", { enumerable: !1, value: !0 }), C;
71
+ ), N = C(() => n.displayFormat === "rgb" ? v(a.value) : n.displayFormat === "hsl" ? $(a.value) : a.value.toUpperCase()), M = { props: n, emit: d, id: I, name: S, tabindex: V, modelValue: c, updateModelValue: g, normalizeColor: l, inputDOMRef: p, focused: y, handleFocus: x, handleBlur: B, resolveAccentColor: f, currentValue: a, handleInput: R, hexToRgb: h, formatRgb: v, formatHsl: $, modifiers: w, displayValue: N };
72
+ return Object.defineProperty(M, "__isScriptSetup", { enumerable: !1, value: !0 }), M;
64
73
  }
65
74
  });
66
75
  export {
67
- G as default
76
+ W as default
68
77
  };