@rolster/react-components 18.25.7 → 18.25.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets/{index-BR6Z9tba.css → index-DG6-q1c1.css} +11 -8
- package/dist/cjs/index.js +13 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-BR6Z9tba.css → index-DG6-q1c1.css} +11 -8
- package/dist/es/index.js +13 -13
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.css +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.css.map +1 -1
- package/dist/esm/components/atoms/{InputDouble/InputDouble.css → InputDecimal/InputDecimal.css} +3 -3
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.css.map +1 -0
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.d.ts +9 -0
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.js +21 -0
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.js.map +1 -0
- package/dist/esm/components/atoms/RadioButton/RadioButton.css +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.css.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.css +1 -1
- package/dist/esm/components/atoms/Switch/Switch.css.map +1 -1
- package/dist/esm/components/molecules/{FieldDouble/FieldDouble.css → FieldDecimal/FieldDecimal.css} +2 -2
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.css.map +1 -0
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.d.ts +9 -0
- package/dist/esm/components/molecules/{FieldDouble/FieldDouble.js → FieldDecimal/FieldDecimal.js} +6 -6
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js.map +1 -0
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.css +1 -0
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.css.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.css +1 -0
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.css.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.css +1 -0
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.css.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +2 -2
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/components/atoms/InputDouble/InputDouble.css.map +0 -1
- package/dist/esm/components/atoms/InputDouble/InputDouble.d.ts +0 -9
- package/dist/esm/components/atoms/InputDouble/InputDouble.js +0 -21
- package/dist/esm/components/atoms/InputDouble/InputDouble.js.map +0 -1
- package/dist/esm/components/molecules/FieldDouble/FieldDouble.css.map +0 -1
- package/dist/esm/components/molecules/FieldDouble/FieldDouble.d.ts +0 -9
- package/dist/esm/components/molecules/FieldDouble/FieldDouble.js.map +0 -1
|
@@ -515,7 +515,7 @@
|
|
|
515
515
|
transition: all 160ms 0ms var(--rls-standard-curve);
|
|
516
516
|
}
|
|
517
517
|
.rls-checkbox:hover {
|
|
518
|
-
cursor:
|
|
518
|
+
cursor: var(--rlc-checkbox-cursor, initial);
|
|
519
519
|
}
|
|
520
520
|
.rls-checkbox--checked {
|
|
521
521
|
--pvt-component-background: var(--rls-theme-color-200);
|
|
@@ -669,17 +669,17 @@
|
|
|
669
669
|
letter-spacing: var(--pvt-letter-spacing);
|
|
670
670
|
} /*# sourceMappingURL=Input.css.map */
|
|
671
671
|
|
|
672
|
-
.rls-input-
|
|
672
|
+
.rls-input-decimal {
|
|
673
673
|
--rlc-tabular-text-font-size: var(--rls-input-font-size);
|
|
674
674
|
--rlc-tabular-text-char-width: 5.25rem;
|
|
675
675
|
position: relative;
|
|
676
676
|
width: 100%;
|
|
677
677
|
box-sizing: border-box;
|
|
678
678
|
}
|
|
679
|
-
.rls-input-
|
|
679
|
+
.rls-input-decimal .rls-amount {
|
|
680
680
|
height: inherit;
|
|
681
681
|
align-items: center;
|
|
682
|
-
} /*# sourceMappingURL=
|
|
682
|
+
} /*# sourceMappingURL=InputDecimal.css.map */
|
|
683
683
|
|
|
684
684
|
.rls-input-money {
|
|
685
685
|
--rlc-tabular-text-font-size: var(--rls-input-font-size);
|
|
@@ -961,7 +961,7 @@
|
|
|
961
961
|
transition: all 160ms 0ms var(--rls-standard-curve);
|
|
962
962
|
}
|
|
963
963
|
.rls-radiobutton:hover {
|
|
964
|
-
cursor:
|
|
964
|
+
cursor: var(--rlc-radiobutton-cursor, initial);
|
|
965
965
|
}
|
|
966
966
|
.rls-radiobutton--checked {
|
|
967
967
|
--pvt-component-background: var(--rls-theme-color-200);
|
|
@@ -1021,7 +1021,7 @@
|
|
|
1021
1021
|
max-width: var(--rlc-switch-max-width, var(--rls-sizing-x20));
|
|
1022
1022
|
}
|
|
1023
1023
|
.rls-switch:hover {
|
|
1024
|
-
cursor:
|
|
1024
|
+
cursor: var(--rlc-switch-cursor, initial);
|
|
1025
1025
|
}
|
|
1026
1026
|
.rls-switch--checked {
|
|
1027
1027
|
--pvt-element-left: calc(100% - var(--pvt-element-size));
|
|
@@ -1266,12 +1266,12 @@
|
|
|
1266
1266
|
color: var(--rls-app-color-900);
|
|
1267
1267
|
} /*# sourceMappingURL=ButtonToggle.css.map */
|
|
1268
1268
|
|
|
1269
|
-
.rls-field-
|
|
1269
|
+
.rls-field-decimal {
|
|
1270
1270
|
--rlc-fieldbox-body-padding: var(--rls-sizing-x4);
|
|
1271
1271
|
position: relative;
|
|
1272
1272
|
width: 100%;
|
|
1273
1273
|
box-sizing: border-box;
|
|
1274
|
-
} /*# sourceMappingURL=
|
|
1274
|
+
} /*# sourceMappingURL=FieldDecimal.css.map */
|
|
1275
1275
|
|
|
1276
1276
|
.rls-field-money {
|
|
1277
1277
|
--rlc-fieldbox-body-padding: var(--rls-sizing-x4);
|
|
@@ -1333,6 +1333,7 @@
|
|
|
1333
1333
|
} /*# sourceMappingURL=FieldText.css.map */
|
|
1334
1334
|
|
|
1335
1335
|
.rls-label-checkbox {
|
|
1336
|
+
--rlc-switch-cursor: pointer;
|
|
1336
1337
|
--pvt-text-opacity: 1;
|
|
1337
1338
|
--pvt-text-height: var(--rls-sizing-x12);
|
|
1338
1339
|
--pvt-text-overflow: hidden;
|
|
@@ -1375,6 +1376,7 @@
|
|
|
1375
1376
|
} /*# sourceMappingURL=LabelCheckBox.css.map */
|
|
1376
1377
|
|
|
1377
1378
|
.rls-label-radiobutton {
|
|
1379
|
+
--rlc-switch-cursor: pointer;
|
|
1378
1380
|
--pvt-text-opacity: 1;
|
|
1379
1381
|
--pvt-text-height: var(--rls-sizing-x12);
|
|
1380
1382
|
--pvt-text-overflow: hidden;
|
|
@@ -1417,6 +1419,7 @@
|
|
|
1417
1419
|
} /*# sourceMappingURL=LabelRadioButton.css.map */
|
|
1418
1420
|
|
|
1419
1421
|
.rls-label-switch {
|
|
1422
|
+
--rlc-switch-cursor: pointer;
|
|
1420
1423
|
--pvt-text-opacity: 1;
|
|
1421
1424
|
--pvt-text-height: var(--rls-sizing-x12);
|
|
1422
1425
|
--pvt-text-overflow: hidden;
|
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import require$$0, { useMemo, useCallback, useState, useRef, useEffect, createContext } from 'react';
|
|
2
|
-
import { currencyFormat,
|
|
2
|
+
import { currencyFormat, BigDecimal, valueIsDefined, SealedPartial } from '@rolster/commons';
|
|
3
3
|
import { i18n, i18nSubscribe } from '@rolster/i18n';
|
|
4
4
|
import { PaginationController, verifyDayPicker, createDayPicker, createDayRangePicker, verifyMonthPicker, createMonthPicker, monthLimitTemplate, createYearPicker, verifyYearPicker, ListCollection, locationListCanTop, navigationListFromInput, navigationListFromElement, createAutocompleteStore, dateOutRange, verifyDateRange, PickerListenerEvent } from '@rolster/components';
|
|
5
5
|
import { DAY_LABELS, DateRange, normalizeMinTime, assignDayInDate, dateIsBefore, dateFormatTemplate, MONTH_NAMES, Month, assignYearInDate, assignMonthInDate } from '@rolster/dates';
|
|
@@ -1516,19 +1516,19 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
1516
1516
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("input", { ref: formControl?.elementRef, className: "rls-input__component", autoComplete: "off", type: type ?? 'text', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, onKeyDown: _onKeyDown, onKeyUp: _onKeyUp, value: valueInput }), jsxRuntimeExports.jsx("span", { className: "rls-input__value", children: children })] }));
|
|
1517
1517
|
}
|
|
1518
1518
|
|
|
1519
|
-
function
|
|
1519
|
+
function RlsInputDecimal(props) {
|
|
1520
1520
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
1521
|
-
const [valueInput, setValueInput] = useState((formControl?.value ?? value ??
|
|
1521
|
+
const [valueInput, setValueInput] = useState((formControl?.value ?? value ?? BigDecimal.zero()).rounded);
|
|
1522
1522
|
const amount = useMemo(() => {
|
|
1523
|
-
return formControl?.value?.
|
|
1523
|
+
return formControl?.value?.rounded ?? valueInput;
|
|
1524
1524
|
}, [formControl?.value, valueInput]);
|
|
1525
1525
|
const onValueInput = useCallback((value) => {
|
|
1526
|
-
const
|
|
1527
|
-
formControl ? formControl.setValue(
|
|
1528
|
-
onValue && onValue(
|
|
1526
|
+
const valueDecimal = BigDecimal.create(value);
|
|
1527
|
+
formControl ? formControl.setValue(valueDecimal) : setValueInput(value);
|
|
1528
|
+
onValue && onValue(valueDecimal);
|
|
1529
1529
|
}, [formControl, onValue]);
|
|
1530
1530
|
const doubleProps = { ...props, formControl: undefined };
|
|
1531
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-
|
|
1531
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-decimal", children: jsxRuntimeExports.jsx(RlsInput, { ...doubleProps, type: "number", value: valueInput, onValue: onValueInput, children: jsxRuntimeExports.jsx(RlsAmount, { value: amount, symbol: symbol, decimals: decimals }) }) }));
|
|
1532
1532
|
}
|
|
1533
1533
|
|
|
1534
1534
|
function RlsInputMoney(props) {
|
|
@@ -1837,7 +1837,7 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1837
1837
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: formControl?.wrong && (jsxRuntimeExports.jsx("div", { className: className, children: jsxRuntimeExports.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: msgError }) })) }));
|
|
1838
1838
|
}
|
|
1839
1839
|
|
|
1840
|
-
function
|
|
1840
|
+
function RlsFieldDecimal(props) {
|
|
1841
1841
|
const { children, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
|
|
1842
1842
|
const disabled = useMemo(() => {
|
|
1843
1843
|
return formControl?.disabled || props.disabled;
|
|
@@ -1848,9 +1848,9 @@ function RlsFieldDouble(props) {
|
|
|
1848
1848
|
error: formControl?.wrong,
|
|
1849
1849
|
disabled,
|
|
1850
1850
|
readonly: props.readOnly
|
|
1851
|
-
}, 'rls-field-
|
|
1851
|
+
}, 'rls-field-decimal');
|
|
1852
1852
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1853
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(
|
|
1853
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputDecimal, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1854
1854
|
}
|
|
1855
1855
|
|
|
1856
1856
|
function RlsFieldMoney(props) {
|
|
@@ -2473,7 +2473,7 @@ const reactI18n = i18n({
|
|
|
2473
2473
|
}
|
|
2474
2474
|
});
|
|
2475
2475
|
|
|
2476
|
-
class ConfirmationResult extends
|
|
2476
|
+
class ConfirmationResult extends SealedPartial {
|
|
2477
2477
|
static approved() {
|
|
2478
2478
|
return new ConfirmationResult('approved');
|
|
2479
2479
|
}
|
|
@@ -3855,5 +3855,5 @@ function useDatatable() {
|
|
|
3855
3855
|
return { scrolleable, tableRef };
|
|
3856
3856
|
}
|
|
3857
3857
|
|
|
3858
|
-
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange,
|
|
3858
|
+
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalSheet, RlsNavbar, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, calculateImgDimension, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useImageEditorController, useListController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3859
3859
|
//# sourceMappingURL=index.js.map
|