@rolster/react-components 19.7.0 → 19.7.2
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 +265 -420
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +265 -420
- 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.js +6 -4
- 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.js +2 -4
- 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,35 @@ 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
540
|
function RlsAvatarComponent({ children, contrasted, rounded, skeleton, rlsTheme }) {
|
|
553
|
-
const className =
|
|
554
|
-
|
|
555
|
-
|
|
541
|
+
const className = renderClassStatus('rls-avatar', {
|
|
542
|
+
contrasted,
|
|
543
|
+
rounded,
|
|
544
|
+
skeleton
|
|
545
|
+
});
|
|
556
546
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
557
547
|
}
|
|
558
548
|
const RlsAvatar = memo(RlsAvatarComponent);
|
|
559
549
|
|
|
560
550
|
function RlsBadgeComponent({ children, contrasted, rlsTheme }) {
|
|
561
|
-
const className =
|
|
562
|
-
return renderClassStatus('rls-badge', { contrasted });
|
|
563
|
-
}, [contrasted]);
|
|
551
|
+
const className = renderClassStatus('rls-badge', { contrasted });
|
|
564
552
|
return (jsxRuntimeExports.jsx("span", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
565
553
|
}
|
|
566
554
|
const RlsBadge = memo(RlsBadgeComponent);
|
|
567
555
|
|
|
568
556
|
function RlsBreadcrumbLabel({ label }) {
|
|
569
|
-
const className =
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
});
|
|
573
|
-
}, [label.onClick]);
|
|
557
|
+
const className = renderClassStatus('rls-breadcrumb__label__a', {
|
|
558
|
+
actionable: !!label.onClick
|
|
559
|
+
});
|
|
574
560
|
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
561
|
}
|
|
576
562
|
function RlsBreadcrumbComponent({ labels }) {
|
|
@@ -582,9 +568,7 @@ function RlsBreadcrumbComponent({ labels }) {
|
|
|
582
568
|
const RlsBreadcrumb = memo(RlsBreadcrumbComponent);
|
|
583
569
|
|
|
584
570
|
function RlsIconComponent({ value, className, rlsTheme, skeleton }) {
|
|
585
|
-
const classNameIcon =
|
|
586
|
-
return renderClassStatus('rls-icon', { skeleton }, className);
|
|
587
|
-
}, [className, skeleton]);
|
|
571
|
+
const classNameIcon = renderClassStatus('rls-icon', { skeleton }, className);
|
|
588
572
|
return (jsxRuntimeExports.jsx("div", { className: classNameIcon, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
589
573
|
}
|
|
590
574
|
const RlsIcon = memo(RlsIconComponent);
|
|
@@ -595,25 +579,19 @@ function RlsSpinnerComponent() {
|
|
|
595
579
|
const RlsSpinner = memo(RlsSpinnerComponent);
|
|
596
580
|
|
|
597
581
|
function RlsButtonComponent({ type, children, disabled, identifier, onClick, prefixIcon, requesting, rlsTheme, suffixIcon }) {
|
|
598
|
-
const className =
|
|
599
|
-
return renderClassStatus('rls-button__content', { type });
|
|
600
|
-
}, [type]);
|
|
582
|
+
const className = renderClassStatus('rls-button__content', { type });
|
|
601
583
|
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
584
|
}
|
|
603
585
|
const RlsButton = memo(RlsButtonComponent);
|
|
604
586
|
|
|
605
587
|
function RlsButtonActionComponent({ icon, disabled, identifier, onClick, rlsTheme, tooltip, type }) {
|
|
606
|
-
const className =
|
|
607
|
-
return renderClassStatus('rls-button-action', { type });
|
|
608
|
-
}, [type]);
|
|
588
|
+
const className = renderClassStatus('rls-button-action', { type });
|
|
609
589
|
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 }) }))] }));
|
|
610
590
|
}
|
|
611
591
|
const RlsButtonAction = memo(RlsButtonActionComponent);
|
|
612
592
|
|
|
613
593
|
function RlsButtonIconComponent({ icon, className, disabled, onClick, skeleton }) {
|
|
614
|
-
const classNameButton =
|
|
615
|
-
return renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
616
|
-
}, [className, skeleton]);
|
|
594
|
+
const classNameButton = renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
617
595
|
return (jsxRuntimeExports.jsx("button", { className: classNameButton, onClick: onClick, disabled: disabled, children: !skeleton && jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
618
596
|
}
|
|
619
597
|
const RlsButtonIcon = memo(RlsButtonIconComponent);
|
|
@@ -639,9 +617,7 @@ function RlsButtonOptionComponent({ icon, children, disabled, formControl, ident
|
|
|
639
617
|
onValue,
|
|
640
618
|
value
|
|
641
619
|
});
|
|
642
|
-
const className =
|
|
643
|
-
return renderClassStatus('rls-button-option', { checked });
|
|
644
|
-
}, [checked]);
|
|
620
|
+
const className = renderClassStatus('rls-button-option', { checked });
|
|
645
621
|
const onAction = useCallback(() => {
|
|
646
622
|
onSelect();
|
|
647
623
|
onClick?.();
|
|
@@ -651,9 +627,7 @@ function RlsButtonOptionComponent({ icon, children, disabled, formControl, ident
|
|
|
651
627
|
const RlsButtonOption = memo(RlsButtonOptionComponent);
|
|
652
628
|
|
|
653
629
|
function RlsCheckBoxComponent({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
654
|
-
const className =
|
|
655
|
-
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
656
|
-
}, [checked, disabled]);
|
|
630
|
+
const className = renderClassStatus('rls-checkbox', { checked, disabled });
|
|
657
631
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx(RlsIcon, { value: "checkmark" }) }));
|
|
658
632
|
}
|
|
659
633
|
const RlsCheckBox = memo(RlsCheckBoxComponent);
|
|
@@ -673,9 +647,7 @@ const RlsSkeleton = memo(RlsSkeletonComponent);
|
|
|
673
647
|
function RlsImageComponent({ src, rlsTheme }) {
|
|
674
648
|
const [srcIsComplet, setSrcIsComplet] = useState(false);
|
|
675
649
|
const refImage = useRef(null);
|
|
676
|
-
const className =
|
|
677
|
-
return renderClassStatus('rls-image', { complet: srcIsComplet });
|
|
678
|
-
}, [srcIsComplet]);
|
|
650
|
+
const className = renderClassStatus('rls-image', { complet: srcIsComplet });
|
|
679
651
|
useEffect(() => {
|
|
680
652
|
setSrcIsComplet(!!(src && refImage.current?.complete));
|
|
681
653
|
}, [src]);
|
|
@@ -729,12 +701,10 @@ function RlsInputComponent({ children, decimals, disabled, formControl, identifi
|
|
|
729
701
|
setFocused(() => false);
|
|
730
702
|
onBlur?.();
|
|
731
703
|
}, [formControl, onBlur]);
|
|
732
|
-
const className =
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
});
|
|
737
|
-
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
704
|
+
const className = renderClassStatus('rls-input', {
|
|
705
|
+
disabled: formControl?.disabled || disabled,
|
|
706
|
+
focused: formControl?.focused ?? focused
|
|
707
|
+
});
|
|
738
708
|
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
709
|
}
|
|
740
710
|
const RlsInput = memo(RlsInputComponent);
|
|
@@ -744,13 +714,11 @@ function RlsInputCounterComponent({ className, disabled, formControl, identifier
|
|
|
744
714
|
const [value, setValue] = useState(formControl?.value ?? valueProp ?? 0);
|
|
745
715
|
const [focused, setFocused] = useState(false);
|
|
746
716
|
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]);
|
|
717
|
+
const classNameCounter = renderClassStatus('rls-input-counter', {
|
|
718
|
+
disabled: _disabled,
|
|
719
|
+
focused: formControl?.focused ?? focused,
|
|
720
|
+
readonly: readOnly
|
|
721
|
+
}, className);
|
|
754
722
|
useEffect(() => {
|
|
755
723
|
if (!changeIsInternal.current && formControl) {
|
|
756
724
|
const counterValue = formControl.value;
|
|
@@ -865,12 +833,10 @@ function RlsInputPasswordComponent({ disabled, formControl, identifier, onEnter,
|
|
|
865
833
|
formControl?.blur();
|
|
866
834
|
setFocused(() => false);
|
|
867
835
|
}, [formControl]);
|
|
868
|
-
const className =
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
});
|
|
873
|
-
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
836
|
+
const className = renderClassStatus('rls-input-password', {
|
|
837
|
+
disabled: formControl?.disabled || disabled,
|
|
838
|
+
focused: formControl?.focused ?? focused
|
|
839
|
+
});
|
|
874
840
|
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
841
|
}
|
|
876
842
|
const RlsInputPassword = memo(RlsInputPasswordComponent);
|
|
@@ -890,9 +856,7 @@ const RlsInputPercentage = memo(RlsInputPercentageComponent);
|
|
|
890
856
|
|
|
891
857
|
function RlsInputSearchComponent({ formControl, disabled, identifier, onEnter, onSearch, placeholder }) {
|
|
892
858
|
const [value, setValue] = useState('');
|
|
893
|
-
const className =
|
|
894
|
-
return renderClassStatus('rls-input-search', { disabled });
|
|
895
|
-
}, [disabled]);
|
|
859
|
+
const className = renderClassStatus('rls-input-search', { disabled });
|
|
896
860
|
const onValue = useCallback((value) => {
|
|
897
861
|
if (!formControl) {
|
|
898
862
|
setValue(() => value);
|
|
@@ -1263,17 +1227,13 @@ function RlsMessageIconComponent({ icon, children, rlsTheme }) {
|
|
|
1263
1227
|
const RlsMessageIcon = memo(RlsMessageIconComponent);
|
|
1264
1228
|
|
|
1265
1229
|
function RlsPosterComponent({ children, contrasted, rlsTheme }) {
|
|
1266
|
-
const className =
|
|
1267
|
-
return renderClassStatus('rls-poster', { contrasted });
|
|
1268
|
-
}, [contrasted]);
|
|
1230
|
+
const className = renderClassStatus('rls-poster', { contrasted });
|
|
1269
1231
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1270
1232
|
}
|
|
1271
1233
|
const RlsPoster = memo(RlsPosterComponent);
|
|
1272
1234
|
|
|
1273
1235
|
function RlsProgressBarComponent({ indeterminate, percentage, rlsTheme }) {
|
|
1274
|
-
const className =
|
|
1275
|
-
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1276
|
-
}, [indeterminate]);
|
|
1236
|
+
const className = renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1277
1237
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage ?? 0}%` } }) }));
|
|
1278
1238
|
}
|
|
1279
1239
|
const RlsProgressBar = memo(RlsProgressBarComponent);
|
|
@@ -1284,9 +1244,7 @@ function RlsProgressCircularComponent({ rlsTheme }) {
|
|
|
1284
1244
|
const RlsProgressCircular = memo(RlsProgressCircularComponent);
|
|
1285
1245
|
|
|
1286
1246
|
function RlsRadioButtonComponent({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1287
|
-
const className =
|
|
1288
|
-
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1289
|
-
}, [checked, disabled]);
|
|
1247
|
+
const className = renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1290
1248
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1291
1249
|
}
|
|
1292
1250
|
const RlsRadioButton = memo(RlsRadioButtonComponent);
|
|
@@ -1297,9 +1255,11 @@ function RlsSkeletonTextComponent({ active, children, rlsTheme }) {
|
|
|
1297
1255
|
const RlsSkeletonText = memo(RlsSkeletonTextComponent);
|
|
1298
1256
|
|
|
1299
1257
|
function RlsSwitchComponent({ checked, capsule, disabled, identifier, onClick, rlsTheme }) {
|
|
1300
|
-
const className =
|
|
1301
|
-
|
|
1302
|
-
|
|
1258
|
+
const className = renderClassStatus('rls-switch', {
|
|
1259
|
+
checked,
|
|
1260
|
+
capsule,
|
|
1261
|
+
disabled
|
|
1262
|
+
});
|
|
1303
1263
|
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
1264
|
}
|
|
1305
1265
|
const RlsSwitch = memo(RlsSwitchComponent);
|
|
@@ -1316,9 +1276,7 @@ function RlsAccordionComponent({ bordered, children, className, disabled, identi
|
|
|
1316
1276
|
const [animating, setAnimating] = useState(false);
|
|
1317
1277
|
const contentRef = useRef(null);
|
|
1318
1278
|
const initializedRef = useRef(false);
|
|
1319
|
-
const classNameAccordion =
|
|
1320
|
-
return renderClassStatus('rls-accordion', { bordered, disabled, open, animating }, className);
|
|
1321
|
-
}, [animating, bordered, className, disabled, open]);
|
|
1279
|
+
const classNameAccordion = renderClassStatus('rls-accordion', { bordered, disabled, open, animating }, className);
|
|
1322
1280
|
const onClickHeader = useCallback(() => {
|
|
1323
1281
|
if (!disabled) {
|
|
1324
1282
|
setOpen((current) => {
|
|
@@ -1367,17 +1325,13 @@ function RlsAccordionComponent({ bordered, children, className, disabled, identi
|
|
|
1367
1325
|
const RlsAccordion = memo(RlsAccordionComponent);
|
|
1368
1326
|
|
|
1369
1327
|
function RlsAlertComponent({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1370
|
-
const className =
|
|
1371
|
-
return renderClassStatus('rls-alert', { bordered });
|
|
1372
|
-
}, [bordered]);
|
|
1328
|
+
const className = renderClassStatus('rls-alert', { bordered });
|
|
1373
1329
|
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
1330
|
}
|
|
1375
1331
|
const RlsAlert = memo(RlsAlertComponent);
|
|
1376
1332
|
|
|
1377
1333
|
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]);
|
|
1334
|
+
const classNameBallot = renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1381
1335
|
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
1336
|
}
|
|
1383
1337
|
const RlsBallot = memo(RlsBallotComponent);
|
|
@@ -1388,9 +1342,7 @@ function RlsBodyComponent({ children, identifier, rlsTheme }) {
|
|
|
1388
1342
|
const RlsBody = memo(RlsBodyComponent);
|
|
1389
1343
|
|
|
1390
1344
|
function RlsButtonProgressComponent({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1391
|
-
const className =
|
|
1392
|
-
return renderClassStatus('rls-button-progress', { progressing });
|
|
1393
|
-
}, [progressing]);
|
|
1345
|
+
const className = renderClassStatus('rls-button-progress', { progressing });
|
|
1394
1346
|
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
1347
|
}
|
|
1396
1348
|
const RlsButtonProgress = memo(RlsButtonProgressComponent);
|
|
@@ -1421,12 +1373,10 @@ function RlsButtonToggleComponent({ onAction, options, type, automatic, disabled
|
|
|
1421
1373
|
document.removeEventListener('click', onCloseMenu);
|
|
1422
1374
|
};
|
|
1423
1375
|
}, []);
|
|
1424
|
-
const classNameList =
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
});
|
|
1429
|
-
}, [visible]);
|
|
1376
|
+
const classNameList = renderClassStatus('rls-button-toggle__list', {
|
|
1377
|
+
hide: !visible,
|
|
1378
|
+
visible
|
|
1379
|
+
});
|
|
1430
1380
|
const onClickMenu = useCallback(() => {
|
|
1431
1381
|
setVisible((visible) => !visible);
|
|
1432
1382
|
}, []);
|
|
@@ -1588,14 +1538,12 @@ function RlsFieldAreaComponent(props) {
|
|
|
1588
1538
|
const disabled = useMemo(() => {
|
|
1589
1539
|
return formControl?.disabled || props.disabled;
|
|
1590
1540
|
}, [formControl?.disabled, props.disabled]);
|
|
1591
|
-
const className =
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
}, 'rls-field-area');
|
|
1598
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1541
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1542
|
+
disabled,
|
|
1543
|
+
error: formControl?.wrong,
|
|
1544
|
+
focused: formControl?.focused && !disabled,
|
|
1545
|
+
readonly: props.readOnly
|
|
1546
|
+
}, 'rls-field-area');
|
|
1599
1547
|
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
1548
|
}
|
|
1601
1549
|
const RlsFieldArea = memo(RlsFieldAreaComponent);
|
|
@@ -1605,14 +1553,12 @@ function RlsFieldDecimalComponent(props) {
|
|
|
1605
1553
|
const disabled = useMemo(() => {
|
|
1606
1554
|
return formControl?.disabled || props.disabled;
|
|
1607
1555
|
}, [formControl?.disabled, props.disabled]);
|
|
1608
|
-
const className =
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
}, 'rls-field-decimal');
|
|
1615
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1556
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1557
|
+
disabled,
|
|
1558
|
+
error: formControl?.wrong,
|
|
1559
|
+
focused: formControl?.focused && !disabled,
|
|
1560
|
+
readonly: props.readOnly
|
|
1561
|
+
}, 'rls-field-decimal');
|
|
1616
1562
|
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
1563
|
}
|
|
1618
1564
|
const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
@@ -1620,12 +1566,12 @@ const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
|
1620
1566
|
function RlsFieldFileComponent({ accept, children, disabled: _disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
|
|
1621
1567
|
const inputRef = useRef(null);
|
|
1622
1568
|
const disabled = useMemo(() => formControl?.disabled || _disabled, [formControl?.disabled, _disabled]);
|
|
1623
|
-
const className =
|
|
1569
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1624
1570
|
disabled,
|
|
1625
1571
|
error: formControl?.wrong,
|
|
1626
1572
|
focused: formControl?.focused && !disabled,
|
|
1627
1573
|
readonly: readOnly
|
|
1628
|
-
}, 'rls-field-file')
|
|
1574
|
+
}, 'rls-field-file');
|
|
1629
1575
|
const currentFile = useMemo(() => formControl?.value ?? value, [formControl?.value, value]);
|
|
1630
1576
|
const displayValue = useMemo(() => {
|
|
1631
1577
|
return currentFile?.name ?? '';
|
|
@@ -1706,13 +1652,11 @@ function RlsFieldListSuggestionsComponent({ elements, action, disabled, higher,
|
|
|
1706
1652
|
});
|
|
1707
1653
|
});
|
|
1708
1654
|
}, []);
|
|
1709
|
-
const className =
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
});
|
|
1715
|
-
}, [disabled, higher, visible]);
|
|
1655
|
+
const className = renderClassStatus('rls-field-list__suggestions', {
|
|
1656
|
+
disabled,
|
|
1657
|
+
higher,
|
|
1658
|
+
visible
|
|
1659
|
+
});
|
|
1716
1660
|
const onChangePattern = useCallback((event) => {
|
|
1717
1661
|
searchControl?.onChange(event.target.value);
|
|
1718
1662
|
}, [searchControl?.onChange]);
|
|
@@ -1732,14 +1676,12 @@ function RlsFieldMoneyComponent(props) {
|
|
|
1732
1676
|
const disabled = useMemo(() => {
|
|
1733
1677
|
return formControl?.disabled || props.disabled;
|
|
1734
1678
|
}, [formControl?.disabled, props.disabled]);
|
|
1735
|
-
const className =
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
}, 'rls-field-money');
|
|
1742
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1679
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1680
|
+
disabled,
|
|
1681
|
+
error: formControl?.wrong,
|
|
1682
|
+
focused: formControl?.focused && !disabled,
|
|
1683
|
+
readonly: props.readOnly
|
|
1684
|
+
}, 'rls-field-money');
|
|
1743
1685
|
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
1686
|
}
|
|
1745
1687
|
const RlsFieldMoney = memo(RlsFieldMoneyComponent);
|
|
@@ -1749,14 +1691,12 @@ function RlsFieldNumberComponent(props) {
|
|
|
1749
1691
|
const disabled = useMemo(() => {
|
|
1750
1692
|
return formControl?.disabled || props.disabled;
|
|
1751
1693
|
}, [formControl?.disabled, props.disabled]);
|
|
1752
|
-
const className =
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
}, 'rls-field-number');
|
|
1759
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1694
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1695
|
+
disabled,
|
|
1696
|
+
error: formControl?.wrong,
|
|
1697
|
+
focused: formControl?.focused && !disabled,
|
|
1698
|
+
readonly: props.readOnly
|
|
1699
|
+
}, 'rls-field-number');
|
|
1760
1700
|
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
1701
|
}
|
|
1762
1702
|
const RlsFieldNumber = memo(RlsFieldNumberComponent);
|
|
@@ -1767,14 +1707,12 @@ function RlsFieldPasswordComponent(props) {
|
|
|
1767
1707
|
const disabled = useMemo(() => {
|
|
1768
1708
|
return formControl?.disabled || props.disabled;
|
|
1769
1709
|
}, [formControl?.disabled, props.disabled]);
|
|
1770
|
-
const className =
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
}, 'rls-field-password');
|
|
1777
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1710
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1711
|
+
disabled,
|
|
1712
|
+
error: formControl?.wrong,
|
|
1713
|
+
focused: formControl?.focused && !disabled,
|
|
1714
|
+
readonly: props.readOnly
|
|
1715
|
+
}, 'rls-field-password');
|
|
1778
1716
|
const onTogglePassword = useCallback(() => {
|
|
1779
1717
|
setPasswordIsActive((password) => !password);
|
|
1780
1718
|
}, []);
|
|
@@ -1787,14 +1725,12 @@ function RlsFieldPercentageComponent(props) {
|
|
|
1787
1725
|
const disabled = useMemo(() => {
|
|
1788
1726
|
return formControl?.disabled || props.disabled;
|
|
1789
1727
|
}, [formControl?.disabled, props.disabled]);
|
|
1790
|
-
const className =
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
}, 'rls-field-percentage');
|
|
1797
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1728
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1729
|
+
disabled,
|
|
1730
|
+
error: formControl?.wrong,
|
|
1731
|
+
focused: formControl?.focused && !disabled,
|
|
1732
|
+
readonly: props.readOnly
|
|
1733
|
+
}, 'rls-field-percentage');
|
|
1798
1734
|
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
1735
|
}
|
|
1800
1736
|
const RlsFieldPercentage = memo(RlsFieldPercentageComponent);
|
|
@@ -1809,14 +1745,12 @@ function RlsFieldTextComponent(props) {
|
|
|
1809
1745
|
const disabled = useMemo(() => {
|
|
1810
1746
|
return formControl?.disabled || props.disabled;
|
|
1811
1747
|
}, [formControl?.disabled, props.disabled]);
|
|
1812
|
-
const className =
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
}, 'rls-field-text');
|
|
1819
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1748
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1749
|
+
disabled,
|
|
1750
|
+
error: formControl?.wrong,
|
|
1751
|
+
focused: formControl?.focused && !disabled,
|
|
1752
|
+
readonly: props.readOnly
|
|
1753
|
+
}, 'rls-field-text');
|
|
1820
1754
|
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
1755
|
}
|
|
1822
1756
|
const RlsFieldText = memo(RlsFieldTextComponent);
|
|
@@ -1846,13 +1780,11 @@ function RlsLabelCheckBoxComponent({ children, disabled, extended, identifier, f
|
|
|
1846
1780
|
disabled,
|
|
1847
1781
|
formControl
|
|
1848
1782
|
});
|
|
1849
|
-
const className =
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
});
|
|
1855
|
-
}, [disabled, extended, reverse]);
|
|
1783
|
+
const className = renderClassStatus('rls-label-checkbox', {
|
|
1784
|
+
disabled,
|
|
1785
|
+
extended,
|
|
1786
|
+
reverse
|
|
1787
|
+
});
|
|
1856
1788
|
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
1789
|
}
|
|
1858
1790
|
const RlsLabelCheckBox = memo(RlsLabelCheckBoxComponent);
|
|
@@ -1864,13 +1796,11 @@ function RlsLabelRadioButtonComponent({ children, disabled, extended, identifier
|
|
|
1864
1796
|
onValue,
|
|
1865
1797
|
value
|
|
1866
1798
|
});
|
|
1867
|
-
const className =
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
});
|
|
1873
|
-
}, [disabled, extended, reverse]);
|
|
1799
|
+
const className = renderClassStatus('rls-label-radiobutton', {
|
|
1800
|
+
disabled,
|
|
1801
|
+
extended,
|
|
1802
|
+
reverse
|
|
1803
|
+
});
|
|
1874
1804
|
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
1805
|
}
|
|
1876
1806
|
const RlsLabelRadioButton = memo(RlsLabelRadioButtonComponent);
|
|
@@ -1880,21 +1810,17 @@ function RlsLabelSwitchComponent({ capsule, children, disabled, extended, identi
|
|
|
1880
1810
|
disabled,
|
|
1881
1811
|
formControl
|
|
1882
1812
|
});
|
|
1883
|
-
const className =
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
});
|
|
1889
|
-
}, [disabled, extended, reverse]);
|
|
1813
|
+
const className = renderClassStatus('rls-label-switch', {
|
|
1814
|
+
disabled,
|
|
1815
|
+
extended,
|
|
1816
|
+
reverse
|
|
1817
|
+
});
|
|
1890
1818
|
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
1819
|
}
|
|
1892
1820
|
const RlsLabelSwitch = memo(RlsLabelSwitchComponent);
|
|
1893
1821
|
|
|
1894
1822
|
function RlsMessageEmptyComponent({ children, className, emoji, icon, identifier, image, rlsTheme, title }) {
|
|
1895
|
-
const classNameMessageEmpty =
|
|
1896
|
-
return renderClassStatus('rls-message-empty', {}, className);
|
|
1897
|
-
}, [className]);
|
|
1823
|
+
const classNameMessageEmpty = renderClassStatus('rls-message-empty', {}, className);
|
|
1898
1824
|
const logo = useMemo(() => {
|
|
1899
1825
|
if (icon) {
|
|
1900
1826
|
return (jsxRuntimeExports.jsx("div", { className: "rls-message-empty__logo", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
@@ -1928,7 +1854,9 @@ function RlsNavbarMenuComponent({ options, onOption }) {
|
|
|
1928
1854
|
const RlsNavbarMenu = memo(RlsNavbarMenuComponent);
|
|
1929
1855
|
|
|
1930
1856
|
function PageButton({ page, onSelect }) {
|
|
1931
|
-
const className =
|
|
1857
|
+
const className = renderClassStatus('rls-pagination__page', {
|
|
1858
|
+
active: page.active
|
|
1859
|
+
});
|
|
1932
1860
|
const onClick = useCallback(() => {
|
|
1933
1861
|
onSelect(page);
|
|
1934
1862
|
}, [page, onSelect]);
|
|
@@ -1982,15 +1910,13 @@ function RlsPickerDayHeaders() {
|
|
|
1982
1910
|
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
1911
|
}
|
|
1984
1912
|
function RlsPickerDayElement({ day, onSelect, disabled }) {
|
|
1985
|
-
const className =
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
});
|
|
1993
|
-
}, [day, disabled]);
|
|
1913
|
+
const className = renderClassStatus('rls-picker-day__element', {
|
|
1914
|
+
disabled: day.disabled || disabled,
|
|
1915
|
+
focused: day.focused,
|
|
1916
|
+
forbidden: day.forbidden,
|
|
1917
|
+
selected: day.selected,
|
|
1918
|
+
today: day.today
|
|
1919
|
+
});
|
|
1994
1920
|
const onClick = useCallback(() => {
|
|
1995
1921
|
if (day.value && !day.disabled && !disabled) {
|
|
1996
1922
|
onSelect(day.value);
|
|
@@ -2057,15 +1983,13 @@ function RlsPickerDayRangeHeaders() {
|
|
|
2057
1983
|
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
1984
|
}
|
|
2059
1985
|
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]);
|
|
1986
|
+
const className = renderClassStatus('rls-picker-day-range__element', {
|
|
1987
|
+
disabled: day.disabled || disabled,
|
|
1988
|
+
end: day.end,
|
|
1989
|
+
forbidden: day.forbidden,
|
|
1990
|
+
ranged: day.ranged,
|
|
1991
|
+
source: day.source
|
|
1992
|
+
});
|
|
2069
1993
|
const onClick = useCallback(() => {
|
|
2070
1994
|
if (day.value && !day.disabled && !disabled) {
|
|
2071
1995
|
onSelect(day.value);
|
|
@@ -2118,13 +2042,11 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2118
2042
|
setLabel(MONTH_NAMES(month.value));
|
|
2119
2043
|
});
|
|
2120
2044
|
}, []);
|
|
2121
|
-
const className =
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
});
|
|
2127
|
-
}, [month.disabled, month.focused, month.selected, disabled]);
|
|
2045
|
+
const className = renderClassStatus('rls-picker-month__component', {
|
|
2046
|
+
disabled: month.disabled || disabled,
|
|
2047
|
+
focused: month.focused,
|
|
2048
|
+
selected: month.selected
|
|
2049
|
+
});
|
|
2128
2050
|
const onClick = useCallback(() => {
|
|
2129
2051
|
if (valueIsDefined(month.value) && !month.disabled && !disabled) {
|
|
2130
2052
|
onSelect(month.value);
|
|
@@ -2262,13 +2184,11 @@ function RlsPickerSelectorTitleComponent({ monthControl, type, yearControl, date
|
|
|
2262
2184
|
const RlsPickerSelectorTitle = memo(RlsPickerSelectorTitleComponent);
|
|
2263
2185
|
|
|
2264
2186
|
function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
2265
|
-
const className =
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
});
|
|
2271
|
-
}, [year.disabled, year.focused, year.selected, disabled]);
|
|
2187
|
+
const className = renderClassStatus('rls-picker-year__element', {
|
|
2188
|
+
disabled: year.disabled || disabled,
|
|
2189
|
+
focused: year.focused,
|
|
2190
|
+
selected: year.selected
|
|
2191
|
+
});
|
|
2272
2192
|
const onClick = useCallback(() => {
|
|
2273
2193
|
if (year.value && !year.disabled && !disabled) {
|
|
2274
2194
|
onSelect(year.value);
|
|
@@ -2344,13 +2264,11 @@ function RlsSliderComponent({ children, className, disabled, formControl, identi
|
|
|
2344
2264
|
const refTrack = useRef(null);
|
|
2345
2265
|
const refTrackOn = useRef(null);
|
|
2346
2266
|
const refThumb = useRef(null);
|
|
2347
|
-
const classNameSlider =
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
}, className);
|
|
2353
|
-
}, [valueSlider, minValueSlider, maxValueSlider, disabled]);
|
|
2267
|
+
const classNameSlider = renderClassStatus('rls-slider', {
|
|
2268
|
+
complet: valueSlider === maxValueSlider,
|
|
2269
|
+
disabled: disabled,
|
|
2270
|
+
empty: valueSlider === minValueSlider
|
|
2271
|
+
}, className);
|
|
2354
2272
|
useEffect(() => {
|
|
2355
2273
|
const valueInitial = formControl?.value ?? value ?? 0;
|
|
2356
2274
|
refThumb.current.style.left = `${rate}%`;
|
|
@@ -2380,12 +2298,10 @@ function RlsSliderComponent({ children, className, disabled, formControl, identi
|
|
|
2380
2298
|
const RlsSlider = memo(RlsSliderComponent);
|
|
2381
2299
|
|
|
2382
2300
|
function RlsTab({ onSelect, tab, value }) {
|
|
2383
|
-
const className =
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
});
|
|
2388
|
-
}, [tab, value]);
|
|
2301
|
+
const className = renderClassStatus('rls-tabs__children', {
|
|
2302
|
+
active: tab.value === value,
|
|
2303
|
+
disabled: tab.disabled
|
|
2304
|
+
});
|
|
2389
2305
|
const onClick = useCallback(() => {
|
|
2390
2306
|
if (!tab.disabled) {
|
|
2391
2307
|
onSelect(tab.value);
|
|
@@ -2417,9 +2333,7 @@ function RlsToolbarComponent({ actions, children, subtitle }) {
|
|
|
2417
2333
|
const RlsToolbar = memo(RlsToolbarComponent);
|
|
2418
2334
|
|
|
2419
2335
|
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]);
|
|
2336
|
+
const classNameSheet = renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2423
2337
|
const onClickBackdrop = useCallback(() => {
|
|
2424
2338
|
if (autoclose) {
|
|
2425
2339
|
controller?.close();
|
|
@@ -2431,9 +2345,7 @@ function RlsBottomSheetComponent({ autoclose, children, className, controller, o
|
|
|
2431
2345
|
const RlsBottomSheet = memo(RlsBottomSheetComponent);
|
|
2432
2346
|
|
|
2433
2347
|
function RlsCardComponent({ children, className, outline, rlsTheme }) {
|
|
2434
|
-
const classNameCard =
|
|
2435
|
-
return renderClassStatus('rls-card', { outline }, className);
|
|
2436
|
-
}, [outline, className]);
|
|
2348
|
+
const classNameCard = renderClassStatus('rls-card', { outline }, className);
|
|
2437
2349
|
return (jsxRuntimeExports.jsx("div", { className: classNameCard, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2438
2350
|
}
|
|
2439
2351
|
const RlsCard = memo(RlsCardComponent);
|
|
@@ -2447,9 +2359,7 @@ class ConfirmationResult extends SealedPartial {
|
|
|
2447
2359
|
}
|
|
2448
2360
|
}
|
|
2449
2361
|
function RlsConfirmationComponent({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2450
|
-
const classConfirmation =
|
|
2451
|
-
return renderClassStatus('rls-confirmation', { visible }, className);
|
|
2452
|
-
}, [visible, className]);
|
|
2362
|
+
const classConfirmation = renderClassStatus('rls-confirmation', { visible }, className);
|
|
2453
2363
|
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
2364
|
}
|
|
2455
2365
|
const RlsConfirmation = memo(RlsConfirmationComponent);
|
|
@@ -2479,7 +2389,7 @@ function useConfirmation() {
|
|
|
2479
2389
|
setVisible(false);
|
|
2480
2390
|
resolve(ConfirmationResult.reject());
|
|
2481
2391
|
},
|
|
2482
|
-
type: options.reject.type ?? '
|
|
2392
|
+
type: options.reject.type ?? 'flat',
|
|
2483
2393
|
disabled: options.reject.disabled,
|
|
2484
2394
|
identifier: options.reject.identifier,
|
|
2485
2395
|
rlsTheme: options.reject.rlsTheme
|
|
@@ -2520,12 +2430,10 @@ function useDatatable(table) {
|
|
|
2520
2430
|
|
|
2521
2431
|
function RlsDatatableComponent({ children, footer, header, identifier, rlsTheme, resizable, summary, table, toolbar }) {
|
|
2522
2432
|
const datatable = useDatatable(table);
|
|
2523
|
-
const className =
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
});
|
|
2528
|
-
}, [resizable, datatable.scrolleable]);
|
|
2433
|
+
const className = renderClassStatus('rls-datatable', {
|
|
2434
|
+
resizable,
|
|
2435
|
+
scrolleable: resizable && datatable?.scrolleable
|
|
2436
|
+
});
|
|
2529
2437
|
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
2438
|
}
|
|
2531
2439
|
const RlsDatatable = memo(RlsDatatableComponent);
|
|
@@ -2534,61 +2442,45 @@ function RlsDatatableHeaderComponent({ children, identifier, rlsTheme }) {
|
|
|
2534
2442
|
}
|
|
2535
2443
|
const RlsDatatableHeader = memo(RlsDatatableHeaderComponent);
|
|
2536
2444
|
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]);
|
|
2445
|
+
const classNameTitle = renderClassStatus('rls-datatable__title', { actions, control, truncated }, className);
|
|
2540
2446
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classNameTitle, "rls-theme": rlsTheme, children: children }));
|
|
2541
2447
|
}
|
|
2542
2448
|
const RlsDatatableTitle = memo(RlsDatatableTitleComponent);
|
|
2543
2449
|
function RlsDatatableSubheaderComponent({ children, className, identifier, rlsTheme }) {
|
|
2544
|
-
const classNameSubheader =
|
|
2545
|
-
return renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2546
|
-
}, [className]);
|
|
2450
|
+
const classNameSubheader = renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2547
2451
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameSubheader, "rls-theme": rlsTheme, children: children }));
|
|
2548
2452
|
}
|
|
2549
2453
|
const RlsDatatableSubheader = memo(RlsDatatableSubheaderComponent);
|
|
2550
2454
|
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]);
|
|
2455
|
+
const classNameRecord = renderClassStatus('rls-datatable__record', { error, info, truncated, success, warning }, className);
|
|
2554
2456
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameRecord, "rls-theme": rlsTheme, children: children }));
|
|
2555
2457
|
}
|
|
2556
2458
|
const RlsDatatableRecord = memo(RlsDatatableRecordComponent);
|
|
2557
2459
|
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]);
|
|
2460
|
+
const classNameTotals = renderClassStatus('rls-datatable__totals', { error, info, truncated, success, warning }, className);
|
|
2561
2461
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameTotals, "rls-theme": rlsTheme, children: children }));
|
|
2562
2462
|
}
|
|
2563
2463
|
const RlsDatatableTotals = memo(RlsDatatableTotalsComponent);
|
|
2564
2464
|
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]);
|
|
2465
|
+
const classNameCell = renderClassStatus('rls-datatable__cell', { actions, control, truncated }, className);
|
|
2568
2466
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameCell, "rls-theme": rlsTheme, children: children }));
|
|
2569
2467
|
}
|
|
2570
2468
|
const RlsDatatableCell = memo(RlsDatatableCellComponent);
|
|
2571
2469
|
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]);
|
|
2470
|
+
const classNameData = renderClassStatus('rls-datatable__data', { actions, control, truncated }, className);
|
|
2575
2471
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameData, children: children }));
|
|
2576
2472
|
}
|
|
2577
2473
|
const RlsDatatableData = memo(RlsDatatableDataComponent);
|
|
2578
2474
|
function RlsDatatableFloatingComponent({ children, className, identifier, invested, rlsTheme }) {
|
|
2579
|
-
const classNameFloating =
|
|
2580
|
-
return renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2581
|
-
}, [className, invested]);
|
|
2475
|
+
const classNameFloating = renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2582
2476
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
2583
2477
|
}
|
|
2584
2478
|
const RlsDatatableFloating = memo(RlsDatatableFloatingComponent);
|
|
2585
2479
|
|
|
2586
2480
|
function RlsDropdownComponent({ children, controller, rlsTheme }) {
|
|
2587
|
-
const className =
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
});
|
|
2591
|
-
}, [controller.visible]);
|
|
2481
|
+
const className = renderClassStatus('rls-dropdown', {
|
|
2482
|
+
visible: controller.visible
|
|
2483
|
+
});
|
|
2592
2484
|
useEffect(() => {
|
|
2593
2485
|
function onCloseDropdown({ target }) {
|
|
2594
2486
|
if (!controller.component.current.contains(target)) {
|
|
@@ -2926,22 +2818,13 @@ function RlsFieldAutocompleteTemplateComponent(props) {
|
|
|
2926
2818
|
const disabled = useMemo(() => {
|
|
2927
2819
|
return formControl?.disabled || props.disabled;
|
|
2928
2820
|
}, [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
|
-
]);
|
|
2821
|
+
const className = renderClassStatus('rls-field-box', {
|
|
2822
|
+
focused: autocomplete.focused && !disabled,
|
|
2823
|
+
error: formControl?.wrong,
|
|
2824
|
+
disabled,
|
|
2825
|
+
readonly: props.readOnly,
|
|
2826
|
+
selected: !!autocomplete.value
|
|
2827
|
+
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2945
2828
|
const onClickPattern = useCallback(() => {
|
|
2946
2829
|
onSearch?.(autocomplete.pattern);
|
|
2947
2830
|
}, [onSearch, autocomplete.pattern]);
|
|
@@ -2983,9 +2866,7 @@ function RlsFieldAutocompleteComponent(props) {
|
|
|
2983
2866
|
const RlsFieldAutocomplete = memo(RlsFieldAutocompleteComponent);
|
|
2984
2867
|
|
|
2985
2868
|
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]);
|
|
2869
|
+
const classNameModal = renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2989
2870
|
const onClickBackdrop = useCallback(() => {
|
|
2990
2871
|
if (autoclose) {
|
|
2991
2872
|
controller?.close();
|
|
@@ -3056,26 +2937,18 @@ function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
|
3056
2937
|
const minuteFormat = useMemo(() => {
|
|
3057
2938
|
return formatTime(minute);
|
|
3058
2939
|
}, [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]);
|
|
2940
|
+
const classNameHour = renderClassStatus('rls-picker-clock__title__value', {
|
|
2941
|
+
active: selectionIsHours
|
|
2942
|
+
});
|
|
2943
|
+
const classNameMinute = renderClassStatus('rls-picker-clock__title__value', {
|
|
2944
|
+
active: !selectionIsHours
|
|
2945
|
+
});
|
|
2946
|
+
const classNameAM = renderClassStatus('rls-picker-clock__zone__value', {
|
|
2947
|
+
active: !zoneIsPM
|
|
2948
|
+
});
|
|
2949
|
+
const classNamePM = renderClassStatus('rls-picker-clock__zone__value', {
|
|
2950
|
+
active: zoneIsPM
|
|
2951
|
+
});
|
|
3079
2952
|
const refreshClockHour = useEffectEvent(() => {
|
|
3080
2953
|
refreshClock(hour > 12 ? hour - 12 : hour);
|
|
3081
2954
|
});
|
|
@@ -3213,7 +3086,7 @@ function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
|
3213
3086
|
transform: `translate(${DIAL_RADIUS}rem, ${DIAL_RADIUS}rem)`
|
|
3214
3087
|
}, 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
3088
|
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: "
|
|
3089
|
+
}) })] }) }), 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
3090
|
}
|
|
3218
3091
|
const RlsPickerClock = memo(RlsPickerClockComponent);
|
|
3219
3092
|
|
|
@@ -3232,12 +3105,10 @@ function RlsFieldClockComponent({ children, disabled: disabledProps, formControl
|
|
|
3232
3105
|
const disabled = useMemo(() => {
|
|
3233
3106
|
return formControl?.disabled || disabledProps;
|
|
3234
3107
|
}, [formControl?.disabled, disabledProps]);
|
|
3235
|
-
const className =
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
});
|
|
3240
|
-
}, [disabled, readOnly]);
|
|
3108
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3109
|
+
disabled,
|
|
3110
|
+
readonly: readOnly
|
|
3111
|
+
});
|
|
3241
3112
|
const timeValue = useMemo(() => {
|
|
3242
3113
|
return formControl ? formControl.value : value;
|
|
3243
3114
|
}, [formControl?.value, value]);
|
|
@@ -3273,7 +3144,7 @@ function RlsFieldClockComponent({ children, disabled: disabledProps, formControl
|
|
|
3273
3144
|
formControl?.touch();
|
|
3274
3145
|
setModalIsVisible(false);
|
|
3275
3146
|
}, [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 })] }));
|
|
3147
|
+
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
3148
|
}
|
|
3278
3149
|
const RlsFieldClock = memo(RlsFieldClockComponent);
|
|
3279
3150
|
|
|
@@ -3485,7 +3356,7 @@ function RlsPickerColorComponent({ color, formControl, onListener, rlsTheme }) {
|
|
|
3485
3356
|
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
3357
|
left: indicatorPosition.left,
|
|
3487
3358
|
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: "
|
|
3359
|
+
}, 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
3360
|
}
|
|
3490
3361
|
const RlsPickerColor = memo(RlsPickerColorComponent);
|
|
3491
3362
|
|
|
@@ -3498,12 +3369,10 @@ function RlsFieldColorComponent({ children, color, disabled: disabledProps, form
|
|
|
3498
3369
|
const disabled = useMemo(() => {
|
|
3499
3370
|
return formControl?.disabled || disabledProps;
|
|
3500
3371
|
}, [formControl?.disabled, disabledProps]);
|
|
3501
|
-
const className =
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
});
|
|
3506
|
-
}, [disabled, readOnly]);
|
|
3372
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3373
|
+
disabled,
|
|
3374
|
+
readonly: readOnly
|
|
3375
|
+
});
|
|
3507
3376
|
const displayHex = useMemo(() => {
|
|
3508
3377
|
const hex = colorValue && hexIsValid(colorValue) ? colorValue : '';
|
|
3509
3378
|
return normalizeHex(hex);
|
|
@@ -3534,7 +3403,7 @@ function RlsFieldColorComponent({ children, color, disabled: disabledProps, form
|
|
|
3534
3403
|
formControl?.touch();
|
|
3535
3404
|
setModalIsVisible(false);
|
|
3536
3405
|
}, [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-
|
|
3406
|
+
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
3407
|
}
|
|
3539
3408
|
const RlsFieldColor = memo(RlsFieldColorComponent);
|
|
3540
3409
|
|
|
@@ -3559,13 +3428,11 @@ function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDat
|
|
|
3559
3428
|
const value = useMemo(() => {
|
|
3560
3429
|
return new Date(yearControl.value, monthControl.value, dayControl.value);
|
|
3561
3430
|
}, [yearControl.value, monthControl.value, dayControl.value]);
|
|
3562
|
-
const classNameComponent =
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
});
|
|
3568
|
-
}, [visibility]);
|
|
3431
|
+
const classNameComponent = renderClassStatus('rls-picker-date__component', {
|
|
3432
|
+
day: visibility === 'DAY',
|
|
3433
|
+
month: visibility === 'MONTH',
|
|
3434
|
+
year: visibility === 'YEAR'
|
|
3435
|
+
});
|
|
3569
3436
|
const title = useMemo(() => {
|
|
3570
3437
|
return dateFormatTemplate(value, DATE_FORMAT_TITLE);
|
|
3571
3438
|
}, [value]);
|
|
@@ -3619,7 +3486,7 @@ function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDat
|
|
|
3619
3486
|
value: value
|
|
3620
3487
|
});
|
|
3621
3488
|
}, [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: "
|
|
3489
|
+
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
3490
|
}
|
|
3624
3491
|
const RlsPickerDate = memo(RlsPickerDateComponent);
|
|
3625
3492
|
|
|
@@ -3633,18 +3500,16 @@ function RlsModalDateComponent({ automatic, controller, date, disabled, formCont
|
|
|
3633
3500
|
const RlsModalDate = memo(RlsModalDateComponent);
|
|
3634
3501
|
|
|
3635
3502
|
function RlsFieldDateComponent({ children, date, disabled: disabledProps, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3636
|
-
const today =
|
|
3503
|
+
const today = useMemo(() => new Date(), []);
|
|
3637
3504
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3638
3505
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3639
3506
|
const disabled = useMemo(() => {
|
|
3640
3507
|
return formControl?.disabled || disabledProps;
|
|
3641
3508
|
}, [formControl?.disabled, disabledProps]);
|
|
3642
|
-
const className =
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
});
|
|
3647
|
-
}, [disabled, readOnly]);
|
|
3509
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3510
|
+
disabled,
|
|
3511
|
+
readonly: readOnly
|
|
3512
|
+
});
|
|
3648
3513
|
const dateValue = useMemo(() => {
|
|
3649
3514
|
return formControl ? formControl.value : value;
|
|
3650
3515
|
}, [formControl?.value, value]);
|
|
@@ -3658,7 +3523,7 @@ function RlsFieldDateComponent({ children, date, disabled: disabledProps, formCo
|
|
|
3658
3523
|
}, [dateValue, format]);
|
|
3659
3524
|
useEffect(() => {
|
|
3660
3525
|
const dateSecure = verifyDateRange({
|
|
3661
|
-
date: formControl?.value ?? date ?? today
|
|
3526
|
+
date: formControl?.value ?? date ?? today,
|
|
3662
3527
|
minDate,
|
|
3663
3528
|
maxDate
|
|
3664
3529
|
});
|
|
@@ -3691,7 +3556,7 @@ function RlsFieldDateComponent({ children, date, disabled: disabledProps, formCo
|
|
|
3691
3556
|
formControl?.touch();
|
|
3692
3557
|
setModalIsVisible(false);
|
|
3693
3558
|
}, [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 })] }));
|
|
3559
|
+
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
3560
|
}
|
|
3696
3561
|
const RlsFieldDate = memo(RlsFieldDateComponent);
|
|
3697
3562
|
|
|
@@ -3725,16 +3590,14 @@ function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, fo
|
|
|
3725
3590
|
}
|
|
3726
3591
|
return value;
|
|
3727
3592
|
}, [_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]);
|
|
3593
|
+
const classNameComponent = renderClassStatus('rls-picker-date-range__component', {
|
|
3594
|
+
day: visibility === 'DAY',
|
|
3595
|
+
month: visibility === 'MONTH',
|
|
3596
|
+
year: visibility === 'YEAR'
|
|
3597
|
+
});
|
|
3598
|
+
const classNameFooter = renderClassStatus('rls-picker-date-range__footer', {
|
|
3599
|
+
automatic
|
|
3600
|
+
});
|
|
3738
3601
|
const title = useMemo(() => rangeFormatTemplate(value), [value]);
|
|
3739
3602
|
useEffect(() => {
|
|
3740
3603
|
return i18nSubscribe(() => {
|
|
@@ -3765,7 +3628,7 @@ function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, fo
|
|
|
3765
3628
|
formControl?.setValue(value);
|
|
3766
3629
|
onListener?.({ event: PickerListenerEvent.Select, value });
|
|
3767
3630
|
}, [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: "
|
|
3631
|
+
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
3632
|
}
|
|
3770
3633
|
const RlsPickerDateRange = memo(RlsPickerDateRangeComponent);
|
|
3771
3634
|
|
|
@@ -3785,12 +3648,10 @@ function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, f
|
|
|
3785
3648
|
const disabled = useMemo(() => {
|
|
3786
3649
|
return formControl?.disabled || disabledProps;
|
|
3787
3650
|
}, [formControl?.disabled, disabledProps]);
|
|
3788
|
-
const className =
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
});
|
|
3793
|
-
}, [disabled, readOnly]);
|
|
3651
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3652
|
+
disabled,
|
|
3653
|
+
readonly: readOnly
|
|
3654
|
+
});
|
|
3794
3655
|
const dateRangeValue = useMemo(() => {
|
|
3795
3656
|
return formControl ? formControl.value : value;
|
|
3796
3657
|
}, [formControl?.value, value]);
|
|
@@ -3826,7 +3687,7 @@ function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, f
|
|
|
3826
3687
|
formControl?.touch();
|
|
3827
3688
|
setModalIsVisible(false);
|
|
3828
3689
|
}, [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 })] }));
|
|
3690
|
+
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
3691
|
}
|
|
3831
3692
|
const RlsFieldDateRange = memo(RlsFieldDateRangeComponent);
|
|
3832
3693
|
|
|
@@ -3968,20 +3829,12 @@ function RlsFieldListInner({ render, suggestions, action, children, formControl,
|
|
|
3968
3829
|
const disabled = useMemo(() => {
|
|
3969
3830
|
return formControl?.disabled || props.disabled;
|
|
3970
3831
|
}, [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
|
-
]);
|
|
3832
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3833
|
+
focused: fieldList.listIsVisible && !disabled,
|
|
3834
|
+
error: formControl?.wrong,
|
|
3835
|
+
disabled,
|
|
3836
|
+
readonly: props.readOnly
|
|
3837
|
+
}, `rls-field-list rls-field-list__multi ${props.className ?? ''}`);
|
|
3985
3838
|
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
3839
|
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
3840
|
}
|
|
@@ -4111,20 +3964,12 @@ function RlsFieldSelectTemplateComponent(props) {
|
|
|
4111
3964
|
const disabled = useMemo(() => {
|
|
4112
3965
|
return formControl?.disabled || props.disabled;
|
|
4113
3966
|
}, [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
|
-
]);
|
|
3967
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3968
|
+
focused: select.focused && !disabled,
|
|
3969
|
+
error: formControl?.wrong,
|
|
3970
|
+
disabled: disabled,
|
|
3971
|
+
readonly: props.readOnly
|
|
3972
|
+
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
4128
3973
|
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
3974
|
}
|
|
4130
3975
|
const RlsFieldSelectTemplate = memo(RlsFieldSelectTemplateComponent);
|
|
@@ -4135,9 +3980,7 @@ function RlsFieldSelectComponent(props) {
|
|
|
4135
3980
|
const RlsFieldSelect = memo(RlsFieldSelectComponent);
|
|
4136
3981
|
|
|
4137
3982
|
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]);
|
|
3983
|
+
const classNameForm = renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4141
3984
|
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
3985
|
}
|
|
4143
3986
|
const RlsFormNavigation = memo(RlsFormNavigationComponent);
|
|
@@ -4585,9 +4428,7 @@ function RlsImageChooserComponent(props) {
|
|
|
4585
4428
|
const RlsImageChooser = memo(RlsImageChooserComponent);
|
|
4586
4429
|
|
|
4587
4430
|
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]);
|
|
4431
|
+
const classNameModal = renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4591
4432
|
const onClickBackdrop = useCallback(() => {
|
|
4592
4433
|
if (autoclose) {
|
|
4593
4434
|
controller?.close();
|
|
@@ -4605,9 +4446,7 @@ function generateId() {
|
|
|
4605
4446
|
return `rls-notification-${++_id}`;
|
|
4606
4447
|
}
|
|
4607
4448
|
function RlsNotification({ content, icon, onClose, rlsTheme, title, visible }) {
|
|
4608
|
-
const className =
|
|
4609
|
-
return renderClassStatus('rls-notification', { visible });
|
|
4610
|
-
}, [visible]);
|
|
4449
|
+
const className = renderClassStatus('rls-notification', { visible });
|
|
4611
4450
|
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
4451
|
}
|
|
4613
4452
|
function useNotifications() {
|
|
@@ -4638,14 +4477,24 @@ function useNotifications() {
|
|
|
4638
4477
|
const duration = config.duration ?? DURATION_DEFAULT;
|
|
4639
4478
|
setNotifications((notifications) => [
|
|
4640
4479
|
...notifications,
|
|
4641
|
-
{ id, config, visible:
|
|
4480
|
+
{ id, config, visible: false }
|
|
4642
4481
|
]);
|
|
4482
|
+
requestAnimationFrame(() => {
|
|
4483
|
+
requestAnimationFrame(() => {
|
|
4484
|
+
setNotifications((notifications) => notifications.map((notification) => notification.id === id
|
|
4485
|
+
? { ...notification, visible: true }
|
|
4486
|
+
: notification));
|
|
4487
|
+
});
|
|
4488
|
+
});
|
|
4643
4489
|
const timer = setTimeout(() => {
|
|
4644
4490
|
remove(id);
|
|
4645
4491
|
}, duration);
|
|
4646
4492
|
timersRef.current.set(id, timer);
|
|
4647
4493
|
}, [remove]);
|
|
4648
|
-
const
|
|
4494
|
+
const className = renderClassStatus('rls-notifications', {
|
|
4495
|
+
visible: notifications.length > 0
|
|
4496
|
+
});
|
|
4497
|
+
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
4498
|
return {
|
|
4650
4499
|
RlsNotifications,
|
|
4651
4500
|
notify
|
|
@@ -4668,9 +4517,7 @@ function calculateDuration({ length }) {
|
|
|
4668
4517
|
return duration + DURATION_RESET;
|
|
4669
4518
|
}
|
|
4670
4519
|
function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible }) {
|
|
4671
|
-
const className =
|
|
4672
|
-
return renderClassStatus('rls-snackbar', { visible });
|
|
4673
|
-
}, [visible]);
|
|
4520
|
+
const className = renderClassStatus('rls-snackbar', { visible });
|
|
4674
4521
|
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
4522
|
}
|
|
4676
4523
|
const RlsSnackbar = memo(RlsSnackbarComponent);
|
|
@@ -4733,13 +4580,11 @@ function RlsApplication({ children }) {
|
|
|
4733
4580
|
const [navbarInApp, setNavbarInApp] = useState(false);
|
|
4734
4581
|
const [navbarIsCondense, setNavbarIsCondense] = useState(false);
|
|
4735
4582
|
const [appIsMobile, setIsMobile] = useState(false);
|
|
4736
|
-
const className =
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
});
|
|
4742
|
-
}, [appIsMobile, navbarInApp, navbarIsCondense]);
|
|
4583
|
+
const className = renderClassStatus('rls-app__body', {
|
|
4584
|
+
mobile: appIsMobile,
|
|
4585
|
+
'navbar-snackbar': navbarInApp,
|
|
4586
|
+
'navbar-condense': navbarIsCondense
|
|
4587
|
+
});
|
|
4743
4588
|
const state = useMemo(() => ({
|
|
4744
4589
|
confirmation,
|
|
4745
4590
|
notify,
|
|
@@ -4754,7 +4599,7 @@ function RlsApplication({ children }) {
|
|
|
4754
4599
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
4755
4600
|
|
|
4756
4601
|
const DESIGN_SYSTEM_PREFIX = 'rls-design-system';
|
|
4757
|
-
const DESIGN_SYSTEMS = ['bordered', 'filled'];
|
|
4602
|
+
const DESIGN_SYSTEMS = ['bordered', 'filled', 'gradient'];
|
|
4758
4603
|
function designSystemClass(designSystem) {
|
|
4759
4604
|
return `${DESIGN_SYSTEM_PREFIX}-${designSystem}`;
|
|
4760
4605
|
}
|