@rolster/react-components 18.25.4 → 18.25.6
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-C4DYcbf0.css → index-C4vQ44JP.css} +17 -10
- package/dist/cjs/index.js +70 -76
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-C4DYcbf0.css → index-C4vQ44JP.css} +17 -10
- package/dist/es/index.js +70 -76
- package/dist/es/index.js.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/BottomSheet/BottomSheet.css +5 -3
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.css.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/dist/esm/components/organisms/Modal/Modal.css +5 -3
- package/dist/esm/components/organisms/Modal/Modal.css.map +1 -1
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.css +6 -3
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.css.map +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
@@ -1992,6 +1992,7 @@
|
|
|
1992
1992
|
--pvt-component-max-height: 75%;
|
|
1993
1993
|
--pvt-component-opacity: 0;
|
|
1994
1994
|
--pvt-component-visibility: hidden;
|
|
1995
|
+
--pvt-component-transition: 320ms;
|
|
1995
1996
|
--pvt-backdrop-opacity: 0;
|
|
1996
1997
|
--pvt-backdrop-bottom: initial;
|
|
1997
1998
|
position: fixed;
|
|
@@ -2027,9 +2028,10 @@
|
|
|
2027
2028
|
border-radius: var(--rls-sizing-x4) var(--rls-sizing-x4) 0rem 0rem;
|
|
2028
2029
|
background: var(--rlc-bottom-sheet-background, var(--rls-app-color-050));
|
|
2029
2030
|
transform: var(--pvt-component-transform);
|
|
2030
|
-
transition: opacity
|
|
2031
|
-
|
|
2032
|
-
|
|
2031
|
+
transition: opacity var(--pvt-component-transition) 0ms
|
|
2032
|
+
var(--rls-deceleration-curve),
|
|
2033
|
+
transform var(--pvt-component-transition) 0ms var(--rls-deceleration-curve),
|
|
2034
|
+
visibility var(--pvt-component-transition) 0ms var(--rls-deceleration-curve);
|
|
2033
2035
|
}
|
|
2034
2036
|
.rls-bottom-sheet__component::before {
|
|
2035
2037
|
display: block;
|
|
@@ -2313,6 +2315,7 @@
|
|
|
2313
2315
|
--pvt-component-height: 0rem;
|
|
2314
2316
|
--pvt-component-opacity: 0;
|
|
2315
2317
|
--pvt-component-visibility: hidden;
|
|
2318
|
+
--pvt-component-transition: 160ms;
|
|
2316
2319
|
--pvt-backdrop-opacity: 0;
|
|
2317
2320
|
--pvt-backdrop-bottom: initial;
|
|
2318
2321
|
position: fixed;
|
|
@@ -2348,9 +2351,10 @@
|
|
|
2348
2351
|
border-radius: var(--rls-sizing-x4);
|
|
2349
2352
|
background: var(--rlc-modal-background, var(--rls-app-color-050));
|
|
2350
2353
|
transform: var(--pvt-component-transform);
|
|
2351
|
-
transition: opacity
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
+
transition: opacity var(--pvt-component-transition) 0ms
|
|
2355
|
+
var(--rls-deceleration-curve),
|
|
2356
|
+
transform var(--pvt-component-transition) 0ms var(--rls-deceleration-curve),
|
|
2357
|
+
visibility var(--pvt-component-transition) 0ms var(--rls-deceleration-curve);
|
|
2354
2358
|
}
|
|
2355
2359
|
.rls-modal__backdrop {
|
|
2356
2360
|
position: absolute;
|
|
@@ -2861,6 +2865,7 @@
|
|
|
2861
2865
|
--pvt-component-border-radius: var(--rls-sizing-x4);
|
|
2862
2866
|
--pvt-component-opacity: 0;
|
|
2863
2867
|
--pvt-component-visibility: hidden;
|
|
2868
|
+
--pvt-component-transition: 160ms;
|
|
2864
2869
|
--pvt-backdrop-opacity: 0;
|
|
2865
2870
|
--pvt-backdrop-bottom: initial;
|
|
2866
2871
|
position: fixed;
|
|
@@ -2897,9 +2902,10 @@
|
|
|
2897
2902
|
border-radius: var(--pvt-component-border-radius);
|
|
2898
2903
|
background: var(--rlc-modal-sheet-background, var(--rls-app-color-050));
|
|
2899
2904
|
transform: var(--pvt-component-transform);
|
|
2900
|
-
transition: opacity
|
|
2901
|
-
|
|
2902
|
-
|
|
2905
|
+
transition: opacity var(--pvt-component-transition) 0ms
|
|
2906
|
+
var(--rls-deceleration-curve),
|
|
2907
|
+
transform var(--pvt-component-transition) 0ms var(--rls-deceleration-curve),
|
|
2908
|
+
visibility var(--pvt-component-transition) 0ms var(--rls-deceleration-curve);
|
|
2903
2909
|
}
|
|
2904
2910
|
.rls-modal-sheet__backdrop {
|
|
2905
2911
|
position: absolute;
|
|
@@ -2923,6 +2929,7 @@
|
|
|
2923
2929
|
--pvt-component-max-height: 75%;
|
|
2924
2930
|
--pvt-component-border-radius: var(--rls-sizing-x4) var(--rls-sizing-x4)
|
|
2925
2931
|
0rem 0rem;
|
|
2932
|
+
--pvt-component-transition: 320ms;
|
|
2926
2933
|
align-items: initial;
|
|
2927
2934
|
}
|
|
2928
2935
|
.rls-modal-sheet--visible {
|
package/dist/cjs/index.js
CHANGED
|
@@ -1474,20 +1474,20 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
1474
1474
|
const valueInitial = formControl?.value ?? value ? String(value) : '';
|
|
1475
1475
|
const [valueInput, setValueInput] = require$$0.useState(valueInitial);
|
|
1476
1476
|
const [focused, setFocused] = require$$0.useState(false);
|
|
1477
|
-
const
|
|
1477
|
+
const changeIsInternal = require$$0.useRef(false);
|
|
1478
1478
|
require$$0.useEffect(() => {
|
|
1479
|
-
if (!
|
|
1479
|
+
if (!changeIsInternal.current && formControl) {
|
|
1480
1480
|
const valueControl = formControl.value ? String(formControl.value) : '';
|
|
1481
1481
|
valueInput !== valueControl && setValueInput(valueControl);
|
|
1482
1482
|
}
|
|
1483
|
-
|
|
1483
|
+
changeIsInternal.current = false;
|
|
1484
1484
|
}, [formControl?.value]);
|
|
1485
1485
|
const _onChange = require$$0.useCallback((event) => {
|
|
1486
1486
|
const valueInput = event.target.value;
|
|
1487
1487
|
const value = type === 'number'
|
|
1488
1488
|
? parseFloat((+valueInput).toFixed(decimals))
|
|
1489
1489
|
: valueInput;
|
|
1490
|
-
|
|
1490
|
+
changeIsInternal.current = true;
|
|
1491
1491
|
onValue && onValue(value);
|
|
1492
1492
|
setValueInput(valueInput);
|
|
1493
1493
|
formControl?.setValue(value);
|
|
@@ -1840,96 +1840,86 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
|
|
1842
1842
|
function RlsFieldDouble(props) {
|
|
1843
|
-
const { children,
|
|
1843
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1844
|
+
const disabled = require$$0.useMemo(() => {
|
|
1845
|
+
return formControl?.disabled || props.disabled;
|
|
1846
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1844
1847
|
const className = require$$0.useMemo(() => {
|
|
1845
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1846
1848
|
return renderClassStatus('rls-field-box', {
|
|
1847
|
-
focused: formControl?.focused && !
|
|
1849
|
+
focused: formControl?.focused && !disabled,
|
|
1848
1850
|
error: formControl?.wrong,
|
|
1849
|
-
disabled
|
|
1851
|
+
disabled,
|
|
1852
|
+
readonly: props.readOnly
|
|
1850
1853
|
}, 'rls-field-double');
|
|
1851
|
-
}, [
|
|
1852
|
-
formControl?.focused,
|
|
1853
|
-
formControl?.wrong,
|
|
1854
|
-
formControl?.disabled,
|
|
1855
|
-
disabled
|
|
1856
|
-
]);
|
|
1854
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1857
1855
|
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 }))] }));
|
|
1858
1856
|
}
|
|
1859
1857
|
|
|
1860
1858
|
function RlsFieldMoney(props) {
|
|
1861
|
-
const { children,
|
|
1859
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1860
|
+
const disabled = require$$0.useMemo(() => {
|
|
1861
|
+
return formControl?.disabled || props.disabled;
|
|
1862
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1862
1863
|
const className = require$$0.useMemo(() => {
|
|
1863
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1864
1864
|
return renderClassStatus('rls-field-box', {
|
|
1865
|
-
focused: formControl?.focused && !
|
|
1865
|
+
focused: formControl?.focused && !disabled,
|
|
1866
1866
|
error: formControl?.wrong,
|
|
1867
|
-
disabled
|
|
1867
|
+
disabled,
|
|
1868
|
+
readonly: props.readOnly
|
|
1868
1869
|
}, 'rls-field-money');
|
|
1869
|
-
}, [
|
|
1870
|
-
formControl?.focused,
|
|
1871
|
-
formControl?.wrong,
|
|
1872
|
-
formControl?.disabled,
|
|
1873
|
-
disabled
|
|
1874
|
-
]);
|
|
1870
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1875
1871
|
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 }))] }));
|
|
1876
1872
|
}
|
|
1877
1873
|
|
|
1878
1874
|
function RlsFieldNumber(props) {
|
|
1879
|
-
const { children,
|
|
1875
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1876
|
+
const disabled = require$$0.useMemo(() => {
|
|
1877
|
+
return formControl?.disabled || props.disabled;
|
|
1878
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1880
1879
|
const className = require$$0.useMemo(() => {
|
|
1881
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1882
1880
|
return renderClassStatus('rls-field-box', {
|
|
1883
|
-
focused: formControl?.focused && !
|
|
1881
|
+
focused: formControl?.focused && !disabled,
|
|
1884
1882
|
error: formControl?.wrong,
|
|
1885
|
-
disabled
|
|
1883
|
+
disabled,
|
|
1884
|
+
readonly: props.readOnly
|
|
1886
1885
|
}, 'rls-field-number');
|
|
1887
|
-
}, [
|
|
1888
|
-
formControl?.focused,
|
|
1889
|
-
formControl?.wrong,
|
|
1890
|
-
formControl?.disabled,
|
|
1891
|
-
disabled
|
|
1892
|
-
]);
|
|
1886
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1893
1887
|
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 }))] }));
|
|
1894
1888
|
}
|
|
1895
1889
|
|
|
1896
1890
|
function RlsFieldPassword(props) {
|
|
1897
|
-
const { children,
|
|
1891
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1898
1892
|
const [password, setPassword] = require$$0.useState(true);
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1901
|
-
}, []);
|
|
1893
|
+
const disabled = require$$0.useMemo(() => {
|
|
1894
|
+
return formControl?.disabled || props.disabled;
|
|
1895
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1902
1896
|
const className = require$$0.useMemo(() => {
|
|
1903
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1904
1897
|
return renderClassStatus('rls-field-box', {
|
|
1905
|
-
focused: formControl?.focused && !
|
|
1898
|
+
focused: formControl?.focused && !disabled,
|
|
1906
1899
|
error: formControl?.wrong,
|
|
1907
|
-
disabled
|
|
1900
|
+
disabled,
|
|
1901
|
+
readonly: props.readOnly
|
|
1908
1902
|
}, 'rls-field-password');
|
|
1909
|
-
}, [
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
disabled
|
|
1914
|
-
]);
|
|
1903
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1904
|
+
const onToggleInput = require$$0.useCallback(() => {
|
|
1905
|
+
setPassword((password) => !password);
|
|
1906
|
+
}, []);
|
|
1915
1907
|
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 }))] }));
|
|
1916
1908
|
}
|
|
1917
1909
|
|
|
1918
1910
|
function RlsFieldPercentage(props) {
|
|
1919
|
-
const { children,
|
|
1911
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1912
|
+
const disabled = require$$0.useMemo(() => {
|
|
1913
|
+
return formControl?.disabled || props.disabled;
|
|
1914
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1920
1915
|
const className = require$$0.useMemo(() => {
|
|
1921
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1922
1916
|
return renderClassStatus('rls-field-box', {
|
|
1923
|
-
focused: formControl?.focused && !
|
|
1917
|
+
focused: formControl?.focused && !disabled,
|
|
1924
1918
|
error: formControl?.wrong,
|
|
1925
|
-
disabled
|
|
1919
|
+
disabled,
|
|
1920
|
+
readonly: props.readOnly
|
|
1926
1921
|
}, 'rls-field-percentage');
|
|
1927
|
-
}, [
|
|
1928
|
-
formControl?.focused,
|
|
1929
|
-
formControl?.wrong,
|
|
1930
|
-
formControl?.disabled,
|
|
1931
|
-
disabled
|
|
1932
|
-
]);
|
|
1922
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1933
1923
|
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 }))] }));
|
|
1934
1924
|
}
|
|
1935
1925
|
|
|
@@ -1938,20 +1928,18 @@ function RlsFieldReadonly({ children, identifier, rlsTheme, value }) {
|
|
|
1938
1928
|
}
|
|
1939
1929
|
|
|
1940
1930
|
function RlsFieldText(props) {
|
|
1941
|
-
const { children,
|
|
1931
|
+
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1932
|
+
const disabled = require$$0.useMemo(() => {
|
|
1933
|
+
return formControl?.disabled || props.disabled;
|
|
1934
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1942
1935
|
const className = require$$0.useMemo(() => {
|
|
1943
|
-
const _disabled = formControl?.disabled || disabled;
|
|
1944
1936
|
return renderClassStatus('rls-field-box', {
|
|
1945
|
-
focused: formControl?.focused && !
|
|
1937
|
+
focused: formControl?.focused && !disabled,
|
|
1946
1938
|
error: formControl?.wrong,
|
|
1947
|
-
disabled
|
|
1939
|
+
disabled,
|
|
1940
|
+
readonly: props.readOnly
|
|
1948
1941
|
}, 'rls-field-text');
|
|
1949
|
-
}, [
|
|
1950
|
-
formControl?.focused,
|
|
1951
|
-
formControl?.wrong,
|
|
1952
|
-
formControl?.disabled,
|
|
1953
|
-
disabled
|
|
1954
|
-
]);
|
|
1942
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1955
1943
|
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 }))] }));
|
|
1956
1944
|
}
|
|
1957
1945
|
|
|
@@ -2846,7 +2834,7 @@ function useFieldAutocomplete(props) {
|
|
|
2846
2834
|
|
|
2847
2835
|
function RlsFieldAutocompleteTemplate(props) {
|
|
2848
2836
|
const autocomplete = useFieldAutocomplete(props);
|
|
2849
|
-
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder,
|
|
2837
|
+
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2850
2838
|
const [labels, setLabels] = require$$0.useState({
|
|
2851
2839
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
2852
2840
|
listEmptyTitle: reactI18n('listEmptyTitle'),
|
|
@@ -2869,7 +2857,7 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2869
2857
|
focused: autocomplete.focused && !disabled,
|
|
2870
2858
|
error: formControl?.wrong,
|
|
2871
2859
|
disabled,
|
|
2872
|
-
readonly: readOnly,
|
|
2860
|
+
readonly: props.readOnly,
|
|
2873
2861
|
selected: !!autocomplete.value
|
|
2874
2862
|
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2875
2863
|
}, [
|
|
@@ -2877,8 +2865,8 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2877
2865
|
autocomplete.value,
|
|
2878
2866
|
autocomplete.focused,
|
|
2879
2867
|
props.className,
|
|
2880
|
-
|
|
2881
|
-
|
|
2868
|
+
props.readOnly,
|
|
2869
|
+
disabled
|
|
2882
2870
|
]);
|
|
2883
2871
|
const classNameList = require$$0.useMemo(() => {
|
|
2884
2872
|
return renderClassStatus('rls-field-list__suggestions', {
|
|
@@ -2896,7 +2884,7 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2896
2884
|
event.key === 'Enter' && onSearch && onSearch(autocomplete.pattern);
|
|
2897
2885
|
autocomplete.onKeydownInput(event);
|
|
2898
2886
|
}, [autocomplete.onKeydownInput, onSearch, autocomplete.pattern]);
|
|
2899
|
-
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 })] })] }));
|
|
2887
|
+
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 })] })] }));
|
|
2900
2888
|
}
|
|
2901
2889
|
function RlsFieldAutocomplete(props) {
|
|
2902
2890
|
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 }) })), []);
|
|
@@ -3268,7 +3256,7 @@ function useFieldSelect(props) {
|
|
|
3268
3256
|
|
|
3269
3257
|
function RlsFieldSelectTemplate(props) {
|
|
3270
3258
|
const select = useFieldSelect(props);
|
|
3271
|
-
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder,
|
|
3259
|
+
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
3272
3260
|
const [labels, setLabels] = require$$0.useState({
|
|
3273
3261
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
3274
3262
|
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
@@ -3289,16 +3277,22 @@ function RlsFieldSelectTemplate(props) {
|
|
|
3289
3277
|
focused: select.focused && !disabled,
|
|
3290
3278
|
error: formControl?.wrong,
|
|
3291
3279
|
disabled: disabled,
|
|
3292
|
-
readonly: readOnly
|
|
3280
|
+
readonly: props.readOnly
|
|
3293
3281
|
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
3294
|
-
}, [
|
|
3282
|
+
}, [
|
|
3283
|
+
formControl?.wrong,
|
|
3284
|
+
select.focused,
|
|
3285
|
+
props.className,
|
|
3286
|
+
props.readOnly,
|
|
3287
|
+
disabled
|
|
3288
|
+
]);
|
|
3295
3289
|
const classNameList = require$$0.useMemo(() => {
|
|
3296
3290
|
return renderClassStatus('rls-field-list__suggestions', {
|
|
3297
3291
|
higher: select.higher,
|
|
3298
3292
|
visible: select.modalIsVisible
|
|
3299
3293
|
});
|
|
3300
3294
|
}, [select.modalIsVisible, select.higher]);
|
|
3301
|
-
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 })] })] }));
|
|
3295
|
+
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 })] })] }));
|
|
3302
3296
|
}
|
|
3303
3297
|
function RlsFieldSelect(props) {
|
|
3304
3298
|
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 }) })), []);
|