@milaboratories/uikit 2.5.6 → 2.6.0

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.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/uikit@2.5.6 build /home/runner/_work/platforma/platforma/lib/ui/uikit
3
+ > @milaboratories/uikit@2.6.0 build /home/runner/_work/platforma/platforma/lib/ui/uikit
4
4
  > ts-builder build --target browser-lib --build-config ./build.browser-lib.config.js
5
5
 
6
6
  Building browser-lib project...
@@ -8,12 +8,12 @@ Using custom config: ./build.browser-lib.config.js
8
8
  ↳ vite.js build --config ./build.browser-lib.config.js --mode production
9
9
  vite v6.3.5 building for production...
10
10
  transforming...
11
- ✓ 727 modules transformed.
11
+ ✓ 728 modules transformed.
12
12
  rendering chunks...
13
13
 
14
14
  [vite:dts] Start generate declaration files...
15
15
  computing gzip size...
16
- [vite:dts] Declaration files built in 15514ms.
16
+ [vite:dts] Declaration files built in 6291ms.
17
17
 
18
18
  dist/components/PlTabs/Tab.vue2.js  0.09 kB │ gzip: 0.11 kB │ map: 0.09 kB
19
19
  dist/components/PlTooltip/global.js  0.10 kB │ gzip: 0.11 kB │ map: 0.22 kB
@@ -23,40 +23,40 @@ computing gzip size...
23
23
  dist/components/PlChip/PlChip.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
24
24
  dist/components/PlTabs/PlTabs.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
25
25
  dist/layout/PlGrid/PlGrid.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
26
- dist/components/PlFileDialog/Remote.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
27
26
  dist/components/DataTable/TdCell.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
28
27
  dist/components/DataTable/TrHead.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
29
28
  dist/components/DataTable/ThCell.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
30
29
  dist/components/DataTable/TrBody.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
30
+ dist/components/PlFileDialog/Remote.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
31
31
  dist/components/PlAlert/PlAlert.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
32
32
  dist/base/BtnBase.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
33
- dist/components/TabItem.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
33
+ dist/components/DataTable/TScroll.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
34
34
  dist/components/VScroll.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
35
35
  dist/components/HScroll.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
36
- dist/components/DataTable/TScroll.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
36
+ dist/components/TabItem.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
37
37
  dist/components/PlSplash/PlSplash.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
38
38
  dist/layout/PlSpacer/PlSpacer.vue2.js  0.10 kB │ gzip: 0.11 kB │ map: 0.10 kB
39
39
  dist/components/PlTooltip/PlTooltip.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
40
- dist/components/PlBtnLink/PlBtnLink.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
41
40
  dist/components/PlLogView/PlLogView.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
41
+ dist/components/PlBtnLink/PlBtnLink.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
42
42
  dist/components/Scrollable.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
43
+ dist/components/PlDropdown/PlDropdown.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
43
44
  dist/components/PlBtnGroup/PlBtnGroup.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
44
- dist/components/PlBtnSplit/PlBtnSplit.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
45
- dist/components/PlBtnGhost/PlBtnGhost.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
46
45
  dist/components/PlTextArea/PlTextArea.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
47
46
  dist/components/PlCheckbox/PlCheckbox.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
48
- dist/components/PlDropdown/PlDropdown.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
47
+ dist/components/PlBtnSplit/PlBtnSplit.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
48
+ dist/components/PlBtnGhost/PlBtnGhost.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
49
49
  dist/utils/DoubleContour.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.43 kB
50
- dist/components/PlDropdown/OptionList.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
51
50
  dist/components/InputRange.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
51
+ dist/components/PlDropdown/OptionList.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
52
52
  dist/components/SliderRange.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
53
53
  dist/components/PlAccordion/PlAccordion.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
54
- dist/components/PlBtnDanger/PlBtnDanger.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
55
- dist/components/PlBtnAccent/PlBtnAccent.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
56
- dist/layout/PlContainer/PlContainer.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
57
54
  dist/components/PlTextField/PlTextField.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
58
55
  dist/components/PlStatusTag/PlStatusTag.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
59
56
  dist/components/PlFileInput/PlFileInput.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
57
+ dist/components/PlBtnAccent/PlBtnAccent.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
58
+ dist/layout/PlContainer/PlContainer.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
59
+ dist/components/PlBtnDanger/PlBtnDanger.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
60
60
  dist/layout/PlBlockPage/PlBlockPage.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
61
61
  dist/components/DataTable/ColumnCaret.vue2.js  0.11 kB │ gzip: 0.11 kB │ map: 0.10 kB
62
62
  dist/components/PlBtnPrimary/PlBtnPrimary.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
@@ -64,30 +64,30 @@ computing gzip size...
64
64
  dist/utils/InnerBorder.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.34 kB
65
65
  dist/components/ThemeSwitcher.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
66
66
  dist/components/PlDialogModal/PlDialogModal.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
67
- dist/components/PlNumberField/PlNumberField.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
68
67
  dist/components/PlProgressBar/PlProgressBar.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
68
+ dist/components/PlNumberField/PlNumberField.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
69
69
  dist/components/PlDropdownRef/PlDropdownRef.vue2.js  0.11 kB │ gzip: 0.12 kB │ map: 0.10 kB
70
- dist/components/PlAutocomplete/PlAutocomplete.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
71
70
  dist/components/PlToggleSwitch/PlToggleSwitch.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
72
71
  dist/components/PlBtnSecondary/PlBtnSecondary.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
72
+ dist/components/PlAutocomplete/PlAutocomplete.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
73
+ dist/components/PlProgressCell/PlProgressCell.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
73
74
  dist/components/DataTable/TableComponent.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
74
75
  dist/components/PlDropdownLine/PlDropdownLine.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
75
- dist/components/PlProgressCell/PlProgressCell.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
76
76
  dist/components/PlCheckbox/PlCheckboxBase.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
77
77
  dist/components/PlDropdownLine/ResizableInput.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
78
78
  dist/components/ContextProvider.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
79
- dist/utils/DropdownOverlay/DropdownOverlay.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
80
79
  dist/components/PlConfirmDialog.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
80
+ dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
81
81
  dist/components/PlErrorBoundary/PlErrorBoundary.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
82
82
  dist/components/PlCheckboxGroup/PlCheckboxGroup.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
83
83
  dist/components/PlEditableTitle/PlEditableTitle.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
84
- dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
84
+ dist/utils/DropdownOverlay/DropdownOverlay.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
85
85
  dist/helpers/math.js  0.12 kB │ gzip: 0.13 kB │ map: 0.33 kB
86
86
  dist/components/DataTable/RowsCommandMenu.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
87
87
  dist/components/DropdownListItem.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
88
88
  dist/components/PlLoaderCircular/PlLoaderCircular.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
89
- dist/components/PlSlideModal/PlPureSlideModal.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
90
89
  dist/components/PlDropdownLegacy/PlDropdownLegacy.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
90
+ dist/components/PlSlideModal/PlPureSlideModal.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
91
91
  dist/components/SliderRangeTriple.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
92
92
  dist/components/DataTable/BaseCellComponent.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
93
93
  dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
@@ -128,8 +128,8 @@ computing gzip size...
128
128
  dist/assets/icons/icon-assets-min/24_arrow-down.svg.js  0.27 kB │ gzip: 0.24 kB │ map: 0.44 kB
129
129
  dist/assets/icons/icon-assets-min/16_add.svg.js  0.27 kB │ gzip: 0.23 kB │ map: 0.44 kB
130
130
  dist/components/PlRadio/PlRadio.vue.js  0.27 kB │ gzip: 0.21 kB │ map: 0.10 kB
131
- dist/assets/icons/icon-assets-min/24_linetype-longdash.svg.js  0.27 kB │ gzip: 0.23 kB │ map: 0.47 kB
132
131
  dist/components/PlChartStackedBar/Legends.vue.js  0.27 kB │ gzip: 0.21 kB │ map: 0.10 kB
132
+ dist/assets/icons/icon-assets-min/24_linetype-longdash.svg.js  0.27 kB │ gzip: 0.23 kB │ map: 0.47 kB
133
133
  dist/assets/icons/icon-assets-min/16_chevron-first.svg.js  0.28 kB │ gzip: 0.23 kB │ map: 0.45 kB
134
134
  dist/components/PlIcon16/PlIcon16.vue.js  0.28 kB │ gzip: 0.22 kB │ map: 0.10 kB
135
135
  dist/components/PlIcon24/PlIcon24.vue.js  0.28 kB │ gzip: 0.22 kB │ map: 0.10 kB
@@ -166,12 +166,12 @@ computing gzip size...
166
166
  dist/assets/icons/icon-assets-min/24_jump-link.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.46 kB
167
167
  dist/assets/icons/icon-assets-min/24_checkbox-intermediate.svg.js  0.30 kB │ gzip: 0.24 kB │ map: 0.53 kB
168
168
  dist/assets/icons/icon-assets-min/24_chevron-up.svg.js  0.30 kB │ gzip: 0.24 kB │ map: 0.48 kB
169
+ dist/components/PlElementList/utils.js  0.30 kB │ gzip: 0.23 kB │ map: 0.79 kB
169
170
  dist/assets/icons/icon-assets-min/16_close.svg.js  0.30 kB │ gzip: 0.24 kB │ map: 0.47 kB
170
171
  dist/assets/icons/icon-assets-min/24_chevron-down.svg.js  0.30 kB │ gzip: 0.24 kB │ map: 0.48 kB
171
172
  dist/assets/icons/icon-assets-min/24_linetype-dotdash.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.49 kB
172
173
  dist/assets/icons/icon-assets-min/24_menu.svg.js  0.30 kB │ gzip: 0.24 kB │ map: 0.46 kB
173
174
  dist/assets/icons/icon-assets-min/24_text-align-left.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.49 kB
174
- dist/components/PlElementList/utils.js  0.30 kB │ gzip: 0.23 kB │ map: 0.79 kB
175
175
  dist/assets/icons/icon-assets-min/24_arrow-link.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.48 kB
176
176
  dist/assets/icons/icon-assets-min/24_chevron-right.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.49 kB
177
177
  dist/assets/icons/icon-assets-min/16_arrow-link.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.48 kB
@@ -183,10 +183,10 @@ computing gzip size...
183
183
  dist/assets/icons/icon-assets-min/24_text-align-right.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.50 kB
184
184
  dist/assets/icons/icon-assets-min/16_checkmark.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.48 kB
185
185
  dist/components/PlChartStackedBar/PlChartStackedBar.vue.js  0.30 kB │ gzip: 0.22 kB │ map: 0.11 kB
186
- dist/assets/icons/icon-assets-min/16_arrow-up.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.48 kB
187
- dist/assets/icons/icon-assets-min/24_linetype-twodash.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.50 kB
188
186
  dist/components/PlChartStackedBar/StackedRowCompact.vue.js  0.30 kB │ gzip: 0.22 kB │ map: 0.11 kB
189
187
  dist/components/PlElementList/PlElementListItem.vue.js  0.30 kB │ gzip: 0.22 kB │ map: 0.11 kB
188
+ dist/assets/icons/icon-assets-min/16_arrow-up.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.48 kB
189
+ dist/assets/icons/icon-assets-min/24_linetype-twodash.svg.js  0.30 kB │ gzip: 0.25 kB │ map: 0.50 kB
190
190
  dist/assets/icons/icon-assets-min/24_checkmark.svg.js  0.31 kB │ gzip: 0.25 kB │ map: 0.49 kB
191
191
  dist/assets/icons/icon-assets-min/16_arrow-down.svg.js  0.31 kB │ gzip: 0.25 kB │ map: 0.49 kB
192
192
  dist/assets/icons/icon-assets-min/16_arrow-left.svg.js  0.31 kB │ gzip: 0.24 kB │ map: 0.49 kB
@@ -212,8 +212,8 @@ computing gzip size...
212
212
  dist/assets/icons/icon-assets-min/16_compare.svg.js  0.34 kB │ gzip: 0.26 kB │ map: 0.51 kB
213
213
  dist/assets/icons/icon-assets-min/16_jump-link.svg.js  0.34 kB │ gzip: 0.26 kB │ map: 0.52 kB
214
214
  dist/assets/icons/icon-assets-min/16_reverse.svg.js  0.34 kB │ gzip: 0.26 kB │ map: 0.51 kB
215
- dist/assets/icons/icon-assets-min/16_stop.svg.js  0.34 kB │ gzip: 0.25 kB │ map: 0.52 kB
216
215
  dist/components/DataTable/TrHead.vue.js  0.34 kB │ gzip: 0.27 kB │ map: 0.10 kB
216
+ dist/assets/icons/icon-assets-min/16_stop.svg.js  0.34 kB │ gzip: 0.25 kB │ map: 0.52 kB
217
217
  dist/assets/icons/icon-assets-min/24_expand-left.svg.js  0.35 kB │ gzip: 0.24 kB │ map: 0.53 kB
218
218
  dist/assets/icons/icon-assets-min/24_expand-right.svg.js  0.35 kB │ gzip: 0.25 kB │ map: 0.53 kB
219
219
  dist/assets/icons/icon-assets-min/24_restart.svg.js  0.35 kB │ gzip: 0.27 kB │ map: 0.52 kB
@@ -267,9 +267,9 @@ computing gzip size...
267
267
  dist/assets/icons/icon-assets-min/24_align-right.svg.js  0.43 kB │ gzip: 0.28 kB │ map: 0.61 kB
268
268
  dist/assets/icons/icon-assets-min/24_zoom-out.svg.js  0.43 kB │ gzip: 0.29 kB │ map: 0.63 kB
269
269
  dist/assets/icons/icon-assets-min/24_windows-collapse.svg.js  0.43 kB │ gzip: 0.30 kB │ map: 0.66 kB
270
+ dist/utils/InnerBorder.vue.js  0.43 kB │ gzip: 0.31 kB │ map: 0.42 kB
270
271
  dist/assets/icons/icon-assets-min/16_delete-circle.svg.js  0.43 kB │ gzip: 0.30 kB │ map: 0.62 kB
271
272
  dist/assets/icons/icon-assets-min/24_drag-vertical.svg.js  0.43 kB │ gzip: 0.31 kB │ map: 0.62 kB
272
- dist/utils/InnerBorder.vue.js  0.43 kB │ gzip: 0.31 kB │ map: 0.42 kB
273
273
  dist/assets/icons/icon-assets-min/16_zip.svg.js  0.43 kB │ gzip: 0.29 kB │ map: 0.60 kB
274
274
  dist/assets/icons/icon-assets-min/24_arrow-left-curved.svg.js  0.43 kB │ gzip: 0.31 kB │ map: 0.61 kB
275
275
  dist/assets/icons/icon-assets-min/24_drag-horizontal.svg.js  0.43 kB │ gzip: 0.32 kB │ map: 0.62 kB
@@ -350,8 +350,8 @@ computing gzip size...
350
350
  dist/assets/icons/icon-assets-min/16_settings.svg.js  0.56 kB │ gzip: 0.33 kB │ map: 0.74 kB
351
351
  dist/composition/useFormState.js  0.56 kB │ gzip: 0.32 kB │ map: 1.67 kB
352
352
  dist/assets/icons/icon-assets-min/24_frame-type-none.svg.js  0.56 kB │ gzip: 0.27 kB │ map: 0.75 kB
353
- dist/assets/icons/icon-assets-min/24_columns.svg.js  0.56 kB │ gzip: 0.33 kB │ map: 0.76 kB
354
353
  dist/components/DataTable/ColumnCaret.vue.js  0.56 kB │ gzip: 0.37 kB │ map: 0.78 kB
354
+ dist/assets/icons/icon-assets-min/24_columns.svg.js  0.56 kB │ gzip: 0.33 kB │ map: 0.76 kB
355
355
  dist/assets/icons/icon-assets-min/16_clipboard-copied.svg.js  0.56 kB │ gzip: 0.36 kB │ map: 0.76 kB
356
356
  dist/assets/icons/icon-assets-min/16_clipboard.svg.js  0.56 kB │ gzip: 0.34 kB │ map: 0.74 kB
357
357
  dist/assets/icons/icon-assets-min/24_file-doc-import.svg.js  0.56 kB │ gzip: 0.37 kB │ map: 0.77 kB
@@ -389,8 +389,8 @@ computing gzip size...
389
389
  dist/assets/icons/icon-assets-min/16_duplicate.svg.js  0.62 kB │ gzip: 0.39 kB │ map: 0.83 kB
390
390
  dist/assets/icons/icon-assets-min/24_bar-stacked.svg.js  0.62 kB │ gzip: 0.34 kB │ map: 0.83 kB
391
391
  dist/components/PlElementList/PlElementList.vue3.js  0.63 kB │ gzip: 0.41 kB │ map: 0.11 kB
392
- dist/assets/icons/icon-assets-min/24_file-doc-download.svg.js  0.63 kB │ gzip: 0.38 kB │ map: 0.85 kB
393
392
  dist/composition/useRipple.js  0.63 kB │ gzip: 0.40 kB │ map: 1.69 kB
393
+ dist/assets/icons/icon-assets-min/24_file-doc-download.svg.js  0.63 kB │ gzip: 0.38 kB │ map: 0.85 kB
394
394
  dist/assets/icons/icon-assets-min/24_axes.svg.js  0.63 kB │ gzip: 0.37 kB │ map: 0.81 kB
395
395
  dist/assets/icons/icon-assets-min/24_clipboard.svg.js  0.63 kB │ gzip: 0.37 kB │ map: 0.84 kB
396
396
  dist/assets/icons/icon-assets-min/24_connected-points.svg.js  0.63 kB │ gzip: 0.37 kB │ map: 0.83 kB
@@ -464,8 +464,8 @@ computing gzip size...
464
464
  dist/assets/icons/icon-assets-min/24_view-show.svg.js  0.93 kB │ gzip: 0.55 kB │ map: 1.11 kB
465
465
  dist/assets/icons/icon-assets-min/24_theme-dark.svg.js  0.94 kB │ gzip: 0.48 kB │ map: 1.12 kB
466
466
  dist/layout/PlRow/PlRow.vue.js  0.94 kB │ gzip: 0.56 kB │ map: 0.61 kB
467
- dist/components/PlIcon24/PlIcon24.vue2.js  0.95 kB │ gzip: 0.51 kB │ map: 2.26 kB
468
467
  dist/components/PlIcon16/PlIcon16.vue2.js  0.95 kB │ gzip: 0.51 kB │ map: 1.55 kB
468
+ dist/components/PlIcon24/PlIcon24.vue2.js  0.95 kB │ gzip: 0.51 kB │ map: 2.26 kB
469
469
  dist/assets/icons/icon-assets-min/24_dendrogram-X-line.svg.js  0.95 kB │ gzip: 0.39 kB │ map: 1.24 kB
470
470
  dist/components/PlAccordion/PlAccordionSection.vue3.js  0.95 kB │ gzip: 0.53 kB │ map: 0.11 kB
471
471
  dist/components/DataTable/composition/useTableColumns.js  0.97 kB │ gzip: 0.53 kB │ map: 2.87 kB
@@ -597,6 +597,7 @@ computing gzip size...
597
597
  dist/components/PlElementList/PlElementListItem.vue3.js  3.80 kB │ gzip: 1.36 kB │ map: 0.12 kB
598
598
  dist/components/PlElementList/PlElementListItem.vue2.js  3.80 kB │ gzip: 1.15 kB │ map: 6.59 kB
599
599
  dist/components/PlChip/PlChip.vue.js  4.06 kB │ gzip: 1.63 kB │ map: 1.35 kB
600
+ dist/composition/usePollingQuery.js  4.13 kB │ gzip: 1.57 kB │ map: 19.03 kB
600
601
  dist/components/PlBtnGhost/PlBtnGhost.vue.js  4.35 kB │ gzip: 1.66 kB │ map: 2.38 kB
601
602
  dist/assets/icons/icon-assets-min/24_heatmap.svg.js  4.38 kB │ gzip: 0.99 kB │ map: 4.68 kB
602
603
  dist/composition/useSortable2.js  4.41 kB │ gzip: 1.50 kB │ map: 13.08 kB
@@ -629,8 +630,8 @@ computing gzip size...
629
630
  dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js  18.36 kB │ gzip: 5.09 kB │ map: 17.29 kB
630
631
  dist/components/PlSvg/PlSvg.vue2.js  39.45 kB │ gzip: 3.37 kB │ map: 12.06 kB
631
632
  dist/components/PlFileDialog/pl-file-dialog.module.scss.js  47.68 kB │ gzip: 16.33 kB │ map: 0.13 kB
632
- dist/index.js 502.31 kB │ gzip: 192.47 kB │ map: 5.79 kB
633
+ dist/index.js 502.40 kB │ gzip: 192.50 kB │ map: 5.86 kB
633
634
  dist/components/PlSlideModal/PlPureSlideModal.vue.js 604.73 kB │ gzip: 205.03 kB │ map: 2.25 kB
634
635
  dist/components/DataTable/TableComponent.vue.js 606.57 kB │ gzip: 205.92 kB │ map: 4.86 kB
635
- ✓ built in 23.21s
636
+ ✓ built in 9.80s
636
637
  Build completed successfully
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/uikit@2.5.6 type-check /home/runner/_work/platforma/platforma/lib/ui/uikit
3
+ > @milaboratories/uikit@2.6.0 type-check /home/runner/_work/platforma/platforma/lib/ui/uikit
4
4
  > ts-builder types --target browser-lib
5
5
 
6
6
  ↳ vue-tsc.js --noEmit --project ./tsconfig.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @milaboratories/uikit
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1e9b8da: Implement the `usePollingQuery` composable with abort-aware polling, state tracking, and comprehensive test coverage mirroring upstream interval behaviour.
8
+
9
+ ## 2.5.7
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [17e5fe7]
14
+ - @platforma-sdk/model@1.45.30
15
+
3
16
  ## 2.5.6
4
17
 
5
18
  ### Patch Changes
@@ -0,0 +1,27 @@
1
+ import { defineComponent as n, createBlock as r, openBlock as a, Transition as s, withCtx as p, renderSlot as c } from "vue";
2
+ const f = /* @__PURE__ */ n({
3
+ __name: "ExpandTransition",
4
+ setup(l) {
5
+ const t = (e) => {
6
+ e.classList.add("expand-collapse-fix"), e.style.setProperty("--component-height", e.scrollHeight + "px");
7
+ }, o = (e) => {
8
+ e.style.removeProperty("--component-height"), e.classList.remove("expand-collapse-fix");
9
+ };
10
+ return (e, i) => (a(), r(s, {
11
+ name: "expand-collapse",
12
+ onEnter: t,
13
+ onLeave: t,
14
+ onAfterEnter: o,
15
+ onAfterLeave: o
16
+ }, {
17
+ default: p(() => [
18
+ c(e.$slots, "default")
19
+ ]),
20
+ _: 3
21
+ }));
22
+ }
23
+ });
24
+ export {
25
+ f as default
26
+ };
27
+ //# sourceMappingURL=ExpandTransition.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandTransition.vue.js","sources":["../../../src/components/PlAccordion/ExpandTransition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nconst onStart = (el: Element) => {\n el.classList.add('expand-collapse-fix');\n (el as HTMLElement).style.setProperty('--component-height', el.scrollHeight + 'px');\n};\n\nconst onAfter = (el: Element) => {\n (el as HTMLElement).style.removeProperty('--component-height');\n el.classList.remove('expand-collapse-fix');\n};\n</script>\n\n<template>\n <Transition name=\"expand-collapse\" @enter=\"onStart\" @leave=\"onStart\" @after-enter=\"onAfter\" @after-leave=\"onAfter\">\n <slot/>\n </Transition>\n</template>\n\n<style>\n.expand-collapse-fix {\n overflow: hidden;\n}\n\n.expand-collapse-enter-active,\n.expand-collapse-leave-active {\n transition:\n height 0.2s ease-in-out,\n opacity 0.2s ease-in-out;\n height: var(--component-height);\n}\n\n.expand-collapse-enter-from,\n.expand-collapse-leave-to {\n opacity: 0.5;\n height: 0;\n}\n</style>\n"],"names":["onStart","el","onAfter"],"mappings":";;;;AACA,UAAMA,IAAU,CAACC,MAAgB;AAC/B,MAAAA,EAAG,UAAU,IAAI,qBAAqB,GACrCA,EAAmB,MAAM,YAAY,sBAAsBA,EAAG,eAAe,IAAI;AAAA,IACpF,GAEMC,IAAU,CAACD,MAAgB;AAC9B,MAAAA,EAAmB,MAAM,eAAe,oBAAoB,GAC7DA,EAAG,UAAU,OAAO,qBAAqB;AAAA,IAC3C;;;;;;;;;;;;;;;"}
@@ -0,0 +1,121 @@
1
+ import { MaybeRef, WatchSource } from 'vue';
2
+ /**
3
+ * Repeatedly executes an asynchronous query while tracking arguments, state transitions,
4
+ * and result freshness.
5
+ *
6
+ * @remarks
7
+ *
8
+ * ### Typical usage
9
+ *
10
+ * ```ts
11
+ * const args = ref({ id: 'item-1' });
12
+ * const { data, pause, resume, lastError } = usePollingQuery(args, fetchItem, {
13
+ * minInterval: 5_000,
14
+ * minDelay: 250,
15
+ * });
16
+ * ```
17
+ *
18
+ * The composable polls `fetchItem` while `resume()`d. Whenever the `args` ref changes the current
19
+ * request is aborted, the status becomes `'stale'`, and a new poll is scheduled after the optional
20
+ * debounce period and the configured timing constraints. Results from older requests are ignored
21
+ * through version tracking, ensuring consumers only observe the freshest payload.
22
+ *
23
+ * ### Timing behaviour
24
+ *
25
+ * - `minInterval` defines the minimum duration between the start times of consecutive polls.
26
+ * - `minDelay` (optional) enforces a minimum wait time between a poll finishing and the next poll starting.
27
+ * - After each poll completes, the next poll is scheduled `max(minInterval - elapsed, minDelay)` ms later.
28
+ * - When arguments change, the next poll still respects both constraints while also honouring the debounce.
29
+ *
30
+ * ### Abort handling
31
+ *
32
+ * Each poll receives a dedicated `AbortSignal`. The signal is aborted when pausing, disposing
33
+ * the scope, or when the arguments ref changes. Queries should surface aborts by listening to
34
+ * the signal. Aborted requests may settle later; outdated results are discarded via version checks.
35
+ *
36
+ * ### Pause, resume, and callback control
37
+ *
38
+ * - `pause()` stops future polls, clears pending timeouts, and aborts in-flight requests.
39
+ * - `resume()` is idempotent; it reactivates polling only when currently inactive.
40
+ * - The callback receives a bound `pause()` helper for conditional pausing.
41
+ *
42
+ * ### Error handling
43
+ *
44
+ * Errors bubble into `lastError`; they reset on the next successful poll or when `resume()`
45
+ * transitions from inactive to active. With `pauseOnError: true` the composable pauses automatically.
46
+ *
47
+ * ### Argument tracking
48
+ *
49
+ * - Initial state is `{ status: 'idle' }`.
50
+ * - Argument changes mark the status `'stale'` when a prior result exists; otherwise it stays `'idle'`.
51
+ * - A successful poll for the latest arguments marks the status `'synced'` and updates `value`.
52
+ *
53
+ * ### Request versioning and concurrency
54
+ *
55
+ * Each poll increments an internal version counter. Only the latest version updates shared state,
56
+ * preventing stale results from overwriting fresh data. `maxInFlightRequests` limits concurrent
57
+ * polls; values > 1 allow the next poll to begin even if aborted requests are still settling, while
58
+ * still capping total concurrency to protect upstream services.
59
+ *
60
+ * ### Debouncing
61
+ *
62
+ * Use `debounce` to accumulate rapid argument changes. The status still transitions to `'stale'`
63
+ * immediately, all running polls are aborted, and the new poll waits for the debounce window
64
+ * (and the timing constraints) before executing.
65
+ *
66
+ * ### Options
67
+ *
68
+ * - `minInterval` — required; must be positive. Zero or negative disables polling (`resume()` no-op). Accepts refs.
69
+ * - `minDelay` — optional delay after completion before the next poll may start. Accepts refs.
70
+ * - `autoStart` — start in active mode (default `true`).
71
+ * - `triggerOnResume` — run the callback immediately on `resume()` (default `false`).
72
+ * - `pauseOnError` — automatically pauses when the callback throws (default `false`).
73
+ * - `maxInFlightRequests` — maximum concurrent polls (default `1`).
74
+ * - `debounce` — debounce window for argument changes in milliseconds (default `0`).
75
+ *
76
+ * ### Returns
77
+ *
78
+ * - `data` — readonly ref of `{ status, value }`.
79
+ * - `lastError` — readonly ref of the latest error (or `null`).
80
+ * - `isActive` — readonly ref indicating active polling.
81
+ * - `inFlightCount` — readonly ref with the number of active requests.
82
+ * - `pause()` and `resume()` controls.
83
+ *
84
+ * @typeParam Args - Arguments shape passed to the polling callback.
85
+ * @typeParam Result - Result type produced by the polling callback.
86
+ */
87
+ export declare function usePollingQuery<Args, Result>(args: WatchSource<Args>, queryFn: (args: Args, options: {
88
+ signal: AbortSignal;
89
+ pause: () => void;
90
+ }) => Promise<Result>, options: {
91
+ minInterval: MaybeRef<number>;
92
+ minDelay?: MaybeRef<number | undefined>;
93
+ autoStart?: boolean;
94
+ triggerOnResume?: boolean;
95
+ pauseOnError?: boolean;
96
+ maxInFlightRequests?: number;
97
+ debounce?: number;
98
+ }): {
99
+ data: Readonly<import('vue').Ref<{
100
+ readonly status: "idle";
101
+ } | {
102
+ readonly status: "synced";
103
+ readonly value: import('vue').DeepReadonly<Result>;
104
+ } | {
105
+ readonly status: "stale";
106
+ readonly value: import('vue').DeepReadonly<Result>;
107
+ }, {
108
+ readonly status: "idle";
109
+ } | {
110
+ readonly status: "synced";
111
+ readonly value: import('vue').DeepReadonly<Result>;
112
+ } | {
113
+ readonly status: "stale";
114
+ readonly value: import('vue').DeepReadonly<Result>;
115
+ }>>;
116
+ lastError: Readonly<import('vue').Ref<Error | null, Error | null>>;
117
+ isActive: Readonly<import('vue').Ref<boolean, boolean>>;
118
+ inFlightCount: Readonly<import('vue').Ref<number, number>>;
119
+ pause: () => void;
120
+ resume: () => void;
121
+ };
@@ -0,0 +1,137 @@
1
+ import { shallowRef as ee, ref as O, onScopeDispose as te, watch as ne, readonly as M, toValue as Q } from "vue";
2
+ function ae(l) {
3
+ return l instanceof Error ? l : new Error(typeof l == "string" ? l : JSON.stringify(l));
4
+ }
5
+ function re(l, W, r) {
6
+ const a = {
7
+ minInterval: r.minInterval,
8
+ minDelay: r.minDelay ?? 0,
9
+ autoStart: r.autoStart ?? !0,
10
+ triggerOnResume: r.triggerOnResume ?? !1,
11
+ pauseOnError: r.pauseOnError ?? !1,
12
+ maxInFlightRequests: Math.max(1, r.maxInFlightRequests ?? 1),
13
+ debounce: Math.max(0, r.debounce ?? 0)
14
+ }, p = () => Math.max(0, Q(a.minInterval)), j = () => {
15
+ const e = a.minDelay === void 0 ? void 0 : Q(a.minDelay);
16
+ return Math.max(0, e ?? 0);
17
+ }, u = () => p() > 0, i = ee({ status: "idle" }), w = O(null), t = O(!1);
18
+ let E = 0, S = 0;
19
+ const h = O(0);
20
+ let c = !1, o = null, d = null, f = 0, m = 0;
21
+ const A = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), g = [];
22
+ let q, y = !1;
23
+ const z = (e) => {
24
+ q = e, y = !0;
25
+ }, G = () => {
26
+ if (i.value.status === "synced" || i.value.status === "stale") {
27
+ const { value: e } = i.value;
28
+ i.value = { status: "stale", value: e };
29
+ }
30
+ }, V = () => {
31
+ if (g.length === 0) return;
32
+ const e = g.shift();
33
+ e == null || e.resolve();
34
+ }, H = async () => {
35
+ h.value < a.maxInFlightRequests || await new Promise((e) => {
36
+ g.push({ resolve: e });
37
+ });
38
+ }, k = () => {
39
+ o !== null && (clearTimeout(o), o = null);
40
+ }, R = () => {
41
+ d !== null && (clearTimeout(d), d = null);
42
+ }, T = (e) => {
43
+ A.forEach((n, s) => {
44
+ n.signal.aborted || (I.set(s, e), n.abort());
45
+ });
46
+ }, K = (e = 0) => {
47
+ const n = Date.now(), s = Math.max(f, m), F = s > n ? s - n : 0;
48
+ return Math.max(0, e, F);
49
+ }, D = (e = 0, n = "normal") => {
50
+ if (!t.value || !u() || c) return;
51
+ const s = K(e);
52
+ o !== null && clearTimeout(o), o = setTimeout(() => {
53
+ o = null, L(n);
54
+ }, s);
55
+ }, L = async (e) => {
56
+ if (!t.value || c || !u()) return;
57
+ const n = Date.now(), s = Math.max(f, m);
58
+ if (n < s) {
59
+ D(s - n, e);
60
+ return;
61
+ }
62
+ if (!y) return;
63
+ const F = q, X = S;
64
+ if (await H(), !t.value || c || !u()) {
65
+ V();
66
+ return;
67
+ }
68
+ const b = new AbortController(), v = ++E;
69
+ A.set(v, b), h.value += 1;
70
+ const Y = p(), Z = Date.now();
71
+ f = Math.max(f, Z + Y);
72
+ let J = !1;
73
+ const _ = () => {
74
+ J || (J = !0, C());
75
+ };
76
+ try {
77
+ const x = await W(F, { signal: b.signal, pause: _ });
78
+ b.signal.aborted || v === E && X === S && (w.value = null, i.value = { status: "synced", value: x });
79
+ } catch (x) {
80
+ b.signal.aborted || (v === E && (w.value = ae(x)), a.pauseOnError && C());
81
+ } finally {
82
+ const x = j(), $ = Date.now();
83
+ m = Math.max(m, $ + x), A.delete(v), h.value = Math.max(0, h.value - 1), V();
84
+ const N = I.get(v);
85
+ N && I.delete(v), t.value && !c && N !== "args" && D();
86
+ }
87
+ }, P = (e = "external") => {
88
+ !t.value || c || !u() || D(0, e);
89
+ }, U = () => {
90
+ if (S += 1, G(), T("args"), !t.value || !u())
91
+ return;
92
+ const e = () => {
93
+ P(
94
+ "external"
95
+ /* External */
96
+ );
97
+ };
98
+ a.debounce > 0 ? (R(), d = setTimeout(() => {
99
+ d = null, e();
100
+ }, a.debounce)) : e();
101
+ }, C = () => {
102
+ t.value && (t.value = !1, k(), R(), T("pause"), f = Date.now(), m = Date.now());
103
+ }, B = () => {
104
+ if (!u() || t.value || !y) return;
105
+ t.value = !0, w.value = null;
106
+ const e = Date.now();
107
+ f = e, m = e, a.triggerOnResume ? P(
108
+ "external"
109
+ /* External */
110
+ ) : D(
111
+ p(),
112
+ "external"
113
+ /* External */
114
+ );
115
+ };
116
+ return te(() => {
117
+ c = !0, k(), R(), T("dispose"), t.value = !1, g.splice(0, g.length).forEach(({ resolve: e }) => e());
118
+ }), ne(
119
+ l,
120
+ (e) => {
121
+ const n = !y;
122
+ z(e), !n && U();
123
+ },
124
+ { flush: "sync", immediate: !0 }
125
+ ), a.autoStart && u() && B(), {
126
+ data: M(i),
127
+ lastError: M(w),
128
+ isActive: M(t),
129
+ inFlightCount: M(h),
130
+ pause: C,
131
+ resume: B
132
+ };
133
+ }
134
+ export {
135
+ re as usePollingQuery
136
+ };
137
+ //# sourceMappingURL=usePollingQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePollingQuery.js","sources":["../../src/composition/usePollingQuery.ts"],"sourcesContent":["import type { MaybeRef, WatchSource } from 'vue';\nimport { onScopeDispose, readonly, ref, shallowRef, toValue, watch } from 'vue';\n\ntype AbortReason = 'args' | 'pause' | 'dispose';\n\ntype PollingData<Result> =\n | { status: 'idle' }\n | { status: 'synced'; value: Result }\n | { status: 'stale'; value: Result };\n\ninterface InternalOptions {\n minInterval: MaybeRef<number>;\n minDelay: MaybeRef<number | undefined>;\n autoStart: boolean;\n triggerOnResume: boolean;\n pauseOnError: boolean;\n maxInFlightRequests: number;\n debounce: number;\n}\n\ninterface Waiter {\n resolve: () => void;\n}\n\nconst enum ScheduleSource {\n Normal = 'normal',\n External = 'external',\n}\n\nfunction toError(error: unknown): Error {\n if (error instanceof Error) return error;\n return new Error(typeof error === 'string' ? error : JSON.stringify(error));\n}\n\n/**\n * Repeatedly executes an asynchronous query while tracking arguments, state transitions,\n * and result freshness.\n *\n * @remarks\n *\n * ### Typical usage\n *\n * ```ts\n * const args = ref({ id: 'item-1' });\n * const { data, pause, resume, lastError } = usePollingQuery(args, fetchItem, {\n * minInterval: 5_000,\n * minDelay: 250,\n * });\n * ```\n *\n * The composable polls `fetchItem` while `resume()`d. Whenever the `args` ref changes the current\n * request is aborted, the status becomes `'stale'`, and a new poll is scheduled after the optional\n * debounce period and the configured timing constraints. Results from older requests are ignored\n * through version tracking, ensuring consumers only observe the freshest payload.\n *\n * ### Timing behaviour\n *\n * - `minInterval` defines the minimum duration between the start times of consecutive polls.\n * - `minDelay` (optional) enforces a minimum wait time between a poll finishing and the next poll starting.\n * - After each poll completes, the next poll is scheduled `max(minInterval - elapsed, minDelay)` ms later.\n * - When arguments change, the next poll still respects both constraints while also honouring the debounce.\n *\n * ### Abort handling\n *\n * Each poll receives a dedicated `AbortSignal`. The signal is aborted when pausing, disposing\n * the scope, or when the arguments ref changes. Queries should surface aborts by listening to\n * the signal. Aborted requests may settle later; outdated results are discarded via version checks.\n *\n * ### Pause, resume, and callback control\n *\n * - `pause()` stops future polls, clears pending timeouts, and aborts in-flight requests.\n * - `resume()` is idempotent; it reactivates polling only when currently inactive.\n * - The callback receives a bound `pause()` helper for conditional pausing.\n *\n * ### Error handling\n *\n * Errors bubble into `lastError`; they reset on the next successful poll or when `resume()`\n * transitions from inactive to active. With `pauseOnError: true` the composable pauses automatically.\n *\n * ### Argument tracking\n *\n * - Initial state is `{ status: 'idle' }`.\n * - Argument changes mark the status `'stale'` when a prior result exists; otherwise it stays `'idle'`.\n * - A successful poll for the latest arguments marks the status `'synced'` and updates `value`.\n *\n * ### Request versioning and concurrency\n *\n * Each poll increments an internal version counter. Only the latest version updates shared state,\n * preventing stale results from overwriting fresh data. `maxInFlightRequests` limits concurrent\n * polls; values > 1 allow the next poll to begin even if aborted requests are still settling, while\n * still capping total concurrency to protect upstream services.\n *\n * ### Debouncing\n *\n * Use `debounce` to accumulate rapid argument changes. The status still transitions to `'stale'`\n * immediately, all running polls are aborted, and the new poll waits for the debounce window\n * (and the timing constraints) before executing.\n *\n * ### Options\n *\n * - `minInterval` — required; must be positive. Zero or negative disables polling (`resume()` no-op). Accepts refs.\n * - `minDelay` — optional delay after completion before the next poll may start. Accepts refs.\n * - `autoStart` — start in active mode (default `true`).\n * - `triggerOnResume` — run the callback immediately on `resume()` (default `false`).\n * - `pauseOnError` — automatically pauses when the callback throws (default `false`).\n * - `maxInFlightRequests` — maximum concurrent polls (default `1`).\n * - `debounce` — debounce window for argument changes in milliseconds (default `0`).\n *\n * ### Returns\n *\n * - `data` — readonly ref of `{ status, value }`.\n * - `lastError` — readonly ref of the latest error (or `null`).\n * - `isActive` — readonly ref indicating active polling.\n * - `inFlightCount` — readonly ref with the number of active requests.\n * - `pause()` and `resume()` controls.\n *\n * @typeParam Args - Arguments shape passed to the polling callback.\n * @typeParam Result - Result type produced by the polling callback.\n */\nexport function usePollingQuery<Args, Result>(\n args: WatchSource<Args>,\n queryFn: (args: Args, options: { signal: AbortSignal; pause: () => void }) => Promise<Result>,\n options: {\n minInterval: MaybeRef<number>;\n minDelay?: MaybeRef<number | undefined>;\n autoStart?: boolean;\n triggerOnResume?: boolean;\n pauseOnError?: boolean;\n maxInFlightRequests?: number;\n debounce?: number;\n },\n) {\n const internal: InternalOptions = {\n minInterval: options.minInterval,\n minDelay: options.minDelay ?? 0,\n autoStart: options.autoStart ?? true,\n triggerOnResume: options.triggerOnResume ?? false,\n pauseOnError: options.pauseOnError ?? false,\n maxInFlightRequests: Math.max(1, options.maxInFlightRequests ?? 1),\n debounce: Math.max(0, options.debounce ?? 0),\n };\n\n const resolveMinInterval = () => Math.max(0, toValue(internal.minInterval));\n const resolveMinDelay = () => {\n const raw = internal.minDelay === undefined ? undefined : toValue(internal.minDelay);\n return Math.max(0, raw ?? 0);\n };\n const canRun = () => resolveMinInterval() > 0;\n\n const data = shallowRef<PollingData<Result>>({ status: 'idle' });\n const lastError = ref<Error | null>(null);\n const isActive = ref(false);\n\n let latestVersion = 0;\n let argsVersion = 0;\n const inFlightCount = ref(0);\n let disposed = false;\n\n let scheduledTimeout: ReturnType<typeof setTimeout> | null = null;\n let debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n\n let nextMinIntervalStart = 0;\n let nextMinDelayStart = 0;\n\n const controllers = new Map<number, AbortController>();\n const abortReasons = new Map<number, AbortReason>();\n const waiters: Waiter[] = [];\n\n let currentArgs: Args;\n let hasCurrentArgs = false;\n\n const setCurrentArgs = (value: Args) => {\n currentArgs = value;\n hasCurrentArgs = true;\n };\n\n const markStale = () => {\n if (data.value.status === 'synced' || data.value.status === 'stale') {\n const { value } = data.value;\n data.value = { status: 'stale', value };\n }\n };\n\n const scheduleWaiters = () => {\n if (waiters.length === 0) return;\n const waiter = waiters.shift();\n waiter?.resolve();\n };\n\n const waitForSlot = async () => {\n if (inFlightCount.value < internal.maxInFlightRequests) return;\n await new Promise<void>((resolve) => {\n waiters.push({ resolve });\n });\n };\n\n const clearScheduled = () => {\n if (scheduledTimeout !== null) {\n clearTimeout(scheduledTimeout);\n scheduledTimeout = null;\n }\n };\n\n const clearDebounce = () => {\n if (debounceTimeout !== null) {\n clearTimeout(debounceTimeout);\n debounceTimeout = null;\n }\n };\n\n const abortAll = (reason: AbortReason) => {\n controllers.forEach((controller, version) => {\n if (!controller.signal.aborted) {\n abortReasons.set(version, reason);\n controller.abort();\n }\n });\n };\n\n const computeDelay = (requestedDelay = 0) => {\n const now = Date.now();\n const earliest = Math.max(nextMinIntervalStart, nextMinDelayStart);\n const baseDelay = earliest > now ? earliest - now : 0;\n return Math.max(0, requestedDelay, baseDelay);\n };\n\n const queueExecution = (requestedDelay = 0, source: ScheduleSource = ScheduleSource.Normal) => {\n if (!isActive.value || !canRun() || disposed) return;\n const delay = computeDelay(requestedDelay);\n\n if (scheduledTimeout !== null) {\n clearTimeout(scheduledTimeout);\n }\n\n scheduledTimeout = setTimeout(() => {\n scheduledTimeout = null;\n void runExecution(source);\n }, delay);\n };\n\n const runExecution = async (source: ScheduleSource) => {\n if (!isActive.value || disposed || !canRun()) return;\n\n const now = Date.now();\n const earliest = Math.max(nextMinIntervalStart, nextMinDelayStart);\n if (now < earliest) {\n queueExecution(earliest - now, source);\n return;\n }\n\n if (!hasCurrentArgs) return;\n\n const argsSnapshot = currentArgs;\n const assignedArgsVersion = argsVersion;\n\n await waitForSlot();\n\n if (!isActive.value || disposed || !canRun()) {\n scheduleWaiters();\n return;\n }\n\n const controller = new AbortController();\n const version = ++latestVersion;\n\n controllers.set(version, controller);\n inFlightCount.value += 1;\n\n const minInterval = resolveMinInterval();\n const startTime = Date.now();\n nextMinIntervalStart = Math.max(nextMinIntervalStart, startTime + minInterval);\n\n let pausedByCallback = false;\n\n const pauseFromCallback = () => {\n if (pausedByCallback) return;\n pausedByCallback = true;\n pause();\n };\n\n try {\n const result = await queryFn(argsSnapshot, { signal: controller.signal, pause: pauseFromCallback });\n if (!controller.signal.aborted) {\n if (version === latestVersion && assignedArgsVersion === argsVersion) {\n lastError.value = null;\n data.value = { status: 'synced', value: result };\n }\n }\n } catch (error) {\n if (controller.signal.aborted) {\n // ignore abort errors\n } else {\n if (version === latestVersion) {\n lastError.value = toError(error);\n }\n\n if (internal.pauseOnError) {\n pause();\n }\n }\n } finally {\n const minDelay = resolveMinDelay();\n const finishTime = Date.now();\n nextMinDelayStart = Math.max(nextMinDelayStart, finishTime + minDelay);\n\n controllers.delete(version);\n inFlightCount.value = Math.max(0, inFlightCount.value - 1);\n scheduleWaiters();\n\n const reason = abortReasons.get(version);\n if (reason) {\n abortReasons.delete(version);\n }\n\n const shouldSchedule\n = isActive.value && !disposed && reason !== 'args';\n\n if (shouldSchedule) {\n queueExecution();\n }\n }\n };\n\n const triggerExecution = (source: ScheduleSource = ScheduleSource.External) => {\n if (!isActive.value || disposed || !canRun()) return;\n queueExecution(0, source);\n };\n\n const handleArgsChange = () => {\n argsVersion += 1;\n markStale();\n abortAll('args');\n\n if (!isActive.value || !canRun()) {\n return;\n }\n\n const schedule = () => {\n triggerExecution(ScheduleSource.External);\n };\n\n if (internal.debounce > 0) {\n clearDebounce();\n debounceTimeout = setTimeout(() => {\n debounceTimeout = null;\n schedule();\n }, internal.debounce);\n } else {\n schedule();\n }\n };\n\n const pause = () => {\n if (!isActive.value) return;\n isActive.value = false;\n clearScheduled();\n clearDebounce();\n abortAll('pause');\n nextMinIntervalStart = Date.now();\n nextMinDelayStart = Date.now();\n };\n\n const resume = () => {\n if (!canRun()) return;\n if (isActive.value) return;\n if (!hasCurrentArgs) return;\n isActive.value = true;\n lastError.value = null;\n\n const now = Date.now();\n nextMinIntervalStart = now;\n nextMinDelayStart = now;\n\n if (internal.triggerOnResume) {\n triggerExecution(ScheduleSource.External);\n } else {\n queueExecution(resolveMinInterval(), ScheduleSource.External);\n }\n };\n\n onScopeDispose(() => {\n disposed = true;\n clearScheduled();\n clearDebounce();\n abortAll('dispose');\n isActive.value = false;\n waiters.splice(0, waiters.length).forEach(({ resolve }) => resolve());\n });\n\n watch(\n args,\n (value) => {\n const initial = !hasCurrentArgs;\n setCurrentArgs(value);\n if (initial) {\n return;\n }\n handleArgsChange();\n },\n { flush: 'sync', immediate: true },\n );\n\n if (internal.autoStart && canRun()) {\n resume();\n }\n\n return {\n data: readonly(data),\n lastError: readonly(lastError),\n isActive: readonly(isActive),\n inFlightCount: readonly(inFlightCount),\n pause,\n resume,\n };\n}\n"],"names":["toError","error","usePollingQuery","args","queryFn","options","internal","resolveMinInterval","toValue","resolveMinDelay","raw","canRun","data","shallowRef","lastError","ref","isActive","latestVersion","argsVersion","inFlightCount","disposed","scheduledTimeout","debounceTimeout","nextMinIntervalStart","nextMinDelayStart","controllers","abortReasons","waiters","currentArgs","hasCurrentArgs","setCurrentArgs","value","markStale","scheduleWaiters","waiter","waitForSlot","resolve","clearScheduled","clearDebounce","abortAll","reason","controller","version","computeDelay","requestedDelay","now","earliest","baseDelay","queueExecution","source","delay","runExecution","argsSnapshot","assignedArgsVersion","minInterval","startTime","pausedByCallback","pauseFromCallback","pause","result","minDelay","finishTime","triggerExecution","handleArgsChange","schedule","resume","onScopeDispose","watch","initial","readonly"],"mappings":";AA6BA,SAASA,GAAQC,GAAuB;AACtC,SAAIA,aAAiB,QAAcA,IAC5B,IAAI,MAAM,OAAOA,KAAU,WAAWA,IAAQ,KAAK,UAAUA,CAAK,CAAC;AAC5E;AAuFO,SAASC,GACdC,GACAC,GACAC,GASA;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AS,QAAQ,IACjBW,EAAQ,OAAO,GAAGA,EAAQ,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAAS,QAAcA,GAAS;AAAA,EACtE,CAAC,GAED+B;AAAA,IACEhE;AAAA,IACA,CAAC4B,MAAU;AACT,YAAMqC,IAAU,CAACvC;AAEjB,MADAC,EAAeC,CAAK,GAChB,CAAAqC,KAGJL,EAAA;AAAA,IACF;AAAA,IACA,EAAE,OAAO,QAAQ,WAAW,GAAA;AAAA,EAAK,GAG/BzD,EAAS,aAAaK,OACxBsD,EAAA,GAGK;AAAA,IACL,MAAMI,EAASzD,CAAI;AAAA,IACnB,WAAWyD,EAASvD,CAAS;AAAA,IAC7B,UAAUuD,EAASrD,CAAQ;AAAA,IAC3B,eAAeqD,EAASlD,CAAa;AAAA,IACrC,OAAAuC;AAAA,IACA,QAAAO;AAAA,EAAA;AAEJ;"}
package/dist/index.d.ts CHANGED
@@ -83,6 +83,7 @@ export { useEventListener } from './composition/useEventListener';
83
83
  export { useFormState } from './composition/useFormState';
84
84
  export { useHover } from './composition/useHover';
85
85
  export { useInterval } from './composition/useInterval';
86
+ export { usePollingQuery } from './composition/usePollingQuery';
86
87
  export { useLocalStorage } from './composition/useLocalStorage';
87
88
  export { useMouse } from './composition/useMouse';
88
89
  export { useMouseCapture } from './composition/useMouseCapture';