origam 2.41.0 → 2.41.1

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 (286) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/src/components/Alert/OrigamAlert.vue +1 -2
  3. package/dist/src/components/Audio/OrigamAudio.vue +15 -14
  4. package/dist/src/components/Badge/OrigamBadge.vue +6 -1
  5. package/dist/src/components/Bracket/OrigamBracket.vue +5 -5
  6. package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +1 -2
  7. package/dist/src/components/Btn/OrigamBtn.vue +14 -15
  8. package/dist/src/components/Card/OrigamCard.vue +2 -1
  9. package/dist/src/components/Carousel/OrigamCarousel.vue +14 -13
  10. package/dist/src/components/Chart/OrigamChartBullet.vue +4 -1
  11. package/dist/src/components/Chart/OrigamChartPictorial.vue +3 -6
  12. package/dist/src/components/Chart/OrigamChartPolar.vue +2 -1
  13. package/dist/src/components/Chart/OrigamChartPolarBar.vue +3 -1
  14. package/dist/src/components/Chart/OrigamChartSankey.vue +9 -167
  15. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +14 -12
  16. package/dist/src/components/Chart/OrigamChartSunburst.vue +10 -2
  17. package/dist/src/components/Chart/OrigamChartWordCloud.vue +39 -36
  18. package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +3 -4
  19. package/dist/src/components/Chip/OrigamChip.vue +2 -3
  20. package/dist/src/components/Chip/OrigamChipGroup.vue +2 -3
  21. package/dist/src/components/Clipboard/OrigamClipboard.vue +1 -1
  22. package/dist/src/components/Code/OrigamCode.vue +4 -2
  23. package/dist/src/components/ColorPicker/OrigamColorPicker.vue +5 -1
  24. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +1 -2
  25. package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +1 -2
  26. package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +1 -2
  27. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +6 -2
  28. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +2 -4
  29. package/dist/src/components/Counter/OrigamCounter.vue +1 -0
  30. package/dist/src/components/DataTable/OrigamDataTable.vue +2 -3
  31. package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +1 -2
  32. package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +3 -2
  33. package/dist/src/components/DataTable/OrigamDataTableRow.vue +2 -3
  34. package/dist/src/components/DataTable/OrigamDataTableRows.vue +43 -39
  35. package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +3 -4
  36. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +1 -1
  37. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1 -2
  38. package/dist/src/components/Dialog/OrigamDialog.vue +1 -2
  39. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +2 -3
  40. package/dist/src/components/Field/OrigamField.vue +2 -6
  41. package/dist/src/components/FileField/OrigamFileField.vue +23 -6
  42. package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +3 -4
  43. package/dist/src/components/FileField/OrigamFileFieldListItem.vue +3 -4
  44. package/dist/src/components/Form/OrigamForm.vue +0 -2
  45. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +7 -7
  46. package/dist/src/components/Input/OrigamInput.vue +3 -11
  47. package/dist/src/components/List/OrigamListGroup.vue +2 -3
  48. package/dist/src/components/List/OrigamListItem.vue +4 -5
  49. package/dist/src/components/Media/OrigamMediaController.vue +12 -13
  50. package/dist/src/components/Media/OrigamMediaScrubber.vue +15 -12
  51. package/dist/src/components/Media/OrigamMediaVolumeControl.vue +4 -5
  52. package/dist/src/components/Menu/OrigamMenu.vue +1 -2
  53. package/dist/src/components/NumberField/OrigamNumberField.vue +7 -10
  54. package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +7 -1
  55. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1 -1
  56. package/dist/src/components/Pagination/OrigamPagination.vue +4 -5
  57. package/dist/src/components/Parallax/OrigamParallaxElement.vue +1 -4
  58. package/dist/src/components/PasswordField/OrigamPasswordField.vue +9 -7
  59. package/dist/src/components/Radio/OrigamRadioBtn.vue +2 -3
  60. package/dist/src/components/RatingField/OrigamRatingField.vue +1 -2
  61. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +2 -3
  62. package/dist/src/components/Select/OrigamSelect.vue +135 -105
  63. package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +7 -2
  64. package/dist/src/components/Slide/OrigamSlideGroup.vue +7 -10
  65. package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +9 -10
  66. package/dist/src/components/Stepper/OrigamStepper.vue +7 -11
  67. package/dist/src/components/Stepper/OrigamStepperItem.vue +2 -3
  68. package/dist/src/components/Switch/OrigamSwitch.vue +0 -9
  69. package/dist/src/components/Tabs/OrigamTabs.vue +1 -1
  70. package/dist/src/components/TextField/OrigamTextField.vue +2 -5
  71. package/dist/src/components/TextareaField/OrigamTextareaField.vue +3 -2
  72. package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +13 -14
  73. package/dist/src/components/Transition/OrigamExpandX.vue +4 -10
  74. package/dist/src/components/Transition/OrigamExpandY.vue +4 -10
  75. package/dist/src/components/Transition/OrigamSnack.vue +2 -8
  76. package/dist/src/components/Treeview/OrigamTreeviewNode.vue +24 -18
  77. package/dist/src/components/Video/OrigamVideo.vue +14 -19
  78. package/dist/src/components/Window/OrigamWindow.vue +2 -3
  79. package/dist/src/composables/Audio/use-waveform.composable.cjs +24 -19
  80. package/dist/src/composables/Audio/use-waveform.composable.js +24 -19
  81. package/dist/src/composables/Calendar/calendar.composable.cjs +11 -11
  82. package/dist/src/composables/Calendar/calendar.composable.js +1 -1
  83. package/dist/src/composables/Chart/chart.composable.cjs +541 -415
  84. package/dist/src/composables/Chart/chart.composable.d.ts +2 -5
  85. package/dist/src/composables/Chart/chart.composable.js +392 -338
  86. package/dist/src/composables/Code/code.composable.cjs +4 -4
  87. package/dist/src/composables/Code/code.composable.js +1 -1
  88. package/dist/src/composables/Commons/color.composable.cjs +106 -48
  89. package/dist/src/composables/Commons/color.composable.js +55 -48
  90. package/dist/src/composables/Commons/display.composable.cjs +7 -1
  91. package/dist/src/composables/Commons/display.composable.js +2 -2
  92. package/dist/src/composables/Commons/dragResizer.composable.cjs +11 -10
  93. package/dist/src/composables/Commons/dragResizer.composable.js +2 -1
  94. package/dist/src/composables/Commons/group.composable.cjs +17 -14
  95. package/dist/src/composables/Commons/group.composable.js +19 -15
  96. package/dist/src/composables/Commons/nested.composable.cjs +16 -16
  97. package/dist/src/composables/Commons/nested.composable.d.ts +1 -1
  98. package/dist/src/composables/Commons/nested.composable.js +1 -1
  99. package/dist/src/composables/Commons/nestedItem.composable.cjs +3 -3
  100. package/dist/src/composables/Commons/nestedItem.composable.d.ts +1 -1
  101. package/dist/src/composables/Commons/nestedItem.composable.js +1 -1
  102. package/dist/src/composables/Commons/size.composable.cjs +1 -1
  103. package/dist/src/composables/Commons/size.composable.js +1 -1
  104. package/dist/src/composables/Commons/stateEffect.composable.cjs +54 -32
  105. package/dist/src/composables/Commons/stateEffect.composable.js +43 -33
  106. package/dist/src/composables/Commons/teleport.composable.cjs +2 -1
  107. package/dist/src/composables/Commons/teleport.composable.js +4 -1
  108. package/dist/src/composables/Commons/touch.composable.cjs +77 -33
  109. package/dist/src/composables/Commons/touch.composable.js +77 -33
  110. package/dist/src/composables/Commons/vModel.composable.cjs +1 -1
  111. package/dist/src/composables/Commons/vModel.composable.js +1 -1
  112. package/dist/src/composables/Commons/validation.composable.cjs +1 -1
  113. package/dist/src/composables/Commons/validation.composable.js +1 -1
  114. package/dist/src/composables/Commons/velocity.composable.cjs +5 -1
  115. package/dist/src/composables/Commons/velocity.composable.js +5 -1
  116. package/dist/src/composables/DataTable/headers.composable.cjs +36 -30
  117. package/dist/src/composables/DataTable/headers.composable.d.ts +1 -1
  118. package/dist/src/composables/DataTable/headers.composable.js +29 -23
  119. package/dist/src/composables/DataTable/headersCell.composable.cjs +2 -2
  120. package/dist/src/composables/DataTable/headersCell.composable.js +1 -1
  121. package/dist/src/composables/DataTable/select.composable.cjs +4 -4
  122. package/dist/src/composables/DataTable/select.composable.js +1 -1
  123. package/dist/src/composables/DataTable/sort.composable.cjs +6 -6
  124. package/dist/src/composables/DataTable/sort.composable.js +1 -1
  125. package/dist/src/composables/Form/form.composable.cjs +1 -1
  126. package/dist/src/composables/Form/form.composable.js +3 -1
  127. package/dist/src/composables/Masonry/masonry.composable.cjs +29 -20
  128. package/dist/src/composables/Masonry/masonry.composable.d.ts +0 -14
  129. package/dist/src/composables/Masonry/masonry.composable.js +29 -20
  130. package/dist/src/composables/NumberFormat/number-format.composable.cjs +28 -23
  131. package/dist/src/composables/NumberFormat/number-format.composable.js +28 -23
  132. package/dist/src/composables/Parallax/parallax.composable.cjs +9 -9
  133. package/dist/src/composables/Parallax/parallax.composable.js +3 -3
  134. package/dist/src/composables/Parallax/transform.composable.cjs +14 -13
  135. package/dist/src/composables/Parallax/transform.composable.js +2 -1
  136. package/dist/src/composables/PasswordField/passwordStrength.composable.cjs +2 -2
  137. package/dist/src/composables/PasswordField/passwordStrength.composable.js +1 -1
  138. package/dist/src/composables/QrCode/qr-code.composable.cjs +1 -1
  139. package/dist/src/composables/QrCode/qr-code.composable.js +1 -1
  140. package/dist/src/composables/Sheet/sheetSwipe.composable.cjs +3 -4
  141. package/dist/src/composables/Sheet/sheetSwipe.composable.js +4 -4
  142. package/dist/src/composables/TextareaField/textarea-field-rich.composable.cjs +31 -31
  143. package/dist/src/composables/TextareaField/textarea-field-rich.composable.js +1 -1
  144. package/dist/src/composables/Watermark/watermark.composable.cjs +1 -1
  145. package/dist/src/composables/Watermark/watermark.composable.js +1 -1
  146. package/dist/src/consts/Audio/audio.const.cjs +5 -4
  147. package/dist/src/consts/Audio/audio.const.d.ts +2 -1
  148. package/dist/src/consts/Audio/audio.const.js +2 -1
  149. package/dist/src/consts/Blockquote/blockquote.const.cjs +3 -3
  150. package/dist/src/consts/Blockquote/blockquote.const.js +1 -1
  151. package/dist/src/consts/Bracket/bracket.const.cjs +4 -3
  152. package/dist/src/consts/Bracket/bracket.const.js +2 -1
  153. package/dist/src/consts/Code/code.const.cjs +3 -3
  154. package/dist/src/consts/Code/code.const.d.ts +1 -1
  155. package/dist/src/consts/Code/code.const.js +1 -1
  156. package/dist/src/consts/Commons/autocomplete.const.cjs +2 -2
  157. package/dist/src/consts/Commons/autocomplete.const.d.ts +1 -1
  158. package/dist/src/consts/Commons/autocomplete.const.js +1 -1
  159. package/dist/src/consts/Commons/display.const.cjs +2 -2
  160. package/dist/src/consts/Commons/display.const.js +1 -1
  161. package/dist/src/consts/Commons/hotkey.const.cjs +2 -2
  162. package/dist/src/consts/Commons/hotkey.const.js +1 -1
  163. package/dist/src/consts/Commons/margin.const.cjs +1 -1
  164. package/dist/src/consts/Commons/margin.const.js +1 -1
  165. package/dist/src/consts/Commons/padding.const.cjs +1 -1
  166. package/dist/src/consts/Commons/padding.const.js +1 -1
  167. package/dist/src/consts/Commons/rounded.const.cjs +6 -2
  168. package/dist/src/consts/Commons/rounded.const.js +6 -2
  169. package/dist/src/consts/EmptyState/empty-state.const.cjs +12 -12
  170. package/dist/src/consts/EmptyState/empty-state.const.js +6 -6
  171. package/dist/src/consts/PasswordField/password-field.const.cjs +1 -1
  172. package/dist/src/consts/PasswordField/password-field.const.js +1 -1
  173. package/dist/src/consts/QrCode/qr-code.const.cjs +2 -2
  174. package/dist/src/consts/QrCode/qr-code.const.js +1 -1
  175. package/dist/src/consts/TextField/text-field.const.cjs +21 -21
  176. package/dist/src/consts/TextField/text-field.const.js +1 -1
  177. package/dist/src/consts/TextareaField/textarea-field.const.cjs +32 -4
  178. package/dist/src/consts/TextareaField/textarea-field.const.d.ts +1 -0
  179. package/dist/src/consts/TextareaField/textarea-field.const.js +29 -1
  180. package/dist/src/directives/Contrast/contrast.directive.cjs +5 -3
  181. package/dist/src/directives/Contrast/contrast.directive.js +5 -3
  182. package/dist/src/directives/Intersect/intersect.directive.cjs +2 -1
  183. package/dist/src/directives/Intersect/intersect.directive.js +2 -1
  184. package/dist/src/interfaces/Chart/chart.interface.d.ts +70 -1
  185. package/dist/src/interfaces/ColorPicker/color-picker.interface.d.ts +1 -1
  186. package/dist/src/interfaces/Commons/border.interface.d.ts +11 -10
  187. package/dist/src/interfaces/Commons/filters.interface.d.ts +7 -0
  188. package/dist/src/interfaces/Commons/margin.interface.d.ts +12 -11
  189. package/dist/src/interfaces/Commons/padding.interface.d.ts +12 -11
  190. package/dist/src/interfaces/Commons/ripple.interface.d.ts +1 -3
  191. package/dist/src/interfaces/Commons/rounded.interface.d.ts +10 -9
  192. package/dist/src/interfaces/DataTable/sort.interface.d.ts +6 -0
  193. package/dist/src/interfaces/Grid/grid.interface.d.ts +4 -4
  194. package/dist/src/interfaces/SliderField/slider-field.interface.d.ts +4 -4
  195. package/dist/src/origam-core.cjs +51 -33
  196. package/dist/src/origam-core.js +21 -27
  197. package/dist/src/types/Commons/box-value.type.cjs +1 -0
  198. package/dist/src/types/Commons/box-value.type.d.ts +1 -0
  199. package/dist/src/types/Commons/box-value.type.js +0 -0
  200. package/dist/src/types/Commons/location.type.d.ts +13 -0
  201. package/dist/src/types/Commons/point.type.d.ts +1 -1
  202. package/dist/src/types/DataTable/data-table.type.d.ts +1 -0
  203. package/dist/src/types/Grid/grid.type.d.ts +7 -0
  204. package/dist/src/types/SliderField/slider-field.type.d.ts +8 -0
  205. package/dist/src/utils/Bracket/bracket-surface.util.cjs +9 -2
  206. package/dist/src/utils/Bracket/bracket-surface.util.js +9 -2
  207. package/dist/src/utils/Calendar/rrule.util.cjs +12 -7
  208. package/dist/src/utils/Calendar/rrule.util.js +12 -7
  209. package/dist/src/utils/Chart/chart-point.util.cjs +15 -0
  210. package/dist/src/utils/Chart/chart-point.util.d.ts +11 -0
  211. package/dist/src/utils/Chart/chart-point.util.js +8 -0
  212. package/dist/src/utils/Chart/sankey-layout.util.cjs +144 -0
  213. package/dist/src/utils/Chart/sankey-layout.util.d.ts +27 -0
  214. package/dist/src/utils/Chart/sankey-layout.util.js +130 -0
  215. package/dist/src/utils/Code/parse-highlight-lines.util.cjs +17 -14
  216. package/dist/src/utils/Code/parse-highlight-lines.util.js +17 -14
  217. package/dist/src/utils/CommandPalette/fuzzy-match.util.cjs +13 -9
  218. package/dist/src/utils/CommandPalette/fuzzy-match.util.js +13 -9
  219. package/dist/src/utils/Commons/anchor.util.cjs +6 -1
  220. package/dist/src/utils/Commons/anchor.util.js +6 -1
  221. package/dist/src/utils/Commons/apply-mask.util.cjs +11 -14
  222. package/dist/src/utils/Commons/apply-mask.util.js +7 -10
  223. package/dist/src/utils/Commons/apply-theme.util.cjs +6 -4
  224. package/dist/src/utils/Commons/apply-theme.util.js +6 -4
  225. package/dist/src/utils/Commons/bindProps.util.cjs +3 -5
  226. package/dist/src/utils/Commons/bindProps.util.js +3 -5
  227. package/dist/src/utils/Commons/color.util.cjs +43 -36
  228. package/dist/src/utils/Commons/color.util.js +44 -31
  229. package/dist/src/utils/Commons/commons.util.cjs +3 -3
  230. package/dist/src/utils/Commons/commons.util.js +3 -3
  231. package/dist/src/utils/Commons/console.util.cjs +6 -0
  232. package/dist/src/utils/Commons/console.util.d.ts +11 -0
  233. package/dist/src/utils/Commons/console.util.js +5 -0
  234. package/dist/src/utils/Commons/date.util.cjs +2 -27
  235. package/dist/src/utils/Commons/date.util.js +2 -27
  236. package/dist/src/utils/Commons/display.util.cjs +10 -1
  237. package/dist/src/utils/Commons/display.util.d.ts +8 -1
  238. package/dist/src/utils/Commons/display.util.js +9 -1
  239. package/dist/src/utils/Commons/eventListener.util.cjs +1 -2
  240. package/dist/src/utils/Commons/eventListener.util.js +1 -2
  241. package/dist/src/utils/Commons/filters.util.cjs +48 -34
  242. package/dist/src/utils/Commons/filters.util.d.ts +3 -8
  243. package/dist/src/utils/Commons/filters.util.js +47 -34
  244. package/dist/src/utils/Commons/forwardRefs.util.cjs +44 -40
  245. package/dist/src/utils/Commons/forwardRefs.util.js +44 -40
  246. package/dist/src/utils/Commons/group.util.cjs +1 -1
  247. package/dist/src/utils/Commons/group.util.js +1 -1
  248. package/dist/src/utils/Commons/hotkey.util.cjs +65 -61
  249. package/dist/src/utils/Commons/hotkey.util.js +56 -53
  250. package/dist/src/utils/Commons/hover.util.cjs +2 -2
  251. package/dist/src/utils/Commons/hover.util.js +2 -2
  252. package/dist/src/utils/Commons/locale.util.cjs +1 -1
  253. package/dist/src/utils/Commons/locale.util.js +1 -1
  254. package/dist/src/utils/Commons/location.util.cjs +87 -92
  255. package/dist/src/utils/Commons/location.util.js +75 -83
  256. package/dist/src/utils/Commons/nested.util.cjs +11 -11
  257. package/dist/src/utils/Commons/nested.util.js +1 -1
  258. package/dist/src/utils/Commons/point.util.cjs +16 -14
  259. package/dist/src/utils/Commons/point.util.js +13 -8
  260. package/dist/src/utils/Commons/ripple.util.cjs +4 -4
  261. package/dist/src/utils/Commons/ripple.util.js +4 -4
  262. package/dist/src/utils/Commons/scroll.util.cjs +9 -6
  263. package/dist/src/utils/Commons/scroll.util.js +9 -6
  264. package/dist/src/utils/Commons/token-name.util.cjs +22 -21
  265. package/dist/src/utils/Commons/token-name.util.js +22 -21
  266. package/dist/src/utils/Commons/validate-pattern.util.cjs +6 -6
  267. package/dist/src/utils/Commons/validate-pattern.util.js +1 -1
  268. package/dist/src/utils/DataTable/headers.util.cjs +20 -26
  269. package/dist/src/utils/DataTable/headers.util.js +18 -26
  270. package/dist/src/utils/DataTable/sort.util.cjs +41 -47
  271. package/dist/src/utils/DataTable/sort.util.d.ts +2 -7
  272. package/dist/src/utils/DataTable/sort.util.js +49 -47
  273. package/dist/src/utils/List/list-item.util.cjs +6 -1
  274. package/dist/src/utils/List/list-item.util.js +6 -1
  275. package/dist/src/utils/Parallax/parallax-element.util.cjs +13 -14
  276. package/dist/src/utils/Parallax/parallax-element.util.js +10 -11
  277. package/dist/src/utils/Slide/slide-group.util.cjs +4 -4
  278. package/dist/src/utils/Slide/slide-group.util.js +4 -4
  279. package/dist/src/utils/TextareaField/html-to-markdown.util.cjs +5 -36
  280. package/dist/src/utils/TextareaField/html-to-markdown.util.js +5 -36
  281. package/dist/src/utils/TextareaField/sanitize-html.util.cjs +18 -22
  282. package/dist/src/utils/TextareaField/sanitize-html.util.js +19 -23
  283. package/dist/src/utils/index.cjs +11 -0
  284. package/dist/src/utils/index.d.ts +1 -0
  285. package/dist/src/utils/index.js +1 -0
  286. package/package.json +1 -1
@@ -3,45 +3,58 @@ export function defaultFilter(value, query) {
3
3
  if (value == null || query == null) return -1;
4
4
  return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase());
5
5
  }
6
+ function isMatch(match) {
7
+ return match !== -1 && match !== false;
8
+ }
9
+ function matchObjectKeys(item, transformed, query, keys, filter, options, customMatches, defaultMatches) {
10
+ const filterKeys = keys || Object.keys(transformed);
11
+ for (const key of filterKeys) {
12
+ const value = getPropertyFromItem(transformed, key);
13
+ const keyFilter = options?.customKeyFilter?.[key];
14
+ const match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
15
+ if (isMatch(match)) {
16
+ if (keyFilter) customMatches[key] = match;
17
+ else defaultMatches[key] = match;
18
+ } else if (options?.filterMode === "every") {
19
+ return false;
20
+ }
21
+ }
22
+ return true;
23
+ }
24
+ function satisfiesFilterMode(filterMode, defaultMatchesLength, customMatchesLength, customFiltersLength) {
25
+ if (!defaultMatchesLength && !customMatchesLength) return false;
26
+ if (filterMode === "union") {
27
+ return customMatchesLength === customFiltersLength || !!defaultMatchesLength;
28
+ }
29
+ if (filterMode === "intersection") {
30
+ return customMatchesLength === customFiltersLength && !!defaultMatchesLength;
31
+ }
32
+ return true;
33
+ }
34
+ function matchItem(item, transformed, query, keys, filter, options, customFiltersLength) {
35
+ const customMatches = {};
36
+ const defaultMatches = {};
37
+ if (typeof item === "object") {
38
+ if (!matchObjectKeys(item, transformed, query, keys, filter, options, customMatches, defaultMatches)) return null;
39
+ } else {
40
+ const match = filter(item, query, item);
41
+ if (isMatch(match)) defaultMatches.title = match;
42
+ }
43
+ const defaultMatchesLength = Object.keys(defaultMatches).length;
44
+ const customMatchesLength = Object.keys(customMatches).length;
45
+ if (!satisfiesFilterMode(options?.filterMode, defaultMatchesLength, customMatchesLength, customFiltersLength)) return null;
46
+ return { ...defaultMatches, ...customMatches };
47
+ }
6
48
  export function filterItems(items, query, options) {
7
49
  const array = [];
8
50
  const filter = options?.default ?? defaultFilter;
9
51
  const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false;
10
52
  const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length;
11
53
  if (!items?.length) return array;
12
- loop:
13
- for (let i = 0; i < items.length; i++) {
14
- const [item, transformed = item] = wrapInArray(items[i]);
15
- const customMatches = {};
16
- const defaultMatches = {};
17
- let match = -1;
18
- if (query && !options?.noFilter) {
19
- if (typeof item === "object") {
20
- const filterKeys = keys || Object.keys(transformed);
21
- for (const key of filterKeys) {
22
- const value = getPropertyFromItem(transformed, key);
23
- const keyFilter = options?.customKeyFilter?.[key];
24
- match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
25
- if (match !== -1 && match !== false) {
26
- if (keyFilter) customMatches[key] = match;
27
- else defaultMatches[key] = match;
28
- } else if (options?.filterMode === "every") {
29
- continue loop;
30
- }
31
- }
32
- } else {
33
- match = filter(item, query, item);
34
- if (match !== -1 && match !== false) {
35
- defaultMatches.title = match;
36
- }
37
- }
38
- const defaultMatchesLength = Object.keys(defaultMatches).length;
39
- const customMatchesLength = Object.keys(customMatches).length;
40
- if (!defaultMatchesLength && !customMatchesLength) continue;
41
- if (options?.filterMode === "union" && customMatchesLength !== customFiltersLength && !defaultMatchesLength) continue;
42
- if (options?.filterMode === "intersection" && (customMatchesLength !== customFiltersLength || !defaultMatchesLength)) continue;
43
- }
44
- array.push({ index: i, matches: { ...defaultMatches, ...customMatches } });
45
- }
54
+ for (let i = 0; i < items.length; i++) {
55
+ const [item, transformed = item] = wrapInArray(items[i]);
56
+ const matches = query && !options?.noFilter ? matchItem(item, transformed, query, keys, filter, options, customFiltersLength) : {};
57
+ if (matches) array.push({ index: i, matches });
58
+ }
46
59
  return array;
47
60
  }
@@ -6,6 +6,38 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.forwardRefs = forwardRefs;
7
7
  exports.getDescriptor = getDescriptor;
8
8
  var _forwardRefs = require("../../consts/Commons/forwardRefs.const.cjs");
9
+ function isInternalKey(key) {
10
+ return typeof key === "symbol" || key.startsWith("$") || key.startsWith("__");
11
+ }
12
+ function findRefValueWith(refs, key) {
13
+ for (const ref of refs) {
14
+ if (ref.value && Reflect.has(ref.value, key)) return ref.value;
15
+ }
16
+ return void 0;
17
+ }
18
+ function findDescriptorInRefs(refs, key) {
19
+ for (const ref of refs) {
20
+ if (!ref.value) continue;
21
+ const descriptor = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
22
+ if (descriptor) return descriptor;
23
+ }
24
+ return void 0;
25
+ }
26
+ function findDescriptorInForwardedRefs(refs, key) {
27
+ for (const ref of refs) {
28
+ const childRefs = ref.value && ref.value[_forwardRefs.FORWARD_REFS];
29
+ if (!childRefs) continue;
30
+ const queue = childRefs.slice();
31
+ while (queue.length) {
32
+ const ref2 = queue.shift();
33
+ const descriptor = getDescriptor(ref2.value, key);
34
+ if (descriptor) return descriptor;
35
+ const childRefs2 = ref2.value?.[_forwardRefs.FORWARD_REFS];
36
+ if (childRefs2) queue.push(...childRefs2);
37
+ }
38
+ }
39
+ return void 0;
40
+ }
9
41
  function forwardRefs(target, ...refs) {
10
42
  target[_forwardRefs.FORWARD_REFS] = refs;
11
43
  return new Proxy(target, {
@@ -13,60 +45,32 @@ function forwardRefs(target, ...refs) {
13
45
  if (Reflect.has(target2, key)) {
14
46
  return Reflect.get(target2, key);
15
47
  }
16
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return;
17
- for (const ref of refs) {
18
- if (ref.value && Reflect.has(ref.value, key)) {
19
- const val = Reflect.get(ref.value, key);
20
- return typeof val === "function" ? val.bind(ref.value) : val;
21
- }
22
- }
48
+ if (isInternalKey(key)) return;
49
+ const owner = findRefValueWith(refs, key);
50
+ if (!owner) return;
51
+ const val = Reflect.get(owner, key);
52
+ return typeof val === "function" ? val.bind(owner) : val;
23
53
  },
24
54
  has(target2, key) {
25
55
  if (Reflect.has(target2, key)) {
26
56
  return true;
27
57
  }
28
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return false;
29
- for (const ref of refs) {
30
- if (ref.value && Reflect.has(ref.value, key)) {
31
- return true;
32
- }
33
- }
34
- return false;
58
+ if (isInternalKey(key)) return false;
59
+ return findRefValueWith(refs, key) !== void 0;
35
60
  },
36
61
  set(target2, key, value) {
37
62
  if (Reflect.has(target2, key)) {
38
63
  return Reflect.set(target2, key, value);
39
64
  }
40
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return false;
41
- for (const ref of refs) {
42
- if (ref.value && Reflect.has(ref.value, key)) {
43
- return Reflect.set(ref.value, key, value);
44
- }
45
- }
46
- return false;
65
+ if (isInternalKey(key)) return false;
66
+ const owner = findRefValueWith(refs, key);
67
+ return owner ? Reflect.set(owner, key, value) : false;
47
68
  },
48
69
  getOwnPropertyDescriptor(target2, key) {
49
70
  const descriptor = Reflect.getOwnPropertyDescriptor(target2, key);
50
71
  if (descriptor) return descriptor;
51
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return;
52
- for (const ref of refs) {
53
- if (!ref.value) continue;
54
- const descriptor2 = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
55
- if (descriptor2) return descriptor2;
56
- }
57
- for (const ref of refs) {
58
- const childRefs = ref.value && ref.value[_forwardRefs.FORWARD_REFS];
59
- if (!childRefs) continue;
60
- const queue = childRefs.slice();
61
- while (queue.length) {
62
- const ref2 = queue.shift();
63
- const descriptor2 = getDescriptor(ref2.value, key);
64
- if (descriptor2) return descriptor2;
65
- const childRefs2 = ref2.value?.[_forwardRefs.FORWARD_REFS];
66
- if (childRefs2) queue.push(...childRefs2);
67
- }
68
- }
69
- return void 0;
72
+ if (isInternalKey(key)) return;
73
+ return findDescriptorInRefs(refs, key) ?? findDescriptorInForwardedRefs(refs, key);
70
74
  }
71
75
  });
72
76
  }
@@ -1,4 +1,36 @@
1
1
  import { FORWARD_REFS } from "../../consts/Commons/forwardRefs.const.js";
2
+ function isInternalKey(key) {
3
+ return typeof key === "symbol" || key.startsWith("$") || key.startsWith("__");
4
+ }
5
+ function findRefValueWith(refs, key) {
6
+ for (const ref of refs) {
7
+ if (ref.value && Reflect.has(ref.value, key)) return ref.value;
8
+ }
9
+ return void 0;
10
+ }
11
+ function findDescriptorInRefs(refs, key) {
12
+ for (const ref of refs) {
13
+ if (!ref.value) continue;
14
+ const descriptor = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
15
+ if (descriptor) return descriptor;
16
+ }
17
+ return void 0;
18
+ }
19
+ function findDescriptorInForwardedRefs(refs, key) {
20
+ for (const ref of refs) {
21
+ const childRefs = ref.value && ref.value[FORWARD_REFS];
22
+ if (!childRefs) continue;
23
+ const queue = childRefs.slice();
24
+ while (queue.length) {
25
+ const ref2 = queue.shift();
26
+ const descriptor = getDescriptor(ref2.value, key);
27
+ if (descriptor) return descriptor;
28
+ const childRefs2 = ref2.value?.[FORWARD_REFS];
29
+ if (childRefs2) queue.push(...childRefs2);
30
+ }
31
+ }
32
+ return void 0;
33
+ }
2
34
  export function forwardRefs(target, ...refs) {
3
35
  target[FORWARD_REFS] = refs;
4
36
  return new Proxy(target, {
@@ -6,60 +38,32 @@ export function forwardRefs(target, ...refs) {
6
38
  if (Reflect.has(target2, key)) {
7
39
  return Reflect.get(target2, key);
8
40
  }
9
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return;
10
- for (const ref of refs) {
11
- if (ref.value && Reflect.has(ref.value, key)) {
12
- const val = Reflect.get(ref.value, key);
13
- return typeof val === "function" ? val.bind(ref.value) : val;
14
- }
15
- }
41
+ if (isInternalKey(key)) return;
42
+ const owner = findRefValueWith(refs, key);
43
+ if (!owner) return;
44
+ const val = Reflect.get(owner, key);
45
+ return typeof val === "function" ? val.bind(owner) : val;
16
46
  },
17
47
  has(target2, key) {
18
48
  if (Reflect.has(target2, key)) {
19
49
  return true;
20
50
  }
21
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return false;
22
- for (const ref of refs) {
23
- if (ref.value && Reflect.has(ref.value, key)) {
24
- return true;
25
- }
26
- }
27
- return false;
51
+ if (isInternalKey(key)) return false;
52
+ return findRefValueWith(refs, key) !== void 0;
28
53
  },
29
54
  set(target2, key, value) {
30
55
  if (Reflect.has(target2, key)) {
31
56
  return Reflect.set(target2, key, value);
32
57
  }
33
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return false;
34
- for (const ref of refs) {
35
- if (ref.value && Reflect.has(ref.value, key)) {
36
- return Reflect.set(ref.value, key, value);
37
- }
38
- }
39
- return false;
58
+ if (isInternalKey(key)) return false;
59
+ const owner = findRefValueWith(refs, key);
60
+ return owner ? Reflect.set(owner, key, value) : false;
40
61
  },
41
62
  getOwnPropertyDescriptor(target2, key) {
42
63
  const descriptor = Reflect.getOwnPropertyDescriptor(target2, key);
43
64
  if (descriptor) return descriptor;
44
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return;
45
- for (const ref of refs) {
46
- if (!ref.value) continue;
47
- const descriptor2 = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
48
- if (descriptor2) return descriptor2;
49
- }
50
- for (const ref of refs) {
51
- const childRefs = ref.value && ref.value[FORWARD_REFS];
52
- if (!childRefs) continue;
53
- const queue = childRefs.slice();
54
- while (queue.length) {
55
- const ref2 = queue.shift();
56
- const descriptor2 = getDescriptor(ref2.value, key);
57
- if (descriptor2) return descriptor2;
58
- const childRefs2 = ref2.value?.[FORWARD_REFS];
59
- if (childRefs2) queue.push(...childRefs2);
60
- }
61
- }
62
- return void 0;
65
+ if (isInternalKey(key)) return;
66
+ return findDescriptorInRefs(refs, key) ?? findDescriptorInForwardedRefs(refs, key);
63
67
  }
64
68
  });
65
69
  }
@@ -31,7 +31,7 @@ function getValues(items, ids) {
31
31
  const itemIndex = items.findIndex(item => item.id === id);
32
32
  if (~itemIndex) {
33
33
  const item = items[itemIndex];
34
- values.push(item.value != null ? item.value : itemIndex);
34
+ values.push(item.value ?? itemIndex);
35
35
  }
36
36
  });
37
37
  return values;
@@ -23,7 +23,7 @@ export function getValues(items, ids) {
23
23
  const itemIndex = items.findIndex((item) => item.id === id);
24
24
  if (~itemIndex) {
25
25
  const item = items[itemIndex];
26
- values.push(item.value != null ? item.value : itemIndex);
26
+ values.push(item.value ?? itemIndex);
27
27
  }
28
28
  });
29
29
  return values;
@@ -8,28 +8,23 @@ exports.splitKeyCombination = splitKeyCombination;
8
8
  exports.splitKeySequence = splitKeySequence;
9
9
  var _hotkey = require("../../consts/Commons/hotkey.const.cjs");
10
10
  var _console = require("./console.util.cjs");
11
- function splitKeyCombination(combination, isInternal = false) {
12
- if (!combination) {
13
- if (!isInternal) (0, _console.consoleWarn)("Invalid hotkey combination: empty string provided");
14
- return [];
15
- }
11
+ function hasInvalidCombinationStructure(combination) {
16
12
  const startsWithPlusOrUnderscore = combination.startsWith("+") || combination.startsWith("_");
17
13
  const hasInvalidLeadingSeparator =
18
14
  // Starts with a single '+' or '_' followed by a non-separator character (e.g. '+a', '_a')
19
15
  startsWithPlusOrUnderscore && !(combination.startsWith("++") || combination.startsWith("__"));
20
- const hasInvalidStructure =
21
- // Invalid leading separator patterns
22
- combination.length > 1 && hasInvalidLeadingSeparator ||
23
- // Disallow literal + or _ keys (they require shift)
24
- combination.includes("++") || combination.includes("__") || combination === "+" || combination === "_" ||
25
- // Ends with a separator that is not part of a doubled literal
26
- combination.length > 1 && (combination.endsWith("+") || combination.endsWith("_")) && combination.at(-2) !== combination.at(-1) ||
27
- // Stand-alone doubled separators (dangling)
28
- combination === "++" || combination === "--" || combination === "__";
29
- if (hasInvalidStructure) {
30
- if (!isInternal) (0, _console.consoleWarn)(`Invalid hotkey combination: "${combination}" has invalid structure`);
31
- return [];
32
- }
16
+ return (
17
+ // Invalid leading separator patterns
18
+ combination.length > 1 && hasInvalidLeadingSeparator ||
19
+ // Disallow literal + or _ keys (they require shift)
20
+ combination.includes("++") || combination.includes("__") || combination === "+" || combination === "_" ||
21
+ // Ends with a separator that is not part of a doubled literal
22
+ combination.length > 1 && (combination.endsWith("+") || combination.endsWith("_")) && combination.at(-2) !== combination.at(-1) ||
23
+ // Stand-alone doubled separators (dangling)
24
+ combination === "++" || combination === "--" || combination === "__"
25
+ );
26
+ }
27
+ function parseCombinationKeys(combination) {
33
28
  const keys = [];
34
29
  let buffer = "";
35
30
  const flushBuffer = () => {
@@ -41,74 +36,71 @@ function splitKeyCombination(combination, isInternal = false) {
41
36
  for (let i = 0; i < combination.length; i++) {
42
37
  const char = combination[i];
43
38
  const nextChar = combination[i + 1];
44
- if (char === "+" || char === "_" || char === "-") {
45
- if (char === nextChar) {
46
- flushBuffer();
47
- keys.push(char);
48
- i++;
49
- } else if (char === "+" || char === "_") {
50
- flushBuffer();
51
- } else {
52
- buffer += char;
53
- }
39
+ const isSeparator = char === "+" || char === "_" || char === "-";
40
+ if (isSeparator && char === nextChar) {
41
+ flushBuffer();
42
+ keys.push(char);
43
+ i++;
44
+ } else if (char === "+" || char === "_") {
45
+ flushBuffer();
54
46
  } else {
55
47
  buffer += char;
56
48
  }
57
49
  }
58
50
  flushBuffer();
59
- const hasInvalidMinus = keys.some(key => key.length > 1 && key.includes("-") && key !== "--");
60
- if (hasInvalidMinus) {
61
- if (!isInternal) (0, _console.consoleWarn)(`Invalid hotkey combination: "${combination}" has invalid structure`);
51
+ return keys;
52
+ }
53
+ function splitKeyCombination(combination, isInternal = false) {
54
+ if (!combination) {
55
+ if (!isInternal) (0, _console.consoleWarn)("Invalid hotkey combination: empty string provided");
62
56
  return [];
63
57
  }
58
+ const warnInvalidStructure = () => {
59
+ if (!isInternal) (0, _console.consoleWarn)(`Invalid hotkey combination: "${combination}" has invalid structure`);
60
+ return [];
61
+ };
62
+ if (hasInvalidCombinationStructure(combination)) return warnInvalidStructure();
63
+ const keys = parseCombinationKeys(combination);
64
+ const hasInvalidMinus = keys.some(key => key.length > 1 && key.includes("-") && key !== "--");
65
+ if (hasInvalidMinus) return warnInvalidStructure();
64
66
  if (keys.length === 0 && combination) {
65
67
  return [normalizeKey(combination)];
66
68
  }
67
69
  return keys;
68
70
  }
69
- function splitKeySequence(str) {
70
- if (!str) {
71
- (0, _console.consoleWarn)("Invalid hotkey sequence: empty string provided");
72
- return [];
73
- }
71
+ function hasInvalidSequenceEdges(str) {
74
72
  const hasInvalidStart = str.startsWith("-") && !["---", "--+"].includes(str);
75
73
  const hasInvalidEnd = str.endsWith("-") && !str.endsWith("+-") && !str.endsWith("_-") && str !== "-" && str !== "---";
76
- if (hasInvalidStart || hasInvalidEnd) {
77
- (0, _console.consoleWarn)(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
78
- return [];
79
- }
74
+ return hasInvalidStart || hasInvalidEnd;
75
+ }
76
+ function isHyphenInCombination(str, i) {
77
+ const prevChar = str[i - 1];
78
+ const prevPrevChar = i > 1 ? str[i - 2] : void 0;
79
+ return (prevChar === "+" || prevChar === "_") && prevPrevChar !== "+";
80
+ }
81
+ function tokenizeSequence(str) {
80
82
  const result = [];
81
83
  let buffer = "";
82
- let i = 0;
83
- while (i < str.length) {
84
+ for (let i = 0; i < str.length; i++) {
84
85
  const char = str[i];
85
- if (char === "-") {
86
- const prevChar = str[i - 1];
87
- const prevPrevChar = i > 1 ? str[i - 2] : void 0;
88
- const precededBySinglePlusOrUnderscore = (prevChar === "+" || prevChar === "_") && prevPrevChar !== "+";
89
- if (precededBySinglePlusOrUnderscore) {
90
- buffer += char;
91
- i++;
92
- } else {
93
- if (buffer) {
94
- result.push(buffer);
95
- buffer = "";
96
- } else {
97
- result.push("-");
98
- }
99
- i++;
100
- }
101
- } else {
86
+ if (char !== "-" || isHyphenInCombination(str, i)) {
102
87
  buffer += char;
103
- i++;
88
+ } else if (buffer) {
89
+ result.push(buffer);
90
+ buffer = "";
91
+ } else {
92
+ result.push("-");
104
93
  }
105
94
  }
106
95
  if (buffer) {
107
96
  result.push(buffer);
108
97
  }
98
+ return result;
99
+ }
100
+ function collapseMinusRuns(parts) {
109
101
  const collapsed = [];
110
102
  let minusCount = 0;
111
- for (const part of result) {
103
+ for (const part of parts) {
112
104
  if (part === "-") {
113
105
  if (minusCount % 2 === 0) collapsed.push("-");
114
106
  minusCount++;
@@ -117,6 +109,18 @@ function splitKeySequence(str) {
117
109
  collapsed.push(part);
118
110
  }
119
111
  }
112
+ return collapsed;
113
+ }
114
+ function splitKeySequence(str) {
115
+ if (!str) {
116
+ (0, _console.consoleWarn)("Invalid hotkey sequence: empty string provided");
117
+ return [];
118
+ }
119
+ if (hasInvalidSequenceEdges(str)) {
120
+ (0, _console.consoleWarn)(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
121
+ return [];
122
+ }
123
+ const collapsed = collapseMinusRuns(tokenizeSequence(str));
120
124
  const areAllValid = collapsed.every(s => splitKeyCombination(s, true).length > 0);
121
125
  if (!areAllValid) {
122
126
  (0, _console.consoleWarn)(`Invalid hotkey sequence: "${str}" contains invalid combinations`);