@janbox/storefront-ui 2.0.0 → 2.0.2

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 (65) hide show
  1. package/dist/constants/index.d.ts +3 -0
  2. package/dist/constants/index.d.ts.map +1 -1
  3. package/dist/constants/index.js +5 -0
  4. package/dist/lib/accordion/accordion-summary/accordion-summary.d.ts.map +1 -1
  5. package/dist/lib/accordion/accordion-summary/accordion-summary.js +19 -18
  6. package/dist/lib/accordion/accordion-summary/types.d.ts +2 -2
  7. package/dist/lib/accordion/accordion-summary/types.d.ts.map +1 -1
  8. package/dist/lib/cascader/types.d.ts +1 -1
  9. package/dist/lib/cascader/types.d.ts.map +1 -1
  10. package/dist/lib/filter-panel/filter-panel.js +2 -2
  11. package/dist/lib/filter-panel/price-range-filter-panel.d.ts +3 -0
  12. package/dist/lib/filter-panel/price-range-filter-panel.d.ts.map +1 -0
  13. package/dist/lib/filter-panel/price-range-filter-panel.js +126 -0
  14. package/dist/lib/filter-panel/radio-filter-panel.js +1 -1
  15. package/dist/lib/filter-panel/types.d.ts +17 -7
  16. package/dist/lib/filter-panel/types.d.ts.map +1 -1
  17. package/dist/lib/floating/floating-content/floating-content.d.ts.map +1 -1
  18. package/dist/lib/floating/floating-content/floating-content.js +3 -1
  19. package/dist/lib/floating/floating-content/types.d.ts +2 -2
  20. package/dist/lib/floating/floating-content/types.d.ts.map +1 -1
  21. package/dist/lib/form-helper-text/form-helper-text.d.ts.map +1 -1
  22. package/dist/lib/form-helper-text/form-helper-text.js +7 -4
  23. package/dist/lib/form-helper-text/types.d.ts +2 -1
  24. package/dist/lib/form-helper-text/types.d.ts.map +1 -1
  25. package/dist/lib/input/input.d.ts.map +1 -1
  26. package/dist/lib/input/input.js +119 -122
  27. package/dist/lib/input/types.d.ts +3 -2
  28. package/dist/lib/input/types.d.ts.map +1 -1
  29. package/dist/lib/input-mask/index.d.ts +2 -0
  30. package/dist/lib/input-mask/index.d.ts.map +1 -1
  31. package/dist/lib/loading/loading-overlay/loading-overlay.d.ts +1 -1
  32. package/dist/lib/loading/loading-overlay/loading-overlay.d.ts.map +1 -1
  33. package/dist/lib/loading/loading-overlay/loading-overlay.js +10 -10
  34. package/dist/lib/loading/loading-overlay/types.d.ts +3 -2
  35. package/dist/lib/loading/loading-overlay/types.d.ts.map +1 -1
  36. package/dist/lib/menu/menu-list/menu-list.d.ts.map +1 -1
  37. package/dist/lib/menu/menu-list/menu-list.js +4 -3
  38. package/dist/lib/multiple-select/multiple-select.d.ts.map +1 -1
  39. package/dist/lib/multiple-select/multiple-select.js +8 -2
  40. package/dist/lib/multiple-select/types.d.ts +2 -4
  41. package/dist/lib/multiple-select/types.d.ts.map +1 -1
  42. package/dist/lib/phone-input/phone-input.d.ts.map +1 -1
  43. package/dist/lib/phone-input/phone-input.js +105 -92
  44. package/dist/lib/phone-input/types.d.ts +2 -3
  45. package/dist/lib/phone-input/types.d.ts.map +1 -1
  46. package/dist/lib/radio-button/radio-button.d.ts.map +1 -1
  47. package/dist/lib/radio-button/radio-button.js +7 -7
  48. package/dist/lib/radio-button/types.d.ts +2 -4
  49. package/dist/lib/radio-button/types.d.ts.map +1 -1
  50. package/dist/lib/textarea/textarea.d.ts.map +1 -1
  51. package/dist/lib/textarea/textarea.js +48 -44
  52. package/dist/lib/textarea/types.d.ts +3 -2
  53. package/dist/lib/textarea/types.d.ts.map +1 -1
  54. package/dist/lib/video/types.d.ts +2 -8
  55. package/dist/lib/video/types.d.ts.map +1 -1
  56. package/dist/lib/video/video.d.ts +1 -1
  57. package/dist/lib/video/video.d.ts.map +1 -1
  58. package/dist/lib/video/video.js +2 -4
  59. package/dist/locales/en/ui__translation.json +1 -1
  60. package/dist/locales/vi/ui__translation.json +3 -1
  61. package/dist/style.css +17 -17
  62. package/package.json +1 -1
  63. package/dist/lib/filter-panel/input-range-filter-panel.d.ts +0 -3
  64. package/dist/lib/filter-panel/input-range-filter-panel.d.ts.map +0 -1
  65. package/dist/lib/filter-panel/input-range-filter-panel.js +0 -77
@@ -1,77 +0,0 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
2
- import { TYPING_DEBOUNCE } from "../../constants/index.js";
3
- import { useQueryParams } from "../../hooks/use-query-params.js";
4
- import "react";
5
- import "lodash-es";
6
- import "../../theme/palette.js";
7
- import { NumberParamParser } from "../../utils/query-params.js";
8
- import { InputRange } from "../input-range/input-range.js";
9
- const InputRangeFilterPanel = ({ value, queryParam, placeholder, onChange }) => {
10
- var _a, _b, _c, _d;
11
- const { queryParams, setQueryParams } = useQueryParams({
12
- ...((_a = queryParam == null ? void 0 : queryParam.from) == null ? void 0 : _a.key) ? {
13
- [queryParam.from.key]: {
14
- parser(value2) {
15
- return new NumberParamParser(value2).parse();
16
- }
17
- }
18
- } : {},
19
- ...((_b = queryParam == null ? void 0 : queryParam.to) == null ? void 0 : _b.key) ? {
20
- [queryParam.to.key]: {
21
- parser(value2) {
22
- return new NumberParamParser(value2).parse();
23
- }
24
- }
25
- } : {}
26
- });
27
- const finalValue = {
28
- from: (value == null ? void 0 : value.from) ?? (((_c = queryParam == null ? void 0 : queryParam.from) == null ? void 0 : _c.key) ? queryParams[queryParam.from.key] : void 0),
29
- to: (value == null ? void 0 : value.to) ?? (((_d = queryParam == null ? void 0 : queryParam.to) == null ? void 0 : _d.key) ? queryParams[queryParam.to.key] : void 0)
30
- };
31
- const onInputRangeChange = (event, edge) => {
32
- var _a2, _b2;
33
- const valueAsNumber = event.target.valueAsNumber;
34
- if (edge === "from" && ((_a2 = queryParam == null ? void 0 : queryParam.from) == null ? void 0 : _a2.key)) {
35
- setQueryParams(
36
- {
37
- [queryParam.from.key]: isNaN(valueAsNumber) ? void 0 : valueAsNumber
38
- },
39
- {
40
- preventScrollReset: true
41
- }
42
- );
43
- }
44
- if (edge === "to" && ((_b2 = queryParam == null ? void 0 : queryParam.to) == null ? void 0 : _b2.key)) {
45
- setQueryParams(
46
- {
47
- [queryParam.to.key]: isNaN(valueAsNumber) ? void 0 : valueAsNumber
48
- },
49
- {
50
- preventScrollReset: true
51
- }
52
- );
53
- }
54
- onChange == null ? void 0 : onChange(event, edge);
55
- };
56
- return /* @__PURE__ */ jsx(
57
- InputRange,
58
- {
59
- onChange: onInputRangeChange,
60
- inputs: [
61
- {
62
- debounce: TYPING_DEBOUNCE,
63
- value: finalValue.from ?? "",
64
- placeholder: placeholder == null ? void 0 : placeholder.from
65
- },
66
- {
67
- debounce: TYPING_DEBOUNCE,
68
- value: finalValue.to ?? "",
69
- placeholder: placeholder == null ? void 0 : placeholder.to
70
- }
71
- ]
72
- }
73
- );
74
- };
75
- export {
76
- InputRangeFilterPanel
77
- };