@majoo-ui/react 1.58.8 → 1.58.9-beta.1
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/index.esm.js +28 -13
- package/index.umd.js +28 -13
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -9829,7 +9829,7 @@ var NumberFormat = /*@__PURE__*/function (superclass) {
|
|
|
9829
9829
|
}(React__default.Component);
|
|
9830
9830
|
NumberFormat.defaultProps = defaultProps;
|
|
9831
9831
|
|
|
9832
|
-
const _excluded$i = ["placeholder", "value", "size", "isInvalid", "readOnly", "disabled", "control", "name"];
|
|
9832
|
+
const _excluded$i = ["placeholder", "value", "size", "isInvalid", "readOnly", "disabled", "control", "name", "maxValueLength", "maxLength", "thousandSeparator"];
|
|
9833
9833
|
var _jsxFileName$F = "/Users/ryanakbar20/Documents/project/majoo/majoo-ui/packages/react/src/components/form/components/InputNumber/InputNumber.js";
|
|
9834
9834
|
const StyledInput = styled(NumberFormat, {
|
|
9835
9835
|
// Reset
|
|
@@ -10003,6 +10003,14 @@ const StyledInput = styled(NumberFormat, {
|
|
|
10003
10003
|
size: 'lg'
|
|
10004
10004
|
}
|
|
10005
10005
|
});
|
|
10006
|
+
function countThousandSeparatorsByLength(numberLength) {
|
|
10007
|
+
const separatorCount = Math.floor((numberLength - 1) / 3);
|
|
10008
|
+
return separatorCount;
|
|
10009
|
+
}
|
|
10010
|
+
function getMaxValueLength(maxValue, prefix = '', suffix = '', thousandSeparator) {
|
|
10011
|
+
const tsLength = thousandSeparator ? countThousandSeparatorsByLength(maxValue) : 0;
|
|
10012
|
+
return maxValue + (prefix === null || prefix === void 0 ? void 0 : prefix.length) + (suffix === null || suffix === void 0 ? void 0 : suffix.length) + tsLength;
|
|
10013
|
+
}
|
|
10006
10014
|
const InputNumber = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
10007
10015
|
let {
|
|
10008
10016
|
placeholder,
|
|
@@ -10012,7 +10020,10 @@ const InputNumber = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
10012
10020
|
readOnly,
|
|
10013
10021
|
disabled,
|
|
10014
10022
|
control,
|
|
10015
|
-
name
|
|
10023
|
+
name,
|
|
10024
|
+
maxValueLength,
|
|
10025
|
+
maxLength,
|
|
10026
|
+
thousandSeparator
|
|
10016
10027
|
} = _ref,
|
|
10017
10028
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
10018
10029
|
return /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
@@ -10033,14 +10044,14 @@ const InputNumber = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
10033
10044
|
__self: undefined,
|
|
10034
10045
|
__source: {
|
|
10035
10046
|
fileName: _jsxFileName$F,
|
|
10036
|
-
lineNumber:
|
|
10047
|
+
lineNumber: 225,
|
|
10037
10048
|
columnNumber: 9
|
|
10038
10049
|
}
|
|
10039
10050
|
}),
|
|
10040
10051
|
__self: undefined,
|
|
10041
10052
|
__source: {
|
|
10042
10053
|
fileName: _jsxFileName$F,
|
|
10043
|
-
lineNumber:
|
|
10054
|
+
lineNumber: 222,
|
|
10044
10055
|
columnNumber: 5
|
|
10045
10056
|
}
|
|
10046
10057
|
}, /*#__PURE__*/React__default.createElement(StyledInput, _extends({
|
|
@@ -10051,12 +10062,14 @@ const InputNumber = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
10051
10062
|
isInvalid: isInvalid,
|
|
10052
10063
|
readOnly: readOnly,
|
|
10053
10064
|
isReadOnly: readOnly && !(props !== null && props !== void 0 && props.inputGroup) && !(props !== null && props !== void 0 && props.asChild),
|
|
10054
|
-
disabled: disabled
|
|
10065
|
+
disabled: disabled,
|
|
10066
|
+
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props === null || props === void 0 ? void 0 : props.prefix, props === null || props === void 0 ? void 0 : props.suffix, thousandSeparator) : maxLength,
|
|
10067
|
+
thousandSeparator: thousandSeparator
|
|
10055
10068
|
}, props, {
|
|
10056
10069
|
__self: undefined,
|
|
10057
10070
|
__source: {
|
|
10058
10071
|
fileName: _jsxFileName$F,
|
|
10059
|
-
lineNumber:
|
|
10072
|
+
lineNumber: 234,
|
|
10060
10073
|
columnNumber: 7
|
|
10061
10074
|
}
|
|
10062
10075
|
})));
|
|
@@ -10908,7 +10921,9 @@ const Popover = ({
|
|
|
10908
10921
|
const {
|
|
10909
10922
|
getReferenceProps,
|
|
10910
10923
|
getFloatingProps
|
|
10911
|
-
} = useInteractions([useClick(floatingHook.context
|
|
10924
|
+
} = useInteractions([useClick(floatingHook.context, {
|
|
10925
|
+
keyboardHandlers: false
|
|
10926
|
+
}), useDismiss(floatingHook.context, {
|
|
10912
10927
|
ancestorScroll: _hideOnScroll
|
|
10913
10928
|
})]);
|
|
10914
10929
|
const value = {
|
|
@@ -10923,7 +10938,7 @@ const Popover = ({
|
|
|
10923
10938
|
__self: undefined,
|
|
10924
10939
|
__source: {
|
|
10925
10940
|
fileName: _jsxFileName$y,
|
|
10926
|
-
lineNumber:
|
|
10941
|
+
lineNumber: 62,
|
|
10927
10942
|
columnNumber: 10
|
|
10928
10943
|
}
|
|
10929
10944
|
}, children);
|
|
@@ -10965,14 +10980,14 @@ const PopoverContent = ({
|
|
|
10965
10980
|
__self: undefined,
|
|
10966
10981
|
__source: {
|
|
10967
10982
|
fileName: _jsxFileName$y,
|
|
10968
|
-
lineNumber:
|
|
10983
|
+
lineNumber: 80,
|
|
10969
10984
|
columnNumber: 65
|
|
10970
10985
|
}
|
|
10971
10986
|
}, child),
|
|
10972
10987
|
__self: undefined,
|
|
10973
10988
|
__source: {
|
|
10974
10989
|
fileName: _jsxFileName$y,
|
|
10975
|
-
lineNumber:
|
|
10990
|
+
lineNumber: 80,
|
|
10976
10991
|
columnNumber: 5
|
|
10977
10992
|
}
|
|
10978
10993
|
}, /*#__PURE__*/React__default.createElement(FloatingFocusManager, {
|
|
@@ -10983,7 +10998,7 @@ const PopoverContent = ({
|
|
|
10983
10998
|
__self: undefined,
|
|
10984
10999
|
__source: {
|
|
10985
11000
|
fileName: _jsxFileName$y,
|
|
10986
|
-
lineNumber:
|
|
11001
|
+
lineNumber: 81,
|
|
10987
11002
|
columnNumber: 7
|
|
10988
11003
|
}
|
|
10989
11004
|
}, /*#__PURE__*/React__default.createElement("div", _extends({}, getFloatingProps({
|
|
@@ -10998,7 +11013,7 @@ const PopoverContent = ({
|
|
|
10998
11013
|
__self: undefined,
|
|
10999
11014
|
__source: {
|
|
11000
11015
|
fileName: _jsxFileName$y,
|
|
11001
|
-
lineNumber:
|
|
11016
|
+
lineNumber: 82,
|
|
11002
11017
|
columnNumber: 9
|
|
11003
11018
|
}
|
|
11004
11019
|
}), children))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
@@ -11019,7 +11034,7 @@ const PopoverClose = _ref => {
|
|
|
11019
11034
|
__self: undefined,
|
|
11020
11035
|
__source: {
|
|
11021
11036
|
fileName: _jsxFileName$y,
|
|
11022
|
-
lineNumber:
|
|
11037
|
+
lineNumber: 106,
|
|
11023
11038
|
columnNumber: 5
|
|
11024
11039
|
}
|
|
11025
11040
|
}), children);
|
package/index.umd.js
CHANGED
|
@@ -9910,7 +9910,7 @@
|
|
|
9910
9910
|
}(React__default["default"].Component);
|
|
9911
9911
|
NumberFormat.defaultProps = defaultProps;
|
|
9912
9912
|
|
|
9913
|
-
const _excluded$i = ["placeholder", "value", "size", "isInvalid", "readOnly", "disabled", "control", "name"];
|
|
9913
|
+
const _excluded$i = ["placeholder", "value", "size", "isInvalid", "readOnly", "disabled", "control", "name", "maxValueLength", "maxLength", "thousandSeparator"];
|
|
9914
9914
|
var _jsxFileName$F = "/Users/ryanakbar20/Documents/project/majoo/majoo-ui/packages/react/src/components/form/components/InputNumber/InputNumber.js";
|
|
9915
9915
|
const StyledInput = styled(NumberFormat, {
|
|
9916
9916
|
// Reset
|
|
@@ -10084,6 +10084,14 @@
|
|
|
10084
10084
|
size: 'lg'
|
|
10085
10085
|
}
|
|
10086
10086
|
});
|
|
10087
|
+
function countThousandSeparatorsByLength(numberLength) {
|
|
10088
|
+
const separatorCount = Math.floor((numberLength - 1) / 3);
|
|
10089
|
+
return separatorCount;
|
|
10090
|
+
}
|
|
10091
|
+
function getMaxValueLength(maxValue, prefix = '', suffix = '', thousandSeparator) {
|
|
10092
|
+
const tsLength = thousandSeparator ? countThousandSeparatorsByLength(maxValue) : 0;
|
|
10093
|
+
return maxValue + (prefix === null || prefix === void 0 ? void 0 : prefix.length) + (suffix === null || suffix === void 0 ? void 0 : suffix.length) + tsLength;
|
|
10094
|
+
}
|
|
10087
10095
|
const InputNumber = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
10088
10096
|
let {
|
|
10089
10097
|
placeholder,
|
|
@@ -10093,7 +10101,10 @@
|
|
|
10093
10101
|
readOnly,
|
|
10094
10102
|
disabled,
|
|
10095
10103
|
control,
|
|
10096
|
-
name
|
|
10104
|
+
name,
|
|
10105
|
+
maxValueLength,
|
|
10106
|
+
maxLength,
|
|
10107
|
+
thousandSeparator
|
|
10097
10108
|
} = _ref,
|
|
10098
10109
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
10099
10110
|
return /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
@@ -10114,14 +10125,14 @@
|
|
|
10114
10125
|
__self: undefined,
|
|
10115
10126
|
__source: {
|
|
10116
10127
|
fileName: _jsxFileName$F,
|
|
10117
|
-
lineNumber:
|
|
10128
|
+
lineNumber: 225,
|
|
10118
10129
|
columnNumber: 9
|
|
10119
10130
|
}
|
|
10120
10131
|
}),
|
|
10121
10132
|
__self: undefined,
|
|
10122
10133
|
__source: {
|
|
10123
10134
|
fileName: _jsxFileName$F,
|
|
10124
|
-
lineNumber:
|
|
10135
|
+
lineNumber: 222,
|
|
10125
10136
|
columnNumber: 5
|
|
10126
10137
|
}
|
|
10127
10138
|
}, /*#__PURE__*/React__default["default"].createElement(StyledInput, _extends({
|
|
@@ -10132,12 +10143,14 @@
|
|
|
10132
10143
|
isInvalid: isInvalid,
|
|
10133
10144
|
readOnly: readOnly,
|
|
10134
10145
|
isReadOnly: readOnly && !(props !== null && props !== void 0 && props.inputGroup) && !(props !== null && props !== void 0 && props.asChild),
|
|
10135
|
-
disabled: disabled
|
|
10146
|
+
disabled: disabled,
|
|
10147
|
+
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props === null || props === void 0 ? void 0 : props.prefix, props === null || props === void 0 ? void 0 : props.suffix, thousandSeparator) : maxLength,
|
|
10148
|
+
thousandSeparator: thousandSeparator
|
|
10136
10149
|
}, props, {
|
|
10137
10150
|
__self: undefined,
|
|
10138
10151
|
__source: {
|
|
10139
10152
|
fileName: _jsxFileName$F,
|
|
10140
|
-
lineNumber:
|
|
10153
|
+
lineNumber: 234,
|
|
10141
10154
|
columnNumber: 7
|
|
10142
10155
|
}
|
|
10143
10156
|
})));
|
|
@@ -10989,7 +11002,9 @@
|
|
|
10989
11002
|
const {
|
|
10990
11003
|
getReferenceProps,
|
|
10991
11004
|
getFloatingProps
|
|
10992
|
-
} = react$1.useInteractions([react$1.useClick(floatingHook.context
|
|
11005
|
+
} = react$1.useInteractions([react$1.useClick(floatingHook.context, {
|
|
11006
|
+
keyboardHandlers: false
|
|
11007
|
+
}), react$1.useDismiss(floatingHook.context, {
|
|
10993
11008
|
ancestorScroll: _hideOnScroll
|
|
10994
11009
|
})]);
|
|
10995
11010
|
const value = {
|
|
@@ -11004,7 +11019,7 @@
|
|
|
11004
11019
|
__self: undefined,
|
|
11005
11020
|
__source: {
|
|
11006
11021
|
fileName: _jsxFileName$y,
|
|
11007
|
-
lineNumber:
|
|
11022
|
+
lineNumber: 62,
|
|
11008
11023
|
columnNumber: 10
|
|
11009
11024
|
}
|
|
11010
11025
|
}, children);
|
|
@@ -11046,14 +11061,14 @@
|
|
|
11046
11061
|
__self: undefined,
|
|
11047
11062
|
__source: {
|
|
11048
11063
|
fileName: _jsxFileName$y,
|
|
11049
|
-
lineNumber:
|
|
11064
|
+
lineNumber: 80,
|
|
11050
11065
|
columnNumber: 65
|
|
11051
11066
|
}
|
|
11052
11067
|
}, child),
|
|
11053
11068
|
__self: undefined,
|
|
11054
11069
|
__source: {
|
|
11055
11070
|
fileName: _jsxFileName$y,
|
|
11056
|
-
lineNumber:
|
|
11071
|
+
lineNumber: 80,
|
|
11057
11072
|
columnNumber: 5
|
|
11058
11073
|
}
|
|
11059
11074
|
}, /*#__PURE__*/React__default["default"].createElement(react$1.FloatingFocusManager, {
|
|
@@ -11064,7 +11079,7 @@
|
|
|
11064
11079
|
__self: undefined,
|
|
11065
11080
|
__source: {
|
|
11066
11081
|
fileName: _jsxFileName$y,
|
|
11067
|
-
lineNumber:
|
|
11082
|
+
lineNumber: 81,
|
|
11068
11083
|
columnNumber: 7
|
|
11069
11084
|
}
|
|
11070
11085
|
}, /*#__PURE__*/React__default["default"].createElement("div", _extends({}, getFloatingProps({
|
|
@@ -11079,7 +11094,7 @@
|
|
|
11079
11094
|
__self: undefined,
|
|
11080
11095
|
__source: {
|
|
11081
11096
|
fileName: _jsxFileName$y,
|
|
11082
|
-
lineNumber:
|
|
11097
|
+
lineNumber: 82,
|
|
11083
11098
|
columnNumber: 9
|
|
11084
11099
|
}
|
|
11085
11100
|
}), children))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
@@ -11100,7 +11115,7 @@
|
|
|
11100
11115
|
__self: undefined,
|
|
11101
11116
|
__source: {
|
|
11102
11117
|
fileName: _jsxFileName$y,
|
|
11103
|
-
lineNumber:
|
|
11118
|
+
lineNumber: 106,
|
|
11104
11119
|
columnNumber: 5
|
|
11105
11120
|
}
|
|
11106
11121
|
}), children);
|