@rolster/react-components 18.21.31 → 18.21.33
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-DsP20SgC.css → index-D3ZlI-1N.css} +7 -5
- package/dist/cjs/index.js +32 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-DsP20SgC.css → index-D3ZlI-1N.css} +7 -5
- package/dist/es/index.js +31 -23
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.css +3 -5
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.css.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.d.ts +2 -0
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js +5 -2
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.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/InputPassword/InputPassword.js +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/organisms/Card/Card.css +3 -0
- package/dist/esm/components/organisms/Card/Card.css.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +1 -0
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +5 -4
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.d.ts +1 -0
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +3 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +8 -7
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.d.ts +1 -0
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +3 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
- package/dist/esm/components/organisms/index.d.ts +2 -0
- package/dist/esm/components/organisms/index.js +2 -0
- package/dist/esm/components/organisms/index.js.map +1 -1
- package/dist/esm/controllers/ListController.d.ts +2 -1
- package/dist/esm/controllers/ListController.js +6 -3
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/package.json +2 -2
|
@@ -120,18 +120,16 @@
|
|
|
120
120
|
vertical-align: top;
|
|
121
121
|
-webkit-font-smoothing: antialiased;
|
|
122
122
|
}
|
|
123
|
-
.rls-breadcrumb__label--active {
|
|
124
|
-
--pvt-link-font-color: var(--rls-theme-color-500);
|
|
125
|
-
}
|
|
126
123
|
.rls-breadcrumb__label__a {
|
|
127
124
|
display: inline-block;
|
|
128
|
-
|
|
125
|
+
}
|
|
126
|
+
.rls-breadcrumb__label__a[rls-theme] {
|
|
127
|
+
color: var(--rls-theme-color-500);
|
|
129
128
|
}
|
|
130
129
|
.rls-breadcrumb__label__a--actionable {
|
|
131
130
|
cursor: pointer;
|
|
132
131
|
}
|
|
133
132
|
.rls-breadcrumb__label__a--actionable:hover {
|
|
134
|
-
color: var(--rls-theme-color-500);
|
|
135
133
|
text-decoration: underline;
|
|
136
134
|
} /*# sourceMappingURL=Breadcrumb.css.map */
|
|
137
135
|
|
|
@@ -251,6 +249,7 @@
|
|
|
251
249
|
justify-content: center;
|
|
252
250
|
align-items: center;
|
|
253
251
|
overflow: hidden;
|
|
252
|
+
column-gap: var(--rlc-button-content-gap, var(--rls-sizing-x2));
|
|
254
253
|
line-height: var(--rls-sizing-x20);
|
|
255
254
|
height: var(--rls-sizing-x20);
|
|
256
255
|
padding: var(--rlc-button-content-padding, 0rem var(--rls-sizing-x4));
|
|
@@ -1771,12 +1770,14 @@
|
|
|
1771
1770
|
} /*# sourceMappingURL=Toolbar.css.map */
|
|
1772
1771
|
|
|
1773
1772
|
.rls-card {
|
|
1773
|
+
--rlc-divider-background: var(--rls-app-color-300);
|
|
1774
1774
|
--pvt-background: var(--rls-app-color-100);
|
|
1775
1775
|
--pvt-border: var(--rls-app-border-2-300);
|
|
1776
1776
|
background: var(--pvt-background);
|
|
1777
1777
|
border-radius: var(--rls-sizing-x4);
|
|
1778
1778
|
}
|
|
1779
1779
|
.rls-card[rls-theme] {
|
|
1780
|
+
--rlc-divider-background: var(--rls-theme-color-300);
|
|
1780
1781
|
--pvt-background: var(--rls-theme-color-100);
|
|
1781
1782
|
}
|
|
1782
1783
|
.rls-card--outline {
|
|
@@ -1786,6 +1787,7 @@
|
|
|
1786
1787
|
.rls-card__content {
|
|
1787
1788
|
display: flex;
|
|
1788
1789
|
flex-direction: column;
|
|
1790
|
+
row-gap: var(--rlc-card-content-gap, var(--rls-sizing-x4));
|
|
1789
1791
|
padding: var(--rlc-card-content-padding, var(--rls-sizing-x8));
|
|
1790
1792
|
box-sizing: border-box;
|
|
1791
1793
|
} /*# sourceMappingURL=Card.css.map */
|
package/dist/cjs/index.js
CHANGED
|
@@ -1502,10 +1502,13 @@ function RlsBreadcrumbLabel({ label }) {
|
|
|
1502
1502
|
actionable: !!label.onClick
|
|
1503
1503
|
});
|
|
1504
1504
|
}, [label.onClick]);
|
|
1505
|
-
return (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, children: label.label }) }));
|
|
1505
|
+
return (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, "rls-theme": label.rlsTheme, children: label.label }) }));
|
|
1506
1506
|
}
|
|
1507
1507
|
function RlsBreadcrumb({ labels }) {
|
|
1508
|
-
|
|
1508
|
+
const children = require$$0.useMemo(() => {
|
|
1509
|
+
return labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index)));
|
|
1510
|
+
}, [labels]);
|
|
1511
|
+
return jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: children });
|
|
1509
1512
|
}
|
|
1510
1513
|
|
|
1511
1514
|
function RlsIcon({ value, skeleton }) {
|
|
@@ -1606,7 +1609,7 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
|
|
|
1606
1609
|
}, [formControl, onValue]);
|
|
1607
1610
|
const _onKeyDown = require$$0.useCallback((event) => {
|
|
1608
1611
|
onKeyDown && onKeyDown(event);
|
|
1609
|
-
event.
|
|
1612
|
+
event.key === 'Enter' && onEnter && onEnter();
|
|
1610
1613
|
}, [onKeyDown, onEnter]);
|
|
1611
1614
|
const _onKeyUp = require$$0.useCallback((event) => {
|
|
1612
1615
|
onKeyUp && onKeyUp(event);
|
|
@@ -2421,8 +2424,11 @@ function useDatatable() {
|
|
|
2421
2424
|
return { scrolleable, tableRef };
|
|
2422
2425
|
}
|
|
2423
2426
|
|
|
2427
|
+
function calculateMinHeightList(count, height) {
|
|
2428
|
+
return count <= 0 ? 160 : (count < 6 ? count : 6) * height;
|
|
2429
|
+
}
|
|
2424
2430
|
function useListController(props) {
|
|
2425
|
-
const {
|
|
2431
|
+
const { count, suggestions, automatic, formControl, lineHeight, reference } = props;
|
|
2426
2432
|
const listIsOpen = require$$0.useRef(false);
|
|
2427
2433
|
const contentRef = require$$0.useRef(null);
|
|
2428
2434
|
const listRef = require$$0.useRef(null);
|
|
@@ -2485,7 +2491,7 @@ function useListController(props) {
|
|
|
2485
2491
|
changeValueInternal.current = false;
|
|
2486
2492
|
}, [collection, formControl?.value]);
|
|
2487
2493
|
const setState = require$$0.useCallback((state) => {
|
|
2488
|
-
const minHeightList =
|
|
2494
|
+
const minHeightList = calculateMinHeightList(count, lineHeight ?? 48);
|
|
2489
2495
|
const _state = state.modalIsVisible
|
|
2490
2496
|
? {
|
|
2491
2497
|
...state,
|
|
@@ -2493,7 +2499,7 @@ function useListController(props) {
|
|
|
2493
2499
|
}
|
|
2494
2500
|
: state;
|
|
2495
2501
|
refreshState((state) => ({ ...state, ..._state }));
|
|
2496
|
-
}, [
|
|
2502
|
+
}, [count]);
|
|
2497
2503
|
const setFormValue = require$$0.useCallback((element, initialValue = false) => {
|
|
2498
2504
|
refreshState((state) => ({
|
|
2499
2505
|
...state,
|
|
@@ -2538,10 +2544,10 @@ function useListController(props) {
|
|
|
2538
2544
|
const DURATION_ANIMATION$1 = 240;
|
|
2539
2545
|
const MAX_ELEMENTS = 6;
|
|
2540
2546
|
function useFieldAutocomplete(props) {
|
|
2541
|
-
const
|
|
2547
|
+
const count = require$$0.useRef(props.suggestions.length);
|
|
2542
2548
|
const controller = useListController({
|
|
2543
2549
|
...props,
|
|
2544
|
-
|
|
2550
|
+
count: count.current
|
|
2545
2551
|
});
|
|
2546
2552
|
const [coincidences, setCoincidences] = require$$0.useState([]);
|
|
2547
2553
|
const [pattern, setPattern] = require$$0.useState('');
|
|
@@ -2560,7 +2566,7 @@ function useFieldAutocomplete(props) {
|
|
|
2560
2566
|
_store.current = store;
|
|
2561
2567
|
const coincidences = collection.slice(0, MAX_ELEMENTS);
|
|
2562
2568
|
setCoincidences(coincidences);
|
|
2563
|
-
|
|
2569
|
+
count.current = coincidences.length;
|
|
2564
2570
|
}, []);
|
|
2565
2571
|
require$$0.useEffect(() => {
|
|
2566
2572
|
refreshCoincidences(props.suggestions, pattern, true);
|
|
@@ -2687,16 +2693,17 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2687
2693
|
visible: autocomplete.modalIsVisible
|
|
2688
2694
|
});
|
|
2689
2695
|
}, [autocomplete.higher, autocomplete.modalIsVisible]);
|
|
2690
|
-
const
|
|
2696
|
+
const onChangePattern = require$$0.useCallback((event) => {
|
|
2691
2697
|
autocomplete.setPattern(event.target.value);
|
|
2692
2698
|
}, [autocomplete.setPattern]);
|
|
2693
|
-
const
|
|
2699
|
+
const onClickPattern = require$$0.useCallback(() => {
|
|
2694
2700
|
onSearch && onSearch(autocomplete.pattern);
|
|
2695
2701
|
}, [onSearch, autocomplete.pattern]);
|
|
2696
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { 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 }), 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: classNameList, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: autocomplete.listRef, className: "rls-field-list__ul", children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { ref: autocomplete.inputRef, className: "rls-field-list__ul__control", type: "text", placeholder: labels.listInputPlaceholder, value: autocomplete.pattern, onChange:
|
|
2702
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { 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 }), 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: classNameList, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: autocomplete.listRef, className: "rls-field-list__ul", children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { ref: autocomplete.inputRef, className: "rls-field-list__ul__control", type: "text", placeholder: labels.listInputPlaceholder, value: autocomplete.pattern, onChange: onChangePattern, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: autocomplete.onKeydownInput, 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 })] })] }));
|
|
2697
2703
|
}
|
|
2698
2704
|
function RlsFieldAutocomplete(props) {
|
|
2699
|
-
|
|
2705
|
+
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 }) })), []);
|
|
2706
|
+
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2700
2707
|
}
|
|
2701
2708
|
|
|
2702
2709
|
function RlsModal({ children, overflow, visible, rlsTheme }) {
|
|
@@ -2948,13 +2955,13 @@ function RlsFieldDateRange({ children, date: _date, disabled, formControl, ident
|
|
|
2948
2955
|
}
|
|
2949
2956
|
|
|
2950
2957
|
function useFieldSelect(props) {
|
|
2951
|
-
const
|
|
2958
|
+
const count = require$$0.useRef(props.suggestions.length);
|
|
2952
2959
|
const controller = useListController({
|
|
2953
2960
|
...props,
|
|
2954
|
-
|
|
2961
|
+
count: count.current
|
|
2955
2962
|
});
|
|
2956
2963
|
require$$0.useEffect(() => {
|
|
2957
|
-
|
|
2964
|
+
count.current = props.suggestions.length;
|
|
2958
2965
|
}, [props.suggestions]);
|
|
2959
2966
|
const onFocusInput = require$$0.useCallback(() => {
|
|
2960
2967
|
controller.setState({ focused: true });
|
|
@@ -3060,26 +3067,27 @@ function RlsFieldSelectTemplate(props) {
|
|
|
3060
3067
|
});
|
|
3061
3068
|
});
|
|
3062
3069
|
}, []);
|
|
3063
|
-
const
|
|
3070
|
+
const disabled = require$$0.useMemo(() => {
|
|
3064
3071
|
return formControl?.disabled || props.disabled;
|
|
3065
3072
|
}, [formControl?.disabled, props.disabled]);
|
|
3066
3073
|
const className = require$$0.useMemo(() => {
|
|
3067
3074
|
return renderClassStatus('rls-field-box', {
|
|
3068
|
-
disabled:
|
|
3075
|
+
disabled: disabled,
|
|
3069
3076
|
error: formControl?.wrong,
|
|
3070
|
-
focused: select.focused && !
|
|
3077
|
+
focused: select.focused && !disabled
|
|
3071
3078
|
}, 'rls-field-list rls-field-select');
|
|
3072
|
-
}, [formControl?.wrong, select.focused,
|
|
3079
|
+
}, [formControl?.wrong, select.focused, disabled]);
|
|
3073
3080
|
const classNameList = require$$0.useMemo(() => {
|
|
3074
3081
|
return renderClassStatus('rls-field-list__suggestions', {
|
|
3075
3082
|
higher: select.higher,
|
|
3076
3083
|
visible: select.modalIsVisible
|
|
3077
3084
|
});
|
|
3078
3085
|
}, [select.modalIsVisible, select.higher]);
|
|
3079
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { 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.inputRef, className: "rls-field-list__control", readOnly: true,
|
|
3086
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { 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.inputRef, 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 }), 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: classNameList, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: select.listRef, 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 })] })] }));
|
|
3080
3087
|
}
|
|
3081
3088
|
function RlsFieldSelect(props) {
|
|
3082
|
-
|
|
3089
|
+
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 }) })), []);
|
|
3090
|
+
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
3083
3091
|
}
|
|
3084
3092
|
|
|
3085
3093
|
function RlsFormNavigation({ children, visible, rlsTheme }) {
|
|
@@ -3251,6 +3259,8 @@ exports.renderClassStatus = renderClassStatus;
|
|
|
3251
3259
|
exports.setErrorsI18n = setErrorsI18n;
|
|
3252
3260
|
exports.useConfirmation = useConfirmation;
|
|
3253
3261
|
exports.useDatatable = useDatatable;
|
|
3262
|
+
exports.useFieldAutocomplete = useFieldAutocomplete;
|
|
3263
|
+
exports.useFieldSelect = useFieldSelect;
|
|
3254
3264
|
exports.useListController = useListController;
|
|
3255
3265
|
exports.useSnackbar = useSnackbar;
|
|
3256
3266
|
//# sourceMappingURL=index.js.map
|