@majoo-ui/react 1.58.8 → 1.58.9
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/components/editableTable/EditableMobile.d.ts +1 -0
- package/components/editableTable/EditableTable.d.ts +5 -0
- package/components/editableTable/faker.d.ts +16 -0
- package/components/form/components/InputSelectCheck/OptionGroupItem.d.ts +5 -0
- package/index.esm.js +548 -323
- package/index.umd.js +557 -331
- package/package.json +3 -2
package/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import React__default, { useState, useEffect, createContext, useContext, useRef,
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { createStitches, styled as styled$1 } from '@stitches/react';
|
|
5
5
|
import { foundations } from '@majoo-ui/core';
|
|
6
|
-
import { CloseOutline, UserFilled, CircleQuestionOutline, CircleInfoOutline, SearchOutline, CloseFilled, CaretDownOutline,
|
|
6
|
+
import { CloseOutline, UserFilled, CircleQuestionOutline, CircleInfoOutline, SearchOutline, CloseFilled, CaretDownOutline, ChevronDownOutline, ChevronUpOutline, CirclePlusOutline, SortingOutline, MinusOutline, PlusOutline, ChevronLeftOutline, ChevronRightOutline, TimeOutline, CalendarOutline, ChevronLgLeftOutline, ChevronLgRightOutline, ArrowLeftOutline, ArrowRightOutline, EllipsisHorizontalOutline, EyeOutline, UploadOutline, ImageOutline, ChevronUpDownOutline, CheckFilled, RemoveOutline, LocationOutline } from '@majoo-ui/icons';
|
|
7
7
|
import { Transition } from 'react-transition-group';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import { Portal } from '@majoo-ui/helpers';
|
|
@@ -45,6 +45,7 @@ import { Editor } from 'react-draft-wysiwyg';
|
|
|
45
45
|
import { ContextMenuTrigger as ContextMenuTrigger$1, ContextMenu as ContextMenu$1, MenuItem } from 'react-contextmenu';
|
|
46
46
|
import ReactSkeleton, { SkeletonTheme } from 'react-loading-skeleton';
|
|
47
47
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
48
|
+
import { useVirtual } from 'react-virtual';
|
|
48
49
|
import ScrollSpy from 'react-ui-scrollspy';
|
|
49
50
|
import ReactCrop, { centerCrop, makeAspectCrop } from 'react-image-crop';
|
|
50
51
|
import imageCompressionComponent from 'browser-image-compression';
|
|
@@ -12872,6 +12873,140 @@ const CheckOutline = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
|
12872
12873
|
}
|
|
12873
12874
|
}));
|
|
12874
12875
|
|
|
12876
|
+
const StyledAccordion = styled(AccordionPrimitive.Root, {});
|
|
12877
|
+
const Accordion = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
|
|
12878
|
+
var {
|
|
12879
|
+
children
|
|
12880
|
+
} = _a,
|
|
12881
|
+
props = __rest(_a, ["children"]);
|
|
12882
|
+
return jsx(StyledAccordion, Object.assign({
|
|
12883
|
+
ref: forwardedRef
|
|
12884
|
+
}, props, props.type === 'single' ? {
|
|
12885
|
+
collapsible: true
|
|
12886
|
+
} : {}, {
|
|
12887
|
+
children: children
|
|
12888
|
+
}), void 0);
|
|
12889
|
+
});
|
|
12890
|
+
const StyledItem$1 = styled(AccordionPrimitive.Item, {
|
|
12891
|
+
borderTop: '1px solid $colors$slate6',
|
|
12892
|
+
'&:last-of-type': {
|
|
12893
|
+
borderBottom: '1px solid $colors$slate6'
|
|
12894
|
+
}
|
|
12895
|
+
});
|
|
12896
|
+
const StyledHeader = styled(AccordionPrimitive.Header, {
|
|
12897
|
+
all: 'unset'
|
|
12898
|
+
});
|
|
12899
|
+
const StyledTrigger$1 = styled(AccordionPrimitive.Trigger, {
|
|
12900
|
+
all: 'unset',
|
|
12901
|
+
boxSizing: 'border-box',
|
|
12902
|
+
userSelect: 'none',
|
|
12903
|
+
'&::before': {
|
|
12904
|
+
boxSizing: 'border-box'
|
|
12905
|
+
},
|
|
12906
|
+
'&::after': {
|
|
12907
|
+
boxSizing: 'border-box'
|
|
12908
|
+
},
|
|
12909
|
+
cursor: 'pointer',
|
|
12910
|
+
display: 'flex',
|
|
12911
|
+
alignItems: 'center',
|
|
12912
|
+
color: '$hiContrast',
|
|
12913
|
+
width: '100%',
|
|
12914
|
+
'@hover': {
|
|
12915
|
+
'&:hover': {
|
|
12916
|
+
backgroundColor: '$slate2'
|
|
12917
|
+
}
|
|
12918
|
+
},
|
|
12919
|
+
'&:focus': {
|
|
12920
|
+
outline: 'none',
|
|
12921
|
+
boxShadow: 'inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8'
|
|
12922
|
+
},
|
|
12923
|
+
'& svg.icon-cdf': {
|
|
12924
|
+
color: '$white',
|
|
12925
|
+
size: '24px',
|
|
12926
|
+
transition: 'transform 175ms cubic-bezier(0.65, 0, 0.35, 1)'
|
|
12927
|
+
},
|
|
12928
|
+
'& svg.right': {
|
|
12929
|
+
marginRight: '$spacing-05'
|
|
12930
|
+
},
|
|
12931
|
+
'&[data-state="open"]': {
|
|
12932
|
+
'& svg.icon-cdf': {
|
|
12933
|
+
transform: 'rotate(180deg)'
|
|
12934
|
+
}
|
|
12935
|
+
},
|
|
12936
|
+
variants: {
|
|
12937
|
+
arrowPosition: {
|
|
12938
|
+
right: {
|
|
12939
|
+
justifyContent: 'space-between'
|
|
12940
|
+
},
|
|
12941
|
+
left: {
|
|
12942
|
+
justifyContent: 'start'
|
|
12943
|
+
}
|
|
12944
|
+
}
|
|
12945
|
+
}
|
|
12946
|
+
});
|
|
12947
|
+
const AccordionTrigger = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
|
|
12948
|
+
var {
|
|
12949
|
+
children,
|
|
12950
|
+
arrowPosition = 'right',
|
|
12951
|
+
hasContent = true,
|
|
12952
|
+
arrowColor = 'white'
|
|
12953
|
+
} = _a,
|
|
12954
|
+
props = __rest(_a, ["children", "arrowPosition", "hasContent", "arrowColor"]);
|
|
12955
|
+
return jsx(StyledHeader, {
|
|
12956
|
+
children: jsx(StyledTrigger$1, Object.assign({}, props, {
|
|
12957
|
+
arrowPosition: arrowPosition,
|
|
12958
|
+
ref: forwardedRef
|
|
12959
|
+
}, {
|
|
12960
|
+
children: arrowPosition === 'right' ? jsxs(Fragment, {
|
|
12961
|
+
children: [children, hasContent && jsx(ChevronDownOutline, {
|
|
12962
|
+
className: "icon-cdf right",
|
|
12963
|
+
color: arrowColor
|
|
12964
|
+
}, void 0)]
|
|
12965
|
+
}, void 0) : jsxs(Fragment, {
|
|
12966
|
+
children: [hasContent && jsx(ChevronDownOutline, {
|
|
12967
|
+
className: "icon-cdf left",
|
|
12968
|
+
color: arrowColor
|
|
12969
|
+
}, void 0), children]
|
|
12970
|
+
}, void 0)
|
|
12971
|
+
}), void 0)
|
|
12972
|
+
}, void 0);
|
|
12973
|
+
});
|
|
12974
|
+
const AccordionItem = StyledItem$1;
|
|
12975
|
+
const AccordionContent = AccordionPrimitive.Content;
|
|
12976
|
+
|
|
12977
|
+
const OptionGroup = styled(Flex$1, {
|
|
12978
|
+
position: 'relative'
|
|
12979
|
+
});
|
|
12980
|
+
const OptionItem = styled(Flex$1, {
|
|
12981
|
+
fontWeight: 600
|
|
12982
|
+
});
|
|
12983
|
+
const OptionChildren = styled(Box, {});
|
|
12984
|
+
const IconWrapper$1 = styled(Box, {
|
|
12985
|
+
position: 'absolute',
|
|
12986
|
+
top: 10,
|
|
12987
|
+
right: 0,
|
|
12988
|
+
cursor: 'pointer'
|
|
12989
|
+
});
|
|
12990
|
+
function OptionGroupItem({
|
|
12991
|
+
item,
|
|
12992
|
+
children
|
|
12993
|
+
}) {
|
|
12994
|
+
const [isShow, setIsShow] = useState(false);
|
|
12995
|
+
return jsxs(OptionGroup, Object.assign({
|
|
12996
|
+
direction: "column"
|
|
12997
|
+
}, {
|
|
12998
|
+
children: [jsxs(OptionItem, {
|
|
12999
|
+
children: [item, jsx(IconWrapper$1, Object.assign({
|
|
13000
|
+
onClick: () => setIsShow(!isShow)
|
|
13001
|
+
}, {
|
|
13002
|
+
children: isShow ? jsx(ChevronUpOutline, {}, void 0) : jsx(ChevronDownOutline, {}, void 0)
|
|
13003
|
+
}), void 0)]
|
|
13004
|
+
}, void 0), isShow && jsx(OptionChildren, {
|
|
13005
|
+
children: children
|
|
13006
|
+
}, void 0)]
|
|
13007
|
+
}), void 0);
|
|
13008
|
+
}
|
|
13009
|
+
|
|
12875
13010
|
const _excluded$c = ["placeholder", "option", "value", "defaultValue", "size", "disabled", "onChange", "search", "readOnly", "placement", "disabledOptions", "textEmptyItem", "onRemoveItem", "isInvalid", "sortBy", "showSelectAll", "showTagSelectAll", "selectAllLabel", "showSelectedTag", "unremovableTags", "helperText", "css", "showCounter", "labelCounter", "collapsible", "toggleInput", "fetchData", "onSearch", "isLoading", "maxSelectedItem"];
|
|
12876
13011
|
var _jsxFileName$w = "/Users/ryanakbar20/Documents/project/majoo/majoo-ui/packages/react/src/components/form/components/InputSelectCheck/InputSelectCheck.js";
|
|
12877
13012
|
const Wrapper$1 = styled('div', {
|
|
@@ -13104,7 +13239,7 @@ const IndeterminateFilled$1 = styled('div', {
|
|
|
13104
13239
|
alignItems: 'center'
|
|
13105
13240
|
});
|
|
13106
13241
|
const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
13107
|
-
var _selectedItems$filter, _selectedItems$filter2, _selectedItems$filter3, _selectedItems$filter4;
|
|
13242
|
+
var _initItem$reduce, _selectedItems$filter, _selectedItems$filter2, _selectedItems$filter3, _selectedItems$filter4;
|
|
13108
13243
|
let {
|
|
13109
13244
|
placeholder,
|
|
13110
13245
|
option,
|
|
@@ -13223,7 +13358,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13223
13358
|
removeSelectedItem,
|
|
13224
13359
|
selectedItems
|
|
13225
13360
|
} = useMultipleSelection({
|
|
13226
|
-
selectedItems: selectedValue.length > 0 ? initItem.filter(item => selectedValue.includes(item.id)) : []
|
|
13361
|
+
selectedItems: selectedValue.length > 0 ? initItem === null || initItem === void 0 ? 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)) : []
|
|
13227
13362
|
});
|
|
13228
13363
|
const generateOptions = data => {
|
|
13229
13364
|
return data.map(option => {
|
|
@@ -13301,7 +13436,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13301
13436
|
isOpen
|
|
13302
13437
|
} = useCombobox({
|
|
13303
13438
|
inputValue,
|
|
13304
|
-
items: items,
|
|
13439
|
+
items: items.reduce((acc, item) => [...acc, item, ...(item.children ? item.children : [])], []),
|
|
13305
13440
|
selectedItem: selectedValue,
|
|
13306
13441
|
itemToString: item => item ? item.name : '',
|
|
13307
13442
|
onStateChange: ({
|
|
@@ -13343,6 +13478,52 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13343
13478
|
setInputSelectValue(itemIds);
|
|
13344
13479
|
onChange === null || onChange === void 0 ? void 0 : onChange(itemIds.slice(1));
|
|
13345
13480
|
} else {
|
|
13481
|
+
var _selectedItem$childre;
|
|
13482
|
+
//start check if item have children (option group)
|
|
13483
|
+
if (selectedItem !== null && selectedItem !== void 0 && (_selectedItem$childre = selectedItem.children) !== null && _selectedItem$childre !== void 0 && _selectedItem$childre.length) {
|
|
13484
|
+
var _selectedItem$childre2;
|
|
13485
|
+
const itemIdsSelect = [];
|
|
13486
|
+
const itemIdsUnSelect = [];
|
|
13487
|
+
selectedItem === null || selectedItem === void 0 ? void 0 : (_selectedItem$childre2 = selectedItem.children) === null || _selectedItem$childre2 === void 0 ? void 0 : _selectedItem$childre2.forEach(item => {
|
|
13488
|
+
if (selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id)) {
|
|
13489
|
+
removeSelectedItem(item);
|
|
13490
|
+
itemIdsUnSelect.push(item.id);
|
|
13491
|
+
} else {
|
|
13492
|
+
addSelectedItem(item);
|
|
13493
|
+
itemIdsSelect.push(item.id);
|
|
13494
|
+
}
|
|
13495
|
+
});
|
|
13496
|
+
|
|
13497
|
+
//select all child in one of the option groups
|
|
13498
|
+
if (itemIdsSelect.length) {
|
|
13499
|
+
setSelectedValue([...selectedValue, ...itemIdsSelect]);
|
|
13500
|
+
setInputSelectValue([...selectedValue, ...itemIdsSelect]);
|
|
13501
|
+
const _filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
13502
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([..._filteredSelectedValues, ...itemIdsSelect]);
|
|
13503
|
+
}
|
|
13504
|
+
|
|
13505
|
+
//unselect all child in one of the option groups
|
|
13506
|
+
if (itemIdsUnSelect.length) {
|
|
13507
|
+
const newSelectedValue = selectedValue.filter(selId => {
|
|
13508
|
+
var _itemIdsUnSelect$filt;
|
|
13509
|
+
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId)) === null || _itemIdsUnSelect$filt === void 0 ? void 0 : _itemIdsUnSelect$filt[0]) !== selId && selId;
|
|
13510
|
+
});
|
|
13511
|
+
setSelectedValue(newSelectedValue);
|
|
13512
|
+
setInputSelectValue(newSelectedValue);
|
|
13513
|
+
const _filteredSelectedValues2 = newSelectedValue.filter(val => val !== '!all');
|
|
13514
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_filteredSelectedValues2);
|
|
13515
|
+
}
|
|
13516
|
+
return;
|
|
13517
|
+
}
|
|
13518
|
+
//end check if item have children (option group)
|
|
13519
|
+
|
|
13520
|
+
//start check the child from one of the option groups
|
|
13521
|
+
if (selectedValue.includes(selectedItem.id)) {
|
|
13522
|
+
removeItem(selectedItem);
|
|
13523
|
+
return;
|
|
13524
|
+
}
|
|
13525
|
+
//end check the child from one of the option groups
|
|
13526
|
+
|
|
13346
13527
|
addSelectedItem(selectedItem);
|
|
13347
13528
|
setSelectedValue([...selectedValue, selectedItem.id]);
|
|
13348
13529
|
setInputSelectValue([...selectedValue, selectedItem.id]);
|
|
@@ -13439,13 +13620,173 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13439
13620
|
}
|
|
13440
13621
|
};
|
|
13441
13622
|
const isShowTagSelectAll = showTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > (option === null || option === void 0 ? void 0 : option.length);
|
|
13623
|
+
const renderOptionItem = (item, index, asChild) => {
|
|
13624
|
+
var _item$render;
|
|
13625
|
+
return /*#__PURE__*/React__default.createElement(ItemWrapper$1, _extends({
|
|
13626
|
+
key: item.id
|
|
13627
|
+
}, getItemProps({
|
|
13628
|
+
item,
|
|
13629
|
+
index: index,
|
|
13630
|
+
disabled: item.isDisabled
|
|
13631
|
+
}), {
|
|
13632
|
+
css: {
|
|
13633
|
+
backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
|
|
13634
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer',
|
|
13635
|
+
color: item.isDisabled ? '$textDisable' : 'textPrimary',
|
|
13636
|
+
padding: asChild ? '0px $spacing-05' : 0
|
|
13637
|
+
},
|
|
13638
|
+
__self: undefined,
|
|
13639
|
+
__source: {
|
|
13640
|
+
fileName: _jsxFileName$w,
|
|
13641
|
+
lineNumber: 678,
|
|
13642
|
+
columnNumber: 9
|
|
13643
|
+
}
|
|
13644
|
+
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
13645
|
+
css: {
|
|
13646
|
+
width: '16px',
|
|
13647
|
+
height: '16px',
|
|
13648
|
+
border: '1px solid $bgBorder',
|
|
13649
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer'
|
|
13650
|
+
},
|
|
13651
|
+
__self: undefined,
|
|
13652
|
+
__source: {
|
|
13653
|
+
fileName: _jsxFileName$w,
|
|
13654
|
+
lineNumber: 692,
|
|
13655
|
+
columnNumber: 11
|
|
13656
|
+
}
|
|
13657
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
13658
|
+
color: colors$8.iconDisable,
|
|
13659
|
+
__self: undefined,
|
|
13660
|
+
__source: {
|
|
13661
|
+
fileName: _jsxFileName$w,
|
|
13662
|
+
lineNumber: 702,
|
|
13663
|
+
columnNumber: 17
|
|
13664
|
+
}
|
|
13665
|
+
}) : selectedValue.includes(item.id) && (item.isDisabled === false || item.isDisabled === undefined) && /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
13666
|
+
color: colors$8.iconGreen,
|
|
13667
|
+
__self: undefined,
|
|
13668
|
+
__source: {
|
|
13669
|
+
fileName: _jsxFileName$w,
|
|
13670
|
+
lineNumber: 706,
|
|
13671
|
+
columnNumber: 19
|
|
13672
|
+
}
|
|
13673
|
+
})), 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) < (items === null || items === void 0 ? void 0 : items.length) ? /*#__PURE__*/React__default.createElement(IndeterminateFilled$1, {
|
|
13674
|
+
__self: undefined,
|
|
13675
|
+
__source: {
|
|
13676
|
+
fileName: _jsxFileName$w,
|
|
13677
|
+
lineNumber: 713,
|
|
13678
|
+
columnNumber: 15
|
|
13679
|
+
}
|
|
13680
|
+
}, "-") : /*#__PURE__*/React__default.createElement("div", {
|
|
13681
|
+
__self: undefined,
|
|
13682
|
+
__source: {
|
|
13683
|
+
fileName: _jsxFileName$w,
|
|
13684
|
+
lineNumber: 715,
|
|
13685
|
+
columnNumber: 15
|
|
13686
|
+
}
|
|
13687
|
+
})), /*#__PURE__*/React__default.createElement(Item$3, {
|
|
13688
|
+
css: {
|
|
13689
|
+
backgroundColor: 'unset',
|
|
13690
|
+
width: '100%'
|
|
13691
|
+
},
|
|
13692
|
+
__self: undefined,
|
|
13693
|
+
__source: {
|
|
13694
|
+
fileName: _jsxFileName$w,
|
|
13695
|
+
lineNumber: 718,
|
|
13696
|
+
columnNumber: 11
|
|
13697
|
+
}
|
|
13698
|
+
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
13699
|
+
};
|
|
13700
|
+
let optionGroupIndex = showSelectAll ? 1 : 0;
|
|
13701
|
+
const renderOptionGroupItem = (item, index) => {
|
|
13702
|
+
var _item$children2, _item$children3, _item$children3$filte, _item$render2, _item$children4;
|
|
13703
|
+
if (index > showSelectAll ? 1 : 0) {
|
|
13704
|
+
var _item$children;
|
|
13705
|
+
optionGroupIndex += (item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) + 1;
|
|
13706
|
+
}
|
|
13707
|
+
const filterSelectedChild = item === null || item === void 0 ? void 0 : (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.filter(e => selectedValue.includes(e.id) && !e.isDisabled);
|
|
13708
|
+
return /*#__PURE__*/React__default.createElement(OptionGroupItem, {
|
|
13709
|
+
item: /*#__PURE__*/React__default.createElement(ItemWrapper$1, _extends({
|
|
13710
|
+
key: item.id
|
|
13711
|
+
}, getItemProps({
|
|
13712
|
+
item,
|
|
13713
|
+
index: optionGroupIndex,
|
|
13714
|
+
disabled: item.isDisabled
|
|
13715
|
+
}), {
|
|
13716
|
+
css: {
|
|
13717
|
+
backgroundColor: highlightedIndex === optionGroupIndex ? '$bgGray' : 'white',
|
|
13718
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer',
|
|
13719
|
+
color: item.isDisabled ? '$textDisable' : 'textPrimary'
|
|
13720
|
+
},
|
|
13721
|
+
__self: undefined,
|
|
13722
|
+
__source: {
|
|
13723
|
+
fileName: _jsxFileName$w,
|
|
13724
|
+
lineNumber: 735,
|
|
13725
|
+
columnNumber: 13
|
|
13726
|
+
}
|
|
13727
|
+
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
13728
|
+
css: {
|
|
13729
|
+
width: '16px',
|
|
13730
|
+
height: '16px',
|
|
13731
|
+
border: '1px solid $bgBorder',
|
|
13732
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer'
|
|
13733
|
+
},
|
|
13734
|
+
__self: undefined,
|
|
13735
|
+
__source: {
|
|
13736
|
+
fileName: _jsxFileName$w,
|
|
13737
|
+
lineNumber: 748,
|
|
13738
|
+
columnNumber: 15
|
|
13739
|
+
}
|
|
13740
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && item.isDisabled ? /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
13741
|
+
color: colors$8.iconDisable,
|
|
13742
|
+
__self: undefined,
|
|
13743
|
+
__source: {
|
|
13744
|
+
fileName: _jsxFileName$w,
|
|
13745
|
+
lineNumber: 757,
|
|
13746
|
+
columnNumber: 19
|
|
13747
|
+
}
|
|
13748
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) === (item === null || item === void 0 ? void 0 : (_item$children3 = item.children) === null || _item$children3 === void 0 ? void 0 : (_item$children3$filte = _item$children3.filter(e => !e.isDisabled)) === null || _item$children3$filte === void 0 ? void 0 : _item$children3$filte.length) ? /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
13749
|
+
color: colors$8.iconGreen,
|
|
13750
|
+
__self: undefined,
|
|
13751
|
+
__source: {
|
|
13752
|
+
fileName: _jsxFileName$w,
|
|
13753
|
+
lineNumber: 759,
|
|
13754
|
+
columnNumber: 19
|
|
13755
|
+
}
|
|
13756
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) > 0 ? /*#__PURE__*/React__default.createElement(IndeterminateFilled$1, {
|
|
13757
|
+
__self: undefined,
|
|
13758
|
+
__source: {
|
|
13759
|
+
fileName: _jsxFileName$w,
|
|
13760
|
+
lineNumber: 761,
|
|
13761
|
+
columnNumber: 19
|
|
13762
|
+
}
|
|
13763
|
+
}, "-") : null), /*#__PURE__*/React__default.createElement(Item$3, {
|
|
13764
|
+
css: {
|
|
13765
|
+
backgroundColor: 'unset',
|
|
13766
|
+
width: '100%'
|
|
13767
|
+
},
|
|
13768
|
+
__self: undefined,
|
|
13769
|
+
__source: {
|
|
13770
|
+
fileName: _jsxFileName$w,
|
|
13771
|
+
lineNumber: 764,
|
|
13772
|
+
columnNumber: 15
|
|
13773
|
+
}
|
|
13774
|
+
}, item.render ? (_item$render2 = item.render) === null || _item$render2 === void 0 ? void 0 : _item$render2.call(item, item.name) : item.name)),
|
|
13775
|
+
__self: undefined,
|
|
13776
|
+
__source: {
|
|
13777
|
+
fileName: _jsxFileName$w,
|
|
13778
|
+
lineNumber: 733,
|
|
13779
|
+
columnNumber: 9
|
|
13780
|
+
}
|
|
13781
|
+
}, item === null || item === void 0 ? void 0 : (_item$children4 = item.children) === null || _item$children4 === void 0 ? void 0 : _item$children4.map((optItem, optIndex) => renderOptionItem(optItem, optionGroupIndex + optIndex + 1, true)));
|
|
13782
|
+
};
|
|
13442
13783
|
return /*#__PURE__*/React__default.createElement(Wrapper$1, _extends({
|
|
13443
13784
|
css: css
|
|
13444
13785
|
}, props, {
|
|
13445
13786
|
__self: undefined,
|
|
13446
13787
|
__source: {
|
|
13447
13788
|
fileName: _jsxFileName$w,
|
|
13448
|
-
lineNumber:
|
|
13789
|
+
lineNumber: 776,
|
|
13449
13790
|
columnNumber: 7
|
|
13450
13791
|
}
|
|
13451
13792
|
}), /*#__PURE__*/React__default.createElement(Select, {
|
|
@@ -13455,7 +13796,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13455
13796
|
__self: undefined,
|
|
13456
13797
|
__source: {
|
|
13457
13798
|
fileName: _jsxFileName$w,
|
|
13458
|
-
lineNumber:
|
|
13799
|
+
lineNumber: 777,
|
|
13459
13800
|
columnNumber: 9
|
|
13460
13801
|
}
|
|
13461
13802
|
}, /*#__PURE__*/React__default.createElement(InputWrapper$1, _extends({}, getComboboxProps(getDropdownProps({
|
|
@@ -13470,7 +13811,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13470
13811
|
__self: undefined,
|
|
13471
13812
|
__source: {
|
|
13472
13813
|
fileName: _jsxFileName$w,
|
|
13473
|
-
lineNumber:
|
|
13814
|
+
lineNumber: 778,
|
|
13474
13815
|
columnNumber: 11
|
|
13475
13816
|
}
|
|
13476
13817
|
}), /*#__PURE__*/React__default.createElement(Input$6, _extends({}, getInputProps({
|
|
@@ -13488,7 +13829,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13488
13829
|
__self: undefined,
|
|
13489
13830
|
__source: {
|
|
13490
13831
|
fileName: _jsxFileName$w,
|
|
13491
|
-
lineNumber:
|
|
13832
|
+
lineNumber: 788,
|
|
13492
13833
|
columnNumber: 13
|
|
13493
13834
|
}
|
|
13494
13835
|
})), /*#__PURE__*/React__default.createElement(Button$2, _extends({}, getToggleButtonProps({
|
|
@@ -13501,7 +13842,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13501
13842
|
__self: undefined,
|
|
13502
13843
|
__source: {
|
|
13503
13844
|
fileName: _jsxFileName$w,
|
|
13504
|
-
lineNumber:
|
|
13845
|
+
lineNumber: 795,
|
|
13505
13846
|
columnNumber: 13
|
|
13506
13847
|
}
|
|
13507
13848
|
}), placeholder != null ? placeholder : t('placeholder', 'Pilih Item'))), /*#__PURE__*/React__default.createElement(IconWrapper, _extends({}, getToggleButtonProps({
|
|
@@ -13512,7 +13853,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13512
13853
|
__self: undefined,
|
|
13513
13854
|
__source: {
|
|
13514
13855
|
fileName: _jsxFileName$w,
|
|
13515
|
-
lineNumber:
|
|
13856
|
+
lineNumber: 805,
|
|
13516
13857
|
columnNumber: 11
|
|
13517
13858
|
}
|
|
13518
13859
|
}), /*#__PURE__*/React__default.createElement(IconCaretDown, {
|
|
@@ -13520,7 +13861,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13520
13861
|
__self: undefined,
|
|
13521
13862
|
__source: {
|
|
13522
13863
|
fileName: _jsxFileName$w,
|
|
13523
|
-
lineNumber:
|
|
13864
|
+
lineNumber: 810,
|
|
13524
13865
|
columnNumber: 13
|
|
13525
13866
|
}
|
|
13526
13867
|
}))), helperText && /*#__PURE__*/React__default.createElement(Paragraph, {
|
|
@@ -13533,7 +13874,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13533
13874
|
__self: undefined,
|
|
13534
13875
|
__source: {
|
|
13535
13876
|
fileName: _jsxFileName$w,
|
|
13536
|
-
lineNumber:
|
|
13877
|
+
lineNumber: 814,
|
|
13537
13878
|
columnNumber: 11
|
|
13538
13879
|
}
|
|
13539
13880
|
}, helperText), showSelectedTag && !showCounter && selectedItems.length !== 0 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TagWrapper$2, {
|
|
@@ -13541,7 +13882,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13541
13882
|
__self: undefined,
|
|
13542
13883
|
__source: {
|
|
13543
13884
|
fileName: _jsxFileName$w,
|
|
13544
|
-
lineNumber:
|
|
13885
|
+
lineNumber: 820,
|
|
13545
13886
|
columnNumber: 13
|
|
13546
13887
|
}
|
|
13547
13888
|
}, isShowTagSelectAll ? /*#__PURE__*/React__default.createElement(Tag, _extends({
|
|
@@ -13561,7 +13902,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13561
13902
|
__self: undefined,
|
|
13562
13903
|
__source: {
|
|
13563
13904
|
fileName: _jsxFileName$w,
|
|
13564
|
-
lineNumber:
|
|
13905
|
+
lineNumber: 822,
|
|
13565
13906
|
columnNumber: 17
|
|
13566
13907
|
}
|
|
13567
13908
|
}), selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')) : selectedItems === null || selectedItems === void 0 ? void 0 : (_selectedItems$filter = selectedItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== '!all')) === null || _selectedItems$filter === void 0 ? void 0 : (_selectedItems$filter2 = _selectedItems$filter.filter((_, idx) => {
|
|
@@ -13591,7 +13932,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13591
13932
|
__self: undefined,
|
|
13592
13933
|
__source: {
|
|
13593
13934
|
fileName: _jsxFileName$w,
|
|
13594
|
-
lineNumber:
|
|
13935
|
+
lineNumber: 850,
|
|
13595
13936
|
columnNumber: 21
|
|
13596
13937
|
}
|
|
13597
13938
|
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > 5 && /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
@@ -13600,7 +13941,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13600
13941
|
__self: undefined,
|
|
13601
13942
|
__source: {
|
|
13602
13943
|
fileName: _jsxFileName$w,
|
|
13603
|
-
lineNumber:
|
|
13944
|
+
lineNumber: 872,
|
|
13604
13945
|
columnNumber: 15
|
|
13605
13946
|
}
|
|
13606
13947
|
}, /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
@@ -13610,14 +13951,14 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13610
13951
|
__self: undefined,
|
|
13611
13952
|
__source: {
|
|
13612
13953
|
fileName: _jsxFileName$w,
|
|
13613
|
-
lineNumber:
|
|
13954
|
+
lineNumber: 873,
|
|
13614
13955
|
columnNumber: 17
|
|
13615
13956
|
}
|
|
13616
13957
|
}, /*#__PURE__*/React__default.createElement(Separator$2, {
|
|
13617
13958
|
__self: undefined,
|
|
13618
13959
|
__source: {
|
|
13619
13960
|
fileName: _jsxFileName$w,
|
|
13620
|
-
lineNumber:
|
|
13961
|
+
lineNumber: 874,
|
|
13621
13962
|
columnNumber: 19
|
|
13622
13963
|
}
|
|
13623
13964
|
}), /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
@@ -13631,7 +13972,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13631
13972
|
__self: undefined,
|
|
13632
13973
|
__source: {
|
|
13633
13974
|
fileName: _jsxFileName$w,
|
|
13634
|
-
lineNumber:
|
|
13975
|
+
lineNumber: 875,
|
|
13635
13976
|
columnNumber: 19
|
|
13636
13977
|
}
|
|
13637
13978
|
}, showAllTags ? /*#__PURE__*/React__default.createElement(ChevronUpOutline, {
|
|
@@ -13639,7 +13980,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13639
13980
|
__self: undefined,
|
|
13640
13981
|
__source: {
|
|
13641
13982
|
fileName: _jsxFileName$w,
|
|
13642
|
-
lineNumber:
|
|
13983
|
+
lineNumber: 881,
|
|
13643
13984
|
columnNumber: 23
|
|
13644
13985
|
}
|
|
13645
13986
|
}) : /*#__PURE__*/React__default.createElement(ChevronDownOutline, {
|
|
@@ -13647,7 +13988,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13647
13988
|
__self: undefined,
|
|
13648
13989
|
__source: {
|
|
13649
13990
|
fileName: _jsxFileName$w,
|
|
13650
|
-
lineNumber:
|
|
13991
|
+
lineNumber: 883,
|
|
13651
13992
|
columnNumber: 23
|
|
13652
13993
|
}
|
|
13653
13994
|
}), /*#__PURE__*/React__default.createElement(Paragraph, {
|
|
@@ -13659,14 +14000,14 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13659
14000
|
__self: undefined,
|
|
13660
14001
|
__source: {
|
|
13661
14002
|
fileName: _jsxFileName$w,
|
|
13662
|
-
lineNumber:
|
|
14003
|
+
lineNumber: 885,
|
|
13663
14004
|
columnNumber: 21
|
|
13664
14005
|
}
|
|
13665
14006
|
}, showAllTags ? t('showSomeText', 'Tampilkan Sebagian') : t('showAllText', 'Tampilkan Semua'))), /*#__PURE__*/React__default.createElement(Separator$2, {
|
|
13666
14007
|
__self: undefined,
|
|
13667
14008
|
__source: {
|
|
13668
14009
|
fileName: _jsxFileName$w,
|
|
13669
|
-
lineNumber:
|
|
14010
|
+
lineNumber: 889,
|
|
13670
14011
|
columnNumber: 19
|
|
13671
14012
|
}
|
|
13672
14013
|
})), /*#__PURE__*/React__default.createElement(Paragraph, {
|
|
@@ -13677,7 +14018,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13677
14018
|
__self: undefined,
|
|
13678
14019
|
__source: {
|
|
13679
14020
|
fileName: _jsxFileName$w,
|
|
13680
|
-
lineNumber:
|
|
14021
|
+
lineNumber: 891,
|
|
13681
14022
|
columnNumber: 17
|
|
13682
14023
|
}
|
|
13683
14024
|
}, `${selectedItems === null || selectedItems === void 0 ? 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')}`))), showCounter && !isShowTagSelectAll && Boolean(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) && /*#__PURE__*/React__default.createElement(Paragraph, {
|
|
@@ -13689,7 +14030,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13689
14030
|
__self: undefined,
|
|
13690
14031
|
__source: {
|
|
13691
14032
|
fileName: _jsxFileName$w,
|
|
13692
|
-
lineNumber:
|
|
14033
|
+
lineNumber: 901,
|
|
13693
14034
|
columnNumber: 11
|
|
13694
14035
|
}
|
|
13695
14036
|
}, `${selectedItems === null || selectedItems === void 0 ? void 0 : (_selectedItems$filter4 = selectedItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== '!all')) === null || _selectedItems$filter4 === void 0 ? void 0 : _selectedItems$filter4.length} ${labelCounter || t('labelCounterText', 'Item terpilih')}`), /*#__PURE__*/React__default.createElement(OptionWrapper$1, {
|
|
@@ -13702,7 +14043,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13702
14043
|
__self: undefined,
|
|
13703
14044
|
__source: {
|
|
13704
14045
|
fileName: _jsxFileName$w,
|
|
13705
|
-
lineNumber:
|
|
14046
|
+
lineNumber: 908,
|
|
13706
14047
|
columnNumber: 9
|
|
13707
14048
|
}
|
|
13708
14049
|
}, isLoading && /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
@@ -13724,7 +14065,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13724
14065
|
__self: undefined,
|
|
13725
14066
|
__source: {
|
|
13726
14067
|
fileName: _jsxFileName$w,
|
|
13727
|
-
lineNumber:
|
|
14068
|
+
lineNumber: 918,
|
|
13728
14069
|
columnNumber: 13
|
|
13729
14070
|
}
|
|
13730
14071
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
@@ -13732,7 +14073,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13732
14073
|
__self: undefined,
|
|
13733
14074
|
__source: {
|
|
13734
14075
|
fileName: _jsxFileName$w,
|
|
13735
|
-
lineNumber:
|
|
14076
|
+
lineNumber: 935,
|
|
13736
14077
|
columnNumber: 15
|
|
13737
14078
|
}
|
|
13738
14079
|
}, "Loading....")), items.length > 0 || isLoading ? /*#__PURE__*/React__default.createElement(Option, _extends({}, getMenuProps({
|
|
@@ -13743,7 +14084,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13743
14084
|
__self: undefined,
|
|
13744
14085
|
__source: {
|
|
13745
14086
|
fileName: _jsxFileName$w,
|
|
13746
|
-
lineNumber:
|
|
14087
|
+
lineNumber: 941,
|
|
13747
14088
|
columnNumber: 13
|
|
13748
14089
|
}
|
|
13749
14090
|
}), /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
@@ -13758,92 +14099,17 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13758
14099
|
__self: undefined,
|
|
13759
14100
|
__source: {
|
|
13760
14101
|
fileName: _jsxFileName$w,
|
|
13761
|
-
lineNumber:
|
|
14102
|
+
lineNumber: 945,
|
|
13762
14103
|
columnNumber: 19
|
|
13763
14104
|
}
|
|
13764
14105
|
}, child),
|
|
13765
14106
|
__self: undefined,
|
|
13766
14107
|
__source: {
|
|
13767
14108
|
fileName: _jsxFileName$w,
|
|
13768
|
-
lineNumber:
|
|
14109
|
+
lineNumber: 942,
|
|
13769
14110
|
columnNumber: 15
|
|
13770
14111
|
}
|
|
13771
|
-
}, isOpen && items.map((item, index) => {
|
|
13772
|
-
var _item$render;
|
|
13773
|
-
return /*#__PURE__*/React__default.createElement(ItemWrapper$1, _extends({
|
|
13774
|
-
key: item.id
|
|
13775
|
-
}, getItemProps({
|
|
13776
|
-
item,
|
|
13777
|
-
index: index,
|
|
13778
|
-
disabled: item.isDisabled
|
|
13779
|
-
}), {
|
|
13780
|
-
css: {
|
|
13781
|
-
backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
|
|
13782
|
-
cursor: item.isDisabled ? 'not-allowed' : 'pointer',
|
|
13783
|
-
color: item.isDisabled ? '$textDisable' : 'textPrimary'
|
|
13784
|
-
},
|
|
13785
|
-
__self: undefined,
|
|
13786
|
-
__source: {
|
|
13787
|
-
fileName: _jsxFileName$w,
|
|
13788
|
-
lineNumber: 807,
|
|
13789
|
-
columnNumber: 21
|
|
13790
|
-
}
|
|
13791
|
-
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
13792
|
-
css: {
|
|
13793
|
-
width: '16px',
|
|
13794
|
-
height: '16px',
|
|
13795
|
-
border: '1px solid $bgBorder',
|
|
13796
|
-
cursor: item.isDisabled ? 'not-allowed' : 'pointer'
|
|
13797
|
-
},
|
|
13798
|
-
__self: undefined,
|
|
13799
|
-
__source: {
|
|
13800
|
-
fileName: _jsxFileName$w,
|
|
13801
|
-
lineNumber: 820,
|
|
13802
|
-
columnNumber: 23
|
|
13803
|
-
}
|
|
13804
|
-
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
13805
|
-
color: colors$8.iconDisable,
|
|
13806
|
-
__self: undefined,
|
|
13807
|
-
__source: {
|
|
13808
|
-
fileName: _jsxFileName$w,
|
|
13809
|
-
lineNumber: 830,
|
|
13810
|
-
columnNumber: 29
|
|
13811
|
-
}
|
|
13812
|
-
}) : selectedValue.includes(item.id) && (item.isDisabled === false || item.isDisabled === undefined) && /*#__PURE__*/React__default.createElement(CheckOutline, {
|
|
13813
|
-
color: colors$8.iconGreen,
|
|
13814
|
-
__self: undefined,
|
|
13815
|
-
__source: {
|
|
13816
|
-
fileName: _jsxFileName$w,
|
|
13817
|
-
lineNumber: 834,
|
|
13818
|
-
columnNumber: 31
|
|
13819
|
-
}
|
|
13820
|
-
})), 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) < (items === null || items === void 0 ? void 0 : items.length) ? /*#__PURE__*/React__default.createElement(IndeterminateFilled$1, {
|
|
13821
|
-
__self: undefined,
|
|
13822
|
-
__source: {
|
|
13823
|
-
fileName: _jsxFileName$w,
|
|
13824
|
-
lineNumber: 841,
|
|
13825
|
-
columnNumber: 27
|
|
13826
|
-
}
|
|
13827
|
-
}, "-") : /*#__PURE__*/React__default.createElement("div", {
|
|
13828
|
-
__self: undefined,
|
|
13829
|
-
__source: {
|
|
13830
|
-
fileName: _jsxFileName$w,
|
|
13831
|
-
lineNumber: 843,
|
|
13832
|
-
columnNumber: 27
|
|
13833
|
-
}
|
|
13834
|
-
})), /*#__PURE__*/React__default.createElement(Item$3, {
|
|
13835
|
-
css: {
|
|
13836
|
-
backgroundColor: 'unset',
|
|
13837
|
-
width: '100%'
|
|
13838
|
-
},
|
|
13839
|
-
__self: undefined,
|
|
13840
|
-
__source: {
|
|
13841
|
-
fileName: _jsxFileName$w,
|
|
13842
|
-
lineNumber: 846,
|
|
13843
|
-
columnNumber: 23
|
|
13844
|
-
}
|
|
13845
|
-
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
13846
|
-
}))) : /*#__PURE__*/React__default.createElement(Option, _extends({
|
|
14112
|
+
}, isOpen && items.map((item, index) => item !== null && item !== void 0 && item.children ? renderOptionGroupItem(item, index) : renderOptionItem(item, index)))) : /*#__PURE__*/React__default.createElement(Option, _extends({
|
|
13847
14113
|
css: {
|
|
13848
14114
|
height: 'auto'
|
|
13849
14115
|
}
|
|
@@ -13853,14 +14119,14 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13853
14119
|
__self: undefined,
|
|
13854
14120
|
__source: {
|
|
13855
14121
|
fileName: _jsxFileName$w,
|
|
13856
|
-
lineNumber:
|
|
14122
|
+
lineNumber: 962,
|
|
13857
14123
|
columnNumber: 13
|
|
13858
14124
|
}
|
|
13859
14125
|
}), /*#__PURE__*/React__default.createElement(StyledDiv, {
|
|
13860
14126
|
__self: undefined,
|
|
13861
14127
|
__source: {
|
|
13862
14128
|
fileName: _jsxFileName$w,
|
|
13863
|
-
lineNumber:
|
|
14129
|
+
lineNumber: 963,
|
|
13864
14130
|
columnNumber: 15
|
|
13865
14131
|
}
|
|
13866
14132
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13870,7 +14136,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13870
14136
|
__self: undefined,
|
|
13871
14137
|
__source: {
|
|
13872
14138
|
fileName: _jsxFileName$w,
|
|
13873
|
-
lineNumber:
|
|
14139
|
+
lineNumber: 964,
|
|
13874
14140
|
columnNumber: 17
|
|
13875
14141
|
}
|
|
13876
14142
|
}, /*#__PURE__*/React__default.createElement(CircleInfoOutline, {
|
|
@@ -13882,7 +14148,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13882
14148
|
__self: undefined,
|
|
13883
14149
|
__source: {
|
|
13884
14150
|
fileName: _jsxFileName$w,
|
|
13885
|
-
lineNumber:
|
|
14151
|
+
lineNumber: 965,
|
|
13886
14152
|
columnNumber: 19
|
|
13887
14153
|
}
|
|
13888
14154
|
})), textEmptyItem != null ? textEmptyItem : t('emptyItemText', 'Item tidak ditemukan')))));
|
|
@@ -19319,7 +19585,7 @@ const StyledList = styled(TabsPrimitive.List, {
|
|
|
19319
19585
|
display: 'none'
|
|
19320
19586
|
}
|
|
19321
19587
|
});
|
|
19322
|
-
const StyledTrigger
|
|
19588
|
+
const StyledTrigger = styled(TabsPrimitive.Trigger, {
|
|
19323
19589
|
all: 'unset',
|
|
19324
19590
|
fontFamily: 'inherit',
|
|
19325
19591
|
backgroundColor: 'white',
|
|
@@ -19550,7 +19816,7 @@ const TabsTrigger$1 = _ref3 => {
|
|
|
19550
19816
|
} = _ref3,
|
|
19551
19817
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$1);
|
|
19552
19818
|
const [isIconHovered, setIsIconHovered] = useState(false);
|
|
19553
|
-
return /*#__PURE__*/React__default.createElement(StyledTrigger
|
|
19819
|
+
return /*#__PURE__*/React__default.createElement(StyledTrigger, _extends({
|
|
19554
19820
|
value: value
|
|
19555
19821
|
}, props, {
|
|
19556
19822
|
__self: undefined,
|
|
@@ -20205,107 +20471,6 @@ ModalDialog.defaultProps = {
|
|
|
20205
20471
|
layer: '$modal'
|
|
20206
20472
|
};
|
|
20207
20473
|
|
|
20208
|
-
const StyledAccordion = styled(AccordionPrimitive.Root, {});
|
|
20209
|
-
const Accordion = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
|
|
20210
|
-
var {
|
|
20211
|
-
children
|
|
20212
|
-
} = _a,
|
|
20213
|
-
props = __rest(_a, ["children"]);
|
|
20214
|
-
return jsx(StyledAccordion, Object.assign({
|
|
20215
|
-
ref: forwardedRef
|
|
20216
|
-
}, props, props.type === 'single' ? {
|
|
20217
|
-
collapsible: true
|
|
20218
|
-
} : {}, {
|
|
20219
|
-
children: children
|
|
20220
|
-
}), void 0);
|
|
20221
|
-
});
|
|
20222
|
-
const StyledItem$1 = styled(AccordionPrimitive.Item, {
|
|
20223
|
-
borderTop: '1px solid $colors$slate6',
|
|
20224
|
-
'&:last-of-type': {
|
|
20225
|
-
borderBottom: '1px solid $colors$slate6'
|
|
20226
|
-
}
|
|
20227
|
-
});
|
|
20228
|
-
const StyledHeader = styled(AccordionPrimitive.Header, {
|
|
20229
|
-
all: 'unset'
|
|
20230
|
-
});
|
|
20231
|
-
const StyledTrigger = styled(AccordionPrimitive.Trigger, {
|
|
20232
|
-
all: 'unset',
|
|
20233
|
-
boxSizing: 'border-box',
|
|
20234
|
-
userSelect: 'none',
|
|
20235
|
-
'&::before': {
|
|
20236
|
-
boxSizing: 'border-box'
|
|
20237
|
-
},
|
|
20238
|
-
'&::after': {
|
|
20239
|
-
boxSizing: 'border-box'
|
|
20240
|
-
},
|
|
20241
|
-
cursor: 'pointer',
|
|
20242
|
-
display: 'flex',
|
|
20243
|
-
alignItems: 'center',
|
|
20244
|
-
color: '$hiContrast',
|
|
20245
|
-
width: '100%',
|
|
20246
|
-
'@hover': {
|
|
20247
|
-
'&:hover': {
|
|
20248
|
-
backgroundColor: '$slate2'
|
|
20249
|
-
}
|
|
20250
|
-
},
|
|
20251
|
-
'&:focus': {
|
|
20252
|
-
outline: 'none',
|
|
20253
|
-
boxShadow: 'inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8'
|
|
20254
|
-
},
|
|
20255
|
-
'& svg.icon-cdf': {
|
|
20256
|
-
color: '$white',
|
|
20257
|
-
size: '24px',
|
|
20258
|
-
transition: 'transform 175ms cubic-bezier(0.65, 0, 0.35, 1)'
|
|
20259
|
-
},
|
|
20260
|
-
'& svg.right': {
|
|
20261
|
-
marginRight: '$spacing-05'
|
|
20262
|
-
},
|
|
20263
|
-
'&[data-state="open"]': {
|
|
20264
|
-
'& svg.icon-cdf': {
|
|
20265
|
-
transform: 'rotate(180deg)'
|
|
20266
|
-
}
|
|
20267
|
-
},
|
|
20268
|
-
variants: {
|
|
20269
|
-
arrowPosition: {
|
|
20270
|
-
right: {
|
|
20271
|
-
justifyContent: 'space-between'
|
|
20272
|
-
},
|
|
20273
|
-
left: {
|
|
20274
|
-
justifyContent: 'start'
|
|
20275
|
-
}
|
|
20276
|
-
}
|
|
20277
|
-
}
|
|
20278
|
-
});
|
|
20279
|
-
const AccordionTrigger = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
|
|
20280
|
-
var {
|
|
20281
|
-
children,
|
|
20282
|
-
arrowPosition = 'right',
|
|
20283
|
-
hasContent = true,
|
|
20284
|
-
arrowColor = 'white'
|
|
20285
|
-
} = _a,
|
|
20286
|
-
props = __rest(_a, ["children", "arrowPosition", "hasContent", "arrowColor"]);
|
|
20287
|
-
return jsx(StyledHeader, {
|
|
20288
|
-
children: jsx(StyledTrigger, Object.assign({}, props, {
|
|
20289
|
-
arrowPosition: arrowPosition,
|
|
20290
|
-
ref: forwardedRef
|
|
20291
|
-
}, {
|
|
20292
|
-
children: arrowPosition === 'right' ? jsxs(Fragment, {
|
|
20293
|
-
children: [children, hasContent && jsx(ChevronDownOutline, {
|
|
20294
|
-
className: "icon-cdf right",
|
|
20295
|
-
color: arrowColor
|
|
20296
|
-
}, void 0)]
|
|
20297
|
-
}, void 0) : jsxs(Fragment, {
|
|
20298
|
-
children: [hasContent && jsx(ChevronDownOutline, {
|
|
20299
|
-
className: "icon-cdf left",
|
|
20300
|
-
color: arrowColor
|
|
20301
|
-
}, void 0), children]
|
|
20302
|
-
}, void 0)
|
|
20303
|
-
}), void 0)
|
|
20304
|
-
}, void 0);
|
|
20305
|
-
});
|
|
20306
|
-
const AccordionItem = StyledItem$1;
|
|
20307
|
-
const AccordionContent = AccordionPrimitive.Content;
|
|
20308
|
-
|
|
20309
20474
|
const removeUndefinedFields = obj => {
|
|
20310
20475
|
let newObj = {};
|
|
20311
20476
|
Object.keys(obj).forEach(key => {
|
|
@@ -32020,13 +32185,17 @@ const Required$2 = styled('span', {
|
|
|
32020
32185
|
color: '$textRed !important'
|
|
32021
32186
|
});
|
|
32022
32187
|
function EditableTableMobile(props) {
|
|
32188
|
+
var _a, _b;
|
|
32023
32189
|
const {
|
|
32190
|
+
rowVirtualizer,
|
|
32191
|
+
tableContainerRef,
|
|
32024
32192
|
instance,
|
|
32025
32193
|
showCheckbox,
|
|
32026
32194
|
customRows,
|
|
32027
32195
|
onExpand,
|
|
32028
32196
|
hiddenColumns,
|
|
32029
|
-
customEmptyDataProps
|
|
32197
|
+
customEmptyDataProps,
|
|
32198
|
+
virtualized
|
|
32030
32199
|
} = props;
|
|
32031
32200
|
const {
|
|
32032
32201
|
getTableProps,
|
|
@@ -32068,121 +32237,131 @@ function EditableTableMobile(props) {
|
|
|
32068
32237
|
showInMobile
|
|
32069
32238
|
};
|
|
32070
32239
|
};
|
|
32071
|
-
const renderTableRow = (row,
|
|
32240
|
+
const renderTableRow = (row, customStyle) => {
|
|
32241
|
+
var _a;
|
|
32072
32242
|
return jsxs(Fragment, {
|
|
32073
|
-
children: [
|
|
32243
|
+
children: [jsx(TableRow$2, Object.assign({
|
|
32074
32244
|
css: customStyle
|
|
32075
32245
|
}, row.getRowProps(), {
|
|
32076
|
-
|
|
32077
|
-
|
|
32078
|
-
|
|
32079
|
-
|
|
32080
|
-
|
|
32081
|
-
|
|
32082
|
-
|
|
32083
|
-
|
|
32084
|
-
|
|
32085
|
-
|
|
32086
|
-
}
|
|
32087
|
-
|
|
32088
|
-
|
|
32089
|
-
}), jsxs(Flex$1, Object.assign({
|
|
32090
|
-
align: "center",
|
|
32091
|
-
justify: "between",
|
|
32092
|
-
css: {
|
|
32093
|
-
cursor: 'pointer',
|
|
32094
|
-
minHeight: 40
|
|
32095
|
-
}
|
|
32096
|
-
}, {
|
|
32097
|
-
children: [jsx(Box, {
|
|
32098
|
-
children: cell.render('Cell')
|
|
32099
|
-
}, void 0), !isSelector && jsx(Flex$1, Object.assign({
|
|
32100
|
-
justify: "center",
|
|
32246
|
+
children: row.cells.map((cell, index) => {
|
|
32247
|
+
var _a, _b;
|
|
32248
|
+
const isMobileHeader = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.isMobileHeader;
|
|
32249
|
+
const isSelector = ((_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.id) === 'selection';
|
|
32250
|
+
return (isMobileHeader || isSelector) && /*#__PURE__*/createElement$2(TableCell$2, Object.assign({}, cell.getCellProps({
|
|
32251
|
+
style: {
|
|
32252
|
+
minWidth: cell.column.minWidth,
|
|
32253
|
+
width: isSelector ? 10 : cell.column.width,
|
|
32254
|
+
maxWidth: isSelector ? 10 : cell.column.maxWidth
|
|
32255
|
+
}
|
|
32256
|
+
}), {
|
|
32257
|
+
key: `cell-body-${index}`
|
|
32258
|
+
}), jsxs(Flex$1, Object.assign({
|
|
32101
32259
|
align: "center",
|
|
32102
|
-
|
|
32103
|
-
|
|
32104
|
-
|
|
32105
|
-
|
|
32106
|
-
}
|
|
32107
|
-
row.toggleRowExpanded(!row.isExpanded);
|
|
32108
|
-
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!row.isExpanded);
|
|
32260
|
+
justify: "between",
|
|
32261
|
+
css: {
|
|
32262
|
+
cursor: 'pointer',
|
|
32263
|
+
minHeight: 40
|
|
32109
32264
|
}
|
|
32110
32265
|
}, {
|
|
32111
|
-
children:
|
|
32112
|
-
|
|
32113
|
-
|
|
32114
|
-
|
|
32115
|
-
|
|
32266
|
+
children: [jsx(Box, {
|
|
32267
|
+
children: cell.render('Cell')
|
|
32268
|
+
}, void 0), !isSelector && jsx(Flex$1, Object.assign({
|
|
32269
|
+
justify: "center",
|
|
32270
|
+
align: "center",
|
|
32271
|
+
onClick: () => {
|
|
32272
|
+
var _a;
|
|
32273
|
+
if (!((_a = Object.keys(state.expanded)) === null || _a === void 0 ? void 0 : _a.includes(row.id))) {
|
|
32274
|
+
toggleAllRowsExpanded(false);
|
|
32275
|
+
}
|
|
32276
|
+
row.toggleRowExpanded(!row.isExpanded);
|
|
32277
|
+
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!row.isExpanded);
|
|
32278
|
+
}
|
|
32279
|
+
}, {
|
|
32280
|
+
children: row.isExpanded ? jsx(ChevronUpOutline, {}, void 0) : jsx(ChevronDownOutline, {}, void 0)
|
|
32281
|
+
}), void 0)]
|
|
32282
|
+
}), void 0));
|
|
32283
|
+
})
|
|
32284
|
+
}), void 0), jsxs(TableRowCollapse, Object.assign({
|
|
32116
32285
|
css: {
|
|
32117
32286
|
backgroundColor: '$gray50'
|
|
32118
32287
|
}
|
|
32119
|
-
}
|
|
32120
|
-
children: jsx(
|
|
32121
|
-
|
|
32122
|
-
|
|
32123
|
-
children: jsx(Flex$1, Object.assign({
|
|
32124
|
-
direction: "column",
|
|
32125
|
-
css: {
|
|
32126
|
-
borderTop: '1pt solid $bgBorder'
|
|
32127
|
-
}
|
|
32288
|
+
}, {
|
|
32289
|
+
children: [showCheckbox && jsx(TableCell$2, {}, void 0), jsx(TableCellCollapse, {
|
|
32290
|
+
children: jsx(Collapalse, Object.assign({
|
|
32291
|
+
isOpen: row.isExpanded
|
|
32128
32292
|
}, {
|
|
32129
|
-
children:
|
|
32130
|
-
|
|
32131
|
-
|
|
32132
|
-
|
|
32133
|
-
|
|
32134
|
-
|
|
32135
|
-
|
|
32136
|
-
|
|
32137
|
-
|
|
32138
|
-
|
|
32139
|
-
|
|
32140
|
-
|
|
32141
|
-
|
|
32142
|
-
|
|
32143
|
-
|
|
32144
|
-
|
|
32145
|
-
|
|
32146
|
-
children: jsxs(Grid, Object.assign({
|
|
32147
|
-
columns: 6,
|
|
32148
|
-
flow: "row",
|
|
32293
|
+
children: jsx(Flex$1, Object.assign({
|
|
32294
|
+
direction: "column",
|
|
32295
|
+
css: {
|
|
32296
|
+
borderTop: '1pt solid $bgBorder'
|
|
32297
|
+
}
|
|
32298
|
+
}, {
|
|
32299
|
+
children: row.cells.filter(cell => {
|
|
32300
|
+
var _a, _b, _c, _d;
|
|
32301
|
+
return typeof ((_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.hidden) === 'boolean' ? !((_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.hidden) : !((_d = (_c = cell === null || cell === void 0 ? void 0 : cell.column) === null || _c === void 0 ? void 0 : _c.hidden) === null || _d === void 0 ? void 0 : _d.call(_c, cell));
|
|
32302
|
+
}).map((cell, index) => {
|
|
32303
|
+
var _a, _b, _c, _d;
|
|
32304
|
+
const headerRender = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.Header;
|
|
32305
|
+
const isMobileHeader = (_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.isMobileHeader;
|
|
32306
|
+
const isSelector = ((_c = cell === null || cell === void 0 ? void 0 : cell.column) === null || _c === void 0 ? void 0 : _c.id) === 'selection';
|
|
32307
|
+
return !isMobileHeader && !isSelector && jsx(Flex$1, Object.assign({
|
|
32308
|
+
direction: "column",
|
|
32309
|
+
justify: "center",
|
|
32149
32310
|
css: {
|
|
32150
|
-
|
|
32151
|
-
|
|
32152
|
-
|
|
32311
|
+
borderBottom: '1pt solid $bgBorder',
|
|
32312
|
+
padding: '10px 12px',
|
|
32313
|
+
minHeight: 52
|
|
32153
32314
|
}
|
|
32154
32315
|
}, {
|
|
32155
|
-
children:
|
|
32156
|
-
|
|
32316
|
+
children: jsxs(Grid, Object.assign({
|
|
32317
|
+
columns: 6,
|
|
32318
|
+
flow: "row",
|
|
32319
|
+
css: {
|
|
32320
|
+
gridRowGap: '$spacing-04',
|
|
32321
|
+
gridColumnGap: '$spacing-04',
|
|
32322
|
+
alignItems: 'center'
|
|
32323
|
+
}
|
|
32157
32324
|
}, {
|
|
32158
|
-
children: jsx(
|
|
32159
|
-
|
|
32160
|
-
color: "secondary"
|
|
32325
|
+
children: [jsx(GridItem, Object.assign({
|
|
32326
|
+
colSpan: 3
|
|
32161
32327
|
}, {
|
|
32162
|
-
children:
|
|
32163
|
-
|
|
32164
|
-
|
|
32165
|
-
|
|
32166
|
-
|
|
32167
|
-
|
|
32168
|
-
|
|
32169
|
-
|
|
32170
|
-
|
|
32171
|
-
|
|
32172
|
-
|
|
32328
|
+
children: jsx(Heading, Object.assign({
|
|
32329
|
+
heading: "headerTable",
|
|
32330
|
+
color: "secondary"
|
|
32331
|
+
}, {
|
|
32332
|
+
children: typeof headerRender === 'string' ? jsxs(Fragment, {
|
|
32333
|
+
children: [headerRender === null || headerRender === void 0 ? void 0 : headerRender.toUpperCase(), ((_d = cell === null || cell === void 0 ? void 0 : cell.column) === null || _d === void 0 ? void 0 : _d.isRequired) ? jsx(Required$2, {
|
|
32334
|
+
children: "*"
|
|
32335
|
+
}, void 0) : '']
|
|
32336
|
+
}, void 0) : headerRender
|
|
32337
|
+
}), void 0)
|
|
32338
|
+
}), void 0), jsx(GridItem, Object.assign({
|
|
32339
|
+
colSpan: 3
|
|
32173
32340
|
}, {
|
|
32174
|
-
children:
|
|
32175
|
-
|
|
32176
|
-
|
|
32177
|
-
|
|
32178
|
-
|
|
32179
|
-
|
|
32341
|
+
children: jsx(Flex$1, Object.assign({
|
|
32342
|
+
justify: "end"
|
|
32343
|
+
}, {
|
|
32344
|
+
children: cell.render('Cell')
|
|
32345
|
+
}), void 0)
|
|
32346
|
+
}), void 0)]
|
|
32347
|
+
}), void 0)
|
|
32348
|
+
}), `cell-collapse-${index}`);
|
|
32349
|
+
})
|
|
32350
|
+
}), void 0)
|
|
32180
32351
|
}), void 0)
|
|
32181
|
-
}
|
|
32182
|
-
}, void 0))]
|
|
32352
|
+
}, void 0)]
|
|
32353
|
+
}), 'row-collapse-' + ((_a = row.getRowProps()) === null || _a === void 0 ? void 0 : _a.key))]
|
|
32183
32354
|
}, void 0);
|
|
32184
32355
|
};
|
|
32356
|
+
const {
|
|
32357
|
+
virtualItems: virtualRows,
|
|
32358
|
+
totalSize
|
|
32359
|
+
} = rowVirtualizer;
|
|
32360
|
+
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
32361
|
+
const paddingBottom = virtualRows.length > 0 ? totalSize - (((_b = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[virtualRows.length - 1]) === null || _b === void 0 ? void 0 : _b.end) || 0) : 0;
|
|
32362
|
+
const tableRowData = virtualized ? virtualRows : rows;
|
|
32185
32363
|
return jsx(TableContainer$2, Object.assign({
|
|
32364
|
+
ref: tableContainerRef,
|
|
32186
32365
|
css: props === null || props === void 0 ? void 0 : props.css
|
|
32187
32366
|
}, {
|
|
32188
32367
|
children: jsxs(TableContent$2, Object.assign({}, getTableProps(), {
|
|
@@ -32193,7 +32372,7 @@ function EditableTableMobile(props) {
|
|
|
32193
32372
|
return typeof (column === null || column === void 0 ? void 0 : column.hidden) === 'boolean' ? !(column === null || column === void 0 ? void 0 : column.hidden) : !((_a = column === null || column === void 0 ? void 0 : column.hidden) === null || _a === void 0 ? void 0 : _a.call(column, column));
|
|
32194
32373
|
});
|
|
32195
32374
|
return /*#__PURE__*/createElement$2(TableHeadRow$2, Object.assign({}, headerGroup.getHeaderGroupProps(), {
|
|
32196
|
-
key: index
|
|
32375
|
+
key: `head-row-${index}`
|
|
32197
32376
|
}), visibleHeaders.map((column, index) => {
|
|
32198
32377
|
const isMobileHeader = column === null || column === void 0 ? void 0 : column.isMobileHeader;
|
|
32199
32378
|
const isSelector = (column === null || column === void 0 ? void 0 : column.id) === 'selection';
|
|
@@ -32204,14 +32383,21 @@ function EditableTableMobile(props) {
|
|
|
32204
32383
|
maxWidth: isSelector ? 10 : column.maxWidth
|
|
32205
32384
|
}
|
|
32206
32385
|
}), {
|
|
32207
|
-
key: index
|
|
32386
|
+
key: `head-cell-${index}`
|
|
32208
32387
|
}), column.render('Header'), (column === null || column === void 0 ? void 0 : column.isRequired) ? jsx(Required$2, {
|
|
32209
32388
|
children: "*"
|
|
32210
32389
|
}, void 0) : '');
|
|
32211
32390
|
}));
|
|
32212
32391
|
})
|
|
32213
|
-
}, void 0),
|
|
32214
|
-
children:
|
|
32392
|
+
}, void 0), jsxs(TableBody$2, Object.assign({}, getTableBodyProps(), {
|
|
32393
|
+
children: [virtualized && paddingTop > 0 && jsx("tr", {
|
|
32394
|
+
children: jsx("td", {
|
|
32395
|
+
style: {
|
|
32396
|
+
height: `${paddingTop}px`
|
|
32397
|
+
}
|
|
32398
|
+
}, void 0)
|
|
32399
|
+
}, void 0), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.map((dataRow, index) => {
|
|
32400
|
+
const row = virtualized ? rows === null || rows === void 0 ? void 0 : rows[dataRow === null || dataRow === void 0 ? void 0 : dataRow.index] : dataRow;
|
|
32215
32401
|
prepareRow(row);
|
|
32216
32402
|
const {
|
|
32217
32403
|
customStyle
|
|
@@ -32219,13 +32405,19 @@ function EditableTableMobile(props) {
|
|
|
32219
32405
|
const {
|
|
32220
32406
|
CustomRow,
|
|
32221
32407
|
showInMobile
|
|
32222
|
-
} = getCustomRows(row, () => renderTableRow(row,
|
|
32408
|
+
} = getCustomRows(row, () => renderTableRow(row, customStyle));
|
|
32223
32409
|
return jsx(React__default.Fragment, {
|
|
32224
32410
|
children: CustomRow && showInMobile ? jsx(CustomRow, {
|
|
32225
32411
|
style: customStyle
|
|
32226
|
-
}, void 0) : renderTableRow(row,
|
|
32412
|
+
}, void 0) : renderTableRow(row, customStyle)
|
|
32227
32413
|
}, index);
|
|
32228
|
-
})
|
|
32414
|
+
}), virtualized && paddingBottom > 0 && jsx("tr", {
|
|
32415
|
+
children: jsx("td", {
|
|
32416
|
+
style: {
|
|
32417
|
+
height: `${paddingBottom}px`
|
|
32418
|
+
}
|
|
32419
|
+
}, void 0)
|
|
32420
|
+
}, void 0)]
|
|
32229
32421
|
}), void 0), rows.length < 1 && jsx(TableFoot$1, {
|
|
32230
32422
|
children: jsx(TableFootRow$1, {
|
|
32231
32423
|
children: jsx(TableFootCell$1, Object.assign({
|
|
@@ -49726,6 +49918,7 @@ function Remove(props) {
|
|
|
49726
49918
|
}, void 0);
|
|
49727
49919
|
}
|
|
49728
49920
|
function EditableTable(props) {
|
|
49921
|
+
var _a, _b;
|
|
49729
49922
|
const {
|
|
49730
49923
|
columns,
|
|
49731
49924
|
data,
|
|
@@ -49740,12 +49933,14 @@ function EditableTable(props) {
|
|
|
49740
49933
|
onExpand,
|
|
49741
49934
|
isMobileLayout,
|
|
49742
49935
|
hiddenColumns,
|
|
49743
|
-
customEmptyDataProps: emptyDataProps
|
|
49936
|
+
customEmptyDataProps: emptyDataProps,
|
|
49937
|
+
virtualized = false
|
|
49744
49938
|
} = props;
|
|
49745
49939
|
const {
|
|
49746
49940
|
t
|
|
49747
49941
|
} = useTranslation('MajooUI/table');
|
|
49748
49942
|
const [selectedIndex, setSelectedIndex] = useState(null);
|
|
49943
|
+
const isMobile = useMediaQuery(isMobileLayout === undefined ? '(max-width: 767px)' : isMobileLayout ? '(max-width: 8000px)' : '(max-width: 0px)');
|
|
49749
49944
|
const IndeterminateCheckbox = props => {
|
|
49750
49945
|
function handleCheckedChange(checked) {
|
|
49751
49946
|
props === null || props === void 0 ? void 0 : props.onChange({
|
|
@@ -49804,6 +49999,19 @@ function EditableTable(props) {
|
|
|
49804
49999
|
selectedRowIds
|
|
49805
50000
|
}
|
|
49806
50001
|
} = instance;
|
|
50002
|
+
const tableContainerRef = useRef(null);
|
|
50003
|
+
const rowVirtualizer = useVirtual({
|
|
50004
|
+
parentRef: tableContainerRef,
|
|
50005
|
+
size: data === null || data === void 0 ? void 0 : data.length,
|
|
50006
|
+
overscan: isMobile ? 20 : 10,
|
|
50007
|
+
estimateSize: useCallback(() => isMobile ? 40 : rowHeight || 80, [isMobile, rowHeight])
|
|
50008
|
+
});
|
|
50009
|
+
const {
|
|
50010
|
+
virtualItems: virtualRows,
|
|
50011
|
+
totalSize
|
|
50012
|
+
} = rowVirtualizer;
|
|
50013
|
+
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
50014
|
+
const paddingBottom = virtualRows.length > 0 ? totalSize - (((_b = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[virtualRows.length - 1]) === null || _b === void 0 ? void 0 : _b.end) || 0) : 0;
|
|
49807
50015
|
useEffect(() => {
|
|
49808
50016
|
if (hiddenColumns) setHiddenColumns(hiddenColumns);
|
|
49809
50017
|
}, [hiddenColumns, setHiddenColumns]);
|
|
@@ -49817,7 +50025,6 @@ function EditableTable(props) {
|
|
|
49817
50025
|
});
|
|
49818
50026
|
}
|
|
49819
50027
|
}, [selectedRowIds, data, onSelectedChange, selectedIndex]);
|
|
49820
|
-
const isMobile = useMediaQuery(isMobileLayout === undefined ? '(max-width: 767px)' : isMobileLayout ? '(max-width: 8000px)' : '(max-width: 0px)');
|
|
49821
50028
|
const customEmptyDataProps = emptyDataProps || defaultEmptyDataProps(t, isMobile);
|
|
49822
50029
|
const getCustomRows = (row, renderRow) => {
|
|
49823
50030
|
var _a;
|
|
@@ -49870,7 +50077,9 @@ function EditableTable(props) {
|
|
|
49870
50077
|
})
|
|
49871
50078
|
}), void 0);
|
|
49872
50079
|
};
|
|
50080
|
+
const tableRowData = virtualized ? virtualRows : rows;
|
|
49873
50081
|
return !isMobile ? jsx(TableContainer$1, Object.assign({
|
|
50082
|
+
ref: tableContainerRef,
|
|
49874
50083
|
css: props === null || props === void 0 ? void 0 : props.css
|
|
49875
50084
|
}, {
|
|
49876
50085
|
children: jsxs(TableContent$1, Object.assign({}, getTableProps(), {
|
|
@@ -49894,8 +50103,15 @@ function EditableTable(props) {
|
|
|
49894
50103
|
}), void 0))
|
|
49895
50104
|
}), void 0);
|
|
49896
50105
|
})
|
|
49897
|
-
}, void 0),
|
|
49898
|
-
children:
|
|
50106
|
+
}, void 0), jsxs(TableBody$1, Object.assign({}, getTableBodyProps(), {
|
|
50107
|
+
children: [virtualized && paddingTop > 0 && jsx("tr", {
|
|
50108
|
+
children: jsx("td", {
|
|
50109
|
+
style: {
|
|
50110
|
+
height: `${paddingTop}px`
|
|
50111
|
+
}
|
|
50112
|
+
}, void 0)
|
|
50113
|
+
}, void 0), tableRowData.map((dataRow, index) => {
|
|
50114
|
+
const row = virtualized ? rows === null || rows === void 0 ? void 0 : rows[dataRow === null || dataRow === void 0 ? void 0 : dataRow.index] : dataRow;
|
|
49899
50115
|
prepareRow(row);
|
|
49900
50116
|
const subRowCells = row.cells.filter(cell => cell.column.isSubRow);
|
|
49901
50117
|
const notNullHeaderColumns = visibleColumns.filter(column => typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow);
|
|
@@ -49950,7 +50166,13 @@ function EditableTable(props) {
|
|
|
49950
50166
|
}), cell.column.id);
|
|
49951
50167
|
})]
|
|
49952
50168
|
}, index);
|
|
49953
|
-
})
|
|
50169
|
+
}), virtualized && paddingBottom > 0 && jsx("tr", {
|
|
50170
|
+
children: jsx("td", {
|
|
50171
|
+
style: {
|
|
50172
|
+
height: `${paddingBottom}px`
|
|
50173
|
+
}
|
|
50174
|
+
}, void 0)
|
|
50175
|
+
}, void 0)]
|
|
49954
50176
|
}), void 0), rows.length < 1 && jsx(TableFoot, {
|
|
49955
50177
|
children: jsx(TableFootRow, {
|
|
49956
50178
|
children: jsx(TableFootCell, Object.assign({
|
|
@@ -49978,7 +50200,10 @@ function EditableTable(props) {
|
|
|
49978
50200
|
customRows: customRows,
|
|
49979
50201
|
onExpand: onExpand,
|
|
49980
50202
|
hiddenColumns: hiddenColumns,
|
|
49981
|
-
customEmptyDataProps: customEmptyDataProps
|
|
50203
|
+
customEmptyDataProps: customEmptyDataProps,
|
|
50204
|
+
virtualized: virtualized,
|
|
50205
|
+
rowVirtualizer: rowVirtualizer,
|
|
50206
|
+
tableContainerRef: tableContainerRef
|
|
49982
50207
|
}, void 0);
|
|
49983
50208
|
}
|
|
49984
50209
|
EditableTable.Product = Product;
|