@helpdice/ui 2.6.0 → 2.6.1-beta.0
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/auto-complete/index.js +246 -14
- package/dist/container/index.js +7 -0
- package/dist/expandable/index.js +7 -0
- package/dist/index.js +321 -228
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +246 -14
- package/dist/input/input-currency-range.d.ts +8 -0
- package/dist/table/index.js +232 -146
- package/esm/expandable/expand.js +7 -0
- package/esm/input/index.d.ts +2 -0
- package/esm/input/index.js +2 -0
- package/esm/input/input-currency-range.d.ts +8 -0
- package/esm/input/input-currency-range.js +83 -0
- package/package.json +1 -1
|
@@ -839,7 +839,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
|
|
|
839
839
|
return getAllScaleProps;
|
|
840
840
|
};
|
|
841
841
|
|
|
842
|
-
var _excluded$
|
|
842
|
+
var _excluded$b = ["children"];
|
|
843
843
|
var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
|
|
844
844
|
if (scale === 1) return scale;
|
|
845
845
|
var diff = Math.abs((scale - 1) / 2);
|
|
@@ -849,7 +849,7 @@ var withScale = function withScale(Render) {
|
|
|
849
849
|
var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
850
850
|
var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
|
|
851
851
|
var children = _ref.children,
|
|
852
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
852
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
853
853
|
var _useTheme = theme.useTheme(),
|
|
854
854
|
layout = _useTheme.layout;
|
|
855
855
|
var paddingLeft = props.paddingLeft,
|
|
@@ -934,7 +934,7 @@ var withScale = function withScale(Render) {
|
|
|
934
934
|
return ScaleFC;
|
|
935
935
|
};
|
|
936
936
|
|
|
937
|
-
var _excluded$
|
|
937
|
+
var _excluded$a = ["children", "tag", "className", "color"];
|
|
938
938
|
var getTypeColor = function getTypeColor(type, palette) {
|
|
939
939
|
var colors = {
|
|
940
940
|
"default": 'inherit',
|
|
@@ -952,7 +952,7 @@ var TextChild = function TextChild(_ref) {
|
|
|
952
952
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
953
953
|
_ref$color = _ref.color,
|
|
954
954
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
955
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
955
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
956
956
|
var Component = tag;
|
|
957
957
|
var theme$1 = theme.useTheme();
|
|
958
958
|
var _useScale = useScale(),
|
|
@@ -1000,7 +1000,7 @@ var TextChild = function TextChild(_ref) {
|
|
|
1000
1000
|
};
|
|
1001
1001
|
TextChild.displayName = 'TextChild';
|
|
1002
1002
|
|
|
1003
|
-
var _excluded$
|
|
1003
|
+
var _excluded$9 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "children", "className", "display", "alignItems", "justify"];
|
|
1004
1004
|
var _getModifierChild = function getModifierChild(tags, children) {
|
|
1005
1005
|
if (!tags.length) return children;
|
|
1006
1006
|
var nextTag = tags.slice(1, tags.length);
|
|
@@ -1047,7 +1047,7 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
1047
1047
|
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
1048
1048
|
alignItems = _ref.alignItems,
|
|
1049
1049
|
justify = _ref.justify,
|
|
1050
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1050
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1051
1051
|
var elements = {
|
|
1052
1052
|
h1: h1,
|
|
1053
1053
|
h2: h2,
|
|
@@ -1242,7 +1242,7 @@ var getColors = function getColors(palette, status) {
|
|
|
1242
1242
|
return colors[status];
|
|
1243
1243
|
};
|
|
1244
1244
|
|
|
1245
|
-
var _excluded$
|
|
1245
|
+
var _excluded$8 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth", "required"];
|
|
1246
1246
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1247
1247
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1248
1248
|
target: el,
|
|
@@ -1289,7 +1289,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1289
1289
|
_ref$fullWidth = _ref.fullWidth,
|
|
1290
1290
|
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
1291
1291
|
required = _ref.required,
|
|
1292
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1292
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1293
1293
|
var theme$1 = theme.useTheme();
|
|
1294
1294
|
var _useScale = useScale(),
|
|
1295
1295
|
SCALES = _useScale.SCALES;
|
|
@@ -1443,7 +1443,7 @@ tuple('hover', 'click');
|
|
|
1443
1443
|
tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
|
|
1444
1444
|
tuple('start', 'center', 'end', 'left', 'right');
|
|
1445
1445
|
|
|
1446
|
-
var _excluded$
|
|
1446
|
+
var _excluded$7 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "required", "resize"];
|
|
1447
1447
|
tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
1448
1448
|
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1449
1449
|
var _ref$type = _ref.type,
|
|
@@ -1467,7 +1467,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1467
1467
|
required = _ref.required,
|
|
1468
1468
|
_ref$resize = _ref.resize,
|
|
1469
1469
|
resize = _ref$resize === void 0 ? 'none' : _ref$resize,
|
|
1470
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1470
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1471
1471
|
var theme$1 = theme.useTheme();
|
|
1472
1472
|
var _useScale = useScale(),
|
|
1473
1473
|
SCALES = _useScale.SCALES;
|
|
@@ -1591,11 +1591,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
|
|
|
1591
1591
|
};
|
|
1592
1592
|
var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
|
|
1593
1593
|
|
|
1594
|
-
var _excluded$
|
|
1594
|
+
var _excluded$6 = ["hideToggle", "children"];
|
|
1595
1595
|
var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1596
1596
|
var hideToggle = _ref.hideToggle,
|
|
1597
1597
|
children = _ref.children,
|
|
1598
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1598
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1599
1599
|
var _useScale = useScale(),
|
|
1600
1600
|
getAllScaleProps = _useScale.getAllScaleProps;
|
|
1601
1601
|
var inputRef = React.useRef(null);
|
|
@@ -3203,7 +3203,7 @@ var repositionCursor = function repositionCursor(_ref) {
|
|
|
3203
3203
|
};
|
|
3204
3204
|
};
|
|
3205
3205
|
|
|
3206
|
-
var _excluded$
|
|
3206
|
+
var _excluded$5 = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
|
|
3207
3207
|
var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3208
3208
|
var _ref$allowDecimals = _ref.allowDecimals,
|
|
3209
3209
|
allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
|
|
@@ -3245,7 +3245,7 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3245
3245
|
_ref$formatValueOnBlu = _ref.formatValueOnBlur,
|
|
3246
3246
|
formatValueOnBlur = _ref$formatValueOnBlu === void 0 ? true : _ref$formatValueOnBlu,
|
|
3247
3247
|
children = _ref.children,
|
|
3248
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3248
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
3249
3249
|
var _useScale = useScale(),
|
|
3250
3250
|
SCALES = _useScale.SCALES;
|
|
3251
3251
|
var theme$1 = theme.useTheme();
|
|
@@ -3547,11 +3547,243 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3547
3547
|
|
|
3548
3548
|
var CurrencyInput = withScale(InputCurrency);
|
|
3549
3549
|
|
|
3550
|
+
var _excluded$4 = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
|
|
3551
|
+
var getItemLayout = function getItemLayout(val) {
|
|
3552
|
+
var display = val === 0 ? 'display: none;' : 'display: inherit;';
|
|
3553
|
+
if (typeof val === 'number') {
|
|
3554
|
+
var width = 100 / 24 * val;
|
|
3555
|
+
var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
|
|
3556
|
+
return {
|
|
3557
|
+
grow: 0,
|
|
3558
|
+
display: display,
|
|
3559
|
+
width: ratio,
|
|
3560
|
+
basis: ratio
|
|
3561
|
+
};
|
|
3562
|
+
}
|
|
3563
|
+
return {
|
|
3564
|
+
grow: 1,
|
|
3565
|
+
display: display,
|
|
3566
|
+
width: '100%',
|
|
3567
|
+
basis: '0'
|
|
3568
|
+
};
|
|
3569
|
+
};
|
|
3570
|
+
var GridBasicItem = function GridBasicItem(_ref) {
|
|
3571
|
+
var _ref$xs = _ref.xs,
|
|
3572
|
+
xs = _ref$xs === void 0 ? false : _ref$xs,
|
|
3573
|
+
_ref$sm = _ref.sm,
|
|
3574
|
+
sm = _ref$sm === void 0 ? false : _ref$sm,
|
|
3575
|
+
_ref$md = _ref.md,
|
|
3576
|
+
md = _ref$md === void 0 ? false : _ref$md,
|
|
3577
|
+
_ref$lg = _ref.lg,
|
|
3578
|
+
lg = _ref$lg === void 0 ? false : _ref$lg,
|
|
3579
|
+
_ref$xl = _ref.xl,
|
|
3580
|
+
xl = _ref$xl === void 0 ? false : _ref$xl,
|
|
3581
|
+
justify = _ref.justify,
|
|
3582
|
+
direction = _ref.direction,
|
|
3583
|
+
alignItems = _ref.alignItems,
|
|
3584
|
+
alignContent = _ref.alignContent,
|
|
3585
|
+
children = _ref.children,
|
|
3586
|
+
_ref$className = _ref.className,
|
|
3587
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
3588
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
3589
|
+
var theme$1 = theme.useTheme();
|
|
3590
|
+
var _useScale = useScale(),
|
|
3591
|
+
SCALES = _useScale.SCALES;
|
|
3592
|
+
var classes = React.useMemo(function () {
|
|
3593
|
+
var aligns = {
|
|
3594
|
+
justify: justify,
|
|
3595
|
+
direction: direction,
|
|
3596
|
+
alignItems: alignItems,
|
|
3597
|
+
alignContent: alignContent,
|
|
3598
|
+
xs: xs,
|
|
3599
|
+
sm: sm,
|
|
3600
|
+
md: md,
|
|
3601
|
+
lg: lg,
|
|
3602
|
+
xl: xl
|
|
3603
|
+
};
|
|
3604
|
+
var classString = Object.keys(aligns).reduce(function (pre, name) {
|
|
3605
|
+
if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
|
|
3606
|
+
return pre;
|
|
3607
|
+
}, '');
|
|
3608
|
+
return classString.trim();
|
|
3609
|
+
}, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
|
|
3610
|
+
var layout = React.useMemo(function () {
|
|
3611
|
+
return {
|
|
3612
|
+
xs: getItemLayout(xs),
|
|
3613
|
+
sm: getItemLayout(sm),
|
|
3614
|
+
md: getItemLayout(md),
|
|
3615
|
+
lg: getItemLayout(lg),
|
|
3616
|
+
xl: getItemLayout(xl)
|
|
3617
|
+
};
|
|
3618
|
+
}, [xs, sm, md, lg, xl]);
|
|
3619
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
3620
|
+
className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || theme.useClasses('item', classes, className) || ""),
|
|
3621
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
3622
|
+
id: "568430467",
|
|
3623
|
+
dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display],
|
|
3624
|
+
children: ".item.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1, 'inherit'), ";height:").concat(SCALES.height(1, 'auto'), ";}.justify.__jsx-style-dynamic-selector{-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";}.direction.__jsx-style-dynamic-selector{-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";}.alignContent.__jsx-style-dynamic-selector{-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";}.alignItems.__jsx-style-dynamic-selector{-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";}.xs.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xs.grow, ";-webkit-flex-grow:").concat(layout.xs.grow, ";-ms-flex-positive:").concat(layout.xs.grow, ";flex-grow:").concat(layout.xs.grow, ";max-width:").concat(layout.xs.width, ";-webkit-flex-basis:").concat(layout.xs.basis, ";-ms-flex-preferred-size:").concat(layout.xs.basis, ";flex-basis:").concat(layout.xs.basis, ";").concat(layout.xs.display, ";}@media only screen and (min-width:").concat(theme$1.breakpoints.sm.min, "){.sm.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.sm.grow, ";-webkit-flex-grow:").concat(layout.sm.grow, ";-ms-flex-positive:").concat(layout.sm.grow, ";flex-grow:").concat(layout.sm.grow, ";max-width:").concat(layout.sm.width, ";-webkit-flex-basis:").concat(layout.sm.basis, ";-ms-flex-preferred-size:").concat(layout.sm.basis, ";flex-basis:").concat(layout.sm.basis, ";").concat(layout.sm.display, ";}}@media only screen and (min-width:").concat(theme$1.breakpoints.md.min, "){.md.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.md.grow, ";-webkit-flex-grow:").concat(layout.md.grow, ";-ms-flex-positive:").concat(layout.md.grow, ";flex-grow:").concat(layout.md.grow, ";max-width:").concat(layout.md.width, ";-webkit-flex-basis:").concat(layout.md.basis, ";-ms-flex-preferred-size:").concat(layout.md.basis, ";flex-basis:").concat(layout.md.basis, ";").concat(layout.md.display, ";}}@media only screen and (min-width:").concat(theme$1.breakpoints.lg.min, "){.lg.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.lg.grow, ";-webkit-flex-grow:").concat(layout.lg.grow, ";-ms-flex-positive:").concat(layout.lg.grow, ";flex-grow:").concat(layout.lg.grow, ";max-width:").concat(layout.lg.width, ";-webkit-flex-basis:").concat(layout.lg.basis, ";-ms-flex-preferred-size:").concat(layout.lg.basis, ";flex-basis:").concat(layout.lg.basis, ";").concat(layout.lg.display, ";}}@media only screen and (min-width:").concat(theme$1.breakpoints.xl.min, "){.xl.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xl.grow, ";-webkit-flex-grow:").concat(layout.xl.grow, ";-ms-flex-positive:").concat(layout.xl.grow, ";flex-grow:").concat(layout.xl.grow, ";max-width:").concat(layout.xl.width, ";-webkit-flex-basis:").concat(layout.xl.basis, ";-ms-flex-preferred-size:").concat(layout.xl.basis, ";flex-basis:").concat(layout.xl.basis, ";").concat(layout.xl.display, ";}}")
|
|
3625
|
+
})]
|
|
3626
|
+
}));
|
|
3627
|
+
};
|
|
3628
|
+
GridBasicItem.displayName = 'GridBasicItem';
|
|
3629
|
+
|
|
3630
|
+
var _excluded$3 = ["children", "className"];
|
|
3631
|
+
var GridComponent = function GridComponent(_ref) {
|
|
3632
|
+
var children = _ref.children,
|
|
3633
|
+
_ref$className = _ref.className,
|
|
3634
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
3635
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
3636
|
+
var _useScale = useScale(),
|
|
3637
|
+
SCALES = _useScale.SCALES;
|
|
3638
|
+
var _styles$className = {
|
|
3639
|
+
styles: /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
3640
|
+
id: "1271839607",
|
|
3641
|
+
dynamic: [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')],
|
|
3642
|
+
children: "div.__jsx-style-dynamic-selector{margin:".concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";box-sizing:border-box;padding:").concat(SCALES.pt(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pr(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pb(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pl(0, 'var(--grid-gap-unit)'), ";}")
|
|
3643
|
+
}),
|
|
3644
|
+
className: _JSXStyle.dynamic([["1271839607", [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]]])
|
|
3645
|
+
},
|
|
3646
|
+
resolveClassName = _styles$className.className,
|
|
3647
|
+
styles = _styles$className.styles;
|
|
3648
|
+
var classes = theme.useClasses(resolveClassName, className);
|
|
3649
|
+
return /*#__PURE__*/jsxRuntime.jsxs(GridBasicItem, _objectSpread2(_objectSpread2({
|
|
3650
|
+
className: classes
|
|
3651
|
+
}, props), {}, {
|
|
3652
|
+
children: [children, styles]
|
|
3653
|
+
}));
|
|
3654
|
+
};
|
|
3655
|
+
GridComponent.displayName = 'Grid';
|
|
3656
|
+
var Grid = withScale(GridComponent);
|
|
3657
|
+
|
|
3658
|
+
var _excluded$2 = ["gap", "wrap", "children", "className"];
|
|
3659
|
+
var GridContainerComponent = function GridContainerComponent(_ref) {
|
|
3660
|
+
var _ref$gap = _ref.gap,
|
|
3661
|
+
gap = _ref$gap === void 0 ? 0 : _ref$gap,
|
|
3662
|
+
_ref$wrap = _ref.wrap,
|
|
3663
|
+
wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
|
|
3664
|
+
children = _ref.children,
|
|
3665
|
+
_ref$className = _ref.className,
|
|
3666
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
3667
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
3668
|
+
var _useScale = useScale(),
|
|
3669
|
+
unit = _useScale.unit,
|
|
3670
|
+
SCALES = _useScale.SCALES;
|
|
3671
|
+
var gapUnit = React.useMemo(function () {
|
|
3672
|
+
return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
|
|
3673
|
+
}, [gap, unit]);
|
|
3674
|
+
var _styles$className = {
|
|
3675
|
+
styles: /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
3676
|
+
id: "3631618093",
|
|
3677
|
+
dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')],
|
|
3678
|
+
children: "div.__jsx-style-dynamic-selector{--grid-gap-unit:".concat(gapUnit, ";--grid-container-margin:calc(-1 * var(--grid-gap-unit));--grid-container-width:calc(100% + var(--grid-gap-unit) * 2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;width:").concat(SCALES.width(1, 'var(--grid-container-width)'), ";margin:").concat(SCALES.mt(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mr(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mb(0, 'var(--grid-container-margin)'), " ").concat(SCALES.ml(0, 'var(--grid-container-margin)'), ";}")
|
|
3679
|
+
}),
|
|
3680
|
+
className: _JSXStyle.dynamic([["3631618093", [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]]])
|
|
3681
|
+
},
|
|
3682
|
+
resolveClassName = _styles$className.className,
|
|
3683
|
+
styles = _styles$className.styles;
|
|
3684
|
+
var classes = theme.useClasses(resolveClassName, className);
|
|
3685
|
+
return /*#__PURE__*/jsxRuntime.jsxs(GridBasicItem, _objectSpread2(_objectSpread2({
|
|
3686
|
+
className: classes
|
|
3687
|
+
}, props), {}, {
|
|
3688
|
+
children: [children, styles]
|
|
3689
|
+
}));
|
|
3690
|
+
};
|
|
3691
|
+
GridContainerComponent.displayName = 'GridContainer';
|
|
3692
|
+
var GridContainer = withScale(GridContainerComponent);
|
|
3693
|
+
|
|
3694
|
+
Grid.Container = GridContainer;
|
|
3695
|
+
|
|
3696
|
+
function parseCurrency(value) {
|
|
3697
|
+
var _trimmed$match;
|
|
3698
|
+
var trimmed = value.trim();
|
|
3699
|
+
|
|
3700
|
+
// Extract currency symbol
|
|
3701
|
+
var currencySymbol = ((_trimmed$match = trimmed.match(/[^\d.,\s]/)) === null || _trimmed$match === void 0 ? void 0 : _trimmed$match[0]) || "";
|
|
3702
|
+
|
|
3703
|
+
// Remove everything except digits, comma, dot
|
|
3704
|
+
var numericPart = trimmed.replace(/[^\d.,]/g, "");
|
|
3705
|
+
|
|
3706
|
+
// Convert comma to dot if needed
|
|
3707
|
+
var normalized = numericPart.replace(",", ".");
|
|
3708
|
+
return {
|
|
3709
|
+
amount: Number(normalized),
|
|
3710
|
+
currency: currencySymbol
|
|
3711
|
+
};
|
|
3712
|
+
}
|
|
3713
|
+
function CurrencyRangeInput(_ref) {
|
|
3714
|
+
var prefix = _ref.prefix,
|
|
3715
|
+
allowDecimals = _ref.allowDecimals,
|
|
3716
|
+
onChange = _ref.onChange,
|
|
3717
|
+
intlConfig = _ref.intlConfig,
|
|
3718
|
+
children = _ref.children;
|
|
3719
|
+
var _React$useState = React.useState({
|
|
3720
|
+
min: '0',
|
|
3721
|
+
max: '0',
|
|
3722
|
+
currency: ''
|
|
3723
|
+
}),
|
|
3724
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3725
|
+
value = _React$useState2[0],
|
|
3726
|
+
setValue = _React$useState2[1];
|
|
3727
|
+
React.useEffect(function () {
|
|
3728
|
+
var min = parseCurrency(value.min);
|
|
3729
|
+
var max = parseCurrency(value.max);
|
|
3730
|
+
if (max.amount > min.amount) {
|
|
3731
|
+
if (onChange) onChange({
|
|
3732
|
+
target: {
|
|
3733
|
+
value: {
|
|
3734
|
+
min: min.amount,
|
|
3735
|
+
max: max.amount,
|
|
3736
|
+
currency: min.currency
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
});
|
|
3740
|
+
}
|
|
3741
|
+
}, [value]);
|
|
3742
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3743
|
+
className: "with-label",
|
|
3744
|
+
children: [children && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
3745
|
+
children: children
|
|
3746
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Grid.Container, {
|
|
3747
|
+
gap: 2,
|
|
3748
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Grid, {
|
|
3749
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input.Currency, {
|
|
3750
|
+
onChange: function onChange(e) {
|
|
3751
|
+
return setValue(function (prev) {
|
|
3752
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
3753
|
+
min: e.target.value
|
|
3754
|
+
});
|
|
3755
|
+
});
|
|
3756
|
+
},
|
|
3757
|
+
intlConfig: intlConfig,
|
|
3758
|
+
prefix: prefix,
|
|
3759
|
+
placeholder: "Min",
|
|
3760
|
+
allowDecimals: allowDecimals
|
|
3761
|
+
})
|
|
3762
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Grid, {
|
|
3763
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input.Currency, {
|
|
3764
|
+
onChange: function onChange(e) {
|
|
3765
|
+
return setValue(function (prev) {
|
|
3766
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
3767
|
+
max: e.target.value
|
|
3768
|
+
});
|
|
3769
|
+
});
|
|
3770
|
+
},
|
|
3771
|
+
intlConfig: intlConfig,
|
|
3772
|
+
prefix: prefix,
|
|
3773
|
+
placeholder: "Max",
|
|
3774
|
+
allowDecimals: allowDecimals
|
|
3775
|
+
})
|
|
3776
|
+
})]
|
|
3777
|
+
})]
|
|
3778
|
+
});
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3550
3781
|
/* "use client" */
|
|
3551
3782
|
Input.Textarea = Textarea;
|
|
3552
3783
|
Input.Password = InputPassword;
|
|
3553
3784
|
Input.Phone = PhoneInput$1;
|
|
3554
3785
|
Input.Currency = CurrencyInput;
|
|
3786
|
+
Input.CurrencyRange = CurrencyRangeInput;
|
|
3555
3787
|
|
|
3556
3788
|
/* "use client" */
|
|
3557
3789
|
|
package/dist/container/index.js
CHANGED
|
@@ -1663,6 +1663,7 @@ var Expandable = function Expandable(_ref) {
|
|
|
1663
1663
|
|
|
1664
1664
|
// Measure content height and detect overflow
|
|
1665
1665
|
React.useEffect(function () {
|
|
1666
|
+
var _contentRef$current$q, _contentRef$current;
|
|
1666
1667
|
var el = contentRef.current;
|
|
1667
1668
|
if (!el) return;
|
|
1668
1669
|
var updateHeight = function updateHeight() {
|
|
@@ -1676,6 +1677,12 @@ var Expandable = function Expandable(_ref) {
|
|
|
1676
1677
|
setFadeColor(parentBg || "#fff");
|
|
1677
1678
|
};
|
|
1678
1679
|
updateHeight();
|
|
1680
|
+
var images = (_contentRef$current$q = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelectorAll("img")) !== null && _contentRef$current$q !== void 0 ? _contentRef$current$q : [];
|
|
1681
|
+
if (images) {
|
|
1682
|
+
images.forEach(function (img) {
|
|
1683
|
+
return img.addEventListener("load", updateHeight);
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1679
1686
|
var observer = new ResizeObserver(updateHeight);
|
|
1680
1687
|
observer.observe(el);
|
|
1681
1688
|
return function () {
|
package/dist/expandable/index.js
CHANGED
|
@@ -1568,6 +1568,7 @@ var Expandable = function Expandable(_ref) {
|
|
|
1568
1568
|
|
|
1569
1569
|
// Measure content height and detect overflow
|
|
1570
1570
|
React.useEffect(function () {
|
|
1571
|
+
var _contentRef$current$q, _contentRef$current;
|
|
1571
1572
|
var el = contentRef.current;
|
|
1572
1573
|
if (!el) return;
|
|
1573
1574
|
var updateHeight = function updateHeight() {
|
|
@@ -1581,6 +1582,12 @@ var Expandable = function Expandable(_ref) {
|
|
|
1581
1582
|
setFadeColor(parentBg || "#fff");
|
|
1582
1583
|
};
|
|
1583
1584
|
updateHeight();
|
|
1585
|
+
var images = (_contentRef$current$q = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelectorAll("img")) !== null && _contentRef$current$q !== void 0 ? _contentRef$current$q : [];
|
|
1586
|
+
if (images) {
|
|
1587
|
+
images.forEach(function (img) {
|
|
1588
|
+
return img.addEventListener("load", updateHeight);
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1584
1591
|
var observer = new ResizeObserver(updateHeight);
|
|
1585
1592
|
observer.observe(el);
|
|
1586
1593
|
return function () {
|