@eightshift/ui-components 4.0.0 → 5.0.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.
Files changed (144) hide show
  1. package/package.json +101 -101
  2. package/dist/Button-CvzGKGCo.js +0 -185
  3. package/dist/Collection-ddre1L5v.js +0 -2332
  4. package/dist/Color-MV5kBVXr.js +0 -2452
  5. package/dist/ColorSwatch-BqQfVu4L.js +0 -64
  6. package/dist/ComboBox-jQ-dk95U.js +0 -1906
  7. package/dist/Dialog-DX1aiYyE.js +0 -2300
  8. package/dist/FieldError-52GVSGgC.js +0 -42
  9. package/dist/FocusScope-Cri5BFRz.js +0 -831
  10. package/dist/Form-Cq3fu75_.js +0 -5
  11. package/dist/Group-_emcIVxI.js +0 -48
  12. package/dist/Heading-B2153VXe.js +0 -16
  13. package/dist/Hidden-rE6uR-lr.js +0 -41
  14. package/dist/Input-BxpFEIXV.js +0 -133
  15. package/dist/Label-icmbmNdI.js +0 -17
  16. package/dist/List-BYNHbol3.js +0 -593
  17. package/dist/ListBox-mJ4nQaL7.js +0 -581
  18. package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
  19. package/dist/OverlayArrow-BB0CWwdq.js +0 -629
  20. package/dist/RSPContexts-2lR5GG9p.js +0 -14
  21. package/dist/Select-aab027f3.esm--EmXjiL3.js +0 -2469
  22. package/dist/Separator-D9moUgP8.js +0 -322
  23. package/dist/Slider-rz2XRMGm.js +0 -853
  24. package/dist/Text-DVSAPY-K.js +0 -16
  25. package/dist/VisuallyHidden-f9zX67a_.js +0 -48
  26. package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
  27. package/dist/assets/index.css +0 -37
  28. package/dist/assets/style-admin.css +0 -5255
  29. package/dist/assets/style-editor.css +0 -5255
  30. package/dist/assets/style.css +0 -5261
  31. package/dist/assets/wp-font-enhancements.css +0 -8
  32. package/dist/assets/wp-ui-enhancements.css +0 -299
  33. package/dist/components/animated-visibility/animated-visibility.js +0 -105
  34. package/dist/components/base-control/base-control.js +0 -86
  35. package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
  36. package/dist/components/button/button.js +0 -387
  37. package/dist/components/checkbox/checkbox.js +0 -320
  38. package/dist/components/color-pickers/color-picker.js +0 -272
  39. package/dist/components/color-pickers/color-swatch.js +0 -58
  40. package/dist/components/color-pickers/gradient-editor.js +0 -534
  41. package/dist/components/color-pickers/solid-color-picker.js +0 -1567
  42. package/dist/components/component-toggle/component-toggle.js +0 -158
  43. package/dist/components/container-panel/container-panel.js +0 -131
  44. package/dist/components/draggable/draggable-context.js +0 -5
  45. package/dist/components/draggable/draggable-handle.js +0 -46
  46. package/dist/components/draggable/draggable.js +0 -6207
  47. package/dist/components/draggable-list/draggable-list-context.js +0 -5
  48. package/dist/components/draggable-list/draggable-list-item.js +0 -77
  49. package/dist/components/draggable-list/draggable-list.js +0 -151
  50. package/dist/components/expandable/expandable.js +0 -342
  51. package/dist/components/index.js +0 -137
  52. package/dist/components/input-field/input-field.js +0 -231
  53. package/dist/components/item-collection/item-collection.js +0 -59
  54. package/dist/components/layout/hstack.js +0 -30
  55. package/dist/components/layout/vstack.js +0 -30
  56. package/dist/components/link-input/link-input.js +0 -293
  57. package/dist/components/matrix-align/matrix-align.js +0 -134
  58. package/dist/components/menu/menu.js +0 -285
  59. package/dist/components/modal/modal.js +0 -305
  60. package/dist/components/notice/notice.js +0 -123
  61. package/dist/components/number-picker/number-picker.js +0 -292
  62. package/dist/components/option-select/option-select.js +0 -264
  63. package/dist/components/options-panel/options-panel.js +0 -158
  64. package/dist/components/placeholders/file-placeholder.js +0 -42
  65. package/dist/components/placeholders/image-placeholder.js +0 -88
  66. package/dist/components/placeholders/media-placeholder.js +0 -63
  67. package/dist/components/popover/popover.js +0 -207
  68. package/dist/components/radio/radio.js +0 -579
  69. package/dist/components/repeater/repeater-context.js +0 -5
  70. package/dist/components/repeater/repeater-item.js +0 -119
  71. package/dist/components/repeater/repeater.js +0 -280
  72. package/dist/components/responsive/mini-responsive.js +0 -498
  73. package/dist/components/responsive/responsive-legacy.js +0 -343
  74. package/dist/components/responsive/responsive.js +0 -580
  75. package/dist/components/responsive-preview/responsive-preview.js +0 -123
  76. package/dist/components/rich-label/rich-label.js +0 -66
  77. package/dist/components/select/async-multi-select.js +0 -157
  78. package/dist/components/select/async-single-select.js +0 -137
  79. package/dist/components/select/custom-select-default-components.js +0 -38
  80. package/dist/components/select/multi-select-components.js +0 -8
  81. package/dist/components/select/multi-select.js +0 -151
  82. package/dist/components/select/react-select-component-wrappers.js +0 -90
  83. package/dist/components/select/shared.js +0 -26
  84. package/dist/components/select/single-select.js +0 -131
  85. package/dist/components/select/styles.js +0 -49
  86. package/dist/components/select/v2/async-select.js +0 -297
  87. package/dist/components/select/v2/shared.js +0 -24
  88. package/dist/components/select/v2/single-select.js +0 -990
  89. package/dist/components/slider/column-config-slider.js +0 -210
  90. package/dist/components/slider/slider.js +0 -343
  91. package/dist/components/slider/utils.js +0 -84
  92. package/dist/components/spacer/spacer.js +0 -97
  93. package/dist/components/tabs/tabs.js +0 -702
  94. package/dist/components/toggle/switch.js +0 -155
  95. package/dist/components/toggle/toggle.js +0 -64
  96. package/dist/components/toggle-button/toggle-button.js +0 -324
  97. package/dist/components/tooltip/tooltip.js +0 -525
  98. package/dist/context-D2KUdwNL.js +0 -92
  99. package/dist/default-i18n-CT_oS1Fy.js +0 -922
  100. package/dist/filterDOMProps-EDDcM64A.js +0 -28
  101. package/dist/icons/block-icon.js +0 -42
  102. package/dist/icons/generic-color-swatch.js +0 -113
  103. package/dist/icons/icons.js +0 -30371
  104. package/dist/icons/index.js +0 -11
  105. package/dist/icons/jsx-svg.js +0 -50
  106. package/dist/index-641ee5b8.esm-BPz6U6sJ.js +0 -3137
  107. package/dist/index-BKGQ6jGS.js +0 -44
  108. package/dist/index-BYHhzLf-.js +0 -444
  109. package/dist/index.js +0 -139
  110. package/dist/lite-DVmmD_-j.js +0 -7
  111. package/dist/modifiers.esm-BuJQPI1X.js +0 -31
  112. package/dist/multi-select-components-BlZZoNXC.js +0 -3744
  113. package/dist/number-GajL10e1.js +0 -36
  114. package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
  115. package/dist/react-select-async.esm-CwUoej5h.js +0 -107
  116. package/dist/react-select.esm-DcwYxadV.js +0 -15
  117. package/dist/style-admin.js +0 -1
  118. package/dist/style-editor.js +0 -1
  119. package/dist/style.js +0 -1
  120. package/dist/textSelection-0UUS8Yfg.js +0 -46
  121. package/dist/useButton-BpOKDWEN.js +0 -71
  122. package/dist/useEvent-B0b-6KBr.js +0 -23
  123. package/dist/useFocusRing-CV5l3lf6.js +0 -107
  124. package/dist/useFormReset-C5OggHsw.js +0 -22
  125. package/dist/useFormValidation-DhDNSjws.js +0 -224
  126. package/dist/useHover-DwDr6ozG.js +0 -900
  127. package/dist/useLabel-D7HkNEHT.js +0 -27
  128. package/dist/useLabels-D8cxd1Z8.js +0 -23
  129. package/dist/useListState-UGlN5-7P.js +0 -161
  130. package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
  131. package/dist/useNumberField-CEAj7Mrj.js +0 -1204
  132. package/dist/useNumberFormatter-321rAb4J.js +0 -13
  133. package/dist/usePress-DNW8qpY6.js +0 -664
  134. package/dist/useSingleSelectListState-DC0wWTUM.js +0 -38
  135. package/dist/useToggle-BrpmSOB-.js +0 -59
  136. package/dist/useToggleState-CmQX3SoX.js +0 -19
  137. package/dist/utilities/array-helpers.js +0 -56
  138. package/dist/utilities/debounce-throttle.js +0 -123
  139. package/dist/utilities/es-dash.js +0 -376
  140. package/dist/utilities/index.js +0 -27
  141. package/dist/utilities/text-helpers.js +0 -136
  142. package/dist/utils-DkCSC521.js +0 -370
  143. package/dist/wp/wp-font-enhancements.js +0 -1
  144. package/dist/wp/wp-ui-enhancements.js +0 -1
@@ -1,1204 +0,0 @@
1
- import { b as $458b0a5536c1a7cf$export$40bfa8c7b0832715, g as $03deb23ff14920c4$export$4eaf04e54aa8eed6, o as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, K as $c87311424ea30a05$export$186c6964ca17d99, u as $c87311424ea30a05$export$a11b0059900ceec8, c as $c87311424ea30a05$export$fedb369cb70207f1 } from "./useHover-DwDr6ozG.js";
2
- import { $ as $9446cca9a3875146$export$cb6e0bb50bc19463, a as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-GajL10e1.js";
3
- import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, b as $e5be200c675c3b3a$export$a763b9476acd3eb } from "./useFormValidation-DhDNSjws.js";
4
- import { $ as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 } from "./NumberFormatter-DA8u1Ot7.js";
5
- import { useCallback, useState, useMemo, useEffect, useRef } from "react";
6
- import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, p as $ff5963eb1fccf552$export$e08e3b67e392101e } from "./utils-DkCSC521.js";
7
- import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
8
- import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-C5OggHsw.js";
9
- import { a as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-CV5l3lf6.js";
10
- import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-B0b-6KBr.js";
11
- import { b as $2d73ec29415bd339$export$712718f7aec83d5 } from "./Input-BxpFEIXV.js";
12
- import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-CFP1YZWQ.js";
13
- import { $ as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-321rAb4J.js";
14
- import { c as $319e236875307eab$export$d10ae4f68404609a, b as $319e236875307eab$export$a9b970dcc4ae71a9 } from "./Button-CvzGKGCo.js";
15
- function $7d0a636d7a4dcefd$export$2123ff2b87c81ca(props, ref) {
16
- let { onScroll, isDisabled } = props;
17
- let onScrollHandler = useCallback((e) => {
18
- if (e.ctrlKey) return;
19
- e.preventDefault();
20
- e.stopPropagation();
21
- if (onScroll) onScroll({
22
- deltaX: e.deltaX,
23
- deltaY: e.deltaY
24
- });
25
- }, [
26
- onScroll
27
- ]);
28
- $e9faafb641e167db$export$90fc3a17d93f704c(ref, "wheel", isDisabled ? void 0 : onScrollHandler);
29
- }
30
- const $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = new RegExp("^.*\\(.*\\).*$");
31
- const $6c7bd7858deea686$var$NUMBERING_SYSTEMS = [
32
- "latn",
33
- "arab",
34
- "hanidec",
35
- "deva",
36
- "beng"
37
- ];
38
- class $6c7bd7858deea686$export$cd11ab140839f11d {
39
- /**
40
- * Parses the given string to a number. Returns NaN if a valid number could not be parsed.
41
- */
42
- parse(value) {
43
- return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).parse(value);
44
- }
45
- /**
46
- * Returns whether the given string could potentially be a valid number. This should be used to
47
- * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
48
- * of the minus/plus sign characters can be checked.
49
- */
50
- isValidPartialNumber(value, minValue, maxValue) {
51
- return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);
52
- }
53
- /**
54
- * Returns a numbering system for which the given string is valid in the current locale.
55
- * If no numbering system could be detected, the default numbering system for the current
56
- * locale is returned.
57
- */
58
- getNumberingSystem(value) {
59
- return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;
60
- }
61
- constructor(locale, options = {}) {
62
- this.locale = locale;
63
- this.options = options;
64
- }
65
- }
66
- const $6c7bd7858deea686$var$numberParserCache = /* @__PURE__ */ new Map();
67
- function $6c7bd7858deea686$var$getNumberParserImpl(locale, options, value) {
68
- let defaultParser = $6c7bd7858deea686$var$getCachedNumberParser(locale, options);
69
- if (!locale.includes("-nu-") && !defaultParser.isValidPartialNumber(value)) {
70
- for (let numberingSystem of $6c7bd7858deea686$var$NUMBERING_SYSTEMS) if (numberingSystem !== defaultParser.options.numberingSystem) {
71
- let parser = $6c7bd7858deea686$var$getCachedNumberParser(locale + (locale.includes("-u-") ? "-nu-" : "-u-nu-") + numberingSystem, options);
72
- if (parser.isValidPartialNumber(value)) return parser;
73
- }
74
- }
75
- return defaultParser;
76
- }
77
- function $6c7bd7858deea686$var$getCachedNumberParser(locale, options) {
78
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
79
- let parser = $6c7bd7858deea686$var$numberParserCache.get(cacheKey);
80
- if (!parser) {
81
- parser = new $6c7bd7858deea686$var$NumberParserImpl(locale, options);
82
- $6c7bd7858deea686$var$numberParserCache.set(cacheKey, parser);
83
- }
84
- return parser;
85
- }
86
- class $6c7bd7858deea686$var$NumberParserImpl {
87
- parse(value) {
88
- let fullySanitizedValue = this.sanitize(value);
89
- if (this.symbols.group)
90
- fullySanitizedValue = $6c7bd7858deea686$var$replaceAll(fullySanitizedValue, this.symbols.group, "");
91
- if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, ".");
92
- if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, "-");
93
- fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);
94
- if (this.options.style === "percent") {
95
- let isNegative = fullySanitizedValue.indexOf("-");
96
- fullySanitizedValue = fullySanitizedValue.replace("-", "");
97
- let index = fullySanitizedValue.indexOf(".");
98
- if (index === -1) index = fullySanitizedValue.length;
99
- fullySanitizedValue = fullySanitizedValue.replace(".", "");
100
- if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;
101
- else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;
102
- else if (index - 2 === -2) fullySanitizedValue = "0.00";
103
- else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;
104
- if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;
105
- }
106
- let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;
107
- if (isNaN(newValue)) return NaN;
108
- if (this.options.style === "percent") {
109
- var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
110
- let options = {
111
- ...this.options,
112
- style: "decimal",
113
- minimumFractionDigits: Math.min(((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) + 2, 20),
114
- maximumFractionDigits: Math.min(((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) + 2, 20)
115
- };
116
- return new $6c7bd7858deea686$export$cd11ab140839f11d(this.locale, options).parse(new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(this.locale, options).format(newValue));
117
- }
118
- if (this.options.currencySign === "accounting" && $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;
119
- return newValue;
120
- }
121
- sanitize(value) {
122
- value = value.replace(this.symbols.literals, "");
123
- if (this.symbols.minusSign) value = value.replace("-", this.symbols.minusSign);
124
- if (this.options.numberingSystem === "arab") {
125
- if (this.symbols.decimal) {
126
- value = value.replace(",", this.symbols.decimal);
127
- value = value.replace(String.fromCharCode(1548), this.symbols.decimal);
128
- }
129
- if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, ".", this.symbols.group);
130
- }
131
- if (this.options.locale === "fr-FR") value = $6c7bd7858deea686$var$replaceAll(value, ".", String.fromCharCode(8239));
132
- return value;
133
- }
134
- isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {
135
- value = this.sanitize(value);
136
- if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);
137
- else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);
138
- if (this.symbols.group && value.startsWith(this.symbols.group)) return false;
139
- if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;
140
- if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, this.symbols.group, "");
141
- value = value.replace(this.symbols.numeral, "");
142
- if (this.symbols.decimal) value = value.replace(this.symbols.decimal, "");
143
- return value.length === 0;
144
- }
145
- constructor(locale, options = {}) {
146
- this.locale = locale;
147
- this.formatter = new Intl.NumberFormat(locale, options);
148
- this.options = this.formatter.resolvedOptions();
149
- this.symbols = $6c7bd7858deea686$var$getSymbols(locale, this.formatter, this.options, options);
150
- var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
151
- if (this.options.style === "percent" && (((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) > 18 || ((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) > 18)) console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
152
- }
153
- }
154
- const $6c7bd7858deea686$var$nonLiteralParts = /* @__PURE__ */ new Set([
155
- "decimal",
156
- "fraction",
157
- "integer",
158
- "minusSign",
159
- "plusSign",
160
- "group"
161
- ]);
162
- const $6c7bd7858deea686$var$pluralNumbers = [
163
- 0,
164
- 4,
165
- 2,
166
- 1,
167
- 11,
168
- 20,
169
- 3,
170
- 7,
171
- 100,
172
- 21,
173
- 0.1,
174
- 1.1
175
- ];
176
- function $6c7bd7858deea686$var$getSymbols(locale, formatter, intlOptions, originalOptions) {
177
- var _allParts_find, _posAllParts_find, _decimalParts_find, _allParts_find1;
178
- let symbolFormatter = new Intl.NumberFormat(locale, {
179
- ...intlOptions,
180
- // Resets so we get the full range of symbols
181
- minimumSignificantDigits: 1,
182
- maximumSignificantDigits: 21,
183
- roundingIncrement: 1,
184
- roundingPriority: "auto",
185
- roundingMode: "halfExpand"
186
- });
187
- let allParts = symbolFormatter.formatToParts(-10000.111);
188
- let posAllParts = symbolFormatter.formatToParts(10000.111);
189
- let pluralParts = $6c7bd7858deea686$var$pluralNumbers.map((n) => symbolFormatter.formatToParts(n));
190
- var _allParts_find_value;
191
- let minusSign = (_allParts_find_value = (_allParts_find = allParts.find((p) => p.type === "minusSign")) === null || _allParts_find === void 0 ? void 0 : _allParts_find.value) !== null && _allParts_find_value !== void 0 ? _allParts_find_value : "-";
192
- let plusSign = (_posAllParts_find = posAllParts.find((p) => p.type === "plusSign")) === null || _posAllParts_find === void 0 ? void 0 : _posAllParts_find.value;
193
- if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "exceptZero" || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "always")) plusSign = "+";
194
- let decimalParts = new Intl.NumberFormat(locale, {
195
- ...intlOptions,
196
- minimumFractionDigits: 2,
197
- maximumFractionDigits: 2
198
- }).formatToParts(1e-3);
199
- let decimal = (_decimalParts_find = decimalParts.find((p) => p.type === "decimal")) === null || _decimalParts_find === void 0 ? void 0 : _decimalParts_find.value;
200
- let group = (_allParts_find1 = allParts.find((p) => p.type === "group")) === null || _allParts_find1 === void 0 ? void 0 : _allParts_find1.value;
201
- let allPartsLiterals = allParts.filter((p) => !$6c7bd7858deea686$var$nonLiteralParts.has(p.type)).map((p) => $6c7bd7858deea686$var$escapeRegex(p.value));
202
- let pluralPartsLiterals = pluralParts.flatMap((p) => p.filter((p2) => !$6c7bd7858deea686$var$nonLiteralParts.has(p2.type)).map((p2) => $6c7bd7858deea686$var$escapeRegex(p2.value)));
203
- let sortedLiterals = [
204
- .../* @__PURE__ */ new Set([
205
- ...allPartsLiterals,
206
- ...pluralPartsLiterals
207
- ])
208
- ].sort((a, b) => b.length - a.length);
209
- let literals = sortedLiterals.length === 0 ? new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${sortedLiterals.join("|")}|[\\p{White_Space}]`, "gu");
210
- let numerals = [
211
- ...new Intl.NumberFormat(intlOptions.locale, {
212
- useGrouping: false
213
- }).format(9876543210)
214
- ].reverse();
215
- let indexes = new Map(numerals.map((d, i) => [
216
- d,
217
- i
218
- ]));
219
- let numeral = new RegExp(`[${numerals.join("")}]`, "g");
220
- let index = (d) => String(indexes.get(d));
221
- return {
222
- minusSign,
223
- plusSign,
224
- decimal,
225
- group,
226
- literals,
227
- numeral,
228
- index
229
- };
230
- }
231
- function $6c7bd7858deea686$var$replaceAll(str, find, replace) {
232
- if (str.replaceAll) return str.replaceAll(find, replace);
233
- return str.split(find).join(replace);
234
- }
235
- function $6c7bd7858deea686$var$escapeRegex(string) {
236
- return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
237
- }
238
- function $de67e98908f0c6ee$export$7f629e9dc1ecf37c(props) {
239
- let { minValue, maxValue, step, formatOptions, value, defaultValue = NaN, onChange, locale, isDisabled, isReadOnly } = props;
240
- if (value === null) value = NaN;
241
- if (value !== void 0 && !isNaN(value)) {
242
- if (step !== void 0 && !isNaN(step)) value = $9446cca9a3875146$export$cb6e0bb50bc19463(value, minValue, maxValue, step);
243
- else value = $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, minValue, maxValue);
244
- }
245
- if (!isNaN(defaultValue)) {
246
- if (step !== void 0 && !isNaN(step)) defaultValue = $9446cca9a3875146$export$cb6e0bb50bc19463(defaultValue, minValue, maxValue, step);
247
- else defaultValue = $9446cca9a3875146$export$7d15b64cf5a3a4c4(defaultValue, minValue, maxValue);
248
- }
249
- let [numberValue, setNumberValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, isNaN(defaultValue) ? NaN : defaultValue, onChange);
250
- let [inputValue, setInputValue] = useState(() => isNaN(numberValue) ? "" : new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(locale, formatOptions).format(numberValue));
251
- let numberParser = useMemo(() => new $6c7bd7858deea686$export$cd11ab140839f11d(locale, formatOptions), [
252
- locale,
253
- formatOptions
254
- ]);
255
- let numberingSystem = useMemo(() => numberParser.getNumberingSystem(inputValue), [
256
- numberParser,
257
- inputValue
258
- ]);
259
- let formatter = useMemo(() => new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(locale, {
260
- ...formatOptions,
261
- numberingSystem
262
- }), [
263
- locale,
264
- formatOptions,
265
- numberingSystem
266
- ]);
267
- let intlOptions = useMemo(() => formatter.resolvedOptions(), [
268
- formatter
269
- ]);
270
- let format = useCallback((value2) => isNaN(value2) || value2 === null ? "" : formatter.format(value2), [
271
- formatter
272
- ]);
273
- let validation = $e5be200c675c3b3a$export$fc1a364ae1f3ff10({
274
- ...props,
275
- value: numberValue
276
- });
277
- let clampStep = step !== void 0 && !isNaN(step) ? step : 1;
278
- if (intlOptions.style === "percent" && (step === void 0 || isNaN(step))) clampStep = 0.01;
279
- let [prevValue, setPrevValue] = useState(numberValue);
280
- let [prevLocale, setPrevLocale] = useState(locale);
281
- let [prevFormatOptions, setPrevFormatOptions] = useState(formatOptions);
282
- if (!Object.is(numberValue, prevValue) || locale !== prevLocale || formatOptions !== prevFormatOptions) {
283
- setInputValue(format(numberValue));
284
- setPrevValue(numberValue);
285
- setPrevLocale(locale);
286
- setPrevFormatOptions(formatOptions);
287
- }
288
- let parsedValue = useMemo(() => numberParser.parse(inputValue), [
289
- numberParser,
290
- inputValue
291
- ]);
292
- let commit = () => {
293
- if (!inputValue.length) {
294
- setNumberValue(NaN);
295
- setInputValue(value === void 0 ? "" : format(numberValue));
296
- return;
297
- }
298
- if (isNaN(parsedValue)) {
299
- setInputValue(format(numberValue));
300
- return;
301
- }
302
- let clampedValue;
303
- if (step === void 0 || isNaN(step)) clampedValue = $9446cca9a3875146$export$7d15b64cf5a3a4c4(parsedValue, minValue, maxValue);
304
- else clampedValue = $9446cca9a3875146$export$cb6e0bb50bc19463(parsedValue, minValue, maxValue, step);
305
- clampedValue = numberParser.parse(format(clampedValue));
306
- setNumberValue(clampedValue);
307
- setInputValue(format(value === void 0 ? clampedValue : numberValue));
308
- };
309
- let safeNextStep = (operation, minMax = 0) => {
310
- let prev = parsedValue;
311
- if (isNaN(prev)) {
312
- let newValue = isNaN(minMax) ? 0 : minMax;
313
- return $9446cca9a3875146$export$cb6e0bb50bc19463(newValue, minValue, maxValue, clampStep);
314
- } else {
315
- let newValue = $9446cca9a3875146$export$cb6e0bb50bc19463(prev, minValue, maxValue, clampStep);
316
- if (operation === "+" && newValue > prev || operation === "-" && newValue < prev) return newValue;
317
- return $9446cca9a3875146$export$cb6e0bb50bc19463($de67e98908f0c6ee$var$handleDecimalOperation(operation, prev, clampStep), minValue, maxValue, clampStep);
318
- }
319
- };
320
- let increment = () => {
321
- let newValue = safeNextStep("+", minValue);
322
- if (newValue === numberValue) setInputValue(format(newValue));
323
- setNumberValue(newValue);
324
- validation.commitValidation();
325
- };
326
- let decrement = () => {
327
- let newValue = safeNextStep("-", maxValue);
328
- if (newValue === numberValue) setInputValue(format(newValue));
329
- setNumberValue(newValue);
330
- validation.commitValidation();
331
- };
332
- let incrementToMax = () => {
333
- if (maxValue != null) {
334
- setNumberValue($9446cca9a3875146$export$cb6e0bb50bc19463(maxValue, minValue, maxValue, clampStep));
335
- validation.commitValidation();
336
- }
337
- };
338
- let decrementToMin = () => {
339
- if (minValue != null) {
340
- setNumberValue(minValue);
341
- validation.commitValidation();
342
- }
343
- };
344
- let canIncrement = useMemo(() => !isDisabled && !isReadOnly && (isNaN(parsedValue) || maxValue === void 0 || isNaN(maxValue) || $9446cca9a3875146$export$cb6e0bb50bc19463(parsedValue, minValue, maxValue, clampStep) > parsedValue || $de67e98908f0c6ee$var$handleDecimalOperation("+", parsedValue, clampStep) <= maxValue), [
345
- isDisabled,
346
- isReadOnly,
347
- minValue,
348
- maxValue,
349
- clampStep,
350
- parsedValue
351
- ]);
352
- let canDecrement = useMemo(() => !isDisabled && !isReadOnly && (isNaN(parsedValue) || minValue === void 0 || isNaN(minValue) || $9446cca9a3875146$export$cb6e0bb50bc19463(parsedValue, minValue, maxValue, clampStep) < parsedValue || $de67e98908f0c6ee$var$handleDecimalOperation("-", parsedValue, clampStep) >= minValue), [
353
- isDisabled,
354
- isReadOnly,
355
- minValue,
356
- maxValue,
357
- clampStep,
358
- parsedValue
359
- ]);
360
- let validate = (value2) => numberParser.isValidPartialNumber(value2, minValue, maxValue);
361
- return {
362
- ...validation,
363
- validate,
364
- increment,
365
- incrementToMax,
366
- decrement,
367
- decrementToMin,
368
- canIncrement,
369
- canDecrement,
370
- minValue,
371
- maxValue,
372
- numberValue: parsedValue,
373
- setNumberValue,
374
- setInputValue,
375
- inputValue,
376
- commit
377
- };
378
- }
379
- function $de67e98908f0c6ee$var$handleDecimalOperation(operator, value1, value2) {
380
- let result = operator === "+" ? value1 + value2 : value1 - value2;
381
- if (value1 % 1 !== 0 || value2 % 1 !== 0) {
382
- const value1Decimal = value1.toString().split(".");
383
- const value2Decimal = value2.toString().split(".");
384
- const value1DecimalLength = value1Decimal[1] && value1Decimal[1].length || 0;
385
- const value2DecimalLength = value2Decimal[1] && value2Decimal[1].length || 0;
386
- const multiplier = Math.pow(10, Math.max(value1DecimalLength, value2DecimalLength));
387
- value1 = Math.round(value1 * multiplier);
388
- value2 = Math.round(value2 * multiplier);
389
- result = operator === "+" ? value1 + value2 : value1 - value2;
390
- result /= multiplier;
391
- }
392
- return result;
393
- }
394
- function $d841c8010a73d545$var$supportsNativeBeforeInputEvent() {
395
- return typeof window !== "undefined" && window.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
396
- }
397
- function $d841c8010a73d545$export$4f384c9210e583c3(props, state, inputRef) {
398
- let onBeforeInputFallback = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
399
- let input = inputRef.current;
400
- if (!input) return;
401
- let nextValue = null;
402
- switch (e.inputType) {
403
- case "historyUndo":
404
- case "historyRedo":
405
- return;
406
- case "insertLineBreak":
407
- return;
408
- case "deleteContent":
409
- case "deleteByCut":
410
- case "deleteByDrag":
411
- nextValue = input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
412
- break;
413
- case "deleteContentForward":
414
- nextValue = input.selectionEnd === input.selectionStart ? input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd + 1) : input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
415
- break;
416
- case "deleteContentBackward":
417
- nextValue = input.selectionEnd === input.selectionStart ? input.value.slice(0, input.selectionStart - 1) + input.value.slice(input.selectionStart) : input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
418
- break;
419
- case "deleteSoftLineBackward":
420
- case "deleteHardLineBackward":
421
- nextValue = input.value.slice(input.selectionStart);
422
- break;
423
- default:
424
- if (e.data != null) nextValue = input.value.slice(0, input.selectionStart) + e.data + input.value.slice(input.selectionEnd);
425
- break;
426
- }
427
- if (nextValue == null || !state.validate(nextValue)) e.preventDefault();
428
- });
429
- useEffect(() => {
430
- if (!$d841c8010a73d545$var$supportsNativeBeforeInputEvent() || !inputRef.current) return;
431
- let input = inputRef.current;
432
- input.addEventListener("beforeinput", onBeforeInputFallback, false);
433
- return () => {
434
- input.removeEventListener("beforeinput", onBeforeInputFallback, false);
435
- };
436
- }, [
437
- inputRef,
438
- onBeforeInputFallback
439
- ]);
440
- let onBeforeInput = !$d841c8010a73d545$var$supportsNativeBeforeInputEvent() ? (e) => {
441
- let nextValue = e.target.value.slice(0, e.target.selectionStart) + e.data + e.target.value.slice(e.target.selectionEnd);
442
- if (!state.validate(nextValue)) e.preventDefault();
443
- } : null;
444
- let { labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5(props, inputRef);
445
- let compositionStartState = useRef(null);
446
- return {
447
- inputProps: $3ef42575df84b30b$export$9d1611c77c2fe928(textFieldProps, {
448
- onBeforeInput,
449
- onCompositionStart() {
450
- let { value, selectionStart, selectionEnd } = inputRef.current;
451
- compositionStartState.current = {
452
- value,
453
- selectionStart,
454
- selectionEnd
455
- };
456
- },
457
- onCompositionEnd() {
458
- if (inputRef.current && !state.validate(inputRef.current.value)) {
459
- let { value, selectionStart, selectionEnd } = compositionStartState.current;
460
- inputRef.current.value = value;
461
- inputRef.current.setSelectionRange(selectionStart, selectionEnd);
462
- state.setInputValue(value);
463
- }
464
- }
465
- }),
466
- labelProps,
467
- descriptionProps,
468
- errorMessageProps,
469
- ...validation
470
- };
471
- }
472
- var $ed6aae4e5f766f1e$exports = {};
473
- $ed6aae4e5f766f1e$exports = {
474
- "Empty": `فارغ`
475
- };
476
- var $38854e2b175151fa$exports = {};
477
- $38854e2b175151fa$exports = {
478
- "Empty": `Изпразни`
479
- };
480
- var $15b25ab20f3945b2$exports = {};
481
- $15b25ab20f3945b2$exports = {
482
- "Empty": `Prázdné`
483
- };
484
- var $692a4298b6b649a2$exports = {};
485
- $692a4298b6b649a2$exports = {
486
- "Empty": `Tom`
487
- };
488
- var $1c6e1539193f1243$exports = {};
489
- $1c6e1539193f1243$exports = {
490
- "Empty": `Leer`
491
- };
492
- var $1e8678632c464b6d$exports = {};
493
- $1e8678632c464b6d$exports = {
494
- "Empty": `Άδειο`
495
- };
496
- var $4adc85d9bf5b9eed$exports = {};
497
- $4adc85d9bf5b9eed$exports = {
498
- "Empty": `Empty`
499
- };
500
- var $41c4b2bb61dafbca$exports = {};
501
- $41c4b2bb61dafbca$exports = {
502
- "Empty": `Vacío`
503
- };
504
- var $405f8b24f5dd2a60$exports = {};
505
- $405f8b24f5dd2a60$exports = {
506
- "Empty": `Tühjenda`
507
- };
508
- var $7efe3ed02b9b9dd4$exports = {};
509
- $7efe3ed02b9b9dd4$exports = {
510
- "Empty": `Tyhjä`
511
- };
512
- var $99fc4c101d92daf3$exports = {};
513
- $99fc4c101d92daf3$exports = {
514
- "Empty": `Vide`
515
- };
516
- var $f9e155e6e8cacaa2$exports = {};
517
- $f9e155e6e8cacaa2$exports = {
518
- "Empty": `ריק`
519
- };
520
- var $c31b5e8e9a249fd5$exports = {};
521
- $c31b5e8e9a249fd5$exports = {
522
- "Empty": `Prazno`
523
- };
524
- var $9c5435bc17499bd9$exports = {};
525
- $9c5435bc17499bd9$exports = {
526
- "Empty": `Üres`
527
- };
528
- var $6d1fc8e84d8165e1$exports = {};
529
- $6d1fc8e84d8165e1$exports = {
530
- "Empty": `Vuoto`
531
- };
532
- var $46ea6b3641b83e71$exports = {};
533
- $46ea6b3641b83e71$exports = {
534
- "Empty": `空`
535
- };
536
- var $0e3cc9a288289dc5$exports = {};
537
- $0e3cc9a288289dc5$exports = {
538
- "Empty": `비어 있음`
539
- };
540
- var $4ff2bb25c0089ffb$exports = {};
541
- $4ff2bb25c0089ffb$exports = {
542
- "Empty": `Tuščias`
543
- };
544
- var $6cf33cd4c010a2fb$exports = {};
545
- $6cf33cd4c010a2fb$exports = {
546
- "Empty": `Tukšs`
547
- };
548
- var $5a9f8486f8b8837e$exports = {};
549
- $5a9f8486f8b8837e$exports = {
550
- "Empty": `Tom`
551
- };
552
- var $583f94d807f6ecea$exports = {};
553
- $583f94d807f6ecea$exports = {
554
- "Empty": `Leeg`
555
- };
556
- var $cc4dcfeea2b4050d$exports = {};
557
- $cc4dcfeea2b4050d$exports = {
558
- "Empty": `Pusty`
559
- };
560
- var $68ac2954d56e12b4$exports = {};
561
- $68ac2954d56e12b4$exports = {
562
- "Empty": `Vazio`
563
- };
564
- var $fdb0616f309780b0$exports = {};
565
- $fdb0616f309780b0$exports = {
566
- "Empty": `Vazio`
567
- };
568
- var $fe1eccf4ee1d6f52$exports = {};
569
- $fe1eccf4ee1d6f52$exports = {
570
- "Empty": `Gol`
571
- };
572
- var $a38b6c4e18725976$exports = {};
573
- $a38b6c4e18725976$exports = {
574
- "Empty": `Не заполнено`
575
- };
576
- var $6c14ae2b766b652c$exports = {};
577
- $6c14ae2b766b652c$exports = {
578
- "Empty": `Prázdne`
579
- };
580
- var $8f1c9692e16dc5eb$exports = {};
581
- $8f1c9692e16dc5eb$exports = {
582
- "Empty": `Prazen`
583
- };
584
- var $d2aa7abea627cafa$exports = {};
585
- $d2aa7abea627cafa$exports = {
586
- "Empty": `Prazno`
587
- };
588
- var $676b82e4b56408e6$exports = {};
589
- $676b82e4b56408e6$exports = {
590
- "Empty": `Tomt`
591
- };
592
- var $14c9042552d7ce08$exports = {};
593
- $14c9042552d7ce08$exports = {
594
- "Empty": `Boş`
595
- };
596
- var $393254ebcb66c9f5$exports = {};
597
- $393254ebcb66c9f5$exports = {
598
- "Empty": `Пусто`
599
- };
600
- var $d49d621f310cf6ce$exports = {};
601
- $d49d621f310cf6ce$exports = {
602
- "Empty": `空`
603
- };
604
- var $94b60c866ca5dfe6$exports = {};
605
- $94b60c866ca5dfe6$exports = {
606
- "Empty": `空白`
607
- };
608
- var $a99895ee3dc79e61$exports = {};
609
- $a99895ee3dc79e61$exports = {
610
- "ar-AE": $ed6aae4e5f766f1e$exports,
611
- "bg-BG": $38854e2b175151fa$exports,
612
- "cs-CZ": $15b25ab20f3945b2$exports,
613
- "da-DK": $692a4298b6b649a2$exports,
614
- "de-DE": $1c6e1539193f1243$exports,
615
- "el-GR": $1e8678632c464b6d$exports,
616
- "en-US": $4adc85d9bf5b9eed$exports,
617
- "es-ES": $41c4b2bb61dafbca$exports,
618
- "et-EE": $405f8b24f5dd2a60$exports,
619
- "fi-FI": $7efe3ed02b9b9dd4$exports,
620
- "fr-FR": $99fc4c101d92daf3$exports,
621
- "he-IL": $f9e155e6e8cacaa2$exports,
622
- "hr-HR": $c31b5e8e9a249fd5$exports,
623
- "hu-HU": $9c5435bc17499bd9$exports,
624
- "it-IT": $6d1fc8e84d8165e1$exports,
625
- "ja-JP": $46ea6b3641b83e71$exports,
626
- "ko-KR": $0e3cc9a288289dc5$exports,
627
- "lt-LT": $4ff2bb25c0089ffb$exports,
628
- "lv-LV": $6cf33cd4c010a2fb$exports,
629
- "nb-NO": $5a9f8486f8b8837e$exports,
630
- "nl-NL": $583f94d807f6ecea$exports,
631
- "pl-PL": $cc4dcfeea2b4050d$exports,
632
- "pt-BR": $68ac2954d56e12b4$exports,
633
- "pt-PT": $fdb0616f309780b0$exports,
634
- "ro-RO": $fe1eccf4ee1d6f52$exports,
635
- "ru-RU": $a38b6c4e18725976$exports,
636
- "sk-SK": $6c14ae2b766b652c$exports,
637
- "sl-SI": $8f1c9692e16dc5eb$exports,
638
- "sr-SP": $d2aa7abea627cafa$exports,
639
- "sv-SE": $676b82e4b56408e6$exports,
640
- "tr-TR": $14c9042552d7ce08$exports,
641
- "uk-UA": $393254ebcb66c9f5$exports,
642
- "zh-CN": $d49d621f310cf6ce$exports,
643
- "zh-TW": $94b60c866ca5dfe6$exports
644
- };
645
- function $parcel$interopDefault$1(a) {
646
- return a && a.__esModule ? a.default : a;
647
- }
648
- function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
649
- const _async = useRef(void 0);
650
- let { value, textValue, minValue, maxValue, isDisabled, isReadOnly, isRequired, onIncrement, onIncrementPage, onDecrement, onDecrementPage, onDecrementToMin, onIncrementToMax } = props;
651
- const stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault$1($a99895ee3dc79e61$exports), "@react-aria/spinbutton");
652
- const clearAsync = () => clearTimeout(_async.current);
653
- useEffect(() => {
654
- return () => clearAsync();
655
- }, []);
656
- let onKeyDown = (e) => {
657
- if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) return;
658
- switch (e.key) {
659
- case "PageUp":
660
- if (onIncrementPage) {
661
- e.preventDefault();
662
- onIncrementPage === null || onIncrementPage === void 0 ? void 0 : onIncrementPage();
663
- break;
664
- }
665
- // fallthrough!
666
- case "ArrowUp":
667
- case "Up":
668
- if (onIncrement) {
669
- e.preventDefault();
670
- onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement();
671
- }
672
- break;
673
- case "PageDown":
674
- if (onDecrementPage) {
675
- e.preventDefault();
676
- onDecrementPage === null || onDecrementPage === void 0 ? void 0 : onDecrementPage();
677
- break;
678
- }
679
- // fallthrough
680
- case "ArrowDown":
681
- case "Down":
682
- if (onDecrement) {
683
- e.preventDefault();
684
- onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement();
685
- }
686
- break;
687
- case "Home":
688
- if (onDecrementToMin) {
689
- e.preventDefault();
690
- onDecrementToMin === null || onDecrementToMin === void 0 ? void 0 : onDecrementToMin();
691
- }
692
- break;
693
- case "End":
694
- if (onIncrementToMax) {
695
- e.preventDefault();
696
- onIncrementToMax === null || onIncrementToMax === void 0 ? void 0 : onIncrementToMax();
697
- }
698
- break;
699
- }
700
- };
701
- let isFocused = useRef(false);
702
- let onFocus = () => {
703
- isFocused.current = true;
704
- };
705
- let onBlur = () => {
706
- isFocused.current = false;
707
- };
708
- let ariaTextValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "−");
709
- useEffect(() => {
710
- if (isFocused.current) {
711
- $319e236875307eab$export$d10ae4f68404609a("assertive");
712
- $319e236875307eab$export$a9b970dcc4ae71a9(ariaTextValue, "assertive");
713
- }
714
- }, [
715
- ariaTextValue
716
- ]);
717
- const onIncrementPressStart = $8ae05eaa5c114e9c$export$7f54fc3180508a52((initialStepDelay) => {
718
- clearAsync();
719
- onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement();
720
- _async.current = window.setTimeout(() => {
721
- if (maxValue === void 0 || isNaN(maxValue) || value === void 0 || isNaN(value) || value < maxValue) onIncrementPressStart(60);
722
- }, initialStepDelay);
723
- });
724
- const onDecrementPressStart = $8ae05eaa5c114e9c$export$7f54fc3180508a52((initialStepDelay) => {
725
- clearAsync();
726
- onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement();
727
- _async.current = window.setTimeout(() => {
728
- if (minValue === void 0 || isNaN(minValue) || value === void 0 || isNaN(value) || value > minValue) onDecrementPressStart(60);
729
- }, initialStepDelay);
730
- });
731
- let cancelContextMenu = (e) => {
732
- e.preventDefault();
733
- };
734
- let { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
735
- return {
736
- spinButtonProps: {
737
- role: "spinbutton",
738
- "aria-valuenow": value !== void 0 && !isNaN(value) ? value : void 0,
739
- "aria-valuetext": ariaTextValue,
740
- "aria-valuemin": minValue,
741
- "aria-valuemax": maxValue,
742
- "aria-disabled": isDisabled || void 0,
743
- "aria-readonly": isReadOnly || void 0,
744
- "aria-required": isRequired || void 0,
745
- onKeyDown,
746
- onFocus,
747
- onBlur
748
- },
749
- incrementButtonProps: {
750
- onPressStart: () => {
751
- onIncrementPressStart(400);
752
- addGlobalListener(window, "contextmenu", cancelContextMenu);
753
- },
754
- onPressEnd: () => {
755
- clearAsync();
756
- removeAllGlobalListeners();
757
- },
758
- onFocus,
759
- onBlur
760
- },
761
- decrementButtonProps: {
762
- onPressStart: () => {
763
- onDecrementPressStart(400);
764
- addGlobalListener(window, "contextmenu", cancelContextMenu);
765
- },
766
- onPressEnd: () => {
767
- clearAsync();
768
- removeAllGlobalListeners();
769
- },
770
- onFocus,
771
- onBlur
772
- }
773
- };
774
- }
775
- var $fb78e0f6ab6349ed$exports = {};
776
- $fb78e0f6ab6349ed$exports = {
777
- "decrease": (args) => `خفض ${args.fieldLabel}`,
778
- "increase": (args) => `زيادة ${args.fieldLabel}`,
779
- "numberField": `حقل رقمي`
780
- };
781
- var $2776acdd9959a647$exports = {};
782
- $2776acdd9959a647$exports = {
783
- "decrease": (args) => `Намаляване ${args.fieldLabel}`,
784
- "increase": (args) => `Усилване ${args.fieldLabel}`,
785
- "numberField": `Номер на полето`
786
- };
787
- var $741954410a365ad3$exports = {};
788
- $741954410a365ad3$exports = {
789
- "decrease": (args) => `Snížit ${args.fieldLabel}`,
790
- "increase": (args) => `Zvýšit ${args.fieldLabel}`,
791
- "numberField": `Číselné pole`
792
- };
793
- var $8321ed0f8ab642f0$exports = {};
794
- $8321ed0f8ab642f0$exports = {
795
- "decrease": (args) => `Reducer ${args.fieldLabel}`,
796
- "increase": (args) => `Øg ${args.fieldLabel}`,
797
- "numberField": `Talfelt`
798
- };
799
- var $92978e0c4ecafa32$exports = {};
800
- $92978e0c4ecafa32$exports = {
801
- "decrease": (args) => `${args.fieldLabel} verringern`,
802
- "increase": (args) => `${args.fieldLabel} erhöhen`,
803
- "numberField": `Nummernfeld`
804
- };
805
- var $ac5ff71962864a84$exports = {};
806
- $ac5ff71962864a84$exports = {
807
- "decrease": (args) => `Μείωση ${args.fieldLabel}`,
808
- "increase": (args) => `Αύξηση ${args.fieldLabel}`,
809
- "numberField": `Πεδίο αριθμού`
810
- };
811
- var $efe4685e2440d8be$exports = {};
812
- $efe4685e2440d8be$exports = {
813
- "decrease": (args) => `Decrease ${args.fieldLabel}`,
814
- "increase": (args) => `Increase ${args.fieldLabel}`,
815
- "numberField": `Number field`
816
- };
817
- var $e50a9a48739b90e1$exports = {};
818
- $e50a9a48739b90e1$exports = {
819
- "decrease": (args) => `Reducir ${args.fieldLabel}`,
820
- "increase": (args) => `Aumentar ${args.fieldLabel}`,
821
- "numberField": `Campo de número`
822
- };
823
- var $6e0d5294ecbb8ab6$exports = {};
824
- $6e0d5294ecbb8ab6$exports = {
825
- "decrease": (args) => `Vähenda ${args.fieldLabel}`,
826
- "increase": (args) => `Suurenda ${args.fieldLabel}`,
827
- "numberField": `Numbri väli`
828
- };
829
- var $e7129d65f607f77f$exports = {};
830
- $e7129d65f607f77f$exports = {
831
- "decrease": (args) => `Vähennä ${args.fieldLabel}`,
832
- "increase": (args) => `Lisää ${args.fieldLabel}`,
833
- "numberField": `Numerokenttä`
834
- };
835
- var $d72adf5b20573e34$exports = {};
836
- $d72adf5b20573e34$exports = {
837
- "decrease": (args) => `Diminuer ${args.fieldLabel}`,
838
- "increase": (args) => `Augmenter ${args.fieldLabel}`,
839
- "numberField": `Champ de nombre`
840
- };
841
- var $a25c707e88b844a7$exports = {};
842
- $a25c707e88b844a7$exports = {
843
- "decrease": (args) => `הקטן ${args.fieldLabel}`,
844
- "increase": (args) => `הגדל ${args.fieldLabel}`,
845
- "numberField": `שדה מספר`
846
- };
847
- var $69b41140b9a4ca54$exports = {};
848
- $69b41140b9a4ca54$exports = {
849
- "decrease": (args) => `Smanji ${args.fieldLabel}`,
850
- "increase": (args) => `Povećaj ${args.fieldLabel}`,
851
- "numberField": `Polje broja`
852
- };
853
- var $81dab28f37f59d1a$exports = {};
854
- $81dab28f37f59d1a$exports = {
855
- "decrease": (args) => `${args.fieldLabel} csökkentése`,
856
- "increase": (args) => `${args.fieldLabel} növelése`,
857
- "numberField": `Számmező`
858
- };
859
- var $866555b31f2d7711$exports = {};
860
- $866555b31f2d7711$exports = {
861
- "decrease": (args) => `Riduci ${args.fieldLabel}`,
862
- "increase": (args) => `Aumenta ${args.fieldLabel}`,
863
- "numberField": `Campo numero`
864
- };
865
- var $dafcd55d52b9d371$exports = {};
866
- $dafcd55d52b9d371$exports = {
867
- "decrease": (args) => `${args.fieldLabel}を縮小`,
868
- "increase": (args) => `${args.fieldLabel}を拡大`,
869
- "numberField": `数値フィールド`
870
- };
871
- var $f090c1f8c5da0145$exports = {};
872
- $f090c1f8c5da0145$exports = {
873
- "decrease": (args) => `${args.fieldLabel} 감소`,
874
- "increase": (args) => `${args.fieldLabel} 증가`,
875
- "numberField": `번호 필드`
876
- };
877
- var $6f10f3a13360a75c$exports = {};
878
- $6f10f3a13360a75c$exports = {
879
- "decrease": (args) => `Sumažinti ${args.fieldLabel}`,
880
- "increase": (args) => `Padidinti ${args.fieldLabel}`,
881
- "numberField": `Numerio laukas`
882
- };
883
- var $47432cefd4b7bd1b$exports = {};
884
- $47432cefd4b7bd1b$exports = {
885
- "decrease": (args) => `Samazināšana ${args.fieldLabel}`,
886
- "increase": (args) => `Palielināšana ${args.fieldLabel}`,
887
- "numberField": `Skaitļu lauks`
888
- };
889
- var $dc578a950a2bf23d$exports = {};
890
- $dc578a950a2bf23d$exports = {
891
- "decrease": (args) => `Reduser ${args.fieldLabel}`,
892
- "increase": (args) => `Øk ${args.fieldLabel}`,
893
- "numberField": `Tallfelt`
894
- };
895
- var $353f1bfca4dc395a$exports = {};
896
- $353f1bfca4dc395a$exports = {
897
- "decrease": (args) => `${args.fieldLabel} verlagen`,
898
- "increase": (args) => `${args.fieldLabel} verhogen`,
899
- "numberField": `Getalveld`
900
- };
901
- var $241bc0bbd870e982$exports = {};
902
- $241bc0bbd870e982$exports = {
903
- "decrease": (args) => `Zmniejsz ${args.fieldLabel}`,
904
- "increase": (args) => `Zwiększ ${args.fieldLabel}`,
905
- "numberField": `Pole numeru`
906
- };
907
- var $da3005c7bd72b0a8$exports = {};
908
- $da3005c7bd72b0a8$exports = {
909
- "decrease": (args) => `Diminuir ${args.fieldLabel}`,
910
- "increase": (args) => `Aumentar ${args.fieldLabel}`,
911
- "numberField": `Campo de número`
912
- };
913
- var $cf48bfc540882310$exports = {};
914
- $cf48bfc540882310$exports = {
915
- "decrease": (args) => `Diminuir ${args.fieldLabel}`,
916
- "increase": (args) => `Aumentar ${args.fieldLabel}`,
917
- "numberField": `Campo numérico`
918
- };
919
- var $b63a28c481ab9ee3$exports = {};
920
- $b63a28c481ab9ee3$exports = {
921
- "decrease": (args) => `Scădere ${args.fieldLabel}`,
922
- "increase": (args) => `Creștere ${args.fieldLabel}`,
923
- "numberField": `Câmp numeric`
924
- };
925
- var $19f9df95c2464ab6$exports = {};
926
- $19f9df95c2464ab6$exports = {
927
- "decrease": (args) => `Уменьшение ${args.fieldLabel}`,
928
- "increase": (args) => `Увеличение ${args.fieldLabel}`,
929
- "numberField": `Числовое поле`
930
- };
931
- var $b272932a685e8482$exports = {};
932
- $b272932a685e8482$exports = {
933
- "decrease": (args) => `Znížiť ${args.fieldLabel}`,
934
- "increase": (args) => `Zvýšiť ${args.fieldLabel}`,
935
- "numberField": `Číselné pole`
936
- };
937
- var $cbaf8b5b61f9e544$exports = {};
938
- $cbaf8b5b61f9e544$exports = {
939
- "decrease": (args) => `Upadati ${args.fieldLabel}`,
940
- "increase": (args) => `Povečajte ${args.fieldLabel}`,
941
- "numberField": `Številčno polje`
942
- };
943
- var $e0a3af6ac1449b2f$exports = {};
944
- $e0a3af6ac1449b2f$exports = {
945
- "decrease": (args) => `Smanji ${args.fieldLabel}`,
946
- "increase": (args) => `Povećaj ${args.fieldLabel}`,
947
- "numberField": `Polje broja`
948
- };
949
- var $71e167d2458a6019$exports = {};
950
- $71e167d2458a6019$exports = {
951
- "decrease": (args) => `Minska ${args.fieldLabel}`,
952
- "increase": (args) => `Öka ${args.fieldLabel}`,
953
- "numberField": `Nummerfält`
954
- };
955
- var $3719245abc082946$exports = {};
956
- $3719245abc082946$exports = {
957
- "decrease": (args) => `${args.fieldLabel} azalt`,
958
- "increase": (args) => `${args.fieldLabel} arttır`,
959
- "numberField": `Sayı alanı`
960
- };
961
- var $2ccc589e2f51824d$exports = {};
962
- $2ccc589e2f51824d$exports = {
963
- "decrease": (args) => `Зменшити ${args.fieldLabel}`,
964
- "increase": (args) => `Збільшити ${args.fieldLabel}`,
965
- "numberField": `Поле номера`
966
- };
967
- var $e1103cb9b4c13942$exports = {};
968
- $e1103cb9b4c13942$exports = {
969
- "decrease": (args) => `降低 ${args.fieldLabel}`,
970
- "increase": (args) => `提高 ${args.fieldLabel}`,
971
- "numberField": `数字字段`
972
- };
973
- var $448607634f80dccb$exports = {};
974
- $448607634f80dccb$exports = {
975
- "decrease": (args) => `縮小 ${args.fieldLabel}`,
976
- "increase": (args) => `放大 ${args.fieldLabel}`,
977
- "numberField": `數字欄位`
978
- };
979
- var $280a227d7cb94b92$exports = {};
980
- $280a227d7cb94b92$exports = {
981
- "ar-AE": $fb78e0f6ab6349ed$exports,
982
- "bg-BG": $2776acdd9959a647$exports,
983
- "cs-CZ": $741954410a365ad3$exports,
984
- "da-DK": $8321ed0f8ab642f0$exports,
985
- "de-DE": $92978e0c4ecafa32$exports,
986
- "el-GR": $ac5ff71962864a84$exports,
987
- "en-US": $efe4685e2440d8be$exports,
988
- "es-ES": $e50a9a48739b90e1$exports,
989
- "et-EE": $6e0d5294ecbb8ab6$exports,
990
- "fi-FI": $e7129d65f607f77f$exports,
991
- "fr-FR": $d72adf5b20573e34$exports,
992
- "he-IL": $a25c707e88b844a7$exports,
993
- "hr-HR": $69b41140b9a4ca54$exports,
994
- "hu-HU": $81dab28f37f59d1a$exports,
995
- "it-IT": $866555b31f2d7711$exports,
996
- "ja-JP": $dafcd55d52b9d371$exports,
997
- "ko-KR": $f090c1f8c5da0145$exports,
998
- "lt-LT": $6f10f3a13360a75c$exports,
999
- "lv-LV": $47432cefd4b7bd1b$exports,
1000
- "nb-NO": $dc578a950a2bf23d$exports,
1001
- "nl-NL": $353f1bfca4dc395a$exports,
1002
- "pl-PL": $241bc0bbd870e982$exports,
1003
- "pt-BR": $da3005c7bd72b0a8$exports,
1004
- "pt-PT": $cf48bfc540882310$exports,
1005
- "ro-RO": $b63a28c481ab9ee3$exports,
1006
- "ru-RU": $19f9df95c2464ab6$exports,
1007
- "sk-SK": $b272932a685e8482$exports,
1008
- "sl-SI": $cbaf8b5b61f9e544$exports,
1009
- "sr-SP": $e0a3af6ac1449b2f$exports,
1010
- "sv-SE": $71e167d2458a6019$exports,
1011
- "tr-TR": $3719245abc082946$exports,
1012
- "uk-UA": $2ccc589e2f51824d$exports,
1013
- "zh-CN": $e1103cb9b4c13942$exports,
1014
- "zh-TW": $448607634f80dccb$exports
1015
- };
1016
- function $parcel$interopDefault(a) {
1017
- return a && a.__esModule ? a.default : a;
1018
- }
1019
- function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
1020
- let { id, decrementAriaLabel, incrementAriaLabel, isDisabled, isReadOnly, isRequired, minValue, maxValue, autoFocus, label, formatOptions, onBlur = () => {
1021
- }, onFocus, onFocusChange, onKeyDown, onKeyUp, description, errorMessage, isWheelDisabled, ...otherProps } = props;
1022
- let { increment, incrementToMax, decrement, decrementToMin, numberValue, inputValue, commit, commitValidation } = state;
1023
- const stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($280a227d7cb94b92$exports), "@react-aria/numberfield");
1024
- let inputId = $bdb11010cef70236$export$f680877a34711e37(id);
1025
- let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
1026
- onBlur() {
1027
- commit();
1028
- }
1029
- });
1030
- let numberFormatter = $a916eb452884faea$export$b7a616150fdb9f44(formatOptions);
1031
- let intlOptions = useMemo(() => numberFormatter.resolvedOptions(), [
1032
- numberFormatter
1033
- ]);
1034
- let textValueFormatter = $a916eb452884faea$export$b7a616150fdb9f44({
1035
- ...formatOptions,
1036
- currencySign: void 0
1037
- });
1038
- let textValue = useMemo(() => isNaN(numberValue) ? "" : textValueFormatter.format(numberValue), [
1039
- textValueFormatter,
1040
- numberValue
1041
- ]);
1042
- let { spinButtonProps, incrementButtonProps: incButtonProps, decrementButtonProps: decButtonProps } = $d2e8511e6f209edf$export$e908e06f4b8e3402({
1043
- isDisabled,
1044
- isReadOnly,
1045
- isRequired,
1046
- maxValue,
1047
- minValue,
1048
- onIncrement: increment,
1049
- onIncrementToMax: incrementToMax,
1050
- onDecrement: decrement,
1051
- onDecrementToMin: decrementToMin,
1052
- value: numberValue,
1053
- textValue
1054
- });
1055
- let [focusWithin, setFocusWithin] = useState(false);
1056
- let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
1057
- isDisabled,
1058
- onFocusWithinChange: setFocusWithin
1059
- });
1060
- let onWheel = useCallback((e) => {
1061
- if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
1062
- if (e.deltaY > 0) increment();
1063
- else if (e.deltaY < 0) decrement();
1064
- }, [
1065
- decrement,
1066
- increment
1067
- ]);
1068
- let scrollingDisabled = isWheelDisabled || isDisabled || isReadOnly || !focusWithin;
1069
- $7d0a636d7a4dcefd$export$2123ff2b87c81ca({
1070
- onScroll: onWheel,
1071
- isDisabled: scrollingDisabled
1072
- }, inputRef);
1073
- var _intlOptions_maximumFractionDigits;
1074
- let hasDecimals = ((_intlOptions_maximumFractionDigits = intlOptions.maximumFractionDigits) !== null && _intlOptions_maximumFractionDigits !== void 0 ? _intlOptions_maximumFractionDigits : 0) > 0;
1075
- let hasNegative = state.minValue === void 0 || isNaN(state.minValue) || state.minValue < 0;
1076
- let inputMode = "numeric";
1077
- if ($c87311424ea30a05$export$186c6964ca17d99()) {
1078
- if (hasNegative) inputMode = "text";
1079
- else if (hasDecimals) inputMode = "decimal";
1080
- } else if ($c87311424ea30a05$export$a11b0059900ceec8()) {
1081
- if (hasNegative) inputMode = "numeric";
1082
- else if (hasDecimals) inputMode = "decimal";
1083
- }
1084
- let onChange = (value) => {
1085
- if (state.validate(value)) state.setInputValue(value);
1086
- };
1087
- let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
1088
- let onKeyDownEnter = useCallback((e) => {
1089
- if (e.key === "Enter") {
1090
- commit();
1091
- commitValidation();
1092
- } else e.continuePropagation();
1093
- }, [
1094
- commit,
1095
- commitValidation
1096
- ]);
1097
- let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
1098
- let { labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps } = $d841c8010a73d545$export$4f384c9210e583c3({
1099
- ...otherProps,
1100
- ...domProps,
1101
- name: void 0,
1102
- label,
1103
- autoFocus,
1104
- isDisabled,
1105
- isReadOnly,
1106
- isRequired,
1107
- validate: void 0,
1108
- [$e5be200c675c3b3a$export$a763b9476acd3eb]: state,
1109
- value: inputValue,
1110
- defaultValue: void 0,
1111
- autoComplete: "off",
1112
- "aria-label": props["aria-label"] || void 0,
1113
- "aria-labelledby": props["aria-labelledby"] || void 0,
1114
- id: inputId,
1115
- type: "text",
1116
- inputMode,
1117
- onChange,
1118
- onBlur,
1119
- onFocus,
1120
- onFocusChange,
1121
- onKeyDown: useMemo(() => $ff5963eb1fccf552$export$e08e3b67e392101e(onKeyDownEnter, onKeyDown), [
1122
- onKeyDownEnter,
1123
- onKeyDown
1124
- ]),
1125
- onKeyUp,
1126
- description,
1127
- errorMessage
1128
- }, state, inputRef);
1129
- $99facab73266f662$export$5add1d006293d136(inputRef, state.numberValue, state.setNumberValue);
1130
- let inputProps = $3ef42575df84b30b$export$9d1611c77c2fe928(spinButtonProps, focusProps, textFieldProps, {
1131
- // override the spinbutton role, we can't focus a spin button with VO
1132
- role: null,
1133
- // ignore aria-roledescription on iOS so that required state will announce when it is present
1134
- "aria-roledescription": !$c87311424ea30a05$export$fedb369cb70207f1() ? stringFormatter.format("numberField") : null,
1135
- "aria-valuemax": null,
1136
- "aria-valuemin": null,
1137
- "aria-valuenow": null,
1138
- "aria-valuetext": null,
1139
- autoCorrect: "off",
1140
- spellCheck: "false"
1141
- });
1142
- if (props.validationBehavior === "native") inputProps["aria-required"] = void 0;
1143
- let onButtonPressStart = (e) => {
1144
- var _inputRef_current;
1145
- if (document.activeElement === inputRef.current) return;
1146
- if (e.pointerType === "mouse") (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
1147
- else e.target.focus();
1148
- };
1149
- let fieldLabel = props["aria-label"] || (typeof props.label === "string" ? props.label : "");
1150
- let ariaLabelledby;
1151
- if (!fieldLabel) ariaLabelledby = props.label != null ? labelProps.id : props["aria-labelledby"];
1152
- let incrementId = $bdb11010cef70236$export$f680877a34711e37();
1153
- let decrementId = $bdb11010cef70236$export$f680877a34711e37();
1154
- let incrementButtonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(incButtonProps, {
1155
- "aria-label": incrementAriaLabel || stringFormatter.format("increase", {
1156
- fieldLabel
1157
- }).trim(),
1158
- id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,
1159
- "aria-labelledby": ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,
1160
- "aria-controls": inputId,
1161
- excludeFromTabOrder: true,
1162
- preventFocusOnPress: true,
1163
- allowFocusWhenDisabled: true,
1164
- isDisabled: !state.canIncrement,
1165
- onPressStart: onButtonPressStart
1166
- });
1167
- let decrementButtonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(decButtonProps, {
1168
- "aria-label": decrementAriaLabel || stringFormatter.format("decrease", {
1169
- fieldLabel
1170
- }).trim(),
1171
- id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,
1172
- "aria-labelledby": ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,
1173
- "aria-controls": inputId,
1174
- excludeFromTabOrder: true,
1175
- preventFocusOnPress: true,
1176
- allowFocusWhenDisabled: true,
1177
- isDisabled: !state.canDecrement,
1178
- onPressStart: onButtonPressStart
1179
- });
1180
- return {
1181
- groupProps: {
1182
- ...focusWithinProps,
1183
- role: "group",
1184
- "aria-disabled": isDisabled,
1185
- "aria-invalid": isInvalid ? "true" : void 0
1186
- },
1187
- labelProps,
1188
- inputProps,
1189
- incrementButtonProps,
1190
- decrementButtonProps,
1191
- errorMessageProps,
1192
- descriptionProps,
1193
- isInvalid,
1194
- validationErrors,
1195
- validationDetails
1196
- };
1197
- }
1198
- export {
1199
- $de67e98908f0c6ee$export$7f629e9dc1ecf37c as $,
1200
- $81397a9303501bda$export$23f548e970bdf099 as a,
1201
- $d2e8511e6f209edf$export$e908e06f4b8e3402 as b,
1202
- $7d0a636d7a4dcefd$export$2123ff2b87c81ca as c,
1203
- $d841c8010a73d545$export$4f384c9210e583c3 as d
1204
- };