@majoo-ui/react 1.59.9-rc.2 → 1.59.9-rc.3
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 +241 -233
- package/index.umd.js +241 -233
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -5093,7 +5093,7 @@
|
|
|
5093
5093
|
onClick: e => {
|
|
5094
5094
|
e.preventDefault();
|
|
5095
5095
|
e.stopPropagation();
|
|
5096
|
-
value
|
|
5096
|
+
value === null || value === void 0 || value.onRemove();
|
|
5097
5097
|
},
|
|
5098
5098
|
__self: undefined,
|
|
5099
5099
|
__source: {
|
|
@@ -5112,6 +5112,7 @@
|
|
|
5112
5112
|
}
|
|
5113
5113
|
})));
|
|
5114
5114
|
const SingleTagBanner = props => {
|
|
5115
|
+
var _props$icon;
|
|
5115
5116
|
return /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5116
5117
|
gap: 2,
|
|
5117
5118
|
direction: "column",
|
|
@@ -5137,7 +5138,7 @@
|
|
|
5137
5138
|
lineNumber: 212,
|
|
5138
5139
|
columnNumber: 9
|
|
5139
5140
|
}
|
|
5140
|
-
}, (props
|
|
5141
|
+
}, (props === null || props === void 0 ? void 0 : props.icon) && /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5141
5142
|
css: {
|
|
5142
5143
|
marginTop: '-2px'
|
|
5143
5144
|
},
|
|
@@ -5147,7 +5148,7 @@
|
|
|
5147
5148
|
lineNumber: 213,
|
|
5148
5149
|
columnNumber: 27
|
|
5149
5150
|
}
|
|
5150
|
-
}, props
|
|
5151
|
+
}, props === null || props === void 0 || (_props$icon = props.icon) === null || _props$icon === void 0 ? void 0 : _props$icon.call(props)), /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5151
5152
|
gap: 2,
|
|
5152
5153
|
direction: "column",
|
|
5153
5154
|
css: {
|
|
@@ -5178,7 +5179,7 @@
|
|
|
5178
5179
|
onClick: e => {
|
|
5179
5180
|
e.preventDefault();
|
|
5180
5181
|
e.stopPropagation();
|
|
5181
|
-
props
|
|
5182
|
+
props === null || props === void 0 || props.onRemove();
|
|
5182
5183
|
},
|
|
5183
5184
|
closeCenter: !props.title && !props.link,
|
|
5184
5185
|
__self: undefined,
|
|
@@ -7996,7 +7997,7 @@
|
|
|
7996
7997
|
React.useEffect(() => {
|
|
7997
7998
|
if (textareaRef.current) {
|
|
7998
7999
|
textareaRef.current.style.height = '50px';
|
|
7999
|
-
const scrollHeight = textareaRef
|
|
8000
|
+
const scrollHeight = textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current.scrollHeight;
|
|
8000
8001
|
textareaRef.current.style.height = scrollHeight + 5 + 'px';
|
|
8001
8002
|
}
|
|
8002
8003
|
}, []);
|
|
@@ -8051,7 +8052,7 @@
|
|
|
8051
8052
|
var _jsxFileName$I = "/Users/ryanakbar20/Documents/project/majoo/majoo-ui/packages/react/src/components/form/components/InputRadio/InputRadioGroup.js";
|
|
8052
8053
|
const RadioGroup = styled(RadioGroupPrimitive__namespace.Root, Flex$1);
|
|
8053
8054
|
function InputRadioGroup(props) {
|
|
8054
|
-
return (props
|
|
8055
|
+
return (props === null || props === void 0 ? void 0 : props.children) && /*#__PURE__*/React__default["default"].createElement(InputRadioContext.Provider, {
|
|
8055
8056
|
value: props,
|
|
8056
8057
|
__self: this,
|
|
8057
8058
|
__source: {
|
|
@@ -8066,7 +8067,7 @@
|
|
|
8066
8067
|
lineNumber: 14,
|
|
8067
8068
|
columnNumber: 9
|
|
8068
8069
|
}
|
|
8069
|
-
}), React__default["default"].Children.map(props
|
|
8070
|
+
}), React__default["default"].Children.map(props === null || props === void 0 ? void 0 : props.children, child => /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
8070
8071
|
style: Object.assign({}, child.props.style, {
|
|
8071
8072
|
opacity: 1
|
|
8072
8073
|
})
|
|
@@ -8254,8 +8255,9 @@
|
|
|
8254
8255
|
return /*#__PURE__*/React__default["default"].createElement(InputNumber, _extends({}, inputProps, {
|
|
8255
8256
|
readOnly: readOnly,
|
|
8256
8257
|
onFocus: () => {
|
|
8258
|
+
var _inputProps$onFocus;
|
|
8257
8259
|
onValueChange(props.value);
|
|
8258
|
-
inputProps
|
|
8260
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onFocus = inputProps.onFocus) === null || _inputProps$onFocus === void 0 || _inputProps$onFocus.call(inputProps);
|
|
8259
8261
|
},
|
|
8260
8262
|
asChild: true,
|
|
8261
8263
|
__self: this,
|
|
@@ -8270,8 +8272,9 @@
|
|
|
8270
8272
|
disabled: disabled,
|
|
8271
8273
|
readOnly: readOnly,
|
|
8272
8274
|
onFocus: () => {
|
|
8275
|
+
var _inputProps$onFocus2;
|
|
8273
8276
|
onValueChange(props.value);
|
|
8274
|
-
inputProps
|
|
8277
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onFocus2 = inputProps.onFocus) === null || _inputProps$onFocus2 === void 0 || _inputProps$onFocus2.call(inputProps);
|
|
8275
8278
|
},
|
|
8276
8279
|
asChild: true,
|
|
8277
8280
|
__self: this,
|
|
@@ -10765,24 +10768,24 @@
|
|
|
10765
10768
|
allowLeadingZeros,
|
|
10766
10769
|
format
|
|
10767
10770
|
} = Object.assign({}, ref);
|
|
10768
|
-
const formattedValueStartsWithZero = (_formattedValue = formattedValue)
|
|
10769
|
-
const formattedWithZeroAndSuffix = (_formattedValue2 = formattedValue)
|
|
10771
|
+
const formattedValueStartsWithZero = (_formattedValue = formattedValue) === null || _formattedValue === void 0 ? void 0 : _formattedValue.startsWith(`${prefix}0`);
|
|
10772
|
+
const formattedWithZeroAndSuffix = (_formattedValue2 = formattedValue) === null || _formattedValue2 === void 0 ? void 0 : _formattedValue2.endsWith(`0${suffix}`);
|
|
10770
10773
|
const emptyFormattedValue = prefix || suffix || prefix + suffix || '';
|
|
10771
10774
|
if ((formattedValueStartsWithZero || formattedWithZeroAndSuffix) && !allowLeadingZeros && !format) {
|
|
10772
10775
|
var _formattedValue3, _input$value;
|
|
10773
10776
|
const isSpecialChar = /^[+-]/.test(formattedValue);
|
|
10774
|
-
if (formattedValue !== `${prefix}0${suffix}` && !((_formattedValue3 = formattedValue)
|
|
10777
|
+
if (formattedValue !== `${prefix}0${suffix}` && !((_formattedValue3 = formattedValue) !== null && _formattedValue3 !== void 0 && _formattedValue3.includes('0,'))) {
|
|
10775
10778
|
var _formattedValue4, _numAsString;
|
|
10776
|
-
formattedValue = (_formattedValue4 = formattedValue)
|
|
10777
|
-
numAsString = (_numAsString = numAsString)
|
|
10779
|
+
formattedValue = (_formattedValue4 = formattedValue) === null || _formattedValue4 === void 0 ? void 0 : _formattedValue4.replace(new RegExp(`^${isSpecialChar ? '\\' : ''}${prefix}0+${suffix}`), emptyFormattedValue);
|
|
10780
|
+
numAsString = (_numAsString = numAsString) === null || _numAsString === void 0 ? void 0 : _numAsString.replace(/^0+/, '');
|
|
10778
10781
|
}
|
|
10779
|
-
if (formattedValue === emptyFormattedValue && !numAsString && [`${prefix}00${suffix}`, `${prefix}0${suffix}`].includes(input
|
|
10782
|
+
if (formattedValue === emptyFormattedValue && !numAsString && [`${prefix}00${suffix}`, `${prefix}0${suffix}`].includes(input === null || input === void 0 ? void 0 : input.value)) {
|
|
10780
10783
|
formattedValue = `${prefix}0${suffix}`;
|
|
10781
10784
|
numAsString = '0';
|
|
10782
|
-
} else if (input
|
|
10785
|
+
} else if (input !== null && input !== void 0 && (_input$value = input.value) !== null && _input$value !== void 0 && _input$value.includes('0,')) {
|
|
10783
10786
|
allowLeadingZeros = true;
|
|
10784
|
-
formattedValue = input
|
|
10785
|
-
numAsString = this.removeFormatting(input
|
|
10787
|
+
formattedValue = input === null || input === void 0 ? void 0 : input.value;
|
|
10788
|
+
numAsString = this.removeFormatting(input === null || input === void 0 ? void 0 : input.value);
|
|
10786
10789
|
}
|
|
10787
10790
|
}
|
|
10788
10791
|
//end adjustment
|
|
@@ -11240,7 +11243,7 @@
|
|
|
11240
11243
|
}
|
|
11241
11244
|
function getMaxValueLength(maxValue, prefix = '', suffix = '', thousandSeparator) {
|
|
11242
11245
|
const tsLength = thousandSeparator ? countThousandSeparatorsByLength(maxValue) : 0;
|
|
11243
|
-
return maxValue + (prefix
|
|
11246
|
+
return maxValue + (prefix === null || prefix === void 0 ? void 0 : prefix.length) + (suffix === null || suffix === void 0 ? void 0 : suffix.length) + tsLength;
|
|
11244
11247
|
}
|
|
11245
11248
|
const InputNumber = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
11246
11249
|
let {
|
|
@@ -11292,9 +11295,9 @@
|
|
|
11292
11295
|
size: size,
|
|
11293
11296
|
isInvalid: isInvalid,
|
|
11294
11297
|
readOnly: readOnly,
|
|
11295
|
-
isReadOnly: readOnly && !(props
|
|
11298
|
+
isReadOnly: readOnly && !(props !== null && props !== void 0 && props.inputGroup) && !(props !== null && props !== void 0 && props.asChild),
|
|
11296
11299
|
disabled: disabled,
|
|
11297
|
-
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props
|
|
11300
|
+
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props === null || props === void 0 ? void 0 : props.prefix, props === null || props === void 0 ? void 0 : props.suffix, thousandSeparator) : maxLength,
|
|
11298
11301
|
thousandSeparator: thousandSeparator
|
|
11299
11302
|
}, props, {
|
|
11300
11303
|
__self: undefined,
|
|
@@ -11596,16 +11599,16 @@
|
|
|
11596
11599
|
const addTags = event => {
|
|
11597
11600
|
if (event.key === 'Enter' && event.target.value !== '' && max !== tags.length) {
|
|
11598
11601
|
if (tags.find(tag => tag.toLowerCase() === event.target.value.toLowerCase())) {
|
|
11599
|
-
onEnter
|
|
11602
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11600
11603
|
key: 'duplicate',
|
|
11601
11604
|
value: event.target.value
|
|
11602
11605
|
});
|
|
11603
11606
|
return;
|
|
11604
11607
|
}
|
|
11605
|
-
if (pattern && pattern
|
|
11608
|
+
if (pattern && pattern !== null && pattern !== void 0 && pattern.regex) {
|
|
11606
11609
|
const regex = new RegExp(pattern.regex);
|
|
11607
11610
|
if (!regex.test(event.target.value)) {
|
|
11608
|
-
onEnter
|
|
11611
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11609
11612
|
key: 'error',
|
|
11610
11613
|
value: event.target.value
|
|
11611
11614
|
});
|
|
@@ -11614,7 +11617,7 @@
|
|
|
11614
11617
|
}
|
|
11615
11618
|
}
|
|
11616
11619
|
setRegexError(false);
|
|
11617
|
-
onEnter
|
|
11620
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11618
11621
|
key: 'success',
|
|
11619
11622
|
value: event.target.value
|
|
11620
11623
|
});
|
|
@@ -11626,7 +11629,7 @@
|
|
|
11626
11629
|
if (disabled || readOnly) {
|
|
11627
11630
|
return tags;
|
|
11628
11631
|
} else if (key === 'removeTag' || key === 'Backspace') {
|
|
11629
|
-
onRemoveItem
|
|
11632
|
+
onRemoveItem === null || onRemoveItem === void 0 || onRemoveItem(tags[index]);
|
|
11630
11633
|
setTags([...tags.filter(tag => tags.indexOf(tag) !== index)]);
|
|
11631
11634
|
}
|
|
11632
11635
|
};
|
|
@@ -11677,7 +11680,7 @@
|
|
|
11677
11680
|
lineNumber: 180,
|
|
11678
11681
|
columnNumber: 9
|
|
11679
11682
|
}
|
|
11680
|
-
})), regexError && pattern && (pattern
|
|
11683
|
+
})), regexError && pattern && (pattern !== null && pattern !== void 0 && pattern.errorMessage ? /*#__PURE__*/React__default["default"].createElement(FormHelper, {
|
|
11681
11684
|
color: "red",
|
|
11682
11685
|
__self: this,
|
|
11683
11686
|
__source: {
|
|
@@ -11985,14 +11988,14 @@
|
|
|
11985
11988
|
t
|
|
11986
11989
|
} = reactI18next.useTranslation(['MajooUI/inputSearchbox', 'translation']);
|
|
11987
11990
|
const [value, setValue] = React.useState(defaultValue);
|
|
11988
|
-
const inputValue = (_props$value = props
|
|
11989
|
-
const debounceChange = React.useCallback(debounce__default["default"](e => onChange
|
|
11991
|
+
const inputValue = (_props$value = props === null || props === void 0 ? void 0 : props.value) != null ? _props$value : value;
|
|
11992
|
+
const debounceChange = React.useCallback(debounce__default["default"](e => onChange === null || onChange === void 0 ? void 0 : onChange(e), 1000), [onChange]);
|
|
11990
11993
|
const handleChange = React.useCallback(e => {
|
|
11991
11994
|
setValue(e.target.value);
|
|
11992
11995
|
if (withDebounce) {
|
|
11993
11996
|
debounceChange(e.target.value);
|
|
11994
11997
|
} else {
|
|
11995
|
-
onChange
|
|
11998
|
+
onChange === null || onChange === void 0 || onChange(e.target.value);
|
|
11996
11999
|
}
|
|
11997
12000
|
}, [onChange, debounceChange, withDebounce]);
|
|
11998
12001
|
const handleClearButtonClick = e => {
|
|
@@ -12045,7 +12048,7 @@
|
|
|
12045
12048
|
columnNumber: 7
|
|
12046
12049
|
}
|
|
12047
12050
|
})), /*#__PURE__*/React__default["default"].createElement(InputRightElement, {
|
|
12048
|
-
children: (inputValue
|
|
12051
|
+
children: (inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(SvgCloseFilled, {
|
|
12049
12052
|
color: colors$7.iconSecondary,
|
|
12050
12053
|
__self: undefined,
|
|
12051
12054
|
__source: {
|
|
@@ -12290,7 +12293,7 @@
|
|
|
12290
12293
|
middleware: [react$1.offset(_sideOffset), react$1.shift(), _flip && react$1.flip()],
|
|
12291
12294
|
onOpenChange: isOpen => {
|
|
12292
12295
|
setOpenState(isOpen);
|
|
12293
|
-
!isOpen && (onClose
|
|
12296
|
+
!isOpen && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
12294
12297
|
},
|
|
12295
12298
|
placement
|
|
12296
12299
|
});
|
|
@@ -13177,7 +13180,7 @@
|
|
|
13177
13180
|
return;
|
|
13178
13181
|
}
|
|
13179
13182
|
(_b = scrollerRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo({
|
|
13180
|
-
top: selectedIndex *
|
|
13183
|
+
top: selectedIndex * 60
|
|
13181
13184
|
});
|
|
13182
13185
|
}, [query, search, openOptions, open, selectedIndex]);
|
|
13183
13186
|
var handleInputValue = function handleInputValue(value, isReset) {
|
|
@@ -14165,13 +14168,13 @@
|
|
|
14165
14168
|
const isShowSelectAll = showSelectAll && !maxSelectedItem;
|
|
14166
14169
|
React.useEffect(() => {
|
|
14167
14170
|
var _scrollerRef$current;
|
|
14168
|
-
(_scrollerRef$current = scrollerRef.current)
|
|
14171
|
+
(_scrollerRef$current = scrollerRef.current) === null || _scrollerRef$current === void 0 || _scrollerRef$current.scrollTo({
|
|
14169
14172
|
top: 0
|
|
14170
14173
|
});
|
|
14171
14174
|
}, [query]);
|
|
14172
14175
|
React.useEffect(() => {
|
|
14173
|
-
if (defaultValue
|
|
14174
|
-
if (value
|
|
14176
|
+
if (defaultValue !== null && defaultValue !== void 0 && defaultValue.length) {
|
|
14177
|
+
if (value !== null && value !== void 0 && value.length) {
|
|
14175
14178
|
setInputSelectValue(value);
|
|
14176
14179
|
}
|
|
14177
14180
|
} else {
|
|
@@ -14236,7 +14239,7 @@
|
|
|
14236
14239
|
removeSelectedItem,
|
|
14237
14240
|
selectedItems
|
|
14238
14241
|
} = Downshift.useMultipleSelection({
|
|
14239
|
-
selectedItems: selectedValue.length > 0 ? initItem
|
|
14242
|
+
selectedItems: selectedValue.length > 0 ? initItem === null || initItem === void 0 || (_initItem$reduce = initItem.reduce((acc, item) => [...acc, item, ...(item.children ? item.children : [])], [])) === null || _initItem$reduce === void 0 ? void 0 : _initItem$reduce.filter(item => selectedValue.includes(item.id)) : []
|
|
14240
14243
|
});
|
|
14241
14244
|
const generateOptions = data => {
|
|
14242
14245
|
return data.map(option => {
|
|
@@ -14258,7 +14261,7 @@
|
|
|
14258
14261
|
};
|
|
14259
14262
|
const debouncedSearch = React__default["default"].useRef(debounce__default["default"](_async(function (query) {
|
|
14260
14263
|
setQuery(query);
|
|
14261
|
-
onSearch
|
|
14264
|
+
onSearch === null || onSearch === void 0 || onSearch(query);
|
|
14262
14265
|
return _await();
|
|
14263
14266
|
}), 1000)).current;
|
|
14264
14267
|
React__default["default"].useEffect(() => {
|
|
@@ -14267,7 +14270,7 @@
|
|
|
14267
14270
|
};
|
|
14268
14271
|
}, [debouncedSearch]);
|
|
14269
14272
|
const handleInputValue = input => {
|
|
14270
|
-
onSearch
|
|
14273
|
+
onSearch === null || onSearch === void 0 || onSearch(input);
|
|
14271
14274
|
if (input === '') {
|
|
14272
14275
|
if (disabledOptions.length > 0) {
|
|
14273
14276
|
setItems(generateOptions(sortDisabled));
|
|
@@ -14275,9 +14278,9 @@
|
|
|
14275
14278
|
return setItems(sortValue);
|
|
14276
14279
|
}
|
|
14277
14280
|
} else {
|
|
14278
|
-
let filterItems = option
|
|
14279
|
-
var _item$name;
|
|
14280
|
-
return item
|
|
14281
|
+
let filterItems = option === null || option === void 0 ? void 0 : option.filter(item => {
|
|
14282
|
+
var _item$name, _item$name$includes, _input$toLocaleLowerC;
|
|
14283
|
+
return item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 || (_item$name = _item$name.toLowerCase()) === null || _item$name === void 0 || (_item$name$includes = _item$name.includes) === null || _item$name$includes === void 0 ? void 0 : _item$name$includes.call(_item$name, input === null || input === void 0 || (_input$toLocaleLowerC = input.toLocaleLowerCase) === null || _input$toLocaleLowerC === void 0 ? void 0 : _input$toLocaleLowerC.call(input));
|
|
14281
14284
|
});
|
|
14282
14285
|
setItems(filterItems);
|
|
14283
14286
|
}
|
|
@@ -14286,10 +14289,10 @@
|
|
|
14286
14289
|
if (disabled || readOnly) {
|
|
14287
14290
|
return selectedValue;
|
|
14288
14291
|
} else {
|
|
14289
|
-
if ((selected
|
|
14292
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.id) === 'counter') {
|
|
14290
14293
|
setSelectedValue([]);
|
|
14291
14294
|
setInputSelectValue([]);
|
|
14292
|
-
onChange
|
|
14295
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14293
14296
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14294
14297
|
removeSelectedItem(selectedValue[i]);
|
|
14295
14298
|
}
|
|
@@ -14299,7 +14302,7 @@
|
|
|
14299
14302
|
setSelectedValue(filterItems);
|
|
14300
14303
|
setInputSelectValue(filterItems);
|
|
14301
14304
|
if (selected.id !== '!all') {
|
|
14302
|
-
onChange
|
|
14305
|
+
onChange === null || onChange === void 0 || onChange(filterItems);
|
|
14303
14306
|
}
|
|
14304
14307
|
}
|
|
14305
14308
|
}
|
|
@@ -14337,9 +14340,9 @@
|
|
|
14337
14340
|
if (selectedItem.id === '!all') {
|
|
14338
14341
|
items.forEach(item => {
|
|
14339
14342
|
var _item$children;
|
|
14340
|
-
if (item
|
|
14343
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
|
14341
14344
|
var _item$children2;
|
|
14342
|
-
item
|
|
14345
|
+
item === null || item === void 0 || (_item$children2 = item.children) === null || _item$children2 === void 0 || _item$children2.forEach(item => {
|
|
14343
14346
|
removeSelectedItem(item);
|
|
14344
14347
|
});
|
|
14345
14348
|
} else {
|
|
@@ -14348,7 +14351,7 @@
|
|
|
14348
14351
|
});
|
|
14349
14352
|
setSelectedValue([]);
|
|
14350
14353
|
setInputSelectValue([]);
|
|
14351
|
-
onChange
|
|
14354
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14352
14355
|
} else {
|
|
14353
14356
|
removeItem(selectedItem);
|
|
14354
14357
|
}
|
|
@@ -14359,9 +14362,9 @@
|
|
|
14359
14362
|
const itemIds = [];
|
|
14360
14363
|
items.forEach(item => {
|
|
14361
14364
|
var _item$children3;
|
|
14362
|
-
if (item
|
|
14365
|
+
if (item !== null && item !== void 0 && (_item$children3 = item.children) !== null && _item$children3 !== void 0 && _item$children3.length) {
|
|
14363
14366
|
var _item$children4;
|
|
14364
|
-
item
|
|
14367
|
+
item === null || item === void 0 || (_item$children4 = item.children) === null || _item$children4 === void 0 || _item$children4.forEach(item => {
|
|
14365
14368
|
addSelectedItem(item);
|
|
14366
14369
|
itemIds.push(item.id);
|
|
14367
14370
|
});
|
|
@@ -14373,16 +14376,16 @@
|
|
|
14373
14376
|
setSelectedValue(itemIds);
|
|
14374
14377
|
setInputSelectValue(itemIds);
|
|
14375
14378
|
// onChange?.(itemIds.slice(1).filter(id => !items.find(item => item.id === id)?.children?.length));
|
|
14376
|
-
onChange
|
|
14379
|
+
onChange === null || onChange === void 0 || onChange(itemIds.slice(1));
|
|
14377
14380
|
} else {
|
|
14378
14381
|
var _selectedItem$childre;
|
|
14379
14382
|
//start check if item have children (option group)
|
|
14380
|
-
if (selectedItem
|
|
14383
|
+
if (selectedItem !== null && selectedItem !== void 0 && (_selectedItem$childre = selectedItem.children) !== null && _selectedItem$childre !== void 0 && _selectedItem$childre.length) {
|
|
14381
14384
|
var _selectedItem$childre2;
|
|
14382
14385
|
const itemIdsSelect = [];
|
|
14383
14386
|
const itemIdsUnSelect = [];
|
|
14384
|
-
selectedItem
|
|
14385
|
-
if (selectedValue
|
|
14387
|
+
selectedItem === null || selectedItem === void 0 || (_selectedItem$childre2 = selectedItem.children) === null || _selectedItem$childre2 === void 0 || _selectedItem$childre2.forEach(item => {
|
|
14388
|
+
if (selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id)) {
|
|
14386
14389
|
removeSelectedItem(item);
|
|
14387
14390
|
itemIdsUnSelect.push(item.id);
|
|
14388
14391
|
} else {
|
|
@@ -14396,19 +14399,19 @@
|
|
|
14396
14399
|
setSelectedValue([...selectedValue, ...itemIdsSelect]);
|
|
14397
14400
|
setInputSelectValue([...selectedValue, ...itemIdsSelect]);
|
|
14398
14401
|
const _filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14399
|
-
onChange
|
|
14402
|
+
onChange === null || onChange === void 0 || onChange([..._filteredSelectedValues, ...itemIdsSelect]);
|
|
14400
14403
|
}
|
|
14401
14404
|
|
|
14402
14405
|
//unselect all child in one of the option groups
|
|
14403
14406
|
if (itemIdsUnSelect.length) {
|
|
14404
14407
|
const newSelectedValue = selectedValue.filter(selId => {
|
|
14405
14408
|
var _itemIdsUnSelect$filt;
|
|
14406
|
-
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId))
|
|
14409
|
+
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId)) === null || _itemIdsUnSelect$filt === void 0 ? void 0 : _itemIdsUnSelect$filt[0]) !== selId && selId;
|
|
14407
14410
|
});
|
|
14408
14411
|
setSelectedValue(newSelectedValue);
|
|
14409
14412
|
setInputSelectValue(newSelectedValue);
|
|
14410
14413
|
const _filteredSelectedValues2 = newSelectedValue.filter(val => val !== '!all');
|
|
14411
|
-
onChange
|
|
14414
|
+
onChange === null || onChange === void 0 || onChange(_filteredSelectedValues2);
|
|
14412
14415
|
}
|
|
14413
14416
|
return;
|
|
14414
14417
|
}
|
|
@@ -14425,7 +14428,7 @@
|
|
|
14425
14428
|
setSelectedValue([...selectedValue, selectedItem.id]);
|
|
14426
14429
|
setInputSelectValue([...selectedValue, selectedItem.id]);
|
|
14427
14430
|
const filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14428
|
-
onChange
|
|
14431
|
+
onChange === null || onChange === void 0 || onChange([...filteredSelectedValues, selectedItem.id]);
|
|
14429
14432
|
}
|
|
14430
14433
|
selectItem(null);
|
|
14431
14434
|
}
|
|
@@ -14457,9 +14460,9 @@
|
|
|
14457
14460
|
}
|
|
14458
14461
|
}
|
|
14459
14462
|
});
|
|
14460
|
-
const getOption = React.useCallback(() => maxSelectedItem ? option
|
|
14461
|
-
const isMaxSelectedItem = maxSelectedItem && (selectedValue
|
|
14462
|
-
if (isMaxSelectedItem && !(selectedValue
|
|
14463
|
+
const getOption = React.useCallback(() => maxSelectedItem ? option === null || option === void 0 ? void 0 : option.map(item => {
|
|
14464
|
+
const isMaxSelectedItem = maxSelectedItem && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) >= maxSelectedItem;
|
|
14465
|
+
if (isMaxSelectedItem && !(selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id))) {
|
|
14463
14466
|
item.hideCheck = true;
|
|
14464
14467
|
item.isDisabled = true;
|
|
14465
14468
|
} else {
|
|
@@ -14468,7 +14471,7 @@
|
|
|
14468
14471
|
}
|
|
14469
14472
|
return item;
|
|
14470
14473
|
}) : option, [maxSelectedItem, option, selectedValue]);
|
|
14471
|
-
const itemsLength = items
|
|
14474
|
+
const itemsLength = items === null || items === void 0 ? void 0 : items.reduce((acc, item) => {
|
|
14472
14475
|
return [...acc, ...(item.children ? item.children : [item])];
|
|
14473
14476
|
}, []).length;
|
|
14474
14477
|
React.useEffect(() => {
|
|
@@ -14515,15 +14518,16 @@
|
|
|
14515
14518
|
}, [label, isOpen]);
|
|
14516
14519
|
const toggleCollapsible = () => setShowAllTags(!showAllTags);
|
|
14517
14520
|
const handleRemoveAllItem = () => {
|
|
14518
|
-
onChange
|
|
14521
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14519
14522
|
setSelectedValue([]);
|
|
14520
14523
|
setInputSelectValue([]);
|
|
14521
14524
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14522
14525
|
removeSelectedItem(selectedValue[i]);
|
|
14523
14526
|
}
|
|
14524
14527
|
};
|
|
14525
|
-
const isShowTagSelectAll = showTagSelectAll && (selectedItems
|
|
14528
|
+
const isShowTagSelectAll = showTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > (option === null || option === void 0 ? void 0 : option.length);
|
|
14526
14529
|
const renderOptionItem = (item, index, asChild) => {
|
|
14530
|
+
var _item$render;
|
|
14527
14531
|
return /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
14528
14532
|
key: item.id
|
|
14529
14533
|
}, getItemProps({
|
|
@@ -14556,7 +14560,7 @@
|
|
|
14556
14560
|
lineNumber: 745,
|
|
14557
14561
|
columnNumber: 11
|
|
14558
14562
|
}
|
|
14559
|
-
}, !(item
|
|
14563
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14560
14564
|
color: colors$8.iconDisable,
|
|
14561
14565
|
__self: undefined,
|
|
14562
14566
|
__source: {
|
|
@@ -14572,7 +14576,7 @@
|
|
|
14572
14576
|
lineNumber: 760,
|
|
14573
14577
|
columnNumber: 19
|
|
14574
14578
|
}
|
|
14575
|
-
})), isShowSelectAll && (item
|
|
14579
|
+
})), isShowSelectAll && (item === null || item === void 0 ? void 0 : item.id) === '!all' && selectedValue !== null && selectedValue !== void 0 && selectedValue.length && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) < itemsLength ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled$1, {
|
|
14576
14580
|
__self: undefined,
|
|
14577
14581
|
__source: {
|
|
14578
14582
|
fileName: _jsxFileName$y,
|
|
@@ -14597,15 +14601,15 @@
|
|
|
14597
14601
|
lineNumber: 769,
|
|
14598
14602
|
columnNumber: 11
|
|
14599
14603
|
}
|
|
14600
|
-
}, item.render ? item.render
|
|
14604
|
+
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
14601
14605
|
};
|
|
14602
14606
|
let lastGroupIndex = showSelectAll ? 1 : 0;
|
|
14603
14607
|
const renderOptionGroupItem = (item, index) => {
|
|
14604
|
-
var _item$children5, _item$children6, _item$children7, _item$children8;
|
|
14608
|
+
var _item$children5, _item$children6, _item$children7, _item$render2, _item$children8;
|
|
14605
14609
|
// const groupIndex = (index > (showSelectAll ? 1 : 0)) ? lastGroupIndex : 0;
|
|
14606
14610
|
const groupIndex = lastGroupIndex;
|
|
14607
|
-
lastGroupIndex += ((item
|
|
14608
|
-
const filterSelectedChild = item
|
|
14611
|
+
lastGroupIndex += ((item === null || item === void 0 || (_item$children5 = item.children) === null || _item$children5 === void 0 ? void 0 : _item$children5.length) || 0) + 1;
|
|
14612
|
+
const filterSelectedChild = item === null || item === void 0 || (_item$children6 = item.children) === null || _item$children6 === void 0 ? void 0 : _item$children6.filter(e => selectedValue.includes(e.id) && !e.isDisabled);
|
|
14609
14613
|
return /*#__PURE__*/React__default["default"].createElement(OptionGroupItem, {
|
|
14610
14614
|
item: /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
14611
14615
|
key: item.id
|
|
@@ -14638,7 +14642,7 @@
|
|
|
14638
14642
|
lineNumber: 799,
|
|
14639
14643
|
columnNumber: 15
|
|
14640
14644
|
}
|
|
14641
|
-
}, !(item
|
|
14645
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14642
14646
|
color: colors$8.iconDisable,
|
|
14643
14647
|
__self: undefined,
|
|
14644
14648
|
__source: {
|
|
@@ -14646,7 +14650,7 @@
|
|
|
14646
14650
|
lineNumber: 809,
|
|
14647
14651
|
columnNumber: 19
|
|
14648
14652
|
}
|
|
14649
|
-
}) : (filterSelectedChild
|
|
14653
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) === (item === null || item === void 0 || (_item$children7 = item.children) === null || _item$children7 === void 0 || (_item$children7 = _item$children7.filter(e => !e.isDisabled)) === null || _item$children7 === void 0 ? void 0 : _item$children7.length) ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14650
14654
|
color: colors$8.iconGreen,
|
|
14651
14655
|
__self: undefined,
|
|
14652
14656
|
__source: {
|
|
@@ -14654,7 +14658,7 @@
|
|
|
14654
14658
|
lineNumber: 811,
|
|
14655
14659
|
columnNumber: 19
|
|
14656
14660
|
}
|
|
14657
|
-
}) : (filterSelectedChild
|
|
14661
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled$1, {
|
|
14658
14662
|
__self: undefined,
|
|
14659
14663
|
__source: {
|
|
14660
14664
|
fileName: _jsxFileName$y,
|
|
@@ -14672,14 +14676,14 @@
|
|
|
14672
14676
|
lineNumber: 816,
|
|
14673
14677
|
columnNumber: 15
|
|
14674
14678
|
}
|
|
14675
|
-
}, item.render ? item.render
|
|
14679
|
+
}, item.render ? (_item$render2 = item.render) === null || _item$render2 === void 0 ? void 0 : _item$render2.call(item, item.name) : item.name)),
|
|
14676
14680
|
__self: undefined,
|
|
14677
14681
|
__source: {
|
|
14678
14682
|
fileName: _jsxFileName$y,
|
|
14679
14683
|
lineNumber: 784,
|
|
14680
14684
|
columnNumber: 9
|
|
14681
14685
|
}
|
|
14682
|
-
}, item
|
|
14686
|
+
}, item === null || item === void 0 || (_item$children8 = item.children) === null || _item$children8 === void 0 ? void 0 : _item$children8.map((optItem, optIndex) => renderOptionItem(optItem, groupIndex + optIndex + 1, true)));
|
|
14683
14687
|
};
|
|
14684
14688
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper$1, _extends({
|
|
14685
14689
|
css: css
|
|
@@ -14810,13 +14814,13 @@
|
|
|
14810
14814
|
lineNumber: 875,
|
|
14811
14815
|
columnNumber: 17
|
|
14812
14816
|
}
|
|
14813
|
-
}), selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')) : selectedItems
|
|
14817
|
+
}), selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')) : selectedItems === null || selectedItems === void 0 || (_selectedItems$filter = selectedItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== '!all')) === null || _selectedItems$filter === void 0 || (_selectedItems$filter = _selectedItems$filter.filter((_, idx) => {
|
|
14814
14818
|
if (showAllTags || !collapsible) {
|
|
14815
14819
|
return true;
|
|
14816
14820
|
} else {
|
|
14817
14821
|
return idx < 5;
|
|
14818
14822
|
}
|
|
14819
|
-
}))
|
|
14823
|
+
})) === null || _selectedItems$filter === void 0 ? void 0 : _selectedItems$filter.map((selectedItem, index) => /*#__PURE__*/React__default["default"].createElement(Tag, _extends({
|
|
14820
14824
|
disabled: disabled,
|
|
14821
14825
|
isRemovable: readOnly || disabled || unremovableTags.includes(selectedItem.id) ? false : true,
|
|
14822
14826
|
size: "lg",
|
|
@@ -14841,7 +14845,7 @@
|
|
|
14841
14845
|
lineNumber: 904,
|
|
14842
14846
|
columnNumber: 21
|
|
14843
14847
|
}
|
|
14844
|
-
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems
|
|
14848
|
+
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > collapsibleLimit && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
14845
14849
|
direction: "column",
|
|
14846
14850
|
gap: 4,
|
|
14847
14851
|
__self: undefined,
|
|
@@ -14927,7 +14931,7 @@
|
|
|
14927
14931
|
lineNumber: 947,
|
|
14928
14932
|
columnNumber: 19
|
|
14929
14933
|
}
|
|
14930
|
-
}, `${selectedItems
|
|
14934
|
+
}, `${selectedItems === null || selectedItems === void 0 || (_selectedItems$filter2 = selectedItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== '!all')) === null || _selectedItems$filter2 === void 0 ? void 0 : _selectedItems$filter2.length} ${labelCounter || t('labelCounterText', 'Item terpilih')}`))), showCounter && !isShowTagSelectAll && Boolean(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) && /*#__PURE__*/React__default["default"].createElement(Paragraph, {
|
|
14931
14935
|
css: {
|
|
14932
14936
|
fontSize: '$label',
|
|
14933
14937
|
marginTop: '$spacing-01'
|
|
@@ -14939,7 +14943,7 @@
|
|
|
14939
14943
|
lineNumber: 957,
|
|
14940
14944
|
columnNumber: 11
|
|
14941
14945
|
}
|
|
14942
|
-
}, `${selectedItems
|
|
14946
|
+
}, `${selectedItems === null || selectedItems === void 0 || (_selectedItems$filter3 = selectedItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== '!all')) === null || _selectedItems$filter3 === void 0 ? void 0 : _selectedItems$filter3.length} ${labelCounter || t('labelCounterText', 'Item terpilih')}`), /*#__PURE__*/React__default["default"].createElement(OptionWrapper$1, {
|
|
14943
14947
|
placement: placement,
|
|
14944
14948
|
css: {
|
|
14945
14949
|
display: isOpen && disabled === false ? 'block' : 'none',
|
|
@@ -14997,7 +15001,7 @@
|
|
|
14997
15001
|
}), /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
14998
15002
|
condition: !!fetchData && items.length > 0,
|
|
14999
15003
|
wrapper: child => /*#__PURE__*/React__default["default"].createElement(InfiniteScroll__default["default"], {
|
|
15000
|
-
loadMore: () => !isLoading && (fetchData
|
|
15004
|
+
loadMore: () => !isLoading && (fetchData === null || fetchData === void 0 ? void 0 : fetchData({
|
|
15001
15005
|
query
|
|
15002
15006
|
})),
|
|
15003
15007
|
hasMore: true,
|
|
@@ -15016,7 +15020,7 @@
|
|
|
15016
15020
|
lineNumber: 997,
|
|
15017
15021
|
columnNumber: 15
|
|
15018
15022
|
}
|
|
15019
|
-
}, isOpen && items.map((item, index) => item
|
|
15023
|
+
}, isOpen && items.map((item, index) => item !== null && item !== void 0 && item.children ? renderOptionGroupItem(item) : renderOptionItem(item, index)))) : /*#__PURE__*/React__default["default"].createElement(Option, _extends({
|
|
15020
15024
|
css: {
|
|
15021
15025
|
height: 'auto'
|
|
15022
15026
|
}
|
|
@@ -18679,9 +18683,9 @@
|
|
|
18679
18683
|
}
|
|
18680
18684
|
function handleInputChange(type, e) {
|
|
18681
18685
|
var _e$target;
|
|
18682
|
-
const value = e
|
|
18686
|
+
const value = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
|
|
18683
18687
|
const format = 'DD:MM:YYYY:HH:mm';
|
|
18684
|
-
const minLength = (value
|
|
18688
|
+
const minLength = (value === null || value === void 0 ? void 0 : value.length) > 1;
|
|
18685
18689
|
const hourValue = params => moment__default["default"](moment__default["default"](`${moment__default["default"](date).format('DD:MM:YYYY:mm')}:${params}`, 'DD:MM:YYYY:mm:HH').toDate());
|
|
18686
18690
|
const minuteValue = params => moment__default["default"](moment__default["default"](`${moment__default["default"](date).format('DD:MM:YYYY:HH')}:${params}`, 'DD:MM:YYYY:HH:mm').toDate());
|
|
18687
18691
|
if (!disabled) {
|
|
@@ -21281,7 +21285,7 @@
|
|
|
21281
21285
|
};
|
|
21282
21286
|
};
|
|
21283
21287
|
const getValue = () => {
|
|
21284
|
-
let value = props
|
|
21288
|
+
let value = props === null || props === void 0 ? void 0 : props.value;
|
|
21285
21289
|
const isTrailing = variantIcon === 'trailing';
|
|
21286
21290
|
if (typeof value === 'number' || parseInt(value)) {
|
|
21287
21291
|
if (Math.sign(value) === 1 || Math.sign(value) === 0) {
|
|
@@ -21913,7 +21917,7 @@
|
|
|
21913
21917
|
justify: "center",
|
|
21914
21918
|
onClick: () => {
|
|
21915
21919
|
var _dialogPageRef$curren;
|
|
21916
|
-
return (_dialogPageRef$curren = dialogPageRef.current)
|
|
21920
|
+
return (_dialogPageRef$curren = dialogPageRef.current) === null || _dialogPageRef$curren === void 0 ? void 0 : _dialogPageRef$curren.click();
|
|
21917
21921
|
},
|
|
21918
21922
|
__self: undefined,
|
|
21919
21923
|
__source: {
|
|
@@ -21991,7 +21995,7 @@
|
|
|
21991
21995
|
onSubmit: () => {
|
|
21992
21996
|
var _dialogPageRef$curren2;
|
|
21993
21997
|
debouncedGoToPage(Number(goToPage));
|
|
21994
|
-
(_dialogPageRef$curren2 = dialogPageRef.current)
|
|
21998
|
+
(_dialogPageRef$curren2 = dialogPageRef.current) === null || _dialogPageRef$curren2 === void 0 || _dialogPageRef$curren2.click();
|
|
21995
21999
|
},
|
|
21996
22000
|
__self: undefined,
|
|
21997
22001
|
__source: {
|
|
@@ -22008,7 +22012,7 @@
|
|
|
22008
22012
|
allowNegative: false,
|
|
22009
22013
|
onChange: e => {
|
|
22010
22014
|
var _e$target;
|
|
22011
|
-
return setGoToPage((_e$target = e.target)
|
|
22015
|
+
return setGoToPage((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
22012
22016
|
},
|
|
22013
22017
|
__self: undefined,
|
|
22014
22018
|
__source: {
|
|
@@ -22041,7 +22045,7 @@
|
|
|
22041
22045
|
onClick: () => {
|
|
22042
22046
|
var _dialogPageRef$curren3;
|
|
22043
22047
|
setGoToPage(null);
|
|
22044
|
-
(_dialogPageRef$curren3 = dialogPageRef.current)
|
|
22048
|
+
(_dialogPageRef$curren3 = dialogPageRef.current) === null || _dialogPageRef$curren3 === void 0 || _dialogPageRef$curren3.click();
|
|
22045
22049
|
},
|
|
22046
22050
|
__self: undefined,
|
|
22047
22051
|
__source: {
|
|
@@ -22056,7 +22060,7 @@
|
|
|
22056
22060
|
onClick: () => {
|
|
22057
22061
|
var _dialogPageRef$curren4;
|
|
22058
22062
|
debouncedGoToPage(Number(goToPage));
|
|
22059
|
-
(_dialogPageRef$curren4 = dialogPageRef.current)
|
|
22063
|
+
(_dialogPageRef$curren4 = dialogPageRef.current) === null || _dialogPageRef$curren4 === void 0 || _dialogPageRef$curren4.click();
|
|
22060
22064
|
},
|
|
22061
22065
|
__self: undefined,
|
|
22062
22066
|
__source: {
|
|
@@ -22145,7 +22149,7 @@
|
|
|
22145
22149
|
onClick: () => {
|
|
22146
22150
|
if (isMobilePagination) {
|
|
22147
22151
|
var _dialogLimitRef$curre;
|
|
22148
|
-
(_dialogLimitRef$curre = dialogLimitRef.current)
|
|
22152
|
+
(_dialogLimitRef$curre = dialogLimitRef.current) === null || _dialogLimitRef$curre === void 0 || _dialogLimitRef$curre.click();
|
|
22149
22153
|
}
|
|
22150
22154
|
},
|
|
22151
22155
|
__self: this,
|
|
@@ -22191,7 +22195,7 @@
|
|
|
22191
22195
|
lineNumber: 60,
|
|
22192
22196
|
columnNumber: 13
|
|
22193
22197
|
}
|
|
22194
|
-
}, limits
|
|
22198
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(PopoverClose, {
|
|
22195
22199
|
key: limit,
|
|
22196
22200
|
css: limitItemContainerStyle(selectedLimit === limit),
|
|
22197
22201
|
onClick: () => onChange(limit),
|
|
@@ -22274,7 +22278,7 @@
|
|
|
22274
22278
|
lineNumber: 100,
|
|
22275
22279
|
columnNumber: 11
|
|
22276
22280
|
}
|
|
22277
|
-
}, limits
|
|
22281
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
22278
22282
|
css: {
|
|
22279
22283
|
height: 44,
|
|
22280
22284
|
width: '100%',
|
|
@@ -22289,7 +22293,7 @@
|
|
|
22289
22293
|
onClick: () => {
|
|
22290
22294
|
var _dialogLimitRef$curre2;
|
|
22291
22295
|
onChange(limit);
|
|
22292
|
-
(_dialogLimitRef$curre2 = dialogLimitRef.current)
|
|
22296
|
+
(_dialogLimitRef$curre2 = dialogLimitRef.current) === null || _dialogLimitRef$curre2 === void 0 || _dialogLimitRef$curre2.click();
|
|
22293
22297
|
},
|
|
22294
22298
|
__self: this,
|
|
22295
22299
|
__source: {
|
|
@@ -24556,7 +24560,7 @@
|
|
|
24556
24560
|
onClick: () => {
|
|
24557
24561
|
var _document$getElements;
|
|
24558
24562
|
setOpenDrop(true);
|
|
24559
|
-
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu'))
|
|
24563
|
+
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu')) === null || _document$getElements === void 0 ? void 0 : _document$getElements[0];
|
|
24560
24564
|
contextMenu.style.opacity = 0;
|
|
24561
24565
|
},
|
|
24562
24566
|
__self: undefined,
|
|
@@ -25212,7 +25216,7 @@
|
|
|
25212
25216
|
if (!props.onOpenAutoFocus) {
|
|
25213
25217
|
e.preventDefault();
|
|
25214
25218
|
} else {
|
|
25215
|
-
props
|
|
25219
|
+
props === null || props === void 0 || props.onOpenAutoFocus();
|
|
25216
25220
|
}
|
|
25217
25221
|
},
|
|
25218
25222
|
__self: undefined,
|
|
@@ -25292,7 +25296,7 @@
|
|
|
25292
25296
|
}, props.description)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
25293
25297
|
css: {
|
|
25294
25298
|
width: '100%',
|
|
25295
|
-
display: props
|
|
25299
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25296
25300
|
},
|
|
25297
25301
|
__self: undefined,
|
|
25298
25302
|
__source: {
|
|
@@ -25334,8 +25338,8 @@
|
|
|
25334
25338
|
size: props.btnSize,
|
|
25335
25339
|
onClick: buttonConfirm,
|
|
25336
25340
|
buttonType: props.dialogType,
|
|
25337
|
-
disabled: props
|
|
25338
|
-
}, props
|
|
25341
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25342
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25339
25343
|
__self: undefined,
|
|
25340
25344
|
__source: {
|
|
25341
25345
|
fileName: _jsxFileName$b,
|
|
@@ -25354,19 +25358,19 @@
|
|
|
25354
25358
|
size: props.btnSize,
|
|
25355
25359
|
onClick: buttonCancel,
|
|
25356
25360
|
css: {
|
|
25357
|
-
color: props.dialogType === 'negative' && !(props
|
|
25361
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25358
25362
|
flex: props.isMobile && 1
|
|
25359
25363
|
},
|
|
25360
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25361
|
-
disabled: props
|
|
25362
|
-
}, props
|
|
25364
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25365
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25366
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25363
25367
|
__self: undefined,
|
|
25364
25368
|
__source: {
|
|
25365
25369
|
fileName: _jsxFileName$b,
|
|
25366
25370
|
lineNumber: 187,
|
|
25367
25371
|
columnNumber: 19
|
|
25368
25372
|
}
|
|
25369
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25373
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default["default"].createElement(ADialog__namespace.Action, {
|
|
25370
25374
|
asChild: true,
|
|
25371
25375
|
__self: undefined,
|
|
25372
25376
|
__source: {
|
|
@@ -25381,8 +25385,8 @@
|
|
|
25381
25385
|
css: {
|
|
25382
25386
|
flex: props.isMobile && 1
|
|
25383
25387
|
},
|
|
25384
|
-
disabled: props
|
|
25385
|
-
}, props
|
|
25388
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25389
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25386
25390
|
__self: undefined,
|
|
25387
25391
|
__source: {
|
|
25388
25392
|
fileName: _jsxFileName$b,
|
|
@@ -25512,7 +25516,7 @@
|
|
|
25512
25516
|
}, props.description)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
25513
25517
|
css: {
|
|
25514
25518
|
width: '100%',
|
|
25515
|
-
display: props
|
|
25519
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25516
25520
|
},
|
|
25517
25521
|
__self: this,
|
|
25518
25522
|
__source: {
|
|
@@ -25557,8 +25561,8 @@
|
|
|
25557
25561
|
css: {
|
|
25558
25562
|
flex: props.isMobile && 1
|
|
25559
25563
|
},
|
|
25560
|
-
disabled: props
|
|
25561
|
-
}, props
|
|
25564
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25565
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25562
25566
|
__self: this,
|
|
25563
25567
|
__source: {
|
|
25564
25568
|
fileName: _jsxFileName$b,
|
|
@@ -25577,19 +25581,19 @@
|
|
|
25577
25581
|
size: props.btnSize,
|
|
25578
25582
|
onClick: props.onCancel,
|
|
25579
25583
|
css: {
|
|
25580
|
-
color: props.dialogType === 'negative' && !(props
|
|
25584
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25581
25585
|
flex: props.isMobile && 1
|
|
25582
25586
|
},
|
|
25583
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25584
|
-
disabled: props
|
|
25585
|
-
}, props
|
|
25587
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25588
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25589
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25586
25590
|
__self: this,
|
|
25587
25591
|
__source: {
|
|
25588
25592
|
fileName: _jsxFileName$b,
|
|
25589
25593
|
lineNumber: 293,
|
|
25590
25594
|
columnNumber: 19
|
|
25591
25595
|
}
|
|
25592
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25596
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default["default"].createElement(ADialog__namespace.Action, {
|
|
25593
25597
|
asChild: true,
|
|
25594
25598
|
__self: this,
|
|
25595
25599
|
__source: {
|
|
@@ -25604,8 +25608,8 @@
|
|
|
25604
25608
|
css: {
|
|
25605
25609
|
flex: props.isMobile && 1
|
|
25606
25610
|
},
|
|
25607
|
-
disabled: props
|
|
25608
|
-
}, props
|
|
25611
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25612
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25609
25613
|
__self: this,
|
|
25610
25614
|
__source: {
|
|
25611
25615
|
fileName: _jsxFileName$b,
|
|
@@ -28119,7 +28123,7 @@
|
|
|
28119
28123
|
upload({
|
|
28120
28124
|
url: action,
|
|
28121
28125
|
file: newFile,
|
|
28122
|
-
customBody: customBodyRequest
|
|
28126
|
+
customBody: customBodyRequest === null || customBodyRequest === void 0 ? void 0 : customBodyRequest(newFile),
|
|
28123
28127
|
token,
|
|
28124
28128
|
tokenKey,
|
|
28125
28129
|
reqKey,
|
|
@@ -28139,12 +28143,12 @@
|
|
|
28139
28143
|
arrProgress[i] = fileProgress;
|
|
28140
28144
|
}
|
|
28141
28145
|
}
|
|
28142
|
-
onChange
|
|
28146
|
+
onChange === null || onChange === void 0 || (_onChange = onChange({
|
|
28143
28147
|
fileList: arrProgress,
|
|
28144
28148
|
file: fileProgress,
|
|
28145
28149
|
indexReplace: indexReplace.current,
|
|
28146
28150
|
isReplace: indexReplace.current !== null
|
|
28147
|
-
}))
|
|
28151
|
+
})) === null || _onChange === void 0 || (_onChange = _onChange.then(() => setError(null))) === null || _onChange === void 0 || _onChange.catch(error => setError(error.message));
|
|
28148
28152
|
}
|
|
28149
28153
|
}).then(result => {
|
|
28150
28154
|
var _onChange2;
|
|
@@ -28157,12 +28161,12 @@
|
|
|
28157
28161
|
arrFile[i] = fileSuccess;
|
|
28158
28162
|
}
|
|
28159
28163
|
}
|
|
28160
|
-
onChange
|
|
28164
|
+
onChange === null || onChange === void 0 || (_onChange2 = onChange({
|
|
28161
28165
|
fileList: arrFile,
|
|
28162
28166
|
file: fileSuccess,
|
|
28163
28167
|
indexReplace: indexReplace.current,
|
|
28164
28168
|
isReplace: indexReplace.current !== null
|
|
28165
|
-
}))
|
|
28169
|
+
})) === null || _onChange2 === void 0 || (_onChange2 = _onChange2.then(() => setError(null))) === null || _onChange2 === void 0 || _onChange2.catch(error => setError(error.message));
|
|
28166
28170
|
}).catch(error => {
|
|
28167
28171
|
var _onChange3;
|
|
28168
28172
|
let fileError = Object.assign({}, newFile);
|
|
@@ -28174,21 +28178,21 @@
|
|
|
28174
28178
|
arrFile[i] = fileError;
|
|
28175
28179
|
}
|
|
28176
28180
|
}
|
|
28177
|
-
onChange
|
|
28181
|
+
onChange === null || onChange === void 0 || (_onChange3 = onChange({
|
|
28178
28182
|
fileList: arrFile,
|
|
28179
28183
|
file: fileError,
|
|
28180
28184
|
indexReplace: indexReplace.current,
|
|
28181
28185
|
isReplace: indexReplace.current !== null
|
|
28182
|
-
}))
|
|
28186
|
+
})) === null || _onChange3 === void 0 || (_onChange3 = _onChange3.then(() => setError(null))) === null || _onChange3 === void 0 || _onChange3.catch(error => setError(error.message));
|
|
28183
28187
|
});
|
|
28184
28188
|
} else {
|
|
28185
28189
|
var _onChange4;
|
|
28186
|
-
onChange
|
|
28190
|
+
onChange === null || onChange === void 0 || (_onChange4 = onChange({
|
|
28187
28191
|
fileList: arrFile,
|
|
28188
28192
|
file: newFile,
|
|
28189
28193
|
indexReplace: indexReplace.current,
|
|
28190
28194
|
isReplace: indexReplace.current !== null
|
|
28191
|
-
}))
|
|
28195
|
+
})) === null || _onChange4 === void 0 || (_onChange4 = _onChange4.then(() => setError(null))) === null || _onChange4 === void 0 || _onChange4.catch(error => setError(error.message));
|
|
28192
28196
|
}
|
|
28193
28197
|
if (indexReplace.current !== null) {
|
|
28194
28198
|
arrFile[indexReplace.current] = newFile;
|
|
@@ -28208,15 +28212,15 @@
|
|
|
28208
28212
|
// program to get the dimensions of an image
|
|
28209
28213
|
const img = document.createElement('img');
|
|
28210
28214
|
img.src = URL.createObjectURL(files[0]);
|
|
28211
|
-
img.size = files
|
|
28212
|
-
img.type = files
|
|
28215
|
+
img.size = files === null || files === void 0 || (_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.size;
|
|
28216
|
+
img.type = files === null || files === void 0 || (_files$2 = files[0]) === null || _files$2 === void 0 ? void 0 : _files$2.type;
|
|
28213
28217
|
img.onload = () => {
|
|
28214
28218
|
const imgRatio = img.width / img.height;
|
|
28215
28219
|
setAspect(ratio || imgRatio);
|
|
28216
28220
|
setCropperImgRatio(imgRatio);
|
|
28217
28221
|
if (onBeforeCrop) {
|
|
28218
28222
|
var _onBeforeCrop;
|
|
28219
|
-
onBeforeCrop
|
|
28223
|
+
onBeforeCrop === null || onBeforeCrop === void 0 || (_onBeforeCrop = onBeforeCrop(img)) === null || _onBeforeCrop === void 0 || (_onBeforeCrop = _onBeforeCrop.then(() => {
|
|
28220
28224
|
setError(null);
|
|
28221
28225
|
toggleModal();
|
|
28222
28226
|
setTimeout(() => {
|
|
@@ -28230,7 +28234,7 @@
|
|
|
28230
28234
|
}, 300);
|
|
28231
28235
|
setFileState(files[0]);
|
|
28232
28236
|
setPreviewImage(URL.createObjectURL(files[0]));
|
|
28233
|
-
}))
|
|
28237
|
+
})) === null || _onBeforeCrop === void 0 || _onBeforeCrop.catch(error => setError(error === null || error === void 0 ? void 0 : error.message));
|
|
28234
28238
|
} else {
|
|
28235
28239
|
toggleModal();
|
|
28236
28240
|
setTimeout(() => {
|
|
@@ -28248,18 +28252,18 @@
|
|
|
28248
28252
|
};
|
|
28249
28253
|
img.onerror = error => {
|
|
28250
28254
|
var _onBeforeCrop2;
|
|
28251
|
-
onBeforeCrop
|
|
28255
|
+
onBeforeCrop === null || onBeforeCrop === void 0 || (_onBeforeCrop2 = onBeforeCrop(img, error)) === null || _onBeforeCrop2 === void 0 || (_onBeforeCrop2 = _onBeforeCrop2.then(() => setError(null))) === null || _onBeforeCrop2 === void 0 || _onBeforeCrop2.catch(error => setError(error === null || error === void 0 ? void 0 : error.message));
|
|
28252
28256
|
};
|
|
28253
28257
|
}
|
|
28254
28258
|
}
|
|
28255
28259
|
}
|
|
28256
28260
|
function handleCrop() {
|
|
28257
|
-
if (completedCrop
|
|
28258
|
-
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState
|
|
28259
|
-
const sizeMB = (blob
|
|
28261
|
+
if (completedCrop !== null && completedCrop !== void 0 && completedCrop.width && completedCrop !== null && completedCrop !== void 0 && completedCrop.height && imgRef.current) {
|
|
28262
|
+
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState === null || fileState === void 0 ? void 0 : fileState.type).then(blob => {
|
|
28263
|
+
const sizeMB = (blob === null || blob === void 0 ? void 0 : blob.size) / 1024 / 1024;
|
|
28260
28264
|
if (sizeMB < maxSizeMB || sizeMB < 1 || !imageCompression) {
|
|
28261
|
-
const file = new File([blob], fileState
|
|
28262
|
-
type: blob
|
|
28265
|
+
const file = new File([blob], fileState === null || fileState === void 0 ? void 0 : fileState.name, {
|
|
28266
|
+
type: blob === null || blob === void 0 ? void 0 : blob.type
|
|
28263
28267
|
});
|
|
28264
28268
|
handleUpload([file]);
|
|
28265
28269
|
setCrop(null);
|
|
@@ -28273,16 +28277,16 @@
|
|
|
28273
28277
|
alwaysKeepResolution: true
|
|
28274
28278
|
}).then(compressedFile => {
|
|
28275
28279
|
var _fileState$name;
|
|
28276
|
-
const file = new File([compressedFile], (fileState
|
|
28277
|
-
type: compressedFile
|
|
28280
|
+
const file = new File([compressedFile], (fileState === null || fileState === void 0 || (_fileState$name = fileState.name) === null || _fileState$name === void 0 ? void 0 : _fileState$name.replace(/\.[^/.]+$/, '')) + '.png', {
|
|
28281
|
+
type: compressedFile === null || compressedFile === void 0 ? void 0 : compressedFile.type
|
|
28278
28282
|
});
|
|
28279
28283
|
handleUpload([file]);
|
|
28280
28284
|
setCrop(null);
|
|
28281
28285
|
setCompletedCrop(null);
|
|
28282
|
-
}).catch(error => console.error(error
|
|
28286
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
28283
28287
|
}
|
|
28284
28288
|
toggleModal();
|
|
28285
|
-
}).catch(error => console.error(error
|
|
28289
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
28286
28290
|
} else {
|
|
28287
28291
|
handleUpload([fileState]);
|
|
28288
28292
|
toggleModal();
|
|
@@ -28311,7 +28315,7 @@
|
|
|
28311
28315
|
const index = fileList.indexOf(file);
|
|
28312
28316
|
const newFileList = fileList.slice();
|
|
28313
28317
|
newFileList.splice(index, 1);
|
|
28314
|
-
onChange
|
|
28318
|
+
onChange === null || onChange === void 0 || onChange({
|
|
28315
28319
|
fileList: newFileList,
|
|
28316
28320
|
file
|
|
28317
28321
|
});
|
|
@@ -28334,14 +28338,14 @@
|
|
|
28334
28338
|
}
|
|
28335
28339
|
function handleOpenFile(file) {
|
|
28336
28340
|
var _String, _file$name;
|
|
28337
|
-
let extension = (_String = String(file
|
|
28341
|
+
let extension = (_String = String(file === null || file === void 0 || (_file$name = file.name) === null || _file$name === void 0 ? void 0 : _file$name.split('.').pop())) === null || _String === void 0 ? void 0 : _String.toLowerCase();
|
|
28338
28342
|
if (extension === 'pdf') {
|
|
28339
|
-
window.open(file
|
|
28343
|
+
window.open(file === null || file === void 0 ? void 0 : file.url);
|
|
28340
28344
|
} else {
|
|
28341
|
-
if (file
|
|
28345
|
+
if (file !== null && file !== void 0 && file.url) {
|
|
28342
28346
|
const link = document.createElement('a');
|
|
28343
28347
|
link.href = file.url;
|
|
28344
|
-
link.setAttribute('download', file
|
|
28348
|
+
link.setAttribute('download', file === null || file === void 0 ? void 0 : file.name);
|
|
28345
28349
|
document.body.appendChild(link);
|
|
28346
28350
|
link.click();
|
|
28347
28351
|
document.body.removeChild(link);
|
|
@@ -28403,12 +28407,12 @@
|
|
|
28403
28407
|
}, replaceLabel && replaceLabel.length > 0 ? replaceLabel : t('replaceLabel', 'Ubah Berkas')));
|
|
28404
28408
|
}
|
|
28405
28409
|
const renderPicture = () => {
|
|
28406
|
-
return fileList
|
|
28407
|
-
if ((item
|
|
28410
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28411
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28408
28412
|
return /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
|
28409
28413
|
key: index,
|
|
28410
|
-
progress: item
|
|
28411
|
-
loading: item
|
|
28414
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28415
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28412
28416
|
__self: undefined,
|
|
28413
28417
|
__source: {
|
|
28414
28418
|
fileName: _jsxFileName$9,
|
|
@@ -28481,13 +28485,13 @@
|
|
|
28481
28485
|
});
|
|
28482
28486
|
};
|
|
28483
28487
|
const renderFile = () => {
|
|
28484
|
-
return fileList
|
|
28488
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28485
28489
|
var _item$name;
|
|
28486
|
-
if ((item
|
|
28490
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28487
28491
|
return /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
|
28488
28492
|
key: index,
|
|
28489
|
-
progress: item
|
|
28490
|
-
loading: item
|
|
28493
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28494
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28491
28495
|
__self: undefined,
|
|
28492
28496
|
__source: {
|
|
28493
28497
|
fileName: _jsxFileName$9,
|
|
@@ -28553,7 +28557,7 @@
|
|
|
28553
28557
|
lineNumber: 666,
|
|
28554
28558
|
columnNumber: 17
|
|
28555
28559
|
}
|
|
28556
|
-
}, ".", item
|
|
28560
|
+
}, ".", item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.split('.').pop()), /*#__PURE__*/React__default["default"].createElement(Tooltip$1, {
|
|
28557
28561
|
label: item.name,
|
|
28558
28562
|
__self: undefined,
|
|
28559
28563
|
__source: {
|
|
@@ -28923,7 +28927,7 @@
|
|
|
28923
28927
|
}
|
|
28924
28928
|
return /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
28925
28929
|
direction: "row",
|
|
28926
|
-
gap: (fileList
|
|
28930
|
+
gap: (fileList === null || fileList === void 0 ? void 0 : fileList.length) <= 1 && max === 1 ? 0 : 3,
|
|
28927
28931
|
wrap: "wrap",
|
|
28928
28932
|
css: {
|
|
28929
28933
|
userSelect: 'none'
|
|
@@ -29753,9 +29757,9 @@
|
|
|
29753
29757
|
function InputColorPicker(props) {
|
|
29754
29758
|
const [isPopover, setIsPopover] = React.useState(false);
|
|
29755
29759
|
function getColor() {
|
|
29756
|
-
const color = props
|
|
29760
|
+
const color = props === null || props === void 0 ? void 0 : props.color;
|
|
29757
29761
|
if (typeof color === 'string') {
|
|
29758
|
-
return color
|
|
29762
|
+
return color === null || color === void 0 ? void 0 : color.toUpperCase();
|
|
29759
29763
|
}
|
|
29760
29764
|
return `rgba(${color.r},${color.g},${color.b},${color.a})`;
|
|
29761
29765
|
}
|
|
@@ -32774,7 +32778,7 @@
|
|
|
32774
32778
|
var _data;
|
|
32775
32779
|
const isActive = props.currentStep === i;
|
|
32776
32780
|
const isComplete = props.isComplete[i - 1];
|
|
32777
|
-
const isAdditional = (_data = data[i - 1])
|
|
32781
|
+
const isAdditional = (_data = data[i - 1]) === null || _data === void 0 ? void 0 : _data.additional;
|
|
32778
32782
|
const lastItem = navMobileItems.indexOf(data[i - 1]) + 1 === navMobileItems.length;
|
|
32779
32783
|
// eslint-disable-next-line no-lone-blocks
|
|
32780
32784
|
{
|
|
@@ -32789,7 +32793,7 @@
|
|
|
32789
32793
|
key: `step-${i}`,
|
|
32790
32794
|
onClick: () => {
|
|
32791
32795
|
var _data2;
|
|
32792
|
-
if (props.onNavClicked && !((_data2 = data[i - 1])
|
|
32796
|
+
if (props.onNavClicked && !((_data2 = data[i - 1]) !== null && _data2 !== void 0 && _data2.disabled) || isAdditional) props.onNavClicked(i);
|
|
32793
32797
|
if (!forbidClickNav && isComplete && !isHide || isAdditional) {
|
|
32794
32798
|
props.goToStep(i);
|
|
32795
32799
|
}
|
|
@@ -32822,9 +32826,9 @@
|
|
|
32822
32826
|
lineNumber: 176,
|
|
32823
32827
|
columnNumber: 17
|
|
32824
32828
|
}
|
|
32825
|
-
}), typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title = (_data3 = data[i - 1]).title)
|
|
32829
|
+
}), typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title = (_data3 = data[i - 1]).title) === null || _data$title === void 0 ? void 0 : _data$title.call(_data3), ((_data4 = data[i - 1]) === null || _data4 === void 0 ? void 0 : _data4.withTolltip) && /*#__PURE__*/React__default["default"].createElement(Tooltip$1, {
|
|
32826
32830
|
align: "center",
|
|
32827
|
-
label: (_data5 = data[i - 1])
|
|
32831
|
+
label: (_data5 = data[i - 1]) === null || _data5 === void 0 ? void 0 : _data5.tooltipsContents,
|
|
32828
32832
|
__self: undefined,
|
|
32829
32833
|
__source: {
|
|
32830
32834
|
fileName: _jsxFileName$4,
|
|
@@ -32843,9 +32847,9 @@
|
|
|
32843
32847
|
lineNumber: 181,
|
|
32844
32848
|
columnNumber: 19
|
|
32845
32849
|
}
|
|
32846
|
-
})), ((_data6 = data[i - 1])
|
|
32850
|
+
})), ((_data6 = data[i - 1]) === null || _data6 === void 0 ? void 0 : _data6.comingSoon) && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
32847
32851
|
css: {
|
|
32848
|
-
marginLeft: (_data7 = data[i - 1])
|
|
32852
|
+
marginLeft: (_data7 = data[i - 1]) !== null && _data7 !== void 0 && _data7.withTolltip ? 0 : '$spacing-03'
|
|
32849
32853
|
},
|
|
32850
32854
|
align: "center",
|
|
32851
32855
|
__self: undefined,
|
|
@@ -32896,10 +32900,10 @@
|
|
|
32896
32900
|
lineNumber: 198,
|
|
32897
32901
|
columnNumber: 21
|
|
32898
32902
|
}
|
|
32899
|
-
}, typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title2 = (_data8 = data[i - 1]).title)
|
|
32903
|
+
}, typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title2 = (_data8 = data[i - 1]).title) === null || _data$title2 === void 0 ? void 0 : _data$title2.call(_data8)), ((_data9 = data[i - 1]) === null || _data9 === void 0 ? void 0 : _data9.withTolltip) && /*#__PURE__*/React__default["default"].createElement(Tooltip$1, {
|
|
32900
32904
|
align: "center",
|
|
32901
32905
|
withClick: true,
|
|
32902
|
-
label: (_data10 = data[i - 1])
|
|
32906
|
+
label: (_data10 = data[i - 1]) === null || _data10 === void 0 ? void 0 : _data10.tooltipsContents,
|
|
32903
32907
|
__self: undefined,
|
|
32904
32908
|
__source: {
|
|
32905
32909
|
fileName: _jsxFileName$4,
|
|
@@ -32915,11 +32919,11 @@
|
|
|
32915
32919
|
lineNumber: 209,
|
|
32916
32920
|
columnNumber: 25
|
|
32917
32921
|
}
|
|
32918
|
-
})), ((_data11 = data[i - 1])
|
|
32922
|
+
})), ((_data11 = data[i - 1]) === null || _data11 === void 0 ? void 0 : _data11.comingSoon) && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
32919
32923
|
align: "center",
|
|
32920
32924
|
justify: "center",
|
|
32921
32925
|
css: {
|
|
32922
|
-
marginTop: (_data12 = data[i - 1])
|
|
32926
|
+
marginTop: (_data12 = data[i - 1]) !== null && _data12 !== void 0 && _data12.withTolltip ? 0 : '$spacing-03'
|
|
32923
32927
|
},
|
|
32924
32928
|
__self: undefined,
|
|
32925
32929
|
__source: {
|
|
@@ -32943,7 +32947,7 @@
|
|
|
32943
32947
|
userSelect: 'none',
|
|
32944
32948
|
fontSize: '12px',
|
|
32945
32949
|
textAlign: '-webkit-center',
|
|
32946
|
-
display: ((_data13 = data[i - 1])
|
|
32950
|
+
display: ((_data13 = data[i - 1]) === null || _data13 === void 0 ? void 0 : _data13.disabled) && 'none',
|
|
32947
32951
|
marginTop: '$spacing-07',
|
|
32948
32952
|
flex: 1,
|
|
32949
32953
|
maxWidth: lastItem && 26
|
|
@@ -33023,7 +33027,7 @@
|
|
|
33023
33027
|
height: 24,
|
|
33024
33028
|
borderRadius: '$round',
|
|
33025
33029
|
border: `4px solid ${isActive ? '$bgGreen' : '$bgInactive'}`,
|
|
33026
|
-
backgroundColor: (_data14 = data[i - 1])
|
|
33030
|
+
backgroundColor: (_data14 = data[i - 1]) !== null && _data14 !== void 0 && _data14.disabled ? '$gray200' : '$white'
|
|
33027
33031
|
},
|
|
33028
33032
|
__self: undefined,
|
|
33029
33033
|
__source: {
|
|
@@ -33052,50 +33056,53 @@
|
|
|
33052
33056
|
}
|
|
33053
33057
|
return /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
33054
33058
|
condition: !isMobile,
|
|
33055
|
-
wrapper: child =>
|
|
33056
|
-
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
|
|
33062
|
-
|
|
33063
|
-
|
|
33064
|
-
|
|
33065
|
-
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
|
|
33071
|
-
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
|
|
33083
|
-
|
|
33084
|
-
|
|
33085
|
-
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
|
|
33093
|
-
|
|
33094
|
-
|
|
33095
|
-
|
|
33096
|
-
|
|
33097
|
-
|
|
33098
|
-
|
|
33059
|
+
wrapper: child => {
|
|
33060
|
+
var _props$appendContent;
|
|
33061
|
+
return /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
33062
|
+
css: {
|
|
33063
|
+
opacity: isHide ? 0 : undefined,
|
|
33064
|
+
maxWidth: 311
|
|
33065
|
+
},
|
|
33066
|
+
__self: undefined,
|
|
33067
|
+
__source: {
|
|
33068
|
+
fileName: _jsxFileName$4,
|
|
33069
|
+
lineNumber: 281,
|
|
33070
|
+
columnNumber: 9
|
|
33071
|
+
}
|
|
33072
|
+
}, /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
33073
|
+
css: {
|
|
33074
|
+
position: !isMobile && 'sticky',
|
|
33075
|
+
top: !isMobile ? 44 : 40
|
|
33076
|
+
},
|
|
33077
|
+
direction: "column",
|
|
33078
|
+
gap: 7,
|
|
33079
|
+
__self: undefined,
|
|
33080
|
+
__source: {
|
|
33081
|
+
fileName: _jsxFileName$4,
|
|
33082
|
+
lineNumber: 282,
|
|
33083
|
+
columnNumber: 11
|
|
33084
|
+
}
|
|
33085
|
+
}, /*#__PURE__*/React__default["default"].createElement(Card, {
|
|
33086
|
+
css: {
|
|
33087
|
+
height: 'fit-content',
|
|
33088
|
+
padding: 0
|
|
33089
|
+
},
|
|
33090
|
+
showBottomLine: false,
|
|
33091
|
+
__self: undefined,
|
|
33092
|
+
__source: {
|
|
33093
|
+
fileName: _jsxFileName$4,
|
|
33094
|
+
lineNumber: 283,
|
|
33095
|
+
columnNumber: 13
|
|
33096
|
+
}
|
|
33097
|
+
}, child), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
33098
|
+
__self: undefined,
|
|
33099
|
+
__source: {
|
|
33100
|
+
fileName: _jsxFileName$4,
|
|
33101
|
+
lineNumber: 292,
|
|
33102
|
+
columnNumber: 13
|
|
33103
|
+
}
|
|
33104
|
+
}, typeof (props === null || props === void 0 ? void 0 : props.appendContent) === 'function' ? props === null || props === void 0 || (_props$appendContent = props.appendContent) === null || _props$appendContent === void 0 ? void 0 : _props$appendContent.call(props) : props === null || props === void 0 ? void 0 : props.appendContent)));
|
|
33105
|
+
},
|
|
33099
33106
|
__self: undefined,
|
|
33100
33107
|
__source: {
|
|
33101
33108
|
fileName: _jsxFileName$4,
|
|
@@ -33160,7 +33167,8 @@
|
|
|
33160
33167
|
}));
|
|
33161
33168
|
}, [props.hide]);
|
|
33162
33169
|
React.useEffect(() => {
|
|
33163
|
-
|
|
33170
|
+
var _props$onChangeVisibi;
|
|
33171
|
+
props === null || props === void 0 || (_props$onChangeVisibi = props.onChangeVisibility) === null || _props$onChangeVisibi === void 0 || _props$onChangeVisibi.call(props, state.hide);
|
|
33164
33172
|
}, [state.hide]);
|
|
33165
33173
|
const toogleVisibility = value => {
|
|
33166
33174
|
updateState(prev => Object.assign({}, prev, {
|
|
@@ -33169,11 +33177,11 @@
|
|
|
33169
33177
|
};
|
|
33170
33178
|
const getIsComplete = currentStep => {
|
|
33171
33179
|
var _state$isComplete;
|
|
33172
|
-
return state
|
|
33180
|
+
return state === null || state === void 0 || (_state$isComplete = state.isComplete) === null || _state$isComplete === void 0 ? void 0 : _state$isComplete[currentStep - 1];
|
|
33173
33181
|
};
|
|
33174
33182
|
const getTitleStep = currentStep => {
|
|
33175
33183
|
var _props$navContents;
|
|
33176
|
-
return props
|
|
33184
|
+
return props === null || props === void 0 || (_props$navContents = props.navContents) === null || _props$navContents === void 0 || (_props$navContents = _props$navContents[currentStep - 1]) === null || _props$navContents === void 0 ? void 0 : _props$navContents.title;
|
|
33177
33185
|
};
|
|
33178
33186
|
const setState = value => {
|
|
33179
33187
|
updateState(Object.assign({}, state, value));
|
|
@@ -33207,13 +33215,13 @@
|
|
|
33207
33215
|
block: 'start'
|
|
33208
33216
|
});
|
|
33209
33217
|
props.onStepChange && props.onStepChange(e);
|
|
33210
|
-
if (props
|
|
33211
|
-
if ((e
|
|
33218
|
+
if (props !== null && props !== void 0 && (_props$navContents2 = props.navContents) !== null && _props$navContents2 !== void 0 && (_props$navContents2 = _props$navContents2[(e === null || e === void 0 ? void 0 : e.activeStep) - 1]) !== null && _props$navContents2 !== void 0 && _props$navContents2.disabled) {
|
|
33219
|
+
if ((e === null || e === void 0 ? void 0 : e.activeStep) > (e === null || e === void 0 ? void 0 : e.previousStep)) {
|
|
33212
33220
|
var _state$SW;
|
|
33213
|
-
state
|
|
33221
|
+
state === null || state === void 0 || (_state$SW = state.SW) === null || _state$SW === void 0 || _state$SW.nextStep();
|
|
33214
33222
|
} else {
|
|
33215
33223
|
var _state$SW2;
|
|
33216
|
-
state
|
|
33224
|
+
state === null || state === void 0 || (_state$SW2 = state.SW) === null || _state$SW2 === void 0 || _state$SW2.previousStep();
|
|
33217
33225
|
}
|
|
33218
33226
|
}
|
|
33219
33227
|
};
|
|
@@ -33228,11 +33236,11 @@
|
|
|
33228
33236
|
}, /*#__PURE__*/React__default["default"].createElement(StepWizardContext.Provider, {
|
|
33229
33237
|
value: {
|
|
33230
33238
|
toogleVisibility,
|
|
33231
|
-
isHide: state
|
|
33239
|
+
isHide: state === null || state === void 0 ? void 0 : state.hide,
|
|
33232
33240
|
setComplete,
|
|
33233
33241
|
setState,
|
|
33234
33242
|
state,
|
|
33235
|
-
SW: state
|
|
33243
|
+
SW: state === null || state === void 0 ? void 0 : state.SW,
|
|
33236
33244
|
forbidClickNav: props.forbidClickNav,
|
|
33237
33245
|
titles: props.titles,
|
|
33238
33246
|
isMobile: props.isMobile,
|
|
@@ -33255,7 +33263,7 @@
|
|
|
33255
33263
|
nav: /*#__PURE__*/React__default["default"].createElement(Navigation, {
|
|
33256
33264
|
onNavClicked: props.onNavClicked,
|
|
33257
33265
|
isComplete: state.isComplete,
|
|
33258
|
-
appendContent: props
|
|
33266
|
+
appendContent: props === null || props === void 0 ? void 0 : props.appendContent,
|
|
33259
33267
|
__self: undefined,
|
|
33260
33268
|
__source: {
|
|
33261
33269
|
fileName: _jsxFileName$4,
|
|
@@ -33265,7 +33273,7 @@
|
|
|
33265
33273
|
}),
|
|
33266
33274
|
initialStep: props.initialStep,
|
|
33267
33275
|
onStepChange: handleStepChange,
|
|
33268
|
-
isLazyMount: props
|
|
33276
|
+
isLazyMount: props === null || props === void 0 ? void 0 : props.isLazyMount,
|
|
33269
33277
|
__self: undefined,
|
|
33270
33278
|
__source: {
|
|
33271
33279
|
fileName: _jsxFileName$4,
|
|
@@ -33412,9 +33420,9 @@
|
|
|
33412
33420
|
var _getDatasets;
|
|
33413
33421
|
function getDatasets(content, activeId, isCollapse) {
|
|
33414
33422
|
const datasets = [];
|
|
33415
|
-
for (let i = 0; i < (content
|
|
33423
|
+
for (let i = 0; i < (content === null || content === void 0 ? void 0 : content.length); i++) {
|
|
33416
33424
|
var _content$i;
|
|
33417
|
-
if (((_content$i = content[i])
|
|
33425
|
+
if (((_content$i = content[i]) === null || _content$i === void 0 ? void 0 : _content$i.id) === activeId) {
|
|
33418
33426
|
datasets.unshift(content[i]);
|
|
33419
33427
|
} else {
|
|
33420
33428
|
datasets.push(content[i]);
|
|
@@ -33452,7 +33460,7 @@
|
|
|
33452
33460
|
lineNumber: 107,
|
|
33453
33461
|
columnNumber: 7
|
|
33454
33462
|
}
|
|
33455
|
-
}, (_getDatasets = getDatasets(content, activeId, isCollapse))
|
|
33463
|
+
}, (_getDatasets = getDatasets(content, activeId, isCollapse)) === null || _getDatasets === void 0 ? void 0 : _getDatasets.map((item, index) => {
|
|
33456
33464
|
return /*#__PURE__*/React__default["default"].createElement(List, {
|
|
33457
33465
|
key: index,
|
|
33458
33466
|
__self: this,
|
|
@@ -33469,11 +33477,11 @@
|
|
|
33469
33477
|
marginLeft: '-4px !important',
|
|
33470
33478
|
borderLeftWidth: '4px !important',
|
|
33471
33479
|
borderLeftStyle: 'solid !important',
|
|
33472
|
-
borderLeftColor: `${(item
|
|
33480
|
+
borderLeftColor: `${(item === null || item === void 0 ? void 0 : item.id) === activeId ? colors$8.primary500 : 'transparent'} !important`,
|
|
33473
33481
|
paddingLeft: '16px !important',
|
|
33474
33482
|
minHeight: 25
|
|
33475
33483
|
},
|
|
33476
|
-
"data-to-scrollspy-id": item
|
|
33484
|
+
"data-to-scrollspy-id": item === null || item === void 0 ? void 0 : item.id,
|
|
33477
33485
|
__self: this,
|
|
33478
33486
|
__source: {
|
|
33479
33487
|
fileName: _jsxFileName$2,
|
|
@@ -33482,13 +33490,13 @@
|
|
|
33482
33490
|
}
|
|
33483
33491
|
}, /*#__PURE__*/React__default["default"].createElement(Title$1, {
|
|
33484
33492
|
className: "link-title",
|
|
33485
|
-
active: (item
|
|
33486
|
-
href: `#${item
|
|
33493
|
+
active: (item === null || item === void 0 ? void 0 : item.id) === activeId,
|
|
33494
|
+
href: `#${item === null || item === void 0 ? void 0 : item.id}`,
|
|
33487
33495
|
onClick: e => {
|
|
33488
33496
|
var _e$currentTarget, _e$currentTarget2;
|
|
33489
33497
|
e.preventDefault();
|
|
33490
|
-
onNavClick
|
|
33491
|
-
const target = window.document.getElementById(e
|
|
33498
|
+
onNavClick === null || onNavClick === void 0 || onNavClick(e === null || e === void 0 || (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.href) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.split('#')) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget[1]);
|
|
33499
|
+
const target = window.document.getElementById(e === null || e === void 0 || (_e$currentTarget2 = e.currentTarget) === null || _e$currentTarget2 === void 0 || (_e$currentTarget2 = _e$currentTarget2.href) === null || _e$currentTarget2 === void 0 || (_e$currentTarget2 = _e$currentTarget2.split('#')) === null || _e$currentTarget2 === void 0 ? void 0 : _e$currentTarget2[1]);
|
|
33492
33500
|
if (target) {
|
|
33493
33501
|
var headerOffset = 20;
|
|
33494
33502
|
var elementPosition = target.getBoundingClientRect().top;
|
|
@@ -33512,7 +33520,7 @@
|
|
|
33512
33520
|
lineNumber: 125,
|
|
33513
33521
|
columnNumber: 17
|
|
33514
33522
|
}
|
|
33515
|
-
}, item
|
|
33523
|
+
}, item === null || item === void 0 ? void 0 : item.title), item === null || item === void 0 ? void 0 : item.icon));
|
|
33516
33524
|
})));
|
|
33517
33525
|
}
|
|
33518
33526
|
function TableOfContent({
|