@true-engineering/true-react-common-ui-kit 4.0.0-alpha65 → 4.0.0-alpha67

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 (35) hide show
  1. package/dist/components/DatePicker/types.d.ts +1 -1
  2. package/dist/components/FiltersPane/components/Filter/helpers.d.ts +1 -0
  3. package/dist/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.d.ts +15 -0
  4. package/dist/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.styles.d.ts +11 -0
  5. package/dist/components/FiltersPane/components/FilterDateSingle/index.d.ts +2 -0
  6. package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +1 -5
  7. package/dist/components/FiltersPane/components/index.d.ts +1 -0
  8. package/dist/components/FiltersPane/types.d.ts +7 -2
  9. package/dist/components/Selector/Selector.styles.d.ts +1 -7
  10. package/dist/hooks/use-resize-ref.d.ts +3 -3
  11. package/dist/theme/types.d.ts +2 -1
  12. package/dist/true-react-common-ui-kit.js +303 -327
  13. package/dist/true-react-common-ui-kit.js.map +1 -1
  14. package/dist/true-react-common-ui-kit.umd.cjs +1 -1
  15. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  16. package/package.json +1 -1
  17. package/src/components/DatePicker/DatePicker.tsx +2 -0
  18. package/src/components/DatePicker/types.ts +1 -0
  19. package/src/components/FiltersPane/FiltersPane.stories.tsx +38 -23
  20. package/src/components/FiltersPane/components/Filter/Filter.tsx +19 -1
  21. package/src/components/FiltersPane/components/Filter/helpers.ts +1 -1
  22. package/src/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.styles.ts +34 -0
  23. package/src/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.tsx +103 -0
  24. package/src/components/FiltersPane/components/FilterDateSingle/index.ts +2 -0
  25. package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +2 -2
  26. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +1 -24
  27. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +6 -43
  28. package/src/components/FiltersPane/components/index.ts +1 -0
  29. package/src/components/FiltersPane/constants.ts +2 -0
  30. package/src/components/FiltersPane/types.ts +11 -1
  31. package/src/components/Selector/Selector.stories.tsx +4 -0
  32. package/src/components/Selector/Selector.styles.ts +31 -133
  33. package/src/components/Selector/Selector.tsx +35 -48
  34. package/src/hooks/use-resize-ref.ts +5 -5
  35. package/src/theme/types.ts +2 -0
@@ -1,6 +1,6 @@
1
1
  import { createContext, useContext, useMemo, useRef, useEffect, memo, useLayoutEffect, useCallback, useState, Fragment as Fragment$1, forwardRef, PureComponent, createRef, createElement } from "react";
2
2
  import { createUseStyles } from "react-jss";
3
- import { isObject, isString, isNotEmpty, isArrayNotEmpty, mergeStyles, isStringEmpty, isStringNotEmpty, mergeRefs, isFunction, isEmpty, addDataAttributes as addDataAttributes$1, stopPropagation, applyAction, isReactNodeNotEmpty, addClickHandler, getTestId, getSelectKeyHandler, addDataTestId, getArray, isArrayLikeNotEmpty, doNothing, createFilter, merge, getTransition, indexMap, isNumberInteger, hasDuplicates, isArrayEmpty } from "@true-engineering/true-react-platform-helpers";
3
+ import { isObject, isString, isNotEmpty, isArrayNotEmpty, mergeStyles, isStringEmpty, isStringNotEmpty, mergeRefs, isFunction, isEmpty, addDataAttributes as addDataAttributes$1, stopPropagation, applyAction, isReactNodeNotEmpty, addClickHandler, getTestId, getSelectKeyHandler, addDataTestId, getArray, isArrayLikeNotEmpty, doNothing, createFilter, merge, getTransition, indexMap, isNumberInteger, isArrayEmpty } from "@true-engineering/true-react-platform-helpers";
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import { CSSTransition } from "react-transition-group";
6
6
  import clsx from "clsx";
@@ -207,7 +207,7 @@ const getTweakStylesCache = () => {
207
207
  };
208
208
  };
209
209
  const tweakStylesCache = getTweakStylesCache();
210
- const useStyles$Y = createUseStyles((tweakStyles) => tweakStyles);
210
+ const useStyles$Z = createUseStyles((tweakStyles) => tweakStyles);
211
211
  const createThemedStyles = (first, second) => {
212
212
  const componentName = isString(first) ? first : void 0;
213
213
  const styles = second ?? first;
@@ -220,7 +220,7 @@ const createThemedStyles = (first, second) => {
220
220
  const resultStyles = mixStyles(styles, themeStyles, tweakStyles).filter(areStylesNotEmpty);
221
221
  return { theme: tweakStylesCache(resultStyles) };
222
222
  }, [themeStyles, tweakStyles]);
223
- return useStyles$Y(data);
223
+ return useStyles$Z(data);
224
224
  };
225
225
  };
226
226
  const useDidMountEffect = (effect, dependencies) => {
@@ -2932,14 +2932,14 @@ const iconsMap = {
2932
2932
  "status-warning": statusWarning,
2933
2933
  "trash-can": trashCan
2934
2934
  };
2935
- const useStyles$X = createThemedStyles("Icon", {
2935
+ const useStyles$Y = createThemedStyles("Icon", {
2936
2936
  root: {
2937
2937
  display: "flex",
2938
2938
  alignItems: "center"
2939
2939
  }
2940
2940
  });
2941
2941
  const Icon = ({ type, data, testId, tweakStyles }) => {
2942
- const classes = useStyles$X({ theme: tweakStyles });
2942
+ const classes = useStyles$Y({ theme: tweakStyles });
2943
2943
  const theme = useTheme();
2944
2944
  const icon = theme.icons?.[type] ?? iconsMap[type];
2945
2945
  if (isEmpty(icon)) {
@@ -2964,7 +2964,7 @@ const minWidthRelativeToTrigger = size({
2964
2964
  });
2965
2965
  }
2966
2966
  });
2967
- const useStyles$W = createThemedStyles("WithPopup", {
2967
+ const useStyles$X = createThemedStyles("WithPopup", {
2968
2968
  trigger: {
2969
2969
  width: "fit-content"
2970
2970
  },
@@ -3024,7 +3024,7 @@ const WithPopup = ({
3024
3024
  testId,
3025
3025
  onToggle
3026
3026
  }) => {
3027
- const classes = useStyles$W({ theme: tweakStyles });
3027
+ const classes = useStyles$X({ theme: tweakStyles });
3028
3028
  const [isOpen, setIsOpen] = useState(false);
3029
3029
  const isActive = isOpen && !isDisabled;
3030
3030
  const arrowRef = useRef(null);
@@ -3128,7 +3128,7 @@ const WithPopup = ({
3128
3128
  const ITEM_HORIZONTAL_PADDING = 16;
3129
3129
  const ICON_SIZE = 20;
3130
3130
  const ICON_GAP = 12;
3131
- const useStyles$V = createThemedStyles("ListItem", {
3131
+ const useStyles$W = createThemedStyles("ListItem", {
3132
3132
  root: {
3133
3133
  display: "flex",
3134
3134
  alignItems: "center",
@@ -3181,7 +3181,7 @@ const ListItem = ({
3181
3181
  data,
3182
3182
  onClick
3183
3183
  }) => {
3184
- const classes = useStyles$V({ theme: tweakStyles });
3184
+ const classes = useStyles$W({ theme: tweakStyles });
3185
3185
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3186
3186
  shouldDrawSpacerAbove && /* @__PURE__ */ jsx("div", { className: classes.spacer }),
3187
3187
  /* @__PURE__ */ jsxs(
@@ -3204,7 +3204,7 @@ const ListItem = ({
3204
3204
  shouldDrawSpacerBelow && /* @__PURE__ */ jsx("div", { className: classes.spacer })
3205
3205
  ] });
3206
3206
  };
3207
- const useStyles$U = createThemedStyles("List", {
3207
+ const useStyles$V = createThemedStyles("List", {
3208
3208
  root: {
3209
3209
  minWidth: 180,
3210
3210
  backgroundColor: colors.CLASSIC_WHITE,
@@ -3224,7 +3224,7 @@ const withPopupStyles$1 = {
3224
3224
  }
3225
3225
  };
3226
3226
  const List = ({ items, size: size2, testId, data, tweakStyles, onClick }) => {
3227
- const classes = useStyles$U({ theme: tweakStyles });
3227
+ const classes = useStyles$V({ theme: tweakStyles });
3228
3228
  const handleItemClick = (event, { onClick: itemOnClick }) => {
3229
3229
  if (isNotEmpty(itemOnClick)) {
3230
3230
  itemOnClick(event);
@@ -3263,7 +3263,7 @@ const List = ({ items, size: size2, testId, data, tweakStyles, onClick }) => {
3263
3263
  );
3264
3264
  };
3265
3265
  const ANIMATION_TIMEOUT = 150;
3266
- const useStyles$T = createThemedStyles("AccountInfo", {
3266
+ const useStyles$U = createThemedStyles("AccountInfo", {
3267
3267
  root: {
3268
3268
  display: "flex"
3269
3269
  },
@@ -3310,7 +3310,7 @@ const AccountInfo = ({
3310
3310
  accountName,
3311
3311
  options
3312
3312
  }) => {
3313
- const classes = useStyles$T({ theme: tweakStyles });
3313
+ const classes = useStyles$U({ theme: tweakStyles });
3314
3314
  const tweakListStyles = useTweakStyles({
3315
3315
  tweakStyles,
3316
3316
  className: "tweakList",
@@ -3347,7 +3347,7 @@ const AccountInfo = ({
3347
3347
  ] })
3348
3348
  ] });
3349
3349
  };
3350
- const useStyles$S = createThemedStyles("AddButton", {
3350
+ const useStyles$T = createThemedStyles("AddButton", {
3351
3351
  root: {
3352
3352
  display: "flex",
3353
3353
  alignItems: "center",
@@ -3383,7 +3383,7 @@ const AddButton = ({
3383
3383
  testId,
3384
3384
  tweakStyles
3385
3385
  }) => {
3386
- const classes = useStyles$S({ theme: tweakStyles });
3386
+ const classes = useStyles$T({ theme: tweakStyles });
3387
3387
  return /* @__PURE__ */ jsxs(
3388
3388
  "button",
3389
3389
  {
@@ -3403,7 +3403,7 @@ const AddButton = ({
3403
3403
  }
3404
3404
  );
3405
3405
  };
3406
- const useStyles$R = createThemedStyles("DotsPreloader", {
3406
+ const useStyles$S = createThemedStyles("DotsPreloader", {
3407
3407
  root: {
3408
3408
  display: "flex",
3409
3409
  gap: 4,
@@ -3448,7 +3448,7 @@ const useStyles$R = createThemedStyles("DotsPreloader", {
3448
3448
  }
3449
3449
  });
3450
3450
  const DotsPreloader = ({ tweakStyles }) => {
3451
- const classes = useStyles$R({ theme: tweakStyles });
3451
+ const classes = useStyles$S({ theme: tweakStyles });
3452
3452
  return /* @__PURE__ */ jsx("div", { className: classes.root, children: /* @__PURE__ */ jsx("span", { className: classes.dot }) });
3453
3453
  };
3454
3454
  const DefaultPreloader = () => /* @__PURE__ */ jsxs("svg", { width: "100%", height: "100%", viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg", children: [
@@ -3473,7 +3473,7 @@ const DefaultPreloader = () => /* @__PURE__ */ jsxs("svg", { width: "100%", heig
3473
3473
  }
3474
3474
  ) }) })
3475
3475
  ] });
3476
- const useStyles$Q = createThemedStyles("SvgPreloader", {
3476
+ const useStyles$R = createThemedStyles("SvgPreloader", {
3477
3477
  root: {
3478
3478
  display: "flex",
3479
3479
  width: "100%",
@@ -3481,13 +3481,13 @@ const useStyles$Q = createThemedStyles("SvgPreloader", {
3481
3481
  }
3482
3482
  });
3483
3483
  const SvgPreloader = ({ type = "default", tweakStyles }) => {
3484
- const classes = useStyles$Q({ theme: tweakStyles });
3484
+ const classes = useStyles$R({ theme: tweakStyles });
3485
3485
  const theme = useTheme();
3486
3486
  const PreloaderIcon = theme.preloaders?.[type] ?? DefaultPreloader;
3487
3487
  const isInlineSvg = typeof PreloaderIcon === "string";
3488
3488
  return isInlineSvg ? /* @__PURE__ */ jsx("div", { className: classes.root, dangerouslySetInnerHTML: { __html: PreloaderIcon } }) : /* @__PURE__ */ jsx(PreloaderIcon, {});
3489
3489
  };
3490
- const useStyles$P = createThemedStyles("ThemedPreloader", {
3490
+ const useStyles$Q = createThemedStyles("ThemedPreloader", {
3491
3491
  root: {
3492
3492
  display: "flex"
3493
3493
  },
@@ -3505,7 +3505,7 @@ const ThemedPreloader = ({
3505
3505
  testId,
3506
3506
  tweakStyles
3507
3507
  }) => {
3508
- const classes = useStyles$P({ theme: tweakStyles });
3508
+ const classes = useStyles$Q({ theme: tweakStyles });
3509
3509
  const tweakDotsPreloaderStyles = useTweakStyles({
3510
3510
  tweakStyles,
3511
3511
  className: "tweakDotsPreloader",
@@ -3527,7 +3527,7 @@ const ThemedPreloader = ({
3527
3527
  }
3528
3528
  );
3529
3529
  };
3530
- const useStyles$O = createThemedStyles("Button", {
3530
+ const useStyles$P = createThemedStyles("Button", {
3531
3531
  root: {
3532
3532
  display: "flex",
3533
3533
  justifyContent: "center",
@@ -3699,7 +3699,7 @@ const Button = forwardRef(function Button2({
3699
3699
  preloaderType = "dots",
3700
3700
  ...interactions
3701
3701
  }, ref) {
3702
- const classes = useStyles$O({ theme: tweakStyles });
3702
+ const classes = useStyles$P({ theme: tweakStyles });
3703
3703
  const tweakPreloaderStyles = useTweakStyles({
3704
3704
  innerStyles: getPreloaderStyles(size2),
3705
3705
  tweakStyles,
@@ -3752,7 +3752,7 @@ const Button = forwardRef(function Button2({
3752
3752
  }
3753
3753
  );
3754
3754
  });
3755
- const useStyles$N = createThemedStyles("Checkbox", {
3755
+ const useStyles$O = createThemedStyles("Checkbox", {
3756
3756
  root: {
3757
3757
  position: "relative",
3758
3758
  cursor: "pointer",
@@ -3806,7 +3806,7 @@ function Checkbox({
3806
3806
  tweakStyles,
3807
3807
  onSelect
3808
3808
  }) {
3809
- const classes = useStyles$N({ theme: tweakStyles });
3809
+ const classes = useStyles$O({ theme: tweakStyles });
3810
3810
  const hasAction = !isDisabled && !isReadonly;
3811
3811
  const isSelected = isChecked || isSemiChecked;
3812
3812
  const onToggle = (event) => onSelect?.({ value, isSelected: !isSelected }, event);
@@ -3841,7 +3841,7 @@ function Checkbox({
3841
3841
  }
3842
3842
  );
3843
3843
  }
3844
- const useStyles$M = createThemedStyles("CloseButton", {
3844
+ const useStyles$N = createThemedStyles("CloseButton", {
3845
3845
  root: {
3846
3846
  width: 40,
3847
3847
  height: 40,
@@ -3874,7 +3874,7 @@ const CloseButton = ({
3874
3874
  icon = "close",
3875
3875
  onClose
3876
3876
  }) => {
3877
- const classes = useStyles$M({ theme: tweakStyles });
3877
+ const classes = useStyles$N({ theme: tweakStyles });
3878
3878
  return /* @__PURE__ */ jsx(
3879
3879
  "button",
3880
3880
  {
@@ -3886,7 +3886,7 @@ const CloseButton = ({
3886
3886
  }
3887
3887
  );
3888
3888
  };
3889
- const useStyles$L = createThemedStyles("CssBaseline", {
3889
+ const useStyles$M = createThemedStyles("CssBaseline", {
3890
3890
  "@global html, body": {
3891
3891
  fontFamily: "Arial, sans-serif",
3892
3892
  color: colors.FONT_MAIN,
@@ -3897,10 +3897,10 @@ const useStyles$L = createThemedStyles("CssBaseline", {
3897
3897
  root: {}
3898
3898
  });
3899
3899
  const CssBaseline = ({ data, testId, tweakStyles }) => {
3900
- const classes = useStyles$L({ theme: tweakStyles });
3900
+ const classes = useStyles$M({ theme: tweakStyles });
3901
3901
  return /* @__PURE__ */ jsx("div", { className: classes.root, ...addDataAttributes$1(data, testId) });
3902
3902
  };
3903
- const useStyles$K = createThemedStyles("WithMessages", {
3903
+ const useStyles$L = createThemedStyles("WithMessages", {
3904
3904
  withMessages: {
3905
3905
  display: "flex",
3906
3906
  flexDirection: "column",
@@ -3935,7 +3935,7 @@ const useStyles$K = createThemedStyles("WithMessages", {
3935
3935
  children: {}
3936
3936
  });
3937
3937
  const WithMessages = forwardRef(function WithMessages2({ children, infoMessage, errorMessage, controlsDirection, tweakStyles, testId, data }, ref) {
3938
- const classes = useStyles$K({ theme: tweakStyles });
3938
+ const classes = useStyles$L({ theme: tweakStyles });
3939
3939
  const shouldShowError = isReactNodeNotEmpty(errorMessage);
3940
3940
  const shouldShowInfo = isReactNodeNotEmpty(infoMessage) && !shouldShowError;
3941
3941
  return /* @__PURE__ */ jsxs(
@@ -3967,7 +3967,7 @@ const WithMessages = forwardRef(function WithMessages2({ children, infoMessage,
3967
3967
  const isControlWrapperIcon = (iconItem) => isObject(iconItem) && "iconComponent" in iconItem;
3968
3968
  const convertToControlWrapperIcon = (iconItem) => isControlWrapperIcon(iconItem) ? iconItem : { iconComponent: iconItem };
3969
3969
  const { CONTROL, Z_INDEX: Z_INDEX$1 } = dimensions;
3970
- const useStyles$J = createThemedStyles("ControlWrapper", {
3970
+ const useStyles$K = createThemedStyles("ControlWrapper", {
3971
3971
  controlWrapper: {
3972
3972
  "--control-height": `${CONTROL.HEIGHT - 2}px`,
3973
3973
  // borders
@@ -4140,7 +4140,7 @@ const ControlWrapper = ({
4140
4140
  data,
4141
4141
  onClear
4142
4142
  }) => {
4143
- const classes = useStyles$J({ theme: tweakStyles });
4143
+ const classes = useStyles$K({ theme: tweakStyles });
4144
4144
  const [startControlsWidth, setStartControlsWidth] = useState();
4145
4145
  const startIcons = getArray(startIcon).map(convertToControlWrapperIcon);
4146
4146
  const endIcons = getArray(endIcon).map(convertToControlWrapperIcon);
@@ -4232,7 +4232,7 @@ const GROUP_PLACEMENTS = [
4232
4232
  "bottom-right"
4233
4233
  ];
4234
4234
  const PADDING_WITH_UNITS = 8;
4235
- const useStyles$I = createThemedStyles("Input", {
4235
+ const useStyles$J = createThemedStyles("Input", {
4236
4236
  inputContent: {
4237
4237
  height: "var(--control-height)",
4238
4238
  padding: [0, "var(--control-padding)"],
@@ -4347,7 +4347,7 @@ const InputBase = forwardRef(function InputBase2({
4347
4347
  children,
4348
4348
  ...inputProps
4349
4349
  }, ref) {
4350
- const classes = useStyles$I({ theme: tweakStyles });
4350
+ const classes = useStyles$J({ theme: tweakStyles });
4351
4351
  const tweakControlWrapperStyles = useTweakStyles({
4352
4352
  tweakStyles,
4353
4353
  className: "tweakControlWrapper",
@@ -4490,7 +4490,7 @@ const Input = forwardRef(function Input2({ infoMessage, errorMessage, isInvalid,
4490
4490
  });
4491
4491
  const EMPTY_DATE_INPUT_VALUE = "__.__.____";
4492
4492
  const EMPTY_DATE_RANGE_INPUT_VALUE = `${EMPTY_DATE_INPUT_VALUE} - ${EMPTY_DATE_INPUT_VALUE}`;
4493
- const useStyles$H = createThemedStyles("DateInput", {
4493
+ const useStyles$I = createThemedStyles("DateInput", {
4494
4494
  root: {
4495
4495
  width: "100%",
4496
4496
  height: "100%",
@@ -4512,7 +4512,7 @@ const DateInput = forwardRef(function DateInput2({
4512
4512
  onChange,
4513
4513
  ...inputProps
4514
4514
  }, ref) {
4515
- const classes = useStyles$H({ theme: tweakStyles });
4515
+ const classes = useStyles$I({ theme: tweakStyles });
4516
4516
  const tweakInputStyles = useTweakStyles({
4517
4517
  tweakStyles,
4518
4518
  className: "tweakInput",
@@ -4632,7 +4632,7 @@ const ALL_OPTION_INDEX = -1;
4632
4632
  const ROW_HEIGHT$1 = 40;
4633
4633
  const CONTAINER_PADDING = 10;
4634
4634
  const CELL_PADDING = [10, 20];
4635
- const useStyles$G = createThemedStyles("SelectList", {
4635
+ const useStyles$H = createThemedStyles("SelectList", {
4636
4636
  root: {
4637
4637
  borderRadius: dimensions.BORDER_RADIUS_SMALL,
4638
4638
  boxShadow: "0 13px 74px -27px rgba(0, 0, 0, 0.11)",
@@ -4763,7 +4763,7 @@ function SelectList({
4763
4763
  convertValueToReactNode = convertValueToString,
4764
4764
  convertValueToId
4765
4765
  }) {
4766
- const classes = useStyles$G({ theme: tweakStyles });
4766
+ const classes = useStyles$H({ theme: tweakStyles });
4767
4767
  const isHeaderNotEmpty = isReactNodeNotEmpty(customListHeader);
4768
4768
  const isFooterNotEmpty = isReactNodeNotEmpty(customListFooter);
4769
4769
  const optionsDisableMap = useMemo(
@@ -4852,7 +4852,7 @@ const defaultConvertFunction$2 = (v) => v === void 0 ? void 0 : String(v);
4852
4852
  const defaultCompareFunction = (v1, v2) => v1 === v2;
4853
4853
  const getDefaultConvertToIdFunction = (convertValueToString) => (value) => isNotEmpty(value?.id) ? String(value.id) : convertValueToString(value);
4854
4854
  const { Z_INDEX } = dimensions;
4855
- const useStyles$F = createThemedStyles("Select", {
4855
+ const useStyles$G = createThemedStyles("Select", {
4856
4856
  root: {
4857
4857
  width: "100%",
4858
4858
  position: "relative",
@@ -4963,7 +4963,7 @@ function Select(props) {
4963
4963
  size: size2,
4964
4964
  ...inputProps
4965
4965
  } = props;
4966
- const classes = useStyles$F({ theme: tweakStyles });
4966
+ const classes = useStyles$G({ theme: tweakStyles });
4967
4967
  const { shouldRenderInList: shouldRenderSearchInputInList = false, ...searchInputProps } = searchInput ?? {};
4968
4968
  const hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
4969
4969
  const hasReadonlyInput = isReadonly || optionsMode === "normal" || shouldRenderSearchInputInList;
@@ -5366,7 +5366,7 @@ function Select(props) {
5366
5366
  }
5367
5367
  );
5368
5368
  }
5369
- const useStyles$E = createThemedStyles("DatePickerHeader", {
5369
+ const useStyles$F = createThemedStyles("DatePickerHeader", {
5370
5370
  btn: {
5371
5371
  width: 36,
5372
5372
  height: 36,
@@ -5418,7 +5418,7 @@ const DatePickerHeader = ({
5418
5418
  decreaseMonth,
5419
5419
  increaseMonth
5420
5420
  }) => {
5421
- const classes = useStyles$E({ theme: tweakStyles });
5421
+ const classes = useStyles$F({ theme: tweakStyles });
5422
5422
  const tweakSelectStyles = useTweakStyles({
5423
5423
  innerStyles: selectStyles$1,
5424
5424
  tweakStyles,
@@ -5489,7 +5489,7 @@ const getDateValueParser = (dateFormat) => (value) => {
5489
5489
  return isStringNotEmpty(inputValue) ? parse(value, dateFormat, /* @__PURE__ */ new Date()) : null;
5490
5490
  };
5491
5491
  const areDatesEquals = (date1, date2) => isEmpty(date1) && isEmpty(date2) || isNotEmpty(date1) && isNotEmpty(date2) && isSameDay(date1, date2);
5492
- const useStyles$D = createThemedStyles("DatePicker", {
5492
+ const useStyles$E = createThemedStyles("DatePicker", {
5493
5493
  root: {
5494
5494
  width: "100%",
5495
5495
  height: "100%"
@@ -5541,6 +5541,7 @@ const DatePicker = forwardRef(function DatePicker2({
5541
5541
  preventOpenOnFocus,
5542
5542
  popperModifiers = [],
5543
5543
  popperPlacement = "bottom-start",
5544
+ popperProps,
5544
5545
  todayButton,
5545
5546
  highlightDates,
5546
5547
  calendarContainer,
@@ -5561,7 +5562,7 @@ const DatePicker = forwardRef(function DatePicker2({
5561
5562
  tweakStyles,
5562
5563
  ...inputProps
5563
5564
  }, ref) {
5564
- const classes = useStyles$D({ theme: tweakStyles });
5565
+ const classes = useStyles$E({ theme: tweakStyles });
5565
5566
  const tweakDateInputStyles = useTweakStyles({
5566
5567
  tweakStyles,
5567
5568
  className: "tweakDateInput",
@@ -5692,6 +5693,7 @@ const DatePicker = forwardRef(function DatePicker2({
5692
5693
  disabledKeyboardNavigation,
5693
5694
  popperContainer: shouldRenderPopperInBody ? PopperContainer : void 0,
5694
5695
  popperModifiers: [offset(-10), ...popperModifiers],
5696
+ popperProps,
5695
5697
  popperPlacement,
5696
5698
  strictParsing,
5697
5699
  preventOpenOnFocus,
@@ -5736,7 +5738,7 @@ const DatePicker = forwardRef(function DatePicker2({
5736
5738
  ) });
5737
5739
  });
5738
5740
  const LINK_REGEXP = /(http(s?):\/\/(.*))(\s?)/;
5739
- const useStyles$C = createThemedStyles("Description", {
5741
+ const useStyles$D = createThemedStyles("Description", {
5740
5742
  root: {},
5741
5743
  button: {
5742
5744
  cursor: "pointer",
@@ -5768,7 +5770,7 @@ const Description = ({
5768
5770
  data,
5769
5771
  tweakStyles
5770
5772
  }) => {
5771
- const classes = useStyles$C({ theme: tweakStyles });
5773
+ const classes = useStyles$D({ theme: tweakStyles });
5772
5774
  const isTooShort = text.length < truncateIndex;
5773
5775
  const [isOpen, setIsOpen] = useState(isAlwaysOpen);
5774
5776
  const link = text.match(LINK_REGEXP);
@@ -5790,7 +5792,7 @@ const blockEvent = (event) => {
5790
5792
  event.preventDefault();
5791
5793
  event.stopPropagation();
5792
5794
  };
5793
- const useStyles$B = createThemedStyles("FileInput", {
5795
+ const useStyles$C = createThemedStyles("FileInput", {
5794
5796
  root: {
5795
5797
  display: "flex",
5796
5798
  flexDirection: "column",
@@ -5872,7 +5874,7 @@ const FileInput = forwardRef(function FileInput2({
5872
5874
  tweakStyles,
5873
5875
  data
5874
5876
  }, ref) {
5875
- const classes = useStyles$B({ theme: tweakStyles });
5877
+ const classes = useStyles$C({ theme: tweakStyles });
5876
5878
  const [isDragOver, setIsDragOver] = useState(false);
5877
5879
  const handleAdd = (files) => {
5878
5880
  if (isDisabled || isEmpty(files) || files?.length === 0) {
@@ -5934,7 +5936,7 @@ const FileInput = forwardRef(function FileInput2({
5934
5936
  /* @__PURE__ */ jsx("div", { className: classes.fileList, children: fileList })
5935
5937
  ] });
5936
5938
  });
5937
- const useStyles$A = createThemedStyles("IconButton", {
5939
+ const useStyles$B = createThemedStyles("IconButton", {
5938
5940
  root: {
5939
5941
  display: "flex",
5940
5942
  justifyContent: "center",
@@ -6014,7 +6016,7 @@ const IconButton = forwardRef(function IconButton2({
6014
6016
  onClick,
6015
6017
  ...restProps
6016
6018
  }, ref) {
6017
- const classes = useStyles$A({ theme: tweakStyles });
6019
+ const classes = useStyles$B({ theme: tweakStyles });
6018
6020
  const hasNoAction = isDisabled || isLoading;
6019
6021
  return /* @__PURE__ */ jsx(
6020
6022
  "button",
@@ -6034,7 +6036,7 @@ const IconButton = forwardRef(function IconButton2({
6034
6036
  }
6035
6037
  );
6036
6038
  });
6037
- const useStyles$z = createThemedStyles("Tooltip", {
6039
+ const useStyles$A = createThemedStyles("Tooltip", {
6038
6040
  root: {
6039
6041
  display: "inline-block",
6040
6042
  boxSizing: "border-box"
@@ -6083,7 +6085,7 @@ const Tooltip = ({
6083
6085
  testId,
6084
6086
  tweakStyles
6085
6087
  }) => {
6086
- const classes = useStyles$z({ theme: tweakStyles });
6088
+ const classes = useStyles$A({ theme: tweakStyles });
6087
6089
  return /* @__PURE__ */ jsx(
6088
6090
  "div",
6089
6091
  {
@@ -6098,7 +6100,7 @@ const Tooltip = ({
6098
6100
  }
6099
6101
  );
6100
6102
  };
6101
- const useStyles$y = createThemedStyles("TextWithTooltip", {
6103
+ const useStyles$z = createThemedStyles("TextWithTooltip", {
6102
6104
  root: {
6103
6105
  position: "relative"
6104
6106
  },
@@ -6126,7 +6128,7 @@ const TextWithTooltip = ({
6126
6128
  data,
6127
6129
  tweakStyles
6128
6130
  }) => {
6129
- const classes = useStyles$y({ theme: tweakStyles });
6131
+ const classes = useStyles$z({ theme: tweakStyles });
6130
6132
  const tweakTooltipStyles = useTweakStyles({
6131
6133
  tweakStyles,
6132
6134
  className: "tweakTooltip",
@@ -6249,7 +6251,7 @@ const getFileIcon = ({ type, name }) => {
6249
6251
  }
6250
6252
  return FILE_ICON_DEFAULT;
6251
6253
  };
6252
- const useStyles$x = createThemedStyles("FileItem", {
6254
+ const useStyles$y = createThemedStyles("FileItem", {
6253
6255
  root: {
6254
6256
  display: "flex",
6255
6257
  flexDirection: "column",
@@ -6357,7 +6359,7 @@ const FileItem = ({
6357
6359
  data,
6358
6360
  tweakStyles
6359
6361
  }) => {
6360
- const classes = useStyles$x({ theme: tweakStyles });
6362
+ const classes = useStyles$y({ theme: tweakStyles });
6361
6363
  const tweakIconButtonStyles = useTweakStyles({
6362
6364
  tweakStyles,
6363
6365
  className: "tweakRemoveIconButton",
@@ -6457,6 +6459,7 @@ const FilterLocales = {
6457
6459
  from: "От",
6458
6460
  to: "До",
6459
6461
  back: "Назад",
6462
+ date: "Дата",
6460
6463
  searchPlaceholder: "Поиск",
6461
6464
  displayedFields: "Поля для поиска",
6462
6465
  months: [
@@ -6490,6 +6493,7 @@ const FilterLocales = {
6490
6493
  from: "From",
6491
6494
  to: "To",
6492
6495
  back: "Back",
6496
+ date: "Date",
6493
6497
  searchPlaceholder: "Search",
6494
6498
  displayedFields: "Displayed fields",
6495
6499
  months: [
@@ -6553,6 +6557,154 @@ const getLocale$1 = (key = DEFAULT_LOCALE$1, custom, custom2) => merge(FilterLoc
6553
6557
  const getSelectLocale = (key = DEFAULT_SELECT_LOCALE, custom, custom2) => merge(SelectLocales[key], custom, custom2);
6554
6558
  const sortValues = (arr) => arr.includes(void 0) ? arr : arr.sort((a, b) => a < b ? -1 : 1);
6555
6559
  const defaultConvertFunction$1 = (val) => String(val);
6560
+ const FILTER_HEIGHT = 36;
6561
+ const useStyles$x = createThemedStyles("FiltersPane", {
6562
+ root: {
6563
+ display: "flex",
6564
+ flexWrap: "wrap",
6565
+ gap: 8,
6566
+ width: "100%"
6567
+ },
6568
+ settings: {
6569
+ display: "flex",
6570
+ alignItems: "center",
6571
+ justifyContent: "center",
6572
+ borderRadius: 18,
6573
+ boxSizing: "border-box",
6574
+ width: 40,
6575
+ height: FILTER_HEIGHT,
6576
+ cursor: "pointer",
6577
+ transition: animations.defaultTransition,
6578
+ transitionProperty: "background-color"
6579
+ },
6580
+ settingsIcon: {
6581
+ width: 16,
6582
+ height: 16
6583
+ },
6584
+ clear: {
6585
+ display: "flex",
6586
+ alignItems: "center",
6587
+ height: FILTER_HEIGHT
6588
+ },
6589
+ filterWithClearButton: {
6590
+ display: "flex",
6591
+ gap: 16,
6592
+ minWidth: 0
6593
+ }
6594
+ });
6595
+ const clearButtonStyles$5 = {
6596
+ s: {
6597
+ paddingLeft: 0,
6598
+ paddingRight: 0,
6599
+ minWidth: "unset"
6600
+ },
6601
+ text: {
6602
+ background: "none",
6603
+ color: colors.GREY_ACTIVE,
6604
+ "&:hover, &:focus": {
6605
+ color: colors.FONT_MEDIUM
6606
+ },
6607
+ "&:active": {
6608
+ color: colors.FONT_MAIN
6609
+ },
6610
+ "&:hover, &:focus, &:active": {
6611
+ background: "none",
6612
+ borderColor: "transparent"
6613
+ }
6614
+ }
6615
+ };
6616
+ const innerTextButtonStyles = {
6617
+ text: {
6618
+ color: colors.GREY_ACTIVE,
6619
+ "&:hover, &:focus": {
6620
+ color: colors.FONT_MEDIUM
6621
+ },
6622
+ "&:active": {
6623
+ color: colors.FONT_MEDIUM
6624
+ }
6625
+ }
6626
+ };
6627
+ const useStyles$w = createThemedStyles("FilterDateSingle", {
6628
+ root: {
6629
+ width: 312,
6630
+ background: colors.CLASSIC_WHITE,
6631
+ position: "relative",
6632
+ zIndex: 20
6633
+ },
6634
+ container: {
6635
+ padding: [8, 20]
6636
+ },
6637
+ buttons: {
6638
+ display: "flex",
6639
+ flexDirection: "row-reverse",
6640
+ justifyContent: "space-between",
6641
+ padding: 8
6642
+ }
6643
+ });
6644
+ const clearButtonStyles$4 = structuredClone(innerTextButtonStyles);
6645
+ const FilterDateSingle = ({
6646
+ value,
6647
+ label,
6648
+ locale,
6649
+ localeKey,
6650
+ isClearable,
6651
+ tweakStyles,
6652
+ onChange,
6653
+ onClose,
6654
+ onEndBtnSubmit,
6655
+ testId,
6656
+ data,
6657
+ ...props
6658
+ }) => {
6659
+ const classes = useStyles$w({ theme: tweakStyles });
6660
+ const tweakClearButtonStyles = useTweakStyles({
6661
+ innerStyles: clearButtonStyles$4,
6662
+ tweakStyles,
6663
+ className: "tweakClearButton",
6664
+ currentComponentName: "FilterDateSingle"
6665
+ });
6666
+ const tweakDatePickerStyles = useTweakStyles({
6667
+ tweakStyles,
6668
+ className: "tweakDatePicker",
6669
+ currentComponentName: "FilterDateSingle"
6670
+ });
6671
+ const popperTargetRef = useRef(null);
6672
+ const dateLocale = localeKey === "ru" ? ru : enUS;
6673
+ const translates = useMemo(() => getLocale$1(localeKey, locale), [localeKey, locale]);
6674
+ const handleClear = () => {
6675
+ onEndBtnSubmit();
6676
+ };
6677
+ return /* @__PURE__ */ jsxs("div", { className: classes.root, ref: popperTargetRef, ...addDataAttributes$1(data, testId), children: [
6678
+ /* @__PURE__ */ jsx("div", { className: classes.container, children: /* @__PURE__ */ jsx(
6679
+ DatePicker,
6680
+ {
6681
+ label: label ?? translates.date,
6682
+ locale: dateLocale,
6683
+ months: translates.months,
6684
+ selectedDate: value,
6685
+ onChangeDate: (date) => {
6686
+ onChange(date);
6687
+ onClose?.();
6688
+ },
6689
+ tweakStyles: tweakDatePickerStyles,
6690
+ popperProps: { elements: { reference: popperTargetRef?.current } },
6691
+ ...props
6692
+ }
6693
+ ) }),
6694
+ /* @__PURE__ */ jsx("div", { className: classes.buttons, children: isClearable && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
6695
+ Button,
6696
+ {
6697
+ onClick: handleClear,
6698
+ size: "s",
6699
+ view: "text",
6700
+ testId: getTestId(testId, "clear-button"),
6701
+ isFullWidth: true,
6702
+ tweakStyles: tweakClearButtonStyles,
6703
+ children: translates.clear
6704
+ }
6705
+ ) }) })
6706
+ ] });
6707
+ };
6556
6708
  const getPrevSpaces = (val, position) => val.slice(0, position).split("").filter(isSpaceChar).length;
6557
6709
  const getNewCaretPosition = (defaultPosition, oldValue, newValue, isDeleteForwardAction) => {
6558
6710
  if (oldValue === newValue) {
@@ -6670,73 +6822,6 @@ const NumberInput = forwardRef(function NumberInput2({
6670
6822
  }
6671
6823
  );
6672
6824
  });
6673
- const FILTER_HEIGHT = 36;
6674
- const useStyles$w = createThemedStyles("FiltersPane", {
6675
- root: {
6676
- display: "flex",
6677
- flexWrap: "wrap",
6678
- gap: 8,
6679
- width: "100%"
6680
- },
6681
- settings: {
6682
- display: "flex",
6683
- alignItems: "center",
6684
- justifyContent: "center",
6685
- borderRadius: 18,
6686
- boxSizing: "border-box",
6687
- width: 40,
6688
- height: FILTER_HEIGHT,
6689
- cursor: "pointer",
6690
- transition: animations.defaultTransition,
6691
- transitionProperty: "background-color"
6692
- },
6693
- settingsIcon: {
6694
- width: 16,
6695
- height: 16
6696
- },
6697
- clear: {
6698
- display: "flex",
6699
- alignItems: "center",
6700
- height: FILTER_HEIGHT
6701
- },
6702
- filterWithClearButton: {
6703
- display: "flex",
6704
- gap: 16,
6705
- minWidth: 0
6706
- }
6707
- });
6708
- const clearButtonStyles$4 = {
6709
- s: {
6710
- paddingLeft: 0,
6711
- paddingRight: 0,
6712
- minWidth: "unset"
6713
- },
6714
- text: {
6715
- background: "none",
6716
- color: colors.GREY_ACTIVE,
6717
- "&:hover, &:focus": {
6718
- color: colors.FONT_MEDIUM
6719
- },
6720
- "&:active": {
6721
- color: colors.FONT_MAIN
6722
- },
6723
- "&:hover, &:focus, &:active": {
6724
- background: "none",
6725
- borderColor: "transparent"
6726
- }
6727
- }
6728
- };
6729
- const innerTextButtonStyles = {
6730
- text: {
6731
- color: colors.GREY_ACTIVE,
6732
- "&:hover, &:focus": {
6733
- color: colors.FONT_MEDIUM
6734
- },
6735
- "&:active": {
6736
- color: colors.FONT_MEDIUM
6737
- }
6738
- }
6739
- };
6740
6825
  const useStyles$v = createThemedStyles("FilterInterval", {
6741
6826
  root: {
6742
6827
  padding: 8,
@@ -7697,7 +7782,7 @@ function FilterSelect({
7697
7782
  }
7698
7783
  const useStyles$s = createThemedStyles("FilterWithDates", {
7699
7784
  root: {
7700
- width: 320,
7785
+ width: 312,
7701
7786
  background: colors.CLASSIC_WHITE,
7702
7787
  position: "relative",
7703
7788
  zIndex: 20
@@ -7716,27 +7801,10 @@ const useStyles$s = createThemedStyles("FilterWithDates", {
7716
7801
  flexDirection: "row-reverse",
7717
7802
  justifyContent: "space-between",
7718
7803
  padding: 8
7719
- },
7720
- datepicker: {}
7804
+ }
7721
7805
  });
7722
7806
  const clearButtonStyles = structuredClone(innerTextButtonStyles);
7723
7807
  const backButtonStyles = innerTextButtonStyles;
7724
- const PICKER_TOP_MARGIN = 28;
7725
- const PICKER_WITH_BUTTONS_TOP_MARGIN = 56;
7726
- const START_PICKER_LEFT_MARGIN = -20;
7727
- const END_PICKER_LEFT_MARGIN = -170;
7728
- const startDatePickerStyles = {
7729
- popper: { marginTop: PICKER_TOP_MARGIN, marginLeft: START_PICKER_LEFT_MARGIN }
7730
- };
7731
- const startDatePickerWithButtonStyles = {
7732
- popper: { marginTop: PICKER_WITH_BUTTONS_TOP_MARGIN, marginLeft: START_PICKER_LEFT_MARGIN }
7733
- };
7734
- const endDatePickerStyles = {
7735
- popper: { marginTop: PICKER_TOP_MARGIN, marginLeft: END_PICKER_LEFT_MARGIN }
7736
- };
7737
- const endDatePickerWithButtonStyles = {
7738
- popper: { marginTop: PICKER_WITH_BUTTONS_TOP_MARGIN, marginLeft: END_PICKER_LEFT_MARGIN }
7739
- };
7740
7808
  const FilterWithDates = ({
7741
7809
  value,
7742
7810
  onChange,
@@ -7764,36 +7832,22 @@ const FilterWithDates = ({
7764
7832
  className: "tweakBackButton",
7765
7833
  currentComponentName: "FilterWithDates"
7766
7834
  });
7767
- const hasButtonsRow = isClearable || isNotEmpty(onStartBtnSubmit);
7768
7835
  const tweakStartDatePickerStyles = useTweakStyles({
7769
- innerStyles: hasButtonsRow ? startDatePickerWithButtonStyles : startDatePickerStyles,
7770
7836
  tweakStyles,
7771
7837
  className: "tweakStartDatePicker",
7772
7838
  currentComponentName: "FilterWithDates"
7773
7839
  });
7774
7840
  const tweakEndDatePickerStyles = useTweakStyles({
7775
- innerStyles: hasButtonsRow ? endDatePickerWithButtonStyles : endDatePickerStyles,
7776
7841
  tweakStyles,
7777
7842
  className: "tweakEndDatePicker",
7778
7843
  currentComponentName: "FilterWithDates"
7779
7844
  });
7780
- const [isOpenFrom, setOpenFrom] = useState(false);
7781
- const [isOpenTo, setOpenTo] = useState(false);
7782
- const ref = useRef(null);
7845
+ const popperTargetRef = useRef(null);
7783
7846
  const dateLocale = localeKey === "ru" ? ru : enUS;
7784
7847
  const translates = useMemo(() => getLocale$1(localeKey, locale), [localeKey, locale]);
7785
7848
  const handleClear = () => {
7786
7849
  onEndBtnSubmit();
7787
7850
  };
7788
- const isOpenCalendar = isOpenFrom || isOpenTo;
7789
- const handleFromSelected = (val) => {
7790
- onChange({ from: val, to: value?.to ?? null });
7791
- setOpenFrom(false);
7792
- };
7793
- const handleToSelected = (val) => {
7794
- onChange({ from: value?.from ?? null, to: val });
7795
- setOpenTo(false);
7796
- };
7797
7851
  const handleChangeFrom = (val) => {
7798
7852
  if (val !== null && value !== void 0 && value.to !== null && isAfter(val, value.to)) {
7799
7853
  onChange({ from: value.to, to: val });
@@ -7808,7 +7862,7 @@ const FilterWithDates = ({
7808
7862
  onChange({ from: value?.from ?? null, to: val });
7809
7863
  }
7810
7864
  };
7811
- return /* @__PURE__ */ jsxs("div", { className: classes.root, ...addDataAttributes$1(data, testId), children: [
7865
+ return /* @__PURE__ */ jsxs("div", { className: classes.root, ref: popperTargetRef, ...addDataAttributes$1(data, testId), children: [
7812
7866
  /* @__PURE__ */ jsxs("div", { className: classes.container, children: [
7813
7867
  /* @__PURE__ */ jsx("div", { className: classes.containerItem, children: /* @__PURE__ */ jsx(
7814
7868
  DatePicker,
@@ -7822,6 +7876,7 @@ const FilterWithDates = ({
7822
7876
  tweakStyles: tweakStartDatePickerStyles,
7823
7877
  testId: getTestId(testId, "from"),
7824
7878
  isClearable,
7879
+ popperProps: { elements: { reference: popperTargetRef?.current } },
7825
7880
  ...startPickerProps
7826
7881
  }
7827
7882
  ) }),
@@ -7837,6 +7892,7 @@ const FilterWithDates = ({
7837
7892
  tweakStyles: tweakEndDatePickerStyles,
7838
7893
  testId: getTestId(testId, "to"),
7839
7894
  isClearable,
7895
+ popperProps: { elements: { reference: popperTargetRef?.current } },
7840
7896
  ...endPickerProps
7841
7897
  }
7842
7898
  ) })
@@ -7865,18 +7921,7 @@ const FilterWithDates = ({
7865
7921
  children: translates.back
7866
7922
  }
7867
7923
  ) })
7868
- ] }),
7869
- isOpenCalendar && /* @__PURE__ */ jsx("div", { ref, className: classes.datepicker, children: /* @__PURE__ */ jsx(
7870
- DatePicker,
7871
- {
7872
- selectedDate: (isOpenFrom ? value?.from : value?.to) ?? null,
7873
- label: "",
7874
- locale: dateLocale,
7875
- months: translates.months,
7876
- isInline: true,
7877
- onChangeDate: isOpenFrom ? handleFromSelected : handleToSelected
7878
- }
7879
- ) })
7924
+ ] })
7880
7925
  ] });
7881
7926
  };
7882
7927
  const useStyles$r = createThemedStyles("FilterWithPeriod", {
@@ -8072,6 +8117,22 @@ function Filter(props) {
8072
8117
  }
8073
8118
  );
8074
8119
  }
8120
+ if (filter2.type === "datePickerSingle") {
8121
+ const preparedValue = isDateOrEmpty(value) ? value : void 0;
8122
+ return /* @__PURE__ */ jsx(
8123
+ FilterDateSingle,
8124
+ {
8125
+ value: preparedValue,
8126
+ onChange,
8127
+ onClose,
8128
+ onEndBtnSubmit: () => onChange(void 0),
8129
+ localeKey: translatesLocaleKey,
8130
+ locale: translates,
8131
+ testId: getTestId(testId, "datePicker"),
8132
+ ...filter2
8133
+ }
8134
+ );
8135
+ }
8075
8136
  if (filter2.type === "multiSelect") {
8076
8137
  const preparedValue = isMultiSelectValue(value) ? value : void 0;
8077
8138
  return /* @__PURE__ */ jsx(
@@ -8351,7 +8412,7 @@ function FilterValueView({
8351
8412
  }
8352
8413
  const isMultiple = filter2.type === "custom" && filter2.valueViewType === "multiple";
8353
8414
  const isRange = filter2.type === "custom" && filter2.valueViewType === "range";
8354
- const isDate = filter2.type === "dateRange" || filter2.type === "dateRangeWithoutPeriod";
8415
+ const isDateRange = filter2.type === "dateRange" || filter2.type === "dateRangeWithoutPeriod";
8355
8416
  const displayValue = (v) => {
8356
8417
  if (!isNotEmpty(v)) {
8357
8418
  return "";
@@ -8400,7 +8461,7 @@ function FilterValueView({
8400
8461
  }
8401
8462
  return /* @__PURE__ */ jsx("span", { className: classes.text, children: intervals.join(" ") });
8402
8463
  }
8403
- if (isDate) {
8464
+ if (isDateRange) {
8404
8465
  const { from, to, periodType, label } = value;
8405
8466
  const hasFrom = from !== void 0 && from !== null;
8406
8467
  const hasTo = to !== void 0 && to !== null;
@@ -8671,9 +8732,9 @@ function FiltersPane({
8671
8732
  onSettingsButtonClick,
8672
8733
  onClear
8673
8734
  }) {
8674
- const classes = useStyles$w({ theme: tweakStyles });
8735
+ const classes = useStyles$x({ theme: tweakStyles });
8675
8736
  const tweakClearButtonStyles = useTweakStyles({
8676
- innerStyles: clearButtonStyles$4,
8737
+ innerStyles: clearButtonStyles$5,
8677
8738
  tweakStyles,
8678
8739
  className: "tweakClearButton",
8679
8740
  currentComponentName: "FiltersPane"
@@ -10774,131 +10835,49 @@ function RadioButton({
10774
10835
  }
10775
10836
  );
10776
10837
  }
10777
- const SELECTOR_TOTAL_GAP = 4;
10778
- const SELECTOR_BORDER_WIDTH = 1;
10779
- const SELECTOR_GAP = SELECTOR_TOTAL_GAP - SELECTOR_BORDER_WIDTH;
10780
- const getSelectorLineStyle = (activeElementData) => isNotEmpty(activeElementData) ? {
10781
- width: activeElementData.clientWidth - SELECTOR_GAP * 2,
10782
- transform: `translateX(${activeElementData.offsetLeft}px)`
10783
- } : void 0;
10784
10838
  const useStyles$7 = createThemedStyles("Selector", {
10785
- root: {
10786
- display: "flex",
10787
- alignItems: "center",
10788
- listStyle: "none",
10789
- position: "relative"
10790
- },
10791
- required: {
10792
- "&::before": {
10793
- top: "50%",
10794
- left: -12,
10795
- width: 6,
10796
- height: 6,
10839
+ selector: {
10840
+ display: "grid",
10841
+ gridAutoFlow: "column",
10842
+ gridAutoColumns: "auto",
10843
+ boxSizing: "border-box",
10844
+ position: "relative",
10845
+ "&:has($active)::before": {
10797
10846
  content: '""',
10798
10847
  position: "absolute",
10799
- transform: "translate(0, -50%)",
10800
- borderRadius: "50%",
10801
- backgroundColor: colors.ORANGE_FOCUS
10848
+ transition: animations.defaultTransition,
10849
+ transitionProperty: "left, width",
10850
+ width: "var(--active-element-width)",
10851
+ height: "var(--active-element-height)",
10852
+ top: "var(--active-element-top)",
10853
+ left: "var(--active-element-left)"
10802
10854
  }
10803
10855
  },
10804
- invalid: {},
10805
- optionWrapper: {
10806
- height: "100%"
10856
+ autoWidth: {
10857
+ gridAutoColumns: "1fr"
10807
10858
  },
10859
+ required: {},
10860
+ invalid: {},
10808
10861
  option: {
10862
+ appearance: "none",
10863
+ background: "none",
10864
+ border: "none",
10809
10865
  display: "flex",
10810
10866
  alignItems: "center",
10811
10867
  justifyContent: "center",
10812
- appearance: "none",
10813
- borderRadius: 0,
10814
- padding: 0,
10815
- border: "none",
10816
- cursor: "pointer",
10817
- width: "100%"
10818
- },
10819
- active: {
10820
- cursor: "default"
10821
- },
10822
- disabled: {
10823
- cursor: "default",
10824
- "& $optionText": {
10825
- color: colors.FONT_LABEL
10826
- }
10827
- },
10828
- optionIcon: {
10829
- width: 20,
10830
- height: 20
10831
- },
10832
- optionText: {},
10833
- iconFromRight: {
10834
- "& $option": {
10868
+ zIndex: 1,
10869
+ "$iconFromRight &": {
10835
10870
  flexDirection: "row-reverse"
10836
10871
  }
10837
10872
  },
10873
+ active: {},
10874
+ disabled: {},
10875
+ optionIcon: {},
10876
+ optionText: {},
10877
+ iconFromRight: {},
10838
10878
  s: {},
10839
10879
  m: {},
10840
- l: {},
10841
- line: {},
10842
- selector: {
10843
- display: "grid",
10844
- gridAutoFlow: "column",
10845
- gridAutoColumns: "1fr",
10846
- borderRadius: dimensions.BORDER_RADIUS_SMALL,
10847
- backgroundColor: colors.BORDER_LIGHT,
10848
- width: "fit-content",
10849
- position: "relative",
10850
- border: ["solid", SELECTOR_BORDER_WIDTH, "transparent"],
10851
- "& $line": {
10852
- content: '""',
10853
- position: "absolute",
10854
- left: SELECTOR_GAP,
10855
- height: `calc(100% - ${SELECTOR_GAP * 2}px)`,
10856
- backgroundColor: colors.CLASSIC_WHITE,
10857
- borderRadius: dimensions.BORDER_RADIUS_SMALL,
10858
- transition: animations.defaultTransition,
10859
- transitionProperty: "transform, width"
10860
- },
10861
- "&$invalid": {
10862
- borderColor: colors.RED_WARNING
10863
- },
10864
- "& $option": {
10865
- gap: 6,
10866
- position: "relative",
10867
- zIndex: 1,
10868
- height: "100%",
10869
- color: colors.FONT_MEDIUM,
10870
- fontSize: 16,
10871
- transition: animations.defaultTransition,
10872
- transitionProperty: "color",
10873
- background: "none",
10874
- "&$s": {
10875
- padding: [4, 8],
10876
- fontSize: 10,
10877
- lineHeight: "14px"
10878
- },
10879
- "&$m": {
10880
- padding: [14, 18]
10881
- },
10882
- "&$l": {
10883
- padding: [16, 24]
10884
- },
10885
- "&:hover, &:focus": {
10886
- color: colors.FONT_MAIN
10887
- },
10888
- "&$active": {
10889
- color: colors.FONT_MAIN
10890
- }
10891
- }
10892
- },
10893
- autoWidth: {
10894
- "&$selector": {
10895
- gridAutoColumns: "auto",
10896
- "& $line": {
10897
- width: "unset",
10898
- transform: "unset"
10899
- }
10900
- }
10901
- }
10880
+ l: {}
10902
10881
  });
10903
10882
  function Selector({
10904
10883
  options,
@@ -10914,57 +10893,53 @@ function Selector({
10914
10893
  tweakStyles,
10915
10894
  onChange
10916
10895
  }) {
10917
- const classes = useStyles$7({ theme: tweakStyles });
10918
- const optionsValues = options.map((opt) => opt.value);
10919
- const [elementsData, setElementsData] = useState([]);
10920
- const listRef = useRef(null);
10921
- if (hasDuplicates(optionsValues)) {
10922
- console.error("Selector: Значения options.value должны быть уникальными");
10923
- }
10924
- useEffect(() => {
10925
- const listEl = listRef.current;
10926
- if (listEl === null) {
10927
- return;
10896
+ const classes = useStyles$7({ tweakStyles });
10897
+ const updateVariables = (active) => {
10898
+ if (isNotEmpty(active?.parentElement)) {
10899
+ active.parentElement.style.setProperty("--active-element-width", `${active.clientWidth}px`);
10900
+ active.parentElement.style.setProperty("--active-element-height", `${active.clientHeight}px`);
10901
+ active.parentElement.style.setProperty("--active-element-left", `${active.offsetLeft}px`);
10902
+ active.parentElement.style.setProperty("--active-element-top", `${active.offsetTop}px`);
10928
10903
  }
10929
- setElementsData([...listEl.querySelectorAll(`.${classes.optionWrapper}`)]);
10930
- }, [options, size2]);
10931
- const activeElementData = isNotEmpty(value) ? elementsData[optionsValues.indexOf(value)] : void 0;
10932
- return /* @__PURE__ */ jsxs(
10904
+ };
10905
+ const resizeRef = useResizeRef({
10906
+ onTargetChange: (target) => updateVariables(target.querySelector(`.${classes.active}`))
10907
+ });
10908
+ return /* @__PURE__ */ jsx(
10933
10909
  "div",
10934
10910
  {
10935
- className: clsx(classes.root, classes.selector, {
10911
+ ref: resizeRef,
10912
+ className: clsx(classes.selector, classes[size2], {
10936
10913
  [classes.iconFromRight]: iconPosition === "right",
10937
10914
  [classes.invalid]: isInvalid,
10938
10915
  [classes.required]: isRequired,
10939
10916
  [classes.autoWidth]: hasSameOptionsWidth
10940
10917
  }),
10941
- ref: listRef,
10942
10918
  ...addDataAttributes$1(data, testId),
10943
- children: [
10944
- isNotEmpty(activeElementData) && /* @__PURE__ */ jsx("div", { className: classes.line, style: getSelectorLineStyle(activeElementData) }),
10945
- options.map((option) => {
10946
- const optionId = option.value.toString();
10947
- const isDisabledOption = option.isDisabled ?? isDisabled;
10948
- const isActiveOption = option.value === value;
10949
- return /* @__PURE__ */ jsx("div", { className: classes.optionWrapper, children: /* @__PURE__ */ jsxs(
10950
- "button",
10951
- {
10952
- type: "button",
10953
- className: clsx(classes.option, classes[size2], {
10954
- [classes.active]: isActiveOption,
10955
- [classes.disabled]: isDisabledOption
10956
- }),
10957
- disabled: isDisabledOption,
10958
- onClick: !isDisabledOption ? () => onChange(option.value) : void 0,
10959
- ...addDataTestId(testId, optionId),
10960
- children: [
10961
- isReactNodeNotEmpty(option.icon) && /* @__PURE__ */ jsx("div", { className: classes.optionIcon, children: renderIcon(option.icon) }),
10962
- /* @__PURE__ */ jsx("div", { className: classes.optionText, children: option.label })
10963
- ]
10964
- }
10965
- ) }, optionId);
10966
- })
10967
- ]
10919
+ children: options.map((option) => {
10920
+ const optionId = String(option.value);
10921
+ const isDisabledOption = option.isDisabled || isDisabled;
10922
+ const isActiveOption = option.value === value;
10923
+ return /* @__PURE__ */ jsxs(
10924
+ "button",
10925
+ {
10926
+ ref: isActiveOption ? updateVariables : void 0,
10927
+ type: "button",
10928
+ className: clsx(classes.option, {
10929
+ [classes.active]: isActiveOption,
10930
+ [classes.disabled]: isDisabledOption
10931
+ }),
10932
+ disabled: isDisabledOption,
10933
+ onClick: !isDisabledOption ? () => onChange(option.value) : void 0,
10934
+ ...addDataTestId(testId, optionId),
10935
+ children: [
10936
+ isReactNodeNotEmpty(option.icon) && /* @__PURE__ */ jsx("div", { className: classes.optionIcon, children: renderIcon(option.icon) }),
10937
+ /* @__PURE__ */ jsx("div", { className: classes.optionText, children: option.label })
10938
+ ]
10939
+ },
10940
+ optionId
10941
+ );
10942
+ })
10968
10943
  }
10969
10944
  );
10970
10945
  }
@@ -12025,6 +12000,7 @@ export {
12025
12000
  FileInput,
12026
12001
  FileItem,
12027
12002
  Filter,
12003
+ FilterDateSingle,
12028
12004
  FilterInterval,
12029
12005
  FilterMultiSelect,
12030
12006
  FilterSelect,