@pdg/react-form 1.2.16 → 1.2.18

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.
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PFormRadioGroupProps, PFormRadioGroupSingleValue, PFormRadioGroupItems } from './PFormRadioGroup.types';
3
+ import './PFormRadioGroup.scss';
3
4
  declare function PFormRadioGroup<BaseValue extends PFormRadioGroupSingleValue, Items extends PFormRadioGroupItems<BaseValue> = PFormRadioGroupItems<BaseValue>>({ ref,
4
5
  /********************************************************************************************************************/
5
6
  variant: initVariant, size: initSize, color: initColor, focused: initFocused, fullWidth: initFullWidth, hidden: initHidden, startAdornment, endAdornment,
package/dist/index.esm.js CHANGED
@@ -4743,24 +4743,28 @@ var PFormMobile = function PFormMobile(t0) {
4743
4743
  t4 = $[11];
4744
4744
  }
4745
4745
  return t4;
4746
- };var _excluded$p = ["onChange"];
4746
+ };var _excluded$p = ["ref", "onChange"];
4747
4747
  var NumberFormatCustom = function NumberFormatCustom(t0) {
4748
- var $ = c(8);
4748
+ var $ = c(10);
4749
4749
  var onChange;
4750
4750
  var props;
4751
+ var ref;
4751
4752
  if ($[0] !== t0) {
4752
4753
  var _t = t0;
4754
+ ref = _t.ref;
4753
4755
  onChange = _t.onChange;
4754
4756
  props = _objectWithoutProperties(_t, _excluded$p);
4755
4757
  $[0] = t0;
4756
4758
  $[1] = onChange;
4757
4759
  $[2] = props;
4760
+ $[3] = ref;
4758
4761
  } else {
4759
4762
  onChange = $[1];
4760
4763
  props = $[2];
4764
+ ref = $[3];
4761
4765
  }
4762
4766
  var t1;
4763
- if ($[3] !== onChange) {
4767
+ if ($[4] !== onChange) {
4764
4768
  t1 = function t1(values) {
4765
4769
  if (onChange) {
4766
4770
  onChange({
@@ -4770,21 +4774,23 @@ var NumberFormatCustom = function NumberFormatCustom(t0) {
4770
4774
  });
4771
4775
  }
4772
4776
  };
4773
- $[3] = onChange;
4774
- $[4] = t1;
4777
+ $[4] = onChange;
4778
+ $[5] = t1;
4775
4779
  } else {
4776
- t1 = $[4];
4780
+ t1 = $[5];
4777
4781
  }
4778
4782
  var t2;
4779
- if ($[5] !== props || $[6] !== t1) {
4783
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
4780
4784
  t2 = /*#__PURE__*/React.createElement(NumericFormat, _extends({}, props, {
4785
+ getInputRef: ref,
4781
4786
  onValueChange: t1
4782
4787
  }));
4783
- $[5] = props;
4784
- $[6] = t1;
4785
- $[7] = t2;
4788
+ $[6] = props;
4789
+ $[7] = ref;
4790
+ $[8] = t1;
4791
+ $[9] = t2;
4786
4792
  } else {
4787
- t2 = $[7];
4793
+ t2 = $[9];
4788
4794
  }
4789
4795
  return t2;
4790
4796
  };var _excluded$o = ["ref", "className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "labelShrink", "clear", "slotProps", "value", "onChange", "onValue", "onValidate"];
@@ -7385,7 +7391,7 @@ var PFormCheckbox = function PFormCheckbox(t0) {
7385
7391
  };
7386
7392
  function _temp$q() {
7387
7393
  return "PFormCheckbox";
7388
- }var _excluded$g = ["ref", "variant", "size", "color", "focused", "fullWidth", "hidden", "startAdornment", "endAdornment", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "data", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"];
7394
+ }insertStyle(".PFormRadioGroup .PFormRadioGroup-Item.PFormRadioGroup-Item--error .MuiTypography-root{color:var(--error-color) !important}");var _excluded$g = ["ref", "variant", "size", "color", "focused", "fullWidth", "hidden", "startAdornment", "endAdornment", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "data", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"];
7389
7395
  var PADDING_LEFT = 3;
7390
7396
  function PFormRadioGroup(t0) {
7391
7397
  var $ = c(272);
@@ -7528,6 +7534,7 @@ function PFormRadioGroup(t0) {
7528
7534
  }
7529
7535
  var inline = t1 === undefined ? true : t1;
7530
7536
  var id = useId();
7537
+ var theme = useTheme();
7531
7538
  var _useFormState = useFormState(),
7532
7539
  formVariant = _useFormState.variant,
7533
7540
  formSize = _useFormState.size,
@@ -7544,7 +7551,6 @@ function PFormRadioGroup(t0) {
7544
7551
  var size = initSize !== null && initSize !== void 0 ? initSize : formSize;
7545
7552
  var color = initColor !== null && initColor !== void 0 ? initColor : formColor;
7546
7553
  var focused = initFocused !== null && initFocused !== void 0 ? initFocused : formFocused;
7547
- var theme = useTheme();
7548
7554
  var initValueRef = useAutoUpdateRef(initValue);
7549
7555
  var baseRef = useRef(null);
7550
7556
  var firstInputRef = useRef(null);
@@ -8336,6 +8342,7 @@ function PFormRadioGroup(t0) {
8336
8342
  itemDisabled_0 = t57.disabled;
8337
8343
  return /*#__PURE__*/React.createElement(FormControlLabel, {
8338
8344
  key: idx_0,
8345
+ className: classNames("PFormRadioGroup-Item", error && "PFormRadioGroup-Item--error"),
8339
8346
  control: /*#__PURE__*/React.createElement(Radio, {
8340
8347
  icon: /*#__PURE__*/React.createElement(RadioButtonUnchecked, {
8341
8348
  color: error ? "error" : undefined
@@ -8353,10 +8360,11 @@ function PFormRadioGroup(t0) {
8353
8360
  }),
8354
8361
  label: label_1,
8355
8362
  style: {
8356
- color: error ? theme.palette.error.main : "",
8357
8363
  whiteSpace: "nowrap",
8358
8364
  marginTop: -5,
8359
- marginBottom: -5
8365
+ marginBottom: -5,
8366
+ color: error ? theme.palette.error.main : undefined,
8367
+ opacity: error && (disabled || readOnly || itemDisabled_0) ? 0.5 : 1
8360
8368
  },
8361
8369
  value: value_4,
8362
8370
  disabled: disabled || readOnly || itemDisabled_0
@@ -8679,7 +8687,7 @@ function PFormRadioGroup(t0) {
8679
8687
  function _temp$p() {
8680
8688
  return "PFormRadioGroup";
8681
8689
  }insertStyle(".PFormToggleButtonGroup.loading .PFormItemBase-Control-wrap .PFormItemBase-Control{align-items:center !important}.PFormToggleButtonGroup .ToggleButton{display:inline-flex;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-items:center}.PFormToggleButtonGroup .ToggleButton .__label__{height:0;line-height:0 !important;overflow:visible !important}.PFormToggleButtonGroup.type-checkbox .ToggleButton,.PFormToggleButtonGroup.type-radio .ToggleButton{padding-left:3px;padding-right:5px;border:0 !important;margin-left:0 !important;justify-content:flex-start;display:flex;background-color:rgba(0,0,0,0) !important}.PFormToggleButtonGroup.type-checkbox .ToggleButton:not(:last-child),.PFormToggleButtonGroup.type-radio .ToggleButton:not(:last-child){margin-right:5px}.PFormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-checked__,.PFormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-unchecked__,.PFormToggleButtonGroup.type-radio .ToggleButton .__checkbox-checked__,.PFormToggleButtonGroup.type-radio .ToggleButton .__checkbox-unchecked__{margin-right:3px}.PFormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-checked__,.PFormToggleButtonGroup.type-radio .ToggleButton .__checkbox-checked__{display:none}.PFormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected.Mui-disabled,.PFormToggleButtonGroup.type-radio .ToggleButton.Mui-selected.Mui-disabled{opacity:.5}.PFormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected .__checkbox-checked__,.PFormToggleButtonGroup.type-radio .ToggleButton.Mui-selected .__checkbox-checked__{display:block}.PFormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected .__checkbox-unchecked__,.PFormToggleButtonGroup.type-radio .ToggleButton.Mui-selected .__checkbox-unchecked__{display:none}.PFormToggleButtonGroup:not(.with-label).variant-outlined .PFormItemBase-Control-wrap{margin-top:15px;margin-bottom:-15px}.PFormToggleButtonGroup:not(.with-label).variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup:not(.with-label).variant-filled .PFormItemBase-Control-wrap{margin-top:15px;margin-bottom:-15px}.PFormToggleButtonGroup:not(.with-label).variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup:not(.with-label).variant-standard .PFormItemBase-Control-wrap{margin-top:0px;margin-bottom:0px}.PFormToggleButtonGroup:not(.with-label).variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:28px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-outlined .PFormItemBase-Control-wrap{margin-top:13px;margin-bottom:-13px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:24px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-filled .PFormItemBase-Control-wrap{margin-top:13px;margin-bottom:-13px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:31px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-standard .PFormItemBase-Control-wrap{margin-top:0px;margin-bottom:0px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:26px}.PFormToggleButtonGroup.with-label.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup.with-label.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup.with-label.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:28px}.PFormToggleButtonGroup.with-label.size-small.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.size-small.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:24px}.PFormToggleButtonGroup.with-label.size-small.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.size-small.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:31px}.PFormToggleButtonGroup.with-label.size-small.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.size-small.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:26px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:28px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:24px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:31px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:26px}");function PFormToggleButtonGroup(t0) {
8682
- var $ = c(237);
8690
+ var $ = c(236);
8683
8691
  var ref = t0.ref,
8684
8692
  initVariant = t0.variant,
8685
8693
  initSize = t0.size,
@@ -9595,30 +9603,18 @@ function _temp$p() {
9595
9603
  finalItemWidth = itemWidth || "auto";
9596
9604
  }
9597
9605
  }
9598
- var t60 = error ? theme.palette.error.main : "";
9599
- var t61 = error ? theme.palette.error.main : "";
9600
- var t62;
9601
- if ($[160] !== finalItemWidth || $[161] !== t60 || $[162] !== t61) {
9602
- t62 = {
9606
+ var t60 = error ? theme.palette.error.main : undefined;
9607
+ var t61;
9608
+ if ($[160] !== color || $[161] !== disabled || $[162] !== error || $[163] !== finalItemWidth || $[164] !== initFocused || $[165] !== items || $[166] !== readOnly || $[167] !== refForButtonResizeHeightDetect || $[168] !== size || $[169] !== t60 || $[170] !== theme || $[171] !== type) {
9609
+ var buttonStyle = {
9603
9610
  borderColor: t60,
9604
- color: t61,
9605
9611
  width: finalItemWidth
9606
9612
  };
9607
- $[160] = finalItemWidth;
9608
- $[161] = t60;
9609
- $[162] = t61;
9610
- $[163] = t62;
9611
- } else {
9612
- t62 = $[163];
9613
- }
9614
- var buttonStyle = t62;
9615
- var t63;
9616
- if ($[164] !== buttonStyle || $[165] !== color || $[166] !== disabled || $[167] !== initFocused || $[168] !== items || $[169] !== readOnly || $[170] !== refForButtonResizeHeightDetect || $[171] !== size || $[172] !== type) {
9617
- t63 = items && items.map(function (t64, idx) {
9618
- var value_3 = t64.value,
9619
- label_0 = t64.label,
9620
- itemDisabled = t64.disabled,
9621
- itemColor = t64.color;
9613
+ t61 = items && items.map(function (t62, idx) {
9614
+ var value_3 = t62.value,
9615
+ label_0 = t62.label,
9616
+ itemDisabled = t62.disabled,
9617
+ itemColor = t62.color;
9622
9618
  return /*#__PURE__*/React.createElement(ToggleButton, {
9623
9619
  ref: function ref(ref_0) {
9624
9620
  if (idx === 0) {
@@ -9631,7 +9627,9 @@ function _temp$p() {
9631
9627
  value: value_3,
9632
9628
  color: itemColor || color,
9633
9629
  disabled: disabled || readOnly || itemDisabled,
9634
- style: buttonStyle,
9630
+ style: _objectSpread2(_objectSpread2({}, buttonStyle), {}, {
9631
+ color: disabled || readOnly || itemDisabled ? error ? theme.alpha(theme.palette.error.main, 0.5) : undefined : error ? theme.palette.error.main : undefined
9632
+ }),
9635
9633
  onFocus: function onFocus() {
9636
9634
  return setFocused(initFocused || true);
9637
9635
  },
@@ -9650,24 +9648,27 @@ function _temp$p() {
9650
9648
  className: "__label__"
9651
9649
  }, label_0));
9652
9650
  });
9653
- $[164] = buttonStyle;
9654
- $[165] = color;
9655
- $[166] = disabled;
9656
- $[167] = initFocused;
9657
- $[168] = items;
9658
- $[169] = readOnly;
9659
- $[170] = refForButtonResizeHeightDetect;
9660
- $[171] = size;
9661
- $[172] = type;
9662
- $[173] = t63;
9651
+ $[160] = color;
9652
+ $[161] = disabled;
9653
+ $[162] = error;
9654
+ $[163] = finalItemWidth;
9655
+ $[164] = initFocused;
9656
+ $[165] = items;
9657
+ $[166] = readOnly;
9658
+ $[167] = refForButtonResizeHeightDetect;
9659
+ $[168] = size;
9660
+ $[169] = t60;
9661
+ $[170] = theme;
9662
+ $[171] = type;
9663
+ $[172] = t61;
9663
9664
  } else {
9664
- t63 = $[173];
9665
+ t61 = $[172];
9665
9666
  }
9666
- var buttons = t63;
9667
+ var buttons = t61;
9667
9668
  var newRealValue = value_2 == null ? null : value_2;
9668
9669
  if (items && value_2 != null) {
9669
9670
  if (Array.isArray(newRealValue)) {
9670
- if ($[174] !== items || $[175] !== multiple || $[176] !== newRealValue) {
9671
+ if ($[173] !== items || $[174] !== multiple || $[175] !== newRealValue) {
9671
9672
  var stringRealValues = newRealValue.map(_temp3$1);
9672
9673
  if (multiple) {
9673
9674
  var foundItems = items.filter(function (v_2) {
@@ -9675,42 +9676,42 @@ function _temp$p() {
9675
9676
  });
9676
9677
  newRealValue = foundItems.map(_temp4$1);
9677
9678
  }
9678
- $[174] = items;
9679
- $[175] = multiple;
9679
+ $[173] = items;
9680
+ $[174] = multiple;
9681
+ $[175] = newRealValue;
9680
9682
  $[176] = newRealValue;
9681
- $[177] = newRealValue;
9682
9683
  } else {
9683
- newRealValue = $[177];
9684
+ newRealValue = $[176];
9684
9685
  }
9685
9686
  } else {
9686
9687
  if (newRealValue != null) {
9687
9688
  var _t3;
9688
- if ($[178] !== newRealValue) {
9689
+ if ($[177] !== newRealValue) {
9689
9690
  _t3 = newRealValue.toString();
9690
- $[178] = newRealValue;
9691
- $[179] = _t3;
9691
+ $[177] = newRealValue;
9692
+ $[178] = _t3;
9692
9693
  } else {
9693
- _t3 = $[179];
9694
+ _t3 = $[178];
9694
9695
  }
9695
9696
  var stringRealValue = _t3;
9696
9697
  var _t4;
9697
- if ($[180] !== items || $[181] !== stringRealValue) {
9698
+ if ($[179] !== items || $[180] !== stringRealValue) {
9698
9699
  var _t5;
9699
- if ($[183] !== stringRealValue) {
9700
+ if ($[182] !== stringRealValue) {
9700
9701
  _t5 = function _t5(v_4) {
9701
9702
  return v_4.value.toString() === stringRealValue;
9702
9703
  };
9703
- $[183] = stringRealValue;
9704
- $[184] = _t5;
9704
+ $[182] = stringRealValue;
9705
+ $[183] = _t5;
9705
9706
  } else {
9706
- _t5 = $[184];
9707
+ _t5 = $[183];
9707
9708
  }
9708
9709
  _t4 = items.find(_t5);
9709
- $[180] = items;
9710
- $[181] = stringRealValue;
9711
- $[182] = _t4;
9710
+ $[179] = items;
9711
+ $[180] = stringRealValue;
9712
+ $[181] = _t4;
9712
9713
  } else {
9713
- _t4 = $[182];
9714
+ _t4 = $[181];
9714
9715
  }
9715
9716
  var foundItem = _t4;
9716
9717
  if (foundItem) {
@@ -9720,9 +9721,9 @@ function _temp$p() {
9720
9721
  }
9721
9722
  }
9722
9723
  var realValue_1 = newRealValue;
9723
- var t64;
9724
- if ($[185] !== buttons || $[186] !== disabled || $[187] !== endAdornment || $[188] !== formColWidth || $[189] !== fullWidth || $[190] !== handleChange || $[191] !== isOnGetItemLoading || $[192] !== items || $[193] !== label || $[194] !== labelId || $[195] !== loading || $[196] !== multiple || $[197] !== readOnly || $[198] !== realValue_1 || $[199] !== refForButtonResizeHeightDetect || $[200] !== refForButtonsResizeHeightDetect || $[201] !== refForLoadingResizeHeightDetect || $[202] !== refForResizeWidthDetect || $[203] !== size || $[204] !== startAdornment || $[205] !== type || $[206] !== width) {
9725
- t64 = isOnGetItemLoading || loading ? /*#__PURE__*/React.createElement("div", {
9724
+ var t62;
9725
+ if ($[184] !== buttons || $[185] !== disabled || $[186] !== endAdornment || $[187] !== formColWidth || $[188] !== fullWidth || $[189] !== handleChange || $[190] !== isOnGetItemLoading || $[191] !== items || $[192] !== label || $[193] !== labelId || $[194] !== loading || $[195] !== multiple || $[196] !== readOnly || $[197] !== realValue_1 || $[198] !== refForButtonResizeHeightDetect || $[199] !== refForButtonsResizeHeightDetect || $[200] !== refForLoadingResizeHeightDetect || $[201] !== refForResizeWidthDetect || $[202] !== size || $[203] !== startAdornment || $[204] !== type || $[205] !== width) {
9726
+ t62 = isOnGetItemLoading || loading ? /*#__PURE__*/React.createElement("div", {
9726
9727
  style: {
9727
9728
  opacity: 0.54
9728
9729
  },
@@ -9774,84 +9775,84 @@ function _temp$p() {
9774
9775
  visibility: "hidden"
9775
9776
  }
9776
9777
  }) : buttons)), endAdornment && /*#__PURE__*/React.createElement("div", null, endAdornment));
9777
- $[185] = buttons;
9778
- $[186] = disabled;
9779
- $[187] = endAdornment;
9780
- $[188] = formColWidth;
9781
- $[189] = fullWidth;
9782
- $[190] = handleChange;
9783
- $[191] = isOnGetItemLoading;
9784
- $[192] = items;
9785
- $[193] = label;
9786
- $[194] = labelId;
9787
- $[195] = loading;
9788
- $[196] = multiple;
9789
- $[197] = readOnly;
9790
- $[198] = realValue_1;
9791
- $[199] = refForButtonResizeHeightDetect;
9792
- $[200] = refForButtonsResizeHeightDetect;
9793
- $[201] = refForLoadingResizeHeightDetect;
9794
- $[202] = refForResizeWidthDetect;
9795
- $[203] = size;
9796
- $[204] = startAdornment;
9797
- $[205] = type;
9798
- $[206] = width;
9799
- $[207] = t64;
9800
- } else {
9801
- t64 = $[207];
9802
- }
9803
- var control = t64;
9778
+ $[184] = buttons;
9779
+ $[185] = disabled;
9780
+ $[186] = endAdornment;
9781
+ $[187] = formColWidth;
9782
+ $[188] = fullWidth;
9783
+ $[189] = handleChange;
9784
+ $[190] = isOnGetItemLoading;
9785
+ $[191] = items;
9786
+ $[192] = label;
9787
+ $[193] = labelId;
9788
+ $[194] = loading;
9789
+ $[195] = multiple;
9790
+ $[196] = readOnly;
9791
+ $[197] = realValue_1;
9792
+ $[198] = refForButtonResizeHeightDetect;
9793
+ $[199] = refForButtonsResizeHeightDetect;
9794
+ $[200] = refForLoadingResizeHeightDetect;
9795
+ $[201] = refForResizeWidthDetect;
9796
+ $[202] = size;
9797
+ $[203] = startAdornment;
9798
+ $[204] = type;
9799
+ $[205] = width;
9800
+ $[206] = t62;
9801
+ } else {
9802
+ t62 = $[206];
9803
+ }
9804
+ var control = t62;
9804
9805
  var controlHeight = height || 0;
9805
9806
  var isMultiline = controlHeight <= (realHeight !== null && realHeight !== void 0 ? realHeight : 0);
9806
- var t65 = "variant-".concat(variant);
9807
- var t66 = "size-".concat(size);
9808
- var t67 = !!label && "with-label";
9809
- var t68 = !!fullWidth && "full-width";
9810
- var t69 = "type-".concat(type);
9811
- var t70 = (isOnGetItemLoading || loading) && "loading";
9807
+ var t63 = "variant-".concat(variant);
9808
+ var t64 = "size-".concat(size);
9809
+ var t65 = !!label && "with-label";
9810
+ var t66 = !!fullWidth && "full-width";
9811
+ var t67 = "type-".concat(type);
9812
+ var t68 = (isOnGetItemLoading || loading) && "loading";
9813
+ var t69;
9814
+ if ($[207] !== className || $[208] !== t63 || $[209] !== t64 || $[210] !== t65 || $[211] !== t66 || $[212] !== t67 || $[213] !== t68) {
9815
+ t69 = classNames(className, "PFormValueItem", "PFormToggleButtonGroup", t63, t64, t65, t66, t67, t68);
9816
+ $[207] = className;
9817
+ $[208] = t63;
9818
+ $[209] = t64;
9819
+ $[210] = t65;
9820
+ $[211] = t66;
9821
+ $[212] = t67;
9822
+ $[213] = t68;
9823
+ $[214] = t69;
9824
+ } else {
9825
+ t69 = $[214];
9826
+ }
9827
+ var t70 = error ? errorHelperText : helperText;
9812
9828
  var t71;
9813
- if ($[208] !== className || $[209] !== t65 || $[210] !== t66 || $[211] !== t67 || $[212] !== t68 || $[213] !== t69 || $[214] !== t70) {
9814
- t71 = classNames(className, "PFormValueItem", "PFormToggleButtonGroup", t65, t66, t67, t68, t69, t70);
9815
- $[208] = className;
9816
- $[209] = t65;
9817
- $[210] = t66;
9818
- $[211] = t67;
9819
- $[212] = t68;
9820
- $[213] = t69;
9821
- $[214] = t70;
9822
- $[215] = t71;
9823
- } else {
9824
- t71 = $[215];
9825
- }
9826
- var t72 = error ? errorHelperText : helperText;
9827
- var t73;
9828
- if ($[216] === Symbol["for"]("react.memo_cache_sentinel")) {
9829
- t73 = {
9829
+ if ($[215] === Symbol["for"]("react.memo_cache_sentinel")) {
9830
+ t71 = {
9830
9831
  style: {
9831
9832
  marginLeft: 2
9832
9833
  }
9833
9834
  };
9834
- $[216] = t73;
9835
+ $[215] = t71;
9835
9836
  } else {
9836
- t73 = $[216];
9837
+ t71 = $[215];
9837
9838
  }
9838
- var t74;
9839
- if ($[217] === Symbol["for"]("react.memo_cache_sentinel")) {
9840
- t74 = {
9839
+ var t72;
9840
+ if ($[216] === Symbol["for"]("react.memo_cache_sentinel")) {
9841
+ t72 = {
9841
9842
  style: {
9842
9843
  marginLeft: 2
9843
9844
  }
9844
9845
  };
9845
- $[217] = t74;
9846
+ $[216] = t72;
9846
9847
  } else {
9847
- t74 = $[217];
9848
+ t72 = $[216];
9848
9849
  }
9849
- var t75 = realHeight ? realHeight + (isMultiline ? 13 : 0) : controlHeight;
9850
- var t76 = isMultiline ? false : isOnGetItemLoading || loading;
9851
- var t77;
9852
- if ($[218] !== color || $[219] !== control || $[220] !== error || $[221] !== errorHelperText || $[222] !== formControlBaseProps || $[223] !== fullWidth || $[224] !== hidden || $[225] !== label || $[226] !== labelIcon || $[227] !== required || $[228] !== size || $[229] !== style || $[230] !== sx || $[231] !== t71 || $[232] !== t72 || $[233] !== t75 || $[234] !== t76 || $[235] !== variant) {
9853
- t77 = /*#__PURE__*/React.createElement(PFormItemBase, _extends({}, formControlBaseProps, {
9854
- className: t71,
9850
+ var t73 = realHeight ? realHeight + (isMultiline ? 13 : 0) : controlHeight;
9851
+ var t74 = isMultiline ? false : isOnGetItemLoading || loading;
9852
+ var t75;
9853
+ if ($[217] !== color || $[218] !== control || $[219] !== error || $[220] !== errorHelperText || $[221] !== formControlBaseProps || $[222] !== fullWidth || $[223] !== hidden || $[224] !== label || $[225] !== labelIcon || $[226] !== required || $[227] !== size || $[228] !== style || $[229] !== sx || $[230] !== t69 || $[231] !== t70 || $[232] !== t73 || $[233] !== t74 || $[234] !== variant) {
9854
+ t75 = /*#__PURE__*/React.createElement(PFormItemBase, _extends({}, formControlBaseProps, {
9855
+ className: t69,
9855
9856
  variant: variant,
9856
9857
  size: size,
9857
9858
  color: color,
@@ -9860,41 +9861,41 @@ function _temp$p() {
9860
9861
  required: required,
9861
9862
  fullWidth: fullWidth,
9862
9863
  error: error,
9863
- helperText: t72,
9864
- helperTextProps: t73,
9864
+ helperText: t70,
9865
+ helperTextProps: t71,
9865
9866
  errorHelperText: errorHelperText,
9866
- errorHelperTextProps: t74,
9867
+ errorHelperTextProps: t72,
9867
9868
  style: style,
9868
9869
  sx: sx,
9869
9870
  hidden: hidden,
9870
9871
  autoSize: true,
9871
- controlHeight: t75,
9872
- controlVerticalCenter: t76,
9872
+ controlHeight: t73,
9873
+ controlVerticalCenter: t74,
9873
9874
  control: control
9874
9875
  }));
9875
- $[218] = color;
9876
- $[219] = control;
9877
- $[220] = error;
9878
- $[221] = errorHelperText;
9879
- $[222] = formControlBaseProps;
9880
- $[223] = fullWidth;
9881
- $[224] = hidden;
9882
- $[225] = label;
9883
- $[226] = labelIcon;
9884
- $[227] = required;
9885
- $[228] = size;
9886
- $[229] = style;
9887
- $[230] = sx;
9888
- $[231] = t71;
9889
- $[232] = t72;
9890
- $[233] = t75;
9891
- $[234] = t76;
9892
- $[235] = variant;
9893
- $[236] = t77;
9876
+ $[217] = color;
9877
+ $[218] = control;
9878
+ $[219] = error;
9879
+ $[220] = errorHelperText;
9880
+ $[221] = formControlBaseProps;
9881
+ $[222] = fullWidth;
9882
+ $[223] = hidden;
9883
+ $[224] = label;
9884
+ $[225] = labelIcon;
9885
+ $[226] = required;
9886
+ $[227] = size;
9887
+ $[228] = style;
9888
+ $[229] = sx;
9889
+ $[230] = t69;
9890
+ $[231] = t70;
9891
+ $[232] = t73;
9892
+ $[233] = t74;
9893
+ $[234] = variant;
9894
+ $[235] = t75;
9894
9895
  } else {
9895
- t77 = $[236];
9896
+ t75 = $[235];
9896
9897
  }
9897
- return t77;
9898
+ return t75;
9898
9899
  }
9899
9900
  function _temp4$1(v_3) {
9900
9901
  return v_3.value;
package/dist/index.js CHANGED
@@ -4743,24 +4743,28 @@ var PFormMobile = function PFormMobile(t0) {
4743
4743
  t4 = $[11];
4744
4744
  }
4745
4745
  return t4;
4746
- };var _excluded$p = ["onChange"];
4746
+ };var _excluded$p = ["ref", "onChange"];
4747
4747
  var NumberFormatCustom = function NumberFormatCustom(t0) {
4748
- var $ = compilerRuntime.c(8);
4748
+ var $ = compilerRuntime.c(10);
4749
4749
  var onChange;
4750
4750
  var props;
4751
+ var ref;
4751
4752
  if ($[0] !== t0) {
4752
4753
  var _t = t0;
4754
+ ref = _t.ref;
4753
4755
  onChange = _t.onChange;
4754
4756
  props = _objectWithoutProperties(_t, _excluded$p);
4755
4757
  $[0] = t0;
4756
4758
  $[1] = onChange;
4757
4759
  $[2] = props;
4760
+ $[3] = ref;
4758
4761
  } else {
4759
4762
  onChange = $[1];
4760
4763
  props = $[2];
4764
+ ref = $[3];
4761
4765
  }
4762
4766
  var t1;
4763
- if ($[3] !== onChange) {
4767
+ if ($[4] !== onChange) {
4764
4768
  t1 = function t1(values) {
4765
4769
  if (onChange) {
4766
4770
  onChange({
@@ -4770,21 +4774,23 @@ var NumberFormatCustom = function NumberFormatCustom(t0) {
4770
4774
  });
4771
4775
  }
4772
4776
  };
4773
- $[3] = onChange;
4774
- $[4] = t1;
4777
+ $[4] = onChange;
4778
+ $[5] = t1;
4775
4779
  } else {
4776
- t1 = $[4];
4780
+ t1 = $[5];
4777
4781
  }
4778
4782
  var t2;
4779
- if ($[5] !== props || $[6] !== t1) {
4783
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
4780
4784
  t2 = /*#__PURE__*/React.createElement(reactNumberFormat.NumericFormat, _extends({}, props, {
4785
+ getInputRef: ref,
4781
4786
  onValueChange: t1
4782
4787
  }));
4783
- $[5] = props;
4784
- $[6] = t1;
4785
- $[7] = t2;
4788
+ $[6] = props;
4789
+ $[7] = ref;
4790
+ $[8] = t1;
4791
+ $[9] = t2;
4786
4792
  } else {
4787
- t2 = $[7];
4793
+ t2 = $[9];
4788
4794
  }
4789
4795
  return t2;
4790
4796
  };var _excluded$o = ["ref", "className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "labelShrink", "clear", "slotProps", "value", "onChange", "onValue", "onValidate"];
@@ -7385,7 +7391,7 @@ var PFormCheckbox = function PFormCheckbox(t0) {
7385
7391
  };
7386
7392
  function _temp$q() {
7387
7393
  return "PFormCheckbox";
7388
- }var _excluded$g = ["ref", "variant", "size", "color", "focused", "fullWidth", "hidden", "startAdornment", "endAdornment", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "data", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"];
7394
+ }insertStyle(".PFormRadioGroup .PFormRadioGroup-Item.PFormRadioGroup-Item--error .MuiTypography-root{color:var(--error-color) !important}");var _excluded$g = ["ref", "variant", "size", "color", "focused", "fullWidth", "hidden", "startAdornment", "endAdornment", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "data", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"];
7389
7395
  var PADDING_LEFT = 3;
7390
7396
  function PFormRadioGroup(t0) {
7391
7397
  var $ = compilerRuntime.c(272);
@@ -7528,6 +7534,7 @@ function PFormRadioGroup(t0) {
7528
7534
  }
7529
7535
  var inline = t1 === undefined ? true : t1;
7530
7536
  var id = React.useId();
7537
+ var theme = material.useTheme();
7531
7538
  var _useFormState = useFormState(),
7532
7539
  formVariant = _useFormState.variant,
7533
7540
  formSize = _useFormState.size,
@@ -7544,7 +7551,6 @@ function PFormRadioGroup(t0) {
7544
7551
  var size = initSize !== null && initSize !== void 0 ? initSize : formSize;
7545
7552
  var color = initColor !== null && initColor !== void 0 ? initColor : formColor;
7546
7553
  var focused = initFocused !== null && initFocused !== void 0 ? initFocused : formFocused;
7547
- var theme = material.useTheme();
7548
7554
  var initValueRef = reactHook.useAutoUpdateRef(initValue);
7549
7555
  var baseRef = React.useRef(null);
7550
7556
  var firstInputRef = React.useRef(null);
@@ -8336,6 +8342,7 @@ function PFormRadioGroup(t0) {
8336
8342
  itemDisabled_0 = t57.disabled;
8337
8343
  return /*#__PURE__*/React.createElement(material.FormControlLabel, {
8338
8344
  key: idx_0,
8345
+ className: classNames("PFormRadioGroup-Item", error && "PFormRadioGroup-Item--error"),
8339
8346
  control: /*#__PURE__*/React.createElement(material.Radio, {
8340
8347
  icon: /*#__PURE__*/React.createElement(iconsMaterial.RadioButtonUnchecked, {
8341
8348
  color: error ? "error" : undefined
@@ -8353,10 +8360,11 @@ function PFormRadioGroup(t0) {
8353
8360
  }),
8354
8361
  label: label_1,
8355
8362
  style: {
8356
- color: error ? theme.palette.error.main : "",
8357
8363
  whiteSpace: "nowrap",
8358
8364
  marginTop: -5,
8359
- marginBottom: -5
8365
+ marginBottom: -5,
8366
+ color: error ? theme.palette.error.main : undefined,
8367
+ opacity: error && (disabled || readOnly || itemDisabled_0) ? 0.5 : 1
8360
8368
  },
8361
8369
  value: value_4,
8362
8370
  disabled: disabled || readOnly || itemDisabled_0
@@ -8679,7 +8687,7 @@ function PFormRadioGroup(t0) {
8679
8687
  function _temp$p() {
8680
8688
  return "PFormRadioGroup";
8681
8689
  }insertStyle(".PFormToggleButtonGroup.loading .PFormItemBase-Control-wrap .PFormItemBase-Control{align-items:center !important}.PFormToggleButtonGroup .ToggleButton{display:inline-flex;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-items:center}.PFormToggleButtonGroup .ToggleButton .__label__{height:0;line-height:0 !important;overflow:visible !important}.PFormToggleButtonGroup.type-checkbox .ToggleButton,.PFormToggleButtonGroup.type-radio .ToggleButton{padding-left:3px;padding-right:5px;border:0 !important;margin-left:0 !important;justify-content:flex-start;display:flex;background-color:rgba(0,0,0,0) !important}.PFormToggleButtonGroup.type-checkbox .ToggleButton:not(:last-child),.PFormToggleButtonGroup.type-radio .ToggleButton:not(:last-child){margin-right:5px}.PFormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-checked__,.PFormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-unchecked__,.PFormToggleButtonGroup.type-radio .ToggleButton .__checkbox-checked__,.PFormToggleButtonGroup.type-radio .ToggleButton .__checkbox-unchecked__{margin-right:3px}.PFormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-checked__,.PFormToggleButtonGroup.type-radio .ToggleButton .__checkbox-checked__{display:none}.PFormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected.Mui-disabled,.PFormToggleButtonGroup.type-radio .ToggleButton.Mui-selected.Mui-disabled{opacity:.5}.PFormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected .__checkbox-checked__,.PFormToggleButtonGroup.type-radio .ToggleButton.Mui-selected .__checkbox-checked__{display:block}.PFormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected .__checkbox-unchecked__,.PFormToggleButtonGroup.type-radio .ToggleButton.Mui-selected .__checkbox-unchecked__{display:none}.PFormToggleButtonGroup:not(.with-label).variant-outlined .PFormItemBase-Control-wrap{margin-top:15px;margin-bottom:-15px}.PFormToggleButtonGroup:not(.with-label).variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup:not(.with-label).variant-filled .PFormItemBase-Control-wrap{margin-top:15px;margin-bottom:-15px}.PFormToggleButtonGroup:not(.with-label).variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup:not(.with-label).variant-standard .PFormItemBase-Control-wrap{margin-top:0px;margin-bottom:0px}.PFormToggleButtonGroup:not(.with-label).variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:28px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-outlined .PFormItemBase-Control-wrap{margin-top:13px;margin-bottom:-13px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:24px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-filled .PFormItemBase-Control-wrap{margin-top:13px;margin-bottom:-13px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:31px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-standard .PFormItemBase-Control-wrap{margin-top:0px;margin-bottom:0px}.PFormToggleButtonGroup:not(.with-label).size-small.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:26px}.PFormToggleButtonGroup.with-label.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup.with-label.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PFormToggleButtonGroup.with-label.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:28px}.PFormToggleButtonGroup.with-label.size-small.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.size-small.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:24px}.PFormToggleButtonGroup.with-label.size-small.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.size-small.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:31px}.PFormToggleButtonGroup.with-label.size-small.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PFormToggleButtonGroup.with-label.size-small.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:26px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:37px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:28px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-outlined .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-outlined .PFormItemBase-Control-wrap .ToggleButton{height:24px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-filled .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-filled .PFormItemBase-Control-wrap .ToggleButton{height:31px}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-standard .PFormItemBase-Control-wrap{margin-top:0;margin-bottom:0}.PForm .PFormCol.with-label .PFormToggleButtonGroup.size-small.variant-standard .PFormItemBase-Control-wrap .ToggleButton{height:26px}");function PFormToggleButtonGroup(t0) {
8682
- var $ = compilerRuntime.c(237);
8690
+ var $ = compilerRuntime.c(236);
8683
8691
  var ref = t0.ref,
8684
8692
  initVariant = t0.variant,
8685
8693
  initSize = t0.size,
@@ -9595,30 +9603,18 @@ function _temp$p() {
9595
9603
  finalItemWidth = itemWidth || "auto";
9596
9604
  }
9597
9605
  }
9598
- var t60 = error ? theme.palette.error.main : "";
9599
- var t61 = error ? theme.palette.error.main : "";
9600
- var t62;
9601
- if ($[160] !== finalItemWidth || $[161] !== t60 || $[162] !== t61) {
9602
- t62 = {
9606
+ var t60 = error ? theme.palette.error.main : undefined;
9607
+ var t61;
9608
+ if ($[160] !== color || $[161] !== disabled || $[162] !== error || $[163] !== finalItemWidth || $[164] !== initFocused || $[165] !== items || $[166] !== readOnly || $[167] !== refForButtonResizeHeightDetect || $[168] !== size || $[169] !== t60 || $[170] !== theme || $[171] !== type) {
9609
+ var buttonStyle = {
9603
9610
  borderColor: t60,
9604
- color: t61,
9605
9611
  width: finalItemWidth
9606
9612
  };
9607
- $[160] = finalItemWidth;
9608
- $[161] = t60;
9609
- $[162] = t61;
9610
- $[163] = t62;
9611
- } else {
9612
- t62 = $[163];
9613
- }
9614
- var buttonStyle = t62;
9615
- var t63;
9616
- if ($[164] !== buttonStyle || $[165] !== color || $[166] !== disabled || $[167] !== initFocused || $[168] !== items || $[169] !== readOnly || $[170] !== refForButtonResizeHeightDetect || $[171] !== size || $[172] !== type) {
9617
- t63 = items && items.map(function (t64, idx) {
9618
- var value_3 = t64.value,
9619
- label_0 = t64.label,
9620
- itemDisabled = t64.disabled,
9621
- itemColor = t64.color;
9613
+ t61 = items && items.map(function (t62, idx) {
9614
+ var value_3 = t62.value,
9615
+ label_0 = t62.label,
9616
+ itemDisabled = t62.disabled,
9617
+ itemColor = t62.color;
9622
9618
  return /*#__PURE__*/React.createElement(material.ToggleButton, {
9623
9619
  ref: function ref(ref_0) {
9624
9620
  if (idx === 0) {
@@ -9631,7 +9627,9 @@ function _temp$p() {
9631
9627
  value: value_3,
9632
9628
  color: itemColor || color,
9633
9629
  disabled: disabled || readOnly || itemDisabled,
9634
- style: buttonStyle,
9630
+ style: _objectSpread2(_objectSpread2({}, buttonStyle), {}, {
9631
+ color: disabled || readOnly || itemDisabled ? error ? theme.alpha(theme.palette.error.main, 0.5) : undefined : error ? theme.palette.error.main : undefined
9632
+ }),
9635
9633
  onFocus: function onFocus() {
9636
9634
  return setFocused(initFocused || true);
9637
9635
  },
@@ -9650,24 +9648,27 @@ function _temp$p() {
9650
9648
  className: "__label__"
9651
9649
  }, label_0));
9652
9650
  });
9653
- $[164] = buttonStyle;
9654
- $[165] = color;
9655
- $[166] = disabled;
9656
- $[167] = initFocused;
9657
- $[168] = items;
9658
- $[169] = readOnly;
9659
- $[170] = refForButtonResizeHeightDetect;
9660
- $[171] = size;
9661
- $[172] = type;
9662
- $[173] = t63;
9651
+ $[160] = color;
9652
+ $[161] = disabled;
9653
+ $[162] = error;
9654
+ $[163] = finalItemWidth;
9655
+ $[164] = initFocused;
9656
+ $[165] = items;
9657
+ $[166] = readOnly;
9658
+ $[167] = refForButtonResizeHeightDetect;
9659
+ $[168] = size;
9660
+ $[169] = t60;
9661
+ $[170] = theme;
9662
+ $[171] = type;
9663
+ $[172] = t61;
9663
9664
  } else {
9664
- t63 = $[173];
9665
+ t61 = $[172];
9665
9666
  }
9666
- var buttons = t63;
9667
+ var buttons = t61;
9667
9668
  var newRealValue = value_2 == null ? null : value_2;
9668
9669
  if (items && value_2 != null) {
9669
9670
  if (Array.isArray(newRealValue)) {
9670
- if ($[174] !== items || $[175] !== multiple || $[176] !== newRealValue) {
9671
+ if ($[173] !== items || $[174] !== multiple || $[175] !== newRealValue) {
9671
9672
  var stringRealValues = newRealValue.map(_temp3$1);
9672
9673
  if (multiple) {
9673
9674
  var foundItems = items.filter(function (v_2) {
@@ -9675,42 +9676,42 @@ function _temp$p() {
9675
9676
  });
9676
9677
  newRealValue = foundItems.map(_temp4$1);
9677
9678
  }
9678
- $[174] = items;
9679
- $[175] = multiple;
9679
+ $[173] = items;
9680
+ $[174] = multiple;
9681
+ $[175] = newRealValue;
9680
9682
  $[176] = newRealValue;
9681
- $[177] = newRealValue;
9682
9683
  } else {
9683
- newRealValue = $[177];
9684
+ newRealValue = $[176];
9684
9685
  }
9685
9686
  } else {
9686
9687
  if (newRealValue != null) {
9687
9688
  var _t3;
9688
- if ($[178] !== newRealValue) {
9689
+ if ($[177] !== newRealValue) {
9689
9690
  _t3 = newRealValue.toString();
9690
- $[178] = newRealValue;
9691
- $[179] = _t3;
9691
+ $[177] = newRealValue;
9692
+ $[178] = _t3;
9692
9693
  } else {
9693
- _t3 = $[179];
9694
+ _t3 = $[178];
9694
9695
  }
9695
9696
  var stringRealValue = _t3;
9696
9697
  var _t4;
9697
- if ($[180] !== items || $[181] !== stringRealValue) {
9698
+ if ($[179] !== items || $[180] !== stringRealValue) {
9698
9699
  var _t5;
9699
- if ($[183] !== stringRealValue) {
9700
+ if ($[182] !== stringRealValue) {
9700
9701
  _t5 = function _t5(v_4) {
9701
9702
  return v_4.value.toString() === stringRealValue;
9702
9703
  };
9703
- $[183] = stringRealValue;
9704
- $[184] = _t5;
9704
+ $[182] = stringRealValue;
9705
+ $[183] = _t5;
9705
9706
  } else {
9706
- _t5 = $[184];
9707
+ _t5 = $[183];
9707
9708
  }
9708
9709
  _t4 = items.find(_t5);
9709
- $[180] = items;
9710
- $[181] = stringRealValue;
9711
- $[182] = _t4;
9710
+ $[179] = items;
9711
+ $[180] = stringRealValue;
9712
+ $[181] = _t4;
9712
9713
  } else {
9713
- _t4 = $[182];
9714
+ _t4 = $[181];
9714
9715
  }
9715
9716
  var foundItem = _t4;
9716
9717
  if (foundItem) {
@@ -9720,9 +9721,9 @@ function _temp$p() {
9720
9721
  }
9721
9722
  }
9722
9723
  var realValue_1 = newRealValue;
9723
- var t64;
9724
- if ($[185] !== buttons || $[186] !== disabled || $[187] !== endAdornment || $[188] !== formColWidth || $[189] !== fullWidth || $[190] !== handleChange || $[191] !== isOnGetItemLoading || $[192] !== items || $[193] !== label || $[194] !== labelId || $[195] !== loading || $[196] !== multiple || $[197] !== readOnly || $[198] !== realValue_1 || $[199] !== refForButtonResizeHeightDetect || $[200] !== refForButtonsResizeHeightDetect || $[201] !== refForLoadingResizeHeightDetect || $[202] !== refForResizeWidthDetect || $[203] !== size || $[204] !== startAdornment || $[205] !== type || $[206] !== width) {
9725
- t64 = isOnGetItemLoading || loading ? /*#__PURE__*/React.createElement("div", {
9724
+ var t62;
9725
+ if ($[184] !== buttons || $[185] !== disabled || $[186] !== endAdornment || $[187] !== formColWidth || $[188] !== fullWidth || $[189] !== handleChange || $[190] !== isOnGetItemLoading || $[191] !== items || $[192] !== label || $[193] !== labelId || $[194] !== loading || $[195] !== multiple || $[196] !== readOnly || $[197] !== realValue_1 || $[198] !== refForButtonResizeHeightDetect || $[199] !== refForButtonsResizeHeightDetect || $[200] !== refForLoadingResizeHeightDetect || $[201] !== refForResizeWidthDetect || $[202] !== size || $[203] !== startAdornment || $[204] !== type || $[205] !== width) {
9726
+ t62 = isOnGetItemLoading || loading ? /*#__PURE__*/React.createElement("div", {
9726
9727
  style: {
9727
9728
  opacity: 0.54
9728
9729
  },
@@ -9774,84 +9775,84 @@ function _temp$p() {
9774
9775
  visibility: "hidden"
9775
9776
  }
9776
9777
  }) : buttons)), endAdornment && /*#__PURE__*/React.createElement("div", null, endAdornment));
9777
- $[185] = buttons;
9778
- $[186] = disabled;
9779
- $[187] = endAdornment;
9780
- $[188] = formColWidth;
9781
- $[189] = fullWidth;
9782
- $[190] = handleChange;
9783
- $[191] = isOnGetItemLoading;
9784
- $[192] = items;
9785
- $[193] = label;
9786
- $[194] = labelId;
9787
- $[195] = loading;
9788
- $[196] = multiple;
9789
- $[197] = readOnly;
9790
- $[198] = realValue_1;
9791
- $[199] = refForButtonResizeHeightDetect;
9792
- $[200] = refForButtonsResizeHeightDetect;
9793
- $[201] = refForLoadingResizeHeightDetect;
9794
- $[202] = refForResizeWidthDetect;
9795
- $[203] = size;
9796
- $[204] = startAdornment;
9797
- $[205] = type;
9798
- $[206] = width;
9799
- $[207] = t64;
9800
- } else {
9801
- t64 = $[207];
9802
- }
9803
- var control = t64;
9778
+ $[184] = buttons;
9779
+ $[185] = disabled;
9780
+ $[186] = endAdornment;
9781
+ $[187] = formColWidth;
9782
+ $[188] = fullWidth;
9783
+ $[189] = handleChange;
9784
+ $[190] = isOnGetItemLoading;
9785
+ $[191] = items;
9786
+ $[192] = label;
9787
+ $[193] = labelId;
9788
+ $[194] = loading;
9789
+ $[195] = multiple;
9790
+ $[196] = readOnly;
9791
+ $[197] = realValue_1;
9792
+ $[198] = refForButtonResizeHeightDetect;
9793
+ $[199] = refForButtonsResizeHeightDetect;
9794
+ $[200] = refForLoadingResizeHeightDetect;
9795
+ $[201] = refForResizeWidthDetect;
9796
+ $[202] = size;
9797
+ $[203] = startAdornment;
9798
+ $[204] = type;
9799
+ $[205] = width;
9800
+ $[206] = t62;
9801
+ } else {
9802
+ t62 = $[206];
9803
+ }
9804
+ var control = t62;
9804
9805
  var controlHeight = height || 0;
9805
9806
  var isMultiline = controlHeight <= (realHeight !== null && realHeight !== void 0 ? realHeight : 0);
9806
- var t65 = "variant-".concat(variant);
9807
- var t66 = "size-".concat(size);
9808
- var t67 = !!label && "with-label";
9809
- var t68 = !!fullWidth && "full-width";
9810
- var t69 = "type-".concat(type);
9811
- var t70 = (isOnGetItemLoading || loading) && "loading";
9807
+ var t63 = "variant-".concat(variant);
9808
+ var t64 = "size-".concat(size);
9809
+ var t65 = !!label && "with-label";
9810
+ var t66 = !!fullWidth && "full-width";
9811
+ var t67 = "type-".concat(type);
9812
+ var t68 = (isOnGetItemLoading || loading) && "loading";
9813
+ var t69;
9814
+ if ($[207] !== className || $[208] !== t63 || $[209] !== t64 || $[210] !== t65 || $[211] !== t66 || $[212] !== t67 || $[213] !== t68) {
9815
+ t69 = classNames(className, "PFormValueItem", "PFormToggleButtonGroup", t63, t64, t65, t66, t67, t68);
9816
+ $[207] = className;
9817
+ $[208] = t63;
9818
+ $[209] = t64;
9819
+ $[210] = t65;
9820
+ $[211] = t66;
9821
+ $[212] = t67;
9822
+ $[213] = t68;
9823
+ $[214] = t69;
9824
+ } else {
9825
+ t69 = $[214];
9826
+ }
9827
+ var t70 = error ? errorHelperText : helperText;
9812
9828
  var t71;
9813
- if ($[208] !== className || $[209] !== t65 || $[210] !== t66 || $[211] !== t67 || $[212] !== t68 || $[213] !== t69 || $[214] !== t70) {
9814
- t71 = classNames(className, "PFormValueItem", "PFormToggleButtonGroup", t65, t66, t67, t68, t69, t70);
9815
- $[208] = className;
9816
- $[209] = t65;
9817
- $[210] = t66;
9818
- $[211] = t67;
9819
- $[212] = t68;
9820
- $[213] = t69;
9821
- $[214] = t70;
9822
- $[215] = t71;
9823
- } else {
9824
- t71 = $[215];
9825
- }
9826
- var t72 = error ? errorHelperText : helperText;
9827
- var t73;
9828
- if ($[216] === Symbol["for"]("react.memo_cache_sentinel")) {
9829
- t73 = {
9829
+ if ($[215] === Symbol["for"]("react.memo_cache_sentinel")) {
9830
+ t71 = {
9830
9831
  style: {
9831
9832
  marginLeft: 2
9832
9833
  }
9833
9834
  };
9834
- $[216] = t73;
9835
+ $[215] = t71;
9835
9836
  } else {
9836
- t73 = $[216];
9837
+ t71 = $[215];
9837
9838
  }
9838
- var t74;
9839
- if ($[217] === Symbol["for"]("react.memo_cache_sentinel")) {
9840
- t74 = {
9839
+ var t72;
9840
+ if ($[216] === Symbol["for"]("react.memo_cache_sentinel")) {
9841
+ t72 = {
9841
9842
  style: {
9842
9843
  marginLeft: 2
9843
9844
  }
9844
9845
  };
9845
- $[217] = t74;
9846
+ $[216] = t72;
9846
9847
  } else {
9847
- t74 = $[217];
9848
+ t72 = $[216];
9848
9849
  }
9849
- var t75 = realHeight ? realHeight + (isMultiline ? 13 : 0) : controlHeight;
9850
- var t76 = isMultiline ? false : isOnGetItemLoading || loading;
9851
- var t77;
9852
- if ($[218] !== color || $[219] !== control || $[220] !== error || $[221] !== errorHelperText || $[222] !== formControlBaseProps || $[223] !== fullWidth || $[224] !== hidden || $[225] !== label || $[226] !== labelIcon || $[227] !== required || $[228] !== size || $[229] !== style || $[230] !== sx || $[231] !== t71 || $[232] !== t72 || $[233] !== t75 || $[234] !== t76 || $[235] !== variant) {
9853
- t77 = /*#__PURE__*/React.createElement(PFormItemBase, _extends({}, formControlBaseProps, {
9854
- className: t71,
9850
+ var t73 = realHeight ? realHeight + (isMultiline ? 13 : 0) : controlHeight;
9851
+ var t74 = isMultiline ? false : isOnGetItemLoading || loading;
9852
+ var t75;
9853
+ if ($[217] !== color || $[218] !== control || $[219] !== error || $[220] !== errorHelperText || $[221] !== formControlBaseProps || $[222] !== fullWidth || $[223] !== hidden || $[224] !== label || $[225] !== labelIcon || $[226] !== required || $[227] !== size || $[228] !== style || $[229] !== sx || $[230] !== t69 || $[231] !== t70 || $[232] !== t73 || $[233] !== t74 || $[234] !== variant) {
9854
+ t75 = /*#__PURE__*/React.createElement(PFormItemBase, _extends({}, formControlBaseProps, {
9855
+ className: t69,
9855
9856
  variant: variant,
9856
9857
  size: size,
9857
9858
  color: color,
@@ -9860,41 +9861,41 @@ function _temp$p() {
9860
9861
  required: required,
9861
9862
  fullWidth: fullWidth,
9862
9863
  error: error,
9863
- helperText: t72,
9864
- helperTextProps: t73,
9864
+ helperText: t70,
9865
+ helperTextProps: t71,
9865
9866
  errorHelperText: errorHelperText,
9866
- errorHelperTextProps: t74,
9867
+ errorHelperTextProps: t72,
9867
9868
  style: style,
9868
9869
  sx: sx,
9869
9870
  hidden: hidden,
9870
9871
  autoSize: true,
9871
- controlHeight: t75,
9872
- controlVerticalCenter: t76,
9872
+ controlHeight: t73,
9873
+ controlVerticalCenter: t74,
9873
9874
  control: control
9874
9875
  }));
9875
- $[218] = color;
9876
- $[219] = control;
9877
- $[220] = error;
9878
- $[221] = errorHelperText;
9879
- $[222] = formControlBaseProps;
9880
- $[223] = fullWidth;
9881
- $[224] = hidden;
9882
- $[225] = label;
9883
- $[226] = labelIcon;
9884
- $[227] = required;
9885
- $[228] = size;
9886
- $[229] = style;
9887
- $[230] = sx;
9888
- $[231] = t71;
9889
- $[232] = t72;
9890
- $[233] = t75;
9891
- $[234] = t76;
9892
- $[235] = variant;
9893
- $[236] = t77;
9876
+ $[217] = color;
9877
+ $[218] = control;
9878
+ $[219] = error;
9879
+ $[220] = errorHelperText;
9880
+ $[221] = formControlBaseProps;
9881
+ $[222] = fullWidth;
9882
+ $[223] = hidden;
9883
+ $[224] = label;
9884
+ $[225] = labelIcon;
9885
+ $[226] = required;
9886
+ $[227] = size;
9887
+ $[228] = style;
9888
+ $[229] = sx;
9889
+ $[230] = t69;
9890
+ $[231] = t70;
9891
+ $[232] = t73;
9892
+ $[233] = t74;
9893
+ $[234] = variant;
9894
+ $[235] = t75;
9894
9895
  } else {
9895
- t77 = $[236];
9896
+ t75 = $[235];
9896
9897
  }
9897
- return t77;
9898
+ return t75;
9898
9899
  }
9899
9900
  function _temp4$1(v_3) {
9900
9901
  return v_3.value;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pdg/react-form",
3
3
  "title": "Typescript React Form Module",
4
4
  "description": "Typescript React Form Module",
5
- "version": "1.2.16",
5
+ "version": "1.2.18",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.esm.js",