@epam/uui 5.12.1 → 5.14.0-alpha.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/assets/styles/index.scss +0 -4
- package/components/buttons/IconButton.d.ts.map +1 -1
- package/components/datePickers/Calendar.d.ts.map +1 -1
- package/components/datePickers/RangeDatePicker.d.ts.map +1 -1
- package/components/datePickers/types.d.ts +1 -0
- package/components/datePickers/types.d.ts.map +1 -1
- package/components/filters/FilterNumericBody.d.ts.map +1 -1
- package/components/filters/FilterPanelItemToggler.d.ts +1 -1
- package/components/filters/FilterPickerBody.d.ts +1 -2
- package/components/filters/FilterPickerBody.d.ts.map +1 -1
- package/components/filters/FiltersPanel.d.ts +4 -1
- package/components/filters/FiltersPanel.d.ts.map +1 -1
- package/components/layout/FlexItems/FlexRow.d.ts.map +1 -1
- package/components/navigation/MainMenu/MainMenuAvatar.d.ts +2 -2
- package/components/navigation/MainMenu/MainMenuAvatar.d.ts.map +1 -1
- package/components/navigation/MainMenu/MainMenuButton.d.ts.map +1 -1
- package/components/navigation/MainMenu/MainMenuDropdown.d.ts.map +1 -1
- package/components/overlays/DropdownMenu.d.ts +1 -1
- package/components/overlays/DropdownMenu.d.ts.map +1 -1
- package/components/overlays/NotificationCard.d.ts.map +1 -1
- package/components/pickers/DataPickerBody.d.ts.map +1 -1
- package/components/pickers/PickerInput.d.ts +4 -2
- package/components/pickers/PickerInput.d.ts.map +1 -1
- package/components/typography/RichTextView.d.ts.map +1 -1
- package/index.esm.js +571 -555
- package/index.esm.js.map +1 -1
- package/index.js +571 -555
- package/index.js.map +1 -1
- package/package.json +6 -6
- package/settings.d.ts.map +1 -1
- package/settings.types.d.ts +7 -0
- package/settings.types.d.ts.map +1 -1
- package/stats.html +1 -1
- package/styles.css +2573 -2610
- package/styles.css.map +1 -1
- package/assets/styles/buttonLayout.scss +0 -70
- package/assets/styles/controlLayout.scss +0 -28
- package/assets/styles/icons.scss +0 -55
- package/assets/styles/text-size.scss +0 -42
package/index.esm.js
CHANGED
|
@@ -289,9 +289,12 @@ const settings = {
|
|
|
289
289
|
button: '36',
|
|
290
290
|
checkbox: '18',
|
|
291
291
|
countIndicator: '24',
|
|
292
|
+
flexRow: '36',
|
|
293
|
+
filtersPanel: '36',
|
|
292
294
|
linkButton: '36',
|
|
293
295
|
numericInput: '36',
|
|
294
296
|
radioInput: '18',
|
|
297
|
+
richTextView: '14',
|
|
295
298
|
switch: '18',
|
|
296
299
|
tabButton: '48',
|
|
297
300
|
tag: '36',
|
|
@@ -311,6 +314,9 @@ const settings = {
|
|
|
311
314
|
48: '30',
|
|
312
315
|
},
|
|
313
316
|
},
|
|
317
|
+
notificationCard: {
|
|
318
|
+
action: '30',
|
|
319
|
+
},
|
|
314
320
|
tag: {
|
|
315
321
|
countIndicator: {
|
|
316
322
|
18: '12',
|
|
@@ -589,7 +595,7 @@ const settings = {
|
|
|
589
595
|
},
|
|
590
596
|
};
|
|
591
597
|
|
|
592
|
-
var css$1y = {"uui-typography":"
|
|
598
|
+
var css$1y = {"uui-typography":"BxVSfM","uuiTypography":"BxVSfM","hero-header":"v2j3Fi","heroHeader":"v2j3Fi","promo-header":"ZYwa5j","promoHeader":"ZYwa5j","uui-critical":"bikZJm","uuiCritical":"bikZJm","uui-info":"_337-o8","uuiInfo":"_337-o8","uui-success":"w-Iljh","uuiSuccess":"w-Iljh","uui-warning":"S2i7Tl","uuiWarning":"S2i7Tl","uui-highlight":"vUeKnF","uuiHighlight":"vUeKnF","uui-typography-size-12":"Uuaujp","uuiTypographySize12":"Uuaujp","uui-typography-size-14":"LBX21x","uuiTypographySize14":"LBX21x","uui-typography-size-16":"LCUWJt","uuiTypographySize16":"LCUWJt","root":"oJurr-"};
|
|
593
599
|
|
|
594
600
|
function applyButtonMods(mods) {
|
|
595
601
|
return [
|
|
@@ -607,7 +613,7 @@ const Button = /* @__PURE__ */withMods(uuiComponents.Button, applyButtonMods, ()
|
|
|
607
613
|
};
|
|
608
614
|
});
|
|
609
615
|
|
|
610
|
-
var css$1x = {"root":"
|
|
616
|
+
var css$1x = {"root":"pACCop"};
|
|
611
617
|
|
|
612
618
|
function applyIconButtonMods(props) {
|
|
613
619
|
return ['uui-icon_button', `uui-color-${props.color || 'neutral'}`, css$1x.root];
|
|
@@ -644,7 +650,7 @@ function getIconClass(props) {
|
|
|
644
650
|
return [classList['has-left-icon'] ? 'uui-has-left-icon' : 'uui-no-left-icon', classList['has-right-icon'] ? 'uui-has-right-icon' : 'uui-no-right-icon'];
|
|
645
651
|
}
|
|
646
652
|
|
|
647
|
-
var css$1w = {"uui-typography":"
|
|
653
|
+
var css$1w = {"uui-typography":"_9JtiGA","uuiTypography":"_9JtiGA","hero-header":"_4sCMyU","heroHeader":"_4sCMyU","promo-header":"ud9sqv","promoHeader":"ud9sqv","uui-critical":"jCjGqG","uuiCritical":"jCjGqG","uui-info":"tlNKLb","uuiInfo":"tlNKLb","uui-success":"xBjHx-","uuiSuccess":"xBjHx-","uui-warning":"c-bBbX","uuiWarning":"c-bBbX","uui-highlight":"_-3n5XS","uuiHighlight":"_-3n5XS","uui-typography-size-12":"yESo6b","uuiTypographySize12":"yESo6b","uui-typography-size-14":"ct8kP7","uuiTypographySize14":"ct8kP7","uui-typography-size-16":"JQkd-k","uuiTypographySize16":"JQkd-k","root":"CaLDSv"};
|
|
648
654
|
|
|
649
655
|
const DEFAULT_COLOR = 'primary';
|
|
650
656
|
const DEFAULT_WEIGHT = 'semibold';
|
|
@@ -668,14 +674,14 @@ const LinkButton = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
668
674
|
];
|
|
669
675
|
const captionStyles = cx(uuiElement.caption, props.underline && `uui-underline-${props.underline}`, `uui-link-button-weight-${props.weight || DEFAULT_WEIGHT}`);
|
|
670
676
|
const DropdownIcon = props.dropdownIcon ? props.dropdownIcon : systemIcons.foldingArrow;
|
|
671
|
-
return (React.createElement(Clickable,
|
|
677
|
+
return (React.createElement(Clickable, { ...props, type: "button", cx: rootStyles, ref: ref },
|
|
672
678
|
props.icon && props.iconPosition !== 'right' && (React.createElement(IconContainer, { icon: props.icon, onClick: !props.isDisabled ? props.onIconClick : undefined })),
|
|
673
679
|
props.caption && (React.createElement("div", { className: captionStyles }, props.caption)),
|
|
674
680
|
props.icon && props.iconPosition === 'right' && (React.createElement(IconContainer, { icon: props.icon, onClick: !props.isDisabled ? props.onIconClick : undefined })),
|
|
675
681
|
props.isDropdown && (React.createElement(IconContainer, { icon: DropdownIcon, flipY: props.isOpen }))));
|
|
676
682
|
});
|
|
677
683
|
|
|
678
|
-
var css$1v = {"root":"
|
|
684
|
+
var css$1v = {"root":"E5oITR"};
|
|
679
685
|
|
|
680
686
|
const CountIndicator = /* @__PURE__ */forwardRef((props, ref) => {
|
|
681
687
|
return (React__default.createElement("div", { ref: ref, className: cx([
|
|
@@ -687,7 +693,7 @@ const CountIndicator = /* @__PURE__ */forwardRef((props, ref) => {
|
|
|
687
693
|
]) }, props.caption));
|
|
688
694
|
});
|
|
689
695
|
|
|
690
|
-
var css$1u = {"uui-typography":"
|
|
696
|
+
var css$1u = {"uui-typography":"gIceca","uuiTypography":"gIceca","hero-header":"asTGYp","heroHeader":"asTGYp","promo-header":"trsecL","promoHeader":"trsecL","uui-critical":"_8-T74h","uuiCritical":"_8-T74h","uui-info":"_5ZNXuT","uuiInfo":"_5ZNXuT","uui-success":"RSJQXw","uuiSuccess":"RSJQXw","uui-warning":"qdNLSe","uuiWarning":"qdNLSe","uui-highlight":"aEpXJr","uuiHighlight":"aEpXJr","uui-typography-size-12":"xYwGrt","uuiTypographySize12":"xYwGrt","uui-typography-size-14":"Bn9Ykw","uuiTypographySize14":"Bn9Ykw","uui-typography-size-16":"KCG0U7","uuiTypographySize16":"KCG0U7","root":"V6ye1G","withNotify":"uldSJh"};
|
|
691
697
|
|
|
692
698
|
const TabButton = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
693
699
|
const styles = [
|
|
@@ -699,7 +705,12 @@ const TabButton = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
|
699
705
|
];
|
|
700
706
|
const DropdownIcon = props.dropdownIcon ? props.dropdownIcon : systemIcons.foldingArrow;
|
|
701
707
|
const ClearIcon = props.clearIcon ? props.clearIcon : systemIcons.clear;
|
|
702
|
-
return (React__default.createElement(Clickable,
|
|
708
|
+
return (React__default.createElement(Clickable, { ...props, rawProps: {
|
|
709
|
+
role: 'tab',
|
|
710
|
+
'aria-haspopup': props.isDropdown,
|
|
711
|
+
'aria-expanded': props.isOpen,
|
|
712
|
+
...props.rawProps,
|
|
713
|
+
}, cx: styles, ref: ref },
|
|
703
714
|
props.icon && props.iconPosition !== 'right' && (React__default.createElement(IconContainer, { icon: props.icon, onClick: !props.isDisabled ? props.onIconClick : undefined })),
|
|
704
715
|
(props.caption || props.withNotify) && (React__default.createElement("div", { className: cx$1(uuiElement.caption) },
|
|
705
716
|
props.caption,
|
|
@@ -710,7 +721,7 @@ const TabButton = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
|
710
721
|
props.onClear && !props.isDisabled && (React__default.createElement(IconContainer, { cx: uuiMarkers.clickable, icon: ClearIcon, onClick: props.onClear }))));
|
|
711
722
|
});
|
|
712
723
|
|
|
713
|
-
var css$1t = {"uui-typography":"
|
|
724
|
+
var css$1t = {"uui-typography":"_2Bb0KD","uuiTypography":"_2Bb0KD","hero-header":"SZ8utT","heroHeader":"SZ8utT","promo-header":"aU5LPU","promoHeader":"aU5LPU","uui-critical":"_58nZr7","uuiCritical":"_58nZr7","uui-info":"npTySD","uuiInfo":"npTySD","uui-success":"PPqIFl","uuiSuccess":"PPqIFl","uui-warning":"UqYNlP","uuiWarning":"UqYNlP","uui-highlight":"_4kb4e-","uuiHighlight":"_4kb4e-","uui-typography-size-12":"EGRcHY","uuiTypographySize12":"EGRcHY","uui-typography-size-14":"Z9LG4E","uuiTypographySize14":"Z9LG4E","uui-typography-size-16":"SxsGWp","uuiTypographySize16":"SxsGWp","root":"ylnw9n"};
|
|
714
725
|
|
|
715
726
|
function applyVerticalTabButtonMods() {
|
|
716
727
|
return [css$1t.root, 'uui-vertical-tab-button'];
|
|
@@ -732,7 +743,7 @@ var SvgContentMinusOutline = function SvgContentMinusOutline(props, ref) {
|
|
|
732
743
|
};
|
|
733
744
|
var ForwardRef$C = /*#__PURE__*/forwardRef(SvgContentMinusOutline);
|
|
734
745
|
|
|
735
|
-
var css$1s = {"uui-typography":"
|
|
746
|
+
var css$1s = {"uui-typography":"_30GgUR","uuiTypography":"_30GgUR","hero-header":"ucbYAv","heroHeader":"ucbYAv","promo-header":"q-A2LH","promoHeader":"q-A2LH","uui-critical":"CNxN1F","uuiCritical":"CNxN1F","uui-info":"vSS8Im","uuiInfo":"vSS8Im","uui-success":"_0vTg54","uuiSuccess":"_0vTg54","uui-warning":"dLvklV","uuiWarning":"dLvklV","uui-highlight":"M0j3Ak","uuiHighlight":"M0j3Ak","uui-typography-size-12":"jl3d-r","uuiTypographySize12":"jl3d-r","uui-typography-size-14":"YiB0Fl","uuiTypographySize14":"YiB0Fl","uui-typography-size-16":"w8ZG-h","uuiTypographySize16":"w8ZG-h","root":"kpCvpo","mode-cell":"_8rLBew","modeCell":"_8rLBew"};
|
|
736
747
|
|
|
737
748
|
function applyCheckboxMods(mods) {
|
|
738
749
|
return [
|
|
@@ -767,7 +778,7 @@ var SvgRadioDotFill = function SvgRadioDotFill(props, ref) {
|
|
|
767
778
|
};
|
|
768
779
|
var ForwardRef$B = /*#__PURE__*/forwardRef(SvgRadioDotFill);
|
|
769
780
|
|
|
770
|
-
var css$1r = {"uui-typography":"
|
|
781
|
+
var css$1r = {"uui-typography":"qvk7q0","uuiTypography":"qvk7q0","hero-header":"JPaP-O","heroHeader":"JPaP-O","promo-header":"znvySk","promoHeader":"znvySk","uui-critical":"OXYllz","uuiCritical":"OXYllz","uui-info":"_6QiNvJ","uuiInfo":"_6QiNvJ","uui-success":"cI7so5","uuiSuccess":"cI7so5","uui-warning":"NyyBWq","uuiWarning":"NyyBWq","uui-highlight":"Nd5fJR","uuiHighlight":"Nd5fJR","uui-typography-size-12":"LgXqsQ","uuiTypographySize12":"LgXqsQ","uui-typography-size-14":"rCPTYN","uuiTypographySize14":"rCPTYN","uui-typography-size-16":"_45cfAG","uuiTypographySize16":"_45cfAG","root":"YHrYwa"};
|
|
771
782
|
|
|
772
783
|
function applyRadioInputMods(mods) {
|
|
773
784
|
return [
|
|
@@ -779,7 +790,7 @@ function applyRadioInputMods(mods) {
|
|
|
779
790
|
}
|
|
780
791
|
const RadioInput = /* @__PURE__ */withMods(RadioInput$1, applyRadioInputMods, (props) => ({ icon: props.icon ? props.icon : ForwardRef$B }));
|
|
781
792
|
|
|
782
|
-
var css$1q = {"root":"
|
|
793
|
+
var css$1q = {"root":"bMXx1M"};
|
|
783
794
|
|
|
784
795
|
function applySwitchMods(mods) {
|
|
785
796
|
return [
|
|
@@ -790,50 +801,6 @@ function applySwitchMods(mods) {
|
|
|
790
801
|
}
|
|
791
802
|
const Switch = /* @__PURE__ */withMods(uuiComponents.Switch, applySwitchMods);
|
|
792
803
|
|
|
793
|
-
/******************************************************************************
|
|
794
|
-
Copyright (c) Microsoft Corporation.
|
|
795
|
-
|
|
796
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
797
|
-
purpose with or without fee is hereby granted.
|
|
798
|
-
|
|
799
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
800
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
801
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
802
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
803
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
804
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
805
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
806
|
-
***************************************************************************** */
|
|
807
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
function __rest(s, e) {
|
|
811
|
-
var t = {};
|
|
812
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
813
|
-
t[p] = s[p];
|
|
814
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
815
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
816
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
817
|
-
t[p[i]] = s[p[i]];
|
|
818
|
-
}
|
|
819
|
-
return t;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
823
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
824
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
825
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
826
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
827
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
828
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
829
|
-
});
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
833
|
-
var e = new Error(message);
|
|
834
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
835
|
-
};
|
|
836
|
-
|
|
837
804
|
/**
|
|
838
805
|
* Defines the different edit modes.
|
|
839
806
|
*/
|
|
@@ -847,7 +814,7 @@ var EditMode;
|
|
|
847
814
|
EditMode["INLINE"] = "inline";
|
|
848
815
|
})(EditMode || (EditMode = {}));
|
|
849
816
|
|
|
850
|
-
var textInputCss = {"uui-typography":"
|
|
817
|
+
var textInputCss = {"uui-typography":"f-TQHl","uuiTypography":"f-TQHl","hero-header":"EgaOGP","heroHeader":"EgaOGP","promo-header":"yHxVeD","promoHeader":"yHxVeD","uui-critical":"h-hUtL","uuiCritical":"h-hUtL","uui-info":"Gxds1P","uuiInfo":"Gxds1P","uui-success":"zkPTKp","uuiSuccess":"zkPTKp","uui-warning":"_4gHeaJ","uuiWarning":"_4gHeaJ","uui-highlight":"a2qRo4","uuiHighlight":"a2qRo4","uui-typography-size-12":"MrfIZO","uuiTypographySize12":"MrfIZO","uui-typography-size-14":"cV3wFz","uuiTypographySize14":"cV3wFz","uui-typography-size-16":"zF-hZF","uuiTypographySize16":"zF-hZF","root":"unsKZ7","mode-form":"Lr-Rvl","modeForm":"Lr-Rvl","mode-inline":"UvGGX5","modeInline":"UvGGX5","mode-cell":"w6GVvK","modeCell":"w6GVvK"};
|
|
851
818
|
|
|
852
819
|
const DEFAULT_MODE$3 = EditMode.FORM;
|
|
853
820
|
function applyTextInputMods(mods) {
|
|
@@ -864,25 +831,31 @@ const TextInput = /* @__PURE__ */withMods(TextInput$1, applyTextInputMods, () =>
|
|
|
864
831
|
}));
|
|
865
832
|
const SearchInput = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
866
833
|
// analytics events are sending in IEditableDebouncer, so we need to avoid sending events in TextInput
|
|
867
|
-
const textInputProps =
|
|
834
|
+
const { ...textInputProps } = props;
|
|
868
835
|
delete textInputProps.getValueChangeAnalyticsEvent;
|
|
869
|
-
return (React__default.createElement(IEditableDebouncer,
|
|
870
|
-
var _a;
|
|
836
|
+
return (React__default.createElement(IEditableDebouncer, { ...props, render: (iEditable) => {
|
|
871
837
|
const defaultOnCancel = () => iEditable.onValueChange('');
|
|
872
|
-
return (React__default.createElement(TextInput,
|
|
873
|
-
} }))
|
|
838
|
+
return (React__default.createElement(TextInput, { icon: systemIcons.search, onCancel: props.onCancel ?? defaultOnCancel, type: "search", inputMode: "search", ref: ref, ...textInputProps, ...iEditable }));
|
|
839
|
+
} }));
|
|
874
840
|
});
|
|
875
841
|
|
|
876
|
-
var css$1p = {"root":"
|
|
842
|
+
var css$1p = {"root":"z-HBZ-"};
|
|
877
843
|
|
|
878
844
|
const ControlGroup = /* @__PURE__ */withMods(ControlGroup$1, () => [css$1p.root, 'uui-control-group']);
|
|
879
845
|
|
|
880
846
|
function MultiSwitchComponent(props, ref) {
|
|
881
|
-
return (React.createElement(ControlGroup, { ref: ref, rawProps:
|
|
847
|
+
return (React.createElement(ControlGroup, { ref: ref, rawProps: {
|
|
848
|
+
...props.rawProps,
|
|
849
|
+
role: 'tablist',
|
|
850
|
+
'aria-invalid': props.isInvalid,
|
|
851
|
+
'aria-required': props.isRequired,
|
|
852
|
+
'aria-disabled': props.isDisabled,
|
|
853
|
+
'aria-readonly': props.isReadonly,
|
|
854
|
+
} }, props.items.map((item, index) => (React.createElement(Button, { ...props, ...item, isDisabled: props.isDisabled, key: index + '-' + item.id, onClick: () => props.onValueChange(item.id), fill: props.value === item.id ? 'solid' : 'outline', color: props.color, size: props.size, rawProps: { 'aria-current': props.value === item.id, role: 'tab' } })))));
|
|
882
855
|
}
|
|
883
856
|
const MultiSwitch = /* @__PURE__ */React.forwardRef(MultiSwitchComponent);
|
|
884
857
|
|
|
885
|
-
var css$1o = {"uui-typography":"
|
|
858
|
+
var css$1o = {"uui-typography":"xgifaP","uuiTypography":"xgifaP","hero-header":"Nq1-MR","heroHeader":"Nq1-MR","promo-header":"_9VRwFg","promoHeader":"_9VRwFg","uui-critical":"AgR3Av","uuiCritical":"AgR3Av","uui-info":"Bts1pp","uuiInfo":"Bts1pp","uui-success":"d-dULs","uuiSuccess":"d-dULs","uui-warning":"x1JfbH","uuiWarning":"x1JfbH","uui-highlight":"C8-QQ1","uuiHighlight":"C8-QQ1","uui-typography-size-12":"ilf8Bb","uuiTypographySize12":"ilf8Bb","uui-typography-size-14":"Ge67Sl","uuiTypographySize14":"Ge67Sl","uui-typography-size-16":"BK9iWe","uuiTypographySize16":"BK9iWe","root":"VblDiw","mode-form":"_2alu6s","modeForm":"_2alu6s","mode-cell":"UmhnnI","modeCell":"UmhnnI"};
|
|
886
859
|
|
|
887
860
|
const DEFAULT_MODE$2 = EditMode.FORM;
|
|
888
861
|
function applyNumericInputMods(mods) {
|
|
@@ -894,16 +867,15 @@ function applyNumericInputMods(mods) {
|
|
|
894
867
|
];
|
|
895
868
|
}
|
|
896
869
|
const NumericInput = /* @__PURE__ */withMods(NumericInput$1, applyNumericInputMods, (props) => {
|
|
897
|
-
var _a, _b;
|
|
898
870
|
return {
|
|
899
871
|
upIcon: systemIcons.foldingArrow,
|
|
900
872
|
downIcon: systemIcons.foldingArrow,
|
|
901
|
-
align:
|
|
902
|
-
disableArrows:
|
|
873
|
+
align: props.align ?? (props.mode === 'cell' ? 'right' : 'left'),
|
|
874
|
+
disableArrows: props.disableArrows ?? props.mode === 'cell',
|
|
903
875
|
};
|
|
904
876
|
});
|
|
905
877
|
|
|
906
|
-
var css$1n = {"uui-typography":"
|
|
878
|
+
var css$1n = {"uui-typography":"ClsqnT","uuiTypography":"ClsqnT","hero-header":"TpUjt2","heroHeader":"TpUjt2","promo-header":"_52ocSD","promoHeader":"_52ocSD","uui-critical":"n6ZtH3","uuiCritical":"n6ZtH3","uui-info":"PbcuPS","uuiInfo":"PbcuPS","uui-success":"T7ZhYL","uuiSuccess":"T7ZhYL","uui-warning":"Otka0q","uuiWarning":"Otka0q","uui-highlight":"U3LRBm","uuiHighlight":"U3LRBm","uui-typography-size-12":"_7tEilr","uuiTypographySize12":"_7tEilr","uui-typography-size-14":"gDA-et","uuiTypographySize14":"gDA-et","uui-typography-size-16":"UygcqK","uuiTypographySize16":"UygcqK","root":"ZAeJwg","mode-form":"IyS74M","modeForm":"IyS74M","mode-cell":"UuHcnY","modeCell":"UuHcnY","mode-inline":"QT3Bmi","modeInline":"QT3Bmi"};
|
|
907
879
|
|
|
908
880
|
const DEFAULT_MODE$1 = EditMode.FORM;
|
|
909
881
|
function applyTextAreaMods(mods) {
|
|
@@ -1004,9 +976,9 @@ var SvgNotificationInfoFill = function SvgNotificationInfoFill(props, ref) {
|
|
|
1004
976
|
};
|
|
1005
977
|
var ForwardRef$x = /*#__PURE__*/forwardRef(SvgNotificationInfoFill);
|
|
1006
978
|
|
|
1007
|
-
var css$1m = {"uui-typography":"
|
|
979
|
+
var css$1m = {"uui-typography":"-y2sNC","uuiTypography":"-y2sNC","hero-header":"UCYswi","heroHeader":"UCYswi","promo-header":"K14fst","promoHeader":"K14fst","uui-critical":"xHZfNj","uuiCritical":"xHZfNj","uui-info":"_89R8C3","uuiInfo":"_89R8C3","uui-success":"_8eiMmp","uuiSuccess":"_8eiMmp","uui-warning":"CC7jP6","uuiWarning":"CC7jP6","uui-highlight":"tC3oQc","uuiHighlight":"tC3oQc","uui-typography-size-12":"o-fF8y","uuiTypographySize12":"o-fF8y","uui-typography-size-14":"hr--CY","uuiTypographySize14":"hr--CY","uui-typography-size-16":"z7bSyf","uuiTypographySize16":"z7bSyf","root":"_5uAGDW","main-path":"V23QHk","mainPath":"V23QHk","content-wrapper":"KI6tN4","contentWrapper":"KI6tN4","content":"Crz1MD","action-wrapper":"PBVbEV","actionWrapper":"PBVbEV","icon-wrapper":"IwMP4M","iconWrapper":"IwMP4M","icon":"nnb-vH","close-icon":"ZrkwuB","closeIcon":"ZrkwuB"};
|
|
1008
980
|
|
|
1009
|
-
const Alert = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement("div",
|
|
981
|
+
const Alert = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement("div", { role: "alert", ref: ref, className: cx('uui-alert', css$1m.root, props.color && `uui-color-${props.color}`, props.cx, `uui-size-${props.size || settings.sizes.defaults.alert}`), ...props.rawProps },
|
|
1010
982
|
React.createElement("div", { className: css$1m.mainPath },
|
|
1011
983
|
React.createElement("div", { className: css$1m.contentWrapper },
|
|
1012
984
|
props.icon && (React.createElement("div", { className: css$1m.iconWrapper },
|
|
@@ -1015,14 +987,14 @@ const Alert = /* @__PURE__ */React.forwardRef((props, ref) => (React.createEleme
|
|
|
1015
987
|
props.children,
|
|
1016
988
|
props.actions && (React.createElement("div", { className: css$1m.actionWrapper }, props.actions.map((action) => (React.createElement(LinkButton, { caption: action.name, onClick: action.action, key: action.name, cx: css$1m.actionLink, size: settings.sizes.alert.action[props.size || settings.sizes.defaults.alert] }))))))),
|
|
1017
989
|
props.onClose && React.createElement(IconButton, { icon: ForwardRef$R, color: "neutral", onClick: props.onClose, cx: css$1m.closeIcon })))));
|
|
1018
|
-
const WarningAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert,
|
|
1019
|
-
const SuccessAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert,
|
|
1020
|
-
const HintAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert,
|
|
1021
|
-
const ErrorAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert,
|
|
990
|
+
const WarningAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert, { icon: ForwardRef$z, color: "warning", ref: ref, ...props }));
|
|
991
|
+
const SuccessAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert, { icon: ForwardRef$A, color: "success", ref: ref, ...props }));
|
|
992
|
+
const HintAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert, { icon: ForwardRef$x, color: "info", ref: ref, ...props }));
|
|
993
|
+
const ErrorAlert = /* @__PURE__ */React.forwardRef((props, ref) => React.createElement(Alert, { icon: ForwardRef$y, color: "error", ref: ref, ...props }));
|
|
1022
994
|
|
|
1023
995
|
const Dropdown = /* @__PURE__ */withMods(Dropdown$1);
|
|
1024
996
|
|
|
1025
|
-
var css$1l = {"root":"
|
|
997
|
+
var css$1l = {"root":"xxkRoE"};
|
|
1026
998
|
|
|
1027
999
|
function applyDropdownContainerMods(mods) {
|
|
1028
1000
|
return [
|
|
@@ -1033,7 +1005,7 @@ function applyDropdownContainerMods(mods) {
|
|
|
1033
1005
|
}
|
|
1034
1006
|
const DropdownContainer = /* @__PURE__ */withMods(uuiComponents.DropdownContainer, applyDropdownContainerMods);
|
|
1035
1007
|
|
|
1036
|
-
var css$1k = {"uui-typography":"
|
|
1008
|
+
var css$1k = {"uui-typography":"ldKZo1","uuiTypography":"ldKZo1","hero-header":"l87kBe","heroHeader":"l87kBe","promo-header":"bwPTht","promoHeader":"bwPTht","uui-critical":"ciTvCD","uuiCritical":"ciTvCD","uui-info":"_9sEoyd","uuiInfo":"_9sEoyd","uui-success":"x5qmnw","uuiSuccess":"x5qmnw","uui-warning":"CABWNO","uuiWarning":"CABWNO","uui-highlight":"-igZrt","uuiHighlight":"-igZrt","uui-typography-size-12":"BqgHSj","uuiTypographySize12":"BqgHSj","uui-typography-size-14":"e1Xad7","uuiTypographySize14":"e1Xad7","uui-typography-size-16":"-QjEdT","uuiTypographySize16":"-QjEdT","submenu-root-item-rtl":"nkWATN","submenuRootItemRtl":"nkWATN","icon-after":"ywrKSn","iconAfter":"ywrKSn","submenu-root-item":"umZ867","submenuRootItem":"umZ867","icon-check":"Hh5Q-Z","iconCheck":"Hh5Q-Z","splitter-root":"yBz9Wp","splitterRoot":"yBz9Wp","splitter":"nzAQE1","header-root":"_1XBTP0","headerRoot":"_1XBTP0","item-root":"hZOnwX","itemRoot":"hZOnwX","icon":"h2aza6","link":"N2KBz8","indent":"_1hFf-t","selected-mark":"sWDucY","selectedMark":"sWDucY"};
|
|
1037
1009
|
|
|
1038
1010
|
var IDropdownControlKeys;
|
|
1039
1011
|
(function (IDropdownControlKeys) {
|
|
@@ -1069,10 +1041,10 @@ function DropdownMenuContainer(props) {
|
|
|
1069
1041
|
props.onClose();
|
|
1070
1042
|
}
|
|
1071
1043
|
};
|
|
1072
|
-
return (React__default.createElement(DropdownContainer,
|
|
1044
|
+
return (React__default.createElement(DropdownContainer, { ...props, rawProps: { ...props.rawProps, role: 'menu' }, ref: menuRef, width: props.minWidth, lockProps: { onKeyDown: handleArrowKeys }, cx: [props.cx] }));
|
|
1073
1045
|
}
|
|
1074
1046
|
const DropdownMenuBody = /* @__PURE__ */withMods(DropdownMenuContainer, () => ['uui-dropdownMenu-body'], (props) => {
|
|
1075
|
-
return (
|
|
1047
|
+
return ({ closeOnKey: IDropdownControlKeys.ESCAPE, ...props });
|
|
1076
1048
|
});
|
|
1077
1049
|
const DropdownMenuButton = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
1078
1050
|
const context = useContext(UuiContext);
|
|
@@ -1139,11 +1111,8 @@ function DropdownSubMenu(props) {
|
|
|
1139
1111
|
},
|
|
1140
1112
|
},
|
|
1141
1113
|
];
|
|
1142
|
-
const isRtl =
|
|
1143
|
-
return (React__default.createElement(Dropdown$1, { openOnHover: props.openOnHover || true, closeOnMouseLeave: "boundary", openDelay: 400, closeDelay: 400, placement: isRtl ? 'left-start' : 'right-start', modifiers: subMenuModifiers, renderBody: (dropdownProps) => !props.isDisabled && (React__default.createElement(DropdownMenuBody,
|
|
1144
|
-
var { toggleDropdownOpening } = _a, targetProps = __rest(_a, ["toggleDropdownOpening"]);
|
|
1145
|
-
return (React__default.createElement(DropdownMenuButton, Object.assign({ cx: cx$1(isRtl ? css$1k.submenuRootItemRtl : css$1k.submenuRootItem), icon: systemIcons.foldingArrow, iconPosition: "right", isDropdown: true, toggleDropdownOpening: toggleDropdownOpening }, props, targetProps)));
|
|
1146
|
-
} }));
|
|
1114
|
+
const isRtl = window?.document.dir === 'rtl';
|
|
1115
|
+
return (React__default.createElement(Dropdown$1, { openOnHover: props.openOnHover || true, closeOnMouseLeave: "boundary", openDelay: 400, closeDelay: 400, placement: isRtl ? 'left-start' : 'right-start', modifiers: subMenuModifiers, renderBody: (dropdownProps) => !props.isDisabled && (React__default.createElement(DropdownMenuBody, { closeOnKey: IDropdownControlKeys.LEFT_ARROW, ...props, ...dropdownProps })), renderTarget: ({ toggleDropdownOpening, ...targetProps }) => (React__default.createElement(DropdownMenuButton, { cx: cx$1(isRtl ? css$1k.submenuRootItemRtl : css$1k.submenuRootItem), icon: systemIcons.foldingArrow, iconPosition: "right", isDropdown: true, toggleDropdownOpening: toggleDropdownOpening, ...props, ...targetProps })) }));
|
|
1147
1116
|
}
|
|
1148
1117
|
function DropdownMenuSwitchButton(props) {
|
|
1149
1118
|
const context = useContext(UuiContext);
|
|
@@ -1166,7 +1135,7 @@ function DropdownMenuSwitchButton(props) {
|
|
|
1166
1135
|
React__default.createElement(Switch, { value: isSelected, tabIndex: -1, onValueChange: onHandleValueChange })));
|
|
1167
1136
|
}
|
|
1168
1137
|
|
|
1169
|
-
var css$1j = {"uui-typography":"
|
|
1138
|
+
var css$1j = {"uui-typography":"xLeQ6A","uuiTypography":"xLeQ6A","hero-header":"B7T9iu","heroHeader":"B7T9iu","promo-header":"DozF8b","promoHeader":"DozF8b","uui-critical":"_7XsXRp","uuiCritical":"_7XsXRp","uui-info":"VNPUMO","uuiInfo":"VNPUMO","uui-success":"-yyP5J","uuiSuccess":"-yyP5J","uui-warning":"b9XMVZ","uuiWarning":"b9XMVZ","uui-highlight":"ut0-PM","uuiHighlight":"ut0-PM","uui-typography-size-12":"n9oHNn","uuiTypographySize12":"n9oHNn","uui-typography-size-14":"FSITU5","uuiTypographySize14":"FSITU5","uui-typography-size-16":"SCPYan","uuiTypographySize16":"SCPYan","root":"fEipts","mode-block":"RAx6KN","modeBlock":"RAx6KN","mode-inline":"BhcUut","modeInline":"BhcUut","padding-0":"CesDLL","padding0":"CesDLL","padding-6":"prWMXS","padding6":"prWMXS","padding-12":"_1adp4A","padding12":"_1adp4A","padding-18":"TLAPMG","padding18":"TLAPMG"};
|
|
1170
1139
|
|
|
1171
1140
|
function applyAccordionMods(mods) {
|
|
1172
1141
|
return [
|
|
@@ -1179,7 +1148,7 @@ const Accordion = /* @__PURE__ */withMods(uuiComponents.Accordion, applyAccordio
|
|
|
1179
1148
|
dropdownIcon: mods.dropdownIcon !== null && systemIcons.foldingArrow,
|
|
1180
1149
|
}));
|
|
1181
1150
|
|
|
1182
|
-
var css$1i = {"uui-typography":"
|
|
1151
|
+
var css$1i = {"uui-typography":"hYnPjH","uuiTypography":"hYnPjH","hero-header":"Dj6w3u","heroHeader":"Dj6w3u","promo-header":"OBklvO","promoHeader":"OBklvO","uui-critical":"bkN-vV","uuiCritical":"bkN-vV","uui-info":"bmTF0K","uuiInfo":"bmTF0K","uui-success":"X7XhzC","uuiSuccess":"X7XhzC","uui-warning":"_6ZsOqd","uuiWarning":"_6ZsOqd","uui-highlight":"a70o5O","uuiHighlight":"a70o5O","uui-typography-size-12":"LXZzQT","uuiTypographySize12":"LXZzQT","uui-typography-size-14":"nOyQGP","uuiTypographySize14":"nOyQGP","uui-typography-size-16":"-tA--w","uuiTypographySize16":"-tA--w","root":"c-O-SF","border-top":"qDo7pK","borderTop":"qDo7pK","border-bottom":"MRf3AQ","borderBottom":"MRf3AQ","top-shadow":"KShzPY","topShadow":"KShzPY","padding-6":"_3AKRP7","padding6":"_3AKRP7","padding-12":"_1Y0skw","padding12":"_1Y0skw","padding-18":"ZxGeQE","padding18":"ZxGeQE","padding-24":"FdT-7U","padding24":"FdT-7U","margin-24":"T43dwX","margin24":"T43dwX","margin-12":"OHdpd-","margin12":"OHdpd-","vPadding-12":"OErEoG","vPadding12":"OErEoG","vPadding-18":"wQSAg-","vPadding18":"wQSAg-","vPadding-24":"dJJiKd","vPadding24":"dJJiKd","vPadding-36":"i53Wcl","vPadding36":"i53Wcl","vPadding-48":"X5-NDi","vPadding48":"X5-NDi","spacing-6":"UL3q5r","spacing6":"UL3q5r","spacing-12":"_0n-boz","spacing12":"_0n-boz","spacing-18":"QT2snz","spacing18":"QT2snz","uui-surface-main":"L7iaGV","uuiSurfaceMain":"L7iaGV"};
|
|
1183
1152
|
|
|
1184
1153
|
const FlexCell = /* @__PURE__ */withMods(FlexCell$1, () => [css$1i.flexCell]);
|
|
1185
1154
|
|
|
@@ -1191,7 +1160,7 @@ const FlexRow = /* @__PURE__ */withMods(FlexRow$1, (props) => {
|
|
|
1191
1160
|
}
|
|
1192
1161
|
return [
|
|
1193
1162
|
css$1i.root,
|
|
1194
|
-
props.size !== null && 'uui-size-' + (props.size ||
|
|
1163
|
+
props.size !== null && 'uui-size-' + (props.size || settings.sizes.defaults.flexRow),
|
|
1195
1164
|
props.padding && css$1i['padding-' + props.padding],
|
|
1196
1165
|
props.vPadding && css$1i['vPadding-' + props.vPadding],
|
|
1197
1166
|
props.margin && css$1i['margin-' + props.margin],
|
|
@@ -1203,7 +1172,7 @@ const FlexRow = /* @__PURE__ */withMods(FlexRow$1, (props) => {
|
|
|
1203
1172
|
];
|
|
1204
1173
|
});
|
|
1205
1174
|
|
|
1206
|
-
var css$1h = {"root":"
|
|
1175
|
+
var css$1h = {"root":"R8jLhn","margin-24":"HYRTkQ","margin24":"HYRTkQ","padding-12":"cYbU1i","padding12":"cYbU1i","padding-24":"Y5MAvD","padding24":"Y5MAvD","shadow":"BpzT37","uui-surface-main":"tFCvnH","uuiSurfaceMain":"tFCvnH"};
|
|
1207
1176
|
|
|
1208
1177
|
const Panel = /* @__PURE__ */withMods(VPanel, (props) => [
|
|
1209
1178
|
'uui-panel',
|
|
@@ -1213,7 +1182,7 @@ const Panel = /* @__PURE__ */withMods(VPanel, (props) => [
|
|
|
1213
1182
|
props.background && css$1h[`uui-${props.background}`],
|
|
1214
1183
|
]);
|
|
1215
1184
|
|
|
1216
|
-
var css$1g = {"root":"
|
|
1185
|
+
var css$1g = {"root":"qMGWOH"};
|
|
1217
1186
|
|
|
1218
1187
|
function applyTooltipMods(mods) {
|
|
1219
1188
|
return [
|
|
@@ -1223,7 +1192,7 @@ function applyTooltipMods(mods) {
|
|
|
1223
1192
|
}
|
|
1224
1193
|
const Tooltip = /* @__PURE__ */withMods(uuiComponents.Tooltip, applyTooltipMods);
|
|
1225
1194
|
|
|
1226
|
-
var css$1f = {"uui-typography":"
|
|
1195
|
+
var css$1f = {"uui-typography":"vJNIsV","uuiTypography":"vJNIsV","hero-header":"N5Xnyd","heroHeader":"N5Xnyd","promo-header":"JquOji","promoHeader":"JquOji","uui-critical":"Pq7LcG","uuiCritical":"Pq7LcG","uui-info":"oD9hBv","uuiInfo":"oD9hBv","uui-success":"YxmhRj","uuiSuccess":"YxmhRj","uui-warning":"tLa-pa","uuiWarning":"tLa-pa","uui-highlight":"knpLhD","uuiHighlight":"knpLhD","uui-typography-size-12":"_7PgaXt","uuiTypographySize12":"_7PgaXt","uui-typography-size-14":"L3nem9","uuiTypographySize14":"L3nem9","uui-typography-size-16":"SDn02K","uuiTypographySize16":"SDn02K","root":"_12npG6"};
|
|
1227
1196
|
|
|
1228
1197
|
function applyLabeledInputMods(mods) {
|
|
1229
1198
|
return [
|
|
@@ -1237,7 +1206,7 @@ const LabeledInput = /* @__PURE__ */withMods(uuiComponents.LabeledInput, applyLa
|
|
|
1237
1206
|
infoIcon: props.infoIcon || (settings.sizes.labeledInput.fillIcon.includes(props.size) ? ForwardRef$x : ForwardRef$M),
|
|
1238
1207
|
}));
|
|
1239
1208
|
|
|
1240
|
-
var css$1e = {"root":"
|
|
1209
|
+
var css$1e = {"root":"EDNS1f"};
|
|
1241
1210
|
|
|
1242
1211
|
function RadioGroup(props) {
|
|
1243
1212
|
const direction = props.direction || 'vertical';
|
|
@@ -1246,13 +1215,13 @@ function RadioGroup(props) {
|
|
|
1246
1215
|
props.onValueChange(newVal);
|
|
1247
1216
|
}
|
|
1248
1217
|
};
|
|
1249
|
-
return (React.createElement("fieldset",
|
|
1250
|
-
const
|
|
1251
|
-
return (React.createElement(RadioInput,
|
|
1218
|
+
return (React.createElement("fieldset", { ref: props.forwardedRef, className: cx$1(css$1e.root, directionMode[direction], props.cx), onFocus: props.onFocus, onBlur: props.onBlur, ...props.rawProps }, props.items.map((i) => {
|
|
1219
|
+
const { id, name, renderName, ...restItemProps } = i;
|
|
1220
|
+
return (React.createElement(RadioInput, { name: props.name, renderLabel: i.renderName ? i.renderName : () => i.name, value: props.value === i.id, onValueChange: () => handleChange(i.id), isDisabled: props.isDisabled || i.isDisabled, isReadonly: props.isReadonly, isInvalid: props.isInvalid, isRequired: props.isRequired, key: i.id.toString(), size: props.size || i.size, ...restItemProps }));
|
|
1252
1221
|
})));
|
|
1253
1222
|
}
|
|
1254
1223
|
|
|
1255
|
-
var css$1d = {"root":"
|
|
1224
|
+
var css$1d = {"root":"vTRG1l"};
|
|
1256
1225
|
|
|
1257
1226
|
function applyScrollBarsMods() {
|
|
1258
1227
|
return [
|
|
@@ -1261,13 +1230,13 @@ function applyScrollBarsMods() {
|
|
|
1261
1230
|
}
|
|
1262
1231
|
const ScrollBars = /* @__PURE__ */withMods(ScrollBars$1, applyScrollBarsMods);
|
|
1263
1232
|
|
|
1264
|
-
var css$1c = {"scroll-container":"
|
|
1233
|
+
var css$1c = {"scroll-container":"OTdxwc","scrollContainer":"OTdxwc","list-container":"mlqys2","listContainer":"mlqys2"};
|
|
1265
1234
|
|
|
1266
|
-
var css$1b = {"root":"
|
|
1235
|
+
var css$1b = {"root":"eTyaVK"};
|
|
1267
1236
|
|
|
1268
1237
|
const AvatarStack = /* @__PURE__ */withMods(AvatarStack$1, () => [css$1b.root]);
|
|
1269
1238
|
|
|
1270
|
-
var css$1a = {"uui-typography":"
|
|
1239
|
+
var css$1a = {"uui-typography":"zqlhYe","uuiTypography":"zqlhYe","hero-header":"_3GvzwV","heroHeader":"_3GvzwV","promo-header":"itb2zy","promoHeader":"itb2zy","uui-critical":"IBFSR4","uuiCritical":"IBFSR4","uui-info":"TzXAo2","uuiInfo":"TzXAo2","uui-success":"_5taKYW","uuiSuccess":"_5taKYW","uui-warning":"_37qX-v","uuiWarning":"_37qX-v","uui-highlight":"_871AeR","uuiHighlight":"_871AeR","uui-typography-size-12":"AxrAwO","uuiTypographySize12":"AxrAwO","uui-typography-size-14":"Gy-56-","uuiTypographySize14":"Gy-56-","uui-typography-size-16":"mgPB-8","uuiTypographySize16":"mgPB-8","root":"n0P6HQ"};
|
|
1271
1240
|
|
|
1272
1241
|
const DEFAULT_FILL = 'solid';
|
|
1273
1242
|
function applyBadgeMods(mods) {
|
|
@@ -1282,7 +1251,11 @@ function applyBadgeMods(mods) {
|
|
|
1282
1251
|
const Badge = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
1283
1252
|
const styles = [applyBadgeMods(props), props.cx];
|
|
1284
1253
|
const DropdownIcon = props.dropdownIcon ? props.dropdownIcon : systemIcons.foldingArrow;
|
|
1285
|
-
return (React__default.createElement(Clickable,
|
|
1254
|
+
return (React__default.createElement(Clickable, { ...props, rawProps: {
|
|
1255
|
+
'aria-haspopup': props.isDropdown,
|
|
1256
|
+
'aria-expanded': props.isOpen,
|
|
1257
|
+
...props.rawProps,
|
|
1258
|
+
}, cx: styles, ref: ref },
|
|
1286
1259
|
(props.indicator && props.fill === 'outline') && (React__default.createElement("div", { className: "uui-indicator" })),
|
|
1287
1260
|
props.icon && props.iconPosition !== 'right' && (React__default.createElement(IconContainer, { icon: props.icon, onClick: !props.isDisabled ? props.onIconClick : undefined })),
|
|
1288
1261
|
props.caption && (React__default.createElement("div", { className: uuiElement.caption }, props.caption)),
|
|
@@ -1291,7 +1264,7 @@ const Badge = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
|
1291
1264
|
props.isDropdown && (React__default.createElement(IconContainer, { icon: DropdownIcon, flipY: props.isOpen }))));
|
|
1292
1265
|
});
|
|
1293
1266
|
|
|
1294
|
-
var css$19 = {"uui-typography":"
|
|
1267
|
+
var css$19 = {"uui-typography":"_5S-apH","uuiTypography":"_5S-apH","hero-header":"wDJAWq","heroHeader":"wDJAWq","promo-header":"_7f1YDr","promoHeader":"_7f1YDr","uui-critical":"_1tHijE","uuiCritical":"_1tHijE","uui-info":"AxubfL","uuiInfo":"AxubfL","uui-success":"_0HXlPL","uuiSuccess":"_0HXlPL","uui-warning":"Ezgw3N","uuiWarning":"Ezgw3N","uui-highlight":"xwaUPi","uuiHighlight":"xwaUPi","uui-typography-size-12":"q2YhEN","uuiTypographySize12":"q2YhEN","uui-typography-size-14":"_7Y6i-z","uuiTypographySize14":"_7Y6i-z","uui-typography-size-16":"_3L9CP0","uuiTypographySize16":"_3L9CP0","root":"aZOusA"};
|
|
1295
1268
|
|
|
1296
1269
|
function applyTagMods(props) {
|
|
1297
1270
|
return [
|
|
@@ -1306,7 +1279,11 @@ const Tag = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
|
1306
1279
|
const styles = [applyTagMods(props), props.cx];
|
|
1307
1280
|
const ClearIcon = props.clearIcon ? props.clearIcon : systemIcons.clear;
|
|
1308
1281
|
const DropdownIcon = props.dropdownIcon ? props.dropdownIcon : systemIcons.foldingArrow;
|
|
1309
|
-
return (React__default.createElement(Clickable,
|
|
1282
|
+
return (React__default.createElement(Clickable, { ...props, rawProps: {
|
|
1283
|
+
'aria-haspopup': props.isDropdown,
|
|
1284
|
+
'aria-expanded': props.isOpen,
|
|
1285
|
+
...props.rawProps,
|
|
1286
|
+
}, cx: styles, ref: ref },
|
|
1310
1287
|
props.icon && props.iconPosition !== 'right' && (React__default.createElement(IconContainer, { icon: props.icon, onClick: !props.isDisabled ? props.onIconClick : undefined })),
|
|
1311
1288
|
props.caption && (React__default.createElement("div", { className: uuiElement.caption }, props.caption)),
|
|
1312
1289
|
props.count !== undefined && props.count !== null && (React__default.createElement(CountIndicator, { color: (!props.color || props.color === 'neutral') ? 'white' : props.color, size: settings.sizes.tag.countIndicator[(props.size || settings.sizes.defaults.tag)], caption: props.count })),
|
|
@@ -1315,7 +1292,7 @@ const Tag = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
|
1315
1292
|
props.onClear && !props.isDisabled && (React__default.createElement(IconContainer, { cx: uuiMarkers.clickable, icon: ClearIcon, onClick: props.onClear }))));
|
|
1316
1293
|
});
|
|
1317
1294
|
|
|
1318
|
-
var css$18 = {"root":"
|
|
1295
|
+
var css$18 = {"root":"J3wPxu","uui-spinner":"_8tIFq4","uuiSpinner":"_8tIFq4"};
|
|
1319
1296
|
|
|
1320
1297
|
function applySpinnerMods() {
|
|
1321
1298
|
return [css$18.root, 'uui-spinner'];
|
|
@@ -1352,31 +1329,31 @@ var SvgNavigationChevronRightOutline = function SvgNavigationChevronRightOutline
|
|
|
1352
1329
|
};
|
|
1353
1330
|
var ForwardRef$v = /*#__PURE__*/forwardRef(SvgNavigationChevronRightOutline);
|
|
1354
1331
|
|
|
1355
|
-
var css$17 = {"root":"
|
|
1332
|
+
var css$17 = {"root":"CMrtz0","page":"NsLYQJ","spacer":"_5Df6NJ","mode-ghost":"GTeXSU","modeGhost":"GTeXSU"};
|
|
1356
1333
|
|
|
1357
1334
|
function Paginator(props) {
|
|
1358
|
-
const renderPaginator = (params) => (React__default.createElement("nav",
|
|
1335
|
+
const renderPaginator = (params) => (React__default.createElement("nav", { role: "navigation", className: cx(css$17.root, 'uui-paginator', `uui-size-${props.size || settings.sizes.defaults.paginator}`), ...params.rawProps },
|
|
1359
1336
|
React__default.createElement(Button, { size: props.size || settings.sizes.defaults.paginator, icon: ForwardRef$w, onClick: params.goToPrev, isDisabled: params.isFirst || props.isDisabled, fill: "outline", color: "secondary" }),
|
|
1360
1337
|
params.pages.map((page, index) => {
|
|
1361
1338
|
if (page.type === 'spacer') {
|
|
1362
1339
|
return (React__default.createElement(Button, { cx: cx(css$17.spacer, css$17.page), size: props.size || settings.sizes.defaults.paginator, key: `${index}_spacer`, caption: "...", fill: "ghost", color: "secondary", tabIndex: -1, isDisabled: props.isDisabled }));
|
|
1363
1340
|
}
|
|
1364
1341
|
else {
|
|
1365
|
-
return (React__default.createElement(Button, { cx: cx(css$17[`mode-${!page.isActive && 'ghost'}`], css$17.page), size: props.size || settings.sizes.defaults.paginator, key: page.pageNumber, caption: page.pageNumber, onClick: () =>
|
|
1342
|
+
return (React__default.createElement(Button, { cx: cx(css$17[`mode-${!page.isActive && 'ghost'}`], css$17.page), size: props.size || settings.sizes.defaults.paginator, key: page.pageNumber, caption: page.pageNumber, onClick: () => page.onClick?.(), rawProps: { 'aria-current': page.isActive }, fill: (page.isActive && 'outline') || 'ghost', color: "primary", isDisabled: props.isDisabled }));
|
|
1366
1343
|
}
|
|
1367
1344
|
}),
|
|
1368
1345
|
React__default.createElement(Button, { size: props.size || settings.sizes.defaults.paginator, icon: ForwardRef$v, onClick: params.goToNext, isDisabled: params.isLast || props.isDisabled, fill: "outline", color: "secondary" })));
|
|
1369
|
-
return React__default.createElement(Paginator$1,
|
|
1346
|
+
return React__default.createElement(Paginator$1, { ...props, render: renderPaginator });
|
|
1370
1347
|
}
|
|
1371
1348
|
|
|
1372
|
-
var css$16 = {"root":"
|
|
1349
|
+
var css$16 = {"root":"cyfgRL","progress-bar":"KkP0fa","progressBar":"KkP0fa","progressBar-indeterminate":"W2ISm2","progressBarIndeterminate":"W2ISm2","size-12":"_6b-rPO","size12":"_6b-rPO","size-18":"Jai7iq","size18":"Jai7iq","size-24":"dOh3S6","size24":"dOh3S6"};
|
|
1373
1350
|
|
|
1374
1351
|
const IndeterminateBar = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
1375
1352
|
return (React.createElement("div", { ref: ref, className: cx('uui-indeterminate_bar', props.cx, css$16.root, css$16[`size-${props.size || 12}`]) },
|
|
1376
1353
|
React.createElement("div", { className: cx(css$16.progressBar) })));
|
|
1377
1354
|
});
|
|
1378
1355
|
|
|
1379
|
-
var css$15 = {"root":"
|
|
1356
|
+
var css$15 = {"root":"KwJ53C","striped":"d52D-i","animate-stripes":"BWNGso","animateStripes":"BWNGso","size-12":"jlWhzf","size12":"jlWhzf","size-18":"_5Ll7BO","size18":"_5Ll7BO","size-24":"QinFkw","size24":"QinFkw"};
|
|
1380
1357
|
|
|
1381
1358
|
const DEFAULT_SIZE = '12';
|
|
1382
1359
|
function applyProgressBarMods(mods) {
|
|
@@ -1391,14 +1368,14 @@ const ProgressBar = /* @__PURE__ */withMods(uuiComponents.ProgressBar, applyProg
|
|
|
1391
1368
|
hideLabel: props.hideLabel || props.striped,
|
|
1392
1369
|
}));
|
|
1393
1370
|
|
|
1394
|
-
var css$14 = {"root":"
|
|
1371
|
+
var css$14 = {"root":"ypsRN7"};
|
|
1395
1372
|
|
|
1396
1373
|
const IndicatorBar = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
1397
1374
|
const { progress } = props;
|
|
1398
1375
|
return progress || progress === 0 ? (React.createElement(ProgressBar, { ref: ref, progress: progress, cx: cx(css$14.root, props.cx), hideLabel: true })) : (React.createElement(IndeterminateBar, { ref: ref, cx: cx(css$14.root, props.cx) }));
|
|
1399
1376
|
});
|
|
1400
1377
|
|
|
1401
|
-
var css$13 = {"root":"
|
|
1378
|
+
var css$13 = {"root":"eaqlDL"};
|
|
1402
1379
|
|
|
1403
1380
|
const StatusIndicator = /* @__PURE__ */forwardRef((props, ref) => {
|
|
1404
1381
|
return (React__default.createElement("div", { ref: ref, className: cx([
|
|
@@ -1413,10 +1390,9 @@ const StatusIndicator = /* @__PURE__ */forwardRef((props, ref) => {
|
|
|
1413
1390
|
React__default.createElement("p", { className: "uui-status_indicator-caption" }, props.caption)));
|
|
1414
1391
|
});
|
|
1415
1392
|
|
|
1416
|
-
var css$12 = {"drag-handle":"
|
|
1393
|
+
var css$12 = {"drag-handle":"x6Pko4","dragHandle":"x6Pko4","icon-container":"Hm1ea5","iconContainer":"Hm1ea5"};
|
|
1417
1394
|
|
|
1418
1395
|
function DataRowAddons(props) {
|
|
1419
|
-
var _a, _b;
|
|
1420
1396
|
const row = props.rowProps;
|
|
1421
1397
|
const getIndent = () => {
|
|
1422
1398
|
return (row.indent - 1) * (settings.sizes.rowAddons.indentUnit[props.size] || settings.sizes.rowAddons.defaults.indentUnit);
|
|
@@ -1425,8 +1401,8 @@ function DataRowAddons(props) {
|
|
|
1425
1401
|
return settings.sizes.rowAddons.indentWidth[props.size] || settings.sizes.rowAddons.defaults.indentWidth;
|
|
1426
1402
|
};
|
|
1427
1403
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1428
|
-
|
|
1429
|
-
|
|
1404
|
+
row.dnd?.srcData && React__default.createElement(DragHandle, { key: "dh", cx: css$12.dragHandle, rawProps: { ...props.eventHandlers } }),
|
|
1405
|
+
row?.checkbox?.isVisible && (React__default.createElement(Checkbox, { key: "cb", cx: "uui-dr_addons-checkbox", tabIndex: props.tabIndex, size: settings.sizes.rowAddons.checkbox[props.size], value: row.isChecked, indeterminate: !row.isChecked && row.isChildrenChecked, onValueChange: () => row.onCheck?.(row), isDisabled: row.checkbox.isDisabled, isInvalid: row.checkbox.isInvalid })),
|
|
1430
1406
|
row.indent > 0 && (React__default.createElement("div", { key: "fold", className: cx('uui-dr_addons-indent', `uui-size-${props.size}`), style: { marginInlineStart: getIndent(), width: getWidth() } }, row.isFoldable && (React__default.createElement(IconContainer, { rawProps: {
|
|
1431
1407
|
'aria-label': row.isFolded ? 'Unfold' : 'Fold',
|
|
1432
1408
|
role: 'button',
|
|
@@ -1435,7 +1411,7 @@ function DataRowAddons(props) {
|
|
|
1435
1411
|
], rotate: row.isFolded ? '90ccw' : '0', onClick: () => row.onFold(row), size: settings.sizes.rowAddons.icon[props.size] || settings.sizes.rowAddons.defaults.icon }))))));
|
|
1436
1412
|
}
|
|
1437
1413
|
|
|
1438
|
-
var css$11 = {"root":"
|
|
1414
|
+
var css$11 = {"root":"CSycT4"};
|
|
1439
1415
|
|
|
1440
1416
|
const Blocker = /* @__PURE__ */withMods(Blocker$1, () => [css$11.root], (cmpProps) => ({ renderSpinner: cmpProps.renderSpinner || (() => React__default.createElement(Spinner, null)) }));
|
|
1441
1417
|
|
|
@@ -1449,17 +1425,13 @@ const VirtualList = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
1449
1425
|
});
|
|
1450
1426
|
React.useImperativeHandle(ref, () => scrollContainerRef.current, [scrollContainerRef.current]);
|
|
1451
1427
|
const scrollShadows = useScrollShadows({ root: scrollContainerRef.current });
|
|
1452
|
-
const renderRows = () => {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
})) || (React.createElement("div", { className: css$1c.listContainer, style: { minHeight: `${estimatedHeight}px` } },
|
|
1457
|
-
React.createElement("div", { ref: listContainerRef, role: props.role, style: { marginTop: offsetY } }, props.rows)));
|
|
1458
|
-
};
|
|
1428
|
+
const renderRows = () => props.renderRows?.({
|
|
1429
|
+
listContainerRef, estimatedHeight, offsetY, scrollShadows,
|
|
1430
|
+
}) || (React.createElement("div", { className: css$1c.listContainer, style: { minHeight: `${estimatedHeight}px` } },
|
|
1431
|
+
React.createElement("div", { ref: listContainerRef, role: props.role, style: { marginTop: offsetY } }, props.rows)));
|
|
1459
1432
|
const renderView = ({ style }) => (React.createElement(VirtualListView, { isLoading: props.isLoading, style: style, rawProps: props.rawProps }));
|
|
1460
1433
|
const scrollBarsRef = React.useCallback((scrollbars) => {
|
|
1461
|
-
|
|
1462
|
-
if (!((_a = scrollbars === null || scrollbars === void 0 ? void 0 : scrollbars.container) === null || _a === void 0 ? void 0 : _a.firstChild))
|
|
1434
|
+
if (!scrollbars?.container?.firstChild)
|
|
1463
1435
|
return;
|
|
1464
1436
|
scrollContainerRef.current = scrollbars.container.firstChild;
|
|
1465
1437
|
}, []);
|
|
@@ -1472,11 +1444,20 @@ const VirtualList = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
1472
1444
|
});
|
|
1473
1445
|
const VirtualListView = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
1474
1446
|
return (React.createElement(React.Fragment, null,
|
|
1475
|
-
React.createElement("div",
|
|
1447
|
+
React.createElement("div", { ...props.rawProps, style: {
|
|
1448
|
+
...props.style,
|
|
1449
|
+
position: 'relative',
|
|
1450
|
+
flex: '1 1 auto',
|
|
1451
|
+
display: 'flex',
|
|
1452
|
+
flexDirection: 'column',
|
|
1453
|
+
overflow: props.isLoading ? 'hidden' : 'scroll',
|
|
1454
|
+
marginRight: props.isLoading ? 0 : props.style.marginRight,
|
|
1455
|
+
marginBottom: props.isLoading ? 0 : props.style.marginBottom,
|
|
1456
|
+
}, ref: ref }, props.children),
|
|
1476
1457
|
React.createElement(Blocker, { isEnabled: props.isLoading })));
|
|
1477
1458
|
});
|
|
1478
1459
|
|
|
1479
|
-
var css$10 = {"root":"
|
|
1460
|
+
var css$10 = {"root":"pNV1hC"};
|
|
1480
1461
|
|
|
1481
1462
|
function CheckboxGroup(props) {
|
|
1482
1463
|
const currentValue = props.value || [];
|
|
@@ -1492,13 +1473,13 @@ function CheckboxGroup(props) {
|
|
|
1492
1473
|
}
|
|
1493
1474
|
props.onValueChange(newSelection);
|
|
1494
1475
|
};
|
|
1495
|
-
return (React.createElement("fieldset",
|
|
1496
|
-
const
|
|
1497
|
-
return (React.createElement(Checkbox,
|
|
1476
|
+
return (React.createElement("fieldset", { ref: props.forwardedRef, className: cx$1(css$10.root, directionMode[direction], props.cx), ...props.rawProps }, props.items.map((i) => {
|
|
1477
|
+
const { id, name, renderName, ...restItemProps } = i;
|
|
1478
|
+
return (React.createElement(Checkbox, { renderLabel: i.renderName ? i.renderName : () => i.name, value: currentValue.indexOf(i.id) !== -1, onValueChange: (selected) => handleChange(selected, i.id), isDisabled: props.isDisabled, isReadonly: props.isReadonly, isInvalid: props.isInvalid, isRequired: props.isRequired, key: i.id.toString(), size: props.size || i.size, ...restItemProps }));
|
|
1498
1479
|
})));
|
|
1499
1480
|
}
|
|
1500
1481
|
|
|
1501
|
-
var css$$ = {"uui-typography":"
|
|
1482
|
+
var css$$ = {"uui-typography":"tzhWEj","uuiTypography":"tzhWEj","hero-header":"Ipxhnw","heroHeader":"Ipxhnw","promo-header":"Yl5rv4","promoHeader":"Yl5rv4","uui-critical":"_5nNXIg","uuiCritical":"_5nNXIg","uui-info":"ioEw5U","uuiInfo":"ioEw5U","uui-success":"Rwybbl","uuiSuccess":"Rwybbl","uui-warning":"_6tFSSs","uuiWarning":"_6tFSSs","uui-highlight":"VHqS1E","uuiHighlight":"VHqS1E","uui-typography-size-12":"sYUH8k","uuiTypographySize12":"sYUH8k","uui-typography-size-14":"_1jWzM9","uuiTypographySize14":"_1jWzM9","uui-typography-size-16":"W9VSp5","uuiTypographySize16":"W9VSp5","root":"_6-p7jO","modal-blocker":"irt6Up","modalBlocker":"irt6Up","animateModalBlocker":"EC5h0T","modal":"M0K8dr","modal-footer":"TFPRsQ","modalFooter":"TFPRsQ","modal-header":"d9bA-T","modalHeader":"d9bA-T"};
|
|
1502
1483
|
|
|
1503
1484
|
const ModalBlocker = /* @__PURE__ */withMods(ModalBlocker$1, () => [css$$.modalBlocker]);
|
|
1504
1485
|
const ModalWindow = /* @__PURE__ */withMods(ModalWindow$1, () => [css$$.root, css$$.modal], (props) => {
|
|
@@ -1506,9 +1487,12 @@ const ModalWindow = /* @__PURE__ */withMods(ModalWindow$1, () => [css$$.root, cs
|
|
|
1506
1487
|
const height = props.height || 'auto';
|
|
1507
1488
|
const maxHeight = isMobile() ? '100dvh' : (props.maxHeight || '80dvh');
|
|
1508
1489
|
return {
|
|
1509
|
-
style:
|
|
1490
|
+
style: {
|
|
1491
|
+
...props.style,
|
|
1492
|
+
width,
|
|
1510
1493
|
height,
|
|
1511
|
-
maxHeight
|
|
1494
|
+
maxHeight,
|
|
1495
|
+
},
|
|
1512
1496
|
};
|
|
1513
1497
|
});
|
|
1514
1498
|
class ModalHeader extends React__default.Component {
|
|
@@ -1531,27 +1515,33 @@ class ModalFooter extends React__default.Component {
|
|
|
1531
1515
|
}
|
|
1532
1516
|
}
|
|
1533
1517
|
|
|
1534
|
-
const TREE_SHAKEABLE_INIT = () => (
|
|
1518
|
+
const TREE_SHAKEABLE_INIT = () => ({
|
|
1519
|
+
...i18n$1,
|
|
1520
|
+
dataPickerBody: {
|
|
1535
1521
|
searchPlaceholder: 'Search',
|
|
1536
1522
|
noRecordsMessage: 'No records found',
|
|
1537
1523
|
noRecordsSubTitle: 'Check your spelling, or search for a different keyword',
|
|
1538
1524
|
typeSearchToLoadMessage: 'Type search to load items',
|
|
1539
|
-
},
|
|
1525
|
+
},
|
|
1526
|
+
pickerModal: {
|
|
1540
1527
|
headerTitle: 'Please select',
|
|
1541
1528
|
searchPlaceholder: 'Type text for quick search',
|
|
1542
1529
|
cancelButton: 'Cancel',
|
|
1543
1530
|
selectButton: 'Select',
|
|
1544
1531
|
clearAllButton: 'CLEAR ALL',
|
|
1545
1532
|
selectAllButton: 'SELECT ALL',
|
|
1546
|
-
},
|
|
1533
|
+
},
|
|
1534
|
+
pickerInput: {
|
|
1547
1535
|
showOnlySelectedLabel: 'Show only selected',
|
|
1548
1536
|
clearSelectionButton: 'CLEAR ALL',
|
|
1549
1537
|
clearSelectionButtonSingle: 'CLEAR',
|
|
1550
1538
|
selectAllButton: 'SELECT ALL',
|
|
1551
1539
|
doneButton: 'DONE',
|
|
1552
|
-
},
|
|
1540
|
+
},
|
|
1541
|
+
notificationCard: {
|
|
1553
1542
|
closeAllNotificationsButton: 'CLOSE ALL NOTIFICATIONS',
|
|
1554
|
-
},
|
|
1543
|
+
},
|
|
1544
|
+
form: {
|
|
1555
1545
|
notifications: {
|
|
1556
1546
|
actionButtonCaption: 'Restore',
|
|
1557
1547
|
unsavedChangesMessage: 'You have unsaved changes. Click Restore button if you would like to recover the data',
|
|
@@ -1561,10 +1551,12 @@ const TREE_SHAKEABLE_INIT = () => (Object.assign(Object.assign({}, i18n$1), { da
|
|
|
1561
1551
|
discardButton: 'Discard',
|
|
1562
1552
|
saveButton: 'Save',
|
|
1563
1553
|
},
|
|
1564
|
-
},
|
|
1554
|
+
},
|
|
1555
|
+
rangeDatePicker: {
|
|
1565
1556
|
pickerPlaceholderFrom: 'From:',
|
|
1566
1557
|
pickerPlaceholderTo: 'To:',
|
|
1567
|
-
},
|
|
1558
|
+
},
|
|
1559
|
+
tables: {
|
|
1568
1560
|
noResultsBlock: {
|
|
1569
1561
|
title: 'No results found',
|
|
1570
1562
|
message: 'We can’t find any item matching your request',
|
|
@@ -1598,10 +1590,12 @@ const TREE_SHAKEABLE_INIT = () => (Object.assign(Object.assign({}, i18n$1), { da
|
|
|
1598
1590
|
collapseAllTooltip: 'Collapse All',
|
|
1599
1591
|
expandAllTooltip: 'Expand All',
|
|
1600
1592
|
},
|
|
1601
|
-
},
|
|
1593
|
+
},
|
|
1594
|
+
pickerFilterHeader: {
|
|
1602
1595
|
sortAscending: 'Sort Ascending',
|
|
1603
1596
|
sortDescending: 'Sort Descending',
|
|
1604
|
-
},
|
|
1597
|
+
},
|
|
1598
|
+
filterToolbar: {
|
|
1605
1599
|
addCaption: 'Add filter',
|
|
1606
1600
|
datePicker: {
|
|
1607
1601
|
placeholder: 'Select date',
|
|
@@ -1616,19 +1610,24 @@ const TREE_SHAKEABLE_INIT = () => (Object.assign(Object.assign({}, i18n$1), { da
|
|
|
1616
1610
|
pickerInput: {
|
|
1617
1611
|
itemsPlaceholder: 'items',
|
|
1618
1612
|
},
|
|
1619
|
-
},
|
|
1613
|
+
},
|
|
1614
|
+
presetPanel: {
|
|
1620
1615
|
addCaption: 'Add Preset',
|
|
1621
|
-
},
|
|
1616
|
+
},
|
|
1617
|
+
confirmationModal: {
|
|
1622
1618
|
discardButton: 'Discard',
|
|
1623
1619
|
saveButton: 'Save',
|
|
1624
|
-
},
|
|
1620
|
+
},
|
|
1621
|
+
fileUpload: {
|
|
1625
1622
|
labelStart: 'Drop files to attach or',
|
|
1626
1623
|
browse: 'browse',
|
|
1627
1624
|
labelEnd: 'your local files',
|
|
1628
|
-
},
|
|
1625
|
+
},
|
|
1626
|
+
fileCard: {
|
|
1629
1627
|
fileSizeProgress: ' of ',
|
|
1630
1628
|
failedUploadErrorMessage: 'Upload failed',
|
|
1631
|
-
},
|
|
1629
|
+
},
|
|
1630
|
+
errorHandler: {
|
|
1632
1631
|
errorPageConfig: {
|
|
1633
1632
|
notFound: {
|
|
1634
1633
|
title: 'Oooops! We couldn’t find this page',
|
|
@@ -1670,7 +1669,8 @@ const TREE_SHAKEABLE_INIT = () => (Object.assign(Object.assign({}, i18n$1), { da
|
|
|
1670
1669
|
},
|
|
1671
1670
|
},
|
|
1672
1671
|
supportMessage: undefined,
|
|
1673
|
-
}
|
|
1672
|
+
},
|
|
1673
|
+
});
|
|
1674
1674
|
const i18n = /* @__PURE__ */TREE_SHAKEABLE_INIT();
|
|
1675
1675
|
|
|
1676
1676
|
var _path$u;
|
|
@@ -1688,42 +1688,40 @@ var SvgNotificationHelpFill = function SvgNotificationHelpFill(props, ref) {
|
|
|
1688
1688
|
};
|
|
1689
1689
|
var ForwardRef$u = /*#__PURE__*/forwardRef(SvgNotificationHelpFill);
|
|
1690
1690
|
|
|
1691
|
-
var css$_ = {"uui-typography":"
|
|
1691
|
+
var css$_ = {"uui-typography":"Gt9SS8","uuiTypography":"Gt9SS8","hero-header":"_02l2ih","heroHeader":"_02l2ih","promo-header":"dTb7ro","promoHeader":"dTb7ro","uui-critical":"Sdi66j","uuiCritical":"Sdi66j","uui-info":"WwyBEo","uuiInfo":"WwyBEo","uui-success":"EUk49W","uuiSuccess":"EUk49W","uui-warning":"xA7UQP","uuiWarning":"xA7UQP","uui-highlight":"u-sLJu","uuiHighlight":"u-sLJu","uui-typography-size-12":"mWUMtG","uuiTypographySize12":"mWUMtG","uui-typography-size-14":"gRB44j","uuiTypographySize14":"gRB44j","uui-typography-size-16":"leU-1F","uuiTypographySize16":"leU-1F","root":"NikXlR","icon-wrapper":"aB0sfy","iconWrapper":"aB0sfy","action-wrapper":"_1gO-MY","actionWrapper":"_1gO-MY","action-link":"_1zFAyy","actionLink":"_1zFAyy","close-icon":"fr4B2G","closeIcon":"fr4B2G","main-path":"_4ugvzp","mainPath":"_4ugvzp","content":"tM9ovP","close-wrapper":"LWcf9e","closeWrapper":"LWcf9e","notification-wrapper":"k19tkt","notificationWrapper":"k19tkt","clear-button":"THoTCo","clearButton":"THoTCo"};
|
|
1692
1692
|
|
|
1693
1693
|
const NotificationCard = /* @__PURE__ */React__default.forwardRef((props, ref) => {
|
|
1694
1694
|
const notificationCardNode = React__default.useRef(null);
|
|
1695
1695
|
React__default.useImperativeHandle(ref, () => notificationCardNode.current, [notificationCardNode.current]);
|
|
1696
1696
|
React__default.useLayoutEffect(() => {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
(_b = notificationCardNode.current) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseleave', props.refreshTimer);
|
|
1697
|
+
notificationCardNode.current?.addEventListener('mouseenter', props.clearTimer);
|
|
1698
|
+
notificationCardNode.current?.addEventListener('mouseleave', props.refreshTimer);
|
|
1700
1699
|
return () => {
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
(_b = notificationCardNode.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', props.refreshTimer);
|
|
1700
|
+
notificationCardNode.current?.removeEventListener('mouseenter', props.clearTimer);
|
|
1701
|
+
notificationCardNode.current?.removeEventListener('mouseleave', props.refreshTimer);
|
|
1704
1702
|
};
|
|
1705
1703
|
}, []);
|
|
1706
|
-
return (React__default.createElement("div",
|
|
1704
|
+
return (React__default.createElement("div", { role: "alert", className: cx('uui-notification_card', props.color && `uui-color-${props.color}`, css$_.root, props.cx), ref: notificationCardNode, ...props.rawProps },
|
|
1707
1705
|
React__default.createElement("div", { className: css$_.mainPath },
|
|
1708
1706
|
props.icon && (React__default.createElement("div", { className: css$_.iconWrapper },
|
|
1709
1707
|
React__default.createElement(IconContainer, { size: 24, icon: props.icon }))),
|
|
1710
1708
|
React__default.createElement("div", { className: css$_.content },
|
|
1711
1709
|
props.children,
|
|
1712
|
-
props.actions && (React__default.createElement("div", { className: css$_.actionWrapper }, props.actions.map((action) => (React__default.createElement(LinkButton, {
|
|
1710
|
+
props.actions && (React__default.createElement("div", { className: css$_.actionWrapper }, props.actions.map((action) => (React__default.createElement(LinkButton, { key: action.name, caption: action.name, onClick: action.action, cx: css$_.actionLink, size: settings.sizes.notificationCard.action, rawProps: action.rawProps })))))),
|
|
1713
1711
|
props.onClose && (React__default.createElement("div", { className: css$_.closeWrapper },
|
|
1714
1712
|
React__default.createElement(IconButton, { icon: ForwardRef$R, color: "neutral", onClick: props.onClose, cx: css$_.closeIcon }))))));
|
|
1715
1713
|
});
|
|
1716
|
-
const WarningNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard,
|
|
1717
|
-
const SuccessNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard,
|
|
1718
|
-
const HintNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard,
|
|
1719
|
-
const ErrorNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard,
|
|
1714
|
+
const WarningNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, { icon: ForwardRef$z, color: "warning", ...props, ref: ref, cx: props.cx })));
|
|
1715
|
+
const SuccessNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, { icon: ForwardRef$A, color: "success", ...props, ref: ref, cx: props.cx })));
|
|
1716
|
+
const HintNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, { icon: ForwardRef$u, color: "info", ...props, ref: ref, cx: props.cx })));
|
|
1717
|
+
const ErrorNotification = /* @__PURE__ */React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, { icon: ForwardRef$y, color: "error", ...props, ref: ref, cx: props.cx })));
|
|
1720
1718
|
function ClearNotification() {
|
|
1721
1719
|
const uuiCtx = useUuiContext();
|
|
1722
1720
|
return (React__default.createElement("div", { className: cx(css$_.notificationWrapper, css$_.clearButton) },
|
|
1723
1721
|
React__default.createElement(LinkButton, { caption: i18n.notificationCard.closeAllNotificationsButton, onClick: () => uuiCtx.uuiNotifications.clearAll() })));
|
|
1724
1722
|
}
|
|
1725
1723
|
|
|
1726
|
-
var css$Z = {"footer":"
|
|
1724
|
+
var css$Z = {"footer":"zDTQ-W"};
|
|
1727
1725
|
|
|
1728
1726
|
class ConfirmationModal extends React.Component {
|
|
1729
1727
|
render() {
|
|
@@ -1731,7 +1729,7 @@ class ConfirmationModal extends React.Component {
|
|
|
1731
1729
|
if (this.props.bodyContent) {
|
|
1732
1730
|
bodyContent = React.createElement(Panel, { background: "surface-main", margin: "24" }, this.props.bodyContent);
|
|
1733
1731
|
}
|
|
1734
|
-
return (React.createElement(ModalBlocker,
|
|
1732
|
+
return (React.createElement(ModalBlocker, { ...this.props },
|
|
1735
1733
|
React.createElement(ModalWindow, { width: 420 },
|
|
1736
1734
|
React.createElement(ModalHeader, { borderBottom: true, title: this.props.caption, onClose: () => this.props.abort() }),
|
|
1737
1735
|
React.createElement(ScrollBars, null, bodyContent),
|
|
@@ -1765,7 +1763,7 @@ function useReliableForceUpdate() {
|
|
|
1765
1763
|
return red[1];
|
|
1766
1764
|
}
|
|
1767
1765
|
|
|
1768
|
-
var css$Y = {"root":"
|
|
1766
|
+
var css$Y = {"root":"OPiMq2","timepicker-input":"WVyBwA","timepickerInput":"WVyBwA","ltr-always":"zaTOH5","ltrAlways":"zaTOH5"};
|
|
1769
1767
|
|
|
1770
1768
|
const uuiTimePicker = {
|
|
1771
1769
|
container: 'uui-timepicker-container',
|
|
@@ -1804,7 +1802,7 @@ function TimePickerBody(props) {
|
|
|
1804
1802
|
const minutesToSubtract = value.minute() % minutesStep === 0 ? minutesStep : value.minute() % minutesStep;
|
|
1805
1803
|
onMinutesChange(value.subtract(minutesToSubtract, 'm').minute());
|
|
1806
1804
|
};
|
|
1807
|
-
return (React.createElement("div",
|
|
1805
|
+
return (React.createElement("div", { className: cx$1(css$Y.root, uuiTimePicker.container, props.cx), ref: props.forwardedRef, ...props.rawProps },
|
|
1808
1806
|
React.createElement("div", { className: css$Y.ltrAlways },
|
|
1809
1807
|
React.createElement("div", { className: uuiTimePicker.elementContainer },
|
|
1810
1808
|
React.createElement(IconContainer, { size: 18, rawProps: { 'aria-label': 'Increment hours' }, cx: uuiTimePicker.iconUp, icon: ForwardRef$Q, onClick: () => onHoursChange(uuiDayjs.dayjs().set(props.value).add(1, 'h').hour()) }),
|
|
@@ -1886,7 +1884,11 @@ function TimePicker(props) {
|
|
|
1886
1884
|
useEffect(() => {
|
|
1887
1885
|
if (valueToTimeString(props.value, props.format) !== state.value) {
|
|
1888
1886
|
const stringValue = valueToTimeString(props.value, props.format);
|
|
1889
|
-
setState((prevState) => (
|
|
1887
|
+
setState((prevState) => ({
|
|
1888
|
+
...prevState,
|
|
1889
|
+
value: stringValue,
|
|
1890
|
+
inputValue: stringValue,
|
|
1891
|
+
}));
|
|
1890
1892
|
}
|
|
1891
1893
|
}, [props.value, props.format]);
|
|
1892
1894
|
const getFormat = () => props.format === 24 ? 'HH:mm' : 'hh:mm A';
|
|
@@ -1902,10 +1904,10 @@ function TimePicker(props) {
|
|
|
1902
1904
|
props.onValueChange(null);
|
|
1903
1905
|
};
|
|
1904
1906
|
const onToggle = (value) => {
|
|
1905
|
-
setState((prevState) => (
|
|
1907
|
+
setState((prevState) => ({ ...prevState, isOpen: value }));
|
|
1906
1908
|
};
|
|
1907
1909
|
const saveTime = (newTime) => {
|
|
1908
|
-
setState((prevState) => (
|
|
1910
|
+
setState((prevState) => ({ ...prevState, inputValue: newTime }));
|
|
1909
1911
|
props.onValueChange(formatStringTimeToObject(newTime));
|
|
1910
1912
|
};
|
|
1911
1913
|
const getTimeFromInputValue = (newValue) => {
|
|
@@ -1920,45 +1922,41 @@ function TimePicker(props) {
|
|
|
1920
1922
|
saveTime(inputValue);
|
|
1921
1923
|
};
|
|
1922
1924
|
const handleFocus = (e) => {
|
|
1923
|
-
var _a;
|
|
1924
1925
|
onToggle(true);
|
|
1925
|
-
|
|
1926
|
+
props.onFocus?.(e);
|
|
1926
1927
|
};
|
|
1927
1928
|
const handleInputChange = (newValue) => {
|
|
1928
|
-
setState((prevState) => (
|
|
1929
|
+
setState((prevState) => ({ ...prevState, inputValue: newValue }));
|
|
1929
1930
|
if (newValue) {
|
|
1930
1931
|
const result = getTimeFromInputValue(newValue);
|
|
1931
1932
|
if (isTimeValid(result)) {
|
|
1932
|
-
setState((prevState) => (
|
|
1933
|
+
setState((prevState) => ({ ...prevState, value: result }));
|
|
1933
1934
|
}
|
|
1934
1935
|
}
|
|
1935
1936
|
};
|
|
1936
1937
|
const handleBlur = (e) => {
|
|
1937
|
-
var _a;
|
|
1938
1938
|
if (isFocusReceiverInsideFocusLock(e))
|
|
1939
1939
|
return;
|
|
1940
1940
|
onToggle(false);
|
|
1941
|
-
|
|
1941
|
+
props.onBlur?.(e);
|
|
1942
1942
|
if (state.value === '' || state.inputValue === '') {
|
|
1943
1943
|
props.onValueChange(null);
|
|
1944
|
-
setState((prevState) => (
|
|
1944
|
+
setState((prevState) => ({ ...prevState, value: null, inputValue: null }));
|
|
1945
1945
|
}
|
|
1946
1946
|
state.value && state.inputValue && saveTime(state.value);
|
|
1947
1947
|
};
|
|
1948
1948
|
const renderInput = (inputProps) => {
|
|
1949
|
-
|
|
1950
|
-
return (React__default.createElement(TextInput, Object.assign({}, inputProps, { onClick: null, size: props.size || '36', isDisabled: props.isDisabled, isReadonly: props.isReadonly, isInvalid: props.isInvalid, cx: [css$Y.root, css$Y.timepickerInput, props.inputCx], value: state.inputValue, onValueChange: handleInputChange, onCancel: !props.disableClear && onClear, onFocus: handleFocus, onBlur: handleBlur, isDropdown: false, placeholder: props.placeholder ? props.placeholder : getFormat(), mode: props.mode || DEFAULT_MODE, rawProps: (_a = props.rawProps) === null || _a === void 0 ? void 0 : _a.input })));
|
|
1949
|
+
return (React__default.createElement(TextInput, { ...inputProps, onClick: null, size: props.size || '36', isDisabled: props.isDisabled, isReadonly: props.isReadonly, isInvalid: props.isInvalid, cx: [css$Y.root, css$Y.timepickerInput, props.inputCx], value: state.inputValue, onValueChange: handleInputChange, onCancel: !props.disableClear && onClear, onFocus: handleFocus, onBlur: handleBlur, isDropdown: false, placeholder: props.placeholder ? props.placeholder : getFormat(), mode: props.mode || DEFAULT_MODE, rawProps: props.rawProps?.input }));
|
|
1951
1950
|
};
|
|
1952
1951
|
const renderBody = (bodyProps) => {
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
React__default.createElement(TimePickerBody, Object.assign({}, timePickerBodyProps, { onValueChange: handleBodyValueChange, value: formatStringTimeToObject(state.value), rawProps: (_a = props.rawProps) === null || _a === void 0 ? void 0 : _a.body, cx: props.bodyCx })))));
|
|
1952
|
+
const { forwardedRef, onValueChange, ...timePickerBodyProps } = props;
|
|
1953
|
+
return (!props.isDisabled && !props.isReadonly && (React__default.createElement(DropdownContainer, { ...bodyProps, focusLock: false },
|
|
1954
|
+
React__default.createElement(TimePickerBody, { ...timePickerBodyProps, onValueChange: handleBodyValueChange, value: formatStringTimeToObject(state.value), rawProps: props.rawProps?.body, cx: props.bodyCx }))));
|
|
1957
1955
|
};
|
|
1958
1956
|
return (React__default.createElement(Dropdown, { renderTarget: (targetProps) => (props.renderTarget ? props.renderTarget(targetProps) : renderInput(targetProps)), renderBody: (bodyProps) => !props.isDisabled && !props.isReadonly && renderBody(bodyProps), onValueChange: !props.isDisabled && !props.isReadonly ? onToggle : null, value: state.isOpen, modifiers: [{ name: 'offset', options: { offset: [0, 6] } }], forwardedRef: props.forwardedRef }));
|
|
1959
1957
|
}
|
|
1960
1958
|
|
|
1961
|
-
var css$X = {"root":"
|
|
1959
|
+
var css$X = {"root":"_4sgZ8N"};
|
|
1962
1960
|
|
|
1963
1961
|
function applyInputAddonMods() {
|
|
1964
1962
|
return [
|
|
@@ -1967,7 +1965,7 @@ function applyInputAddonMods() {
|
|
|
1967
1965
|
}
|
|
1968
1966
|
const InputAddon = /* @__PURE__ */withMods(InputAddon$1, applyInputAddonMods);
|
|
1969
1967
|
|
|
1970
|
-
var css$W = {"root":"
|
|
1968
|
+
var css$W = {"root":"ZLpNz7"};
|
|
1971
1969
|
|
|
1972
1970
|
function applySliderMods() {
|
|
1973
1971
|
return [css$W.root, 'uui-color-neutral'];
|
|
@@ -1990,7 +1988,7 @@ var SvgStarFilled = function SvgStarFilled(props, ref) {
|
|
|
1990
1988
|
};
|
|
1991
1989
|
var ForwardRef$t = /*#__PURE__*/forwardRef(SvgStarFilled);
|
|
1992
1990
|
|
|
1993
|
-
var css$V = {"root":"
|
|
1991
|
+
var css$V = {"root":"h1Mcnu","tooltip":"_0p8TPz"};
|
|
1994
1992
|
|
|
1995
1993
|
function applyRatingMods(mods) {
|
|
1996
1994
|
return [
|
|
@@ -2026,17 +2024,16 @@ const getMonthOnOpen = (selectedDate, focus) => {
|
|
|
2026
2024
|
return uuiDayjs.dayjs(selectedDate[focus]);
|
|
2027
2025
|
}
|
|
2028
2026
|
else if (selectedDate.from) {
|
|
2029
|
-
return uuiDayjs.dayjs(selectedDate
|
|
2027
|
+
return uuiDayjs.dayjs(selectedDate?.from);
|
|
2030
2028
|
}
|
|
2031
2029
|
else if (selectedDate.to) {
|
|
2032
|
-
return uuiDayjs.dayjs(selectedDate
|
|
2030
|
+
return uuiDayjs.dayjs(selectedDate?.to);
|
|
2033
2031
|
}
|
|
2034
2032
|
return uuiDayjs.dayjs();
|
|
2035
2033
|
};
|
|
2036
2034
|
const isValidDate = (input, format, filter) => {
|
|
2037
|
-
var _a, _b;
|
|
2038
2035
|
const parsedDate = uuiDayjs.dayjs(input, supportedDateFormats(format), true);
|
|
2039
|
-
return
|
|
2036
|
+
return parsedDate.isValid() ?? filter?.(parsedDate) ?? true;
|
|
2040
2037
|
};
|
|
2041
2038
|
const isValidRange = (range) => {
|
|
2042
2039
|
const from = uuiDayjs.dayjs(range.from);
|
|
@@ -2132,7 +2129,7 @@ const getNextYearsList = (currentDate) => {
|
|
|
2132
2129
|
return currentDate.add(16, 'year');
|
|
2133
2130
|
};
|
|
2134
2131
|
|
|
2135
|
-
var css$U = {"root":"
|
|
2132
|
+
var css$U = {"root":"_1hm209","container":"OXPn1F"};
|
|
2136
2133
|
|
|
2137
2134
|
const uuiHeader = {
|
|
2138
2135
|
container: 'uui-datepicker-header-container',
|
|
@@ -2216,14 +2213,14 @@ function DatePickerHeader({ navIconLeft, navIconRight, value: { month, view }, o
|
|
|
2216
2213
|
React.createElement(Button, { icon: navIconRight || ForwardRef$v, color: "secondary", fill: "ghost", cx: uuiHeader.navIconRight, onClick: !isDisabled && (() => onRightNavigationArrow()), isDisabled: disableNext }))));
|
|
2217
2214
|
}
|
|
2218
2215
|
|
|
2219
|
-
var css$T = {"uui-typography":"
|
|
2216
|
+
var css$T = {"uui-typography":"EOtnYV","uuiTypography":"EOtnYV","hero-header":"ET7Lxi","heroHeader":"ET7Lxi","promo-header":"K84Wt2","promoHeader":"K84Wt2","uui-critical":"wvrfve","uuiCritical":"wvrfve","uui-info":"VtfHwd","uuiInfo":"VtfHwd","uui-success":"xzQHuh","uuiSuccess":"xzQHuh","uui-warning":"lxHRbO","uuiWarning":"lxHRbO","uui-highlight":"yK8yWc","uuiHighlight":"yK8yWc","uui-typography-size-12":"cIsloX","uuiTypographySize12":"cIsloX","uui-typography-size-14":"HQput1","uuiTypographySize14":"HQput1","uui-typography-size-16":"-nPSkp","uuiTypographySize16":"-nPSkp","root":"-rIouh"};
|
|
2220
2217
|
|
|
2221
2218
|
function applyDateSelectionMods() {
|
|
2222
2219
|
return [css$T.root, `uui-size-${settings.sizes.defaults.datePicker}`];
|
|
2223
2220
|
}
|
|
2224
2221
|
const Calendar = /* @__PURE__ */withMods(Calendar$1, applyDateSelectionMods);
|
|
2225
2222
|
|
|
2226
|
-
var css$S = {"uui-typography":"
|
|
2223
|
+
var css$S = {"uui-typography":"WAE8ds","uuiTypography":"WAE8ds","hero-header":"cRSH9u","heroHeader":"cRSH9u","promo-header":"PDAJvQ","promoHeader":"PDAJvQ","uui-critical":"_93T7xf","uuiCritical":"_93T7xf","uui-info":"_9ijqS2","uuiInfo":"_9ijqS2","uui-success":"_9L6ZU9","uuiSuccess":"_9L6ZU9","uui-warning":"iYH3U3","uuiWarning":"iYH3U3","uui-highlight":"Z7IfpQ","uuiHighlight":"Z7IfpQ","uui-typography-size-12":"CQK-Wk","uuiTypographySize12":"CQK-Wk","uui-typography-size-14":"_97rGbs","uuiTypographySize14":"_97rGbs","uui-typography-size-16":"HJhR02","uuiTypographySize16":"HJhR02","root":"SJyVUO"};
|
|
2227
2224
|
|
|
2228
2225
|
const uuiDatePickerBody = {
|
|
2229
2226
|
wrapper: 'uui-datepicker-body-wrapper',
|
|
@@ -2238,7 +2235,7 @@ function DatePickerBodyComp(props, ref) {
|
|
|
2238
2235
|
setMonth(getNewMonth(value));
|
|
2239
2236
|
setView('DAY_SELECTION');
|
|
2240
2237
|
}, [value, setMonth]);
|
|
2241
|
-
return (React__default.createElement(StatelessDatePickerBody,
|
|
2238
|
+
return (React__default.createElement(StatelessDatePickerBody, { ref: ref, ...props, month: month, view: view, onValueChange: onValueChange, onMonthChange: (m) => setMonth(m), onViewChange: (v) => setView(v) }));
|
|
2242
2239
|
}
|
|
2243
2240
|
const StatelessDatePickerBody = /* @__PURE__ */forwardRef(StatelessDatePickerBodyComp);
|
|
2244
2241
|
function StatelessDatePickerBodyComp({ renderDay, isHoliday, cx: classes, filter, rawProps, value, month, view, onValueChange, onMonthChange, onViewChange, isDisabled, }, ref) {
|
|
@@ -2266,7 +2263,7 @@ function StatelessDatePickerBodyComp({ renderDay, isHoliday, cx: classes, filter
|
|
|
2266
2263
|
return (React__default.createElement(Calendar, { value: selectedDate, month: month, onValueChange: onDayClick, filter: filter, renderDay: renderDay, isHoliday: isHoliday, isDisabled: isDisabled }));
|
|
2267
2264
|
}
|
|
2268
2265
|
};
|
|
2269
|
-
return (React__default.createElement("div",
|
|
2266
|
+
return (React__default.createElement("div", { ref: ref, className: cx$1(uuiDatePickerBodyBase.container, `uui-size-${settings.sizes.defaults.datePicker}`, classes), ...rawProps },
|
|
2270
2267
|
React__default.createElement("div", { className: cx$1(css$S.root, uuiDatePickerBody.wrapper) },
|
|
2271
2268
|
React__default.createElement(DatePickerHeader, { value: {
|
|
2272
2269
|
view,
|
|
@@ -2284,7 +2281,7 @@ const modifiers$1 = [{
|
|
|
2284
2281
|
options: { offset: [0, 6] },
|
|
2285
2282
|
}];
|
|
2286
2283
|
function DatePickerComponent(props, ref) {
|
|
2287
|
-
const { format = defaultFormat, value } = props;
|
|
2284
|
+
const { format = defaultFormat, value, size = settings.sizes.defaults.datePicker } = props;
|
|
2288
2285
|
const context = useUuiContext();
|
|
2289
2286
|
const [inputValue, setInputValue] = useState(toCustomDateFormat(value, format));
|
|
2290
2287
|
const [isBodyOpen, setBodyIsOpen] = useState(false);
|
|
@@ -2306,8 +2303,7 @@ function DatePickerComponent(props, ref) {
|
|
|
2306
2303
|
setBodyIsOpen(false);
|
|
2307
2304
|
};
|
|
2308
2305
|
const onBlur = (e) => {
|
|
2309
|
-
|
|
2310
|
-
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
2306
|
+
props.onBlur?.(e);
|
|
2311
2307
|
if (isValidDate(inputValue, format, props.filter)) {
|
|
2312
2308
|
setInputValue(toCustomDateFormat(inputValue, format));
|
|
2313
2309
|
onValueChange(toValueDateFormat(inputValue, format));
|
|
@@ -2324,37 +2320,33 @@ function DatePickerComponent(props, ref) {
|
|
|
2324
2320
|
}
|
|
2325
2321
|
};
|
|
2326
2322
|
const renderInput = (renderProps) => {
|
|
2327
|
-
var _a;
|
|
2328
2323
|
const allowClear = !props.disableClear && !!inputValue;
|
|
2329
|
-
return (React__default.createElement(TextInput,
|
|
2324
|
+
return (React__default.createElement(TextInput, { ...renderProps, isDropdown: false, cx: cx$1(props.inputCx, isBodyOpen && uuiMod.focus), icon: props.mode !== EditMode.CELL && systemIcons.calendar ? systemIcons.calendar : undefined, iconPosition: props.iconPosition || 'left', placeholder: props.placeholder ? props.placeholder : format, size: size, value: inputValue || undefined, onValueChange: (v) => {
|
|
2330
2325
|
setInputValue(v || '');
|
|
2331
2326
|
}, onCancel: allowClear ? () => {
|
|
2332
2327
|
if (!props.disableClear && !!inputValue) {
|
|
2333
2328
|
onValueChange(null);
|
|
2334
2329
|
}
|
|
2335
2330
|
} : undefined, isInvalid: props.isInvalid, isDisabled: props.isDisabled, isReadonly: props.isReadonly, tabIndex: props.isReadonly || props.isDisabled ? -1 : 0, onFocus: (e) => {
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
}, onKeyDown: onInputKeyDown, onBlur: onBlur, mode: props.mode || defaultMode$1, rawProps: (_a = props.rawProps) === null || _a === void 0 ? void 0 : _a.input, id: props.id })));
|
|
2331
|
+
props.onFocus?.(e);
|
|
2332
|
+
}, onKeyDown: onInputKeyDown, onBlur: onBlur, mode: props.mode || defaultMode$1, rawProps: props.rawProps?.input, id: props.id }));
|
|
2339
2333
|
};
|
|
2340
2334
|
const renderBody = (renderProps) => {
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
_b.call(props)));
|
|
2335
|
+
return (React__default.createElement(DropdownContainer, { ...renderProps },
|
|
2336
|
+
React__default.createElement(DatePickerBody, { value: value, onValueChange: onBodyValueChange, cx: cx$1(props.bodyCx), filter: props.filter, isHoliday: props.isHoliday, renderDay: props.renderDay, rawProps: props.rawProps?.body }),
|
|
2337
|
+
props.renderFooter?.()));
|
|
2345
2338
|
};
|
|
2346
2339
|
return (React__default.createElement(Dropdown$1, { value: isBodyOpen, modifiers: modifiers$1, placement: props.placement, forwardedRef: ref, onValueChange: (v) => {
|
|
2347
2340
|
setBodyIsOpen(v);
|
|
2348
2341
|
}, renderTarget: (renderProps) => {
|
|
2349
|
-
|
|
2350
|
-
return ((_a = props.renderTarget) === null || _a === void 0 ? void 0 : _a.call(props, renderProps)) || renderInput(renderProps);
|
|
2342
|
+
return props.renderTarget?.(renderProps) || renderInput(renderProps);
|
|
2351
2343
|
}, renderBody: (renderProps) => {
|
|
2352
2344
|
return renderBody(renderProps);
|
|
2353
2345
|
} }));
|
|
2354
2346
|
}
|
|
2355
2347
|
const DatePicker = /* @__PURE__ */React__default.forwardRef(DatePickerComponent);
|
|
2356
2348
|
|
|
2357
|
-
var css$R = {"uui-typography":"
|
|
2349
|
+
var css$R = {"uui-typography":"BkL79b","uuiTypography":"BkL79b","hero-header":"_13uVSp","heroHeader":"_13uVSp","promo-header":"_6ZmjrH","promoHeader":"_6ZmjrH","uui-critical":"OP489O","uuiCritical":"OP489O","uui-info":"_1-pda5","uuiInfo":"_1-pda5","uui-success":"n9ZbaR","uuiSuccess":"n9ZbaR","uui-warning":"nQogdv","uuiWarning":"nQogdv","uui-highlight":"WG3IBv","uuiHighlight":"WG3IBv","uui-typography-size-12":"C-YqC6","uuiTypographySize12":"C-YqC6","uui-typography-size-14":"Z1RNxQ","uuiTypographySize14":"Z1RNxQ","uui-typography-size-16":"LvnqKR","uuiTypographySize16":"LvnqKR","date-input":"vLAvGR","dateInput":"vLAvGR","root":"GjFccn","separator":"_0cvkqX","mode-form":"LYcuL2","modeForm":"LYcuL2","mode-cell":"oF2hS4","modeCell":"oF2hS4"};
|
|
2358
2350
|
|
|
2359
2351
|
const RangeDatePickerInput = /* @__PURE__ */forwardRef(({ isDisabled, isInvalid, isReadonly, size, disableClear, rawProps, value, inFocus, format, onValueChange, onFocusInput, onBlurInput, onClick, getPlaceholder, filter, onKeyDown, id, cx: classes, }, ref) => {
|
|
2360
2352
|
const [inputValue, setInputValue] = useState(toCustomDateRangeFormat(value, format));
|
|
@@ -2362,21 +2354,30 @@ const RangeDatePickerInput = /* @__PURE__ */forwardRef(({ isDisabled, isInvalid,
|
|
|
2362
2354
|
setInputValue(toCustomDateRangeFormat(value, format));
|
|
2363
2355
|
}, [format, value, setInputValue]);
|
|
2364
2356
|
const onInputChange = (newValue, inputType) => {
|
|
2365
|
-
setInputValue(
|
|
2357
|
+
setInputValue({
|
|
2358
|
+
...inputValue,
|
|
2359
|
+
[inputType]: newValue,
|
|
2360
|
+
});
|
|
2366
2361
|
};
|
|
2367
2362
|
const handleFocus = (event, inputType) => {
|
|
2368
2363
|
onFocusInput(event, inputType);
|
|
2369
2364
|
};
|
|
2370
2365
|
const handleBlur = (event, inputType) => {
|
|
2371
|
-
onBlurInput
|
|
2366
|
+
onBlurInput?.(event, inputType);
|
|
2372
2367
|
const selectedDate = toValueDateRangeFormat(inputValue, format);
|
|
2373
2368
|
if (isValidRange(selectedDate) && (!filter || filter(uuiDayjs.dayjs(selectedDate[inputType])))) {
|
|
2374
2369
|
setInputValue(toCustomDateRangeFormat(selectedDate, format));
|
|
2375
2370
|
onValueChange(selectedDate);
|
|
2376
2371
|
}
|
|
2377
2372
|
else {
|
|
2378
|
-
setInputValue(
|
|
2379
|
-
|
|
2373
|
+
setInputValue({
|
|
2374
|
+
...inputValue,
|
|
2375
|
+
[inputType]: null,
|
|
2376
|
+
});
|
|
2377
|
+
onValueChange({
|
|
2378
|
+
...selectedDate,
|
|
2379
|
+
[inputType]: null,
|
|
2380
|
+
});
|
|
2380
2381
|
}
|
|
2381
2382
|
};
|
|
2382
2383
|
const onInputKeyDown = (e) => {
|
|
@@ -2389,14 +2390,14 @@ const RangeDatePickerInput = /* @__PURE__ */forwardRef(({ isDisabled, isInvalid,
|
|
|
2389
2390
|
return (
|
|
2390
2391
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
2391
2392
|
React__default.createElement("div", { ref: ref, className: cx$1(`uui-size-${size || settings.sizes.defaults.rangeDatePicker}`, 'uui-range-date-picker', classes, css$R.root, isDisabled && uuiMod.disabled, isReadonly && uuiMod.readonly, isInvalid && uuiMod.invalid, inFocus && uuiMod.focus), onKeyDown: onKeyDown },
|
|
2392
|
-
React__default.createElement(TextInput, { icon: systemIcons.calendar, cx: cx$1(css$R.dateInput, inFocus === 'from' && uuiMod.focus), size: size || settings.sizes.defaults.rangeDatePicker, placeholder: getPlaceholder ? getPlaceholder('from') : i18n.rangeDatePicker.pickerPlaceholderFrom, value: inputValue.from || undefined, onValueChange: (v) => onInputChange(v || '', 'from'), onFocus: (event) => handleFocus(event, 'from'), onBlur: (event) => handleBlur(event, 'from'), isInvalid: isInvalid, isDisabled: isDisabled, isReadonly: isReadonly, isDropdown: false, rawProps: rawProps
|
|
2393
|
+
React__default.createElement(TextInput, { icon: systemIcons.calendar, cx: cx$1(css$R.dateInput, inFocus === 'from' && uuiMod.focus), size: size || settings.sizes.defaults.rangeDatePicker, placeholder: getPlaceholder ? getPlaceholder('from') : i18n.rangeDatePicker.pickerPlaceholderFrom, value: inputValue.from || undefined, onValueChange: (v) => onInputChange(v || '', 'from'), onFocus: (event) => handleFocus(event, 'from'), onBlur: (event) => handleBlur(event, 'from'), isInvalid: isInvalid, isDisabled: isDisabled, isReadonly: isReadonly, isDropdown: false, rawProps: rawProps?.from, onClick: onClick, onKeyDown: onInputKeyDown, id: id }),
|
|
2393
2394
|
React__default.createElement("div", { className: css$R.separator }),
|
|
2394
2395
|
React__default.createElement(TextInput, { cx: cx$1(css$R.dateInput, inFocus === 'to' && uuiMod.focus), placeholder: getPlaceholder ? getPlaceholder('to') : i18n.rangeDatePicker.pickerPlaceholderTo, size: size || settings.sizes.defaults.rangeDatePicker, value: inputValue.to || undefined, onCancel: clearAllowed ? () => {
|
|
2395
2396
|
onValueChange(defaultRangeValue);
|
|
2396
|
-
} : undefined, onValueChange: (v) => onInputChange(v || '', 'to'), onFocus: (e) => handleFocus(e, 'to'), onBlur: (e) => handleBlur(e, 'to'), isInvalid: isInvalid, isDisabled: isDisabled, isReadonly: isReadonly, isDropdown: false, rawProps: rawProps
|
|
2397
|
+
} : undefined, onValueChange: (v) => onInputChange(v || '', 'to'), onFocus: (e) => handleFocus(e, 'to'), onBlur: (e) => handleBlur(e, 'to'), isInvalid: isInvalid, isDisabled: isDisabled, isReadonly: isReadonly, isDropdown: false, rawProps: rawProps?.to, onClick: onClick, onKeyDown: onInputKeyDown })));
|
|
2397
2398
|
});
|
|
2398
2399
|
|
|
2399
|
-
var css$Q = {"uui-typography":"
|
|
2400
|
+
var css$Q = {"uui-typography":"aKMPv2","uuiTypography":"aKMPv2","hero-header":"DVAVTF","heroHeader":"DVAVTF","promo-header":"_8LdXQ2","promoHeader":"_8LdXQ2","uui-critical":"cZUiVU","uuiCritical":"cZUiVU","uui-info":"-rGsc4","uuiInfo":"-rGsc4","uui-success":"D9ahuw","uuiSuccess":"D9ahuw","uui-warning":"tUGB8H","uuiWarning":"tUGB8H","uui-highlight":"_7eczJW","uuiHighlight":"_7eczJW","uui-typography-size-12":"TWShcg","uuiTypographySize12":"TWShcg","uui-typography-size-14":"qPqW0g","uuiTypographySize14":"qPqW0g","uui-typography-size-16":"ApVwQ7","uuiTypographySize16":"ApVwQ7","root":"Aox5rF"};
|
|
2400
2401
|
|
|
2401
2402
|
const uuiPresets = {
|
|
2402
2403
|
container: 'uui-presets-container',
|
|
@@ -2404,15 +2405,19 @@ const uuiPresets = {
|
|
|
2404
2405
|
item: 'uui-presets-item',
|
|
2405
2406
|
};
|
|
2406
2407
|
const getPresets = (presets) => {
|
|
2407
|
-
return Object.keys(presets).map((key) => (
|
|
2408
|
+
return Object.keys(presets).map((key) => ({
|
|
2409
|
+
...presets[key].getRange(),
|
|
2410
|
+
name: presets[key].name,
|
|
2411
|
+
key,
|
|
2412
|
+
})).sort((a, b) => a.order - b.order);
|
|
2408
2413
|
};
|
|
2409
2414
|
function CalendarPresets(props) {
|
|
2410
|
-
return (React.createElement("div",
|
|
2415
|
+
return (React.createElement("div", { ref: props.forwardedRef, className: cx$1(uuiPresets.container, css$Q.root, props.cx), ...props.rawProps },
|
|
2411
2416
|
React.createElement("div", { className: uuiPresets.header }, "Presets"),
|
|
2412
2417
|
getPresets(props.presets).map((item) => (React.createElement(LinkButton, { key: item.key, caption: item.name, onClick: () => props.onPresetSet(item), size: "24" })))));
|
|
2413
2418
|
}
|
|
2414
2419
|
|
|
2415
|
-
var css$P = {"uui-typography":"
|
|
2420
|
+
var css$P = {"uui-typography":"GJL03A","uuiTypography":"GJL03A","hero-header":"nqQ9YN","heroHeader":"nqQ9YN","promo-header":"ektPMD","promoHeader":"ektPMD","uui-critical":"-I4kxZ","uuiCritical":"-I4kxZ","uui-info":"bWM30a","uuiInfo":"bWM30a","uui-success":"wQRgAa","uuiSuccess":"wQRgAa","uui-warning":"_7yLZQ6","uuiWarning":"_7yLZQ6","uui-highlight":"pB7qnj","uuiHighlight":"pB7qnj","uui-typography-size-12":"Wus-0s","uuiTypographySize12":"Wus-0s","uui-typography-size-14":"Wq8khN","uuiTypographySize14":"Wq8khN","uui-typography-size-16":"_2w3ugW","uuiTypographySize16":"_2w3ugW","root":"VZX6-F","container":"MEKRPh","day-selection":"OO-quB","daySelection":"OO-quB","from-picker":"-uaY0w","fromPicker":"-uaY0w","to-picker":"UqQCKB","toPicker":"UqQCKB","bodes-wrapper":"D23g4B","bodesWrapper":"D23g4B","blocker":"_0xMMMt"};
|
|
2416
2421
|
|
|
2417
2422
|
const uuiRangeDatePickerBody = {
|
|
2418
2423
|
inRange: 'uui-range-datepicker-in-range',
|
|
@@ -2510,8 +2515,8 @@ function RangeDatePickerBodyComp(props, ref) {
|
|
|
2510
2515
|
// selectedDate can be null, other params should always have values
|
|
2511
2516
|
const newRange = v ? getRange(v) : selectedDate;
|
|
2512
2517
|
let newInFocus = null;
|
|
2513
|
-
const fromChanged = selectedDate.from !==
|
|
2514
|
-
const toChanged = selectedDate.to !==
|
|
2518
|
+
const fromChanged = selectedDate.from !== newRange?.from;
|
|
2519
|
+
const toChanged = selectedDate.to !== newRange?.to;
|
|
2515
2520
|
if (inFocus === 'from' && fromChanged) {
|
|
2516
2521
|
newInFocus = 'to';
|
|
2517
2522
|
}
|
|
@@ -2521,11 +2526,11 @@ function RangeDatePickerBodyComp(props, ref) {
|
|
|
2521
2526
|
setActiveMonth(part);
|
|
2522
2527
|
props.onValueChange({
|
|
2523
2528
|
selectedDate: newRange ? newRange : selectedDate,
|
|
2524
|
-
inFocus: newInFocus
|
|
2529
|
+
inFocus: newInFocus ?? inFocus,
|
|
2525
2530
|
});
|
|
2526
2531
|
};
|
|
2527
2532
|
const renderDay = (renderProps) => {
|
|
2528
|
-
return (React__default.createElement(Day,
|
|
2533
|
+
return (React__default.createElement(Day, { ...renderProps, cx: getDayCX(renderProps.value, selectedDate) }));
|
|
2529
2534
|
};
|
|
2530
2535
|
const from = {
|
|
2531
2536
|
month,
|
|
@@ -2553,17 +2558,17 @@ function RangeDatePickerBodyComp(props, ref) {
|
|
|
2553
2558
|
});
|
|
2554
2559
|
}, presets: presets })));
|
|
2555
2560
|
};
|
|
2556
|
-
return (React__default.createElement("div",
|
|
2561
|
+
return (React__default.createElement("div", { ref: ref, className: cx$1(css$P.root, uuiDatePickerBodyBase.container, props.cx), ...props.rawProps },
|
|
2557
2562
|
React__default.createElement(FlexRow, { cx: [view === 'DAY_SELECTION' && css$P.daySelection, css$P.container], alignItems: "top" },
|
|
2558
2563
|
React__default.createElement(FlexCell, { width: "auto" },
|
|
2559
2564
|
React__default.createElement(FlexRow, null,
|
|
2560
2565
|
React__default.createElement(FlexRow, { cx: css$P.bodesWrapper, alignItems: "top" },
|
|
2561
|
-
React__default.createElement(StatelessDatePickerBody,
|
|
2566
|
+
React__default.createElement(StatelessDatePickerBody, { key: "date-picker-body-left", cx: cx$1(css$P.fromPicker), ...from, onValueChange: (v) => onBodyValueChange(v, 'from'), onMonthChange: (m) => {
|
|
2562
2567
|
setMonth(m);
|
|
2563
|
-
}, onViewChange: (v) => setView(v), filter: props.filter, isHoliday: props.isHoliday, renderDay: props.renderDay || renderDay, isDisabled: view !== 'DAY_SELECTION' && activeMonth === 'to' })
|
|
2564
|
-
React__default.createElement(StatelessDatePickerBody,
|
|
2568
|
+
}, onViewChange: (v) => setView(v), filter: props.filter, isHoliday: props.isHoliday, renderDay: props.renderDay || renderDay, isDisabled: view !== 'DAY_SELECTION' && activeMonth === 'to' }),
|
|
2569
|
+
React__default.createElement(StatelessDatePickerBody, { key: "date-picker-body-right", cx: cx$1(css$P.toPicker), ...to, onValueChange: (v) => onBodyValueChange(v, 'to'), onMonthChange: (m) => {
|
|
2565
2570
|
setMonth(m.subtract(1, 'month'));
|
|
2566
|
-
}, onViewChange: (v) => setView(v), filter: props.filter, renderDay: props.renderDay || renderDay, isHoliday: props.isHoliday, isDisabled: view !== 'DAY_SELECTION' && activeMonth === 'from' })
|
|
2571
|
+
}, onViewChange: (v) => setView(v), filter: props.filter, renderDay: props.renderDay || renderDay, isHoliday: props.isHoliday, isDisabled: view !== 'DAY_SELECTION' && activeMonth === 'from' }),
|
|
2567
2572
|
view !== 'DAY_SELECTION' && (React__default.createElement("div", { style: {
|
|
2568
2573
|
left: activeMonth === 'from' ? '50%' : undefined,
|
|
2569
2574
|
right: activeMonth === 'to' ? '50%' : undefined,
|
|
@@ -2573,9 +2578,9 @@ function RangeDatePickerBodyComp(props, ref) {
|
|
|
2573
2578
|
}
|
|
2574
2579
|
const getDayCX = (day, selectedDate) => {
|
|
2575
2580
|
const dayValue = day.valueOf();
|
|
2576
|
-
const fromValue =
|
|
2581
|
+
const fromValue = selectedDate?.from
|
|
2577
2582
|
? uuiDayjs.dayjs(selectedDate.from).valueOf() : null;
|
|
2578
|
-
const toValue =
|
|
2583
|
+
const toValue = selectedDate?.to
|
|
2579
2584
|
? uuiDayjs.dayjs(selectedDate.to).valueOf() : null;
|
|
2580
2585
|
const inRange = fromValue
|
|
2581
2586
|
&& toValue
|
|
@@ -2587,22 +2592,22 @@ const getDayCX = (day, selectedDate) => {
|
|
|
2587
2592
|
return [cx$1(inRange && uuiRangeDatePickerBody.inRange, isFirst && uuiRangeDatePickerBody.firstDayInRangeWrapper, !inRange && isFirst && uuiRangeDatePickerBody.lastDayInRangeWrapper, isLast && uuiRangeDatePickerBody.lastDayInRangeWrapper, !inRange && isLast && uuiRangeDatePickerBody.firstDayInRangeWrapper, (dayValue === fromValue || dayValue === toValue) && uuiDaySelection.selectedDay)];
|
|
2588
2593
|
};
|
|
2589
2594
|
|
|
2590
|
-
var css$O = {"dropdown-container":"
|
|
2595
|
+
var css$O = {"dropdown-container":"HbqhCF","dropdownContainer":"HbqhCF"};
|
|
2591
2596
|
|
|
2592
2597
|
const modifiers = [{
|
|
2593
2598
|
name: 'offset',
|
|
2594
2599
|
options: { offset: [0, 6] },
|
|
2595
2600
|
}];
|
|
2596
2601
|
function RangeDatePickerComponent(props, ref) {
|
|
2597
|
-
const { value: _value, format = defaultFormat } = props;
|
|
2602
|
+
const { value: _value, format = defaultFormat, size = settings.sizes.defaults.rangeDatePicker } = props;
|
|
2598
2603
|
const value = _value || defaultRangeValue; // also handles null in comparison to default value
|
|
2599
2604
|
const context = useUuiContext();
|
|
2600
2605
|
const [isOpen, setIsOpen] = useState(false);
|
|
2601
2606
|
const [inFocus, setInFocus] = useState(null);
|
|
2602
2607
|
const targetRef = React__default.useRef(null);
|
|
2603
2608
|
const onValueChange = (newValue) => {
|
|
2604
|
-
const fromChanged =
|
|
2605
|
-
const toChanged =
|
|
2609
|
+
const fromChanged = value?.from !== newValue?.from;
|
|
2610
|
+
const toChanged = value?.to !== newValue?.to;
|
|
2606
2611
|
if (fromChanged || toChanged) {
|
|
2607
2612
|
props.onValueChange(newValue);
|
|
2608
2613
|
if (props.getValueChangeAnalyticsEvent) {
|
|
@@ -2612,17 +2617,15 @@ function RangeDatePickerComponent(props, ref) {
|
|
|
2612
2617
|
}
|
|
2613
2618
|
};
|
|
2614
2619
|
const onOpenChange = (newIsOpen) => {
|
|
2615
|
-
var _a;
|
|
2616
2620
|
setIsOpen(newIsOpen);
|
|
2617
|
-
|
|
2621
|
+
props.onOpenChange?.(newIsOpen);
|
|
2618
2622
|
if (!inFocus && newIsOpen) {
|
|
2619
2623
|
setInFocus('from');
|
|
2620
2624
|
targetRef.current.querySelector('.uui-input').focus();
|
|
2621
2625
|
}
|
|
2622
2626
|
};
|
|
2623
2627
|
const onBodyValueChange = (newValue) => {
|
|
2624
|
-
|
|
2625
|
-
setInFocus((_a = newValue.inFocus) !== null && _a !== void 0 ? _a : inFocus);
|
|
2628
|
+
setInFocus(newValue.inFocus ?? inFocus);
|
|
2626
2629
|
onValueChange(newValue.selectedDate);
|
|
2627
2630
|
const toChanged = value.to !== newValue.selectedDate.to;
|
|
2628
2631
|
const closeBody = newValue.selectedDate.from && newValue.selectedDate.to
|
|
@@ -2633,19 +2636,14 @@ function RangeDatePickerComponent(props, ref) {
|
|
|
2633
2636
|
}
|
|
2634
2637
|
};
|
|
2635
2638
|
const renderBody = (renderProps) => {
|
|
2636
|
-
|
|
2637
|
-
return (React__default.createElement(DropdownContainer, Object.assign({}, renderProps, { cx: cx(css$O.dropdownContainer), shards: [targetRef], returnFocus: (node) => {
|
|
2638
|
-
console.log('lock', node);
|
|
2639
|
-
return true;
|
|
2640
|
-
} }),
|
|
2639
|
+
return (React__default.createElement(DropdownContainer, { ...renderProps, cx: cx(css$O.dropdownContainer), shards: [targetRef], returnFocus: true },
|
|
2641
2640
|
React__default.createElement(FlexRow, null,
|
|
2642
2641
|
React__default.createElement(RangeDatePickerBody, { cx: cx(props.bodyCx), value: {
|
|
2643
2642
|
selectedDate: _value,
|
|
2644
2643
|
inFocus,
|
|
2645
2644
|
}, onValueChange: onBodyValueChange, filter: props.filter, presets: props.presets, renderDay: props.renderDay, renderFooter: () => {
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
}, isHoliday: props.isHoliday, rawProps: (_a = props.rawProps) === null || _a === void 0 ? void 0 : _a.body }))));
|
|
2645
|
+
return props.renderFooter?.(value);
|
|
2646
|
+
}, isHoliday: props.isHoliday, rawProps: props.rawProps?.body }))));
|
|
2649
2647
|
};
|
|
2650
2648
|
const handleEscape = (e) => {
|
|
2651
2649
|
if (e.key === 'Escape' && isOpen) {
|
|
@@ -2654,17 +2652,15 @@ function RangeDatePickerComponent(props, ref) {
|
|
|
2654
2652
|
}
|
|
2655
2653
|
};
|
|
2656
2654
|
return (React__default.createElement(Dropdown$1, { renderTarget: (renderProps) => {
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
var _a;
|
|
2660
|
-
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e, type);
|
|
2655
|
+
return props.renderTarget?.(renderProps) || (React__default.createElement(RangeDatePickerInput, { id: props.id, ref: (node) => { renderProps.ref(node); targetRef.current = node; }, cx: props.inputCx, onClick: () => renderProps.toggleDropdownOpening(true), isDisabled: props.isDisabled, isInvalid: props.isInvalid, isReadonly: props.isReadonly, size: size, getPlaceholder: props.getPlaceholder, disableClear: props.disableClear, rawProps: props.rawProps, inFocus: inFocus, value: value, format: format, onValueChange: onValueChange, onFocusInput: (e, type) => {
|
|
2656
|
+
props.onFocus?.(e, type);
|
|
2661
2657
|
setInFocus(type);
|
|
2662
|
-
}, onBlurInput: (e, type) => {
|
|
2658
|
+
}, onBlurInput: (e, type) => { props.onBlur?.(e, type); !isOpen && setInFocus(null); }, onKeyDown: handleEscape }));
|
|
2663
2659
|
}, renderBody: (renderProps) => renderBody(renderProps), onValueChange: (v) => onOpenChange(v), value: isOpen, modifiers: modifiers, placement: props.placement, forwardedRef: ref }));
|
|
2664
2660
|
}
|
|
2665
2661
|
const RangeDatePicker = /* @__PURE__ */React__default.forwardRef(RangeDatePickerComponent);
|
|
2666
2662
|
|
|
2667
|
-
var css$N = {"root":"
|
|
2663
|
+
var css$N = {"root":"r770-s","blocker":"Rxk1cT","marker":"aUVXuk","top":"-pU3st","bottom":"xqhEC6","left":"zuU0it","right":"sJDsTK","inside":"mwqolr"};
|
|
2668
2664
|
|
|
2669
2665
|
function DropMarker(props) {
|
|
2670
2666
|
return props.isDndInProgress
|
|
@@ -2674,12 +2670,12 @@ function DropMarker(props) {
|
|
|
2674
2670
|
css$N.root,
|
|
2675
2671
|
css$N.marker,
|
|
2676
2672
|
css$N[props.position],
|
|
2677
|
-
props
|
|
2673
|
+
props?.cx,
|
|
2678
2674
|
]) })))
|
|
2679
2675
|
: null;
|
|
2680
2676
|
}
|
|
2681
2677
|
|
|
2682
|
-
var css$M = {"root":"
|
|
2678
|
+
var css$M = {"root":"nRxydU","line-height":"TNNoPW","lineHeight":"TNNoPW","font-size":"A4sNLT","fontSize":"A4sNLT"};
|
|
2683
2679
|
|
|
2684
2680
|
function applyTextMods(mods) {
|
|
2685
2681
|
return [
|
|
@@ -2695,16 +2691,18 @@ function applyTextMods(mods) {
|
|
|
2695
2691
|
];
|
|
2696
2692
|
}
|
|
2697
2693
|
const Text = /* @__PURE__ */withMods(uuiComponents.Text, applyTextMods, (props) => {
|
|
2698
|
-
|
|
2699
|
-
const style = ((_a = props === null || props === void 0 ? void 0 : props.rawProps) === null || _a === void 0 ? void 0 : _a.style) || {};
|
|
2694
|
+
const style = props?.rawProps?.style || {};
|
|
2700
2695
|
props.fontSize && (style['--uui-text-font-size'] = `${props.fontSize}px`);
|
|
2701
2696
|
props.lineHeight && (style['--uui-text-line-height'] = `${props.lineHeight}px`);
|
|
2702
2697
|
return {
|
|
2703
|
-
rawProps:
|
|
2698
|
+
rawProps: {
|
|
2699
|
+
...props?.rawProps,
|
|
2700
|
+
style: style,
|
|
2701
|
+
},
|
|
2704
2702
|
};
|
|
2705
2703
|
});
|
|
2706
2704
|
|
|
2707
|
-
var css$L = {"root":"
|
|
2705
|
+
var css$L = {"root":"BhTsOJ","loading-word":"_9u9irQ","loadingWord":"_9u9irQ","animated-loading":"p-R-41","animatedLoading":"p-R-41","skeleton_loading":"mtCOaR","skeletonLoading":"mtCOaR"};
|
|
2708
2706
|
|
|
2709
2707
|
const TextPlaceholder = (props) => {
|
|
2710
2708
|
const pattern = ' ';
|
|
@@ -2716,20 +2714,20 @@ const TextPlaceholder = (props) => {
|
|
|
2716
2714
|
}
|
|
2717
2715
|
return words;
|
|
2718
2716
|
}, [props.wordsCount]);
|
|
2719
|
-
return (React.createElement("div",
|
|
2717
|
+
return (React.createElement("div", { "aria-busy": true, className: cx(css$L.root, 'uui-text-placeholder'), ...props.rawProps }, text.map((it, index) => (React.createElement("span", { key: index, className: cx([
|
|
2720
2718
|
props.cx, css$L.loadingWord, !props.isNotAnimated && css$L.animatedLoading,
|
|
2721
2719
|
]), dangerouslySetInnerHTML: { __html: it } })))));
|
|
2722
2720
|
};
|
|
2723
2721
|
|
|
2724
|
-
const RichTextView = /* @__PURE__ */withMods(uuiComponents.RichTextView, (mods) => ['uui-typography', `uui-typography-size-${mods.size ||
|
|
2722
|
+
const RichTextView = /* @__PURE__ */withMods(uuiComponents.RichTextView, (mods) => ['uui-typography', `uui-typography-size-${mods.size || settings.sizes.defaults.richTextView}`]);
|
|
2725
2723
|
|
|
2726
|
-
var css$K = {"uui-typography":"
|
|
2724
|
+
var css$K = {"uui-typography":"HxDx9i","uuiTypography":"HxDx9i","hero-header":"_5VKSx5","heroHeader":"_5VKSx5","promo-header":"_9DfNxC","promoHeader":"_9DfNxC","uui-critical":"_0zi0mL","uuiCritical":"_0zi0mL","uui-info":"CAz27P","uuiInfo":"CAz27P","uui-success":"hUHlcf","uuiSuccess":"hUHlcf","uui-warning":"rd4B66","uuiWarning":"rd4B66","uui-highlight":"nud0ey","uuiHighlight":"nud0ey","uui-typography-size-12":"vGMHV5","uuiTypographySize12":"vGMHV5","uui-typography-size-14":"_1oV-F-","uuiTypographySize14":"_1oV-F-","uui-typography-size-16":"pBt5IQ","uuiTypographySize16":"pBt5IQ","modal":"JZp-zC","search-wrapper":"MC-RfA","searchWrapper":"MC-RfA","no-data":"ehup4C","noData":"ehup4C","type-search-to-load-size-24":"QuDh0j","typeSearchToLoadSize24":"QuDh0j"};
|
|
2727
2725
|
|
|
2728
2726
|
class DataPickerBody extends PickerBodyBase {
|
|
2729
2727
|
constructor() {
|
|
2730
2728
|
super(...arguments);
|
|
2731
2729
|
this.lens = Lens.onEditableComponent(this);
|
|
2732
|
-
this.searchLens = this.lens.prop('search');
|
|
2730
|
+
this.searchLens = this.lens.prop('search').default('');
|
|
2733
2731
|
this.getSearchSize = () => (isMobile() ? settings.sizes.pickerInput.body.mobile.searchInput : this.props.searchSize);
|
|
2734
2732
|
}
|
|
2735
2733
|
renderEmpty() {
|
|
@@ -2766,12 +2764,12 @@ class DataPickerBody extends PickerBodyBase {
|
|
|
2766
2764
|
return (React__default.createElement(React__default.Fragment, null,
|
|
2767
2765
|
this.showSearch() && (React__default.createElement("div", { key: "search", className: css$K.searchWrapper },
|
|
2768
2766
|
React__default.createElement(FlexCell$1, { grow: 1 },
|
|
2769
|
-
React__default.createElement(SearchInput,
|
|
2770
|
-
React__default.createElement(FlexRow, { key: "body", cx: cx$1('uui-picker_input-body', css$K[this.props.editMode], css$K[this.props.selectionMode]), rawProps: { style: { maxHeight: this.props.maxHeight, maxWidth: this.props.maxWidth } } }, this.props.rows.length > 0 ? (React__default.createElement(VirtualList,
|
|
2767
|
+
React__default.createElement(SearchInput, { ref: this.searchRef, placeholder: i18n.dataPickerBody.searchPlaceholder, ...this.searchLens.toProps(), onKeyDown: this.searchKeyDown, size: searchSize, debounceDelay: this.props.searchDebounceDelay, rawProps: { dir: 'auto' } })))),
|
|
2768
|
+
React__default.createElement(FlexRow, { key: "body", cx: cx$1('uui-picker_input-body', css$K[this.props.editMode], css$K[this.props.selectionMode]), rawProps: { style: { maxHeight: this.props.maxHeight, maxWidth: this.props.maxWidth } } }, this.props.rows.length > 0 ? (React__default.createElement(VirtualList, { ...this.lens.toProps(), rows: this.props.rows, rawProps: this.props.rawProps, rowsCount: this.props.rowsCount, isLoading: this.props.isReloading })) : this.renderEmpty())));
|
|
2771
2769
|
}
|
|
2772
2770
|
}
|
|
2773
2771
|
|
|
2774
|
-
var css$J = {"footer":"
|
|
2772
|
+
var css$J = {"footer":"sozOQb"};
|
|
2775
2773
|
|
|
2776
2774
|
function DataPickerFooterImpl(props) {
|
|
2777
2775
|
const { search, clearSelection, view, showSelected, selectionMode, isSearchTooShort, } = props;
|
|
@@ -2782,11 +2780,12 @@ function DataPickerFooterImpl(props) {
|
|
|
2782
2780
|
const clearAllText = i18n.pickerInput.clearSelectionButton;
|
|
2783
2781
|
const clearSingleText = i18n.pickerInput.clearSelectionButtonSingle;
|
|
2784
2782
|
const selectAllText = i18n.pickerInput.selectAllButton;
|
|
2785
|
-
const isSearching = search
|
|
2786
|
-
const hideFooter =
|
|
2783
|
+
const isSearching = search?.length;
|
|
2784
|
+
const hideFooter = (rowsCount === 0 && !hasSelection) || isSearching || (isSinglePicker && props.disableClear);
|
|
2787
2785
|
const showClear = !props.disableClear && (isSinglePicker ? true : (!view.selectAll || hasSelection));
|
|
2788
2786
|
return !hideFooter && (React__default.createElement(FlexRow, { cx: css$J.footer },
|
|
2789
|
-
!isSinglePicker && (
|
|
2787
|
+
!isSinglePicker && !isSearchTooShort && ( // Show this switch only for multi mode and when some rows rendered
|
|
2788
|
+
React__default.createElement(Switch, { size: settings.sizes.pickerInput.body.dropdown.footer.switch[props.size], value: showSelected.value, isDisabled: !hasSelection, onValueChange: showSelected.onValueChange, label: i18n.pickerInput.showOnlySelectedLabel })),
|
|
2790
2789
|
React__default.createElement(FlexSpacer, null),
|
|
2791
2790
|
React__default.createElement(FlexCell, { width: "auto", alignSelf: "center" },
|
|
2792
2791
|
view.selectAll && !hasSelection && (React__default.createElement(LinkButton, { key: "SelectAll/ClearAll" // We use the same key for these buttons, because we need to leave focus on it after click, so we need to react doesn't remount it.
|
|
@@ -2796,13 +2795,13 @@ function DataPickerFooterImpl(props) {
|
|
|
2796
2795
|
}
|
|
2797
2796
|
const DataPickerFooter = /* @__PURE__ */React__default.memo(DataPickerFooterImpl);
|
|
2798
2797
|
|
|
2799
|
-
var css$I = {"header":"
|
|
2798
|
+
var css$I = {"header":"wMZ-WZ","title":"YlL16p","close":"xQZv6j"};
|
|
2800
2799
|
|
|
2801
2800
|
const DataPickerHeaderImpl = (props) => {
|
|
2802
2801
|
const title = props.title && typeof props.title === 'string' ? props.title.charAt(0).toUpperCase() + props.title.slice(1) : '';
|
|
2803
2802
|
return (React__default.createElement(FlexRow, { alignItems: "center", borderBottom: true, cx: css$I.header },
|
|
2804
2803
|
React__default.createElement(Text, { size: settings.sizes.pickerInput.body.mobile.header.titleSize, cx: css$I.title }, title),
|
|
2805
|
-
React__default.createElement(IconButton, { icon: ForwardRef$R, onClick: () =>
|
|
2804
|
+
React__default.createElement(IconButton, { icon: ForwardRef$R, onClick: () => props.close?.(), cx: css$I.close })));
|
|
2806
2805
|
};
|
|
2807
2806
|
const DataPickerHeader = /* @__PURE__ */React__default.memo(DataPickerHeaderImpl);
|
|
2808
2807
|
|
|
@@ -2821,7 +2820,7 @@ var SvgNotificationDoneFill = function SvgNotificationDoneFill(props, ref) {
|
|
|
2821
2820
|
};
|
|
2822
2821
|
var ForwardRef$s = /*#__PURE__*/forwardRef(SvgNotificationDoneFill);
|
|
2823
2822
|
|
|
2824
|
-
var css$H = {"uui-typography":"
|
|
2823
|
+
var css$H = {"uui-typography":"ABRSP8","uuiTypography":"ABRSP8","hero-header":"wRZybC","heroHeader":"wRZybC","promo-header":"asiE9V","promoHeader":"asiE9V","uui-critical":"AsmwAs","uuiCritical":"AsmwAs","uui-info":"-uBWvQ","uuiInfo":"-uBWvQ","uui-success":"_2kj7aE","uuiSuccess":"_2kj7aE","uui-warning":"bewLAK","uuiWarning":"bewLAK","uui-highlight":"IqY4-t","uuiHighlight":"IqY4-t","uui-typography-size-12":"KCX5pw","uuiTypographySize12":"KCX5pw","uui-typography-size-14":"mqV-mo","uuiTypographySize14":"mqV-mo","uui-typography-size-16":"UzBgBP","uuiTypographySize16":"UzBgBP","root":"_1G6IGo","align-widgets-top":"bIoXk-","alignWidgetsTop":"bIoXk-","align-widgets-center":"cBkJ7a","alignWidgetsCenter":"cBkJ7a","icon-container":"_8FqDvc","iconContainer":"_8FqDvc","loading-cell":"MsFp0B","loadingCell":"MsFp0B","content-wrapper":"_0qKHT-","contentWrapper":"_0qKHT-","render-item":"ZTQ4-q","renderItem":"ZTQ4-q","icon-wrapper":"JxtiW2","iconWrapper":"JxtiW2","icon-default":"llubGF","iconDefault":"llubGF","selected-mark":"_0YHkYX","selectedMark":"_0YHkYX"};
|
|
2825
2824
|
|
|
2826
2825
|
function DataPickerCell(props) {
|
|
2827
2826
|
const ref = React.useRef();
|
|
@@ -2854,11 +2853,11 @@ function DataPickerCell(props) {
|
|
|
2854
2853
|
], style: props.padding && {
|
|
2855
2854
|
'--uui-data_picker_cell-horizontal-padding': `${props.padding}px`,
|
|
2856
2855
|
} },
|
|
2857
|
-
React.createElement(DataRowAddons,
|
|
2856
|
+
React.createElement(DataRowAddons, { size: props.size, ...props, tabIndex: -1 }),
|
|
2858
2857
|
getWrappedContent()));
|
|
2859
2858
|
}
|
|
2860
2859
|
|
|
2861
|
-
var css$G = {"uui-typography":"
|
|
2860
|
+
var css$G = {"uui-typography":"_1nkYG0","uuiTypography":"_1nkYG0","hero-header":"dimCXO","heroHeader":"dimCXO","promo-header":"qyq6VH","promoHeader":"qyq6VH","uui-critical":"B8CkH4","uuiCritical":"B8CkH4","uui-info":"CoyrHT","uuiInfo":"CoyrHT","uui-success":"JPkeQW","uuiSuccess":"JPkeQW","uui-warning":"aDToIv","uuiWarning":"aDToIv","uui-highlight":"ofwnxv","uuiHighlight":"ofwnxv","uui-typography-size-12":"F8-r3S","uuiTypographySize12":"F8-r3S","uui-typography-size-14":"_3vbTHX","uuiTypographySize14":"_3vbTHX","uui-typography-size-16":"_6AdfbZ","uuiTypographySize16":"_6AdfbZ","picker-row":"vfEsYk","pickerRow":"vfEsYk"};
|
|
2862
2861
|
|
|
2863
2862
|
class DataPickerRow extends React.Component {
|
|
2864
2863
|
constructor() {
|
|
@@ -2868,20 +2867,20 @@ class DataPickerRow extends React.Component {
|
|
|
2868
2867
|
};
|
|
2869
2868
|
}
|
|
2870
2869
|
render() {
|
|
2871
|
-
return (React.createElement(DataPickerRow$1,
|
|
2870
|
+
return (React.createElement(DataPickerRow$1, { ...this.props, cx: [css$G.pickerRow, this.props.cx], renderContent: this.renderContent }));
|
|
2872
2871
|
}
|
|
2873
2872
|
}
|
|
2874
2873
|
|
|
2875
|
-
var css$F = {"uui-typography":"
|
|
2874
|
+
var css$F = {"uui-typography":"_9CDQzT","uuiTypography":"_9CDQzT","hero-header":"jMK-oa","heroHeader":"jMK-oa","promo-header":"hdyb-c","promoHeader":"hdyb-c","uui-critical":"rtAyKJ","uuiCritical":"rtAyKJ","uui-info":"rH6cmC","uuiInfo":"rH6cmC","uui-success":"Lz-pJ9","uuiSuccess":"Lz-pJ9","uui-warning":"YEj-aM","uuiWarning":"YEj-aM","uui-highlight":"_9p7pDl","uuiHighlight":"_9p7pDl","uui-typography-size-12":"jT2yqX","uuiTypographySize12":"jT2yqX","uui-typography-size-14":"qY5H4D","uuiTypographySize14":"qY5H4D","uui-typography-size-16":"sOWLqQ","uuiTypographySize16":"sOWLqQ","done":"s3y5zt","container":"pB1d1t"};
|
|
2876
2875
|
|
|
2877
2876
|
const PickerBodyMobileView = (props) => {
|
|
2878
2877
|
const isMobileView = isMobile();
|
|
2879
2878
|
const maxWidth = isMobileView ? 'auto' : props.maxWidth;
|
|
2880
2879
|
const maxHeight = isMobileView ? 'auto' : props.maxHeight;
|
|
2881
|
-
return (React__default.createElement(DropdownContainer,
|
|
2880
|
+
return (React__default.createElement(DropdownContainer, { ...props, maxWidth: maxWidth, maxHeight: maxHeight, cx: [css$F.container, props.cx], autoFocus: true },
|
|
2882
2881
|
isMobileView && React__default.createElement(DataPickerHeader, { title: props.title, close: props.onClose }),
|
|
2883
2882
|
props.children,
|
|
2884
|
-
isMobileView && React__default.createElement(LinkButton, { caption: i18n.pickerInput.doneButton, onClick: () =>
|
|
2883
|
+
isMobileView && React__default.createElement(LinkButton, { caption: i18n.pickerInput.doneButton, onClick: () => props.onClose?.(), cx: css$F.done, size: settings.sizes.pickerInput.body.mobile.footer.linkButton })));
|
|
2885
2884
|
};
|
|
2886
2885
|
|
|
2887
2886
|
var _path$r, _path2$4;
|
|
@@ -2906,20 +2905,20 @@ var SvgSearchWithBackground = function SvgSearchWithBackground(props, ref) {
|
|
|
2906
2905
|
};
|
|
2907
2906
|
var ForwardRef$r = /*#__PURE__*/forwardRef(SvgSearchWithBackground);
|
|
2908
2907
|
|
|
2909
|
-
var css$E = {"uui-typography":"
|
|
2908
|
+
var css$E = {"uui-typography":"g19Aaf","uuiTypography":"g19Aaf","hero-header":"MRSVr3","heroHeader":"MRSVr3","promo-header":"_5-cyyu","promoHeader":"_5-cyyu","uui-critical":"v3ZeyL","uuiCritical":"v3ZeyL","uui-info":"N0DO5V","uuiInfo":"N0DO5V","uui-success":"_0ISLjj","uuiSuccess":"_0ISLjj","uui-warning":"z7SJuL","uuiWarning":"z7SJuL","uui-highlight":"swu-iL","uuiHighlight":"swu-iL","uui-typography-size-12":"_22dH7X","uuiTypographySize12":"_22dH7X","uui-typography-size-14":"rnaj4I","uuiTypographySize14":"rnaj4I","uui-typography-size-16":"_8ojcMS","uuiTypographySize16":"_8ojcMS","sub-header-wrapper":"AtSLRH","subHeaderWrapper":"AtSLRH","switch":"uhMYYA","no-found-modal-container":"KO0IAv","noFoundModalContainer":"KO0IAv","no-found-modal-container-icon":"nDcD5x","noFoundModalContainerIcon":"nDcD5x","no-found-modal-container-text":"_2jZsix","noFoundModalContainerText":"_2jZsix"};
|
|
2910
2909
|
|
|
2911
2910
|
const mergeHighlightRanges = (ranges) => {
|
|
2912
2911
|
const mergedRanges = [];
|
|
2913
2912
|
ranges.forEach((range) => {
|
|
2914
2913
|
if (!mergedRanges.length) {
|
|
2915
|
-
mergedRanges.push(
|
|
2914
|
+
mergedRanges.push({ ...range, isHighlighted: true });
|
|
2916
2915
|
}
|
|
2917
2916
|
const lastRange = mergedRanges[mergedRanges.length - 1];
|
|
2918
2917
|
if (range.from >= lastRange.from && range.from <= lastRange.to && range.to > lastRange.to) {
|
|
2919
2918
|
lastRange.to = range.to;
|
|
2920
2919
|
}
|
|
2921
2920
|
if (lastRange.to < range.from) {
|
|
2922
|
-
mergedRanges.push(
|
|
2921
|
+
mergedRanges.push({ ...range, isHighlighted: true });
|
|
2923
2922
|
}
|
|
2924
2923
|
});
|
|
2925
2924
|
return mergedRanges;
|
|
@@ -2960,7 +2959,7 @@ const getHighlightRanges = (str, search) => {
|
|
|
2960
2959
|
};
|
|
2961
2960
|
const getDecoratedText = (str, ranges) => ranges.map((range, index) => {
|
|
2962
2961
|
const rangeStr = str.substring(range.from, range.to);
|
|
2963
|
-
return (React__default.createElement("span",
|
|
2962
|
+
return (React__default.createElement("span", { key: `${rangeStr}-${index}`, ...(range.isHighlighted ? { className: 'uui-highlight' } : {}) }, rangeStr));
|
|
2964
2963
|
});
|
|
2965
2964
|
const getHighlightedSearchMatches = (str, search) => {
|
|
2966
2965
|
if (!search || !str) {
|
|
@@ -2973,14 +2972,13 @@ const getHighlightedSearchMatches = (str, search) => {
|
|
|
2973
2972
|
return getDecoratedText(str, ranges);
|
|
2974
2973
|
};
|
|
2975
2974
|
|
|
2976
|
-
var css$D = {"root":"
|
|
2975
|
+
var css$D = {"root":"xn0B4y","column-gap":"tkXQjV","columnGap":"tkXQjV","multiline":"TLoOEr","text":"hhdFZN"};
|
|
2977
2976
|
|
|
2978
2977
|
function PickerItem(props) {
|
|
2979
|
-
var _a;
|
|
2980
2978
|
const { highlightSearchMatches = true, size, avatarUrl, isLoading, isDisabled, icon, cx, } = props;
|
|
2981
2979
|
const itemSize = size || settings.sizes.pickerInput.body.dropdown.row.cell.item.default;
|
|
2982
2980
|
const isMultiline = !!(props.title && props.subtitle);
|
|
2983
|
-
const { search } =
|
|
2981
|
+
const { search } = props.dataSourceState ?? {};
|
|
2984
2982
|
const title = highlightSearchMatches ? getHighlightedSearchMatches(props.title, search) : props.title;
|
|
2985
2983
|
const subtitle = highlightSearchMatches ? getHighlightedSearchMatches(props.subtitle, search) : props.subtitle;
|
|
2986
2984
|
return (React.createElement(FlexCell, { width: "auto", cx: [css$D.root, 'uui-typography', cx] },
|
|
@@ -3007,10 +3005,10 @@ function PickerModal(props) {
|
|
|
3007
3005
|
};
|
|
3008
3006
|
const renderItem = (item, rowProps, dsState) => {
|
|
3009
3007
|
const { flattenSearchResults } = view.getConfig();
|
|
3010
|
-
return (React__default.createElement(PickerItem,
|
|
3008
|
+
return (React__default.createElement(PickerItem, { title: getName(item), size: "36", dataSourceState: dsState, ...(flattenSearchResults ? { subtitle: getSubtitle(rowProps, dataSourceState) } : {}), ...rowProps }));
|
|
3011
3009
|
};
|
|
3012
3010
|
const renderRow = (rowProps) => {
|
|
3013
|
-
return props.renderRow ? (props.renderRow(rowProps, dataSourceState)) : (React__default.createElement(DataPickerRow,
|
|
3011
|
+
return props.renderRow ? (props.renderRow(rowProps, dataSourceState)) : (React__default.createElement(DataPickerRow, { ...rowProps, key: rowProps.rowKey, padding: "24", size: "36", renderItem: (item, itemProps) => renderItem(item, itemProps, dataSourceState) }));
|
|
3014
3012
|
};
|
|
3015
3013
|
const renderFooter = () => {
|
|
3016
3014
|
const hasSelection = view.getSelectedRowsCount() > 0;
|
|
@@ -3030,40 +3028,44 @@ function PickerModal(props) {
|
|
|
3030
3028
|
};
|
|
3031
3029
|
const dataRows = getRows();
|
|
3032
3030
|
const rows = dataRows.map((row) => renderRow(row));
|
|
3033
|
-
return (React__default.createElement(ModalBlocker,
|
|
3031
|
+
return (React__default.createElement(ModalBlocker, { ...props },
|
|
3034
3032
|
React__default.createElement(ModalWindow, { width: 600, height: 700 },
|
|
3035
3033
|
React__default.createElement(ModalHeader, { title: props.caption || i18n.pickerModal.headerTitle, onClose: () => props.abort() }),
|
|
3036
3034
|
React__default.createElement(FlexCell, { cx: css$E.subHeaderWrapper },
|
|
3037
3035
|
React__default.createElement(FlexRow, { vPadding: "24" },
|
|
3038
|
-
React__default.createElement(SearchInput,
|
|
3036
|
+
React__default.createElement(SearchInput, { ...dataSourceStateLens.prop('search').toProps(), onKeyDown: (e) => handleDataSourceKeyboard({
|
|
3039
3037
|
value: getDataSourceState(),
|
|
3040
3038
|
onValueChange: handleDataSourceValueChange,
|
|
3041
3039
|
listView: view,
|
|
3042
3040
|
rows: dataRows,
|
|
3043
3041
|
searchPosition: 'body',
|
|
3044
|
-
}, e), autoFocus: true, placeholder: i18n.pickerModal.searchPlaceholder, rawProps: { dir: 'auto' } }))
|
|
3045
|
-
!isSingleSelect() && (React__default.createElement(Switch,
|
|
3042
|
+
}, e), autoFocus: true, placeholder: i18n.pickerModal.searchPlaceholder, rawProps: { dir: 'auto' } })),
|
|
3043
|
+
!isSingleSelect() && (React__default.createElement(Switch, { cx: css$E.switch, size: "18", ...getFooterProps().showSelected, isDisabled: view.getSelectedRowsCount() < 1, label: "Show only selected" })),
|
|
3046
3044
|
props.renderFilter && React__default.createElement(FlexCell, { grow: 2 }, props.renderFilter(dataSourceStateLens.prop('filter').toProps()))),
|
|
3047
|
-
React__default.createElement(DataPickerBody,
|
|
3045
|
+
React__default.createElement(DataPickerBody, { ...getListProps(), value: getDataSourceState(), onValueChange: handleDataSourceValueChange, search: dataSourceStateLens.prop('search').toProps(), showSearch: false, rows: rows, renderNotFound: renderNotFound, editMode: "modal" }),
|
|
3048
3046
|
React__default.createElement(ModalFooter, { padding: "24", vPadding: "24" }, props.renderFooter ? props.renderFooter(getFooterProps()) : renderFooter()))));
|
|
3049
3047
|
}
|
|
3050
3048
|
|
|
3051
|
-
var css$C = {"tooltip":"
|
|
3049
|
+
var css$C = {"tooltip":"oeiAeF"};
|
|
3052
3050
|
|
|
3053
3051
|
const PickerTogglerTag = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
3054
|
-
|
|
3055
|
-
|
|
3052
|
+
const tagProps = {
|
|
3053
|
+
...props,
|
|
3054
|
+
tabIndex: -1,
|
|
3055
|
+
size: settings.sizes.pickerInput.toggler.tag[props.size],
|
|
3056
|
+
caption: props.rowProps?.isLoading ? React.createElement(TextPlaceholder, null) : props.caption,
|
|
3057
|
+
};
|
|
3056
3058
|
if (props.isCollapsed) {
|
|
3057
3059
|
const collapsedRows = props.collapsedRows.map((row) => props.getName(row.value)).join(', ');
|
|
3058
3060
|
return (React.createElement(Tooltip, { key: "selected", content: collapsedRows, closeDelay: 150, closeOnMouseLeave: "boundary", cx: css$C.tooltip },
|
|
3059
|
-
React.createElement(Tag,
|
|
3061
|
+
React.createElement(Tag, { ref: ref, rawProps: { role: 'option' }, ...tagProps })));
|
|
3060
3062
|
}
|
|
3061
3063
|
else {
|
|
3062
|
-
return React.createElement(Tag,
|
|
3064
|
+
return React.createElement(Tag, { ref: ref, rawProps: { role: 'option' }, ...tagProps });
|
|
3063
3065
|
}
|
|
3064
3066
|
});
|
|
3065
3067
|
|
|
3066
|
-
var css$B = {"uui-typography":"
|
|
3068
|
+
var css$B = {"uui-typography":"_61h-lG","uuiTypography":"_61h-lG","hero-header":"QjuHFI","heroHeader":"QjuHFI","promo-header":"usIHqQ","promoHeader":"usIHqQ","uui-critical":"_1LrhgT","uuiCritical":"_1LrhgT","uui-info":"ZPA-7Y","uuiInfo":"ZPA-7Y","uui-success":"WDM4jS","uuiSuccess":"WDM4jS","uui-warning":"nDtAw1","uuiWarning":"nDtAw1","uui-highlight":"T6a-7R","uuiHighlight":"T6a-7R","uui-typography-size-12":"pCKbJ8","uuiTypographySize12":"pCKbJ8","uui-typography-size-14":"BpN-lv","uuiTypographySize14":"BpN-lv","uui-typography-size-16":"-Wsuxg","uuiTypographySize16":"-Wsuxg","root":"u3iEav","mode-form":"DO4phm","modeForm":"DO4phm","mode-cell":"_8I-T6N","modeCell":"_8I-T6N","mode-inline":"_0dGFxs","modeInline":"_0dGFxs"};
|
|
3067
3069
|
|
|
3068
3070
|
const defaultMode = EditMode.FORM;
|
|
3069
3071
|
function applyPickerTogglerMods(mods) {
|
|
@@ -3076,28 +3078,27 @@ function applyPickerTogglerMods(mods) {
|
|
|
3076
3078
|
}
|
|
3077
3079
|
function PickerTogglerComponent(props, ref) {
|
|
3078
3080
|
const renderItem = (itemProps) => {
|
|
3079
|
-
const itemPropsWithSize =
|
|
3081
|
+
const itemPropsWithSize = { ...itemProps, size: (props.size || settings.sizes.pickerInput.toggler.defaults.tag) };
|
|
3080
3082
|
if (!!props.renderItem) {
|
|
3081
3083
|
return props.renderItem(itemPropsWithSize);
|
|
3082
3084
|
}
|
|
3083
|
-
return (React.createElement(PickerTogglerTag,
|
|
3085
|
+
return (React.createElement(PickerTogglerTag, { ...itemPropsWithSize, getName: props.getName }));
|
|
3084
3086
|
};
|
|
3085
|
-
return (React.createElement(PickerToggler$1,
|
|
3087
|
+
return (React.createElement(PickerToggler$1, { ...props, ref: ref, cx: [applyPickerTogglerMods(props), props.cx], renderItem: renderItem, getName: props.getName, cancelIcon: systemIcons.clear, dropdownIcon: systemIcons.foldingArrow }));
|
|
3086
3088
|
}
|
|
3087
3089
|
const PickerToggler = /* @__PURE__ */React.forwardRef(PickerTogglerComponent);
|
|
3088
3090
|
|
|
3089
|
-
function PickerInputComponent(
|
|
3090
|
-
var { highlightSearchMatches = true } = _a, props = __rest(_a, ["highlightSearchMatches"]);
|
|
3091
|
+
function PickerInputComponent({ highlightSearchMatches = true, ...props }, ref) {
|
|
3091
3092
|
const toggleModalOpening = () => {
|
|
3092
|
-
const { renderFooter, rawProps
|
|
3093
|
+
const { renderFooter, rawProps, ...restProps } = props;
|
|
3093
3094
|
context.uuiModals
|
|
3094
|
-
.show((modalProps) => (React__default.createElement(PickerModal,
|
|
3095
|
+
.show((modalProps) => (React__default.createElement(PickerModal, { ...restProps, rawProps: rawProps?.body, ...modalProps, caption: getPlaceholder(), initialValue: props.value, renderRow: renderRow, selectionMode: props.selectionMode, valueType: props.valueType })))
|
|
3095
3096
|
.then((newSelection) => {
|
|
3096
3097
|
handleSelectionValueChange(newSelection);
|
|
3097
3098
|
})
|
|
3098
3099
|
.catch(() => { });
|
|
3099
3100
|
};
|
|
3100
|
-
const { view, context, popperModifiers, getName, getPlaceholder, handleSelectionValueChange, getTogglerProps, getRows, handleTogglerSearchChange, toggleBodyOpening, dataSourceState, getFooterProps, getPickerBodyProps, getListProps, shouldShowBody, getSearchPosition, closePickerBody, openPickerBody, handlePickerInputKeyboard, } = usePickerInput(
|
|
3101
|
+
const { view, context, popperModifiers, getName, getPlaceholder, handleSelectionValueChange, getTogglerProps, getRows, handleTogglerSearchChange, toggleBodyOpening, dataSourceState, getFooterProps, getPickerBodyProps, getListProps, shouldShowBody, getSearchPosition, closePickerBody, openPickerBody, handlePickerInputKeyboard, } = usePickerInput({ ...props, toggleModalOpening });
|
|
3101
3102
|
const dropdownRef = useRef(null);
|
|
3102
3103
|
useImperativeHandle(ref, () => {
|
|
3103
3104
|
if (dropdownRef.current) {
|
|
@@ -3113,12 +3114,17 @@ function PickerInputComponent(_a, ref) {
|
|
|
3113
3114
|
};
|
|
3114
3115
|
};
|
|
3115
3116
|
const renderTarget = (targetProps) => {
|
|
3116
|
-
const renderTargetFn = props.renderToggler || ((props) => React__default.createElement(PickerToggler,
|
|
3117
|
-
return (React__default.createElement(IEditableDebouncer, { value: targetProps.value, onValueChange: handleTogglerSearchChange, debounceDelay: props.searchDebounceDelay, render: (editableProps) => renderTargetFn(
|
|
3117
|
+
const renderTargetFn = props.renderToggler || ((props) => React__default.createElement(PickerToggler, { ...props }));
|
|
3118
|
+
return (React__default.createElement(IEditableDebouncer, { value: targetProps.value, onValueChange: handleTogglerSearchChange, debounceDelay: props.searchDebounceDelay, render: (editableProps) => renderTargetFn({
|
|
3119
|
+
...getTogglerMods(),
|
|
3120
|
+
...targetProps,
|
|
3121
|
+
...editableProps,
|
|
3122
|
+
onKeyDown: (e) => handlePickerInputKeyboard(rows, e, editableProps.value),
|
|
3123
|
+
}) }));
|
|
3118
3124
|
};
|
|
3119
3125
|
const renderFooter = () => {
|
|
3120
3126
|
const footerProps = getFooterProps();
|
|
3121
|
-
return props.renderFooter ? props.renderFooter(footerProps) : React__default.createElement(DataPickerFooter,
|
|
3127
|
+
return props.renderFooter ? props.renderFooter(footerProps) : React__default.createElement(DataPickerFooter, { ...footerProps, size: props.size });
|
|
3122
3128
|
};
|
|
3123
3129
|
const getRowSize = () => {
|
|
3124
3130
|
if (isMobile()) {
|
|
@@ -3138,32 +3144,31 @@ function PickerInputComponent(_a, ref) {
|
|
|
3138
3144
|
};
|
|
3139
3145
|
const renderRowItem = (item, rowProps, dsState) => {
|
|
3140
3146
|
const { flattenSearchResults } = view.getConfig();
|
|
3141
|
-
return (React__default.createElement(PickerItem,
|
|
3147
|
+
return (React__default.createElement(PickerItem, { title: getName(item), size: getRowSize(), dataSourceState: dsState, highlightSearchMatches: highlightSearchMatches, ...(flattenSearchResults ? { subtitle: getSubtitle(rowProps, dataSourceState) } : {}), ...rowProps }));
|
|
3142
3148
|
};
|
|
3143
3149
|
const renderRow = (rowProps, dsState) => {
|
|
3144
|
-
return props.renderRow ? (props.renderRow(rowProps, dsState)) : (React__default.createElement(DataPickerRow,
|
|
3150
|
+
return props.renderRow ? (props.renderRow(rowProps, dsState)) : (React__default.createElement(DataPickerRow, { ...rowProps, key: rowProps.rowKey, size: getRowSize(), padding: (props.editMode === 'modal' ? settings.sizes.pickerInput.body.modal.padding : settings.sizes.pickerInput.body.dropdown.padding), renderItem: (item, itemProps) => renderRowItem(item, itemProps, dsState) }));
|
|
3145
3151
|
};
|
|
3146
3152
|
const renderBody = (bodyProps, rows) => {
|
|
3147
3153
|
const renderedDataRows = rows.map((row) => renderRow(row, dataSourceState));
|
|
3148
3154
|
const bodyHeight = isMobile() ? document.documentElement.clientHeight : props.dropdownHeight || settings.sizes.pickerInput.body.dropdown.height;
|
|
3149
3155
|
const minBodyWidth = props.minBodyWidth || settings.sizes.pickerInput.body.dropdown.width;
|
|
3150
3156
|
return (React__default.createElement(PickerBodyMobileView, { title: props.entityName, onClose: () => toggleBodyOpening(false), cx: [props.bodyCx], onKeyDown: bodyProps.onKeyDown, width: bodyProps.togglerWidth > minBodyWidth ? bodyProps.togglerWidth : minBodyWidth, focusLock: getSearchPosition() === 'body' },
|
|
3151
|
-
React__default.createElement(DataPickerBody,
|
|
3157
|
+
React__default.createElement(DataPickerBody, { ...bodyProps, rows: renderedDataRows, maxHeight: bodyHeight, searchSize: props.size, editMode: "dropdown", selectionMode: props.selectionMode }),
|
|
3152
3158
|
renderFooter()));
|
|
3153
3159
|
};
|
|
3154
3160
|
const rows = getRows();
|
|
3155
3161
|
const renderItem = props.renderTag ? props.renderTag : null;
|
|
3156
3162
|
return (React__default.createElement(Dropdown, { renderTarget: (dropdownProps) => {
|
|
3157
3163
|
const targetProps = getTogglerProps();
|
|
3158
|
-
return renderTarget(
|
|
3159
|
-
}, renderBody: (bodyProps) => renderBody(
|
|
3164
|
+
return renderTarget({ ...dropdownProps, ...targetProps, renderItem });
|
|
3165
|
+
}, renderBody: (bodyProps) => renderBody({ ...bodyProps, ...getPickerBodyProps(rows), ...getListProps() }, rows), value: shouldShowBody(), onValueChange: !props.isDisabled && toggleBodyOpening, placement: props.dropdownPlacement, modifiers: popperModifiers, closeBodyOnTogglerHidden: !isMobile(), portalTarget: props.portalTarget, ref: dropdownRef }));
|
|
3160
3166
|
}
|
|
3161
3167
|
const PickerInput = /* @__PURE__ */React__default.forwardRef(PickerInputComponent);
|
|
3162
3168
|
|
|
3163
|
-
var css$A = {"row":"
|
|
3169
|
+
var css$A = {"row":"jF1NuQ"};
|
|
3164
3170
|
|
|
3165
3171
|
function PickerListItem(props) {
|
|
3166
|
-
var _a;
|
|
3167
3172
|
let label;
|
|
3168
3173
|
if (props.isLoading) {
|
|
3169
3174
|
label = React__default.createElement(TextPlaceholder, { wordsCount: 2 });
|
|
@@ -3173,31 +3178,31 @@ function PickerListItem(props) {
|
|
|
3173
3178
|
}
|
|
3174
3179
|
let component;
|
|
3175
3180
|
if (props.checkbox) {
|
|
3176
|
-
component = (React__default.createElement(Checkbox,
|
|
3181
|
+
component = (React__default.createElement(Checkbox, { ...props.checkbox, isDisabled: props.isLoading || props.checkbox.isDisabled || props.isDisabled, label: label, value: props.isChecked, onValueChange: () => props.onCheck(props) }));
|
|
3177
3182
|
}
|
|
3178
3183
|
else {
|
|
3179
3184
|
component = (React__default.createElement(RadioInput, { label: label, value: props.isSelected, isDisabled: props.isLoading || !props.isSelectable || props.isDisabled, onValueChange: () => props.onSelect(props) }));
|
|
3180
3185
|
}
|
|
3181
|
-
return (React__default.createElement("div",
|
|
3186
|
+
return (React__default.createElement("div", { role: "option", "aria-selected": props.isSelectable ? props.isSelected : undefined, "aria-busy": props.isLoading, "aria-posinset": props.index + 1, ...(props.checkbox?.isVisible && { 'aria-checked': props.isChecked }), className: css$A.row }, component));
|
|
3182
3187
|
}
|
|
3183
3188
|
|
|
3184
|
-
var css$z = {"root":"
|
|
3189
|
+
var css$z = {"root":"_6Zwmy-"};
|
|
3185
3190
|
|
|
3186
3191
|
function PickerList(props) {
|
|
3187
3192
|
const { context, view, onlySelectedView, getName, getEntityName, appendLastSelected, getSelectedIdsArray, buildRowsList, getMaxDefaultItems, dataSourceState, getModalTogglerCaption, } = usePickerList(props);
|
|
3188
3193
|
const defaultRenderRow = (row) => {
|
|
3189
|
-
return React__default.createElement(PickerListItem,
|
|
3194
|
+
return React__default.createElement(PickerListItem, { getName: (item) => getName(item), ...row, key: row.rowKey });
|
|
3190
3195
|
};
|
|
3191
3196
|
const handleShowPicker = () => {
|
|
3192
3197
|
context.uuiModals
|
|
3193
|
-
.show((modalProps) => (React__default.createElement(PickerModal,
|
|
3198
|
+
.show((modalProps) => (React__default.createElement(PickerModal, { ...modalProps, ...props, caption: props.placeholder || `Please select ${getEntityName() ? getEntityName() : ''}`, initialValue: props.value, selectionMode: props.selectionMode, valueType: props.valueType })))
|
|
3194
3199
|
.then((value) => {
|
|
3195
3200
|
appendLastSelected([...getSelectedIdsArray(value)]);
|
|
3196
3201
|
props.onValueChange(value);
|
|
3197
3202
|
})
|
|
3198
3203
|
.catch(() => { });
|
|
3199
3204
|
};
|
|
3200
|
-
const defaultRenderToggler = (props) => React__default.createElement(LinkButton,
|
|
3205
|
+
const defaultRenderToggler = (props) => React__default.createElement(LinkButton, { caption: "Show all", ...props });
|
|
3201
3206
|
const viewProps = view.getListProps();
|
|
3202
3207
|
const selectedRows = onlySelectedView.getVisibleRows();
|
|
3203
3208
|
const rows = buildRowsList();
|
|
@@ -3207,7 +3212,7 @@ function PickerList(props) {
|
|
|
3207
3212
|
return (React__default.createElement("div", { className: cx('uui-picker-list', css$z.root) },
|
|
3208
3213
|
!rows.length
|
|
3209
3214
|
&& (props.noOptionsMessage || (React__default.createElement(Text, { color: "secondary", size: props.size }, "No options available"))),
|
|
3210
|
-
rows.map((row) => renderRow(
|
|
3215
|
+
rows.map((row) => renderRow({ ...row, isDisabled: props.isDisabled }, dataSourceState)),
|
|
3211
3216
|
showPicker
|
|
3212
3217
|
&& renderToggler({
|
|
3213
3218
|
onClick: handleShowPicker,
|
|
@@ -3216,19 +3221,19 @@ function PickerList(props) {
|
|
|
3216
3221
|
}, selectedRows)));
|
|
3217
3222
|
}
|
|
3218
3223
|
|
|
3219
|
-
var css$y = {"uui-typography":"
|
|
3224
|
+
var css$y = {"uui-typography":"a6JNIj","uuiTypography":"a6JNIj","hero-header":"ZZBy0i","heroHeader":"ZZBy0i","promo-header":"atAVtU","promoHeader":"atAVtU","uui-critical":"QFudLM","uuiCritical":"QFudLM","uui-info":"DlH5L8","uuiInfo":"DlH5L8","uui-success":"PYeP89","uuiSuccess":"PYeP89","uui-warning":"kTbmsf","uuiWarning":"kTbmsf","uui-highlight":"_2IK4G7","uuiHighlight":"_2IK4G7","uui-typography-size-12":"wlzL-L","uuiTypographySize12":"wlzL-L","uui-typography-size-14":"CX18dp","uuiTypographySize14":"CX18dp","uui-typography-size-16":"JPl2ua","uuiTypographySize16":"JPl2ua","root":"vKPXcO","wrapper":"w9joLA","align-widgets-top":"_7HduvY","alignWidgetsTop":"_7HduvY","align-widgets-center":"AwP4aF","alignWidgetsCenter":"AwP4aF"};
|
|
3220
3225
|
|
|
3221
3226
|
function DataTableCell(initialProps) {
|
|
3222
|
-
const props =
|
|
3227
|
+
const props = { ...initialProps };
|
|
3223
3228
|
if (props.isFirstColumn) {
|
|
3224
|
-
props.addons = React.createElement(DataRowAddons,
|
|
3229
|
+
props.addons = React.createElement(DataRowAddons, { size: props.size, ...props });
|
|
3225
3230
|
}
|
|
3226
3231
|
props.renderPlaceholder = props.renderPlaceholder
|
|
3227
3232
|
|| (() => (React.createElement(Text, { key: "t", size: settings.sizes.dataTable.body.row.cell.text[props.size] },
|
|
3228
3233
|
React.createElement(TextPlaceholder, { isNotAnimated: true }))));
|
|
3229
3234
|
props.renderUnknown = props.renderUnknown
|
|
3230
3235
|
|| (() => (React.createElement(Text, { key: "t", size: settings.sizes.dataTable.body.row.cell.text[props.size] }, "Unknown")));
|
|
3231
|
-
props.renderTooltip = (tooltipProps) => React.createElement(Tooltip,
|
|
3236
|
+
props.renderTooltip = (tooltipProps) => React.createElement(Tooltip, { color: "critical", ...tooltipProps });
|
|
3232
3237
|
const isEditable = !!props.onValueChange;
|
|
3233
3238
|
const getLeftPadding = () => {
|
|
3234
3239
|
const { rowProps: { isLoading }, columnsGap, isFirstColumn } = props;
|
|
@@ -3262,18 +3267,18 @@ function DataTableCell(initialProps) {
|
|
|
3262
3267
|
'--uui-dt-cell-padding-start': `${getLeftPadding()}px`,
|
|
3263
3268
|
'--uui-dt-cell-padding-end': `${getRightPadding()}px`,
|
|
3264
3269
|
};
|
|
3265
|
-
return React.createElement(DataTableCell$1,
|
|
3270
|
+
return React.createElement(DataTableCell$1, { ...props });
|
|
3266
3271
|
}
|
|
3267
3272
|
|
|
3268
|
-
var css$x = {"uui-typography":"
|
|
3273
|
+
var css$x = {"uui-typography":"mzI6wR","uuiTypography":"mzI6wR","hero-header":"yX8Lag","heroHeader":"yX8Lag","promo-header":"qPAQ-B","promoHeader":"qPAQ-B","uui-critical":"Q2ztmy","uuiCritical":"Q2ztmy","uui-info":"rC4eUf","uuiInfo":"rC4eUf","uui-success":"YRTLXR","uuiSuccess":"YRTLXR","uui-warning":"Gxgxk0","uuiWarning":"Gxgxk0","uui-highlight":"_4fsWBg","uuiHighlight":"_4fsWBg","uui-typography-size-12":"hbBzqE","uuiTypographySize12":"hbBzqE","uui-typography-size-14":"_3A9T-D","uuiTypographySize14":"_3A9T-D","uui-typography-size-16":"_9exhAl","uuiTypographySize16":"_9exhAl","root":"K3uSqu"};
|
|
3269
3274
|
|
|
3270
3275
|
// Here we define a single instance of the renderCell function to make DataTableRow#shouldComponentUpdate work.
|
|
3271
3276
|
// As we need our mods to style the cell properly, we extract them from DataTableCellProps.rowProps, which is a hack, but it's reliable enough.
|
|
3272
3277
|
const renderCell = (props) => {
|
|
3273
3278
|
const mods = props.rowProps;
|
|
3274
|
-
return React.createElement(DataTableCell,
|
|
3279
|
+
return React.createElement(DataTableCell, { ...props, key: props.key, size: mods.size, columnsGap: mods.columnsGap });
|
|
3275
3280
|
};
|
|
3276
|
-
const renderDropMarkers = (props) => React.createElement(DropMarker,
|
|
3281
|
+
const renderDropMarkers = (props) => React.createElement(DropMarker, { ...props, enableBlocker: true });
|
|
3277
3282
|
const propsMods = { renderCell, renderDropMarkers };
|
|
3278
3283
|
const DataTableRow = /* @__PURE__ */withMods(DataTableRow$1, ({ borderBottom = true, size }) => {
|
|
3279
3284
|
return [
|
|
@@ -3281,7 +3286,7 @@ const DataTableRow = /* @__PURE__ */withMods(DataTableRow$1, ({ borderBottom = t
|
|
|
3281
3286
|
];
|
|
3282
3287
|
}, () => propsMods);
|
|
3283
3288
|
|
|
3284
|
-
var css$w = {"uui-typography":"
|
|
3289
|
+
var css$w = {"uui-typography":"_4iFPr4","uuiTypography":"_4iFPr4","hero-header":"JYXhhW","heroHeader":"JYXhhW","promo-header":"KQ4Blj","promoHeader":"KQ4Blj","uui-critical":"_5n5WWd","uuiCritical":"_5n5WWd","uui-info":"y4H3NR","uuiInfo":"y4H3NR","uui-success":"ho88Nc","uuiSuccess":"ho88Nc","uui-warning":"cFeEl8","uuiWarning":"cFeEl8","uui-highlight":"yVvK0A","uuiHighlight":"yVvK0A","uui-typography-size-12":"FZ-fs2","uuiTypographySize12":"FZ-fs2","uui-typography-size-14":"N8-jZu","uuiTypographySize14":"N8-jZu","uui-typography-size-16":"sra5UV","uuiTypographySize16":"sra5UV","sorting-panel-container":"_1EABRs","sortingPanelContainer":"_1EABRs"};
|
|
3285
3290
|
|
|
3286
3291
|
var _path$q;
|
|
3287
3292
|
function _extends$q() { return _extends$q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$q.apply(null, arguments); }
|
|
@@ -3411,7 +3416,7 @@ var SvgNavigationExpandAllOutline = function SvgNavigationExpandAllOutline(props
|
|
|
3411
3416
|
};
|
|
3412
3417
|
var ForwardRef$k = /*#__PURE__*/forwardRef(SvgNavigationExpandAllOutline);
|
|
3413
3418
|
|
|
3414
|
-
var css$v = {"uui-typography":"
|
|
3419
|
+
var css$v = {"uui-typography":"_21XfQY","uuiTypography":"_21XfQY","hero-header":"BRi-jX","heroHeader":"BRi-jX","promo-header":"zKmBJD","promoHeader":"zKmBJD","uui-critical":"RvVhOS","uuiCritical":"RvVhOS","uui-info":"yAPwo5","uuiInfo":"yAPwo5","uui-success":"OiLmjn","uuiSuccess":"OiLmjn","uui-warning":"_3QIjZ7","uuiWarning":"_3QIjZ7","uui-highlight":"_425xqK","uuiHighlight":"_425xqK","uui-typography-size-12":"cGQ5CJ","uuiTypographySize12":"cGQ5CJ","uui-typography-size-14":"O21yvw","uuiTypographySize14":"O21yvw","uui-typography-size-16":"NOsklh","uuiTypographySize16":"NOsklh","root":"zwUlOn","caption-wrapper":"YhIv3o","captionWrapper":"YhIv3o","sort-icon":"iem-b8","sortIcon":"iem-b8","dropdown-icon":"Fh5Euk","dropdownIcon":"Fh5Euk","infoIcon":"tMUXHs","resizable":"_8Nll-G","align-right":"v5CDlb","alignRight":"v5CDlb","align-center":"_0Zw-c8","alignCenter":"_0Zw-c8","caption":"_4cqmmN","truncate":"ppHOIR","checkbox":"UiLcKV","icon":"mYB1tY","fold-all-icon":"-HoBAF","foldAllIcon":"-HoBAF","cell-tooltip":"_8LG9NN","cellTooltip":"_8LG9NN","upper-case":"HrP98p","upperCase":"HrP98p","resizing-marker":"H4CLqN","resizingMarker":"H4CLqN","pinned-right":"Q5qWTE","pinnedRight":"Q5qWTE","draggable":"CZzUqz","ghost":"sdCpXo","is-dragged-out":"LqGzpo","isDraggedOut":"LqGzpo","dnd-marker-left":"jtLjQo","dndMarkerLeft":"jtLjQo","dnd-marker-right":"KyAQN8","dndMarkerRight":"KyAQN8","cell-tooltip-wrapper":"FGEqUV","cellTooltipWrapper":"FGEqUV","cell-tooltip-text":"YDMeQd","cellTooltipText":"YDMeQd","tooltip-caption":"jIm71m","tooltipCaption":"jIm71m","tooltip-info":"-cgNXl","tooltipInfo":"-cgNXl"};
|
|
3415
3420
|
|
|
3416
3421
|
class DataTableHeaderCell extends React.Component {
|
|
3417
3422
|
constructor() {
|
|
@@ -3439,7 +3444,7 @@ class DataTableHeaderCell extends React.Component {
|
|
|
3439
3444
|
};
|
|
3440
3445
|
this.renderHeaderCheckbox = () => {
|
|
3441
3446
|
if (this.props.selectAll && this.props.isFirstColumn) {
|
|
3442
|
-
return (React.createElement(Checkbox,
|
|
3447
|
+
return (React.createElement(Checkbox, { size: settings.sizes.dataTable.header.row.cell.checkbox[this.props.size], ...this.props.selectAll, cx: cx$1(css$v.checkbox, uuiDataTableHeaderCell.uuiTableHeaderCheckbox) }));
|
|
3443
3448
|
}
|
|
3444
3449
|
};
|
|
3445
3450
|
this.renderFoldAllIcon = () => {
|
|
@@ -3473,9 +3478,8 @@ class DataTableHeaderCell extends React.Component {
|
|
|
3473
3478
|
return columnsGap ? +columnsGap / 2 : settings.sizes.dataTable.header.row.cell.defaults.resizeMarker;
|
|
3474
3479
|
};
|
|
3475
3480
|
this.renderCellContent = (props, dropdownProps) => {
|
|
3476
|
-
|
|
3477
|
-
const
|
|
3478
|
-
const onClickEvent = !props.isResizing && (!this.props.column.renderFilter ? props.toggleSort : dropdownProps === null || dropdownProps === void 0 ? void 0 : dropdownProps.onClick);
|
|
3481
|
+
const isResizable = this.props.column.allowResizing ?? this.props.allowColumnsResizing;
|
|
3482
|
+
const onClickEvent = !props.isResizing && (!this.props.column.renderFilter ? props.toggleSort : dropdownProps?.onClick);
|
|
3479
3483
|
const computeStyles = {
|
|
3480
3484
|
'--uui-dt-header-cell-icon-size': `${settings.sizes.dataTable.header.row.cell.iconSize[this.props.size || settings.sizes.dataTable.header.row.cell.defaults.size]}px`,
|
|
3481
3485
|
'--uui-dt-header-cell-padding-start': `${this.getLeftPadding()}px`,
|
|
@@ -3483,10 +3487,13 @@ class DataTableHeaderCell extends React.Component {
|
|
|
3483
3487
|
'--uui-dt-header-cell-resizing-marker-width': `${this.getResizingMarkerWidth()}px`,
|
|
3484
3488
|
};
|
|
3485
3489
|
return (React.createElement(DataTableCellContainer, { column: this.props.column, ref: (ref) => {
|
|
3486
|
-
var _a;
|
|
3487
3490
|
props.ref(ref);
|
|
3488
|
-
|
|
3489
|
-
}, cx: cx$1(uuiDataTableHeaderCell.uuiTableHeaderCell, (this.props.column.isSortable || this.props.isDropdown) && uuiMarkers.clickable, css$v.root, `uui-size-${this.props.size || settings.sizes.dataTable.header.row.cell.defaults.size}`, this.props.isFirstColumn && 'uui-dt-header-first-column', this.props.isLastColumn && 'uui-dt-header-last-column', this.props.column.fix && css$v['pinned-' + this.props.column.fix], isResizable && css$v.resizable, props.isDraggable && css$v.draggable, props.isDragGhost && css$v.ghost, props.isDraggedOut && css$v.isDraggedOut, props.isDndInProgress && css$v['dnd-marker-' + props.position]), onClick: onClickEvent, rawProps:
|
|
3491
|
+
dropdownProps?.ref?.(ref);
|
|
3492
|
+
}, cx: cx$1(uuiDataTableHeaderCell.uuiTableHeaderCell, (this.props.column.isSortable || this.props.isDropdown) && uuiMarkers.clickable, css$v.root, `uui-size-${this.props.size || settings.sizes.dataTable.header.row.cell.defaults.size}`, this.props.isFirstColumn && 'uui-dt-header-first-column', this.props.isLastColumn && 'uui-dt-header-last-column', this.props.column.fix && css$v['pinned-' + this.props.column.fix], isResizable && css$v.resizable, props.isDraggable && css$v.draggable, props.isDragGhost && css$v.ghost, props.isDraggedOut && css$v.isDraggedOut, props.isDndInProgress && css$v['dnd-marker-' + props.position]), onClick: onClickEvent, rawProps: {
|
|
3493
|
+
role: 'columnheader',
|
|
3494
|
+
'aria-sort': this.props.sortDirection === 'asc' ? 'ascending' : this.props.sortDirection ? 'descending' : 'none',
|
|
3495
|
+
...props.eventHandlers,
|
|
3496
|
+
}, style: computeStyles },
|
|
3490
3497
|
this.renderHeaderCheckbox(),
|
|
3491
3498
|
this.renderFoldAllIcon(),
|
|
3492
3499
|
this.getColumnCaption(),
|
|
@@ -3498,7 +3505,7 @@ class DataTableHeaderCell extends React.Component {
|
|
|
3498
3505
|
if (this.props.column.renderHeaderCell) {
|
|
3499
3506
|
return this.props.column.renderHeaderCell(this.props);
|
|
3500
3507
|
}
|
|
3501
|
-
return (React.createElement(DataTableHeaderCell$1,
|
|
3508
|
+
return (React.createElement(DataTableHeaderCell$1, { ...this.props, renderCellContent: this.props.column.renderFilter ? this.renderCellWithFilter : this.renderCellContent }));
|
|
3502
3509
|
}
|
|
3503
3510
|
}
|
|
3504
3511
|
|
|
@@ -3517,9 +3524,9 @@ var SvgActionSettingsFill = function SvgActionSettingsFill(props, ref) {
|
|
|
3517
3524
|
};
|
|
3518
3525
|
var ForwardRef$j = /*#__PURE__*/forwardRef(SvgActionSettingsFill);
|
|
3519
3526
|
|
|
3520
|
-
var css$u = {"uui-typography":"
|
|
3527
|
+
var css$u = {"uui-typography":"MFsB3e","uuiTypography":"MFsB3e","hero-header":"TSC2bI","heroHeader":"TSC2bI","promo-header":"uORLhC","promoHeader":"uORLhC","uui-critical":"d-N7AT","uuiCritical":"d-N7AT","uui-info":"IzNorL","uuiInfo":"IzNorL","uui-success":"Fb-Zr1","uuiSuccess":"Fb-Zr1","uui-warning":"QJimvB","uuiWarning":"QJimvB","uui-highlight":"vxbRed","uuiHighlight":"vxbRed","uui-typography-size-12":"KRMN2u","uuiTypographySize12":"KRMN2u","uui-typography-size-14":"DPyrb-","uuiTypographySize14":"DPyrb-","uui-typography-size-16":"vIlT-c","uuiTypographySize16":"vIlT-c","root":"lfaot6"};
|
|
3521
3528
|
|
|
3522
|
-
var css$t = {"uui-typography":"
|
|
3529
|
+
var css$t = {"uui-typography":"JW01Xq","uuiTypography":"JW01Xq","hero-header":"mj0zrx","heroHeader":"mj0zrx","promo-header":"_03vzNU","promoHeader":"_03vzNU","uui-critical":"OG-ZWJ","uuiCritical":"OG-ZWJ","uui-info":"oEYqhR","uuiInfo":"oEYqhR","uui-success":"Kdt98F","uuiSuccess":"Kdt98F","uui-warning":"_7HKxLi","uuiWarning":"_7HKxLi","uui-highlight":"ZoRWZA","uuiHighlight":"ZoRWZA","uui-typography-size-12":"XYkKpa","uuiTypographySize12":"XYkKpa","uui-typography-size-14":"fdJ6JY","uuiTypographySize14":"fdJ6JY","uui-typography-size-16":"nmxA58","uuiTypographySize16":"nmxA58","root":"CNR9Zt","caption-wrapper":"_380w5T","captionWrapper":"_380w5T","align-center":"lj76LJ","alignCenter":"lj76LJ","caption":"_6IjNY3","truncate":"_0cPStP","group-cell-tooltip":"Z7SQvc","groupCellTooltip":"Z7SQvc","upper-case":"QlGSpH","upperCase":"QlGSpH","group-cell-tooltip-wrapper":"f14w42","groupCellTooltipWrapper":"f14w42","group-cell-tooltip-text":"_7gcF6-","groupCellTooltipText":"_7gcF6-","tooltip-caption":"cfvDIt","tooltipCaption":"cfvDIt","tooltip-info":"l5d9Fa","tooltipInfo":"l5d9Fa"};
|
|
3523
3530
|
|
|
3524
3531
|
class DataTableHeaderGroupCell extends React.Component {
|
|
3525
3532
|
constructor() {
|
|
@@ -3558,7 +3565,10 @@ class DataTableHeaderGroupCell extends React.Component {
|
|
|
3558
3565
|
};
|
|
3559
3566
|
return (React.createElement(DataTableCellContainer, { column: this.props.group, ref: (ref) => {
|
|
3560
3567
|
props.ref(ref);
|
|
3561
|
-
}, cx: cx$1(uuiDataTableHeaderGroupCell.uuiTableHeaderGroupCell, css$t.root, `uui-size-${this.props.size || settings.sizes.dataTable.header.row.groupCell.defaults.size}`, this.props.isFirstCell && 'uui-dt-header-first-column', this.props.isLastCell && 'uui-dt-header-last-column'), rawProps:
|
|
3568
|
+
}, cx: cx$1(uuiDataTableHeaderGroupCell.uuiTableHeaderGroupCell, css$t.root, `uui-size-${this.props.size || settings.sizes.dataTable.header.row.groupCell.defaults.size}`, this.props.isFirstCell && 'uui-dt-header-first-column', this.props.isLastCell && 'uui-dt-header-last-column'), rawProps: {
|
|
3569
|
+
role: 'columnheader',
|
|
3570
|
+
...props.eventHandlers,
|
|
3571
|
+
}, style: computeStyles }, this.getColumnCaption()));
|
|
3562
3572
|
};
|
|
3563
3573
|
}
|
|
3564
3574
|
render() {
|
|
@@ -3574,8 +3584,8 @@ class DataTableHeaderGroupCell extends React.Component {
|
|
|
3574
3584
|
}
|
|
3575
3585
|
|
|
3576
3586
|
const DataTableHeaderRow = /* @__PURE__ */withMods(DataTableHeaderRow$1, () => [css$u.root, 'uui-dt-vars'], (mods) => ({
|
|
3577
|
-
renderCell: (props) => (React.createElement(DataTableHeaderCell,
|
|
3578
|
-
renderGroupCell: (props) => (React.createElement(DataTableHeaderGroupCell,
|
|
3587
|
+
renderCell: (props) => (React.createElement(DataTableHeaderCell, { ...props, size: mods.size, textCase: mods.textCase || 'normal', key: props.column.key, columnsGap: mods.columnsGap })),
|
|
3588
|
+
renderGroupCell: (props) => (React.createElement(DataTableHeaderGroupCell, { ...props, size: mods.size, textCase: mods.textCase || 'normal', key: props.key, columnsGap: mods.columnsGap })),
|
|
3579
3589
|
renderConfigButton: () => (React.createElement(IconButton, { key: "configuration", onClick: mods.onConfigButtonClick, cx: ['config-icon', `uui-size-${settings.sizes.dataTable.header.row.cell.iconSize[mods.size || settings.sizes.dataTable.header.row.default]}`], color: "neutral", icon: ForwardRef$j })),
|
|
3580
3590
|
}));
|
|
3581
3591
|
|
|
@@ -3584,16 +3594,15 @@ const UUI_FILTERS_PANEL_ADD_BUTTON_BODY = 'uui-filters-panel-add-button-body';
|
|
|
3584
3594
|
const UUI_FILTERS_PANEL_ITEM_BODY = 'uui-filters-panel-item-body';
|
|
3585
3595
|
const UUI_FILTERS_PANEL_ITEM_TOGGLER = 'uui-filters-panel-item-toggler';
|
|
3586
3596
|
|
|
3587
|
-
var css$s = {"uui-typography":"
|
|
3597
|
+
var css$s = {"uui-typography":"X6MzLT","uuiTypography":"X6MzLT","hero-header":"rcsq--","heroHeader":"rcsq--","promo-header":"-Q753K","promoHeader":"-Q753K","uui-critical":"SYsk9T","uuiCritical":"SYsk9T","uui-info":"ThFMpJ","uuiInfo":"ThFMpJ","uui-success":"GOXlfv","uuiSuccess":"GOXlfv","uui-warning":"knJDW4","uuiWarning":"knJDW4","uui-highlight":"fVYgMv","uuiHighlight":"fVYgMv","uui-typography-size-12":"Ksi-lU","uuiTypographySize12":"Ksi-lU","uui-typography-size-14":"Lfgohn","uuiTypographySize14":"Lfgohn","uui-typography-size-16":"LUr0uH","uuiTypographySize16":"LUr0uH","root":"lq2-jO","title-wrapper":"_8jrXXQ","titleWrapper":"_8jrXXQ","title":"-Xbe5H","text-wrapper":"RhaHkf","textWrapper":"RhaHkf","selection":"ZJ30bO","postfix":"CR2td5","selected":"_7U8TBU"};
|
|
3588
3598
|
|
|
3589
3599
|
const defaultSize = '36';
|
|
3590
3600
|
const FilterPanelItemToggler = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
3591
3601
|
const togglerPickerOpened = (e) => {
|
|
3592
|
-
var _a;
|
|
3593
3602
|
if (props.isDisabled)
|
|
3594
3603
|
return;
|
|
3595
3604
|
e.preventDefault();
|
|
3596
|
-
|
|
3605
|
+
props.onClick?.();
|
|
3597
3606
|
};
|
|
3598
3607
|
const onKeyDownHandler = (e) => {
|
|
3599
3608
|
if (props.isDisabled)
|
|
@@ -3611,12 +3620,12 @@ const FilterPanelItemToggler = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
3611
3620
|
const getSelectionText = () => props.selection.map((i, index) => (React.createElement(React.Fragment, { key: `${i}${index}` },
|
|
3612
3621
|
React.createElement(Text, { color: "primary", size: props.size, cx: css$s.selection }, i),
|
|
3613
3622
|
(props.postfix || index !== props.selection.length - 1) && React.createElement("span", null, ",\u00A0"))));
|
|
3614
|
-
return (React.createElement(FlexRow$1,
|
|
3623
|
+
return (React.createElement(FlexRow$1, { ...props, rawProps: {
|
|
3615
3624
|
style: { maxWidth: `${props.maxWidth ? props.maxWidth + 'px' : 'auto'}` },
|
|
3616
3625
|
role: 'button',
|
|
3617
3626
|
tabIndex: props.isDisabled ? -1 : 0,
|
|
3618
3627
|
onKeyDown: onKeyDownHandler,
|
|
3619
|
-
}, cx: cx(UUI_FILTERS_PANEL_ITEM_TOGGLER, css$s.root, uuiElement.inputBox, uuiMarkers.clickable, props.isOpen && uuiMod.opened, `size-${props.size || defaultSize}`, props.cx), onClick: togglerPickerOpened, ref: ref }
|
|
3628
|
+
}, cx: cx(UUI_FILTERS_PANEL_ITEM_TOGGLER, css$s.root, uuiElement.inputBox, uuiMarkers.clickable, props.isOpen && uuiMod.opened, `uui-size-${props.size || defaultSize}`, props.cx), onClick: togglerPickerOpened, ref: ref },
|
|
3620
3629
|
React.createElement(FlexRow$1, { cx: css$s.titleWrapper },
|
|
3621
3630
|
React.createElement(Text, { size: props.size, cx: css$s.title }, getTitle),
|
|
3622
3631
|
props.selection && (React.createElement("div", { className: css$s.textWrapper },
|
|
@@ -3626,12 +3635,10 @@ const FilterPanelItemToggler = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
3626
3635
|
});
|
|
3627
3636
|
|
|
3628
3637
|
const pickerHeight = 300;
|
|
3629
|
-
function FilterPickerBody(
|
|
3630
|
-
|
|
3631
|
-
var { highlightSearchMatches = true } = _a, restProps = __rest(_a, ["highlightSearchMatches"]);
|
|
3632
|
-
const props = Object.assign(Object.assign({}, restProps), { highlightSearchMatches });
|
|
3638
|
+
function FilterPickerBody({ highlightSearchMatches = true, ...restProps }) {
|
|
3639
|
+
const props = { ...restProps, highlightSearchMatches };
|
|
3633
3640
|
const shouldShowBody = () => props.isOpen;
|
|
3634
|
-
const { view, getName, isSingleSelect, getRows, dataSourceState, getFooterProps, getPickerBodyProps, getListProps, handleDataSourceValueChange, } = usePickerInput(
|
|
3641
|
+
const { view, getName, isSingleSelect, getRows, dataSourceState, getFooterProps, getPickerBodyProps, getListProps, handleDataSourceValueChange, } = usePickerInput({ ...props, shouldShowBody });
|
|
3635
3642
|
const prevValue = usePrevious(props.value);
|
|
3636
3643
|
const prevOpened = usePrevious(props.isOpen);
|
|
3637
3644
|
React.useLayoutEffect(() => {
|
|
@@ -3651,45 +3658,44 @@ function FilterPickerBody(_a) {
|
|
|
3651
3658
|
};
|
|
3652
3659
|
const renderItem = (item, rowProps, dsState) => {
|
|
3653
3660
|
const { flattenSearchResults } = view.getConfig();
|
|
3654
|
-
return (React.createElement(PickerItem,
|
|
3661
|
+
return (React.createElement(PickerItem, { title: getName(item), highlightSearchMatches: highlightSearchMatches, ...(flattenSearchResults ? { subtitle: getSubtitle(rowProps, dsState) } : {}), dataSourceState: dsState, size: settings.sizes.filtersPanel.pickerInput.body.default, ...rowProps }));
|
|
3655
3662
|
};
|
|
3656
3663
|
const onSelect = (row) => {
|
|
3657
|
-
handleDataSourceValueChange((currentDataSourceState) => (
|
|
3664
|
+
handleDataSourceValueChange((currentDataSourceState) => ({ ...currentDataSourceState, search: '', selectedId: row.id }));
|
|
3658
3665
|
};
|
|
3659
3666
|
const renderRow = (rowProps, dsState) => {
|
|
3660
3667
|
if (rowProps.isSelectable && isSingleSelect() && props.editMode !== 'modal') {
|
|
3661
3668
|
rowProps.onSelect = onSelect;
|
|
3662
3669
|
}
|
|
3663
|
-
return props.renderRow ? (props.renderRow(rowProps, dataSourceState)) : (React.createElement(DataPickerRow,
|
|
3670
|
+
return props.renderRow ? (props.renderRow(rowProps, dataSourceState)) : (React.createElement(DataPickerRow, { ...rowProps, key: rowProps.rowKey, size: settings.sizes.filtersPanel.pickerInput.body.default, padding: "12", renderItem: (item, itemProps) => renderItem(item, itemProps, dsState) }));
|
|
3664
3671
|
};
|
|
3665
3672
|
const renderFooter = () => {
|
|
3666
|
-
|
|
3673
|
+
const footerProps = getFooterProps();
|
|
3674
|
+
return props.renderFooter ? props.renderFooter(footerProps) : React.createElement(DataPickerFooter, { ...footerProps, size: settings.sizes.filtersPanel.pickerInput.body.default });
|
|
3667
3675
|
};
|
|
3668
3676
|
const renderBody = (bodyProps, rows) => {
|
|
3669
3677
|
const renderedDataRows = rows.map((props) => renderRow(props, dataSourceState));
|
|
3670
3678
|
const maxHeight = isMobile() ? document.documentElement.clientHeight : props.maxBodyHeight || pickerHeight;
|
|
3671
3679
|
const maxWidth = isMobile() ? undefined : 360;
|
|
3672
3680
|
return (React.createElement(React.Fragment, null,
|
|
3673
|
-
React.createElement(DataPickerBody,
|
|
3681
|
+
React.createElement(DataPickerBody, { ...bodyProps, selectionMode: props.selectionMode, rows: renderedDataRows, maxHeight: maxHeight, maxWidth: maxWidth, searchSize: settings.sizes.filtersPanel.pickerInput.body.default, editMode: "dropdown" }),
|
|
3674
3682
|
renderFooter()));
|
|
3675
3683
|
};
|
|
3676
3684
|
const rows = getRows();
|
|
3677
|
-
return renderBody(
|
|
3685
|
+
return renderBody({ ...getPickerBodyProps(rows), ...getListProps(), showSearch: props.showSearch ?? true }, rows);
|
|
3678
3686
|
}
|
|
3679
3687
|
|
|
3680
3688
|
function FilterDatePickerBody(props) {
|
|
3681
|
-
var _a;
|
|
3682
3689
|
const { value } = props;
|
|
3683
3690
|
const context = useUuiContext();
|
|
3684
3691
|
const handleValueChange = (newValue) => {
|
|
3685
|
-
var _a;
|
|
3686
3692
|
props.onValueChange(newValue);
|
|
3687
3693
|
if (props.getValueChangeAnalyticsEvent) {
|
|
3688
3694
|
const event = props.getValueChangeAnalyticsEvent(newValue, value);
|
|
3689
3695
|
context.uuiAnalytics.sendEvent(event);
|
|
3690
3696
|
}
|
|
3691
3697
|
if (newValue) {
|
|
3692
|
-
|
|
3698
|
+
props.onClose?.();
|
|
3693
3699
|
}
|
|
3694
3700
|
};
|
|
3695
3701
|
const handleBodyChange = (newValue) => {
|
|
@@ -3699,7 +3705,7 @@ function FilterDatePickerBody(props) {
|
|
|
3699
3705
|
};
|
|
3700
3706
|
return (React__default.createElement(Fragment, null,
|
|
3701
3707
|
React__default.createElement(FlexRow, { borderBottom: true },
|
|
3702
|
-
React__default.createElement(DatePickerBody, { filter: props.filter, value: value, onValueChange: handleBodyChange, renderDay: props.renderDay, isHoliday: props.isHoliday, rawProps:
|
|
3708
|
+
React__default.createElement(DatePickerBody, { filter: props.filter, value: value, onValueChange: handleBodyChange, renderDay: props.renderDay, isHoliday: props.isHoliday, rawProps: props.rawProps?.body })),
|
|
3703
3709
|
React__default.createElement(FlexCell, { alignSelf: "stretch" },
|
|
3704
3710
|
React__default.createElement(FlexRow, { padding: "24", vPadding: "12" },
|
|
3705
3711
|
React__default.createElement(Text, null, value ? uuiDayjs.dayjs(value).format('MMM DD, YYYY') : ''),
|
|
@@ -3714,16 +3720,15 @@ function FilterRangeDatePickerBody(props) {
|
|
|
3714
3720
|
const value = _value || defaultRangeValue; // also handles null in comparison to default value
|
|
3715
3721
|
const context = useUuiContext();
|
|
3716
3722
|
const onOpenChange = (newIsOpen) => {
|
|
3717
|
-
var _a, _b;
|
|
3718
3723
|
{
|
|
3719
|
-
|
|
3724
|
+
props.onClose?.();
|
|
3720
3725
|
}
|
|
3721
|
-
|
|
3726
|
+
props.onOpenChange?.(newIsOpen);
|
|
3722
3727
|
};
|
|
3723
3728
|
const [inFocus, setInFocus] = useState('from');
|
|
3724
3729
|
const onValueChange = (newValue) => {
|
|
3725
|
-
const fromChanged =
|
|
3726
|
-
const toChanged =
|
|
3730
|
+
const fromChanged = value?.from !== newValue?.from;
|
|
3731
|
+
const toChanged = value?.to !== newValue?.to;
|
|
3727
3732
|
if (fromChanged || toChanged) {
|
|
3728
3733
|
props.onValueChange(newValue);
|
|
3729
3734
|
if (props.getValueChangeAnalyticsEvent) {
|
|
@@ -3733,8 +3738,7 @@ function FilterRangeDatePickerBody(props) {
|
|
|
3733
3738
|
}
|
|
3734
3739
|
};
|
|
3735
3740
|
const onBodyValueChange = (newValue) => {
|
|
3736
|
-
|
|
3737
|
-
setInFocus((_a = newValue.inFocus) !== null && _a !== void 0 ? _a : inFocus);
|
|
3741
|
+
setInFocus(newValue.inFocus ?? inFocus);
|
|
3738
3742
|
onValueChange(newValue.selectedDate);
|
|
3739
3743
|
const toChanged = value.to !== newValue.selectedDate.to;
|
|
3740
3744
|
const closeBody = newValue.selectedDate.from && newValue.selectedDate.to
|
|
@@ -3762,30 +3766,28 @@ function FilterRangeDatePickerBody(props) {
|
|
|
3762
3766
|
React__default.createElement(LinkButton, { isDisabled: !value.from && !value.to, caption: i18n.pickerModal.clearAllButton, onClick: () => onValueChange(defaultRangeValue) })))));
|
|
3763
3767
|
}
|
|
3764
3768
|
|
|
3765
|
-
var css$r = {"container":"
|
|
3769
|
+
var css$r = {"container":"_9CqI-K"};
|
|
3766
3770
|
|
|
3767
3771
|
function FilterNumericBody(props) {
|
|
3768
|
-
|
|
3769
|
-
const isInRangePredicate = (props === null || props === void 0 ? void 0 : props.selectedPredicate) === 'inRange' || (props === null || props === void 0 ? void 0 : props.selectedPredicate) === 'notInRange';
|
|
3772
|
+
const isInRangePredicate = props?.selectedPredicate === 'inRange' || props?.selectedPredicate === 'notInRange';
|
|
3770
3773
|
const isWrongRange = (from, to) => {
|
|
3771
3774
|
if (!to && to !== 0)
|
|
3772
3775
|
return false;
|
|
3773
3776
|
return from > to;
|
|
3774
3777
|
};
|
|
3775
3778
|
const rangeValueHandler = (type) => (val) => {
|
|
3776
|
-
var _a, _b;
|
|
3777
3779
|
const value = props.value;
|
|
3778
3780
|
switch (type) {
|
|
3779
3781
|
case 'from': {
|
|
3780
3782
|
props.onValueChange({
|
|
3781
3783
|
from: val,
|
|
3782
|
-
to:
|
|
3784
|
+
to: value?.to ?? null,
|
|
3783
3785
|
});
|
|
3784
3786
|
break;
|
|
3785
3787
|
}
|
|
3786
3788
|
case 'to': {
|
|
3787
3789
|
props.onValueChange({
|
|
3788
|
-
from:
|
|
3790
|
+
from: value?.from ?? null,
|
|
3789
3791
|
to: val,
|
|
3790
3792
|
});
|
|
3791
3793
|
break;
|
|
@@ -3816,30 +3818,30 @@ function FilterNumericBody(props) {
|
|
|
3816
3818
|
return (React__default.createElement("div", null,
|
|
3817
3819
|
React__default.createElement(FlexRow, { padding: "12", alignItems: "center", spacing: "12", borderBottom: true, cx: css$r.container },
|
|
3818
3820
|
React__default.createElement(FlexCell, { width: "100%" },
|
|
3819
|
-
React__default.createElement(NumericInput, { value:
|
|
3821
|
+
React__default.createElement(NumericInput, { value: value?.from ?? null, onValueChange: rangeValueHandler('from'), placeholder: "Min", formatOptions: { maximumFractionDigits: 2 } })),
|
|
3820
3822
|
React__default.createElement(FlexCell, { width: "100%" },
|
|
3821
|
-
React__default.createElement(NumericInput, { value:
|
|
3823
|
+
React__default.createElement(NumericInput, { value: value?.to ?? null, onValueChange: rangeValueHandler('to'), placeholder: "Max", formatOptions: { maximumFractionDigits: 2 }, isInvalid: isWrongRange(value?.from, value?.to) }))),
|
|
3822
3824
|
renderFooter()));
|
|
3823
3825
|
}
|
|
3824
3826
|
return (React__default.createElement("div", null,
|
|
3825
3827
|
React__default.createElement(FlexRow, { padding: "12", alignItems: "center", borderBottom: true, cx: css$r.container },
|
|
3826
3828
|
React__default.createElement(FlexCell, { width: 130 },
|
|
3827
|
-
React__default.createElement(NumericInput, { value: typeof props.value === 'number' ? props.value : null, onValueChange: props.onValueChange,
|
|
3829
|
+
React__default.createElement(NumericInput, { value: typeof props.value === 'number' ? props.value : null, onValueChange: props.onValueChange, placeholder: "Enter a number", formatOptions: { maximumFractionDigits: 2 } }))),
|
|
3828
3830
|
renderFooter()));
|
|
3829
3831
|
}
|
|
3830
3832
|
|
|
3831
3833
|
function FilterItemBody(props) {
|
|
3832
3834
|
switch (props.type) {
|
|
3833
3835
|
case 'singlePicker':
|
|
3834
|
-
return React__default.createElement(FilterPickerBody,
|
|
3836
|
+
return React__default.createElement(FilterPickerBody, { ...props, selectionMode: "single", valueType: "id" });
|
|
3835
3837
|
case 'numeric':
|
|
3836
|
-
return React__default.createElement(FilterNumericBody,
|
|
3838
|
+
return React__default.createElement(FilterNumericBody, { ...props });
|
|
3837
3839
|
case 'multiPicker':
|
|
3838
|
-
return React__default.createElement(FilterPickerBody,
|
|
3840
|
+
return React__default.createElement(FilterPickerBody, { ...props, selectionMode: "multi", valueType: "id" });
|
|
3839
3841
|
case 'datePicker':
|
|
3840
|
-
return React__default.createElement(FilterDatePickerBody,
|
|
3842
|
+
return React__default.createElement(FilterDatePickerBody, { ...props, format: props.format || 'DD/MM/YYYY' });
|
|
3841
3843
|
case 'rangeDatePicker':
|
|
3842
|
-
return React__default.createElement(FilterRangeDatePickerBody,
|
|
3844
|
+
return React__default.createElement(FilterRangeDatePickerBody, { ...props, format: props.format || 'DD/MM/YYYY', value: props.value || { from: null, to: null } });
|
|
3843
3845
|
case 'custom':
|
|
3844
3846
|
return props.render(props);
|
|
3845
3847
|
}
|
|
@@ -3860,7 +3862,7 @@ var SvgActionDeleteOutline = function SvgActionDeleteOutline(props, ref) {
|
|
|
3860
3862
|
};
|
|
3861
3863
|
var ForwardRef$i = /*#__PURE__*/forwardRef(SvgActionDeleteOutline);
|
|
3862
3864
|
|
|
3863
|
-
var css$q = {"uui-typography":"
|
|
3865
|
+
var css$q = {"uui-typography":"YW50B4","uuiTypography":"YW50B4","hero-header":"fRkN0X","heroHeader":"fRkN0X","promo-header":"uDWlk5","promoHeader":"uDWlk5","uui-critical":"dgWam0","uuiCritical":"dgWam0","uui-info":"GwnWr5","uuiInfo":"GwnWr5","uui-success":"V14vZQ","uuiSuccess":"V14vZQ","uui-warning":"_2QeDQw","uuiWarning":"_2QeDQw","uui-highlight":"_5jlXDM","uuiHighlight":"_5jlXDM","uui-typography-size-12":"Vvdr02","uuiTypographySize12":"Vvdr02","uui-typography-size-14":"UsrvAY","uuiTypographySize14":"UsrvAY","uui-typography-size-16":"aTq-mv","uuiTypographySize16":"aTq-mv","header":"J4Li8l","removeButton":"_-3WpJT","with-search":"UdYSMf","withSearch":"UdYSMf"};
|
|
3864
3866
|
|
|
3865
3867
|
function useView(props, value) {
|
|
3866
3868
|
const forceUpdate = useForceUpdate();
|
|
@@ -3875,11 +3877,11 @@ function useView(props, value) {
|
|
|
3875
3877
|
dataSourceState.checked = value;
|
|
3876
3878
|
}
|
|
3877
3879
|
}
|
|
3878
|
-
return useViewFn
|
|
3880
|
+
return useViewFn?.(dataSourceState, forceUpdate, { showSelectedOnly: true });
|
|
3879
3881
|
}
|
|
3880
3882
|
function FiltersToolbarItemImpl(props) {
|
|
3881
3883
|
const { maxCount = 2 } = props;
|
|
3882
|
-
const isPickersType =
|
|
3884
|
+
const isPickersType = props?.type === 'multiPicker' || props?.type === 'singlePicker';
|
|
3883
3885
|
const isMobileScreen = isMobile();
|
|
3884
3886
|
const popperModifiers = useMemo(() => {
|
|
3885
3887
|
const modifiers = [
|
|
@@ -3902,11 +3904,10 @@ function FiltersToolbarItemImpl(props) {
|
|
|
3902
3904
|
return modifiers;
|
|
3903
3905
|
}, [isPickersType]);
|
|
3904
3906
|
const getDefaultPredicate = () => {
|
|
3905
|
-
var _a, _b;
|
|
3906
3907
|
if (!props.predicates) {
|
|
3907
3908
|
return null;
|
|
3908
3909
|
}
|
|
3909
|
-
return Object.keys(props.value || {})[0] ||
|
|
3910
|
+
return Object.keys(props.value || {})[0] || props.predicates.find((i) => i.isDefault)?.predicate || props.predicates?.[0].predicate;
|
|
3910
3911
|
};
|
|
3911
3912
|
const [isOpen, isOpenChange] = useState(props.autoFocus);
|
|
3912
3913
|
const [predicate, setPredicate] = useState(getDefaultPredicate());
|
|
@@ -3948,23 +3949,19 @@ function FiltersToolbarItemImpl(props) {
|
|
|
3948
3949
|
}
|
|
3949
3950
|
setPredicate(val);
|
|
3950
3951
|
};
|
|
3951
|
-
const renderHeader = (hideTitle) => {
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
props.predicates ? (React__default.createElement(MultiSwitch, { items: props.predicates.map((i) => ({ id: i.predicate, caption: i.name })), value: predicate, onValueChange: changePredicate, size: "24" })) : (!hideTitle && (React__default.createElement(Text, { color: "secondary", size: "24", fontSize: "14" }, props.title))),
|
|
3955
|
-
!(props === null || props === void 0 ? void 0 : props.isAlwaysVisible) && (React__default.createElement(LinkButton, { cx: css$q.removeButton, caption: i18n.filterToolbar.datePicker.removeCaption, onClick: removeOnclickHandler, size: "24", icon: ForwardRef$i }))));
|
|
3956
|
-
};
|
|
3952
|
+
const renderHeader = (hideTitle) => (React__default.createElement("div", { className: cx(css$q.header, isPickersType && (props.showSearch ?? css$q.withSearch)) },
|
|
3953
|
+
props.predicates ? (React__default.createElement(MultiSwitch, { items: props.predicates.map((i) => ({ id: i.predicate, caption: i.name })), value: predicate, onValueChange: changePredicate, size: "24" })) : (!hideTitle && (React__default.createElement(Text, { color: "secondary", size: "24", fontSize: "14" }, props.title))),
|
|
3954
|
+
!props?.isAlwaysVisible && (React__default.createElement(LinkButton, { cx: css$q.removeButton, caption: i18n.filterToolbar.datePicker.removeCaption, onClick: removeOnclickHandler, size: "24", icon: ForwardRef$i }))));
|
|
3957
3955
|
const renderBody = (dropdownProps) => {
|
|
3958
3956
|
const hideHeaderTitle = isPickersType && isMobileScreen;
|
|
3959
|
-
return isPickersType ? (React__default.createElement(PickerBodyMobileView,
|
|
3957
|
+
return isPickersType ? (React__default.createElement(PickerBodyMobileView, { ...dropdownProps, cx: UUI_FILTERS_PANEL_ITEM_BODY, title: props.title, width: 360, onClose: () => isOpenChange(false) },
|
|
3960
3958
|
renderHeader(hideHeaderTitle),
|
|
3961
|
-
React__default.createElement(FilterItemBody,
|
|
3959
|
+
React__default.createElement(FilterItemBody, { ...props, ...dropdownProps, selectedPredicate: predicate, value: getValue(), onValueChange: onValueChange }))) : (React__default.createElement(DropdownContainer, { cx: UUI_FILTERS_PANEL_ITEM_BODY, ...dropdownProps },
|
|
3962
3960
|
renderHeader(hideHeaderTitle),
|
|
3963
|
-
React__default.createElement(FilterItemBody,
|
|
3961
|
+
React__default.createElement(FilterItemBody, { ...props, ...dropdownProps, selectedPredicate: predicate, value: getValue(), onValueChange: onValueChange })));
|
|
3964
3962
|
};
|
|
3965
3963
|
const getValue = () => {
|
|
3966
|
-
|
|
3967
|
-
return predicate ? (_a = props.value) === null || _a === void 0 ? void 0 : _a[predicate] : props.value;
|
|
3964
|
+
return predicate ? props.value?.[predicate] : props.value;
|
|
3968
3965
|
};
|
|
3969
3966
|
const getPickerItemName = (item, config) => {
|
|
3970
3967
|
if (item.isLoading) {
|
|
@@ -3983,13 +3980,13 @@ function FiltersToolbarItemImpl(props) {
|
|
|
3983
3980
|
case 'multiPicker': {
|
|
3984
3981
|
let isLoading = false;
|
|
3985
3982
|
const selection = currentValue
|
|
3986
|
-
? currentValue
|
|
3983
|
+
? currentValue?.slice(0, maxCount).map((i) => {
|
|
3987
3984
|
const item = view.getById(i, null);
|
|
3988
|
-
isLoading = item
|
|
3985
|
+
isLoading = item?.isLoading;
|
|
3989
3986
|
return getPickerItemName(item, props);
|
|
3990
3987
|
})
|
|
3991
3988
|
: currentValue;
|
|
3992
|
-
const postfix = (!isLoading &&
|
|
3989
|
+
const postfix = (!isLoading && currentValue?.length > maxCount) ? ` +${(currentValue.length - maxCount).toString()} ${i18n.filterToolbar.pickerInput.itemsPlaceholder}` : null;
|
|
3993
3990
|
return { selection, postfix };
|
|
3994
3991
|
}
|
|
3995
3992
|
case 'numeric': {
|
|
@@ -3999,7 +3996,7 @@ function FiltersToolbarItemImpl(props) {
|
|
|
3999
3996
|
return { selection: undefined };
|
|
4000
3997
|
}
|
|
4001
3998
|
const selection = isRangePredicate
|
|
4002
|
-
? `${!
|
|
3999
|
+
? `${!currentValue?.from && currentValue?.from !== 0 ? 'Min' : decimalFormat(currentValue?.from)} - ${!currentValue?.to && currentValue?.to !== 0 ? 'Max' : decimalFormat(currentValue?.to)}`
|
|
4003
4000
|
: `${!currentValue && currentValue !== 0 ? 'ALL' : decimalFormat(currentValue)}`;
|
|
4004
4001
|
return { selection: [selection] };
|
|
4005
4002
|
}
|
|
@@ -4018,11 +4015,11 @@ function FiltersToolbarItemImpl(props) {
|
|
|
4018
4015
|
if (!currentValue || (!currentValue.from && !currentValue.to)) {
|
|
4019
4016
|
return { selection: undefined };
|
|
4020
4017
|
}
|
|
4021
|
-
const currentValueFrom =
|
|
4022
|
-
? uuiDayjs.dayjs(currentValue
|
|
4018
|
+
const currentValueFrom = currentValue?.from
|
|
4019
|
+
? uuiDayjs.dayjs(currentValue?.from).format(props.format || defaultFormat)
|
|
4023
4020
|
: i18n.filterToolbar.rangeDatePicker.emptyPlaceholderFrom;
|
|
4024
|
-
const currentValueTo =
|
|
4025
|
-
? uuiDayjs.dayjs(currentValue
|
|
4021
|
+
const currentValueTo = currentValue?.to
|
|
4022
|
+
? uuiDayjs.dayjs(currentValue?.to).format(props.format || defaultFormat)
|
|
4026
4023
|
: i18n.filterToolbar.rangeDatePicker.emptyPlaceholderTo;
|
|
4027
4024
|
const selection = `${currentValueFrom} - ${currentValueTo}`;
|
|
4028
4025
|
return { selection: [selection] };
|
|
@@ -4038,7 +4035,7 @@ function FiltersToolbarItemImpl(props) {
|
|
|
4038
4035
|
return props.togglerWidth;
|
|
4039
4036
|
return props.type === 'datePicker' || props.type === 'rangeDatePicker' ? null : 300;
|
|
4040
4037
|
};
|
|
4041
|
-
const renderTarget = (dropdownProps) => (React__default.createElement(FilterPanelItemToggler,
|
|
4038
|
+
const renderTarget = (dropdownProps) => (React__default.createElement(FilterPanelItemToggler, { ...dropdownProps, ...getTogglerValue(), title: props.title, predicateName: props.value ? predicateName : null, maxWidth: getTogglerWidth(), size: props.size }));
|
|
4042
4039
|
return (React__default.createElement(Dropdown$1, { renderTarget: renderTarget, renderBody: renderBody, closeBodyOnTogglerHidden: !isMobile(), value: isOpen, onValueChange: isOpenChange, modifiers: popperModifiers }));
|
|
4043
4040
|
}
|
|
4044
4041
|
const FiltersPanelItem = /* @__PURE__ */React__default.memo(FiltersToolbarItemImpl);
|
|
@@ -4097,7 +4094,7 @@ const normalizeFilterWithPredicates = (filter) => {
|
|
|
4097
4094
|
return result;
|
|
4098
4095
|
};
|
|
4099
4096
|
function FiltersToolbarImpl(props) {
|
|
4100
|
-
const { filters, tableState, setTableState } = props;
|
|
4097
|
+
const { filters, tableState, setTableState, size = settings.sizes.defaults.filtersPanel } = props;
|
|
4101
4098
|
const [newFilterId, setNewFilterId] = useState(null);
|
|
4102
4099
|
const pickerInputRef = useRef(null);
|
|
4103
4100
|
const dataSource = useArrayDataSource({
|
|
@@ -4105,15 +4102,13 @@ function FiltersToolbarImpl(props) {
|
|
|
4105
4102
|
getId: (item) => item.field,
|
|
4106
4103
|
}, []);
|
|
4107
4104
|
const onFiltersChange = (updatedFilters) => {
|
|
4108
|
-
var _a, _b;
|
|
4109
4105
|
const newConfig = {};
|
|
4110
4106
|
const newFilter = {};
|
|
4111
|
-
const filtersConfig = Object.values(
|
|
4107
|
+
const filtersConfig = Object.values(tableState.filtersConfig ?? {});
|
|
4112
4108
|
const sortedOrders = orderBy(filtersConfig, ({ order }) => order);
|
|
4113
|
-
let lastItemOrder =
|
|
4109
|
+
let lastItemOrder = sortedOrders?.length ? sortedOrders[sortedOrders.length - 1]?.order : null;
|
|
4114
4110
|
updatedFilters.forEach((filter) => {
|
|
4115
|
-
|
|
4116
|
-
let order = (_b = (_a = tableState === null || tableState === void 0 ? void 0 : tableState.filtersConfig) === null || _a === void 0 ? void 0 : _a[filter === null || filter === void 0 ? void 0 : filter.field]) === null || _b === void 0 ? void 0 : _b.order;
|
|
4111
|
+
let order = tableState?.filtersConfig?.[filter?.field]?.order;
|
|
4117
4112
|
if (!order) {
|
|
4118
4113
|
order = getOrderBetween(lastItemOrder, null);
|
|
4119
4114
|
lastItemOrder = order;
|
|
@@ -4124,31 +4119,42 @@ function FiltersToolbarImpl(props) {
|
|
|
4124
4119
|
newFilter[filter.field] = tableState.filter[filter.field];
|
|
4125
4120
|
}
|
|
4126
4121
|
});
|
|
4127
|
-
setTableState(
|
|
4122
|
+
setTableState({
|
|
4123
|
+
...tableState,
|
|
4124
|
+
filtersConfig: newConfig,
|
|
4125
|
+
filter: newFilter,
|
|
4126
|
+
});
|
|
4128
4127
|
};
|
|
4129
4128
|
const handleFilterChange = (newFilter) => {
|
|
4130
|
-
const filter = normalizeFilterWithPredicates(
|
|
4131
|
-
setTableState(
|
|
4129
|
+
const filter = normalizeFilterWithPredicates({ ...tableState.filter, ...newFilter });
|
|
4130
|
+
setTableState({
|
|
4131
|
+
...tableState,
|
|
4132
|
+
filter: filter,
|
|
4133
|
+
});
|
|
4132
4134
|
};
|
|
4133
4135
|
const removeFilter = (field) => {
|
|
4134
|
-
const filterConfig =
|
|
4136
|
+
const filterConfig = { ...tableState.filtersConfig };
|
|
4135
4137
|
delete filterConfig[field];
|
|
4136
|
-
const filter =
|
|
4138
|
+
const filter = { ...tableState.filter };
|
|
4137
4139
|
delete filter[field];
|
|
4138
|
-
const newTableState =
|
|
4139
|
-
|
|
4140
|
+
const newTableState = {
|
|
4141
|
+
...tableState,
|
|
4142
|
+
filtersConfig: filterConfig,
|
|
4143
|
+
filter: filter,
|
|
4144
|
+
};
|
|
4145
|
+
setTableState({ ...newTableState });
|
|
4140
4146
|
};
|
|
4141
4147
|
const selectedFilters = useMemo(() => {
|
|
4142
4148
|
const filtersConfig = tableState.filtersConfig || {};
|
|
4143
4149
|
return filters.filter((filter) => {
|
|
4144
|
-
return filter.isAlwaysVisible || (filtersConfig[filter
|
|
4150
|
+
return filter.isAlwaysVisible || (filtersConfig[filter?.field] ? filtersConfig[filter?.field].isVisible : false);
|
|
4145
4151
|
});
|
|
4146
4152
|
}, [tableState.filtersConfig, filters]);
|
|
4147
4153
|
const sortedActiveFilters = useMemo(() => {
|
|
4148
|
-
return orderBy(selectedFilters, (f) =>
|
|
4154
|
+
return orderBy(selectedFilters, (f) => tableState.filtersConfig?.[f.field]?.order);
|
|
4149
4155
|
}, [filters, tableState.filtersConfig]);
|
|
4150
4156
|
const renderAddFilterToggler = useCallback((togglerProps) => {
|
|
4151
|
-
return (React__default.createElement(Button, { size:
|
|
4157
|
+
return (React__default.createElement(Button, { size: size, onClick: togglerProps.onClick, ref: togglerProps.ref, caption: i18n.filterToolbar.addCaption, icon: ForwardRef$h, iconPosition: "left", fill: "ghost", color: "primary", cx: UUI_FILTERS_PANEL_ADD_BUTTON }));
|
|
4152
4158
|
}, []);
|
|
4153
4159
|
const getRowOptions = useCallback((item) => ({
|
|
4154
4160
|
isDisabled: item.isAlwaysVisible,
|
|
@@ -4159,29 +4165,25 @@ function FiltersToolbarImpl(props) {
|
|
|
4159
4165
|
}), []);
|
|
4160
4166
|
const isAllFiltersAlwaysVisible = props.filters.every((i) => i.isAlwaysVisible);
|
|
4161
4167
|
useEffect(() => {
|
|
4162
|
-
var _a, _b;
|
|
4163
4168
|
if (sortedActiveFilters.length && newFilterId && sortedActiveFilters.find(({ field }) => field === newFilterId)) {
|
|
4164
4169
|
// PickerInput should be closed after filterId update and opening the filter's body.
|
|
4165
4170
|
// Otherwise, the focus will be not set in the search input of the filter's body.
|
|
4166
|
-
|
|
4171
|
+
pickerInputRef.current?.closePickerBody?.();
|
|
4167
4172
|
// Reset new filter id, after first render with autofocus
|
|
4168
4173
|
setNewFilterId(null);
|
|
4169
4174
|
}
|
|
4170
4175
|
}, [newFilterId, sortedActiveFilters]);
|
|
4171
4176
|
return (React__default.createElement(React__default.Fragment, null,
|
|
4172
|
-
sortedActiveFilters.map((f) => {
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
React__default.createElement(FiltersPanelItem, Object.assign({}, f, { value: (_a = tableState.filter) === null || _a === void 0 ? void 0 : _a[f.field], onValueChange: handleFilterChange, key: f.field, autoFocus: newFilterId === f.field, removeFilter: removeFilter, size: props.size }))));
|
|
4176
|
-
}),
|
|
4177
|
-
!isAllFiltersAlwaysVisible && (React__default.createElement(PickerInput, { dataSource: dataSource, value: selectedFilters, onValueChange: onFiltersChange, selectionMode: "multi", valueType: "entity", renderRow: (props) => (React__default.createElement(DataPickerRow, Object.assign({}, props, { padding: "12", key: props.key, onCheck: (row) => {
|
|
4177
|
+
sortedActiveFilters.map((f) => (React__default.createElement(FlexCell$1, { width: "auto", key: f.field },
|
|
4178
|
+
React__default.createElement(FiltersPanelItem, { ...f, value: tableState.filter?.[f.field], onValueChange: handleFilterChange, key: f.field, autoFocus: newFilterId === f.field, removeFilter: removeFilter, size: size })))),
|
|
4179
|
+
!isAllFiltersAlwaysVisible && (React__default.createElement(PickerInput, { dataSource: dataSource, value: selectedFilters, onValueChange: onFiltersChange, selectionMode: "multi", valueType: "entity", renderRow: (props) => (React__default.createElement(DataPickerRow, { ...props, padding: "12", key: props.key, onCheck: (row) => {
|
|
4178
4180
|
props.onCheck && props.onCheck(row);
|
|
4179
4181
|
setNewFilterId(row.value.field);
|
|
4180
|
-
}, renderItem: (item, rowProps) => React__default.createElement(PickerItem,
|
|
4182
|
+
}, renderItem: (item, rowProps) => React__default.createElement(PickerItem, { ...rowProps, title: item.title }) })), getName: (i) => i.title, renderToggler: renderAddFilterToggler, emptyValue: [], getRowOptions: getRowOptions, fixedBodyPosition: true, size: size, bodyCx: UUI_FILTERS_PANEL_ADD_BUTTON_BODY, ref: pickerInputRef }))));
|
|
4181
4183
|
}
|
|
4182
4184
|
const FiltersPanel = /* @__PURE__ */React__default.memo(FiltersToolbarImpl);
|
|
4183
4185
|
|
|
4184
|
-
var css$p = {"divider":"
|
|
4186
|
+
var css$p = {"divider":"_17emL1","dropdownDeleteIcon":"Qz4p4E","presetsWrapper":"kIPjag","addPresetContainer":"QU13Tb","dropContainer":"_-6Q2lB"};
|
|
4185
4187
|
|
|
4186
4188
|
var _path$g;
|
|
4187
4189
|
function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
|
|
@@ -4294,24 +4296,31 @@ var SvgContentLinkOutline = function SvgContentLinkOutline(props, ref) {
|
|
|
4294
4296
|
};
|
|
4295
4297
|
var ForwardRef$a = /*#__PURE__*/forwardRef(SvgContentLinkOutline);
|
|
4296
4298
|
|
|
4297
|
-
var css$o = {"delete-button":"
|
|
4299
|
+
var css$o = {"delete-button":"fBWN-v","deleteButton":"fBWN-v","tab-button":"KzG68N","tabButton":"KzG68N","targetOpen":"_90TTTS"};
|
|
4298
4300
|
|
|
4299
4301
|
function PresetActionsDropdown(props) {
|
|
4300
4302
|
const { uuiNotifications } = useUuiContext();
|
|
4301
|
-
const copyUrlToClipboard = useCallback(() =>
|
|
4302
|
-
|
|
4303
|
+
const copyUrlToClipboard = useCallback(async () => {
|
|
4304
|
+
await navigator.clipboard.writeText(props.getPresetLink(props.preset));
|
|
4303
4305
|
successNotificationHandler('Link copied!');
|
|
4304
|
-
}
|
|
4305
|
-
const saveInCurrent = useCallback((preset) =>
|
|
4306
|
-
const newPreset =
|
|
4307
|
-
|
|
4306
|
+
}, []);
|
|
4307
|
+
const saveInCurrent = useCallback(async (preset) => {
|
|
4308
|
+
const newPreset = {
|
|
4309
|
+
...preset,
|
|
4310
|
+
filter: props.tableState.filter,
|
|
4311
|
+
sorting: props.tableState.sorting,
|
|
4312
|
+
columnsConfig: props.tableState.columnsConfig,
|
|
4313
|
+
filtersConfig: props.tableState.filtersConfig,
|
|
4314
|
+
viewState: props.tableState.viewState,
|
|
4315
|
+
};
|
|
4316
|
+
await props.updatePreset(newPreset);
|
|
4308
4317
|
successNotificationHandler('Changes saved!');
|
|
4309
|
-
}
|
|
4318
|
+
}, [
|
|
4310
4319
|
props.tableState.filter, props.tableState.columnsConfig, props.tableState.filtersConfig,
|
|
4311
4320
|
]);
|
|
4312
4321
|
const successNotificationHandler = useCallback((text) => {
|
|
4313
4322
|
uuiNotifications
|
|
4314
|
-
.show((props) => (React__default.createElement(SuccessNotification,
|
|
4323
|
+
.show((props) => (React__default.createElement(SuccessNotification, { ...props },
|
|
4315
4324
|
React__default.createElement(Text, { size: "36", fontSize: "14" }, text))), { duration: 3 })
|
|
4316
4325
|
.catch(() => null);
|
|
4317
4326
|
}, []);
|
|
@@ -4324,16 +4333,16 @@ function PresetActionsDropdown(props) {
|
|
|
4324
4333
|
const duplicateHandler = useCallback(() => {
|
|
4325
4334
|
props.duplicatePreset(props.preset);
|
|
4326
4335
|
}, [props.preset]);
|
|
4327
|
-
const deleteHandler = useCallback(() =>
|
|
4328
|
-
|
|
4329
|
-
}
|
|
4336
|
+
const deleteHandler = useCallback(async () => {
|
|
4337
|
+
await props.deletePreset(props.preset);
|
|
4338
|
+
}, [
|
|
4330
4339
|
props.activePresetId, props.deletePreset, props.preset,
|
|
4331
4340
|
]);
|
|
4332
4341
|
const renderBody = (dropdownProps) => {
|
|
4333
4342
|
const isReadonlyPreset = props.preset.isReadonly;
|
|
4334
4343
|
const isPresetChanged = props.activePresetId === props.preset.id && props.hasPresetChanged(props.preset);
|
|
4335
4344
|
const isRenameAvailable = props.preset.id === props.activePresetId && !isReadonlyPreset;
|
|
4336
|
-
return (React__default.createElement(DropdownMenuBody,
|
|
4345
|
+
return (React__default.createElement(DropdownMenuBody, { ...dropdownProps },
|
|
4337
4346
|
isPresetChanged && (React__default.createElement(React__default.Fragment, null,
|
|
4338
4347
|
!isReadonlyPreset && (React__default.createElement(DropdownMenuButton, { key: `${props.preset.id}-save-in-current`, icon: ForwardRef$f, caption: "Save in current", onClick: () => { dropdownProps.onClose(); saveInCurrentHandler(); } })),
|
|
4339
4348
|
React__default.createElement(DropdownMenuButton, { key: `${props.preset.id}-save-as-new`, icon: ForwardRef$e, caption: "Save as new",
|
|
@@ -4349,12 +4358,12 @@ function PresetActionsDropdown(props) {
|
|
|
4349
4358
|
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$i, caption: "Delete", cx: css$o.deleteButton, onClick: deleteHandler })))));
|
|
4350
4359
|
};
|
|
4351
4360
|
const renderTarget = useCallback((dropdownProps) => {
|
|
4352
|
-
return (React__default.createElement(IconButton,
|
|
4361
|
+
return (React__default.createElement(IconButton, { cx: [css$o.tabButton, dropdownProps.isOpen && css$o.targetOpen], color: props.preset.id === props.activePresetId ? 'primary' : 'neutral', ...dropdownProps, icon: ForwardRef$g, size: "18" }));
|
|
4353
4362
|
}, []);
|
|
4354
4363
|
return (React__default.createElement(Dropdown, { renderBody: renderBody, renderTarget: renderTarget, placement: "bottom-end", modifiers: [{ name: 'offset', options: { offset: [0, 22] } }] }));
|
|
4355
4364
|
}
|
|
4356
4365
|
|
|
4357
|
-
var css$n = {"preset-input-cell":"
|
|
4366
|
+
var css$n = {"preset-input-cell":"u-T7JY","presetInputCell":"u-T7JY","preset-input":"fheg1F","presetInput":"fheg1F"};
|
|
4358
4367
|
|
|
4359
4368
|
const UUI_PRESETS_PANEL_ADD_BUTTON = 'uui-presets-panel-add-button';
|
|
4360
4369
|
const UUI_PRESETS_PANEL_MORE_BUTTON = 'uui-presets-panel-more-button';
|
|
@@ -4362,21 +4371,20 @@ const UUI_PRESETS_PANEL_INPUT = 'uui-presets-panel-input';
|
|
|
4362
4371
|
const UUI_PRESETS_PANEL_PRESET = 'uui-presets-panel-preset';
|
|
4363
4372
|
|
|
4364
4373
|
function PresetInput(props) {
|
|
4365
|
-
|
|
4366
|
-
const [presetCaption, setPresetCaption] = useState(((_a = props.preset) === null || _a === void 0 ? void 0 : _a.name) || '');
|
|
4374
|
+
const [presetCaption, setPresetCaption] = useState(props.preset?.name || '');
|
|
4367
4375
|
const [readonly, setReadonly] = useState(false);
|
|
4368
4376
|
const cancelActionHandler = useCallback(() => {
|
|
4369
4377
|
setPresetCaption('');
|
|
4370
4378
|
props.onCancel();
|
|
4371
4379
|
}, [props.onCancel]);
|
|
4372
|
-
const acceptActionHandler = useCallback(() =>
|
|
4380
|
+
const acceptActionHandler = useCallback(async () => {
|
|
4373
4381
|
setReadonly(() => true);
|
|
4374
4382
|
if (presetCaption) {
|
|
4375
|
-
|
|
4383
|
+
await props.onSuccess(presetCaption);
|
|
4376
4384
|
}
|
|
4377
4385
|
props.onCancel();
|
|
4378
4386
|
setReadonly(() => false);
|
|
4379
|
-
}
|
|
4387
|
+
}, [presetCaption]);
|
|
4380
4388
|
const newPresetOnBlurHandler = useCallback(() => {
|
|
4381
4389
|
if (presetCaption.length) {
|
|
4382
4390
|
return;
|
|
@@ -4387,7 +4395,7 @@ function PresetInput(props) {
|
|
|
4387
4395
|
React__default.createElement(TextInput, { cx: css$n.presetInput, onValueChange: setPresetCaption, value: presetCaption, onCancel: cancelActionHandler, onAccept: acceptActionHandler, onBlur: newPresetOnBlurHandler, autoFocus: true, maxLength: 50, isReadonly: readonly })));
|
|
4388
4396
|
}
|
|
4389
4397
|
|
|
4390
|
-
var css$m = {"preset":"
|
|
4398
|
+
var css$m = {"preset":"aPdvJ3","activePreset":"rCT0O9"};
|
|
4391
4399
|
|
|
4392
4400
|
function Preset(props) {
|
|
4393
4401
|
const [isRenamePreset, setIsRenamePreset] = useState(false);
|
|
@@ -4401,11 +4409,14 @@ function Preset(props) {
|
|
|
4401
4409
|
}
|
|
4402
4410
|
}, []);
|
|
4403
4411
|
const handlePresetRename = useCallback((name) => {
|
|
4404
|
-
const newPreset =
|
|
4412
|
+
const newPreset = {
|
|
4413
|
+
...props.preset,
|
|
4414
|
+
name: name,
|
|
4415
|
+
};
|
|
4405
4416
|
return props.updatePreset(newPreset);
|
|
4406
4417
|
}, [props.preset]);
|
|
4407
4418
|
const isPresetActive = props.activePresetId === props.preset.id;
|
|
4408
|
-
const PresetActionsDropdownComponent = useCallback(() => React__default.createElement(PresetActionsDropdown,
|
|
4419
|
+
const PresetActionsDropdownComponent = useCallback(() => React__default.createElement(PresetActionsDropdown, { renamePreset: setPresetForRename, ...props }), [props.preset, props.tableState, props.activePresetId]);
|
|
4409
4420
|
return (React__default.createElement(FlexCell, { key: props.preset.id, alignSelf: "center", width: "auto" }, isRenamePreset ? (React__default.createElement(PresetInput, { onCancel: cancelRenamePreset, onSuccess: handlePresetRename, preset: props.preset })) : (React__default.createElement(TabButton, { caption: props.preset.name, onClick: !isPresetActive && choosePresetHandler, cx: [css$m.preset, isPresetActive && css$m.activePreset, UUI_PRESETS_PANEL_PRESET], size: "60", withNotify: isPresetActive && props.hasPresetChanged(props.preset), icon: PresetActionsDropdownComponent, iconPosition: "right", isLinkActive: isPresetActive }))));
|
|
4410
4421
|
}
|
|
4411
4422
|
|
|
@@ -4434,12 +4445,12 @@ function PresetsPanel(props) {
|
|
|
4434
4445
|
const cancelAddingPreset = useCallback(() => {
|
|
4435
4446
|
setIsAddingPreset(false);
|
|
4436
4447
|
}, []);
|
|
4437
|
-
const presetApi =
|
|
4448
|
+
const { presets, ...presetApi } = props;
|
|
4438
4449
|
const renderPreset = (preset) => {
|
|
4439
|
-
return React__default.createElement(Preset,
|
|
4450
|
+
return React__default.createElement(Preset, { key: preset.id, preset: preset, addPreset: setAddingPreset, ...presetApi });
|
|
4440
4451
|
};
|
|
4441
4452
|
const renderAddPresetButton = useCallback(() => {
|
|
4442
|
-
return (React__default.createElement("div", { key: "addingPresetBlock", className: css$p.addPresetContainer }, !isAddingPreset ? (React__default.createElement(Button, { cx: UUI_PRESETS_PANEL_ADD_BUTTON,
|
|
4453
|
+
return (React__default.createElement("div", { key: "addingPresetBlock", className: css$p.addPresetContainer }, !isAddingPreset ? (React__default.createElement(Button, { cx: UUI_PRESETS_PANEL_ADD_BUTTON, onClick: setAddingPreset, caption: i18n.presetPanel.addCaption, icon: ForwardRef$h, iconPosition: "left", fill: "ghost", color: "primary" })) : (React__default.createElement(PresetInput, { onCancel: cancelAddingPreset, onSuccess: props.createNewPreset }))));
|
|
4443
4454
|
}, [isAddingPreset]);
|
|
4444
4455
|
const onPresetDropdownSelect = (preset) => {
|
|
4445
4456
|
props.choosePreset(preset.preset);
|
|
@@ -4447,8 +4458,8 @@ function PresetsPanel(props) {
|
|
|
4447
4458
|
const renderMoreButtonDropdown = (item, hiddenItems) => {
|
|
4448
4459
|
return (React__default.createElement(Dropdown, { key: "more", renderTarget: (props) => (React__default.createElement(FlexRow, null,
|
|
4449
4460
|
React__default.createElement("div", { className: css$p.divider }),
|
|
4450
|
-
React__default.createElement(Button,
|
|
4451
|
-
React__default.createElement(ScrollBars
|
|
4461
|
+
React__default.createElement(Button, { cx: UUI_PRESETS_PANEL_MORE_BUTTON, fill: "ghost", color: "secondary", caption: `${hiddenItems?.length || ''} more`, ...props }))), renderBody: (propsBody) => (React__default.createElement(DropdownMenuBody, { minWidth: 230, maxHeight: 300, ...propsBody },
|
|
4462
|
+
React__default.createElement(ScrollBars, null, hiddenItems.map((hiddenItem) => (React__default.createElement(DropdownMenuButton, { key: hiddenItem.preset.id, onClick: () => onPresetDropdownSelect(hiddenItem), caption: hiddenItem.preset.name, icon: !hiddenItem.preset.isReadonly && ForwardRef$9, iconPosition: "right", cx: css$p.dropdownDeleteIcon, onIconClick: !hiddenItem.preset.isReadonly && (() => props.deletePreset(hiddenItem.preset)) })))))) }));
|
|
4452
4463
|
};
|
|
4453
4464
|
const getPresetPriority = (preset, index) => {
|
|
4454
4465
|
return preset.id === props.activePresetId ? 100499 : 1000 - index;
|
|
@@ -4483,18 +4494,21 @@ const defaultPredicates = {
|
|
|
4483
4494
|
|
|
4484
4495
|
const useColumnsWithFilters = (initialColumns, filters) => {
|
|
4485
4496
|
const makeFilterRenderCallback = useCallback((key) => function (filterLens, dropdownProps) {
|
|
4486
|
-
const filter = filters
|
|
4497
|
+
const filter = filters?.find((f) => f.columnKey === key);
|
|
4487
4498
|
if (!filter)
|
|
4488
4499
|
return null;
|
|
4489
4500
|
const props = filterLens.prop(filter.field).toProps();
|
|
4490
|
-
return React__default.createElement(FilterItemBody,
|
|
4501
|
+
return React__default.createElement(FilterItemBody, { ...props, ...filter, ...dropdownProps });
|
|
4491
4502
|
}, [filters]);
|
|
4492
4503
|
const columns = useMemo(() => {
|
|
4493
4504
|
if (filters) {
|
|
4494
4505
|
const filterKeys = filters.map((f) => f.columnKey);
|
|
4495
4506
|
const newColumns = (initialColumns.map((column) => {
|
|
4496
4507
|
if (filterKeys.includes(column.key)) {
|
|
4497
|
-
return
|
|
4508
|
+
return {
|
|
4509
|
+
...column,
|
|
4510
|
+
renderFilter: makeFilterRenderCallback(column.key),
|
|
4511
|
+
};
|
|
4498
4512
|
}
|
|
4499
4513
|
else {
|
|
4500
4514
|
return column;
|
|
@@ -4562,7 +4576,7 @@ var SvgTableGroupColumnRightFill = function SvgTableGroupColumnRightFill(props,
|
|
|
4562
4576
|
};
|
|
4563
4577
|
var ForwardRef$6 = /*#__PURE__*/forwardRef(SvgTableGroupColumnRightFill);
|
|
4564
4578
|
|
|
4565
|
-
var css$l = {"unpin-icon":"
|
|
4579
|
+
var css$l = {"unpin-icon":"NkzQUH","unpinIcon":"NkzQUH","pin-toggler-icon":"GAjuj2","pinTogglerIcon":"GAjuj2"};
|
|
4566
4580
|
|
|
4567
4581
|
function PinIconButton(props) {
|
|
4568
4582
|
const i18nLocal = i18n.tables.columnsConfigurationModal;
|
|
@@ -4621,7 +4635,7 @@ var SvgActionDragIndicator18 = function SvgActionDragIndicator18(props, ref) {
|
|
|
4621
4635
|
};
|
|
4622
4636
|
var ForwardRef$5 = /*#__PURE__*/forwardRef(SvgActionDragIndicator18);
|
|
4623
4637
|
|
|
4624
|
-
var css$k = {"uui-typography":"
|
|
4638
|
+
var css$k = {"uui-typography":"_32ixSS","uuiTypography":"_32ixSS","hero-header":"xdaUfA","heroHeader":"xdaUfA","promo-header":"WbqvVY","promoHeader":"WbqvVY","uui-critical":"Rym68P","uuiCritical":"Rym68P","uui-info":"r8xp12","uuiInfo":"r8xp12","uui-success":"nIhJwz","uuiSuccess":"nIhJwz","uui-warning":"QcW9FF","uuiWarning":"QcW9FF","uui-highlight":"_5OG25r","uuiHighlight":"_5OG25r","uui-typography-size-12":"sl-tXn","uuiTypographySize12":"sl-tXn","uui-typography-size-14":"SR3bzs","uuiTypographySize14":"SR3bzs","uui-typography-size-16":"p5UNBo","uuiTypographySize16":"p5UNBo","row-wrapper":"ZFnZ6M","rowWrapper":"ZFnZ6M","pin-icon-button":"_8VfQR0","pinIconButton":"_8VfQR0","not-pinned":"gr49Qr","notPinned":"gr49Qr","checkbox":"mVthc-","drag-handle":"_9U5uls","dragHandle":"_9U5uls","dnd-disabled":"EQiIt8","dndDisabled":"EQiIt8"};
|
|
4625
4639
|
|
|
4626
4640
|
const ColumnRow = /* @__PURE__ */React.memo(function ColumnRow(props) {
|
|
4627
4641
|
const { column } = props;
|
|
@@ -4632,19 +4646,19 @@ const ColumnRow = /* @__PURE__ */React.memo(function ColumnRow(props) {
|
|
|
4632
4646
|
const data = { column, columnConfig };
|
|
4633
4647
|
const renderContent = (dndActorParams) => {
|
|
4634
4648
|
const wrapperClasses = cx$1(css$k.rowWrapper, !isPinned && css$k.notPinned, dndActorParams.isDragGhost && uuiDndState.dragGhost, 'uui-dt-columns-config-row');
|
|
4635
|
-
const
|
|
4636
|
-
const dndActorPropsWithoutRef =
|
|
4637
|
-
return (React.createElement(FlexRow, { size: settings.sizes.dataTable.columnsConfigurationModal.columnRow, cx: wrapperClasses, ref: dndActorParams.ref, rawProps:
|
|
4649
|
+
const { onTouchStart, onPointerDown, ...restEventHandlers } = dndActorParams.eventHandlers;
|
|
4650
|
+
const { ref, ...dndActorPropsWithoutRef } = dndActorParams;
|
|
4651
|
+
return (React.createElement(FlexRow, { size: settings.sizes.dataTable.columnsConfigurationModal.columnRow, cx: wrapperClasses, ref: dndActorParams.ref, rawProps: { ...restEventHandlers }, alignItems: "top" },
|
|
4638
4652
|
React.createElement(DragHandle, { dragHandleIcon: ForwardRef$5, rawProps: { onTouchStart, onPointerDown }, isDisabled: !isDndAllowed, cx: cx$1(css$k.dragHandle, !isDndAllowed && css$k.dndDisabled) }),
|
|
4639
4653
|
React.createElement(Checkbox, { key: column.key, label: props.renderItem ? props.renderItem(props.column) : column.caption, value: isVisible, onValueChange: toggleVisibility, isReadonly: column.isAlwaysVisible || column.isLocked, cx: css$k.checkbox }),
|
|
4640
4654
|
React.createElement(FlexRow, { size: null, cx: css$k.pinIconButton },
|
|
4641
4655
|
React.createElement(PinIconButton, { pinPosition: pinPosition, canUnpin: !isPinnedAlways, onTogglePin: togglePin })),
|
|
4642
|
-
React.createElement(DropMarker,
|
|
4656
|
+
React.createElement(DropMarker, { ...dndActorPropsWithoutRef })));
|
|
4643
4657
|
};
|
|
4644
4658
|
return (React.createElement(DndActor, { key: column.key, srcData: isDndAllowed && data, dstData: data, canAcceptDrop: onCanAcceptDrop, onDrop: onDrop, render: renderContent }));
|
|
4645
4659
|
});
|
|
4646
4660
|
|
|
4647
|
-
var css$j = {"uui-typography":"
|
|
4661
|
+
var css$j = {"uui-typography":"MurWgC","uuiTypography":"MurWgC","hero-header":"gCcOHV","heroHeader":"gCcOHV","promo-header":"SgAxmi","promoHeader":"SgAxmi","uui-critical":"hymC2b","uuiCritical":"hymC2b","uui-info":"_02h1-C","uuiInfo":"_02h1-C","uui-success":"lZ8LD0","uuiSuccess":"lZ8LD0","uui-warning":"tUQxBR","uuiWarning":"tUQxBR","uui-highlight":"NYeV1h","uuiHighlight":"NYeV1h","uui-typography-size-12":"jmN8YS","uuiTypographySize12":"jmN8YS","uui-typography-size-14":"i-Fcsb","uuiTypographySize14":"i-Fcsb","uui-typography-size-16":"TIDdKp","uuiTypographySize16":"TIDdKp","root":"E-umN6","main-panel":"BEzv1w","mainPanel":"BEzv1w","group":"w3NF06","group-title":"UL3kDV","groupTitle":"UL3kDV","group-items":"RNJJj7","groupItems":"RNJJj7","no-data":"_1FbXS4","noData":"_1FbXS4","no-data-title":"ihe0TZ","noDataTitle":"ihe0TZ","no-data-sub-title":"tYJeDr","noDataSubTitle":"tYJeDr","h-divider":"GSmfBV","hDivider":"GSmfBV","search-area":"tRLyKt","searchArea":"tRLyKt","subgroup-accordion":"IiZoVx","subgroupAccordion":"IiZoVx","subgroup":"uyTtR4","subgroup-title":"HIuIhz","subgroupTitle":"HIuIhz"};
|
|
4648
4662
|
|
|
4649
4663
|
const renderGroupTitle = (title, amount) => (React.createElement(FlexRow, { cx: css$j.group },
|
|
4650
4664
|
React.createElement(Text, { size: "none", cx: css$j.groupTitle }, title),
|
|
@@ -4652,7 +4666,7 @@ const renderGroupTitle = (title, amount) => (React.createElement(FlexRow, { cx:
|
|
|
4652
4666
|
React.createElement(FlexSpacer, null)));
|
|
4653
4667
|
function ColumnsConfigurationModal(props) {
|
|
4654
4668
|
const i18n$1 = i18n.tables.columnsConfigurationModal;
|
|
4655
|
-
const { columns, columnsConfig: initialColumnsConfig, defaultConfig
|
|
4669
|
+
const { columns, columnsConfig: initialColumnsConfig, defaultConfig, ...modalProps } = props;
|
|
4656
4670
|
const { groupedColumns, searchValue, columnsConfig, reset, checkAll, uncheckAll, setSearchValue, hasAnySelectedColumns, } = useColumnsConfiguration({
|
|
4657
4671
|
initialColumnsConfig,
|
|
4658
4672
|
columns,
|
|
@@ -4692,14 +4706,14 @@ function ColumnsConfigurationModal(props) {
|
|
|
4692
4706
|
React.createElement(SubGroup, { renderItem: props.renderItem, items: items })));
|
|
4693
4707
|
};
|
|
4694
4708
|
const applyButton = React.createElement(Button, { caption: i18n$1.applyButton, isDisabled: !hasAnySelectedColumns, color: "primary", onClick: apply });
|
|
4695
|
-
return (React.createElement(ModalBlocker,
|
|
4709
|
+
return (React.createElement(ModalBlocker, { ...modalProps },
|
|
4696
4710
|
React.createElement(ModalWindow, { cx: css$j.root, height: "95dvh", maxHeight: "95dvh", width: settings.sizes.dataTable.columnsConfigurationModal.width },
|
|
4697
4711
|
React.createElement(ModalHeader, { title: i18n$1.configureColumnsTitle, onClose: close }),
|
|
4698
4712
|
React.createElement(FlexRow, { borderBottom: true, cx: css$j.searchArea },
|
|
4699
4713
|
React.createElement(SearchInput, { size: settings.sizes.dataTable.columnsConfigurationModal.search, value: searchValue, onValueChange: setSearchValue, placeholder: i18n$1.searchPlaceholder }),
|
|
4700
4714
|
React.createElement(Dropdown, { closeOnTargetClick: true, renderBody: () => (React.createElement(DropdownMenuBody, { minWidth: 100 },
|
|
4701
4715
|
React.createElement(DropdownMenuButton, { caption: i18n$1.clearAllButton, onClick: uncheckAll }),
|
|
4702
|
-
React.createElement(DropdownMenuButton, { caption: i18n$1.selectAllButton, onClick: checkAll }))), renderTarget: (props) => (React.createElement(Button,
|
|
4716
|
+
React.createElement(DropdownMenuButton, { caption: i18n$1.selectAllButton, onClick: checkAll }))), renderTarget: (props) => (React.createElement(Button, { ...props, fill: "none", icon: ForwardRef$g, size: settings.sizes.dataTable.columnsConfigurationModal.search, color: "secondary", isDropdown: false })) })),
|
|
4703
4717
|
React.createElement(Panel, { background: "surface-main", cx: css$j.mainPanel },
|
|
4704
4718
|
React.createElement(ScrollBars, null,
|
|
4705
4719
|
renderVisible(),
|
|
@@ -4733,7 +4747,7 @@ function SubGroup(props) {
|
|
|
4733
4747
|
return null;
|
|
4734
4748
|
}
|
|
4735
4749
|
|
|
4736
|
-
var css$i = {"listContainer":"
|
|
4750
|
+
var css$i = {"listContainer":"WOkFve","header":"mvAB0v","group":"xI-P5S","stickyHeader":"xproOD"};
|
|
4737
4751
|
|
|
4738
4752
|
const getChildrenAndRest = (row, rows) => {
|
|
4739
4753
|
const firstNotChildIndex = rows.findIndex((other) => other.depth < row.depth || (row.depth === other.depth && other.isPinned));
|
|
@@ -4749,9 +4763,8 @@ const getChildrenAndRest = (row, rows) => {
|
|
|
4749
4763
|
};
|
|
4750
4764
|
|
|
4751
4765
|
function DataRowsGroup({ row, childRows, renderRow, top = 1, }) {
|
|
4752
|
-
var _a, _b;
|
|
4753
4766
|
const rowRef = useRef();
|
|
4754
|
-
const childrenPinnedTop = row.isPinned ? (top + (
|
|
4767
|
+
const childrenPinnedTop = row.isPinned ? (top + (rowRef.current?.clientHeight ?? 0)) : top;
|
|
4755
4768
|
return (React__default.createElement("div", { className: css$i.group, key: row.rowKey },
|
|
4756
4769
|
React__default.createElement("div", { className: row.isPinned ? css$i.stickyHeader : css$i.header,
|
|
4757
4770
|
// Gaps between pinned parents should be removed by -1 from top height.
|
|
@@ -4782,10 +4795,9 @@ function DataRowsGroups({ rows, renderRow, top = 1, }) {
|
|
|
4782
4795
|
}
|
|
4783
4796
|
|
|
4784
4797
|
function DataRowsContainer({ estimatedHeight, listContainerRef, offsetY, rows, renderRow, headerRef, }) {
|
|
4785
|
-
var _a;
|
|
4786
4798
|
return (React__default.createElement("div", { className: css$i.listContainer, style: { minHeight: `${estimatedHeight}px` } },
|
|
4787
4799
|
React__default.createElement("div", { ref: listContainerRef, role: "rowgroup", style: { marginTop: offsetY } },
|
|
4788
|
-
React__default.createElement(DataRowsGroups, { rows: rows, renderRow: renderRow, top:
|
|
4800
|
+
React__default.createElement(DataRowsGroups, { rows: rows, renderRow: renderRow, top: headerRef?.current?.clientHeight }))));
|
|
4789
4801
|
}
|
|
4790
4802
|
|
|
4791
4803
|
var _path$4, _path2, _path3, _path4, _path5, _path6, _g, _path7, _path8, _path9, _path10, _path11, _path12, _path13, _path14, _path15, _path16, _path17, _path18, _path19, _path20, _path21, _path22, _path23, _path24, _defs;
|
|
@@ -4799,7 +4811,7 @@ var SvgEmptyTable = function SvgEmptyTable(props, ref) {
|
|
|
4799
4811
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4800
4812
|
ref: ref
|
|
4801
4813
|
}, props), /*#__PURE__*/React.createElement("g", {
|
|
4802
|
-
clipPath: "url(#
|
|
4814
|
+
clipPath: "url(#p2wmcu4bb72ds99dv_a)"
|
|
4803
4815
|
}, _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
4804
4816
|
d: "M150.585 1.535C49.483-11.495 27.481 61.805 45.725 97.481c10.581 20.69-39.64 70.792 17.744 81.468 27.538 5.123 36-13.341 62.433-10.655 35.4 3.6 148.167-4.73 88.349-78.915-31.713-39.335 1.026-79.506-63.666-87.844Z",
|
|
4805
4817
|
fill: "#F5F6FA"
|
|
@@ -4820,7 +4832,7 @@ var SvgEmptyTable = function SvgEmptyTable(props, ref) {
|
|
|
4820
4832
|
d: "M86.786 22.982c-2.55 0-4.965 2.07-4.965 4.552V120.6c0 2.484 2.4 4.572 4.965 4.572h88.101c2.582 0 4.986-2.089 4.986-4.572V27.534c0-2.464-2.418-4.552-4.986-4.552h-88.1Zm-5.793 4.552c0-3.022 2.874-5.38 5.793-5.38h88.101c2.935 0 5.814 2.374 5.814 5.38V120.6c0 3.021-2.86 5.4-5.814 5.4h-88.1c-2.94 0-5.794-2.381-5.794-5.4V27.534Z",
|
|
4821
4833
|
fill: "#1D1E26"
|
|
4822
4834
|
})), /*#__PURE__*/React.createElement("mask", {
|
|
4823
|
-
id: "
|
|
4835
|
+
id: "p2wmcurj6l4bp9djh_b",
|
|
4824
4836
|
style: {
|
|
4825
4837
|
maskType: "alpha"
|
|
4826
4838
|
},
|
|
@@ -4833,7 +4845,7 @@ var SvgEmptyTable = function SvgEmptyTable(props, ref) {
|
|
|
4833
4845
|
d: "M174.887 125.586h-88.1c-2.752 0-5.38-2.234-5.38-4.986V27.534c0-2.752 2.644-4.966 5.38-4.966h88.1c2.752 0 5.4 2.23 5.4 4.966V120.6c0 2.752-2.632 4.986-5.4 4.986Z",
|
|
4834
4846
|
fill: "#9BDEFF"
|
|
4835
4847
|
}))), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
4836
|
-
mask: "url(#
|
|
4848
|
+
mask: "url(#p2wmcurj6l4bp9djh_b)",
|
|
4837
4849
|
fillRule: "evenodd",
|
|
4838
4850
|
clipRule: "evenodd"
|
|
4839
4851
|
}, /*#__PURE__*/React.createElement("path", {
|
|
@@ -4919,7 +4931,7 @@ var SvgEmptyTable = function SvgEmptyTable(props, ref) {
|
|
|
4919
4931
|
d: "M24.73 96.184a.414.414 0 0 1 .581.06l48.646 59.751a.413.413 0 1 1-.642.523L24.67 96.766a.414.414 0 0 1 .06-.582Z",
|
|
4920
4932
|
fill: "#fff"
|
|
4921
4933
|
}))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
4922
|
-
id: "
|
|
4934
|
+
id: "p2wmcu4bb72ds99dv_a"
|
|
4923
4935
|
}, /*#__PURE__*/React.createElement("path", {
|
|
4924
4936
|
fill: "#fff",
|
|
4925
4937
|
transform: "translate(.552)",
|
|
@@ -4928,46 +4940,44 @@ var SvgEmptyTable = function SvgEmptyTable(props, ref) {
|
|
|
4928
4940
|
};
|
|
4929
4941
|
var ForwardRef$4 = /*#__PURE__*/forwardRef(SvgEmptyTable);
|
|
4930
4942
|
|
|
4931
|
-
var css$h = {"root":"
|
|
4943
|
+
var css$h = {"root":"fxV7Ca","sticky-header":"a1hkPt","stickyHeader":"a1hkPt","no-results":"_3U-Fuc","noResults":"_3U-Fuc","icon":"iy02DZ","title":"XN-V7s"};
|
|
4932
4944
|
|
|
4933
4945
|
function DataTable(props) {
|
|
4934
|
-
var _a, _b, _c, _d;
|
|
4935
4946
|
const { uuiModals } = useUuiContext();
|
|
4936
4947
|
const headerRef = React.useRef();
|
|
4937
4948
|
const columnsWithFilters = useColumnsWithFilters(props.columns, props.filters);
|
|
4938
|
-
const { columns, config, defaultConfig } = useColumnsConfig(columnsWithFilters,
|
|
4949
|
+
const { columns, config, defaultConfig } = useColumnsConfig(columnsWithFilters, props.value?.columnsConfig);
|
|
4939
4950
|
const defaultRenderRow = React.useCallback((rowProps) => {
|
|
4940
|
-
return (React.createElement(DataTableRow,
|
|
4951
|
+
return (React.createElement(DataTableRow, { size: props.size || settings.sizes.dataTable.body.row.default, columnsGap: props.columnsGap, borderBottom: props.border, ...rowProps, key: rowProps.rowKey, cx: css$h.cell }));
|
|
4941
4952
|
}, []);
|
|
4942
|
-
const renderRow = (row) =>
|
|
4943
|
-
const rows =
|
|
4953
|
+
const renderRow = (row) => (props.renderRow ?? defaultRenderRow)({ ...row, columns });
|
|
4954
|
+
const rows = props.getRows?.() ?? props.rows ?? [];
|
|
4944
4955
|
const renderNoResultsBlock = React.useCallback(() => {
|
|
4945
|
-
|
|
4946
|
-
return (React.createElement("div", { className: css$h.noResults }, props.renderNoResultsBlock ? ((_a = props.renderNoResultsBlock) === null || _a === void 0 ? void 0 : _a.call(props)) : (React.createElement(React.Fragment, null,
|
|
4956
|
+
return (React.createElement("div", { className: css$h.noResults }, props.renderNoResultsBlock ? (props.renderNoResultsBlock?.()) : (React.createElement(React.Fragment, null,
|
|
4947
4957
|
React.createElement(IconContainer, { cx: css$h.icon, icon: ForwardRef$4 }),
|
|
4948
4958
|
React.createElement(Text, { cx: css$h.title, fontSize: "24", lineHeight: "30", color: "primary", fontWeight: "600" }, i18n.tables.noResultsBlock.title),
|
|
4949
4959
|
React.createElement(Text, { fontSize: "16", lineHeight: "24", color: "primary" }, i18n.tables.noResultsBlock.message)))));
|
|
4950
4960
|
}, [props.renderNoResultsBlock]);
|
|
4951
4961
|
const onConfigurationButtonClick = React.useCallback(() => {
|
|
4952
|
-
const configProps = { columns: props.columns, columnsConfig:
|
|
4962
|
+
const configProps = { columns: props.columns, columnsConfig: { ...config }, defaultConfig };
|
|
4953
4963
|
uuiModals
|
|
4954
4964
|
.show((modalProps) => {
|
|
4955
4965
|
return (props.renderColumnsConfigurationModal
|
|
4956
|
-
? props.renderColumnsConfigurationModal(
|
|
4957
|
-
: (React.createElement(ColumnsConfigurationModal,
|
|
4966
|
+
? props.renderColumnsConfigurationModal({ ...configProps, ...modalProps })
|
|
4967
|
+
: (React.createElement(ColumnsConfigurationModal, { ...modalProps, columns: props.columns, columnsConfig: config, defaultConfig: defaultConfig })));
|
|
4958
4968
|
})
|
|
4959
|
-
.then((columnsConfig) => props.onValueChange(
|
|
4969
|
+
.then((columnsConfig) => props.onValueChange({ ...props.value, columnsConfig }))
|
|
4960
4970
|
.catch(() => null);
|
|
4961
4971
|
}, [
|
|
4962
4972
|
props.columns, config, defaultConfig, props.value, props.onValueChange, props.renderColumnsConfigurationModal,
|
|
4963
4973
|
]);
|
|
4964
4974
|
const renderRowsContainer = React.useCallback(({ listContainerRef, estimatedHeight, offsetY, scrollShadows }) => (React.createElement(React.Fragment, null,
|
|
4965
4975
|
React.createElement("div", { className: css$h.stickyHeader, ref: headerRef },
|
|
4966
|
-
React.createElement(DataTableHeaderRow, { columns: columns, columnGroups: props.columnGroups, onConfigButtonClick: props.showColumnsConfig && onConfigurationButtonClick, selectAll: props.selectAll, size: props.headerSize || settings.sizes.dataTable.header.row.default, textCase: props.headerTextCase, allowColumnsReordering: props.allowColumnsReordering, allowColumnsResizing: props.allowColumnsResizing, showFoldAll: props.showFoldAll, value:
|
|
4976
|
+
React.createElement(DataTableHeaderRow, { columns: columns, columnGroups: props.columnGroups, onConfigButtonClick: props.showColumnsConfig && onConfigurationButtonClick, selectAll: props.selectAll, size: props.headerSize || settings.sizes.dataTable.header.row.default, textCase: props.headerTextCase, allowColumnsReordering: props.allowColumnsReordering, allowColumnsResizing: props.allowColumnsResizing, showFoldAll: props.showFoldAll, value: { ...props.value, columnsConfig: config }, onValueChange: props.onValueChange, columnsGap: props.columnsGap }),
|
|
4967
4977
|
React.createElement("div", { className: cx$1(uuiScrollShadows.top, {
|
|
4968
4978
|
[uuiScrollShadows.topVisible]: scrollShadows.verticalTop,
|
|
4969
4979
|
}) })),
|
|
4970
|
-
props.exactRowsCount !== 0 ? (React.createElement(DataRowsContainer, { headerRef: headerRef, listContainerRef: listContainerRef, estimatedHeight: estimatedHeight, offsetY: offsetY, scrollShadows: scrollShadows, renderRow: renderRow, rows: rows })) : (renderNoResultsBlock
|
|
4980
|
+
props.exactRowsCount !== 0 ? (React.createElement(DataRowsContainer, { headerRef: headerRef, listContainerRef: listContainerRef, estimatedHeight: estimatedHeight, offsetY: offsetY, scrollShadows: scrollShadows, renderRow: renderRow, rows: rows })) : (renderNoResultsBlock?.()))), [
|
|
4971
4981
|
props, columns, rows, renderNoResultsBlock, onConfigurationButtonClick,
|
|
4972
4982
|
]);
|
|
4973
4983
|
return (React.createElement(DataTableSelectionProvider, { onCopy: props.onCopy, rows: rows, columns: columns },
|
|
@@ -4979,9 +4989,9 @@ function DataTable(props) {
|
|
|
4979
4989
|
} }))));
|
|
4980
4990
|
}
|
|
4981
4991
|
|
|
4982
|
-
var css$g = {"root":"
|
|
4992
|
+
var css$g = {"root":"_71r7Vw"};
|
|
4983
4993
|
|
|
4984
|
-
var css$f = {"root":"
|
|
4994
|
+
var css$f = {"root":"_9px-LU","burger-content":"_2exS6-","burgerContent":"_2exS6-"};
|
|
4985
4995
|
|
|
4986
4996
|
var _path$3;
|
|
4987
4997
|
function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
|
|
@@ -5024,7 +5034,7 @@ var SvgNavigationArrowDownOutline = function SvgNavigationArrowDownOutline(props
|
|
|
5024
5034
|
};
|
|
5025
5035
|
var ForwardRef$2 = /*#__PURE__*/forwardRef(SvgNavigationArrowDownOutline);
|
|
5026
5036
|
|
|
5027
|
-
var css$e = {"uui-typography":"
|
|
5037
|
+
var css$e = {"uui-typography":"nmuj54","uuiTypography":"nmuj54","hero-header":"cS4g33","heroHeader":"cS4g33","promo-header":"UPjpLS","promoHeader":"UPjpLS","uui-critical":"oeDuSl","uuiCritical":"oeDuSl","uui-info":"a-g-Zg","uuiInfo":"a-g-Zg","uui-success":"GumRKQ","uuiSuccess":"GumRKQ","uui-warning":"SGK4h-","uuiWarning":"SGK4h-","uui-highlight":"MtkQYM","uuiHighlight":"MtkQYM","uui-typography-size-12":"_-3yaGh","uuiTypographySize12":"_-3yaGh","uui-typography-size-14":"gMJvM-","uuiTypographySize14":"gMJvM-","uui-typography-size-16":"b-fSgW","uuiTypographySize16":"b-fSgW","root":"xxU-SL","button-primary":"XKK6nU","buttonPrimary":"XKK6nU","button-secondary":"K7d13b","buttonSecondary":"K7d13b","hasIcon":"YjB09J","dropdown":"h6AffX"};
|
|
5028
5038
|
|
|
5029
5039
|
const BurgerButton = /* @__PURE__ */withMods(Button$1, (props) => [
|
|
5030
5040
|
css$e.root,
|
|
@@ -5035,13 +5045,13 @@ const BurgerButton = /* @__PURE__ */withMods(Button$1, (props) => [
|
|
|
5035
5045
|
props.icon && css$e.hasIcon,
|
|
5036
5046
|
], () => ({ dropdownIcon: ForwardRef$2, dropdownIconPosition: 'left', role: 'menuitem' }));
|
|
5037
5047
|
|
|
5038
|
-
var css$d = {"search-input":"
|
|
5048
|
+
var css$d = {"search-input":"B03jsb","searchInput":"B03jsb"};
|
|
5039
5049
|
|
|
5040
5050
|
function BurgerSearch(props) {
|
|
5041
5051
|
return (React.createElement(TextInput$1, { cx: cx(css$d.searchInput, 'uui-main_menu-burger-search'), iconPosition: "left", icon: ForwardRef$O, placeholder: props.placeholder, value: props.value, onValueChange: props.onValueChange, onCancel: props.onCancel, cancelIcon: props.value && ForwardRef$R }));
|
|
5042
5052
|
}
|
|
5043
5053
|
|
|
5044
|
-
var css$c = {"root":"
|
|
5054
|
+
var css$c = {"root":"X-Obxd","group-header":"io9R7u","groupHeader":"io9R7u","group-name":"Sidt0s","groupName":"Sidt0s","line":"NY2vj5"};
|
|
5045
5055
|
|
|
5046
5056
|
function BurgerGroupHeader(props) {
|
|
5047
5057
|
return (React.createElement("div", { className: cx(css$c.root, css$c.groupHeader, 'uui-burger-group-header') },
|
|
@@ -5049,15 +5059,21 @@ function BurgerGroupHeader(props) {
|
|
|
5049
5059
|
React.createElement("span", { className: css$c.groupName }, props.caption)));
|
|
5050
5060
|
}
|
|
5051
5061
|
|
|
5052
|
-
var css$b = {"uui-typography":"
|
|
5062
|
+
var css$b = {"uui-typography":"pX80mn","uuiTypography":"pX80mn","hero-header":"KwGVz9","heroHeader":"KwGVz9","promo-header":"d3B-Zl","promoHeader":"d3B-Zl","uui-critical":"wTazlB","uuiCritical":"wTazlB","uui-info":"Gp6-PP","uuiInfo":"Gp6-PP","uui-success":"DsJSna","uuiSuccess":"DsJSna","uui-warning":"sQzarJ","uuiWarning":"sQzarJ","uui-highlight":"_0Olot5","uuiHighlight":"_0Olot5","uui-typography-size-12":"cC35hB","uuiTypographySize12":"cC35hB","uui-typography-size-14":"MEVcFB","uuiTypographySize14":"MEVcFB","uui-typography-size-16":"oBa-cm","uuiTypographySize16":"oBa-cm","root":"_9iJWU-","type-primary":"NTDtXn","typePrimary":"NTDtXn","type-secondary":"j3jc9U","typeSecondary":"j3jc9U"};
|
|
5053
5063
|
|
|
5054
5064
|
const MainMenuButton = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
5055
|
-
const { type
|
|
5056
|
-
return (React.createElement(Clickable,
|
|
5065
|
+
const { type, ...clickableProps } = props;
|
|
5066
|
+
return (React.createElement(Clickable, { ...clickableProps, rawProps: {
|
|
5067
|
+
'aria-expanded': props.isOpen,
|
|
5068
|
+
'aria-current': props.isLinkActive
|
|
5069
|
+
? 'page'
|
|
5070
|
+
: undefined,
|
|
5071
|
+
...props.rawProps,
|
|
5072
|
+
}, cx: [
|
|
5057
5073
|
css$b.root,
|
|
5058
5074
|
css$b['type-' + (type || 'primary')],
|
|
5059
5075
|
props.cx,
|
|
5060
|
-
], ref: ref }
|
|
5076
|
+
], ref: ref },
|
|
5061
5077
|
props.icon && props.iconPosition !== 'right' && (React.createElement(IconContainer, { icon: props.icon, onClick: props.onIconClick })),
|
|
5062
5078
|
props.caption && (React.createElement("div", { className: uuiElement.caption }, props.caption)),
|
|
5063
5079
|
props.count !== undefined && props.count !== null && (React.createElement(CountIndicator, { caption: props.count, color: "neutral", size: "18" })),
|
|
@@ -5065,11 +5081,11 @@ const MainMenuButton = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
5065
5081
|
props.isDropdown && (React.createElement(IconContainer, { icon: ForwardRef$Q, flipY: props.isOpen }))));
|
|
5066
5082
|
});
|
|
5067
5083
|
|
|
5068
|
-
var css$a = {"dropdown-body":"
|
|
5084
|
+
var css$a = {"dropdown-body":"NBSS22","dropdownBody":"NBSS22"};
|
|
5069
5085
|
|
|
5070
5086
|
class MainMenuDropdown extends React.Component {
|
|
5071
5087
|
render() {
|
|
5072
|
-
return (React.createElement(Dropdown$1, { renderTarget: (props) => (React.createElement(MainMenuButton,
|
|
5088
|
+
return (React.createElement(Dropdown$1, { renderTarget: (props) => (React.createElement(MainMenuButton, { caption: this.props.caption, ...props, rawProps: this.props.rawProps, isLinkActive: this.props.isLinkActive, isDropdown: true })), renderBody: (props) => {
|
|
5073
5089
|
const handleEscape = (e) => {
|
|
5074
5090
|
if (e.key === 'Escape' && props.isOpen) {
|
|
5075
5091
|
props.onClose();
|
|
@@ -5077,16 +5093,19 @@ class MainMenuDropdown extends React.Component {
|
|
|
5077
5093
|
};
|
|
5078
5094
|
return (React.createElement(FocusLock, { returnFocus: true, persistentFocus: true, lockProps: { onKeyDown: handleEscape } },
|
|
5079
5095
|
React.createElement("div", { className: cx(css$a.dropdownBody, 'uui-main_menu-dropdown') }, this.props.renderBody
|
|
5080
|
-
? this.props.renderBody(
|
|
5096
|
+
? this.props.renderBody({ ...props })
|
|
5081
5097
|
: React.Children.map(this.props.children, (item) => {
|
|
5082
5098
|
if (!item)
|
|
5083
5099
|
return item;
|
|
5084
|
-
return React.createElement(item.type,
|
|
5100
|
+
return React.createElement(item.type, {
|
|
5101
|
+
...item.props,
|
|
5102
|
+
onClick: item.props.onClick
|
|
5085
5103
|
? () => {
|
|
5086
5104
|
item.props.onClick();
|
|
5087
5105
|
props.onClose();
|
|
5088
5106
|
}
|
|
5089
|
-
: null
|
|
5107
|
+
: null,
|
|
5108
|
+
});
|
|
5090
5109
|
}))));
|
|
5091
5110
|
}, placement: "bottom-start" }));
|
|
5092
5111
|
}
|
|
@@ -5120,69 +5139,66 @@ var SvgNavigationGlobalMenuOutlineOutline = function SvgNavigationGlobalMenuOutl
|
|
|
5120
5139
|
};
|
|
5121
5140
|
var ForwardRef$1 = /*#__PURE__*/forwardRef(SvgNavigationGlobalMenuOutlineOutline);
|
|
5122
5141
|
|
|
5123
|
-
var css$9 = {"global-menu-btn":"
|
|
5142
|
+
var css$9 = {"global-menu-btn":"s2Kk-c","globalMenuBtn":"s2Kk-c","global-menu-icon":"d3ZLeB","globalMenuIcon":"d3ZLeB"};
|
|
5124
5143
|
|
|
5125
|
-
const GlobalMenu = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement("button",
|
|
5144
|
+
const GlobalMenu = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement("button", { ref: ref, id: "global_menu_toggle", className: cx(css$9.globalMenuBtn, props.cx), ...props.rawProps },
|
|
5126
5145
|
React.createElement(IconContainer, { size: 36, icon: ForwardRef$1, cx: css$9.globalMenuIcon }))));
|
|
5127
5146
|
|
|
5128
|
-
var css$8 = {"container":"
|
|
5147
|
+
var css$8 = {"container":"Fo2XIf","open":"Jl6kPH","folding-arrow":"_0yKUTS","foldingArrow":"_0yKUTS"};
|
|
5129
5148
|
|
|
5130
|
-
const MainMenuAvatar = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement("button", { ref: ref, className: cx(css$8.container, props.isDropdown && css$8.dropdown, props.isOpen && css$8.open, props.onClick && uuiMarkers.clickable, props.cx), onClick: props.onClick },
|
|
5149
|
+
const MainMenuAvatar = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement("button", { ref: ref, className: cx(css$8.container, props.isDropdown && css$8.dropdown, props.isOpen && css$8.open, props.onClick && uuiMarkers.clickable, props.cx), onClick: props.onClick, ...props.rawProps },
|
|
5131
5150
|
React.createElement(Avatar, { size: "36", img: props.avatarUrl }),
|
|
5132
5151
|
props.icon && React.createElement(IconContainer, { icon: props.icon }),
|
|
5133
5152
|
props.isDropdown && (React.createElement("div", null,
|
|
5134
5153
|
React.createElement(IconContainer, { size: 18, icon: ForwardRef$Q, flipY: props.isOpen, cx: css$8.foldingArrow }))))));
|
|
5135
5154
|
|
|
5136
|
-
var css$7 = {"search-input":"
|
|
5155
|
+
var css$7 = {"search-input":"qGIkEO","searchInput":"qGIkEO"};
|
|
5137
5156
|
|
|
5138
|
-
const MainMenuSearch = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement(IEditableDebouncer,
|
|
5139
|
-
var _a;
|
|
5140
|
-
return (React.createElement(TextInput$1, Object.assign({ iconPosition: "left", icon: ForwardRef$O, cancelIcon: ((_a = props.value) === null || _a === void 0 ? void 0 : _a.length) > 0 && ForwardRef$R }, props, iEditable, { ref: ref, cx: cx$1(css$7.searchInput, props.cx) }, props.rawProps)));
|
|
5141
|
-
} }))));
|
|
5157
|
+
const MainMenuSearch = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement(IEditableDebouncer, { ...props, render: (iEditable) => (React.createElement(TextInput$1, { iconPosition: "left", icon: ForwardRef$O, cancelIcon: props.value?.length > 0 && ForwardRef$R, ...props, ...iEditable, ref: ref, cx: cx$1(css$7.searchInput, props.cx), ...props.rawProps })) })));
|
|
5142
5158
|
|
|
5143
|
-
var css$6 = {"container":"
|
|
5159
|
+
var css$6 = {"container":"u3ZJx9"};
|
|
5144
5160
|
|
|
5145
|
-
const MainMenuIcon = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement(IconButton,
|
|
5161
|
+
const MainMenuIcon = /* @__PURE__ */React.forwardRef((props, ref) => (React.createElement(IconButton, { ref: ref, icon: props.icon, cx: cx$1(props.cx, css$6.container), ...props })));
|
|
5146
5162
|
|
|
5147
|
-
var css$5 = {"root":"
|
|
5163
|
+
var css$5 = {"root":"Tp56UK"};
|
|
5148
5164
|
|
|
5149
5165
|
const Anchor = /* @__PURE__ */withMods(Anchor$1, () => [css$5.root]);
|
|
5150
5166
|
|
|
5151
5167
|
function Form(props) {
|
|
5152
5168
|
const context = useUuiContext();
|
|
5153
5169
|
const beforeLeave = React.useCallback(() => {
|
|
5154
|
-
return context.uuiModals.show((modalProps) => React.createElement(ConfirmationModal,
|
|
5170
|
+
return context.uuiModals.show((modalProps) => React.createElement(ConfirmationModal, { caption: i18n.form.modals.beforeLeaveMessage, ...modalProps }));
|
|
5155
5171
|
}, [context.uuiModals]);
|
|
5156
5172
|
const loadUnsavedChanges = () => {
|
|
5157
5173
|
return context.uuiNotifications
|
|
5158
|
-
.show((props) => (React.createElement(WarningNotification,
|
|
5174
|
+
.show((props) => (React.createElement(WarningNotification, { ...props, actions: [
|
|
5159
5175
|
{
|
|
5160
5176
|
name: i18n.form.notifications.actionButtonCaption,
|
|
5161
5177
|
action: props.onSuccess,
|
|
5162
5178
|
},
|
|
5163
|
-
] }
|
|
5179
|
+
] },
|
|
5164
5180
|
React.createElement(RichTextView, null,
|
|
5165
|
-
React.createElement(Text,
|
|
5181
|
+
React.createElement(Text, null, i18n.form.notifications.unsavedChangesMessage)))), { duration: 5, position: 'bot-left' });
|
|
5166
5182
|
};
|
|
5167
|
-
return React.createElement(Form$1,
|
|
5183
|
+
return React.createElement(Form$1, { loadUnsavedChanges: loadUnsavedChanges, beforeLeave: beforeLeave, ...props });
|
|
5168
5184
|
}
|
|
5169
5185
|
|
|
5170
5186
|
function useForm(props) {
|
|
5171
5187
|
const context = useUuiContext();
|
|
5172
5188
|
const beforeLeave = useCallback(() => {
|
|
5173
|
-
return context.uuiModals.show((modalProps) => React__default.createElement(ConfirmationModal,
|
|
5189
|
+
return context.uuiModals.show((modalProps) => React__default.createElement(ConfirmationModal, { caption: i18n.form.modals.beforeLeaveMessage, ...modalProps }));
|
|
5174
5190
|
}, [context.uuiModals]);
|
|
5175
5191
|
const loadUnsavedChanges = () => {
|
|
5176
|
-
return context.uuiNotifications.show((props) => (React__default.createElement(WarningNotification,
|
|
5192
|
+
return context.uuiNotifications.show((props) => (React__default.createElement(WarningNotification, { ...props, actions: [
|
|
5177
5193
|
{
|
|
5178
5194
|
name: i18n.form.notifications.actionButtonCaption,
|
|
5179
5195
|
action: props.onSuccess,
|
|
5180
5196
|
},
|
|
5181
|
-
] }
|
|
5197
|
+
] },
|
|
5182
5198
|
React__default.createElement(RichTextView, null,
|
|
5183
|
-
React__default.createElement(Text,
|
|
5199
|
+
React__default.createElement(Text, null, i18n.form.notifications.unsavedChangesMessage)))), { duration: 5, position: 'bot-left' });
|
|
5184
5200
|
};
|
|
5185
|
-
return useForm$1(
|
|
5201
|
+
return useForm$1({ beforeLeave, loadUnsavedChanges, ...props });
|
|
5186
5202
|
}
|
|
5187
5203
|
|
|
5188
5204
|
var _path;
|
|
@@ -5202,33 +5218,33 @@ var SvgFileCloudUploadFill = function SvgFileCloudUploadFill(props, ref) {
|
|
|
5202
5218
|
};
|
|
5203
5219
|
var ForwardRef = /*#__PURE__*/forwardRef(SvgFileCloudUploadFill);
|
|
5204
5220
|
|
|
5205
|
-
var css$4 = {"root":"
|
|
5221
|
+
var css$4 = {"root":"jvQYDn","drop-start":"BgBc8k","dropStart":"BgBc8k","drop-over":"RCYMhV","dropOver":"RCYMhV","link":"emzVc4","drop-area":"c10qcM","dropArea":"c10qcM","drop-caption":"HNz32q","dropCaption":"HNz32q","icon-blue":"aF-Nim","iconBlue":"aF-Nim"};
|
|
5206
5222
|
|
|
5207
5223
|
function DropSpot(props) {
|
|
5208
5224
|
const getInfoText = typeof props.infoText === 'string'
|
|
5209
|
-
? (React.createElement(Text, { lineHeight: "24", size: "24", fontSize: "14", color: "tertiary" }, props.infoText)) : props
|
|
5225
|
+
? (React.createElement(Text, { lineHeight: "24", size: "24", fontSize: "14", color: "tertiary" }, props.infoText)) : props?.infoText;
|
|
5210
5226
|
const renderAttachmentArea = (params) => {
|
|
5211
|
-
return (React.createElement("div",
|
|
5212
|
-
React.createElement("div",
|
|
5227
|
+
return (React.createElement("div", { className: cx$1(css$4.root, props.cx, params.isDragStart && css$4.dropStart, params.isDraggingOver && css$4.dropOver), ...props.rawProps },
|
|
5228
|
+
React.createElement("div", { ...params.eventHandlers, className: css$4.dropArea },
|
|
5213
5229
|
React.createElement(FlexRow, { size: "24" },
|
|
5214
5230
|
React.createElement(IconContainer, { icon: ForwardRef, cx: css$4.iconBlue }),
|
|
5215
5231
|
React.createElement(Text, { lineHeight: "24", size: "24", fontSize: "14", cx: css$4.dropCaption }, i18n.fileUpload.labelStart),
|
|
5216
5232
|
React.createElement(UploadFileToggler, { onFilesAdded: props.onUploadFiles, render: (props) => (React.createElement(RichTextView, null,
|
|
5217
|
-
React.createElement(LinkButton,
|
|
5233
|
+
React.createElement(LinkButton, { caption: i18n.fileUpload.browse, ...props, cx: css$4.link }))), accept: props.accept, single: props.single })),
|
|
5218
5234
|
getInfoText)));
|
|
5219
5235
|
};
|
|
5220
5236
|
return React.createElement(DropSpot$1, { render: renderAttachmentArea, onFilesDropped: props.onUploadFiles });
|
|
5221
5237
|
}
|
|
5222
5238
|
|
|
5223
|
-
var css$3 = {"uui-typography":"
|
|
5239
|
+
var css$3 = {"uui-typography":"_7SSEm-","uuiTypography":"_7SSEm-","hero-header":"ExOPed","heroHeader":"ExOPed","promo-header":"oejPyI","promoHeader":"oejPyI","uui-critical":"pPhVLd","uuiCritical":"pPhVLd","uui-info":"zBUhlQ","uuiInfo":"zBUhlQ","uui-success":"tmEgyz","uuiSuccess":"tmEgyz","uui-warning":"J4ZZOy","uuiWarning":"J4ZZOy","uui-highlight":"WoZ9sf","uuiHighlight":"WoZ9sf","uui-typography-size-12":"-N-gQd","uuiTypographySize12":"-N-gQd","uui-typography-size-14":"_4QJK2A","uuiTypographySize14":"_4QJK2A","uui-typography-size-16":"-kADgb","uuiTypographySize16":"-kADgb","root":"wDYgGZ","file-name":"OPqaMz","fileName":"OPqaMz","default-color":"oc7SsP","defaultColor":"oc7SsP","doc-color":"DUYMpj","docColor":"DUYMpj","xls-color":"Y8MoGe","xlsColor":"Y8MoGe","pdf-color":"N0WK2I","pdfColor":"N0WK2I","movie-color":"lrWC8Y","movieColor":"lrWC8Y","img-color":"_2e5Eai","imgColor":"_2e5Eai","mov-color":"ipiVeK","movColor":"ipiVeK","error-block":"bEjOXk","errorBlock":"bEjOXk","icons-block":"_8wZfGG","iconsBlock":"_8wZfGG"};
|
|
5224
5240
|
|
|
5225
|
-
var css$2 = {"root":"
|
|
5241
|
+
var css$2 = {"root":"KFyvnu"};
|
|
5226
5242
|
|
|
5227
5243
|
const SvgCircleProgress = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
5228
5244
|
const outsetRadius = props.size / 2 - 1;
|
|
5229
5245
|
const insetRadius = props.size / 2 - 3;
|
|
5230
5246
|
const circumference = insetRadius * Math.PI;
|
|
5231
|
-
return (React.createElement("svg",
|
|
5247
|
+
return (React.createElement("svg", { className: css$2.root, width: props.size, height: props.size, ref: ref, ...props.rawProps },
|
|
5232
5248
|
React.createElement("circle", { strokeDasharray: circumference, strokeDashoffset: circumference - (props.progress / 100) * circumference, strokeWidth: insetRadius, fill: "transparent", r: insetRadius / 2, cx: props.size / 2, cy: props.size / 2 }),
|
|
5233
5249
|
React.createElement("circle", { strokeWidth: 1, fill: "transparent", r: outsetRadius, cx: props.size / 2, cy: props.size / 2 })));
|
|
5234
5250
|
});
|
|
@@ -5273,8 +5289,8 @@ const FileCard = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
5273
5289
|
}
|
|
5274
5290
|
};
|
|
5275
5291
|
const { cx: componentCx, width, file: { progress, size, name, extension, error, abortXHR, }, onClick, } = props;
|
|
5276
|
-
const fileExtension = extension ||
|
|
5277
|
-
const fileName = name
|
|
5292
|
+
const fileExtension = extension || name?.split('.').pop();
|
|
5293
|
+
const fileName = name?.split('.').slice(0, -1).join('');
|
|
5278
5294
|
const isLoading = progress < 100;
|
|
5279
5295
|
const isCrossShow = ((!isLoadingShow && isLoading) || !isLoading) && onClick;
|
|
5280
5296
|
const mouseLeaveHandler = (e) => {
|
|
@@ -5297,12 +5313,12 @@ const FileCard = /* @__PURE__ */React.forwardRef((props, ref) => {
|
|
|
5297
5313
|
progress && progress < 100 && abortXHR();
|
|
5298
5314
|
onClick();
|
|
5299
5315
|
};
|
|
5300
|
-
return (React.createElement(FlexCell, { ref: ref, cx: cx$1(css$3.root, 'uui-file_card', (isLoading ||
|
|
5301
|
-
React.createElement(FlexRow, {
|
|
5316
|
+
return (React.createElement(FlexCell, { ref: ref, cx: cx$1(css$3.root, 'uui-file_card', (isLoading || error?.isError) && uuiMod.loading, componentCx, error?.isError && uuiMod.error), minWidth: width, width: !width ? '100%' : undefined },
|
|
5317
|
+
React.createElement(FlexRow, { alignItems: "top", columnGap: "6" },
|
|
5302
5318
|
fileExtension && getIcon(fileExtension),
|
|
5303
5319
|
React.createElement(FlexCell, { width: "100%" },
|
|
5304
|
-
React.createElement(Text, { size: "18", fontSize: "14", lineHeight: "18", color: (progress < 100 ||
|
|
5305
|
-
|
|
5320
|
+
React.createElement(Text, { size: "18", fontSize: "14", lineHeight: "18", color: (progress < 100 || error?.isError) ? 'tertiary' : 'primary', cx: css$3.fileName }, fileName),
|
|
5321
|
+
error?.isError ? renderErrorContent() : renderSuccessfulContent()),
|
|
5306
5322
|
React.createElement("div", { className: cx$1(css$3.iconsBlock), onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler },
|
|
5307
5323
|
isLoadingShow && isLoading && React.createElement(SvgCircleProgress, { progress: progress, size: 18 }),
|
|
5308
5324
|
isCrossShow && React.createElement(IconButton, { icon: ForwardRef$R, onClick: removeHandler })))));
|
|
@@ -5350,7 +5366,7 @@ const getErrorPageConfig = () => ({
|
|
|
5350
5366
|
},
|
|
5351
5367
|
});
|
|
5352
5368
|
|
|
5353
|
-
var css$1 = {"container":"
|
|
5369
|
+
var css$1 = {"container":"tW1P5U"};
|
|
5354
5370
|
|
|
5355
5371
|
const ErrorPage = (props) => {
|
|
5356
5372
|
const isMobileScreen = isMobile();
|
|
@@ -5359,10 +5375,10 @@ const ErrorPage = (props) => {
|
|
|
5359
5375
|
React__default.createElement("img", { className: "uui-error-image", src: isMobileScreen && props.mobileImageUrl ? props.mobileImageUrl : props.imageUrl, alt: "ERROR OCCURRED!" }),
|
|
5360
5376
|
React__default.createElement("div", { className: "uui-error-title" }, props.title),
|
|
5361
5377
|
React__default.createElement("div", { className: "uui-error-subtitle" }, props.subtitle),
|
|
5362
|
-
|
|
5378
|
+
props?.supportLink && React__default.createElement("div", { className: "uui-error-support-link" }, props?.supportLink))));
|
|
5363
5379
|
};
|
|
5364
5380
|
|
|
5365
|
-
var css = {"recovery-spinner":"
|
|
5381
|
+
var css = {"recovery-spinner":"ZvCzZ0","recoverySpinner":"ZvCzZ0","recovery-message":"JRjTr0","recoveryMessage":"JRjTr0","modal-blocker":"gm-GV8","modalBlocker":"gm-GV8","modalFadeIn":"MFGxj-"};
|
|
5366
5382
|
|
|
5367
5383
|
function ErrorHandler(props) {
|
|
5368
5384
|
const { uuiNotifications, uuiModals, uuiApi } = useUuiContext();
|
|
@@ -5377,8 +5393,8 @@ function ErrorHandler(props) {
|
|
|
5377
5393
|
props.onNotificationError(c);
|
|
5378
5394
|
}
|
|
5379
5395
|
else {
|
|
5380
|
-
uuiNotifications.show((notificationProps) => (React__default.createElement(ErrorNotification,
|
|
5381
|
-
React__default.createElement(Text,
|
|
5396
|
+
uuiNotifications.show((notificationProps) => (React__default.createElement(ErrorNotification, { ...notificationProps },
|
|
5397
|
+
React__default.createElement(Text, null, c.responseData && c.responseData.errorMessage))));
|
|
5382
5398
|
}
|
|
5383
5399
|
c.dismissError();
|
|
5384
5400
|
});
|
|
@@ -5389,7 +5405,7 @@ function ErrorHandler(props) {
|
|
|
5389
5405
|
React__default.createElement(ModalWindow, null,
|
|
5390
5406
|
React__default.createElement(ModalHeader, { borderBottom: true, title: title }),
|
|
5391
5407
|
React__default.createElement(Spinner, { cx: css.recoverySpinner }),
|
|
5392
|
-
React__default.createElement(FlexRow, {
|
|
5408
|
+
React__default.createElement(FlexRow, { cx: css.recoveryMessage },
|
|
5393
5409
|
React__default.createElement(FlexCell, { grow: 1 },
|
|
5394
5410
|
React__default.createElement(RichTextView, null, subtitle),
|
|
5395
5411
|
isAuthLost && (React__default.createElement(Text, { color: "tertiary" },
|
|
@@ -5399,7 +5415,7 @@ function ErrorHandler(props) {
|
|
|
5399
5415
|
".")))))));
|
|
5400
5416
|
};
|
|
5401
5417
|
const renderErrorPage = (errorInform) => {
|
|
5402
|
-
return React__default.createElement(ErrorPage,
|
|
5418
|
+
return React__default.createElement(ErrorPage, { cx: props.cx, ...errorInform });
|
|
5403
5419
|
};
|
|
5404
5420
|
if (errorType === 'error') {
|
|
5405
5421
|
uuiModals.closeAll();
|