@rolster/react-components 18.21.32 → 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-BQ758ZeF.css → index-D3ZlI-1N.css} +1 -0
- package/dist/cjs/index.js +32 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-BQ758ZeF.css → index-D3ZlI-1N.css} +1 -0
- package/dist/es/index.js +31 -23
- package/dist/es/index.js.map +1 -1
- 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/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 +1 -1
|
@@ -249,6 +249,7 @@
|
|
|
249
249
|
justify-content: center;
|
|
250
250
|
align-items: center;
|
|
251
251
|
overflow: hidden;
|
|
252
|
+
column-gap: var(--rlc-button-content-gap, var(--rls-sizing-x2));
|
|
252
253
|
line-height: var(--rls-sizing-x20);
|
|
253
254
|
height: var(--rls-sizing-x20);
|
|
254
255
|
padding: var(--rlc-button-content-padding, 0rem var(--rls-sizing-x4));
|
package/dist/es/index.js
CHANGED
|
@@ -1500,10 +1500,13 @@ function RlsBreadcrumbLabel({ label }) {
|
|
|
1500
1500
|
actionable: !!label.onClick
|
|
1501
1501
|
});
|
|
1502
1502
|
}, [label.onClick]);
|
|
1503
|
-
return (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: label.onClick,
|
|
1503
|
+
return (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, "rls-theme": label.rlsTheme, children: label.label }) }));
|
|
1504
1504
|
}
|
|
1505
1505
|
function RlsBreadcrumb({ labels }) {
|
|
1506
|
-
|
|
1506
|
+
const children = useMemo(() => {
|
|
1507
|
+
return labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index)));
|
|
1508
|
+
}, [labels]);
|
|
1509
|
+
return jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: children });
|
|
1507
1510
|
}
|
|
1508
1511
|
|
|
1509
1512
|
function RlsIcon({ value, skeleton }) {
|
|
@@ -1604,7 +1607,7 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
|
|
|
1604
1607
|
}, [formControl, onValue]);
|
|
1605
1608
|
const _onKeyDown = useCallback((event) => {
|
|
1606
1609
|
onKeyDown && onKeyDown(event);
|
|
1607
|
-
event.
|
|
1610
|
+
event.key === 'Enter' && onEnter && onEnter();
|
|
1608
1611
|
}, [onKeyDown, onEnter]);
|
|
1609
1612
|
const _onKeyUp = useCallback((event) => {
|
|
1610
1613
|
onKeyUp && onKeyUp(event);
|
|
@@ -2419,8 +2422,11 @@ function useDatatable() {
|
|
|
2419
2422
|
return { scrolleable, tableRef };
|
|
2420
2423
|
}
|
|
2421
2424
|
|
|
2425
|
+
function calculateMinHeightList(count, height) {
|
|
2426
|
+
return count <= 0 ? 160 : (count < 6 ? count : 6) * height;
|
|
2427
|
+
}
|
|
2422
2428
|
function useListController(props) {
|
|
2423
|
-
const {
|
|
2429
|
+
const { count, suggestions, automatic, formControl, lineHeight, reference } = props;
|
|
2424
2430
|
const listIsOpen = useRef(false);
|
|
2425
2431
|
const contentRef = useRef(null);
|
|
2426
2432
|
const listRef = useRef(null);
|
|
@@ -2483,7 +2489,7 @@ function useListController(props) {
|
|
|
2483
2489
|
changeValueInternal.current = false;
|
|
2484
2490
|
}, [collection, formControl?.value]);
|
|
2485
2491
|
const setState = useCallback((state) => {
|
|
2486
|
-
const minHeightList =
|
|
2492
|
+
const minHeightList = calculateMinHeightList(count, lineHeight ?? 48);
|
|
2487
2493
|
const _state = state.modalIsVisible
|
|
2488
2494
|
? {
|
|
2489
2495
|
...state,
|
|
@@ -2491,7 +2497,7 @@ function useListController(props) {
|
|
|
2491
2497
|
}
|
|
2492
2498
|
: state;
|
|
2493
2499
|
refreshState((state) => ({ ...state, ..._state }));
|
|
2494
|
-
}, [
|
|
2500
|
+
}, [count]);
|
|
2495
2501
|
const setFormValue = useCallback((element, initialValue = false) => {
|
|
2496
2502
|
refreshState((state) => ({
|
|
2497
2503
|
...state,
|
|
@@ -2536,10 +2542,10 @@ function useListController(props) {
|
|
|
2536
2542
|
const DURATION_ANIMATION$1 = 240;
|
|
2537
2543
|
const MAX_ELEMENTS = 6;
|
|
2538
2544
|
function useFieldAutocomplete(props) {
|
|
2539
|
-
const
|
|
2545
|
+
const count = useRef(props.suggestions.length);
|
|
2540
2546
|
const controller = useListController({
|
|
2541
2547
|
...props,
|
|
2542
|
-
|
|
2548
|
+
count: count.current
|
|
2543
2549
|
});
|
|
2544
2550
|
const [coincidences, setCoincidences] = useState([]);
|
|
2545
2551
|
const [pattern, setPattern] = useState('');
|
|
@@ -2558,7 +2564,7 @@ function useFieldAutocomplete(props) {
|
|
|
2558
2564
|
_store.current = store;
|
|
2559
2565
|
const coincidences = collection.slice(0, MAX_ELEMENTS);
|
|
2560
2566
|
setCoincidences(coincidences);
|
|
2561
|
-
|
|
2567
|
+
count.current = coincidences.length;
|
|
2562
2568
|
}, []);
|
|
2563
2569
|
useEffect(() => {
|
|
2564
2570
|
refreshCoincidences(props.suggestions, pattern, true);
|
|
@@ -2685,16 +2691,17 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2685
2691
|
visible: autocomplete.modalIsVisible
|
|
2686
2692
|
});
|
|
2687
2693
|
}, [autocomplete.higher, autocomplete.modalIsVisible]);
|
|
2688
|
-
const
|
|
2694
|
+
const onChangePattern = useCallback((event) => {
|
|
2689
2695
|
autocomplete.setPattern(event.target.value);
|
|
2690
2696
|
}, [autocomplete.setPattern]);
|
|
2691
|
-
const
|
|
2697
|
+
const onClickPattern = useCallback(() => {
|
|
2692
2698
|
onSearch && onSearch(autocomplete.pattern);
|
|
2693
2699
|
}, [onSearch, autocomplete.pattern]);
|
|
2694
|
-
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:
|
|
2700
|
+
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 })] })] }));
|
|
2695
2701
|
}
|
|
2696
2702
|
function RlsFieldAutocomplete(props) {
|
|
2697
|
-
|
|
2703
|
+
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2704
|
+
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2698
2705
|
}
|
|
2699
2706
|
|
|
2700
2707
|
function RlsModal({ children, overflow, visible, rlsTheme }) {
|
|
@@ -2946,13 +2953,13 @@ function RlsFieldDateRange({ children, date: _date, disabled, formControl, ident
|
|
|
2946
2953
|
}
|
|
2947
2954
|
|
|
2948
2955
|
function useFieldSelect(props) {
|
|
2949
|
-
const
|
|
2956
|
+
const count = useRef(props.suggestions.length);
|
|
2950
2957
|
const controller = useListController({
|
|
2951
2958
|
...props,
|
|
2952
|
-
|
|
2959
|
+
count: count.current
|
|
2953
2960
|
});
|
|
2954
2961
|
useEffect(() => {
|
|
2955
|
-
|
|
2962
|
+
count.current = props.suggestions.length;
|
|
2956
2963
|
}, [props.suggestions]);
|
|
2957
2964
|
const onFocusInput = useCallback(() => {
|
|
2958
2965
|
controller.setState({ focused: true });
|
|
@@ -3058,26 +3065,27 @@ function RlsFieldSelectTemplate(props) {
|
|
|
3058
3065
|
});
|
|
3059
3066
|
});
|
|
3060
3067
|
}, []);
|
|
3061
|
-
const
|
|
3068
|
+
const disabled = useMemo(() => {
|
|
3062
3069
|
return formControl?.disabled || props.disabled;
|
|
3063
3070
|
}, [formControl?.disabled, props.disabled]);
|
|
3064
3071
|
const className = useMemo(() => {
|
|
3065
3072
|
return renderClassStatus('rls-field-box', {
|
|
3066
|
-
disabled:
|
|
3073
|
+
disabled: disabled,
|
|
3067
3074
|
error: formControl?.wrong,
|
|
3068
|
-
focused: select.focused && !
|
|
3075
|
+
focused: select.focused && !disabled
|
|
3069
3076
|
}, 'rls-field-list rls-field-select');
|
|
3070
|
-
}, [formControl?.wrong, select.focused,
|
|
3077
|
+
}, [formControl?.wrong, select.focused, disabled]);
|
|
3071
3078
|
const classNameList = useMemo(() => {
|
|
3072
3079
|
return renderClassStatus('rls-field-list__suggestions', {
|
|
3073
3080
|
higher: select.higher,
|
|
3074
3081
|
visible: select.modalIsVisible
|
|
3075
3082
|
});
|
|
3076
3083
|
}, [select.modalIsVisible, select.higher]);
|
|
3077
|
-
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,
|
|
3084
|
+
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 })] })] }));
|
|
3078
3085
|
}
|
|
3079
3086
|
function RlsFieldSelect(props) {
|
|
3080
|
-
|
|
3087
|
+
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
3088
|
+
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
3081
3089
|
}
|
|
3082
3090
|
|
|
3083
3091
|
function RlsFormNavigation({ children, visible, rlsTheme }) {
|
|
@@ -3173,5 +3181,5 @@ function RlsApplication({ children }) {
|
|
|
3173
3181
|
}, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
3174
3182
|
}
|
|
3175
3183
|
|
|
3176
|
-
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useListController, useSnackbar };
|
|
3184
|
+
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useListController, useSnackbar };
|
|
3177
3185
|
//# sourceMappingURL=index.js.map
|