@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.esm.js
CHANGED
|
@@ -2580,7 +2580,7 @@ const BannerClose = () => /*#__PURE__*/React.createElement(Context$2.Consumer, {
|
|
|
2580
2580
|
onClick: e => {
|
|
2581
2581
|
e.preventDefault();
|
|
2582
2582
|
e.stopPropagation();
|
|
2583
|
-
value
|
|
2583
|
+
value === null || value === void 0 || value.onRemove();
|
|
2584
2584
|
},
|
|
2585
2585
|
__self: undefined,
|
|
2586
2586
|
__source: {
|
|
@@ -2599,6 +2599,7 @@ const BannerClose = () => /*#__PURE__*/React.createElement(Context$2.Consumer, {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
})));
|
|
2601
2601
|
const SingleTagBanner = props => {
|
|
2602
|
+
var _props$icon;
|
|
2602
2603
|
return /*#__PURE__*/React.createElement(Flex$1, {
|
|
2603
2604
|
gap: 2,
|
|
2604
2605
|
direction: "column",
|
|
@@ -2624,7 +2625,7 @@ const SingleTagBanner = props => {
|
|
|
2624
2625
|
lineNumber: 212,
|
|
2625
2626
|
columnNumber: 9
|
|
2626
2627
|
}
|
|
2627
|
-
}, (props
|
|
2628
|
+
}, (props === null || props === void 0 ? void 0 : props.icon) && /*#__PURE__*/React.createElement(Flex$1, {
|
|
2628
2629
|
css: {
|
|
2629
2630
|
marginTop: '-2px'
|
|
2630
2631
|
},
|
|
@@ -2634,7 +2635,7 @@ const SingleTagBanner = props => {
|
|
|
2634
2635
|
lineNumber: 213,
|
|
2635
2636
|
columnNumber: 27
|
|
2636
2637
|
}
|
|
2637
|
-
}, props
|
|
2638
|
+
}, props === null || props === void 0 || (_props$icon = props.icon) === null || _props$icon === void 0 ? void 0 : _props$icon.call(props)), /*#__PURE__*/React.createElement(Flex$1, {
|
|
2638
2639
|
gap: 2,
|
|
2639
2640
|
direction: "column",
|
|
2640
2641
|
css: {
|
|
@@ -2665,7 +2666,7 @@ const SingleTagBanner = props => {
|
|
|
2665
2666
|
onClick: e => {
|
|
2666
2667
|
e.preventDefault();
|
|
2667
2668
|
e.stopPropagation();
|
|
2668
|
-
props
|
|
2669
|
+
props === null || props === void 0 || props.onRemove();
|
|
2669
2670
|
},
|
|
2670
2671
|
closeCenter: !props.title && !props.link,
|
|
2671
2672
|
__self: undefined,
|
|
@@ -8425,7 +8426,7 @@ const InputTextArea = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
8425
8426
|
useEffect(() => {
|
|
8426
8427
|
if (textareaRef.current) {
|
|
8427
8428
|
textareaRef.current.style.height = '50px';
|
|
8428
|
-
const scrollHeight = textareaRef
|
|
8429
|
+
const scrollHeight = textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current.scrollHeight;
|
|
8429
8430
|
textareaRef.current.style.height = scrollHeight + 5 + 'px';
|
|
8430
8431
|
}
|
|
8431
8432
|
}, []);
|
|
@@ -8480,7 +8481,7 @@ const InputRadioContext = /*#__PURE__*/React__default.createContext();
|
|
|
8480
8481
|
var _jsxFileName$I = "/Users/galuhramadhan/projects/majoo-ui/packages/react/src/components/form/components/InputRadio/InputRadioGroup.js";
|
|
8481
8482
|
const RadioGroup = styled(RadioGroupPrimitive.Root, Flex$1);
|
|
8482
8483
|
function InputRadioGroup(props) {
|
|
8483
|
-
return (props
|
|
8484
|
+
return (props === null || props === void 0 ? void 0 : props.children) && /*#__PURE__*/React__default.createElement(InputRadioContext.Provider, {
|
|
8484
8485
|
value: props,
|
|
8485
8486
|
__self: this,
|
|
8486
8487
|
__source: {
|
|
@@ -8495,7 +8496,7 @@ function InputRadioGroup(props) {
|
|
|
8495
8496
|
lineNumber: 14,
|
|
8496
8497
|
columnNumber: 9
|
|
8497
8498
|
}
|
|
8498
|
-
}), React__default.Children.map(props
|
|
8499
|
+
}), React__default.Children.map(props === null || props === void 0 ? void 0 : props.children, child => /*#__PURE__*/React__default.cloneElement(child, {
|
|
8499
8500
|
style: Object.assign({}, child.props.style, {
|
|
8500
8501
|
opacity: 1
|
|
8501
8502
|
})
|
|
@@ -8683,8 +8684,9 @@ const InputRadio = _ref => {
|
|
|
8683
8684
|
return /*#__PURE__*/React__default.createElement(InputNumber, _extends({}, inputProps, {
|
|
8684
8685
|
readOnly: readOnly,
|
|
8685
8686
|
onFocus: () => {
|
|
8687
|
+
var _inputProps$onFocus;
|
|
8686
8688
|
onValueChange(props.value);
|
|
8687
|
-
inputProps
|
|
8689
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onFocus = inputProps.onFocus) === null || _inputProps$onFocus === void 0 || _inputProps$onFocus.call(inputProps);
|
|
8688
8690
|
},
|
|
8689
8691
|
asChild: true,
|
|
8690
8692
|
__self: this,
|
|
@@ -8699,8 +8701,9 @@ const InputRadio = _ref => {
|
|
|
8699
8701
|
disabled: disabled,
|
|
8700
8702
|
readOnly: readOnly,
|
|
8701
8703
|
onFocus: () => {
|
|
8704
|
+
var _inputProps$onFocus2;
|
|
8702
8705
|
onValueChange(props.value);
|
|
8703
|
-
inputProps
|
|
8706
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onFocus2 = inputProps.onFocus) === null || _inputProps$onFocus2 === void 0 || _inputProps$onFocus2.call(inputProps);
|
|
8704
8707
|
},
|
|
8705
8708
|
asChild: true,
|
|
8706
8709
|
__self: this,
|
|
@@ -10665,24 +10668,24 @@ var NumberFormat = /*@__PURE__*/function (superclass) {
|
|
|
10665
10668
|
allowLeadingZeros,
|
|
10666
10669
|
format
|
|
10667
10670
|
} = Object.assign({}, ref);
|
|
10668
|
-
const formattedValueStartsWithZero = (_formattedValue = formattedValue)
|
|
10669
|
-
const formattedWithZeroAndSuffix = (_formattedValue2 = formattedValue)
|
|
10671
|
+
const formattedValueStartsWithZero = (_formattedValue = formattedValue) === null || _formattedValue === void 0 ? void 0 : _formattedValue.startsWith(`${prefix}0`);
|
|
10672
|
+
const formattedWithZeroAndSuffix = (_formattedValue2 = formattedValue) === null || _formattedValue2 === void 0 ? void 0 : _formattedValue2.endsWith(`0${suffix}`);
|
|
10670
10673
|
const emptyFormattedValue = prefix || suffix || prefix + suffix || '';
|
|
10671
10674
|
if ((formattedValueStartsWithZero || formattedWithZeroAndSuffix) && !allowLeadingZeros && !format) {
|
|
10672
10675
|
var _formattedValue3, _input$value;
|
|
10673
10676
|
const isSpecialChar = /^[+-]/.test(formattedValue);
|
|
10674
|
-
if (formattedValue !== `${prefix}0${suffix}` && !((_formattedValue3 = formattedValue)
|
|
10677
|
+
if (formattedValue !== `${prefix}0${suffix}` && !((_formattedValue3 = formattedValue) !== null && _formattedValue3 !== void 0 && _formattedValue3.includes('0,'))) {
|
|
10675
10678
|
var _formattedValue4, _numAsString;
|
|
10676
|
-
formattedValue = (_formattedValue4 = formattedValue)
|
|
10677
|
-
numAsString = (_numAsString = numAsString)
|
|
10679
|
+
formattedValue = (_formattedValue4 = formattedValue) === null || _formattedValue4 === void 0 ? void 0 : _formattedValue4.replace(new RegExp(`^${isSpecialChar ? '\\' : ''}${prefix}0+${suffix}`), emptyFormattedValue);
|
|
10680
|
+
numAsString = (_numAsString = numAsString) === null || _numAsString === void 0 ? void 0 : _numAsString.replace(/^0+/, '');
|
|
10678
10681
|
}
|
|
10679
|
-
if (formattedValue === emptyFormattedValue && !numAsString && [`${prefix}00${suffix}`, `${prefix}0${suffix}`].includes(input
|
|
10682
|
+
if (formattedValue === emptyFormattedValue && !numAsString && [`${prefix}00${suffix}`, `${prefix}0${suffix}`].includes(input === null || input === void 0 ? void 0 : input.value)) {
|
|
10680
10683
|
formattedValue = `${prefix}0${suffix}`;
|
|
10681
10684
|
numAsString = '0';
|
|
10682
|
-
} else if (input
|
|
10685
|
+
} else if (input !== null && input !== void 0 && (_input$value = input.value) !== null && _input$value !== void 0 && _input$value.includes('0,')) {
|
|
10683
10686
|
allowLeadingZeros = true;
|
|
10684
|
-
formattedValue = input
|
|
10685
|
-
numAsString = this.removeFormatting(input
|
|
10687
|
+
formattedValue = input === null || input === void 0 ? void 0 : input.value;
|
|
10688
|
+
numAsString = this.removeFormatting(input === null || input === void 0 ? void 0 : input.value);
|
|
10686
10689
|
}
|
|
10687
10690
|
}
|
|
10688
10691
|
//end adjustment
|
|
@@ -11140,7 +11143,7 @@ function countThousandSeparatorsByLength(numberLength) {
|
|
|
11140
11143
|
}
|
|
11141
11144
|
function getMaxValueLength(maxValue, prefix = '', suffix = '', thousandSeparator) {
|
|
11142
11145
|
const tsLength = thousandSeparator ? countThousandSeparatorsByLength(maxValue) : 0;
|
|
11143
|
-
return maxValue + (prefix
|
|
11146
|
+
return maxValue + (prefix === null || prefix === void 0 ? void 0 : prefix.length) + (suffix === null || suffix === void 0 ? void 0 : suffix.length) + tsLength;
|
|
11144
11147
|
}
|
|
11145
11148
|
const InputNumber = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
11146
11149
|
let {
|
|
@@ -11192,9 +11195,9 @@ const InputNumber = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
11192
11195
|
size: size,
|
|
11193
11196
|
isInvalid: isInvalid,
|
|
11194
11197
|
readOnly: readOnly,
|
|
11195
|
-
isReadOnly: readOnly && !(props
|
|
11198
|
+
isReadOnly: readOnly && !(props !== null && props !== void 0 && props.inputGroup) && !(props !== null && props !== void 0 && props.asChild),
|
|
11196
11199
|
disabled: disabled,
|
|
11197
|
-
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props
|
|
11200
|
+
maxLength: maxValueLength ? getMaxValueLength(maxValueLength, props === null || props === void 0 ? void 0 : props.prefix, props === null || props === void 0 ? void 0 : props.suffix, thousandSeparator) : maxLength,
|
|
11198
11201
|
thousandSeparator: thousandSeparator
|
|
11199
11202
|
}, props, {
|
|
11200
11203
|
__self: undefined,
|
|
@@ -11498,16 +11501,16 @@ function TagsInput(_ref) {
|
|
|
11498
11501
|
const addTags = event => {
|
|
11499
11502
|
if (event.key === 'Enter' && event.target.value !== '' && max !== tags.length) {
|
|
11500
11503
|
if (tags.find(tag => tag.toLowerCase() === event.target.value.toLowerCase())) {
|
|
11501
|
-
onEnter
|
|
11504
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11502
11505
|
key: 'duplicate',
|
|
11503
11506
|
value: event.target.value
|
|
11504
11507
|
});
|
|
11505
11508
|
return;
|
|
11506
11509
|
}
|
|
11507
|
-
if (pattern && pattern
|
|
11510
|
+
if (pattern && pattern !== null && pattern !== void 0 && pattern.regex) {
|
|
11508
11511
|
const regex = new RegExp(pattern.regex);
|
|
11509
11512
|
if (!regex.test(event.target.value)) {
|
|
11510
|
-
onEnter
|
|
11513
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11511
11514
|
key: 'error',
|
|
11512
11515
|
value: event.target.value
|
|
11513
11516
|
});
|
|
@@ -11516,7 +11519,7 @@ function TagsInput(_ref) {
|
|
|
11516
11519
|
}
|
|
11517
11520
|
}
|
|
11518
11521
|
setRegexError(false);
|
|
11519
|
-
onEnter
|
|
11522
|
+
onEnter === null || onEnter === void 0 || onEnter({
|
|
11520
11523
|
key: 'success',
|
|
11521
11524
|
value: event.target.value
|
|
11522
11525
|
});
|
|
@@ -11528,7 +11531,7 @@ function TagsInput(_ref) {
|
|
|
11528
11531
|
if (disabled || readOnly) {
|
|
11529
11532
|
return tags;
|
|
11530
11533
|
} else if (key === 'removeTag' || key === 'Backspace') {
|
|
11531
|
-
onRemoveItem
|
|
11534
|
+
onRemoveItem === null || onRemoveItem === void 0 || onRemoveItem(tags[index]);
|
|
11532
11535
|
setTags([...tags.filter(tag => tags.indexOf(tag) !== index)]);
|
|
11533
11536
|
}
|
|
11534
11537
|
};
|
|
@@ -11579,7 +11582,7 @@ function TagsInput(_ref) {
|
|
|
11579
11582
|
lineNumber: 180,
|
|
11580
11583
|
columnNumber: 9
|
|
11581
11584
|
}
|
|
11582
|
-
})), regexError && pattern && (pattern
|
|
11585
|
+
})), regexError && pattern && (pattern !== null && pattern !== void 0 && pattern.errorMessage ? /*#__PURE__*/React__default.createElement(FormHelper, {
|
|
11583
11586
|
color: "red",
|
|
11584
11587
|
__self: this,
|
|
11585
11588
|
__source: {
|
|
@@ -11887,14 +11890,14 @@ const InputSearchbox = _ref => {
|
|
|
11887
11890
|
t
|
|
11888
11891
|
} = useTranslation(['MajooUI/inputSearchbox', 'translation']);
|
|
11889
11892
|
const [value, setValue] = useState(defaultValue);
|
|
11890
|
-
const inputValue = (_props$value = props
|
|
11891
|
-
const debounceChange = useCallback(debounce(e => onChange
|
|
11893
|
+
const inputValue = (_props$value = props === null || props === void 0 ? void 0 : props.value) != null ? _props$value : value;
|
|
11894
|
+
const debounceChange = useCallback(debounce(e => onChange === null || onChange === void 0 ? void 0 : onChange(e), 1000), [onChange]);
|
|
11892
11895
|
const handleChange = useCallback(e => {
|
|
11893
11896
|
setValue(e.target.value);
|
|
11894
11897
|
if (withDebounce) {
|
|
11895
11898
|
debounceChange(e.target.value);
|
|
11896
11899
|
} else {
|
|
11897
|
-
onChange
|
|
11900
|
+
onChange === null || onChange === void 0 || onChange(e.target.value);
|
|
11898
11901
|
}
|
|
11899
11902
|
}, [onChange, debounceChange, withDebounce]);
|
|
11900
11903
|
const handleClearButtonClick = e => {
|
|
@@ -11947,7 +11950,7 @@ const InputSearchbox = _ref => {
|
|
|
11947
11950
|
columnNumber: 7
|
|
11948
11951
|
}
|
|
11949
11952
|
})), /*#__PURE__*/React__default.createElement(InputRightElement, {
|
|
11950
|
-
children: (inputValue
|
|
11953
|
+
children: (inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) > 0 ? /*#__PURE__*/React__default.createElement(SvgCloseFilled, {
|
|
11951
11954
|
color: colors$7.iconSecondary,
|
|
11952
11955
|
__self: undefined,
|
|
11953
11956
|
__source: {
|
|
@@ -12192,7 +12195,7 @@ const Popover = ({
|
|
|
12192
12195
|
middleware: [offset(_sideOffset), shift$2(), _flip && flip()],
|
|
12193
12196
|
onOpenChange: isOpen => {
|
|
12194
12197
|
setOpenState(isOpen);
|
|
12195
|
-
!isOpen && (onClose
|
|
12198
|
+
!isOpen && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
12196
12199
|
},
|
|
12197
12200
|
placement
|
|
12198
12201
|
});
|
|
@@ -13991,13 +13994,13 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13991
13994
|
const isShowSelectAll = showSelectAll && !maxSelectedItem;
|
|
13992
13995
|
useEffect(() => {
|
|
13993
13996
|
var _scrollerRef$current;
|
|
13994
|
-
(_scrollerRef$current = scrollerRef.current)
|
|
13997
|
+
(_scrollerRef$current = scrollerRef.current) === null || _scrollerRef$current === void 0 || _scrollerRef$current.scrollTo({
|
|
13995
13998
|
top: 0
|
|
13996
13999
|
});
|
|
13997
14000
|
}, [query]);
|
|
13998
14001
|
useEffect(() => {
|
|
13999
|
-
if (defaultValue
|
|
14000
|
-
if (value
|
|
14002
|
+
if (defaultValue !== null && defaultValue !== void 0 && defaultValue.length) {
|
|
14003
|
+
if (value !== null && value !== void 0 && value.length) {
|
|
14001
14004
|
setInputSelectValue(value);
|
|
14002
14005
|
}
|
|
14003
14006
|
} else {
|
|
@@ -14062,7 +14065,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14062
14065
|
removeSelectedItem,
|
|
14063
14066
|
selectedItems
|
|
14064
14067
|
} = useMultipleSelection({
|
|
14065
|
-
selectedItems: selectedValue.length > 0 ? initItem
|
|
14068
|
+
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)) : []
|
|
14066
14069
|
});
|
|
14067
14070
|
const generateOptions = data => {
|
|
14068
14071
|
return data.map(option => {
|
|
@@ -14084,7 +14087,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14084
14087
|
};
|
|
14085
14088
|
const debouncedSearch = React__default.useRef(debounce(async query => {
|
|
14086
14089
|
setQuery(query);
|
|
14087
|
-
onSearch
|
|
14090
|
+
onSearch === null || onSearch === void 0 || onSearch(query);
|
|
14088
14091
|
}, 1000)).current;
|
|
14089
14092
|
React__default.useEffect(() => {
|
|
14090
14093
|
return () => {
|
|
@@ -14092,7 +14095,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14092
14095
|
};
|
|
14093
14096
|
}, [debouncedSearch]);
|
|
14094
14097
|
const handleInputValue = input => {
|
|
14095
|
-
onSearch
|
|
14098
|
+
onSearch === null || onSearch === void 0 || onSearch(input);
|
|
14096
14099
|
if (input === '') {
|
|
14097
14100
|
if (disabledOptions.length > 0) {
|
|
14098
14101
|
setItems(generateOptions(sortDisabled));
|
|
@@ -14100,9 +14103,9 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14100
14103
|
return setItems(sortValue);
|
|
14101
14104
|
}
|
|
14102
14105
|
} else {
|
|
14103
|
-
let filterItems = option
|
|
14104
|
-
var _item$name;
|
|
14105
|
-
return item
|
|
14106
|
+
let filterItems = option === null || option === void 0 ? void 0 : option.filter(item => {
|
|
14107
|
+
var _item$name, _item$name$includes, _input$toLocaleLowerC;
|
|
14108
|
+
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));
|
|
14106
14109
|
});
|
|
14107
14110
|
setItems(filterItems);
|
|
14108
14111
|
}
|
|
@@ -14111,10 +14114,10 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14111
14114
|
if (disabled || readOnly) {
|
|
14112
14115
|
return selectedValue;
|
|
14113
14116
|
} else {
|
|
14114
|
-
if ((selected
|
|
14117
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.id) === 'counter') {
|
|
14115
14118
|
setSelectedValue([]);
|
|
14116
14119
|
setInputSelectValue([]);
|
|
14117
|
-
onChange
|
|
14120
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14118
14121
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14119
14122
|
removeSelectedItem(selectedValue[i]);
|
|
14120
14123
|
}
|
|
@@ -14124,7 +14127,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14124
14127
|
setSelectedValue(filterItems);
|
|
14125
14128
|
setInputSelectValue(filterItems);
|
|
14126
14129
|
if (selected.id !== '!all') {
|
|
14127
|
-
onChange
|
|
14130
|
+
onChange === null || onChange === void 0 || onChange(filterItems);
|
|
14128
14131
|
}
|
|
14129
14132
|
}
|
|
14130
14133
|
}
|
|
@@ -14162,9 +14165,9 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14162
14165
|
if (selectedItem.id === '!all') {
|
|
14163
14166
|
items.forEach(item => {
|
|
14164
14167
|
var _item$children;
|
|
14165
|
-
if (item
|
|
14168
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
|
14166
14169
|
var _item$children2;
|
|
14167
|
-
item
|
|
14170
|
+
item === null || item === void 0 || (_item$children2 = item.children) === null || _item$children2 === void 0 || _item$children2.forEach(item => {
|
|
14168
14171
|
removeSelectedItem(item);
|
|
14169
14172
|
});
|
|
14170
14173
|
} else {
|
|
@@ -14173,7 +14176,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14173
14176
|
});
|
|
14174
14177
|
setSelectedValue([]);
|
|
14175
14178
|
setInputSelectValue([]);
|
|
14176
|
-
onChange
|
|
14179
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14177
14180
|
} else {
|
|
14178
14181
|
removeItem(selectedItem);
|
|
14179
14182
|
}
|
|
@@ -14184,9 +14187,9 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14184
14187
|
const itemIds = [];
|
|
14185
14188
|
items.forEach(item => {
|
|
14186
14189
|
var _item$children3;
|
|
14187
|
-
if (item
|
|
14190
|
+
if (item !== null && item !== void 0 && (_item$children3 = item.children) !== null && _item$children3 !== void 0 && _item$children3.length) {
|
|
14188
14191
|
var _item$children4;
|
|
14189
|
-
item
|
|
14192
|
+
item === null || item === void 0 || (_item$children4 = item.children) === null || _item$children4 === void 0 || _item$children4.forEach(item => {
|
|
14190
14193
|
addSelectedItem(item);
|
|
14191
14194
|
itemIds.push(item.id);
|
|
14192
14195
|
});
|
|
@@ -14198,16 +14201,16 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14198
14201
|
setSelectedValue(itemIds);
|
|
14199
14202
|
setInputSelectValue(itemIds);
|
|
14200
14203
|
// onChange?.(itemIds.slice(1).filter(id => !items.find(item => item.id === id)?.children?.length));
|
|
14201
|
-
onChange
|
|
14204
|
+
onChange === null || onChange === void 0 || onChange(itemIds.slice(1));
|
|
14202
14205
|
} else {
|
|
14203
14206
|
var _selectedItem$childre;
|
|
14204
14207
|
//start check if item have children (option group)
|
|
14205
|
-
if (selectedItem
|
|
14208
|
+
if (selectedItem !== null && selectedItem !== void 0 && (_selectedItem$childre = selectedItem.children) !== null && _selectedItem$childre !== void 0 && _selectedItem$childre.length) {
|
|
14206
14209
|
var _selectedItem$childre2;
|
|
14207
14210
|
const itemIdsSelect = [];
|
|
14208
14211
|
const itemIdsUnSelect = [];
|
|
14209
|
-
selectedItem
|
|
14210
|
-
if (selectedValue
|
|
14212
|
+
selectedItem === null || selectedItem === void 0 || (_selectedItem$childre2 = selectedItem.children) === null || _selectedItem$childre2 === void 0 || _selectedItem$childre2.forEach(item => {
|
|
14213
|
+
if (selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id)) {
|
|
14211
14214
|
removeSelectedItem(item);
|
|
14212
14215
|
itemIdsUnSelect.push(item.id);
|
|
14213
14216
|
} else {
|
|
@@ -14221,19 +14224,19 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14221
14224
|
setSelectedValue([...selectedValue, ...itemIdsSelect]);
|
|
14222
14225
|
setInputSelectValue([...selectedValue, ...itemIdsSelect]);
|
|
14223
14226
|
const _filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14224
|
-
onChange
|
|
14227
|
+
onChange === null || onChange === void 0 || onChange([..._filteredSelectedValues, ...itemIdsSelect]);
|
|
14225
14228
|
}
|
|
14226
14229
|
|
|
14227
14230
|
//unselect all child in one of the option groups
|
|
14228
14231
|
if (itemIdsUnSelect.length) {
|
|
14229
14232
|
const newSelectedValue = selectedValue.filter(selId => {
|
|
14230
14233
|
var _itemIdsUnSelect$filt;
|
|
14231
|
-
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId))
|
|
14234
|
+
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId)) === null || _itemIdsUnSelect$filt === void 0 ? void 0 : _itemIdsUnSelect$filt[0]) !== selId && selId;
|
|
14232
14235
|
});
|
|
14233
14236
|
setSelectedValue(newSelectedValue);
|
|
14234
14237
|
setInputSelectValue(newSelectedValue);
|
|
14235
14238
|
const _filteredSelectedValues2 = newSelectedValue.filter(val => val !== '!all');
|
|
14236
|
-
onChange
|
|
14239
|
+
onChange === null || onChange === void 0 || onChange(_filteredSelectedValues2);
|
|
14237
14240
|
}
|
|
14238
14241
|
return;
|
|
14239
14242
|
}
|
|
@@ -14250,7 +14253,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14250
14253
|
setSelectedValue([...selectedValue, selectedItem.id]);
|
|
14251
14254
|
setInputSelectValue([...selectedValue, selectedItem.id]);
|
|
14252
14255
|
const filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
14253
|
-
onChange
|
|
14256
|
+
onChange === null || onChange === void 0 || onChange([...filteredSelectedValues, selectedItem.id]);
|
|
14254
14257
|
}
|
|
14255
14258
|
selectItem(null);
|
|
14256
14259
|
}
|
|
@@ -14282,9 +14285,9 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14282
14285
|
}
|
|
14283
14286
|
}
|
|
14284
14287
|
});
|
|
14285
|
-
const getOption = useCallback(() => maxSelectedItem ? option
|
|
14286
|
-
const isMaxSelectedItem = maxSelectedItem && (selectedValue
|
|
14287
|
-
if (isMaxSelectedItem && !(selectedValue
|
|
14288
|
+
const getOption = useCallback(() => maxSelectedItem ? option === null || option === void 0 ? void 0 : option.map(item => {
|
|
14289
|
+
const isMaxSelectedItem = maxSelectedItem && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) >= maxSelectedItem;
|
|
14290
|
+
if (isMaxSelectedItem && !(selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id))) {
|
|
14288
14291
|
item.hideCheck = true;
|
|
14289
14292
|
item.isDisabled = true;
|
|
14290
14293
|
} else {
|
|
@@ -14293,7 +14296,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14293
14296
|
}
|
|
14294
14297
|
return item;
|
|
14295
14298
|
}) : option, [maxSelectedItem, option, selectedValue]);
|
|
14296
|
-
const itemsLength = items
|
|
14299
|
+
const itemsLength = items === null || items === void 0 ? void 0 : items.reduce((acc, item) => {
|
|
14297
14300
|
return [...acc, ...(item.children ? item.children : [item])];
|
|
14298
14301
|
}, []).length;
|
|
14299
14302
|
useEffect(() => {
|
|
@@ -14340,15 +14343,16 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14340
14343
|
}, [label, isOpen]);
|
|
14341
14344
|
const toggleCollapsible = () => setShowAllTags(!showAllTags);
|
|
14342
14345
|
const handleRemoveAllItem = () => {
|
|
14343
|
-
onChange
|
|
14346
|
+
onChange === null || onChange === void 0 || onChange([]);
|
|
14344
14347
|
setSelectedValue([]);
|
|
14345
14348
|
setInputSelectValue([]);
|
|
14346
14349
|
for (let i = 0; i < selectedValue.length; i++) {
|
|
14347
14350
|
removeSelectedItem(selectedValue[i]);
|
|
14348
14351
|
}
|
|
14349
14352
|
};
|
|
14350
|
-
const isShowTagSelectAll = showTagSelectAll && (selectedItems
|
|
14353
|
+
const isShowTagSelectAll = showTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > (option === null || option === void 0 ? void 0 : option.length);
|
|
14351
14354
|
const renderOptionItem = (item, index, asChild) => {
|
|
14355
|
+
var _item$render;
|
|
14352
14356
|
return /*#__PURE__*/React__default.createElement(ItemWrapper$1, _extends({
|
|
14353
14357
|
key: item.id
|
|
14354
14358
|
}, getItemProps({
|
|
@@ -14381,7 +14385,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14381
14385
|
lineNumber: 745,
|
|
14382
14386
|
columnNumber: 11
|
|
14383
14387
|
}
|
|
14384
|
-
}, !(item
|
|
14388
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
14385
14389
|
color: colors$8.iconDisable,
|
|
14386
14390
|
__self: undefined,
|
|
14387
14391
|
__source: {
|
|
@@ -14397,7 +14401,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14397
14401
|
lineNumber: 760,
|
|
14398
14402
|
columnNumber: 19
|
|
14399
14403
|
}
|
|
14400
|
-
})), isShowSelectAll && (item
|
|
14404
|
+
})), 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.createElement(IndeterminateFilled$1, {
|
|
14401
14405
|
__self: undefined,
|
|
14402
14406
|
__source: {
|
|
14403
14407
|
fileName: _jsxFileName$y,
|
|
@@ -14422,15 +14426,15 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14422
14426
|
lineNumber: 769,
|
|
14423
14427
|
columnNumber: 11
|
|
14424
14428
|
}
|
|
14425
|
-
}, item.render ? item.render
|
|
14429
|
+
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
14426
14430
|
};
|
|
14427
14431
|
let lastGroupIndex = showSelectAll ? 1 : 0;
|
|
14428
14432
|
const renderOptionGroupItem = (item, index) => {
|
|
14429
|
-
var _item$children5, _item$children6, _item$children7, _item$children8;
|
|
14433
|
+
var _item$children5, _item$children6, _item$children7, _item$render2, _item$children8;
|
|
14430
14434
|
// const groupIndex = (index > (showSelectAll ? 1 : 0)) ? lastGroupIndex : 0;
|
|
14431
14435
|
const groupIndex = lastGroupIndex;
|
|
14432
|
-
lastGroupIndex += ((item
|
|
14433
|
-
const filterSelectedChild = item
|
|
14436
|
+
lastGroupIndex += ((item === null || item === void 0 || (_item$children5 = item.children) === null || _item$children5 === void 0 ? void 0 : _item$children5.length) || 0) + 1;
|
|
14437
|
+
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);
|
|
14434
14438
|
return /*#__PURE__*/React__default.createElement(OptionGroupItem, {
|
|
14435
14439
|
item: /*#__PURE__*/React__default.createElement(ItemWrapper$1, _extends({
|
|
14436
14440
|
key: item.id
|
|
@@ -14463,7 +14467,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14463
14467
|
lineNumber: 799,
|
|
14464
14468
|
columnNumber: 15
|
|
14465
14469
|
}
|
|
14466
|
-
}, !(item
|
|
14470
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && item.isDisabled ? /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
14467
14471
|
color: colors$8.iconDisable,
|
|
14468
14472
|
__self: undefined,
|
|
14469
14473
|
__source: {
|
|
@@ -14471,7 +14475,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14471
14475
|
lineNumber: 809,
|
|
14472
14476
|
columnNumber: 19
|
|
14473
14477
|
}
|
|
14474
|
-
}) : (filterSelectedChild
|
|
14478
|
+
}) : (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.createElement(CheckOutline, {
|
|
14475
14479
|
color: colors$8.iconGreen,
|
|
14476
14480
|
__self: undefined,
|
|
14477
14481
|
__source: {
|
|
@@ -14479,7 +14483,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14479
14483
|
lineNumber: 811,
|
|
14480
14484
|
columnNumber: 19
|
|
14481
14485
|
}
|
|
14482
|
-
}) : (filterSelectedChild
|
|
14486
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) > 0 ? /*#__PURE__*/React__default.createElement(IndeterminateFilled$1, {
|
|
14483
14487
|
__self: undefined,
|
|
14484
14488
|
__source: {
|
|
14485
14489
|
fileName: _jsxFileName$y,
|
|
@@ -14497,14 +14501,14 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14497
14501
|
lineNumber: 816,
|
|
14498
14502
|
columnNumber: 15
|
|
14499
14503
|
}
|
|
14500
|
-
}, item.render ? item.render
|
|
14504
|
+
}, item.render ? (_item$render2 = item.render) === null || _item$render2 === void 0 ? void 0 : _item$render2.call(item, item.name) : item.name)),
|
|
14501
14505
|
__self: undefined,
|
|
14502
14506
|
__source: {
|
|
14503
14507
|
fileName: _jsxFileName$y,
|
|
14504
14508
|
lineNumber: 784,
|
|
14505
14509
|
columnNumber: 9
|
|
14506
14510
|
}
|
|
14507
|
-
}, item
|
|
14511
|
+
}, 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)));
|
|
14508
14512
|
};
|
|
14509
14513
|
return /*#__PURE__*/React__default.createElement(Wrapper$1, _extends({
|
|
14510
14514
|
css: css
|
|
@@ -14635,13 +14639,13 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14635
14639
|
lineNumber: 875,
|
|
14636
14640
|
columnNumber: 17
|
|
14637
14641
|
}
|
|
14638
|
-
}), selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')) : selectedItems
|
|
14642
|
+
}), 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) => {
|
|
14639
14643
|
if (showAllTags || !collapsible) {
|
|
14640
14644
|
return true;
|
|
14641
14645
|
} else {
|
|
14642
14646
|
return idx < 5;
|
|
14643
14647
|
}
|
|
14644
|
-
}))
|
|
14648
|
+
})) === null || _selectedItems$filter === void 0 ? void 0 : _selectedItems$filter.map((selectedItem, index) => /*#__PURE__*/React__default.createElement(Tag, _extends({
|
|
14645
14649
|
disabled: disabled,
|
|
14646
14650
|
isRemovable: readOnly || disabled || unremovableTags.includes(selectedItem.id) ? false : true,
|
|
14647
14651
|
size: "lg",
|
|
@@ -14666,7 +14670,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14666
14670
|
lineNumber: 904,
|
|
14667
14671
|
columnNumber: 21
|
|
14668
14672
|
}
|
|
14669
|
-
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems
|
|
14673
|
+
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > collapsibleLimit && /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
14670
14674
|
direction: "column",
|
|
14671
14675
|
gap: 4,
|
|
14672
14676
|
__self: undefined,
|
|
@@ -14752,7 +14756,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14752
14756
|
lineNumber: 947,
|
|
14753
14757
|
columnNumber: 19
|
|
14754
14758
|
}
|
|
14755
|
-
}, `${selectedItems
|
|
14759
|
+
}, `${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.createElement(Paragraph, {
|
|
14756
14760
|
css: {
|
|
14757
14761
|
fontSize: '$label',
|
|
14758
14762
|
marginTop: '$spacing-01'
|
|
@@ -14764,7 +14768,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14764
14768
|
lineNumber: 957,
|
|
14765
14769
|
columnNumber: 11
|
|
14766
14770
|
}
|
|
14767
|
-
}, `${selectedItems
|
|
14771
|
+
}, `${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.createElement(OptionWrapper$1, {
|
|
14768
14772
|
placement: placement,
|
|
14769
14773
|
css: {
|
|
14770
14774
|
display: isOpen && disabled === false ? 'block' : 'none',
|
|
@@ -14822,7 +14826,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14822
14826
|
}), /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
14823
14827
|
condition: !!fetchData && items.length > 0,
|
|
14824
14828
|
wrapper: child => /*#__PURE__*/React__default.createElement(InfiniteScroll, {
|
|
14825
|
-
loadMore: () => !isLoading && (fetchData
|
|
14829
|
+
loadMore: () => !isLoading && (fetchData === null || fetchData === void 0 ? void 0 : fetchData({
|
|
14826
14830
|
query
|
|
14827
14831
|
})),
|
|
14828
14832
|
hasMore: true,
|
|
@@ -14841,7 +14845,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14841
14845
|
lineNumber: 997,
|
|
14842
14846
|
columnNumber: 15
|
|
14843
14847
|
}
|
|
14844
|
-
}, isOpen && items.map((item, index) => item
|
|
14848
|
+
}, isOpen && items.map((item, index) => item !== null && item !== void 0 && item.children ? renderOptionGroupItem(item) : renderOptionItem(item, index)))) : /*#__PURE__*/React__default.createElement(Option, _extends({
|
|
14845
14849
|
css: {
|
|
14846
14850
|
height: 'auto'
|
|
14847
14851
|
}
|
|
@@ -17220,9 +17224,9 @@ const NativeTimePicker = ({
|
|
|
17220
17224
|
}
|
|
17221
17225
|
function handleInputChange(type, e) {
|
|
17222
17226
|
var _e$target;
|
|
17223
|
-
const value = e
|
|
17227
|
+
const value = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
|
|
17224
17228
|
const format = 'DD:MM:YYYY:HH:mm';
|
|
17225
|
-
const minLength = (value
|
|
17229
|
+
const minLength = (value === null || value === void 0 ? void 0 : value.length) > 1;
|
|
17226
17230
|
const hourValue = params => moment(moment(`${moment(date).format('DD:MM:YYYY:mm')}:${params}`, 'DD:MM:YYYY:mm:HH').toDate());
|
|
17227
17231
|
const minuteValue = params => moment(moment(`${moment(date).format('DD:MM:YYYY:HH')}:${params}`, 'DD:MM:YYYY:HH:mm').toDate());
|
|
17228
17232
|
if (!disabled) {
|
|
@@ -17913,7 +17917,10 @@ const CalendarTimePicker = ({
|
|
|
17913
17917
|
children: "Hingga Pukul"
|
|
17914
17918
|
}), void 0), jsx(InputTimePicker, {
|
|
17915
17919
|
onChange: val => {
|
|
17916
|
-
|
|
17920
|
+
const endDate = moment(endTime).format('YYYY-MM-DD');
|
|
17921
|
+
const newTime = val.format('HH:mm');
|
|
17922
|
+
const newValue = moment(`${endDate} ${newTime}`, 'YYYY-MM-DD HH:mm').toDate();
|
|
17923
|
+
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([selected[0], newValue]);
|
|
17917
17924
|
},
|
|
17918
17925
|
size: "sm",
|
|
17919
17926
|
value: endTime,
|
|
@@ -19185,11 +19192,15 @@ const CalendarRangePicker = _a => {
|
|
|
19185
19192
|
onSelectedDate === null || onSelectedDate === void 0 ? void 0 : onSelectedDate([selectedDate.date]);
|
|
19186
19193
|
} else {
|
|
19187
19194
|
if (new Date(dateValue[0]) > selectedDate.date) {
|
|
19188
|
-
|
|
19189
|
-
|
|
19195
|
+
const dateAsString = moment(dateValue[0]).format('YYYY-MM-DD');
|
|
19196
|
+
const newValue = [selectedDate.date, moment(`${dateAsString} 23:59`, 'YYYY-MM-DD HH:mm').toDate()];
|
|
19197
|
+
setDateValue(newValue);
|
|
19198
|
+
onSelectedDate === null || onSelectedDate === void 0 ? void 0 : onSelectedDate(newValue);
|
|
19190
19199
|
} else {
|
|
19191
|
-
|
|
19192
|
-
|
|
19200
|
+
const dateAsString = moment(selectedDate.date).format('YYYY-MM-DD');
|
|
19201
|
+
const newValue = [dateValue[0], moment(`${dateAsString} 23:59`, 'YYYY-MM-DD HH:mm').toDate()];
|
|
19202
|
+
setDateValue(newValue);
|
|
19203
|
+
onSelectedDate === null || onSelectedDate === void 0 ? void 0 : onSelectedDate(newValue);
|
|
19193
19204
|
}
|
|
19194
19205
|
}
|
|
19195
19206
|
};
|
|
@@ -19834,11 +19845,14 @@ function InputDatePicker({
|
|
|
19834
19845
|
options: (advanceOptions === null || advanceOptions === void 0 ? void 0 : advanceOptions.options) || options,
|
|
19835
19846
|
disabled: disabled,
|
|
19836
19847
|
optionHandler: value => {
|
|
19848
|
+
const reducedResult = advancePickerReducer(value, undefined);
|
|
19849
|
+
const dateAsString = moment(reducedResult[1]).format('YYYY-MM-DD');
|
|
19850
|
+
const payload = [reducedResult[0], moment(`${dateAsString} 23:59`, 'YYYY-MM-DD HH:mm').toDate()];
|
|
19837
19851
|
dispatch({
|
|
19838
19852
|
type: 'UPDATE',
|
|
19839
|
-
payload
|
|
19853
|
+
payload
|
|
19840
19854
|
});
|
|
19841
|
-
if (onChange) onChange(
|
|
19855
|
+
if (onChange) onChange(payload);
|
|
19842
19856
|
setOpenPicker(false);
|
|
19843
19857
|
}
|
|
19844
19858
|
}, void 0) : {
|
|
@@ -21062,7 +21076,7 @@ const NotificationBadge = _ref => {
|
|
|
21062
21076
|
};
|
|
21063
21077
|
};
|
|
21064
21078
|
const getValue = () => {
|
|
21065
|
-
let value = props
|
|
21079
|
+
let value = props === null || props === void 0 ? void 0 : props.value;
|
|
21066
21080
|
const isTrailing = variantIcon === 'trailing';
|
|
21067
21081
|
if (typeof value === 'number' || parseInt(value)) {
|
|
21068
21082
|
if (Math.sign(value) === 1 || Math.sign(value) === 0) {
|
|
@@ -21695,7 +21709,7 @@ const PaginationButton = ({
|
|
|
21695
21709
|
justify: "center",
|
|
21696
21710
|
onClick: () => {
|
|
21697
21711
|
var _dialogPageRef$curren;
|
|
21698
|
-
return (_dialogPageRef$curren = dialogPageRef.current)
|
|
21712
|
+
return (_dialogPageRef$curren = dialogPageRef.current) === null || _dialogPageRef$curren === void 0 ? void 0 : _dialogPageRef$curren.click();
|
|
21699
21713
|
},
|
|
21700
21714
|
__self: undefined,
|
|
21701
21715
|
__source: {
|
|
@@ -21773,7 +21787,7 @@ const PaginationButton = ({
|
|
|
21773
21787
|
onSubmit: () => {
|
|
21774
21788
|
var _dialogPageRef$curren2;
|
|
21775
21789
|
debouncedGoToPage(Number(goToPage));
|
|
21776
|
-
(_dialogPageRef$curren2 = dialogPageRef.current)
|
|
21790
|
+
(_dialogPageRef$curren2 = dialogPageRef.current) === null || _dialogPageRef$curren2 === void 0 || _dialogPageRef$curren2.click();
|
|
21777
21791
|
},
|
|
21778
21792
|
__self: undefined,
|
|
21779
21793
|
__source: {
|
|
@@ -21790,7 +21804,7 @@ const PaginationButton = ({
|
|
|
21790
21804
|
allowNegative: false,
|
|
21791
21805
|
onChange: e => {
|
|
21792
21806
|
var _e$target;
|
|
21793
|
-
return setGoToPage((_e$target = e.target)
|
|
21807
|
+
return setGoToPage((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
21794
21808
|
},
|
|
21795
21809
|
__self: undefined,
|
|
21796
21810
|
__source: {
|
|
@@ -21823,7 +21837,7 @@ const PaginationButton = ({
|
|
|
21823
21837
|
onClick: () => {
|
|
21824
21838
|
var _dialogPageRef$curren3;
|
|
21825
21839
|
setGoToPage(null);
|
|
21826
|
-
(_dialogPageRef$curren3 = dialogPageRef.current)
|
|
21840
|
+
(_dialogPageRef$curren3 = dialogPageRef.current) === null || _dialogPageRef$curren3 === void 0 || _dialogPageRef$curren3.click();
|
|
21827
21841
|
},
|
|
21828
21842
|
__self: undefined,
|
|
21829
21843
|
__source: {
|
|
@@ -21838,7 +21852,7 @@ const PaginationButton = ({
|
|
|
21838
21852
|
onClick: () => {
|
|
21839
21853
|
var _dialogPageRef$curren4;
|
|
21840
21854
|
debouncedGoToPage(Number(goToPage));
|
|
21841
|
-
(_dialogPageRef$curren4 = dialogPageRef.current)
|
|
21855
|
+
(_dialogPageRef$curren4 = dialogPageRef.current) === null || _dialogPageRef$curren4 === void 0 || _dialogPageRef$curren4.click();
|
|
21842
21856
|
},
|
|
21843
21857
|
__self: undefined,
|
|
21844
21858
|
__source: {
|
|
@@ -21927,7 +21941,7 @@ function PaginationInfo(_ref) {
|
|
|
21927
21941
|
onClick: () => {
|
|
21928
21942
|
if (isMobilePagination) {
|
|
21929
21943
|
var _dialogLimitRef$curre;
|
|
21930
|
-
(_dialogLimitRef$curre = dialogLimitRef.current)
|
|
21944
|
+
(_dialogLimitRef$curre = dialogLimitRef.current) === null || _dialogLimitRef$curre === void 0 || _dialogLimitRef$curre.click();
|
|
21931
21945
|
}
|
|
21932
21946
|
},
|
|
21933
21947
|
__self: this,
|
|
@@ -21973,7 +21987,7 @@ function PaginationInfo(_ref) {
|
|
|
21973
21987
|
lineNumber: 60,
|
|
21974
21988
|
columnNumber: 13
|
|
21975
21989
|
}
|
|
21976
|
-
}, limits
|
|
21990
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default.createElement(PopoverClose, {
|
|
21977
21991
|
key: limit,
|
|
21978
21992
|
css: limitItemContainerStyle(selectedLimit === limit),
|
|
21979
21993
|
onClick: () => onChange(limit),
|
|
@@ -22056,7 +22070,7 @@ function PaginationInfo(_ref) {
|
|
|
22056
22070
|
lineNumber: 100,
|
|
22057
22071
|
columnNumber: 11
|
|
22058
22072
|
}
|
|
22059
|
-
}, limits
|
|
22073
|
+
}, limits === null || limits === void 0 ? void 0 : limits.map(limit => /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
22060
22074
|
css: {
|
|
22061
22075
|
height: 44,
|
|
22062
22076
|
width: '100%',
|
|
@@ -22071,7 +22085,7 @@ function PaginationInfo(_ref) {
|
|
|
22071
22085
|
onClick: () => {
|
|
22072
22086
|
var _dialogLimitRef$curre2;
|
|
22073
22087
|
onChange(limit);
|
|
22074
|
-
(_dialogLimitRef$curre2 = dialogLimitRef.current)
|
|
22088
|
+
(_dialogLimitRef$curre2 = dialogLimitRef.current) === null || _dialogLimitRef$curre2 === void 0 || _dialogLimitRef$curre2.click();
|
|
22075
22089
|
},
|
|
22076
22090
|
__self: this,
|
|
22077
22091
|
__source: {
|
|
@@ -24193,7 +24207,7 @@ const rowMenuColumn = (options, icon, config) => ({
|
|
|
24193
24207
|
onClick: () => {
|
|
24194
24208
|
var _document$getElements;
|
|
24195
24209
|
setOpenDrop(true);
|
|
24196
|
-
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu'))
|
|
24210
|
+
const contextMenu = (_document$getElements = document.getElementsByClassName('react-contextmenu')) === null || _document$getElements === void 0 ? void 0 : _document$getElements[0];
|
|
24197
24211
|
contextMenu.style.opacity = 0;
|
|
24198
24212
|
},
|
|
24199
24213
|
__self: undefined,
|
|
@@ -24842,7 +24856,7 @@ const TemplateAlertFunction = props => {
|
|
|
24842
24856
|
if (!props.onOpenAutoFocus) {
|
|
24843
24857
|
e.preventDefault();
|
|
24844
24858
|
} else {
|
|
24845
|
-
props
|
|
24859
|
+
props === null || props === void 0 || props.onOpenAutoFocus();
|
|
24846
24860
|
}
|
|
24847
24861
|
},
|
|
24848
24862
|
__self: undefined,
|
|
@@ -24922,7 +24936,7 @@ const TemplateAlertFunction = props => {
|
|
|
24922
24936
|
}, props.description)), /*#__PURE__*/React__default.createElement(Box, {
|
|
24923
24937
|
css: {
|
|
24924
24938
|
width: '100%',
|
|
24925
|
-
display: props
|
|
24939
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
24926
24940
|
},
|
|
24927
24941
|
__self: undefined,
|
|
24928
24942
|
__source: {
|
|
@@ -24964,8 +24978,8 @@ const TemplateAlertFunction = props => {
|
|
|
24964
24978
|
size: props.btnSize,
|
|
24965
24979
|
onClick: buttonConfirm,
|
|
24966
24980
|
buttonType: props.dialogType,
|
|
24967
|
-
disabled: props
|
|
24968
|
-
}, props
|
|
24981
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
24982
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
24969
24983
|
__self: undefined,
|
|
24970
24984
|
__source: {
|
|
24971
24985
|
fileName: _jsxFileName$b,
|
|
@@ -24984,19 +24998,19 @@ const TemplateAlertFunction = props => {
|
|
|
24984
24998
|
size: props.btnSize,
|
|
24985
24999
|
onClick: buttonCancel,
|
|
24986
25000
|
css: {
|
|
24987
|
-
color: props.dialogType === 'negative' && !(props
|
|
25001
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
24988
25002
|
flex: props.isMobile && 1
|
|
24989
25003
|
},
|
|
24990
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
24991
|
-
disabled: props
|
|
24992
|
-
}, props
|
|
25004
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25005
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25006
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
24993
25007
|
__self: undefined,
|
|
24994
25008
|
__source: {
|
|
24995
25009
|
fileName: _jsxFileName$b,
|
|
24996
25010
|
lineNumber: 187,
|
|
24997
25011
|
columnNumber: 19
|
|
24998
25012
|
}
|
|
24999
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25013
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default.createElement(ADialog.Action, {
|
|
25000
25014
|
asChild: true,
|
|
25001
25015
|
__self: undefined,
|
|
25002
25016
|
__source: {
|
|
@@ -25011,8 +25025,8 @@ const TemplateAlertFunction = props => {
|
|
|
25011
25025
|
css: {
|
|
25012
25026
|
flex: props.isMobile && 1
|
|
25013
25027
|
},
|
|
25014
|
-
disabled: props
|
|
25015
|
-
}, props
|
|
25028
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25029
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25016
25030
|
__self: undefined,
|
|
25017
25031
|
__source: {
|
|
25018
25032
|
fileName: _jsxFileName$b,
|
|
@@ -25142,7 +25156,7 @@ function AlertDialog(props) {
|
|
|
25142
25156
|
}, props.description)), /*#__PURE__*/React__default.createElement(Box, {
|
|
25143
25157
|
css: {
|
|
25144
25158
|
width: '100%',
|
|
25145
|
-
display: props
|
|
25159
|
+
display: props !== null && props !== void 0 && props.singleButton && props !== null && props !== void 0 && props.hideActionButton ? 'none' : 'inherit'
|
|
25146
25160
|
},
|
|
25147
25161
|
__self: this,
|
|
25148
25162
|
__source: {
|
|
@@ -25187,8 +25201,8 @@ function AlertDialog(props) {
|
|
|
25187
25201
|
css: {
|
|
25188
25202
|
flex: props.isMobile && 1
|
|
25189
25203
|
},
|
|
25190
|
-
disabled: props
|
|
25191
|
-
}, props
|
|
25204
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25205
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25192
25206
|
__self: this,
|
|
25193
25207
|
__source: {
|
|
25194
25208
|
fileName: _jsxFileName$b,
|
|
@@ -25207,19 +25221,19 @@ function AlertDialog(props) {
|
|
|
25207
25221
|
size: props.btnSize,
|
|
25208
25222
|
onClick: props.onCancel,
|
|
25209
25223
|
css: {
|
|
25210
|
-
color: props.dialogType === 'negative' && !(props
|
|
25224
|
+
color: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) && '$textSecondary !important',
|
|
25211
25225
|
flex: props.isMobile && 1
|
|
25212
25226
|
},
|
|
25213
|
-
buttonType: props.dialogType === 'negative' && !(props
|
|
25214
|
-
disabled: props
|
|
25215
|
-
}, props
|
|
25227
|
+
buttonType: props.dialogType === 'negative' && !(props !== null && props !== void 0 && props.disabledButton) ? 'ghost-secondary' : 'ghost',
|
|
25228
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25229
|
+
}, props === null || props === void 0 ? void 0 : props.cancelButtonProps, {
|
|
25216
25230
|
__self: this,
|
|
25217
25231
|
__source: {
|
|
25218
25232
|
fileName: _jsxFileName$b,
|
|
25219
25233
|
lineNumber: 293,
|
|
25220
25234
|
columnNumber: 19
|
|
25221
25235
|
}
|
|
25222
|
-
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props
|
|
25236
|
+
}), props.labelCancel ? props.labelCancel : t('label.cancel', 'Batal'))), !(props !== null && props !== void 0 && props.hideActionButton) && /*#__PURE__*/React__default.createElement(ADialog.Action, {
|
|
25223
25237
|
asChild: true,
|
|
25224
25238
|
__self: this,
|
|
25225
25239
|
__source: {
|
|
@@ -25234,8 +25248,8 @@ function AlertDialog(props) {
|
|
|
25234
25248
|
css: {
|
|
25235
25249
|
flex: props.isMobile && 1
|
|
25236
25250
|
},
|
|
25237
|
-
disabled: props
|
|
25238
|
-
}, props
|
|
25251
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabledButton
|
|
25252
|
+
}, props === null || props === void 0 ? void 0 : props.actionButtonProps, {
|
|
25239
25253
|
__self: this,
|
|
25240
25254
|
__source: {
|
|
25241
25255
|
fileName: _jsxFileName$b,
|
|
@@ -27725,7 +27739,7 @@ const Upload = ({
|
|
|
27725
27739
|
upload({
|
|
27726
27740
|
url: action,
|
|
27727
27741
|
file: newFile,
|
|
27728
|
-
customBody: customBodyRequest
|
|
27742
|
+
customBody: customBodyRequest === null || customBodyRequest === void 0 ? void 0 : customBodyRequest(newFile),
|
|
27729
27743
|
token,
|
|
27730
27744
|
tokenKey,
|
|
27731
27745
|
reqKey,
|
|
@@ -27745,12 +27759,12 @@ const Upload = ({
|
|
|
27745
27759
|
arrProgress[i] = fileProgress;
|
|
27746
27760
|
}
|
|
27747
27761
|
}
|
|
27748
|
-
onChange
|
|
27762
|
+
onChange === null || onChange === void 0 || (_onChange = onChange({
|
|
27749
27763
|
fileList: arrProgress,
|
|
27750
27764
|
file: fileProgress,
|
|
27751
27765
|
indexReplace: indexReplace.current,
|
|
27752
27766
|
isReplace: indexReplace.current !== null
|
|
27753
|
-
}))
|
|
27767
|
+
})) === null || _onChange === void 0 || (_onChange = _onChange.then(() => setError(null))) === null || _onChange === void 0 || _onChange.catch(error => setError(error.message));
|
|
27754
27768
|
}
|
|
27755
27769
|
}).then(result => {
|
|
27756
27770
|
var _onChange2;
|
|
@@ -27763,12 +27777,12 @@ const Upload = ({
|
|
|
27763
27777
|
arrFile[i] = fileSuccess;
|
|
27764
27778
|
}
|
|
27765
27779
|
}
|
|
27766
|
-
onChange
|
|
27780
|
+
onChange === null || onChange === void 0 || (_onChange2 = onChange({
|
|
27767
27781
|
fileList: arrFile,
|
|
27768
27782
|
file: fileSuccess,
|
|
27769
27783
|
indexReplace: indexReplace.current,
|
|
27770
27784
|
isReplace: indexReplace.current !== null
|
|
27771
|
-
}))
|
|
27785
|
+
})) === null || _onChange2 === void 0 || (_onChange2 = _onChange2.then(() => setError(null))) === null || _onChange2 === void 0 || _onChange2.catch(error => setError(error.message));
|
|
27772
27786
|
}).catch(error => {
|
|
27773
27787
|
var _onChange3;
|
|
27774
27788
|
let fileError = Object.assign({}, newFile);
|
|
@@ -27780,21 +27794,21 @@ const Upload = ({
|
|
|
27780
27794
|
arrFile[i] = fileError;
|
|
27781
27795
|
}
|
|
27782
27796
|
}
|
|
27783
|
-
onChange
|
|
27797
|
+
onChange === null || onChange === void 0 || (_onChange3 = onChange({
|
|
27784
27798
|
fileList: arrFile,
|
|
27785
27799
|
file: fileError,
|
|
27786
27800
|
indexReplace: indexReplace.current,
|
|
27787
27801
|
isReplace: indexReplace.current !== null
|
|
27788
|
-
}))
|
|
27802
|
+
})) === null || _onChange3 === void 0 || (_onChange3 = _onChange3.then(() => setError(null))) === null || _onChange3 === void 0 || _onChange3.catch(error => setError(error.message));
|
|
27789
27803
|
});
|
|
27790
27804
|
} else {
|
|
27791
27805
|
var _onChange4;
|
|
27792
|
-
onChange
|
|
27806
|
+
onChange === null || onChange === void 0 || (_onChange4 = onChange({
|
|
27793
27807
|
fileList: arrFile,
|
|
27794
27808
|
file: newFile,
|
|
27795
27809
|
indexReplace: indexReplace.current,
|
|
27796
27810
|
isReplace: indexReplace.current !== null
|
|
27797
|
-
}))
|
|
27811
|
+
})) === null || _onChange4 === void 0 || (_onChange4 = _onChange4.then(() => setError(null))) === null || _onChange4 === void 0 || _onChange4.catch(error => setError(error.message));
|
|
27798
27812
|
}
|
|
27799
27813
|
if (indexReplace.current !== null) {
|
|
27800
27814
|
arrFile[indexReplace.current] = newFile;
|
|
@@ -27814,15 +27828,15 @@ const Upload = ({
|
|
|
27814
27828
|
// program to get the dimensions of an image
|
|
27815
27829
|
const img = document.createElement('img');
|
|
27816
27830
|
img.src = URL.createObjectURL(files[0]);
|
|
27817
|
-
img.size = files
|
|
27818
|
-
img.type = files
|
|
27831
|
+
img.size = files === null || files === void 0 || (_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.size;
|
|
27832
|
+
img.type = files === null || files === void 0 || (_files$2 = files[0]) === null || _files$2 === void 0 ? void 0 : _files$2.type;
|
|
27819
27833
|
img.onload = () => {
|
|
27820
27834
|
const imgRatio = img.width / img.height;
|
|
27821
27835
|
setAspect(ratio || imgRatio);
|
|
27822
27836
|
setCropperImgRatio(imgRatio);
|
|
27823
27837
|
if (onBeforeCrop) {
|
|
27824
27838
|
var _onBeforeCrop;
|
|
27825
|
-
onBeforeCrop
|
|
27839
|
+
onBeforeCrop === null || onBeforeCrop === void 0 || (_onBeforeCrop = onBeforeCrop(img)) === null || _onBeforeCrop === void 0 || (_onBeforeCrop = _onBeforeCrop.then(() => {
|
|
27826
27840
|
setError(null);
|
|
27827
27841
|
toggleModal();
|
|
27828
27842
|
setTimeout(() => {
|
|
@@ -27836,7 +27850,7 @@ const Upload = ({
|
|
|
27836
27850
|
}, 300);
|
|
27837
27851
|
setFileState(files[0]);
|
|
27838
27852
|
setPreviewImage(URL.createObjectURL(files[0]));
|
|
27839
|
-
}))
|
|
27853
|
+
})) === null || _onBeforeCrop === void 0 || _onBeforeCrop.catch(error => setError(error === null || error === void 0 ? void 0 : error.message));
|
|
27840
27854
|
} else {
|
|
27841
27855
|
toggleModal();
|
|
27842
27856
|
setTimeout(() => {
|
|
@@ -27854,18 +27868,18 @@ const Upload = ({
|
|
|
27854
27868
|
};
|
|
27855
27869
|
img.onerror = error => {
|
|
27856
27870
|
var _onBeforeCrop2;
|
|
27857
|
-
onBeforeCrop
|
|
27871
|
+
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));
|
|
27858
27872
|
};
|
|
27859
27873
|
}
|
|
27860
27874
|
}
|
|
27861
27875
|
}
|
|
27862
27876
|
function handleCrop() {
|
|
27863
|
-
if (completedCrop
|
|
27864
|
-
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState
|
|
27865
|
-
const sizeMB = (blob
|
|
27877
|
+
if (completedCrop !== null && completedCrop !== void 0 && completedCrop.width && completedCrop !== null && completedCrop !== void 0 && completedCrop.height && imgRef.current) {
|
|
27878
|
+
imgPreview(imgRef.current, completedCrop, 1, 0, ratio, fileState === null || fileState === void 0 ? void 0 : fileState.type).then(blob => {
|
|
27879
|
+
const sizeMB = (blob === null || blob === void 0 ? void 0 : blob.size) / 1024 / 1024;
|
|
27866
27880
|
if (sizeMB < maxSizeMB || sizeMB < 1 || !imageCompression) {
|
|
27867
|
-
const file = new File([blob], fileState
|
|
27868
|
-
type: blob
|
|
27881
|
+
const file = new File([blob], fileState === null || fileState === void 0 ? void 0 : fileState.name, {
|
|
27882
|
+
type: blob === null || blob === void 0 ? void 0 : blob.type
|
|
27869
27883
|
});
|
|
27870
27884
|
handleUpload([file]);
|
|
27871
27885
|
setCrop(null);
|
|
@@ -27879,16 +27893,16 @@ const Upload = ({
|
|
|
27879
27893
|
alwaysKeepResolution: true
|
|
27880
27894
|
}).then(compressedFile => {
|
|
27881
27895
|
var _fileState$name;
|
|
27882
|
-
const file = new File([compressedFile], (fileState
|
|
27883
|
-
type: compressedFile
|
|
27896
|
+
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', {
|
|
27897
|
+
type: compressedFile === null || compressedFile === void 0 ? void 0 : compressedFile.type
|
|
27884
27898
|
});
|
|
27885
27899
|
handleUpload([file]);
|
|
27886
27900
|
setCrop(null);
|
|
27887
27901
|
setCompletedCrop(null);
|
|
27888
|
-
}).catch(error => console.error(error
|
|
27902
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
27889
27903
|
}
|
|
27890
27904
|
toggleModal();
|
|
27891
|
-
}).catch(error => console.error(error
|
|
27905
|
+
}).catch(error => console.error(error === null || error === void 0 ? void 0 : error.message));
|
|
27892
27906
|
} else {
|
|
27893
27907
|
handleUpload([fileState]);
|
|
27894
27908
|
toggleModal();
|
|
@@ -27917,7 +27931,7 @@ const Upload = ({
|
|
|
27917
27931
|
const index = fileList.indexOf(file);
|
|
27918
27932
|
const newFileList = fileList.slice();
|
|
27919
27933
|
newFileList.splice(index, 1);
|
|
27920
|
-
onChange
|
|
27934
|
+
onChange === null || onChange === void 0 || onChange({
|
|
27921
27935
|
fileList: newFileList,
|
|
27922
27936
|
file
|
|
27923
27937
|
});
|
|
@@ -27940,14 +27954,14 @@ const Upload = ({
|
|
|
27940
27954
|
}
|
|
27941
27955
|
function handleOpenFile(file) {
|
|
27942
27956
|
var _String, _file$name;
|
|
27943
|
-
let extension = (_String = String(file
|
|
27957
|
+
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();
|
|
27944
27958
|
if (extension === 'pdf') {
|
|
27945
|
-
window.open(file
|
|
27959
|
+
window.open(file === null || file === void 0 ? void 0 : file.url);
|
|
27946
27960
|
} else {
|
|
27947
|
-
if (file
|
|
27961
|
+
if (file !== null && file !== void 0 && file.url) {
|
|
27948
27962
|
const link = document.createElement('a');
|
|
27949
27963
|
link.href = file.url;
|
|
27950
|
-
link.setAttribute('download', file
|
|
27964
|
+
link.setAttribute('download', file === null || file === void 0 ? void 0 : file.name);
|
|
27951
27965
|
document.body.appendChild(link);
|
|
27952
27966
|
link.click();
|
|
27953
27967
|
document.body.removeChild(link);
|
|
@@ -28009,12 +28023,12 @@ const Upload = ({
|
|
|
28009
28023
|
}, replaceLabel && replaceLabel.length > 0 ? replaceLabel : t('replaceLabel', 'Ubah Berkas')));
|
|
28010
28024
|
}
|
|
28011
28025
|
const renderPicture = () => {
|
|
28012
|
-
return fileList
|
|
28013
|
-
if ((item
|
|
28026
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28027
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28014
28028
|
return /*#__PURE__*/React__default.createElement(UploadProgress, {
|
|
28015
28029
|
key: index,
|
|
28016
|
-
progress: item
|
|
28017
|
-
loading: item
|
|
28030
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28031
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28018
28032
|
__self: undefined,
|
|
28019
28033
|
__source: {
|
|
28020
28034
|
fileName: _jsxFileName$9,
|
|
@@ -28087,13 +28101,13 @@ const Upload = ({
|
|
|
28087
28101
|
});
|
|
28088
28102
|
};
|
|
28089
28103
|
const renderFile = () => {
|
|
28090
|
-
return fileList
|
|
28104
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map((item, index) => {
|
|
28091
28105
|
var _item$name;
|
|
28092
|
-
if ((item
|
|
28106
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === 'uploading') {
|
|
28093
28107
|
return /*#__PURE__*/React__default.createElement(UploadProgress, {
|
|
28094
28108
|
key: index,
|
|
28095
|
-
progress: item
|
|
28096
|
-
loading: item
|
|
28109
|
+
progress: item === null || item === void 0 ? void 0 : item.percent,
|
|
28110
|
+
loading: item === null || item === void 0 ? void 0 : item.loading,
|
|
28097
28111
|
__self: undefined,
|
|
28098
28112
|
__source: {
|
|
28099
28113
|
fileName: _jsxFileName$9,
|
|
@@ -28159,7 +28173,7 @@ const Upload = ({
|
|
|
28159
28173
|
lineNumber: 666,
|
|
28160
28174
|
columnNumber: 17
|
|
28161
28175
|
}
|
|
28162
|
-
}, ".", item
|
|
28176
|
+
}, ".", item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.split('.').pop()), /*#__PURE__*/React__default.createElement(Tooltip$1, {
|
|
28163
28177
|
label: item.name,
|
|
28164
28178
|
__self: undefined,
|
|
28165
28179
|
__source: {
|
|
@@ -28529,7 +28543,7 @@ const Upload = ({
|
|
|
28529
28543
|
}
|
|
28530
28544
|
return /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
28531
28545
|
direction: "row",
|
|
28532
|
-
gap: (fileList
|
|
28546
|
+
gap: (fileList === null || fileList === void 0 ? void 0 : fileList.length) <= 1 && max === 1 ? 0 : 3,
|
|
28533
28547
|
wrap: "wrap",
|
|
28534
28548
|
css: {
|
|
28535
28549
|
userSelect: 'none'
|
|
@@ -29352,9 +29366,9 @@ const Separator$1 = styled('div', {
|
|
|
29352
29366
|
function InputColorPicker(props) {
|
|
29353
29367
|
const [isPopover, setIsPopover] = useState(false);
|
|
29354
29368
|
function getColor() {
|
|
29355
|
-
const color = props
|
|
29369
|
+
const color = props === null || props === void 0 ? void 0 : props.color;
|
|
29356
29370
|
if (typeof color === 'string') {
|
|
29357
|
-
return color
|
|
29371
|
+
return color === null || color === void 0 ? void 0 : color.toUpperCase();
|
|
29358
29372
|
}
|
|
29359
29373
|
return `rgba(${color.r},${color.g},${color.b},${color.a})`;
|
|
29360
29374
|
}
|
|
@@ -32373,7 +32387,7 @@ const Navigation = props => {
|
|
|
32373
32387
|
var _data;
|
|
32374
32388
|
const isActive = props.currentStep === i;
|
|
32375
32389
|
const isComplete = props.isComplete[i - 1];
|
|
32376
|
-
const isAdditional = (_data = data[i - 1])
|
|
32390
|
+
const isAdditional = (_data = data[i - 1]) === null || _data === void 0 ? void 0 : _data.additional;
|
|
32377
32391
|
const lastItem = navMobileItems.indexOf(data[i - 1]) + 1 === navMobileItems.length;
|
|
32378
32392
|
// eslint-disable-next-line no-lone-blocks
|
|
32379
32393
|
{
|
|
@@ -32388,7 +32402,7 @@ const Navigation = props => {
|
|
|
32388
32402
|
key: `step-${i}`,
|
|
32389
32403
|
onClick: () => {
|
|
32390
32404
|
var _data2;
|
|
32391
|
-
if (props.onNavClicked && !((_data2 = data[i - 1])
|
|
32405
|
+
if (props.onNavClicked && !((_data2 = data[i - 1]) !== null && _data2 !== void 0 && _data2.disabled) || isAdditional) props.onNavClicked(i);
|
|
32392
32406
|
if (!forbidClickNav && isComplete && !isHide || isAdditional) {
|
|
32393
32407
|
props.goToStep(i);
|
|
32394
32408
|
}
|
|
@@ -32421,9 +32435,9 @@ const Navigation = props => {
|
|
|
32421
32435
|
lineNumber: 176,
|
|
32422
32436
|
columnNumber: 17
|
|
32423
32437
|
}
|
|
32424
|
-
}), typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title = (_data3 = data[i - 1]).title)
|
|
32438
|
+
}), 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.createElement(Tooltip$1, {
|
|
32425
32439
|
align: "center",
|
|
32426
|
-
label: (_data5 = data[i - 1])
|
|
32440
|
+
label: (_data5 = data[i - 1]) === null || _data5 === void 0 ? void 0 : _data5.tooltipsContents,
|
|
32427
32441
|
__self: undefined,
|
|
32428
32442
|
__source: {
|
|
32429
32443
|
fileName: _jsxFileName$4,
|
|
@@ -32442,9 +32456,9 @@ const Navigation = props => {
|
|
|
32442
32456
|
lineNumber: 181,
|
|
32443
32457
|
columnNumber: 19
|
|
32444
32458
|
}
|
|
32445
|
-
})), ((_data6 = data[i - 1])
|
|
32459
|
+
})), ((_data6 = data[i - 1]) === null || _data6 === void 0 ? void 0 : _data6.comingSoon) && /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
32446
32460
|
css: {
|
|
32447
|
-
marginLeft: (_data7 = data[i - 1])
|
|
32461
|
+
marginLeft: (_data7 = data[i - 1]) !== null && _data7 !== void 0 && _data7.withTolltip ? 0 : '$spacing-03'
|
|
32448
32462
|
},
|
|
32449
32463
|
align: "center",
|
|
32450
32464
|
__self: undefined,
|
|
@@ -32495,10 +32509,10 @@ const Navigation = props => {
|
|
|
32495
32509
|
lineNumber: 198,
|
|
32496
32510
|
columnNumber: 21
|
|
32497
32511
|
}
|
|
32498
|
-
}, typeof data[i - 1].title === 'string' ? data[i - 1].title : (_data$title2 = (_data8 = data[i - 1]).title)
|
|
32512
|
+
}, 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.createElement(Tooltip$1, {
|
|
32499
32513
|
align: "center",
|
|
32500
32514
|
withClick: true,
|
|
32501
|
-
label: (_data10 = data[i - 1])
|
|
32515
|
+
label: (_data10 = data[i - 1]) === null || _data10 === void 0 ? void 0 : _data10.tooltipsContents,
|
|
32502
32516
|
__self: undefined,
|
|
32503
32517
|
__source: {
|
|
32504
32518
|
fileName: _jsxFileName$4,
|
|
@@ -32514,11 +32528,11 @@ const Navigation = props => {
|
|
|
32514
32528
|
lineNumber: 209,
|
|
32515
32529
|
columnNumber: 25
|
|
32516
32530
|
}
|
|
32517
|
-
})), ((_data11 = data[i - 1])
|
|
32531
|
+
})), ((_data11 = data[i - 1]) === null || _data11 === void 0 ? void 0 : _data11.comingSoon) && /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
32518
32532
|
align: "center",
|
|
32519
32533
|
justify: "center",
|
|
32520
32534
|
css: {
|
|
32521
|
-
marginTop: (_data12 = data[i - 1])
|
|
32535
|
+
marginTop: (_data12 = data[i - 1]) !== null && _data12 !== void 0 && _data12.withTolltip ? 0 : '$spacing-03'
|
|
32522
32536
|
},
|
|
32523
32537
|
__self: undefined,
|
|
32524
32538
|
__source: {
|
|
@@ -32542,7 +32556,7 @@ const Navigation = props => {
|
|
|
32542
32556
|
userSelect: 'none',
|
|
32543
32557
|
fontSize: '12px',
|
|
32544
32558
|
textAlign: '-webkit-center',
|
|
32545
|
-
display: ((_data13 = data[i - 1])
|
|
32559
|
+
display: ((_data13 = data[i - 1]) === null || _data13 === void 0 ? void 0 : _data13.disabled) && 'none',
|
|
32546
32560
|
marginTop: '$spacing-07',
|
|
32547
32561
|
flex: 1,
|
|
32548
32562
|
maxWidth: lastItem && 26
|
|
@@ -32622,7 +32636,7 @@ const Navigation = props => {
|
|
|
32622
32636
|
height: 24,
|
|
32623
32637
|
borderRadius: '$round',
|
|
32624
32638
|
border: `4px solid ${isActive ? '$bgGreen' : '$bgInactive'}`,
|
|
32625
|
-
backgroundColor: (_data14 = data[i - 1])
|
|
32639
|
+
backgroundColor: (_data14 = data[i - 1]) !== null && _data14 !== void 0 && _data14.disabled ? '$gray200' : '$white'
|
|
32626
32640
|
},
|
|
32627
32641
|
__self: undefined,
|
|
32628
32642
|
__source: {
|
|
@@ -32651,50 +32665,53 @@ const Navigation = props => {
|
|
|
32651
32665
|
}
|
|
32652
32666
|
return /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
32653
32667
|
condition: !isMobile,
|
|
32654
|
-
wrapper: child =>
|
|
32655
|
-
|
|
32656
|
-
|
|
32657
|
-
|
|
32658
|
-
|
|
32659
|
-
|
|
32660
|
-
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
|
|
32676
|
-
|
|
32677
|
-
|
|
32678
|
-
|
|
32679
|
-
|
|
32680
|
-
|
|
32681
|
-
|
|
32682
|
-
|
|
32683
|
-
|
|
32684
|
-
|
|
32685
|
-
|
|
32686
|
-
|
|
32687
|
-
|
|
32688
|
-
|
|
32689
|
-
|
|
32690
|
-
|
|
32691
|
-
|
|
32692
|
-
|
|
32693
|
-
|
|
32694
|
-
|
|
32695
|
-
|
|
32696
|
-
|
|
32697
|
-
|
|
32668
|
+
wrapper: child => {
|
|
32669
|
+
var _props$appendContent;
|
|
32670
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
32671
|
+
css: {
|
|
32672
|
+
opacity: isHide ? 0 : undefined,
|
|
32673
|
+
maxWidth: 311
|
|
32674
|
+
},
|
|
32675
|
+
__self: undefined,
|
|
32676
|
+
__source: {
|
|
32677
|
+
fileName: _jsxFileName$4,
|
|
32678
|
+
lineNumber: 281,
|
|
32679
|
+
columnNumber: 9
|
|
32680
|
+
}
|
|
32681
|
+
}, /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
32682
|
+
css: {
|
|
32683
|
+
position: !isMobile && 'sticky',
|
|
32684
|
+
top: !isMobile ? 44 : 40
|
|
32685
|
+
},
|
|
32686
|
+
direction: "column",
|
|
32687
|
+
gap: 7,
|
|
32688
|
+
__self: undefined,
|
|
32689
|
+
__source: {
|
|
32690
|
+
fileName: _jsxFileName$4,
|
|
32691
|
+
lineNumber: 282,
|
|
32692
|
+
columnNumber: 11
|
|
32693
|
+
}
|
|
32694
|
+
}, /*#__PURE__*/React__default.createElement(Card, {
|
|
32695
|
+
css: {
|
|
32696
|
+
height: 'fit-content',
|
|
32697
|
+
padding: 0
|
|
32698
|
+
},
|
|
32699
|
+
showBottomLine: false,
|
|
32700
|
+
__self: undefined,
|
|
32701
|
+
__source: {
|
|
32702
|
+
fileName: _jsxFileName$4,
|
|
32703
|
+
lineNumber: 283,
|
|
32704
|
+
columnNumber: 13
|
|
32705
|
+
}
|
|
32706
|
+
}, child), /*#__PURE__*/React__default.createElement(Box, {
|
|
32707
|
+
__self: undefined,
|
|
32708
|
+
__source: {
|
|
32709
|
+
fileName: _jsxFileName$4,
|
|
32710
|
+
lineNumber: 292,
|
|
32711
|
+
columnNumber: 13
|
|
32712
|
+
}
|
|
32713
|
+
}, 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)));
|
|
32714
|
+
},
|
|
32698
32715
|
__self: undefined,
|
|
32699
32716
|
__source: {
|
|
32700
32717
|
fileName: _jsxFileName$4,
|
|
@@ -32759,7 +32776,8 @@ const Default = props => {
|
|
|
32759
32776
|
}));
|
|
32760
32777
|
}, [props.hide]);
|
|
32761
32778
|
useEffect(() => {
|
|
32762
|
-
|
|
32779
|
+
var _props$onChangeVisibi;
|
|
32780
|
+
props === null || props === void 0 || (_props$onChangeVisibi = props.onChangeVisibility) === null || _props$onChangeVisibi === void 0 || _props$onChangeVisibi.call(props, state.hide);
|
|
32763
32781
|
}, [state.hide]);
|
|
32764
32782
|
const toogleVisibility = value => {
|
|
32765
32783
|
updateState(prev => Object.assign({}, prev, {
|
|
@@ -32768,11 +32786,11 @@ const Default = props => {
|
|
|
32768
32786
|
};
|
|
32769
32787
|
const getIsComplete = currentStep => {
|
|
32770
32788
|
var _state$isComplete;
|
|
32771
|
-
return state
|
|
32789
|
+
return state === null || state === void 0 || (_state$isComplete = state.isComplete) === null || _state$isComplete === void 0 ? void 0 : _state$isComplete[currentStep - 1];
|
|
32772
32790
|
};
|
|
32773
32791
|
const getTitleStep = currentStep => {
|
|
32774
32792
|
var _props$navContents;
|
|
32775
|
-
return props
|
|
32793
|
+
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;
|
|
32776
32794
|
};
|
|
32777
32795
|
const setState = value => {
|
|
32778
32796
|
updateState(Object.assign({}, state, value));
|
|
@@ -32806,13 +32824,13 @@ const Default = props => {
|
|
|
32806
32824
|
block: 'start'
|
|
32807
32825
|
});
|
|
32808
32826
|
props.onStepChange && props.onStepChange(e);
|
|
32809
|
-
if (props
|
|
32810
|
-
if ((e
|
|
32827
|
+
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) {
|
|
32828
|
+
if ((e === null || e === void 0 ? void 0 : e.activeStep) > (e === null || e === void 0 ? void 0 : e.previousStep)) {
|
|
32811
32829
|
var _state$SW;
|
|
32812
|
-
state
|
|
32830
|
+
state === null || state === void 0 || (_state$SW = state.SW) === null || _state$SW === void 0 || _state$SW.nextStep();
|
|
32813
32831
|
} else {
|
|
32814
32832
|
var _state$SW2;
|
|
32815
|
-
state
|
|
32833
|
+
state === null || state === void 0 || (_state$SW2 = state.SW) === null || _state$SW2 === void 0 || _state$SW2.previousStep();
|
|
32816
32834
|
}
|
|
32817
32835
|
}
|
|
32818
32836
|
};
|
|
@@ -32827,11 +32845,11 @@ const Default = props => {
|
|
|
32827
32845
|
}, /*#__PURE__*/React__default.createElement(StepWizardContext.Provider, {
|
|
32828
32846
|
value: {
|
|
32829
32847
|
toogleVisibility,
|
|
32830
|
-
isHide: state
|
|
32848
|
+
isHide: state === null || state === void 0 ? void 0 : state.hide,
|
|
32831
32849
|
setComplete,
|
|
32832
32850
|
setState,
|
|
32833
32851
|
state,
|
|
32834
|
-
SW: state
|
|
32852
|
+
SW: state === null || state === void 0 ? void 0 : state.SW,
|
|
32835
32853
|
forbidClickNav: props.forbidClickNav,
|
|
32836
32854
|
titles: props.titles,
|
|
32837
32855
|
isMobile: props.isMobile,
|
|
@@ -32854,7 +32872,7 @@ const Default = props => {
|
|
|
32854
32872
|
nav: /*#__PURE__*/React__default.createElement(Navigation, {
|
|
32855
32873
|
onNavClicked: props.onNavClicked,
|
|
32856
32874
|
isComplete: state.isComplete,
|
|
32857
|
-
appendContent: props
|
|
32875
|
+
appendContent: props === null || props === void 0 ? void 0 : props.appendContent,
|
|
32858
32876
|
__self: undefined,
|
|
32859
32877
|
__source: {
|
|
32860
32878
|
fileName: _jsxFileName$4,
|
|
@@ -32864,7 +32882,7 @@ const Default = props => {
|
|
|
32864
32882
|
}),
|
|
32865
32883
|
initialStep: props.initialStep,
|
|
32866
32884
|
onStepChange: handleStepChange,
|
|
32867
|
-
isLazyMount: props
|
|
32885
|
+
isLazyMount: props === null || props === void 0 ? void 0 : props.isLazyMount,
|
|
32868
32886
|
__self: undefined,
|
|
32869
32887
|
__source: {
|
|
32870
32888
|
fileName: _jsxFileName$4,
|
|
@@ -33011,9 +33029,9 @@ function Content({
|
|
|
33011
33029
|
var _getDatasets;
|
|
33012
33030
|
function getDatasets(content, activeId, isCollapse) {
|
|
33013
33031
|
const datasets = [];
|
|
33014
|
-
for (let i = 0; i < (content
|
|
33032
|
+
for (let i = 0; i < (content === null || content === void 0 ? void 0 : content.length); i++) {
|
|
33015
33033
|
var _content$i;
|
|
33016
|
-
if (((_content$i = content[i])
|
|
33034
|
+
if (((_content$i = content[i]) === null || _content$i === void 0 ? void 0 : _content$i.id) === activeId) {
|
|
33017
33035
|
datasets.unshift(content[i]);
|
|
33018
33036
|
} else {
|
|
33019
33037
|
datasets.push(content[i]);
|
|
@@ -33051,7 +33069,7 @@ function Content({
|
|
|
33051
33069
|
lineNumber: 107,
|
|
33052
33070
|
columnNumber: 7
|
|
33053
33071
|
}
|
|
33054
|
-
}, (_getDatasets = getDatasets(content, activeId, isCollapse))
|
|
33072
|
+
}, (_getDatasets = getDatasets(content, activeId, isCollapse)) === null || _getDatasets === void 0 ? void 0 : _getDatasets.map((item, index) => {
|
|
33055
33073
|
return /*#__PURE__*/React__default.createElement(List, {
|
|
33056
33074
|
key: index,
|
|
33057
33075
|
__self: this,
|
|
@@ -33068,11 +33086,11 @@ function Content({
|
|
|
33068
33086
|
marginLeft: '-4px !important',
|
|
33069
33087
|
borderLeftWidth: '4px !important',
|
|
33070
33088
|
borderLeftStyle: 'solid !important',
|
|
33071
|
-
borderLeftColor: `${(item
|
|
33089
|
+
borderLeftColor: `${(item === null || item === void 0 ? void 0 : item.id) === activeId ? colors$8.primary500 : 'transparent'} !important`,
|
|
33072
33090
|
paddingLeft: '16px !important',
|
|
33073
33091
|
minHeight: 25
|
|
33074
33092
|
},
|
|
33075
|
-
"data-to-scrollspy-id": item
|
|
33093
|
+
"data-to-scrollspy-id": item === null || item === void 0 ? void 0 : item.id,
|
|
33076
33094
|
__self: this,
|
|
33077
33095
|
__source: {
|
|
33078
33096
|
fileName: _jsxFileName$2,
|
|
@@ -33081,13 +33099,13 @@ function Content({
|
|
|
33081
33099
|
}
|
|
33082
33100
|
}, /*#__PURE__*/React__default.createElement(Title$1, {
|
|
33083
33101
|
className: "link-title",
|
|
33084
|
-
active: (item
|
|
33085
|
-
href: `#${item
|
|
33102
|
+
active: (item === null || item === void 0 ? void 0 : item.id) === activeId,
|
|
33103
|
+
href: `#${item === null || item === void 0 ? void 0 : item.id}`,
|
|
33086
33104
|
onClick: e => {
|
|
33087
33105
|
var _e$currentTarget, _e$currentTarget2;
|
|
33088
33106
|
e.preventDefault();
|
|
33089
|
-
onNavClick
|
|
33090
|
-
const target = window.document.getElementById(e
|
|
33107
|
+
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]);
|
|
33108
|
+
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]);
|
|
33091
33109
|
if (target) {
|
|
33092
33110
|
var headerOffset = 20;
|
|
33093
33111
|
var elementPosition = target.getBoundingClientRect().top;
|
|
@@ -33111,7 +33129,7 @@ function Content({
|
|
|
33111
33129
|
lineNumber: 125,
|
|
33112
33130
|
columnNumber: 17
|
|
33113
33131
|
}
|
|
33114
|
-
}, item
|
|
33132
|
+
}, item === null || item === void 0 ? void 0 : item.title), item === null || item === void 0 ? void 0 : item.icon));
|
|
33115
33133
|
})));
|
|
33116
33134
|
}
|
|
33117
33135
|
function TableOfContent({
|