@ironsource/shared-ui 2.1.12-rc.4 → 2.1.12-rc.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 (301) hide show
  1. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_adb49e50_lang.css +1 -0
  2. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_0198fee8_lang.css +1 -0
  3. package/ButtonV4.vue_vue_type_style_index_0_scoped_852be7ec_lang.css +1 -0
  4. package/Chart.vue_vue_type_style_index_0_scoped_3da25a36_lang.css +1 -0
  5. package/ChartHeader.vue_vue_type_style_index_0_scoped_af520313_lang.css +1 -0
  6. package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_2f916aeb_lang.css +1 -0
  7. package/ChartLegend.vue_vue_type_style_index_0_scoped_6103d8bd_lang.css +1 -0
  8. package/ChartPlane.vue_vue_type_style_index_0_scoped_dd60ff0e_lang.css +1 -0
  9. package/ChartTooltip.vue_vue_type_style_index_0_scoped_3d0780bb_lang.css +1 -0
  10. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_38354f10_lang.css +1 -0
  11. package/ColumnPicker.vue_vue_type_style_index_0_scoped_ea8c7024_lang.css +1 -0
  12. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_f5204c04_lang.css +1 -0
  13. package/DataGrid.vue_vue_type_style_index_0_scoped_da7631e0_lang.css +1 -0
  14. package/DataGridHeader.vue_vue_type_style_index_0_scoped_840e700c_lang.css +1 -0
  15. package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_e38c881a_lang.css +1 -0
  16. package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
  17. package/DialogFooter.vue_vue_type_style_index_0_scoped_8b7f64fe_lang.css +1 -0
  18. package/DialogHeader.vue_vue_type_style_index_0_scoped_9a814ec3_lang.css +1 -0
  19. package/DialogV4.vue_vue_type_style_index_0_scoped_cc99f1e3_lang.css +1 -0
  20. package/DropdownV4.vue_vue_type_style_index_0_scoped_55dd36a7_lang.css +1 -0
  21. package/FieldLabel.vue_vue_type_style_index_0_scoped_921d4087_lang.css +1 -0
  22. package/FormRow.vue_vue_type_style_index_0_scoped_2d5a3057_lang.css +1 -0
  23. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
  24. package/Link.vue_vue_type_style_index_0_scoped_ad98fe7b_lang.css +1 -0
  25. package/MultipleDataGrid.vue_vue_type_style_index_0_scoped_3caa1d7b_lang.css +1 -0
  26. package/OptionChip.vue_vue_type_style_index_0_scoped_538e4a21_lang.css +1 -0
  27. package/OptionV4.vue_vue_type_style_index_0_scoped_752a357d_lang.css +1 -0
  28. package/RadioButton.vue_vue_type_style_index_0_scoped_dac25b9f_lang.css +1 -0
  29. package/RemoveButton.vue_vue_type_style_index_0_scoped_ca7fc11d_lang.css +1 -0
  30. package/SettingsHeader.vue_vue_type_style_index_0_scoped_01f78cd7_lang.css +1 -0
  31. package/SortableItem.vue_vue_type_style_index_0_scoped_800cd503_lang.css +1 -0
  32. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_a534c7af_lang.css +1 -0
  33. package/SortableList.vue_vue_type_style_index_0_scoped_84dc8525_lang.css +1 -0
  34. package/SubHeader.vue_vue_type_style_index_0_scoped_e6008b6c_lang.css +1 -0
  35. package/SwitchV4.vue_vue_type_style_index_0_scoped_cd6621a7_lang.css +1 -0
  36. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_2076b5ab_lang.css +1 -0
  37. package/Tooltip.vue_vue_type_style_index_0_scoped_20630944_lang.css +1 -0
  38. package/TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css +1 -0
  39. package/TooltipV4.vue_vue_type_style_index_0_scoped_8a451e54_lang.css +1 -0
  40. package/TooltipV4.vue_vue_type_style_index_1_lang.css +1 -1
  41. package/TreeDropdown.vue_vue_type_style_index_0_scoped_4ba9e4bd_lang.css +1 -0
  42. package/components/appIcon/index.d.ts +3 -3
  43. package/components/banner/Banner.vue.d.ts +3 -3
  44. package/components/banner/index.d.ts +7 -7
  45. package/components/button/common/consts.d.ts +1 -0
  46. package/components/button/v3/Button.vue.d.ts +3 -3
  47. package/components/button/v3/ButtonBase.vue.d.ts +3 -3
  48. package/components/button/v3/IconButton.vue.d.ts +3 -3
  49. package/components/button/v3/index.d.ts +14 -14
  50. package/components/button/v4/ButtonV4.vue.d.ts +5 -3
  51. package/components/button/v4/ButtonV4.vue.js +4 -4
  52. package/components/button/v4/ButtonV4.vue2.js +28 -27
  53. package/components/button/v4/ToggleButtonGroupAB.vue.js +3 -3
  54. package/components/button/v4/ToggleButtonGroupAB.vue2.js +40 -44
  55. package/components/chart/Chart.vue.d.ts +168 -37
  56. package/components/chart/Chart.vue.js +2 -2
  57. package/components/chart/Chart.vue2.js +154 -297
  58. package/components/chart/ChartHeader.vue.d.ts +50 -11
  59. package/components/chart/ChartHeader.vue.js +3 -3
  60. package/components/chart/ChartHeader.vue2.js +73 -54
  61. package/components/chart/ChartHeaderTrend.vue.d.ts +48 -0
  62. package/components/chart/ChartHeaderTrend.vue.js +7 -0
  63. package/components/chart/ChartHeaderTrend.vue2.js +97 -0
  64. package/components/chart/ChartLegend.vue.d.ts +24 -0
  65. package/components/chart/ChartLegend.vue.js +3 -3
  66. package/components/chart/ChartLegend.vue2.js +82 -63
  67. package/components/chart/ChartPlane.vue.d.ts +236 -0
  68. package/components/chart/ChartPlane.vue.js +7 -0
  69. package/components/chart/ChartPlane.vue2.js +381 -0
  70. package/components/chart/ChartStoryArgs.d.ts +196 -0
  71. package/components/chart/ChartTooltip.vue.d.ts +22 -2
  72. package/components/chart/ChartTooltip.vue.js +2 -2
  73. package/components/chart/ChartTooltip.vue2.js +51 -56
  74. package/components/chart/LegendSorting.vue.d.ts +37 -0
  75. package/components/chart/LegendSorting.vue.js +45 -0
  76. package/components/chart/LegendSorting.vue2.js +4 -0
  77. package/components/chart/SettingsHeader.vue.d.ts +1 -0
  78. package/components/chart/SettingsHeader.vue.js +3 -3
  79. package/components/chart/SettingsHeader.vue2.js +17 -16
  80. package/components/chart/SubHeader.vue.d.ts +52 -0
  81. package/components/chart/SubHeader.vue.js +7 -0
  82. package/components/chart/SubHeader.vue2.js +61 -0
  83. package/components/chart/TooltipHeader.vue.d.ts +50 -0
  84. package/components/chart/TooltipHeader.vue.js +7 -0
  85. package/components/chart/TooltipHeader.vue2.js +70 -0
  86. package/components/chart/colorPalette.d.ts +5 -0
  87. package/components/chart/colorPalette.js +68 -0
  88. package/components/chart/composables/useChartHeight.d.ts +5 -0
  89. package/components/chart/composables/useChartHeight.js +24 -0
  90. package/components/chart/composables/useColorsMap.d.ts +12 -0
  91. package/components/chart/composables/useColorsMap.js +48 -0
  92. package/components/chart/composables/useTooltipPosition.d.ts +1 -1
  93. package/components/chart/composables/useTooltipPosition.js +11 -15
  94. package/components/chart/consts.d.ts +33 -7
  95. package/components/chart/consts.js +46 -22
  96. package/components/chart/index.d.ts +592 -119
  97. package/components/chart/mockData.d.ts +59 -5
  98. package/components/chart/types.d.ts +39 -6
  99. package/components/chart/types.js +5 -2
  100. package/components/chart/utils/formatNumber.d.ts +0 -1
  101. package/components/chart/utils/highlightUtils.d.ts +3 -0
  102. package/components/chart/utils/highlightUtils.js +18 -0
  103. package/components/chart/utils/utils.d.ts +3 -3
  104. package/components/chart/utils/utils.js +25 -10
  105. package/components/checkbox/v3/Checkbox.vue.d.ts +3 -3
  106. package/components/checkbox/v3/index.d.ts +7 -7
  107. package/components/columnPicker/ColumnPicker.vue.d.ts +119 -0
  108. package/components/columnPicker/ColumnPicker.vue.js +7 -0
  109. package/components/columnPicker/ColumnPicker.vue2.js +322 -0
  110. package/components/columnPicker/OptionChip.vue.d.ts +53 -0
  111. package/components/columnPicker/OptionChip.vue.js +7 -0
  112. package/components/columnPicker/OptionChip.vue2.js +46 -0
  113. package/components/columnPicker/RemoveButton.vue.d.ts +38 -0
  114. package/components/columnPicker/RemoveButton.vue.js +7 -0
  115. package/components/columnPicker/RemoveButton.vue2.js +35 -0
  116. package/components/columnPicker/index.d.ts +388 -0
  117. package/components/columnPicker/index.js +6 -0
  118. package/components/columnPicker/mockData.d.ts +8 -0
  119. package/components/dateRange/common/DateRange.common.js +100 -94
  120. package/components/dateRange/common/DateServices.common.d.ts +7 -1
  121. package/components/dateRange/common/DateServices.common.js +88 -92
  122. package/components/dateRange/common/consts.common.d.ts +5 -0
  123. package/components/dateRange/common/consts.common.js +9 -3
  124. package/components/dateRange/v3/DateRange.vue.d.ts +3 -3
  125. package/components/dateRange/v3/DateRangePicker.vue.d.ts +3 -3
  126. package/components/dateRange/v3/index.d.ts +7 -7
  127. package/components/dateRange/v4/DateRangePickerV4.vue.d.ts +3 -3
  128. package/components/dateRange/v4/DateRangeV4.vue.d.ts +3 -3
  129. package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
  130. package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
  131. package/components/dateRange/v4/index.d.ts +7 -7
  132. package/components/dialog/v3/Dialog.vue.d.ts +3 -3
  133. package/components/dialog/v3/index.d.ts +46 -46
  134. package/components/dialog/v4/DialogFooter.vue.d.ts +78 -0
  135. package/components/dialog/v4/DialogFooter.vue.js +7 -0
  136. package/components/dialog/v4/DialogFooter.vue2.js +60 -0
  137. package/components/dialog/v4/DialogHeader.vue.d.ts +60 -0
  138. package/components/dialog/v4/DialogHeader.vue.js +7 -0
  139. package/components/dialog/v4/DialogHeader.vue2.js +58 -0
  140. package/components/dialog/v4/DialogV4.vue.d.ts +13 -12
  141. package/components/dialog/v4/DialogV4.vue.js +4 -4
  142. package/components/dialog/v4/DialogV4.vue2.js +65 -107
  143. package/components/dialog/v4/index.d.ts +164 -164
  144. package/components/dropdown/common/Dropdown.common.d.ts +1 -0
  145. package/components/dropdown/common/Dropdown.common.js +161 -149
  146. package/components/dropdown/v3/Dropdown.vue.d.ts +1 -1
  147. package/components/dropdown/v3/index.d.ts +20 -20
  148. package/components/dropdown/v4/ButtonDropdownTrigger.vue.d.ts +1 -0
  149. package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +3 -3
  150. package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +16 -13
  151. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
  152. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +1 -1
  153. package/components/dropdown/v4/ChipDropdownTrigger.vue.d.ts +5 -0
  154. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +3 -3
  155. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +64 -54
  156. package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +22 -9
  157. package/components/dropdown/v4/ConditionalDropdown.vue.js +3 -3
  158. package/components/dropdown/v4/ConditionalDropdown.vue2.js +144 -122
  159. package/components/dropdown/v4/DropdownV4.vue.d.ts +34 -1
  160. package/components/dropdown/v4/DropdownV4.vue.js +2 -2
  161. package/components/dropdown/v4/DropdownV4.vue2.js +241 -189
  162. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
  163. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
  164. package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
  165. package/components/dropdown/v4/OptionV4.vue.d.ts +23 -5
  166. package/components/dropdown/v4/OptionV4.vue.js +3 -3
  167. package/components/dropdown/v4/OptionV4.vue2.js +162 -117
  168. package/components/dropdown/v4/TreeDropdown.vue.d.ts +1 -1
  169. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  170. package/components/dropdown/v4/TreeDropdown.vue2.js +68 -73
  171. package/components/dropdown/v4/dropdownStoryArgs.d.ts +8 -0
  172. package/components/dropdown/v4/index.d.ts +701 -162
  173. package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
  174. package/components/emptyState/v4/index.d.ts +7 -7
  175. package/components/forms/FormRow.vue.d.ts +9 -2
  176. package/components/forms/FormRow.vue.js +3 -3
  177. package/components/forms/FormRow.vue2.js +25 -14
  178. package/components/forms/index.d.ts +25 -5
  179. package/components/includeExclude/IncludeExclude.vue.d.ts +1 -1
  180. package/components/includeExclude/IncludeExcludeDragDrop.vue.d.ts +1 -1
  181. package/components/includeExclude/index.d.ts +40 -40
  182. package/components/link/Link.vue.d.ts +70 -0
  183. package/components/link/Link.vue.js +7 -0
  184. package/components/link/Link.vue2.js +43 -0
  185. package/components/link/index.d.ts +201 -0
  186. package/components/link/index.js +6 -0
  187. package/components/radioButton/v3/RadioButton.vue.d.ts +5 -0
  188. package/components/radioButton/v3/RadioButton.vue.js +3 -3
  189. package/components/radioButton/v3/RadioButton.vue2.js +42 -39
  190. package/components/radioButton/v3/index.d.ts +20 -1
  191. package/components/search/v3/index.d.ts +3 -3
  192. package/components/shared/FieldLabel.vue.d.ts +19 -7
  193. package/components/shared/FieldLabel.vue.js +3 -3
  194. package/components/shared/FieldLabel.vue2.js +50 -37
  195. package/components/sortableList/SortableItem.vue.d.ts +17 -2
  196. package/components/sortableList/SortableItem.vue.js +3 -3
  197. package/components/sortableList/SortableItem.vue2.js +86 -70
  198. package/components/sortableList/SortableItemLabel.vue.js +3 -3
  199. package/components/sortableList/SortableItemLabel.vue2.js +26 -23
  200. package/components/sortableList/SortableList.types.d.ts +1 -0
  201. package/components/sortableList/SortableList.vue.d.ts +10 -0
  202. package/components/sortableList/SortableList.vue.js +3 -3
  203. package/components/sortableList/SortableList.vue2.js +104 -96
  204. package/components/sortableList/composables/useHoverEffect.js +1 -1
  205. package/components/sortableList/index.d.ts +39 -1
  206. package/components/switch/v4/SwitchV4.vue.d.ts +16 -0
  207. package/components/switch/v4/SwitchV4.vue.js +3 -3
  208. package/components/switch/v4/SwitchV4.vue2.js +39 -24
  209. package/components/switch/v4/index.d.ts +29 -0
  210. package/components/table/common/Table.common.d.ts +0 -1
  211. package/components/table/common/Table.common.js +38 -39
  212. package/components/table/common/Table.types.d.ts +2 -0
  213. package/components/table/common/consts.d.ts +1 -0
  214. package/components/table/common/consts.js +2 -1
  215. package/components/table/v4/DataGrid.vue.d.ts +18 -7
  216. package/components/table/v4/DataGrid.vue.js +3 -3
  217. package/components/table/v4/DataGrid.vue2.js +300 -250
  218. package/components/table/v4/DataGridHeader.vue.d.ts +85 -0
  219. package/components/table/v4/DataGridHeader.vue.js +7 -0
  220. package/components/table/v4/DataGridHeader.vue2.js +82 -0
  221. package/components/table/v4/DataGridRowsCounter.vue.js +3 -3
  222. package/components/table/v4/DataGridRowsCounter.vue2.js +12 -12
  223. package/components/table/v4/MultipleDataGrid.vue.d.ts +8 -7
  224. package/components/table/v4/MultipleDataGrid.vue.js +2 -2
  225. package/components/table/v4/MultipleDataGrid.vue2.js +91 -90
  226. package/components/table/v4/index.d.ts +575 -293
  227. package/components/table/v4/index.js +7 -4
  228. package/components/table/v4/storyUtils.d.ts +27 -0
  229. package/components/tabs/v3/Tabs.vue.d.ts +3 -3
  230. package/components/tabs/v3/index.d.ts +7 -7
  231. package/components/tooltip/common/Tooltip.types.d.ts +1 -0
  232. package/components/tooltip/v3/Tooltip.vue.d.ts +4 -4
  233. package/components/tooltip/v3/Tooltip.vue.js +2 -2
  234. package/components/tooltip/v3/Tooltip.vue2.js +1 -1
  235. package/components/tooltip/v3/index.d.ts +7 -7
  236. package/components/tooltip/v4/TooltipV4.vue.d.ts +9 -4
  237. package/components/tooltip/v4/TooltipV4.vue.js +2 -2
  238. package/components/tooltip/v4/TooltipV4.vue2.js +18 -17
  239. package/components/tooltip/v4/index.d.ts +27 -8
  240. package/components/typography/Text.vue.d.ts +3 -3
  241. package/components/typography/index.d.ts +7 -7
  242. package/composables/useDateService.d.ts +7 -0
  243. package/composables/useDateService.js +10 -0
  244. package/composables/useFormValidation.d.ts +1 -0
  245. package/composables/useFormValidation.js +32 -27
  246. package/composables/useFullPageHeight.d.ts +10 -0
  247. package/composables/useFullPageHeight.js +15 -0
  248. package/consts/common.d.ts +1 -0
  249. package/consts/common.js +4 -0
  250. package/consts/regex.d.ts +1 -0
  251. package/consts/regex.js +2 -1
  252. package/index.d.ts +4185 -2363
  253. package/index.js +148 -132
  254. package/mocks/apps.d.ts +1 -0
  255. package/mocks/optionsWithIcons.d.ts +2 -0
  256. package/package.json +13 -1
  257. package/testids/index.d.ts +8 -0
  258. package/testids/index.js +35 -33
  259. package/utils/date.d.ts +1 -0
  260. package/utils/date.js +9 -0
  261. package/utils/formatNumbers.d.ts +1 -1
  262. package/utils/formatNumbers.js +37 -7
  263. package/utils/index.js +7 -0
  264. package/utils/text.d.ts +3 -0
  265. package/utils/text.js +24 -5
  266. package/utils/totals.d.ts +5 -0
  267. package/utils/totals.js +9 -0
  268. package/utils/utils.d.ts +1 -0
  269. package/utils/utils.js +4 -0
  270. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_604dfc6f_lang.css +0 -1
  271. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_ea1c4589_lang.css +0 -1
  272. package/ButtonV4.vue_vue_type_style_index_0_scoped_bdfce3aa_lang.css +0 -1
  273. package/Chart.vue_vue_type_style_index_0_scoped_a641383a_lang.css +0 -1
  274. package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
  275. package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
  276. package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
  277. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_e43ac1c9_lang.css +0 -1
  278. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_96c7507e_lang.css +0 -1
  279. package/DataGrid.vue_vue_type_style_index_0_scoped_6b54ac22_lang.css +0 -1
  280. package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css +0 -1
  281. package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
  282. package/DialogV4.vue_vue_type_style_index_0_scoped_37da643b_lang.css +0 -1
  283. package/DropdownV4.vue_vue_type_style_index_0_scoped_d154c5da_lang.css +0 -1
  284. package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +0 -1
  285. package/FormRow.vue_vue_type_style_index_0_scoped_fc3897fd_lang.css +0 -1
  286. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
  287. package/MultipleDataGrid.vue_vue_type_style_index_0_scoped_020a9896_lang.css +0 -1
  288. package/OptionV4.vue_vue_type_style_index_0_scoped_1e8837dc_lang.css +0 -1
  289. package/RadioButton.vue_vue_type_style_index_0_scoped_3c6b715c_lang.css +0 -1
  290. package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
  291. package/SortableItem.vue_vue_type_style_index_0_scoped_48542664_lang.css +0 -1
  292. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_f2ced2f4_lang.css +0 -1
  293. package/SortableList.vue_vue_type_style_index_0_scoped_8f267f88_lang.css +0 -1
  294. package/SwitchV4.vue_vue_type_style_index_0_scoped_c2e356f5_lang.css +0 -1
  295. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_c81a7d3e_lang.css +0 -1
  296. package/Tooltip.vue_vue_type_style_index_0_scoped_9020a179_lang.css +0 -1
  297. package/TooltipV4.vue_vue_type_style_index_0_scoped_66eab856_lang.css +0 -1
  298. package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
  299. package/components/chart/composables/useChartValues.d.ts +0 -12
  300. package/components/chart/composables/useChartValues.js +0 -32
  301. package/components/chart/utils/formatNumber.js +0 -11
@@ -1,15 +1,15 @@
1
1
  import { onClickOutside as ie } from "@vueuse/core";
2
2
  import { useToggle as fe } from "../../../composables/useToggle.js";
3
- import { ref as r, computed as b, onMounted as ce, onBeforeMount as de, onUnmounted as ve, watch as Q } from "vue";
3
+ import { ref as r, computed as b, onMounted as de, onBeforeMount as ce, onUnmounted as ve, watch as Q } from "vue";
4
4
  import { min as me, addDays as ge, format as X } from "date-fns";
5
5
  import { presetsList as he, formatError as De, mandatoryValuesError as Me, navigatePrev as Z, navigateNext as V } from "./consts.common.js";
6
- import m from "./DateServices.common.js";
7
- const Te = (o, y) => {
8
- const N = r(null), c = r({ started: !1, date: null }), x = r(!1), _ = 2, S = r({ from: null, to: null }), s = r({}), g = r([]), k = r(null), f = r({}), T = r({}), w = r(!1), P = r(null), u = r(null), j = r("left"), p = r(null), O = r(null), E = r([]), K = r(null), [h] = fe({ initialValue: !1 }), q = r(null);
6
+ import d from "./DateServices.common.js";
7
+ const pe = (o, y) => {
8
+ const N = r(null), c = r({ started: !1, date: null }), x = r(!1), _ = 2, T = r({ from: null, to: null }), u = r({}), g = r([]), k = r(null), i = r({}), p = r({}), E = r(!1), w = r(null), s = r(null), j = r("left"), P = r(null), O = r(null), C = r([]), K = r(null), [D] = fe({ initialValue: !1 }), q = r(null);
9
9
  ie(q, () => {
10
- h.value = !1;
10
+ D.value = !1;
11
11
  });
12
- const L = (e, t) => {
12
+ const U = (e, t) => {
13
13
  const a = {
14
14
  weeks: [],
15
15
  days: {},
@@ -17,28 +17,28 @@ const Te = (o, y) => {
17
17
  year: t
18
18
  };
19
19
  let n, l;
20
- const d = new Date(t, e, 1).getDay();
21
- let v = 1;
22
- const i = /* @__PURE__ */ new Date();
23
- i.setHours(0, 0, 0, 0);
24
- const se = m.daysInMonth(e, t);
20
+ const v = new Date(t, e, 1).getDay();
21
+ let m = 1;
22
+ const f = d.getCurrentTimeUTC();
23
+ f.setHours(0, 0, 0, 0);
24
+ const ue = d.daysInMonth(e, t);
25
25
  for (let I = 0; I < 6; I++) {
26
26
  l = [];
27
27
  for (let H = 0; H < 7; H++)
28
- n = {}, I === 0 && d > 0 && H < d && (n.value = 0), v > se && (n.value = 0), !n.value && n.value !== 0 && (n.value = v, v += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), i < n.date ? n.isFuture = !0 : n.date.getTime() === i.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
28
+ n = {}, I === 0 && v > 0 && H < v && (n.value = 0), m > ue && (n.value = 0), !n.value && n.value !== 0 && (n.value = m, m += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), f < n.date ? n.isFuture = !0 : n.date.getTime() === f.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
29
29
  a.weeks.push(l);
30
30
  }
31
31
  return a;
32
- }, C = () => {
33
- let e = m.getCurrentTimeUTC();
34
- if (u.value && u.value.toEnd ? e = u.value.toEnd : o.range && o.range.to && (e = o.range.to), !s.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
35
- s.value = {}, g.value = [];
32
+ }, S = () => {
33
+ let e = d.getCurrentTimeUTC();
34
+ if (s.value && s.value.toEnd ? e = s.value.toEnd : o.range && o.range.to && (e = o.range.to), !u.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
35
+ u.value = {}, g.value = [];
36
36
  for (let t = 0; t < _; t++) {
37
37
  const a = new Date(e);
38
38
  a.setDate(1), a.setMonth(e.getMonth() - t);
39
39
  const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
40
- s.value[n] = {
41
- parsedMonth: L(
40
+ u.value[n] = {
41
+ parsedMonth: U(
42
42
  a.getMonth(),
43
43
  a.getFullYear()
44
44
  ),
@@ -47,74 +47,74 @@ const Te = (o, y) => {
47
47
  }
48
48
  }
49
49
  }, z = (e, t) => {
50
- P.value = e;
50
+ w.value = e;
51
51
  let a = e;
52
- e === "date" && (a = o.datePresetList), E.value = he[a], t && (u.value = {
52
+ e === "date" && (a = o.datePresetList), C.value = he[a], t && (s.value = {
53
53
  fromStart: null,
54
54
  fromEnd: null,
55
55
  toStart: null,
56
56
  toEnd: null
57
- }, S.value.from = "", S.value.to = "", c.value = { started: !1, date: null }, f.value = "custom"), y("rangeTypeChanged", P.value);
57
+ }, T.value.from = "", T.value.to = "", c.value = { started: !1, date: null }, i.value = "custom"), y("rangeTypeChanged", w.value);
58
58
  }, ee = (e) => {
59
- f.value = e.id, D(k.value[e.id].dates()), C();
60
- }, D = (e, t = !1) => {
59
+ i.value = e.id, M(k.value[e.id].dates()), S();
60
+ }, M = (e, t = !1) => {
61
61
  let a = e;
62
- return (!e || !e.from && !e.to) && (a = k.value[E.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null), w.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, w.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, w.value = !0, !1) : (u.value = R(a), S.value.from = X(
63
- u.value.fromStart,
62
+ return !e.from && !e.to && e.preset ? a = k.value[e.preset]?.dates() : (!e || !e.from && !e.to) && (a = k.value[C.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null), E.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, E.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, E.value = !0, !1) : (s.value = R(a), T.value.from = X(
63
+ s.value.fromStart,
64
64
  o.dateFormat
65
- ), S.value.to = X(u.value.toEnd, o.dateFormat), !0);
65
+ ), T.value.to = X(s.value.toEnd, o.dateFormat), !0);
66
66
  }, F = () => {
67
- f.value === "custom" ? p.value = m.getDateRangeString(u.value) : p.value = J.value, y("currentDateChanged", p.value);
67
+ i.value === "custom" ? P.value = d.getDateRangeString(s.value) : P.value = J.value, y("currentDateChanged", P.value);
68
68
  }, te = () => {
69
- if (u.value.fromStart == null || u.value.toEnd == null) {
70
- w.value = !0, O.value = Me;
69
+ if (s.value.fromStart == null || s.value.toEnd == null) {
70
+ E.value = !0, O.value = Me;
71
71
  return;
72
72
  }
73
- const e = m.getCurrentTimeUTC();
74
- u.value.toEnd > e && (u.value.toEnd = e), F(), T.value = f.value, y("rangeChanged", {
75
- from: u.value.fromStart,
76
- to: u.value.toEnd,
77
- preset: T.value
73
+ const e = d.getCurrentTimeUTC();
74
+ s.value.toEnd > e && (s.value.toEnd = e), F(), p.value = i.value, y("rangeChanged", {
75
+ from: s.value.fromStart,
76
+ to: s.value.toEnd,
77
+ preset: p.value
78
78
  }), W(!1);
79
79
  }, ae = (e, t) => e ? Z : t ? V : null, ne = (e) => {
80
80
  let t = null, a = null;
81
81
  const n = _ - 1;
82
- let l = "", M = null, d = null;
82
+ let l = "", h = null, v = null;
83
83
  switch (e) {
84
84
  case V:
85
- Object.keys(s.value).forEach((v) => {
86
- const i = s.value[v];
87
- i.order === 0 && (M = i), i.order === n ? (g.value.splice(
88
- g.value.indexOf(v),
85
+ Object.keys(u.value).forEach((m) => {
86
+ const f = u.value[m];
87
+ f.order === 0 && (h = f), f.order === n ? (g.value.splice(
88
+ g.value.indexOf(m),
89
89
  1
90
- ), delete s.value[v]) : i.order += 1;
91
- }), t = M.parsedMonth.month + 1, a = M.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, s.value[l] = {
92
- parsedMonth: L(t, a),
90
+ ), delete u.value[m]) : f.order += 1;
91
+ }), t = h.parsedMonth.month + 1, a = h.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
92
+ parsedMonth: U(t, a),
93
93
  order: 0
94
94
  }, g.value.push(l);
95
95
  break;
96
96
  case Z:
97
- Object.keys(s.value).forEach((v) => {
98
- const i = s.value[v];
99
- i.order === n && (d = i), i.order === 0 ? (g.value.splice(
100
- g.value.indexOf(v),
97
+ Object.keys(u.value).forEach((m) => {
98
+ const f = u.value[m];
99
+ f.order === n && (v = f), f.order === 0 ? (g.value.splice(
100
+ g.value.indexOf(m),
101
101
  1
102
- ), delete s.value[v]) : i.order -= 1;
103
- }), t = d.parsedMonth.month - 1, a = d.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, s.value[l] = {
104
- parsedMonth: L(t, a),
102
+ ), delete u.value[m]) : f.order -= 1;
103
+ }), t = v.parsedMonth.month - 1, a = v.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
104
+ parsedMonth: U(t, a),
105
105
  order: n
106
106
  }, g.value.unshift(l);
107
107
  break;
108
108
  }
109
109
  }, R = (e) => {
110
110
  let t;
111
- switch (P.value) {
111
+ switch (w.value) {
112
112
  case "week":
113
113
  t = {
114
- fromStart: m.getFirstDayOfWeek(e.from),
115
- fromEnd: m.getLastDayOfWeek(e.from),
116
- toStart: m.getFirstDayOfWeek(e.to),
117
- toEnd: m.getLastDayOfWeek(e.to)
114
+ fromStart: d.getFirstDayOfWeek(e.from),
115
+ fromEnd: d.getLastDayOfWeek(e.from),
116
+ toStart: d.getFirstDayOfWeek(e.to),
117
+ toEnd: d.getLastDayOfWeek(e.to)
118
118
  };
119
119
  break;
120
120
  case "month":
@@ -124,13 +124,13 @@ const Te = (o, y) => {
124
124
  e.from.getMonth(),
125
125
  1
126
126
  ),
127
- fromEnd: m.getLastDayOfMonth(e.from),
127
+ fromEnd: d.getLastDayOfMonth(e.from),
128
128
  toStart: new Date(
129
129
  e.to.getFullYear(),
130
130
  e.to.getMonth(),
131
131
  1
132
132
  ),
133
- toEnd: m.getLastDayOfMonth(e.to)
133
+ toEnd: d.getLastDayOfMonth(e.to)
134
134
  };
135
135
  break;
136
136
  case "date":
@@ -144,62 +144,68 @@ const Te = (o, y) => {
144
144
  break;
145
145
  }
146
146
  return t;
147
- }, U = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
147
+ }, L = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
148
148
  let t = !1;
149
+ if (!e.from && !e.to && e.preset) {
150
+ const l = C.value.find(
151
+ (h) => h.id === e.preset
152
+ );
153
+ i.value = l.id, t = !0;
154
+ }
149
155
  const a = {
150
156
  from: new Date(e.from),
151
157
  to: new Date(e.to)
152
158
  };
153
159
  a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
154
- const n = E.value.map((l) => l.id);
160
+ const n = C.value.map((l) => l.id);
155
161
  if (Object.keys(k.value).forEach((l) => {
156
- const M = k.value[l];
162
+ const h = k.value[l];
157
163
  if (l !== "custom" && !t && n.indexOf(l) !== -1) {
158
- const d = M.dates();
159
- d.from.setHours(0, 0, 0, 0), d.to.setHours(0, 0, 0, 0), U(d.from, a.from) && U(d.to, a.to) && (f.value = l, t = !0);
164
+ const v = h.dates();
165
+ v.from.setHours(0, 0, 0, 0), v.to.setHours(0, 0, 0, 0), L(v.from, a.from) && L(v.to, a.to) && (i.value = l, t = !0);
160
166
  }
161
167
  }), t) {
162
- const l = E.value.find(
163
- (M) => M.id === f.value
168
+ const l = C.value.find(
169
+ (h) => h.id === i.value
164
170
  );
165
171
  y("dateRangePresetNameChanged", l.name);
166
172
  } else
167
- y("dateRangePresetNameChanged", null), f.value = "custom";
168
- T.value = f.value;
173
+ y("dateRangePresetNameChanged", null), i.value = "custom";
174
+ p.value = i.value;
169
175
  }, A = (e, t, a) => {
170
176
  if (!c.value.started)
171
- f.value = "custom", c.value.started = !0, c.value.date = new Date(a, t, e.value), D(
177
+ i.value = "custom", c.value.started = !0, c.value.date = new Date(a, t, e.value), M(
172
178
  { from: c.value.date, to: c.value.date },
173
179
  !0
174
180
  );
175
181
  else {
176
182
  const n = new Date(a, t, e.value), l = c.value.date;
177
- c.value.started = !1, c.value.date = null, n < l ? A(e, t, a) : D({ from: l, to: n });
183
+ c.value.started = !1, c.value.date = null, n < l ? A(e, t, a) : M({ from: l, to: n });
178
184
  }
179
185
  }, B = () => {
180
186
  const e = N.value.offsetLeft;
181
187
  return window.innerWidth - e > 930 ? "left" : "right";
182
188
  }, W = (e = !0) => {
183
- h.value = !h.value, h.value ? (j.value = B(), D(o.range), C(), y("opened")) : (D(o.range), C(), f.value = T.value, e && y("dismissed"));
189
+ D.value = !D.value, D.value ? (j.value = B(), M(o.range), S(), y("opened")) : (M(o.range), S(), i.value = p.value, e && y("dismissed"));
184
190
  }, G = () => {
185
- h.value && W();
191
+ D.value && W();
186
192
  }, le = () => {
187
- k.value = m.getPresetsFunctions(o.includeToday), k.value.custom = {
193
+ k.value = d.getPresetsFunctions(o.includeToday), k.value.custom = {
188
194
  dates: () => o.range
189
195
  };
190
196
  }, oe = b(() => (g.value || []).reduce((e, t) => {
191
- const n = s.value[t].parsedMonth.weeks[s.value[t].parsedMonth.weeks.length - 1].filter(
197
+ const n = u.value[t].parsedMonth.weeks[u.value[t].parsedMonth.weeks.length - 1].filter(
192
198
  (l) => l.value !== 0
193
199
  ).length;
194
200
  return e && !n;
195
201
  }, !0)), Y = () => {
196
- o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), D(o.range), C(), F());
202
+ o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), M(o.range), S(), F());
197
203
  };
198
- ce(() => {
204
+ de(() => {
199
205
  Y();
200
- }), de(() => {
206
+ }), ce(() => {
201
207
  const e = (t) => {
202
- t.key === "Escape" && h.value && G();
208
+ t.key === "Escape" && D.value && G();
203
209
  };
204
210
  document.addEventListener("keyup", e), ve(() => {
205
211
  document.removeEventListener("keyup", e);
@@ -207,50 +213,50 @@ const Te = (o, y) => {
207
213
  }), Q(
208
214
  () => o.range,
209
215
  (e, t) => {
210
- e && e !== t && (x.value ? ($(e), D(e), F()) : Y());
216
+ e && e !== t && (x.value ? ($(e), M(e), F()) : Y());
211
217
  }
212
- ), Q(h, (e) => {
218
+ ), Q(D, (e) => {
213
219
  e || (c.value.started = !1);
214
220
  });
215
221
  const J = b(() => {
216
- const e = E.value.find(
217
- (t) => t.id === f.value
222
+ const e = C.value.find(
223
+ (t) => t.id === i.value
218
224
  );
219
225
  return e ? e.name : "";
220
- }), re = b(() => `datepicker${o.uniqueId}`), ue = b(() => {
226
+ }), re = b(() => `datepicker${o.uniqueId}`), se = b(() => {
221
227
  const e = [o.maxDate, K.value].filter((t) => t);
222
228
  return e.length ? me(e) : null;
223
229
  });
224
230
  return {
225
231
  datePicker: N,
226
232
  datePickerId: re,
227
- getMaxAllowedDate: ue,
233
+ getMaxAllowedDate: se,
228
234
  selectedPresetName: J,
229
- selectedPreset: f,
230
- displayError: w,
231
- rangeType: P,
232
- selectedRange: u,
235
+ selectedPreset: i,
236
+ displayError: E,
237
+ rangeType: w,
238
+ selectedRange: s,
233
239
  placement: j,
234
- currentDate: p,
240
+ currentDate: P,
235
241
  error: O,
236
- presets: E,
237
- isOpen: h,
242
+ presets: C,
243
+ isOpen: D,
238
244
  popup: q,
239
245
  selectionStart: c,
240
246
  initialized: x,
241
- textDates: S,
242
- currentMonths: s,
247
+ textDates: T,
248
+ currentMonths: u,
243
249
  displayedMonthsKeys: g,
244
- initMonths: C,
250
+ initMonths: S,
245
251
  changeType: z,
246
252
  presetChanged: ee,
247
- initRange: D,
253
+ initRange: M,
248
254
  setCurrentDate: F,
249
255
  apply: te,
250
256
  getNavigation: ae,
251
257
  navigationCallback: ne,
252
258
  getSelectedRangeByType: R,
253
- compareDates: U,
259
+ compareDates: L,
254
260
  determinePreset: $,
255
261
  selectionChanged: A,
256
262
  checkPlacement: B,
@@ -261,5 +267,5 @@ const Te = (o, y) => {
261
267
  };
262
268
  };
263
269
  export {
264
- Te as dateRangeCommon
270
+ pe as dateRangeCommon
265
271
  };
@@ -6,7 +6,7 @@ export type Day = {
6
6
  disabled?: boolean;
7
7
  };
8
8
  export type Week = Day[];
9
- declare class DateServices {
9
+ export declare class DateServices {
10
10
  getCurrentTimeUTC(): Date;
11
11
  daysInMonth(month: any, year: any): number;
12
12
  getDateRangeString(dateRange: any): string;
@@ -117,6 +117,12 @@ declare class DateServices {
117
117
  to?: Date;
118
118
  };
119
119
  };
120
+ last9months: {
121
+ dates(): {
122
+ from?: Date;
123
+ to?: Date;
124
+ };
125
+ };
120
126
  last12months: {
121
127
  dates(): {
122
128
  from?: Date;