@rolster/react-components 1.5.7 → 18.10.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.
Files changed (153) hide show
  1. package/dist/cjs/assets/{lib.cjs-c052832f.css → index-Fy0sGm5F.css} +159 -106
  2. package/dist/cjs/index.js +2119 -0
  3. package/dist/cjs/index.js.map +1 -0
  4. package/dist/es/assets/{lib-c052832f.css → index-Fy0sGm5F.css} +159 -106
  5. package/dist/es/index.js +2051 -0
  6. package/dist/es/index.js.map +1 -0
  7. package/dist/esm/components/atoms/Amount/Amount.css +3 -2
  8. package/dist/esm/components/atoms/Amount/Amount.d.ts +3 -1
  9. package/dist/esm/components/atoms/Amount/Amount.js +2 -2
  10. package/dist/esm/components/atoms/Amount/Amount.js.map +1 -1
  11. package/dist/esm/components/atoms/Button/Button.css +1 -1
  12. package/dist/esm/components/atoms/CheckBox/CheckBox.d.ts +8 -1
  13. package/dist/esm/components/atoms/CheckBox/CheckBox.js +7 -2
  14. package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
  15. package/dist/esm/components/atoms/Icon/Icon.css +1 -1
  16. package/dist/esm/components/atoms/Input/Input.css +1 -1
  17. package/dist/esm/components/atoms/Input/Input.d.ts +3 -3
  18. package/dist/esm/components/atoms/Input/Input.js +12 -10
  19. package/dist/esm/components/atoms/Input/Input.js.map +1 -1
  20. package/dist/esm/components/atoms/InputMoney/InputMoney.d.ts +3 -3
  21. package/dist/esm/components/atoms/InputMoney/InputMoney.js +5 -10
  22. package/dist/esm/components/atoms/InputMoney/InputMoney.js.map +1 -1
  23. package/dist/esm/components/atoms/InputNumber/InputNumber.d.ts +3 -3
  24. package/dist/esm/components/atoms/InputNumber/InputNumber.js +5 -10
  25. package/dist/esm/components/atoms/InputNumber/InputNumber.js.map +1 -1
  26. package/dist/esm/components/atoms/InputPassword/InputPassword.d.ts +1 -1
  27. package/dist/esm/components/atoms/InputPassword/InputPassword.js +9 -7
  28. package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
  29. package/dist/esm/components/atoms/InputText/InputText.d.ts +3 -3
  30. package/dist/esm/components/atoms/InputText/InputText.js +5 -10
  31. package/dist/esm/components/atoms/InputText/InputText.js.map +1 -1
  32. package/dist/esm/components/atoms/Label/Label.css +3 -0
  33. package/dist/esm/components/atoms/Label/Label.d.ts +2 -0
  34. package/dist/esm/components/atoms/Label/Label.js +5 -0
  35. package/dist/esm/components/atoms/Label/Label.js.map +1 -0
  36. package/dist/esm/components/atoms/MessageIcon/MessageIcon.css +12 -0
  37. package/dist/esm/components/atoms/MessageIcon/MessageIcon.d.ts +7 -0
  38. package/dist/esm/components/atoms/MessageIcon/MessageIcon.js +7 -0
  39. package/dist/esm/components/atoms/MessageIcon/MessageIcon.js.map +1 -0
  40. package/dist/esm/components/atoms/RadioButton/RadioButton.d.ts +2 -1
  41. package/dist/esm/components/atoms/RadioButton/RadioButton.js +2 -2
  42. package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
  43. package/dist/esm/components/atoms/SearchInput/SearchInput.d.ts +2 -2
  44. package/dist/esm/components/atoms/Switch/Switch.css +40 -21
  45. package/dist/esm/components/atoms/Switch/Switch.d.ts +7 -1
  46. package/dist/esm/components/atoms/Switch/Switch.js +8 -3
  47. package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
  48. package/dist/esm/components/atoms/index.d.ts +2 -0
  49. package/dist/esm/components/atoms/index.js +2 -0
  50. package/dist/esm/components/atoms/index.js.map +1 -1
  51. package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
  52. package/dist/esm/components/molecules/CheckBoxLabel/CheckBoxLabel.css +1 -5
  53. package/dist/esm/components/molecules/CheckBoxLabel/CheckBoxLabel.d.ts +1 -1
  54. package/dist/esm/components/molecules/CheckBoxLabel/CheckBoxLabel.js.map +1 -1
  55. package/dist/esm/components/molecules/DayPicker/DayPicker.d.ts +1 -1
  56. package/dist/esm/components/molecules/DayPicker/DayPicker.js +1 -1
  57. package/dist/esm/components/molecules/DayPicker/DayPicker.js.map +1 -1
  58. package/dist/esm/components/molecules/DayRangePicker/DayRangePicker.d.ts +1 -1
  59. package/dist/esm/components/molecules/DayRangePicker/DayRangePicker.js +1 -1
  60. package/dist/esm/components/molecules/DayRangePicker/DayRangePicker.js.map +1 -1
  61. package/dist/esm/components/molecules/MoneyField/MoneyField.d.ts +4 -2
  62. package/dist/esm/components/molecules/MoneyField/MoneyField.js +7 -8
  63. package/dist/esm/components/molecules/MoneyField/MoneyField.js.map +1 -1
  64. package/dist/esm/components/molecules/MonthPicker/MonthPicker.d.ts +1 -1
  65. package/dist/esm/components/molecules/MonthPicker/MonthPicker.js.map +1 -1
  66. package/dist/esm/components/molecules/MonthTitlePicker/MonthTitlePicker.d.ts +1 -1
  67. package/dist/esm/components/molecules/MonthTitlePicker/MonthTitlePicker.js +1 -1
  68. package/dist/esm/components/molecules/MonthTitlePicker/MonthTitlePicker.js.map +1 -1
  69. package/dist/esm/components/molecules/NumberField/NumberField.d.ts +4 -2
  70. package/dist/esm/components/molecules/NumberField/NumberField.js +7 -8
  71. package/dist/esm/components/molecules/NumberField/NumberField.js.map +1 -1
  72. package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
  73. package/dist/esm/components/molecules/PasswordField/PasswordField.d.ts +1 -1
  74. package/dist/esm/components/molecules/PasswordField/PasswordField.js +6 -7
  75. package/dist/esm/components/molecules/PasswordField/PasswordField.js.map +1 -1
  76. package/dist/esm/components/molecules/RadioButtonLabel/RadioButtonLabel.d.ts +1 -1
  77. package/dist/esm/components/molecules/RadioButtonLabel/RadioButtonLabel.js.map +1 -1
  78. package/dist/esm/components/molecules/SwitchLabel/SwitchLabel.css +2 -5
  79. package/dist/esm/components/molecules/SwitchLabel/SwitchLabel.d.ts +1 -1
  80. package/dist/esm/components/molecules/SwitchLabel/SwitchLabel.js.map +1 -1
  81. package/dist/esm/components/molecules/TextField/TextField.d.ts +4 -2
  82. package/dist/esm/components/molecules/TextField/TextField.js +7 -8
  83. package/dist/esm/components/molecules/TextField/TextField.js.map +1 -1
  84. package/dist/esm/components/molecules/YearPicker/YearPicker.d.ts +2 -2
  85. package/dist/esm/components/molecules/YearPicker/YearPicker.js +2 -2
  86. package/dist/esm/components/molecules/YearPicker/YearPicker.js.map +1 -1
  87. package/dist/esm/components/organisms/AutocompleteField/AutocompleteField.css +21 -19
  88. package/dist/esm/components/organisms/AutocompleteField/AutocompleteField.d.ts +15 -8
  89. package/dist/esm/components/organisms/AutocompleteField/AutocompleteField.js +26 -159
  90. package/dist/esm/components/organisms/AutocompleteField/AutocompleteField.js.map +1 -1
  91. package/dist/esm/components/organisms/AutocompleteField/autocomplete-field.hook.d.ts +27 -0
  92. package/dist/esm/components/organisms/AutocompleteField/autocomplete-field.hook.js +170 -0
  93. package/dist/esm/components/organisms/AutocompleteField/autocomplete-field.hook.js.map +1 -0
  94. package/dist/esm/components/organisms/Card/Card.css +1 -1
  95. package/dist/esm/components/organisms/Confirmation/Confirmation.css +58 -34
  96. package/dist/esm/components/organisms/Confirmation/Confirmation.js +2 -1
  97. package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
  98. package/dist/esm/components/organisms/Datatable/Datatable.d.ts +2 -1
  99. package/dist/esm/components/organisms/Datatable/Datatable.js +3 -2
  100. package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
  101. package/dist/esm/components/organisms/DateField/DateField.css +3 -0
  102. package/dist/esm/components/organisms/DateField/DateField.d.ts +1 -1
  103. package/dist/esm/components/organisms/DateField/DateField.js +10 -3
  104. package/dist/esm/components/organisms/DateField/DateField.js.map +1 -1
  105. package/dist/esm/components/organisms/DatePicker/DatePicker.d.ts +1 -1
  106. package/dist/esm/components/organisms/DatePicker/DatePicker.js +4 -3
  107. package/dist/esm/components/organisms/DatePicker/DatePicker.js.map +1 -1
  108. package/dist/esm/components/organisms/DateRangeField/DateRangeField.d.ts +1 -1
  109. package/dist/esm/components/organisms/DateRangeField/DateRangeField.js.map +1 -1
  110. package/dist/esm/components/organisms/DateRangePicker/DateRangePicker.d.ts +1 -1
  111. package/dist/esm/components/organisms/DateRangePicker/DateRangePicker.js +3 -2
  112. package/dist/esm/components/organisms/DateRangePicker/DateRangePicker.js.map +1 -1
  113. package/dist/esm/components/organisms/SelectField/SelectField.d.ts +13 -8
  114. package/dist/esm/components/organisms/SelectField/SelectField.js +21 -89
  115. package/dist/esm/components/organisms/SelectField/SelectField.js.map +1 -1
  116. package/dist/esm/components/organisms/SelectField/select-field.hook.d.ts +24 -0
  117. package/dist/esm/components/organisms/SelectField/select-field.hook.js +104 -0
  118. package/dist/esm/components/organisms/SelectField/select-field.hook.js.map +1 -0
  119. package/dist/esm/components/organisms/Snackbar/Snackbar.css +14 -16
  120. package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +1 -1
  121. package/dist/esm/components/organisms/Snackbar/Snackbar.js +1 -1
  122. package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
  123. package/dist/esm/hooks/index.d.ts +0 -2
  124. package/dist/esm/hooks/index.js +0 -2
  125. package/dist/esm/hooks/index.js.map +1 -1
  126. package/dist/esm/hooks/list-control.hook.d.ts +14 -8
  127. package/dist/esm/hooks/list-control.hook.js +22 -15
  128. package/dist/esm/hooks/list-control.hook.js.map +1 -1
  129. package/dist/esm/i18n.d.ts +18 -0
  130. package/dist/esm/i18n.js +23 -0
  131. package/dist/esm/i18n.js.map +1 -0
  132. package/dist/esm/models.d.ts +19 -8
  133. package/dist/esm/models.js +8 -9
  134. package/dist/esm/models.js.map +1 -1
  135. package/dist/esm/utils/css.d.ts +1 -1
  136. package/dist/esm/utils/css.js +4 -1
  137. package/dist/esm/utils/css.js.map +1 -1
  138. package/dist/esm/utils/date-range-picker.js.map +1 -1
  139. package/dist/esm/utils/day-picker.js.map +1 -1
  140. package/dist/esm/utils/month-picker.js +1 -1
  141. package/dist/esm/utils/month-picker.js.map +1 -1
  142. package/dist/esm/utils/year-picker.js.map +1 -1
  143. package/package.json +26 -11
  144. package/dist/cjs/lib.cjs.js +0 -3366
  145. package/dist/cjs/lib.cjs.js.map +0 -1
  146. package/dist/es/lib.js +0 -3300
  147. package/dist/es/lib.js.map +0 -1
  148. package/dist/esm/hooks/form-control.hook.d.ts +0 -15
  149. package/dist/esm/hooks/form-control.hook.js +0 -77
  150. package/dist/esm/hooks/form-control.hook.js.map +0 -1
  151. package/dist/esm/hooks/form-group.hook.d.ts +0 -2
  152. package/dist/esm/hooks/form-group.hook.js +0 -22
  153. package/dist/esm/hooks/form-group.hook.js.map +0 -1
@@ -0,0 +1,2119 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var helpersAdvanced = require('@rolster/helpers-advanced');
6
+ var helpersDate = require('@rolster/helpers-date');
7
+ var helpersString = require('@rolster/helpers-string');
8
+ var i18n = require('@rolster/i18n');
9
+ var ReactDOM = require('react-dom');
10
+ require('uuid');
11
+ var rxjs = require('rxjs');
12
+
13
+ const baseCls = 'rls-tabular-text';
14
+ const pointers = ['.', ','];
15
+ function charClass(char) {
16
+ return pointers.includes(char) ? `${baseCls}__pointer` : `${baseCls}__char`;
17
+ }
18
+ function RlsTabularText({ value }) {
19
+ return (jsxRuntime.jsx("div", { className: "rls-tabular-text", children: value?.split('').map((char, index) => (jsxRuntime.jsx("span", { className: charClass(char), children: char }, index))) }));
20
+ }
21
+
22
+ function RlsAmount({ value, decimals, rlsTheme, symbol }) {
23
+ return (jsxRuntime.jsxs("div", { className: "rls-amount", "rls-theme": rlsTheme, children: [symbol && jsxRuntime.jsx("span", { children: symbol }), jsxRuntime.jsx(RlsTabularText, { value: helpersAdvanced.currencyFormat({ value, decimals }) })] }));
24
+ }
25
+
26
+ function renderClassStatus(base, status = {}, aditionals) {
27
+ const resultClass = [base];
28
+ Object.entries(status).forEach(([name, value]) => {
29
+ if (value) {
30
+ typeof value === 'string'
31
+ ? resultClass.push(`${base}--${value}`)
32
+ : resultClass.push(`${base}--${name}`);
33
+ }
34
+ });
35
+ if (aditionals) {
36
+ resultClass.push(aditionals);
37
+ }
38
+ return resultClass.join(' ');
39
+ }
40
+
41
+ function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
42
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-avatar', { rounded, skeleton }), "rls-theme": rlsTheme, children: children }));
43
+ }
44
+
45
+ function RlsBreadcrumb({ labels }) {
46
+ return (jsxRuntime.jsx("div", { className: "rls-breadcrumb", children: labels.map(({ label, onClick }, index) => (jsxRuntime.jsx("label", { className: "rls-breadcrumb__label", onClick: onClick, children: jsxRuntime.jsx("a", { className: "rls-breadcrumb__label__a", children: label }) }, index))) }));
47
+ }
48
+
49
+ function RlsIcon({ value, skeleton }) {
50
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-icon', { skeleton }), children: jsxRuntime.jsx("i", { className: `rls-icon-${value}` }) }));
51
+ }
52
+
53
+ function RlsButton({ type, children, disabled, prefixIcon, suffixIcon, rlsTheme, onClick }) {
54
+ return (jsxRuntime.jsx("button", { className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntime.jsxs("div", { className: renderClassStatus('rls-button__content', { type }), children: [prefixIcon && jsxRuntime.jsx(RlsIcon, { value: prefixIcon }), children && (jsxRuntime.jsx("div", { className: "rls-button__label", children: children })), suffixIcon && jsxRuntime.jsx(RlsIcon, { value: suffixIcon })] }) }));
55
+ }
56
+
57
+ function RlsButtonAction({ icon, disabled, tooltip, onClick }) {
58
+ return (jsxRuntime.jsxs("button", { className: "rls-button-action", onClick: onClick, disabled: disabled, children: [jsxRuntime.jsx("div", { className: "rls-button-action__content", children: jsxRuntime.jsx(RlsIcon, { value: icon }) }), tooltip && (jsxRuntime.jsx("div", { className: "rls-button-action__tooltip caption-semibold", children: jsxRuntime.jsx("span", { children: tooltip }) }))] }));
59
+ }
60
+
61
+ function RlsCheckBox({ checked, disabled, onClick, rlsTheme }) {
62
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-checkbox', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntime.jsx("div", { className: "rls-checkbox__component" }) }));
63
+ }
64
+ function RlsCheckBoxControl({ formControl, disabled, rlsTheme }) {
65
+ return (jsxRuntime.jsx(RlsCheckBox, { checked: formControl.state || false, disabled: disabled, onClick: () => {
66
+ formControl.setState(!formControl.state);
67
+ }, rlsTheme: rlsTheme }));
68
+ }
69
+
70
+ function RlsInput({ children, disabled, formControl, onValue, placeholder, type, value }) {
71
+ const [focused, setFocused] = react.useState(false);
72
+ function onChange(event) {
73
+ switch (type) {
74
+ case 'number':
75
+ setState(+event.target.value);
76
+ break;
77
+ default:
78
+ setState(event.target.value);
79
+ break;
80
+ }
81
+ }
82
+ function setState(value) {
83
+ formControl?.setState(value);
84
+ if (onValue) {
85
+ onValue(value);
86
+ }
87
+ }
88
+ function onFocus() {
89
+ formControl?.focus();
90
+ setFocused(true);
91
+ }
92
+ function onBlur() {
93
+ if (formControl && !formControl.touched) {
94
+ formControl.touch();
95
+ }
96
+ formControl?.blur();
97
+ setFocused(false);
98
+ }
99
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-input', {
100
+ focused: formControl?.focused || focused,
101
+ disabled: formControl?.disabled || disabled
102
+ }), children: [jsxRuntime.jsx("input", { ref: formControl?.elementRef, className: "rls-input__component", autoComplete: "off", type: type || 'text', placeholder: placeholder, disabled: formControl?.disabled || disabled, onFocus: onFocus, onBlur: onBlur, onChange: onChange, value: formControl?.state || value || '' }), jsxRuntime.jsx("span", { className: "rls-input__value", children: children })] }));
103
+ }
104
+
105
+ function RlsInputMoney({ decimals, disabled, formControl, onValue, placeholder, symbol, value }) {
106
+ const [valueInput, setValueInput] = react.useState(value || 0);
107
+ function onMoney(value) {
108
+ if (!formControl) {
109
+ setValueInput(value);
110
+ }
111
+ if (onValue) {
112
+ onValue(value);
113
+ }
114
+ }
115
+ return (jsxRuntime.jsx("div", { className: "rls-input-money", children: jsxRuntime.jsx(RlsInput, { formControl: formControl, type: "number", value: value, disabled: disabled, placeholder: placeholder, onValue: onMoney, children: jsxRuntime.jsx(RlsAmount, { value: formControl?.state || value || valueInput, symbol: symbol, decimals: decimals }) }) }));
116
+ }
117
+
118
+ function RlsInputNumber({ disabled, formControl, onValue, placeholder, value }) {
119
+ const [valueInput, setValueInput] = react.useState(value || 0);
120
+ function onNumber(value) {
121
+ if (!formControl) {
122
+ setValueInput(value);
123
+ }
124
+ if (onValue) {
125
+ onValue(value);
126
+ }
127
+ }
128
+ return (jsxRuntime.jsx("div", { className: "rls-input-number", children: jsxRuntime.jsx(RlsInput, { formControl: formControl, type: "number", value: value, disabled: disabled, placeholder: placeholder, onValue: onNumber, children: formControl?.state || value || valueInput }) }));
129
+ }
130
+
131
+ function RlsInputPassword({ disabled, formControl, onValue, placeholder, type }) {
132
+ const [focused, setFocused] = react.useState(false);
133
+ function onChange(event) {
134
+ formControl?.setState(event.target.value);
135
+ if (onValue) {
136
+ onValue(event.target.value);
137
+ }
138
+ }
139
+ function onFocus() {
140
+ formControl?.focus();
141
+ setFocused(true);
142
+ }
143
+ function onBlur() {
144
+ if (formControl && !formControl.touched) {
145
+ formControl.touch();
146
+ }
147
+ formControl?.blur();
148
+ setFocused(false);
149
+ }
150
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-input-password', {
151
+ focused: formControl?.focused || focused,
152
+ disabled
153
+ }), children: jsxRuntime.jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type || 'password', placeholder: placeholder, disabled: disabled, onFocus: onFocus, onBlur: onBlur, onChange: onChange }) }));
154
+ }
155
+
156
+ function RlsInputText({ disabled, formControl, onValue, placeholder, value }) {
157
+ const [valueInput, setValueInput] = react.useState(value || '');
158
+ function onText(value) {
159
+ if (!formControl) {
160
+ setValueInput(value);
161
+ }
162
+ if (onValue) {
163
+ onValue(value);
164
+ }
165
+ }
166
+ return (jsxRuntime.jsx("div", { className: "rls-input-text", children: jsxRuntime.jsx(RlsInput, { formControl: formControl, type: "text", value: value, disabled: disabled, placeholder: placeholder, onValue: onText, children: formControl?.state || value || valueInput }) }));
167
+ }
168
+
169
+ function RlsLabel({ children, rlsTheme }) {
170
+ return (jsxRuntime.jsx("label", { className: "rls-label", "rls-theme": rlsTheme, children: children }));
171
+ }
172
+
173
+ function RlsMessageIcon({ icon, children, rlsTheme }) {
174
+ return (jsxRuntime.jsxs("div", { className: "rls-message-icon", "rls-theme": rlsTheme, children: [icon && jsxRuntime.jsx(RlsIcon, { value: icon }), jsxRuntime.jsx("span", { className: "caption-regular truncate", children: children })] }));
175
+ }
176
+
177
+ function RlsPoster({ children, rlsTheme }) {
178
+ return (jsxRuntime.jsx("div", { className: "rls-poster", "rls-theme": rlsTheme, children: children }));
179
+ }
180
+
181
+ function RlsProgressBar({ indeterminate, percentage, rlsTheme }) {
182
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-progress-bar', { indeterminate }), "rls-theme": rlsTheme, children: jsxRuntime.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage || 0}%` } }) }));
183
+ }
184
+
185
+ function RlsRadioButton({ checked, disabled, onClick, rlsTheme }) {
186
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-radiobutton', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntime.jsx("div", { className: "rls-radiobutton__component" }) }));
187
+ }
188
+
189
+ function RlsSearchInput({ formControl, placeholder, onSearch }) {
190
+ return (jsxRuntime.jsxs("div", { className: "rls-search-input", children: [jsxRuntime.jsx(RlsInput, { formControl: formControl, placeholder: placeholder }), onSearch && jsxRuntime.jsx(RlsButtonAction, { icon: "search", onClick: onSearch })] }));
191
+ }
192
+
193
+ function RlsSkeleton({ rlsTheme }) {
194
+ return jsxRuntime.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
195
+ }
196
+
197
+ function RlsSkeletonText({ active, children, rlsTheme }) {
198
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-skeleton-text', { active }), "rls-theme": rlsTheme, children: jsxRuntime.jsx("span", { className: "rls-skeleton-text__value", children: children }) }));
199
+ }
200
+
201
+ function RlsSwitch({ checked, disabled, onClick, rlsTheme }) {
202
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-switch', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntime.jsxs("div", { className: "rls-switch__component", children: [jsxRuntime.jsx("div", { className: "rls-switch__component__element" }), jsxRuntime.jsx("div", { className: "rls-switch__component__bar" })] }) }));
203
+ }
204
+ function RlsSwitchControl({ formControl, disabled, rlsTheme }) {
205
+ return (jsxRuntime.jsx(RlsSwitch, { checked: formControl.state || false, disabled: disabled, onClick: () => {
206
+ formControl.setState(!formControl.state);
207
+ }, rlsTheme: rlsTheme }));
208
+ }
209
+
210
+ function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
211
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-ballot', { bordered, skeleton }), "rls-theme": rlsTheme, children: [(img || initials) && (jsxRuntime.jsxs(RlsAvatar, { skeleton: skeleton, children: [img && jsxRuntime.jsx("img", { src: img }), initials && jsxRuntime.jsx("span", { children: initials })] })), jsxRuntime.jsxs("div", { className: "rls-ballot__component", children: [jsxRuntime.jsx("label", { className: "rls-ballot__title", children: jsxRuntime.jsx(RlsSkeletonText, { active: skeleton, children: children }) }), subtitle && (jsxRuntime.jsx("label", { className: "rls-ballot__subtitle", children: jsxRuntime.jsx(RlsSkeletonText, { active: skeleton, children: subtitle }) }))] })] }));
212
+ }
213
+
214
+ function RlsButtonToggle({ options, type, disabled, rlsTheme, onAction }) {
215
+ const contentRef = react.useRef(null);
216
+ const [firstAction] = options;
217
+ const [action, setAction] = react.useState(firstAction);
218
+ const [visible, setVisible] = react.useState(false);
219
+ react.useEffect(() => {
220
+ function onCloseMenu({ target }) {
221
+ if (!contentRef?.current?.contains(target)) {
222
+ setVisible(false);
223
+ }
224
+ }
225
+ document.addEventListener('click', onCloseMenu);
226
+ return () => {
227
+ document.removeEventListener('click', onCloseMenu);
228
+ };
229
+ }, []);
230
+ function onClickMenu() {
231
+ setVisible((prevValue) => !prevValue);
232
+ }
233
+ function onSelectAction(action) {
234
+ setAction(action);
235
+ setVisible(false);
236
+ }
237
+ return (jsxRuntime.jsxs("div", { className: "rls-button-toggle", ref: contentRef, "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: "rls-button-toggle__content", children: [action && (jsxRuntime.jsx("div", { className: "rls-button-toggle__action", children: jsxRuntime.jsx(RlsButton, { disabled: disabled, type: type, onClick: () => {
238
+ if (onAction) {
239
+ onAction(action.value);
240
+ }
241
+ }, children: action.label }) })), jsxRuntime.jsx("div", { className: "rls-button-toggle__icon", children: jsxRuntime.jsx(RlsButton, { type: type, prefixIcon: "arrow-ios-down", disabled: disabled, onClick: onClickMenu }) })] }), jsxRuntime.jsx("div", { className: renderClassStatus('rls-button-toggle__list', {
242
+ visible,
243
+ hide: !visible
244
+ }), children: jsxRuntime.jsx("ul", { children: options.map((action, index) => (jsxRuntime.jsx("li", { className: "truncate", onClick: () => {
245
+ onSelectAction(action);
246
+ }, children: action.label }, index))) }) })] }));
247
+ }
248
+
249
+ function RlsCheckBoxLabel({ children, disabled, extended, formControl, rlsTheme }) {
250
+ const [checked, setChecked] = react.useState(formControl?.value || false);
251
+ react.useEffect(() => {
252
+ setChecked(formControl?.state || false);
253
+ }, [formControl?.state]);
254
+ function onToggle() {
255
+ if (formControl) {
256
+ formControl?.setState(!formControl.state);
257
+ }
258
+ else {
259
+ setChecked(!checked);
260
+ }
261
+ }
262
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-checkbox-label', {
263
+ disabled,
264
+ extended
265
+ }), "rls-theme": rlsTheme, children: [jsxRuntime.jsx("div", { className: "rls-checkbox-label__component", onClick: onToggle, children: jsxRuntime.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntime.jsx("label", { className: "rls-checkbox-label__text", children: children })] }));
266
+ }
267
+
268
+ let Factory$2 = class Factory {
269
+ constructor(props) {
270
+ const { date, value, maxDate, minDate } = props;
271
+ this.value = value;
272
+ this.date = new Date(date.getTime());
273
+ this.maxDate = maxDate;
274
+ this.minDate = minDate;
275
+ this.date.setDate(1);
276
+ }
277
+ static execute(props) {
278
+ const factory = new Factory(props);
279
+ const firstWeek = factory.createFirstWeek();
280
+ const rightWeeks = factory.createRightWeeks();
281
+ return [firstWeek, ...rightWeeks];
282
+ }
283
+ createFirstWeek() {
284
+ const dayStart = this.date.getDay();
285
+ const days = [];
286
+ let day = 1;
287
+ for (let start = 0; start < dayStart; start++) {
288
+ days.push(this.createDayState());
289
+ }
290
+ for (let end = dayStart; end < 7; end++) {
291
+ days.push(this.createDayState(day));
292
+ day++;
293
+ }
294
+ return { days };
295
+ }
296
+ createRightWeeks() {
297
+ const dayStart = this.date.getDay();
298
+ const rightWeeks = [];
299
+ const dayCount = helpersDate.daysFromMonth(this.date.getFullYear(), this.date.getMonth());
300
+ let days = [];
301
+ let countDaysWeek = 1;
302
+ let day = 8 - dayStart;
303
+ do {
304
+ days.push(this.createDayState(day));
305
+ day++;
306
+ countDaysWeek++;
307
+ if (countDaysWeek > 7) {
308
+ rightWeeks.push({ days });
309
+ days = [];
310
+ countDaysWeek = 1;
311
+ }
312
+ } while (day <= dayCount);
313
+ const daysPending = this.createDaysPending(days.length);
314
+ rightWeeks.push({ days: [...days, ...daysPending] });
315
+ return rightWeeks;
316
+ }
317
+ createDaysPending(daysWeek) {
318
+ const daysPending = [];
319
+ const length = 7 - daysWeek;
320
+ for (let index = 0; index < length; index++) {
321
+ daysPending.push(this.createDayState());
322
+ }
323
+ return daysPending;
324
+ }
325
+ createDayState(value) {
326
+ return {
327
+ disabled: this.overflowDay(value || 0),
328
+ forbidden: !value,
329
+ selected: value === this.value,
330
+ value
331
+ };
332
+ }
333
+ overflowDay(day) {
334
+ return this.minOverflowDay(day) || this.maxOverflowDay(day);
335
+ }
336
+ minOverflowDay(day) {
337
+ return this.minDate
338
+ ? helpersDate.weight(helpersDate.refactorDay(this.date, day)) < helpersDate.weight(this.minDate)
339
+ : false;
340
+ }
341
+ maxOverflowDay(day) {
342
+ return this.maxDate
343
+ ? helpersDate.weight(helpersDate.refactorDay(this.date, day)) > helpersDate.weight(this.maxDate)
344
+ : false;
345
+ }
346
+ };
347
+ function createDayPicker(props) {
348
+ return Factory$2.execute(props);
349
+ }
350
+
351
+ function RlsDayPicker({ date, disabled: disabledPicker, formControl, maxDate, minDate, rlsTheme }) {
352
+ const initialDate = date || new Date();
353
+ const initialDay = formControl?.state || initialDate.getDate();
354
+ const [weeks, setWeeks] = react.useState([]);
355
+ const [value, setValue] = react.useState(initialDay);
356
+ react.useEffect(() => {
357
+ setWeeks(createDayPicker({
358
+ date: initialDate,
359
+ value: formControl?.state || value,
360
+ minDate,
361
+ maxDate
362
+ }));
363
+ }, [value, date, minDate, maxDate]);
364
+ react.useEffect(() => {
365
+ if (date && date.getDate() !== value) {
366
+ onChange(date.getDate());
367
+ }
368
+ }, [date]);
369
+ function onChange(value) {
370
+ setValue(value);
371
+ formControl?.setState(value);
372
+ }
373
+ return (jsxRuntime.jsxs("div", { className: "rls-day-picker", "rls-theme": rlsTheme, children: [jsxRuntime.jsx("div", { className: "rls-day-picker__header", children: helpersDate.DAY_LABELS().map((title, index) => (jsxRuntime.jsx("label", { className: "rls-day-picker__label", children: title }, index))) }), jsxRuntime.jsx("div", { className: "rls-day-picker__component", children: weeks.map(({ days }, index) => (jsxRuntime.jsx("div", { className: "rls-day-picker__week", children: days.map(({ value, disabled, forbidden, selected }, index) => (jsxRuntime.jsx("div", { className: renderClassStatus('rls-day-picker__day', {
374
+ disabled: disabled || disabledPicker,
375
+ forbidden,
376
+ selected
377
+ }), onClick: () => {
378
+ if (value && !disabled) {
379
+ onChange(value);
380
+ }
381
+ }, children: jsxRuntime.jsx("span", { className: "rls-day-picker__day__span", children: value || '??' }) }, index))) }, index))) })] }));
382
+ }
383
+
384
+ const DATE_FORMAT = '{dd}/{mm}/{aa}';
385
+ class ListCollection {
386
+ constructor(value) {
387
+ this.value = value;
388
+ }
389
+ find(element) {
390
+ return this.value.find((current) => current.compareTo(element));
391
+ }
392
+ }
393
+ class DateRange {
394
+ constructor(minDate, maxDate) {
395
+ this.minDate = helpersDate.normalizeMinTime(minDate);
396
+ if (maxDate && helpersDate.isBefore(maxDate, minDate)) {
397
+ this.maxDate = helpersDate.normalizeMinTime(maxDate);
398
+ }
399
+ else {
400
+ this.maxDate = helpersDate.normalizeMinTime(minDate);
401
+ }
402
+ const minFormat = helpersDate.formatDate(this.minDate, DATE_FORMAT);
403
+ const maxFormat = helpersDate.formatDate(this.maxDate, DATE_FORMAT);
404
+ this.description = `${minFormat} - ${maxFormat}`;
405
+ }
406
+ recalculate(date) {
407
+ if (helpersDate.isBefore(this.minDate, date)) {
408
+ return new DateRange(date, this.maxDate);
409
+ }
410
+ if (helpersDate.isAfter(this.maxDate, date)) {
411
+ return new DateRange(this.minDate, date);
412
+ }
413
+ const minDifference = helpersDate.timeDifference(date, this.minDate);
414
+ const maxDifference = helpersDate.timeDifference(this.maxDate, date);
415
+ return minDifference > maxDifference
416
+ ? new DateRange(this.minDate, date)
417
+ : new DateRange(date, this.maxDate);
418
+ }
419
+ static now() {
420
+ return new DateRange(new Date());
421
+ }
422
+ }
423
+
424
+ let Factory$1 = class Factory {
425
+ constructor(props) {
426
+ const { date, range, maxDate, minDate } = props;
427
+ this.date = new Date(date.getTime());
428
+ this.range = range;
429
+ this.maxDate = maxDate;
430
+ this.minDate = minDate;
431
+ this.date.setDate(1);
432
+ }
433
+ static execute(props) {
434
+ const factory = new Factory(props);
435
+ const firstWeek = factory.createFirstWeek();
436
+ const rightWeeks = factory.createRightWeeks();
437
+ return [firstWeek, ...rightWeeks];
438
+ }
439
+ createFirstWeek() {
440
+ const dayStart = this.date.getDay();
441
+ const days = [];
442
+ let day = 1;
443
+ for (let start = 0; start < dayStart; start++) {
444
+ days.push(this.createDayRangeState());
445
+ }
446
+ for (let end = dayStart; end < 7; end++) {
447
+ days.push(this.createDayRangeState(day));
448
+ day++;
449
+ }
450
+ return { days };
451
+ }
452
+ createRightWeeks() {
453
+ const rightWeeks = [];
454
+ const dayStart = this.date.getDay();
455
+ const dayCount = helpersDate.daysFromMonth(this.date.getFullYear(), this.date.getMonth());
456
+ let days = [];
457
+ let countDaysWeek = 1;
458
+ let day = 8 - dayStart;
459
+ do {
460
+ days.push(this.createDayRangeState(day));
461
+ day++;
462
+ countDaysWeek++;
463
+ if (countDaysWeek > 7) {
464
+ rightWeeks.push({ days });
465
+ days = [];
466
+ countDaysWeek = 1;
467
+ }
468
+ } while (day <= dayCount);
469
+ const daysPending = this.createDaysPending(days.length);
470
+ rightWeeks.push({ days: [...days, ...daysPending] });
471
+ return rightWeeks;
472
+ }
473
+ createDaysPending(daysWeek) {
474
+ const daysPending = [];
475
+ const length = 7 - daysWeek;
476
+ for (let index = 0; index < length; index++) {
477
+ daysPending.push(this.createDayRangeState());
478
+ }
479
+ return daysPending;
480
+ }
481
+ createDayRangeState(day) {
482
+ return {
483
+ value: day,
484
+ disabled: this.overflowDay(day || 0),
485
+ forbidden: !day,
486
+ ranged: day ? this.isRangedFromDate(day) : false,
487
+ selected: day ? this.isSelected(day) : false
488
+ };
489
+ }
490
+ isSelected(day) {
491
+ return (this.isSelectedForDate(this.range.minDate, day) ||
492
+ this.isSelectedForDate(this.range.maxDate, day));
493
+ }
494
+ isSelectedForDate(date, day) {
495
+ return (date.getFullYear() === this.date.getFullYear() &&
496
+ date.getMonth() === this.date.getMonth() &&
497
+ day === date.getDate());
498
+ }
499
+ isRangedFromDate(day) {
500
+ return helpersDate.isBetween(this.range.minDate, this.range.maxDate, helpersDate.refactorDay(this.date, day));
501
+ }
502
+ overflowDay(day) {
503
+ return this.minOverflowDay(day) || this.maxOverflowDay(day);
504
+ }
505
+ minOverflowDay(day) {
506
+ return this.minDate
507
+ ? helpersDate.weight(helpersDate.refactorDay(this.date, day)) < helpersDate.weight(this.minDate)
508
+ : false;
509
+ }
510
+ maxOverflowDay(day) {
511
+ return this.maxDate
512
+ ? helpersDate.weight(helpersDate.refactorDay(this.date, day)) > helpersDate.weight(this.maxDate)
513
+ : false;
514
+ }
515
+ };
516
+ function createRangePicker(props) {
517
+ return Factory$1.execute(props);
518
+ }
519
+
520
+ function RlsDayRangePicker({ date, disabled: disabledPicker, formControl, maxDate, minDate, rlsTheme }) {
521
+ const initialRange = formControl?.state || DateRange.now();
522
+ const initialDate = helpersDate.normalizeMinTime(date || initialRange.minDate);
523
+ const [weeks, setWeeks] = react.useState([]);
524
+ const [range, setRange] = react.useState(initialRange);
525
+ react.useEffect(() => {
526
+ setWeeks(createRangePicker({
527
+ date: initialDate,
528
+ range,
529
+ minDate,
530
+ maxDate
531
+ }));
532
+ }, [range, date, minDate, maxDate]);
533
+ function onChange(value) {
534
+ const newRange = range.recalculate(helpersDate.refactorDay(initialDate, value));
535
+ setRange(newRange);
536
+ formControl?.setState(newRange);
537
+ }
538
+ return (jsxRuntime.jsxs("div", { className: "rls-day-range-picker", "rls-theme": rlsTheme, children: [jsxRuntime.jsx("div", { className: "rls-day-range-picker__header", children: helpersDate.DAY_LABELS().map((title, index) => (jsxRuntime.jsx("label", { className: "rls-day-range-picker__label", children: title }, index))) }), jsxRuntime.jsx("div", { className: "rls-day-range-picker__component", children: weeks.map(({ days }, index) => (jsxRuntime.jsx("div", { className: "rls-day-range-picker__week", children: days.map(({ value, disabled, forbidden, ranged, selected }, index) => (jsxRuntime.jsx("div", { className: renderClassStatus('rls-day-range-picker__day', {
539
+ disabled: disabled || disabledPicker,
540
+ forbidden,
541
+ selected,
542
+ ranged
543
+ }), onClick: () => {
544
+ if (value && !disabled) {
545
+ onChange(value);
546
+ }
547
+ }, children: jsxRuntime.jsx("span", { className: "rls-day-range-picker__day__span", children: value || '??' }) }, index))) }, index))) })] }));
548
+ }
549
+
550
+ function RlsMoneyField({ children, decimals, disabled, formControl, onValue, placeholder, symbol, rlsTheme, value }) {
551
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-box-field', {
552
+ focused: formControl?.focused,
553
+ error: formControl?.touched && !formControl?.valid,
554
+ disabled: formControl?.disabled || disabled
555
+ }, 'rls-money-field'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsx("div", { className: "rls-box-field__body", children: jsxRuntime.jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }));
556
+ }
557
+
558
+ const MONTH_MAX_VALUE = helpersDate.Month.January;
559
+ const MONTH_MIN_VALUE = helpersDate.Month.December;
560
+ class Factory {
561
+ constructor(props) {
562
+ const { date, value, maxDate, minDate } = props;
563
+ this.value = value;
564
+ this.date = new Date(date.getTime());
565
+ this.maxDate = maxDate;
566
+ this.minDate = minDate;
567
+ }
568
+ static execute(props) {
569
+ const factory = new Factory(props);
570
+ return [
571
+ factory.createMonth(0),
572
+ factory.createMonth(1),
573
+ factory.createMonth(2),
574
+ factory.createMonth(3),
575
+ factory.createMonth(4),
576
+ factory.createMonth(5),
577
+ factory.createMonth(6),
578
+ factory.createMonth(7),
579
+ factory.createMonth(8),
580
+ factory.createMonth(9),
581
+ factory.createMonth(10),
582
+ factory.createMonth(11)
583
+ ];
584
+ }
585
+ createMonth(value) {
586
+ return {
587
+ value,
588
+ label: helpersDate.MONTH_NAMES()[value],
589
+ disabled: this.overflowMonth(value),
590
+ selected: value === this.value
591
+ };
592
+ }
593
+ get minYear() {
594
+ return this.minDate?.getFullYear() || 0;
595
+ }
596
+ get maxYear() {
597
+ return this.maxDate?.getFullYear() || 10000;
598
+ }
599
+ get minMonth() {
600
+ return this.minDate?.getMonth() || MONTH_MIN_VALUE;
601
+ }
602
+ get maxMonth() {
603
+ return this.maxDate?.getMonth() || MONTH_MAX_VALUE;
604
+ }
605
+ overflowMonth(month) {
606
+ return this.minOverflowMonth(month) || this.maxOverflowMonth(month);
607
+ }
608
+ minOverflowMonth(month) {
609
+ return this.date.getFullYear() === this.minYear && month < this.minMonth;
610
+ }
611
+ maxOverflowMonth(month) {
612
+ return this.date.getFullYear() === this.maxYear && month > this.maxMonth;
613
+ }
614
+ }
615
+ function isMinLimitMonth(month, date, maxDate) {
616
+ const minYear = maxDate?.getFullYear() || 0;
617
+ const minMonth = maxDate?.getMonth() || 0;
618
+ return date.getFullYear() === minYear && month <= minMonth;
619
+ }
620
+ function isMaxLimitMonth(month, date, maxDate) {
621
+ const maxYear = maxDate?.getFullYear() || 10000;
622
+ const maxMonth = maxDate?.getMonth() || 11;
623
+ return date.getFullYear() === maxYear && month >= maxMonth;
624
+ }
625
+ function createMonthPicker(props) {
626
+ return Factory.execute(props);
627
+ }
628
+
629
+ function RlsMonthPicker({ formControl, date, disabled: disabledPicker, maxDate, minDate, rlsTheme }) {
630
+ const initialDate = date || new Date();
631
+ const initialMonth = formControl?.state || initialDate.getMonth();
632
+ const [months, setMonths] = react.useState([]);
633
+ const [value, setValue] = react.useState(initialMonth);
634
+ react.useEffect(() => {
635
+ setMonths(createMonthPicker({
636
+ date: initialDate,
637
+ value: formControl?.state || value,
638
+ minDate,
639
+ maxDate
640
+ }));
641
+ }, [value, date, minDate, maxDate]);
642
+ return (jsxRuntime.jsx("div", { className: "rls-month-picker", "rls-theme": rlsTheme, children: months.map(({ label, value, disabled, selected }, index) => (jsxRuntime.jsx("div", { className: renderClassStatus('rls-month-picker__component', {
643
+ disabled: disabled || disabledPicker || false,
644
+ selected
645
+ }), onClick: () => {
646
+ formControl?.setState(value);
647
+ setValue(value);
648
+ }, children: jsxRuntime.jsx("span", { className: "rls-month-picker__span", children: label }) }, index))) }));
649
+ }
650
+
651
+ function RlsMonthTitlePicker({ monthControl, yearControl, date, maxDate, minDate, onClick }) {
652
+ const { state: month } = monthControl;
653
+ const { state: year } = yearControl;
654
+ const [limitMinMonth, setLimitMinMonth] = react.useState(false);
655
+ const [limitMaxMonth, setLimitMaxMonth] = react.useState(false);
656
+ const monthName = helpersDate.MONTH_NAMES()[month || 0];
657
+ react.useEffect(() => {
658
+ if (typeof month === 'number' && date) {
659
+ setLimitMinMonth(isMinLimitMonth(month, date, minDate));
660
+ setLimitMaxMonth(isMaxLimitMonth(month, date, maxDate));
661
+ }
662
+ }, [date]);
663
+ function onPreviousMonth() {
664
+ if (typeof month === 'number' && typeof year === 'number') {
665
+ if (month > MONTH_MIN_VALUE) {
666
+ monthControl.setState(month - 1);
667
+ }
668
+ else {
669
+ monthControl.setState(MONTH_MAX_VALUE);
670
+ yearControl.setState(year - 1);
671
+ }
672
+ }
673
+ }
674
+ function onNextMonth() {
675
+ if (typeof month === 'number' && typeof year === 'number') {
676
+ if (month < MONTH_MAX_VALUE) {
677
+ monthControl.setState(month + 1);
678
+ }
679
+ else {
680
+ monthControl.setState(MONTH_MIN_VALUE);
681
+ yearControl.setState(year + 1);
682
+ }
683
+ }
684
+ }
685
+ return (jsxRuntime.jsxs("div", { className: "rls-month-title-picker", children: [jsxRuntime.jsx(RlsButtonAction, { icon: "arrow-ios-left", onClick: onPreviousMonth, disabled: limitMinMonth }), jsxRuntime.jsx("span", { onClick: onClick, children: monthName }), jsxRuntime.jsx(RlsButtonAction, { icon: "arrow-ios-right", onClick: onNextMonth, disabled: limitMaxMonth })] }));
686
+ }
687
+
688
+ function RlsNumberField({ children, disabled, formControl, onValue, placeholder, rlsTheme, value }) {
689
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-box-field', {
690
+ focused: formControl?.focused,
691
+ error: formControl?.touched && !formControl?.valid,
692
+ disabled: formControl?.disabled || disabled
693
+ }, 'rls-number-field'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsx("div", { className: "rls-box-field__body", children: jsxRuntime.jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }));
694
+ }
695
+
696
+ const DEFAULT_COUNT_ELEMENT = 20;
697
+ const MIN_NUMBER_PAGE = 1;
698
+ const FIRST_PAGE = 0;
699
+ const DEFAULT_MAX_VISIBLE = 4;
700
+ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPagination }) {
701
+ const count = defaultCount || DEFAULT_COUNT_ELEMENT;
702
+ const [collection, setCollection] = react.useState([]);
703
+ const [index, setIndex] = react.useState(0);
704
+ const [maxPage, setMaxPage] = react.useState(calculateMaxPage(elements, count));
705
+ const [paginations, setPaginations] = react.useState([]);
706
+ const [currentPagination, setCurrentPagination] = react.useState();
707
+ const [description, setDescription] = react.useState('');
708
+ const [firstPage, setFirstPage] = react.useState(true);
709
+ const [lastPage, setLastPage] = react.useState(false);
710
+ react.useEffect(() => {
711
+ refreshFromElements(elements);
712
+ }, [elements]);
713
+ react.useEffect(() => {
714
+ const isFirstPage = currentPagination?.value === FIRST_PAGE;
715
+ const isLastPage = currentPagination?.value === maxPage - 1;
716
+ setFirstPage(isFirstPage);
717
+ setLastPage(isLastPage);
718
+ if (onPagination) {
719
+ onPagination({ firstPage: isFirstPage, lastPage: isLastPage });
720
+ }
721
+ }, [currentPagination]);
722
+ react.useEffect(() => {
723
+ refreshFromFilter(filter);
724
+ }, [filter]);
725
+ function onChangeElements(elements) {
726
+ if (onElements) {
727
+ onElements(elements);
728
+ }
729
+ }
730
+ function calculateMaxPage(collection, count) {
731
+ return collection.length ? Math.ceil(collection.length / count) : 0;
732
+ }
733
+ function onSelectPagination(pagination) {
734
+ const { value } = pagination;
735
+ pagination.active = true;
736
+ setIndex(value);
737
+ setCurrentPagination(pagination);
738
+ refreshFromChanged(createPageProps({ index: value }));
739
+ }
740
+ function goPagination(pagination) {
741
+ if (currentPagination) {
742
+ currentPagination.active = false;
743
+ }
744
+ onSelectPagination(pagination);
745
+ }
746
+ function goPreviousPagination() {
747
+ if (currentPagination) {
748
+ const { prev, value } = currentPagination;
749
+ if (prev) {
750
+ onSelectPagination(prev);
751
+ currentPagination.active = false;
752
+ }
753
+ else {
754
+ const prevIndex = value - MIN_NUMBER_PAGE;
755
+ if (prevIndex >= FIRST_PAGE) {
756
+ refreshFromChanged(createPagePropsFromIndex(prevIndex));
757
+ }
758
+ }
759
+ }
760
+ }
761
+ function goFirstPagination() {
762
+ if (collection.length) {
763
+ refreshFromChanged(createPagePropsFromIndex(FIRST_PAGE));
764
+ }
765
+ }
766
+ function goNextPagination() {
767
+ if (currentPagination) {
768
+ const { next, value } = currentPagination;
769
+ if (next) {
770
+ onSelectPagination(next);
771
+ currentPagination.active = false;
772
+ }
773
+ else {
774
+ const nextIndex = value + 1;
775
+ if (nextIndex <= maxPage) {
776
+ refreshFromChanged(createPagePropsFromIndex(nextIndex));
777
+ }
778
+ }
779
+ }
780
+ }
781
+ function goLastPagination() {
782
+ if (collection.length) {
783
+ refreshFromChanged(createPagePropsFromIndex(maxPage - MIN_NUMBER_PAGE));
784
+ }
785
+ }
786
+ function createPageCollection(props) {
787
+ const { collection, count, index } = props;
788
+ if (collection.length) {
789
+ const finish = (index + MIN_NUMBER_PAGE) * count;
790
+ const start = index * count;
791
+ return collection.slice(start, finish);
792
+ }
793
+ return [];
794
+ }
795
+ function refreshFromElements(elements) {
796
+ elements.length
797
+ ? refreshFromChanged(createRefreshProps(elements, filter))
798
+ : rebootPagination();
799
+ }
800
+ function refreshFromFilter(filter) {
801
+ refreshFromChanged(createRefreshProps(elements, filter));
802
+ }
803
+ function createRefreshProps(elements, filter) {
804
+ const collection = refreshCollection(elements, filter);
805
+ const maxPage = refreshMaxPage(collection, count);
806
+ const index = refreshIndex(collection, maxPage);
807
+ return createPageProps({ collection, index, maxPage });
808
+ }
809
+ function refreshFromChanged(page) {
810
+ refreshPaginations(page);
811
+ refreshDescription(page);
812
+ onChangeElements(createPageCollection(page));
813
+ }
814
+ function refreshCollection(elements, filter) {
815
+ const collection = filter
816
+ ? elements.filter((element) => helpersString.hasPattern(JSON.stringify(element), filter))
817
+ : elements;
818
+ setCollection(collection);
819
+ return collection;
820
+ }
821
+ function refreshMaxPage(collection, count) {
822
+ const maxPage = calculateMaxPage(collection, count);
823
+ setMaxPage(maxPage);
824
+ return maxPage;
825
+ }
826
+ function refreshIndex(collection, currentMaxPage) {
827
+ const maxPage = currentMaxPage || refreshMaxPage(collection, count);
828
+ if (index < maxPage || index === FIRST_PAGE) {
829
+ return index;
830
+ }
831
+ const newIndex = maxPage - 1;
832
+ setIndex(newIndex);
833
+ return newIndex;
834
+ }
835
+ function rebootPagination() {
836
+ setCollection([]);
837
+ setMaxPage(0);
838
+ setIndex(0);
839
+ setPaginations([]);
840
+ onChangeElements([]);
841
+ }
842
+ function refreshDescription(page) {
843
+ const { collection, count, index } = page;
844
+ const totalCount = elements.length;
845
+ const start = index * count + MIN_NUMBER_PAGE;
846
+ let end = (index + MIN_NUMBER_PAGE) * count;
847
+ if (end > collection.length) {
848
+ end = collection.length;
849
+ }
850
+ setDescription(`${start} - ${end} de ${totalCount}`);
851
+ }
852
+ function refreshPaginations({ index, maxPage }) {
853
+ let maxPageVisible = index + DEFAULT_MAX_VISIBLE;
854
+ if (maxPageVisible > maxPage) {
855
+ maxPageVisible = maxPage;
856
+ }
857
+ let minIndexPage = maxPageVisible - DEFAULT_MAX_VISIBLE;
858
+ if (minIndexPage < 0) {
859
+ minIndexPage = 0;
860
+ }
861
+ if (minIndexPage > index) {
862
+ minIndexPage = index;
863
+ }
864
+ let prevPagination = undefined;
865
+ const paginations = [];
866
+ for (let i = minIndexPage; i < maxPageVisible; i++) {
867
+ const pagination = createPagination(i, index);
868
+ paginations.push(pagination);
869
+ pagination.prev = prevPagination;
870
+ if (prevPagination) {
871
+ prevPagination.next = pagination;
872
+ }
873
+ prevPagination = pagination;
874
+ }
875
+ setPaginations(paginations);
876
+ }
877
+ function createPagination(value, index) {
878
+ const active = value === index;
879
+ const pagination = {
880
+ label: (value + 1).toString(),
881
+ value,
882
+ active
883
+ };
884
+ if (active) {
885
+ setCurrentPagination(pagination);
886
+ }
887
+ return pagination;
888
+ }
889
+ function createPagePropsFromIndex(index) {
890
+ return createPageProps({ index });
891
+ }
892
+ function createPageProps(props) {
893
+ return {
894
+ collection: props.collection || collection,
895
+ index: typeof props.index === 'number' ? props.index : index,
896
+ count: props.count || count,
897
+ maxPage: typeof props.maxPage === 'number' ? props.maxPage : maxPage
898
+ };
899
+ }
900
+ return (jsxRuntime.jsxs("div", { className: "rls-pagination", children: [jsxRuntime.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntime.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: firstPage, children: jsxRuntime.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntime.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: firstPage, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntime.jsx("div", { className: "rls-pagination__pages", children: paginations.map((page, index) => {
901
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-pagination__page', {
902
+ active: page.active
903
+ }), onClick: () => {
904
+ goPagination(page);
905
+ }, children: page.label }, index));
906
+ }) }), jsxRuntime.jsx("div", { className: "rls-pagination__description", children: description }), jsxRuntime.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntime.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: lastPage, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntime.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: lastPage, children: jsxRuntime.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
907
+ }
908
+
909
+ function RlsPasswordField({ children, disabled, formControl, placeholder, rlsTheme }) {
910
+ const [password, setPassword] = react.useState(true);
911
+ function onToggleInput() {
912
+ setPassword(!password);
913
+ }
914
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus(' rls-box-field', {
915
+ focused: formControl?.focused,
916
+ error: formControl?.touched && !formControl?.valid,
917
+ disabled: formControl?.disabled || disabled
918
+ }, 'rls-password-field'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsxs("div", { className: "rls-box-field__body", children: [jsxRuntime.jsx(RlsInputPassword, { formControl: formControl, disabled: disabled, placeholder: placeholder, type: password ? 'password' : 'text' }), jsxRuntime.jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }));
919
+ }
920
+
921
+ function RlsRadioButtonLabel({ children, disabled, extended, formControl, rlsTheme, value }) {
922
+ const [checked, setChecked] = react.useState(formControl?.state || false);
923
+ react.useEffect(() => {
924
+ setChecked(formControl?.state === value);
925
+ }, [formControl?.state]);
926
+ function onSelect() {
927
+ if (formControl) {
928
+ formControl?.setState(value);
929
+ }
930
+ }
931
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-radiobutton-label', {
932
+ disabled,
933
+ extended
934
+ }), "rls-theme": rlsTheme, children: [jsxRuntime.jsx("div", { className: "rls-radiobutton-label__component", onClick: onSelect, children: jsxRuntime.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntime.jsx("label", { className: "rls-radiobutton-label__text", children: children })] }));
935
+ }
936
+
937
+ function RlsSwitchLabel({ children, disabled, extended, formControl, rlsTheme }) {
938
+ const [checked, setChecked] = react.useState(formControl?.value || false);
939
+ react.useEffect(() => {
940
+ setChecked(formControl?.state || false);
941
+ }, [formControl?.state]);
942
+ function onToggle() {
943
+ if (formControl) {
944
+ formControl?.setState(!formControl.state);
945
+ }
946
+ else {
947
+ setChecked(!checked);
948
+ }
949
+ }
950
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-switch-label', { disabled, extended }), "rls-theme": rlsTheme, children: [jsxRuntime.jsx("div", { className: "rls-switch-label__component", onClick: onToggle, children: jsxRuntime.jsx(RlsSwitch, { checked: checked, disabled: disabled }) }), jsxRuntime.jsx("label", { className: "rls-switch-label__text", children: children })] }));
951
+ }
952
+
953
+ function RlsTextField({ children, disabled, formControl, onValue, placeholder, rlsTheme, value }) {
954
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-box-field', {
955
+ focused: formControl?.focused,
956
+ error: formControl?.touched && !formControl?.valid,
957
+ disabled: formControl?.disabled || disabled
958
+ }, 'rls-text-field'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsx("div", { className: "rls-box-field__body", children: jsxRuntime.jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }));
959
+ }
960
+
961
+ function RlsToolbar({ actions, children, subtitle }) {
962
+ return (jsxRuntime.jsxs("div", { className: "rls-toolbar", children: [jsxRuntime.jsxs("div", { className: "rls-toolbar__description", children: [children && jsxRuntime.jsx("label", { className: "rls-toolbar__title", children: children }), subtitle && (jsxRuntime.jsx("label", { className: "rls-toolbar__subtitle caption-semibold", children: subtitle }))] }), actions && (jsxRuntime.jsx("div", { className: "rls-toolbar__actions", children: actions.map((action, index) => (jsxRuntime.jsx("div", { children: action }, index))) }))] }));
963
+ }
964
+
965
+ const COUNT_YEAR_RANGE = 4;
966
+ class FactoryYearPicker {
967
+ constructor(props) {
968
+ const { value, maxDate, minDate } = props;
969
+ this.value = value;
970
+ this.maxDate = maxDate;
971
+ this.minDate = minDate;
972
+ }
973
+ static execute(props) {
974
+ const factory = new FactoryYearPicker(props);
975
+ let year = props.year;
976
+ if (factory.minOverflowYear(year)) {
977
+ year = factory.minYear;
978
+ }
979
+ else if (factory.maxOverflowYear(year)) {
980
+ year = factory.maxYear;
981
+ }
982
+ const years = factory.createYears(year);
983
+ return {
984
+ hasNext: factory.hasNext,
985
+ hasPrevious: factory.hasPrevious,
986
+ maxRange: factory.maxYearRange,
987
+ minRange: factory.minYearRange,
988
+ years
989
+ };
990
+ }
991
+ createYears(year) {
992
+ const prevYears = [];
993
+ const nextYears = [];
994
+ this.minYearRange = year;
995
+ this.maxYearRange = year;
996
+ for (let index = 0; index < COUNT_YEAR_RANGE; index++) {
997
+ const yearPrev = year - COUNT_YEAR_RANGE + index;
998
+ const yearNext = year + index + 1;
999
+ const valuePrev = yearPrev >= this.minYear ? yearPrev : undefined;
1000
+ const valueNext = yearNext <= this.maxYear ? yearNext : undefined;
1001
+ const prevState = this.createYear(valuePrev);
1002
+ const nextState = this.createYear(valueNext);
1003
+ prevYears.push(prevState);
1004
+ nextYears.push(nextState);
1005
+ this.recalculateRange(prevState, nextState);
1006
+ }
1007
+ const yearCenter = this.createYear(year);
1008
+ return [...prevYears, yearCenter, ...nextYears];
1009
+ }
1010
+ minOverflowYear(year) {
1011
+ return year < this.minYear;
1012
+ }
1013
+ maxOverflowYear(year) {
1014
+ return year > this.maxYear;
1015
+ }
1016
+ get minYear() {
1017
+ return this.minDate?.getFullYear() || 0;
1018
+ }
1019
+ get maxYear() {
1020
+ return this.maxDate?.getFullYear() || 10000;
1021
+ }
1022
+ get hasPrevious() {
1023
+ return this.minYear < this.minYearRange;
1024
+ }
1025
+ get hasNext() {
1026
+ return this.maxYear > this.maxYearRange;
1027
+ }
1028
+ createYear(value) {
1029
+ return {
1030
+ value,
1031
+ disabled: !value,
1032
+ selected: value === this.value
1033
+ };
1034
+ }
1035
+ recalculateRange(prev, next) {
1036
+ if (!!prev.value && this.minYearRange > prev.value) {
1037
+ this.minYearRange = prev.value;
1038
+ }
1039
+ if (!!next.value && this.maxYearRange < next.value) {
1040
+ this.maxYearRange = next.value;
1041
+ }
1042
+ }
1043
+ }
1044
+ function createYearPicker(props) {
1045
+ return FactoryYearPicker.execute(props);
1046
+ }
1047
+
1048
+ function RlsYearPicker({ formControl, date: date, disabled: disabledPicker, maxDate, minDate, rlsTheme }) {
1049
+ const initialDate = date || new Date();
1050
+ const initialYear = formControl?.state || initialDate.getFullYear();
1051
+ const [value, setValue] = react.useState(initialYear);
1052
+ const [year, setYear] = react.useState(initialYear);
1053
+ const [template, setTemplate] = react.useState(createYearPicker({
1054
+ value: formControl?.state || value,
1055
+ year: initialYear,
1056
+ minDate,
1057
+ maxDate
1058
+ }));
1059
+ react.useEffect(() => {
1060
+ setTemplate(createYearPicker({
1061
+ value: formControl?.state || value,
1062
+ year,
1063
+ minDate,
1064
+ maxDate
1065
+ }));
1066
+ }, [value, year, date, minDate, maxDate]);
1067
+ function onClickPrev() {
1068
+ setYear(year - 8);
1069
+ }
1070
+ function onClickNext() {
1071
+ setYear(year + 8);
1072
+ }
1073
+ function onChange(value) {
1074
+ formControl?.setState(value);
1075
+ setYear(value);
1076
+ setValue(value);
1077
+ }
1078
+ return (jsxRuntime.jsxs("div", { className: "rls-year-picker", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: "rls-year-picker__header", children: [jsxRuntime.jsx("div", { className: "rls-year-picker__action rls-year-picker__action--prev", children: jsxRuntime.jsx("button", { disabled: !template.hasPrevious || disabledPicker, onClick: onClickPrev, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-left" }) }) }), jsxRuntime.jsx("div", { className: "rls-year-picker__title", children: jsxRuntime.jsxs("label", { className: "title1-bold", children: [template.minRange, " - ", template.maxRange] }) }), jsxRuntime.jsx("div", { className: "rls-year-picker__action rls-year-picker__action--next", children: jsxRuntime.jsx("button", { disabled: !template.hasNext || disabledPicker, onClick: onClickNext, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-right" }) }) })] }), jsxRuntime.jsx("div", { className: "rls-year-picker__component", children: template.years.map(({ value, disabled, selected }, index) => (jsxRuntime.jsx("div", { className: renderClassStatus('rls-year-picker__year', {
1079
+ disabled: disabled || disabledPicker,
1080
+ selected
1081
+ }), onClick: () => {
1082
+ if (value) {
1083
+ onChange(value);
1084
+ }
1085
+ }, children: jsxRuntime.jsx("span", { className: "rls-year-picker__year__span body1-medium", children: value || '????' }) }, index))) })] }));
1086
+ }
1087
+
1088
+ const reactI18n = i18n.i18n({
1089
+ es: {
1090
+ confirmationActionApproved: 'Aceptar',
1091
+ dateActionCancel: 'Cancelar',
1092
+ dateActionSelect: 'Establecer',
1093
+ dateActionToday: 'Hoy',
1094
+ listEmptyDescription: 'Lo sentimos, en el momento no hay elementos en el listado',
1095
+ listEmptyTitle: 'Selección no disponible',
1096
+ listInputPlaceholder: 'Buscar...'
1097
+ },
1098
+ en: {
1099
+ confirmationActionApproved: 'Approved',
1100
+ dateActionCancel: 'Cancel',
1101
+ dateActionSelect: 'Select',
1102
+ dateActionToday: 'Today',
1103
+ listEmptyDescription: 'Sorry, there are currently no items in the list',
1104
+ listEmptyTitle: 'Selection not available',
1105
+ listInputPlaceholder: 'Search...'
1106
+ }
1107
+ });
1108
+
1109
+ const classElement = '.rls-list-field__element';
1110
+ const MAX_POSITION_VISIBLE = 4;
1111
+ const LIST_SIZE_REM = 16;
1112
+ const ELEMENT_SIZE_REM = 4;
1113
+ const BASE_SIZE_PX = 16;
1114
+ const ELEMENT_SIZE_PX = BASE_SIZE_PX * ELEMENT_SIZE_REM;
1115
+ const MAZ_LIST_SIZE_PX = BASE_SIZE_PX * LIST_SIZE_REM;
1116
+ function useListControl({ suggestions, formControl, withHigher = false }) {
1117
+ const boxContentRef = react.useRef(null);
1118
+ const listRef = react.useRef(null);
1119
+ const inputRef = react.useRef(null);
1120
+ const [collection, setCollection] = react.useState(new ListCollection([]));
1121
+ const [value, setValue] = react.useState('');
1122
+ const [opened, setOpened] = react.useState(false);
1123
+ const [visible, setVisible] = react.useState(false);
1124
+ const [higher, setHigher] = react.useState(false);
1125
+ const [focused, setFocused] = react.useState(false);
1126
+ const [positionElement, setPositionElement] = react.useState(0);
1127
+ const [listElements, setListElements] = react.useState(undefined);
1128
+ react.useEffect(() => {
1129
+ function onCloseSuggestions(event) {
1130
+ if (!boxContentRef?.current?.contains(event.target)) {
1131
+ setVisible(false);
1132
+ }
1133
+ }
1134
+ document.addEventListener('click', onCloseSuggestions);
1135
+ return () => {
1136
+ document.removeEventListener('click', onCloseSuggestions);
1137
+ };
1138
+ }, []);
1139
+ react.useEffect(() => {
1140
+ if (visible && !opened) {
1141
+ setOpened(true);
1142
+ }
1143
+ if (!visible && opened && formControl && !formControl.touched) {
1144
+ formControl.touch();
1145
+ }
1146
+ setLocationList();
1147
+ }, [visible]);
1148
+ react.useEffect(() => {
1149
+ setCollection(new ListCollection(suggestions));
1150
+ }, [suggestions]);
1151
+ function setLocationList() {
1152
+ if (boxContentRef?.current) {
1153
+ const { top, height } = boxContentRef.current.getBoundingClientRect();
1154
+ const overflow = BASE_SIZE_PX / 2;
1155
+ const positionEnd = top + height + MAZ_LIST_SIZE_PX + overflow;
1156
+ setHigher(positionEnd > window.innerHeight);
1157
+ }
1158
+ }
1159
+ function navigationInput(event) {
1160
+ switch (event.code) {
1161
+ case 'ArrowUp':
1162
+ if (visible && higher) {
1163
+ navigationInputUp();
1164
+ }
1165
+ break;
1166
+ case 'ArrowDown':
1167
+ if (visible && (withHigher || !higher)) {
1168
+ navigationInputDown();
1169
+ }
1170
+ break;
1171
+ }
1172
+ }
1173
+ function navigationElement(event) {
1174
+ switch (event.code) {
1175
+ case 'ArrowUp':
1176
+ navigationElementUp();
1177
+ break;
1178
+ case 'ArrowDown':
1179
+ navigationElementDown();
1180
+ break;
1181
+ }
1182
+ }
1183
+ function navigationInputUp() {
1184
+ const elements = listRef?.current?.querySelectorAll(classElement);
1185
+ if (elements?.length) {
1186
+ const newPosition = elements.length - 1;
1187
+ setListElements(elements);
1188
+ setPositionElement(newPosition);
1189
+ elements.item(newPosition).focus();
1190
+ if (positionElement > MAX_POSITION_VISIBLE) {
1191
+ const elementPosition = elements.length - MAX_POSITION_VISIBLE;
1192
+ setTimeout(() => {
1193
+ listRef?.current?.scroll({
1194
+ top: ELEMENT_SIZE_PX * elementPosition,
1195
+ behavior: 'smooth'
1196
+ });
1197
+ }, 100);
1198
+ }
1199
+ }
1200
+ }
1201
+ function navigationInputDown() {
1202
+ const elements = listRef?.current?.querySelectorAll(classElement);
1203
+ if (elements?.length) {
1204
+ setListElements(elements);
1205
+ setPositionElement(0);
1206
+ elements.item(0).focus();
1207
+ setTimeout(() => {
1208
+ listRef?.current?.scroll({
1209
+ top: 0,
1210
+ behavior: 'smooth'
1211
+ });
1212
+ }, 100);
1213
+ }
1214
+ }
1215
+ function navigationElementUp() {
1216
+ if (positionElement > 0) {
1217
+ const newPosition = positionElement - 1;
1218
+ setPositionElement(newPosition);
1219
+ listElements?.item(newPosition).focus();
1220
+ }
1221
+ else if (withHigher || !higher) {
1222
+ inputRef?.current?.focus();
1223
+ }
1224
+ }
1225
+ function navigationElementDown() {
1226
+ const newPosition = positionElement + 1;
1227
+ const length = listElements?.length || 0;
1228
+ if (newPosition < length) {
1229
+ setPositionElement(newPosition);
1230
+ listElements?.item(newPosition).focus();
1231
+ }
1232
+ else if (higher && !withHigher) {
1233
+ inputRef?.current?.focus();
1234
+ }
1235
+ }
1236
+ return {
1237
+ boxContentRef,
1238
+ collection,
1239
+ focused,
1240
+ higher,
1241
+ inputRef,
1242
+ listRef,
1243
+ value,
1244
+ visible,
1245
+ navigationElement,
1246
+ navigationInput,
1247
+ setFocused,
1248
+ setValue,
1249
+ setVisible
1250
+ };
1251
+ }
1252
+
1253
+ const DURATION_ANIMATION$1 = 240;
1254
+ const MAX_ELEMENTS = 6;
1255
+ function useAutocompleteField({ suggestions, disabled, formControl, onSelect, onValue }) {
1256
+ const [pattern, setPattern] = react.useState('');
1257
+ const [coincidences, setCoincidences] = react.useState([]);
1258
+ const [store, setStore] = react.useState({
1259
+ pattern: '',
1260
+ coincidences: [],
1261
+ previous: null
1262
+ });
1263
+ const listControl = useListControl({
1264
+ suggestions,
1265
+ formControl,
1266
+ withHigher: true
1267
+ });
1268
+ const { collection, inputRef, setFocused, setValue, setVisible, navigationElement, navigationInput } = listControl;
1269
+ const [changeInternal, setChangeInternal] = react.useState(false);
1270
+ react.useEffect(() => {
1271
+ filterSuggestions(pattern, true);
1272
+ }, [suggestions]);
1273
+ react.useEffect(() => {
1274
+ filterSuggestions(pattern);
1275
+ }, [pattern]);
1276
+ react.useEffect(() => {
1277
+ if (!changeInternal) {
1278
+ redefineDescription();
1279
+ }
1280
+ setChangeInternal(false);
1281
+ }, [formControl?.state]);
1282
+ react.useEffect(() => {
1283
+ redefineDescription();
1284
+ }, [collection]);
1285
+ function redefineDescription() {
1286
+ const element = formControl?.state && collection.find(formControl?.state);
1287
+ setValue(element?.description || '');
1288
+ }
1289
+ function onClickControl() {
1290
+ if (!disabled) {
1291
+ setVisible(true);
1292
+ setTimeout(() => inputRef?.current?.focus(), DURATION_ANIMATION$1);
1293
+ }
1294
+ }
1295
+ function onFocusInput() {
1296
+ setFocused(true);
1297
+ }
1298
+ function onBlurInput() {
1299
+ setFocused(false);
1300
+ }
1301
+ function onKeydownInput(event) {
1302
+ switch (event.code) {
1303
+ case 'Escape':
1304
+ setVisible(false);
1305
+ break;
1306
+ case 'Tab':
1307
+ setVisible(false);
1308
+ break;
1309
+ default:
1310
+ navigationInput(event);
1311
+ break;
1312
+ }
1313
+ }
1314
+ function onClickAction() {
1315
+ setVisible(false);
1316
+ setValue('');
1317
+ if (formControl) {
1318
+ setChangeInternal(true);
1319
+ formControl.setState(undefined);
1320
+ }
1321
+ if (onValue) {
1322
+ onValue(undefined);
1323
+ }
1324
+ }
1325
+ function onClickBackdrop() {
1326
+ setVisible(false);
1327
+ }
1328
+ function onClickElement(element) {
1329
+ return () => {
1330
+ onChange(element);
1331
+ };
1332
+ }
1333
+ function onKeydownElement(element) {
1334
+ return (event) => {
1335
+ switch (event.code) {
1336
+ case 'Enter':
1337
+ onChange(element);
1338
+ break;
1339
+ default:
1340
+ navigationElement(event);
1341
+ break;
1342
+ }
1343
+ };
1344
+ }
1345
+ function onChange({ description, value }) {
1346
+ setVisible(false);
1347
+ if (onSelect) {
1348
+ onSelect(value);
1349
+ }
1350
+ else {
1351
+ if (formControl) {
1352
+ setChangeInternal(true);
1353
+ formControl.setState(value);
1354
+ }
1355
+ setValue(description);
1356
+ }
1357
+ if (onValue) {
1358
+ onValue(value);
1359
+ }
1360
+ }
1361
+ function filterSuggestions(pattern, reboot = false) {
1362
+ if (pattern) {
1363
+ const store = reboot ? createStoreEmpty() : searchForPattern(pattern);
1364
+ const elements = store?.coincidences || suggestions;
1365
+ const coincidences = elements.filter((element) => element.hasCoincidence(pattern));
1366
+ setCoincidences(coincidences.slice(0, MAX_ELEMENTS));
1367
+ setStore({
1368
+ coincidences,
1369
+ pattern,
1370
+ previous: store
1371
+ });
1372
+ }
1373
+ else {
1374
+ setCoincidences(suggestions.slice(0, MAX_ELEMENTS));
1375
+ rebootStore();
1376
+ }
1377
+ }
1378
+ function searchForPattern(value) {
1379
+ if (!store.pattern) {
1380
+ return null;
1381
+ }
1382
+ let newStore = store;
1383
+ let search = false;
1384
+ while (!search && newStore) {
1385
+ search = helpersString.hasPattern(value, newStore.pattern, true);
1386
+ if (!search) {
1387
+ newStore = newStore.previous;
1388
+ }
1389
+ }
1390
+ return newStore || rebootStore();
1391
+ }
1392
+ function rebootStore() {
1393
+ const store = createStoreEmpty();
1394
+ setStore(store);
1395
+ return store;
1396
+ }
1397
+ function createStoreEmpty() {
1398
+ return {
1399
+ coincidences: undefined,
1400
+ pattern: '',
1401
+ previous: null
1402
+ };
1403
+ }
1404
+ return {
1405
+ coincidences,
1406
+ listControl,
1407
+ pattern,
1408
+ onBlurInput,
1409
+ onClickAction,
1410
+ onClickBackdrop,
1411
+ onClickControl,
1412
+ onClickElement,
1413
+ onFocusInput,
1414
+ onKeydownElement,
1415
+ onKeydownInput,
1416
+ setPattern
1417
+ };
1418
+ }
1419
+
1420
+ function RlsAutocompleteFieldTemplate({ suggestions, children, disabled, formControl, hiddenIcon, placeholder, searching, rlsTheme, onSearch, onSelect, onValue, render }) {
1421
+ const { coincidences, listControl, pattern, onBlurInput, onClickAction, onClickBackdrop, onClickControl, onClickElement, onFocusInput, onKeydownElement, onKeydownInput, setPattern } = useAutocompleteField({
1422
+ suggestions,
1423
+ disabled,
1424
+ formControl,
1425
+ onSelect,
1426
+ onValue
1427
+ });
1428
+ return (jsxRuntime.jsxs("div", { ref: listControl.boxContentRef, className: renderClassStatus('rls-box-field', {
1429
+ disabled,
1430
+ focused: listControl.focused,
1431
+ selected: !!listControl.value
1432
+ }, 'rls-autocomplete-field rls-list-field'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsxs("div", { className: "rls-box-field__body", children: [jsxRuntime.jsx("label", { className: "rls-list-field__control", onClick: onClickControl, children: listControl.value ? (jsxRuntime.jsx("span", { className: "rls-list-field__control__description", children: listControl.value })) : (jsxRuntime.jsx("span", { className: "rls-list-field__control__placeholder", children: placeholder })) }), !hiddenIcon && listControl.value && (jsxRuntime.jsx("button", { className: "rls-list-field__action", disabled: disabled, onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: "trash-2" }) }))] }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) })), jsxRuntime.jsxs("div", { className: renderClassStatus('rls-list-field__suggestions', {
1433
+ visible: listControl.visible,
1434
+ hide: !listControl.visible,
1435
+ higher: listControl.higher
1436
+ }), children: [jsxRuntime.jsx("div", { className: "rls-list-field__suggestions__body", children: jsxRuntime.jsxs("ul", { ref: listControl.listRef, className: "rls-list-field__ul", children: [jsxRuntime.jsxs("div", { className: "rls-list-field__ul__search", children: [jsxRuntime.jsx("input", { ref: listControl.inputRef, className: "rls-list-field__ul__control", type: "text", placeholder: reactI18n('listInputPlaceholder'), value: pattern, onChange: ({ target: { value } }) => {
1437
+ setPattern(value);
1438
+ }, disabled: disabled || searching, onFocus: onFocusInput, onBlur: onBlurInput, onKeyDown: onKeydownInput }), onSearch && (jsxRuntime.jsx("button", { disabled: disabled || searching, onClick: () => {
1439
+ onSearch(pattern);
1440
+ }, children: jsxRuntime.jsx(RlsIcon, { value: "search" }) }))] }), searching && jsxRuntime.jsx(RlsProgressBar, { indeterminate: true }), coincidences.map((element, index) => (jsxRuntime.jsx("li", { className: "rls-list-field__element", tabIndex: -1, onClick: onClickElement(element), onKeyDown: onKeydownElement(element), children: render(element) }, index))), !coincidences.length && (jsxRuntime.jsx("li", { className: "rls-list-field__empty", children: jsxRuntime.jsxs("div", { className: "rls-list-field__empty__description", children: [jsxRuntime.jsx("label", { className: "label-bold truncate", children: reactI18n('listEmptyTitle') }), jsxRuntime.jsx("p", { className: "caption-regular", children: reactI18n('listEmptyDescription') })] }) }))] }) }), jsxRuntime.jsx("div", { className: "rls-list-field__backdrop", onClick: onClickBackdrop })] })] }));
1441
+ }
1442
+ function RlsAutocompleteField(props) {
1443
+ return (jsxRuntime.jsx(RlsAutocompleteFieldTemplate, { ...props, render: (element) => (jsxRuntime.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: element.title })) }));
1444
+ }
1445
+
1446
+ function RlsCard({ children, outline, rlsTheme }) {
1447
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-card', { outline }), "rls-theme": rlsTheme, children: jsxRuntime.jsx("div", { className: "rls-card__content", children: children }) }));
1448
+ }
1449
+
1450
+ class ConfirmationResult extends helpersAdvanced.PartialSealed {
1451
+ static approved() {
1452
+ return new ConfirmationResult('approved');
1453
+ }
1454
+ static reject() {
1455
+ return new ConfirmationResult('reject');
1456
+ }
1457
+ }
1458
+ function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
1459
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-confirmation', { visible }), "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: "rls-confirmation__component", children: [jsxRuntime.jsxs("div", { className: "rls-confirmation__header", children: [title && (jsxRuntime.jsx("div", { className: "rls-confirmation__header__title", children: title })), subtitle && (jsxRuntime.jsx("div", { className: "rls-confirmation__header__subtitle", children: subtitle }))] }), jsxRuntime.jsx("div", { className: "rls-confirmation__body", children: content && (jsxRuntime.jsx("div", { className: "rls-confirmation__body__content", children: content })) }), (approved || reject) && (jsxRuntime.jsx("div", { className: "rls-confirmation__footer", children: jsxRuntime.jsxs("div", { className: "rls-confirmation__footer__actions", children: [approved && (jsxRuntime.jsx(RlsButton, { type: "raised", onClick: () => {
1460
+ if (approved.onClick) {
1461
+ approved.onClick();
1462
+ }
1463
+ }, children: approved.label })), reject && (jsxRuntime.jsx(RlsButton, { type: "outline", onClick: () => {
1464
+ if (reject.onClick) {
1465
+ reject.onClick();
1466
+ }
1467
+ }, children: reject.label }))] }) }))] }), jsxRuntime.jsx("div", { className: "rls-confirmation__backdrop" })] }));
1468
+ }
1469
+ function useConfirmationService() {
1470
+ const [config, setConfig] = react.useState({});
1471
+ const [visible, setVisible] = react.useState(false);
1472
+ const rlsConfirmation = ReactDOM.createPortal(jsxRuntime.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
1473
+ function confirmation(config) {
1474
+ return new Promise((resolve) => {
1475
+ const { content, rlsTheme, subtitle, title, approved, reject } = config;
1476
+ setConfig({
1477
+ content,
1478
+ rlsTheme,
1479
+ subtitle,
1480
+ title,
1481
+ approved: {
1482
+ label: approved || reactI18n('confirmationActionApproved'),
1483
+ onClick: () => {
1484
+ setVisible(false);
1485
+ resolve(ConfirmationResult.approved());
1486
+ }
1487
+ },
1488
+ reject: reject
1489
+ ? {
1490
+ label: reject,
1491
+ onClick: () => {
1492
+ setVisible(false);
1493
+ resolve(ConfirmationResult.reject());
1494
+ }
1495
+ }
1496
+ : undefined
1497
+ });
1498
+ setVisible(true);
1499
+ });
1500
+ }
1501
+ return {
1502
+ RlsConfirmation: rlsConfirmation,
1503
+ confirmation
1504
+ };
1505
+ }
1506
+
1507
+ function RlsDatatableHeader({ children }) {
1508
+ return jsxRuntime.jsx("tr", { className: "rls-datatable__header", children: children });
1509
+ }
1510
+ function RlsDatatableTitle({ children, className, control }) {
1511
+ return (jsxRuntime.jsx("th", { className: `${className} ` + renderClassStatus('rls-datatable__title', { control }), children: children }));
1512
+ }
1513
+ function RlsDatatableData({ children, className }) {
1514
+ return jsxRuntime.jsx("tr", { className: `rls-datatable__data ${className}`, children: children });
1515
+ }
1516
+ function RlsDatatableCell({ children, className, control, overflow }) {
1517
+ return (jsxRuntime.jsx("th", { className: `${className} ` +
1518
+ renderClassStatus('rls-datatable__cell', { control, overflow }), children: children }));
1519
+ }
1520
+ function RlsDatatable({ children, footer, header, rlsTheme }) {
1521
+ return (jsxRuntime.jsxs("div", { className: "rls-datatable", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("table", { children: [header && jsxRuntime.jsx("thead", { className: "rls-datatable__thead", children: header }), jsxRuntime.jsx("tbody", { className: "rls-datatable__tbody", children: children })] }), footer && jsxRuntime.jsx("div", { className: "rls-datatable__tfooter", children: footer })] }));
1522
+ }
1523
+
1524
+ const controlIsValid = (props) => {
1525
+ const { state, validators } = props;
1526
+ return validators.reduce((errors, validator) => {
1527
+ const error = validator(state);
1528
+ if (error) {
1529
+ errors.push(error);
1530
+ }
1531
+ return errors;
1532
+ }, []);
1533
+ };
1534
+
1535
+ function useReactControl(props = {}) {
1536
+ const [state, setCurrentState] = react.useState(props.state);
1537
+ const [value, setValue] = react.useState(props.state);
1538
+ const [touched, setTouched] = react.useState(false);
1539
+ const [dirty, setDirty] = react.useState(false);
1540
+ const [focused, setFocused] = react.useState(false);
1541
+ const [disabled, setDisabled] = react.useState(false);
1542
+ const [initialValue] = react.useState(props.state);
1543
+ const [validators, setValidators] = react.useState(props.validators);
1544
+ const [subscribers] = react.useState(new rxjs.BehaviorSubject(props.state));
1545
+ const elementRef = react.useRef(null);
1546
+ const errors = (() => validators ? controlIsValid({ state, validators }) : [])();
1547
+ const error = (() => errors[0])();
1548
+ const valid = (() => errors.length === 0)();
1549
+ react.useEffect(() => {
1550
+ if (state !== null && state !== undefined) {
1551
+ setValue(state);
1552
+ }
1553
+ subscribers.next(state);
1554
+ }, [state]);
1555
+ function focus() {
1556
+ setFocused(true);
1557
+ }
1558
+ function blur() {
1559
+ setFocused(false);
1560
+ }
1561
+ function disable() {
1562
+ setDisabled(true);
1563
+ }
1564
+ function enable() {
1565
+ setDisabled(false);
1566
+ }
1567
+ function touch() {
1568
+ setTouched(true);
1569
+ }
1570
+ function untouch() {
1571
+ setTouched(false);
1572
+ }
1573
+ function setState(state) {
1574
+ setDirty(true);
1575
+ setCurrentState(state);
1576
+ }
1577
+ function reset() {
1578
+ setTouched(false);
1579
+ setDirty(false);
1580
+ setCurrentState(initialValue);
1581
+ }
1582
+ function subscribe(subscriber) {
1583
+ return subscribers.subscribe(subscriber);
1584
+ }
1585
+ return {
1586
+ elementRef,
1587
+ error,
1588
+ errors,
1589
+ focused,
1590
+ unfocused: !focused,
1591
+ dirty,
1592
+ pristine: !dirty,
1593
+ disabled,
1594
+ enabled: !disabled,
1595
+ valid,
1596
+ invalid: !valid,
1597
+ touched,
1598
+ untouched: !touched,
1599
+ reset,
1600
+ focus,
1601
+ blur,
1602
+ disable,
1603
+ enable,
1604
+ touch,
1605
+ untouch,
1606
+ setState,
1607
+ setValidators,
1608
+ state,
1609
+ subscribe,
1610
+ value
1611
+ };
1612
+ }
1613
+
1614
+ var PickerListenerType;
1615
+ (function (PickerListenerType) {
1616
+ PickerListenerType["Select"] = "PickerSelect";
1617
+ PickerListenerType["Now"] = "PickerNow";
1618
+ PickerListenerType["Cancel"] = "PickerCancel";
1619
+ })(PickerListenerType || (PickerListenerType = {}));
1620
+
1621
+ function verifyDateRange(date, min, max) {
1622
+ return min && helpersDate.isBefore(min, date)
1623
+ ? min
1624
+ : max && helpersDate.isAfter(max, date)
1625
+ ? max
1626
+ : date;
1627
+ }
1628
+
1629
+ const FORMAT_DESCRIPTION = '{dw}, {mx} {dd} de {aa}';
1630
+ const VISIBILITY_STATE$1 = {
1631
+ month: false,
1632
+ day: false,
1633
+ year: false
1634
+ };
1635
+ const VISIBILITY$1 = {
1636
+ DAY: {
1637
+ ...VISIBILITY_STATE$1,
1638
+ day: true
1639
+ },
1640
+ MONTH: {
1641
+ ...VISIBILITY_STATE$1,
1642
+ month: true
1643
+ },
1644
+ YEAR: {
1645
+ ...VISIBILITY_STATE$1,
1646
+ year: true
1647
+ }
1648
+ };
1649
+ function RlsDatePicker({ automatic, date, formControl, disabled, maxDate, minDate, onListener, rlsTheme }) {
1650
+ const dateInitial = formControl?.state || date || new Date();
1651
+ const yearControl = useReactControl({ state: dateInitial.getFullYear() });
1652
+ const dayControl = useReactControl({ state: dateInitial.getDate() });
1653
+ const monthControl = useReactControl({ state: dateInitial.getMonth() });
1654
+ const [value, setValue] = react.useState(dateInitial);
1655
+ const [{ day, month, year }, setVisibility] = react.useState(VISIBILITY$1.DAY);
1656
+ const title = helpersDate.formatDate(value, FORMAT_DESCRIPTION);
1657
+ react.useEffect(() => {
1658
+ setValue((prevValue) => {
1659
+ return typeof yearControl.state === 'number'
1660
+ ? verifyDateRange(helpersDate.refactorYear(prevValue, yearControl.state), minDate, maxDate)
1661
+ : prevValue;
1662
+ });
1663
+ setVisibility(VISIBILITY$1.DAY);
1664
+ }, [yearControl.state]);
1665
+ react.useEffect(() => {
1666
+ setValue((prevValue) => {
1667
+ return typeof monthControl.state === 'number'
1668
+ ? verifyDateRange(helpersDate.refactorMonth(prevValue, monthControl.state), minDate, maxDate)
1669
+ : prevValue;
1670
+ });
1671
+ setVisibility(VISIBILITY$1.DAY);
1672
+ }, [monthControl.state]);
1673
+ react.useEffect(() => {
1674
+ setValue((prevValue) => {
1675
+ return typeof dayControl.state === 'number'
1676
+ ? verifyDateRange(helpersDate.refactorDay(prevValue, dayControl.state), minDate, maxDate)
1677
+ : prevValue;
1678
+ });
1679
+ }, [dayControl.state]);
1680
+ function onVisibilityDay() {
1681
+ setVisibility(VISIBILITY$1.DAY);
1682
+ }
1683
+ function onVisibilityMonth() {
1684
+ setVisibility(VISIBILITY$1.MONTH);
1685
+ }
1686
+ function onVisibilityYear() {
1687
+ setVisibility(VISIBILITY$1.YEAR);
1688
+ }
1689
+ function onCancel() {
1690
+ if (onListener) {
1691
+ onListener({ type: PickerListenerType.Cancel });
1692
+ }
1693
+ }
1694
+ function onToday() {
1695
+ const value = new Date(); // Today date
1696
+ formControl?.setState(value);
1697
+ setValue(value);
1698
+ yearControl.setState(value.getFullYear());
1699
+ dayControl.setState(value.getDate());
1700
+ monthControl.setState(value.getMonth());
1701
+ if (onListener) {
1702
+ onListener({ type: PickerListenerType.Now, value });
1703
+ }
1704
+ }
1705
+ function onSelect() {
1706
+ formControl?.setState(value);
1707
+ if (onListener) {
1708
+ onListener({ type: PickerListenerType.Select, value });
1709
+ }
1710
+ }
1711
+ return (jsxRuntime.jsxs("div", { className: "rls-date-picker", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: "rls-date-picker__header", children: [jsxRuntime.jsx("div", { className: "rls-date-picker__title rls-date-picker__title--description", children: jsxRuntime.jsx("span", { onClick: onVisibilityDay, children: title }) }), jsxRuntime.jsx("div", { className: "rls-date-picker__title rls-date-picker__title--year", children: jsxRuntime.jsx("span", { onClick: onVisibilityYear, children: yearControl.value }) }), jsxRuntime.jsx(RlsMonthTitlePicker, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, onClick: onVisibilityMonth })] }), jsxRuntime.jsxs("div", { className: renderClassStatus('rls-date-picker__component', {
1712
+ year,
1713
+ day,
1714
+ month
1715
+ }), children: [jsxRuntime.jsx(RlsDayPicker, { formControl: dayControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntime.jsx(RlsMonthPicker, { formControl: monthControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntime.jsx(RlsYearPicker, { formControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled })] }), jsxRuntime.jsx("div", { className: renderClassStatus('rls-date-picker__footer', { automatic }), children: jsxRuntime.jsxs("div", { className: "rls-date-picker__actions", children: [jsxRuntime.jsx("div", { className: "rls-date-picker__actions--cancel", children: jsxRuntime.jsx(RlsButton, { type: "ghost", onClick: onCancel, children: reactI18n('dateActionCancel') }) }), jsxRuntime.jsx("div", { className: "rls-date-picker__actions--today", children: jsxRuntime.jsx(RlsButton, { type: "ghost", onClick: onToday, children: reactI18n('dateActionToday') }) }), jsxRuntime.jsx("div", { className: "rls-date-picker__actions--ok", children: jsxRuntime.jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) })] }));
1716
+ }
1717
+
1718
+ function RlsModal({ children, visible, rlsTheme }) {
1719
+ return ReactDOM.createPortal(jsxRuntime.jsxs("div", { className: renderClassStatus('rls-modal', { visible }), "rls-theme": rlsTheme, children: [jsxRuntime.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntime.jsx("div", { className: "rls-modal__backdrop" })] }), document.body);
1720
+ }
1721
+
1722
+ function RlsDateField({ children, date, disabled, formControl, maxDate, minDate, placeholder, rlsTheme }) {
1723
+ const dateInitial = formControl?.state || date || new Date();
1724
+ const [value, setValue] = react.useState(dateInitial);
1725
+ const [show, setShow] = react.useState(false);
1726
+ const [description, setDescription] = react.useState('');
1727
+ react.useEffect(() => {
1728
+ setDescription(value ? helpersDate.formatDate(value, '{dd}/{mx}/{aa}') : '');
1729
+ }, [value]);
1730
+ function onClickInput() {
1731
+ setShow(true);
1732
+ }
1733
+ function onClean() {
1734
+ if (value) {
1735
+ formControl?.setState(undefined);
1736
+ setValue(undefined);
1737
+ if (formControl && !formControl.touched) {
1738
+ formControl.touch();
1739
+ }
1740
+ }
1741
+ else {
1742
+ setShow(true);
1743
+ }
1744
+ }
1745
+ return (jsxRuntime.jsxs("div", { className: "rls-date-field", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: renderClassStatus('rls-box-field', { disabled }), children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsxs("div", { className: "rls-box-field__body", children: [jsxRuntime.jsx("input", { className: "rls-date-field__control", type: "text", value: description, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsxRuntime.jsx("button", { className: "rls-date-field__action", onClick: onClean, disabled: disabled, children: jsxRuntime.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }), jsxRuntime.jsx(RlsModal, { visible: show, children: jsxRuntime.jsx(RlsDatePicker, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
1746
+ if (value) {
1747
+ setValue(value);
1748
+ }
1749
+ setShow(false);
1750
+ if (formControl && !formControl.touched) {
1751
+ formControl.touch();
1752
+ }
1753
+ } }) })] }));
1754
+ }
1755
+
1756
+ const VISIBILITY_STATE = {
1757
+ month: false,
1758
+ day: false,
1759
+ year: false
1760
+ };
1761
+ const VISIBILITY = {
1762
+ DAY: {
1763
+ ...VISIBILITY_STATE,
1764
+ day: true
1765
+ },
1766
+ MONTH: {
1767
+ ...VISIBILITY_STATE,
1768
+ month: true
1769
+ },
1770
+ YEAR: {
1771
+ ...VISIBILITY_STATE,
1772
+ year: true
1773
+ }
1774
+ };
1775
+ function RlsDateRangePicker({ automatic, date: datePicker, disabled, formControl, maxDate, minDate, rlsTheme, onListener }) {
1776
+ const dateInitial = helpersDate.normalizeMinTime(datePicker || new Date());
1777
+ const rangeInitial = formControl?.state || DateRange.now();
1778
+ const yearControl = useReactControl({ state: dateInitial.getFullYear() });
1779
+ const monthControl = useReactControl({ state: dateInitial.getMonth() });
1780
+ const dayControl = useReactControl({ state: rangeInitial });
1781
+ const [value, setValue] = react.useState(rangeInitial);
1782
+ const [date, setDate] = react.useState(dateInitial);
1783
+ const [{ day, month, year }, setVisibility] = react.useState(VISIBILITY.DAY);
1784
+ react.useEffect(() => {
1785
+ setDate((prevValue) => {
1786
+ return typeof yearControl.state === 'number'
1787
+ ? helpersDate.refactorYear(prevValue, yearControl.state)
1788
+ : prevValue;
1789
+ });
1790
+ setVisibility(VISIBILITY.DAY);
1791
+ }, [yearControl.state]);
1792
+ react.useEffect(() => {
1793
+ setDate((prevValue) => {
1794
+ return typeof monthControl.state === 'number'
1795
+ ? helpersDate.refactorMonth(prevValue, monthControl.state)
1796
+ : prevValue;
1797
+ });
1798
+ setVisibility(VISIBILITY.DAY);
1799
+ }, [monthControl.state]);
1800
+ react.useEffect(() => {
1801
+ if (dayControl.state) {
1802
+ setValue(dayControl.state);
1803
+ }
1804
+ setVisibility(VISIBILITY.DAY);
1805
+ }, [dayControl.state]);
1806
+ function onVisibilityDay() {
1807
+ setVisibility(VISIBILITY.DAY);
1808
+ }
1809
+ function onVisibilityMonth() {
1810
+ setVisibility(VISIBILITY.MONTH);
1811
+ }
1812
+ function onVisibilityYear() {
1813
+ setVisibility(VISIBILITY.YEAR);
1814
+ }
1815
+ function onCancel() {
1816
+ if (onListener) {
1817
+ onListener({ type: PickerListenerType.Cancel });
1818
+ }
1819
+ }
1820
+ function onSelect() {
1821
+ formControl?.setState(value);
1822
+ if (onListener) {
1823
+ onListener({ type: PickerListenerType.Select, value });
1824
+ }
1825
+ }
1826
+ return (jsxRuntime.jsxs("div", { className: "rls-date-range-picker", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: "rls-date-range-picker__header", children: [jsxRuntime.jsx("div", { className: "rls-date-range-picker__title rls-date-range-picker__title--description", children: jsxRuntime.jsx("span", { onClick: onVisibilityDay, children: value.description }) }), jsxRuntime.jsx("div", { className: "rls-date-range-picker__title rls-date-range-picker__title--year", children: jsxRuntime.jsx("span", { onClick: onVisibilityYear, children: yearControl.state }) }), jsxRuntime.jsx(RlsMonthTitlePicker, { monthControl: monthControl, yearControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, onClick: onVisibilityMonth })] }), jsxRuntime.jsxs("div", { className: renderClassStatus('rls-date-range-picker__component', {
1827
+ year,
1828
+ day,
1829
+ month
1830
+ }), children: [jsxRuntime.jsx(RlsDayRangePicker, { formControl: dayControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntime.jsx(RlsMonthPicker, { formControl: monthControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntime.jsx(RlsYearPicker, { formControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled })] }), jsxRuntime.jsx("div", { className: renderClassStatus('rls-date-range-picker__footer', {
1831
+ automatic
1832
+ }), children: jsxRuntime.jsxs("div", { className: "rls-date-range-picker__actions", children: [jsxRuntime.jsx("div", { className: "rls-date-range-picker__actions--cancel", children: jsxRuntime.jsx(RlsButton, { type: "ghost", onClick: onCancel, children: reactI18n('dateActionCancel') }) }), jsxRuntime.jsx("div", { className: "rls-date-range-picker__actions--ok", children: jsxRuntime.jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) })] }));
1833
+ }
1834
+
1835
+ function RlsDateRangeField({ children, date: datePicker, disabled, formControl, maxDate, minDate, placeholder, rlsTheme }) {
1836
+ const rangeInitial = formControl?.state || DateRange.now();
1837
+ const dateInitial = datePicker || new Date();
1838
+ const [value, setValue] = react.useState(rangeInitial);
1839
+ const [date] = react.useState(dateInitial);
1840
+ const [show, setShow] = react.useState(false);
1841
+ const [description, setDescription] = react.useState('');
1842
+ react.useEffect(() => {
1843
+ setDescription(value?.description || '');
1844
+ }, [value]);
1845
+ function onClickInput() {
1846
+ setShow(true);
1847
+ }
1848
+ function onClickAction() {
1849
+ if (value) {
1850
+ formControl?.setState(undefined);
1851
+ setValue(undefined);
1852
+ }
1853
+ else {
1854
+ setShow(true);
1855
+ }
1856
+ }
1857
+ return (jsxRuntime.jsxs("div", { className: "rls-date-field", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: "rls-box-field", children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsxs("div", { className: "rls-box-field__body", children: [jsxRuntime.jsx("input", { className: "rls-date-field__control", type: "text", value: description, readOnly: true, placeholder: placeholder, onClick: onClickInput }), jsxRuntime.jsx("button", { className: "rls-date-field__action", onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) })] }), jsxRuntime.jsx(RlsModal, { visible: show, children: jsxRuntime.jsx(RlsDateRangePicker, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
1858
+ if (value) {
1859
+ setValue(value);
1860
+ }
1861
+ setShow(false);
1862
+ } }) })] }));
1863
+ }
1864
+
1865
+ function RlsFormNavigation({ children, visible, rlsTheme }) {
1866
+ return (jsxRuntime.jsx("div", { className: renderClassStatus('rls-form-navigation', { visible }), "rls-theme": rlsTheme, children: jsxRuntime.jsx("div", { className: "rls-form-navigation__body", children: children }) }));
1867
+ }
1868
+
1869
+ function useSelectField({ suggestions, formControl, onSelect, onValue }) {
1870
+ const listControl = useListControl({ suggestions, formControl });
1871
+ const { collection, inputRef, visible, setFocused, setValue, setVisible, navigationElement, navigationInput } = listControl;
1872
+ const [changeInternal, setChangeInternal] = react.useState(false);
1873
+ react.useEffect(() => {
1874
+ if (!changeInternal) {
1875
+ redefineDescription();
1876
+ }
1877
+ setChangeInternal(false);
1878
+ }, [formControl?.state]);
1879
+ react.useEffect(() => {
1880
+ redefineDescription();
1881
+ }, [collection]);
1882
+ function redefineDescription() {
1883
+ const element = formControl?.state && collection.find(formControl?.state);
1884
+ setValue(element?.description || '');
1885
+ }
1886
+ function onFocusInput() {
1887
+ setFocused(true);
1888
+ }
1889
+ function onBlurInput() {
1890
+ setFocused(false);
1891
+ }
1892
+ function onClickControl() {
1893
+ setVisible(true);
1894
+ }
1895
+ function onKeydownInput(event) {
1896
+ switch (event.code) {
1897
+ case 'Space':
1898
+ setVisible(true);
1899
+ break;
1900
+ case 'Enter':
1901
+ setVisible(true);
1902
+ break;
1903
+ case 'Escape':
1904
+ setVisible(false);
1905
+ break;
1906
+ case 'Tab':
1907
+ setVisible(false);
1908
+ break;
1909
+ default:
1910
+ navigationInput(event);
1911
+ break;
1912
+ }
1913
+ }
1914
+ function onClickAction() {
1915
+ const newVisible = !visible;
1916
+ setVisible(newVisible);
1917
+ if (newVisible) {
1918
+ inputRef?.current?.focus();
1919
+ }
1920
+ }
1921
+ function onClickBackdrop() {
1922
+ setVisible(false);
1923
+ }
1924
+ function onClickElement(element) {
1925
+ return () => {
1926
+ onChange(element);
1927
+ };
1928
+ }
1929
+ function onKeydownElement(element) {
1930
+ return (event) => {
1931
+ switch (event.code) {
1932
+ case 'Enter':
1933
+ onChange(element);
1934
+ break;
1935
+ default:
1936
+ navigationElement(event);
1937
+ break;
1938
+ }
1939
+ };
1940
+ }
1941
+ function onChange({ description, value }) {
1942
+ inputRef?.current?.focus();
1943
+ setVisible(false);
1944
+ if (onSelect) {
1945
+ onSelect(value);
1946
+ }
1947
+ else {
1948
+ if (formControl) {
1949
+ setChangeInternal(true);
1950
+ formControl.setState(value);
1951
+ }
1952
+ setValue(description);
1953
+ }
1954
+ if (onValue) {
1955
+ onValue(value);
1956
+ }
1957
+ }
1958
+ return {
1959
+ listControl,
1960
+ onBlurInput,
1961
+ onClickAction,
1962
+ onClickBackdrop,
1963
+ onClickInput: onClickControl,
1964
+ onClickElement,
1965
+ onFocusInput,
1966
+ onKeydownElement,
1967
+ onKeydownInput
1968
+ };
1969
+ }
1970
+
1971
+ function RlsSelectFieldTemplate({ suggestions, children, disabled, formControl, placeholder, rlsTheme, onSelect, onValue, render }) {
1972
+ const { listControl, onBlurInput, onClickAction, onClickBackdrop, onClickElement, onClickInput, onFocusInput, onKeydownElement, onKeydownInput } = useSelectField({
1973
+ suggestions,
1974
+ disabled,
1975
+ formControl,
1976
+ onSelect,
1977
+ onValue
1978
+ });
1979
+ return (jsxRuntime.jsxs("div", { ref: listControl.boxContentRef, className: renderClassStatus('rls-box-field', { focused: listControl.focused, disabled }, 'rls-select-field rls-list-field'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-box-field__label", children: children }), jsxRuntime.jsx("div", { className: "rls-box-field__component", children: jsxRuntime.jsxs("div", { className: "rls-box-field__body", children: [jsxRuntime.jsx("input", { ref: listControl.inputRef, className: "rls-list-field__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: listControl.value, onFocus: onFocusInput, onBlur: onBlurInput, onClick: onClickInput, onKeyDown: onKeydownInput }), jsxRuntime.jsx("button", { className: renderClassStatus('rls-list-field__action', {
1980
+ visible: listControl.visible
1981
+ }), disabled: disabled, onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-down" }) })] }) }), formControl?.touched && formControl?.error && (jsxRuntime.jsx("div", { className: "rls-box-field__error", children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) })), jsxRuntime.jsxs("div", { className: renderClassStatus('rls-list-field__suggestions', {
1982
+ visible: listControl.visible,
1983
+ hide: !listControl.visible,
1984
+ higher: listControl.higher
1985
+ }), children: [jsxRuntime.jsx("div", { className: "rls-list-field__suggestions__body", children: jsxRuntime.jsxs("ul", { ref: listControl.listRef, className: "rls-list-field__ul", children: [suggestions.map((element, index) => (jsxRuntime.jsx("li", { className: "rls-list-field__element", tabIndex: -1, onClick: onClickElement(element), onKeyDown: onKeydownElement(element), children: render(element) }, index))), !suggestions.length && (jsxRuntime.jsx("li", { className: "rls-list-field__empty", children: jsxRuntime.jsxs("div", { className: "rls-list-field__empty__description", children: [jsxRuntime.jsx("label", { className: "label-bold truncate", children: reactI18n('listEmptyTitle') }), jsxRuntime.jsx("p", { className: "caption-regular", children: reactI18n('listEmptyDescription') })] }) }))] }) }), jsxRuntime.jsx("div", { className: "rls-list-field__backdrop", onClick: onClickBackdrop })] })] }));
1986
+ }
1987
+ function RlsSelectField(props) {
1988
+ return (jsxRuntime.jsx(RlsSelectFieldTemplate, { ...props, render: (element) => (jsxRuntime.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: element.title })) }));
1989
+ }
1990
+
1991
+ const DURATION_ANIMATION = 240;
1992
+ const DURATION_CHAR = 75;
1993
+ const DURATION_MAX = 9000;
1994
+ const DURATION_MIN = 3000;
1995
+ const DURATION_RESET = 480;
1996
+ function calculateDuration({ length }) {
1997
+ let duration = length * DURATION_CHAR;
1998
+ if (duration < DURATION_MIN) {
1999
+ duration = DURATION_MIN;
2000
+ }
2001
+ else if (duration > DURATION_MAX) {
2002
+ duration = DURATION_MAX;
2003
+ }
2004
+ return duration + DURATION_RESET;
2005
+ }
2006
+ function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
2007
+ return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-snackbar', { visible }), "rls-theme": rlsTheme, children: [icon && (jsxRuntime.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntime.jsx(RlsIcon, { value: icon }) })), jsxRuntime.jsxs("div", { className: "rls-snackbar__component", children: [title && jsxRuntime.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntime.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
2008
+ }
2009
+ function useSnackbarService() {
2010
+ const [config, setConfig] = react.useState({});
2011
+ const [duration, setDuration] = react.useState(4000);
2012
+ const [timeoutId, setTimeoutId] = react.useState();
2013
+ const [visible, setVisible] = react.useState(false);
2014
+ const rlsSnackbar = jsxRuntime.jsx(RlsSnackbar, { ...config, visible: visible });
2015
+ react.useEffect(() => {
2016
+ if (visible) {
2017
+ const timeoutId = setTimeout(() => {
2018
+ setVisible(false);
2019
+ setTimeoutId(undefined);
2020
+ }, duration);
2021
+ setTimeoutId(timeoutId);
2022
+ }
2023
+ else if (timeoutId) {
2024
+ clearTimeout(timeoutId);
2025
+ setTimeout(() => snackbar(config), DURATION_ANIMATION);
2026
+ }
2027
+ }, [visible]);
2028
+ function snackbar(config) {
2029
+ const { content } = config;
2030
+ setConfig(config);
2031
+ setDuration(calculateDuration(String(content)));
2032
+ setVisible(!visible);
2033
+ }
2034
+ return {
2035
+ RlsSnackbar: rlsSnackbar,
2036
+ snackbar
2037
+ };
2038
+ }
2039
+
2040
+ const RlsContext = react.createContext({
2041
+ confirmation: () => {
2042
+ return Promise.resolve(ConfirmationResult.approved());
2043
+ },
2044
+ snackbar: () => { }
2045
+ });
2046
+ function RlsApplication({ children }) {
2047
+ const { RlsConfirmation, confirmation } = useConfirmationService();
2048
+ const { RlsSnackbar, snackbar } = useSnackbarService();
2049
+ return (jsxRuntime.jsxs(RlsContext.Provider, { value: { confirmation, snackbar }, children: [jsxRuntime.jsx("div", { className: "rls-app__body", children: children }), RlsSnackbar, RlsConfirmation] }));
2050
+ }
2051
+
2052
+ exports.ConfirmationResult = ConfirmationResult;
2053
+ exports.DateRange = DateRange;
2054
+ exports.ListCollection = ListCollection;
2055
+ exports.RlsAmount = RlsAmount;
2056
+ exports.RlsApplication = RlsApplication;
2057
+ exports.RlsAutocompleteField = RlsAutocompleteField;
2058
+ exports.RlsAutocompleteFieldTemplate = RlsAutocompleteFieldTemplate;
2059
+ exports.RlsAvatar = RlsAvatar;
2060
+ exports.RlsBallot = RlsBallot;
2061
+ exports.RlsBreadcrumb = RlsBreadcrumb;
2062
+ exports.RlsButton = RlsButton;
2063
+ exports.RlsButtonAction = RlsButtonAction;
2064
+ exports.RlsButtonToggle = RlsButtonToggle;
2065
+ exports.RlsCard = RlsCard;
2066
+ exports.RlsCheckBox = RlsCheckBox;
2067
+ exports.RlsCheckBoxControl = RlsCheckBoxControl;
2068
+ exports.RlsCheckBoxLabel = RlsCheckBoxLabel;
2069
+ exports.RlsConfirmation = RlsConfirmation;
2070
+ exports.RlsContext = RlsContext;
2071
+ exports.RlsDatatable = RlsDatatable;
2072
+ exports.RlsDatatableCell = RlsDatatableCell;
2073
+ exports.RlsDatatableData = RlsDatatableData;
2074
+ exports.RlsDatatableHeader = RlsDatatableHeader;
2075
+ exports.RlsDatatableTitle = RlsDatatableTitle;
2076
+ exports.RlsDateField = RlsDateField;
2077
+ exports.RlsDatePicker = RlsDatePicker;
2078
+ exports.RlsDateRangeField = RlsDateRangeField;
2079
+ exports.RlsDateRangePicker = RlsDateRangePicker;
2080
+ exports.RlsDayPicker = RlsDayPicker;
2081
+ exports.RlsDayRangePicker = RlsDayRangePicker;
2082
+ exports.RlsFormNavigation = RlsFormNavigation;
2083
+ exports.RlsIcon = RlsIcon;
2084
+ exports.RlsInput = RlsInput;
2085
+ exports.RlsInputMoney = RlsInputMoney;
2086
+ exports.RlsInputNumber = RlsInputNumber;
2087
+ exports.RlsInputPassword = RlsInputPassword;
2088
+ exports.RlsInputText = RlsInputText;
2089
+ exports.RlsLabel = RlsLabel;
2090
+ exports.RlsMessageIcon = RlsMessageIcon;
2091
+ exports.RlsModal = RlsModal;
2092
+ exports.RlsMoneyField = RlsMoneyField;
2093
+ exports.RlsMonthPicker = RlsMonthPicker;
2094
+ exports.RlsMonthTitlePicker = RlsMonthTitlePicker;
2095
+ exports.RlsNumberField = RlsNumberField;
2096
+ exports.RlsPagination = RlsPagination;
2097
+ exports.RlsPasswordField = RlsPasswordField;
2098
+ exports.RlsPoster = RlsPoster;
2099
+ exports.RlsProgressBar = RlsProgressBar;
2100
+ exports.RlsRadioButton = RlsRadioButton;
2101
+ exports.RlsRadioButtonLabel = RlsRadioButtonLabel;
2102
+ exports.RlsSearchInput = RlsSearchInput;
2103
+ exports.RlsSelectField = RlsSelectField;
2104
+ exports.RlsSelectFieldTemplate = RlsSelectFieldTemplate;
2105
+ exports.RlsSkeleton = RlsSkeleton;
2106
+ exports.RlsSkeletonText = RlsSkeletonText;
2107
+ exports.RlsSnackbar = RlsSnackbar;
2108
+ exports.RlsSwitch = RlsSwitch;
2109
+ exports.RlsSwitchControl = RlsSwitchControl;
2110
+ exports.RlsSwitchLabel = RlsSwitchLabel;
2111
+ exports.RlsTabularText = RlsTabularText;
2112
+ exports.RlsTextField = RlsTextField;
2113
+ exports.RlsToolbar = RlsToolbar;
2114
+ exports.RlsYearPicker = RlsYearPicker;
2115
+ exports.renderClassStatus = renderClassStatus;
2116
+ exports.useConfirmationService = useConfirmationService;
2117
+ exports.useListControl = useListControl;
2118
+ exports.useSnackbarService = useSnackbarService;
2119
+ //# sourceMappingURL=index.js.map