@milaboratories/uikit 2.3.9 → 2.3.10
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.
- package/.turbo/turbo-build.log +19 -19
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.js +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue.d.ts.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue.js +75 -70
- package/dist/components/PlNumberField/PlNumberField.vue.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.js +1 -1
- package/dist/components/PlTextField/PlTextField.vue.js +1 -1
- package/dist/generated/components/svg/images/{SvgRequired.vue2.js → SvgRequired.vue.js} +1 -1
- package/dist/generated/components/svg/images/SvgRequired.vue.js.map +1 -0
- package/dist/sdk/model/dist/index.js +1 -1
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/PlNumberField/PlNumberField.vue +10 -2
- package/dist/generated/components/svg/images/SvgRequired.vue2.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -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.3.
|
|
3
|
+
> @milaboratories/uikit@2.3.10 build /home/runner/_work/platforma/platforma/lib/ui/uikit
|
|
4
4
|
> vite build
|
|
5
5
|
|
|
6
6
|
[36mvite v6.3.5 [32mbuilding for production...[36m[39m
|
|
@@ -23,8 +23,8 @@ computing gzip size...
|
|
|
23
23
|
[2mdist/[22m[36mcomponents/PlFileDialog/Local.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
24
24
|
[2mdist/[22m[36mcomponents/Slider.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
25
25
|
[2mdist/[22m[36mlayout/PlGrid/PlGrid.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
26
|
-
[2mdist/[22m[36mcomponents/PlChip/PlChip.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
27
26
|
[2mdist/[22m[36mcomponents/PlTabs/PlTabs.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
27
|
+
[2mdist/[22m[36mcomponents/PlChip/PlChip.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
28
28
|
[2mdist/[22m[36mcomponents/DataTable/TdCell.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
29
29
|
[2mdist/[22m[36mcomponents/DataTable/TrHead.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
30
30
|
[2mdist/[22m[36mcomponents/DataTable/ThCell.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
@@ -41,15 +41,15 @@ computing gzip size...
|
|
|
41
41
|
[2mdist/[22m[36mlayout/PlSpacer/PlSpacer.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
42
42
|
[2mdist/[22m[36mcomponents/PlSplash/PlSplash.vue2.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
43
43
|
[2mdist/[22m[36mnode_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.36 kB[22m
|
|
44
|
-
[2mdist/[22m[36mcomponents/PlTooltip/PlTooltip.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
45
44
|
[2mdist/[22m[36mcomponents/PlBtnLink/PlBtnLink.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
45
|
+
[2mdist/[22m[36mcomponents/PlTooltip/PlTooltip.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
46
46
|
[2mdist/[22m[36mcomponents/PlLogView/PlLogView.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
47
47
|
[2mdist/[22m[36mcomponents/Scrollable.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
48
48
|
[2mdist/[22m[36mcomponents/PlBtnSplit/PlBtnSplit.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
49
|
+
[2mdist/[22m[36mcomponents/PlDropdown/PlDropdown.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
49
50
|
[2mdist/[22m[36mcomponents/PlBtnGhost/PlBtnGhost.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
50
|
-
[2mdist/[22m[36mcomponents/PlBtnGroup/PlBtnGroup.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
51
51
|
[2mdist/[22m[36mcomponents/PlTextArea/PlTextArea.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
52
|
-
[2mdist/[22m[36mcomponents/
|
|
52
|
+
[2mdist/[22m[36mcomponents/PlBtnGroup/PlBtnGroup.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
53
53
|
[2mdist/[22m[36mcomponents/PlCheckbox/PlCheckbox.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
54
54
|
[2mdist/[22m[36mcomponents/InputRange.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
55
55
|
[2mdist/[22m[36mutils/DoubleContour.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.43 kB[22m
|
|
@@ -58,36 +58,36 @@ computing gzip size...
|
|
|
58
58
|
[2mdist/[22m[36mcomponents/SliderRange.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
59
59
|
[2mdist/[22m[36mlayout/PlBlockPage/PlBlockPage.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
60
60
|
[2mdist/[22m[36mlayout/PlContainer/PlContainer.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
61
|
+
[2mdist/[22m[36mcomponents/PlTextField/PlTextField.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
61
62
|
[2mdist/[22m[36mcomponents/PlBtnAccent/PlBtnAccent.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
62
63
|
[2mdist/[22m[36mcomponents/PlBtnDanger/PlBtnDanger.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
63
|
-
[2mdist/[22m[36mcomponents/
|
|
64
|
+
[2mdist/[22m[36mcomponents/PlFileInput/PlFileInput.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
64
65
|
[2mdist/[22m[36mcomponents/PlStatusTag/PlStatusTag.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
65
66
|
[2mdist/[22m[36mcomponents/PlAccordion/PlAccordion.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
66
|
-
[2mdist/[22m[36mcomponents/PlFileInput/PlFileInput.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
67
67
|
[2mdist/[22m[36mcomponents/DataTable/ColumnCaret.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m[2m │ map: 0.10 kB[22m
|
|
68
68
|
[2mdist/[22m[36mnode_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.39 kB[22m
|
|
69
69
|
[2mdist/[22m[36mcomponents/PlBtnPrimary/PlBtnPrimary.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
70
|
-
[2mdist/[22m[36mcomponents/PlSlideModal/PlSlideModal.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
71
70
|
[2mdist/[22m[36mcomponents/PlFileDialog/PlFileDialog.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
71
|
+
[2mdist/[22m[36mcomponents/PlSlideModal/PlSlideModal.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
72
72
|
[2mdist/[22m[36mutils/InnerBorder.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.34 kB[22m
|
|
73
73
|
[2mdist/[22m[36mnode_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.78 kB[22m
|
|
74
74
|
[2mdist/[22m[36mcomponents/ThemeSwitcher.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
75
|
-
[2mdist/[22m[36mcomponents/PlNumberField/PlNumberField.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
76
75
|
[2mdist/[22m[36mcomponents/PlDropdownRef/PlDropdownRef.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
76
|
+
[2mdist/[22m[36mcomponents/PlNumberField/PlNumberField.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
77
77
|
[2mdist/[22m[36mcomponents/PlProgressBar/PlProgressBar.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
78
78
|
[2mdist/[22m[36mcomponents/PlDialogModal/PlDialogModal.vue2.js [39m[1m[2m 0.11 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
79
79
|
[2mdist/[22m[36mcomponents/DataTable/TableComponent.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
80
80
|
[2mdist/[22m[36mcomponents/PlBtnSecondary/PlBtnSecondary.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
81
81
|
[2mdist/[22m[36mcomponents/PlDropdownLine/PlDropdownLine.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
82
|
-
[2mdist/[22m[36mcomponents/PlToggleSwitch/PlToggleSwitch.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
83
|
-
[2mdist/[22m[36mcomponents/PlProgressCell/PlProgressCell.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
84
82
|
[2mdist/[22m[36mcomponents/PlAutocomplete/PlAutocomplete.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
83
|
+
[2mdist/[22m[36mcomponents/PlProgressCell/PlProgressCell.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
84
|
+
[2mdist/[22m[36mcomponents/PlToggleSwitch/PlToggleSwitch.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
85
85
|
[2mdist/[22m[36mcomponents/PlCheckbox/PlCheckboxBase.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
86
86
|
[2mdist/[22m[36mcomponents/PlDropdownLine/ResizableInput.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.10 kB[22m
|
|
87
87
|
[2mdist/[22m[36mcomponents/ContextProvider.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
88
88
|
[2mdist/[22m[36mcomponents/PlErrorBoundary/PlErrorBoundary.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
89
|
-
[2mdist/[22m[36mcomponents/PlDropdownMulti/PlDropdownMulti.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
90
89
|
[2mdist/[22m[36mcomponents/PlEditableTitle/PlEditableTitle.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
90
|
+
[2mdist/[22m[36mcomponents/PlDropdownMulti/PlDropdownMulti.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
91
91
|
[2mdist/[22m[36mcomponents/PlCheckboxGroup/PlCheckboxGroup.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
92
92
|
[2mdist/[22m[36mhelpers/math.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.13 kB[22m[2m │ map: 0.33 kB[22m
|
|
93
93
|
[2mdist/[22m[36mutils/DropdownOverlay/DropdownOverlay.vue2.js [39m[1m[2m 0.12 kB[22m[1m[22m[2m │ gzip: 0.12 kB[22m[2m │ map: 0.11 kB[22m
|
|
@@ -176,8 +176,8 @@ computing gzip size...
|
|
|
176
176
|
[2mdist/[22m[36massets/icons/icon-assets-min/24_arrow-down.svg.js [39m[1m[2m 0.27 kB[22m[1m[22m[2m │ gzip: 0.24 kB[22m[2m │ map: 0.44 kB[22m
|
|
177
177
|
[2mdist/[22m[36massets/icons/icon-assets-min/16_add.svg.js [39m[1m[2m 0.27 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m[2m │ map: 0.44 kB[22m
|
|
178
178
|
[2mdist/[22m[36mcomponents/PlRadio/PlRadio.vue.js [39m[1m[2m 0.27 kB[22m[1m[22m[2m │ gzip: 0.21 kB[22m[2m │ map: 0.10 kB[22m
|
|
179
|
-
[2mdist/[22m[36mcomponents/PlChartStackedBar/Legends.vue.js [39m[1m[2m 0.27 kB[22m[1m[22m[2m │ gzip: 0.21 kB[22m[2m │ map: 0.10 kB[22m
|
|
180
179
|
[2mdist/[22m[36massets/icons/icon-assets-min/24_linetype-longdash.svg.js [39m[1m[2m 0.27 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m[2m │ map: 0.47 kB[22m
|
|
180
|
+
[2mdist/[22m[36mcomponents/PlChartStackedBar/Legends.vue.js [39m[1m[2m 0.27 kB[22m[1m[22m[2m │ gzip: 0.21 kB[22m[2m │ map: 0.10 kB[22m
|
|
181
181
|
[2mdist/[22m[36massets/icons/icon-assets-min/16_chevron-first.svg.js [39m[1m[2m 0.28 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m[2m │ map: 0.45 kB[22m
|
|
182
182
|
[2mdist/[22m[36mcomponents/PlIcon16/PlIcon16.vue.js [39m[1m[2m 0.28 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.10 kB[22m
|
|
183
183
|
[2mdist/[22m[36mcomponents/PlIcon24/PlIcon24.vue.js [39m[1m[2m 0.28 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.10 kB[22m
|
|
@@ -231,9 +231,9 @@ computing gzip size...
|
|
|
231
231
|
[2mdist/[22m[36massets/icons/icon-assets-min/16_checkmark.svg.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m[2m │ map: 0.48 kB[22m
|
|
232
232
|
[2mdist/[22m[36mcomponents/PlChartStackedBar/PlChartStackedBar.vue.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.11 kB[22m
|
|
233
233
|
[2mdist/[22m[36mcomponents/PlElementList/PlElementListItem.vue.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.11 kB[22m
|
|
234
|
-
[2mdist/[22m[36mcomponents/PlChartStackedBar/StackedRowCompact.vue.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.11 kB[22m
|
|
235
234
|
[2mdist/[22m[36massets/icons/icon-assets-min/16_arrow-up.svg.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m[2m │ map: 0.48 kB[22m
|
|
236
235
|
[2mdist/[22m[36massets/icons/icon-assets-min/24_linetype-twodash.svg.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m[2m │ map: 0.50 kB[22m
|
|
236
|
+
[2mdist/[22m[36mcomponents/PlChartStackedBar/StackedRowCompact.vue.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.11 kB[22m
|
|
237
237
|
[2mdist/[22m[36m_virtual/canonicalize.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m[2m │ map: 0.10 kB[22m
|
|
238
238
|
[2mdist/[22m[36massets/icons/icon-assets-min/24_checkmark.svg.js [39m[1m[2m 0.31 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m[2m │ map: 0.49 kB[22m
|
|
239
239
|
[2mdist/[22m[36massets/icons/icon-assets-min/16_arrow-down.svg.js [39m[1m[2m 0.31 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m[2m │ map: 0.49 kB[22m
|
|
@@ -604,7 +604,7 @@ computing gzip size...
|
|
|
604
604
|
[2mdist/[22m[36mnode_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js [39m[1m[2m 1.16 kB[22m[1m[22m[2m │ gzip: 0.40 kB[22m[2m │ map: 3.01 kB[22m
|
|
605
605
|
[2mdist/[22m[36massets/icons/icon-assets-min/24_cluster.svg.js [39m[1m[2m 1.16 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m[2m │ map: 1.34 kB[22m
|
|
606
606
|
[2mdist/[22m[36mnode_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js [39m[1m[2m 1.17 kB[22m[1m[22m[2m │ gzip: 0.55 kB[22m[2m │ map: 3.28 kB[22m
|
|
607
|
-
[2mdist/[22m[36mgenerated/components/svg/images/SvgRequired.
|
|
607
|
+
[2mdist/[22m[36mgenerated/components/svg/images/SvgRequired.vue.js [39m[1m[2m 1.19 kB[22m[1m[22m[2m │ gzip: 0.75 kB[22m[2m │ map: 1.03 kB[22m
|
|
608
608
|
[2mdist/[22m[36mcomponents/PlSectionSeparator/PlSectionSeparator.vue3.js [39m[1m[2m 1.19 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m[2m │ map: 0.11 kB[22m
|
|
609
609
|
[2mdist/[22m[36mcomponents/PlRadio/PlRadio.vue2.js [39m[1m[2m 1.23 kB[22m[1m[22m[2m │ gzip: 0.66 kB[22m[2m │ map: 2.83 kB[22m
|
|
610
610
|
[2mdist/[22m[36mcomponents/PlIcon24/PlIcon24.vue3.js [39m[1m[2m 1.23 kB[22m[1m[22m[2m │ gzip: 0.38 kB[22m[2m │ map: 0.10 kB[22m
|
|
@@ -739,13 +739,13 @@ computing gzip size...
|
|
|
739
739
|
[2mdist/[22m[36mcomponents/PlFileDialog/Remote.vue.js [39m[1m[2m 8.72 kB[22m[1m[22m[2m │ gzip: 2.79 kB[22m[2m │ map: 14.20 kB[22m
|
|
740
740
|
[2mdist/[22m[36mcomponents/PlElementList/PlElementList.vue2.js [39m[1m[2m 9.13 kB[22m[1m[22m[2m │ gzip: 2.42 kB[22m[2m │ map: 16.89 kB[22m
|
|
741
741
|
[2mdist/[22m[36mnode_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js [39m[1m[2m 9.19 kB[22m[1m[22m[2m │ gzip: 3.33 kB[22m[2m │ map: 21.96 kB[22m
|
|
742
|
-
[2mdist/[22m[36mcomponents/PlNumberField/PlNumberField.vue.js [39m[1m[2m 10.
|
|
742
|
+
[2mdist/[22m[36mcomponents/PlNumberField/PlNumberField.vue.js [39m[1m[2m 10.38 kB[22m[1m[22m[2m │ gzip: 3.33 kB[22m[2m │ map: 13.86 kB[22m
|
|
743
743
|
[2mdist/[22m[36mcomponents/PlFileInput/PlFileInput.vue.js [39m[1m[2m 10.72 kB[22m[1m[22m[2m │ gzip: 3.36 kB[22m[2m │ map: 8.41 kB[22m
|
|
744
744
|
[2mdist/[22m[36mdemo-site-data/all-css-variables.js [39m[1m[2m 11.00 kB[22m[1m[22m[2m │ gzip: 1.76 kB[22m[2m │ map: 18.21 kB[22m
|
|
745
745
|
[2mdist/[22m[36mcomponents/PlDropdownLine/PlDropdownLine.vue.js [39m[1m[2m 14.66 kB[22m[1m[22m[2m │ gzip: 3.91 kB[22m[2m │ map: 13.27 kB[22m
|
|
746
746
|
[2mdist/[22m[36mlib/model/common/dist/index.js [39m[1m[2m 15.38 kB[22m[1m[22m[2m │ gzip: 4.26 kB[22m[2m │ map: 89.05 kB[22m
|
|
747
747
|
[2mdist/[22m[36mcomponents/PlDropdown/PlDropdown.vue.js [39m[1m[2m 16.29 kB[22m[1m[22m[2m │ gzip: 4.79 kB[22m[2m │ map: 15.21 kB[22m
|
|
748
|
-
[2mdist/[22m[36mcomponents/PlDropdownLegacy/PlDropdownLegacy.vue.js [39m[1m[2m 17.
|
|
748
|
+
[2mdist/[22m[36mcomponents/PlDropdownLegacy/PlDropdownLegacy.vue.js [39m[1m[2m 17.35 kB[22m[1m[22m[2m │ gzip: 4.83 kB[22m[2m │ map: 14.94 kB[22m
|
|
749
749
|
[2mdist/[22m[36mcomponents/PlAutocomplete/PlAutocomplete.vue.js [39m[1m[2m 17.72 kB[22m[1m[22m[2m │ gzip: 5.14 kB[22m[2m │ map: 17.60 kB[22m
|
|
750
750
|
[2mdist/[22m[36mcomponents/PlDropdownMulti/PlDropdownMulti.vue.js [39m[1m[2m 20.19 kB[22m[1m[22m[2m │ gzip: 5.27 kB[22m[2m │ map: 13.43 kB[22m
|
|
751
751
|
[2mdist/[22m[36mcomponents/PlSvg/PlSvg.vue2.js [39m[1m[2m 39.01 kB[22m[1m[22m[2m │ gzip: 3.39 kB[22m[2m │ map: 11.95 kB[22m
|
|
@@ -756,6 +756,6 @@ computing gzip size...
|
|
|
756
756
|
[2mdist/[22m[36mindex.js [39m[1m[33m501.34 kB[39m[22m[2m │ gzip: 192.29 kB[22m[2m │ map: 5.60 kB[22m
|
|
757
757
|
[2mdist/[22m[36mcomponents/PlSlideModal/PlSlideModal.vue.js [39m[1m[33m601.75 kB[39m[22m[2m │ gzip: 204.43 kB[22m[2m │ map: 3.22 kB[22m
|
|
758
758
|
[2mdist/[22m[36mcomponents/DataTable/TableComponent.vue.js [39m[1m[33m603.09 kB[39m[22m[2m │ gzip: 205.04 kB[22m[2m │ map: 4.87 kB[22m
|
|
759
|
-
[vite:dts] Declaration files built in
|
|
759
|
+
[vite:dts] Declaration files built in 7086ms.
|
|
760
760
|
|
|
761
|
-
[32m✓ built in
|
|
761
|
+
[32m✓ built in 11.89s[39m
|
|
@@ -1,5 +1,5 @@
|
|
|
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.3.
|
|
3
|
+
> @milaboratories/uikit@2.3.10 type-check /home/runner/_work/platforma/platforma/lib/ui/uikit
|
|
4
4
|
> vue-tsc --project ./tsconfig.lib.json
|
|
5
5
|
|
package/CHANGELOG.md
CHANGED
|
@@ -15,7 +15,7 @@ import Oe from "../PlIcon16/PlIcon16.vue.js";
|
|
|
15
15
|
import xe from "../PlIcon24/PlIcon24.vue.js";
|
|
16
16
|
import Ee from "../../utils/DropdownOverlay/DropdownOverlay.vue.js";
|
|
17
17
|
import { useWatchFetch as H } from "../../composition/useWatchFetch.js";
|
|
18
|
-
import Ve from "../../generated/components/svg/images/SvgRequired.
|
|
18
|
+
import Ve from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
19
19
|
import { getErrorMessage as Ae } from "../../helpers/error.js";
|
|
20
20
|
import { debouncedRef as Ce } from "../../node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js";
|
|
21
21
|
const De = ["tabindex"], Re = { class: "pl-autocomplete__container" }, Fe = { class: "pl-autocomplete__field" }, Me = ["disabled", "placeholder"], $e = {
|
|
@@ -12,7 +12,7 @@ import we from "../LongText.vue.js";
|
|
|
12
12
|
import { normalizeListOptions as _e } from "../../helpers/utils.js";
|
|
13
13
|
import ke from "../PlIcon16/PlIcon16.vue.js";
|
|
14
14
|
import ye from "../PlIcon24/PlIcon24.vue.js";
|
|
15
|
-
import ge from "../../generated/components/svg/images/SvgRequired.
|
|
15
|
+
import ge from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
16
16
|
import { getErrorMessage as Ie } from "../../helpers/error.js";
|
|
17
17
|
import be from "./OptionList.vue.js";
|
|
18
18
|
import { useGroupBy as Ve } from "./useGroupBy.js";
|
|
@@ -14,7 +14,7 @@ import we from "../LongText.vue.js";
|
|
|
14
14
|
import ke from "../PlIcon16/PlIcon16.vue.js";
|
|
15
15
|
import ye from "../PlIcon24/PlIcon24.vue.js";
|
|
16
16
|
import { normalizeListOptions as Ie } from "../../helpers/utils.js";
|
|
17
|
-
import ge from "../../generated/components/svg/images/SvgRequired.
|
|
17
|
+
import ge from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
18
18
|
import { getErrorMessage as Ve } from "../../helpers/error.js";
|
|
19
19
|
const be = { class: "ui-dropdown__envelope" }, Ce = ["tabindex"], Ee = { class: "ui-dropdown__container" }, Le = { class: "ui-dropdown__field" }, Se = ["disabled", "placeholder"], xe = { class: "ui-dropdown__controls" }, Ae = { key: 0 }, Oe = {
|
|
20
20
|
key: 0,
|
|
@@ -11,7 +11,7 @@ import { deepEqual as k, deepIncludes as x } from "../../helpers/objects.js";
|
|
|
11
11
|
import { normalizeListOptions as pe } from "../../helpers/utils.js";
|
|
12
12
|
import fe from "../../utils/DropdownOverlay/DropdownOverlay.vue.js";
|
|
13
13
|
import me from "../PlIcon24/PlIcon24.vue.js";
|
|
14
|
-
import ve from "../../generated/components/svg/images/SvgRequired.
|
|
14
|
+
import ve from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
15
15
|
import { getErrorMessage as he } from "../../helpers/error.js";
|
|
16
16
|
const _e = ["tabindex"], we = { class: "pl-dropdown-multi__container" }, ye = { class: "pl-dropdown-multi__field" }, ke = ["disabled", "placeholder"], be = {
|
|
17
17
|
key: 0,
|
|
@@ -8,7 +8,7 @@ import "../../sdk/model/dist/index.js";
|
|
|
8
8
|
import Q from "../../utils/DoubleContour.vue.js";
|
|
9
9
|
import { useLabelNotch as W } from "../../utils/useLabelNotch.js";
|
|
10
10
|
import { prettyBytes as y } from "../../lib/util/helpers/dist/index.js";
|
|
11
|
-
import X from "../../generated/components/svg/images/SvgRequired.
|
|
11
|
+
import X from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
12
12
|
import { getErrorMessage as Y } from "../../helpers/error.js";
|
|
13
13
|
import { getFileNameFromHandle as Z, getFilePathFromHandle as x } from "../../lib/model/common/dist/index.js";
|
|
14
14
|
const ee = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlNumberField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlNumberField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"names":[],"mappings":"AAqSA,OAAO,wBAAwB,CAAC;AAMhC,KAAK,gBAAgB,GAAG;IACtB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yIAAyI;IACzI,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,KAAK,WAAW,GAAG,gBAAgB,CAAC;AAgNpC,KAAK,iBAAiB,GAAG;IACzB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAyIT,OAAO,IAA6B;;yBAZpB,GAAG;;;;;;;EAiBhC;AAyBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WAlZX,MAAM;UAIP,MAAM;iBAFC,MAAM;cAIT,MAAM;cAEN,MAAM;yBAEK,OAAO;kBAId,MAAM;cAEV,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS;;;;kBA4Y5C,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(".mi-number-field{--contour-color: var(--txt-01);--contour-border-width: 1px;--options-bg: #fff;--option-hover-bg: var(--btn-sec-hover-grey);--label-offset-left-x: 8px;--label-offset-right-x: 8px;--label-color: var(--txt-01);--color-hint: #9d9eae}.mi-number-field ::placeholder{color:#cfd1db;opacity:1}.mi-number-field__main-wrapper{height:40px;position:relative}.mi-number-field__wrapper{padding-left:12px;border-radius:6px}.mi-number-field__wrapper.withoutArrows{padding-right:12px}.mi-number-field__icons{width:40px;border-radius:0 6px 6px 0;border-left:1px solid var(--contour-color)}.mi-number-field__icon{line-height:0}.mi-number-field__icon.disabled{cursor:not-allowed;position:relative;z-index:1}.mi-number-field__icon.disabled svg path{fill:#cfd1db}.mi-number-field__icon:hover{background-color:#9babcc29}.mi-number-field__icon:first-child{border-bottom:1px solid var(--contour-color)}.mi-number-field__hint{margin-top:3px;color:var(--color-hint)}.mi-number-field input{outline:none;border:none;width:100%;background:unset;text-overflow:ellipsis}.mi-number-field__contour{border-radius:var(--border-radius-control);border:var(--contour-border-width) solid var(--contour-color);box-shadow:var(--contour-box-shadow);z-index:0;pointer-events:none;transition:all .3s}.mi-number-field:focus-within:not(.error){--label-color: var(--txt-focus);--contour-color: var(--border-color-focus);--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--border-color-focus-shadow)}.mi-number-field:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.mi-number-field.error{--contour-color: var(--txt-error);--label-color: var(--txt-error);--color-hint: var(--txt-error)}.mi-number-field.disabled{--contour-color: var(--color-dis-01);--control-mask-fill: var(--color-dis-01);cursor:not-allowed}.mi-number-field.disabled label,.mi-number-field.disabled .mi-number-field__hint,.mi-number-field.disabled input{color:var(--contour-color)}.mi-number-field.disabled svg path{fill:var(--contour-color)}.mi-number-field.disabled .mi-number-field__icons{pointer-events:none}.mi-number-field label{position:absolute;top:0;transform:translateY(-60%);left:var(--label-offset-left-x);display:flex;align-items:center;padding:0 4px;overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit;color:var(--label-color);transition:color .3s}.mi-number-field label .required{display:inline-block;font-weight:500;font-size:12px;line-height:16px;color:var(--txt-error);margin-right:4px}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { defineComponent as F, mergeModels as I, useModel as
|
|
2
|
+
import { defineComponent as F, mergeModels as I, useModel as A, ref as v, useSlots as T, computed as s, watch as P, createElementBlock as m, openBlock as f, normalizeClass as c, createElementVNode as n, createCommentVNode as p, createVNode as U, withDirectives as j, createTextVNode as K, createBlock as R, toDisplayString as C, unref as E, withCtx as Z, renderSlot as q, vModelText as z } from "vue";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import { useLabelNotch as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
4
|
+
import G from "../../utils/DoubleContour.vue.js";
|
|
5
|
+
import { useLabelNotch as X } from "../../utils/useLabelNotch.js";
|
|
6
|
+
import H from "../PlTooltip/PlTooltip.vue.js";
|
|
7
|
+
const J = { class: "mi-number-field__main-wrapper d-flex" }, Q = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-description"
|
|
10
|
-
},
|
|
10
|
+
}, W = ["disabled", "placeholder"], Y = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "mi-number-field__hint text-description"
|
|
13
|
-
},
|
|
13
|
+
}, ne = /* @__PURE__ */ F({
|
|
14
14
|
__name: "PlNumberField",
|
|
15
15
|
props: /* @__PURE__ */ I({
|
|
16
16
|
disabled: { type: Boolean },
|
|
@@ -28,47 +28,47 @@ const H = { class: "mi-number-field__main-wrapper d-flex" }, J = {
|
|
|
28
28
|
modelModifiers: {}
|
|
29
29
|
}),
|
|
30
30
|
emits: ["update:modelValue"],
|
|
31
|
-
setup(
|
|
32
|
-
const t =
|
|
33
|
-
|
|
34
|
-
function
|
|
31
|
+
setup(w) {
|
|
32
|
+
const t = w, a = A(w, "modelValue"), g = v(), D = T(), d = v();
|
|
33
|
+
X(g);
|
|
34
|
+
function V(e) {
|
|
35
35
|
return e === void 0 ? "" : String(+e);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function h(e) {
|
|
38
38
|
return e === "." || e === "," || e === "-";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function x(e) {
|
|
41
41
|
if (e === "")
|
|
42
42
|
return;
|
|
43
|
-
if (
|
|
43
|
+
if (h(e))
|
|
44
44
|
return 0;
|
|
45
45
|
let l = e;
|
|
46
46
|
return l = l.replace(",", "."), l = l.replace("−", "-"), l = l.replace("–", "-"), l = l.replace("+", ""), parseFloat(l);
|
|
47
47
|
}
|
|
48
|
-
const o =
|
|
49
|
-
|
|
50
|
-
parseFloat(o.value) !== e && (o.value =
|
|
48
|
+
const o = v(V(a.value)), r = s(() => x(o.value));
|
|
49
|
+
P(() => a.value, (e) => {
|
|
50
|
+
parseFloat(o.value) !== e && (o.value = V(e));
|
|
51
51
|
});
|
|
52
|
-
const
|
|
52
|
+
const O = /^[-−–+]?(\d+)?[\\.,]?(\d+)?$/, y = s({
|
|
53
53
|
get() {
|
|
54
54
|
return o.value;
|
|
55
55
|
},
|
|
56
56
|
set(e) {
|
|
57
|
-
const l =
|
|
58
|
-
l === void 0 || e.match(
|
|
57
|
+
const l = x(e);
|
|
58
|
+
l === void 0 || e.match(O) && !isNaN(l) ? (o.value = e, !t.updateOnEnterOrClickOutside && !h(e) && B()) : d.value && (d.value.value = o.value);
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
61
|
-
function
|
|
60
|
+
}), k = v(!1);
|
|
61
|
+
function B() {
|
|
62
62
|
if (o.value === "") {
|
|
63
|
-
|
|
63
|
+
a.value = void 0;
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
a.value = r.value;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const b = s(() => {
|
|
69
69
|
let e = [];
|
|
70
70
|
t.errorMessage && e.push(t.errorMessage);
|
|
71
|
-
const l =
|
|
71
|
+
const l = r.value;
|
|
72
72
|
if (l !== void 0 && isNaN(l))
|
|
73
73
|
e.push("Value is not a number");
|
|
74
74
|
else if (t.validate && l !== void 0) {
|
|
@@ -77,81 +77,86 @@ const H = { class: "mi-number-field__main-wrapper d-flex" }, J = {
|
|
|
77
77
|
} else
|
|
78
78
|
t.minValue !== void 0 && l !== void 0 && l < t.minValue && e.push(`Value must be higher than ${t.minValue}`), t.maxValue !== void 0 && l !== void 0 && l > t.maxValue && e.push(`Value must be less than ${t.maxValue}`);
|
|
79
79
|
return e = [...e], e.join(" ");
|
|
80
|
-
}), B = s(() => {
|
|
81
|
-
const e = a.value;
|
|
82
|
-
return t.maxValue !== void 0 && e !== void 0 ? e >= t.maxValue : !1;
|
|
83
80
|
}), M = s(() => {
|
|
84
|
-
const e =
|
|
81
|
+
const e = r.value;
|
|
82
|
+
return t.maxValue !== void 0 && e !== void 0 ? e >= t.maxValue : !1;
|
|
83
|
+
}), L = s(() => {
|
|
84
|
+
const e = r.value;
|
|
85
85
|
return t.minValue !== void 0 && e !== void 0 ? e <= t.minValue : !1;
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let l;
|
|
91
|
-
e === void 0 ? l = t.minValue ? t.minValue : 0 : l = (e || 0) + t.step, r.value = t.maxValue !== void 0 ? Math.min(t.maxValue, l) : l;
|
|
86
|
+
}), u = s(
|
|
87
|
+
() => {
|
|
88
|
+
var e;
|
|
89
|
+
return 10 ** (((e = t.step.toString().split(".").at(1)) == null ? void 0 : e.length) ?? 0);
|
|
92
90
|
}
|
|
93
|
-
|
|
91
|
+
);
|
|
94
92
|
function N() {
|
|
95
|
-
const e =
|
|
93
|
+
const e = r.value;
|
|
96
94
|
if (!M.value) {
|
|
97
95
|
let l;
|
|
98
|
-
e === void 0 ? l = 0 : l =
|
|
96
|
+
e === void 0 ? l = t.minValue ? t.minValue : 0 : l = ((e || 0) * u.value + t.step * u.value) / u.value, a.value = t.maxValue !== void 0 ? Math.min(t.maxValue, l) : l;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function _() {
|
|
100
|
+
const e = r.value;
|
|
101
|
+
if (!L.value) {
|
|
102
|
+
let l;
|
|
103
|
+
e === void 0 ? l = 0 : l = ((e || 0) * u.value - t.step * u.value) / u.value, a.value = t.minValue !== void 0 ? Math.max(t.minValue, l) : l;
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
|
-
function
|
|
106
|
+
function S(e) {
|
|
102
107
|
var l, i;
|
|
103
|
-
t.updateOnEnterOrClickOutside && (e.code === "Escape" && (o.value =
|
|
108
|
+
t.updateOnEnterOrClickOutside && (e.code === "Escape" && (o.value = V(a.value), (l = d.value) == null || l.blur()), e.code === "Enter" && ((i = d.value) == null || i.blur())), e.code === "Enter" && (o.value = String(a.value)), ["ArrowDown", "ArrowUp"].includes(e.code) && e.preventDefault(), t.useIncrementButtons && e.code === "ArrowUp" && N(), t.useIncrementButtons && e.code === "ArrowDown" && _();
|
|
104
109
|
}
|
|
105
110
|
const $ = (e) => {
|
|
106
111
|
e.detail > 1 && e.preventDefault();
|
|
107
112
|
};
|
|
108
|
-
return (e, l) => (
|
|
113
|
+
return (e, l) => (f(), m("div", {
|
|
109
114
|
ref_key: "root",
|
|
110
|
-
ref:
|
|
111
|
-
class:
|
|
112
|
-
onKeydown: l[3] || (l[3] = (i) =>
|
|
115
|
+
ref: g,
|
|
116
|
+
class: c([{ error: !!b.value.trim(), disabled: e.disabled }, "mi-number-field d-flex-column"]),
|
|
117
|
+
onKeydown: l[3] || (l[3] = (i) => S(i))
|
|
113
118
|
}, [
|
|
114
|
-
n("div",
|
|
115
|
-
|
|
119
|
+
n("div", J, [
|
|
120
|
+
U(G, { class: "mi-number-field__contour" }),
|
|
116
121
|
n("div", {
|
|
117
|
-
class:
|
|
122
|
+
class: c(["mi-number-field__wrapper flex-grow d-flex flex-align-center", { withoutArrows: !e.useIncrementButtons }])
|
|
118
123
|
}, [
|
|
119
|
-
e.label ? (
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
e.label ? (f(), m("label", Q, [
|
|
125
|
+
K(C(e.label) + " ", 1),
|
|
126
|
+
E(D).tooltip ? (f(), R(E(H), {
|
|
122
127
|
key: 0,
|
|
123
128
|
class: "info",
|
|
124
129
|
position: "top"
|
|
125
130
|
}, {
|
|
126
|
-
tooltip:
|
|
127
|
-
|
|
131
|
+
tooltip: Z(() => [
|
|
132
|
+
q(e.$slots, "tooltip")
|
|
128
133
|
]),
|
|
129
134
|
_: 3
|
|
130
|
-
})) :
|
|
131
|
-
])) :
|
|
132
|
-
|
|
135
|
+
})) : p("", !0)
|
|
136
|
+
])) : p("", !0),
|
|
137
|
+
j(n("input", {
|
|
133
138
|
ref_key: "input",
|
|
134
|
-
ref:
|
|
135
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) =>
|
|
139
|
+
ref: d,
|
|
140
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => y.value = i),
|
|
136
141
|
disabled: e.disabled,
|
|
137
142
|
placeholder: e.placeholder,
|
|
138
143
|
class: "text-s flex-grow",
|
|
139
|
-
onFocusin: l[1] || (l[1] = (i) =>
|
|
144
|
+
onFocusin: l[1] || (l[1] = (i) => k.value = !0),
|
|
140
145
|
onFocusout: l[2] || (l[2] = (i) => {
|
|
141
|
-
|
|
146
|
+
k.value = !1, B();
|
|
142
147
|
})
|
|
143
|
-
}, null, 40,
|
|
144
|
-
[
|
|
148
|
+
}, null, 40, W), [
|
|
149
|
+
[z, y.value]
|
|
145
150
|
])
|
|
146
151
|
], 2),
|
|
147
|
-
e.useIncrementButtons ? (
|
|
152
|
+
e.useIncrementButtons ? (f(), m("div", {
|
|
148
153
|
key: 0,
|
|
149
154
|
class: "mi-number-field__icons d-flex-column",
|
|
150
155
|
onMousedown: $
|
|
151
156
|
}, [
|
|
152
157
|
n("div", {
|
|
153
|
-
class:
|
|
154
|
-
onClick:
|
|
158
|
+
class: c([{ disabled: M.value }, "mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),
|
|
159
|
+
onClick: N
|
|
155
160
|
}, l[4] || (l[4] = [
|
|
156
161
|
n("svg", {
|
|
157
162
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -169,8 +174,8 @@ const H = { class: "mi-number-field__main-wrapper d-flex" }, J = {
|
|
|
169
174
|
], -1)
|
|
170
175
|
]), 2),
|
|
171
176
|
n("div", {
|
|
172
|
-
class:
|
|
173
|
-
onClick:
|
|
177
|
+
class: c([{ disabled: L.value }, "mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),
|
|
178
|
+
onClick: _
|
|
174
179
|
}, l[5] || (l[5] = [
|
|
175
180
|
n("svg", {
|
|
176
181
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -187,13 +192,13 @@ const H = { class: "mi-number-field__main-wrapper d-flex" }, J = {
|
|
|
187
192
|
})
|
|
188
193
|
], -1)
|
|
189
194
|
]), 2)
|
|
190
|
-
], 32)) :
|
|
195
|
+
], 32)) : p("", !0)
|
|
191
196
|
]),
|
|
192
|
-
|
|
197
|
+
b.value.trim() ? (f(), m("div", Y, C(b.value), 1)) : p("", !0)
|
|
193
198
|
], 34));
|
|
194
199
|
}
|
|
195
200
|
});
|
|
196
201
|
export {
|
|
197
|
-
|
|
202
|
+
ne as default
|
|
198
203
|
};
|
|
199
204
|
//# sourceMappingURL=PlNumberField.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlNumberField.vue.js","sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport './pl-number-field.scss';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport { computed, ref, useSlots, watch } from 'vue';\nimport { PlTooltip } from '../PlTooltip';\n\ntype NumberInputProps = {\n /** Input is disabled if true */\n disabled?: boolean;\n /** Label on the top border of the field, empty by default */\n label?: string;\n /** Input placeholder, empty by default */\n placeholder?: string;\n /** Step for increment/decrement buttons, 1 by default */\n step?: number;\n /** If defined - show an error if value is lower */\n minValue?: number;\n /** If defined - show an error if value is higher */\n maxValue?: number;\n /** If false - remove buttons on the right */\n useIncrementButtons?: boolean;\n /** If true - changes do not apply immediately, they apply only by removing focus from the input (by click enter or by click outside) */\n updateOnEnterOrClickOutside?: boolean;\n /** Error message that shows always when it's provided, without other checks */\n errorMessage?: string;\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: number) => string | undefined;\n};\n\nconst props = withDefaults(defineProps<NumberInputProps>(), {\n step: 1,\n label: undefined,\n placeholder: undefined,\n minValue: undefined,\n maxValue: undefined,\n useIncrementButtons: true,\n updateOnEnter: false,\n errorMessage: undefined,\n validate: undefined,\n});\n\nconst modelValue = defineModel<number | undefined>({ required: true });\n\nconst root = ref<HTMLElement>();\nconst slots = useSlots();\nconst input = ref<HTMLInputElement>();\n\nuseLabelNotch(root);\n\nfunction modelToString(v: number | undefined) {\n return v === undefined ? '' : String(+v); // (+v) to avoid staying in input non-number values if they are provided in model\n}\n\nfunction isPartial(v: string) {\n return v === '.' || v === ',' || v === '-';\n}\nfunction stringToModel(v: string) {\n if (v === '') {\n return undefined;\n }\n if (isPartial(v)) {\n return 0;\n }\n let forParsing = v;\n forParsing = forParsing.replace(',', '.');\n forParsing = forParsing.replace('−', '-'); // minus, replacing for the case of input the whole copied value\n forParsing = forParsing.replace('–', '-'); // dash, replacing for the case of input the whole copied value\n forParsing = forParsing.replace('+', '');\n return parseFloat(forParsing);\n}\n\nconst innerTextValue = ref(modelToString(modelValue.value));\nconst innerNumberValue = computed(() => stringToModel(innerTextValue.value));\n\nwatch(() => modelValue.value, (outerValue) => { // update inner value if outer value is changed\n if (parseFloat(innerTextValue.value) !== outerValue) {\n innerTextValue.value = modelToString(outerValue);\n }\n});\n\nconst NUMBER_REGEX = /^[-−–+]?(\\d+)?[\\\\.,]?(\\d+)?$/; // parseFloat works without errors on strings with multiple dots, or letters in value\nconst inputValue = computed({\n get() {\n return innerTextValue.value;\n },\n set(nextValue: string) {\n const parsedValue = stringToModel(nextValue);\n // we allow to set empty value or valid numeric value, otherwise reset input value to previous valid\n if (parsedValue === undefined\n || (nextValue.match(NUMBER_REGEX) && !isNaN(parsedValue))\n ) {\n innerTextValue.value = nextValue;\n if (!props.updateOnEnterOrClickOutside && !isPartial(nextValue)) { // to avoid applying '-' or '.'\n applyChanges();\n }\n } else if (input.value) {\n input.value.value = innerTextValue.value;\n }\n },\n});\nconst focused = ref(false);\n\nfunction applyChanges() {\n if (innerTextValue.value === '') {\n modelValue.value = undefined;\n return;\n }\n modelValue.value = innerNumberValue.value;\n}\n\nconst errors = computed(() => {\n let ers: string[] = [];\n if (props.errorMessage) {\n ers.push(props.errorMessage);\n }\n const parsedValue = innerNumberValue.value;\n if (parsedValue !== undefined && isNaN(parsedValue)) {\n ers.push('Value is not a number');\n } else if (props.validate && parsedValue !== undefined) {\n const error = props.validate(parsedValue);\n if (error) {\n ers.push(error);\n }\n } else {\n if (props.minValue !== undefined && parsedValue !== undefined && parsedValue < props.minValue) {\n ers.push(`Value must be higher than ${props.minValue}`);\n }\n if (props.maxValue !== undefined && parsedValue !== undefined && parsedValue > props.maxValue) {\n ers.push(`Value must be less than ${props.maxValue}`);\n }\n }\n\n ers = [...ers];\n\n return ers.join(' ');\n});\n\nconst isIncrementDisabled = computed(() => {\n const parsedValue = innerNumberValue.value;\n if (props.maxValue !== undefined && parsedValue !== undefined) {\n return parsedValue >= props.maxValue;\n }\n return false;\n});\n\nconst isDecrementDisabled = computed(() => {\n const parsedValue = innerNumberValue.value;\n if (props.minValue !== undefined && parsedValue !== undefined) {\n return parsedValue <= props.minValue;\n }\n return false;\n});\n\nfunction increment() {\n const parsedValue = innerNumberValue.value;\n if (!isIncrementDisabled.value) {\n let nV;\n if (parsedValue === undefined) {\n nV = props.minValue ? props.minValue : 0;\n } else {\n nV = (parsedValue || 0) + props.step;\n }\n modelValue.value = props.maxValue !== undefined ? Math.min(props.maxValue, nV) : nV;\n }\n}\n\nfunction decrement() {\n const parsedValue = innerNumberValue.value;\n if (!isDecrementDisabled.value) {\n let nV;\n if (parsedValue === undefined) {\n nV = 0;\n } else {\n nV = +(parsedValue || 0) - props.step;\n }\n modelValue.value = props.minValue !== undefined ? Math.max(props.minValue, nV) : nV;\n }\n}\n\nfunction handleKeyPress(e: { code: string; preventDefault(): void }) {\n if (props.updateOnEnterOrClickOutside) {\n if (e.code === 'Escape') {\n innerTextValue.value = modelToString(modelValue.value);\n input.value?.blur();\n }\n if (e.code === 'Enter') {\n input.value?.blur();\n }\n }\n\n if (e.code === 'Enter') {\n innerTextValue.value = String(modelValue.value); // to make .1 => 0.1, 10.00 => 10, remove leading zeros etc\n }\n\n if (['ArrowDown', 'ArrowUp'].includes(e.code)) {\n e.preventDefault();\n }\n if (props.useIncrementButtons && e.code === 'ArrowUp') {\n increment();\n }\n if (props.useIncrementButtons && e.code === 'ArrowDown') {\n decrement();\n }\n}\n\n// https://stackoverflow.com/questions/880512/prevent-text-selection-after-double-click#:~:text=If%20you%20encounter%20a%20situation,none%3B%20to%20the%20summary%20element.\n// this prevents selecting of more than input content in some cases,\n// but also disable selecting input content by double-click (useful feature)\nconst onMousedown = (ev: MouseEvent) => {\n if (ev.detail > 1) {\n ev.preventDefault();\n }\n};\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"{ error: !!errors.trim(), disabled: disabled }\"\n class=\"mi-number-field d-flex-column\"\n @keydown=\"handleKeyPress($event)\"\n >\n <div class=\"mi-number-field__main-wrapper d-flex\">\n <DoubleContour class=\"mi-number-field__contour\"/>\n <div\n class=\"mi-number-field__wrapper flex-grow d-flex flex-align-center\"\n :class=\"{withoutArrows: !useIncrementButtons}\"\n >\n <label v-if=\"label\" class=\"text-description\">\n {{ label }}\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\"/>\n </template>\n </PlTooltip>\n </label>\n <input\n ref=\"input\"\n v-model=\"inputValue\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n class=\"text-s flex-grow\"\n @focusin=\"focused = true\"\n @focusout=\"focused = false; applyChanges()\"\n />\n </div>\n <div v-if=\"useIncrementButtons\" class=\"mi-number-field__icons d-flex-column\" @mousedown=\"onMousedown\">\n <div\n :class=\"{ disabled: isIncrementDisabled }\"\n class=\"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"increment\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n <div\n :class=\"{ disabled: isDecrementDisabled }\"\n class=\"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"decrement\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div v-if=\"errors.trim()\" class=\"mi-number-field__hint text-description\">\n {{ errors }}\n </div>\n </div>\n</template>\n"],"names":["props","__props","modelValue","_useModel","root","ref","slots","useSlots","input","useLabelNotch","modelToString","v","isPartial","stringToModel","forParsing","innerTextValue","innerNumberValue","computed","watch","outerValue","NUMBER_REGEX","inputValue","nextValue","parsedValue","applyChanges","focused","errors","ers","error","isIncrementDisabled","isDecrementDisabled","increment","nV","decrement","handleKeyPress","_a","_b","onMousedown","ev"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,UAAMA,IAAQC,GAYRC,IAAaC,iBAAkD,GAE/DC,IAAOC,EAAiB,GACxBC,IAAQC,EAAS,GACjBC,IAAQH,EAAsB;AAEpC,IAAAI,EAAcL,CAAI;AAElB,aAASM,EAAcC,GAAuB;AAC5C,aAAOA,MAAM,SAAY,KAAK,OAAO,CAACA,CAAC;AAAA,IAAA;AAGzC,aAASC,EAAUD,GAAW;AAC5B,aAAOA,MAAM,OAAOA,MAAM,OAAOA,MAAM;AAAA,IAAA;AAEzC,aAASE,EAAcF,GAAW;AAChC,UAAIA,MAAM;AACD;AAEL,UAAAC,EAAUD,CAAC;AACN,eAAA;AAET,UAAIG,IAAaH;AACJ,a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CAAE,IAAIA;AAAA,MAAA;AAAA,IACnF;AAGF,aAASE,EAAe,GAA6C;;AACnE,MAAIlC,EAAM,gCACJ,EAAE,SAAS,aACEe,EAAA,QAAQL,EAAcR,EAAW,KAAK,IACrDiC,IAAA3B,EAAM,UAAN,QAAA2B,EAAa,SAEX,EAAE,SAAS,aACbC,IAAA5B,EAAM,UAAN,QAAA4B,EAAa,UAIb,EAAE,SAAS,YACErB,EAAA,QAAQ,OAAOb,EAAW,KAAK,IAG5C,CAAC,aAAa,SAAS,EAAE,SAAS,EAAE,IAAI,KAC1C,EAAE,eAAe,GAEfF,EAAM,uBAAuB,EAAE,SAAS,aAChC+B,EAAA,GAER/B,EAAM,uBAAuB,EAAE,SAAS,eAChCiC,EAAA;AAAA,IACZ;AAMI,UAAAI,IAAc,CAACC,MAAmB;AAClC,MAAAA,EAAG,SAAS,KACdA,EAAG,eAAe;AAAA,IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PlNumberField.vue.js","sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport './pl-number-field.scss';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport { computed, ref, useSlots, watch } from 'vue';\nimport { PlTooltip } from '../PlTooltip';\n\ntype NumberInputProps = {\n /** Input is disabled if true */\n disabled?: boolean;\n /** Label on the top border of the field, empty by default */\n label?: string;\n /** Input placeholder, empty by default */\n placeholder?: string;\n /** Step for increment/decrement buttons, 1 by default */\n step?: number;\n /** If defined - show an error if value is lower */\n minValue?: number;\n /** If defined - show an error if value is higher */\n maxValue?: number;\n /** If false - remove buttons on the right */\n useIncrementButtons?: boolean;\n /** If true - changes do not apply immediately, they apply only by removing focus from the input (by click enter or by click outside) */\n updateOnEnterOrClickOutside?: boolean;\n /** Error message that shows always when it's provided, without other checks */\n errorMessage?: string;\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: number) => string | undefined;\n};\n\nconst props = withDefaults(defineProps<NumberInputProps>(), {\n step: 1,\n label: undefined,\n placeholder: undefined,\n minValue: undefined,\n maxValue: undefined,\n useIncrementButtons: true,\n updateOnEnter: false,\n errorMessage: undefined,\n validate: undefined,\n});\n\nconst modelValue = defineModel<number | undefined>({ required: true });\n\nconst root = ref<HTMLElement>();\nconst slots = useSlots();\nconst input = ref<HTMLInputElement>();\n\nuseLabelNotch(root);\n\nfunction modelToString(v: number | undefined) {\n return v === undefined ? '' : String(+v); // (+v) to avoid staying in input non-number values if they are provided in model\n}\n\nfunction isPartial(v: string) {\n return v === '.' || v === ',' || v === '-';\n}\nfunction stringToModel(v: string) {\n if (v === '') {\n return undefined;\n }\n if (isPartial(v)) {\n return 0;\n }\n let forParsing = v;\n forParsing = forParsing.replace(',', '.');\n forParsing = forParsing.replace('−', '-'); // minus, replacing for the case of input the whole copied value\n forParsing = forParsing.replace('–', '-'); // dash, replacing for the case of input the whole copied value\n forParsing = forParsing.replace('+', '');\n return parseFloat(forParsing);\n}\n\nconst innerTextValue = ref(modelToString(modelValue.value));\nconst innerNumberValue = computed(() => stringToModel(innerTextValue.value));\n\nwatch(() => modelValue.value, (outerValue) => { // update inner value if outer value is changed\n if (parseFloat(innerTextValue.value) !== outerValue) {\n innerTextValue.value = modelToString(outerValue);\n }\n});\n\nconst NUMBER_REGEX = /^[-−–+]?(\\d+)?[\\\\.,]?(\\d+)?$/; // parseFloat works without errors on strings with multiple dots, or letters in value\nconst inputValue = computed({\n get() {\n return innerTextValue.value;\n },\n set(nextValue: string) {\n const parsedValue = stringToModel(nextValue);\n // we allow to set empty value or valid numeric value, otherwise reset input value to previous valid\n if (parsedValue === undefined\n || (nextValue.match(NUMBER_REGEX) && !isNaN(parsedValue))\n ) {\n innerTextValue.value = nextValue;\n if (!props.updateOnEnterOrClickOutside && !isPartial(nextValue)) { // to avoid applying '-' or '.'\n applyChanges();\n }\n } else if (input.value) {\n input.value.value = innerTextValue.value;\n }\n },\n});\nconst focused = ref(false);\n\nfunction applyChanges() {\n if (innerTextValue.value === '') {\n modelValue.value = undefined;\n return;\n }\n modelValue.value = innerNumberValue.value;\n}\n\nconst errors = computed(() => {\n let ers: string[] = [];\n if (props.errorMessage) {\n ers.push(props.errorMessage);\n }\n const parsedValue = innerNumberValue.value;\n if (parsedValue !== undefined && isNaN(parsedValue)) {\n ers.push('Value is not a number');\n } else if (props.validate && parsedValue !== undefined) {\n const error = props.validate(parsedValue);\n if (error) {\n ers.push(error);\n }\n } else {\n if (props.minValue !== undefined && parsedValue !== undefined && parsedValue < props.minValue) {\n ers.push(`Value must be higher than ${props.minValue}`);\n }\n if (props.maxValue !== undefined && parsedValue !== undefined && parsedValue > props.maxValue) {\n ers.push(`Value must be less than ${props.maxValue}`);\n }\n }\n\n ers = [...ers];\n\n return ers.join(' ');\n});\n\nconst isIncrementDisabled = computed(() => {\n const parsedValue = innerNumberValue.value;\n if (props.maxValue !== undefined && parsedValue !== undefined) {\n return parsedValue >= props.maxValue;\n }\n return false;\n});\n\nconst isDecrementDisabled = computed(() => {\n const parsedValue = innerNumberValue.value;\n if (props.minValue !== undefined && parsedValue !== undefined) {\n return parsedValue <= props.minValue;\n }\n return false;\n});\n\nconst multiplier = computed(() =>\n 10 ** (props.step.toString().split('.').at(1)?.length ?? 0),\n);\n\nfunction increment() {\n const parsedValue = innerNumberValue.value;\n if (!isIncrementDisabled.value) {\n let nV;\n if (parsedValue === undefined) {\n nV = props.minValue ? props.minValue : 0;\n } else {\n nV = ((parsedValue || 0) * multiplier.value\n + props.step * multiplier.value)\n / multiplier.value;\n }\n modelValue.value = props.maxValue !== undefined ? Math.min(props.maxValue, nV) : nV;\n }\n}\n\nfunction decrement() {\n const parsedValue = innerNumberValue.value;\n if (!isDecrementDisabled.value) {\n let nV;\n if (parsedValue === undefined) {\n nV = 0;\n } else {\n nV = ((parsedValue || 0) * multiplier.value\n - props.step * multiplier.value)\n / multiplier.value;\n }\n modelValue.value = props.minValue !== undefined ? Math.max(props.minValue, nV) : nV;\n }\n}\n\nfunction handleKeyPress(e: { code: string; preventDefault(): void }) {\n if (props.updateOnEnterOrClickOutside) {\n if (e.code === 'Escape') {\n innerTextValue.value = modelToString(modelValue.value);\n input.value?.blur();\n }\n if (e.code === 'Enter') {\n input.value?.blur();\n }\n }\n\n if (e.code === 'Enter') {\n innerTextValue.value = String(modelValue.value); // to make .1 => 0.1, 10.00 => 10, remove leading zeros etc\n }\n\n if (['ArrowDown', 'ArrowUp'].includes(e.code)) {\n e.preventDefault();\n }\n if (props.useIncrementButtons && e.code === 'ArrowUp') {\n increment();\n }\n if (props.useIncrementButtons && e.code === 'ArrowDown') {\n decrement();\n }\n}\n\n// https://stackoverflow.com/questions/880512/prevent-text-selection-after-double-click#:~:text=If%20you%20encounter%20a%20situation,none%3B%20to%20the%20summary%20element.\n// this prevents selecting of more than input content in some cases,\n// but also disable selecting input content by double-click (useful feature)\nconst onMousedown = (ev: MouseEvent) => {\n if (ev.detail > 1) {\n ev.preventDefault();\n }\n};\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"{ error: !!errors.trim(), disabled: disabled }\"\n class=\"mi-number-field d-flex-column\"\n @keydown=\"handleKeyPress($event)\"\n >\n <div class=\"mi-number-field__main-wrapper d-flex\">\n <DoubleContour class=\"mi-number-field__contour\"/>\n <div\n class=\"mi-number-field__wrapper flex-grow d-flex flex-align-center\"\n :class=\"{withoutArrows: !useIncrementButtons}\"\n >\n <label v-if=\"label\" class=\"text-description\">\n {{ label }}\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\"/>\n </template>\n </PlTooltip>\n </label>\n <input\n ref=\"input\"\n v-model=\"inputValue\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n class=\"text-s flex-grow\"\n @focusin=\"focused = true\"\n @focusout=\"focused = false; applyChanges()\"\n />\n </div>\n <div v-if=\"useIncrementButtons\" class=\"mi-number-field__icons d-flex-column\" @mousedown=\"onMousedown\">\n <div\n :class=\"{ disabled: isIncrementDisabled }\"\n class=\"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"increment\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n <div\n :class=\"{ disabled: isDecrementDisabled }\"\n class=\"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"decrement\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div v-if=\"errors.trim()\" class=\"mi-number-field__hint text-description\">\n {{ errors }}\n </div>\n </div>\n</template>\n"],"names":["props","__props","modelValue","_useModel","root","ref","slots","useSlots","input","useLabelNotch","modelToString","v","isPartial","stringToModel","forParsing","innerTextValue","innerNumberValue","computed","watch","outerValue","NUMBER_REGEX","inputValue","nextValue","parsedValue","applyChanges","focused","errors","ers","error","isIncrementDisabled","isDecrementDisabled","multiplier","_a","increment","nV","decrement","handleKeyPress","_b","onMousedown","ev"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,UAAMA,IAAQC,GAYRC,IAAaC,iBAAkD,GAE/DC,IAAOC,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import H from "../PlTooltip/PlTooltip.vue.js";
|
|
|
5
5
|
import T from "../../utils/DoubleContour.vue.js";
|
|
6
6
|
import { useLabelNotch as z } from "../../utils/useLabelNotch.js";
|
|
7
7
|
import { useValidation as A } from "../../utils/useValidation.js";
|
|
8
|
-
import I from "../../generated/components/svg/images/SvgRequired.
|
|
8
|
+
import I from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
9
9
|
import { getErrorMessage as L } from "../../helpers/error.js";
|
|
10
10
|
const P = { class: "ui-text-area__envelope" }, R = {
|
|
11
11
|
key: 0,
|