@rolster/react-components 19.1.11 → 19.1.13
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/assets/{index-CDqDWlee.css → index-Dvak5slE.css} +44 -8
- package/dist/cjs/index.js +129 -32
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-CDqDWlee.css → index-Dvak5slE.css} +44 -8
- package/dist/es/index.js +128 -33
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.css +1 -0
- package/dist/esm/components/atoms/Button/Button.css.map +1 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.css +3 -0
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.css.map +1 -1
- package/dist/esm/components/atoms/Input/Input.css +2 -0
- package/dist/esm/components/atoms/Input/Input.css.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +12 -12
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.css +0 -2
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.css.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.css +0 -2
- package/dist/esm/components/atoms/InputMoney/InputMoney.css.map +1 -1
- package/dist/esm/components/definitions.d.ts +5 -2
- package/dist/esm/components/molecules/Ballot/Ballot.css +6 -4
- package/dist/esm/components/molecules/Ballot/Ballot.css.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.d.ts +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.js +5 -5
- package/dist/esm/components/molecules/Ballot/Ballot.js.map +1 -1
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.d.ts +5 -2
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js +6 -5
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/organisms/Dropdown/Dropdown.css +31 -0
- package/dist/esm/components/organisms/Dropdown/Dropdown.css.map +1 -0
- package/dist/esm/components/organisms/Dropdown/Dropdown.d.ts +8 -0
- package/dist/esm/components/organisms/Dropdown/Dropdown.js +23 -0
- package/dist/esm/components/organisms/Dropdown/Dropdown.js.map +1 -0
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.d.ts +3 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js +3 -3
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.d.ts +5 -2
- package/dist/esm/components/organisms/Modal/Modal.js +6 -5
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/controllers/DropdownController.d.ts +9 -0
- package/dist/esm/controllers/DropdownController.js +75 -0
- package/dist/esm/controllers/DropdownController.js.map +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -425,6 +425,7 @@
|
|
|
425
425
|
color: var(--pvt-button-content-font-color);
|
|
426
426
|
border: var(--pvt-button-content-border);
|
|
427
427
|
background: var(--pvt-button-content-background);
|
|
428
|
+
pointer-events: none;
|
|
428
429
|
}
|
|
429
430
|
.rls-button__content::before {
|
|
430
431
|
position: absolute;
|
|
@@ -592,6 +593,9 @@
|
|
|
592
593
|
opacity: 0.5;
|
|
593
594
|
pointer-events: none;
|
|
594
595
|
}
|
|
596
|
+
.rls-button-action__content {
|
|
597
|
+
pointer-events: none;
|
|
598
|
+
}
|
|
595
599
|
.rls-button-action__tooltip {
|
|
596
600
|
position: absolute;
|
|
597
601
|
top: calc(100% + var(--rls-sizing-x6));
|
|
@@ -769,6 +773,8 @@
|
|
|
769
773
|
--pvt-value-font-color: var(--pvt-font-color);
|
|
770
774
|
--pvt-value-opacity: 1;
|
|
771
775
|
--pvt-component-font-color: transparent;
|
|
776
|
+
--rlc-amount-height: var(--pvt-height);
|
|
777
|
+
--rlc-amount-align-items: center;
|
|
772
778
|
position: relative;
|
|
773
779
|
width: var(--rlc-input-width, 100%);
|
|
774
780
|
}
|
|
@@ -833,8 +839,6 @@
|
|
|
833
839
|
} /*# sourceMappingURL=Input.css.map */
|
|
834
840
|
|
|
835
841
|
.rls-input-decimal {
|
|
836
|
-
--rlc-amount-height: var(--rlc-input-height);
|
|
837
|
-
--rlc-amount-align-items: center;
|
|
838
842
|
--rlc-tabular-text-font-size: var(--rls-input-font-size);
|
|
839
843
|
--rlc-tabular-text-char-width: 5.25rem;
|
|
840
844
|
position: relative;
|
|
@@ -843,8 +847,6 @@
|
|
|
843
847
|
} /*# sourceMappingURL=InputDecimal.css.map */
|
|
844
848
|
|
|
845
849
|
.rls-input-money {
|
|
846
|
-
--rlc-amount-height: var(--rlc-input-height);
|
|
847
|
-
--rlc-amount-align-items: center;
|
|
848
850
|
--rlc-tabular-text-font-size: var(--rls-input-font-size);
|
|
849
851
|
--rlc-tabular-text-char-width: 5.25rem;
|
|
850
852
|
position: relative;
|
|
@@ -1277,8 +1279,8 @@
|
|
|
1277
1279
|
--rlc-ballot-title-letter-spacing,
|
|
1278
1280
|
var(--rls-label-letter-spacing)
|
|
1279
1281
|
);
|
|
1280
|
-
--pvt-title-height: var(
|
|
1281
|
-
--rlc-ballot-title-height,
|
|
1282
|
+
--pvt-title-line-height: var(
|
|
1283
|
+
--rlc-ballot-title-line-height,
|
|
1282
1284
|
var(--rls-label-line-height)
|
|
1283
1285
|
);
|
|
1284
1286
|
--pvt-subtitle-font-size: var(
|
|
@@ -1289,8 +1291,8 @@
|
|
|
1289
1291
|
--rlc-ballot-subtitle-letter-spacing,
|
|
1290
1292
|
var(--rls-smalltext-letter-spacing)
|
|
1291
1293
|
);
|
|
1292
|
-
--pvt-subtitle-height: var(
|
|
1293
|
-
--rlc-ballot-subtitle-height,
|
|
1294
|
+
--pvt-subtitle-line-height: var(
|
|
1295
|
+
--rlc-ballot-subtitle-line-height,
|
|
1294
1296
|
var(--rls-smalltext-line-height)
|
|
1295
1297
|
);
|
|
1296
1298
|
position: relative;
|
|
@@ -1334,6 +1336,7 @@
|
|
|
1334
1336
|
);
|
|
1335
1337
|
font-size: var(--pvt-title-font-size);
|
|
1336
1338
|
letter-spacing: var(--pvt-title-letter-spacing);
|
|
1339
|
+
line-height: var(--pvt-title-line-height);
|
|
1337
1340
|
}
|
|
1338
1341
|
.rls-ballot__subtitle {
|
|
1339
1342
|
--rlc-skeleton-text-font-size: var(--pvt-subtitle-font-size);
|
|
@@ -1348,6 +1351,7 @@
|
|
|
1348
1351
|
);
|
|
1349
1352
|
font-size: var(--pvt-subtitle-font-size);
|
|
1350
1353
|
letter-spacing: var(--pvt-subtitle-letter-spacing);
|
|
1354
|
+
line-height: var(--pvt-subtitle-line-height);
|
|
1351
1355
|
overflow: var(--rlc-ballot-subtitle-overflow, initial);
|
|
1352
1356
|
text-overflow: var(--rlc-ballot-subtitle-text-overflow, initial);
|
|
1353
1357
|
white-space: var(--rlc-ballot-subtitle-white-space, initial);
|
|
@@ -2546,6 +2550,38 @@
|
|
|
2546
2550
|
}
|
|
2547
2551
|
} /*# sourceMappingURL=Confirmation.css.map */
|
|
2548
2552
|
|
|
2553
|
+
.rls-dropdown {
|
|
2554
|
+
--pvt-content-opacity: 0;
|
|
2555
|
+
--pvt-content-transform: scale(0, 0);
|
|
2556
|
+
position: var(--rlc-dropdown-position, absolute);
|
|
2557
|
+
display: block;
|
|
2558
|
+
opacity: 0;
|
|
2559
|
+
width: auto;
|
|
2560
|
+
z-index: -16;
|
|
2561
|
+
transition: opacity 240ms 0ms var(--rls-standard-curve);
|
|
2562
|
+
}
|
|
2563
|
+
.rls-dropdown--visible {
|
|
2564
|
+
--pvt-content-opacity: 1;
|
|
2565
|
+
--pvt-content-transform: scale(1, 1);
|
|
2566
|
+
opacity: 1;
|
|
2567
|
+
z-index: var(--rlc-dropdown-z-index, var(--rls-z-index-4));
|
|
2568
|
+
}
|
|
2569
|
+
.rls-dropdown__content {
|
|
2570
|
+
display: block;
|
|
2571
|
+
width: auto;
|
|
2572
|
+
max-width: var(--rlc-dropdown-max-width, 150rem);
|
|
2573
|
+
border-radius: var(--rlc-dropdown-radius, var(--rls-sizing-x6));
|
|
2574
|
+
padding: var(--rlc-dropdown-padding, var(--rls-sizing-x6));
|
|
2575
|
+
box-sizing: border-box;
|
|
2576
|
+
border: var(--rlc-dropdown-border, var(--rls-app-border-1-200));
|
|
2577
|
+
background: var(--rlc-dropdown-background, var(--rls-app-color-050));
|
|
2578
|
+
opacity: var(--pvt-content-opacity);
|
|
2579
|
+
transform: var(--pvt-content-transform);
|
|
2580
|
+
transition:
|
|
2581
|
+
transform 240ms 0ms var(--rls-standard-curve),
|
|
2582
|
+
opacity 240ms 0ms var(--rls-standard-curve);
|
|
2583
|
+
} /*# sourceMappingURL=Dropdown.css.map */
|
|
2584
|
+
|
|
2549
2585
|
.rls-field-autocomplete {
|
|
2550
2586
|
--pvt-control-width: 100%;
|
|
2551
2587
|
--pvt-control-opacity: 1;
|
package/dist/es/index.js
CHANGED
|
@@ -582,7 +582,7 @@ function RlsImage({ src, rlsTheme }) {
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
function RlsInput({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
|
|
585
|
-
const valueInitial = formControl?.value ?? value ? String(value) : '';
|
|
585
|
+
const valueInitial = (formControl?.value ?? value) ? String(value) : '';
|
|
586
586
|
const [valueInput, setValueInput] = useState(valueInitial);
|
|
587
587
|
const [focused, setFocused] = useState(false);
|
|
588
588
|
const changeIsInternal = useRef(false);
|
|
@@ -593,7 +593,7 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
593
593
|
}
|
|
594
594
|
changeIsInternal.current = false;
|
|
595
595
|
}, [formControl?.value]);
|
|
596
|
-
const
|
|
596
|
+
const onChangeInput = useCallback((event) => {
|
|
597
597
|
const valueInput = event.target.value;
|
|
598
598
|
const value = type === 'number'
|
|
599
599
|
? parseFloat((+valueInput).toFixed(decimals))
|
|
@@ -603,22 +603,22 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
603
603
|
setValueInput(valueInput);
|
|
604
604
|
formControl?.setValue(value);
|
|
605
605
|
}, [formControl, onValue, type, decimals]);
|
|
606
|
-
const
|
|
607
|
-
onKeyDown
|
|
608
|
-
event.key === 'Enter' && onEnter
|
|
606
|
+
const onKeyDownInput = useCallback((event) => {
|
|
607
|
+
onKeyDown?.(event);
|
|
608
|
+
event.key === 'Enter' && onEnter?.();
|
|
609
609
|
}, [onKeyDown, onEnter]);
|
|
610
|
-
const
|
|
611
|
-
onKeyUp
|
|
610
|
+
const onKeyUpInput = useCallback((event) => {
|
|
611
|
+
onKeyUp?.(event);
|
|
612
612
|
}, [onKeyUp]);
|
|
613
|
-
const
|
|
613
|
+
const onFocusInput = useCallback(() => {
|
|
614
614
|
formControl?.focus();
|
|
615
615
|
setFocused(() => true);
|
|
616
|
-
onFocus
|
|
616
|
+
onFocus?.();
|
|
617
617
|
}, [formControl, onFocus]);
|
|
618
|
-
const
|
|
618
|
+
const onBlurInput = useCallback(() => {
|
|
619
619
|
formControl?.blur();
|
|
620
620
|
setFocused(() => false);
|
|
621
|
-
onBlur
|
|
621
|
+
onBlur?.();
|
|
622
622
|
}, [formControl, onBlur]);
|
|
623
623
|
const className = useMemo(() => {
|
|
624
624
|
return renderClassStatus('rls-input', {
|
|
@@ -626,7 +626,7 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
626
626
|
focused: formControl?.focused ?? focused
|
|
627
627
|
});
|
|
628
628
|
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
629
|
-
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:
|
|
629
|
+
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 })] }));
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
function RlsInputDecimal(props) {
|
|
@@ -782,11 +782,11 @@ function RlsAlert({ bordered, children, icon, identifier, rlsTheme }) {
|
|
|
782
782
|
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 })] }));
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
786
|
-
const
|
|
787
|
-
return renderClassStatus('rls-ballot', { bordered, skeleton });
|
|
788
|
-
}, [bordered, skeleton]);
|
|
789
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
785
|
+
function RlsBallot({ bordered, className, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
786
|
+
const classNameBallot = useMemo(() => {
|
|
787
|
+
return renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
788
|
+
}, [bordered, skeleton, className]);
|
|
789
|
+
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 }) }))] })] }));
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
function RlsButtonProgress({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
@@ -1572,13 +1572,14 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
1572
1572
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-toolbar", children: [jsxRuntimeExports.jsxs("div", { className: "rls-toolbar__description", children: [children && jsxRuntimeExports.jsx("label", { className: "rls-toolbar__title", children: children }), subtitle && (jsxRuntimeExports.jsx("label", { className: "rls-toolbar__subtitle smalltext-semibold", children: subtitle }))] }), actions && (jsxRuntimeExports.jsx("div", { className: "rls-toolbar__actions", children: actions.map((action, index) => (jsxRuntimeExports.jsx("div", { children: action }, index))) }))] }));
|
|
1573
1573
|
}
|
|
1574
1574
|
|
|
1575
|
-
function RlsBottomSheet({ children, className,
|
|
1575
|
+
function RlsBottomSheet({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
1576
1576
|
const classNameSheet = useMemo(() => {
|
|
1577
|
-
return renderClassStatus('rls-bottom-sheet', { visible }, className);
|
|
1578
|
-
}, [className, visible]);
|
|
1577
|
+
return renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
1578
|
+
}, [className, visible, controller?.visible]);
|
|
1579
1579
|
const onClickBackdrop = useCallback(() => {
|
|
1580
|
-
|
|
1581
|
-
|
|
1580
|
+
autoclose && controller?.close();
|
|
1581
|
+
onBackdrop?.();
|
|
1582
|
+
}, [autoclose, controller, onBackdrop]);
|
|
1582
1583
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameSheet, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-bottom-sheet__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-bottom-sheet__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
1583
1584
|
}
|
|
1584
1585
|
|
|
@@ -1751,6 +1752,25 @@ function RlsDatatableFloating({ children, className, identifier, invested, rlsTh
|
|
|
1751
1752
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
1752
1753
|
}
|
|
1753
1754
|
|
|
1755
|
+
function RlsDropdown({ children, controller, rlsTheme }) {
|
|
1756
|
+
const className = useMemo(() => {
|
|
1757
|
+
return renderClassStatus('rls-dropdown', {
|
|
1758
|
+
visible: controller.visible
|
|
1759
|
+
});
|
|
1760
|
+
}, [controller.visible]);
|
|
1761
|
+
useEffect(() => {
|
|
1762
|
+
function onCloseDropdown({ target }) {
|
|
1763
|
+
!controller.component.current.contains(target) &&
|
|
1764
|
+
controller.close();
|
|
1765
|
+
}
|
|
1766
|
+
document.addEventListener('click', onCloseDropdown);
|
|
1767
|
+
return () => {
|
|
1768
|
+
document.removeEventListener('click', onCloseDropdown);
|
|
1769
|
+
};
|
|
1770
|
+
}, []);
|
|
1771
|
+
return (jsxRuntimeExports.jsx("div", { ref: controller.component, className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-dropdown__content", children: children }) }));
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1754
1774
|
function calculateMinHeightList(count, height) {
|
|
1755
1775
|
return count <= 0 ? 160 : (count < 6 ? count : 6) * height;
|
|
1756
1776
|
}
|
|
@@ -2054,17 +2074,18 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2054
2074
|
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: autocomplete.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: autocomplete.value ? 'trash-2' : 'arrow-ios-down' }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsxs("div", { className: classNameSuggestions, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: autocomplete.refList, className: "rls-field-list__ul", children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { ref: autocomplete.refInput, className: "rls-field-list__ul__control", type: "text", placeholder: labels.listInputPlaceholder, value: autocomplete.pattern, onChange: onChangePattern, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: onKeyDownPattern, disabled: disabled || searching }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: disabled || searching, onClick: onClickPattern, children: jsxRuntimeExports.jsx(RlsIcon, { value: "search" }) }))] }), searching && jsxRuntimeExports.jsx(RlsProgressBar, { indeterminate: true }), autocomplete.coincidences.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: autocomplete.onClickElement(element), onKeyDown: autocomplete.onKeydownElement(element), children: render(element) }, index))), !autocomplete.coincidences.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: autocomplete.onClickBackdrop })] })] }));
|
|
2055
2075
|
}
|
|
2056
2076
|
function RlsFieldAutocomplete(props) {
|
|
2057
|
-
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2077
|
+
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2058
2078
|
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2059
2079
|
}
|
|
2060
2080
|
|
|
2061
|
-
function RlsModal({ children, className,
|
|
2081
|
+
function RlsModal({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2062
2082
|
const classNameModal = useMemo(() => {
|
|
2063
|
-
return renderClassStatus('rls-modal', { visible }, className);
|
|
2064
|
-
}, [className, visible]);
|
|
2083
|
+
return renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2084
|
+
}, [className, visible, controller?.visible]);
|
|
2065
2085
|
const onClickBackdrop = useCallback(() => {
|
|
2066
|
-
|
|
2067
|
-
|
|
2086
|
+
autoclose && controller?.close();
|
|
2087
|
+
onBackdrop?.();
|
|
2088
|
+
}, [autoclose, controller, onBackdrop]);
|
|
2068
2089
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameModal, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
2069
2090
|
}
|
|
2070
2091
|
|
|
@@ -2723,14 +2744,14 @@ function RlsFieldSelectTemplate(props) {
|
|
|
2723
2744
|
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("button", { className: 'rls-field-list__action', disabled: disabled, onClick: select.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: !unremovable && !!select.value ? 'close' : 'arrow-ios-down' }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsxs("div", { className: classNameSuggestions, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: select.refList, className: "rls-field-list__ul", children: [suggestions.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: select.onClickElement(element), onKeyDown: select.onKeydownElement(element), children: render(element) }, index))), !suggestions.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: select.onClickBackdrop })] })] }));
|
|
2724
2745
|
}
|
|
2725
2746
|
function RlsFieldSelect(props) {
|
|
2726
|
-
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2747
|
+
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2727
2748
|
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
2728
2749
|
}
|
|
2729
2750
|
|
|
2730
|
-
function RlsFormNavigation({ children, className, visible, rlsTheme }) {
|
|
2751
|
+
function RlsFormNavigation({ children, className, controller, visible, rlsTheme }) {
|
|
2731
2752
|
const classNameForm = useMemo(() => {
|
|
2732
|
-
return renderClassStatus('rls-form-navigation', { visible }, className);
|
|
2733
|
-
}, [visible,
|
|
2753
|
+
return renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
2754
|
+
}, [className, visible, controller?.visible]);
|
|
2734
2755
|
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: classNameForm, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__component", children: children }) }), document.body);
|
|
2735
2756
|
}
|
|
2736
2757
|
|
|
@@ -3263,6 +3284,80 @@ function RlsApplication({ children }) {
|
|
|
3263
3284
|
}, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
3264
3285
|
}
|
|
3265
3286
|
|
|
3287
|
+
function useDropdownController() {
|
|
3288
|
+
const [visible, setVisible] = useState(false);
|
|
3289
|
+
const component = useRef(null);
|
|
3290
|
+
const open = useCallback((positionX, positionY) => {
|
|
3291
|
+
component.current.style.transformOrigin = '0% 0%';
|
|
3292
|
+
component.current.style.top = `${positionY}px`;
|
|
3293
|
+
component.current.style.left = `${positionX}px`;
|
|
3294
|
+
setVisible(true);
|
|
3295
|
+
}, []);
|
|
3296
|
+
const openWithEvent = useCallback((event) => {
|
|
3297
|
+
const rectContent = component.current.getBoundingClientRect();
|
|
3298
|
+
const rectElement = event.target.getBoundingClientRect();
|
|
3299
|
+
let positionX = 0;
|
|
3300
|
+
let positionY = 0;
|
|
3301
|
+
let effect = '0% 0%';
|
|
3302
|
+
let transform = 0;
|
|
3303
|
+
const elementX = rectElement.x + rectElement.width / 2;
|
|
3304
|
+
const elementY = rectElement.y + rectElement.height / 2;
|
|
3305
|
+
if (elementX + rectContent.width <= window.innerWidth) {
|
|
3306
|
+
positionX = elementX;
|
|
3307
|
+
transform += 1;
|
|
3308
|
+
}
|
|
3309
|
+
else if (elementX + rectElement.width - rectContent.width > 0) {
|
|
3310
|
+
positionX = elementX + rectElement.width - rectContent.width;
|
|
3311
|
+
transform += 3;
|
|
3312
|
+
}
|
|
3313
|
+
else {
|
|
3314
|
+
positionX = window.innerWidth - rectContent.width;
|
|
3315
|
+
transform += 1;
|
|
3316
|
+
}
|
|
3317
|
+
if (elementY + rectContent.height <= window.innerHeight) {
|
|
3318
|
+
positionY = elementY;
|
|
3319
|
+
transform += 4;
|
|
3320
|
+
}
|
|
3321
|
+
else if (elementY + rectElement.height - rectContent.height > 0) {
|
|
3322
|
+
positionY = elementY + rectElement.height - rectContent.height;
|
|
3323
|
+
transform += 7;
|
|
3324
|
+
}
|
|
3325
|
+
else {
|
|
3326
|
+
positionY = window.innerHeight - rectContent.height;
|
|
3327
|
+
transform += 4;
|
|
3328
|
+
}
|
|
3329
|
+
switch (transform) {
|
|
3330
|
+
case 7:
|
|
3331
|
+
effect = '100% 0%';
|
|
3332
|
+
break;
|
|
3333
|
+
case 8:
|
|
3334
|
+
effect = '0% 100%';
|
|
3335
|
+
break;
|
|
3336
|
+
case 10:
|
|
3337
|
+
effect = '100% 100%';
|
|
3338
|
+
break;
|
|
3339
|
+
default:
|
|
3340
|
+
effect = '0% 0%';
|
|
3341
|
+
break;
|
|
3342
|
+
}
|
|
3343
|
+
component.current.style.transformOrigin = effect;
|
|
3344
|
+
component.current.style.top = `${positionY}px`;
|
|
3345
|
+
component.current.style.left = `${positionX}px`;
|
|
3346
|
+
setVisible(true);
|
|
3347
|
+
event.stopPropagation();
|
|
3348
|
+
}, []);
|
|
3349
|
+
const close = useCallback(() => {
|
|
3350
|
+
setVisible(false);
|
|
3351
|
+
}, []);
|
|
3352
|
+
return {
|
|
3353
|
+
close,
|
|
3354
|
+
component,
|
|
3355
|
+
open,
|
|
3356
|
+
openWithEvent,
|
|
3357
|
+
visible
|
|
3358
|
+
};
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3266
3361
|
function usePortalController() {
|
|
3267
3362
|
const [visible, setVisible] = useState(false);
|
|
3268
3363
|
const open = useCallback(() => {
|
|
@@ -3274,5 +3369,5 @@ function usePortalController() {
|
|
|
3274
3369
|
return { close, open, visible };
|
|
3275
3370
|
}
|
|
3276
3371
|
|
|
3277
|
-
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonOption, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldClock, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalSheet, RlsNavbar, RlsPagination, RlsPickerClock, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, usePortalController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3372
|
+
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonOption, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsDropdown, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldClock, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalSheet, RlsNavbar, RlsPagination, RlsPickerClock, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useDropdownController, useFieldAutocomplete, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, usePortalController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3278
3373
|
//# sourceMappingURL=index.js.map
|