@rolster/react-components 19.7.0 → 19.7.3
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 +269 -423
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +269 -423
- package/dist/es/index.mjs.map +1 -1
- package/dist/esm/components/atoms/Amount/Amount.js +1 -3
- package/dist/esm/components/atoms/Amount/Amount.js.map +1 -1
- package/dist/esm/components/atoms/AreaText/AreaText.js +6 -14
- package/dist/esm/components/atoms/AreaText/AreaText.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.d.ts +2 -1
- package/dist/esm/components/atoms/Avatar/Avatar.js +8 -5
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.js +2 -4
- package/dist/esm/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js +3 -5
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.js +2 -4
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.d.ts +2 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js +4 -6
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js.map +1 -1
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.js +2 -4
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.js.map +1 -1
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js +2 -4
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.js +2 -4
- package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/atoms/Icon/Icon.js +2 -4
- package/dist/esm/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/esm/components/atoms/Image/Image.js +2 -4
- package/dist/esm/components/atoms/Image/Image.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +5 -7
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputCounter/InputCounter.js +5 -7
- package/dist/esm/components/atoms/InputCounter/InputCounter.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +5 -7
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.js +2 -4
- package/dist/esm/components/atoms/InputSearch/InputSearch.js.map +1 -1
- package/dist/esm/components/atoms/Poster/Poster.js +2 -4
- package/dist/esm/components/atoms/Poster/Poster.js.map +1 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js +2 -4
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.js +2 -4
- package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.js +6 -4
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/atoms/TabularText/TabularText.js +1 -3
- package/dist/esm/components/atoms/TabularText/TabularText.js.map +1 -1
- package/dist/esm/components/molecules/Accordion/Accordion.js +2 -4
- package/dist/esm/components/molecules/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/molecules/Alert/Alert.js +2 -4
- package/dist/esm/components/molecules/Alert/Alert.js.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.js +2 -4
- package/dist/esm/components/molecules/Ballot/Ballot.js.map +1 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js +2 -4
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js.map +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js +5 -7
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/FieldArea/FieldArea.js +6 -8
- package/dist/esm/components/molecules/FieldArea/FieldArea.js.map +1 -1
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js +6 -8
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js.map +1 -1
- package/dist/esm/components/molecules/FieldFile/FieldFile.js +2 -2
- package/dist/esm/components/molecules/FieldFile/FieldFile.js.map +1 -1
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js +5 -7
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +6 -8
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +6 -8
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +6 -8
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js +6 -8
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +6 -8
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +6 -8
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +6 -8
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +6 -8
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.js +1 -3
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.js.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js +4 -2
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.js +7 -9
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +7 -9
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +5 -7
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +5 -7
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/molecules/Slider/Slider.js +5 -7
- package/dist/esm/components/molecules/Slider/Slider.js.map +1 -1
- package/dist/esm/components/molecules/Tabs/Tabs.js +5 -7
- package/dist/esm/components/molecules/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js +2 -4
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/organisms/Card/Card.js +2 -4
- package/dist/esm/components/organisms/Card/Card.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +3 -5
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Datatable/Datatable.js +12 -28
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/Dropdown/Dropdown.js +4 -6
- package/dist/esm/components/organisms/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +7 -16
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldClock/FieldClock.js +5 -7
- package/dist/esm/components/organisms/FieldClock/FieldClock.js.map +1 -1
- package/dist/esm/components/organisms/FieldColor/FieldColor.js +5 -7
- package/dist/esm/components/organisms/FieldColor/FieldColor.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +8 -10
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +5 -7
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldList/FieldList.js +6 -14
- package/dist/esm/components/organisms/FieldList/FieldList.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +6 -14
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js +2 -4
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.js +2 -4
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js +2 -4
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js.map +1 -1
- package/dist/esm/components/organisms/Notifications/Notifications.js +14 -6
- package/dist/esm/components/organisms/Notifications/Notifications.js.map +1 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.js +13 -21
- package/dist/esm/components/organisms/PickerClock/PickerClock.js.map +1 -1
- package/dist/esm/components/organisms/PickerColor/PickerColor.js +1 -1
- package/dist/esm/components/organisms/PickerColor/PickerColor.js.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +6 -8
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +9 -11
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +2 -4
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/context.js +5 -7
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/helpers/design-system.js +1 -1
- package/dist/esm/helpers/design-system.js.map +1 -1
- package/dist/esm/types.d.ts +2 -2
- package/package.json +4 -4
package/dist/es/index.mjs
CHANGED
|
@@ -452,17 +452,13 @@ function RlsTabularTextComponent({ className, value }) {
|
|
|
452
452
|
const codes = useMemo(() => {
|
|
453
453
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value?.split('').map((char, index) => (jsxRuntimeExports.jsx("span", { className: getCharClass(char), children: char }, index))) }));
|
|
454
454
|
}, [value]);
|
|
455
|
-
const _className =
|
|
456
|
-
return renderClassStatus('rls-tabular-text', {}, className);
|
|
457
|
-
}, [className]);
|
|
455
|
+
const _className = renderClassStatus('rls-tabular-text', {}, className);
|
|
458
456
|
return jsxRuntimeExports.jsx("div", { className: _className, children: codes });
|
|
459
457
|
}
|
|
460
458
|
const RlsTabularText = memo(RlsTabularTextComponent);
|
|
461
459
|
|
|
462
460
|
function RlsAmountComponent({ value, className, decimals, rlsTheme, symbol }) {
|
|
463
|
-
const classNameAmount =
|
|
464
|
-
return renderClassStatus('rls-amount', {}, className);
|
|
465
|
-
}, [className]);
|
|
461
|
+
const classNameAmount = renderClassStatus('rls-amount', {}, className);
|
|
466
462
|
const { decimal, integer } = useMemo(() => {
|
|
467
463
|
const currency = currencyFormat({ value, decimals });
|
|
468
464
|
if (!currency.includes(',')) {
|
|
@@ -532,45 +528,36 @@ function RlsAreaTextComponent({ autoComplete, disabled, formControl, identifier,
|
|
|
532
528
|
setFocused(() => false);
|
|
533
529
|
onBlur?.();
|
|
534
530
|
}, [formControl, onBlur]);
|
|
535
|
-
const className =
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
});
|
|
541
|
-
}, [
|
|
542
|
-
formControl?.disabled,
|
|
543
|
-
formControl?.focused,
|
|
544
|
-
disabled,
|
|
545
|
-
focused,
|
|
546
|
-
readOnly
|
|
547
|
-
]);
|
|
531
|
+
const className = renderClassStatus('rls-area-text', {
|
|
532
|
+
disabled: formControl?.disabled || disabled,
|
|
533
|
+
focused: formControl?.focused ?? focused,
|
|
534
|
+
readonly: readOnly
|
|
535
|
+
});
|
|
548
536
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("textarea", { ref: areaRef, className: "rls-area-text__component", autoComplete: autoComplete ?? 'off', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, rows: rows, style: { resize }, onFocus: onFocusArea, onBlur: onBlurArea, onChange: onChangeArea, onKeyDown: onKeyDownArea, onKeyUp: onKeyUpArea, value: valueArea }), jsxRuntimeExports.jsx("span", { className: "rls-area-text__value", children: valueArea })] }));
|
|
549
537
|
}
|
|
550
538
|
const RlsAreaText = memo(RlsAreaTextComponent);
|
|
551
539
|
|
|
552
|
-
function RlsAvatarComponent({ children, contrasted, rounded, skeleton, rlsTheme }) {
|
|
553
|
-
const className =
|
|
554
|
-
|
|
555
|
-
|
|
540
|
+
function RlsAvatarComponent({ children, contrasted, rounded, skeleton, transparent, rlsTheme }) {
|
|
541
|
+
const className = renderClassStatus('rls-avatar', {
|
|
542
|
+
contrasted,
|
|
543
|
+
rounded,
|
|
544
|
+
skeleton,
|
|
545
|
+
transparent
|
|
546
|
+
});
|
|
556
547
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
557
548
|
}
|
|
558
549
|
const RlsAvatar = memo(RlsAvatarComponent);
|
|
559
550
|
|
|
560
551
|
function RlsBadgeComponent({ children, contrasted, rlsTheme }) {
|
|
561
|
-
const className =
|
|
562
|
-
return renderClassStatus('rls-badge', { contrasted });
|
|
563
|
-
}, [contrasted]);
|
|
552
|
+
const className = renderClassStatus('rls-badge', { contrasted });
|
|
564
553
|
return (jsxRuntimeExports.jsx("span", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
565
554
|
}
|
|
566
555
|
const RlsBadge = memo(RlsBadgeComponent);
|
|
567
556
|
|
|
568
557
|
function RlsBreadcrumbLabel({ label }) {
|
|
569
|
-
const className =
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
});
|
|
573
|
-
}, [label.onClick]);
|
|
558
|
+
const className = renderClassStatus('rls-breadcrumb__label__a', {
|
|
559
|
+
actionable: !!label.onClick
|
|
560
|
+
});
|
|
574
561
|
return (jsxRuntimeExports.jsx("span", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, "rls-theme": label.rlsTheme, children: label.label }) }));
|
|
575
562
|
}
|
|
576
563
|
function RlsBreadcrumbComponent({ labels }) {
|
|
@@ -582,9 +569,7 @@ function RlsBreadcrumbComponent({ labels }) {
|
|
|
582
569
|
const RlsBreadcrumb = memo(RlsBreadcrumbComponent);
|
|
583
570
|
|
|
584
571
|
function RlsIconComponent({ value, className, rlsTheme, skeleton }) {
|
|
585
|
-
const classNameIcon =
|
|
586
|
-
return renderClassStatus('rls-icon', { skeleton }, className);
|
|
587
|
-
}, [className, skeleton]);
|
|
572
|
+
const classNameIcon = renderClassStatus('rls-icon', { skeleton }, className);
|
|
588
573
|
return (jsxRuntimeExports.jsx("div", { className: classNameIcon, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
589
574
|
}
|
|
590
575
|
const RlsIcon = memo(RlsIconComponent);
|
|
@@ -595,25 +580,19 @@ function RlsSpinnerComponent() {
|
|
|
595
580
|
const RlsSpinner = memo(RlsSpinnerComponent);
|
|
596
581
|
|
|
597
582
|
function RlsButtonComponent({ type, children, disabled, identifier, onClick, prefixIcon, requesting, rlsTheme, suffixIcon }) {
|
|
598
|
-
const className =
|
|
599
|
-
return renderClassStatus('rls-button__content', { type });
|
|
600
|
-
}, [type]);
|
|
583
|
+
const className = renderClassStatus('rls-button__content', { type });
|
|
601
584
|
return (jsxRuntimeExports.jsx("button", { id: identifier, className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntimeExports.jsxs("div", { className: className, children: [requesting && jsxRuntimeExports.jsx(RlsSpinner, {}), prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), children && jsxRuntimeExports.jsx("div", { className: "rls-button__description", children: children }), suffixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: suffixIcon })] }) }));
|
|
602
585
|
}
|
|
603
586
|
const RlsButton = memo(RlsButtonComponent);
|
|
604
587
|
|
|
605
|
-
function RlsButtonActionComponent({ icon, disabled, identifier, onClick, rlsTheme, tooltip, type }) {
|
|
606
|
-
const className =
|
|
607
|
-
|
|
608
|
-
}, [type]);
|
|
609
|
-
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onClick, disabled: disabled, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-button-action__content", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }), tooltip && (jsxRuntimeExports.jsx("div", { className: "rls-button-action__tooltip rls-overline-font-medium", children: jsxRuntimeExports.jsx("span", { children: tooltip }) }))] }));
|
|
588
|
+
function RlsButtonActionComponent({ icon, badge, disabled, identifier, onClick, rlsTheme, tooltip, type }) {
|
|
589
|
+
const className = renderClassStatus('rls-button-action', { type });
|
|
590
|
+
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onClick, disabled: disabled, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-button-action__content", children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), badge && jsxRuntimeExports.jsx("span", { className: "rls-button-action__badge", children: badge })] }), tooltip && (jsxRuntimeExports.jsx("div", { className: "rls-button-action__tooltip rls-overline-font-medium", children: jsxRuntimeExports.jsx("span", { children: tooltip }) }))] }));
|
|
610
591
|
}
|
|
611
592
|
const RlsButtonAction = memo(RlsButtonActionComponent);
|
|
612
593
|
|
|
613
594
|
function RlsButtonIconComponent({ icon, className, disabled, onClick, skeleton }) {
|
|
614
|
-
const classNameButton =
|
|
615
|
-
return renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
616
|
-
}, [className, skeleton]);
|
|
595
|
+
const classNameButton = renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
617
596
|
return (jsxRuntimeExports.jsx("button", { className: classNameButton, onClick: onClick, disabled: disabled, children: !skeleton && jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
618
597
|
}
|
|
619
598
|
const RlsButtonIcon = memo(RlsButtonIconComponent);
|
|
@@ -639,9 +618,7 @@ function RlsButtonOptionComponent({ icon, children, disabled, formControl, ident
|
|
|
639
618
|
onValue,
|
|
640
619
|
value
|
|
641
620
|
});
|
|
642
|
-
const className =
|
|
643
|
-
return renderClassStatus('rls-button-option', { checked });
|
|
644
|
-
}, [checked]);
|
|
621
|
+
const className = renderClassStatus('rls-button-option', { checked });
|
|
645
622
|
const onAction = useCallback(() => {
|
|
646
623
|
onSelect();
|
|
647
624
|
onClick?.();
|
|
@@ -651,9 +628,7 @@ function RlsButtonOptionComponent({ icon, children, disabled, formControl, ident
|
|
|
651
628
|
const RlsButtonOption = memo(RlsButtonOptionComponent);
|
|
652
629
|
|
|
653
630
|
function RlsCheckBoxComponent({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
654
|
-
const className =
|
|
655
|
-
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
656
|
-
}, [checked, disabled]);
|
|
631
|
+
const className = renderClassStatus('rls-checkbox', { checked, disabled });
|
|
657
632
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx(RlsIcon, { value: "checkmark" }) }));
|
|
658
633
|
}
|
|
659
634
|
const RlsCheckBox = memo(RlsCheckBoxComponent);
|
|
@@ -673,9 +648,7 @@ const RlsSkeleton = memo(RlsSkeletonComponent);
|
|
|
673
648
|
function RlsImageComponent({ src, rlsTheme }) {
|
|
674
649
|
const [srcIsComplet, setSrcIsComplet] = useState(false);
|
|
675
650
|
const refImage = useRef(null);
|
|
676
|
-
const className =
|
|
677
|
-
return renderClassStatus('rls-image', { complet: srcIsComplet });
|
|
678
|
-
}, [srcIsComplet]);
|
|
651
|
+
const className = renderClassStatus('rls-image', { complet: srcIsComplet });
|
|
679
652
|
useEffect(() => {
|
|
680
653
|
setSrcIsComplet(!!(src && refImage.current?.complete));
|
|
681
654
|
}, [src]);
|
|
@@ -729,12 +702,10 @@ function RlsInputComponent({ children, decimals, disabled, formControl, identifi
|
|
|
729
702
|
setFocused(() => false);
|
|
730
703
|
onBlur?.();
|
|
731
704
|
}, [formControl, onBlur]);
|
|
732
|
-
const className =
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
});
|
|
737
|
-
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
705
|
+
const className = renderClassStatus('rls-input', {
|
|
706
|
+
disabled: formControl?.disabled || disabled,
|
|
707
|
+
focused: formControl?.focused ?? focused
|
|
708
|
+
});
|
|
738
709
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("input", { ref: formControl?.elementRef, className: "rls-input__component", autoComplete: "off", type: type ?? 'text', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, onFocus: onFocusInput, onBlur: onBlurInput, onChange: onChangeInput, onKeyDown: onKeyDownInput, onKeyUp: onKeyUpInput, value: valueInput }), jsxRuntimeExports.jsx("span", { className: "rls-input__value", children: children })] }));
|
|
739
710
|
}
|
|
740
711
|
const RlsInput = memo(RlsInputComponent);
|
|
@@ -744,13 +715,11 @@ function RlsInputCounterComponent({ className, disabled, formControl, identifier
|
|
|
744
715
|
const [value, setValue] = useState(formControl?.value ?? valueProp ?? 0);
|
|
745
716
|
const [focused, setFocused] = useState(false);
|
|
746
717
|
const _disabled = useMemo(() => formControl?.disabled || disabled, [formControl?.disabled, disabled]);
|
|
747
|
-
const classNameCounter =
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}, className);
|
|
753
|
-
}, [_disabled, formControl?.focused, focused, readOnly, className]);
|
|
718
|
+
const classNameCounter = renderClassStatus('rls-input-counter', {
|
|
719
|
+
disabled: _disabled,
|
|
720
|
+
focused: formControl?.focused ?? focused,
|
|
721
|
+
readonly: readOnly
|
|
722
|
+
}, className);
|
|
754
723
|
useEffect(() => {
|
|
755
724
|
if (!changeIsInternal.current && formControl) {
|
|
756
725
|
const counterValue = formControl.value;
|
|
@@ -865,12 +834,10 @@ function RlsInputPasswordComponent({ disabled, formControl, identifier, onEnter,
|
|
|
865
834
|
formControl?.blur();
|
|
866
835
|
setFocused(() => false);
|
|
867
836
|
}, [formControl]);
|
|
868
|
-
const className =
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
});
|
|
873
|
-
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
837
|
+
const className = renderClassStatus('rls-input-password', {
|
|
838
|
+
disabled: formControl?.disabled || disabled,
|
|
839
|
+
focused: formControl?.focused ?? focused
|
|
840
|
+
});
|
|
874
841
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, children: jsxRuntimeExports.jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type ?? 'password', placeholder: placeholder, disabled: disabled, readOnly: readOnly, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, onKeyDown: _onKeyDown, onKeyUp: _onKeyUp }) }));
|
|
875
842
|
}
|
|
876
843
|
const RlsInputPassword = memo(RlsInputPasswordComponent);
|
|
@@ -890,9 +857,7 @@ const RlsInputPercentage = memo(RlsInputPercentageComponent);
|
|
|
890
857
|
|
|
891
858
|
function RlsInputSearchComponent({ formControl, disabled, identifier, onEnter, onSearch, placeholder }) {
|
|
892
859
|
const [value, setValue] = useState('');
|
|
893
|
-
const className =
|
|
894
|
-
return renderClassStatus('rls-input-search', { disabled });
|
|
895
|
-
}, [disabled]);
|
|
860
|
+
const className = renderClassStatus('rls-input-search', { disabled });
|
|
896
861
|
const onValue = useCallback((value) => {
|
|
897
862
|
if (!formControl) {
|
|
898
863
|
setValue(() => value);
|
|
@@ -1263,17 +1228,13 @@ function RlsMessageIconComponent({ icon, children, rlsTheme }) {
|
|
|
1263
1228
|
const RlsMessageIcon = memo(RlsMessageIconComponent);
|
|
1264
1229
|
|
|
1265
1230
|
function RlsPosterComponent({ children, contrasted, rlsTheme }) {
|
|
1266
|
-
const className =
|
|
1267
|
-
return renderClassStatus('rls-poster', { contrasted });
|
|
1268
|
-
}, [contrasted]);
|
|
1231
|
+
const className = renderClassStatus('rls-poster', { contrasted });
|
|
1269
1232
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1270
1233
|
}
|
|
1271
1234
|
const RlsPoster = memo(RlsPosterComponent);
|
|
1272
1235
|
|
|
1273
1236
|
function RlsProgressBarComponent({ indeterminate, percentage, rlsTheme }) {
|
|
1274
|
-
const className =
|
|
1275
|
-
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1276
|
-
}, [indeterminate]);
|
|
1237
|
+
const className = renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1277
1238
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage ?? 0}%` } }) }));
|
|
1278
1239
|
}
|
|
1279
1240
|
const RlsProgressBar = memo(RlsProgressBarComponent);
|
|
@@ -1284,9 +1245,7 @@ function RlsProgressCircularComponent({ rlsTheme }) {
|
|
|
1284
1245
|
const RlsProgressCircular = memo(RlsProgressCircularComponent);
|
|
1285
1246
|
|
|
1286
1247
|
function RlsRadioButtonComponent({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1287
|
-
const className =
|
|
1288
|
-
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1289
|
-
}, [checked, disabled]);
|
|
1248
|
+
const className = renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1290
1249
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1291
1250
|
}
|
|
1292
1251
|
const RlsRadioButton = memo(RlsRadioButtonComponent);
|
|
@@ -1297,9 +1256,11 @@ function RlsSkeletonTextComponent({ active, children, rlsTheme }) {
|
|
|
1297
1256
|
const RlsSkeletonText = memo(RlsSkeletonTextComponent);
|
|
1298
1257
|
|
|
1299
1258
|
function RlsSwitchComponent({ checked, capsule, disabled, identifier, onClick, rlsTheme }) {
|
|
1300
|
-
const className =
|
|
1301
|
-
|
|
1302
|
-
|
|
1259
|
+
const className = renderClassStatus('rls-switch', {
|
|
1260
|
+
checked,
|
|
1261
|
+
capsule,
|
|
1262
|
+
disabled
|
|
1263
|
+
});
|
|
1303
1264
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-switch__component", children: jsxRuntimeExports.jsx("div", { className: "rls-switch__component__element" }) }) }));
|
|
1304
1265
|
}
|
|
1305
1266
|
const RlsSwitch = memo(RlsSwitchComponent);
|
|
@@ -1316,9 +1277,7 @@ function RlsAccordionComponent({ bordered, children, className, disabled, identi
|
|
|
1316
1277
|
const [animating, setAnimating] = useState(false);
|
|
1317
1278
|
const contentRef = useRef(null);
|
|
1318
1279
|
const initializedRef = useRef(false);
|
|
1319
|
-
const classNameAccordion =
|
|
1320
|
-
return renderClassStatus('rls-accordion', { bordered, disabled, open, animating }, className);
|
|
1321
|
-
}, [animating, bordered, className, disabled, open]);
|
|
1280
|
+
const classNameAccordion = renderClassStatus('rls-accordion', { bordered, disabled, open, animating }, className);
|
|
1322
1281
|
const onClickHeader = useCallback(() => {
|
|
1323
1282
|
if (!disabled) {
|
|
1324
1283
|
setOpen((current) => {
|
|
@@ -1367,17 +1326,13 @@ function RlsAccordionComponent({ bordered, children, className, disabled, identi
|
|
|
1367
1326
|
const RlsAccordion = memo(RlsAccordionComponent);
|
|
1368
1327
|
|
|
1369
1328
|
function RlsAlertComponent({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1370
|
-
const className =
|
|
1371
|
-
return renderClassStatus('rls-alert', { bordered });
|
|
1372
|
-
}, [bordered]);
|
|
1329
|
+
const className = renderClassStatus('rls-alert', { bordered });
|
|
1373
1330
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-alert__icon", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsx("div", { className: "rls-alert__content", children: children })] }));
|
|
1374
1331
|
}
|
|
1375
1332
|
const RlsAlert = memo(RlsAlertComponent);
|
|
1376
1333
|
|
|
1377
1334
|
function RlsBallotComponent({ bordered, className, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1378
|
-
const classNameBallot =
|
|
1379
|
-
return renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1380
|
-
}, [bordered, skeleton, className]);
|
|
1335
|
+
const classNameBallot = renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1381
1336
|
return (jsxRuntimeExports.jsxs("div", { className: classNameBallot, "rls-theme": rlsTheme, children: [(img || initials) && (jsxRuntimeExports.jsxs(RlsAvatar, { skeleton: skeleton, children: [img && jsxRuntimeExports.jsx("img", { src: img }), initials && jsxRuntimeExports.jsx("span", { children: initials })] })), jsxRuntimeExports.jsxs("div", { className: "rls-ballot__component", children: [jsxRuntimeExports.jsx("div", { className: "rls-ballot__title", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: children }) }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-ballot__subtitle", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: subtitle }) }))] })] }));
|
|
1382
1337
|
}
|
|
1383
1338
|
const RlsBallot = memo(RlsBallotComponent);
|
|
@@ -1388,9 +1343,7 @@ function RlsBodyComponent({ children, identifier, rlsTheme }) {
|
|
|
1388
1343
|
const RlsBody = memo(RlsBodyComponent);
|
|
1389
1344
|
|
|
1390
1345
|
function RlsButtonProgressComponent({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1391
|
-
const className =
|
|
1392
|
-
return renderClassStatus('rls-button-progress', { progressing });
|
|
1393
|
-
}, [progressing]);
|
|
1346
|
+
const className = renderClassStatus('rls-button-progress', { progressing });
|
|
1394
1347
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!progressing && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: icon, onClick: onClick, disabled: disabled })), progressing && jsxRuntimeExports.jsx(RlsProgressCircular, {})] }));
|
|
1395
1348
|
}
|
|
1396
1349
|
const RlsButtonProgress = memo(RlsButtonProgressComponent);
|
|
@@ -1421,12 +1374,10 @@ function RlsButtonToggleComponent({ onAction, options, type, automatic, disabled
|
|
|
1421
1374
|
document.removeEventListener('click', onCloseMenu);
|
|
1422
1375
|
};
|
|
1423
1376
|
}, []);
|
|
1424
|
-
const classNameList =
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
});
|
|
1429
|
-
}, [visible]);
|
|
1377
|
+
const classNameList = renderClassStatus('rls-button-toggle__list', {
|
|
1378
|
+
hide: !visible,
|
|
1379
|
+
visible
|
|
1380
|
+
});
|
|
1430
1381
|
const onClickMenu = useCallback(() => {
|
|
1431
1382
|
setVisible((visible) => !visible);
|
|
1432
1383
|
}, []);
|
|
@@ -1588,14 +1539,12 @@ function RlsFieldAreaComponent(props) {
|
|
|
1588
1539
|
const disabled = useMemo(() => {
|
|
1589
1540
|
return formControl?.disabled || props.disabled;
|
|
1590
1541
|
}, [formControl?.disabled, props.disabled]);
|
|
1591
|
-
const className =
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
}, 'rls-field-area');
|
|
1598
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1542
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1543
|
+
disabled,
|
|
1544
|
+
error: formControl?.wrong,
|
|
1545
|
+
focused: formControl?.focused && !disabled,
|
|
1546
|
+
readonly: props.readOnly
|
|
1547
|
+
}, 'rls-field-area');
|
|
1599
1548
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsAreaText, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1600
1549
|
}
|
|
1601
1550
|
const RlsFieldArea = memo(RlsFieldAreaComponent);
|
|
@@ -1605,14 +1554,12 @@ function RlsFieldDecimalComponent(props) {
|
|
|
1605
1554
|
const disabled = useMemo(() => {
|
|
1606
1555
|
return formControl?.disabled || props.disabled;
|
|
1607
1556
|
}, [formControl?.disabled, props.disabled]);
|
|
1608
|
-
const className =
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
}, 'rls-field-decimal');
|
|
1615
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1557
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1558
|
+
disabled,
|
|
1559
|
+
error: formControl?.wrong,
|
|
1560
|
+
focused: formControl?.focused && !disabled,
|
|
1561
|
+
readonly: props.readOnly
|
|
1562
|
+
}, 'rls-field-decimal');
|
|
1616
1563
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputDecimal, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1617
1564
|
}
|
|
1618
1565
|
const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
@@ -1620,12 +1567,12 @@ const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
|
1620
1567
|
function RlsFieldFileComponent({ accept, children, disabled: _disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
|
|
1621
1568
|
const inputRef = useRef(null);
|
|
1622
1569
|
const disabled = useMemo(() => formControl?.disabled || _disabled, [formControl?.disabled, _disabled]);
|
|
1623
|
-
const className =
|
|
1570
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1624
1571
|
disabled,
|
|
1625
1572
|
error: formControl?.wrong,
|
|
1626
1573
|
focused: formControl?.focused && !disabled,
|
|
1627
1574
|
readonly: readOnly
|
|
1628
|
-
}, 'rls-field-file')
|
|
1575
|
+
}, 'rls-field-file');
|
|
1629
1576
|
const currentFile = useMemo(() => formControl?.value ?? value, [formControl?.value, value]);
|
|
1630
1577
|
const displayValue = useMemo(() => {
|
|
1631
1578
|
return currentFile?.name ?? '';
|
|
@@ -1706,13 +1653,11 @@ function RlsFieldListSuggestionsComponent({ elements, action, disabled, higher,
|
|
|
1706
1653
|
});
|
|
1707
1654
|
});
|
|
1708
1655
|
}, []);
|
|
1709
|
-
const className =
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
});
|
|
1715
|
-
}, [disabled, higher, visible]);
|
|
1656
|
+
const className = renderClassStatus('rls-field-list__suggestions', {
|
|
1657
|
+
disabled,
|
|
1658
|
+
higher,
|
|
1659
|
+
visible
|
|
1660
|
+
});
|
|
1716
1661
|
const onChangePattern = useCallback((event) => {
|
|
1717
1662
|
searchControl?.onChange(event.target.value);
|
|
1718
1663
|
}, [searchControl?.onChange]);
|
|
@@ -1732,14 +1677,12 @@ function RlsFieldMoneyComponent(props) {
|
|
|
1732
1677
|
const disabled = useMemo(() => {
|
|
1733
1678
|
return formControl?.disabled || props.disabled;
|
|
1734
1679
|
}, [formControl?.disabled, props.disabled]);
|
|
1735
|
-
const className =
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
}, 'rls-field-money');
|
|
1742
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1680
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1681
|
+
disabled,
|
|
1682
|
+
error: formControl?.wrong,
|
|
1683
|
+
focused: formControl?.focused && !disabled,
|
|
1684
|
+
readonly: props.readOnly
|
|
1685
|
+
}, 'rls-field-money');
|
|
1743
1686
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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(RlsInputMoney, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1744
1687
|
}
|
|
1745
1688
|
const RlsFieldMoney = memo(RlsFieldMoneyComponent);
|
|
@@ -1749,14 +1692,12 @@ function RlsFieldNumberComponent(props) {
|
|
|
1749
1692
|
const disabled = useMemo(() => {
|
|
1750
1693
|
return formControl?.disabled || props.disabled;
|
|
1751
1694
|
}, [formControl?.disabled, props.disabled]);
|
|
1752
|
-
const className =
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
}, 'rls-field-number');
|
|
1759
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1695
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1696
|
+
disabled,
|
|
1697
|
+
error: formControl?.wrong,
|
|
1698
|
+
focused: formControl?.focused && !disabled,
|
|
1699
|
+
readonly: props.readOnly
|
|
1700
|
+
}, 'rls-field-number');
|
|
1760
1701
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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(RlsInputNumber, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1761
1702
|
}
|
|
1762
1703
|
const RlsFieldNumber = memo(RlsFieldNumberComponent);
|
|
@@ -1767,14 +1708,12 @@ function RlsFieldPasswordComponent(props) {
|
|
|
1767
1708
|
const disabled = useMemo(() => {
|
|
1768
1709
|
return formControl?.disabled || props.disabled;
|
|
1769
1710
|
}, [formControl?.disabled, props.disabled]);
|
|
1770
|
-
const className =
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
}, 'rls-field-password');
|
|
1777
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1711
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1712
|
+
disabled,
|
|
1713
|
+
error: formControl?.wrong,
|
|
1714
|
+
focused: formControl?.focused && !disabled,
|
|
1715
|
+
readonly: props.readOnly
|
|
1716
|
+
}, 'rls-field-password');
|
|
1778
1717
|
const onTogglePassword = useCallback(() => {
|
|
1779
1718
|
setPasswordIsActive((password) => !password);
|
|
1780
1719
|
}, []);
|
|
@@ -1787,14 +1726,12 @@ function RlsFieldPercentageComponent(props) {
|
|
|
1787
1726
|
const disabled = useMemo(() => {
|
|
1788
1727
|
return formControl?.disabled || props.disabled;
|
|
1789
1728
|
}, [formControl?.disabled, props.disabled]);
|
|
1790
|
-
const className =
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
}, 'rls-field-percentage');
|
|
1797
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1729
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1730
|
+
disabled,
|
|
1731
|
+
error: formControl?.wrong,
|
|
1732
|
+
focused: formControl?.focused && !disabled,
|
|
1733
|
+
readonly: props.readOnly
|
|
1734
|
+
}, 'rls-field-percentage');
|
|
1798
1735
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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(RlsInputPercentage, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1799
1736
|
}
|
|
1800
1737
|
const RlsFieldPercentage = memo(RlsFieldPercentageComponent);
|
|
@@ -1809,14 +1746,12 @@ function RlsFieldTextComponent(props) {
|
|
|
1809
1746
|
const disabled = useMemo(() => {
|
|
1810
1747
|
return formControl?.disabled || props.disabled;
|
|
1811
1748
|
}, [formControl?.disabled, props.disabled]);
|
|
1812
|
-
const className =
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
}, 'rls-field-text');
|
|
1819
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1749
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1750
|
+
disabled,
|
|
1751
|
+
error: formControl?.wrong,
|
|
1752
|
+
focused: formControl?.focused && !disabled,
|
|
1753
|
+
readonly: props.readOnly
|
|
1754
|
+
}, 'rls-field-text');
|
|
1820
1755
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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(RlsInputText, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1821
1756
|
}
|
|
1822
1757
|
const RlsFieldText = memo(RlsFieldTextComponent);
|
|
@@ -1846,13 +1781,11 @@ function RlsLabelCheckBoxComponent({ children, disabled, extended, identifier, f
|
|
|
1846
1781
|
disabled,
|
|
1847
1782
|
formControl
|
|
1848
1783
|
});
|
|
1849
|
-
const className =
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
});
|
|
1855
|
-
}, [disabled, extended, reverse]);
|
|
1784
|
+
const className = renderClassStatus('rls-label-checkbox', {
|
|
1785
|
+
disabled,
|
|
1786
|
+
extended,
|
|
1787
|
+
reverse
|
|
1788
|
+
});
|
|
1856
1789
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__text", children: children })] }));
|
|
1857
1790
|
}
|
|
1858
1791
|
const RlsLabelCheckBox = memo(RlsLabelCheckBoxComponent);
|
|
@@ -1864,13 +1797,11 @@ function RlsLabelRadioButtonComponent({ children, disabled, extended, identifier
|
|
|
1864
1797
|
onValue,
|
|
1865
1798
|
value
|
|
1866
1799
|
});
|
|
1867
|
-
const className =
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
});
|
|
1873
|
-
}, [disabled, extended, reverse]);
|
|
1800
|
+
const className = renderClassStatus('rls-label-radiobutton', {
|
|
1801
|
+
disabled,
|
|
1802
|
+
extended,
|
|
1803
|
+
reverse
|
|
1804
|
+
});
|
|
1874
1805
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__component", onClick: onSelect, children: jsxRuntimeExports.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__text", children: children })] }));
|
|
1875
1806
|
}
|
|
1876
1807
|
const RlsLabelRadioButton = memo(RlsLabelRadioButtonComponent);
|
|
@@ -1880,21 +1811,17 @@ function RlsLabelSwitchComponent({ capsule, children, disabled, extended, identi
|
|
|
1880
1811
|
disabled,
|
|
1881
1812
|
formControl
|
|
1882
1813
|
});
|
|
1883
|
-
const className =
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
});
|
|
1889
|
-
}, [disabled, extended, reverse]);
|
|
1814
|
+
const className = renderClassStatus('rls-label-switch', {
|
|
1815
|
+
disabled,
|
|
1816
|
+
extended,
|
|
1817
|
+
reverse
|
|
1818
|
+
});
|
|
1890
1819
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-switch__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsSwitch, { checked: checked, capsule: capsule, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-switch__text", children: children })] }));
|
|
1891
1820
|
}
|
|
1892
1821
|
const RlsLabelSwitch = memo(RlsLabelSwitchComponent);
|
|
1893
1822
|
|
|
1894
1823
|
function RlsMessageEmptyComponent({ children, className, emoji, icon, identifier, image, rlsTheme, title }) {
|
|
1895
|
-
const classNameMessageEmpty =
|
|
1896
|
-
return renderClassStatus('rls-message-empty', {}, className);
|
|
1897
|
-
}, [className]);
|
|
1824
|
+
const classNameMessageEmpty = renderClassStatus('rls-message-empty', {}, className);
|
|
1898
1825
|
const logo = useMemo(() => {
|
|
1899
1826
|
if (icon) {
|
|
1900
1827
|
return (jsxRuntimeExports.jsx("div", { className: "rls-message-empty__logo", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
@@ -1928,7 +1855,9 @@ function RlsNavbarMenuComponent({ options, onOption }) {
|
|
|
1928
1855
|
const RlsNavbarMenu = memo(RlsNavbarMenuComponent);
|
|
1929
1856
|
|
|
1930
1857
|
function PageButton({ page, onSelect }) {
|
|
1931
|
-
const className =
|
|
1858
|
+
const className = renderClassStatus('rls-pagination__page', {
|
|
1859
|
+
active: page.active
|
|
1860
|
+
});
|
|
1932
1861
|
const onClick = useCallback(() => {
|
|
1933
1862
|
onSelect(page);
|
|
1934
1863
|
}, [page, onSelect]);
|
|
@@ -1982,15 +1911,13 @@ function RlsPickerDayHeaders() {
|
|
|
1982
1911
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
1983
1912
|
}
|
|
1984
1913
|
function RlsPickerDayElement({ day, onSelect, disabled }) {
|
|
1985
|
-
const className =
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
});
|
|
1993
|
-
}, [day, disabled]);
|
|
1914
|
+
const className = renderClassStatus('rls-picker-day__element', {
|
|
1915
|
+
disabled: day.disabled || disabled,
|
|
1916
|
+
focused: day.focused,
|
|
1917
|
+
forbidden: day.forbidden,
|
|
1918
|
+
selected: day.selected,
|
|
1919
|
+
today: day.today
|
|
1920
|
+
});
|
|
1994
1921
|
const onClick = useCallback(() => {
|
|
1995
1922
|
if (day.value && !day.disabled && !disabled) {
|
|
1996
1923
|
onSelect(day.value);
|
|
@@ -2057,15 +1984,13 @@ function RlsPickerDayRangeHeaders() {
|
|
|
2057
1984
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
2058
1985
|
}
|
|
2059
1986
|
function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
|
|
2060
|
-
const className =
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
});
|
|
2068
|
-
}, [day.disabled, day.end, day.forbidden, day.ranged, day.source, disabled]);
|
|
1987
|
+
const className = renderClassStatus('rls-picker-day-range__element', {
|
|
1988
|
+
disabled: day.disabled || disabled,
|
|
1989
|
+
end: day.end,
|
|
1990
|
+
forbidden: day.forbidden,
|
|
1991
|
+
ranged: day.ranged,
|
|
1992
|
+
source: day.source
|
|
1993
|
+
});
|
|
2069
1994
|
const onClick = useCallback(() => {
|
|
2070
1995
|
if (day.value && !day.disabled && !disabled) {
|
|
2071
1996
|
onSelect(day.value);
|
|
@@ -2118,13 +2043,11 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2118
2043
|
setLabel(MONTH_NAMES(month.value));
|
|
2119
2044
|
});
|
|
2120
2045
|
}, []);
|
|
2121
|
-
const className =
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
});
|
|
2127
|
-
}, [month.disabled, month.focused, month.selected, disabled]);
|
|
2046
|
+
const className = renderClassStatus('rls-picker-month__component', {
|
|
2047
|
+
disabled: month.disabled || disabled,
|
|
2048
|
+
focused: month.focused,
|
|
2049
|
+
selected: month.selected
|
|
2050
|
+
});
|
|
2128
2051
|
const onClick = useCallback(() => {
|
|
2129
2052
|
if (valueIsDefined(month.value) && !month.disabled && !disabled) {
|
|
2130
2053
|
onSelect(month.value);
|
|
@@ -2262,13 +2185,11 @@ function RlsPickerSelectorTitleComponent({ monthControl, type, yearControl, date
|
|
|
2262
2185
|
const RlsPickerSelectorTitle = memo(RlsPickerSelectorTitleComponent);
|
|
2263
2186
|
|
|
2264
2187
|
function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
2265
|
-
const className =
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
});
|
|
2271
|
-
}, [year.disabled, year.focused, year.selected, disabled]);
|
|
2188
|
+
const className = renderClassStatus('rls-picker-year__element', {
|
|
2189
|
+
disabled: year.disabled || disabled,
|
|
2190
|
+
focused: year.focused,
|
|
2191
|
+
selected: year.selected
|
|
2192
|
+
});
|
|
2272
2193
|
const onClick = useCallback(() => {
|
|
2273
2194
|
if (year.value && !year.disabled && !disabled) {
|
|
2274
2195
|
onSelect(year.value);
|
|
@@ -2344,13 +2265,11 @@ function RlsSliderComponent({ children, className, disabled, formControl, identi
|
|
|
2344
2265
|
const refTrack = useRef(null);
|
|
2345
2266
|
const refTrackOn = useRef(null);
|
|
2346
2267
|
const refThumb = useRef(null);
|
|
2347
|
-
const classNameSlider =
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
}, className);
|
|
2353
|
-
}, [valueSlider, minValueSlider, maxValueSlider, disabled]);
|
|
2268
|
+
const classNameSlider = renderClassStatus('rls-slider', {
|
|
2269
|
+
complet: valueSlider === maxValueSlider,
|
|
2270
|
+
disabled: disabled,
|
|
2271
|
+
empty: valueSlider === minValueSlider
|
|
2272
|
+
}, className);
|
|
2354
2273
|
useEffect(() => {
|
|
2355
2274
|
const valueInitial = formControl?.value ?? value ?? 0;
|
|
2356
2275
|
refThumb.current.style.left = `${rate}%`;
|
|
@@ -2380,12 +2299,10 @@ function RlsSliderComponent({ children, className, disabled, formControl, identi
|
|
|
2380
2299
|
const RlsSlider = memo(RlsSliderComponent);
|
|
2381
2300
|
|
|
2382
2301
|
function RlsTab({ onSelect, tab, value }) {
|
|
2383
|
-
const className =
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
});
|
|
2388
|
-
}, [tab, value]);
|
|
2302
|
+
const className = renderClassStatus('rls-tabs__children', {
|
|
2303
|
+
active: tab.value === value,
|
|
2304
|
+
disabled: tab.disabled
|
|
2305
|
+
});
|
|
2389
2306
|
const onClick = useCallback(() => {
|
|
2390
2307
|
if (!tab.disabled) {
|
|
2391
2308
|
onSelect(tab.value);
|
|
@@ -2417,9 +2334,7 @@ function RlsToolbarComponent({ actions, children, subtitle }) {
|
|
|
2417
2334
|
const RlsToolbar = memo(RlsToolbarComponent);
|
|
2418
2335
|
|
|
2419
2336
|
function RlsBottomSheetComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2420
|
-
const classNameSheet =
|
|
2421
|
-
return renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2422
|
-
}, [className, visible, controller?.visible]);
|
|
2337
|
+
const classNameSheet = renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2423
2338
|
const onClickBackdrop = useCallback(() => {
|
|
2424
2339
|
if (autoclose) {
|
|
2425
2340
|
controller?.close();
|
|
@@ -2431,9 +2346,7 @@ function RlsBottomSheetComponent({ autoclose, children, className, controller, o
|
|
|
2431
2346
|
const RlsBottomSheet = memo(RlsBottomSheetComponent);
|
|
2432
2347
|
|
|
2433
2348
|
function RlsCardComponent({ children, className, outline, rlsTheme }) {
|
|
2434
|
-
const classNameCard =
|
|
2435
|
-
return renderClassStatus('rls-card', { outline }, className);
|
|
2436
|
-
}, [outline, className]);
|
|
2349
|
+
const classNameCard = renderClassStatus('rls-card', { outline }, className);
|
|
2437
2350
|
return (jsxRuntimeExports.jsx("div", { className: classNameCard, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2438
2351
|
}
|
|
2439
2352
|
const RlsCard = memo(RlsCardComponent);
|
|
@@ -2447,9 +2360,7 @@ class ConfirmationResult extends SealedPartial {
|
|
|
2447
2360
|
}
|
|
2448
2361
|
}
|
|
2449
2362
|
function RlsConfirmationComponent({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2450
|
-
const classConfirmation =
|
|
2451
|
-
return renderClassStatus('rls-confirmation', { visible }, className);
|
|
2452
|
-
}, [visible, className]);
|
|
2363
|
+
const classConfirmation = renderClassStatus('rls-confirmation', { visible }, className);
|
|
2453
2364
|
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" })] }));
|
|
2454
2365
|
}
|
|
2455
2366
|
const RlsConfirmation = memo(RlsConfirmationComponent);
|
|
@@ -2479,7 +2390,7 @@ function useConfirmation() {
|
|
|
2479
2390
|
setVisible(false);
|
|
2480
2391
|
resolve(ConfirmationResult.reject());
|
|
2481
2392
|
},
|
|
2482
|
-
type: options.reject.type ?? '
|
|
2393
|
+
type: options.reject.type ?? 'flat',
|
|
2483
2394
|
disabled: options.reject.disabled,
|
|
2484
2395
|
identifier: options.reject.identifier,
|
|
2485
2396
|
rlsTheme: options.reject.rlsTheme
|
|
@@ -2520,12 +2431,10 @@ function useDatatable(table) {
|
|
|
2520
2431
|
|
|
2521
2432
|
function RlsDatatableComponent({ children, footer, header, identifier, rlsTheme, resizable, summary, table, toolbar }) {
|
|
2522
2433
|
const datatable = useDatatable(table);
|
|
2523
|
-
const className =
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
});
|
|
2528
|
-
}, [resizable, datatable.scrolleable]);
|
|
2434
|
+
const className = renderClassStatus('rls-datatable', {
|
|
2435
|
+
resizable,
|
|
2436
|
+
scrolleable: resizable && datatable?.scrolleable
|
|
2437
|
+
});
|
|
2529
2438
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [toolbar && jsxRuntimeExports.jsx("div", { className: "rls-datatable__toolbar", children: toolbar }), jsxRuntimeExports.jsx("div", { className: "rls-datatable__table", children: jsxRuntimeExports.jsxs("table", { id: identifier, children: [header && jsxRuntimeExports.jsx("thead", { className: "rls-datatable__head", children: header }), jsxRuntimeExports.jsx("tbody", { ref: datatable?.refTable, className: "rls-datatable__body", children: children })] }) }), summary && jsxRuntimeExports.jsx("div", { className: "rls-datatable__summary", children: summary }), footer && jsxRuntimeExports.jsx("div", { className: "rls-datatable__footer", children: footer })] }));
|
|
2530
2439
|
}
|
|
2531
2440
|
const RlsDatatable = memo(RlsDatatableComponent);
|
|
@@ -2534,61 +2443,45 @@ function RlsDatatableHeaderComponent({ children, identifier, rlsTheme }) {
|
|
|
2534
2443
|
}
|
|
2535
2444
|
const RlsDatatableHeader = memo(RlsDatatableHeaderComponent);
|
|
2536
2445
|
function RlsDatatableTitleComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2537
|
-
const classNameTitle =
|
|
2538
|
-
return renderClassStatus('rls-datatable__title', { actions, control, truncated }, className);
|
|
2539
|
-
}, [className, truncated, control, actions]);
|
|
2446
|
+
const classNameTitle = renderClassStatus('rls-datatable__title', { actions, control, truncated }, className);
|
|
2540
2447
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classNameTitle, "rls-theme": rlsTheme, children: children }));
|
|
2541
2448
|
}
|
|
2542
2449
|
const RlsDatatableTitle = memo(RlsDatatableTitleComponent);
|
|
2543
2450
|
function RlsDatatableSubheaderComponent({ children, className, identifier, rlsTheme }) {
|
|
2544
|
-
const classNameSubheader =
|
|
2545
|
-
return renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2546
|
-
}, [className]);
|
|
2451
|
+
const classNameSubheader = renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2547
2452
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameSubheader, "rls-theme": rlsTheme, children: children }));
|
|
2548
2453
|
}
|
|
2549
2454
|
const RlsDatatableSubheader = memo(RlsDatatableSubheaderComponent);
|
|
2550
2455
|
function RlsDatatableRecordComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2551
|
-
const classNameRecord =
|
|
2552
|
-
return renderClassStatus('rls-datatable__record', { error, info, truncated, success, warning }, className);
|
|
2553
|
-
}, [className, truncated, error, info, success, warning]);
|
|
2456
|
+
const classNameRecord = renderClassStatus('rls-datatable__record', { error, info, truncated, success, warning }, className);
|
|
2554
2457
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameRecord, "rls-theme": rlsTheme, children: children }));
|
|
2555
2458
|
}
|
|
2556
2459
|
const RlsDatatableRecord = memo(RlsDatatableRecordComponent);
|
|
2557
2460
|
function RlsDatatableTotalsComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2558
|
-
const classNameTotals =
|
|
2559
|
-
return renderClassStatus('rls-datatable__totals', { error, info, truncated, success, warning }, className);
|
|
2560
|
-
}, [className, truncated, error, info, success, warning]);
|
|
2461
|
+
const classNameTotals = renderClassStatus('rls-datatable__totals', { error, info, truncated, success, warning }, className);
|
|
2561
2462
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameTotals, "rls-theme": rlsTheme, children: children }));
|
|
2562
2463
|
}
|
|
2563
2464
|
const RlsDatatableTotals = memo(RlsDatatableTotalsComponent);
|
|
2564
2465
|
function RlsDatatableCellComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2565
|
-
const classNameCell =
|
|
2566
|
-
return renderClassStatus('rls-datatable__cell', { actions, control, truncated }, className);
|
|
2567
|
-
}, [className, truncated, control, actions]);
|
|
2466
|
+
const classNameCell = renderClassStatus('rls-datatable__cell', { actions, control, truncated }, className);
|
|
2568
2467
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameCell, "rls-theme": rlsTheme, children: children }));
|
|
2569
2468
|
}
|
|
2570
2469
|
const RlsDatatableCell = memo(RlsDatatableCellComponent);
|
|
2571
2470
|
function RlsDatatableDataComponent({ actions, children, className, control, identifier, truncated }) {
|
|
2572
|
-
const classNameData =
|
|
2573
|
-
return renderClassStatus('rls-datatable__data', { actions, control, truncated }, className);
|
|
2574
|
-
}, [className, truncated, control, actions]);
|
|
2471
|
+
const classNameData = renderClassStatus('rls-datatable__data', { actions, control, truncated }, className);
|
|
2575
2472
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameData, children: children }));
|
|
2576
2473
|
}
|
|
2577
2474
|
const RlsDatatableData = memo(RlsDatatableDataComponent);
|
|
2578
2475
|
function RlsDatatableFloatingComponent({ children, className, identifier, invested, rlsTheme }) {
|
|
2579
|
-
const classNameFloating =
|
|
2580
|
-
return renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2581
|
-
}, [className, invested]);
|
|
2476
|
+
const classNameFloating = renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2582
2477
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
2583
2478
|
}
|
|
2584
2479
|
const RlsDatatableFloating = memo(RlsDatatableFloatingComponent);
|
|
2585
2480
|
|
|
2586
2481
|
function RlsDropdownComponent({ children, controller, rlsTheme }) {
|
|
2587
|
-
const className =
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
});
|
|
2591
|
-
}, [controller.visible]);
|
|
2482
|
+
const className = renderClassStatus('rls-dropdown', {
|
|
2483
|
+
visible: controller.visible
|
|
2484
|
+
});
|
|
2592
2485
|
useEffect(() => {
|
|
2593
2486
|
function onCloseDropdown({ target }) {
|
|
2594
2487
|
if (!controller.component.current.contains(target)) {
|
|
@@ -2926,22 +2819,13 @@ function RlsFieldAutocompleteTemplateComponent(props) {
|
|
|
2926
2819
|
const disabled = useMemo(() => {
|
|
2927
2820
|
return formControl?.disabled || props.disabled;
|
|
2928
2821
|
}, [formControl?.disabled, props.disabled]);
|
|
2929
|
-
const className =
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2937
|
-
}, [
|
|
2938
|
-
formControl?.wrong,
|
|
2939
|
-
autocomplete.value,
|
|
2940
|
-
autocomplete.focused,
|
|
2941
|
-
props.className,
|
|
2942
|
-
props.readOnly,
|
|
2943
|
-
disabled
|
|
2944
|
-
]);
|
|
2822
|
+
const className = renderClassStatus('rls-field-box', {
|
|
2823
|
+
focused: autocomplete.focused && !disabled,
|
|
2824
|
+
error: formControl?.wrong,
|
|
2825
|
+
disabled,
|
|
2826
|
+
readonly: props.readOnly,
|
|
2827
|
+
selected: !!autocomplete.value
|
|
2828
|
+
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2945
2829
|
const onClickPattern = useCallback(() => {
|
|
2946
2830
|
onSearch?.(autocomplete.pattern);
|
|
2947
2831
|
}, [onSearch, autocomplete.pattern]);
|
|
@@ -2983,9 +2867,7 @@ function RlsFieldAutocompleteComponent(props) {
|
|
|
2983
2867
|
const RlsFieldAutocomplete = memo(RlsFieldAutocompleteComponent);
|
|
2984
2868
|
|
|
2985
2869
|
function RlsModalComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2986
|
-
const classNameModal =
|
|
2987
|
-
return renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2988
|
-
}, [className, visible, controller?.visible]);
|
|
2870
|
+
const classNameModal = renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2989
2871
|
const onClickBackdrop = useCallback(() => {
|
|
2990
2872
|
if (autoclose) {
|
|
2991
2873
|
controller?.close();
|
|
@@ -3056,26 +2938,18 @@ function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
|
3056
2938
|
const minuteFormat = useMemo(() => {
|
|
3057
2939
|
return formatTime(minute);
|
|
3058
2940
|
}, [minute]);
|
|
3059
|
-
const classNameHour =
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
active: !zoneIsPM
|
|
3072
|
-
});
|
|
3073
|
-
}, [zoneIsPM]);
|
|
3074
|
-
const classNamePM = useMemo(() => {
|
|
3075
|
-
return renderClassStatus('rls-picker-clock__zone__value', {
|
|
3076
|
-
active: zoneIsPM
|
|
3077
|
-
});
|
|
3078
|
-
}, [zoneIsPM]);
|
|
2941
|
+
const classNameHour = renderClassStatus('rls-picker-clock__title__value', {
|
|
2942
|
+
active: selectionIsHours
|
|
2943
|
+
});
|
|
2944
|
+
const classNameMinute = renderClassStatus('rls-picker-clock__title__value', {
|
|
2945
|
+
active: !selectionIsHours
|
|
2946
|
+
});
|
|
2947
|
+
const classNameAM = renderClassStatus('rls-picker-clock__zone__value', {
|
|
2948
|
+
active: !zoneIsPM
|
|
2949
|
+
});
|
|
2950
|
+
const classNamePM = renderClassStatus('rls-picker-clock__zone__value', {
|
|
2951
|
+
active: zoneIsPM
|
|
2952
|
+
});
|
|
3079
2953
|
const refreshClockHour = useEffectEvent(() => {
|
|
3080
2954
|
refreshClock(hour > 12 ? hour - 12 : hour);
|
|
3081
2955
|
});
|
|
@@ -3213,7 +3087,7 @@ function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
|
3213
3087
|
transform: `translate(${DIAL_RADIUS}rem, ${DIAL_RADIUS}rem)`
|
|
3214
3088
|
}, children: [jsxRuntimeExports.jsx("line", { ref: lineElement, className: "rls-picker-clock__canvas__line", x1: "-1", y1: "-1" }), jsxRuntimeExports.jsx("circle", { ref: centerElement, className: "rls-picker-clock__canvas__center", r: "4", cx: "-1", cy: "-1" }), jsxRuntimeExports.jsx("circle", { ref: indicatorElement, className: "rls-picker-clock__canvas__indicator", r: `${TICK_RADIUS}rem` }), jsxRuntimeExports.jsx("circle", { ref: pointElement, className: "rls-picker-clock__canvas__point", r: "3.5" })] }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__hours", children: CLOCK_VALUES.map((value) => {
|
|
3215
3089
|
return (jsxRuntimeExports.jsx(RlsPickerClockTick, { value: value, selectionIsHours: selectionIsHours, onValue: onClickValue }, value));
|
|
3216
|
-
}) })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.timeActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "timer", onClick: onCurrentTime }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "
|
|
3090
|
+
}) })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.timeActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "timer", onClick: onCurrentTime }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: labels.timeActionSelect }) })] })] }));
|
|
3217
3091
|
}
|
|
3218
3092
|
const RlsPickerClock = memo(RlsPickerClockComponent);
|
|
3219
3093
|
|
|
@@ -3232,12 +3106,10 @@ function RlsFieldClockComponent({ children, disabled: disabledProps, formControl
|
|
|
3232
3106
|
const disabled = useMemo(() => {
|
|
3233
3107
|
return formControl?.disabled || disabledProps;
|
|
3234
3108
|
}, [formControl?.disabled, disabledProps]);
|
|
3235
|
-
const className =
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
});
|
|
3240
|
-
}, [disabled, readOnly]);
|
|
3109
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3110
|
+
disabled,
|
|
3111
|
+
readonly: readOnly
|
|
3112
|
+
});
|
|
3241
3113
|
const timeValue = useMemo(() => {
|
|
3242
3114
|
return formControl ? formControl.value : value;
|
|
3243
3115
|
}, [formControl?.value, value]);
|
|
@@ -3273,7 +3145,7 @@ function RlsFieldClockComponent({ children, disabled: disabledProps, formControl
|
|
|
3273
3145
|
formControl?.touch();
|
|
3274
3146
|
setModalIsVisible(false);
|
|
3275
3147
|
}, [formControl, onChange]);
|
|
3276
|
-
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, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalClock, { visible: modalIsVisible, time: time, disabled: disabled, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3148
|
+
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, disabled: disabled }))] }) }), !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 })] }));
|
|
3277
3149
|
}
|
|
3278
3150
|
const RlsFieldClock = memo(RlsFieldClockComponent);
|
|
3279
3151
|
|
|
@@ -3485,7 +3357,7 @@ function RlsPickerColorComponent({ color, formControl, onListener, rlsTheme }) {
|
|
|
3485
3357
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-color", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__preview", children: jsxRuntimeExports.jsx("div", { ref: canvasRef, className: "rls-picker-color__canvas", style: canvasStyle, "data-slider": "canvas", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__indicator", style: {
|
|
3486
3358
|
left: indicatorPosition.left,
|
|
3487
3359
|
top: indicatorPosition.top
|
|
3488
|
-
}, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__indicator__circle", style: { backgroundColor: hexColor } }) }) }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__controls", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: hueRef, className: "rls-picker-color__slider__track", style: hueSliderStyle, "data-slider": "hue", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: hueIndicatorStyle }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: alphaRef, className: "rls-picker-color__slider__track rls-picker-color__slider__track--alpha", style: alphaSliderStyle, "data-slider": "alpha", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: alphaIndicatorStyle }) }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__hex", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__hex__swatch", style: { backgroundColor: hexColor } }), jsxRuntimeExports.jsx("span", { className: "rls-picker-color__hex__prefix", children: "#" }), jsxRuntimeExports.jsx("input", { className: "rls-picker-color__hex__input", type: "text", maxLength: 6, value: hexValue, onChange: onHexInputChange, onFocus: onHexFocus, onBlur: onHexBlur, onKeyDown: onHexKeyDown })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.colorActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "
|
|
3360
|
+
}, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__indicator__circle", style: { backgroundColor: hexColor } }) }) }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__controls", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: hueRef, className: "rls-picker-color__slider__track", style: hueSliderStyle, "data-slider": "hue", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: hueIndicatorStyle }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: alphaRef, className: "rls-picker-color__slider__track rls-picker-color__slider__track--alpha", style: alphaSliderStyle, "data-slider": "alpha", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: alphaIndicatorStyle }) }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__hex", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__hex__swatch", style: { backgroundColor: hexColor } }), jsxRuntimeExports.jsx("span", { className: "rls-picker-color__hex__prefix", children: "#" }), jsxRuntimeExports.jsx("input", { className: "rls-picker-color__hex__input", type: "text", maxLength: 6, value: hexValue, onChange: onHexInputChange, onFocus: onHexFocus, onBlur: onHexBlur, onKeyDown: onHexKeyDown })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.colorActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: labels.colorActionSelect }) })] })] }));
|
|
3489
3361
|
}
|
|
3490
3362
|
const RlsPickerColor = memo(RlsPickerColorComponent);
|
|
3491
3363
|
|
|
@@ -3498,12 +3370,10 @@ function RlsFieldColorComponent({ children, color, disabled: disabledProps, form
|
|
|
3498
3370
|
const disabled = useMemo(() => {
|
|
3499
3371
|
return formControl?.disabled || disabledProps;
|
|
3500
3372
|
}, [formControl?.disabled, disabledProps]);
|
|
3501
|
-
const className =
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
});
|
|
3506
|
-
}, [disabled, readOnly]);
|
|
3373
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3374
|
+
disabled,
|
|
3375
|
+
readonly: readOnly
|
|
3376
|
+
});
|
|
3507
3377
|
const displayHex = useMemo(() => {
|
|
3508
3378
|
const hex = colorValue && hexIsValid(colorValue) ? colorValue : '';
|
|
3509
3379
|
return normalizeHex(hex);
|
|
@@ -3534,7 +3404,7 @@ function RlsFieldColorComponent({ children, color, disabled: disabledProps, form
|
|
|
3534
3404
|
formControl?.touch();
|
|
3535
3405
|
setModalIsVisible(false);
|
|
3536
3406
|
}, [formControl, onChange]);
|
|
3537
|
-
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: [displayHex && (jsxRuntimeExports.jsx("div", { className: "rls-field-color__swatch", style: { backgroundColor: displayHex } })), jsxRuntimeExports.jsx("input", { className: "rls-field-color__control", type: "text", value: displayHex, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: colorValue ? 'trash-2' : 'color-palette', onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-
|
|
3407
|
+
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: [displayHex && (jsxRuntimeExports.jsx("div", { className: "rls-field-color__swatch", style: { backgroundColor: displayHex } })), jsxRuntimeExports.jsx("input", { className: "rls-field-color__control", type: "text", value: displayHex, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: colorValue ? 'trash-2' : 'color-palette', onClick: onClickAction, disabled: disabled }))] }) }), !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 }) })] }));
|
|
3538
3408
|
}
|
|
3539
3409
|
const RlsFieldColor = memo(RlsFieldColorComponent);
|
|
3540
3410
|
|
|
@@ -3559,13 +3429,11 @@ function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDat
|
|
|
3559
3429
|
const value = useMemo(() => {
|
|
3560
3430
|
return new Date(yearControl.value, monthControl.value, dayControl.value);
|
|
3561
3431
|
}, [yearControl.value, monthControl.value, dayControl.value]);
|
|
3562
|
-
const classNameComponent =
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
});
|
|
3568
|
-
}, [visibility]);
|
|
3432
|
+
const classNameComponent = renderClassStatus('rls-picker-date__component', {
|
|
3433
|
+
day: visibility === 'DAY',
|
|
3434
|
+
month: visibility === 'MONTH',
|
|
3435
|
+
year: visibility === 'YEAR'
|
|
3436
|
+
});
|
|
3569
3437
|
const title = useMemo(() => {
|
|
3570
3438
|
return dateFormatTemplate(value, DATE_FORMAT_TITLE);
|
|
3571
3439
|
}, [value]);
|
|
@@ -3619,7 +3487,7 @@ function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDat
|
|
|
3619
3487
|
value: value
|
|
3620
3488
|
});
|
|
3621
3489
|
}, [formControl, value, onListener]);
|
|
3622
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDay, { formControl: dayControl, date: value, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), !automatic && (jsxRuntimeExports.jsx("div", { className: "rls-picker-date__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "calendar", onClick: onToday, disabled: itIsDisabledToday }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "
|
|
3490
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDay, { formControl: dayControl, date: value, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), !automatic && (jsxRuntimeExports.jsx("div", { className: "rls-picker-date__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "calendar", onClick: onToday, disabled: itIsDisabledToday }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: labels.dateActionSelect }) })] }) }))] }));
|
|
3623
3491
|
}
|
|
3624
3492
|
const RlsPickerDate = memo(RlsPickerDateComponent);
|
|
3625
3493
|
|
|
@@ -3633,18 +3501,16 @@ function RlsModalDateComponent({ automatic, controller, date, disabled, formCont
|
|
|
3633
3501
|
const RlsModalDate = memo(RlsModalDateComponent);
|
|
3634
3502
|
|
|
3635
3503
|
function RlsFieldDateComponent({ children, date, disabled: disabledProps, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3636
|
-
const today =
|
|
3504
|
+
const today = useMemo(() => new Date(), []);
|
|
3637
3505
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3638
3506
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3639
3507
|
const disabled = useMemo(() => {
|
|
3640
3508
|
return formControl?.disabled || disabledProps;
|
|
3641
3509
|
}, [formControl?.disabled, disabledProps]);
|
|
3642
|
-
const className =
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
});
|
|
3647
|
-
}, [disabled, readOnly]);
|
|
3510
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3511
|
+
disabled,
|
|
3512
|
+
readonly: readOnly
|
|
3513
|
+
});
|
|
3648
3514
|
const dateValue = useMemo(() => {
|
|
3649
3515
|
return formControl ? formControl.value : value;
|
|
3650
3516
|
}, [formControl?.value, value]);
|
|
@@ -3658,7 +3524,7 @@ function RlsFieldDateComponent({ children, date, disabled: disabledProps, formCo
|
|
|
3658
3524
|
}, [dateValue, format]);
|
|
3659
3525
|
useEffect(() => {
|
|
3660
3526
|
const dateSecure = verifyDateRange({
|
|
3661
|
-
date: formControl?.value ?? date ?? today
|
|
3527
|
+
date: formControl?.value ?? date ?? today,
|
|
3662
3528
|
minDate,
|
|
3663
3529
|
maxDate
|
|
3664
3530
|
});
|
|
@@ -3691,7 +3557,7 @@ function RlsFieldDateComponent({ children, date, disabled: disabledProps, formCo
|
|
|
3691
3557
|
formControl?.touch();
|
|
3692
3558
|
setModalIsVisible(false);
|
|
3693
3559
|
}, [formControl, onChange]);
|
|
3694
|
-
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, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDate, { visible: modalIsVisible, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3560
|
+
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, disabled: disabled }))] }) }), !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 })] }));
|
|
3695
3561
|
}
|
|
3696
3562
|
const RlsFieldDate = memo(RlsFieldDateComponent);
|
|
3697
3563
|
|
|
@@ -3725,16 +3591,14 @@ function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, fo
|
|
|
3725
3591
|
}
|
|
3726
3592
|
return value;
|
|
3727
3593
|
}, [_date, yearControl.value, monthControl.value]);
|
|
3728
|
-
const classNameComponent =
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
return renderClassStatus('rls-picker-date-range__footer', { automatic });
|
|
3737
|
-
}, [automatic]);
|
|
3594
|
+
const classNameComponent = renderClassStatus('rls-picker-date-range__component', {
|
|
3595
|
+
day: visibility === 'DAY',
|
|
3596
|
+
month: visibility === 'MONTH',
|
|
3597
|
+
year: visibility === 'YEAR'
|
|
3598
|
+
});
|
|
3599
|
+
const classNameFooter = renderClassStatus('rls-picker-date-range__footer', {
|
|
3600
|
+
automatic
|
|
3601
|
+
});
|
|
3738
3602
|
const title = useMemo(() => rangeFormatTemplate(value), [value]);
|
|
3739
3603
|
useEffect(() => {
|
|
3740
3604
|
return i18nSubscribe(() => {
|
|
@@ -3765,7 +3629,7 @@ function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, fo
|
|
|
3765
3629
|
formControl?.setValue(value);
|
|
3766
3630
|
onListener?.({ event: PickerListenerEvent.Select, value });
|
|
3767
3631
|
}, [formControl, value, onListener]);
|
|
3768
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: visibility === 'MONTH' ? 'year' : 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDayRange, { formControl: rangeControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntimeExports.jsx("div", { className: classNameFooter, children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "
|
|
3632
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: visibility === 'MONTH' ? 'year' : 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDayRange, { formControl: rangeControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntimeExports.jsx("div", { className: classNameFooter, children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: labels.dateActionSelect }) })] }) })] }));
|
|
3769
3633
|
}
|
|
3770
3634
|
const RlsPickerDateRange = memo(RlsPickerDateRangeComponent);
|
|
3771
3635
|
|
|
@@ -3785,12 +3649,10 @@ function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, f
|
|
|
3785
3649
|
const disabled = useMemo(() => {
|
|
3786
3650
|
return formControl?.disabled || disabledProps;
|
|
3787
3651
|
}, [formControl?.disabled, disabledProps]);
|
|
3788
|
-
const className =
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
});
|
|
3793
|
-
}, [disabled, readOnly]);
|
|
3652
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3653
|
+
disabled,
|
|
3654
|
+
readonly: readOnly
|
|
3655
|
+
});
|
|
3794
3656
|
const dateRangeValue = useMemo(() => {
|
|
3795
3657
|
return formControl ? formControl.value : value;
|
|
3796
3658
|
}, [formControl?.value, value]);
|
|
@@ -3826,7 +3688,7 @@ function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, f
|
|
|
3826
3688
|
formControl?.touch();
|
|
3827
3689
|
setModalIsVisible(false);
|
|
3828
3690
|
}, [formControl, onChange]);
|
|
3829
|
-
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, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDateRange, { visible: modalIsVisible, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3691
|
+
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, disabled: disabled }))] }) }), !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 })] }));
|
|
3830
3692
|
}
|
|
3831
3693
|
const RlsFieldDateRange = memo(RlsFieldDateRangeComponent);
|
|
3832
3694
|
|
|
@@ -3968,20 +3830,12 @@ function RlsFieldListInner({ render, suggestions, action, children, formControl,
|
|
|
3968
3830
|
const disabled = useMemo(() => {
|
|
3969
3831
|
return formControl?.disabled || props.disabled;
|
|
3970
3832
|
}, [formControl?.disabled, props.disabled]);
|
|
3971
|
-
const className =
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
}, `rls-field-list rls-field-list__multi ${props.className ?? ''}`);
|
|
3978
|
-
}, [
|
|
3979
|
-
formControl?.wrong,
|
|
3980
|
-
fieldList.listIsVisible,
|
|
3981
|
-
props.className,
|
|
3982
|
-
props.readOnly,
|
|
3983
|
-
disabled
|
|
3984
|
-
]);
|
|
3833
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3834
|
+
focused: fieldList.listIsVisible && !disabled,
|
|
3835
|
+
error: formControl?.wrong,
|
|
3836
|
+
disabled,
|
|
3837
|
+
readonly: props.readOnly
|
|
3838
|
+
}, `rls-field-list rls-field-list__multi ${props.className ?? ''}`);
|
|
3985
3839
|
const renderWithCheckbox = useCallback((element) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__element", children: [jsxRuntimeExports.jsx(RlsCheckBox, { checked: fieldList.isSelected(element) }), render(element)] })), [fieldList.isSelected, render]);
|
|
3986
3840
|
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), disabled: disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) }))] }, index)))) }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-down", onClick: fieldList.onClickAction, disabled: disabled }))] }) }), !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 })] }));
|
|
3987
3841
|
}
|
|
@@ -4111,20 +3965,12 @@ function RlsFieldSelectTemplateComponent(props) {
|
|
|
4111
3965
|
const disabled = useMemo(() => {
|
|
4112
3966
|
return formControl?.disabled || props.disabled;
|
|
4113
3967
|
}, [formControl?.disabled, props.disabled]);
|
|
4114
|
-
const className =
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
4121
|
-
}, [
|
|
4122
|
-
formControl?.wrong,
|
|
4123
|
-
select.focused,
|
|
4124
|
-
props.className,
|
|
4125
|
-
props.readOnly,
|
|
4126
|
-
disabled
|
|
4127
|
-
]);
|
|
3968
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3969
|
+
focused: select.focused && !disabled,
|
|
3970
|
+
error: formControl?.wrong,
|
|
3971
|
+
disabled: disabled,
|
|
3972
|
+
readonly: props.readOnly
|
|
3973
|
+
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
4128
3974
|
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, disabled: disabled }))] }) }), !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 })] }));
|
|
4129
3975
|
}
|
|
4130
3976
|
const RlsFieldSelectTemplate = memo(RlsFieldSelectTemplateComponent);
|
|
@@ -4135,9 +3981,7 @@ function RlsFieldSelectComponent(props) {
|
|
|
4135
3981
|
const RlsFieldSelect = memo(RlsFieldSelectComponent);
|
|
4136
3982
|
|
|
4137
3983
|
function RlsFormNavigationComponent({ children, className, controller, visible, rlsTheme }) {
|
|
4138
|
-
const classNameForm =
|
|
4139
|
-
return renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4140
|
-
}, [className, visible, controller?.visible]);
|
|
3984
|
+
const classNameForm = renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4141
3985
|
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: classNameForm, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__component", children: children }) }), document.body);
|
|
4142
3986
|
}
|
|
4143
3987
|
const RlsFormNavigation = memo(RlsFormNavigationComponent);
|
|
@@ -4585,9 +4429,7 @@ function RlsImageChooserComponent(props) {
|
|
|
4585
4429
|
const RlsImageChooser = memo(RlsImageChooserComponent);
|
|
4586
4430
|
|
|
4587
4431
|
function RlsModalSheetComponent({ autoclose, children, className, controller, onAutoClose, visible, rlsTheme }) {
|
|
4588
|
-
const classNameModal =
|
|
4589
|
-
return renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4590
|
-
}, [className, visible, controller?.visible]);
|
|
4432
|
+
const classNameModal = renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4591
4433
|
const onClickBackdrop = useCallback(() => {
|
|
4592
4434
|
if (autoclose) {
|
|
4593
4435
|
controller?.close();
|
|
@@ -4605,9 +4447,7 @@ function generateId() {
|
|
|
4605
4447
|
return `rls-notification-${++_id}`;
|
|
4606
4448
|
}
|
|
4607
4449
|
function RlsNotification({ content, icon, onClose, rlsTheme, title, visible }) {
|
|
4608
|
-
const className =
|
|
4609
|
-
return renderClassStatus('rls-notification', { visible });
|
|
4610
|
-
}, [visible]);
|
|
4450
|
+
const className = renderClassStatus('rls-notification', { visible });
|
|
4611
4451
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-notification__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-notification__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-notification__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-notification__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-notification__content", children: content })] })] }));
|
|
4612
4452
|
}
|
|
4613
4453
|
function useNotifications() {
|
|
@@ -4638,14 +4478,24 @@ function useNotifications() {
|
|
|
4638
4478
|
const duration = config.duration ?? DURATION_DEFAULT;
|
|
4639
4479
|
setNotifications((notifications) => [
|
|
4640
4480
|
...notifications,
|
|
4641
|
-
{ id, config, visible:
|
|
4481
|
+
{ id, config, visible: false }
|
|
4642
4482
|
]);
|
|
4483
|
+
requestAnimationFrame(() => {
|
|
4484
|
+
requestAnimationFrame(() => {
|
|
4485
|
+
setNotifications((notifications) => notifications.map((notification) => notification.id === id
|
|
4486
|
+
? { ...notification, visible: true }
|
|
4487
|
+
: notification));
|
|
4488
|
+
});
|
|
4489
|
+
});
|
|
4643
4490
|
const timer = setTimeout(() => {
|
|
4644
4491
|
remove(id);
|
|
4645
4492
|
}, duration);
|
|
4646
4493
|
timersRef.current.set(id, timer);
|
|
4647
4494
|
}, [remove]);
|
|
4648
|
-
const
|
|
4495
|
+
const className = renderClassStatus('rls-notifications', {
|
|
4496
|
+
visible: notifications.length > 0
|
|
4497
|
+
});
|
|
4498
|
+
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);
|
|
4649
4499
|
return {
|
|
4650
4500
|
RlsNotifications,
|
|
4651
4501
|
notify
|
|
@@ -4668,9 +4518,7 @@ function calculateDuration({ length }) {
|
|
|
4668
4518
|
return duration + DURATION_RESET;
|
|
4669
4519
|
}
|
|
4670
4520
|
function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible }) {
|
|
4671
|
-
const className =
|
|
4672
|
-
return renderClassStatus('rls-snackbar', { visible });
|
|
4673
|
-
}, [visible]);
|
|
4521
|
+
const className = renderClassStatus('rls-snackbar', { visible });
|
|
4674
4522
|
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 })] })] }));
|
|
4675
4523
|
}
|
|
4676
4524
|
const RlsSnackbar = memo(RlsSnackbarComponent);
|
|
@@ -4733,13 +4581,11 @@ function RlsApplication({ children }) {
|
|
|
4733
4581
|
const [navbarInApp, setNavbarInApp] = useState(false);
|
|
4734
4582
|
const [navbarIsCondense, setNavbarIsCondense] = useState(false);
|
|
4735
4583
|
const [appIsMobile, setIsMobile] = useState(false);
|
|
4736
|
-
const className =
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
});
|
|
4742
|
-
}, [appIsMobile, navbarInApp, navbarIsCondense]);
|
|
4584
|
+
const className = renderClassStatus('rls-app__body', {
|
|
4585
|
+
mobile: appIsMobile,
|
|
4586
|
+
'navbar-snackbar': navbarInApp,
|
|
4587
|
+
'navbar-condense': navbarIsCondense
|
|
4588
|
+
});
|
|
4743
4589
|
const state = useMemo(() => ({
|
|
4744
4590
|
confirmation,
|
|
4745
4591
|
notify,
|
|
@@ -4754,7 +4600,7 @@ function RlsApplication({ children }) {
|
|
|
4754
4600
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
4755
4601
|
|
|
4756
4602
|
const DESIGN_SYSTEM_PREFIX = 'rls-design-system';
|
|
4757
|
-
const DESIGN_SYSTEMS = ['bordered', 'filled'];
|
|
4603
|
+
const DESIGN_SYSTEMS = ['bordered', 'filled', 'gradient'];
|
|
4758
4604
|
function designSystemClass(designSystem) {
|
|
4759
4605
|
return `${DESIGN_SYSTEM_PREFIX}-${designSystem}`;
|
|
4760
4606
|
}
|