@rolster/react-components 18.18.2 → 18.19.0
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 +90 -101
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +90 -101
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +4 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +7 -8
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.d.ts +5 -5
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +8 -8
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +4 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +6 -11
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.d.ts +5 -5
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +8 -8
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
- package/dist/esm/controllers/ListController.d.ts +4 -3
- package/dist/esm/controllers/ListController.js +58 -50
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/definitions.d.ts +10 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/package.json +5 -7
package/dist/es/index.js
CHANGED
|
@@ -25,8 +25,8 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
25
25
|
function requireReactJsxRuntime_production_min () {
|
|
26
26
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
27
27
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
28
|
-
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key
|
|
29
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
28
|
+
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
|
|
29
|
+
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
30
30
|
return reactJsxRuntime_production_min;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -756,11 +756,6 @@ function requireReactJsxRuntime_development () {
|
|
|
756
756
|
};
|
|
757
757
|
var specialPropKeyWarningShown;
|
|
758
758
|
var specialPropRefWarningShown;
|
|
759
|
-
var didWarnAboutStringRefs;
|
|
760
|
-
|
|
761
|
-
{
|
|
762
|
-
didWarnAboutStringRefs = {};
|
|
763
|
-
}
|
|
764
759
|
|
|
765
760
|
function hasValidRef(config) {
|
|
766
761
|
{
|
|
@@ -792,15 +787,7 @@ function requireReactJsxRuntime_development () {
|
|
|
792
787
|
|
|
793
788
|
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
794
789
|
{
|
|
795
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self
|
|
796
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
797
|
-
|
|
798
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
799
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
800
|
-
|
|
801
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
790
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
|
|
804
791
|
}
|
|
805
792
|
}
|
|
806
793
|
|
|
@@ -2086,12 +2073,12 @@ function useDatatable() {
|
|
|
2086
2073
|
}
|
|
2087
2074
|
|
|
2088
2075
|
function useListController(props) {
|
|
2089
|
-
const { suggestions, automatic, formControl,
|
|
2076
|
+
const { suggestions, automatic, formControl, reference } = props;
|
|
2090
2077
|
const listIsOpen = useRef(false);
|
|
2091
2078
|
const contentRef = useRef(null);
|
|
2092
2079
|
const listRef = useRef(null);
|
|
2093
2080
|
const inputRef = useRef(null);
|
|
2094
|
-
const [state,
|
|
2081
|
+
const [state, refreshState] = useState({
|
|
2095
2082
|
focused: false,
|
|
2096
2083
|
higher: false,
|
|
2097
2084
|
value: '',
|
|
@@ -2099,11 +2086,12 @@ function useListController(props) {
|
|
|
2099
2086
|
});
|
|
2100
2087
|
const collection = useRef(new ListCollection([]));
|
|
2101
2088
|
const position = useRef(0);
|
|
2102
|
-
const
|
|
2089
|
+
const valueProtected = useRef();
|
|
2090
|
+
const changeValueInternal = useRef(false);
|
|
2103
2091
|
useEffect(() => {
|
|
2104
2092
|
function onCloseSuggestions({ target }) {
|
|
2105
2093
|
!contentRef?.current?.contains(target) &&
|
|
2106
|
-
|
|
2094
|
+
refreshState((state) => ({ ...state, modalIsVisible: false }));
|
|
2107
2095
|
}
|
|
2108
2096
|
document.addEventListener('click', onCloseSuggestions);
|
|
2109
2097
|
return () => {
|
|
@@ -2117,67 +2105,74 @@ function useListController(props) {
|
|
|
2117
2105
|
if (listIsOpen.current && !state.modalIsVisible) {
|
|
2118
2106
|
formControl?.touch();
|
|
2119
2107
|
}
|
|
2120
|
-
|
|
2108
|
+
refreshState((state) => ({
|
|
2121
2109
|
...state,
|
|
2122
2110
|
higher: locationListCanTop(contentRef.current, listRef.current)
|
|
2123
2111
|
}));
|
|
2124
2112
|
}, [state.modalIsVisible]);
|
|
2125
2113
|
useEffect(() => {
|
|
2126
|
-
collection.current = new ListCollection(suggestions);
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
refreshState({ value: '' });
|
|
2136
|
-
return undefined;
|
|
2137
|
-
}
|
|
2138
|
-
const element = collection.find(state);
|
|
2139
|
-
if (element) {
|
|
2140
|
-
_protected.current = undefined;
|
|
2141
|
-
return refreshState({ value: element.description });
|
|
2114
|
+
collection.current = new ListCollection(suggestions, reference);
|
|
2115
|
+
if (formControl?.value) {
|
|
2116
|
+
const element = collection.current.find(formControl.value);
|
|
2117
|
+
if (!element) {
|
|
2118
|
+
valueProtected.current = formControl.value;
|
|
2119
|
+
automatic
|
|
2120
|
+
? setFormValue(collection.current.value[0], true)
|
|
2121
|
+
: setFormValue(undefined);
|
|
2122
|
+
}
|
|
2142
2123
|
}
|
|
2143
|
-
if (
|
|
2144
|
-
|
|
2145
|
-
setFormValue(
|
|
2146
|
-
refreshState({ value: '' });
|
|
2124
|
+
else if (valueProtected.current) {
|
|
2125
|
+
const element = collection.current.find(valueProtected.current);
|
|
2126
|
+
element && setFormValue(element);
|
|
2147
2127
|
}
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
if (automatic && collection.value[0]) {
|
|
2151
|
-
formControl?.setInitialValue(collection.value[0].value);
|
|
2152
|
-
return true;
|
|
2128
|
+
else {
|
|
2129
|
+
automatic && setFormValue(collection.current.value[0], true);
|
|
2153
2130
|
}
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2131
|
+
}, [suggestions]);
|
|
2132
|
+
useEffect(() => {
|
|
2133
|
+
if (!changeValueInternal.current) {
|
|
2134
|
+
if (formControl?.value) {
|
|
2135
|
+
const element = collection.current.find(formControl.value);
|
|
2136
|
+
if (!element) {
|
|
2137
|
+
valueProtected.current = formControl.value;
|
|
2138
|
+
automatic
|
|
2139
|
+
? setFormValue(collection.current.value[0], true)
|
|
2140
|
+
: setFormValue(undefined);
|
|
2141
|
+
}
|
|
2142
|
+
else {
|
|
2143
|
+
setFormValue(element);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
else {
|
|
2147
|
+
automatic && setFormValue(collection.current.value[0], true);
|
|
2160
2148
|
}
|
|
2161
2149
|
}
|
|
2162
|
-
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
}
|
|
2167
|
-
const setFormValue = useCallback((
|
|
2168
|
-
|
|
2150
|
+
changeValueInternal.current = false;
|
|
2151
|
+
}, [formControl?.value]);
|
|
2152
|
+
const setState = useCallback((state) => {
|
|
2153
|
+
refreshState((_state) => ({ ..._state, ...state }));
|
|
2154
|
+
}, []);
|
|
2155
|
+
const setFormValue = useCallback((element, initialValue = false) => {
|
|
2156
|
+
refreshState((_state) => ({
|
|
2157
|
+
..._state,
|
|
2158
|
+
value: element?.description ?? ''
|
|
2159
|
+
}));
|
|
2160
|
+
changeValueInternal.current = true;
|
|
2161
|
+
initialValue
|
|
2162
|
+
? formControl?.setInitialValue(element?.value)
|
|
2163
|
+
: formControl?.setValue(element?.value);
|
|
2169
2164
|
}, [formControl]);
|
|
2170
|
-
|
|
2165
|
+
const navigationInput = useCallback((event) => {
|
|
2171
2166
|
if (state.modalIsVisible) {
|
|
2172
|
-
const
|
|
2167
|
+
const _position = navigationListFromInput({
|
|
2173
2168
|
content: contentRef.current,
|
|
2174
2169
|
event: event,
|
|
2175
2170
|
list: listRef.current
|
|
2176
2171
|
});
|
|
2177
|
-
position.current =
|
|
2172
|
+
position.current = _position ?? 0;
|
|
2178
2173
|
}
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2174
|
+
}, [state.modalIsVisible]);
|
|
2175
|
+
const navigationElement = useCallback((event) => {
|
|
2181
2176
|
position.current = navigationListFromElement({
|
|
2182
2177
|
content: contentRef.current,
|
|
2183
2178
|
event: event,
|
|
@@ -2185,7 +2180,7 @@ function useListController(props) {
|
|
|
2185
2180
|
list: listRef.current,
|
|
2186
2181
|
position: position.current
|
|
2187
2182
|
});
|
|
2188
|
-
}
|
|
2183
|
+
}, [state.modalIsVisible]);
|
|
2189
2184
|
return {
|
|
2190
2185
|
...state,
|
|
2191
2186
|
contentRef,
|
|
@@ -2194,7 +2189,7 @@ function useListController(props) {
|
|
|
2194
2189
|
navigationElement,
|
|
2195
2190
|
navigationInput,
|
|
2196
2191
|
setFormValue,
|
|
2197
|
-
setState
|
|
2192
|
+
setState
|
|
2198
2193
|
};
|
|
2199
2194
|
}
|
|
2200
2195
|
|
|
@@ -2240,8 +2235,8 @@ function useFieldAutocomplete(props) {
|
|
|
2240
2235
|
}
|
|
2241
2236
|
function onClickAction() {
|
|
2242
2237
|
if (controller.value) {
|
|
2243
|
-
controller.setState({ modalIsVisible: false
|
|
2244
|
-
controller.setFormValue(
|
|
2238
|
+
controller.setState({ modalIsVisible: false });
|
|
2239
|
+
controller.setFormValue(undefined);
|
|
2245
2240
|
props.onValue && props.onValue(props.value);
|
|
2246
2241
|
}
|
|
2247
2242
|
else {
|
|
@@ -2263,17 +2258,17 @@ function useFieldAutocomplete(props) {
|
|
|
2263
2258
|
: controller.navigationElement(event);
|
|
2264
2259
|
};
|
|
2265
2260
|
}
|
|
2266
|
-
function onChange(
|
|
2261
|
+
function onChange(element) {
|
|
2267
2262
|
const { onSelect, onValue } = props;
|
|
2268
2263
|
if (onSelect) {
|
|
2269
2264
|
controller.setState({ modalIsVisible: false });
|
|
2270
|
-
value && onSelect(value);
|
|
2265
|
+
element.value && onSelect(element.value);
|
|
2271
2266
|
}
|
|
2272
2267
|
else {
|
|
2273
|
-
controller.setState({ modalIsVisible: false
|
|
2274
|
-
controller.setFormValue(
|
|
2268
|
+
controller.setState({ modalIsVisible: false });
|
|
2269
|
+
controller.setFormValue(element);
|
|
2275
2270
|
}
|
|
2276
|
-
onValue && onValue(value);
|
|
2271
|
+
onValue && onValue(element.value);
|
|
2277
2272
|
}
|
|
2278
2273
|
function refreshCoincidences(pattern, reboot = false) {
|
|
2279
2274
|
const { collection, store } = createAutocompleteStore({
|
|
@@ -2286,8 +2281,8 @@ function useFieldAutocomplete(props) {
|
|
|
2286
2281
|
setCoincidences(collection.slice(0, MAX_ELEMENTS));
|
|
2287
2282
|
}
|
|
2288
2283
|
return {
|
|
2284
|
+
...controller,
|
|
2289
2285
|
coincidences,
|
|
2290
|
-
controller,
|
|
2291
2286
|
onBlurInput,
|
|
2292
2287
|
onClickAction,
|
|
2293
2288
|
onClickBackdrop,
|
|
@@ -2303,20 +2298,19 @@ function useFieldAutocomplete(props) {
|
|
|
2303
2298
|
|
|
2304
2299
|
function RlsFieldAutocompleteTemplate(props) {
|
|
2305
2300
|
const autocomplete = useFieldAutocomplete(props);
|
|
2306
|
-
const { controller } = autocomplete;
|
|
2307
2301
|
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2308
2302
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2309
2303
|
const className = renderClassStatus('rls-field-box', {
|
|
2310
|
-
focused:
|
|
2304
|
+
focused: autocomplete.focused && !_disabled,
|
|
2311
2305
|
error: formControl?.wrong,
|
|
2312
2306
|
disabled: _disabled,
|
|
2313
|
-
selected: !!
|
|
2307
|
+
selected: !!autocomplete.value
|
|
2314
2308
|
}, 'rls-field-list rls-field-autocomplete');
|
|
2315
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref:
|
|
2316
|
-
visible:
|
|
2317
|
-
higher:
|
|
2318
|
-
hide: !
|
|
2319
|
-
}), children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref:
|
|
2309
|
+
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: renderClassStatus('rls-field-list__suggestions', {
|
|
2310
|
+
visible: autocomplete.modalIsVisible,
|
|
2311
|
+
higher: autocomplete.higher,
|
|
2312
|
+
hide: !autocomplete.modalIsVisible
|
|
2313
|
+
}), 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) => {
|
|
2320
2314
|
autocomplete.setPattern(event.target.value);
|
|
2321
2315
|
}, disabled: _disabled || searching, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: autocomplete.onKeydownInput }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: _disabled || searching, onClick: () => {
|
|
2322
2316
|
onSearch(autocomplete.pattern);
|
|
@@ -2542,8 +2536,8 @@ function useFieldSelect(props) {
|
|
|
2542
2536
|
function onClickAction() {
|
|
2543
2537
|
const removable = !props.unremovable && !!controller.value;
|
|
2544
2538
|
if (removable) {
|
|
2545
|
-
controller.setState({ modalIsVisible: false
|
|
2546
|
-
controller.setFormValue(
|
|
2539
|
+
controller.setState({ modalIsVisible: false });
|
|
2540
|
+
controller.setFormValue(undefined);
|
|
2547
2541
|
props.onValue && props.onValue(props.value);
|
|
2548
2542
|
}
|
|
2549
2543
|
else {
|
|
@@ -2567,21 +2561,21 @@ function useFieldSelect(props) {
|
|
|
2567
2561
|
: controller.navigationElement(event);
|
|
2568
2562
|
};
|
|
2569
2563
|
}
|
|
2570
|
-
function onChange(
|
|
2564
|
+
function onChange(element) {
|
|
2571
2565
|
const { onSelect, onValue } = props;
|
|
2572
2566
|
controller.inputRef?.current?.focus();
|
|
2573
2567
|
if (onSelect) {
|
|
2574
2568
|
controller.setState({ modalIsVisible: false });
|
|
2575
|
-
value && onSelect(value);
|
|
2569
|
+
element.value && onSelect(element.value);
|
|
2576
2570
|
}
|
|
2577
2571
|
else {
|
|
2578
|
-
controller.setFormValue(
|
|
2579
|
-
controller.setState({ modalIsVisible: false
|
|
2572
|
+
controller.setFormValue(element);
|
|
2573
|
+
controller.setState({ modalIsVisible: false });
|
|
2580
2574
|
}
|
|
2581
|
-
onValue && onValue(value);
|
|
2575
|
+
onValue && onValue(element.value);
|
|
2582
2576
|
}
|
|
2583
2577
|
return {
|
|
2584
|
-
controller,
|
|
2578
|
+
...controller,
|
|
2585
2579
|
onBlurInput,
|
|
2586
2580
|
onClickAction,
|
|
2587
2581
|
onClickBackdrop,
|
|
@@ -2595,23 +2589,18 @@ function useFieldSelect(props) {
|
|
|
2595
2589
|
|
|
2596
2590
|
function RlsFieldSelectTemplate(props) {
|
|
2597
2591
|
const select = useFieldSelect(props);
|
|
2598
|
-
const { controller } = select;
|
|
2599
2592
|
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
2600
2593
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2601
2594
|
const className = renderClassStatus('rls-field-box', {
|
|
2602
|
-
focused:
|
|
2595
|
+
focused: select.focused && !_disabled,
|
|
2603
2596
|
error: formControl?.wrong,
|
|
2604
2597
|
disabled: _disabled
|
|
2605
2598
|
}, 'rls-field-list rls-field-select');
|
|
2606
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref:
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
visible: controller.modalIsVisible,
|
|
2612
|
-
higher: controller.higher,
|
|
2613
|
-
hide: !controller.modalIsVisible
|
|
2614
|
-
}), children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: controller.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
|
+
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: renderClassStatus('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: renderClassStatus('rls-field-list__suggestions', {
|
|
2600
|
+
visible: select.modalIsVisible,
|
|
2601
|
+
higher: select.higher,
|
|
2602
|
+
hide: !select.modalIsVisible
|
|
2603
|
+
}), 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 })] })] }));
|
|
2615
2604
|
}
|
|
2616
2605
|
function RlsFieldSelect(props) {
|
|
2617
2606
|
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 }) })) }));
|