@rolster/react-components 18.14.0 → 18.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +17 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +18 -14
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +3 -2
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +3 -2
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +3 -2
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +3 -2
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/MessageFormError/MesageFormError.css +0 -0
- package/dist/esm/components/molecules/MessageFormError/MesageFormError.d.ts +7 -0
- package/dist/esm/components/molecules/MessageFormError/MesageFormError.js +6 -0
- package/dist/esm/components/molecules/MessageFormError/MesageFormError.js.map +1 -0
- package/dist/esm/components/molecules/index.d.ts +1 -0
- package/dist/esm/components/molecules/index.js +1 -0
- package/dist/esm/components/molecules/index.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +3 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +4 -3
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +3 -2
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +3 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/assets/{index-L7r-Teuk.css → index--xgdaD5z.css} +60 -60
- package/dist/es/assets/{index-L7r-Teuk.css → index--xgdaD5z.css} +60 -60
package/dist/cjs/index.js
CHANGED
|
@@ -249,12 +249,16 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
249
249
|
}), children: jsxRuntime.jsx("ul", { children: options.map((action, index) => (jsxRuntime.jsx("li", { className: "truncate", onClick: () => onSelectAction(action), children: action.label }, index))) }) })] }));
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
function RlsMessageFormError({ className, formControl }) {
|
|
253
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: formControl?.wrong && (jsxRuntime.jsx("div", { className: className, children: jsxRuntime.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl?.error?.message }) })) }));
|
|
254
|
+
}
|
|
255
|
+
|
|
252
256
|
function RlsFieldMoney({ children, decimals, disabled, formControl, placeholder, symbol, rlsTheme, value, onValue }) {
|
|
253
257
|
return (jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-box', {
|
|
254
258
|
focused: formControl?.focused,
|
|
255
259
|
error: formControl?.wrong,
|
|
256
260
|
disabled: formControl?.disabled || disabled
|
|
257
|
-
}, 'rls-field-money'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsx("div", { className: "rls-field-box__body", children: jsxRuntime.jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }),
|
|
261
|
+
}, 'rls-field-money'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsx("div", { className: "rls-field-box__body", children: jsxRuntime.jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
258
262
|
}
|
|
259
263
|
|
|
260
264
|
function RlsFieldNumber({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }) {
|
|
@@ -262,7 +266,7 @@ function RlsFieldNumber({ children, disabled, formControl, placeholder, rlsTheme
|
|
|
262
266
|
focused: formControl?.focused,
|
|
263
267
|
error: formControl?.wrong,
|
|
264
268
|
disabled: formControl?.disabled || disabled
|
|
265
|
-
}, 'rls-field-number'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsx("div", { className: "rls-field-box__body", children: jsxRuntime.jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }),
|
|
269
|
+
}, 'rls-field-number'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsx("div", { className: "rls-field-box__body", children: jsxRuntime.jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
266
270
|
}
|
|
267
271
|
|
|
268
272
|
function RlsFieldPassword({ children, disabled, formControl, placeholder, rlsTheme }) {
|
|
@@ -274,7 +278,7 @@ function RlsFieldPassword({ children, disabled, formControl, placeholder, rlsThe
|
|
|
274
278
|
focused: formControl?.focused,
|
|
275
279
|
error: formControl?.wrong,
|
|
276
280
|
disabled: formControl?.disabled || disabled
|
|
277
|
-
}, 'rls-field-password'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__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 })] }) }),
|
|
281
|
+
}, 'rls-field-password'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__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 })] }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
278
282
|
}
|
|
279
283
|
|
|
280
284
|
function RlsFieldText({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }) {
|
|
@@ -282,7 +286,7 @@ function RlsFieldText({ children, disabled, formControl, placeholder, rlsTheme,
|
|
|
282
286
|
focused: formControl?.focused,
|
|
283
287
|
error: formControl?.wrong,
|
|
284
288
|
disabled: formControl?.disabled || disabled
|
|
285
|
-
}, 'rls-field-text'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsx("div", { className: "rls-field-box__body", children: jsxRuntime.jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }),
|
|
289
|
+
}, 'rls-field-text'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsx("div", { className: "rls-field-box__body", children: jsxRuntime.jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
286
290
|
}
|
|
287
291
|
|
|
288
292
|
function RlsLabelCheckBox({ children, disabled, extended, formControl, rlsTheme }) {
|
|
@@ -1597,7 +1601,7 @@ function RlsFieldAutocompleteTemplate({ suggestions, children, disabled, formCon
|
|
|
1597
1601
|
disabled,
|
|
1598
1602
|
focused: listControl.focused,
|
|
1599
1603
|
selected: !!listControl.value
|
|
1600
|
-
}, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("label", { className: "rls-field-list__control", onClick: onClickControl, children: listControl.value ? (jsxRuntime.jsx("span", { className: "rls-field-list__control__description", children: listControl.value })) : (jsxRuntime.jsx("span", { className: "rls-field-list__control__placeholder", children: placeholder })) }), !hiddenIcon && listControl.value && (jsxRuntime.jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: "trash-2" }) }))] }) }),
|
|
1604
|
+
}, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("label", { className: "rls-field-list__control", onClick: onClickControl, children: listControl.value ? (jsxRuntime.jsx("span", { className: "rls-field-list__control__description", children: listControl.value })) : (jsxRuntime.jsx("span", { className: "rls-field-list__control__placeholder", children: placeholder })) }), !hiddenIcon && listControl.value && (jsxRuntime.jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: "trash-2" }) }))] }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
1601
1605
|
visible: listControl.visible,
|
|
1602
1606
|
hide: !listControl.visible,
|
|
1603
1607
|
higher: listControl.higher
|
|
@@ -1617,6 +1621,10 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
1617
1621
|
return `${minFormat} - ${maxFormat}`;
|
|
1618
1622
|
}
|
|
1619
1623
|
|
|
1624
|
+
function RlsModal({ children, visible, rlsTheme }) {
|
|
1625
|
+
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);
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1620
1628
|
const controlIsValid = (props) => {
|
|
1621
1629
|
const { state, validators } = props;
|
|
1622
1630
|
return validators.reduce((errors, validator) => {
|
|
@@ -1782,10 +1790,6 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
1782
1790
|
}), children: [jsxRuntime.jsx(RlsPickerDay, { formControl: dayControl, date: dateInitial, month: monthControl.state, year: yearControl.state, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntime.jsx(RlsPickerMonth, { formControl: monthControl, date: dateInitial, year: yearControl.state, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntime.jsx(RlsPickerYear, { formControl: yearControl, date: dateInitial, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntime.jsx("div", { className: renderClassStatus('rls-picker-date__footer', { automatic }), children: jsxRuntime.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntime.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntime.jsx(RlsButton, { type: "ghost", onClick: onCancel, children: reactI18n('dateActionCancel') }) }), jsxRuntime.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntime.jsx(RlsButton, { type: "ghost", onClick: onToday, disabled: dateOutRange({ date: today, maxDate, minDate }), children: reactI18n('dateActionToday') }) }), jsxRuntime.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntime.jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) })] }));
|
|
1783
1791
|
}
|
|
1784
1792
|
|
|
1785
|
-
function RlsModal({ children, visible, rlsTheme }) {
|
|
1786
|
-
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);
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
1793
|
function RlsFieldDate({ children, date, disabled, formControl, maxDate, minDate, onValue, placeholder, rlsTheme }) {
|
|
1790
1794
|
const today = new Date(); // Initial current date in component
|
|
1791
1795
|
const [value, setValue] = react.useState();
|
|
@@ -1822,7 +1826,7 @@ function RlsFieldDate({ children, date, disabled, formControl, maxDate, minDate,
|
|
|
1822
1826
|
setModalIsVisible(true);
|
|
1823
1827
|
}
|
|
1824
1828
|
}
|
|
1825
|
-
return (jsxRuntime.jsxs("div", { className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("input", { className: "rls-field-date__control", type: "text", value: value ? helpersDate.dateFormatTemplate(value, DATE_RANGE_FORMAT) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsxRuntime.jsx("button", { className: "rls-field-date__action", onClick: onClean, disabled: disabled, children: jsxRuntime.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }),
|
|
1829
|
+
return (jsxRuntime.jsxs("div", { className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("input", { className: "rls-field-date__control", type: "text", value: value ? helpersDate.dateFormatTemplate(value, DATE_RANGE_FORMAT) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsxRuntime.jsx("button", { className: "rls-field-date__action", onClick: onClean, disabled: disabled, children: jsxRuntime.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }), jsxRuntime.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntime.jsx(RlsPickerDate, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value, type }) => {
|
|
1826
1830
|
if (type !== PickerListenerType.Cancel) {
|
|
1827
1831
|
onChange(value, true);
|
|
1828
1832
|
}
|
|
@@ -1908,7 +1912,7 @@ function RlsFieldDateRange({ children, date: datePicker, disabled, formControl,
|
|
|
1908
1912
|
setModalIsVisible(true);
|
|
1909
1913
|
}
|
|
1910
1914
|
}
|
|
1911
|
-
return (jsxRuntime.jsxs("div", { className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("input", { className: "rls-field-date-range__control", type: "text", value: value ? rangeFormatTemplate(value) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsxRuntime.jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: disabled, children: jsxRuntime.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) })] }), jsxRuntime.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntime.jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
|
|
1915
|
+
return (jsxRuntime.jsxs("div", { className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("input", { className: "rls-field-date-range__control", type: "text", value: value ? rangeFormatTemplate(value) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsxRuntime.jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: disabled, children: jsxRuntime.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }), jsxRuntime.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntime.jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
|
|
1912
1916
|
if (value) {
|
|
1913
1917
|
setValue(value);
|
|
1914
1918
|
}
|
|
@@ -2037,7 +2041,7 @@ function RlsFieldSelectTemplate({ suggestions, children, disabled, formControl,
|
|
|
2037
2041
|
});
|
|
2038
2042
|
return (jsxRuntime.jsxs("div", { ref: listControl.boxContentRef, className: renderClassStatus('rls-field-box', { focused: listControl.focused, disabled }, 'rls-field-list rls-field-select'), "rls-theme": rlsTheme, children: [children && jsxRuntime.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntime.jsx("div", { className: "rls-field-box__component", children: jsxRuntime.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntime.jsx("input", { ref: listControl.inputRef, className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: listControl.value, onFocus: onFocusInput, onBlur: onBlurInput, onClick: onClickInput, onKeyDown: onKeydownInput }), jsxRuntime.jsx("button", { className: renderClassStatus('rls-field-list__action', {
|
|
2039
2043
|
visible: listControl.visible
|
|
2040
|
-
}), disabled: disabled, onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-down" }) })] }) }),
|
|
2044
|
+
}), disabled: disabled, onClick: onClickAction, children: jsxRuntime.jsx(RlsIcon, { value: "arrow-ios-down" }) })] }) }), jsxRuntime.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), jsxRuntime.jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
2041
2045
|
visible: listControl.visible,
|
|
2042
2046
|
hide: !listControl.visible,
|
|
2043
2047
|
higher: listControl.higher
|
|
@@ -2156,6 +2160,7 @@ exports.RlsLabel = RlsLabel;
|
|
|
2156
2160
|
exports.RlsLabelCheckBox = RlsLabelCheckBox;
|
|
2157
2161
|
exports.RlsLabelRadioButton = RlsLabelRadioButton;
|
|
2158
2162
|
exports.RlsLabelSwitch = RlsLabelSwitch;
|
|
2163
|
+
exports.RlsMessageFormError = RlsMessageFormError;
|
|
2159
2164
|
exports.RlsMessageIcon = RlsMessageIcon;
|
|
2160
2165
|
exports.RlsModal = RlsModal;
|
|
2161
2166
|
exports.RlsPagination = RlsPagination;
|