@rolster/react-components 18.23.9 → 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/cjs/index.js CHANGED
@@ -1565,6 +1565,16 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
1565
1565
  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 }) }));
1566
1566
  }
1567
1567
 
1568
+ function RlsInputPercentage(props) {
1569
+ const { formControl, identifier, onValue, value } = props;
1570
+ const [valueInput, setValueInput] = require$$0.useState(formControl?.value ?? value ?? 0);
1571
+ const onValueInput = require$$0.useCallback((value) => {
1572
+ !formControl && setValueInput(value);
1573
+ onValue && onValue(value);
1574
+ }, [formControl, onValue]);
1575
+ 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, "%"] }) }));
1576
+ }
1577
+
1568
1578
  function RlsInputSearch({ formControl, identifier, onEnter, onSearch, placeholder }) {
1569
1579
  const [value, setValue] = require$$0.useState('');
1570
1580
  const onValue = require$$0.useCallback((value) => {
@@ -1862,6 +1872,24 @@ function RlsFieldPassword(props) {
1862
1872
  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 }))] }));
1863
1873
  }
1864
1874
 
1875
+ function RlsFieldPercentage(props) {
1876
+ const { children, disabled, formControl, identifier, msgErrorDisabled, rlsTheme } = props;
1877
+ const className = require$$0.useMemo(() => {
1878
+ const _disabled = formControl?.disabled || disabled;
1879
+ return renderClassStatus('rls-field-box', {
1880
+ focused: formControl?.focused && !_disabled,
1881
+ error: formControl?.wrong,
1882
+ disabled: _disabled
1883
+ }, 'rls-field-percentage');
1884
+ }, [
1885
+ formControl?.focused,
1886
+ formControl?.wrong,
1887
+ formControl?.disabled,
1888
+ disabled
1889
+ ]);
1890
+ 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 }))] }));
1891
+ }
1892
+
1865
1893
  function RlsFieldReadonly({ children, identifier, rlsTheme, value }) {
1866
1894
  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 }) }) })] }));
1867
1895
  }
@@ -3759,6 +3787,7 @@ exports.RlsFieldDateRange = RlsFieldDateRange;
3759
3787
  exports.RlsFieldMoney = RlsFieldMoney;
3760
3788
  exports.RlsFieldNumber = RlsFieldNumber;
3761
3789
  exports.RlsFieldPassword = RlsFieldPassword;
3790
+ exports.RlsFieldPercentage = RlsFieldPercentage;
3762
3791
  exports.RlsFieldReadonly = RlsFieldReadonly;
3763
3792
  exports.RlsFieldSelect = RlsFieldSelect;
3764
3793
  exports.RlsFieldSelectTemplate = RlsFieldSelectTemplate;
@@ -3772,6 +3801,7 @@ exports.RlsInput = RlsInput;
3772
3801
  exports.RlsInputMoney = RlsInputMoney;
3773
3802
  exports.RlsInputNumber = RlsInputNumber;
3774
3803
  exports.RlsInputPassword = RlsInputPassword;
3804
+ exports.RlsInputPercentage = RlsInputPercentage;
3775
3805
  exports.RlsInputSearch = RlsInputSearch;
3776
3806
  exports.RlsInputText = RlsInputText;
3777
3807
  exports.RlsLabel = RlsLabel;