@rolster/react-components 19.7.5 → 19.7.11
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/dist/cjs/index.cjs +100 -44
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +100 -44
- package/dist/es/index.mjs.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +2 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +13 -4
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +16 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js.map +1 -1
- package/dist/esm/components/organisms/FieldClock/FieldClock.js +1 -1
- package/dist/esm/components/organisms/FieldClock/FieldClock.js.map +1 -1
- package/dist/esm/components/organisms/FieldColor/FieldColor.js +4 -4
- package/dist/esm/components/organisms/FieldColor/FieldColor.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldList/FieldList.js +1 -1
- package/dist/esm/components/organisms/FieldList/FieldList.js.map +1 -1
- package/dist/esm/components/organisms/FieldList/FieldListController.js +13 -3
- package/dist/esm/components/organisms/FieldList/FieldListController.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +13 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
- package/dist/esm/components/organisms/Notifications/Notifications.d.ts +2 -1
- package/dist/esm/components/organisms/Notifications/Notifications.js +11 -5
- package/dist/esm/components/organisms/Notifications/Notifications.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +2 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +12 -6
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/context.js +3 -3
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/controllers/DropdownController.js +2 -8
- package/dist/esm/controllers/DropdownController.js.map +1 -1
- package/dist/esm/controllers/ListController.js +3 -3
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/controllers/PortalController.js +2 -2
- package/dist/esm/controllers/PortalController.js.map +1 -1
- package/dist/esm/controllers/TabsController.d.ts +5 -1
- package/dist/esm/controllers/TabsController.js +12 -4
- package/dist/esm/controllers/TabsController.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -2380,10 +2380,19 @@ function RlsConfirmationComponent({ approved, className, content, reject, rlsThe
|
|
|
2380
2380
|
return (jsxRuntimeExports.jsxs("div", { className: classConfirmation, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__header", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-confirmation__title", children: title }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__subtitle", children: subtitle }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__body", children: content && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__content", children: content })) }), (approved || reject) && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__actions", children: [approved && (jsxRuntimeExports.jsx(RlsButton, { identifier: approved.identifier, type: approved.type, onClick: approved.onClick, disabled: approved.disabled, rlsTheme: approved.rlsTheme, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: reject.type, onClick: reject.onClick, disabled: reject.disabled, rlsTheme: reject.rlsTheme, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
2381
2381
|
}
|
|
2382
2382
|
const RlsConfirmation = require$$0.memo(RlsConfirmationComponent);
|
|
2383
|
+
const RlsConfirmationBase = RlsConfirmation;
|
|
2383
2384
|
function useConfirmation() {
|
|
2384
2385
|
const [config, setConfig] = require$$0.useState({});
|
|
2385
2386
|
const [visible, setVisible] = require$$0.useState(false);
|
|
2386
|
-
const
|
|
2387
|
+
const configRef = require$$0.useRef(config);
|
|
2388
|
+
configRef.current = config;
|
|
2389
|
+
const visibleRef = require$$0.useRef(visible);
|
|
2390
|
+
visibleRef.current = visible;
|
|
2391
|
+
const RlsConfirmation = require$$0.useMemo(() => {
|
|
2392
|
+
return function RlsConfirmation(props) {
|
|
2393
|
+
return ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmationBase, { ...props, ...configRef.current, visible: visibleRef.current }), document.body);
|
|
2394
|
+
};
|
|
2395
|
+
}, []);
|
|
2387
2396
|
const confirmation = require$$0.useCallback((options) => {
|
|
2388
2397
|
return new Promise((resolve) => {
|
|
2389
2398
|
setConfig({
|
|
@@ -2417,8 +2426,8 @@ function useConfirmation() {
|
|
|
2417
2426
|
});
|
|
2418
2427
|
}, []);
|
|
2419
2428
|
return {
|
|
2420
|
-
|
|
2421
|
-
|
|
2429
|
+
confirmation,
|
|
2430
|
+
RlsConfirmation
|
|
2422
2431
|
};
|
|
2423
2432
|
}
|
|
2424
2433
|
|
|
@@ -2556,7 +2565,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
|
|
|
2556
2565
|
const refInput = require$$0.useRef(null);
|
|
2557
2566
|
const listIsOpen = require$$0.useRef(false);
|
|
2558
2567
|
const stableSuggestions = useStableSuggestions(suggestions);
|
|
2559
|
-
const collection = require$$0.useMemo(() => new components.ListCollection(stableSuggestions, reference), [stableSuggestions]);
|
|
2568
|
+
const collection = require$$0.useMemo(() => new components.ListCollection(stableSuggestions, reference), [stableSuggestions, reference]);
|
|
2560
2569
|
const [state, refreshState] = require$$0.useState({
|
|
2561
2570
|
focused: false,
|
|
2562
2571
|
higher: false,
|
|
@@ -2665,7 +2674,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
|
|
|
2665
2674
|
position: position.current
|
|
2666
2675
|
});
|
|
2667
2676
|
}, [state.higher]);
|
|
2668
|
-
return {
|
|
2677
|
+
return require$$0.useMemo(() => ({
|
|
2669
2678
|
...state,
|
|
2670
2679
|
navigationElement,
|
|
2671
2680
|
navigationInput,
|
|
@@ -2674,7 +2683,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
|
|
|
2674
2683
|
refList,
|
|
2675
2684
|
setFormValue,
|
|
2676
2685
|
setState
|
|
2677
|
-
};
|
|
2686
|
+
}), [state, navigationElement, navigationInput, setFormValue, setState]);
|
|
2678
2687
|
}
|
|
2679
2688
|
|
|
2680
2689
|
const DURATION_ANIMATION$2 = 240;
|
|
@@ -2804,7 +2813,7 @@ function useFieldAutocomplete(props) {
|
|
|
2804
2813
|
}
|
|
2805
2814
|
};
|
|
2806
2815
|
}, [onChange, controller.navigationElement]);
|
|
2807
|
-
return {
|
|
2816
|
+
return require$$0.useMemo(() => ({
|
|
2808
2817
|
...controller,
|
|
2809
2818
|
coincidences,
|
|
2810
2819
|
onBlurInput,
|
|
@@ -2817,7 +2826,20 @@ function useFieldAutocomplete(props) {
|
|
|
2817
2826
|
onKeydownInput,
|
|
2818
2827
|
pattern,
|
|
2819
2828
|
setPattern
|
|
2820
|
-
}
|
|
2829
|
+
}), [
|
|
2830
|
+
controller,
|
|
2831
|
+
coincidences,
|
|
2832
|
+
onBlurInput,
|
|
2833
|
+
onClickAction,
|
|
2834
|
+
onClickBackdrop,
|
|
2835
|
+
onClickControl,
|
|
2836
|
+
onClickElement,
|
|
2837
|
+
onFocusInput,
|
|
2838
|
+
onKeydownElement,
|
|
2839
|
+
onKeydownInput,
|
|
2840
|
+
pattern,
|
|
2841
|
+
setPattern
|
|
2842
|
+
]);
|
|
2821
2843
|
}
|
|
2822
2844
|
|
|
2823
2845
|
function RlsFieldAutocompleteTemplateComponent(props) {
|
|
@@ -2873,7 +2895,7 @@ function RlsFieldAutocompleteTemplateComponent(props) {
|
|
|
2873
2895
|
onClickPattern,
|
|
2874
2896
|
onSearch
|
|
2875
2897
|
]);
|
|
2876
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: autocomplete.value ? 'trash-2' : 'arrow-ios-down', onClick: autocomplete.onClickAction
|
|
2898
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), !props.readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: autocomplete.value ? 'trash-2' : 'arrow-ios-down', onClick: autocomplete.onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: autocomplete.coincidences, visible: autocomplete.listIsVisible, action: action, disabled: disabled, higher: autocomplete.higher, render: render, refList: autocomplete.refList, searchControl: searchControl, onClickElement: autocomplete.onClickElement, onKeydownElement: autocomplete.onKeydownElement, onClickBackdrop: autocomplete.onClickBackdrop })] }));
|
|
2877
2899
|
}
|
|
2878
2900
|
const RlsFieldAutocompleteTemplate = require$$0.memo(RlsFieldAutocompleteTemplateComponent);
|
|
2879
2901
|
function RlsFieldAutocompleteComponent(props) {
|
|
@@ -3161,7 +3183,7 @@ function RlsFieldClockComponent({ children, disabled: disabledProps, formControl
|
|
|
3161
3183
|
formControl?.touch();
|
|
3162
3184
|
setModalIsVisible(false);
|
|
3163
3185
|
}, [formControl, onChange]);
|
|
3164
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-clock", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-clock__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction
|
|
3186
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-clock", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-clock__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalClock, { visible: modalIsVisible, formControl: formControl, time: time, disabled: disabled, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3165
3187
|
}
|
|
3166
3188
|
const RlsFieldClock = require$$0.memo(RlsFieldClockComponent);
|
|
3167
3189
|
|
|
@@ -3390,9 +3412,9 @@ function RlsFieldColorComponent({ children, color, disabled: disabledProps, form
|
|
|
3390
3412
|
disabled,
|
|
3391
3413
|
readonly: readOnly
|
|
3392
3414
|
});
|
|
3393
|
-
const
|
|
3394
|
-
const
|
|
3395
|
-
return normalizeHex(
|
|
3415
|
+
const colorDisplay = require$$0.useMemo(() => {
|
|
3416
|
+
const color = colorValue && hexIsValid(colorValue) ? colorValue : '';
|
|
3417
|
+
return normalizeHex(color);
|
|
3396
3418
|
}, [colorValue]);
|
|
3397
3419
|
const onClickInput = require$$0.useCallback(() => {
|
|
3398
3420
|
if (!readOnly) {
|
|
@@ -3420,7 +3442,7 @@ function RlsFieldColorComponent({ children, color, disabled: disabledProps, form
|
|
|
3420
3442
|
formControl?.touch();
|
|
3421
3443
|
setModalIsVisible(false);
|
|
3422
3444
|
}, [formControl, onChange]);
|
|
3423
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-color", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [
|
|
3445
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-color", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [colorDisplay && (jsxRuntimeExports.jsx("div", { className: "rls-field-color__swatch", style: { backgroundColor: colorDisplay } })), jsxRuntimeExports.jsx("input", { className: "rls-field-color__control", type: "text", value: colorDisplay, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: colorValue ? 'trash-2' : 'color-palette', onClick: onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-color", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerColor, { formControl: formControl, color: color, disabled: disabled, onListener: onListener }) })] }));
|
|
3424
3446
|
}
|
|
3425
3447
|
const RlsFieldColor = require$$0.memo(RlsFieldColorComponent);
|
|
3426
3448
|
|
|
@@ -3573,7 +3595,7 @@ function RlsFieldDateComponent({ children, date, disabled: disabledProps, formCo
|
|
|
3573
3595
|
formControl?.touch();
|
|
3574
3596
|
setModalIsVisible(false);
|
|
3575
3597
|
}, [formControl, onChange]);
|
|
3576
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date__control", type: "text", value: status.label, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction
|
|
3598
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date__control", type: "text", value: status.label, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDate, { visible: modalIsVisible, formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3577
3599
|
}
|
|
3578
3600
|
const RlsFieldDate = require$$0.memo(RlsFieldDateComponent);
|
|
3579
3601
|
|
|
@@ -3704,7 +3726,7 @@ function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, f
|
|
|
3704
3726
|
formControl?.touch();
|
|
3705
3727
|
setModalIsVisible(false);
|
|
3706
3728
|
}, [formControl, onChange]);
|
|
3707
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction
|
|
3729
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDateRange, { visible: modalIsVisible, formControl: formControl, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3708
3730
|
}
|
|
3709
3731
|
const RlsFieldDateRange = require$$0.memo(RlsFieldDateRangeComponent);
|
|
3710
3732
|
|
|
@@ -3827,7 +3849,7 @@ function useFieldList(props) {
|
|
|
3827
3849
|
}
|
|
3828
3850
|
};
|
|
3829
3851
|
}, [toggleElement]);
|
|
3830
|
-
return {
|
|
3852
|
+
return require$$0.useMemo(() => ({
|
|
3831
3853
|
...state,
|
|
3832
3854
|
selected,
|
|
3833
3855
|
refContent,
|
|
@@ -3839,7 +3861,17 @@ function useFieldList(props) {
|
|
|
3839
3861
|
onClickInput,
|
|
3840
3862
|
onKeydownElement,
|
|
3841
3863
|
onRemoveElement
|
|
3842
|
-
}
|
|
3864
|
+
}), [
|
|
3865
|
+
state,
|
|
3866
|
+
selected,
|
|
3867
|
+
isSelected,
|
|
3868
|
+
onClickAction,
|
|
3869
|
+
onClickBackdrop,
|
|
3870
|
+
onClickElement,
|
|
3871
|
+
onClickInput,
|
|
3872
|
+
onKeydownElement,
|
|
3873
|
+
onRemoveElement
|
|
3874
|
+
]);
|
|
3843
3875
|
}
|
|
3844
3876
|
|
|
3845
3877
|
function RlsFieldListInner({ render, suggestions, action, children, formControl, fieldList, msgErrorDisabled, placeholder, rlsTheme, ...props }) {
|
|
@@ -3853,7 +3885,7 @@ function RlsFieldListInner({ render, suggestions, action, children, formControl,
|
|
|
3853
3885
|
readonly: props.readOnly
|
|
3854
3886
|
}, `rls-field-list rls-field-list__multi ${props.className ?? ''}`);
|
|
3855
3887
|
const renderWithCheckbox = require$$0.useCallback((element) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__element", children: [jsxRuntimeExports.jsx(RlsCheckBox, { checked: fieldList.isSelected(element) }), render(element)] })), [fieldList.isSelected, render]);
|
|
3856
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: fieldList.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__multi__chips", onClick: disabled ? undefined : fieldList.onClickInput, children: !fieldList.selected.length && placeholder ? (jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__placeholder", children: placeholder })) : (fieldList.selected.map((item, index) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__chip", children: [jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__chip__description", children: item.description }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__multi__chip__remove", onClick: fieldList.onRemoveElement(item),
|
|
3888
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: fieldList.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__multi__chips", onClick: disabled ? undefined : fieldList.onClickInput, children: !fieldList.selected.length && placeholder ? (jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__placeholder", children: placeholder })) : (fieldList.selected.map((item, index) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__chip", children: [jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__chip__description", children: item.description }), !props.readOnly && !disabled && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__multi__chip__remove", onClick: fieldList.onRemoveElement(item), children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) }))] }, index)))) }), !props.readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-down", onClick: fieldList.onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: fieldList.listIsVisible, action: action, disabled: disabled, higher: fieldList.higher, render: renderWithCheckbox, refList: fieldList.refList, onClickElement: fieldList.onClickElement, onKeydownElement: fieldList.onKeydownElement, onClickBackdrop: fieldList.onClickBackdrop })] }));
|
|
3857
3889
|
}
|
|
3858
3890
|
function RlsFieldListTemplateComponent(props) {
|
|
3859
3891
|
const fieldList = useFieldList(props);
|
|
@@ -3962,7 +3994,7 @@ function useFieldSelect(props) {
|
|
|
3962
3994
|
}
|
|
3963
3995
|
};
|
|
3964
3996
|
}, [onChange, controller.navigationElement]);
|
|
3965
|
-
return {
|
|
3997
|
+
return require$$0.useMemo(() => ({
|
|
3966
3998
|
...controller,
|
|
3967
3999
|
onBlurInput,
|
|
3968
4000
|
onClickAction,
|
|
@@ -3972,7 +4004,17 @@ function useFieldSelect(props) {
|
|
|
3972
4004
|
onFocusInput,
|
|
3973
4005
|
onKeydownElement,
|
|
3974
4006
|
onKeydownInput
|
|
3975
|
-
}
|
|
4007
|
+
}), [
|
|
4008
|
+
controller,
|
|
4009
|
+
onBlurInput,
|
|
4010
|
+
onClickAction,
|
|
4011
|
+
onClickBackdrop,
|
|
4012
|
+
onClickInput,
|
|
4013
|
+
onClickElement,
|
|
4014
|
+
onFocusInput,
|
|
4015
|
+
onKeydownElement,
|
|
4016
|
+
onKeydownInput
|
|
4017
|
+
]);
|
|
3976
4018
|
}
|
|
3977
4019
|
|
|
3978
4020
|
function RlsFieldSelectTemplateComponent(props) {
|
|
@@ -3987,7 +4029,7 @@ function RlsFieldSelectTemplateComponent(props) {
|
|
|
3987
4029
|
disabled: disabled,
|
|
3988
4030
|
readonly: props.readOnly
|
|
3989
4031
|
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
3990
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: select.refInput, className: "rls-field-list__control", readOnly: true, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput, disabled: disabled }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: !unremovable && !!select.value ? 'close' : 'arrow-ios-down', onClick: select.onClickAction
|
|
4032
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: select.refInput, className: "rls-field-list__control", readOnly: true, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput, disabled: disabled }), !props.readOnly && !disabled && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: !unremovable && !!select.value ? 'close' : 'arrow-ios-down', onClick: select.onClickAction }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: select.listIsVisible, action: action, disabled: disabled, higher: select.higher, render: render, refList: select.refList, onClickElement: select.onClickElement, onKeydownElement: select.onKeydownElement, onClickBackdrop: select.onClickBackdrop })] }));
|
|
3991
4033
|
}
|
|
3992
4034
|
const RlsFieldSelectTemplate = require$$0.memo(RlsFieldSelectTemplateComponent);
|
|
3993
4035
|
function RlsFieldSelectComponent(props) {
|
|
@@ -4469,6 +4511,8 @@ function RlsNotification({ content, icon, onClose, rlsTheme, title, visible }) {
|
|
|
4469
4511
|
function useNotifications() {
|
|
4470
4512
|
const [notifications, setNotifications] = require$$0.useState([]);
|
|
4471
4513
|
const timersRef = require$$0.useRef(new Map());
|
|
4514
|
+
const notificationsRef = require$$0.useRef(notifications);
|
|
4515
|
+
notificationsRef.current = notifications;
|
|
4472
4516
|
require$$0.useEffect(() => {
|
|
4473
4517
|
const timers = timersRef.current;
|
|
4474
4518
|
return () => {
|
|
@@ -4489,6 +4533,14 @@ function useNotifications() {
|
|
|
4489
4533
|
setNotifications((notifications) => notifications.filter((notification) => notification.id !== id));
|
|
4490
4534
|
}, DURATION_ANIMATION$1);
|
|
4491
4535
|
}, []);
|
|
4536
|
+
const RlsNotifications = require$$0.useMemo(() => {
|
|
4537
|
+
return function RlsNotifications(props) {
|
|
4538
|
+
const className = renderClassStatus('rls-notifications', {
|
|
4539
|
+
visible: notificationsRef.current.length > 0
|
|
4540
|
+
});
|
|
4541
|
+
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: className, ...props, children: notificationsRef.current.map((notification) => (jsxRuntimeExports.jsx(RlsNotification, { ...notification.config, visible: notification.visible, onClose: () => remove(notification.id) }, notification.id))) }), document.body);
|
|
4542
|
+
};
|
|
4543
|
+
}, [remove]);
|
|
4492
4544
|
const notify = require$$0.useCallback((config) => {
|
|
4493
4545
|
const id = generateId();
|
|
4494
4546
|
const duration = config.duration ?? DURATION_DEFAULT;
|
|
@@ -4508,10 +4560,6 @@ function useNotifications() {
|
|
|
4508
4560
|
}, duration);
|
|
4509
4561
|
timersRef.current.set(id, timer);
|
|
4510
4562
|
}, [remove]);
|
|
4511
|
-
const className = renderClassStatus('rls-notifications', {
|
|
4512
|
-
visible: notifications.length > 0
|
|
4513
|
-
});
|
|
4514
|
-
const RlsNotifications = ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: className, children: notifications.map((notification) => (jsxRuntimeExports.jsx(RlsNotification, { ...notification.config, visible: notification.visible, onClose: () => remove(notification.id) }, notification.id))) }), document.body);
|
|
4515
4563
|
return {
|
|
4516
4564
|
RlsNotifications,
|
|
4517
4565
|
notify
|
|
@@ -4538,6 +4586,7 @@ function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible
|
|
|
4538
4586
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
|
|
4539
4587
|
}
|
|
4540
4588
|
const RlsSnackbar = require$$0.memo(RlsSnackbarComponent);
|
|
4589
|
+
const RlsSnackbarNode = RlsSnackbar;
|
|
4541
4590
|
function useSnackbar() {
|
|
4542
4591
|
const timeoutId = require$$0.useRef(undefined);
|
|
4543
4592
|
const duration = require$$0.useRef(4000);
|
|
@@ -4545,6 +4594,8 @@ function useSnackbar() {
|
|
|
4545
4594
|
config: {},
|
|
4546
4595
|
visible: false
|
|
4547
4596
|
});
|
|
4597
|
+
const stateRef = require$$0.useRef(state);
|
|
4598
|
+
stateRef.current = state;
|
|
4548
4599
|
const onClose = require$$0.useCallback(() => {
|
|
4549
4600
|
if (timeoutId.current) {
|
|
4550
4601
|
clearTimeout(timeoutId.current);
|
|
@@ -4552,7 +4603,13 @@ function useSnackbar() {
|
|
|
4552
4603
|
timeoutId.current = undefined;
|
|
4553
4604
|
setState((state) => ({ ...state, visible: false }));
|
|
4554
4605
|
}, []);
|
|
4555
|
-
const
|
|
4606
|
+
const onCloseRef = require$$0.useRef(onClose);
|
|
4607
|
+
onCloseRef.current = onClose;
|
|
4608
|
+
const RlsSnackbar = require$$0.useMemo(() => {
|
|
4609
|
+
return function RlsSnackbar(props) {
|
|
4610
|
+
return (jsxRuntimeExports.jsx(RlsSnackbarNode, { ...props, ...stateRef.current.config, visible: stateRef.current.visible, onClose: onCloseRef.current }));
|
|
4611
|
+
};
|
|
4612
|
+
}, []);
|
|
4556
4613
|
require$$0.useEffect(() => {
|
|
4557
4614
|
if (state.visible) {
|
|
4558
4615
|
timeoutId.current = setTimeout(() => {
|
|
@@ -4576,10 +4633,7 @@ function useSnackbar() {
|
|
|
4576
4633
|
visible: !state.visible
|
|
4577
4634
|
}));
|
|
4578
4635
|
}, []);
|
|
4579
|
-
return {
|
|
4580
|
-
RlsSnackbar: rlsSnackbar,
|
|
4581
|
-
snackbar
|
|
4582
|
-
};
|
|
4636
|
+
return { RlsSnackbar, snackbar };
|
|
4583
4637
|
}
|
|
4584
4638
|
|
|
4585
4639
|
const RlsContext = require$$0.createContext(null);
|
|
@@ -4592,8 +4646,8 @@ function useRlsContext() {
|
|
|
4592
4646
|
}
|
|
4593
4647
|
function RlsApplication({ children }) {
|
|
4594
4648
|
const { RlsConfirmation, confirmation } = useConfirmation();
|
|
4595
|
-
const { RlsNotifications, notify } = useNotifications();
|
|
4596
4649
|
const { RlsSnackbar, snackbar } = useSnackbar();
|
|
4650
|
+
const { RlsNotifications, notify } = useNotifications();
|
|
4597
4651
|
const [navbarInApp, setNavbarInApp] = require$$0.useState(false);
|
|
4598
4652
|
const [navbarIsCondense, setNavbarIsCondense] = require$$0.useState(false);
|
|
4599
4653
|
const [appIsMobile, setIsMobile] = require$$0.useState(false);
|
|
@@ -4610,7 +4664,7 @@ function RlsApplication({ children }) {
|
|
|
4610
4664
|
setNavbarIsCondense,
|
|
4611
4665
|
snackbar
|
|
4612
4666
|
}), [confirmation, notify, snackbar]);
|
|
4613
|
-
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsNotifications,
|
|
4667
|
+
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, jsxRuntimeExports.jsx(RlsSnackbar, {})] }), jsxRuntimeExports.jsx(RlsConfirmation, {}), jsxRuntimeExports.jsx(RlsNotifications, {})] }));
|
|
4614
4668
|
}
|
|
4615
4669
|
|
|
4616
4670
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
@@ -4716,13 +4770,7 @@ function useDropdownController(effect = '0% 0%') {
|
|
|
4716
4770
|
const close = require$$0.useCallback(() => {
|
|
4717
4771
|
setVisible(false);
|
|
4718
4772
|
}, []);
|
|
4719
|
-
return {
|
|
4720
|
-
close,
|
|
4721
|
-
component,
|
|
4722
|
-
open,
|
|
4723
|
-
openWithEvent,
|
|
4724
|
-
visible
|
|
4725
|
-
};
|
|
4773
|
+
return require$$0.useMemo(() => ({ close, component, open, openWithEvent, visible }), [close, open, openWithEvent, visible]);
|
|
4726
4774
|
}
|
|
4727
4775
|
|
|
4728
4776
|
function usePortalController() {
|
|
@@ -4733,15 +4781,23 @@ function usePortalController() {
|
|
|
4733
4781
|
const close = require$$0.useCallback(() => {
|
|
4734
4782
|
setVisible(false);
|
|
4735
4783
|
}, []);
|
|
4736
|
-
return { close, open, visible };
|
|
4784
|
+
return require$$0.useMemo(() => ({ close, open, visible }), [close, open, visible]);
|
|
4737
4785
|
}
|
|
4738
4786
|
|
|
4739
4787
|
function useTabsController(options) {
|
|
4740
4788
|
const formControl = reactForms.useFormControl(options.value);
|
|
4789
|
+
const tabsRef = require$$0.useRef(options.tabs);
|
|
4790
|
+
tabsRef.current = options.tabs;
|
|
4791
|
+
const onValueRef = require$$0.useRef(options.onValue);
|
|
4792
|
+
onValueRef.current = options.onValue;
|
|
4793
|
+
const formControlRef = require$$0.useRef(formControl);
|
|
4794
|
+
formControlRef.current = formControl;
|
|
4741
4795
|
const Tabs = require$$0.useMemo(() => {
|
|
4742
|
-
return (
|
|
4743
|
-
|
|
4744
|
-
|
|
4796
|
+
return function Tabs(props) {
|
|
4797
|
+
return (jsxRuntimeExports.jsx(RlsTabs, { ...props, tabs: tabsRef.current, formControl: formControlRef.current, onValue: onValueRef.current }));
|
|
4798
|
+
};
|
|
4799
|
+
}, []);
|
|
4800
|
+
return require$$0.useMemo(() => ({ Tabs, formControl }), [Tabs, formControl]);
|
|
4745
4801
|
}
|
|
4746
4802
|
|
|
4747
4803
|
const APP_THEME_ATTRIBUTE = 'app-theme';
|