@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/cjs/index.js
CHANGED
|
@@ -584,7 +584,7 @@ function RlsImage({ src, rlsTheme }) {
|
|
|
584
584
|
}
|
|
585
585
|
|
|
586
586
|
function RlsInput({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
|
|
587
|
-
const valueInitial = formControl?.value ?? value ? String(value) : '';
|
|
587
|
+
const valueInitial = (formControl?.value ?? value) ? String(value) : '';
|
|
588
588
|
const [valueInput, setValueInput] = require$$0.useState(valueInitial);
|
|
589
589
|
const [focused, setFocused] = require$$0.useState(false);
|
|
590
590
|
const changeIsInternal = require$$0.useRef(false);
|
|
@@ -595,7 +595,7 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
595
595
|
}
|
|
596
596
|
changeIsInternal.current = false;
|
|
597
597
|
}, [formControl?.value]);
|
|
598
|
-
const
|
|
598
|
+
const onChangeInput = require$$0.useCallback((event) => {
|
|
599
599
|
const valueInput = event.target.value;
|
|
600
600
|
const value = type === 'number'
|
|
601
601
|
? parseFloat((+valueInput).toFixed(decimals))
|
|
@@ -605,22 +605,22 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
605
605
|
setValueInput(valueInput);
|
|
606
606
|
formControl?.setValue(value);
|
|
607
607
|
}, [formControl, onValue, type, decimals]);
|
|
608
|
-
const
|
|
609
|
-
onKeyDown
|
|
610
|
-
event.key === 'Enter' && onEnter
|
|
608
|
+
const onKeyDownInput = require$$0.useCallback((event) => {
|
|
609
|
+
onKeyDown?.(event);
|
|
610
|
+
event.key === 'Enter' && onEnter?.();
|
|
611
611
|
}, [onKeyDown, onEnter]);
|
|
612
|
-
const
|
|
613
|
-
onKeyUp
|
|
612
|
+
const onKeyUpInput = require$$0.useCallback((event) => {
|
|
613
|
+
onKeyUp?.(event);
|
|
614
614
|
}, [onKeyUp]);
|
|
615
|
-
const
|
|
615
|
+
const onFocusInput = require$$0.useCallback(() => {
|
|
616
616
|
formControl?.focus();
|
|
617
617
|
setFocused(() => true);
|
|
618
|
-
onFocus
|
|
618
|
+
onFocus?.();
|
|
619
619
|
}, [formControl, onFocus]);
|
|
620
|
-
const
|
|
620
|
+
const onBlurInput = require$$0.useCallback(() => {
|
|
621
621
|
formControl?.blur();
|
|
622
622
|
setFocused(() => false);
|
|
623
|
-
onBlur
|
|
623
|
+
onBlur?.();
|
|
624
624
|
}, [formControl, onBlur]);
|
|
625
625
|
const className = require$$0.useMemo(() => {
|
|
626
626
|
return renderClassStatus('rls-input', {
|
|
@@ -628,7 +628,7 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
628
628
|
focused: formControl?.focused ?? focused
|
|
629
629
|
});
|
|
630
630
|
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
631
|
-
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:
|
|
631
|
+
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 })] }));
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
function RlsInputDecimal(props) {
|
|
@@ -784,11 +784,11 @@ function RlsAlert({ bordered, children, icon, identifier, rlsTheme }) {
|
|
|
784
784
|
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 })] }));
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
-
function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
788
|
-
const
|
|
789
|
-
return renderClassStatus('rls-ballot', { bordered, skeleton });
|
|
790
|
-
}, [bordered, skeleton]);
|
|
791
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
787
|
+
function RlsBallot({ bordered, className, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
788
|
+
const classNameBallot = require$$0.useMemo(() => {
|
|
789
|
+
return renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
790
|
+
}, [bordered, skeleton, className]);
|
|
791
|
+
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 }) }))] })] }));
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
function RlsButtonProgress({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
@@ -1574,13 +1574,14 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
1574
1574
|
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))) }))] }));
|
|
1575
1575
|
}
|
|
1576
1576
|
|
|
1577
|
-
function RlsBottomSheet({ children, className,
|
|
1577
|
+
function RlsBottomSheet({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
1578
1578
|
const classNameSheet = require$$0.useMemo(() => {
|
|
1579
|
-
return renderClassStatus('rls-bottom-sheet', { visible }, className);
|
|
1580
|
-
}, [className, visible]);
|
|
1579
|
+
return renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
1580
|
+
}, [className, visible, controller?.visible]);
|
|
1581
1581
|
const onClickBackdrop = require$$0.useCallback(() => {
|
|
1582
|
-
|
|
1583
|
-
|
|
1582
|
+
autoclose && controller?.close();
|
|
1583
|
+
onBackdrop?.();
|
|
1584
|
+
}, [autoclose, controller, onBackdrop]);
|
|
1584
1585
|
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);
|
|
1585
1586
|
}
|
|
1586
1587
|
|
|
@@ -1753,6 +1754,25 @@ function RlsDatatableFloating({ children, className, identifier, invested, rlsTh
|
|
|
1753
1754
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
1754
1755
|
}
|
|
1755
1756
|
|
|
1757
|
+
function RlsDropdown({ children, controller, rlsTheme }) {
|
|
1758
|
+
const className = require$$0.useMemo(() => {
|
|
1759
|
+
return renderClassStatus('rls-dropdown', {
|
|
1760
|
+
visible: controller.visible
|
|
1761
|
+
});
|
|
1762
|
+
}, [controller.visible]);
|
|
1763
|
+
require$$0.useEffect(() => {
|
|
1764
|
+
function onCloseDropdown({ target }) {
|
|
1765
|
+
!controller.component.current.contains(target) &&
|
|
1766
|
+
controller.close();
|
|
1767
|
+
}
|
|
1768
|
+
document.addEventListener('click', onCloseDropdown);
|
|
1769
|
+
return () => {
|
|
1770
|
+
document.removeEventListener('click', onCloseDropdown);
|
|
1771
|
+
};
|
|
1772
|
+
}, []);
|
|
1773
|
+
return (jsxRuntimeExports.jsx("div", { ref: controller.component, className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-dropdown__content", children: children }) }));
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1756
1776
|
function calculateMinHeightList(count, height) {
|
|
1757
1777
|
return count <= 0 ? 160 : (count < 6 ? count : 6) * height;
|
|
1758
1778
|
}
|
|
@@ -2056,17 +2076,18 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2056
2076
|
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 })] })] }));
|
|
2057
2077
|
}
|
|
2058
2078
|
function RlsFieldAutocomplete(props) {
|
|
2059
|
-
const render = require$$0.useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2079
|
+
const render = require$$0.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 }) })), []);
|
|
2060
2080
|
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2061
2081
|
}
|
|
2062
2082
|
|
|
2063
|
-
function RlsModal({ children, className,
|
|
2083
|
+
function RlsModal({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2064
2084
|
const classNameModal = require$$0.useMemo(() => {
|
|
2065
|
-
return renderClassStatus('rls-modal', { visible }, className);
|
|
2066
|
-
}, [className, visible]);
|
|
2085
|
+
return renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2086
|
+
}, [className, visible, controller?.visible]);
|
|
2067
2087
|
const onClickBackdrop = require$$0.useCallback(() => {
|
|
2068
|
-
|
|
2069
|
-
|
|
2088
|
+
autoclose && controller?.close();
|
|
2089
|
+
onBackdrop?.();
|
|
2090
|
+
}, [autoclose, controller, onBackdrop]);
|
|
2070
2091
|
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);
|
|
2071
2092
|
}
|
|
2072
2093
|
|
|
@@ -2725,14 +2746,14 @@ function RlsFieldSelectTemplate(props) {
|
|
|
2725
2746
|
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 })] })] }));
|
|
2726
2747
|
}
|
|
2727
2748
|
function RlsFieldSelect(props) {
|
|
2728
|
-
const render = require$$0.useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2749
|
+
const render = require$$0.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 }) })), []);
|
|
2729
2750
|
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
2730
2751
|
}
|
|
2731
2752
|
|
|
2732
|
-
function RlsFormNavigation({ children, className, visible, rlsTheme }) {
|
|
2753
|
+
function RlsFormNavigation({ children, className, controller, visible, rlsTheme }) {
|
|
2733
2754
|
const classNameForm = require$$0.useMemo(() => {
|
|
2734
|
-
return renderClassStatus('rls-form-navigation', { visible }, className);
|
|
2735
|
-
}, [visible,
|
|
2755
|
+
return renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
2756
|
+
}, [className, visible, controller?.visible]);
|
|
2736
2757
|
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: classNameForm, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__component", children: children }) }), document.body);
|
|
2737
2758
|
}
|
|
2738
2759
|
|
|
@@ -3265,6 +3286,80 @@ function RlsApplication({ children }) {
|
|
|
3265
3286
|
}, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
3266
3287
|
}
|
|
3267
3288
|
|
|
3289
|
+
function useDropdownController() {
|
|
3290
|
+
const [visible, setVisible] = require$$0.useState(false);
|
|
3291
|
+
const component = require$$0.useRef(null);
|
|
3292
|
+
const open = require$$0.useCallback((positionX, positionY) => {
|
|
3293
|
+
component.current.style.transformOrigin = '0% 0%';
|
|
3294
|
+
component.current.style.top = `${positionY}px`;
|
|
3295
|
+
component.current.style.left = `${positionX}px`;
|
|
3296
|
+
setVisible(true);
|
|
3297
|
+
}, []);
|
|
3298
|
+
const openWithEvent = require$$0.useCallback((event) => {
|
|
3299
|
+
const rectContent = component.current.getBoundingClientRect();
|
|
3300
|
+
const rectElement = event.target.getBoundingClientRect();
|
|
3301
|
+
let positionX = 0;
|
|
3302
|
+
let positionY = 0;
|
|
3303
|
+
let effect = '0% 0%';
|
|
3304
|
+
let transform = 0;
|
|
3305
|
+
const elementX = rectElement.x + rectElement.width / 2;
|
|
3306
|
+
const elementY = rectElement.y + rectElement.height / 2;
|
|
3307
|
+
if (elementX + rectContent.width <= window.innerWidth) {
|
|
3308
|
+
positionX = elementX;
|
|
3309
|
+
transform += 1;
|
|
3310
|
+
}
|
|
3311
|
+
else if (elementX + rectElement.width - rectContent.width > 0) {
|
|
3312
|
+
positionX = elementX + rectElement.width - rectContent.width;
|
|
3313
|
+
transform += 3;
|
|
3314
|
+
}
|
|
3315
|
+
else {
|
|
3316
|
+
positionX = window.innerWidth - rectContent.width;
|
|
3317
|
+
transform += 1;
|
|
3318
|
+
}
|
|
3319
|
+
if (elementY + rectContent.height <= window.innerHeight) {
|
|
3320
|
+
positionY = elementY;
|
|
3321
|
+
transform += 4;
|
|
3322
|
+
}
|
|
3323
|
+
else if (elementY + rectElement.height - rectContent.height > 0) {
|
|
3324
|
+
positionY = elementY + rectElement.height - rectContent.height;
|
|
3325
|
+
transform += 7;
|
|
3326
|
+
}
|
|
3327
|
+
else {
|
|
3328
|
+
positionY = window.innerHeight - rectContent.height;
|
|
3329
|
+
transform += 4;
|
|
3330
|
+
}
|
|
3331
|
+
switch (transform) {
|
|
3332
|
+
case 7:
|
|
3333
|
+
effect = '100% 0%';
|
|
3334
|
+
break;
|
|
3335
|
+
case 8:
|
|
3336
|
+
effect = '0% 100%';
|
|
3337
|
+
break;
|
|
3338
|
+
case 10:
|
|
3339
|
+
effect = '100% 100%';
|
|
3340
|
+
break;
|
|
3341
|
+
default:
|
|
3342
|
+
effect = '0% 0%';
|
|
3343
|
+
break;
|
|
3344
|
+
}
|
|
3345
|
+
component.current.style.transformOrigin = effect;
|
|
3346
|
+
component.current.style.top = `${positionY}px`;
|
|
3347
|
+
component.current.style.left = `${positionX}px`;
|
|
3348
|
+
setVisible(true);
|
|
3349
|
+
event.stopPropagation();
|
|
3350
|
+
}, []);
|
|
3351
|
+
const close = require$$0.useCallback(() => {
|
|
3352
|
+
setVisible(false);
|
|
3353
|
+
}, []);
|
|
3354
|
+
return {
|
|
3355
|
+
close,
|
|
3356
|
+
component,
|
|
3357
|
+
open,
|
|
3358
|
+
openWithEvent,
|
|
3359
|
+
visible
|
|
3360
|
+
};
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3268
3363
|
function usePortalController() {
|
|
3269
3364
|
const [visible, setVisible] = require$$0.useState(false);
|
|
3270
3365
|
const open = require$$0.useCallback(() => {
|
|
@@ -3305,6 +3400,7 @@ exports.RlsDatatableRecord = RlsDatatableRecord;
|
|
|
3305
3400
|
exports.RlsDatatableSubheader = RlsDatatableSubheader;
|
|
3306
3401
|
exports.RlsDatatableTitle = RlsDatatableTitle;
|
|
3307
3402
|
exports.RlsDatatableTotals = RlsDatatableTotals;
|
|
3403
|
+
exports.RlsDropdown = RlsDropdown;
|
|
3308
3404
|
exports.RlsFieldAutocomplete = RlsFieldAutocomplete;
|
|
3309
3405
|
exports.RlsFieldAutocompleteTemplate = RlsFieldAutocompleteTemplate;
|
|
3310
3406
|
exports.RlsFieldClock = RlsFieldClock;
|
|
@@ -3370,6 +3466,7 @@ exports.renderClassStatus = renderClassStatus;
|
|
|
3370
3466
|
exports.setErrorsI18n = setErrorsI18n;
|
|
3371
3467
|
exports.useConfirmation = useConfirmation;
|
|
3372
3468
|
exports.useDatatable = useDatatable;
|
|
3469
|
+
exports.useDropdownController = useDropdownController;
|
|
3373
3470
|
exports.useFieldAutocomplete = useFieldAutocomplete;
|
|
3374
3471
|
exports.useFieldSelect = useFieldSelect;
|
|
3375
3472
|
exports.useFormSingleSelectionController = useFormSingleSelectionController;
|