@povio/ui 3.2.3 → 3.2.4-rc.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.
Files changed (33) hide show
  1. package/dist/components/buttons/Button/button.cva.d.ts +1 -1
  2. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  3. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +142 -127
  4. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +2 -17
  5. package/dist/components/inputs/DateTime/shared/DateField.js +92 -87
  6. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +2 -0
  7. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +144 -134
  8. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +2 -0
  9. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +33 -0
  10. package/dist/components/inputs/Input/NumberInput/NumberInput.js +2 -1
  11. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +2 -1
  12. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +56 -2
  13. package/dist/components/inputs/Selection/Select/QuerySelect.js +69 -15
  14. package/dist/components/inputs/Selection/shared/SelectDesktop.js +159 -390
  15. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -1
  16. package/dist/components/inputs/Selection/shared/SelectInput.js +142 -131
  17. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
  18. package/dist/components/inputs/Selection/shared/querySelect.utils.js +1 -0
  19. package/dist/components/inputs/Selection/shared/select.context.js +19 -9
  20. package/dist/components/inputs/shared/input.cva.js +1 -1
  21. package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
  22. package/dist/config/uiConfig.context.d.ts +1 -0
  23. package/dist/config/uiConfig.context.js +2 -1
  24. package/dist/helpers/dynamicColumns.js +2 -1
  25. package/dist/helpers/dynamicInputs.d.ts +1 -1
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.js +2 -1
  28. package/dist/utils/date-time.utils.d.ts +0 -1
  29. package/dist/utils/date-time.utils.js +21 -45
  30. package/dist/utils/intl.utils.d.ts +7 -0
  31. package/dist/utils/intl.utils.js +38 -0
  32. package/dist/utils/intl.utils.spec.d.ts +1 -0
  33. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ type IntlLocale = Intl.LocalesArgument;
2
+ export declare namespace IntlUtils {
3
+ const getDateTimeFormatter: (locale?: IntlLocale, options?: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
4
+ const getDisplayNamesFormatter: (locale: IntlLocale, options: Intl.DisplayNamesOptions) => Intl.DisplayNames;
5
+ const getNumberFormatter: (locale?: IntlLocale, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
6
+ }
7
+ export {};
@@ -0,0 +1,38 @@
1
+ //#region src/utils/intl.utils.ts
2
+ var formatterCacheKey = (locale, options) => {
3
+ const locales = Array.isArray(locale) ? locale.map(String) : locale ? [String(locale)] : [];
4
+ const normalizedOptions = Object.entries(options ?? {}).sort(([left], [right]) => left.localeCompare(right));
5
+ return JSON.stringify([locales, normalizedOptions]);
6
+ };
7
+ var IntlUtils;
8
+ (function(_IntlUtils) {
9
+ const dateTimeFormatters = /* @__PURE__ */ new Map();
10
+ const displayNamesFormatters = /* @__PURE__ */ new Map();
11
+ const numberFormatters = /* @__PURE__ */ new Map();
12
+ _IntlUtils.getDateTimeFormatter = (locale, options) => {
13
+ const key = formatterCacheKey(locale, options);
14
+ const cachedFormatter = dateTimeFormatters.get(key);
15
+ if (cachedFormatter) return cachedFormatter;
16
+ const formatter = new Intl.DateTimeFormat(locale, options);
17
+ dateTimeFormatters.set(key, formatter);
18
+ return formatter;
19
+ };
20
+ _IntlUtils.getDisplayNamesFormatter = (locale, options) => {
21
+ const key = formatterCacheKey(locale, options);
22
+ const cachedFormatter = displayNamesFormatters.get(key);
23
+ if (cachedFormatter) return cachedFormatter;
24
+ const formatter = new Intl.DisplayNames(locale, options);
25
+ displayNamesFormatters.set(key, formatter);
26
+ return formatter;
27
+ };
28
+ _IntlUtils.getNumberFormatter = (locale, options) => {
29
+ const key = formatterCacheKey(locale, options);
30
+ const cachedFormatter = numberFormatters.get(key);
31
+ if (cachedFormatter) return cachedFormatter;
32
+ const formatter = new Intl.NumberFormat(locale, options);
33
+ numberFormatters.set(key, formatter);
34
+ return formatter;
35
+ };
36
+ })(IntlUtils || (IntlUtils = {}));
37
+ //#endregion
38
+ export { IntlUtils };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "3.2.3",
3
+ "version": "3.2.4-rc.10",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",