@rolster/react-components 18.20.2 → 18.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +23 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +23 -25
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js +2 -2
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.d.ts +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +3 -3
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +9 -9
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +7 -8
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/controllers/ListController.js +2 -2
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/helpers/css.js +5 -5
- package/dist/esm/helpers/css.js.map +1 -1
- package/package.json +3 -7
package/dist/cjs/index.js
CHANGED
|
@@ -1455,8 +1455,8 @@ function useListController(props) {
|
|
|
1455
1455
|
refreshState((_state) => ({ ..._state, ...state }));
|
|
1456
1456
|
}, []);
|
|
1457
1457
|
const setFormValue = require$$0.useCallback((element, initialValue = false) => {
|
|
1458
|
-
refreshState((
|
|
1459
|
-
...
|
|
1458
|
+
refreshState((state) => ({
|
|
1459
|
+
...state,
|
|
1460
1460
|
value: element?.description || ''
|
|
1461
1461
|
}));
|
|
1462
1462
|
changeValueInternal.current = true;
|
|
@@ -1497,11 +1497,11 @@ function useListController(props) {
|
|
|
1497
1497
|
|
|
1498
1498
|
function renderClassStatus(base, status = {}, additionals) {
|
|
1499
1499
|
const resultClass = [base];
|
|
1500
|
-
Object.entries(status).forEach(([
|
|
1501
|
-
if (
|
|
1502
|
-
typeof
|
|
1503
|
-
? resultClass.push(`${base}--${
|
|
1504
|
-
: resultClass.push(`${base}--${
|
|
1500
|
+
Object.entries(status).forEach(([key, state]) => {
|
|
1501
|
+
if (state) {
|
|
1502
|
+
typeof state === 'string'
|
|
1503
|
+
? resultClass.push(`${base}--${state}`)
|
|
1504
|
+
: resultClass.push(`${base}--${key}`);
|
|
1505
1505
|
}
|
|
1506
1506
|
});
|
|
1507
1507
|
if (additionals) {
|
|
@@ -1535,7 +1535,7 @@ function RlsBadge({ children, rlsTheme }) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
|
|
1537
1537
|
function RlsBreadcrumb({ labels }) {
|
|
1538
|
-
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map(({ label, onClick }, index) => (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: onClick, children: jsxRuntimeExports.jsx("a", { className:
|
|
1538
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map(({ label, onClick }, index) => (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: onClick, children: jsxRuntimeExports.jsx("a", { className: renderClassStatus('rls-breadcrumb__label__a', {
|
|
1539
1539
|
actionable: !!onClick
|
|
1540
1540
|
}), children: label }) }, index))) }));
|
|
1541
1541
|
}
|
|
@@ -1907,7 +1907,7 @@ function RlsPickerDay({ date, disabled: disabledPicker, formControl, maxDate, mo
|
|
|
1907
1907
|
}
|
|
1908
1908
|
|
|
1909
1909
|
const FORMAT_RANGE = '{dd}/{mx}/{aa}';
|
|
1910
|
-
function RlsPickerDayRange({ date, disabled:
|
|
1910
|
+
function RlsPickerDayRange({ date, disabled: _disabled, formControl, maxDate, minDate, rlsTheme }) {
|
|
1911
1911
|
const currentRange = formControl?.value || dates.DateRange.now();
|
|
1912
1912
|
const currentDate = dates.normalizeMinTime(date || currentRange.minDate);
|
|
1913
1913
|
const sourceDate = require$$0.useRef(currentRange.minDate);
|
|
@@ -1932,12 +1932,12 @@ function RlsPickerDayRange({ date, disabled: disabledPicker, formControl, maxDat
|
|
|
1932
1932
|
formControl?.setValue(range);
|
|
1933
1933
|
}
|
|
1934
1934
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__title", children: dates.dateFormatTemplate(sourceDate.current, FORMAT_RANGE) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__header", children: dates.DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("label", { className: "rls-picker-day-range__label", children: title }, index))) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__week", children: days.map(({ disabled, end, forbidden, source, ranged, value }, index) => (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-picker-day-range__element', {
|
|
1935
|
-
disabled: disabled ||
|
|
1935
|
+
disabled: disabled || _disabled,
|
|
1936
1936
|
end,
|
|
1937
1937
|
forbidden,
|
|
1938
1938
|
ranged,
|
|
1939
1939
|
source
|
|
1940
|
-
}), onClick: value && !
|
|
1940
|
+
}), onClick: value && !_disabled
|
|
1941
1941
|
? () => {
|
|
1942
1942
|
onChange(value);
|
|
1943
1943
|
}
|
|
@@ -2303,15 +2303,14 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2303
2303
|
disabled: _disabled,
|
|
2304
2304
|
selected: !!autocomplete.value
|
|
2305
2305
|
}, 'rls-field-list rls-field-autocomplete');
|
|
2306
|
-
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.
|
|
2307
|
-
visible: autocomplete.modalIsVisible,
|
|
2306
|
+
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.jsx("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
2308
2307
|
higher: autocomplete.higher,
|
|
2309
|
-
|
|
2310
|
-
}), 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: reactI18n('listInputPlaceholder'), value: autocomplete.pattern, onChange: (event) => {
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2308
|
+
visible: autocomplete.modalIsVisible
|
|
2309
|
+
}), children: autocomplete.modalIsVisible && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { 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: reactI18n('listInputPlaceholder'), value: autocomplete.pattern, onChange: (event) => {
|
|
2310
|
+
autocomplete.setPattern(event.target.value);
|
|
2311
|
+
}, disabled: _disabled || searching, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: autocomplete.onKeydownInput }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: _disabled || searching, onClick: () => {
|
|
2312
|
+
onSearch(autocomplete.pattern);
|
|
2313
|
+
}, 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 truncate", children: reactI18n('listEmptyTitle') }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: reactI18n('listEmptyDescription') })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: autocomplete.onClickBackdrop })] })) })] }));
|
|
2315
2314
|
}
|
|
2316
2315
|
function RlsFieldAutocomplete(props) {
|
|
2317
2316
|
return (jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: (element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })) }));
|
|
@@ -2591,15 +2590,14 @@ function RlsFieldSelectTemplate(props) {
|
|
|
2591
2590
|
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
2592
2591
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2593
2592
|
const className = useRenderClassStatus('rls-field-box', {
|
|
2594
|
-
|
|
2593
|
+
disabled: _disabled,
|
|
2595
2594
|
error: formControl?.wrong,
|
|
2596
|
-
|
|
2595
|
+
focused: select.focused && !_disabled
|
|
2597
2596
|
}, 'rls-field-list rls-field-select');
|
|
2598
|
-
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, disabled: _disabled, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput }), 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.
|
|
2599
|
-
visible: select.modalIsVisible,
|
|
2597
|
+
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, disabled: _disabled, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput }), 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.jsx("div", { className: useRenderClassStatus('rls-field-list__suggestions', {
|
|
2600
2598
|
higher: select.higher,
|
|
2601
|
-
|
|
2602
|
-
}), 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 truncate", children: reactI18n('listEmptyTitle') }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: reactI18n('listEmptyDescription') })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: select.onClickBackdrop })] })] }));
|
|
2599
|
+
visible: select.modalIsVisible
|
|
2600
|
+
}), children: select.modalIsVisible && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { 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 truncate", children: reactI18n('listEmptyTitle') }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: reactI18n('listEmptyDescription') })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: select.onClickBackdrop })] })) })] }));
|
|
2603
2601
|
}
|
|
2604
2602
|
function RlsFieldSelect(props) {
|
|
2605
2603
|
return (jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: (element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })) }));
|