@majoo-ui/react 1.59.11-rc.2 → 1.59.11-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 +257 -239
- package/index.umd.js +257 -239
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -2670,7 +2670,7 @@
|
|
|
2670
2670
|
onClick: e => {
|
|
2671
2671
|
e.preventDefault();
|
|
2672
2672
|
e.stopPropagation();
|
|
2673
|
-
value
|
|
2673
|
+
value === null || value === void 0 || value.onRemove();
|
|
2674
2674
|
},
|
|
2675
2675
|
__self: undefined,
|
|
2676
2676
|
__source: {
|
|
@@ -2689,6 +2689,7 @@
|
|
|
2689
2689
|
}
|
|
2690
2690
|
})));
|
|
2691
2691
|
const SingleTagBanner = props => {
|
|
2692
|
+
var _props$icon;
|
|
2692
2693
|
return /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
2693
2694
|
gap: 2,
|
|
2694
2695
|
direction: "column",
|
|
@@ -2714,7 +2715,7 @@
|
|
|
2714
2715
|
lineNumber: 212,
|
|
2715
2716
|
columnNumber: 9
|
|
2716
2717
|
}
|
|
2717
|
-
}, (props
|
|
2718
|
+
}, (props === null || props === void 0 ? void 0 : props.icon) && /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
2718
2719
|
css: {
|
|
2719
2720
|
marginTop: '-2px'
|
|
2720
2721
|
},
|
|
@@ -2724,7 +2725,7 @@
|
|
|
2724
2725
|
lineNumber: 213,
|
|
2725
2726
|
columnNumber: 27
|
|
2726
2727
|
}
|
|
2727
|
-
}, props
|
|
2728
|
+
}, 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, {
|
|
2728
2729
|
gap: 2,
|
|
2729
2730
|
direction: "column",
|
|
2730
2731
|
css: {
|
|
@@ -2755,7 +2756,7 @@
|
|
|
2755
2756
|
onClick: e => {
|
|
2756
2757
|
e.preventDefault();
|
|
2757
2758
|
e.stopPropagation();
|
|
2758
|
-
props
|
|
2759
|
+
props === null || props === void 0 || props.onRemove();
|
|
2759
2760
|
},
|
|
2760
2761
|
closeCenter: !props.title && !props.link,
|
|
2761
2762
|
__self: undefined,
|
|
@@ -8517,7 +8518,7 @@
|
|
|
8517
8518
|
React.useEffect(() => {
|
|
8518
8519
|
if (textareaRef.current) {
|
|
8519
8520
|
textareaRef.current.style.height = '50px';
|
|
8520
|
-
const scrollHeight = textareaRef
|
|
8521
|
+
const scrollHeight = textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current.scrollHeight;
|
|
8521
8522
|
textareaRef.current.style.height = scrollHeight + 5 + 'px';
|
|
8522
8523
|
}
|
|
8523
8524
|
}, []);
|
|
@@ -8572,7 +8573,7 @@
|
|
|
8572
8573
|
var _jsxFileName$I = "/Users/galuhramadhan/projects/majoo-ui/packages/react/src/components/form/components/InputRadio/InputRadioGroup.js";
|
|
8573
8574
|
const RadioGroup = styled(RadioGroupPrimitive__namespace.Root, Flex$1);
|
|
8574
8575
|
function InputRadioGroup(props) {
|
|
8575
|
-
return (props
|
|
8576
|
+
return (props === null || props === void 0 ? void 0 : props.children) && /*#__PURE__*/React__default["default"].createElement(InputRadioContext.Provider, {
|
|
8576
8577
|
value: props,
|
|
8577
8578
|
__self: this,
|
|
8578
8579
|
__source: {
|
|
@@ -8587,7 +8588,7 @@
|
|
|
8587
8588
|
lineNumber: 14,
|
|
8588
8589
|
columnNumber: 9
|
|
8589
8590
|
}
|
|
8590
|
-
}), React__default["default"].Children.map(props
|
|
8591
|
+
}), React__default["default"].Children.map(props === null || props === void 0 ? void 0 : props.children, child => /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
8591
8592
|
style: Object.assign({}, child.props.style, {
|
|
8592
8593
|
opacity: 1
|
|
8593
8594
|
})
|
|
@@ -8775,8 +8776,9 @@
|
|
|
8775
8776
|
return /*#__PURE__*/React__default["default"].createElement(InputNumber, _extends({}, inputProps, {
|
|
8776
8777
|
readOnly: readOnly,
|
|
8777
8778
|
onFocus: () => {
|
|
8779
|
+
var _inputProps$onFocus;
|
|
8778
8780
|
onValueChange(props.value);
|
|
8779
|
-
inputProps
|
|
8781
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onFocus = inputProps.onFocus) === null || _inputProps$onFocus === void 0 || _inputProps$onFocus.call(inputProps);
|
|
8780
8782
|
},
|
|
8781
8783
|
asChild: true,
|
|
8782
8784
|
__self: this,
|
|
@@ -8791,8 +8793,9 @@
|
|
|
8791
8793
|
disabled: disabled,
|
|
8792
8794
|
readOnly: readOnly,
|
|
8793
8795
|
onFocus: () => {
|
|
8796
|
+
var _inputProps$onFocus2;
|
|
8794
8797
|
onValueChange(props.value);
|
|
8795
|
-
inputProps
|
|
8798
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onFocus2 = inputProps.onFocus) === null || _inputProps$onFocus2 === void 0 || _inputProps$onFocus2.call(inputProps);
|
|
8796
8799
|
},
|
|
8797
8800
|
asChild: true,
|
|
8798
8801
|
__self: this,
|
|
@@ -10757,24 +10760,24 @@
|
|
|
10757
10760
|
allowLeadingZeros,
|
|
10758
10761
|
format
|
|
10759
10762
|
} = Object.assign({}, ref);
|
|
10760
|
-
const formattedValueStartsWithZero = (_formattedValue = formattedValue)
|
|
10761
|
-
const formattedWithZeroAndSuffix = (_formattedValue2 = formattedValue)
|
|
10763
|
+
const formattedValueStartsWithZero = (_formattedValue = formattedValue) === null || _formattedValue === void 0 ? void 0 : _formattedValue.startsWith(`${prefix}0`);
|
|
10764
|
+
const formattedWithZeroAndSuffix = (_formattedValue2 = formattedValue) === null || _formattedValue2 === void 0 ? void 0 : _formattedValue2.endsWith(`0${suffix}`);
|
|
10762
10765
|
const emptyFormattedValue = prefix || suffix || prefix + suffix || '';
|
|
10763
10766
|
if ((formattedValueStartsWithZero || formattedWithZeroAndSuffix) && !allowLeadingZeros && !format) {
|
|
10764
10767
|
var _formattedValue3, _input$value;
|
|
10765
10768
|
const isSpecialChar = /^[+-]/.test(formattedValue);
|
|
10766
|
-
if (formattedValue !== `${prefix}0${suffix}` && !((_formattedValue3 = formattedValue)
|
|
10769
|
+
if (formattedValue !== `${prefix}0${suffix}` && !((_formattedValue3 = formattedValue) !== null && _formattedValue3 !== void 0 && _formattedValue3.includes('0,'))) {
|
|
10767
10770
|
var _formattedValue4, _numAsString;
|
|
10768
|
-
formattedValue = (_formattedValue4 = formattedValue)
|
|
10769
|
-
numAsString = (_numAsString = numAsString)
|
|
10771
|
+
formattedValue = (_formattedValue4 = formattedValue) === null || _formattedValue4 === void 0 ? void 0 : _formattedValue4.replace(new RegExp(`^${isSpecialChar ? '\\' : ''}${prefix}0+${suffix}`), emptyFormattedValue);
|
|
10772
|
+
numAsString = (_numAsString = numAsString) === null || _numAsString === void 0 ? void 0 : _numAsString.replace(/^0+/, '');
|
|
10770
10773
|
}
|
|
10771
|
-
if (formattedValue === emptyFormattedValue && !numAsString && [`${prefix}00${suffix}`, `${prefix}0${suffix}`].includes(input
|
|
10774
|
+
if (formattedValue === emptyFormattedValue && !numAsString && [`${prefix}00${suffix}`, `${prefix}0${suffix}`].includes(input === null || input === void 0 ? void 0 : input.value)) {
|
|
10772
10775
|
formattedValue = `${prefix}0${suffix}`;
|
|
10773
10776
|
numAsString = '0';
|
|
10774
|
-
} else if (input
|
|
10777
|
+
} else if (input !== null && input !== void 0 && (_input$value = input.value) !== null && _input$value !== void 0 && _input$value.includes('0,')) {
|
|
10775
10778
|
allowLeadingZeros = true;
|
|
10776
|
-
formattedValue = input
|
|
10777
|
-
numAsString = this.removeFormatting(input
|
|
10779
|
+
formattedValue = input === null || input === void 0 ? void 0 : input.value;
|
|
10780
|
+
numAsString = this.removeFormatting(input === null || input === void 0 ? void 0 : input.value);
|
|
10778
10781
|
}
|
|
10779
10782
|
}
|
|
10780
10783
|
//end adjustment
|
|
@@ -11232,7 +11235,7 @@
|
|
|
11232
11235
|
}
|
|
11233
11236
|
function getMaxValueLength(maxValue, prefix = '', suffix = '', thousandSeparator) {
|
|
11234
11237
|
const tsLength = thousandSeparator ? countThousandSeparatorsByLength(maxValue) : 0;
|
|
11235
|
-
return maxValue + (prefix
|
|
11238
|
+
return maxValue + (prefix === null || prefix === void 0 ? void 0 : prefix.length) + (suffix === null || suffix === void 0 ? void 0 : suffix.length) + tsLength;
|
|
11236
11239
|
}
|
|
11237
11240
|
const InputNumber = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
11238
11241
|
let {
|
|
@@ -11284,9 +11287,9 @@
|
|
|
11284
11287
|
size: size,
|
|
11285
11288
|
isInvalid: isInvalid,
|
|
11286
11289
|
readOnly: readOnly,
|
|
11287
|
-
isReadOnly: readOnly && !(props
|
|
11290
|
+
isReadOnly: readOnly && !(props !== null && props !== void 0 && props.inputGroup) && !(props !== null && props !== void 0 && props.asChild),
|
|
11288
11291
|
disabled: disabled,
|
|
11289
|
-
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props
|
|
11292
|
+
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props === null || props === void 0 ? void 0 : props.prefix, props === null || props === void 0 ? void 0 : props.suffix, thousandSeparator) : maxLength,
|
|
11290
11293
|
thousandSeparator: thousandSeparator
|
|
11291
11294
|
}, props, {
|
|
11292
11295
|
__self: undefined,
|
|
@@ -11588,16 +11591,16 @@
|
|
|
11588
11591
|
const addTags = event => {
|
|
11589
11592
|
if (event.key === 'Enter' && event.target.value !== '' && max !== tags.length) {
|
|
11590
11593
|
if (tags.find(tag => tag.toLowerCase() === event.target.value.toLowerCase())) {
|
|
11591
|
-
onEnter
|
|
11594
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11592
11595
|
key: 'duplicate',
|
|
11593
11596
|
value: event.target.value
|
|
11594
11597
|
});
|
|
11595
11598
|
return;
|
|
11596
11599
|
}
|
|
11597
|
-
if (pattern && pattern
|
|
11600
|
+
if (pattern && pattern !== null && pattern !== void 0 && pattern.regex) {
|
|
11598
11601
|
const regex = new RegExp(pattern.regex);
|
|
11599
11602
|
if (!regex.test(event.target.value)) {
|
|
11600
|
-
onEnter
|
|
11603
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11601
11604
|
key: 'error',
|
|
11602
11605
|
value: event.target.value
|
|
11603
11606
|
});
|
|
@@ -11606,7 +11609,7 @@
|
|
|
11606
11609
|
}
|
|
11607
11610
|
}
|
|
11608
11611
|
setRegexError(false);
|
|
11609
|
-
onEnter
|
|
11612
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11610
11613
|
key: 'success',
|
|
11611
11614
|
value: event.target.value
|
|
11612
11615
|
});
|
|
@@ -11618,7 +11621,7 @@
|
|
|
11618
11621
|
if (disabled || readOnly) {
|
|
11619
11622
|
return tags;
|
|
11620
11623
|
} else if (key === 'removeTag' || key === 'Backspace') {
|
|
11621
|
-
onRemoveItem
|
|
11624
|
+
onRemoveItem === null || onRemoveItem === void 0 || onRemoveItem(tags[index]);
|
|
11622
11625
|
setTags([...tags.filter(tag => tags.indexOf(tag) !== index)]);
|
|
11623
11626
|
}
|
|
11624
11627
|
};
|
|
@@ -11669,7 +11672,7 @@
|
|
|
11669
11672
|
lineNumber: 180,
|
|
11670
11673
|
columnNumber: 9
|
|
11671
11674
|
}
|
|
11672
|
-
})), regexError && pattern && (pattern
|
|
11675
|
+
})), regexError && pattern && (pattern !== null && pattern !== void 0 && pattern.errorMessage ? /*#__PURE__*/React__default["default"].createElement(FormHelper, {
|
|
11673
11676
|
color: "red",
|
|
11674
11677
|
__self: this,
|
|
11675
11678
|
__source: {
|
|
@@ -11977,14 +11980,14 @@
|
|
|
11977
11980
|
t
|
|
11978
11981
|
} = reactI18next.useTranslation(['MajooUI/inputSearchbox', 'translation']);
|
|
11979
11982
|
const [value, setValue] = React.useState(defaultValue);
|
|
11980
|
-
const inputValue = (_props$value = props
|
|
11981
|
-
const debounceChange = React.useCallback(debounce__default["default"](e => onChange
|
|
11983
|
+
const inputValue = (_props$value = props === null || props === void 0 ? void 0 : props.value) != null ? _props$value : value;
|
|
11984
|
+
const debounceChange = React.useCallback(debounce__default["default"](e => onChange === null || onChange === void 0 ? void 0 : onChange(e), 1000), [onChange]);
|
|
11982
11985
|
const handleChange = React.useCallback(e => {
|
|
11983
11986
|
setValue(e.target.value);
|
|
11984
11987
|
if (withDebounce) {
|
|
11985
11988
|
debounceChange(e.target.value);
|
|
11986
11989
|
} else {
|
|
11987
|
-
onChange
|
|
11990
|
+
onChange === null || onChange === void 0 || onChange(e.target.value);
|
|
11988
11991
|
}
|
|
11989
11992
|
}, [onChange, debounceChange, withDebounce]);
|
|
11990
11993
|
const handleClearButtonClick = e => {
|
|
@@ -12037,7 +12040,7 @@
|
|
|
12037
12040
|
columnNumber: 7
|
|
12038
12041
|
}
|
|
12039
12042
|
})), /*#__PURE__*/React__default["default"].createElement(InputRightElement, {
|
|
12040
|
-
children: (inputValue
|
|
12043
|
+
children: (inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(SvgCloseFilled, {
|
|
12041
12044
|
color: colors$7.iconSecondary,
|
|
12042
12045
|
__self: undefined,
|
|
12043
12046
|
__source: {
|
|
@@ -12282,7 +12285,7 @@
|
|
|
12282
12285
|
middleware: [react$1.offset(_sideOffset), react$1.shift(), _flip && react$1.flip()],
|
|
12283
12286
|
onOpenChange: isOpen => {
|
|
12284
12287
|
setOpenState(isOpen);
|
|
12285
|
-
!isOpen && (onClose
|
|
12288
|
+
!isOpen && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
12286
12289
|
},
|
|
12287
12290
|
placement
|
|
12288
12291
|
});
|
|
@@ -14167,13 +14170,13 @@
|
|
|
14167
14170
|
const isShowSelectAll = showSelectAll && !maxSelectedItem;
|
|
14168
14171
|
React.useEffect(() => {
|
|
14169
14172
|
var _scrollerRef$current;
|
|
14170
|
-
(_scrollerRef$current = scrollerRef.current)
|
|
14173
|
+
(_scrollerRef$current = scrollerRef.current) === null || _scrollerRef$current === void 0 || _scrollerRef$current.scrollTo({
|
|
14171
14174
|
top: 0
|
|
14172
14175
|
});
|
|
14173
14176
|
}, [query]);
|
|
14174
14177
|
React.useEffect(() => {
|
|
14175
|
-
if (defaultValue
|
|
14176
|
-
if (value
|
|
14178
|
+
if (defaultValue !== null && defaultValue !== void 0 && defaultValue.length) {
|
|
14179
|
+
if (value !== null && value !== void 0 && value.length) {
|
|
14177
14180
|
setInputSelectValue(value);
|
|
14178
14181
|
}
|
|
14179
14182
|
} else {
|
|
@@ -14238,7 +14241,7 @@
|
|
|
14238
14241
|
removeSelectedItem,
|
|
14239
14242
|
selectedItems
|
|
14240
14243
|
} = Downshift.useMultipleSelection({
|
|
14241
|
-
selectedItems: selectedValue.length > 0 ? initItem
|
|
14244
|
+
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)) : []
|
|
14242
14245
|
});
|
|
14243
14246
|
const generateOptions = data => {
|
|
14244
14247
|
return data.map(option => {
|
|
@@ -14260,7 +14263,7 @@
|
|
|
14260
14263
|
};
|
|
14261
14264
|
const debouncedSearch = React__default["default"].useRef(debounce__default["default"](_async(function (query) {
|
|
14262
14265
|
setQuery(query);
|
|
14263
|
-
onSearch
|
|
14266
|
+
onSearch === null || onSearch === void 0 || onSearch(query);
|
|
14264
14267
|
return _await();
|
|
14265
14268
|
}), 1000)).current;
|
|
14266
14269
|
React__default["default"].useEffect(() => {
|
|
@@ -14269,7 +14272,7 @@
|
|
|
14269
14272
|
};
|
|
14270
14273
|
}, [debouncedSearch]);
|
|
14271
14274
|
const handleInputValue = input => {
|
|
14272
|
-
onSearch
|
|
14275
|
+
onSearch === null || onSearch === void 0 || onSearch(input);
|
|
14273
14276
|
if (input === '') {
|
|
14274
14277
|
if (disabledOptions.length > 0) {
|
|
14275
14278
|
setItems(generateOptions(sortDisabled));
|
|
@@ -14277,9 +14280,9 @@
|
|
|
14277
14280
|
return setItems(sortValue);
|
|
14278
14281
|
}
|
|
14279
14282
|
} else {
|
|
14280
|
-
let filterItems = option
|
|
14281
|
-
var _item$name;
|
|
14282
|
-
return item
|
|
14283
|
+
let filterItems = option === null || option === void 0 ? void 0 : option.filter(item => {
|
|
14284
|
+
var _item$name, _item$name$includes, _input$toLocaleLowerC;
|
|
14285
|
+
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));
|
|
14283
14286
|
});
|
|
14284
14287
|
setItems(filterItems);
|
|
14285
14288
|
}
|
|
@@ -14288,10 +14291,10 @@
|
|
|
14288
14291
|
if (disabled || readOnly) {
|
|
14289
14292
|
return selectedValue;
|
|
14290
14293
|
} else {
|
|
14291
|
-
if ((selected
|
|
14294
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.id) === 'counter') {
|
|
14292
14295
|
setSelectedValue([]);
|
|
14293
14296
|
setInputSelectValue([]);
|
|
14294
|
-
onChange
|
|
14297
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14295
14298
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14296
14299
|
removeSelectedItem(selectedValue[i]);
|
|
14297
14300
|
}
|
|
@@ -14301,7 +14304,7 @@
|
|
|
14301
14304
|
setSelectedValue(filterItems);
|
|
14302
14305
|
setInputSelectValue(filterItems);
|
|
14303
14306
|
if (selected.id !== '!all') {
|
|
14304
|
-
onChange
|
|
14307
|
+
onChange === null || onChange === void 0 || onChange(filterItems);
|
|
14305
14308
|
}
|
|
14306
14309
|
}
|
|
14307
14310
|
}
|
|
@@ -14339,9 +14342,9 @@
|
|
|
14339
14342
|
if (selectedItem.id === '!all') {
|
|
14340
14343
|
items.forEach(item => {
|
|
14341
14344
|
var _item$children;
|
|
14342
|
-
if (item
|
|
14345
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
|
14343
14346
|
var _item$children2;
|
|
14344
|
-
item
|
|
14347
|
+
item === null || item === void 0 || (_item$children2 = item.children) === null || _item$children2 === void 0 || _item$children2.forEach(item => {
|
|
14345
14348
|
removeSelectedItem(item);
|
|
14346
14349
|
});
|
|
14347
14350
|
} else {
|
|
@@ -14350,7 +14353,7 @@
|
|
|
14350
14353
|
});
|
|
14351
14354
|
setSelectedValue([]);
|
|
14352
14355
|
setInputSelectValue([]);
|
|
14353
|
-
onChange
|
|
14356
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14354
14357
|
} else {
|
|
14355
14358
|
removeItem(selectedItem);
|
|
14356
14359
|
}
|
|
@@ -14361,9 +14364,9 @@
|
|
|
14361
14364
|
const itemIds = [];
|
|
14362
14365
|
items.forEach(item => {
|
|
14363
14366
|
var _item$children3;
|
|
14364
|
-
if (item
|
|
14367
|
+
if (item !== null && item !== void 0 && (_item$children3 = item.children) !== null && _item$children3 !== void 0 && _item$children3.length) {
|
|
14365
14368
|
var _item$children4;
|
|
14366
|
-
item
|
|
14369
|
+
item === null || item === void 0 || (_item$children4 = item.children) === null || _item$children4 === void 0 || _item$children4.forEach(item => {
|
|
14367
14370
|
addSelectedItem(item);
|
|
14368
14371
|
itemIds.push(item.id);
|
|
14369
14372
|
});
|
|
@@ -14375,16 +14378,16 @@
|
|
|
14375
14378
|
setSelectedValue(itemIds);
|
|
14376
14379
|
setInputSelectValue(itemIds);
|
|
14377
14380
|
// onChange?.(itemIds.slice(1).filter(id => !items.find(item => item.id === id)?.children?.length));
|
|
14378
|
-
onChange
|
|
14381
|
+
onChange === null || onChange === void 0 || onChange(itemIds.slice(1));
|
|
14379
14382
|
} else {
|
|
14380
14383
|
var _selectedItem$childre;
|
|
14381
14384
|
//start check if item have children (option group)
|
|
14382
|
-
if (selectedItem
|
|
14385
|
+
if (selectedItem !== null && selectedItem !== void 0 && (_selectedItem$childre = selectedItem.children) !== null && _selectedItem$childre !== void 0 && _selectedItem$childre.length) {
|
|
14383
14386
|
var _selectedItem$childre2;
|
|
14384
14387
|
const itemIdsSelect = [];
|
|
14385
14388
|
const itemIdsUnSelect = [];
|
|
14386
|
-
selectedItem
|
|
14387
|
-
if (selectedValue
|
|
14389
|
+
selectedItem === null || selectedItem === void 0 || (_selectedItem$childre2 = selectedItem.children) === null || _selectedItem$childre2 === void 0 || _selectedItem$childre2.forEach(item => {
|
|
14390
|
+
if (selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id)) {
|
|
14388
14391
|
removeSelectedItem(item);
|
|
14389
14392
|
itemIdsUnSelect.push(item.id);
|
|
14390
14393
|
} else {
|
|
@@ -14398,19 +14401,19 @@
|
|
|
14398
14401
|
setSelectedValue([...selectedValue, ...itemIdsSelect]);
|
|
14399
14402
|
setInputSelectValue([...selectedValue, ...itemIdsSelect]);
|
|
14400
14403
|
const _filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14401
|
-
onChange
|
|
14404
|
+
onChange === null || onChange === void 0 || onChange([..._filteredSelectedValues, ...itemIdsSelect]);
|
|
14402
14405
|
}
|
|
14403
14406
|
|
|
14404
14407
|
//unselect all child in one of the option groups
|
|
14405
14408
|
if (itemIdsUnSelect.length) {
|
|
14406
14409
|
const newSelectedValue = selectedValue.filter(selId => {
|
|
14407
14410
|
var _itemIdsUnSelect$filt;
|
|
14408
|
-
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId))
|
|
14411
|
+
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId)) === null || _itemIdsUnSelect$filt === void 0 ? void 0 : _itemIdsUnSelect$filt[0]) !== selId && selId;
|
|
14409
14412
|
});
|
|
14410
14413
|
setSelectedValue(newSelectedValue);
|
|
14411
14414
|
setInputSelectValue(newSelectedValue);
|
|
14412
14415
|
const _filteredSelectedValues2 = newSelectedValue.filter(val => val !== '!all');
|
|
14413
|
-
onChange
|
|
14416
|
+
onChange === null || onChange === void 0 || onChange(_filteredSelectedValues2);
|
|
14414
14417
|
}
|
|
14415
14418
|
return;
|
|
14416
14419
|
}
|
|
@@ -14427,7 +14430,7 @@
|
|
|
14427
14430
|
setSelectedValue([...selectedValue, selectedItem.id]);
|
|
14428
14431
|
setInputSelectValue([...selectedValue, selectedItem.id]);
|
|
14429
14432
|
const filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14430
|
-
onChange
|
|
14433
|
+
onChange === null || onChange === void 0 || onChange([...filteredSelectedValues, selectedItem.id]);
|
|
14431
14434
|
}
|
|
14432
14435
|
selectItem(null);
|
|
14433
14436
|
}
|
|
@@ -14459,9 +14462,9 @@
|
|
|
14459
14462
|
}
|
|
14460
14463
|
}
|
|
14461
14464
|
});
|
|
14462
|
-
const getOption = React.useCallback(() => maxSelectedItem ? option
|
|
14463
|
-
const isMaxSelectedItem = maxSelectedItem && (selectedValue
|
|
14464
|
-
if (isMaxSelectedItem && !(selectedValue
|
|
14465
|
+
const getOption = React.useCallback(() => maxSelectedItem ? option === null || option === void 0 ? void 0 : option.map(item => {
|
|
14466
|
+
const isMaxSelectedItem = maxSelectedItem && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) >= maxSelectedItem;
|
|
14467
|
+
if (isMaxSelectedItem && !(selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id))) {
|
|
14465
14468
|
item.hideCheck = true;
|
|
14466
14469
|
item.isDisabled = true;
|
|
14467
14470
|
} else {
|
|
@@ -14470,7 +14473,7 @@
|
|
|
14470
14473
|
}
|
|
14471
14474
|
return item;
|
|
14472
14475
|
}) : option, [maxSelectedItem, option, selectedValue]);
|
|
14473
|
-
const itemsLength = items
|
|
14476
|
+
const itemsLength = items === null || items === void 0 ? void 0 : items.reduce((acc, item) => {
|
|
14474
14477
|
return [...acc, ...(item.children ? item.children : [item])];
|
|
14475
14478
|
}, []).length;
|
|
14476
14479
|
React.useEffect(() => {
|
|
@@ -14517,15 +14520,16 @@
|
|
|
14517
14520
|
}, [label, isOpen]);
|
|
14518
14521
|
const toggleCollapsible = () => setShowAllTags(!showAllTags);
|
|
14519
14522
|
const handleRemoveAllItem = () => {
|
|
14520
|
-
onChange
|
|
14523
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14521
14524
|
setSelectedValue([]);
|
|
14522
14525
|
setInputSelectValue([]);
|
|
14523
14526
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14524
14527
|
removeSelectedItem(selectedValue[i]);
|
|
14525
14528
|
}
|
|
14526
14529
|
};
|
|
14527
|
-
const isShowTagSelectAll = showTagSelectAll && (selectedItems
|
|
14530
|
+
const isShowTagSelectAll = showTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > (option === null || option === void 0 ? void 0 : option.length);
|
|
14528
14531
|
const renderOptionItem = (item, index, asChild) => {
|
|
14532
|
+
var _item$render;
|
|
14529
14533
|
return /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
14530
14534
|
key: item.id
|
|
14531
14535
|
}, getItemProps({
|
|
@@ -14558,7 +14562,7 @@
|
|
|
14558
14562
|
lineNumber: 745,
|
|
14559
14563
|
columnNumber: 11
|
|
14560
14564
|
}
|
|
14561
|
-
}, !(item
|
|
14565
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14562
14566
|
color: colors$8.iconDisable,
|
|
14563
14567
|
__self: undefined,
|
|
14564
14568
|
__source: {
|
|
@@ -14574,7 +14578,7 @@
|
|
|
14574
14578
|
lineNumber: 760,
|
|
14575
14579
|
columnNumber: 19
|
|
14576
14580
|
}
|
|
14577
|
-
})), isShowSelectAll && (item
|
|
14581
|
+
})), 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, {
|
|
14578
14582
|
__self: undefined,
|
|
14579
14583
|
__source: {
|
|
14580
14584
|
fileName: _jsxFileName$y,
|
|
@@ -14599,15 +14603,15 @@
|
|
|
14599
14603
|
lineNumber: 769,
|
|
14600
14604
|
columnNumber: 11
|
|
14601
14605
|
}
|
|
14602
|
-
}, item.render ? item.render
|
|
14606
|
+
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
14603
14607
|
};
|
|
14604
14608
|
let lastGroupIndex = showSelectAll ? 1 : 0;
|
|
14605
14609
|
const renderOptionGroupItem = (item, index) => {
|
|
14606
|
-
var _item$children5, _item$children6, _item$children7, _item$children8;
|
|
14610
|
+
var _item$children5, _item$children6, _item$children7, _item$render2, _item$children8;
|
|
14607
14611
|
// const groupIndex = (index > (showSelectAll ? 1 : 0)) ? lastGroupIndex : 0;
|
|
14608
14612
|
const groupIndex = lastGroupIndex;
|
|
14609
|
-
lastGroupIndex += ((item
|
|
14610
|
-
const filterSelectedChild = item
|
|
14613
|
+
lastGroupIndex += ((item === null || item === void 0 || (_item$children5 = item.children) === null || _item$children5 === void 0 ? void 0 : _item$children5.length) || 0) + 1;
|
|
14614
|
+
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);
|
|
14611
14615
|
return /*#__PURE__*/React__default["default"].createElement(OptionGroupItem, {
|
|
14612
14616
|
item: /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
14613
14617
|
key: item.id
|
|
@@ -14640,7 +14644,7 @@
|
|
|
14640
14644
|
lineNumber: 799,
|
|
14641
14645
|
columnNumber: 15
|
|
14642
14646
|
}
|
|
14643
|
-
}, !(item
|
|
14647
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14644
14648
|
color: colors$8.iconDisable,
|
|
14645
14649
|
__self: undefined,
|
|
14646
14650
|
__source: {
|
|
@@ -14648,7 +14652,7 @@
|
|
|
14648
14652
|
lineNumber: 809,
|
|
14649
14653
|
columnNumber: 19
|
|
14650
14654
|
}
|
|
14651
|
-
}) : (filterSelectedChild
|
|
14655
|
+
}) : (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, {
|
|
14652
14656
|
color: colors$8.iconGreen,
|
|
14653
14657
|
__self: undefined,
|
|
14654
14658
|
__source: {
|
|
@@ -14656,7 +14660,7 @@
|
|
|
14656
14660
|
lineNumber: 811,
|
|
14657
14661
|
columnNumber: 19
|
|
14658
14662
|
}
|
|
14659
|
-
}) : (filterSelectedChild
|
|
14663
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled$1, {
|
|
14660
14664
|
__self: undefined,
|
|
14661
14665
|
__source: {
|
|
14662
14666
|
fileName: _jsxFileName$y,
|
|
@@ -14674,14 +14678,14 @@
|
|
|
14674
14678
|
lineNumber: 816,
|
|
14675
14679
|
columnNumber: 15
|
|
14676
14680
|
}
|
|
14677
|
-
}, item.render ? item.render
|
|
14681
|
+
}, item.render ? (_item$render2 = item.render) === null || _item$render2 === void 0 ? void 0 : _item$render2.call(item, item.name) : item.name)),
|
|
14678
14682
|
__self: undefined,
|
|
14679
14683
|
__source: {
|
|
14680
14684
|
fileName: _jsxFileName$y,
|
|
14681
14685
|
lineNumber: 784,
|
|
14682
14686
|
columnNumber: 9
|
|
14683
14687
|
}
|
|
14684
|
-
}, item
|
|
14688
|
+
}, 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)));
|
|
14685
14689
|
};
|
|
14686
14690
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper$1, _extends({
|
|
14687
14691
|
css: css
|
|
@@ -14812,13 +14816,13 @@
|
|
|
14812
14816
|
lineNumber: 875,
|
|
14813
14817
|
columnNumber: 17
|
|
14814
14818
|
}
|
|
14815
|
-
}), selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')) : selectedItems
|
|
14819
|
+
}), 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) => {
|
|
14816
14820
|
if (showAllTags || !collapsible) {
|
|
14817
14821
|
return true;
|
|
14818
14822
|
} else {
|
|
14819
14823
|
return idx < 5;
|
|
14820
14824
|
}
|
|
14821
|
-
}))
|
|
14825
|
+
})) === null || _selectedItems$filter === void 0 ? void 0 : _selectedItems$filter.map((selectedItem, index) => /*#__PURE__*/React__default["default"].createElement(Tag, _extends({
|
|
14822
14826
|
disabled: disabled,
|
|
14823
14827
|
isRemovable: readOnly || disabled || unremovableTags.includes(selectedItem.id) ? false : true,
|
|
14824
14828
|
size: "lg",
|
|
@@ -14843,7 +14847,7 @@
|
|
|
14843
14847
|
lineNumber: 904,
|
|
14844
14848
|
columnNumber: 21
|
|
14845
14849
|
}
|
|
14846
|
-
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems
|
|
14850
|
+
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > collapsibleLimit && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
14847
14851
|
direction: "column",
|
|
14848
14852
|
gap: 4,
|
|
14849
14853
|
__self: undefined,
|
|
@@ -14929,7 +14933,7 @@
|
|
|
14929
14933
|
lineNumber: 947,
|
|
14930
14934
|
columnNumber: 19
|
|
14931
14935
|
}
|
|
14932
|
-
}, `${selectedItems
|
|
14936
|
+
}, `${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, {
|
|
14933
14937
|
css: {
|
|
14934
14938
|
fontSize: '$label',
|
|
14935
14939
|
marginTop: '$spacing-01'
|
|
@@ -14941,7 +14945,7 @@
|
|
|
14941
14945
|
lineNumber: 957,
|
|
14942
14946
|
columnNumber: 11
|
|
14943
14947
|
}
|
|
14944
|
-
}, `${selectedItems
|
|
14948
|
+
}, `${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, {
|
|
14945
14949
|
placement: placement,
|
|
14946
14950
|
css: {
|
|
14947
14951
|
display: isOpen && disabled === false ? 'block' : 'none',
|
|
@@ -14999,7 +15003,7 @@
|
|
|
14999
15003
|
}), /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
15000
15004
|
condition: !!fetchData && items.length > 0,
|
|
15001
15005
|
wrapper: child => /*#__PURE__*/React__default["default"].createElement(InfiniteScroll__default["default"], {
|
|
15002
|
-
loadMore: () => !isLoading && (fetchData
|
|
15006
|
+
loadMore: () => !isLoading && (fetchData === null || fetchData === void 0 ? void 0 : fetchData({
|
|
15003
15007
|
query
|
|
15004
15008
|
})),
|
|
15005
15009
|
hasMore: true,
|
|
@@ -15018,7 +15022,7 @@
|
|
|
15018
15022
|
lineNumber: 997,
|
|
15019
15023
|
columnNumber: 15
|
|
15020
15024
|
}
|
|
15021
|
-
}, isOpen && items.map((item, index) => item
|
|
15025
|
+
}, isOpen && items.map((item, index) => item !== null && item !== void 0 && item.children ? renderOptionGroupItem(item) : renderOptionItem(item, index)))) : /*#__PURE__*/React__default["default"].createElement(Option, _extends({
|
|
15022
15026
|
css: {
|
|
15023
15027
|
height: 'auto'
|
|
15024
15028
|
}
|
|
@@ -17443,9 +17447,9 @@
|
|
|
17443
17447
|
}
|
|
17444
17448
|
function handleInputChange(type, e) {
|
|
17445
17449
|
var _e$target;
|
|
17446
|
-
const value = e
|
|
17450
|
+
const value = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
|
|
17447
17451
|
const format = 'DD:MM:YYYY:HH:mm';
|
|
17448
|
-
const minLength = (value
|
|
17452
|
+
const minLength = (value === null || value === void 0 ? void 0 : value.length) > 1;
|
|
17449
17453
|
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());
|
|
17450
17454
|
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());
|
|
17451
17455
|
if (!disabled) {
|
|
@@ -18135,7 +18139,10 @@
|
|
|
18135
18139
|
children: "Hingga Pukul"
|
|
18136
18140
|
}), void 0), jsxRuntime.jsx(InputTimePicker, {
|
|
18137
18141
|
onChange: function (val) {
|
|
18138
|
-
|
|
18142
|
+
var endDate = moment__default["default"](endTime).format('YYYY-MM-DD');
|
|
18143
|
+
var newTime = val.format('HH:mm');
|
|
18144
|
+
var newValue = moment__default["default"]("".concat(endDate, " ").concat(newTime), 'YYYY-MM-DD HH:mm').toDate();
|
|
18145
|
+
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([selected[0], newValue]);
|
|
18139
18146
|
},
|
|
18140
18147
|
size: "sm",
|
|
18141
18148
|
value: endTime,
|
|
@@ -19484,11 +19491,15 @@
|
|
|
19484
19491
|
onSelectedDate === null || onSelectedDate === void 0 ? void 0 : onSelectedDate([selectedDate.date]);
|
|
19485
19492
|
} else {
|
|
19486
19493
|
if (new Date(dateValue[0]) > selectedDate.date) {
|
|
19487
|
-
|
|
19488
|
-
|
|
19494
|
+
var dateAsString = moment__default["default"](dateValue[0]).format('YYYY-MM-DD');
|
|
19495
|
+
var newValue = [selectedDate.date, moment__default["default"]("".concat(dateAsString, " 23:59"), 'YYYY-MM-DD HH:mm').toDate()];
|
|
19496
|
+
setDateValue(newValue);
|
|
19497
|
+
onSelectedDate === null || onSelectedDate === void 0 ? void 0 : onSelectedDate(newValue);
|
|
19489
19498
|
} else {
|
|
19490
|
-
|
|
19491
|
-
|
|
19499
|
+
var dateAsString = moment__default["default"](selectedDate.date).format('YYYY-MM-DD');
|
|
19500
|
+
var newValue = [dateValue[0], moment__default["default"]("".concat(dateAsString, " 23:59"), 'YYYY-MM-DD HH:mm').toDate()];
|
|
19501
|
+
setDateValue(newValue);
|
|
19502
|
+
onSelectedDate === null || onSelectedDate === void 0 ? void 0 : onSelectedDate(newValue);
|
|
19492
19503
|
}
|
|
19493
19504
|
}
|
|
19494
19505
|
};
|
|
@@ -20141,11 +20152,14 @@
|
|
|
20141
20152
|
options: (advanceOptions === null || advanceOptions === void 0 ? void 0 : advanceOptions.options) || options,
|
|
20142
20153
|
disabled: disabled,
|
|
20143
20154
|
optionHandler: function (value) {
|
|
20155
|
+
var reducedResult = advancePickerReducer(value, undefined);
|
|
20156
|
+
var dateAsString = moment__default["default"](reducedResult[1]).format('YYYY-MM-DD');
|
|
20157
|
+
var payload = [reducedResult[0], moment__default["default"]("".concat(dateAsString, " 23:59"), 'YYYY-MM-DD HH:mm').toDate()];
|
|
20144
20158
|
dispatch({
|
|
20145
20159
|
type: 'UPDATE',
|
|
20146
|
-
payload:
|
|
20160
|
+
payload: payload
|
|
20147
20161
|
});
|
|
20148
|
-
if (onChange) onChange(
|
|
20162
|
+
if (onChange) onChange(payload);
|
|
20149
20163
|
setOpenPicker(false);
|
|
20150
20164
|
}
|
|
20151
20165
|
}, void 0) : {
|
|
@@ -21392,7 +21406,7 @@
|
|
|
21392
21406
|
};
|
|
21393
21407
|
};
|
|
21394
21408
|
const getValue = () => {
|
|
21395
|
-
let value = props
|
|
21409
|
+
let value = props === null || props === void 0 ? void 0 : props.value;
|
|
21396
21410
|
const isTrailing = variantIcon === 'trailing';
|
|
21397
21411
|
if (typeof value === 'number' || parseInt(value)) {
|
|
21398
21412
|
if (Math.sign(value) === 1 || Math.sign(value) === 0) {
|
|
@@ -22024,7 +22038,7 @@
|
|
|
22024
22038
|
justify: "center",
|
|
22025
22039
|
onClick: () => {
|
|
22026
22040
|
var _dialogPageRef$curren;
|
|
22027
|
-
return (_dialogPageRef$curren = dialogPageRef.current)
|
|
22041
|
+
return (_dialogPageRef$curren = dialogPageRef.current) === null || _dialogPageRef$curren === void 0 ? void 0 : _dialogPageRef$curren.click();
|
|
22028
22042
|
},
|
|
22029
22043
|
__self: undefined,
|
|
22030
22044
|
__source: {
|
|
@@ -22102,7 +22116,7 @@
|
|
|
22102
22116
|
onSubmit: () => {
|
|
22103
22117
|
var _dialogPageRef$curren2;
|
|
22104
22118
|
debouncedGoToPage(Number(goToPage));
|
|
22105
|
-
(_dialogPageRef$curren2 = dialogPageRef.current)
|
|
22119
|
+
(_dialogPageRef$curren2 = dialogPageRef.current) === null || _dialogPageRef$curren2 === void 0 || _dialogPageRef$curren2.click();
|
|
22106
22120
|
},
|
|
22107
22121
|
__self: undefined,
|
|
22108
22122
|
__source: {
|
|
@@ -22119,7 +22133,7 @@
|
|
|
22119
22133
|
allowNegative: false,
|
|
22120
22134
|
onChange: e => {
|
|
22121
22135
|
var _e$target;
|
|
22122
|
-
return setGoToPage((_e$target = e.target)
|
|
22136
|
+
return setGoToPage((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
22123
22137
|
},
|
|
22124
22138
|
__self: undefined,
|
|
22125
22139
|
__source: {
|
|
@@ -22152,7 +22166,7 @@
|
|
|
22152
22166
|
onClick: () => {
|
|
22153
22167
|
var _dialogPageRef$curren3;
|
|
22154
22168
|
setGoToPage(null);
|
|
22155
|
-
(_dialogPageRef$curren3 = dialogPageRef.current)
|
|
22169
|
+
(_dialogPageRef$curren3 = dialogPageRef.current) === null || _dialogPageRef$curren3 === void 0 || _dialogPageRef$curren3.click();
|
|
22156
22170
|
},
|
|
22157
22171
|
__self: undefined,
|
|
22158
22172
|
__source: {
|
|
@@ -22167,7 +22181,7 @@
|
|
|
22167
22181
|
onClick: () => {
|
|
22168
22182
|
var _dialogPageRef$curren4;
|
|
22169
22183
|
debouncedGoToPage(Number(goToPage));
|
|
22170
|
-
(_dialogPageRef$curren4 = dialogPageRef.current)
|
|
22184
|
+
(_dialogPageRef$curren4 = dialogPageRef.current) === null || _dialogPageRef$curren4 === void 0 || _dialogPageRef$curren4.click();
|
|
22171
22185
|
},
|
|
22172
22186
|
__self: undefined,
|
|
22173
22187
|
__source: {
|
|
@@ -22256,7 +22270,7 @@
|
|
|
22256
22270
|
onClick: () => {
|
|
22257
22271
|
if (isMobilePagination) {
|
|
22258
22272
|
var _dialogLimitRef$curre;
|
|
22259
|
-
(_dialogLimitRef$curre = dialogLimitRef.current)
|
|
22273
|
+
(_dialogLimitRef$curre = dialogLimitRef.current) === null || _dialogLimitRef$curre === void 0 || _dialogLimitRef$curre.click();
|
|
22260
22274
|
}
|
|
22261
22275
|
},
|
|
22262
22276
|
__self: this,
|
|
@@ -22302,7 +22316,7 @@
|
|
|
22302
22316
|
lineNumber: 60,
|
|
22303
22317
|
columnNumber: 13
|
|
22304
22318
|
}
|
|
22305
|
-
}, limits
|
|
22319
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(PopoverClose, {
|
|
22306
22320
|
key: limit,
|
|
22307
22321
|
css: limitItemContainerStyle(selectedLimit === limit),
|
|
22308
22322
|
onClick: () => onChange(limit),
|
|
@@ -22385,7 +22399,7 @@
|
|
|
22385
22399
|
lineNumber: 100,
|
|
22386
22400
|
columnNumber: 11
|
|
22387
22401
|
}
|
|
22388
|
-
}, limits
|
|
22402
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
22389
22403
|
css: {
|
|
22390
22404
|
height: 44,
|
|
22391
22405
|
width: '100%',
|
|
@@ -22400,7 +22414,7 @@
|
|
|
22400
22414
|
onClick: () => {
|
|
22401
22415
|
var _dialogLimitRef$curre2;
|
|
22402
22416
|
onChange(limit);
|
|
22403
|
-
(_dialogLimitRef$curre2 = dialogLimitRef.current)
|
|
22417
|
+
(_dialogLimitRef$curre2 = dialogLimitRef.current) === null || _dialogLimitRef$curre2 === void 0 || _dialogLimitRef$curre2.click();
|
|
22404
22418
|
},
|
|
22405
22419
|
__self: this,
|
|
22406
22420
|
__source: {
|
|
@@ -24667,7 +24681,7 @@
|
|
|
24667
24681
|
onClick: () => {
|
|
24668
24682
|
var _document$getElements;
|
|
24669
24683
|
setOpenDrop(true);
|
|
24670
|
-
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu'))
|
|
24684
|
+
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu')) === null || _document$getElements === void 0 ? void 0 : _document$getElements[0];
|
|
24671
24685
|
contextMenu.style.opacity = 0;
|
|
24672
24686
|
},
|
|
24673
24687
|
__self: undefined,
|
|
@@ -25323,7 +25337,7 @@
|
|
|
25323
25337
|
if (!props.onOpenAutoFocus) {
|
|
25324
25338
|
e.preventDefault();
|
|
25325
25339
|
} else {
|
|
25326
|
-
props
|
|
25340
|
+
props === null || props === void 0 || props.onOpenAutoFocus();
|
|
25327
25341
|
}
|
|
25328
25342
|
},
|
|
25329
25343
|
__self: undefined,
|
|
@@ -25403,7 +25417,7 @@
|
|
|
25403
25417
|
}, props.description)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
25404
25418
|
css: {
|
|
25405
25419
|
width: '100%',
|
|
25406
|
-
display: props
|
|
25420
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25407
25421
|
},
|
|
25408
25422
|
__self: undefined,
|
|
25409
25423
|
__source: {
|
|
@@ -25445,8 +25459,8 @@
|
|
|
25445
25459
|
size: props.btnSize,
|
|
25446
25460
|
onClick: buttonConfirm,
|
|
25447
25461
|
buttonType: props.dialogType,
|
|
25448
|
-
disabled: props
|
|
25449
|
-
}, props
|
|
25462
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25463
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25450
25464
|
__self: undefined,
|
|
25451
25465
|
__source: {
|
|
25452
25466
|
fileName: _jsxFileName$b,
|
|
@@ -25465,19 +25479,19 @@
|
|
|
25465
25479
|
size: props.btnSize,
|
|
25466
25480
|
onClick: buttonCancel,
|
|
25467
25481
|
css: {
|
|
25468
|
-
color: props.dialogType === 'negative' && !(props
|
|
25482
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25469
25483
|
flex: props.isMobile && 1
|
|
25470
25484
|
},
|
|
25471
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25472
|
-
disabled: props
|
|
25473
|
-
}, props
|
|
25485
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25486
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25487
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25474
25488
|
__self: undefined,
|
|
25475
25489
|
__source: {
|
|
25476
25490
|
fileName: _jsxFileName$b,
|
|
25477
25491
|
lineNumber: 187,
|
|
25478
25492
|
columnNumber: 19
|
|
25479
25493
|
}
|
|
25480
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25494
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default["default"].createElement(ADialog__namespace.Action, {
|
|
25481
25495
|
asChild: true,
|
|
25482
25496
|
__self: undefined,
|
|
25483
25497
|
__source: {
|
|
@@ -25492,8 +25506,8 @@
|
|
|
25492
25506
|
css: {
|
|
25493
25507
|
flex: props.isMobile && 1
|
|
25494
25508
|
},
|
|
25495
|
-
disabled: props
|
|
25496
|
-
}, props
|
|
25509
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25510
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25497
25511
|
__self: undefined,
|
|
25498
25512
|
__source: {
|
|
25499
25513
|
fileName: _jsxFileName$b,
|
|
@@ -25623,7 +25637,7 @@
|
|
|
25623
25637
|
}, props.description)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
25624
25638
|
css: {
|
|
25625
25639
|
width: '100%',
|
|
25626
|
-
display: props
|
|
25640
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25627
25641
|
},
|
|
25628
25642
|
__self: this,
|
|
25629
25643
|
__source: {
|
|
@@ -25668,8 +25682,8 @@
|
|
|
25668
25682
|
css: {
|
|
25669
25683
|
flex: props.isMobile && 1
|
|
25670
25684
|
},
|
|
25671
|
-
disabled: props
|
|
25672
|
-
}, props
|
|
25685
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25686
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25673
25687
|
__self: this,
|
|
25674
25688
|
__source: {
|
|
25675
25689
|
fileName: _jsxFileName$b,
|
|
@@ -25688,19 +25702,19 @@
|
|
|
25688
25702
|
size: props.btnSize,
|
|
25689
25703
|
onClick: props.onCancel,
|
|
25690
25704
|
css: {
|
|
25691
|
-
color: props.dialogType === 'negative' && !(props
|
|
25705
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25692
25706
|
flex: props.isMobile && 1
|
|
25693
25707
|
},
|
|
25694
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25695
|
-
disabled: props
|
|
25696
|
-
}, props
|
|
25708
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25709
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25710
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25697
25711
|
__self: this,
|
|
25698
25712
|
__source: {
|
|
25699
25713
|
fileName: _jsxFileName$b,
|
|
25700
25714
|
lineNumber: 293,
|
|
25701
25715
|
columnNumber: 19
|
|
25702
25716
|
}
|
|
25703
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25717
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default["default"].createElement(ADialog__namespace.Action, {
|
|
25704
25718
|
asChild: true,
|
|
25705
25719
|
__self: this,
|
|
25706
25720
|
__source: {
|
|
@@ -25715,8 +25729,8 @@
|
|
|
25715
25729
|
css: {
|
|
25716
25730
|
flex: props.isMobile && 1
|
|
25717
25731
|
},
|
|
25718
|
-
disabled: props
|
|
25719
|
-
}, props
|
|
25732
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25733
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25720
25734
|
__self: this,
|
|
25721
25735
|
__source: {
|
|
25722
25736
|
fileName: _jsxFileName$b,
|
|
@@ -28230,7 +28244,7 @@
|
|
|
28230
28244
|
upload({
|
|
28231
28245
|
url: action,
|
|
28232
28246
|
file: newFile,
|
|
28233
|
-
customBody: customBodyRequest
|
|
28247
|
+
customBody: customBodyRequest === null || customBodyRequest === void 0 ? void 0 : customBodyRequest(newFile),
|
|
28234
28248
|
token,
|
|
28235
28249
|
tokenKey,
|
|
28236
28250
|
reqKey,
|
|
@@ -28250,12 +28264,12 @@
|
|
|
28250
28264
|
arrProgress[i] = fileProgress;
|
|
28251
28265
|
}
|
|
28252
28266
|
}
|
|
28253
|
-
onChange
|
|
28267
|
+
onChange === null || onChange === void 0 || (_onChange = onChange({
|
|
28254
28268
|
fileList: arrProgress,
|
|
28255
28269
|
file: fileProgress,
|
|
28256
28270
|
indexReplace: indexReplace.current,
|
|
28257
28271
|
isReplace: indexReplace.current !== null
|
|
28258
|
-
}))
|
|
28272
|
+
})) === null || _onChange === void 0 || (_onChange = _onChange.then(() => setError(null))) === null || _onChange === void 0 || _onChange.catch(error => setError(error.message));
|
|
28259
28273
|
}
|
|
28260
28274
|
}).then(result => {
|
|
28261
28275
|
var _onChange2;
|
|
@@ -28268,12 +28282,12 @@
|
|
|
28268
28282
|
arrFile[i] = fileSuccess;
|
|
28269
28283
|
}
|
|
28270
28284
|
}
|
|
28271
|
-
onChange
|
|
28285
|
+
onChange === null || onChange === void 0 || (_onChange2 = onChange({
|
|
28272
28286
|
fileList: arrFile,
|
|
28273
28287
|
file: fileSuccess,
|
|
28274
28288
|
indexReplace: indexReplace.current,
|
|
28275
28289
|
isReplace: indexReplace.current !== null
|
|
28276
|
-
}))
|
|
28290
|
+
})) === null || _onChange2 === void 0 || (_onChange2 = _onChange2.then(() => setError(null))) === null || _onChange2 === void 0 || _onChange2.catch(error => setError(error.message));
|
|
28277
28291
|
}).catch(error => {
|
|
28278
28292
|
var _onChange3;
|
|
28279
28293
|
let fileError = Object.assign({}, newFile);
|
|
@@ -28285,21 +28299,21 @@
|
|
|
28285
28299
|
arrFile[i] = fileError;
|
|
28286
28300
|
}
|
|
28287
28301
|
}
|
|
28288
|
-
onChange
|
|
28302
|
+
onChange === null || onChange === void 0 || (_onChange3 = onChange({
|
|
28289
28303
|
fileList: arrFile,
|
|
28290
28304
|
file: fileError,
|
|
28291
28305
|
indexReplace: indexReplace.current,
|
|
28292
28306
|
isReplace: indexReplace.current !== null
|
|
28293
|
-
}))
|
|
28307
|
+
})) === null || _onChange3 === void 0 || (_onChange3 = _onChange3.then(() => setError(null))) === null || _onChange3 === void 0 || _onChange3.catch(error => setError(error.message));
|
|
28294
28308
|
});
|
|
28295
28309
|
} else {
|
|
28296
28310
|
var _onChange4;
|
|
28297
|
-
onChange
|
|
28311
|
+
onChange === null || onChange === void 0 || (_onChange4 = onChange({
|
|
28298
28312
|
fileList: arrFile,
|
|
28299
28313
|
file: newFile,
|
|
28300
28314
|
indexReplace: indexReplace.current,
|
|
28301
28315
|
isReplace: indexReplace.current !== null
|
|
28302
|
-
}))
|
|
28316
|
+
})) === null || _onChange4 === void 0 || (_onChange4 = _onChange4.then(() => setError(null))) === null || _onChange4 === void 0 || _onChange4.catch(error => setError(error.message));
|
|
28303
28317
|
}
|
|
28304
28318
|
if (indexReplace.current !== null) {
|
|
28305
28319
|
arrFile[indexReplace.current] = newFile;
|
|
@@ -28319,15 +28333,15 @@
|
|
|
28319
28333
|
// program to get the dimensions of an image
|
|
28320
28334
|
const img = document.createElement('img');
|
|
28321
28335
|
img.src = URL.createObjectURL(files[0]);
|
|
28322
|
-
img.size = files
|
|
28323
|
-
img.type = files
|
|
28336
|
+
img.size = files === null || files === void 0 || (_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.size;
|
|
28337
|
+
img.type = files === null || files === void 0 || (_files$2 = files[0]) === null || _files$2 === void 0 ? void 0 : _files$2.type;
|
|
28324
28338
|
img.onload = () => {
|
|
28325
28339
|
const imgRatio = img.width / img.height;
|
|
28326
28340
|
setAspect(ratio || imgRatio);
|
|
28327
28341
|
setCropperImgRatio(imgRatio);
|
|
28328
28342
|
if (onBeforeCrop) {
|
|
28329
28343
|
var _onBeforeCrop;
|
|
28330
|
-
onBeforeCrop
|
|
28344
|
+
onBeforeCrop === null || onBeforeCrop === void 0 || (_onBeforeCrop = onBeforeCrop(img)) === null || _onBeforeCrop === void 0 || (_onBeforeCrop = _onBeforeCrop.then(() => {
|
|
28331
28345
|
setError(null);
|
|
28332
28346
|
toggleModal();
|
|
28333
28347
|
setTimeout(() => {
|
|
@@ -28341,7 +28355,7 @@
|
|
|
28341
28355
|
}, 300);
|
|
28342
28356
|
setFileState(files[0]);
|
|
28343
28357
|
setPreviewImage(URL.createObjectURL(files[0]));
|
|
28344
|
-
}))
|
|
28358
|
+
})) === null || _onBeforeCrop === void 0 || _onBeforeCrop.catch(error => setError(error === null || error === void 0 ? void 0 : error.message));
|
|
28345
28359
|
} else {
|
|
28346
28360
|
toggleModal();
|
|
28347
28361
|
setTimeout(() => {
|
|
@@ -28359,18 +28373,18 @@
|
|
|
28359
28373
|
};
|
|
28360
28374
|
img.onerror = error => {
|
|
28361
28375
|
var _onBeforeCrop2;
|
|
28362
|
-
onBeforeCrop
|
|
28376
|
+
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));
|
|
28363
28377
|
};
|
|
28364
28378
|
}
|
|
28365
28379
|
}
|
|
28366
28380
|
}
|
|
28367
28381
|
function handleCrop() {
|
|
28368
|
-
if (completedCrop
|
|
28369
|
-
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState
|
|
28370
|
-
const sizeMB = (blob
|
|
28382
|
+
if (completedCrop !== null && completedCrop !== void 0 && completedCrop.width && completedCrop !== null && completedCrop !== void 0 && completedCrop.height && imgRef.current) {
|
|
28383
|
+
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState === null || fileState === void 0 ? void 0 : fileState.type).then(blob => {
|
|
28384
|
+
const sizeMB = (blob === null || blob === void 0 ? void 0 : blob.size) / 1024 / 1024;
|
|
28371
28385
|
if (sizeMB < maxSizeMB || sizeMB < 1 || !imageCompression) {
|
|
28372
|
-
const file = new File([blob], fileState
|
|
28373
|
-
type: blob
|
|
28386
|
+
const file = new File([blob], fileState === null || fileState === void 0 ? void 0 : fileState.name, {
|
|
28387
|
+
type: blob === null || blob === void 0 ? void 0 : blob.type
|
|
28374
28388
|
});
|
|
28375
28389
|
handleUpload([file]);
|
|
28376
28390
|
setCrop(null);
|
|
@@ -28384,16 +28398,16 @@
|
|
|
28384
28398
|
alwaysKeepResolution: true
|
|
28385
28399
|
}).then(compressedFile => {
|
|
28386
28400
|
var _fileState$name;
|
|
28387
|
-
const file = new File([compressedFile], (fileState
|
|
28388
|
-
type: compressedFile
|
|
28401
|
+
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', {
|
|
28402
|
+
type: compressedFile === null || compressedFile === void 0 ? void 0 : compressedFile.type
|
|
28389
28403
|
});
|
|
28390
28404
|
handleUpload([file]);
|
|
28391
28405
|
setCrop(null);
|
|
28392
28406
|
setCompletedCrop(null);
|
|
28393
|
-
}).catch(error => console.error(error
|
|
28407
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
28394
28408
|
}
|
|
28395
28409
|
toggleModal();
|
|
28396
|
-
}).catch(error => console.error(error
|
|
28410
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
28397
28411
|
} else {
|
|
28398
28412
|
handleUpload([fileState]);
|
|
28399
28413
|
toggleModal();
|
|
@@ -28422,7 +28436,7 @@
|
|
|
28422
28436
|
const index = fileList.indexOf(file);
|
|
28423
28437
|
const newFileList = fileList.slice();
|
|
28424
28438
|
newFileList.splice(index, 1);
|
|
28425
|
-
onChange
|
|
28439
|
+
onChange === null || onChange === void 0 || onChange({
|
|
28426
28440
|
fileList: newFileList,
|
|
28427
28441
|
file
|
|
28428
28442
|
});
|
|
@@ -28445,14 +28459,14 @@
|
|
|
28445
28459
|
}
|
|
28446
28460
|
function handleOpenFile(file) {
|
|
28447
28461
|
var _String, _file$name;
|
|
28448
|
-
let extension = (_String = String(file
|
|
28462
|
+
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();
|
|
28449
28463
|
if (extension === 'pdf') {
|
|
28450
|
-
window.open(file
|
|
28464
|
+
window.open(file === null || file === void 0 ? void 0 : file.url);
|
|
28451
28465
|
} else {
|
|
28452
|
-
if (file
|
|
28466
|
+
if (file !== null && file !== void 0 && file.url) {
|
|
28453
28467
|
const link = document.createElement('a');
|
|
28454
28468
|
link.href = file.url;
|
|
28455
|
-
link.setAttribute('download', file
|
|
28469
|
+
link.setAttribute('download', file === null || file === void 0 ? void 0 : file.name);
|
|
28456
28470
|
document.body.appendChild(link);
|
|
28457
28471
|
link.click();
|
|
28458
28472
|
document.body.removeChild(link);
|
|
@@ -28514,12 +28528,12 @@
|
|
|
28514
28528
|
}, replaceLabel && replaceLabel.length > 0 ? replaceLabel : t('replaceLabel', 'Ubah Berkas')));
|
|
28515
28529
|
}
|
|
28516
28530
|
const renderPicture = () => {
|
|
28517
|
-
return fileList
|
|
28518
|
-
if ((item
|
|
28531
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28532
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28519
28533
|
return /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
|
28520
28534
|
key: index,
|
|
28521
|
-
progress: item
|
|
28522
|
-
loading: item
|
|
28535
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28536
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28523
28537
|
__self: undefined,
|
|
28524
28538
|
__source: {
|
|
28525
28539
|
fileName: _jsxFileName$9,
|
|
@@ -28592,13 +28606,13 @@
|
|
|
28592
28606
|
});
|
|
28593
28607
|
};
|
|
28594
28608
|
const renderFile = () => {
|
|
28595
|
-
return fileList
|
|
28609
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28596
28610
|
var _item$name;
|
|
28597
|
-
if ((item
|
|
28611
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28598
28612
|
return /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
|
28599
28613
|
key: index,
|
|
28600
|
-
progress: item
|
|
28601
|
-
loading: item
|
|
28614
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28615
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28602
28616
|
__self: undefined,
|
|
28603
28617
|
__source: {
|
|
28604
28618
|
fileName: _jsxFileName$9,
|
|
@@ -28664,7 +28678,7 @@
|
|
|
28664
28678
|
lineNumber: 666,
|
|
28665
28679
|
columnNumber: 17
|
|
28666
28680
|
}
|
|
28667
|
-
}, ".", item
|
|
28681
|
+
}, ".", 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, {
|
|
28668
28682
|
label: item.name,
|
|
28669
28683
|
__self: undefined,
|
|
28670
28684
|
__source: {
|
|
@@ -29034,7 +29048,7 @@
|
|
|
29034
29048
|
}
|
|
29035
29049
|
return /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
29036
29050
|
direction: "row",
|
|
29037
|
-
gap: (fileList
|
|
29051
|
+
gap: (fileList === null || fileList === void 0 ? void 0 : fileList.length) <= 1 && max === 1 ? 0 : 3,
|
|
29038
29052
|
wrap: "wrap",
|
|
29039
29053
|
css: {
|
|
29040
29054
|
userSelect: 'none'
|
|
@@ -29866,9 +29880,9 @@
|
|
|
29866
29880
|
function InputColorPicker(props) {
|
|
29867
29881
|
const [isPopover, setIsPopover] = React.useState(false);
|
|
29868
29882
|
function getColor() {
|
|
29869
|
-
const color = props
|
|
29883
|
+
const color = props === null || props === void 0 ? void 0 : props.color;
|
|
29870
29884
|
if (typeof color === 'string') {
|
|
29871
|
-
return color
|
|
29885
|
+
return color === null || color === void 0 ? void 0 : color.toUpperCase();
|
|
29872
29886
|
}
|
|
29873
29887
|
return `rgba(${color.r},${color.g},${color.b},${color.a})`;
|
|
29874
29888
|
}
|
|
@@ -32887,7 +32901,7 @@
|
|
|
32887
32901
|
var _data;
|
|
32888
32902
|
const isActive = props.currentStep === i;
|
|
32889
32903
|
const isComplete = props.isComplete[i - 1];
|
|
32890
|
-
const isAdditional = (_data = data[i - 1])
|
|
32904
|
+
const isAdditional = (_data = data[i - 1]) === null || _data === void 0 ? void 0 : _data.additional;
|
|
32891
32905
|
const lastItem = navMobileItems.indexOf(data[i - 1]) + 1 === navMobileItems.length;
|
|
32892
32906
|
// eslint-disable-next-line no-lone-blocks
|
|
32893
32907
|
{
|
|
@@ -32902,7 +32916,7 @@
|
|
|
32902
32916
|
key: `step-${i}`,
|
|
32903
32917
|
onClick: () => {
|
|
32904
32918
|
var _data2;
|
|
32905
|
-
if (props.onNavClicked && !((_data2 = data[i - 1])
|
|
32919
|
+
if (props.onNavClicked && !((_data2 = data[i - 1]) !== null && _data2 !== void 0 && _data2.disabled) || isAdditional) props.onNavClicked(i);
|
|
32906
32920
|
if (!forbidClickNav && isComplete && !isHide || isAdditional) {
|
|
32907
32921
|
props.goToStep(i);
|
|
32908
32922
|
}
|
|
@@ -32935,9 +32949,9 @@
|
|
|
32935
32949
|
lineNumber: 176,
|
|
32936
32950
|
columnNumber: 17
|
|
32937
32951
|
}
|
|
32938
|
-
}), typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title = (_data3 = data[i - 1]).title)
|
|
32952
|
+
}), 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, {
|
|
32939
32953
|
align: "center",
|
|
32940
|
-
label: (_data5 = data[i - 1])
|
|
32954
|
+
label: (_data5 = data[i - 1]) === null || _data5 === void 0 ? void 0 : _data5.tooltipsContents,
|
|
32941
32955
|
__self: undefined,
|
|
32942
32956
|
__source: {
|
|
32943
32957
|
fileName: _jsxFileName$4,
|
|
@@ -32956,9 +32970,9 @@
|
|
|
32956
32970
|
lineNumber: 181,
|
|
32957
32971
|
columnNumber: 19
|
|
32958
32972
|
}
|
|
32959
|
-
})), ((_data6 = data[i - 1])
|
|
32973
|
+
})), ((_data6 = data[i - 1]) === null || _data6 === void 0 ? void 0 : _data6.comingSoon) && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
32960
32974
|
css: {
|
|
32961
|
-
marginLeft: (_data7 = data[i - 1])
|
|
32975
|
+
marginLeft: (_data7 = data[i - 1]) !== null && _data7 !== void 0 && _data7.withTolltip ? 0 : '$spacing-03'
|
|
32962
32976
|
},
|
|
32963
32977
|
align: "center",
|
|
32964
32978
|
__self: undefined,
|
|
@@ -33009,10 +33023,10 @@
|
|
|
33009
33023
|
lineNumber: 198,
|
|
33010
33024
|
columnNumber: 21
|
|
33011
33025
|
}
|
|
33012
|
-
}, typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title2 = (_data8 = data[i - 1]).title)
|
|
33026
|
+
}, 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, {
|
|
33013
33027
|
align: "center",
|
|
33014
33028
|
withClick: true,
|
|
33015
|
-
label: (_data10 = data[i - 1])
|
|
33029
|
+
label: (_data10 = data[i - 1]) === null || _data10 === void 0 ? void 0 : _data10.tooltipsContents,
|
|
33016
33030
|
__self: undefined,
|
|
33017
33031
|
__source: {
|
|
33018
33032
|
fileName: _jsxFileName$4,
|
|
@@ -33028,11 +33042,11 @@
|
|
|
33028
33042
|
lineNumber: 209,
|
|
33029
33043
|
columnNumber: 25
|
|
33030
33044
|
}
|
|
33031
|
-
})), ((_data11 = data[i - 1])
|
|
33045
|
+
})), ((_data11 = data[i - 1]) === null || _data11 === void 0 ? void 0 : _data11.comingSoon) && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
33032
33046
|
align: "center",
|
|
33033
33047
|
justify: "center",
|
|
33034
33048
|
css: {
|
|
33035
|
-
marginTop: (_data12 = data[i - 1])
|
|
33049
|
+
marginTop: (_data12 = data[i - 1]) !== null && _data12 !== void 0 && _data12.withTolltip ? 0 : '$spacing-03'
|
|
33036
33050
|
},
|
|
33037
33051
|
__self: undefined,
|
|
33038
33052
|
__source: {
|
|
@@ -33056,7 +33070,7 @@
|
|
|
33056
33070
|
userSelect: 'none',
|
|
33057
33071
|
fontSize: '12px',
|
|
33058
33072
|
textAlign: '-webkit-center',
|
|
33059
|
-
display: ((_data13 = data[i - 1])
|
|
33073
|
+
display: ((_data13 = data[i - 1]) === null || _data13 === void 0 ? void 0 : _data13.disabled) && 'none',
|
|
33060
33074
|
marginTop: '$spacing-07',
|
|
33061
33075
|
flex: 1,
|
|
33062
33076
|
maxWidth: lastItem && 26
|
|
@@ -33136,7 +33150,7 @@
|
|
|
33136
33150
|
height: 24,
|
|
33137
33151
|
borderRadius: '$round',
|
|
33138
33152
|
border: `4px solid ${isActive ? '$bgGreen' : '$bgInactive'}`,
|
|
33139
|
-
backgroundColor: (_data14 = data[i - 1])
|
|
33153
|
+
backgroundColor: (_data14 = data[i - 1]) !== null && _data14 !== void 0 && _data14.disabled ? '$gray200' : '$white'
|
|
33140
33154
|
},
|
|
33141
33155
|
__self: undefined,
|
|
33142
33156
|
__source: {
|
|
@@ -33165,50 +33179,53 @@
|
|
|
33165
33179
|
}
|
|
33166
33180
|
return /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
33167
33181
|
condition: !isMobile,
|
|
33168
|
-
wrapper: child =>
|
|
33169
|
-
|
|
33170
|
-
|
|
33171
|
-
|
|
33172
|
-
|
|
33173
|
-
|
|
33174
|
-
|
|
33175
|
-
|
|
33176
|
-
|
|
33177
|
-
|
|
33178
|
-
|
|
33179
|
-
|
|
33180
|
-
|
|
33181
|
-
|
|
33182
|
-
|
|
33183
|
-
|
|
33184
|
-
|
|
33185
|
-
|
|
33186
|
-
|
|
33187
|
-
|
|
33188
|
-
|
|
33189
|
-
|
|
33190
|
-
|
|
33191
|
-
|
|
33192
|
-
|
|
33193
|
-
|
|
33194
|
-
|
|
33195
|
-
|
|
33196
|
-
|
|
33197
|
-
|
|
33198
|
-
|
|
33199
|
-
|
|
33200
|
-
|
|
33201
|
-
|
|
33202
|
-
|
|
33203
|
-
|
|
33204
|
-
|
|
33205
|
-
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
|
-
|
|
33209
|
-
|
|
33210
|
-
|
|
33211
|
-
|
|
33182
|
+
wrapper: child => {
|
|
33183
|
+
var _props$appendContent;
|
|
33184
|
+
return /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
33185
|
+
css: {
|
|
33186
|
+
opacity: isHide ? 0 : undefined,
|
|
33187
|
+
maxWidth: 311
|
|
33188
|
+
},
|
|
33189
|
+
__self: undefined,
|
|
33190
|
+
__source: {
|
|
33191
|
+
fileName: _jsxFileName$4,
|
|
33192
|
+
lineNumber: 281,
|
|
33193
|
+
columnNumber: 9
|
|
33194
|
+
}
|
|
33195
|
+
}, /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
33196
|
+
css: {
|
|
33197
|
+
position: !isMobile && 'sticky',
|
|
33198
|
+
top: !isMobile ? 44 : 40
|
|
33199
|
+
},
|
|
33200
|
+
direction: "column",
|
|
33201
|
+
gap: 7,
|
|
33202
|
+
__self: undefined,
|
|
33203
|
+
__source: {
|
|
33204
|
+
fileName: _jsxFileName$4,
|
|
33205
|
+
lineNumber: 282,
|
|
33206
|
+
columnNumber: 11
|
|
33207
|
+
}
|
|
33208
|
+
}, /*#__PURE__*/React__default["default"].createElement(Card, {
|
|
33209
|
+
css: {
|
|
33210
|
+
height: 'fit-content',
|
|
33211
|
+
padding: 0
|
|
33212
|
+
},
|
|
33213
|
+
showBottomLine: false,
|
|
33214
|
+
__self: undefined,
|
|
33215
|
+
__source: {
|
|
33216
|
+
fileName: _jsxFileName$4,
|
|
33217
|
+
lineNumber: 283,
|
|
33218
|
+
columnNumber: 13
|
|
33219
|
+
}
|
|
33220
|
+
}, child), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
33221
|
+
__self: undefined,
|
|
33222
|
+
__source: {
|
|
33223
|
+
fileName: _jsxFileName$4,
|
|
33224
|
+
lineNumber: 292,
|
|
33225
|
+
columnNumber: 13
|
|
33226
|
+
}
|
|
33227
|
+
}, 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)));
|
|
33228
|
+
},
|
|
33212
33229
|
__self: undefined,
|
|
33213
33230
|
__source: {
|
|
33214
33231
|
fileName: _jsxFileName$4,
|
|
@@ -33273,7 +33290,8 @@
|
|
|
33273
33290
|
}));
|
|
33274
33291
|
}, [props.hide]);
|
|
33275
33292
|
React.useEffect(() => {
|
|
33276
|
-
|
|
33293
|
+
var _props$onChangeVisibi;
|
|
33294
|
+
props === null || props === void 0 || (_props$onChangeVisibi = props.onChangeVisibility) === null || _props$onChangeVisibi === void 0 || _props$onChangeVisibi.call(props, state.hide);
|
|
33277
33295
|
}, [state.hide]);
|
|
33278
33296
|
const toogleVisibility = value => {
|
|
33279
33297
|
updateState(prev => Object.assign({}, prev, {
|
|
@@ -33282,11 +33300,11 @@
|
|
|
33282
33300
|
};
|
|
33283
33301
|
const getIsComplete = currentStep => {
|
|
33284
33302
|
var _state$isComplete;
|
|
33285
|
-
return state
|
|
33303
|
+
return state === null || state === void 0 || (_state$isComplete = state.isComplete) === null || _state$isComplete === void 0 ? void 0 : _state$isComplete[currentStep - 1];
|
|
33286
33304
|
};
|
|
33287
33305
|
const getTitleStep = currentStep => {
|
|
33288
33306
|
var _props$navContents;
|
|
33289
|
-
return props
|
|
33307
|
+
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;
|
|
33290
33308
|
};
|
|
33291
33309
|
const setState = value => {
|
|
33292
33310
|
updateState(Object.assign({}, state, value));
|
|
@@ -33320,13 +33338,13 @@
|
|
|
33320
33338
|
block: 'start'
|
|
33321
33339
|
});
|
|
33322
33340
|
props.onStepChange && props.onStepChange(e);
|
|
33323
|
-
if (props
|
|
33324
|
-
if ((e
|
|
33341
|
+
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) {
|
|
33342
|
+
if ((e === null || e === void 0 ? void 0 : e.activeStep) > (e === null || e === void 0 ? void 0 : e.previousStep)) {
|
|
33325
33343
|
var _state$SW;
|
|
33326
|
-
state
|
|
33344
|
+
state === null || state === void 0 || (_state$SW = state.SW) === null || _state$SW === void 0 || _state$SW.nextStep();
|
|
33327
33345
|
} else {
|
|
33328
33346
|
var _state$SW2;
|
|
33329
|
-
state
|
|
33347
|
+
state === null || state === void 0 || (_state$SW2 = state.SW) === null || _state$SW2 === void 0 || _state$SW2.previousStep();
|
|
33330
33348
|
}
|
|
33331
33349
|
}
|
|
33332
33350
|
};
|
|
@@ -33341,11 +33359,11 @@
|
|
|
33341
33359
|
}, /*#__PURE__*/React__default["default"].createElement(StepWizardContext.Provider, {
|
|
33342
33360
|
value: {
|
|
33343
33361
|
toogleVisibility,
|
|
33344
|
-
isHide: state
|
|
33362
|
+
isHide: state === null || state === void 0 ? void 0 : state.hide,
|
|
33345
33363
|
setComplete,
|
|
33346
33364
|
setState,
|
|
33347
33365
|
state,
|
|
33348
|
-
SW: state
|
|
33366
|
+
SW: state === null || state === void 0 ? void 0 : state.SW,
|
|
33349
33367
|
forbidClickNav: props.forbidClickNav,
|
|
33350
33368
|
titles: props.titles,
|
|
33351
33369
|
isMobile: props.isMobile,
|
|
@@ -33368,7 +33386,7 @@
|
|
|
33368
33386
|
nav: /*#__PURE__*/React__default["default"].createElement(Navigation, {
|
|
33369
33387
|
onNavClicked: props.onNavClicked,
|
|
33370
33388
|
isComplete: state.isComplete,
|
|
33371
|
-
appendContent: props
|
|
33389
|
+
appendContent: props === null || props === void 0 ? void 0 : props.appendContent,
|
|
33372
33390
|
__self: undefined,
|
|
33373
33391
|
__source: {
|
|
33374
33392
|
fileName: _jsxFileName$4,
|
|
@@ -33378,7 +33396,7 @@
|
|
|
33378
33396
|
}),
|
|
33379
33397
|
initialStep: props.initialStep,
|
|
33380
33398
|
onStepChange: handleStepChange,
|
|
33381
|
-
isLazyMount: props
|
|
33399
|
+
isLazyMount: props === null || props === void 0 ? void 0 : props.isLazyMount,
|
|
33382
33400
|
__self: undefined,
|
|
33383
33401
|
__source: {
|
|
33384
33402
|
fileName: _jsxFileName$4,
|
|
@@ -33525,9 +33543,9 @@
|
|
|
33525
33543
|
var _getDatasets;
|
|
33526
33544
|
function getDatasets(content, activeId, isCollapse) {
|
|
33527
33545
|
const datasets = [];
|
|
33528
|
-
for (let i = 0; i < (content
|
|
33546
|
+
for (let i = 0; i < (content === null || content === void 0 ? void 0 : content.length); i++) {
|
|
33529
33547
|
var _content$i;
|
|
33530
|
-
if (((_content$i = content[i])
|
|
33548
|
+
if (((_content$i = content[i]) === null || _content$i === void 0 ? void 0 : _content$i.id) === activeId) {
|
|
33531
33549
|
datasets.unshift(content[i]);
|
|
33532
33550
|
} else {
|
|
33533
33551
|
datasets.push(content[i]);
|
|
@@ -33565,7 +33583,7 @@
|
|
|
33565
33583
|
lineNumber: 107,
|
|
33566
33584
|
columnNumber: 7
|
|
33567
33585
|
}
|
|
33568
|
-
}, (_getDatasets = getDatasets(content, activeId, isCollapse))
|
|
33586
|
+
}, (_getDatasets = getDatasets(content, activeId, isCollapse)) === null || _getDatasets === void 0 ? void 0 : _getDatasets.map((item, index) => {
|
|
33569
33587
|
return /*#__PURE__*/React__default["default"].createElement(List, {
|
|
33570
33588
|
key: index,
|
|
33571
33589
|
__self: this,
|
|
@@ -33582,11 +33600,11 @@
|
|
|
33582
33600
|
marginLeft: '-4px !important',
|
|
33583
33601
|
borderLeftWidth: '4px !important',
|
|
33584
33602
|
borderLeftStyle: 'solid !important',
|
|
33585
|
-
borderLeftColor: `${(item
|
|
33603
|
+
borderLeftColor: `${(item === null || item === void 0 ? void 0 : item.id) === activeId ? colors$8.primary500 : 'transparent'} !important`,
|
|
33586
33604
|
paddingLeft: '16px !important',
|
|
33587
33605
|
minHeight: 25
|
|
33588
33606
|
},
|
|
33589
|
-
"data-to-scrollspy-id": item
|
|
33607
|
+
"data-to-scrollspy-id": item === null || item === void 0 ? void 0 : item.id,
|
|
33590
33608
|
__self: this,
|
|
33591
33609
|
__source: {
|
|
33592
33610
|
fileName: _jsxFileName$2,
|
|
@@ -33595,13 +33613,13 @@
|
|
|
33595
33613
|
}
|
|
33596
33614
|
}, /*#__PURE__*/React__default["default"].createElement(Title$1, {
|
|
33597
33615
|
className: "link-title",
|
|
33598
|
-
active: (item
|
|
33599
|
-
href: `#${item
|
|
33616
|
+
active: (item === null || item === void 0 ? void 0 : item.id) === activeId,
|
|
33617
|
+
href: `#${item === null || item === void 0 ? void 0 : item.id}`,
|
|
33600
33618
|
onClick: e => {
|
|
33601
33619
|
var _e$currentTarget, _e$currentTarget2;
|
|
33602
33620
|
e.preventDefault();
|
|
33603
|
-
onNavClick
|
|
33604
|
-
const target = window.document.getElementById(e
|
|
33621
|
+
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]);
|
|
33622
|
+
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]);
|
|
33605
33623
|
if (target) {
|
|
33606
33624
|
var headerOffset = 20;
|
|
33607
33625
|
var elementPosition = target.getBoundingClientRect().top;
|
|
@@ -33625,7 +33643,7 @@
|
|
|
33625
33643
|
lineNumber: 125,
|
|
33626
33644
|
columnNumber: 17
|
|
33627
33645
|
}
|
|
33628
|
-
}, item
|
|
33646
|
+
}, item === null || item === void 0 ? void 0 : item.title), item === null || item === void 0 ? void 0 : item.icon));
|
|
33629
33647
|
})));
|
|
33630
33648
|
}
|
|
33631
33649
|
function TableOfContent({
|