@nmorph/nmorph-ui-kit 2.2.38 → 2.2.40

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 (235) hide show
  1. package/dist/components/basic/nmorph-button/NmorphButton.css +1 -1
  2. package/dist/components/basic/nmorph-button/NmorphButton.vue.js +13 -10
  3. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +4 -4
  4. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +12 -10
  5. package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +19 -16
  6. package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
  7. package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +30 -26
  8. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +42 -40
  9. package/dist/components/data/nmorph-card/NmorphCard.vue2.js +6 -6
  10. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +24 -21
  11. package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +23 -21
  12. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
  13. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +121 -73
  14. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +105 -78
  15. package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +18 -14
  16. package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +15 -11
  17. package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
  18. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +44 -40
  19. package/dist/components/data/nmorph-tag-list/NmorphTagList.vue.js +7 -7
  20. package/dist/components/data/nmorph-tag-list/NmorphTagList.vue2.js +22 -16
  21. package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.css +1 -1
  22. package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue2.js +9 -9
  23. package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +21 -19
  24. package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +27 -24
  25. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +19 -15
  26. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +10 -8
  27. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +25 -23
  28. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +8 -8
  29. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +4 -4
  30. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue.js +18 -22
  31. package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +42 -33
  32. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +32 -32
  33. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.css +1 -1
  34. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +77 -106
  35. package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.css +1 -1
  36. package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +4 -4
  37. package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +7 -7
  38. package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +6 -6
  39. package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
  40. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +51 -49
  41. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -18
  42. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -24
  43. package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +30 -30
  44. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +34 -32
  45. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +16 -16
  46. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
  47. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +12 -12
  48. package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +34 -32
  49. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +16 -16
  50. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +64 -57
  51. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +27 -22
  52. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +75 -46
  53. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +25 -23
  54. package/dist/hooks/use-field-validation.js +50 -66
  55. package/dist/hooks/use-focusable-input.js +27 -0
  56. package/dist/hooks/use-nmorph-translation.js +4 -4
  57. package/dist/hooks/use-placement.js +65 -61
  58. package/dist/index.es.js +842 -837
  59. package/dist/index.umd.js +36 -36
  60. package/dist/package.json.js +1 -1
  61. package/dist/plugin.js +47 -42
  62. package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +4 -17
  63. package/dist/src/components/basic/nmorph-button/types.d.ts +13 -0
  64. package/dist/src/components/basic/nmorph-icon/NmorphIcon.vue.d.ts +3 -9
  65. package/dist/src/components/basic/nmorph-icon/types.d.ts +6 -0
  66. package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +2 -9
  67. package/dist/src/components/basic/nmorph-layout/types.d.ts +8 -0
  68. package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +3 -14
  69. package/dist/src/components/basic/nmorph-link/types.d.ts +11 -0
  70. package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +2 -2
  71. package/dist/src/components/basic/nmorph-scroll/types.d.ts +5 -0
  72. package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +2 -15
  73. package/dist/src/components/basic/nmorph-space/types.d.ts +14 -0
  74. package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +5 -20
  75. package/dist/src/components/data/nmorph-avatar/types.d.ts +21 -0
  76. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +5 -40
  77. package/dist/src/components/data/nmorph-badge/types.d.ts +34 -0
  78. package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +4 -12
  79. package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.d.ts +3 -9
  80. package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/types.d.ts +12 -0
  81. package/dist/src/components/data/nmorph-calendar/types.d.ts +13 -0
  82. package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +2 -10
  83. package/dist/src/components/data/nmorph-card/types.d.ts +9 -0
  84. package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -5
  85. package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.d.ts +2 -4
  86. package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/types.d.ts +3 -0
  87. package/dist/src/components/data/nmorph-carousel/types.d.ts +6 -0
  88. package/dist/src/components/data/nmorph-collapse/NmorphCollapse.vue.d.ts +3 -7
  89. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +4 -10
  90. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/types.d.ts +13 -0
  91. package/dist/src/components/data/nmorph-collapse/types.d.ts +7 -0
  92. package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +3 -12
  93. package/dist/src/components/data/nmorph-empty/types.d.ts +11 -0
  94. package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -8
  95. package/dist/src/components/data/nmorph-image/types.d.ts +10 -0
  96. package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +9 -18
  97. package/dist/src/components/data/nmorph-image-preview/types.d.ts +23 -0
  98. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -13
  99. package/dist/src/components/data/nmorph-pagination/types.d.ts +14 -0
  100. package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +3 -15
  101. package/dist/src/components/data/nmorph-progress/types.d.ts +12 -0
  102. package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +5 -15
  103. package/dist/src/components/data/nmorph-qr-code/types.d.ts +12 -0
  104. package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -7
  105. package/dist/src/components/data/nmorph-skeleton/components/NmorphSkeletonItem.vue.d.ts +3 -9
  106. package/dist/src/components/data/nmorph-skeleton/components/types.d.ts +8 -0
  107. package/dist/src/components/data/nmorph-skeleton/types.d.ts +6 -0
  108. package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +4 -18
  109. package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.d.ts +2 -4
  110. package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/types.d.ts +3 -0
  111. package/dist/src/components/data/nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.d.ts +4 -5
  112. package/dist/src/components/data/nmorph-table/components/nmorph-table-column/types.d.ts +3 -0
  113. package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/NmorphSortButton.vue.d.ts +4 -6
  114. package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/types.d.ts +7 -0
  115. package/dist/src/components/data/nmorph-table/types.d.ts +15 -0
  116. package/dist/src/components/data/nmorph-tag-list/NmorphTagList.vue.d.ts +9 -9
  117. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +3 -5
  118. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/types.d.ts +6 -0
  119. package/dist/src/components/data/nmorph-tag-list/types.d.ts +8 -0
  120. package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +3 -14
  121. package/dist/src/components/data/nmorph-virtual-list/types.d.ts +15 -0
  122. package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +5 -7
  123. package/dist/src/components/feedback/nmorph-alert/types.d.ts +5 -0
  124. package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +4 -16
  125. package/dist/src/components/feedback/nmorph-callout/types.d.ts +12 -0
  126. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -19
  127. package/dist/src/components/feedback/nmorph-dialog/types.d.ts +20 -0
  128. package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +4 -17
  129. package/dist/src/components/feedback/nmorph-drawer/types.d.ts +18 -0
  130. package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +5 -14
  131. package/dist/src/components/feedback/nmorph-tooltip/types.d.ts +11 -0
  132. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +6 -19
  133. package/dist/src/components/form/nmorph-autocomplete/types.d.ts +18 -0
  134. package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -1
  135. package/dist/src/components/form/nmorph-checkbox/types.d.ts +3 -0
  136. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -10
  137. package/dist/src/components/form/nmorph-checkbox-group/types.d.ts +11 -0
  138. package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +6 -11
  139. package/dist/src/components/form/nmorph-color-picker/types.d.ts +11 -0
  140. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -20
  141. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-clear-button/types.d.ts +3 -0
  142. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +3 -8
  143. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/types.d.ts +10 -0
  144. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/NmorphDatePickerHeader.vue.d.ts +3 -6
  145. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/types.d.ts +12 -0
  146. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.d.ts +3 -6
  147. package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/types.d.ts +9 -0
  148. package/dist/src/components/form/nmorph-date-picker/types.d.ts +21 -0
  149. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +5 -13
  150. package/dist/src/components/form/nmorph-file-upload/types.d.ts +17 -0
  151. package/dist/src/components/form/nmorph-form/NmorphForm.vue.d.ts +4 -8
  152. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +3 -12
  153. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +3 -8
  154. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/types.d.ts +7 -0
  155. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/NmorphValidationIcon.vue.d.ts +3 -6
  156. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/types.d.ts +5 -0
  157. package/dist/src/components/form/nmorph-form/components/nmorph-form-item/types.d.ts +10 -0
  158. package/dist/src/components/form/nmorph-form/types.d.ts +6 -1
  159. package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +3 -10
  160. package/dist/src/components/form/nmorph-number-input/types.d.ts +11 -0
  161. package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +5 -13
  162. package/dist/src/components/form/nmorph-otp-input/types.d.ts +21 -0
  163. package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +4 -9
  164. package/dist/src/components/form/nmorph-radio/types.d.ts +6 -0
  165. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +3 -11
  166. package/dist/src/components/form/nmorph-radio-group/types.d.ts +12 -0
  167. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +3 -21
  168. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -1
  169. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/types.d.ts +3 -0
  170. package/dist/src/components/form/nmorph-select/types.d.ts +21 -0
  171. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +4 -12
  172. package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue.d.ts +3 -6
  173. package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/types.d.ts +4 -0
  174. package/dist/src/components/form/nmorph-select-button/types.d.ts +12 -0
  175. package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +111 -0
  176. package/dist/src/components/form/nmorph-slider/types.d.ts +3 -0
  177. package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +3 -14
  178. package/dist/src/components/form/nmorph-switch/types.d.ts +15 -0
  179. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +6 -14
  180. package/dist/src/components/form/nmorph-text-input/types.d.ts +16 -0
  181. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +6 -18
  182. package/dist/src/components/form/nmorph-textarea/types.d.ts +20 -0
  183. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +6 -20
  184. package/dist/src/components/form/nmorph-time-picker/types.d.ts +24 -0
  185. package/dist/src/components/navigation/index.d.ts +1 -1
  186. package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +4 -12
  187. package/dist/src/components/navigation/nmorph-backtop/types.d.ts +14 -0
  188. package/dist/src/components/navigation/nmorph-breadcrumb/NmorphBreadcrumb.vue.d.ts +2 -4
  189. package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/NmorphBreadcrumbItem.vue.d.ts +2 -4
  190. package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/types.d.ts +3 -0
  191. package/dist/src/components/navigation/nmorph-breadcrumb/types.d.ts +3 -0
  192. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +14 -33
  193. package/dist/src/components/navigation/nmorph-context-menu/types.d.ts +48 -0
  194. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +6 -24
  195. package/dist/src/components/navigation/nmorph-dropdown/types.d.ts +24 -0
  196. package/dist/src/components/navigation/nmorph-tabs/NmorphTabs.vue.d.ts +4 -8
  197. package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/NmorphTabPane.vue.d.ts +4 -5
  198. package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/types.d.ts +3 -0
  199. package/dist/src/components/navigation/nmorph-tabs/{type.d.ts → types.d.ts} +9 -0
  200. package/dist/src/components/navigation/nmorph-tabs/utils.d.ts +1 -1
  201. package/dist/src/components/others/nmorph-divider/NmorphDivider.vue.d.ts +2 -5
  202. package/dist/src/components/others/nmorph-divider/types.d.ts +3 -0
  203. package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +3 -12
  204. package/dist/src/components/others/nmorph-overlay/types.d.ts +14 -0
  205. package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +2 -8
  206. package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +9 -0
  207. package/dist/src/hooks/use-focusable-input.d.ts +16 -0
  208. package/dist/src/hooks/use-form-validation.d.ts +1 -2
  209. package/dist/src/plugin.d.ts +4 -1
  210. package/dist/src/types/app.types.d.ts +21 -0
  211. package/dist/src/types/common.types.d.ts +62 -0
  212. package/dist/src/types/date.types.d.ts +7 -0
  213. package/dist/src/types/image.types.d.ts +17 -0
  214. package/dist/src/types/index.d.ts +8 -206
  215. package/dist/src/types/selection.types.d.ts +26 -0
  216. package/dist/src/types/table.types.d.ts +5 -0
  217. package/dist/src/types/theme.types.d.ts +55 -0
  218. package/dist/src/types/translation.types.d.ts +20 -0
  219. package/dist/src/utils/common.d.ts +3 -0
  220. package/dist/src/utils/file-types.d.ts +8 -0
  221. package/dist/src/utils/index.d.ts +1 -0
  222. package/dist/style.css +1 -1
  223. package/dist/types/common.types.js +14 -0
  224. package/dist/types/date.types.js +4 -0
  225. package/dist/types/image.types.js +5 -0
  226. package/dist/types/selection.types.js +4 -0
  227. package/dist/types/table.types.js +4 -0
  228. package/dist/types/translation.types.js +4 -0
  229. package/dist/utils/common.js +16 -6
  230. package/dist/utils/file-types.js +41 -0
  231. package/package.json +1 -1
  232. package/dist/src/components/data/nmorph-calendar/hooks/index.d.ts +0 -2
  233. package/dist/src/hooks/index.d.ts +0 -9
  234. package/dist/src/outside-hooks/index.d.ts +0 -5
  235. package/dist/types/index.js +0 -20
@@ -1,153 +1,124 @@
1
1
  import './NmorphFileUpload.css';
2
- import { defineComponent as X, computed as C, inject as Y, ref as q, watch as Z, onBeforeUnmount as ee } from "vue";
3
- import { useModifiers as te } from "../../../utils/create-modifiers.js";
4
- import { useI18n as oe } from "vue-i18n";
5
- import { useFormItemInput as re, useFormItemModel as ne } from "../nmorph-form/use-form-item-input.js";
6
- import { resolution as B, NmorphImageResolution as V, NmorphAudioResolution as se, NmorphVideoResolution as ae, NmorphArchiveResolution as ie } from "./types.js";
7
- import le from "../../../assets/icons/doc.svg.js";
8
- import ue from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
9
- import de from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
- import pe from "../../basic/nmorph-button/NmorphButton.vue.js";
11
- import me from "../../../assets/icons/audio.svg.js";
12
- import ce from "../../../assets/icons/video.svg.js";
13
- import fe from "../../../assets/icons/archive.svg.js";
14
- import ve from "../../../assets/icons/cross.svg.js";
15
- import ye from "../../../assets/icons/image.svg.js";
16
- const Pe = /* @__PURE__ */ X({
2
+ import { defineComponent as K, computed as N, inject as z, ref as T, watch as G, onBeforeUnmount as H } from "vue";
3
+ import { useModifiers as J } from "../../../utils/create-modifiers.js";
4
+ import { getFileAcceptValue as Q, getFileTypeCandidates as U, isKnownFileType as p, isFileAllowedByTypes as X, getFileExtension as Y } from "../../../utils/file-types.js";
5
+ import { useI18n as Z } from "vue-i18n";
6
+ import { useFormItemInput as $, useFormItemModel as ee } from "../nmorph-form/use-form-item-input.js";
7
+ import te from "../../../assets/icons/doc.svg.js";
8
+ import oe from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
9
+ import re from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
+ import ae from "../../basic/nmorph-button/NmorphButton.vue.js";
11
+ import ie from "../../../assets/icons/audio.svg.js";
12
+ import ne from "../../../assets/icons/video.svg.js";
13
+ import se from "../../../assets/icons/archive.svg.js";
14
+ import { NmorphImageResolution as V, NmorphAudioResolution as le, NmorphVideoResolution as ue, NmorphArchiveResolution as de } from "./types.js";
15
+ import me from "../../../assets/icons/cross.svg.js";
16
+ import pe from "../../../assets/icons/image.svg.js";
17
+ const Ue = /* @__PURE__ */ K({
17
18
  __name: "NmorphFileUpload",
18
19
  props: {
20
+ id: { type: String, required: !1 },
21
+ name: { type: String, required: !1 },
22
+ autocomplete: { type: String, required: !1 },
23
+ tabindex: { type: Number, required: !1 },
19
24
  modelValue: { type: Array, required: !1, default: () => [] },
20
25
  disabled: { type: Boolean, required: !1, default: !1 },
21
26
  multiple: { type: Boolean, required: !1, default: !1 },
22
27
  allowedTypes: { type: Array, required: !1, default: () => [] },
23
28
  photoWithPreview: { type: Boolean, required: !1, default: !0 },
24
- buttonText: { type: String, required: !1, default: "" },
25
- id: { type: String, required: !1 },
26
- name: { type: String, required: !1 },
27
- autocomplete: { type: String, required: !1 },
28
- tabindex: { type: Number, required: !1 }
29
+ buttonText: { type: String, required: !1, default: "" }
29
30
  },
30
31
  emits: ["update:model-value", "on-unsupported-file-type-error", "on-file-validation-error"],
31
- setup(M, { expose: j, emit: O }) {
32
- const { t: N } = oe(), r = M, c = O, k = C(() => r.buttonText ? r.buttonText : N("selectFile")), { id: f, name: E, autocomplete: W, tabindex: D } = re(r), { modelValue: F, updateModelValue: L } = ne(
32
+ setup(_, { expose: q, emit: C }) {
33
+ const { t: b } = Z(), r = _, c = C, P = N(() => r.buttonText ? r.buttonText : b("selectFile")), { id: f, name: S, autocomplete: B, tabindex: L } = $(r), { modelValue: g, updateModelValue: x } = ee(
33
34
  r,
34
35
  (e) => c("update:model-value", e),
35
36
  []
36
- ), v = Y("form-data", void 0), R = Object.entries(B), T = {
37
- "svg-xml": "svg",
38
- "audio-ogg": "ogg",
39
- "wideo-ogg": "ogg"
40
- }, A = (e) => e.split("/")[1]?.toLowerCase() || "", I = (e) => {
41
- const t = e.split(".").pop()?.toLowerCase();
42
- return t && t !== e.toLowerCase() ? t : "";
43
- }, S = (e) => R.find(([, t]) => t.toLowerCase() === e.toLowerCase())?.[0] || "", y = (e) => Array.from(
44
- new Set(
45
- [
46
- e.type.toLowerCase(),
47
- S(e.type),
48
- I(e.name),
49
- A(e.type)
50
- ].filter(Boolean).map((t) => t.toLowerCase())
51
- )
52
- ), i = (e, t) => Object.prototype.hasOwnProperty.call(t, e), K = (e) => {
53
- const t = y(e);
54
- return e.type.toLowerCase().startsWith("image/") || t.some((o) => i(o, V));
55
- }, P = (e) => {
56
- if (r.allowedTypes.length === 0) return !0;
57
- const t = y(e);
58
- return r.allowedTypes.some((o) => t.includes(String(o).toLowerCase()));
59
- }, $ = C(() => {
60
- if (r.allowedTypes.length !== 0)
61
- return Array.from(
62
- new Set(
63
- r.allowedTypes.flatMap((e) => {
64
- const t = String(e).toLowerCase(), o = B[t], n = T[t] || t;
65
- return t.includes("/") ? t : o ? [`.${n}`, o] : `.${n}`;
66
- })
67
- )
68
- ).join(",");
69
- }), z = (e) => {
70
- const t = y(e);
71
- let o = le;
72
- return (e.type.toLowerCase().startsWith("image/") || t.some((n) => i(n, V))) && (o = ye), (e.type.toLowerCase().startsWith("audio/") || t.some((n) => i(n, se))) && (o = me), (e.type.toLowerCase().startsWith("video/") || t.some((n) => i(n, ae))) && (o = ce), t.some((n) => i(n, ie)) && (o = fe), o;
73
- }, u = q(null), a = q([...F.value]), l = /* @__PURE__ */ new Set(), h = () => {
74
- const e = u.value;
37
+ ), v = z("form-data", void 0), M = (e) => {
38
+ const t = U(e);
39
+ return e.type.toLowerCase().startsWith("image/") || t.some((o) => p(o, V));
40
+ }, W = N(() => Q(r.allowedTypes)), j = (e) => {
41
+ const t = U(e);
42
+ let o = te;
43
+ return (e.type.toLowerCase().startsWith("image/") || t.some((i) => p(i, V))) && (o = pe), (e.type.toLowerCase().startsWith("audio/") || t.some((i) => p(i, le))) && (o = ie), (e.type.toLowerCase().startsWith("video/") || t.some((i) => p(i, ue))) && (o = ne), t.some((i) => p(i, de)) && (o = se), o;
44
+ }, l = T(null), n = T([...g.value]), s = /* @__PURE__ */ new Set(), h = () => {
45
+ const e = l.value;
75
46
  e && (e.value = "");
76
- }, g = (e) => {
77
- l.has(e) && (URL.revokeObjectURL(e), l.delete(e));
78
- }, x = (e) => {
47
+ }, y = (e) => {
48
+ s.has(e) && (URL.revokeObjectURL(e), s.delete(e));
49
+ }, I = (e) => {
79
50
  const t = new Set(e.map((o) => o.previewUrl));
80
- Array.from(l).forEach((o) => {
81
- t.has(o) || g(o);
51
+ Array.from(s).forEach((o) => {
52
+ t.has(o) || y(o);
82
53
  });
83
- }, b = (e) => {
54
+ }, w = (e) => {
84
55
  const t = [...e];
85
- a.value = t, L(t);
86
- }, U = (e) => {
56
+ n.value = t, x(t);
57
+ }, R = (e) => {
87
58
  const t = v?.validateField(f.value, e);
88
59
  return {
89
60
  valid: t?.valid.value ?? !0,
90
61
  errors: t?.errors.value ?? []
91
62
  };
92
- }, G = () => {
93
- r.disabled || !u.value || u.value.click();
94
- }, H = (e) => {
63
+ }, k = () => {
64
+ r.disabled || !l.value || l.value.click();
65
+ }, E = (e) => {
95
66
  if (r.disabled) return;
96
- const t = e.target, o = Array.from(t.files || []), n = r.multiple ? o : o.slice(0, 1), d = [];
97
- if (n.forEach((s) => {
98
- if (!P(s)) {
99
- c("on-unsupported-file-type-error", s.type || I(s.name) || s.name);
67
+ const t = e.target, o = Array.from(t.files || []), i = r.multiple ? o : o.slice(0, 1), u = [];
68
+ if (i.forEach((a) => {
69
+ if (!X(a, r.allowedTypes)) {
70
+ c("on-unsupported-file-type-error", a.type || Y(a.name) || a.name);
100
71
  return;
101
72
  }
102
- const p = r.multiple ? [...a.value.map((w) => w.data), ...d, s] : [s], m = U(p);
73
+ const d = r.multiple ? [...n.value.map((F) => F.data), ...u, a] : [a], m = R(d);
103
74
  if (!m.valid) {
104
- c("on-file-validation-error", { file: s, errors: m.errors });
75
+ c("on-file-validation-error", { file: a, errors: m.errors });
105
76
  return;
106
77
  }
107
- d.push(s);
108
- }), h(), d.length > 0) {
109
- const s = d.map((m) => {
110
- const w = URL.createObjectURL(m);
111
- return l.add(w), { data: m, previewUrl: w };
112
- }), p = r.multiple ? [...a.value, ...s] : s;
113
- x(p), b(p), v?.validateField(f.value, p);
78
+ u.push(a);
79
+ }), h(), u.length > 0) {
80
+ const a = u.map((m) => {
81
+ const F = URL.createObjectURL(m);
82
+ return s.add(F), { data: m, previewUrl: F };
83
+ }), d = r.multiple ? [...n.value, ...a] : a;
84
+ I(d), w(d), v?.validateField(f.value, d);
114
85
  }
115
- }, J = (e) => {
86
+ }, O = (e) => {
116
87
  if (r.disabled) return;
117
- const t = a.value.findIndex((o) => o.data.name === e);
88
+ const t = n.value.findIndex((o) => o.data.name === e);
118
89
  if (t !== -1) {
119
- const o = a.value[t];
120
- g(o.previewUrl), h();
121
- const n = a.value.filter((d, s) => s !== t);
122
- b(n), v?.validateField(f.value, n);
90
+ const o = n.value[t];
91
+ y(o.previewUrl), h();
92
+ const i = n.value.filter((u, a) => a !== t);
93
+ w(i), v?.validateField(f.value, i);
123
94
  }
124
95
  };
125
- Z(
126
- F,
96
+ G(
97
+ g,
127
98
  (e) => {
128
99
  const t = [...e];
129
- x(t), a.value = t, t.length === 0 && h();
100
+ I(t), n.value = t, t.length === 0 && h();
130
101
  },
131
102
  { deep: !0 }
132
- ), ee(() => {
133
- Array.from(l).forEach((e) => g(e));
134
- }), j({ inputDOMRef: u });
135
- const Q = C(
136
- () => te({
103
+ ), H(() => {
104
+ Array.from(s).forEach((e) => y(e));
105
+ }), q({ inputDOMRef: l });
106
+ const D = N(
107
+ () => J({
137
108
  "nmorph-file-upload": [r.disabled && "disabled"]
138
109
  })
139
- ), _ = { t: N, props: r, emit: c, computedButtonText: k, id: f, name: E, autocomplete: W, tabindex: D, modelValue: F, updateModelValue: L, formData: v, knownResolutionEntries: R, extensionByResolution: T, getPlainType: A, getFileExtension: I, getKnownResolutionByMime: S, getFileTypeCandidates: y, isKnownFileType: i, isImageFile: K, isFileAllowed: P, inputAccept: $, typeFileIconMap: z, inputDOMRef: u, files: a, createdPreviewUrls: l, resetInputValue: h, revokePreviewUrl: g, revokeRemovedPreviewUrls: x, filesChanged: b, getFormValidationResult: U, openFileSelector: G, handleFileUpload: H, removeFile: J, modifiers: Q, get NmorphButton() {
140
- return pe;
110
+ ), A = { t: b, props: r, emit: c, computedButtonText: P, id: f, name: S, autocomplete: B, tabindex: L, modelValue: g, updateModelValue: x, formData: v, isImageFile: M, inputAccept: W, typeFileIconMap: j, inputDOMRef: l, files: n, createdPreviewUrls: s, resetInputValue: h, revokePreviewUrl: y, revokeRemovedPreviewUrls: I, filesChanged: w, getFormValidationResult: R, openFileSelector: k, handleFileUpload: E, removeFile: O, modifiers: D, get NmorphButton() {
111
+ return ae;
141
112
  }, get NmorphIcon() {
142
- return de;
113
+ return re;
143
114
  }, get NmorphImagePreview() {
144
- return ue;
115
+ return oe;
145
116
  }, get NmorphIconCross() {
146
- return ve;
117
+ return me;
147
118
  } };
148
- return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
119
+ return Object.defineProperty(A, "__isScriptSetup", { enumerable: !1, value: !0 }), A;
149
120
  }
150
121
  });
151
122
  export {
152
- Pe as default
123
+ Ue as default
153
124
  };
@@ -1 +1 @@
1
- .nmorph-form-item{margin:var(--indentation-04) var(--indentation-00)}.nmorph-form-item label{font-weight:600;font-size:var(--font-size-small);line-height:var(--line-height-loose)}.nmorph-form-item .nmorph-form-item__content{position:relative;display:flex;align-items:center;width:100%}.nmorph-form-item.nmorph-form-item--labeled .nmorph-form-item__content{margin-top:var(--indentation-02)}.nmorph-form-item.nmorph-form-item--valid .nmorph-native-input:focus{background:var(--nmorph-success-color)}.nmorph-form-item.nmorph-form-item--invalid .nmorph-native-input:focus{background:var(--nmorph-error-text-color)}
1
+ .nmorph-form-item{min-width:0;max-width:100%;margin:var(--indentation-04) var(--indentation-00)}.nmorph-form-item label{font-weight:600;font-size:var(--font-size-small);line-height:var(--line-height-loose)}.nmorph-form-item .nmorph-form-item__content{position:relative;display:flex;align-items:center;width:100%;min-width:0;max-width:100%}.nmorph-form-item.nmorph-form-item--labeled .nmorph-form-item__content{margin-top:var(--indentation-02)}.nmorph-form-item.nmorph-form-item--valid .nmorph-native-input:focus{background:var(--nmorph-success-color)}.nmorph-form-item.nmorph-form-item--invalid .nmorph-native-input:focus{background:var(--nmorph-error-text-color)}
@@ -1,7 +1,7 @@
1
1
  import './NmorphErrorBox.css';
2
2
  import { defineComponent as p, computed as s } from "vue";
3
- import { NmorphComponentHeight as u } from "../../../../../../../types/index.js";
4
- import { useModifiers as l } from "../../../../../../../utils/create-modifiers.js";
3
+ import { useModifiers as u } from "../../../../../../../utils/create-modifiers.js";
4
+ import { NmorphComponentHeight as l } from "../../../../../../../types/common.types.js";
5
5
  const h = /* @__PURE__ */ p({
6
6
  __name: "NmorphErrorBox",
7
7
  props: {
@@ -15,8 +15,8 @@ const h = /* @__PURE__ */ p({
15
15
  const r = Array.isArray(e.errors) ? e.errors : e.errors.value;
16
16
  return r.length ? [r[r.length - 1]] : [];
17
17
  }), a = s(
18
- () => l({
19
- nmorph: [u[e.height]],
18
+ () => u({
19
+ nmorph: [l[e.height]],
20
20
  "nmorph-error-box": [e.staticHeight && "static-height", t.value.length === 0 && "empty"]
21
21
  })
22
22
  ), o = { props: e, currentError: t, modifiers: a };
@@ -1,8 +1,8 @@
1
1
  import './NmorphNumberInput.css';
2
2
  import { defineComponent as H, computed as n, ref as s, watch as p } from "vue";
3
- import { NmorphComponentHeight as R } from "../../../types/index.js";
4
- import { useModifiers as T } from "../../../utils/create-modifiers.js";
5
- import { useFormItemInput as D, useFormItemModel as V } from "../nmorph-form/use-form-item-input.js";
3
+ import { useModifiers as R } from "../../../utils/create-modifiers.js";
4
+ import { useFormItemInput as T, useFormItemModel as D } from "../nmorph-form/use-form-item-input.js";
5
+ import { NmorphComponentHeight as V } from "../../../types/common.types.js";
6
6
  import k from "../../../assets/icons/plus-thin.svg.js";
7
7
  import z from "../../../assets/icons/minus-thin.svg.js";
8
8
  import C from "../../basic/nmorph-icon/NmorphIcon.vue.js";
@@ -24,9 +24,9 @@ const L = /* @__PURE__ */ H({
24
24
  },
25
25
  emits: ["update:model-value"],
26
26
  setup(d, { expose: c, emit: f }) {
27
- const e = d, { id: h, name: g, autocomplete: b, tabindex: x } = D(e), N = n(
28
- () => T({
29
- nmorph: [R[e.height]],
27
+ const e = d, { id: h, name: g, autocomplete: b, tabindex: x } = T(e), N = n(
28
+ () => R({
29
+ nmorph: [V[e.height]],
30
30
  "nmorph-number-input": [e.disabled && "disabled", e.actionBtnPositionRight && "action-btn-position-right"]
31
31
  })
32
32
  ), a = {
@@ -45,7 +45,7 @@ const L = /* @__PURE__ */ H({
45
45
  }, v = n(() => {
46
46
  const i = e.actionBtnPositionRight ? "right" : "default";
47
47
  return a[e.height][i];
48
- }), u = f, { modelValue: o, updateModelValue: l } = V(
48
+ }), u = f, { modelValue: o, updateModelValue: l } = D(
49
49
  e,
50
50
  (i) => u("update:model-value", i),
51
51
  0
@@ -1,9 +1,9 @@
1
1
  import './NmorphOTPInput.css';
2
2
  import { defineComponent as le, ref as M, computed as c, watch as O, nextTick as R } from "vue";
3
3
  import { useModifiers as ue } from "../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as oe } from "../../../types/index.js";
5
- import { useFormItemInput as re, useFormItemModel as ne } from "../nmorph-form/use-form-item-input.js";
6
- import se from "../nmorph-text-input/NmorphTextInput.vue.js";
4
+ import { useFormItemInput as oe, useFormItemModel as re } from "../nmorph-form/use-form-item-input.js";
5
+ import ne from "../nmorph-text-input/NmorphTextInput.vue.js";
6
+ import { NmorphComponentHeight as se } from "../../../types/common.types.js";
7
7
  const pe = /* @__PURE__ */ le({
8
8
  __name: "NmorphOTPInput",
9
9
  props: {
@@ -21,7 +21,7 @@ const pe = /* @__PURE__ */ le({
21
21
  },
22
22
  emits: ["update:model-value", "focus", "blur", "complete"],
23
23
  setup(j, { expose: w, emit: N }) {
24
- const l = j, f = N, { id: V, name: T, autocomplete: A, tabindex: p } = re(l), { modelValue: v, updateModelValue: F } = ne(
24
+ const l = j, f = N, { id: V, name: T, autocomplete: A, tabindex: p } = oe(l), { modelValue: v, updateModelValue: F } = re(
25
25
  l,
26
26
  (e) => f("update:model-value", e),
27
27
  ""
@@ -46,7 +46,7 @@ const pe = /* @__PURE__ */ le({
46
46
  );
47
47
  const E = c(
48
48
  () => ue({
49
- nmorph: [oe[l.height], d.value && "focused"],
49
+ nmorph: [se[l.height], d.value && "focused"],
50
50
  "nmorph-otp-input": [l.disabled && "disabled"]
51
51
  })
52
52
  ), B = c(
@@ -142,7 +142,7 @@ const pe = /* @__PURE__ */ le({
142
142
  },
143
143
  { immediate: !0 }
144
144
  );
145
- const I = { props: l, emit: f, id: V, name: T, autocomplete: A, tabindex: p, modelValue: v, updateModelValue: F, inputRefs: i, inputDOMRefs: n, focused: d, otpValue: o, normalizedLength: u, sanitizeValue: g, normalizeOtpValue: S, syncOtpValue: h, modifiers: E, fieldIds: B, inputMode: C, resolvedAutocomplete: P, inputPattern: $, syncInputDOMRef: y, setInputRef: x, selectField: _, focusField: r, blurFields: k, updateCharAt: m, insertValue: H, inputHandler: z, fieldModels: q, getFieldModel: L, backspaceHandler: D, deleteKeyHandler: Z, arrowLeftHandler: K, arrowRightHandler: G, homeHandler: J, endHandler: Q, keydownHandler: U, pasteHandler: W, focusHandler: X, blurHandler: Y, getFieldTabindex: ee, NmorphTextInput: se };
145
+ const I = { props: l, emit: f, id: V, name: T, autocomplete: A, tabindex: p, modelValue: v, updateModelValue: F, inputRefs: i, inputDOMRefs: n, focused: d, otpValue: o, normalizedLength: u, sanitizeValue: g, normalizeOtpValue: S, syncOtpValue: h, modifiers: E, fieldIds: B, inputMode: C, resolvedAutocomplete: P, inputPattern: $, syncInputDOMRef: y, setInputRef: x, selectField: _, focusField: r, blurFields: k, updateCharAt: m, insertValue: H, inputHandler: z, fieldModels: q, getFieldModel: L, backspaceHandler: D, deleteKeyHandler: Z, arrowLeftHandler: K, arrowRightHandler: G, homeHandler: J, endHandler: Q, keydownHandler: U, pasteHandler: W, focusHandler: X, blurHandler: Y, getFieldTabindex: ee, NmorphTextInput: ne };
146
146
  return Object.defineProperty(I, "__isScriptSetup", { enumerable: !1, value: !0 }), I;
147
147
  }
148
148
  });
@@ -1,7 +1,7 @@
1
1
  import './NmorphRadio.css';
2
2
  import { defineComponent as h, inject as r, computed as l, ref as m } from "vue";
3
3
  import { useModifiers as g } from "../../../utils/create-modifiers.js";
4
- import { NmorphSelectionControlHeight as v } from "../../../types/index.js";
4
+ import { NmorphSelectionControlHeight as v } from "../../../types/common.types.js";
5
5
  const q = /* @__PURE__ */ h({
6
6
  __name: "NmorphRadio",
7
7
  props: {
@@ -1,18 +1,18 @@
1
1
  import './NmorphSelect.css';
2
- import { defineComponent as oe, computed as a, ref as d, watch as c, nextTick as R, onMounted as ie, onUnmounted as se, provide as w, toRef as de } from "vue";
3
- import { NmorphComponentHeight as ve } from "../../../types/index.js";
4
- import { useModifiers as ce } from "../../../utils/create-modifiers.js";
5
- import { toCssSize as C, getNmorphOptionHeight as fe, resolveDomElement as pe } from "../../../utils/common.js";
6
- import { useI18n as me } from "vue-i18n";
7
- import { useFormItemModel as he, useFormItemInput as ge } from "../nmorph-form/use-form-item-input.js";
8
- import { useVirtualList as ye } from "../../../hooks/use-virtual-list.js";
9
- import He from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
10
- import be from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
11
- import qe from "../../basic/nmorph-icon/NmorphIcon.vue.js";
12
- import Ie from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
13
- import xe from "../../../assets/icons/chevron-down.svg.js";
14
- import Ne from "../../../assets/icons/loader.svg.js";
15
- const je = /* @__PURE__ */ oe({
2
+ import { defineComponent as ue, computed as a, ref as d, watch as c, nextTick as R, onMounted as oe, onUnmounted as ie, provide as w, toRef as se } from "vue";
3
+ import { useModifiers as de } from "../../../utils/create-modifiers.js";
4
+ import { createCssSizeVariables as ve, getNmorphOptionHeight as ce, toCssSize as fe, resolveDomElement as pe } from "../../../utils/common.js";
5
+ import { useVirtualList as me } from "../../../hooks/use-virtual-list.js";
6
+ import { useI18n as he } from "vue-i18n";
7
+ import { useFormItemModel as ge, useFormItemInput as ye } from "../nmorph-form/use-form-item-input.js";
8
+ import { NmorphComponentHeight as He } from "../../../types/common.types.js";
9
+ import be from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
10
+ import qe from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
11
+ import Ie from "../../basic/nmorph-icon/NmorphIcon.vue.js";
12
+ import xe from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
13
+ import Ne from "../../../assets/icons/chevron-down.svg.js";
14
+ import Se from "../../../assets/icons/loader.svg.js";
15
+ const Ge = /* @__PURE__ */ ue({
16
16
  __name: "NmorphSelect",
17
17
  props: {
18
18
  noElementPlaceholder: { type: String, required: !1, default: "" },
@@ -39,30 +39,30 @@ const je = /* @__PURE__ */ oe({
39
39
  tabindex: { type: Number, required: !1 }
40
40
  },
41
41
  emits: ["update:model-value"],
42
- setup(P, { expose: T, emit: W }) {
43
- T();
44
- const { t: M } = me(), l = P, D = a(
42
+ setup(C, { expose: P, emit: T }) {
43
+ P();
44
+ const { t: M } = he(), l = C, D = a(
45
45
  () => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
46
- ), A = W, { modelValue: p, updateModelValue: h } = he(
46
+ ), A = T, { modelValue: p, updateModelValue: h } = ge(
47
47
  l,
48
48
  (e) => A("update:model-value", e),
49
49
  ""
50
- ), t = d(p.value), r = d(l.open), v = a(() => l.disabled || l.loading), g = a(() => l.optionsWidth === "auto"), y = d(!0), { id: H, name: k, autocomplete: $, tabindex: F } = ge(l), b = (e) => {
50
+ ), t = d(p.value), r = d(l.open), v = a(() => l.disabled || l.loading), g = a(() => l.optionsWidth === "auto"), y = d(!0), { id: H, name: W, autocomplete: k, tabindex: $ } = ye(l), b = (e) => {
51
51
  if (!v.value) {
52
52
  if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, h(t.value)), Array.isArray(t.value)) {
53
- const n = t.value.includes(e), ne = t.value.length === 1 && n;
54
- if (l.valueRequired && ne) return;
55
- n ? t.value = t.value.filter((ue) => ue !== e) : t.value = [...t.value, e];
53
+ const n = t.value.includes(e), re = t.value.length === 1 && n;
54
+ if (l.valueRequired && re) return;
55
+ n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
56
56
  }
57
57
  h(t.value);
58
58
  }
59
- }, m = d(!1), U = () => {
59
+ }, m = d(!1), z = () => {
60
60
  m.value = !0;
61
- }, z = () => {
61
+ }, F = () => {
62
62
  m.value = !1;
63
- }, j = a(
64
- () => ce({
65
- nmorph: [ve[l.height]],
63
+ }, U = a(
64
+ () => de({
65
+ nmorph: [He[l.height]],
66
66
  "nmorph-select": [
67
67
  l.disabled && "disabled",
68
68
  p.value ? "on" : "off",
@@ -74,9 +74,11 @@ const je = /* @__PURE__ */ oe({
74
74
  m.value && "focus"
75
75
  ]
76
76
  })
77
- ), G = a(() => ({
78
- ...l.width !== void 0 && { "--base-width": C(l.width) }
79
- })), J = () => {
77
+ ), j = a(
78
+ () => ve({
79
+ "--base-width": l.width
80
+ })
81
+ ), G = () => {
80
82
  v.value || (r.value = !r.value);
81
83
  };
82
84
  c(
@@ -101,16 +103,16 @@ const je = /* @__PURE__ */ oe({
101
103
  },
102
104
  { deep: !0 }
103
105
  );
104
- const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), I = d(null), x = d([]), N = a(() => l.options), f = a(() => l.virtual && N.value.length > 0), E = a(() => l.virtualItemHeight || fe(l.height)), V = a(() => l.virtualOverscan), _ = a(() => l.virtualDynamicHeight), s = ye(N, {
106
+ const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), I = d(null), x = d([]), N = a(() => l.options), f = a(() => l.virtual && N.value.length > 0), E = a(() => l.virtualItemHeight || ce(l.height)), V = a(() => l.virtualOverscan), _ = a(() => l.virtualDynamicHeight), s = me(N, {
105
107
  enabled: f,
106
108
  itemHeight: E,
107
109
  overscan: V,
108
110
  dynamic: _
109
- }), K = a(() => s.virtualItems.value), Q = s.spacerStyle, X = s.contentStyle, Y = a(() => C(l.virtualMaxHeight)), O = () => {
111
+ }), J = a(() => s.virtualItems.value), K = s.spacerStyle, Q = s.contentStyle, X = a(() => fe(l.virtualMaxHeight)), S = () => {
110
112
  i.value.length > 0 || !I.value || (x.value = Array.from(I.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
111
113
  }, o = a(
112
114
  () => i.value.length > 0 ? i.value.map((e) => e.value) : x.value
113
- ), Z = a(() => f.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${H.value}-listbox`), te = (e) => `${H.value}-option-${e.replace(/\s+/g, "-")}`;
115
+ ), Y = a(() => f.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), O = a(() => o.value[u.value] || ""), Z = a(() => `${H.value}-listbox`), ee = (e) => `${H.value}-option-${e.replace(/\s+/g, "-")}`;
114
116
  c(u, (e) => {
115
117
  r.value && f.value && s.scrollToIndex(e);
116
118
  }), c(
@@ -121,29 +123,29 @@ const je = /* @__PURE__ */ oe({
121
123
  { immediate: !0 }
122
124
  ), c(r, async (e) => {
123
125
  if (e) {
124
- if (await R(), O(), typeof t.value == "string") {
126
+ if (await R(), S(), typeof t.value == "string") {
125
127
  const n = o.value.indexOf(t.value);
126
128
  n !== -1 && (u.value = n);
127
129
  }
128
130
  s.refresh(), f.value && s.scrollToIndex(u.value);
129
131
  }
130
- }), ie(async () => {
131
- await R(), O(), document.addEventListener("click", q);
132
- }), se(() => {
132
+ }), oe(async () => {
133
+ await R(), S(), document.addEventListener("click", q);
134
+ }), ie(() => {
133
135
  document.removeEventListener("click", q);
134
136
  });
135
- const le = a(() => typeof t.value == "string" ? t.value === "" ? D.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), ae = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
136
- w("select-selected-value", t), w("select-change-selected-value", b), w("select-height", de(l, "height"));
137
- const B = d(null), re = a(
137
+ const te = a(() => typeof t.value == "string" ? t.value === "" ? D.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), le = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
138
+ w("select-selected-value", t), w("select-change-selected-value", b), w("select-height", se(l, "height"));
139
+ const B = d(null), ae = a(
138
140
  () => g.value ? `${B.value?.clientWidth || 0}px` : void 0
139
- ), L = { t: M, props: l, computedNoElementPlaceholder: D, emit: A, modelValue: p, updateModelValue: h, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: g, selectedLineOutset: y, id: H, name: k, autocomplete: $, tabindex: F, changeHandler: b, focus: m, focusHandler: U, blurHandler: z, modifiers: j, styles: G, clickHandler: J, closeHandler: q, optionsMap: i, optionsDOMRef: I, slotDomOptions: x, renderedOptions: N, virtualEnabled: f, virtualItemHeight: E, virtualOverscan: V, virtualDynamicHeight: _, virtualList: s, virtualOptions: K, virtualSpacerStyle: Q, virtualContentStyle: X, virtualMaxHeight: Y, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: B, optionsMinWidth: re, spaceHandler: () => {
141
+ ), L = { t: M, props: l, computedNoElementPlaceholder: D, emit: A, modelValue: p, updateModelValue: h, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: g, selectedLineOutset: y, id: H, name: W, autocomplete: k, tabindex: $, changeHandler: b, focus: m, focusHandler: z, blurHandler: F, modifiers: U, styles: j, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: I, slotDomOptions: x, renderedOptions: N, virtualEnabled: f, virtualItemHeight: E, virtualOverscan: V, virtualDynamicHeight: _, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: S, domOptions: o, nativeOptions: Y, currentIndex: u, currentFocusedEl: O, listboxId: Z, getOptionId: ee, selectedValueTitle: te, tags: le, nmorphSelectDOMRef: B, optionsMinWidth: ae, spaceHandler: () => {
140
142
  v.value || (r.value = !r.value);
141
143
  }, arrowDownHandler: () => {
142
144
  v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
143
145
  }, arrowUpHandler: () => {
144
146
  v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
145
147
  }, enterHandler: () => {
146
- r.value && S.value && b(S.value);
148
+ r.value && O.value && b(O.value);
147
149
  }, setVirtualOptionRef: (e, n) => {
148
150
  s.measureElement(n, pe(e));
149
151
  }, escapeHandler: () => {
@@ -153,21 +155,21 @@ const je = /* @__PURE__ */ oe({
153
155
  }, endHandler: () => {
154
156
  u.value = Math.max(o.value.length - 1, 0);
155
157
  }, get NmorphTagItem() {
156
- return Ie;
158
+ return xe;
157
159
  }, get NmorphIcon() {
158
- return qe;
160
+ return Ie;
159
161
  }, get NmorphSelectOption() {
160
- return be;
162
+ return qe;
161
163
  }, get NmorphDropdown() {
162
- return He;
164
+ return be;
163
165
  }, get NmorphIconLoaderDots() {
164
- return Ne;
166
+ return Se;
165
167
  }, get NmorphIconChevronDown() {
166
- return xe;
168
+ return Ne;
167
169
  } };
168
170
  return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
169
171
  }
170
172
  });
171
173
  export {
172
- je as default
174
+ Ge as default
173
175
  };
@@ -1,10 +1,11 @@
1
1
  import './NmorphSelectOption.css';
2
2
  import { defineComponent as g, inject as l, computed as t } from "vue";
3
- import { NmorphComponentHeight as y } from "../../../../../types/index.js";
4
- import { useModifiers as S } from "../../../../../utils/create-modifiers.js";
5
- import b from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
- import q from "../../../../../assets/icons/success.svg.js";
7
- const I = /* @__PURE__ */ g({
3
+ import { useModifiers as y } from "../../../../../utils/create-modifiers.js";
4
+ import { createCssVariables as b } from "../../../../../utils/common.js";
5
+ import { NmorphComponentHeight as S } from "../../../../../types/common.types.js";
6
+ import q from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
7
+ import _ from "../../../../../assets/icons/success.svg.js";
8
+ const H = /* @__PURE__ */ g({
8
9
  __name: "NmorphSelectOption",
9
10
  props: {
10
11
  value: { type: String, required: !0 },
@@ -25,29 +26,31 @@ const I = /* @__PURE__ */ g({
25
26
  const r = l("select-selected-value"), o = l("select-change-selected-value"), a = l(
26
27
  "select-height",
27
28
  void 0
28
- ), e = c, i = p, f = () => {
29
- e.disabled || (i("change-value", e.value), o && o(e.value));
30
- }, u = t(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((v) => v === e.value) : !1), s = t(() => e.height || a?.value || "basic"), h = t(
31
- () => S({
32
- nmorph: [y[s.value]],
29
+ ), e = c, s = p, f = () => {
30
+ e.disabled || (s("change-value", e.value), o && o(e.value));
31
+ }, i = t(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((v) => v === e.value) : !1), u = t(() => e.height || a?.value || "basic"), m = t(
32
+ () => y({
33
+ nmorph: [S[u.value]],
33
34
  "nmorph-select-option": [
34
35
  e.disabled && "disabled",
35
36
  e.label && "with-label",
36
- u.value && "checked",
37
+ i.value && "checked",
37
38
  e.focused && "focused"
38
39
  ]
39
40
  })
40
- ), m = t(() => ({
41
- ...e.hoverBackground !== void 0 && { "--hover-bg": e.hoverBackground },
42
- ...e.hoverColor !== void 0 && { "--hover-color": e.hoverColor }
43
- })), n = { selectSelectedValue: r, selectChangeSelectedValue: o, selectHeight: a, props: e, emit: i, clickHandler: f, checked: u, height: s, modifiers: h, styles: m, get NmorphIcon() {
44
- return b;
45
- }, get NmorphIconSuccess() {
41
+ ), h = t(
42
+ () => b({
43
+ "--hover-bg": e.hoverBackground,
44
+ "--hover-color": e.hoverColor
45
+ })
46
+ ), n = { selectSelectedValue: r, selectChangeSelectedValue: o, selectHeight: a, props: e, emit: s, clickHandler: f, checked: i, height: u, modifiers: m, styles: h, get NmorphIcon() {
46
47
  return q;
48
+ }, get NmorphIconSuccess() {
49
+ return _;
47
50
  } };
48
51
  return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
49
52
  }
50
53
  });
51
54
  export {
52
- I as default
55
+ H as default
53
56
  };