@majoo-ui/react 1.59.9-rc.2 → 1.59.9-rc.4
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 +253 -236
- package/index.umd.js +253 -236
- 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
|
});
|
|
@@ -13169,16 +13172,24 @@
|
|
|
13169
13172
|
var selectBoxRef = React.useRef(null);
|
|
13170
13173
|
var scrollerRef = React.useRef(null);
|
|
13171
13174
|
React.useEffect(function () {
|
|
13172
|
-
var _a
|
|
13175
|
+
var _a;
|
|
13173
13176
|
if (search && Boolean(query)) {
|
|
13174
13177
|
(_a = scrollerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
13175
13178
|
top: 0
|
|
13176
13179
|
});
|
|
13177
13180
|
return;
|
|
13178
13181
|
}
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
+
var scrollToSelectedElement = function scrollToSelectedElement() {
|
|
13183
|
+
var element = document.querySelector("[data-index=\"".concat(selectedIndex, "\"]"));
|
|
13184
|
+
if (element) {
|
|
13185
|
+
var scrollContainer = scrollerRef.current;
|
|
13186
|
+
//@ts-ignore
|
|
13187
|
+
var elementPosition = element.offsetTop - scrollContainer.offsetTop;
|
|
13188
|
+
//@ts-ignore
|
|
13189
|
+
scrollContainer.scrollTop = elementPosition;
|
|
13190
|
+
}
|
|
13191
|
+
};
|
|
13192
|
+
scrollToSelectedElement();
|
|
13182
13193
|
}, [query, search, openOptions, open, selectedIndex]);
|
|
13183
13194
|
var handleInputValue = function handleInputValue(value, isReset) {
|
|
13184
13195
|
if (isReset === void 0) {
|
|
@@ -13533,6 +13544,7 @@
|
|
|
13533
13544
|
key: (_a = item.value) !== null && _a !== void 0 ? _a : index,
|
|
13534
13545
|
hasGroup: !!item.group,
|
|
13535
13546
|
isGroup: item.isGroup,
|
|
13547
|
+
"data-index": index,
|
|
13536
13548
|
css: __assign({}, !item.isGroup ? item.isDisabled ? {
|
|
13537
13549
|
backgroundColor: 'unset',
|
|
13538
13550
|
cursor: 'not-allowed',
|
|
@@ -14165,13 +14177,13 @@
|
|
|
14165
14177
|
const isShowSelectAll = showSelectAll && !maxSelectedItem;
|
|
14166
14178
|
React.useEffect(() => {
|
|
14167
14179
|
var _scrollerRef$current;
|
|
14168
|
-
(_scrollerRef$current = scrollerRef.current)
|
|
14180
|
+
(_scrollerRef$current = scrollerRef.current) === null || _scrollerRef$current === void 0 || _scrollerRef$current.scrollTo({
|
|
14169
14181
|
top: 0
|
|
14170
14182
|
});
|
|
14171
14183
|
}, [query]);
|
|
14172
14184
|
React.useEffect(() => {
|
|
14173
|
-
if (defaultValue
|
|
14174
|
-
if (value
|
|
14185
|
+
if (defaultValue !== null && defaultValue !== void 0 && defaultValue.length) {
|
|
14186
|
+
if (value !== null && value !== void 0 && value.length) {
|
|
14175
14187
|
setInputSelectValue(value);
|
|
14176
14188
|
}
|
|
14177
14189
|
} else {
|
|
@@ -14236,7 +14248,7 @@
|
|
|
14236
14248
|
removeSelectedItem,
|
|
14237
14249
|
selectedItems
|
|
14238
14250
|
} = Downshift.useMultipleSelection({
|
|
14239
|
-
selectedItems: selectedValue.length > 0 ? initItem
|
|
14251
|
+
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
14252
|
});
|
|
14241
14253
|
const generateOptions = data => {
|
|
14242
14254
|
return data.map(option => {
|
|
@@ -14258,7 +14270,7 @@
|
|
|
14258
14270
|
};
|
|
14259
14271
|
const debouncedSearch = React__default["default"].useRef(debounce__default["default"](_async(function (query) {
|
|
14260
14272
|
setQuery(query);
|
|
14261
|
-
onSearch
|
|
14273
|
+
onSearch === null || onSearch === void 0 || onSearch(query);
|
|
14262
14274
|
return _await();
|
|
14263
14275
|
}), 1000)).current;
|
|
14264
14276
|
React__default["default"].useEffect(() => {
|
|
@@ -14267,7 +14279,7 @@
|
|
|
14267
14279
|
};
|
|
14268
14280
|
}, [debouncedSearch]);
|
|
14269
14281
|
const handleInputValue = input => {
|
|
14270
|
-
onSearch
|
|
14282
|
+
onSearch === null || onSearch === void 0 || onSearch(input);
|
|
14271
14283
|
if (input === '') {
|
|
14272
14284
|
if (disabledOptions.length > 0) {
|
|
14273
14285
|
setItems(generateOptions(sortDisabled));
|
|
@@ -14275,9 +14287,9 @@
|
|
|
14275
14287
|
return setItems(sortValue);
|
|
14276
14288
|
}
|
|
14277
14289
|
} else {
|
|
14278
|
-
let filterItems = option
|
|
14279
|
-
var _item$name;
|
|
14280
|
-
return item
|
|
14290
|
+
let filterItems = option === null || option === void 0 ? void 0 : option.filter(item => {
|
|
14291
|
+
var _item$name, _item$name$includes, _input$toLocaleLowerC;
|
|
14292
|
+
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
14293
|
});
|
|
14282
14294
|
setItems(filterItems);
|
|
14283
14295
|
}
|
|
@@ -14286,10 +14298,10 @@
|
|
|
14286
14298
|
if (disabled || readOnly) {
|
|
14287
14299
|
return selectedValue;
|
|
14288
14300
|
} else {
|
|
14289
|
-
if ((selected
|
|
14301
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.id) === 'counter') {
|
|
14290
14302
|
setSelectedValue([]);
|
|
14291
14303
|
setInputSelectValue([]);
|
|
14292
|
-
onChange
|
|
14304
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14293
14305
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14294
14306
|
removeSelectedItem(selectedValue[i]);
|
|
14295
14307
|
}
|
|
@@ -14299,7 +14311,7 @@
|
|
|
14299
14311
|
setSelectedValue(filterItems);
|
|
14300
14312
|
setInputSelectValue(filterItems);
|
|
14301
14313
|
if (selected.id !== '!all') {
|
|
14302
|
-
onChange
|
|
14314
|
+
onChange === null || onChange === void 0 || onChange(filterItems);
|
|
14303
14315
|
}
|
|
14304
14316
|
}
|
|
14305
14317
|
}
|
|
@@ -14337,9 +14349,9 @@
|
|
|
14337
14349
|
if (selectedItem.id === '!all') {
|
|
14338
14350
|
items.forEach(item => {
|
|
14339
14351
|
var _item$children;
|
|
14340
|
-
if (item
|
|
14352
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
|
14341
14353
|
var _item$children2;
|
|
14342
|
-
item
|
|
14354
|
+
item === null || item === void 0 || (_item$children2 = item.children) === null || _item$children2 === void 0 || _item$children2.forEach(item => {
|
|
14343
14355
|
removeSelectedItem(item);
|
|
14344
14356
|
});
|
|
14345
14357
|
} else {
|
|
@@ -14348,7 +14360,7 @@
|
|
|
14348
14360
|
});
|
|
14349
14361
|
setSelectedValue([]);
|
|
14350
14362
|
setInputSelectValue([]);
|
|
14351
|
-
onChange
|
|
14363
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14352
14364
|
} else {
|
|
14353
14365
|
removeItem(selectedItem);
|
|
14354
14366
|
}
|
|
@@ -14359,9 +14371,9 @@
|
|
|
14359
14371
|
const itemIds = [];
|
|
14360
14372
|
items.forEach(item => {
|
|
14361
14373
|
var _item$children3;
|
|
14362
|
-
if (item
|
|
14374
|
+
if (item !== null && item !== void 0 && (_item$children3 = item.children) !== null && _item$children3 !== void 0 && _item$children3.length) {
|
|
14363
14375
|
var _item$children4;
|
|
14364
|
-
item
|
|
14376
|
+
item === null || item === void 0 || (_item$children4 = item.children) === null || _item$children4 === void 0 || _item$children4.forEach(item => {
|
|
14365
14377
|
addSelectedItem(item);
|
|
14366
14378
|
itemIds.push(item.id);
|
|
14367
14379
|
});
|
|
@@ -14373,16 +14385,16 @@
|
|
|
14373
14385
|
setSelectedValue(itemIds);
|
|
14374
14386
|
setInputSelectValue(itemIds);
|
|
14375
14387
|
// onChange?.(itemIds.slice(1).filter(id => !items.find(item => item.id === id)?.children?.length));
|
|
14376
|
-
onChange
|
|
14388
|
+
onChange === null || onChange === void 0 || onChange(itemIds.slice(1));
|
|
14377
14389
|
} else {
|
|
14378
14390
|
var _selectedItem$childre;
|
|
14379
14391
|
//start check if item have children (option group)
|
|
14380
|
-
if (selectedItem
|
|
14392
|
+
if (selectedItem !== null && selectedItem !== void 0 && (_selectedItem$childre = selectedItem.children) !== null && _selectedItem$childre !== void 0 && _selectedItem$childre.length) {
|
|
14381
14393
|
var _selectedItem$childre2;
|
|
14382
14394
|
const itemIdsSelect = [];
|
|
14383
14395
|
const itemIdsUnSelect = [];
|
|
14384
|
-
selectedItem
|
|
14385
|
-
if (selectedValue
|
|
14396
|
+
selectedItem === null || selectedItem === void 0 || (_selectedItem$childre2 = selectedItem.children) === null || _selectedItem$childre2 === void 0 || _selectedItem$childre2.forEach(item => {
|
|
14397
|
+
if (selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id)) {
|
|
14386
14398
|
removeSelectedItem(item);
|
|
14387
14399
|
itemIdsUnSelect.push(item.id);
|
|
14388
14400
|
} else {
|
|
@@ -14396,19 +14408,19 @@
|
|
|
14396
14408
|
setSelectedValue([...selectedValue, ...itemIdsSelect]);
|
|
14397
14409
|
setInputSelectValue([...selectedValue, ...itemIdsSelect]);
|
|
14398
14410
|
const _filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14399
|
-
onChange
|
|
14411
|
+
onChange === null || onChange === void 0 || onChange([..._filteredSelectedValues, ...itemIdsSelect]);
|
|
14400
14412
|
}
|
|
14401
14413
|
|
|
14402
14414
|
//unselect all child in one of the option groups
|
|
14403
14415
|
if (itemIdsUnSelect.length) {
|
|
14404
14416
|
const newSelectedValue = selectedValue.filter(selId => {
|
|
14405
14417
|
var _itemIdsUnSelect$filt;
|
|
14406
|
-
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId))
|
|
14418
|
+
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId)) === null || _itemIdsUnSelect$filt === void 0 ? void 0 : _itemIdsUnSelect$filt[0]) !== selId && selId;
|
|
14407
14419
|
});
|
|
14408
14420
|
setSelectedValue(newSelectedValue);
|
|
14409
14421
|
setInputSelectValue(newSelectedValue);
|
|
14410
14422
|
const _filteredSelectedValues2 = newSelectedValue.filter(val => val !== '!all');
|
|
14411
|
-
onChange
|
|
14423
|
+
onChange === null || onChange === void 0 || onChange(_filteredSelectedValues2);
|
|
14412
14424
|
}
|
|
14413
14425
|
return;
|
|
14414
14426
|
}
|
|
@@ -14425,7 +14437,7 @@
|
|
|
14425
14437
|
setSelectedValue([...selectedValue, selectedItem.id]);
|
|
14426
14438
|
setInputSelectValue([...selectedValue, selectedItem.id]);
|
|
14427
14439
|
const filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14428
|
-
onChange
|
|
14440
|
+
onChange === null || onChange === void 0 || onChange([...filteredSelectedValues, selectedItem.id]);
|
|
14429
14441
|
}
|
|
14430
14442
|
selectItem(null);
|
|
14431
14443
|
}
|
|
@@ -14457,9 +14469,9 @@
|
|
|
14457
14469
|
}
|
|
14458
14470
|
}
|
|
14459
14471
|
});
|
|
14460
|
-
const getOption = React.useCallback(() => maxSelectedItem ? option
|
|
14461
|
-
const isMaxSelectedItem = maxSelectedItem && (selectedValue
|
|
14462
|
-
if (isMaxSelectedItem && !(selectedValue
|
|
14472
|
+
const getOption = React.useCallback(() => maxSelectedItem ? option === null || option === void 0 ? void 0 : option.map(item => {
|
|
14473
|
+
const isMaxSelectedItem = maxSelectedItem && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) >= maxSelectedItem;
|
|
14474
|
+
if (isMaxSelectedItem && !(selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id))) {
|
|
14463
14475
|
item.hideCheck = true;
|
|
14464
14476
|
item.isDisabled = true;
|
|
14465
14477
|
} else {
|
|
@@ -14468,7 +14480,7 @@
|
|
|
14468
14480
|
}
|
|
14469
14481
|
return item;
|
|
14470
14482
|
}) : option, [maxSelectedItem, option, selectedValue]);
|
|
14471
|
-
const itemsLength = items
|
|
14483
|
+
const itemsLength = items === null || items === void 0 ? void 0 : items.reduce((acc, item) => {
|
|
14472
14484
|
return [...acc, ...(item.children ? item.children : [item])];
|
|
14473
14485
|
}, []).length;
|
|
14474
14486
|
React.useEffect(() => {
|
|
@@ -14515,15 +14527,16 @@
|
|
|
14515
14527
|
}, [label, isOpen]);
|
|
14516
14528
|
const toggleCollapsible = () => setShowAllTags(!showAllTags);
|
|
14517
14529
|
const handleRemoveAllItem = () => {
|
|
14518
|
-
onChange
|
|
14530
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14519
14531
|
setSelectedValue([]);
|
|
14520
14532
|
setInputSelectValue([]);
|
|
14521
14533
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14522
14534
|
removeSelectedItem(selectedValue[i]);
|
|
14523
14535
|
}
|
|
14524
14536
|
};
|
|
14525
|
-
const isShowTagSelectAll = showTagSelectAll && (selectedItems
|
|
14537
|
+
const isShowTagSelectAll = showTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > (option === null || option === void 0 ? void 0 : option.length);
|
|
14526
14538
|
const renderOptionItem = (item, index, asChild) => {
|
|
14539
|
+
var _item$render;
|
|
14527
14540
|
return /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
14528
14541
|
key: item.id
|
|
14529
14542
|
}, getItemProps({
|
|
@@ -14556,7 +14569,7 @@
|
|
|
14556
14569
|
lineNumber: 745,
|
|
14557
14570
|
columnNumber: 11
|
|
14558
14571
|
}
|
|
14559
|
-
}, !(item
|
|
14572
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14560
14573
|
color: colors$8.iconDisable,
|
|
14561
14574
|
__self: undefined,
|
|
14562
14575
|
__source: {
|
|
@@ -14572,7 +14585,7 @@
|
|
|
14572
14585
|
lineNumber: 760,
|
|
14573
14586
|
columnNumber: 19
|
|
14574
14587
|
}
|
|
14575
|
-
})), isShowSelectAll && (item
|
|
14588
|
+
})), 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
14589
|
__self: undefined,
|
|
14577
14590
|
__source: {
|
|
14578
14591
|
fileName: _jsxFileName$y,
|
|
@@ -14597,15 +14610,15 @@
|
|
|
14597
14610
|
lineNumber: 769,
|
|
14598
14611
|
columnNumber: 11
|
|
14599
14612
|
}
|
|
14600
|
-
}, item.render ? item.render
|
|
14613
|
+
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
14601
14614
|
};
|
|
14602
14615
|
let lastGroupIndex = showSelectAll ? 1 : 0;
|
|
14603
14616
|
const renderOptionGroupItem = (item, index) => {
|
|
14604
|
-
var _item$children5, _item$children6, _item$children7, _item$children8;
|
|
14617
|
+
var _item$children5, _item$children6, _item$children7, _item$render2, _item$children8;
|
|
14605
14618
|
// const groupIndex = (index > (showSelectAll ? 1 : 0)) ? lastGroupIndex : 0;
|
|
14606
14619
|
const groupIndex = lastGroupIndex;
|
|
14607
|
-
lastGroupIndex += ((item
|
|
14608
|
-
const filterSelectedChild = item
|
|
14620
|
+
lastGroupIndex += ((item === null || item === void 0 || (_item$children5 = item.children) === null || _item$children5 === void 0 ? void 0 : _item$children5.length) || 0) + 1;
|
|
14621
|
+
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
14622
|
return /*#__PURE__*/React__default["default"].createElement(OptionGroupItem, {
|
|
14610
14623
|
item: /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
14611
14624
|
key: item.id
|
|
@@ -14638,7 +14651,7 @@
|
|
|
14638
14651
|
lineNumber: 799,
|
|
14639
14652
|
columnNumber: 15
|
|
14640
14653
|
}
|
|
14641
|
-
}, !(item
|
|
14654
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
14642
14655
|
color: colors$8.iconDisable,
|
|
14643
14656
|
__self: undefined,
|
|
14644
14657
|
__source: {
|
|
@@ -14646,7 +14659,7 @@
|
|
|
14646
14659
|
lineNumber: 809,
|
|
14647
14660
|
columnNumber: 19
|
|
14648
14661
|
}
|
|
14649
|
-
}) : (filterSelectedChild
|
|
14662
|
+
}) : (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
14663
|
color: colors$8.iconGreen,
|
|
14651
14664
|
__self: undefined,
|
|
14652
14665
|
__source: {
|
|
@@ -14654,7 +14667,7 @@
|
|
|
14654
14667
|
lineNumber: 811,
|
|
14655
14668
|
columnNumber: 19
|
|
14656
14669
|
}
|
|
14657
|
-
}) : (filterSelectedChild
|
|
14670
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled$1, {
|
|
14658
14671
|
__self: undefined,
|
|
14659
14672
|
__source: {
|
|
14660
14673
|
fileName: _jsxFileName$y,
|
|
@@ -14672,14 +14685,14 @@
|
|
|
14672
14685
|
lineNumber: 816,
|
|
14673
14686
|
columnNumber: 15
|
|
14674
14687
|
}
|
|
14675
|
-
}, item.render ? item.render
|
|
14688
|
+
}, item.render ? (_item$render2 = item.render) === null || _item$render2 === void 0 ? void 0 : _item$render2.call(item, item.name) : item.name)),
|
|
14676
14689
|
__self: undefined,
|
|
14677
14690
|
__source: {
|
|
14678
14691
|
fileName: _jsxFileName$y,
|
|
14679
14692
|
lineNumber: 784,
|
|
14680
14693
|
columnNumber: 9
|
|
14681
14694
|
}
|
|
14682
|
-
}, item
|
|
14695
|
+
}, 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
14696
|
};
|
|
14684
14697
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper$1, _extends({
|
|
14685
14698
|
css: css
|
|
@@ -14810,13 +14823,13 @@
|
|
|
14810
14823
|
lineNumber: 875,
|
|
14811
14824
|
columnNumber: 17
|
|
14812
14825
|
}
|
|
14813
|
-
}), selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')) : selectedItems
|
|
14826
|
+
}), 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
14827
|
if (showAllTags || !collapsible) {
|
|
14815
14828
|
return true;
|
|
14816
14829
|
} else {
|
|
14817
14830
|
return idx < 5;
|
|
14818
14831
|
}
|
|
14819
|
-
}))
|
|
14832
|
+
})) === null || _selectedItems$filter === void 0 ? void 0 : _selectedItems$filter.map((selectedItem, index) => /*#__PURE__*/React__default["default"].createElement(Tag, _extends({
|
|
14820
14833
|
disabled: disabled,
|
|
14821
14834
|
isRemovable: readOnly || disabled || unremovableTags.includes(selectedItem.id) ? false : true,
|
|
14822
14835
|
size: "lg",
|
|
@@ -14841,7 +14854,7 @@
|
|
|
14841
14854
|
lineNumber: 904,
|
|
14842
14855
|
columnNumber: 21
|
|
14843
14856
|
}
|
|
14844
|
-
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems
|
|
14857
|
+
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > collapsibleLimit && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
14845
14858
|
direction: "column",
|
|
14846
14859
|
gap: 4,
|
|
14847
14860
|
__self: undefined,
|
|
@@ -14927,7 +14940,7 @@
|
|
|
14927
14940
|
lineNumber: 947,
|
|
14928
14941
|
columnNumber: 19
|
|
14929
14942
|
}
|
|
14930
|
-
}, `${selectedItems
|
|
14943
|
+
}, `${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
14944
|
css: {
|
|
14932
14945
|
fontSize: '$label',
|
|
14933
14946
|
marginTop: '$spacing-01'
|
|
@@ -14939,7 +14952,7 @@
|
|
|
14939
14952
|
lineNumber: 957,
|
|
14940
14953
|
columnNumber: 11
|
|
14941
14954
|
}
|
|
14942
|
-
}, `${selectedItems
|
|
14955
|
+
}, `${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
14956
|
placement: placement,
|
|
14944
14957
|
css: {
|
|
14945
14958
|
display: isOpen && disabled === false ? 'block' : 'none',
|
|
@@ -14997,7 +15010,7 @@
|
|
|
14997
15010
|
}), /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
14998
15011
|
condition: !!fetchData && items.length > 0,
|
|
14999
15012
|
wrapper: child => /*#__PURE__*/React__default["default"].createElement(InfiniteScroll__default["default"], {
|
|
15000
|
-
loadMore: () => !isLoading && (fetchData
|
|
15013
|
+
loadMore: () => !isLoading && (fetchData === null || fetchData === void 0 ? void 0 : fetchData({
|
|
15001
15014
|
query
|
|
15002
15015
|
})),
|
|
15003
15016
|
hasMore: true,
|
|
@@ -15016,7 +15029,7 @@
|
|
|
15016
15029
|
lineNumber: 997,
|
|
15017
15030
|
columnNumber: 15
|
|
15018
15031
|
}
|
|
15019
|
-
}, isOpen && items.map((item, index) => item
|
|
15032
|
+
}, 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
15033
|
css: {
|
|
15021
15034
|
height: 'auto'
|
|
15022
15035
|
}
|
|
@@ -18679,9 +18692,9 @@
|
|
|
18679
18692
|
}
|
|
18680
18693
|
function handleInputChange(type, e) {
|
|
18681
18694
|
var _e$target;
|
|
18682
|
-
const value = e
|
|
18695
|
+
const value = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
|
|
18683
18696
|
const format = 'DD:MM:YYYY:HH:mm';
|
|
18684
|
-
const minLength = (value
|
|
18697
|
+
const minLength = (value === null || value === void 0 ? void 0 : value.length) > 1;
|
|
18685
18698
|
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
18699
|
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
18700
|
if (!disabled) {
|
|
@@ -21281,7 +21294,7 @@
|
|
|
21281
21294
|
};
|
|
21282
21295
|
};
|
|
21283
21296
|
const getValue = () => {
|
|
21284
|
-
let value = props
|
|
21297
|
+
let value = props === null || props === void 0 ? void 0 : props.value;
|
|
21285
21298
|
const isTrailing = variantIcon === 'trailing';
|
|
21286
21299
|
if (typeof value === 'number' || parseInt(value)) {
|
|
21287
21300
|
if (Math.sign(value) === 1 || Math.sign(value) === 0) {
|
|
@@ -21913,7 +21926,7 @@
|
|
|
21913
21926
|
justify: "center",
|
|
21914
21927
|
onClick: () => {
|
|
21915
21928
|
var _dialogPageRef$curren;
|
|
21916
|
-
return (_dialogPageRef$curren = dialogPageRef.current)
|
|
21929
|
+
return (_dialogPageRef$curren = dialogPageRef.current) === null || _dialogPageRef$curren === void 0 ? void 0 : _dialogPageRef$curren.click();
|
|
21917
21930
|
},
|
|
21918
21931
|
__self: undefined,
|
|
21919
21932
|
__source: {
|
|
@@ -21991,7 +22004,7 @@
|
|
|
21991
22004
|
onSubmit: () => {
|
|
21992
22005
|
var _dialogPageRef$curren2;
|
|
21993
22006
|
debouncedGoToPage(Number(goToPage));
|
|
21994
|
-
(_dialogPageRef$curren2 = dialogPageRef.current)
|
|
22007
|
+
(_dialogPageRef$curren2 = dialogPageRef.current) === null || _dialogPageRef$curren2 === void 0 || _dialogPageRef$curren2.click();
|
|
21995
22008
|
},
|
|
21996
22009
|
__self: undefined,
|
|
21997
22010
|
__source: {
|
|
@@ -22008,7 +22021,7 @@
|
|
|
22008
22021
|
allowNegative: false,
|
|
22009
22022
|
onChange: e => {
|
|
22010
22023
|
var _e$target;
|
|
22011
|
-
return setGoToPage((_e$target = e.target)
|
|
22024
|
+
return setGoToPage((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
22012
22025
|
},
|
|
22013
22026
|
__self: undefined,
|
|
22014
22027
|
__source: {
|
|
@@ -22041,7 +22054,7 @@
|
|
|
22041
22054
|
onClick: () => {
|
|
22042
22055
|
var _dialogPageRef$curren3;
|
|
22043
22056
|
setGoToPage(null);
|
|
22044
|
-
(_dialogPageRef$curren3 = dialogPageRef.current)
|
|
22057
|
+
(_dialogPageRef$curren3 = dialogPageRef.current) === null || _dialogPageRef$curren3 === void 0 || _dialogPageRef$curren3.click();
|
|
22045
22058
|
},
|
|
22046
22059
|
__self: undefined,
|
|
22047
22060
|
__source: {
|
|
@@ -22056,7 +22069,7 @@
|
|
|
22056
22069
|
onClick: () => {
|
|
22057
22070
|
var _dialogPageRef$curren4;
|
|
22058
22071
|
debouncedGoToPage(Number(goToPage));
|
|
22059
|
-
(_dialogPageRef$curren4 = dialogPageRef.current)
|
|
22072
|
+
(_dialogPageRef$curren4 = dialogPageRef.current) === null || _dialogPageRef$curren4 === void 0 || _dialogPageRef$curren4.click();
|
|
22060
22073
|
},
|
|
22061
22074
|
__self: undefined,
|
|
22062
22075
|
__source: {
|
|
@@ -22145,7 +22158,7 @@
|
|
|
22145
22158
|
onClick: () => {
|
|
22146
22159
|
if (isMobilePagination) {
|
|
22147
22160
|
var _dialogLimitRef$curre;
|
|
22148
|
-
(_dialogLimitRef$curre = dialogLimitRef.current)
|
|
22161
|
+
(_dialogLimitRef$curre = dialogLimitRef.current) === null || _dialogLimitRef$curre === void 0 || _dialogLimitRef$curre.click();
|
|
22149
22162
|
}
|
|
22150
22163
|
},
|
|
22151
22164
|
__self: this,
|
|
@@ -22191,7 +22204,7 @@
|
|
|
22191
22204
|
lineNumber: 60,
|
|
22192
22205
|
columnNumber: 13
|
|
22193
22206
|
}
|
|
22194
|
-
}, limits
|
|
22207
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(PopoverClose, {
|
|
22195
22208
|
key: limit,
|
|
22196
22209
|
css: limitItemContainerStyle(selectedLimit === limit),
|
|
22197
22210
|
onClick: () => onChange(limit),
|
|
@@ -22274,7 +22287,7 @@
|
|
|
22274
22287
|
lineNumber: 100,
|
|
22275
22288
|
columnNumber: 11
|
|
22276
22289
|
}
|
|
22277
|
-
}, limits
|
|
22290
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
22278
22291
|
css: {
|
|
22279
22292
|
height: 44,
|
|
22280
22293
|
width: '100%',
|
|
@@ -22289,7 +22302,7 @@
|
|
|
22289
22302
|
onClick: () => {
|
|
22290
22303
|
var _dialogLimitRef$curre2;
|
|
22291
22304
|
onChange(limit);
|
|
22292
|
-
(_dialogLimitRef$curre2 = dialogLimitRef.current)
|
|
22305
|
+
(_dialogLimitRef$curre2 = dialogLimitRef.current) === null || _dialogLimitRef$curre2 === void 0 || _dialogLimitRef$curre2.click();
|
|
22293
22306
|
},
|
|
22294
22307
|
__self: this,
|
|
22295
22308
|
__source: {
|
|
@@ -24556,7 +24569,7 @@
|
|
|
24556
24569
|
onClick: () => {
|
|
24557
24570
|
var _document$getElements;
|
|
24558
24571
|
setOpenDrop(true);
|
|
24559
|
-
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu'))
|
|
24572
|
+
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu')) === null || _document$getElements === void 0 ? void 0 : _document$getElements[0];
|
|
24560
24573
|
contextMenu.style.opacity = 0;
|
|
24561
24574
|
},
|
|
24562
24575
|
__self: undefined,
|
|
@@ -25212,7 +25225,7 @@
|
|
|
25212
25225
|
if (!props.onOpenAutoFocus) {
|
|
25213
25226
|
e.preventDefault();
|
|
25214
25227
|
} else {
|
|
25215
|
-
props
|
|
25228
|
+
props === null || props === void 0 || props.onOpenAutoFocus();
|
|
25216
25229
|
}
|
|
25217
25230
|
},
|
|
25218
25231
|
__self: undefined,
|
|
@@ -25292,7 +25305,7 @@
|
|
|
25292
25305
|
}, props.description)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
25293
25306
|
css: {
|
|
25294
25307
|
width: '100%',
|
|
25295
|
-
display: props
|
|
25308
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25296
25309
|
},
|
|
25297
25310
|
__self: undefined,
|
|
25298
25311
|
__source: {
|
|
@@ -25334,8 +25347,8 @@
|
|
|
25334
25347
|
size: props.btnSize,
|
|
25335
25348
|
onClick: buttonConfirm,
|
|
25336
25349
|
buttonType: props.dialogType,
|
|
25337
|
-
disabled: props
|
|
25338
|
-
}, props
|
|
25350
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25351
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25339
25352
|
__self: undefined,
|
|
25340
25353
|
__source: {
|
|
25341
25354
|
fileName: _jsxFileName$b,
|
|
@@ -25354,19 +25367,19 @@
|
|
|
25354
25367
|
size: props.btnSize,
|
|
25355
25368
|
onClick: buttonCancel,
|
|
25356
25369
|
css: {
|
|
25357
|
-
color: props.dialogType === 'negative' && !(props
|
|
25370
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25358
25371
|
flex: props.isMobile && 1
|
|
25359
25372
|
},
|
|
25360
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25361
|
-
disabled: props
|
|
25362
|
-
}, props
|
|
25373
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25374
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25375
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25363
25376
|
__self: undefined,
|
|
25364
25377
|
__source: {
|
|
25365
25378
|
fileName: _jsxFileName$b,
|
|
25366
25379
|
lineNumber: 187,
|
|
25367
25380
|
columnNumber: 19
|
|
25368
25381
|
}
|
|
25369
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25382
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default["default"].createElement(ADialog__namespace.Action, {
|
|
25370
25383
|
asChild: true,
|
|
25371
25384
|
__self: undefined,
|
|
25372
25385
|
__source: {
|
|
@@ -25381,8 +25394,8 @@
|
|
|
25381
25394
|
css: {
|
|
25382
25395
|
flex: props.isMobile && 1
|
|
25383
25396
|
},
|
|
25384
|
-
disabled: props
|
|
25385
|
-
}, props
|
|
25397
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25398
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25386
25399
|
__self: undefined,
|
|
25387
25400
|
__source: {
|
|
25388
25401
|
fileName: _jsxFileName$b,
|
|
@@ -25512,7 +25525,7 @@
|
|
|
25512
25525
|
}, props.description)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
25513
25526
|
css: {
|
|
25514
25527
|
width: '100%',
|
|
25515
|
-
display: props
|
|
25528
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25516
25529
|
},
|
|
25517
25530
|
__self: this,
|
|
25518
25531
|
__source: {
|
|
@@ -25557,8 +25570,8 @@
|
|
|
25557
25570
|
css: {
|
|
25558
25571
|
flex: props.isMobile && 1
|
|
25559
25572
|
},
|
|
25560
|
-
disabled: props
|
|
25561
|
-
}, props
|
|
25573
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25574
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25562
25575
|
__self: this,
|
|
25563
25576
|
__source: {
|
|
25564
25577
|
fileName: _jsxFileName$b,
|
|
@@ -25577,19 +25590,19 @@
|
|
|
25577
25590
|
size: props.btnSize,
|
|
25578
25591
|
onClick: props.onCancel,
|
|
25579
25592
|
css: {
|
|
25580
|
-
color: props.dialogType === 'negative' && !(props
|
|
25593
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25581
25594
|
flex: props.isMobile && 1
|
|
25582
25595
|
},
|
|
25583
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25584
|
-
disabled: props
|
|
25585
|
-
}, props
|
|
25596
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25597
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25598
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25586
25599
|
__self: this,
|
|
25587
25600
|
__source: {
|
|
25588
25601
|
fileName: _jsxFileName$b,
|
|
25589
25602
|
lineNumber: 293,
|
|
25590
25603
|
columnNumber: 19
|
|
25591
25604
|
}
|
|
25592
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25605
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default["default"].createElement(ADialog__namespace.Action, {
|
|
25593
25606
|
asChild: true,
|
|
25594
25607
|
__self: this,
|
|
25595
25608
|
__source: {
|
|
@@ -25604,8 +25617,8 @@
|
|
|
25604
25617
|
css: {
|
|
25605
25618
|
flex: props.isMobile && 1
|
|
25606
25619
|
},
|
|
25607
|
-
disabled: props
|
|
25608
|
-
}, props
|
|
25620
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25621
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25609
25622
|
__self: this,
|
|
25610
25623
|
__source: {
|
|
25611
25624
|
fileName: _jsxFileName$b,
|
|
@@ -28119,7 +28132,7 @@
|
|
|
28119
28132
|
upload({
|
|
28120
28133
|
url: action,
|
|
28121
28134
|
file: newFile,
|
|
28122
|
-
customBody: customBodyRequest
|
|
28135
|
+
customBody: customBodyRequest === null || customBodyRequest === void 0 ? void 0 : customBodyRequest(newFile),
|
|
28123
28136
|
token,
|
|
28124
28137
|
tokenKey,
|
|
28125
28138
|
reqKey,
|
|
@@ -28139,12 +28152,12 @@
|
|
|
28139
28152
|
arrProgress[i] = fileProgress;
|
|
28140
28153
|
}
|
|
28141
28154
|
}
|
|
28142
|
-
onChange
|
|
28155
|
+
onChange === null || onChange === void 0 || (_onChange = onChange({
|
|
28143
28156
|
fileList: arrProgress,
|
|
28144
28157
|
file: fileProgress,
|
|
28145
28158
|
indexReplace: indexReplace.current,
|
|
28146
28159
|
isReplace: indexReplace.current !== null
|
|
28147
|
-
}))
|
|
28160
|
+
})) === null || _onChange === void 0 || (_onChange = _onChange.then(() => setError(null))) === null || _onChange === void 0 || _onChange.catch(error => setError(error.message));
|
|
28148
28161
|
}
|
|
28149
28162
|
}).then(result => {
|
|
28150
28163
|
var _onChange2;
|
|
@@ -28157,12 +28170,12 @@
|
|
|
28157
28170
|
arrFile[i] = fileSuccess;
|
|
28158
28171
|
}
|
|
28159
28172
|
}
|
|
28160
|
-
onChange
|
|
28173
|
+
onChange === null || onChange === void 0 || (_onChange2 = onChange({
|
|
28161
28174
|
fileList: arrFile,
|
|
28162
28175
|
file: fileSuccess,
|
|
28163
28176
|
indexReplace: indexReplace.current,
|
|
28164
28177
|
isReplace: indexReplace.current !== null
|
|
28165
|
-
}))
|
|
28178
|
+
})) === null || _onChange2 === void 0 || (_onChange2 = _onChange2.then(() => setError(null))) === null || _onChange2 === void 0 || _onChange2.catch(error => setError(error.message));
|
|
28166
28179
|
}).catch(error => {
|
|
28167
28180
|
var _onChange3;
|
|
28168
28181
|
let fileError = Object.assign({}, newFile);
|
|
@@ -28174,21 +28187,21 @@
|
|
|
28174
28187
|
arrFile[i] = fileError;
|
|
28175
28188
|
}
|
|
28176
28189
|
}
|
|
28177
|
-
onChange
|
|
28190
|
+
onChange === null || onChange === void 0 || (_onChange3 = onChange({
|
|
28178
28191
|
fileList: arrFile,
|
|
28179
28192
|
file: fileError,
|
|
28180
28193
|
indexReplace: indexReplace.current,
|
|
28181
28194
|
isReplace: indexReplace.current !== null
|
|
28182
|
-
}))
|
|
28195
|
+
})) === null || _onChange3 === void 0 || (_onChange3 = _onChange3.then(() => setError(null))) === null || _onChange3 === void 0 || _onChange3.catch(error => setError(error.message));
|
|
28183
28196
|
});
|
|
28184
28197
|
} else {
|
|
28185
28198
|
var _onChange4;
|
|
28186
|
-
onChange
|
|
28199
|
+
onChange === null || onChange === void 0 || (_onChange4 = onChange({
|
|
28187
28200
|
fileList: arrFile,
|
|
28188
28201
|
file: newFile,
|
|
28189
28202
|
indexReplace: indexReplace.current,
|
|
28190
28203
|
isReplace: indexReplace.current !== null
|
|
28191
|
-
}))
|
|
28204
|
+
})) === null || _onChange4 === void 0 || (_onChange4 = _onChange4.then(() => setError(null))) === null || _onChange4 === void 0 || _onChange4.catch(error => setError(error.message));
|
|
28192
28205
|
}
|
|
28193
28206
|
if (indexReplace.current !== null) {
|
|
28194
28207
|
arrFile[indexReplace.current] = newFile;
|
|
@@ -28208,15 +28221,15 @@
|
|
|
28208
28221
|
// program to get the dimensions of an image
|
|
28209
28222
|
const img = document.createElement('img');
|
|
28210
28223
|
img.src = URL.createObjectURL(files[0]);
|
|
28211
|
-
img.size = files
|
|
28212
|
-
img.type = files
|
|
28224
|
+
img.size = files === null || files === void 0 || (_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.size;
|
|
28225
|
+
img.type = files === null || files === void 0 || (_files$2 = files[0]) === null || _files$2 === void 0 ? void 0 : _files$2.type;
|
|
28213
28226
|
img.onload = () => {
|
|
28214
28227
|
const imgRatio = img.width / img.height;
|
|
28215
28228
|
setAspect(ratio || imgRatio);
|
|
28216
28229
|
setCropperImgRatio(imgRatio);
|
|
28217
28230
|
if (onBeforeCrop) {
|
|
28218
28231
|
var _onBeforeCrop;
|
|
28219
|
-
onBeforeCrop
|
|
28232
|
+
onBeforeCrop === null || onBeforeCrop === void 0 || (_onBeforeCrop = onBeforeCrop(img)) === null || _onBeforeCrop === void 0 || (_onBeforeCrop = _onBeforeCrop.then(() => {
|
|
28220
28233
|
setError(null);
|
|
28221
28234
|
toggleModal();
|
|
28222
28235
|
setTimeout(() => {
|
|
@@ -28230,7 +28243,7 @@
|
|
|
28230
28243
|
}, 300);
|
|
28231
28244
|
setFileState(files[0]);
|
|
28232
28245
|
setPreviewImage(URL.createObjectURL(files[0]));
|
|
28233
|
-
}))
|
|
28246
|
+
})) === null || _onBeforeCrop === void 0 || _onBeforeCrop.catch(error => setError(error === null || error === void 0 ? void 0 : error.message));
|
|
28234
28247
|
} else {
|
|
28235
28248
|
toggleModal();
|
|
28236
28249
|
setTimeout(() => {
|
|
@@ -28248,18 +28261,18 @@
|
|
|
28248
28261
|
};
|
|
28249
28262
|
img.onerror = error => {
|
|
28250
28263
|
var _onBeforeCrop2;
|
|
28251
|
-
onBeforeCrop
|
|
28264
|
+
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
28265
|
};
|
|
28253
28266
|
}
|
|
28254
28267
|
}
|
|
28255
28268
|
}
|
|
28256
28269
|
function handleCrop() {
|
|
28257
|
-
if (completedCrop
|
|
28258
|
-
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState
|
|
28259
|
-
const sizeMB = (blob
|
|
28270
|
+
if (completedCrop !== null && completedCrop !== void 0 && completedCrop.width && completedCrop !== null && completedCrop !== void 0 && completedCrop.height && imgRef.current) {
|
|
28271
|
+
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState === null || fileState === void 0 ? void 0 : fileState.type).then(blob => {
|
|
28272
|
+
const sizeMB = (blob === null || blob === void 0 ? void 0 : blob.size) / 1024 / 1024;
|
|
28260
28273
|
if (sizeMB < maxSizeMB || sizeMB < 1 || !imageCompression) {
|
|
28261
|
-
const file = new File([blob], fileState
|
|
28262
|
-
type: blob
|
|
28274
|
+
const file = new File([blob], fileState === null || fileState === void 0 ? void 0 : fileState.name, {
|
|
28275
|
+
type: blob === null || blob === void 0 ? void 0 : blob.type
|
|
28263
28276
|
});
|
|
28264
28277
|
handleUpload([file]);
|
|
28265
28278
|
setCrop(null);
|
|
@@ -28273,16 +28286,16 @@
|
|
|
28273
28286
|
alwaysKeepResolution: true
|
|
28274
28287
|
}).then(compressedFile => {
|
|
28275
28288
|
var _fileState$name;
|
|
28276
|
-
const file = new File([compressedFile], (fileState
|
|
28277
|
-
type: compressedFile
|
|
28289
|
+
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', {
|
|
28290
|
+
type: compressedFile === null || compressedFile === void 0 ? void 0 : compressedFile.type
|
|
28278
28291
|
});
|
|
28279
28292
|
handleUpload([file]);
|
|
28280
28293
|
setCrop(null);
|
|
28281
28294
|
setCompletedCrop(null);
|
|
28282
|
-
}).catch(error => console.error(error
|
|
28295
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
28283
28296
|
}
|
|
28284
28297
|
toggleModal();
|
|
28285
|
-
}).catch(error => console.error(error
|
|
28298
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
28286
28299
|
} else {
|
|
28287
28300
|
handleUpload([fileState]);
|
|
28288
28301
|
toggleModal();
|
|
@@ -28311,7 +28324,7 @@
|
|
|
28311
28324
|
const index = fileList.indexOf(file);
|
|
28312
28325
|
const newFileList = fileList.slice();
|
|
28313
28326
|
newFileList.splice(index, 1);
|
|
28314
|
-
onChange
|
|
28327
|
+
onChange === null || onChange === void 0 || onChange({
|
|
28315
28328
|
fileList: newFileList,
|
|
28316
28329
|
file
|
|
28317
28330
|
});
|
|
@@ -28334,14 +28347,14 @@
|
|
|
28334
28347
|
}
|
|
28335
28348
|
function handleOpenFile(file) {
|
|
28336
28349
|
var _String, _file$name;
|
|
28337
|
-
let extension = (_String = String(file
|
|
28350
|
+
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
28351
|
if (extension === 'pdf') {
|
|
28339
|
-
window.open(file
|
|
28352
|
+
window.open(file === null || file === void 0 ? void 0 : file.url);
|
|
28340
28353
|
} else {
|
|
28341
|
-
if (file
|
|
28354
|
+
if (file !== null && file !== void 0 && file.url) {
|
|
28342
28355
|
const link = document.createElement('a');
|
|
28343
28356
|
link.href = file.url;
|
|
28344
|
-
link.setAttribute('download', file
|
|
28357
|
+
link.setAttribute('download', file === null || file === void 0 ? void 0 : file.name);
|
|
28345
28358
|
document.body.appendChild(link);
|
|
28346
28359
|
link.click();
|
|
28347
28360
|
document.body.removeChild(link);
|
|
@@ -28403,12 +28416,12 @@
|
|
|
28403
28416
|
}, replaceLabel && replaceLabel.length > 0 ? replaceLabel : t('replaceLabel', 'Ubah Berkas')));
|
|
28404
28417
|
}
|
|
28405
28418
|
const renderPicture = () => {
|
|
28406
|
-
return fileList
|
|
28407
|
-
if ((item
|
|
28419
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28420
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28408
28421
|
return /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
|
28409
28422
|
key: index,
|
|
28410
|
-
progress: item
|
|
28411
|
-
loading: item
|
|
28423
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28424
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28412
28425
|
__self: undefined,
|
|
28413
28426
|
__source: {
|
|
28414
28427
|
fileName: _jsxFileName$9,
|
|
@@ -28481,13 +28494,13 @@
|
|
|
28481
28494
|
});
|
|
28482
28495
|
};
|
|
28483
28496
|
const renderFile = () => {
|
|
28484
|
-
return fileList
|
|
28497
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28485
28498
|
var _item$name;
|
|
28486
|
-
if ((item
|
|
28499
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28487
28500
|
return /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
|
28488
28501
|
key: index,
|
|
28489
|
-
progress: item
|
|
28490
|
-
loading: item
|
|
28502
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28503
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28491
28504
|
__self: undefined,
|
|
28492
28505
|
__source: {
|
|
28493
28506
|
fileName: _jsxFileName$9,
|
|
@@ -28553,7 +28566,7 @@
|
|
|
28553
28566
|
lineNumber: 666,
|
|
28554
28567
|
columnNumber: 17
|
|
28555
28568
|
}
|
|
28556
|
-
}, ".", item
|
|
28569
|
+
}, ".", 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
28570
|
label: item.name,
|
|
28558
28571
|
__self: undefined,
|
|
28559
28572
|
__source: {
|
|
@@ -28923,7 +28936,7 @@
|
|
|
28923
28936
|
}
|
|
28924
28937
|
return /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
28925
28938
|
direction: "row",
|
|
28926
|
-
gap: (fileList
|
|
28939
|
+
gap: (fileList === null || fileList === void 0 ? void 0 : fileList.length) <= 1 && max === 1 ? 0 : 3,
|
|
28927
28940
|
wrap: "wrap",
|
|
28928
28941
|
css: {
|
|
28929
28942
|
userSelect: 'none'
|
|
@@ -29753,9 +29766,9 @@
|
|
|
29753
29766
|
function InputColorPicker(props) {
|
|
29754
29767
|
const [isPopover, setIsPopover] = React.useState(false);
|
|
29755
29768
|
function getColor() {
|
|
29756
|
-
const color = props
|
|
29769
|
+
const color = props === null || props === void 0 ? void 0 : props.color;
|
|
29757
29770
|
if (typeof color === 'string') {
|
|
29758
|
-
return color
|
|
29771
|
+
return color === null || color === void 0 ? void 0 : color.toUpperCase();
|
|
29759
29772
|
}
|
|
29760
29773
|
return `rgba(${color.r},${color.g},${color.b},${color.a})`;
|
|
29761
29774
|
}
|
|
@@ -32774,7 +32787,7 @@
|
|
|
32774
32787
|
var _data;
|
|
32775
32788
|
const isActive = props.currentStep === i;
|
|
32776
32789
|
const isComplete = props.isComplete[i - 1];
|
|
32777
|
-
const isAdditional = (_data = data[i - 1])
|
|
32790
|
+
const isAdditional = (_data = data[i - 1]) === null || _data === void 0 ? void 0 : _data.additional;
|
|
32778
32791
|
const lastItem = navMobileItems.indexOf(data[i - 1]) + 1 === navMobileItems.length;
|
|
32779
32792
|
// eslint-disable-next-line no-lone-blocks
|
|
32780
32793
|
{
|
|
@@ -32789,7 +32802,7 @@
|
|
|
32789
32802
|
key: `step-${i}`,
|
|
32790
32803
|
onClick: () => {
|
|
32791
32804
|
var _data2;
|
|
32792
|
-
if (props.onNavClicked && !((_data2 = data[i - 1])
|
|
32805
|
+
if (props.onNavClicked && !((_data2 = data[i - 1]) !== null && _data2 !== void 0 && _data2.disabled) || isAdditional) props.onNavClicked(i);
|
|
32793
32806
|
if (!forbidClickNav && isComplete && !isHide || isAdditional) {
|
|
32794
32807
|
props.goToStep(i);
|
|
32795
32808
|
}
|
|
@@ -32822,9 +32835,9 @@
|
|
|
32822
32835
|
lineNumber: 176,
|
|
32823
32836
|
columnNumber: 17
|
|
32824
32837
|
}
|
|
32825
|
-
}), typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title = (_data3 = data[i - 1]).title)
|
|
32838
|
+
}), 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
32839
|
align: "center",
|
|
32827
|
-
label: (_data5 = data[i - 1])
|
|
32840
|
+
label: (_data5 = data[i - 1]) === null || _data5 === void 0 ? void 0 : _data5.tooltipsContents,
|
|
32828
32841
|
__self: undefined,
|
|
32829
32842
|
__source: {
|
|
32830
32843
|
fileName: _jsxFileName$4,
|
|
@@ -32843,9 +32856,9 @@
|
|
|
32843
32856
|
lineNumber: 181,
|
|
32844
32857
|
columnNumber: 19
|
|
32845
32858
|
}
|
|
32846
|
-
})), ((_data6 = data[i - 1])
|
|
32859
|
+
})), ((_data6 = data[i - 1]) === null || _data6 === void 0 ? void 0 : _data6.comingSoon) && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
32847
32860
|
css: {
|
|
32848
|
-
marginLeft: (_data7 = data[i - 1])
|
|
32861
|
+
marginLeft: (_data7 = data[i - 1]) !== null && _data7 !== void 0 && _data7.withTolltip ? 0 : '$spacing-03'
|
|
32849
32862
|
},
|
|
32850
32863
|
align: "center",
|
|
32851
32864
|
__self: undefined,
|
|
@@ -32896,10 +32909,10 @@
|
|
|
32896
32909
|
lineNumber: 198,
|
|
32897
32910
|
columnNumber: 21
|
|
32898
32911
|
}
|
|
32899
|
-
}, typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title2 = (_data8 = data[i - 1]).title)
|
|
32912
|
+
}, 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
32913
|
align: "center",
|
|
32901
32914
|
withClick: true,
|
|
32902
|
-
label: (_data10 = data[i - 1])
|
|
32915
|
+
label: (_data10 = data[i - 1]) === null || _data10 === void 0 ? void 0 : _data10.tooltipsContents,
|
|
32903
32916
|
__self: undefined,
|
|
32904
32917
|
__source: {
|
|
32905
32918
|
fileName: _jsxFileName$4,
|
|
@@ -32915,11 +32928,11 @@
|
|
|
32915
32928
|
lineNumber: 209,
|
|
32916
32929
|
columnNumber: 25
|
|
32917
32930
|
}
|
|
32918
|
-
})), ((_data11 = data[i - 1])
|
|
32931
|
+
})), ((_data11 = data[i - 1]) === null || _data11 === void 0 ? void 0 : _data11.comingSoon) && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
32919
32932
|
align: "center",
|
|
32920
32933
|
justify: "center",
|
|
32921
32934
|
css: {
|
|
32922
|
-
marginTop: (_data12 = data[i - 1])
|
|
32935
|
+
marginTop: (_data12 = data[i - 1]) !== null && _data12 !== void 0 && _data12.withTolltip ? 0 : '$spacing-03'
|
|
32923
32936
|
},
|
|
32924
32937
|
__self: undefined,
|
|
32925
32938
|
__source: {
|
|
@@ -32943,7 +32956,7 @@
|
|
|
32943
32956
|
userSelect: 'none',
|
|
32944
32957
|
fontSize: '12px',
|
|
32945
32958
|
textAlign: '-webkit-center',
|
|
32946
|
-
display: ((_data13 = data[i - 1])
|
|
32959
|
+
display: ((_data13 = data[i - 1]) === null || _data13 === void 0 ? void 0 : _data13.disabled) && 'none',
|
|
32947
32960
|
marginTop: '$spacing-07',
|
|
32948
32961
|
flex: 1,
|
|
32949
32962
|
maxWidth: lastItem && 26
|
|
@@ -33023,7 +33036,7 @@
|
|
|
33023
33036
|
height: 24,
|
|
33024
33037
|
borderRadius: '$round',
|
|
33025
33038
|
border: `4px solid ${isActive ? '$bgGreen' : '$bgInactive'}`,
|
|
33026
|
-
backgroundColor: (_data14 = data[i - 1])
|
|
33039
|
+
backgroundColor: (_data14 = data[i - 1]) !== null && _data14 !== void 0 && _data14.disabled ? '$gray200' : '$white'
|
|
33027
33040
|
},
|
|
33028
33041
|
__self: undefined,
|
|
33029
33042
|
__source: {
|
|
@@ -33052,50 +33065,53 @@
|
|
|
33052
33065
|
}
|
|
33053
33066
|
return /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
33054
33067
|
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
|
-
|
|
33068
|
+
wrapper: child => {
|
|
33069
|
+
var _props$appendContent;
|
|
33070
|
+
return /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
33071
|
+
css: {
|
|
33072
|
+
opacity: isHide ? 0 : undefined,
|
|
33073
|
+
maxWidth: 311
|
|
33074
|
+
},
|
|
33075
|
+
__self: undefined,
|
|
33076
|
+
__source: {
|
|
33077
|
+
fileName: _jsxFileName$4,
|
|
33078
|
+
lineNumber: 281,
|
|
33079
|
+
columnNumber: 9
|
|
33080
|
+
}
|
|
33081
|
+
}, /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
33082
|
+
css: {
|
|
33083
|
+
position: !isMobile && 'sticky',
|
|
33084
|
+
top: !isMobile ? 44 : 40
|
|
33085
|
+
},
|
|
33086
|
+
direction: "column",
|
|
33087
|
+
gap: 7,
|
|
33088
|
+
__self: undefined,
|
|
33089
|
+
__source: {
|
|
33090
|
+
fileName: _jsxFileName$4,
|
|
33091
|
+
lineNumber: 282,
|
|
33092
|
+
columnNumber: 11
|
|
33093
|
+
}
|
|
33094
|
+
}, /*#__PURE__*/React__default["default"].createElement(Card, {
|
|
33095
|
+
css: {
|
|
33096
|
+
height: 'fit-content',
|
|
33097
|
+
padding: 0
|
|
33098
|
+
},
|
|
33099
|
+
showBottomLine: false,
|
|
33100
|
+
__self: undefined,
|
|
33101
|
+
__source: {
|
|
33102
|
+
fileName: _jsxFileName$4,
|
|
33103
|
+
lineNumber: 283,
|
|
33104
|
+
columnNumber: 13
|
|
33105
|
+
}
|
|
33106
|
+
}, child), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
33107
|
+
__self: undefined,
|
|
33108
|
+
__source: {
|
|
33109
|
+
fileName: _jsxFileName$4,
|
|
33110
|
+
lineNumber: 292,
|
|
33111
|
+
columnNumber: 13
|
|
33112
|
+
}
|
|
33113
|
+
}, 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)));
|
|
33114
|
+
},
|
|
33099
33115
|
__self: undefined,
|
|
33100
33116
|
__source: {
|
|
33101
33117
|
fileName: _jsxFileName$4,
|
|
@@ -33160,7 +33176,8 @@
|
|
|
33160
33176
|
}));
|
|
33161
33177
|
}, [props.hide]);
|
|
33162
33178
|
React.useEffect(() => {
|
|
33163
|
-
|
|
33179
|
+
var _props$onChangeVisibi;
|
|
33180
|
+
props === null || props === void 0 || (_props$onChangeVisibi = props.onChangeVisibility) === null || _props$onChangeVisibi === void 0 || _props$onChangeVisibi.call(props, state.hide);
|
|
33164
33181
|
}, [state.hide]);
|
|
33165
33182
|
const toogleVisibility = value => {
|
|
33166
33183
|
updateState(prev => Object.assign({}, prev, {
|
|
@@ -33169,11 +33186,11 @@
|
|
|
33169
33186
|
};
|
|
33170
33187
|
const getIsComplete = currentStep => {
|
|
33171
33188
|
var _state$isComplete;
|
|
33172
|
-
return state
|
|
33189
|
+
return state === null || state === void 0 || (_state$isComplete = state.isComplete) === null || _state$isComplete === void 0 ? void 0 : _state$isComplete[currentStep - 1];
|
|
33173
33190
|
};
|
|
33174
33191
|
const getTitleStep = currentStep => {
|
|
33175
33192
|
var _props$navContents;
|
|
33176
|
-
return props
|
|
33193
|
+
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
33194
|
};
|
|
33178
33195
|
const setState = value => {
|
|
33179
33196
|
updateState(Object.assign({}, state, value));
|
|
@@ -33207,13 +33224,13 @@
|
|
|
33207
33224
|
block: 'start'
|
|
33208
33225
|
});
|
|
33209
33226
|
props.onStepChange && props.onStepChange(e);
|
|
33210
|
-
if (props
|
|
33211
|
-
if ((e
|
|
33227
|
+
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) {
|
|
33228
|
+
if ((e === null || e === void 0 ? void 0 : e.activeStep) > (e === null || e === void 0 ? void 0 : e.previousStep)) {
|
|
33212
33229
|
var _state$SW;
|
|
33213
|
-
state
|
|
33230
|
+
state === null || state === void 0 || (_state$SW = state.SW) === null || _state$SW === void 0 || _state$SW.nextStep();
|
|
33214
33231
|
} else {
|
|
33215
33232
|
var _state$SW2;
|
|
33216
|
-
state
|
|
33233
|
+
state === null || state === void 0 || (_state$SW2 = state.SW) === null || _state$SW2 === void 0 || _state$SW2.previousStep();
|
|
33217
33234
|
}
|
|
33218
33235
|
}
|
|
33219
33236
|
};
|
|
@@ -33228,11 +33245,11 @@
|
|
|
33228
33245
|
}, /*#__PURE__*/React__default["default"].createElement(StepWizardContext.Provider, {
|
|
33229
33246
|
value: {
|
|
33230
33247
|
toogleVisibility,
|
|
33231
|
-
isHide: state
|
|
33248
|
+
isHide: state === null || state === void 0 ? void 0 : state.hide,
|
|
33232
33249
|
setComplete,
|
|
33233
33250
|
setState,
|
|
33234
33251
|
state,
|
|
33235
|
-
SW: state
|
|
33252
|
+
SW: state === null || state === void 0 ? void 0 : state.SW,
|
|
33236
33253
|
forbidClickNav: props.forbidClickNav,
|
|
33237
33254
|
titles: props.titles,
|
|
33238
33255
|
isMobile: props.isMobile,
|
|
@@ -33255,7 +33272,7 @@
|
|
|
33255
33272
|
nav: /*#__PURE__*/React__default["default"].createElement(Navigation, {
|
|
33256
33273
|
onNavClicked: props.onNavClicked,
|
|
33257
33274
|
isComplete: state.isComplete,
|
|
33258
|
-
appendContent: props
|
|
33275
|
+
appendContent: props === null || props === void 0 ? void 0 : props.appendContent,
|
|
33259
33276
|
__self: undefined,
|
|
33260
33277
|
__source: {
|
|
33261
33278
|
fileName: _jsxFileName$4,
|
|
@@ -33265,7 +33282,7 @@
|
|
|
33265
33282
|
}),
|
|
33266
33283
|
initialStep: props.initialStep,
|
|
33267
33284
|
onStepChange: handleStepChange,
|
|
33268
|
-
isLazyMount: props
|
|
33285
|
+
isLazyMount: props === null || props === void 0 ? void 0 : props.isLazyMount,
|
|
33269
33286
|
__self: undefined,
|
|
33270
33287
|
__source: {
|
|
33271
33288
|
fileName: _jsxFileName$4,
|
|
@@ -33412,9 +33429,9 @@
|
|
|
33412
33429
|
var _getDatasets;
|
|
33413
33430
|
function getDatasets(content, activeId, isCollapse) {
|
|
33414
33431
|
const datasets = [];
|
|
33415
|
-
for (let i = 0; i < (content
|
|
33432
|
+
for (let i = 0; i < (content === null || content === void 0 ? void 0 : content.length); i++) {
|
|
33416
33433
|
var _content$i;
|
|
33417
|
-
if (((_content$i = content[i])
|
|
33434
|
+
if (((_content$i = content[i]) === null || _content$i === void 0 ? void 0 : _content$i.id) === activeId) {
|
|
33418
33435
|
datasets.unshift(content[i]);
|
|
33419
33436
|
} else {
|
|
33420
33437
|
datasets.push(content[i]);
|
|
@@ -33452,7 +33469,7 @@
|
|
|
33452
33469
|
lineNumber: 107,
|
|
33453
33470
|
columnNumber: 7
|
|
33454
33471
|
}
|
|
33455
|
-
}, (_getDatasets = getDatasets(content, activeId, isCollapse))
|
|
33472
|
+
}, (_getDatasets = getDatasets(content, activeId, isCollapse)) === null || _getDatasets === void 0 ? void 0 : _getDatasets.map((item, index) => {
|
|
33456
33473
|
return /*#__PURE__*/React__default["default"].createElement(List, {
|
|
33457
33474
|
key: index,
|
|
33458
33475
|
__self: this,
|
|
@@ -33469,11 +33486,11 @@
|
|
|
33469
33486
|
marginLeft: '-4px !important',
|
|
33470
33487
|
borderLeftWidth: '4px !important',
|
|
33471
33488
|
borderLeftStyle: 'solid !important',
|
|
33472
|
-
borderLeftColor: `${(item
|
|
33489
|
+
borderLeftColor: `${(item === null || item === void 0 ? void 0 : item.id) === activeId ? colors$8.primary500 : 'transparent'} !important`,
|
|
33473
33490
|
paddingLeft: '16px !important',
|
|
33474
33491
|
minHeight: 25
|
|
33475
33492
|
},
|
|
33476
|
-
"data-to-scrollspy-id": item
|
|
33493
|
+
"data-to-scrollspy-id": item === null || item === void 0 ? void 0 : item.id,
|
|
33477
33494
|
__self: this,
|
|
33478
33495
|
__source: {
|
|
33479
33496
|
fileName: _jsxFileName$2,
|
|
@@ -33482,13 +33499,13 @@
|
|
|
33482
33499
|
}
|
|
33483
33500
|
}, /*#__PURE__*/React__default["default"].createElement(Title$1, {
|
|
33484
33501
|
className: "link-title",
|
|
33485
|
-
active: (item
|
|
33486
|
-
href: `#${item
|
|
33502
|
+
active: (item === null || item === void 0 ? void 0 : item.id) === activeId,
|
|
33503
|
+
href: `#${item === null || item === void 0 ? void 0 : item.id}`,
|
|
33487
33504
|
onClick: e => {
|
|
33488
33505
|
var _e$currentTarget, _e$currentTarget2;
|
|
33489
33506
|
e.preventDefault();
|
|
33490
|
-
onNavClick
|
|
33491
|
-
const target = window.document.getElementById(e
|
|
33507
|
+
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]);
|
|
33508
|
+
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
33509
|
if (target) {
|
|
33493
33510
|
var headerOffset = 20;
|
|
33494
33511
|
var elementPosition = target.getBoundingClientRect().top;
|
|
@@ -33512,7 +33529,7 @@
|
|
|
33512
33529
|
lineNumber: 125,
|
|
33513
33530
|
columnNumber: 17
|
|
33514
33531
|
}
|
|
33515
|
-
}, item
|
|
33532
|
+
}, item === null || item === void 0 ? void 0 : item.title), item === null || item === void 0 ? void 0 : item.icon));
|
|
33516
33533
|
})));
|
|
33517
33534
|
}
|
|
33518
33535
|
function TableOfContent({
|