@rolster/react-components 18.23.8 → 18.23.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.
@@ -705,6 +705,12 @@
705
705
  opacity: 0.5;
706
706
  } /*# sourceMappingURL=InputPassword.css.map */
707
707
 
708
+ .rls-input-percentage {
709
+ position: relative;
710
+ width: 100%;
711
+ box-sizing: border-box;
712
+ } /*# sourceMappingURL=InputPercentage.css.map */
713
+
708
714
  .rls-input-search {
709
715
  --rlc-input-height: var(--rls-sizing-x14);
710
716
  position: relative;
@@ -1251,6 +1257,13 @@
1251
1257
  z-index: 2;
1252
1258
  } /*# sourceMappingURL=FieldPassword.css.map */
1253
1259
 
1260
+ .rls-field-percentage {
1261
+ --rlc-fieldbox-body-padding: var(--rls-sizing-x4);
1262
+ position: relative;
1263
+ width: 100%;
1264
+ box-sizing: border-box;
1265
+ } /*# sourceMappingURL=FieldPercentage.css.map */
1266
+
1254
1267
  .rls-field-readonly {
1255
1268
  --rlc-fieldbox-body-padding: var(--rls-sizing-x4);
1256
1269
  --pvt-font-color: var(--rlc-input-font-color, var(--rls-app-color-900));
package/dist/es/index.js CHANGED
@@ -1563,6 +1563,16 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
1563
1563
  return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, children: jsxRuntimeExports.jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type ?? 'password', placeholder: placeholder, disabled: disabled, readOnly: readOnly, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, onKeyDown: _onKeyDown, onKeyUp: _onKeyUp }) }));
1564
1564
  }
1565
1565
 
1566
+ function RlsInputPercentage(props) {
1567
+ const { formControl, identifier, onValue, value } = props;
1568
+ const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
1569
+ const onValueInput = useCallback((value) => {
1570
+ !formControl && setValueInput(value);
1571
+ onValue && onValue(value);
1572
+ }, [formControl, onValue]);
1573
+ return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-percentage", children: jsxRuntimeExports.jsxs(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: [formControl?.value ?? valueInput, "%"] }) }));
1574
+ }
1575
+
1566
1576
  function RlsInputSearch({ formControl, identifier, onEnter, onSearch, placeholder }) {
1567
1577
  const [value, setValue] = useState('');
1568
1578
  const onValue = useCallback((value) => {
@@ -1860,6 +1870,24 @@ function RlsFieldPassword(props) {
1860
1870
  return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputPassword, { ...props, type: password ? 'password' : 'text' }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
1861
1871
  }
1862
1872
 
1873
+ function RlsFieldPercentage(props) {
1874
+ const { children, disabled, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
1875
+ const className = useMemo(() => {
1876
+ const _disabled = formControl?.disabled || disabled;
1877
+ return renderClassStatus('rls-field-box', {
1878
+ focused: formControl?.focused && !_disabled,
1879
+ error: formControl?.wrong,
1880
+ disabled: _disabled
1881
+ }, 'rls-field-percentage');
1882
+ }, [
1883
+ formControl?.focused,
1884
+ formControl?.wrong,
1885
+ formControl?.disabled,
1886
+ disabled
1887
+ ]);
1888
+ return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputPercentage, { ...props }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
1889
+ }
1890
+
1863
1891
  function RlsFieldReadonly({ children, identifier, rlsTheme, value }) {
1864
1892
  return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-readonly rls-field-box", "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx("input", { className: "rls-input__component", autoComplete: "off", type: 'text', readOnly: true, value: value }) }) })] }));
1865
1893
  }
@@ -3458,7 +3486,8 @@ function RlsImageEditor(props) {
3458
3486
  const context = refCanvas.current.getContext('2d', {
3459
3487
  willReadFrequently: true
3460
3488
  });
3461
- const { height, width } = calculateImgDimension(image.current, props.maxDimension || 500);
3489
+ const width = image.current.width;
3490
+ const height = image.current.height;
3462
3491
  refCanvas.current.width = width;
3463
3492
  refCanvas.current.height = height;
3464
3493
  context?.drawImage(image.current, 0, 0, width, height);
@@ -3723,5 +3752,5 @@ function useDatatable() {
3723
3752
  return { scrolleable, tableRef };
3724
3753
  }
3725
3754
 
3726
- export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useImageEditorController, useListController, useRelocationOnComponent, useResize, useSnackbar };
3755
+ export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, 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 };
3727
3756
  //# sourceMappingURL=index.js.map