@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,10 +1,10 @@
1
1
  import './NmorphDropdown.css';
2
- import { defineComponent as w, ref as q, toRef as t, computed as l, watch as v } from "vue";
3
- import { useModifiers as b } from "../../../utils/create-modifiers.js";
4
- import { toCssSize as d } from "../../../utils/common.js";
5
- import { usePlacement as x } from "../../../hooks/use-placement.js";
2
+ import { defineComponent as y, ref as v, toRef as t, computed as i, watch as w } from "vue";
3
+ import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as b, createCssSizeVariables as x } from "../../../utils/common.js";
5
+ import { usePlacement as S } from "../../../hooks/use-placement.js";
6
6
  import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
7
- const B = /* @__PURE__ */ w({
7
+ const B = /* @__PURE__ */ y({
8
8
  __name: "NmorphDropdown",
9
9
  props: {
10
10
  open: { type: Boolean, required: !0 },
@@ -26,44 +26,46 @@ const B = /* @__PURE__ */ w({
26
26
  hideShadow: { type: Boolean, required: !1, default: !1 }
27
27
  },
28
28
  emits: ["on-outside-click", "on-escape-keydown"],
29
- setup(p, { expose: f, emit: m }) {
30
- f();
31
- const e = p, r = m, i = q(null), { placementCoords: o, placementReady: n, adjustPlacement: a } = x({
29
+ setup(u, { expose: p, emit: f }) {
30
+ p();
31
+ const e = u, r = f, l = v(null), { placementCoords: o, placementReady: d, adjustPlacement: a } = S({
32
32
  initialPlacement: t(e, "placement"),
33
- contentDOMElement: i,
33
+ contentDOMElement: l,
34
34
  relativeElement: t(e, "relativeElement"),
35
35
  yOffset: t(e, "yOffset"),
36
36
  xOffset: t(e, "xOffset"),
37
37
  enabled: t(e, "open")
38
- }), c = l(
39
- () => b({
38
+ }), m = i(
39
+ () => q({
40
40
  "nmorph-dropdown": [!e.open && "closed", e.hideShadow && "hide-shadow"]
41
41
  })
42
- ), s = l(
43
- () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : d(e.width)
44
- ), h = l(() => ({
45
- "--nmorph-dropdown-width": s.value,
46
- "--nmorph-dropdown-min-width": d(e.minWidth) || "auto",
47
- "--nmorph-dropdown-max-width": d(e.maxWidth) || "none",
42
+ ), n = i(
43
+ () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : b(e.width)
44
+ ), c = i(() => ({
45
+ "--nmorph-dropdown-width": n.value,
46
+ ...x({
47
+ "--nmorph-dropdown-min-width": e.minWidth === void 0 ? "auto" : e.minWidth,
48
+ "--nmorph-dropdown-max-width": e.maxWidth === void 0 ? "none" : e.maxWidth
49
+ }),
48
50
  left: o.value.x,
49
51
  top: o.value.y,
50
- visibility: e.open && n.value ? "visible" : "hidden"
52
+ visibility: e.open && d.value ? "visible" : "hidden"
51
53
  }));
52
- v(
54
+ w(
53
55
  () => e.open,
54
- (y) => {
55
- y && a();
56
+ (h) => {
57
+ h && a();
56
58
  },
57
59
  { flush: "post" }
58
60
  );
59
- const u = { props: e, emit: r, dropdownDOMRef: i, placementCoords: o, placementReady: n, adjustPlacement: a, modifiers: c, width: s, dropdownStyle: h, outsideClickHandler: () => {
61
+ const s = { props: e, emit: r, dropdownDOMRef: l, placementCoords: o, placementReady: d, adjustPlacement: a, modifiers: m, width: n, dropdownStyle: c, outsideClickHandler: () => {
60
62
  r("on-outside-click");
61
63
  }, escapeHandler: () => {
62
64
  r("on-escape-keydown");
63
65
  }, get NmorphOverlay() {
64
66
  return O;
65
67
  } };
66
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
68
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
67
69
  }
68
70
  });
69
71
  export {
@@ -1,103 +1,87 @@
1
- import { resolution as L } from "../components/form/nmorph-file-upload/types.js";
1
+ import { isFileAllowedByTypes as z } from "../utils/file-types.js";
2
2
  import { ref as h } from "vue";
3
- const S = Object.entries(L), z = (t) => t.split("/")[1]?.toLowerCase() || "", B = (t) => {
4
- const o = t.split(".").pop()?.toLowerCase();
5
- return o && o !== t.toLowerCase() ? o : "";
6
- }, I = (t) => S.find(([, o]) => o.toLowerCase() === t.toLowerCase())?.[0] || "", M = (t) => Array.from(
7
- new Set(
8
- [
9
- t.type.toLowerCase(),
10
- I(t.type),
11
- B(t.name),
12
- z(t.type)
13
- ].filter(Boolean).map((o) => o.toLowerCase())
14
- )
15
- ), w = (t) => typeof File < "u" && t instanceof File, q = (t) => !!t && typeof t == "object" && "data" in t && w(t.data), E = (t) => {
16
- if (w(t)) return [t];
17
- if (!Array.isArray(t)) return null;
18
- const o = t;
19
- return o.length === 0 ? [] : o.every(w) ? o : o.every(q) ? o.map((s) => s.data) : null;
20
- }, j = (t, o) => {
21
- if (o.length === 0) return !0;
22
- const s = M(t);
23
- return o.some((c) => s.includes(String(c).toLowerCase()));
24
- }, P = (t) => {
25
- const { inputValue: o, rules: s } = t, c = h([]), y = h(!1), m = h(!1);
3
+ const v = (n) => typeof File < "u" && n instanceof File, S = (n) => !!n && typeof n == "object" && "data" in n && v(n.data), I = (n) => {
4
+ if (v(n)) return [n];
5
+ if (!Array.isArray(n)) return null;
6
+ const u = n;
7
+ return u.length === 0 ? [] : u.every(v) ? u : u.every(S) ? u.map((l) => l.data) : null;
8
+ }, D = (n) => {
9
+ const { inputValue: u, rules: l } = n, p = h([]), y = h(!1), m = h(!1);
26
10
  return {
27
11
  touched: m,
28
12
  valid: y,
29
- errors: c,
13
+ errors: p,
30
14
  validate: () => {
31
- const g = s?.length > 0;
32
- if (c.value = [], !g) {
15
+ const F = l?.length > 0;
16
+ if (p.value = [], !F) {
33
17
  y.value = !0;
34
18
  return;
35
19
  }
36
- if (o === null) return;
37
- const i = o, u = (a) => g && s.some((r) => a in r), C = typeof i == "string" && u("pattern"), F = typeof i == "number" && u("numberCompareType"), T = (typeof i == "string" || typeof i == "boolean") && u("booleanCompareType"), v = Array.isArray(i) && u("arrayCompareType"), x = u("fileMaxSize") || u("maxFileSize") || u("fileAllowedTypes") || u("allowedTypes") || u("fileMaxCount") || u("maxFiles"), b = x ? E(i) : null, A = x && b !== null;
38
- if (!F && !C && !T && !v && !A) {
20
+ if (u === null) return;
21
+ const o = u, a = (s) => F && l.some((r) => s in r), T = typeof o == "string" && a("pattern"), g = typeof o == "number" && a("numberCompareType"), x = (typeof o == "string" || typeof o == "boolean") && a("booleanCompareType"), b = Array.isArray(o) && a("arrayCompareType"), w = a("fileMaxSize") || a("maxFileSize") || a("fileAllowedTypes") || a("allowedTypes") || a("fileMaxCount") || a("maxFiles"), A = w ? I(o) : null, C = w && A !== null;
22
+ if (!g && !T && !x && !b && !C) {
39
23
  console.warn("The input value and the provided rules do not match");
40
24
  return;
41
25
  }
42
- if (m.value || (m.value = !0), C) {
43
- const a = s;
44
- c.value = a.reduce((r, n) => (i.match(n.pattern) || r.push(n.error), r), []);
26
+ if (m.value || (m.value = !0), T) {
27
+ const s = l;
28
+ p.value = s.reduce((r, t) => (o.match(t.pattern) || r.push(t.error), r), []);
45
29
  }
46
- if (F) {
47
- const a = (n, e, l) => {
48
- switch (l) {
30
+ if (g) {
31
+ const s = (t, e, i) => {
32
+ switch (i) {
49
33
  case "eq":
50
- return n === e;
34
+ return t === e;
51
35
  case "gt":
52
- return n > e;
36
+ return t > e;
53
37
  case "lt":
54
- return n < e;
38
+ return t < e;
55
39
  case "lte":
56
- return n <= e;
40
+ return t <= e;
57
41
  case "gte":
58
- return n >= e;
42
+ return t >= e;
59
43
  }
60
- }, r = s;
61
- c.value = r.reduce((n, e) => (a(i, e.compareValue, e.numberCompareType) && n.push(e.error), n), []);
44
+ }, r = l;
45
+ p.value = r.reduce((t, e) => (s(o, e.compareValue, e.numberCompareType) && t.push(e.error), t), []);
62
46
  }
63
- if (T) {
64
- const a = s;
65
- c.value = a.reduce((r, n) => {
47
+ if (x) {
48
+ const s = l;
49
+ p.value = s.reduce((r, t) => {
66
50
  let e = !1;
67
- const { compareValue: l, booleanCompareType: f } = n;
68
- return f === "not-eq" && (e = i === l), f === "eq" && (e = i !== l), e || r.push(n.error), r;
51
+ const { compareValue: i, booleanCompareType: f } = t;
52
+ return f === "not-eq" && (e = o === i), f === "eq" && (e = o !== i), e || r.push(t.error), r;
69
53
  }, []);
70
54
  }
71
- if (v) {
72
- const a = s, r = (n, e, l) => {
73
- switch (l) {
55
+ if (b) {
56
+ const s = l, r = (t, e, i) => {
57
+ switch (i) {
74
58
  case "contains-one":
75
- return n.some((p) => e.includes(p));
59
+ return t.some((c) => e.includes(c));
76
60
  case "full-eq":
77
- if (n.length !== e.length) return !1;
78
- const f = [...n].sort(), d = [...e].sort();
79
- return f.every((p, R) => p === d[R]);
61
+ if (t.length !== e.length) return !1;
62
+ const f = [...t].sort(), d = [...e].sort();
63
+ return f.every((c, R) => c === d[R]);
80
64
  case "not-contains":
81
- return !n.some((p) => e.includes(p));
65
+ return !t.some((c) => e.includes(c));
82
66
  }
83
67
  };
84
- c.value = a.reduce((n, e) => (r(
85
- i.map((f) => String(f)),
68
+ p.value = s.reduce((t, e) => (r(
69
+ o.map((f) => String(f)),
86
70
  e.compareValue,
87
71
  e.arrayCompareType
88
- ) || n.push(e.error), n), []);
72
+ ) || t.push(e.error), t), []);
89
73
  }
90
- if (A) {
91
- const a = s, r = b || [];
92
- c.value = a.reduce((n, e) => {
93
- const l = e.fileMaxSize ?? e.maxFileSize, f = e.fileAllowedTypes ?? e.allowedTypes, d = e.fileMaxCount ?? e.maxFiles;
94
- return typeof l == "number" && r.some((p) => p.size > l) && n.push(e.error), f && r.some((p) => !j(p, f)) && n.push(e.error), typeof d == "number" && r.length > d && n.push(e.error), n;
74
+ if (C) {
75
+ const s = l, r = A || [];
76
+ p.value = s.reduce((t, e) => {
77
+ const i = e.fileMaxSize ?? e.maxFileSize, f = e.fileAllowedTypes ?? e.allowedTypes, d = e.fileMaxCount ?? e.maxFiles;
78
+ return typeof i == "number" && r.some((c) => c.size > i) && t.push(e.error), f && r.some((c) => !z(c, f)) && t.push(e.error), typeof d == "number" && r.length > d && t.push(e.error), t;
95
79
  }, []);
96
80
  }
97
- y.value = c.value.length === 0;
81
+ y.value = p.value.length === 0;
98
82
  }
99
83
  };
100
84
  };
101
85
  export {
102
- P as useFieldValidation
86
+ D as useFieldValidation
103
87
  };
@@ -0,0 +1,27 @@
1
+ import { ref as c } from "vue";
2
+ const d = (s = {}) => {
3
+ const e = c(null), u = c(!1);
4
+ return {
5
+ elementRef: e,
6
+ focused: u,
7
+ handleFocus: () => {
8
+ u.value = !0, s.onFocus?.();
9
+ },
10
+ handleBlur: () => {
11
+ u.value = !1, s.onBlur?.();
12
+ },
13
+ focus: () => {
14
+ e.value?.focus();
15
+ },
16
+ blur: () => {
17
+ e.value?.blur();
18
+ },
19
+ select: () => {
20
+ const l = e.value;
21
+ l && "select" in l && typeof l.select == "function" && l.select();
22
+ }
23
+ };
24
+ };
25
+ export {
26
+ d as useFocusableInput
27
+ };
@@ -1,12 +1,12 @@
1
- import { Locale as o } from "../types/index.js";
2
1
  import { createI18n as c } from "vue-i18n";
3
- import s from "../locales/en.js";
2
+ import o from "../locales/en.js";
3
+ import { Locale as s } from "../types/translation.types.js";
4
4
  const f = (e) => {
5
- const l = e && e.messages ? { ...e.messages, en: s } : { en: s }, r = e && e.locale ? e.locale : o.en;
5
+ const l = e && e.messages ? { ...e.messages, en: o } : { en: o }, r = e && e.locale ? e.locale : s.en;
6
6
  return c({
7
7
  legacy: !1,
8
8
  locale: r,
9
- fallbackLocale: o.en,
9
+ fallbackLocale: s.en,
10
10
  messages: l
11
11
  });
12
12
  };
@@ -1,89 +1,93 @@
1
- import { ref as b, unref as n, inject as T, watch as F, onMounted as U, onUnmounted as X, nextTick as S } from "vue";
2
- const G = (j) => {
3
- const { initialPlacement: g, relativeElement: y, contentDOMElement: u, yOffset: L = 0, xOffset: O = 0, enabled: h } = j, R = b(n(g)), C = b({ x: "0px", y: "0px" }), v = b(!1), k = T("nmorph"), P = { passive: !0, capture: !0 };
1
+ import { ref as b, unref as i, inject as U, watch as X, onMounted as J, onUnmounted as K, nextTick as $ } from "vue";
2
+ const F = 4, Z = (H) => {
3
+ const { initialPlacement: p, relativeElement: O, contentDOMElement: d, yOffset: R = 0, xOffset: M = 0, enabled: g } = H, y = b(i(p)), L = b({ x: "0px", y: "0px" }), m = b(!1), I = U("nmorph"), P = { passive: !0, capture: !0 };
4
4
  let w = null;
5
- F(
6
- () => k?.browser,
5
+ X(
6
+ () => I?.browser,
7
7
  () => {
8
- o();
8
+ r();
9
9
  },
10
10
  { deep: !0 }
11
- ), U(() => {
12
- o(), V(), window.addEventListener("resize", o, { passive: !0 }), w = new MutationObserver(() => {
13
- M();
14
- }), w.observe(document.body, { childList: !0, subtree: !0 }), M();
15
- }), X(() => {
16
- W(), window.removeEventListener("resize", o), w?.disconnect();
17
- }), F(
18
- () => [n(g), n(y), n(O), n(L), n(h)],
11
+ ), J(() => {
12
+ r(), Y(), window.addEventListener("resize", r, { passive: !0 }), w = new MutationObserver(() => {
13
+ C();
14
+ }), w.observe(document.body, { childList: !0, subtree: !0 }), C();
15
+ }), K(() => {
16
+ _(), window.removeEventListener("resize", r), w?.disconnect();
17
+ }), X(
18
+ () => [i(p), i(O), i(M), i(R), i(g)],
19
19
  () => {
20
- o();
20
+ r();
21
21
  },
22
22
  { flush: "post" }
23
23
  );
24
- const M = () => {
25
- S(() => {
26
- u.value && o();
24
+ const C = () => {
25
+ $(() => {
26
+ d.value && r();
27
27
  });
28
- }, A = () => h === void 0 || n(h) !== !1, q = (e) => {
29
- const [s, t] = e.split("-");
28
+ }, W = () => g === void 0 || i(g) !== !1, N = (t) => {
29
+ const [n, e] = t.split("-");
30
30
  return {
31
- side: s,
32
- align: t || "start",
33
- hasAlign: !!t
31
+ side: n,
32
+ align: e || "start",
33
+ hasAlign: !!e
34
34
  };
35
- }, z = (e, s, t) => t ? `${e}-${s}` : e, B = () => n(y), H = (e, s, t, l, d, r, i) => e === "top" && t - i < 0 ? "bottom" : e === "bottom" && t + d + i > window.innerHeight ? "top" : e === "left" && s - r < 0 ? "right" : e === "right" && s + l + r > window.innerWidth ? "left" : e, V = () => {
36
- window.addEventListener("scroll", o, P);
37
- }, W = () => {
38
- window.removeEventListener("scroll", o, P);
39
- }, o = () => {
40
- S(() => {
35
+ }, S = (t, n, e) => e ? `${t}-${n}` : t, A = () => i(O), B = (t, n, e) => {
36
+ const o = F, a = Math.max(e - n - F, o);
37
+ return Math.min(Math.max(t, o), a);
38
+ }, T = (t, n, e, o, a, s, l) => t === "top" && e - l < 0 ? "bottom" : t === "bottom" && e + a + l > window.innerHeight ? "top" : t === "left" && n - s < 0 ? "right" : t === "right" && n + o + s > window.innerWidth ? "left" : t, Y = () => {
39
+ window.addEventListener("scroll", r, P);
40
+ }, _ = () => {
41
+ window.removeEventListener("scroll", r, P);
42
+ }, r = () => {
43
+ $(() => {
41
44
  if (typeof window > "u") return;
42
- if (!A()) {
43
- v.value = !1;
45
+ if (!W()) {
46
+ m.value = !1;
44
47
  return;
45
48
  }
46
- const e = B();
47
- if (!u.value || !e) {
48
- v.value = !1;
49
+ const t = A();
50
+ if (!d.value || !t) {
51
+ m.value = !1;
49
52
  return;
50
53
  }
51
- const s = u.value.getBoundingClientRect(), t = s.width, l = s.height, d = e.getBoundingClientRect(), { x: r, y: i } = d, m = d.width, p = d.height, D = n(O) || 0, N = n(L) || 0, f = q(n(g)), a = H(
54
+ const n = d.value.getBoundingClientRect(), e = n.width, o = n.height, a = t.getBoundingClientRect(), { x: s, y: l } = a, v = a.width, h = a.height, j = i(M) || 0, k = i(R) || 0, f = N(i(p)), c = T(
52
55
  f.side,
53
- r,
54
- i,
55
- m,
56
- p,
57
- t,
58
- l
56
+ s,
57
+ l,
58
+ v,
59
+ h,
60
+ e,
61
+ o
59
62
  );
60
- let E = r, x = i;
61
- if (a === "top" || a === "bottom") {
62
- const c = {
63
- start: r,
64
- center: r + m / 2 - t / 2,
65
- end: r + m - t
63
+ let x = s, E = l;
64
+ if (c === "top" || c === "bottom") {
65
+ const u = {
66
+ start: s,
67
+ center: s + v / 2 - e / 2,
68
+ end: s + v - e
66
69
  };
67
- E = c[f.align] ?? c.start, x = a === "top" ? i - l : i + p;
70
+ x = u[f.align] ?? u.start, E = c === "top" ? l - o : l + h;
68
71
  }
69
- if (a === "left" || a === "right") {
70
- const c = {
71
- start: i,
72
- center: i + p / 2 - l / 2,
73
- end: i + p - l
72
+ if (c === "left" || c === "right") {
73
+ const u = {
74
+ start: l,
75
+ center: l + h / 2 - o / 2,
76
+ end: l + h - o
74
77
  };
75
- E = a === "left" ? r - t : r + m, x = c[f.align] ?? c.start;
78
+ x = c === "left" ? s - e : s + v, E = u[f.align] ?? u.start;
76
79
  }
77
- R.value = z(a, f.align, f.hasAlign), C.value = { x: `${E + D}px`, y: `${x + N}px` }, v.value = !0, typeof requestAnimationFrame == "function" && requestAnimationFrame(() => {
78
- const c = B();
79
- if (!u.value || !c || !A()) return;
80
- const $ = u.value.getBoundingClientRect();
81
- ($.width !== t || $.height !== l) && o();
80
+ const q = x + j, z = E + k, D = B(q, e, window.innerWidth), G = B(z, o, window.innerHeight);
81
+ y.value = S(c, f.align, f.hasAlign), L.value = { x: `${D}px`, y: `${G}px` }, m.value = !0, typeof requestAnimationFrame == "function" && requestAnimationFrame(() => {
82
+ const u = A();
83
+ if (!d.value || !u || !W()) return;
84
+ const V = d.value.getBoundingClientRect();
85
+ (V.width !== e || V.height !== o) && r();
82
86
  });
83
87
  });
84
88
  };
85
- return { placement: R, placementCoords: C, placementReady: v, adjustPlacement: o };
89
+ return { placement: y, placementCoords: L, placementReady: m, adjustPlacement: r };
86
90
  };
87
91
  export {
88
- G as usePlacement
92
+ Z as usePlacement
89
93
  };