@true-engineering/true-react-common-ui-kit 3.17.0 → 3.18.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.
- package/README.md +7 -0
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +3 -1
- package/dist/components/Modal/Modal.styles.d.ts +1 -1
- package/dist/components/WithPopup/WithPopup.d.ts +1 -2
- package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
- package/dist/components/WithPopup/types.d.ts +0 -2
- package/dist/theme/common.d.ts +1 -0
- package/dist/true-react-common-ui-kit.js +57 -39
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +57 -39
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +2 -12
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +17 -12
- package/src/components/FlexibleTable/FlexibleTable.tsx +2 -1
- package/src/components/WithPopup/WithPopup.styles.ts +21 -0
- package/src/components/WithPopup/WithPopup.tsx +10 -5
- package/src/components/WithPopup/types.ts +0 -3
- package/src/theme/common.ts +3 -2
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../../../theme';
|
|
2
|
+
import { IWithPopupStyles } from '../../../WithPopup';
|
|
2
3
|
import type { IFilterValueViewStyles } from '../FilterValueView';
|
|
3
|
-
export declare const useStyles: import("../../../../theme").IUseStyles<"boolean" | "name" | "left" | "right" | "item" | "value" | "root" | "open" | "disabled" | "booleanItem" | "noValue" | "openNoValue" | "openWithValue" | "withValue" | "iconContainer" | "dropdown"
|
|
4
|
+
export declare const useStyles: import("../../../../theme").IUseStyles<"boolean" | "name" | "left" | "right" | "item" | "value" | "root" | "open" | "disabled" | "booleanItem" | "noValue" | "openNoValue" | "openWithValue" | "withValue" | "iconContainer" | "dropdown", unknown>;
|
|
4
5
|
export type IFilterWrapperStyles = ITweakStyles<typeof useStyles, {
|
|
6
|
+
tweakWithPopup: IWithPopupStyles;
|
|
5
7
|
tweakValueView: IFilterValueViewStyles;
|
|
6
8
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
2
|
import { IIconButtonStyles } from '../IconButton';
|
|
3
|
-
export declare const useStyles: import("../../theme").IUseStyles<"content" | "close" | "overlay" | "root" | "s" | "m" | "l" | "footer" | "
|
|
3
|
+
export declare const useStyles: import("../../theme").IUseStyles<"content" | "close" | "overlay" | "root" | "s" | "m" | "l" | "footer" | "fixedPosition" | "innerOverlay" | "sideBar" | "position-static" | "position-left" | "position-right" | "position-center" | "modal" | "title" | "titleWithCloseButton" | "stickyFooterWrapper" | "stickyFooter" | "buttons-left" | "buttons-center" | "buttons-right" | "withoutFooter" | "withStickyFooter" | "footerWrapper" | "modalWrapper" | "animationEnd" | "animationStart" | "modal-enter" | "modal-enter-active" | "modal-exit" | "modal-exit-active", unknown>;
|
|
4
4
|
export declare const closeButtonStyles: IIconButtonStyles;
|
|
5
5
|
export type IModalStyles = ITweakStyles<typeof useStyles, {
|
|
6
6
|
tweakCloseButton: IIconButtonStyles;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { Placement, Middleware, OffsetOptions, UseHoverProps } from '@floating-ui/react';
|
|
3
3
|
import { ICommonProps } from '../../types';
|
|
4
|
-
import { IPopupEventType
|
|
4
|
+
import { IPopupEventType } from './types';
|
|
5
5
|
import { IWithPopupStyles } from './WithPopup.styles';
|
|
6
6
|
export interface IWithPopupProps extends ICommonProps<IWithPopupStyles> {
|
|
7
7
|
trigger: ReactNode | FC<{
|
|
8
8
|
isActive: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
children: ReactNode | FC<{
|
|
11
|
-
status: ITransitionStatus;
|
|
12
11
|
onClose: () => void;
|
|
13
12
|
}>;
|
|
14
13
|
middlewares?: Middleware[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
|
-
export declare const useStyles: import("../../theme").IUseStyles<"root" | "disabled" | "trigger" | "popup", unknown>;
|
|
2
|
+
export declare const useStyles: import("../../theme").IUseStyles<"root" | "disabled" | "animationEnd" | "animationStart" | "trigger" | "popup" | "dropdown-initial" | "dropdown-open" | "dropdown-close" | "dropdown-unmounted", unknown>;
|
|
3
3
|
export type IWithPopupStyles = ITweakStyles<typeof useStyles>;
|
package/dist/theme/common.d.ts
CHANGED
|
@@ -1079,6 +1079,7 @@ var helpers = {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
|
+
var SLIDE_UP_ANIMATION_DURATION = 150;
|
|
1082
1083
|
var SLIDE_UP_POSITION_START = 15;
|
|
1083
1084
|
var SLIDE_UP_POSITION_END = 0;
|
|
1084
1085
|
var animations = {
|
|
@@ -1092,7 +1093,7 @@ var animations = {
|
|
|
1092
1093
|
"slide-up-enter-active": {
|
|
1093
1094
|
opacity: 1,
|
|
1094
1095
|
transform: "translateY(".concat(SLIDE_UP_POSITION_END, "px)"),
|
|
1095
|
-
transition: "
|
|
1096
|
+
transition: "".concat(SLIDE_UP_ANIMATION_DURATION, "ms ease-in-out"),
|
|
1096
1097
|
transitionProperty: "opacity, transform"
|
|
1097
1098
|
},
|
|
1098
1099
|
"slide-up-exit-active": {
|
|
@@ -1102,7 +1103,7 @@ var animations = {
|
|
|
1102
1103
|
"slide-up-exit": {
|
|
1103
1104
|
opacity: 0,
|
|
1104
1105
|
transform: "translateY(".concat(SLIDE_UP_POSITION_START, "px)"),
|
|
1105
|
-
transition: "
|
|
1106
|
+
transition: "".concat(SLIDE_UP_ANIMATION_DURATION, "ms ease-in-out"),
|
|
1106
1107
|
transitionProperty: "opacity, transform"
|
|
1107
1108
|
}
|
|
1108
1109
|
}
|
|
@@ -17645,6 +17646,21 @@ var useStyles$q = createThemedStyles("WithPopup", {
|
|
|
17645
17646
|
},
|
|
17646
17647
|
popup: {
|
|
17647
17648
|
zIndex: 5
|
|
17649
|
+
},
|
|
17650
|
+
animationEnd: {},
|
|
17651
|
+
animationStart: {},
|
|
17652
|
+
"dropdown-initial": {
|
|
17653
|
+
extend: "animationEnd"
|
|
17654
|
+
},
|
|
17655
|
+
"dropdown-open": {
|
|
17656
|
+
extend: "animationStart"
|
|
17657
|
+
},
|
|
17658
|
+
"dropdown-close": {
|
|
17659
|
+
visibility: "hidden",
|
|
17660
|
+
extend: "animationEnd"
|
|
17661
|
+
},
|
|
17662
|
+
"dropdown-unmounted": {
|
|
17663
|
+
extend: "animationEnd"
|
|
17648
17664
|
}
|
|
17649
17665
|
});
|
|
17650
17666
|
function _array_like_to_array$a(arr, len) {
|
|
@@ -17800,7 +17816,10 @@ var WithPopup = function(param) {
|
|
|
17800
17816
|
}), refs = _useFloating.refs, floatingStyles = _useFloating.floatingStyles, context = _useFloating.context;
|
|
17801
17817
|
var hover = useHover(context, {
|
|
17802
17818
|
enabled: eventType === "hover",
|
|
17803
|
-
delay: hoverDelay
|
|
17819
|
+
delay: typeof hoverDelay === "number" ? {
|
|
17820
|
+
open: hoverDelay,
|
|
17821
|
+
close: 0
|
|
17822
|
+
} : hoverDelay
|
|
17804
17823
|
});
|
|
17805
17824
|
var click = useClick(context, {
|
|
17806
17825
|
enabled: eventType === "click",
|
|
@@ -17815,7 +17834,11 @@ var WithPopup = function(param) {
|
|
|
17815
17834
|
click,
|
|
17816
17835
|
dismiss
|
|
17817
17836
|
]).getFloatingProps;
|
|
17818
|
-
var _useTransitionStatus = useTransitionStatus(context
|
|
17837
|
+
var _useTransitionStatus = useTransitionStatus(context, {
|
|
17838
|
+
duration: {
|
|
17839
|
+
close: 500
|
|
17840
|
+
}
|
|
17841
|
+
}), isMounted = _useTransitionStatus.isMounted, status = _useTransitionStatus.status;
|
|
17819
17842
|
return /* @__PURE__ */ jsxs("div", _object_spread_props$q(_object_spread$r({
|
|
17820
17843
|
ref: refs.setReference,
|
|
17821
17844
|
className: clsx(classes.root, _define_property$s({}, classes.disabled, isDisabled))
|
|
@@ -17838,10 +17861,12 @@ var WithPopup = function(param) {
|
|
|
17838
17861
|
className: classes.popup,
|
|
17839
17862
|
ref: refs.setFloating
|
|
17840
17863
|
}, getFloatingProps()), {
|
|
17841
|
-
children:
|
|
17842
|
-
status,
|
|
17843
|
-
|
|
17844
|
-
|
|
17864
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
17865
|
+
className: classes["dropdown-".concat(status)],
|
|
17866
|
+
children: isFunction$1(children) ? children({
|
|
17867
|
+
onClose: handleClose
|
|
17868
|
+
}) : children
|
|
17869
|
+
})
|
|
17845
17870
|
}))
|
|
17846
17871
|
})
|
|
17847
17872
|
]
|
|
@@ -17948,20 +17973,6 @@ var useStyles$p = createThemedStyles("FilterWrapper", {
|
|
|
17948
17973
|
fontWeight: "bold",
|
|
17949
17974
|
display: "flex",
|
|
17950
17975
|
minWidth: 0
|
|
17951
|
-
},
|
|
17952
|
-
animationEnd: animations.slideUp["slide-up-exit"],
|
|
17953
|
-
animationStart: animations.slideUp["slide-up-enter-active"],
|
|
17954
|
-
"dropdown-initial": {
|
|
17955
|
-
extend: "animationEnd"
|
|
17956
|
-
},
|
|
17957
|
-
"dropdown-open": {
|
|
17958
|
-
extend: "animationStart"
|
|
17959
|
-
},
|
|
17960
|
-
"dropdown-close": {
|
|
17961
|
-
extend: "animationEnd"
|
|
17962
|
-
},
|
|
17963
|
-
"dropdown-unmounted": {
|
|
17964
|
-
extend: "animationEnd"
|
|
17965
17976
|
}
|
|
17966
17977
|
});
|
|
17967
17978
|
function _define_property$r(obj, key, value) {
|
|
@@ -18021,6 +18032,11 @@ function FilterWrapper(param) {
|
|
|
18021
18032
|
var classes = useStyles$p({
|
|
18022
18033
|
theme: tweakStyles
|
|
18023
18034
|
});
|
|
18035
|
+
var tweakWithPopupStyles = useTweakStyles({
|
|
18036
|
+
tweakStyles,
|
|
18037
|
+
className: "tweakWithPopup",
|
|
18038
|
+
currentComponentName: "FilterWrapper"
|
|
18039
|
+
});
|
|
18024
18040
|
var tweakFilterValueViewStyles = useTweakStyles({
|
|
18025
18041
|
tweakStyles,
|
|
18026
18042
|
className: "tweakValueView",
|
|
@@ -18047,6 +18063,7 @@ function FilterWrapper(param) {
|
|
|
18047
18063
|
placement: "bottom-start",
|
|
18048
18064
|
canBeFlipped: true,
|
|
18049
18065
|
isDisabled: isBoolean || isDisabled,
|
|
18066
|
+
tweakStyles: tweakWithPopupStyles,
|
|
18050
18067
|
trigger: function(param2) {
|
|
18051
18068
|
var isActive = param2.isActive;
|
|
18052
18069
|
var _obj;
|
|
@@ -18083,18 +18100,15 @@ function FilterWrapper(param) {
|
|
|
18083
18100
|
}));
|
|
18084
18101
|
},
|
|
18085
18102
|
children: function(param2) {
|
|
18086
|
-
var onClose = param2.onClose
|
|
18087
|
-
return /* @__PURE__ */ jsx(
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
onChange,
|
|
18096
|
-
testId
|
|
18097
|
-
})
|
|
18103
|
+
var onClose = param2.onClose;
|
|
18104
|
+
return /* @__PURE__ */ jsx(Filter, {
|
|
18105
|
+
value,
|
|
18106
|
+
filter,
|
|
18107
|
+
localeKey,
|
|
18108
|
+
locale: locale2,
|
|
18109
|
+
onClose,
|
|
18110
|
+
onChange,
|
|
18111
|
+
testId
|
|
18098
18112
|
});
|
|
18099
18113
|
}
|
|
18100
18114
|
});
|
|
@@ -25230,7 +25244,7 @@ function FlexibleTable(_param) {
|
|
|
25230
25244
|
var TitleComponent = itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.titleComponent;
|
|
25231
25245
|
var _itemConfig_titleAlign, _itemConfig_title;
|
|
25232
25246
|
var _obj;
|
|
25233
|
-
return /* @__PURE__ */ jsx(TableHeader, {
|
|
25247
|
+
return /* @__PURE__ */ jsx(TableHeader, _object_spread_props$k(_object_spread$l({
|
|
25234
25248
|
className: clsx(classes.header, (_obj = {}, _define_property$m(_obj, classes.headerSticky, isFirstColumnSticky && i === 0), _define_property$m(_obj, classes.headerSecond, isFirstColumnSticky && i === 1), _obj)),
|
|
25235
25249
|
style: {
|
|
25236
25250
|
minWidth: itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.minWidth,
|
|
@@ -25238,13 +25252,16 @@ function FlexibleTable(_param) {
|
|
|
25238
25252
|
maxWidth: itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.maxWidth,
|
|
25239
25253
|
textAlign: (_itemConfig_titleAlign = itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.titleAlign) !== null && _itemConfig_titleAlign !== void 0 ? _itemConfig_titleAlign : "left"
|
|
25240
25254
|
},
|
|
25241
|
-
onClick: function() {
|
|
25242
|
-
return onHeadClick
|
|
25243
|
-
}
|
|
25255
|
+
onClick: isNotEmpty(onHeadClick) ? function() {
|
|
25256
|
+
return onHeadClick(key);
|
|
25257
|
+
} : void 0
|
|
25258
|
+
}, addDataAttributes({
|
|
25259
|
+
id: (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.shouldRenderDataId) ? key : void 0
|
|
25260
|
+
})), {
|
|
25244
25261
|
children: isNotEmpty(TitleComponent) ? /* @__PURE__ */ jsx(TitleComponent, {
|
|
25245
25262
|
value: headerContent === null || headerContent === void 0 ? void 0 : headerContent[key]
|
|
25246
25263
|
}) : (_itemConfig_title = itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.title) !== null && _itemConfig_title !== void 0 ? _itemConfig_title : ""
|
|
25247
|
-
}, key);
|
|
25264
|
+
}), key);
|
|
25248
25265
|
})
|
|
25249
25266
|
})
|
|
25250
25267
|
}),
|
|
@@ -30389,6 +30406,7 @@ export {
|
|
|
30389
30406
|
NumberInput,
|
|
30390
30407
|
PhoneInput,
|
|
30391
30408
|
RadioButton,
|
|
30409
|
+
SLIDE_UP_ANIMATION_DURATION,
|
|
30392
30410
|
ScrollIntoViewIfNeeded,
|
|
30393
30411
|
SearchInput,
|
|
30394
30412
|
Select,
|