@rolster/react-components 18.14.0 → 18.15.1
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-L7r-Teuk.css → index-xOmRdBnF.css} +111 -146
- package/dist/cjs/index.js +626 -196
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-L7r-Teuk.css → index-xOmRdBnF.css} +111 -146
- package/dist/es/index.js +565 -136
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Amount/Amount.js +1 -1
- package/dist/esm/components/atoms/Amount/Amount.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.css +1 -1
- package/dist/esm/components/atoms/Button/Button.d.ts +2 -2
- package/dist/esm/components/atoms/Input/Input.js +0 -3
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.css +2 -0
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +0 -3
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/{SearchInput/SearchInput.css → InputSearch/InputSearch.css} +1 -2
- package/dist/esm/components/atoms/InputSearch/InputSearch.d.ts +9 -0
- package/dist/esm/components/atoms/{SearchInput/SearchInput.js → InputSearch/InputSearch.js} +4 -4
- package/dist/esm/components/atoms/{SearchInput/SearchInput.js.map → InputSearch/InputSearch.js.map} +1 -1
- package/dist/esm/components/atoms/Label/Label.css +6 -0
- package/dist/esm/components/atoms/Poster/Poster.css +4 -3
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.css +1 -2
- package/dist/esm/components/atoms/RadioButton/RadioButton.css +0 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.css +3 -4
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.css +8 -48
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js +2 -2
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/esm/components/atoms/TabularText/TabularText.css +5 -2
- package/dist/esm/components/atoms/index.d.ts +1 -1
- package/dist/esm/components/atoms/index.js +1 -1
- package/dist/esm/components/atoms/index.js.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.css +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.d.ts +2 -2
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +3 -2
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +3 -2
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +3 -2
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +3 -2
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +2 -2
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +2 -2
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.d.ts +7 -0
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js +6 -0
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js.map +1 -0
- package/dist/esm/components/molecules/PickerDay/PickerDay.js +3 -3
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.d.ts +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +2 -2
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +2 -2
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonthTitle/PickerMonthTitle.js +3 -3
- package/dist/esm/components/molecules/PickerMonthTitle/PickerMonthTitle.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +2 -2
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/molecules/index.d.ts +1 -0
- package/dist/esm/components/molecules/index.js +1 -0
- package/dist/esm/components/molecules/index.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.css +15 -12
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +2 -10
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +4 -4
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +3 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteHook.d.ts +4 -4
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteHook.js +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteHook.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +8 -11
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.d.ts +2 -2
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +4 -3
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +2 -2
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +3 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectHook.d.ts +2 -2
- package/dist/esm/components/organisms/FieldSelect/FieldSelectHook.js.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.d.ts +2 -2
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +4 -4
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.d.ts +3 -3
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +2 -2
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/helpers/date-range-picker.d.ts +1 -1
- package/dist/esm/helpers/date-range-picker.js +1 -1
- package/dist/esm/helpers/date-range-picker.js.map +1 -1
- package/dist/esm/hooks/DatatableHook.js +7 -4
- package/dist/esm/hooks/DatatableHook.js.map +1 -1
- package/dist/esm/hooks/ListControlHook.d.ts +14 -12
- package/dist/esm/hooks/ListControlHook.js +34 -26
- package/dist/esm/hooks/ListControlHook.js.map +1 -1
- package/package.json +13 -10
- package/dist/esm/components/atoms/SearchInput/SearchInput.d.ts +0 -9
package/dist/es/index.js
CHANGED
|
@@ -1,13 +1,55 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useRef, useEffect, createContext } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { dateIsBefore, normalizeMinTime, dateIsAfter, normalizeMaxTime, getDaysOfMonth, getDateWeight, dateIsEqualsWeight, dateIsBetween, assignDayInDate, Month, MONTH_NAMES, DAY_LABELS, DateRange, dateFormatTemplate, assignYearInDate, assignMonthInDate } from '@rolster/helpers-date';
|
|
3
|
+
import { hasPattern as hasPattern$1 } from '@rolster/helpers-string';
|
|
4
|
+
import { i18n, i18nSubscribe } from '@rolster/i18n';
|
|
6
5
|
import ReactDOM from 'react-dom';
|
|
7
|
-
import { i18n } from '@rolster/i18n';
|
|
8
|
-
import { createFormControlProps } from '@rolster/helpers-forms';
|
|
9
6
|
import 'uuid';
|
|
10
|
-
|
|
7
|
+
|
|
8
|
+
function currencyFormat(currency) {
|
|
9
|
+
const { value, decimals, symbol } = currency;
|
|
10
|
+
const [integer, decimal] = Math.abs(value).toString().split('.');
|
|
11
|
+
let result = '';
|
|
12
|
+
let count = 0;
|
|
13
|
+
for (let i = 1; i <= integer.length; i++) {
|
|
14
|
+
const index = integer.length - i;
|
|
15
|
+
if (count === 3) {
|
|
16
|
+
count = 0;
|
|
17
|
+
result = `.${result}`;
|
|
18
|
+
}
|
|
19
|
+
count++;
|
|
20
|
+
result = `${integer.charAt(index)}${result}`;
|
|
21
|
+
}
|
|
22
|
+
if (decimals && decimal) {
|
|
23
|
+
result = `${result},${decimal.slice(0, 2)}`;
|
|
24
|
+
}
|
|
25
|
+
if (value < 0) {
|
|
26
|
+
result = `-${result}`;
|
|
27
|
+
}
|
|
28
|
+
return symbol ? `${symbol} ${result}` : result;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
class PartialSealed {
|
|
32
|
+
constructor(key, value) {
|
|
33
|
+
this.key = key;
|
|
34
|
+
this.value = value;
|
|
35
|
+
}
|
|
36
|
+
otherwise(otherwise) {
|
|
37
|
+
this.sealedOtherwise = otherwise;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
when(resolver, whenOtherwise) {
|
|
41
|
+
const handler = resolver[this.key];
|
|
42
|
+
const otherwise = whenOtherwise || this.sealedOtherwise;
|
|
43
|
+
if (otherwise) {
|
|
44
|
+
otherwise();
|
|
45
|
+
}
|
|
46
|
+
return handler ? handler(this.value) : undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function itIsDefined(object) {
|
|
51
|
+
return typeof object !== 'undefined' && object !== null;
|
|
52
|
+
}
|
|
11
53
|
|
|
12
54
|
const baseCls = 'rls-tabular-text';
|
|
13
55
|
const pointers = ['.', ','];
|
|
@@ -86,9 +128,6 @@ function RlsInput({ children, disabled, formControl, placeholder, type, value, o
|
|
|
86
128
|
setFocused(true);
|
|
87
129
|
}
|
|
88
130
|
function onBlur() {
|
|
89
|
-
if (formControl && !formControl.touched) {
|
|
90
|
-
formControl.touch();
|
|
91
|
-
}
|
|
92
131
|
formControl?.blur();
|
|
93
132
|
setFocused(false);
|
|
94
133
|
}
|
|
@@ -137,9 +176,6 @@ function RlsInputPassword({ disabled, formControl, placeholder, type, onValue })
|
|
|
137
176
|
setFocused(true);
|
|
138
177
|
}
|
|
139
178
|
function onBlur() {
|
|
140
|
-
if (formControl && !formControl.touched) {
|
|
141
|
-
formControl.touch();
|
|
142
|
-
}
|
|
143
179
|
formControl?.blur();
|
|
144
180
|
setFocused(false);
|
|
145
181
|
}
|
|
@@ -149,6 +185,10 @@ function RlsInputPassword({ disabled, formControl, placeholder, type, onValue })
|
|
|
149
185
|
}), children: jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type || 'password', placeholder: placeholder, disabled: disabled, onFocus: onFocus, onBlur: onBlur, onChange: onChange }) }));
|
|
150
186
|
}
|
|
151
187
|
|
|
188
|
+
function RlsInputSearch({ formControl, placeholder, onSearch }) {
|
|
189
|
+
return (jsxs("div", { className: "rls-input-search", children: [jsx(RlsInput, { formControl: formControl, placeholder: placeholder }), onSearch && jsx(RlsButtonAction, { icon: "search", onClick: onSearch })] }));
|
|
190
|
+
}
|
|
191
|
+
|
|
152
192
|
function RlsInputText({ disabled, formControl, placeholder, value, onValue }) {
|
|
153
193
|
const [valueInput, setValueInput] = useState(value || '');
|
|
154
194
|
function onText(value) {
|
|
@@ -186,16 +226,12 @@ function RlsRadioButton({ checked, disabled, rlsTheme, onClick }) {
|
|
|
186
226
|
return (jsx("div", { className: renderClassStatus('rls-radiobutton', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
187
227
|
}
|
|
188
228
|
|
|
189
|
-
function RlsSearchInput({ formControl, placeholder, onSearch }) {
|
|
190
|
-
return (jsxs("div", { className: "rls-search-input", children: [jsx(RlsInput, { formControl: formControl, placeholder: placeholder }), onSearch && jsx(RlsButtonAction, { icon: "search", onClick: onSearch })] }));
|
|
191
|
-
}
|
|
192
|
-
|
|
193
229
|
function RlsSkeleton({ rlsTheme }) {
|
|
194
230
|
return jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
|
|
195
231
|
}
|
|
196
232
|
|
|
197
233
|
function RlsSkeletonText({ active, children, rlsTheme }) {
|
|
198
|
-
return (jsx("div", { className:
|
|
234
|
+
return (jsx("div", { className: "rls-skeleton-text", "rls-theme": rlsTheme, children: active ? (jsx(RlsSkeleton, {})) : (jsx("span", { className: "rls-skeleton-text__value", children: children })) }));
|
|
199
235
|
}
|
|
200
236
|
|
|
201
237
|
function RlsSwitch({ checked, disabled, rlsTheme, onClick }) {
|
|
@@ -247,12 +283,16 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
247
283
|
}), children: jsx("ul", { children: options.map((action, index) => (jsx("li", { className: "truncate", onClick: () => onSelectAction(action), children: action.label }, index))) }) })] }));
|
|
248
284
|
}
|
|
249
285
|
|
|
286
|
+
function RlsMessageFormError({ className, formControl }) {
|
|
287
|
+
return (jsx(Fragment, { children: formControl?.wrong && (jsx("div", { className: className, children: jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl?.error?.message }) })) }));
|
|
288
|
+
}
|
|
289
|
+
|
|
250
290
|
function RlsFieldMoney({ children, decimals, disabled, formControl, placeholder, symbol, rlsTheme, value, onValue }) {
|
|
251
291
|
return (jsxs("div", { className: renderClassStatus('rls-field-box', {
|
|
252
292
|
focused: formControl?.focused,
|
|
253
293
|
error: formControl?.wrong,
|
|
254
294
|
disabled: formControl?.disabled || disabled
|
|
255
|
-
}, 'rls-field-money'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsx("div", { className: "rls-field-box__body", children: jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }),
|
|
295
|
+
}, 'rls-field-money'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsx("div", { className: "rls-field-box__body", children: jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
256
296
|
}
|
|
257
297
|
|
|
258
298
|
function RlsFieldNumber({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }) {
|
|
@@ -260,7 +300,7 @@ function RlsFieldNumber({ children, disabled, formControl, placeholder, rlsTheme
|
|
|
260
300
|
focused: formControl?.focused,
|
|
261
301
|
error: formControl?.wrong,
|
|
262
302
|
disabled: formControl?.disabled || disabled
|
|
263
|
-
}, 'rls-field-number'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsx("div", { className: "rls-field-box__body", children: jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }),
|
|
303
|
+
}, 'rls-field-number'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsx("div", { className: "rls-field-box__body", children: jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
264
304
|
}
|
|
265
305
|
|
|
266
306
|
function RlsFieldPassword({ children, disabled, formControl, placeholder, rlsTheme }) {
|
|
@@ -272,7 +312,7 @@ function RlsFieldPassword({ children, disabled, formControl, placeholder, rlsThe
|
|
|
272
312
|
focused: formControl?.focused,
|
|
273
313
|
error: formControl?.wrong,
|
|
274
314
|
disabled: formControl?.disabled || disabled
|
|
275
|
-
}, 'rls-field-password'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx(RlsInputPassword, { formControl: formControl, disabled: disabled, placeholder: placeholder, type: password ? 'password' : 'text' }), jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }),
|
|
315
|
+
}, 'rls-field-password'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx(RlsInputPassword, { formControl: formControl, disabled: disabled, placeholder: placeholder, type: password ? 'password' : 'text' }), jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
276
316
|
}
|
|
277
317
|
|
|
278
318
|
function RlsFieldText({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }) {
|
|
@@ -280,13 +320,13 @@ function RlsFieldText({ children, disabled, formControl, placeholder, rlsTheme,
|
|
|
280
320
|
focused: formControl?.focused,
|
|
281
321
|
error: formControl?.wrong,
|
|
282
322
|
disabled: formControl?.disabled || disabled
|
|
283
|
-
}, 'rls-field-text'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsx("div", { className: "rls-field-box__body", children: jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }),
|
|
323
|
+
}, 'rls-field-text'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsx("div", { className: "rls-field-box__body", children: jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
284
324
|
}
|
|
285
325
|
|
|
286
326
|
function RlsLabelCheckBox({ children, disabled, extended, formControl, rlsTheme }) {
|
|
287
|
-
const [checked, setChecked] = useState(formControl?.
|
|
327
|
+
const [checked, setChecked] = useState(!!formControl?.state);
|
|
288
328
|
useEffect(() => {
|
|
289
|
-
setChecked(formControl?.state
|
|
329
|
+
setChecked(!!formControl?.state);
|
|
290
330
|
}, [formControl?.state]);
|
|
291
331
|
function onToggle() {
|
|
292
332
|
if (formControl) {
|
|
@@ -303,7 +343,7 @@ function RlsLabelCheckBox({ children, disabled, extended, formControl, rlsTheme
|
|
|
303
343
|
}
|
|
304
344
|
|
|
305
345
|
function RlsLabelRadioButton({ children, disabled, extended, formControl, rlsTheme, value }) {
|
|
306
|
-
const [checked, setChecked] = useState(formControl?.state
|
|
346
|
+
const [checked, setChecked] = useState(formControl?.state === value);
|
|
307
347
|
useEffect(() => {
|
|
308
348
|
setChecked(formControl?.state === value);
|
|
309
349
|
}, [formControl?.state]);
|
|
@@ -319,9 +359,9 @@ function RlsLabelRadioButton({ children, disabled, extended, formControl, rlsThe
|
|
|
319
359
|
}
|
|
320
360
|
|
|
321
361
|
function RlsLabelSwitch({ children, disabled, extended, formControl, rlsTheme }) {
|
|
322
|
-
const [checked, setChecked] = useState(formControl?.
|
|
362
|
+
const [checked, setChecked] = useState(!!formControl?.state);
|
|
323
363
|
useEffect(() => {
|
|
324
|
-
setChecked(formControl?.state
|
|
364
|
+
setChecked(!!formControl?.state);
|
|
325
365
|
}, [formControl?.state]);
|
|
326
366
|
function onToggle() {
|
|
327
367
|
if (formControl) {
|
|
@@ -448,7 +488,7 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
448
488
|
}
|
|
449
489
|
function refreshCollection(elements, filter) {
|
|
450
490
|
const collection = filter
|
|
451
|
-
? elements.filter((element) => hasPattern(JSON.stringify(element), filter))
|
|
491
|
+
? elements.filter((element) => hasPattern$1(JSON.stringify(element), filter))
|
|
452
492
|
: elements;
|
|
453
493
|
setCollection(collection);
|
|
454
494
|
return collection;
|
|
@@ -547,6 +587,367 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
547
587
|
}) }), jsx("div", { className: "rls-pagination__description", children: description }), jsxs("div", { className: "rls-pagination__actions", children: [jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: lastPage, children: jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: lastPage, children: jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
|
|
548
588
|
}
|
|
549
589
|
|
|
590
|
+
const dateI18n = i18n({
|
|
591
|
+
es: {
|
|
592
|
+
// Months
|
|
593
|
+
january: 'Enero',
|
|
594
|
+
february: 'Febrero',
|
|
595
|
+
march: 'Marzo',
|
|
596
|
+
april: 'Abril',
|
|
597
|
+
may: 'Mayo',
|
|
598
|
+
june: 'Junio',
|
|
599
|
+
july: 'Julio',
|
|
600
|
+
august: 'Agosto',
|
|
601
|
+
september: 'Septiembre',
|
|
602
|
+
october: 'Octubre',
|
|
603
|
+
november: 'Noviembre',
|
|
604
|
+
december: 'Diciembre',
|
|
605
|
+
// Days
|
|
606
|
+
monday: 'Lunes',
|
|
607
|
+
tuesday: 'Martes',
|
|
608
|
+
wednesday: 'Miércoles',
|
|
609
|
+
thursday: 'Jueves',
|
|
610
|
+
friday: 'Viernes',
|
|
611
|
+
saturday: 'Sábado',
|
|
612
|
+
sunday: 'Domingo',
|
|
613
|
+
// Timestamps
|
|
614
|
+
year: 'año',
|
|
615
|
+
month: 'mes',
|
|
616
|
+
week: 'semana',
|
|
617
|
+
day: 'día',
|
|
618
|
+
hour: 'hora',
|
|
619
|
+
minute: 'minuto',
|
|
620
|
+
second: 'segundo'
|
|
621
|
+
},
|
|
622
|
+
en: {
|
|
623
|
+
// Months
|
|
624
|
+
january: 'January',
|
|
625
|
+
february: 'February',
|
|
626
|
+
march: 'March',
|
|
627
|
+
april: 'April',
|
|
628
|
+
may: 'May',
|
|
629
|
+
june: 'June',
|
|
630
|
+
july: 'July',
|
|
631
|
+
august: 'August',
|
|
632
|
+
september: 'September',
|
|
633
|
+
october: 'October',
|
|
634
|
+
november: 'November',
|
|
635
|
+
december: 'December',
|
|
636
|
+
// Days
|
|
637
|
+
monday: 'Monday',
|
|
638
|
+
tuesday: 'Tuesday',
|
|
639
|
+
wednesday: 'Wednesday',
|
|
640
|
+
thursday: 'Thursday',
|
|
641
|
+
friday: 'Friday',
|
|
642
|
+
saturday: 'Saturday',
|
|
643
|
+
sunday: 'Sunday',
|
|
644
|
+
// Timestamps
|
|
645
|
+
year: 'year',
|
|
646
|
+
month: 'month',
|
|
647
|
+
week: 'week',
|
|
648
|
+
day: 'day',
|
|
649
|
+
hour: 'hour',
|
|
650
|
+
minute: 'minute',
|
|
651
|
+
second: 'second'
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
var Miliseconds;
|
|
656
|
+
(function (Miliseconds) {
|
|
657
|
+
Miliseconds[Miliseconds["Year"] = 31536000000] = "Year";
|
|
658
|
+
Miliseconds[Miliseconds["Month"] = 2592000000] = "Month";
|
|
659
|
+
Miliseconds[Miliseconds["Week"] = 604800000] = "Week";
|
|
660
|
+
Miliseconds[Miliseconds["Day"] = 86400000] = "Day";
|
|
661
|
+
Miliseconds[Miliseconds["Hour"] = 3600000] = "Hour";
|
|
662
|
+
Miliseconds[Miliseconds["Minute"] = 60000] = "Minute";
|
|
663
|
+
Miliseconds[Miliseconds["Second"] = 1000] = "Second";
|
|
664
|
+
})(Miliseconds || (Miliseconds = {}));
|
|
665
|
+
var Day;
|
|
666
|
+
(function (Day) {
|
|
667
|
+
Day[Day["Sunday"] = 0] = "Sunday";
|
|
668
|
+
Day[Day["Monday"] = 1] = "Monday";
|
|
669
|
+
Day[Day["Tuesday"] = 2] = "Tuesday";
|
|
670
|
+
Day[Day["Wednesday"] = 3] = "Wednesday";
|
|
671
|
+
Day[Day["Thursday"] = 4] = "Thursday";
|
|
672
|
+
Day[Day["Friday"] = 5] = "Friday";
|
|
673
|
+
Day[Day["Saturday"] = 6] = "Saturday";
|
|
674
|
+
})(Day || (Day = {}));
|
|
675
|
+
var Month;
|
|
676
|
+
(function (Month) {
|
|
677
|
+
Month[Month["January"] = 0] = "January";
|
|
678
|
+
Month[Month["February"] = 1] = "February";
|
|
679
|
+
Month[Month["March"] = 2] = "March";
|
|
680
|
+
Month[Month["April"] = 3] = "April";
|
|
681
|
+
Month[Month["May"] = 4] = "May";
|
|
682
|
+
Month[Month["June"] = 5] = "June";
|
|
683
|
+
Month[Month["July"] = 6] = "July";
|
|
684
|
+
Month[Month["August"] = 7] = "August";
|
|
685
|
+
Month[Month["September"] = 8] = "September";
|
|
686
|
+
Month[Month["October"] = 9] = "October";
|
|
687
|
+
Month[Month["November"] = 10] = "November";
|
|
688
|
+
Month[Month["December"] = 11] = "December";
|
|
689
|
+
})(Month || (Month = {}));
|
|
690
|
+
var MonthDay;
|
|
691
|
+
(function (MonthDay) {
|
|
692
|
+
MonthDay[MonthDay["January"] = 31] = "January";
|
|
693
|
+
MonthDay[MonthDay["February"] = 28] = "February";
|
|
694
|
+
MonthDay[MonthDay["March"] = 31] = "March";
|
|
695
|
+
MonthDay[MonthDay["April"] = 30] = "April";
|
|
696
|
+
MonthDay[MonthDay["May"] = 31] = "May";
|
|
697
|
+
MonthDay[MonthDay["June"] = 30] = "June";
|
|
698
|
+
MonthDay[MonthDay["July"] = 31] = "July";
|
|
699
|
+
MonthDay[MonthDay["August"] = 31] = "August";
|
|
700
|
+
MonthDay[MonthDay["September"] = 30] = "September";
|
|
701
|
+
MonthDay[MonthDay["October"] = 31] = "October";
|
|
702
|
+
MonthDay[MonthDay["November"] = 30] = "November";
|
|
703
|
+
MonthDay[MonthDay["December"] = 31] = "December";
|
|
704
|
+
})(MonthDay || (MonthDay = {}));
|
|
705
|
+
|
|
706
|
+
let MONTH_NAMES_I18N = [];
|
|
707
|
+
let MONTH_LABELS_I18N = [];
|
|
708
|
+
let DAY_NAMES_I18N = [];
|
|
709
|
+
let DAY_LABELS_I18N = [];
|
|
710
|
+
function loadI18n(language = 'es') {
|
|
711
|
+
MONTH_NAMES_I18N = [
|
|
712
|
+
dateI18n('january', { language }),
|
|
713
|
+
dateI18n('february', { language }),
|
|
714
|
+
dateI18n('march', { language }),
|
|
715
|
+
dateI18n('april', { language }),
|
|
716
|
+
dateI18n('may', { language }),
|
|
717
|
+
dateI18n('june', { language }),
|
|
718
|
+
dateI18n('july', { language }),
|
|
719
|
+
dateI18n('august', { language }),
|
|
720
|
+
dateI18n('september', { language }),
|
|
721
|
+
dateI18n('october', { language }),
|
|
722
|
+
dateI18n('november', { language }),
|
|
723
|
+
dateI18n('december', { language })
|
|
724
|
+
];
|
|
725
|
+
MONTH_LABELS_I18N = MONTH_NAMES_I18N.map((name) => name.substring(0, 3));
|
|
726
|
+
DAY_NAMES_I18N = [
|
|
727
|
+
dateI18n('sunday', { language }),
|
|
728
|
+
dateI18n('monday', { language }),
|
|
729
|
+
dateI18n('tuesday', { language }),
|
|
730
|
+
dateI18n('wednesday', { language }),
|
|
731
|
+
dateI18n('thursday', { language }),
|
|
732
|
+
dateI18n('friday', { language }),
|
|
733
|
+
dateI18n('saturday', { language })
|
|
734
|
+
];
|
|
735
|
+
DAY_LABELS_I18N = DAY_NAMES_I18N.map((name) => name.substring(0, 3));
|
|
736
|
+
}
|
|
737
|
+
function isNumber(value) {
|
|
738
|
+
return value !== undefined && value !== null;
|
|
739
|
+
}
|
|
740
|
+
loadI18n();
|
|
741
|
+
i18nSubscribe((language) => loadI18n(language));
|
|
742
|
+
const MONTH_DAYS = [
|
|
743
|
+
MonthDay.January,
|
|
744
|
+
MonthDay.February,
|
|
745
|
+
MonthDay.March,
|
|
746
|
+
MonthDay.April,
|
|
747
|
+
MonthDay.May,
|
|
748
|
+
MonthDay.June,
|
|
749
|
+
MonthDay.July,
|
|
750
|
+
MonthDay.August,
|
|
751
|
+
MonthDay.September,
|
|
752
|
+
MonthDay.October,
|
|
753
|
+
MonthDay.November,
|
|
754
|
+
MonthDay.December
|
|
755
|
+
];
|
|
756
|
+
function MONTH_NAMES(index) {
|
|
757
|
+
return isNumber(index) ? MONTH_NAMES_I18N[index] || '' : MONTH_NAMES_I18N;
|
|
758
|
+
}
|
|
759
|
+
function MONTH_LABELS(index) {
|
|
760
|
+
return isNumber(index) ? MONTH_LABELS_I18N[index] || '' : MONTH_LABELS_I18N;
|
|
761
|
+
}
|
|
762
|
+
function DAY_NAMES(index) {
|
|
763
|
+
return isNumber(index) ? DAY_NAMES_I18N[index] || '' : DAY_NAMES_I18N;
|
|
764
|
+
}
|
|
765
|
+
function DAY_LABELS(index) {
|
|
766
|
+
return isNumber(index) ? DAY_LABELS_I18N[index] || '' : DAY_LABELS_I18N;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function completFormat(value, size) {
|
|
770
|
+
return value.toString().padStart(size, '0');
|
|
771
|
+
}
|
|
772
|
+
function hourFormat(date) {
|
|
773
|
+
const hour = date.getHours();
|
|
774
|
+
return hour > 12 ? hour - 12 : hour === 0 ? 12 : hour;
|
|
775
|
+
}
|
|
776
|
+
function verifyDayInYear(date, year) {
|
|
777
|
+
const days = getDaysOfMonth(year, date.getMonth());
|
|
778
|
+
if (days < date.getDate()) {
|
|
779
|
+
date.setDate(days);
|
|
780
|
+
}
|
|
781
|
+
date.setFullYear(year); // Establecer el año
|
|
782
|
+
}
|
|
783
|
+
function verifyDayInMonth(date, month) {
|
|
784
|
+
const days = getDaysOfMonth(date.getFullYear(), month);
|
|
785
|
+
if (days < date.getDate()) {
|
|
786
|
+
date.setDate(days);
|
|
787
|
+
}
|
|
788
|
+
date.setMonth(month); // Establecer el mes
|
|
789
|
+
}
|
|
790
|
+
const formatters = {
|
|
791
|
+
dd: (date) => {
|
|
792
|
+
return completFormat(date.getDate(), 2);
|
|
793
|
+
},
|
|
794
|
+
dw: (date) => {
|
|
795
|
+
return DAY_NAMES()[date.getDay()];
|
|
796
|
+
},
|
|
797
|
+
dx: (date) => {
|
|
798
|
+
return DAY_NAMES()[date.getDay()];
|
|
799
|
+
},
|
|
800
|
+
mm: (date) => {
|
|
801
|
+
return completFormat(date.getMonth() + 1, 2);
|
|
802
|
+
},
|
|
803
|
+
mn: (date) => {
|
|
804
|
+
return MONTH_NAMES(date.getMonth());
|
|
805
|
+
},
|
|
806
|
+
mx: (date) => {
|
|
807
|
+
return MONTH_LABELS(date.getMonth());
|
|
808
|
+
},
|
|
809
|
+
aa: (date) => {
|
|
810
|
+
return completFormat(date.getFullYear(), 4);
|
|
811
|
+
},
|
|
812
|
+
hh: (date) => {
|
|
813
|
+
return completFormat(date.getHours(), 2);
|
|
814
|
+
},
|
|
815
|
+
ii: (date) => {
|
|
816
|
+
return completFormat(date.getMinutes(), 2);
|
|
817
|
+
},
|
|
818
|
+
ss: (date) => {
|
|
819
|
+
return completFormat(date.getSeconds(), 2);
|
|
820
|
+
},
|
|
821
|
+
hz: (date) => {
|
|
822
|
+
return completFormat(hourFormat(date), 2);
|
|
823
|
+
},
|
|
824
|
+
zz: (date) => {
|
|
825
|
+
return date.getHours() > 11 ? 'PM' : 'AM';
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
const createElapsedTime = (value, single, charPlural = 's', plural) => {
|
|
829
|
+
plural = plural || `${single}${charPlural}`;
|
|
830
|
+
const label = `${single}(${charPlural})`;
|
|
831
|
+
return {
|
|
832
|
+
value,
|
|
833
|
+
label,
|
|
834
|
+
single,
|
|
835
|
+
plural
|
|
836
|
+
};
|
|
837
|
+
};
|
|
838
|
+
[
|
|
839
|
+
createElapsedTime(Miliseconds.Year, 'año'),
|
|
840
|
+
createElapsedTime(Miliseconds.Month, 'mes', 'es'),
|
|
841
|
+
createElapsedTime(Miliseconds.Week, 'semana'),
|
|
842
|
+
createElapsedTime(Miliseconds.Day, 'día', 's', 'dias'),
|
|
843
|
+
createElapsedTime(Miliseconds.Hour, 'hora'),
|
|
844
|
+
createElapsedTime(Miliseconds.Minute, 'minuto'),
|
|
845
|
+
createElapsedTime(Miliseconds.Second, 'segundo')
|
|
846
|
+
];
|
|
847
|
+
function getDateWeight(date) {
|
|
848
|
+
return date.getFullYear() * 365 + (date.getMonth() + 1) * 30 + date.getDate();
|
|
849
|
+
}
|
|
850
|
+
function dateIsEquals(date, compare = new Date()) {
|
|
851
|
+
return date.getTime() === compare.getTime();
|
|
852
|
+
}
|
|
853
|
+
function dateIsEqualsWeight(date, compare = new Date()) {
|
|
854
|
+
return getDateWeight(date) === getDateWeight(compare);
|
|
855
|
+
}
|
|
856
|
+
function dateIsBefore(date, compare = new Date()) {
|
|
857
|
+
return date.getTime() > compare.getTime();
|
|
858
|
+
}
|
|
859
|
+
function dateIsAfter(date, compare = new Date()) {
|
|
860
|
+
return date.getTime() < compare.getTime();
|
|
861
|
+
}
|
|
862
|
+
function dateIsBetween(minDate, maxDate, compare = new Date()) {
|
|
863
|
+
return dateIsAfter(minDate, compare) && dateIsBefore(maxDate, compare);
|
|
864
|
+
}
|
|
865
|
+
function getTimeDifference(date, compare = new Date()) {
|
|
866
|
+
return date.getTime() - compare.getTime();
|
|
867
|
+
}
|
|
868
|
+
function normalizeMinTime(date) {
|
|
869
|
+
const normalize = new Date(date.getTime());
|
|
870
|
+
normalize.setHours(0);
|
|
871
|
+
normalize.setMinutes(0);
|
|
872
|
+
normalize.setSeconds(0);
|
|
873
|
+
normalize.setMilliseconds(0);
|
|
874
|
+
return normalize;
|
|
875
|
+
}
|
|
876
|
+
function normalizeMaxTime(date) {
|
|
877
|
+
const normalize = new Date(date.getTime());
|
|
878
|
+
normalize.setHours(23);
|
|
879
|
+
normalize.setMinutes(59);
|
|
880
|
+
normalize.setSeconds(59);
|
|
881
|
+
normalize.setMilliseconds(0);
|
|
882
|
+
return normalize;
|
|
883
|
+
}
|
|
884
|
+
function getDaysOfMonth(year, month) {
|
|
885
|
+
return month === 1 && isLeapYear(year) ? 29 : MONTH_DAYS[month];
|
|
886
|
+
}
|
|
887
|
+
function isLeapYear(value) {
|
|
888
|
+
const year = value instanceof Date ? value.getFullYear() : value;
|
|
889
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
890
|
+
}
|
|
891
|
+
const regInterpolation = /{([^{}]*)}/g;
|
|
892
|
+
function dateFormatTemplate(date, template) {
|
|
893
|
+
return template.replace(regInterpolation, (value, key) => formatters[key] ? formatters[key](date) : value);
|
|
894
|
+
}
|
|
895
|
+
function assignYearInDate(date, year) {
|
|
896
|
+
const newDate = new Date(date.getTime());
|
|
897
|
+
verifyDayInYear(newDate, year);
|
|
898
|
+
newDate.setFullYear(year);
|
|
899
|
+
return newDate;
|
|
900
|
+
}
|
|
901
|
+
function assignMonthInDate(date, month) {
|
|
902
|
+
const newDate = new Date(date.getTime());
|
|
903
|
+
verifyDayInMonth(newDate, month);
|
|
904
|
+
newDate.setMonth(month);
|
|
905
|
+
return newDate;
|
|
906
|
+
}
|
|
907
|
+
function assignDayInDate(date, day) {
|
|
908
|
+
const newDate = new Date(date.getTime());
|
|
909
|
+
newDate.setDate(day);
|
|
910
|
+
return newDate;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
class DateRange {
|
|
914
|
+
constructor(minDate, maxDate) {
|
|
915
|
+
this.minDate = normalizeMinTime(minDate);
|
|
916
|
+
this.maxDate =
|
|
917
|
+
maxDate && dateIsBefore(maxDate, minDate)
|
|
918
|
+
? normalizeMinTime(maxDate)
|
|
919
|
+
: normalizeMinTime(minDate);
|
|
920
|
+
}
|
|
921
|
+
get minISOFormat() {
|
|
922
|
+
return this.minDate.toISOString();
|
|
923
|
+
}
|
|
924
|
+
get maxISOFormat() {
|
|
925
|
+
return this.maxDate.toISOString();
|
|
926
|
+
}
|
|
927
|
+
between(date) {
|
|
928
|
+
return dateIsBetween(this.minDate, this.maxDate, date);
|
|
929
|
+
}
|
|
930
|
+
equals({ maxDate, minDate }) {
|
|
931
|
+
return dateIsEquals(this.minDate, minDate) && dateIsEquals(this.maxDate, maxDate);
|
|
932
|
+
}
|
|
933
|
+
recalculate(date) {
|
|
934
|
+
if (dateIsBefore(this.minDate, date)) {
|
|
935
|
+
return new DateRange(date, this.maxDate);
|
|
936
|
+
}
|
|
937
|
+
if (dateIsAfter(this.maxDate, date)) {
|
|
938
|
+
return new DateRange(this.minDate, date);
|
|
939
|
+
}
|
|
940
|
+
const minDifference = getTimeDifference(date, this.minDate);
|
|
941
|
+
const maxDifference = getTimeDifference(this.maxDate, date);
|
|
942
|
+
return minDifference > maxDifference
|
|
943
|
+
? new DateRange(this.minDate, date)
|
|
944
|
+
: new DateRange(date, this.maxDate);
|
|
945
|
+
}
|
|
946
|
+
static now() {
|
|
947
|
+
return new DateRange(new Date());
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
550
951
|
function dateIsOutRangeMin(props) {
|
|
551
952
|
const { date, minDate } = props;
|
|
552
953
|
return !!minDate && dateIsBefore(normalizeMinTime(minDate), date);
|
|
@@ -887,6 +1288,30 @@ function createYearPicker(props) {
|
|
|
887
1288
|
};
|
|
888
1289
|
}
|
|
889
1290
|
|
|
1291
|
+
const normalize = (word) => {
|
|
1292
|
+
return word
|
|
1293
|
+
.slice()
|
|
1294
|
+
.replace(/á/g, 'a')
|
|
1295
|
+
.replace(/Á/g, 'A')
|
|
1296
|
+
.replace(/é/g, 'e')
|
|
1297
|
+
.replace(/É/g, 'E')
|
|
1298
|
+
.replace(/í/g, 'i')
|
|
1299
|
+
.replace(/Í/g, 'I')
|
|
1300
|
+
.replace(/ó/g, 'o')
|
|
1301
|
+
.replace(/Ó/g, 'O')
|
|
1302
|
+
.replace(/ú/g, 'u')
|
|
1303
|
+
.replace(/Ú/g, 'U');
|
|
1304
|
+
};
|
|
1305
|
+
const hasPattern = (word, pattern, force = false) => {
|
|
1306
|
+
let filter = pattern.toLowerCase();
|
|
1307
|
+
let test = word.toLowerCase();
|
|
1308
|
+
if (force) {
|
|
1309
|
+
test = normalize(test);
|
|
1310
|
+
filter = normalize(filter);
|
|
1311
|
+
}
|
|
1312
|
+
return !!test.match(`^.*${filter}.*$`);
|
|
1313
|
+
};
|
|
1314
|
+
|
|
890
1315
|
function createEmptyStore() {
|
|
891
1316
|
return {
|
|
892
1317
|
coincidences: undefined,
|
|
@@ -1282,15 +1707,7 @@ class ConfirmationResult extends PartialSealed {
|
|
|
1282
1707
|
}
|
|
1283
1708
|
}
|
|
1284
1709
|
function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
1285
|
-
return (jsxs("div", { className: renderClassStatus('rls-confirmation', { visible }), "rls-theme": rlsTheme, children: [jsxs("div", { className: "rls-confirmation__component", children: [jsxs("div", { className: "rls-confirmation__header", children: [title &&
|
|
1286
|
-
if (approved.onClick) {
|
|
1287
|
-
approved.onClick();
|
|
1288
|
-
}
|
|
1289
|
-
}, children: approved.label })), reject && (jsx(RlsButton, { type: "outline", onClick: () => {
|
|
1290
|
-
if (reject.onClick) {
|
|
1291
|
-
reject.onClick();
|
|
1292
|
-
}
|
|
1293
|
-
}, children: reject.label }))] }) }))] }), jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
1710
|
+
return (jsxs("div", { className: renderClassStatus('rls-confirmation', { visible }), "rls-theme": rlsTheme, children: [jsxs("div", { className: "rls-confirmation__component", children: [jsxs("div", { className: "rls-confirmation__header", children: [title && jsx("div", { className: "rls-confirmation__title", children: title }), subtitle && (jsx("div", { className: "rls-confirmation__subtitle", children: subtitle }))] }), jsx("div", { className: "rls-confirmation__body", children: content && (jsx("div", { className: "rls-confirmation__message", children: content })) }), (approved || reject) && (jsx("div", { className: "rls-confirmation__footer", children: jsxs("div", { className: "rls-confirmation__actions", children: [approved && (jsx(RlsButton, { type: "raised", onClick: approved.onClick, children: approved.label })), reject && (jsx(RlsButton, { type: "outline", onClick: reject.onClick, children: reject.label }))] }) }))] }), jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
1294
1711
|
}
|
|
1295
1712
|
function useConfirmationService() {
|
|
1296
1713
|
const [config, setConfig] = useState({});
|
|
@@ -1359,15 +1776,18 @@ function useDatatable() {
|
|
|
1359
1776
|
const bodyRef = useRef(null);
|
|
1360
1777
|
useEffect(() => {
|
|
1361
1778
|
let observer;
|
|
1362
|
-
|
|
1779
|
+
const body = bodyRef?.current;
|
|
1780
|
+
if (body) {
|
|
1363
1781
|
observer = new ResizeObserver(() => {
|
|
1364
|
-
const scrollHeight =
|
|
1365
|
-
const clientHeight =
|
|
1782
|
+
const scrollHeight = body.scrollHeight || 0;
|
|
1783
|
+
const clientHeight = body.clientHeight || 0;
|
|
1366
1784
|
setScrolleable(scrollHeight > clientHeight);
|
|
1367
1785
|
});
|
|
1368
1786
|
observer.observe(bodyRef?.current);
|
|
1369
1787
|
}
|
|
1370
|
-
return () =>
|
|
1788
|
+
return () => {
|
|
1789
|
+
observer?.disconnect();
|
|
1790
|
+
};
|
|
1371
1791
|
}, []);
|
|
1372
1792
|
return { bodyRef, scrolleable };
|
|
1373
1793
|
}
|
|
@@ -1376,17 +1796,18 @@ function useListControl({ suggestions, formControl }) {
|
|
|
1376
1796
|
const boxContentRef = useRef(null);
|
|
1377
1797
|
const listRef = useRef(null);
|
|
1378
1798
|
const inputRef = useRef(null);
|
|
1379
|
-
const [
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1799
|
+
const [listState, setListState] = useState({
|
|
1800
|
+
collection: new ListCollection([]),
|
|
1801
|
+
focused: false,
|
|
1802
|
+
higher: false,
|
|
1803
|
+
value: '',
|
|
1804
|
+
visible: false
|
|
1805
|
+
});
|
|
1385
1806
|
const position = useRef(0);
|
|
1386
1807
|
useEffect(() => {
|
|
1387
1808
|
function onCloseSuggestions({ target }) {
|
|
1388
1809
|
if (!boxContentRef?.current?.contains(target)) {
|
|
1389
|
-
|
|
1810
|
+
setListState((state) => ({ ...state, visible: false }));
|
|
1390
1811
|
}
|
|
1391
1812
|
}
|
|
1392
1813
|
document.addEventListener('click', onCloseSuggestions);
|
|
@@ -1395,25 +1816,37 @@ function useListControl({ suggestions, formControl }) {
|
|
|
1395
1816
|
};
|
|
1396
1817
|
}, []);
|
|
1397
1818
|
useEffect(() => {
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
}, [visible]);
|
|
1819
|
+
const boxContent = boxContentRef.current;
|
|
1820
|
+
const list = listRef.current;
|
|
1821
|
+
formControl?.touch();
|
|
1822
|
+
setListState((state) => ({
|
|
1823
|
+
...state,
|
|
1824
|
+
higher: !locationListIsBottom(boxContent, list)
|
|
1825
|
+
}));
|
|
1826
|
+
}, [listState.visible]);
|
|
1406
1827
|
useEffect(() => {
|
|
1407
|
-
|
|
1828
|
+
setListState((state) => ({
|
|
1829
|
+
...state,
|
|
1830
|
+
collection: new ListCollection(suggestions)
|
|
1831
|
+
}));
|
|
1408
1832
|
}, [suggestions]);
|
|
1833
|
+
function setFocused(focused) {
|
|
1834
|
+
setListState((state) => ({ ...state, focused }));
|
|
1835
|
+
}
|
|
1836
|
+
function setValue(value) {
|
|
1837
|
+
setListState((state) => ({ ...state, value }));
|
|
1838
|
+
}
|
|
1839
|
+
function setVisible(visible) {
|
|
1840
|
+
setListState((state) => ({ ...state, visible }));
|
|
1841
|
+
}
|
|
1409
1842
|
function navigationInput(event) {
|
|
1410
|
-
if (visible) {
|
|
1843
|
+
if (listState.visible) {
|
|
1411
1844
|
const newPosition = listNavigationInput({
|
|
1412
1845
|
contentElement: boxContentRef.current,
|
|
1413
1846
|
event: event,
|
|
1414
1847
|
listElement: listRef.current
|
|
1415
1848
|
});
|
|
1416
|
-
position.current =
|
|
1849
|
+
position.current = newPosition || 0;
|
|
1417
1850
|
}
|
|
1418
1851
|
}
|
|
1419
1852
|
function navigationElement(event) {
|
|
@@ -1426,19 +1859,15 @@ function useListControl({ suggestions, formControl }) {
|
|
|
1426
1859
|
});
|
|
1427
1860
|
}
|
|
1428
1861
|
return {
|
|
1862
|
+
...listState,
|
|
1429
1863
|
boxContentRef,
|
|
1430
|
-
collection,
|
|
1431
|
-
focused,
|
|
1432
|
-
higher,
|
|
1433
1864
|
inputRef,
|
|
1434
1865
|
listRef,
|
|
1435
1866
|
navigationElement,
|
|
1436
1867
|
navigationInput,
|
|
1437
1868
|
setFocused,
|
|
1438
1869
|
setValue,
|
|
1439
|
-
setVisible
|
|
1440
|
-
value,
|
|
1441
|
-
visible
|
|
1870
|
+
setVisible
|
|
1442
1871
|
};
|
|
1443
1872
|
}
|
|
1444
1873
|
|
|
@@ -1595,7 +2024,7 @@ function RlsFieldAutocompleteTemplate({ suggestions, children, disabled, formCon
|
|
|
1595
2024
|
disabled,
|
|
1596
2025
|
focused: listControl.focused,
|
|
1597
2026
|
selected: !!listControl.value
|
|
1598
|
-
}, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("label", { className: "rls-field-list__control", onClick: onClickControl, children: listControl.value ? (jsx("span", { className: "rls-field-list__control__description", children: listControl.value })) : (jsx("span", { className: "rls-field-list__control__placeholder", children: placeholder })) }), !hiddenIcon && listControl.value && (jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: onClickAction, children: jsx(RlsIcon, { value: "trash-2" }) }))] }) }),
|
|
2027
|
+
}, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("label", { className: "rls-field-list__control", onClick: onClickControl, children: listControl.value ? (jsx("span", { className: "rls-field-list__control__description", children: listControl.value })) : (jsx("span", { className: "rls-field-list__control__placeholder", children: placeholder })) }), !hiddenIcon && listControl.value && (jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: onClickAction, children: jsx(RlsIcon, { value: "trash-2" }) }))] }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
1599
2028
|
visible: listControl.visible,
|
|
1600
2029
|
hide: !listControl.visible,
|
|
1601
2030
|
higher: listControl.higher
|
|
@@ -1615,8 +2044,28 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
1615
2044
|
return `${minFormat} - ${maxFormat}`;
|
|
1616
2045
|
}
|
|
1617
2046
|
|
|
1618
|
-
|
|
1619
|
-
|
|
2047
|
+
function RlsModal({ children, visible, rlsTheme }) {
|
|
2048
|
+
return ReactDOM.createPortal(jsxs("div", { className: renderClassStatus('rls-modal', { visible }), "rls-theme": rlsTheme, children: [jsx("div", { className: "rls-modal__component", children: children }), jsx("div", { className: "rls-modal__backdrop" })] }), document.body);
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
function itIsFormControlOptions(props) {
|
|
2052
|
+
return (typeof props === 'object' && ('state' in props || 'validators' in props));
|
|
2053
|
+
}
|
|
2054
|
+
function createFormControlOptions(...argsProps) {
|
|
2055
|
+
const [props, validators] = argsProps;
|
|
2056
|
+
if (!props) {
|
|
2057
|
+
return { state: props, validators };
|
|
2058
|
+
}
|
|
2059
|
+
if (!validators && itIsFormControlOptions(props)) {
|
|
2060
|
+
return props;
|
|
2061
|
+
}
|
|
2062
|
+
return {
|
|
2063
|
+
state: props,
|
|
2064
|
+
validators
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
const controlIsValid = ({ state, validators }) => {
|
|
1620
2069
|
return validators.reduce((errors, validator) => {
|
|
1621
2070
|
const error = validator(state);
|
|
1622
2071
|
if (error) {
|
|
@@ -1626,89 +2075,77 @@ const controlIsValid = (props) => {
|
|
|
1626
2075
|
}, []);
|
|
1627
2076
|
};
|
|
1628
2077
|
|
|
1629
|
-
function useControl(
|
|
1630
|
-
const
|
|
1631
|
-
const [
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
const
|
|
2078
|
+
function useControl(controlOptions, controlValidators) {
|
|
2079
|
+
const { state, touched, validators } = createFormControlOptions(controlOptions, controlValidators);
|
|
2080
|
+
const [controlState, setControlState] = useState({
|
|
2081
|
+
dirty: false,
|
|
2082
|
+
disabled: false,
|
|
2083
|
+
focused: false,
|
|
2084
|
+
state: state,
|
|
2085
|
+
touched: !!touched,
|
|
2086
|
+
validators: validators
|
|
2087
|
+
});
|
|
2088
|
+
const initialState = useRef(state);
|
|
1640
2089
|
const elementRef = useRef(null);
|
|
1641
|
-
const errors =
|
|
1642
|
-
const
|
|
1643
|
-
const valid = (() => errors.length === 0)();
|
|
1644
|
-
useEffect(() => {
|
|
1645
|
-
if (state !== null && state !== undefined) {
|
|
1646
|
-
setValue(state);
|
|
1647
|
-
}
|
|
1648
|
-
subscribers.next(state);
|
|
1649
|
-
}, [state]);
|
|
2090
|
+
const errors = validators ? controlIsValid({ state, validators }) : [];
|
|
2091
|
+
const valid = errors.length === 0;
|
|
1650
2092
|
function focus() {
|
|
1651
|
-
|
|
2093
|
+
setControlState((state) => ({ ...state, focused: true }));
|
|
1652
2094
|
}
|
|
1653
2095
|
function blur() {
|
|
1654
|
-
|
|
2096
|
+
setControlState((state) => ({ ...state, focused: false, touched: true }));
|
|
1655
2097
|
}
|
|
1656
2098
|
function disable() {
|
|
1657
|
-
|
|
2099
|
+
setControlState((state) => ({ ...state, disabled: true }));
|
|
1658
2100
|
}
|
|
1659
2101
|
function enable() {
|
|
1660
|
-
|
|
2102
|
+
setControlState((state) => ({ ...state, disabled: false }));
|
|
1661
2103
|
}
|
|
1662
2104
|
function touch() {
|
|
1663
|
-
|
|
1664
|
-
}
|
|
1665
|
-
function untouch() {
|
|
1666
|
-
setTouched(false);
|
|
2105
|
+
setControlState((state) => ({ ...state, touched: true }));
|
|
1667
2106
|
}
|
|
1668
2107
|
function setState(state) {
|
|
1669
|
-
|
|
1670
|
-
|
|
2108
|
+
setControlState((currentState) => ({
|
|
2109
|
+
...currentState,
|
|
2110
|
+
dirty: true,
|
|
2111
|
+
state
|
|
2112
|
+
}));
|
|
1671
2113
|
}
|
|
1672
|
-
function
|
|
1673
|
-
|
|
1674
|
-
setDirty(false);
|
|
1675
|
-
setCurrentState(initialValue);
|
|
2114
|
+
function setValidators(validators) {
|
|
2115
|
+
setControlState((state) => ({ ...state, validators }));
|
|
1676
2116
|
}
|
|
1677
|
-
function
|
|
1678
|
-
|
|
1679
|
-
|
|
2117
|
+
function reset() {
|
|
2118
|
+
setControlState((currentState) => ({
|
|
2119
|
+
...currentState,
|
|
2120
|
+
dirty: false,
|
|
2121
|
+
state: initialState.current,
|
|
2122
|
+
touched: false
|
|
2123
|
+
}));
|
|
1680
2124
|
}
|
|
1681
2125
|
return {
|
|
2126
|
+
...controlState,
|
|
1682
2127
|
blur,
|
|
1683
|
-
dirty,
|
|
1684
2128
|
disable,
|
|
1685
|
-
disabled,
|
|
1686
2129
|
elementRef,
|
|
1687
2130
|
enable,
|
|
1688
|
-
enabled: !disabled,
|
|
1689
|
-
error,
|
|
2131
|
+
enabled: !controlState.disabled,
|
|
2132
|
+
error: errors[0],
|
|
1690
2133
|
errors,
|
|
1691
2134
|
focus,
|
|
1692
|
-
focused,
|
|
1693
2135
|
invalid: !valid,
|
|
1694
|
-
pristine: !dirty,
|
|
2136
|
+
pristine: !controlState.dirty,
|
|
1695
2137
|
reset,
|
|
1696
2138
|
setState,
|
|
1697
2139
|
setValidators,
|
|
1698
|
-
state,
|
|
1699
|
-
subscribe,
|
|
1700
2140
|
touch,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
untouch,
|
|
1704
|
-
untouched: !touched,
|
|
2141
|
+
unfocused: !controlState.focused,
|
|
2142
|
+
untouched: !controlState.touched,
|
|
1705
2143
|
valid,
|
|
1706
|
-
|
|
1707
|
-
wrong: touched && !valid
|
|
2144
|
+
wrong: controlState.touched && !valid
|
|
1708
2145
|
};
|
|
1709
2146
|
}
|
|
1710
|
-
function useReactControl(
|
|
1711
|
-
return useControl(
|
|
2147
|
+
function useReactControl(options, validators) {
|
|
2148
|
+
return useControl(options, validators);
|
|
1712
2149
|
}
|
|
1713
2150
|
|
|
1714
2151
|
const FORMAT_DESCRIPTION = '{dw}, {mx} {dd} de {aa}';
|
|
@@ -1773,17 +2210,13 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
1773
2210
|
onListener({ type: PickerListenerType.Select, value });
|
|
1774
2211
|
}
|
|
1775
2212
|
}
|
|
1776
|
-
return (jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxs("div", { className: "rls-picker-date__header", children: [jsx("div", { className: "rls-picker-date__title rls-picker-date__title--description", children: jsx("span", { onClick: onVisibilityDay, children: dateFormatTemplate(dateInitial, FORMAT_DESCRIPTION) }) }), jsx("div", { className: "rls-picker-date__title rls-picker-date__title--year", children: jsx("span", { onClick: onVisibilityYear, children: yearControl.
|
|
2213
|
+
return (jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxs("div", { className: "rls-picker-date__header", children: [jsx("div", { className: "rls-picker-date__title rls-picker-date__title--description", children: jsx("span", { onClick: onVisibilityDay, children: dateFormatTemplate(dateInitial, FORMAT_DESCRIPTION) }) }), jsx("div", { className: "rls-picker-date__title rls-picker-date__title--year", children: jsx("span", { onClick: onVisibilityYear, children: yearControl.state }) }), jsx(RlsPickerMonthTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityMonth })] }), jsxs("div", { className: renderClassStatus('rls-picker-date__component', {
|
|
1777
2214
|
day: visibility === 'DAY',
|
|
1778
2215
|
month: visibility === 'MONTH',
|
|
1779
2216
|
year: visibility === 'YEAR'
|
|
1780
2217
|
}), children: [jsx(RlsPickerDay, { formControl: dayControl, date: dateInitial, month: monthControl.state, year: yearControl.state, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsx(RlsPickerMonth, { formControl: monthControl, date: dateInitial, year: yearControl.state, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsx(RlsPickerYear, { formControl: yearControl, date: dateInitial, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsx("div", { className: renderClassStatus('rls-picker-date__footer', { automatic }), children: jsxs("div", { className: "rls-picker-date__actions", children: [jsx("div", { className: "rls-picker-date__actions--cancel", children: jsx(RlsButton, { type: "ghost", onClick: onCancel, children: reactI18n('dateActionCancel') }) }), jsx("div", { className: "rls-picker-date__actions--today", children: jsx(RlsButton, { type: "ghost", onClick: onToday, disabled: dateOutRange({ date: today, maxDate, minDate }), children: reactI18n('dateActionToday') }) }), jsx("div", { className: "rls-picker-date__actions--ok", children: jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) })] }));
|
|
1781
2218
|
}
|
|
1782
2219
|
|
|
1783
|
-
function RlsModal({ children, visible, rlsTheme }) {
|
|
1784
|
-
return ReactDOM.createPortal(jsxs("div", { className: renderClassStatus('rls-modal', { visible }), "rls-theme": rlsTheme, children: [jsx("div", { className: "rls-modal__component", children: children }), jsx("div", { className: "rls-modal__backdrop" })] }), document.body);
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
2220
|
function RlsFieldDate({ children, date, disabled, formControl, maxDate, minDate, onValue, placeholder, rlsTheme }) {
|
|
1788
2221
|
const today = new Date(); // Initial current date in component
|
|
1789
2222
|
const [value, setValue] = useState();
|
|
@@ -1811,23 +2244,19 @@ function RlsFieldDate({ children, date, disabled, formControl, maxDate, minDate,
|
|
|
1811
2244
|
}
|
|
1812
2245
|
function onClean() {
|
|
1813
2246
|
if (value) {
|
|
2247
|
+
formControl?.touch();
|
|
1814
2248
|
onChange(undefined);
|
|
1815
|
-
if (formControl && !formControl.touched) {
|
|
1816
|
-
formControl.touch();
|
|
1817
|
-
}
|
|
1818
2249
|
}
|
|
1819
2250
|
else {
|
|
1820
2251
|
setModalIsVisible(true);
|
|
1821
2252
|
}
|
|
1822
2253
|
}
|
|
1823
|
-
return (jsxs("div", { className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("input", { className: "rls-field-date__control", type: "text", value: value ? dateFormatTemplate(value, DATE_RANGE_FORMAT) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsx("button", { className: "rls-field-date__action", onClick: onClean, disabled: disabled, children: jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }),
|
|
2254
|
+
return (jsxs("div", { className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("input", { className: "rls-field-date__control", type: "text", value: value ? dateFormatTemplate(value, DATE_RANGE_FORMAT) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsx("button", { className: "rls-field-date__action", onClick: onClean, disabled: disabled, children: jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }), jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsx(RlsPickerDate, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value, type }) => {
|
|
1824
2255
|
if (type !== PickerListenerType.Cancel) {
|
|
1825
2256
|
onChange(value, true);
|
|
1826
2257
|
}
|
|
2258
|
+
formControl?.touch();
|
|
1827
2259
|
setModalIsVisible(false);
|
|
1828
|
-
if (!formControl?.touched) {
|
|
1829
|
-
formControl?.touch();
|
|
1830
|
-
}
|
|
1831
2260
|
} }) })] }));
|
|
1832
2261
|
}
|
|
1833
2262
|
|
|
@@ -1906,7 +2335,7 @@ function RlsFieldDateRange({ children, date: datePicker, disabled, formControl,
|
|
|
1906
2335
|
setModalIsVisible(true);
|
|
1907
2336
|
}
|
|
1908
2337
|
}
|
|
1909
|
-
return (jsxs("div", { className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("input", { className: "rls-field-date-range__control", type: "text", value: value ? rangeFormatTemplate(value) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: disabled, children: jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) })] }), jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
|
|
2338
|
+
return (jsxs("div", { className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("input", { className: "rls-field-date-range__control", type: "text", value: value ? rangeFormatTemplate(value) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: disabled, children: jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }), jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
|
|
1910
2339
|
if (value) {
|
|
1911
2340
|
setValue(value);
|
|
1912
2341
|
}
|
|
@@ -2035,7 +2464,7 @@ function RlsFieldSelectTemplate({ suggestions, children, disabled, formControl,
|
|
|
2035
2464
|
});
|
|
2036
2465
|
return (jsxs("div", { ref: listControl.boxContentRef, className: renderClassStatus('rls-field-box', { focused: listControl.focused, disabled }, 'rls-field-list rls-field-select'), "rls-theme": rlsTheme, children: [children && jsx("label", { className: "rls-field-box__label", children: children }), jsx("div", { className: "rls-field-box__component", children: jsxs("div", { className: "rls-field-box__body", children: [jsx("input", { ref: listControl.inputRef, className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: listControl.value, onFocus: onFocusInput, onBlur: onBlurInput, onClick: onClickInput, onKeyDown: onKeydownInput }), jsx("button", { className: renderClassStatus('rls-field-list__action', {
|
|
2037
2466
|
visible: listControl.visible
|
|
2038
|
-
}), disabled: disabled, onClick: onClickAction, children: jsx(RlsIcon, { value: "arrow-ios-down" }) })] }) }),
|
|
2467
|
+
}), disabled: disabled, onClick: onClickAction, children: jsx(RlsIcon, { value: "arrow-ios-down" }) })] }) }), jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
2039
2468
|
visible: listControl.visible,
|
|
2040
2469
|
hide: !listControl.visible,
|
|
2041
2470
|
higher: listControl.higher
|
|
@@ -2110,5 +2539,5 @@ function RlsApplication({ children }) {
|
|
|
2110
2539
|
return (jsxs(RlsContext.Provider, { value: { confirmation, snackbar }, children: [jsx("div", { className: "rls-app__body", children: children }), RlsSnackbar, RlsConfirmation] }));
|
|
2111
2540
|
}
|
|
2112
2541
|
|
|
2113
|
-
export { ConfirmationResult, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableHeader, RlsDatatableInfo, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerMonthTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton,
|
|
2542
|
+
export { ConfirmationResult, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableHeader, RlsDatatableInfo, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerMonthTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, rangeFormatTemplate, renderClassStatus, useConfirmationService, useDatatable, useListControl, useSnackbarService };
|
|
2114
2543
|
//# sourceMappingURL=index.js.map
|