@rolster/react-components 18.25.5 → 18.25.7
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-CTyuJiCr.css → index-BR6Z9tba.css} +4 -4
- package/dist/cjs/index.js +70 -76
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-CTyuJiCr.css → index-BR6Z9tba.css} +4 -4
- package/dist/es/index.js +70 -76
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.css +3 -3
- package/dist/esm/components/atoms/Button/Button.css.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +4 -4
- package/dist/esm/components/molecules/FieldDouble/FieldDouble.js +8 -10
- package/dist/esm/components/molecules/FieldDouble/FieldDouble.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +8 -10
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +8 -10
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +11 -13
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js +8 -10
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js.map +1 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.css +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +8 -10
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +5 -5
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +10 -4
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/package.json +1 -1
|
@@ -219,8 +219,8 @@
|
|
|
219
219
|
--pvt-raised-background: var(--rls-theme-color-500);
|
|
220
220
|
--pvt-raised-font-color: var(--rls-theme-color-050);
|
|
221
221
|
--pvt-raised-border: none;
|
|
222
|
-
--pvt-flat-background: var(--rls-theme-color-
|
|
223
|
-
--pvt-flat-font-color: var(--rls-theme-color-
|
|
222
|
+
--pvt-flat-background: var(--rls-theme-color-100);
|
|
223
|
+
--pvt-flat-font-color: var(--rls-theme-color-600);
|
|
224
224
|
--pvt-flat-border: none;
|
|
225
225
|
--pvt-stroked-background: transparent;
|
|
226
226
|
--pvt-stroked-font-color: var(--rls-theme-color-500);
|
|
@@ -372,8 +372,8 @@
|
|
|
372
372
|
line-height: initial;
|
|
373
373
|
width: auto;
|
|
374
374
|
font-size: var(--rls-button-font-size);
|
|
375
|
-
font-weight: var(--rls-font-weight-bold);
|
|
376
375
|
letter-spacing: var(--rls-button-letter-spacing);
|
|
376
|
+
font-weight: var(--rlc-button-font-weight, var(--rls-font-weight-bold));
|
|
377
377
|
text-transform: var(--rlc-button-label-text-transform, uppercase);
|
|
378
378
|
text-overflow: ellipsis;
|
|
379
379
|
overflow: hidden;
|
|
@@ -1311,7 +1311,7 @@
|
|
|
1311
1311
|
|
|
1312
1312
|
.rls-field-readonly {
|
|
1313
1313
|
--rlc-fieldbox-body-padding: var(--rls-sizing-x4);
|
|
1314
|
-
--pvt-font-color: var(--rlc-input-font-color, var(--rls-app-color-
|
|
1314
|
+
--pvt-font-color: var(--rlc-input-font-color, var(--rls-app-color-600));
|
|
1315
1315
|
--pvt-font-size: var(--rlc-input-font-size, var(--rls-input-font-size));
|
|
1316
1316
|
--pvt-letter-spacing: var(
|
|
1317
1317
|
--rlc-input-letter-spacing,
|
package/dist/es/index.js
CHANGED
|
@@ -1472,20 +1472,20 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
1472
1472
|
const valueInitial = formControl?.value ?? value ? String(value) : '';
|
|
1473
1473
|
const [valueInput, setValueInput] = useState(valueInitial);
|
|
1474
1474
|
const [focused, setFocused] = useState(false);
|
|
1475
|
-
const
|
|
1475
|
+
const changeIsInternal = useRef(false);
|
|
1476
1476
|
useEffect(() => {
|
|
1477
|
-
if (!
|
|
1477
|
+
if (!changeIsInternal.current && formControl) {
|
|
1478
1478
|
const valueControl = formControl.value ? String(formControl.value) : '';
|
|
1479
1479
|
valueInput !== valueControl && setValueInput(valueControl);
|
|
1480
1480
|
}
|
|
1481
|
-
|
|
1481
|
+
changeIsInternal.current = false;
|
|
1482
1482
|
}, [formControl?.value]);
|
|
1483
1483
|
const _onChange = useCallback((event) => {
|
|
1484
1484
|
const valueInput = event.target.value;
|
|
1485
1485
|
const value = type === 'number'
|
|
1486
1486
|
? parseFloat((+valueInput).toFixed(decimals))
|
|
1487
1487
|
: valueInput;
|
|
1488
|
-
|
|
1488
|
+
changeIsInternal.current = true;
|
|
1489
1489
|
onValue && onValue(value);
|
|
1490
1490
|
setValueInput(valueInput);
|
|
1491
1491
|
formControl?.setValue(value);
|
|
@@ -1838,96 +1838,86 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1838
1838
|
}
|
|
1839
1839
|
|
|
1840
1840
|
function RlsFieldDouble(props) {
|
|
1841
|
-
const { children,
|
|
1841
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1842
|
+
const disabled = useMemo(() => {
|
|
1843
|
+
return formControl?.disabled || props.disabled;
|
|
1844
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1842
1845
|
const className = useMemo(() => {
|
|
1843
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1844
1846
|
return renderClassStatus('rls-field-box', {
|
|
1845
|
-
focused: formControl?.focused && !
|
|
1847
|
+
focused: formControl?.focused && !disabled,
|
|
1846
1848
|
error: formControl?.wrong,
|
|
1847
|
-
disabled
|
|
1849
|
+
disabled,
|
|
1850
|
+
readonly: props.readOnly
|
|
1848
1851
|
}, 'rls-field-double');
|
|
1849
|
-
}, [
|
|
1850
|
-
formControl?.focused,
|
|
1851
|
-
formControl?.wrong,
|
|
1852
|
-
formControl?.disabled,
|
|
1853
|
-
disabled
|
|
1854
|
-
]);
|
|
1852
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1855
1853
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputDouble, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1856
1854
|
}
|
|
1857
1855
|
|
|
1858
1856
|
function RlsFieldMoney(props) {
|
|
1859
|
-
const { children,
|
|
1857
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1858
|
+
const disabled = useMemo(() => {
|
|
1859
|
+
return formControl?.disabled || props.disabled;
|
|
1860
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1860
1861
|
const className = useMemo(() => {
|
|
1861
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1862
1862
|
return renderClassStatus('rls-field-box', {
|
|
1863
|
-
focused: formControl?.focused && !
|
|
1863
|
+
focused: formControl?.focused && !disabled,
|
|
1864
1864
|
error: formControl?.wrong,
|
|
1865
|
-
disabled
|
|
1865
|
+
disabled,
|
|
1866
|
+
readonly: props.readOnly
|
|
1866
1867
|
}, 'rls-field-money');
|
|
1867
|
-
}, [
|
|
1868
|
-
formControl?.focused,
|
|
1869
|
-
formControl?.wrong,
|
|
1870
|
-
formControl?.disabled,
|
|
1871
|
-
disabled
|
|
1872
|
-
]);
|
|
1868
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1873
1869
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputMoney, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1874
1870
|
}
|
|
1875
1871
|
|
|
1876
1872
|
function RlsFieldNumber(props) {
|
|
1877
|
-
const { children,
|
|
1873
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1874
|
+
const disabled = useMemo(() => {
|
|
1875
|
+
return formControl?.disabled || props.disabled;
|
|
1876
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1878
1877
|
const className = useMemo(() => {
|
|
1879
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1880
1878
|
return renderClassStatus('rls-field-box', {
|
|
1881
|
-
focused: formControl?.focused && !
|
|
1879
|
+
focused: formControl?.focused && !disabled,
|
|
1882
1880
|
error: formControl?.wrong,
|
|
1883
|
-
disabled
|
|
1881
|
+
disabled,
|
|
1882
|
+
readonly: props.readOnly
|
|
1884
1883
|
}, 'rls-field-number');
|
|
1885
|
-
}, [
|
|
1886
|
-
formControl?.focused,
|
|
1887
|
-
formControl?.wrong,
|
|
1888
|
-
formControl?.disabled,
|
|
1889
|
-
disabled
|
|
1890
|
-
]);
|
|
1884
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1891
1885
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputNumber, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1892
1886
|
}
|
|
1893
1887
|
|
|
1894
1888
|
function RlsFieldPassword(props) {
|
|
1895
|
-
const { children,
|
|
1889
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1896
1890
|
const [password, setPassword] = useState(true);
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
}, []);
|
|
1891
|
+
const disabled = useMemo(() => {
|
|
1892
|
+
return formControl?.disabled || props.disabled;
|
|
1893
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1900
1894
|
const className = useMemo(() => {
|
|
1901
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1902
1895
|
return renderClassStatus('rls-field-box', {
|
|
1903
|
-
focused: formControl?.focused && !
|
|
1896
|
+
focused: formControl?.focused && !disabled,
|
|
1904
1897
|
error: formControl?.wrong,
|
|
1905
|
-
disabled
|
|
1898
|
+
disabled,
|
|
1899
|
+
readonly: props.readOnly
|
|
1906
1900
|
}, 'rls-field-password');
|
|
1907
|
-
}, [
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
disabled
|
|
1912
|
-
]);
|
|
1901
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1902
|
+
const onToggleInput = useCallback(() => {
|
|
1903
|
+
setPassword((password) => !password);
|
|
1904
|
+
}, []);
|
|
1913
1905
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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(RlsInputPassword, { ...props, type: password ? 'password' : 'text' }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1914
1906
|
}
|
|
1915
1907
|
|
|
1916
1908
|
function RlsFieldPercentage(props) {
|
|
1917
|
-
const { children,
|
|
1909
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1910
|
+
const disabled = useMemo(() => {
|
|
1911
|
+
return formControl?.disabled || props.disabled;
|
|
1912
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1918
1913
|
const className = useMemo(() => {
|
|
1919
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1920
1914
|
return renderClassStatus('rls-field-box', {
|
|
1921
|
-
focused: formControl?.focused && !
|
|
1915
|
+
focused: formControl?.focused && !disabled,
|
|
1922
1916
|
error: formControl?.wrong,
|
|
1923
|
-
disabled
|
|
1917
|
+
disabled,
|
|
1918
|
+
readonly: props.readOnly
|
|
1924
1919
|
}, 'rls-field-percentage');
|
|
1925
|
-
}, [
|
|
1926
|
-
formControl?.focused,
|
|
1927
|
-
formControl?.wrong,
|
|
1928
|
-
formControl?.disabled,
|
|
1929
|
-
disabled
|
|
1930
|
-
]);
|
|
1920
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1931
1921
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputPercentage, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1932
1922
|
}
|
|
1933
1923
|
|
|
@@ -1936,20 +1926,18 @@ function RlsFieldReadonly({ children, identifier, rlsTheme, value }) {
|
|
|
1936
1926
|
}
|
|
1937
1927
|
|
|
1938
1928
|
function RlsFieldText(props) {
|
|
1939
|
-
const { children,
|
|
1929
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1930
|
+
const disabled = useMemo(() => {
|
|
1931
|
+
return formControl?.disabled || props.disabled;
|
|
1932
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1940
1933
|
const className = useMemo(() => {
|
|
1941
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1942
1934
|
return renderClassStatus('rls-field-box', {
|
|
1943
|
-
focused: formControl?.focused && !
|
|
1935
|
+
focused: formControl?.focused && !disabled,
|
|
1944
1936
|
error: formControl?.wrong,
|
|
1945
|
-
disabled
|
|
1937
|
+
disabled,
|
|
1938
|
+
readonly: props.readOnly
|
|
1946
1939
|
}, 'rls-field-text');
|
|
1947
|
-
}, [
|
|
1948
|
-
formControl?.focused,
|
|
1949
|
-
formControl?.wrong,
|
|
1950
|
-
formControl?.disabled,
|
|
1951
|
-
disabled
|
|
1952
|
-
]);
|
|
1940
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1953
1941
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, 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.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputText, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1954
1942
|
}
|
|
1955
1943
|
|
|
@@ -2844,7 +2832,7 @@ function useFieldAutocomplete(props) {
|
|
|
2844
2832
|
|
|
2845
2833
|
function RlsFieldAutocompleteTemplate(props) {
|
|
2846
2834
|
const autocomplete = useFieldAutocomplete(props);
|
|
2847
|
-
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder,
|
|
2835
|
+
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2848
2836
|
const [labels, setLabels] = useState({
|
|
2849
2837
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
2850
2838
|
listEmptyTitle: reactI18n('listEmptyTitle'),
|
|
@@ -2867,7 +2855,7 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2867
2855
|
focused: autocomplete.focused && !disabled,
|
|
2868
2856
|
error: formControl?.wrong,
|
|
2869
2857
|
disabled,
|
|
2870
|
-
readonly: readOnly,
|
|
2858
|
+
readonly: props.readOnly,
|
|
2871
2859
|
selected: !!autocomplete.value
|
|
2872
2860
|
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2873
2861
|
}, [
|
|
@@ -2875,8 +2863,8 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2875
2863
|
autocomplete.value,
|
|
2876
2864
|
autocomplete.focused,
|
|
2877
2865
|
props.className,
|
|
2878
|
-
|
|
2879
|
-
|
|
2866
|
+
props.readOnly,
|
|
2867
|
+
disabled
|
|
2880
2868
|
]);
|
|
2881
2869
|
const classNameList = useMemo(() => {
|
|
2882
2870
|
return renderClassStatus('rls-field-list__suggestions', {
|
|
@@ -2894,7 +2882,7 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2894
2882
|
event.key === 'Enter' && onSearch && onSearch(autocomplete.pattern);
|
|
2895
2883
|
autocomplete.onKeydownInput(event);
|
|
2896
2884
|
}, [autocomplete.onKeydownInput, onSearch, autocomplete.pattern]);
|
|
2897
|
-
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 }), !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: classNameList, 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 })] })] }));
|
|
2885
|
+
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: classNameList, 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 })] })] }));
|
|
2898
2886
|
}
|
|
2899
2887
|
function RlsFieldAutocomplete(props) {
|
|
2900
2888
|
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
@@ -3266,7 +3254,7 @@ function useFieldSelect(props) {
|
|
|
3266
3254
|
|
|
3267
3255
|
function RlsFieldSelectTemplate(props) {
|
|
3268
3256
|
const select = useFieldSelect(props);
|
|
3269
|
-
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder,
|
|
3257
|
+
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
3270
3258
|
const [labels, setLabels] = useState({
|
|
3271
3259
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
3272
3260
|
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
@@ -3287,16 +3275,22 @@ function RlsFieldSelectTemplate(props) {
|
|
|
3287
3275
|
focused: select.focused && !disabled,
|
|
3288
3276
|
error: formControl?.wrong,
|
|
3289
3277
|
disabled: disabled,
|
|
3290
|
-
readonly: readOnly
|
|
3278
|
+
readonly: props.readOnly
|
|
3291
3279
|
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
3292
|
-
}, [
|
|
3280
|
+
}, [
|
|
3281
|
+
formControl?.wrong,
|
|
3282
|
+
select.focused,
|
|
3283
|
+
props.className,
|
|
3284
|
+
props.readOnly,
|
|
3285
|
+
disabled
|
|
3286
|
+
]);
|
|
3293
3287
|
const classNameList = useMemo(() => {
|
|
3294
3288
|
return renderClassStatus('rls-field-list__suggestions', {
|
|
3295
3289
|
higher: select.higher,
|
|
3296
3290
|
visible: select.modalIsVisible
|
|
3297
3291
|
});
|
|
3298
3292
|
}, [select.modalIsVisible, select.higher]);
|
|
3299
|
-
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 }), !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: classNameList, 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 })] })] }));
|
|
3293
|
+
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: classNameList, 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 })] })] }));
|
|
3300
3294
|
}
|
|
3301
3295
|
function RlsFieldSelect(props) {
|
|
3302
3296
|
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|