@majoo-ui/react 1.58.7 → 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 +549 -324
- package/index.umd.js +558 -332
- package/package.json +3 -2
package/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@stitches/react'), require('@majoo-ui/core'), require('@majoo-ui/icons'), require('react-transition-group'), require('react/jsx-runtime'), require('@majoo-ui/helpers'), require('react-i18next'), require('moment'), require('@radix-ui/react-avatar'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-progress'), require('@radix-ui/react-label'), require('@radix-ui/react-checkbox'), require('@radix-ui/react-radio-group'), require('react-hook-form'), require('@radix-ui/react-switch'), require('downshift'), require('react-infinite-scroller'), require('lodash.debounce'), require('@floating-ui/react'), require('otp-input-react'), require('@radix-ui/react-dialog'), require('@radix-ui/react-toggle-group'), require('dayzed'), require('@radix-ui/react-separator'), require('@radix-ui/react-slider'), require('@radix-ui/react-tabs'), require('@radix-ui/react-accordion'), require('react-table'), require('react-dom'), require('@radix-ui/react-alert-dialog'), require('@radix-ui/react-dropdown-menu'), require('@radix-ui/react-aspect-ratio'), require('react-color/lib/components/common'), require('react-color/lib/helpers/color'), require('react-step-wizard'), require('@react-google-maps/api'), require('superagent'), require('recharts'), require('draft-js'), require('react-draft-wysiwyg'), require('react-contextmenu'), require('react-loading-skeleton'), require('react-loading-skeleton/dist/skeleton.css'), require('react-ui-scrollspy'), require('react-image-crop'), require('browser-image-compression'), require('react-table-sticky')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', '@stitches/react', '@majoo-ui/core', '@majoo-ui/icons', 'react-transition-group', 'react/jsx-runtime', '@majoo-ui/helpers', 'react-i18next', 'moment', '@radix-ui/react-avatar', '@radix-ui/react-tooltip', '@radix-ui/react-progress', '@radix-ui/react-label', '@radix-ui/react-checkbox', '@radix-ui/react-radio-group', 'react-hook-form', '@radix-ui/react-switch', 'downshift', 'react-infinite-scroller', 'lodash.debounce', '@floating-ui/react', 'otp-input-react', '@radix-ui/react-dialog', '@radix-ui/react-toggle-group', 'dayzed', '@radix-ui/react-separator', '@radix-ui/react-slider', '@radix-ui/react-tabs', '@radix-ui/react-accordion', 'react-table', 'react-dom', '@radix-ui/react-alert-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-aspect-ratio', 'react-color/lib/components/common', 'react-color/lib/helpers/color', 'react-step-wizard', '@react-google-maps/api', 'superagent', 'recharts', 'draft-js', 'react-draft-wysiwyg', 'react-contextmenu', 'react-loading-skeleton', 'react-loading-skeleton/dist/skeleton.css', 'react-ui-scrollspy', 'react-image-crop', 'browser-image-compression', 'react-table-sticky'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.PropTypes, global.react, global.core, global.icons, global.reactTransitionGroup, global.jsxRuntime, global.helpers, global.reactI18next, global.moment, global.AvatarPrimitive, global.TooltipPrimitive, global.ProgressPrimitive, global.LabelPrimitive, global.CheckboxPrimitive, global.RadioGroupPrimitive, global.reactHookForm, global.SwitchPrimitive, global.Downshift, global.InfiniteScroll, global.debounce, global.react$1, global.OTPInput, global.DialogPrimitive, global.ToggleGroupPrimitive, global.dayzed, global.SeparatorPrimitive, global.SliderPrimitive, global.TabsPrimitive, global.AccordionPrimitive, global.reactTable, global.ReactDOM, global.ADialog, global.DropdownMenuPrimitive, global.AspectRatioPrimitive, global.common, global.color, global.StepWizard$1, global.api, global.request, global.recharts, global.draftJs, global.reactDraftWysiwyg, global.reactContextmenu, global.ReactSkeleton, null, global.ScrollSpy, global.ReactCrop, global.imageCompressionComponent, global.reactTableSticky));
|
|
5
|
-
})(this, (function (exports, React, PropTypes, react, core, icons, reactTransitionGroup, jsxRuntime, helpers, reactI18next, moment, AvatarPrimitive, TooltipPrimitive, ProgressPrimitive, LabelPrimitive, CheckboxPrimitive, RadioGroupPrimitive, reactHookForm, SwitchPrimitive, Downshift, InfiniteScroll, debounce, react$1, OTPInput, DialogPrimitive, ToggleGroupPrimitive, dayzed, SeparatorPrimitive, SliderPrimitive, TabsPrimitive, AccordionPrimitive, reactTable, ReactDOM, ADialog, DropdownMenuPrimitive, AspectRatioPrimitive, common, color, StepWizard$1, api, request, recharts, draftJs, reactDraftWysiwyg, reactContextmenu, ReactSkeleton, skeleton_css, ScrollSpy, ReactCrop, imageCompressionComponent, reactTableSticky) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@stitches/react'), require('@majoo-ui/core'), require('@majoo-ui/icons'), require('react-transition-group'), require('react/jsx-runtime'), require('@majoo-ui/helpers'), require('react-i18next'), require('moment'), require('@radix-ui/react-avatar'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-progress'), require('@radix-ui/react-label'), require('@radix-ui/react-checkbox'), require('@radix-ui/react-radio-group'), require('react-hook-form'), require('@radix-ui/react-switch'), require('downshift'), require('react-infinite-scroller'), require('lodash.debounce'), require('@floating-ui/react'), require('otp-input-react'), require('@radix-ui/react-dialog'), require('@radix-ui/react-toggle-group'), require('dayzed'), require('@radix-ui/react-separator'), require('@radix-ui/react-slider'), require('@radix-ui/react-tabs'), require('@radix-ui/react-accordion'), require('react-table'), require('react-dom'), require('@radix-ui/react-alert-dialog'), require('@radix-ui/react-dropdown-menu'), require('@radix-ui/react-aspect-ratio'), require('react-color/lib/components/common'), require('react-color/lib/helpers/color'), require('react-step-wizard'), require('@react-google-maps/api'), require('superagent'), require('recharts'), require('draft-js'), require('react-draft-wysiwyg'), require('react-contextmenu'), require('react-loading-skeleton'), require('react-loading-skeleton/dist/skeleton.css'), require('react-virtual'), require('react-ui-scrollspy'), require('react-image-crop'), require('browser-image-compression'), require('react-table-sticky')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', '@stitches/react', '@majoo-ui/core', '@majoo-ui/icons', 'react-transition-group', 'react/jsx-runtime', '@majoo-ui/helpers', 'react-i18next', 'moment', '@radix-ui/react-avatar', '@radix-ui/react-tooltip', '@radix-ui/react-progress', '@radix-ui/react-label', '@radix-ui/react-checkbox', '@radix-ui/react-radio-group', 'react-hook-form', '@radix-ui/react-switch', 'downshift', 'react-infinite-scroller', 'lodash.debounce', '@floating-ui/react', 'otp-input-react', '@radix-ui/react-dialog', '@radix-ui/react-toggle-group', 'dayzed', '@radix-ui/react-separator', '@radix-ui/react-slider', '@radix-ui/react-tabs', '@radix-ui/react-accordion', 'react-table', 'react-dom', '@radix-ui/react-alert-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-aspect-ratio', 'react-color/lib/components/common', 'react-color/lib/helpers/color', 'react-step-wizard', '@react-google-maps/api', 'superagent', 'recharts', 'draft-js', 'react-draft-wysiwyg', 'react-contextmenu', 'react-loading-skeleton', 'react-loading-skeleton/dist/skeleton.css', 'react-virtual', 'react-ui-scrollspy', 'react-image-crop', 'browser-image-compression', 'react-table-sticky'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.PropTypes, global.react, global.core, global.icons, global.reactTransitionGroup, global.jsxRuntime, global.helpers, global.reactI18next, global.moment, global.AvatarPrimitive, global.TooltipPrimitive, global.ProgressPrimitive, global.LabelPrimitive, global.CheckboxPrimitive, global.RadioGroupPrimitive, global.reactHookForm, global.SwitchPrimitive, global.Downshift, global.InfiniteScroll, global.debounce, global.react$1, global.OTPInput, global.DialogPrimitive, global.ToggleGroupPrimitive, global.dayzed, global.SeparatorPrimitive, global.SliderPrimitive, global.TabsPrimitive, global.AccordionPrimitive, global.reactTable, global.ReactDOM, global.ADialog, global.DropdownMenuPrimitive, global.AspectRatioPrimitive, global.common, global.color, global.StepWizard$1, global.api, global.request, global.recharts, global.draftJs, global.reactDraftWysiwyg, global.reactContextmenu, global.ReactSkeleton, null, global.reactVirtual, global.ScrollSpy, global.ReactCrop, global.imageCompressionComponent, global.reactTableSticky));
|
|
5
|
+
})(this, (function (exports, React, PropTypes, react, core, icons, reactTransitionGroup, jsxRuntime, helpers, reactI18next, moment, AvatarPrimitive, TooltipPrimitive, ProgressPrimitive, LabelPrimitive, CheckboxPrimitive, RadioGroupPrimitive, reactHookForm, SwitchPrimitive, Downshift, InfiniteScroll, debounce, react$1, OTPInput, DialogPrimitive, ToggleGroupPrimitive, dayzed, SeparatorPrimitive, SliderPrimitive, TabsPrimitive, AccordionPrimitive, reactTable, ReactDOM, ADialog, DropdownMenuPrimitive, AspectRatioPrimitive, common, color, StepWizard$1, api, request, recharts, draftJs, reactDraftWysiwyg, reactContextmenu, ReactSkeleton, skeleton_css, reactVirtual, ScrollSpy, ReactCrop, imageCompressionComponent, reactTableSticky) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -12996,6 +12996,142 @@
|
|
|
12996
12996
|
}
|
|
12997
12997
|
}));
|
|
12998
12998
|
|
|
12999
|
+
var StyledAccordion = styled(AccordionPrimitive__namespace.Root, {});
|
|
13000
|
+
var Accordion = /*#__PURE__*/React__namespace.forwardRef(function (_a, forwardedRef) {
|
|
13001
|
+
var children = _a.children,
|
|
13002
|
+
props = __rest(_a, ["children"]);
|
|
13003
|
+
return jsxRuntime.jsx(StyledAccordion, __assign({
|
|
13004
|
+
ref: forwardedRef
|
|
13005
|
+
}, props, props.type === 'single' ? {
|
|
13006
|
+
collapsible: true
|
|
13007
|
+
} : {}, {
|
|
13008
|
+
children: children
|
|
13009
|
+
}), void 0);
|
|
13010
|
+
});
|
|
13011
|
+
var StyledItem$1 = styled(AccordionPrimitive__namespace.Item, {
|
|
13012
|
+
borderTop: '1px solid $colors$slate6',
|
|
13013
|
+
'&:last-of-type': {
|
|
13014
|
+
borderBottom: '1px solid $colors$slate6'
|
|
13015
|
+
}
|
|
13016
|
+
});
|
|
13017
|
+
var StyledHeader = styled(AccordionPrimitive__namespace.Header, {
|
|
13018
|
+
all: 'unset'
|
|
13019
|
+
});
|
|
13020
|
+
var StyledTrigger$1 = styled(AccordionPrimitive__namespace.Trigger, {
|
|
13021
|
+
all: 'unset',
|
|
13022
|
+
boxSizing: 'border-box',
|
|
13023
|
+
userSelect: 'none',
|
|
13024
|
+
'&::before': {
|
|
13025
|
+
boxSizing: 'border-box'
|
|
13026
|
+
},
|
|
13027
|
+
'&::after': {
|
|
13028
|
+
boxSizing: 'border-box'
|
|
13029
|
+
},
|
|
13030
|
+
cursor: 'pointer',
|
|
13031
|
+
display: 'flex',
|
|
13032
|
+
alignItems: 'center',
|
|
13033
|
+
color: '$hiContrast',
|
|
13034
|
+
width: '100%',
|
|
13035
|
+
'@hover': {
|
|
13036
|
+
'&:hover': {
|
|
13037
|
+
backgroundColor: '$slate2'
|
|
13038
|
+
}
|
|
13039
|
+
},
|
|
13040
|
+
'&:focus': {
|
|
13041
|
+
outline: 'none',
|
|
13042
|
+
boxShadow: 'inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8'
|
|
13043
|
+
},
|
|
13044
|
+
'& svg.icon-cdf': {
|
|
13045
|
+
color: '$white',
|
|
13046
|
+
size: '24px',
|
|
13047
|
+
transition: 'transform 175ms cubic-bezier(0.65, 0, 0.35, 1)'
|
|
13048
|
+
},
|
|
13049
|
+
'& svg.right': {
|
|
13050
|
+
marginRight: '$spacing-05'
|
|
13051
|
+
},
|
|
13052
|
+
'&[data-state="open"]': {
|
|
13053
|
+
'& svg.icon-cdf': {
|
|
13054
|
+
transform: 'rotate(180deg)'
|
|
13055
|
+
}
|
|
13056
|
+
},
|
|
13057
|
+
variants: {
|
|
13058
|
+
arrowPosition: {
|
|
13059
|
+
right: {
|
|
13060
|
+
justifyContent: 'space-between'
|
|
13061
|
+
},
|
|
13062
|
+
left: {
|
|
13063
|
+
justifyContent: 'start'
|
|
13064
|
+
}
|
|
13065
|
+
}
|
|
13066
|
+
}
|
|
13067
|
+
});
|
|
13068
|
+
var AccordionTrigger = /*#__PURE__*/React__namespace.forwardRef(function (_a, forwardedRef) {
|
|
13069
|
+
var children = _a.children,
|
|
13070
|
+
_b = _a.arrowPosition,
|
|
13071
|
+
arrowPosition = _b === void 0 ? 'right' : _b,
|
|
13072
|
+
_c = _a.hasContent,
|
|
13073
|
+
hasContent = _c === void 0 ? true : _c,
|
|
13074
|
+
_d = _a.arrowColor,
|
|
13075
|
+
arrowColor = _d === void 0 ? 'white' : _d,
|
|
13076
|
+
props = __rest(_a, ["children", "arrowPosition", "hasContent", "arrowColor"]);
|
|
13077
|
+
return jsxRuntime.jsx(StyledHeader, {
|
|
13078
|
+
children: jsxRuntime.jsx(StyledTrigger$1, __assign({}, props, {
|
|
13079
|
+
arrowPosition: arrowPosition,
|
|
13080
|
+
ref: forwardedRef
|
|
13081
|
+
}, {
|
|
13082
|
+
children: arrowPosition === 'right' ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13083
|
+
children: [children, hasContent && jsxRuntime.jsx(icons.ChevronDownOutline, {
|
|
13084
|
+
className: "icon-cdf right",
|
|
13085
|
+
color: arrowColor
|
|
13086
|
+
}, void 0)]
|
|
13087
|
+
}, void 0) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13088
|
+
children: [hasContent && jsxRuntime.jsx(icons.ChevronDownOutline, {
|
|
13089
|
+
className: "icon-cdf left",
|
|
13090
|
+
color: arrowColor
|
|
13091
|
+
}, void 0), children]
|
|
13092
|
+
}, void 0)
|
|
13093
|
+
}), void 0)
|
|
13094
|
+
}, void 0);
|
|
13095
|
+
});
|
|
13096
|
+
var AccordionItem = StyledItem$1;
|
|
13097
|
+
var AccordionContent = AccordionPrimitive__namespace.Content;
|
|
13098
|
+
|
|
13099
|
+
var OptionGroup = styled(Flex$1, {
|
|
13100
|
+
position: 'relative'
|
|
13101
|
+
});
|
|
13102
|
+
var OptionItem = styled(Flex$1, {
|
|
13103
|
+
fontWeight: 600
|
|
13104
|
+
});
|
|
13105
|
+
var OptionChildren = styled(Box, {});
|
|
13106
|
+
var IconWrapper$1 = styled(Box, {
|
|
13107
|
+
position: 'absolute',
|
|
13108
|
+
top: 10,
|
|
13109
|
+
right: 0,
|
|
13110
|
+
cursor: 'pointer'
|
|
13111
|
+
});
|
|
13112
|
+
function OptionGroupItem(_a) {
|
|
13113
|
+
var item = _a.item,
|
|
13114
|
+
children = _a.children;
|
|
13115
|
+
var _b = React.useState(false),
|
|
13116
|
+
isShow = _b[0],
|
|
13117
|
+
setIsShow = _b[1];
|
|
13118
|
+
return jsxRuntime.jsxs(OptionGroup, __assign({
|
|
13119
|
+
direction: "column"
|
|
13120
|
+
}, {
|
|
13121
|
+
children: [jsxRuntime.jsxs(OptionItem, {
|
|
13122
|
+
children: [item, jsxRuntime.jsx(IconWrapper$1, __assign({
|
|
13123
|
+
onClick: function () {
|
|
13124
|
+
return setIsShow(!isShow);
|
|
13125
|
+
}
|
|
13126
|
+
}, {
|
|
13127
|
+
children: isShow ? jsxRuntime.jsx(icons.ChevronUpOutline, {}, void 0) : jsxRuntime.jsx(icons.ChevronDownOutline, {}, void 0)
|
|
13128
|
+
}), void 0)]
|
|
13129
|
+
}, void 0), isShow && jsxRuntime.jsx(OptionChildren, {
|
|
13130
|
+
children: children
|
|
13131
|
+
}, void 0)]
|
|
13132
|
+
}), void 0);
|
|
13133
|
+
}
|
|
13134
|
+
|
|
12999
13135
|
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"];
|
|
13000
13136
|
var _jsxFileName$w = "/Users/ryanakbar20/Documents/project/majoo/majoo-ui/packages/react/src/components/form/components/InputSelectCheck/InputSelectCheck.js";
|
|
13001
13137
|
function _await(value, then, direct) {
|
|
@@ -13249,7 +13385,7 @@
|
|
|
13249
13385
|
alignItems: 'center'
|
|
13250
13386
|
});
|
|
13251
13387
|
const InputSelectCheck = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
13252
|
-
var _selectedItems$filter, _selectedItems$filter2, _selectedItems$filter3, _selectedItems$filter4;
|
|
13388
|
+
var _initItem$reduce, _selectedItems$filter, _selectedItems$filter2, _selectedItems$filter3, _selectedItems$filter4;
|
|
13253
13389
|
let {
|
|
13254
13390
|
placeholder,
|
|
13255
13391
|
option,
|
|
@@ -13368,7 +13504,7 @@
|
|
|
13368
13504
|
removeSelectedItem,
|
|
13369
13505
|
selectedItems
|
|
13370
13506
|
} = Downshift.useMultipleSelection({
|
|
13371
|
-
selectedItems: selectedValue.length > 0 ? initItem.filter(item => selectedValue.includes(item.id)) : []
|
|
13507
|
+
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)) : []
|
|
13372
13508
|
});
|
|
13373
13509
|
const generateOptions = data => {
|
|
13374
13510
|
return data.map(option => {
|
|
@@ -13447,7 +13583,7 @@
|
|
|
13447
13583
|
isOpen
|
|
13448
13584
|
} = Downshift.useCombobox({
|
|
13449
13585
|
inputValue,
|
|
13450
|
-
items: items,
|
|
13586
|
+
items: items.reduce((acc, item) => [...acc, item, ...(item.children ? item.children : [])], []),
|
|
13451
13587
|
selectedItem: selectedValue,
|
|
13452
13588
|
itemToString: item => item ? item.name : '',
|
|
13453
13589
|
onStateChange: ({
|
|
@@ -13489,6 +13625,52 @@
|
|
|
13489
13625
|
setInputSelectValue(itemIds);
|
|
13490
13626
|
onChange === null || onChange === void 0 ? void 0 : onChange(itemIds.slice(1));
|
|
13491
13627
|
} else {
|
|
13628
|
+
var _selectedItem$childre;
|
|
13629
|
+
//start check if item have children (option group)
|
|
13630
|
+
if (selectedItem !== null && selectedItem !== void 0 && (_selectedItem$childre = selectedItem.children) !== null && _selectedItem$childre !== void 0 && _selectedItem$childre.length) {
|
|
13631
|
+
var _selectedItem$childre2;
|
|
13632
|
+
const itemIdsSelect = [];
|
|
13633
|
+
const itemIdsUnSelect = [];
|
|
13634
|
+
selectedItem === null || selectedItem === void 0 ? void 0 : (_selectedItem$childre2 = selectedItem.children) === null || _selectedItem$childre2 === void 0 ? void 0 : _selectedItem$childre2.forEach(item => {
|
|
13635
|
+
if (selectedValue !== null && selectedValue !== void 0 && selectedValue.includes(item.id)) {
|
|
13636
|
+
removeSelectedItem(item);
|
|
13637
|
+
itemIdsUnSelect.push(item.id);
|
|
13638
|
+
} else {
|
|
13639
|
+
addSelectedItem(item);
|
|
13640
|
+
itemIdsSelect.push(item.id);
|
|
13641
|
+
}
|
|
13642
|
+
});
|
|
13643
|
+
|
|
13644
|
+
//select all child in one of the option groups
|
|
13645
|
+
if (itemIdsSelect.length) {
|
|
13646
|
+
setSelectedValue([...selectedValue, ...itemIdsSelect]);
|
|
13647
|
+
setInputSelectValue([...selectedValue, ...itemIdsSelect]);
|
|
13648
|
+
const _filteredSelectedValues = selectedValue.filter(val => val !== '!all');
|
|
13649
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([..._filteredSelectedValues, ...itemIdsSelect]);
|
|
13650
|
+
}
|
|
13651
|
+
|
|
13652
|
+
//unselect all child in one of the option groups
|
|
13653
|
+
if (itemIdsUnSelect.length) {
|
|
13654
|
+
const newSelectedValue = selectedValue.filter(selId => {
|
|
13655
|
+
var _itemIdsUnSelect$filt;
|
|
13656
|
+
return ((_itemIdsUnSelect$filt = itemIdsUnSelect.filter(unselId => unselId === selId && unselId)) === null || _itemIdsUnSelect$filt === void 0 ? void 0 : _itemIdsUnSelect$filt[0]) !== selId && selId;
|
|
13657
|
+
});
|
|
13658
|
+
setSelectedValue(newSelectedValue);
|
|
13659
|
+
setInputSelectValue(newSelectedValue);
|
|
13660
|
+
const _filteredSelectedValues2 = newSelectedValue.filter(val => val !== '!all');
|
|
13661
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_filteredSelectedValues2);
|
|
13662
|
+
}
|
|
13663
|
+
return;
|
|
13664
|
+
}
|
|
13665
|
+
//end check if item have children (option group)
|
|
13666
|
+
|
|
13667
|
+
//start check the child from one of the option groups
|
|
13668
|
+
if (selectedValue.includes(selectedItem.id)) {
|
|
13669
|
+
removeItem(selectedItem);
|
|
13670
|
+
return;
|
|
13671
|
+
}
|
|
13672
|
+
//end check the child from one of the option groups
|
|
13673
|
+
|
|
13492
13674
|
addSelectedItem(selectedItem);
|
|
13493
13675
|
setSelectedValue([...selectedValue, selectedItem.id]);
|
|
13494
13676
|
setInputSelectValue([...selectedValue, selectedItem.id]);
|
|
@@ -13585,13 +13767,173 @@
|
|
|
13585
13767
|
}
|
|
13586
13768
|
};
|
|
13587
13769
|
const isShowTagSelectAll = showTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > (option === null || option === void 0 ? void 0 : option.length);
|
|
13770
|
+
const renderOptionItem = (item, index, asChild) => {
|
|
13771
|
+
var _item$render;
|
|
13772
|
+
return /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
13773
|
+
key: item.id
|
|
13774
|
+
}, getItemProps({
|
|
13775
|
+
item,
|
|
13776
|
+
index: index,
|
|
13777
|
+
disabled: item.isDisabled
|
|
13778
|
+
}), {
|
|
13779
|
+
css: {
|
|
13780
|
+
backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
|
|
13781
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer',
|
|
13782
|
+
color: item.isDisabled ? '$textDisable' : 'textPrimary',
|
|
13783
|
+
padding: asChild ? '0px $spacing-05' : 0
|
|
13784
|
+
},
|
|
13785
|
+
__self: undefined,
|
|
13786
|
+
__source: {
|
|
13787
|
+
fileName: _jsxFileName$w,
|
|
13788
|
+
lineNumber: 678,
|
|
13789
|
+
columnNumber: 9
|
|
13790
|
+
}
|
|
13791
|
+
}), /*#__PURE__*/React__default["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: 692,
|
|
13802
|
+
columnNumber: 11
|
|
13803
|
+
}
|
|
13804
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
13805
|
+
color: colors$8.iconDisable,
|
|
13806
|
+
__self: undefined,
|
|
13807
|
+
__source: {
|
|
13808
|
+
fileName: _jsxFileName$w,
|
|
13809
|
+
lineNumber: 702,
|
|
13810
|
+
columnNumber: 17
|
|
13811
|
+
}
|
|
13812
|
+
}) : selectedValue.includes(item.id) && (item.isDisabled === false || item.isDisabled === undefined) && /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
13813
|
+
color: colors$8.iconGreen,
|
|
13814
|
+
__self: undefined,
|
|
13815
|
+
__source: {
|
|
13816
|
+
fileName: _jsxFileName$w,
|
|
13817
|
+
lineNumber: 706,
|
|
13818
|
+
columnNumber: 19
|
|
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["default"].createElement(IndeterminateFilled$1, {
|
|
13821
|
+
__self: undefined,
|
|
13822
|
+
__source: {
|
|
13823
|
+
fileName: _jsxFileName$w,
|
|
13824
|
+
lineNumber: 713,
|
|
13825
|
+
columnNumber: 15
|
|
13826
|
+
}
|
|
13827
|
+
}, "-") : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
13828
|
+
__self: undefined,
|
|
13829
|
+
__source: {
|
|
13830
|
+
fileName: _jsxFileName$w,
|
|
13831
|
+
lineNumber: 715,
|
|
13832
|
+
columnNumber: 15
|
|
13833
|
+
}
|
|
13834
|
+
})), /*#__PURE__*/React__default["default"].createElement(Item$3, {
|
|
13835
|
+
css: {
|
|
13836
|
+
backgroundColor: 'unset',
|
|
13837
|
+
width: '100%'
|
|
13838
|
+
},
|
|
13839
|
+
__self: undefined,
|
|
13840
|
+
__source: {
|
|
13841
|
+
fileName: _jsxFileName$w,
|
|
13842
|
+
lineNumber: 718,
|
|
13843
|
+
columnNumber: 11
|
|
13844
|
+
}
|
|
13845
|
+
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
13846
|
+
};
|
|
13847
|
+
let optionGroupIndex = showSelectAll ? 1 : 0;
|
|
13848
|
+
const renderOptionGroupItem = (item, index) => {
|
|
13849
|
+
var _item$children2, _item$children3, _item$children3$filte, _item$render2, _item$children4;
|
|
13850
|
+
if (index > showSelectAll ? 1 : 0) {
|
|
13851
|
+
var _item$children;
|
|
13852
|
+
optionGroupIndex += (item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) + 1;
|
|
13853
|
+
}
|
|
13854
|
+
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);
|
|
13855
|
+
return /*#__PURE__*/React__default["default"].createElement(OptionGroupItem, {
|
|
13856
|
+
item: /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
13857
|
+
key: item.id
|
|
13858
|
+
}, getItemProps({
|
|
13859
|
+
item,
|
|
13860
|
+
index: optionGroupIndex,
|
|
13861
|
+
disabled: item.isDisabled
|
|
13862
|
+
}), {
|
|
13863
|
+
css: {
|
|
13864
|
+
backgroundColor: highlightedIndex === optionGroupIndex ? '$bgGray' : 'white',
|
|
13865
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer',
|
|
13866
|
+
color: item.isDisabled ? '$textDisable' : 'textPrimary'
|
|
13867
|
+
},
|
|
13868
|
+
__self: undefined,
|
|
13869
|
+
__source: {
|
|
13870
|
+
fileName: _jsxFileName$w,
|
|
13871
|
+
lineNumber: 735,
|
|
13872
|
+
columnNumber: 13
|
|
13873
|
+
}
|
|
13874
|
+
}), /*#__PURE__*/React__default["default"].createElement(IconWrapper, {
|
|
13875
|
+
css: {
|
|
13876
|
+
width: '16px',
|
|
13877
|
+
height: '16px',
|
|
13878
|
+
border: '1px solid $bgBorder',
|
|
13879
|
+
cursor: item.isDisabled ? 'not-allowed' : 'pointer'
|
|
13880
|
+
},
|
|
13881
|
+
__self: undefined,
|
|
13882
|
+
__source: {
|
|
13883
|
+
fileName: _jsxFileName$w,
|
|
13884
|
+
lineNumber: 748,
|
|
13885
|
+
columnNumber: 15
|
|
13886
|
+
}
|
|
13887
|
+
}, !(item !== null && item !== void 0 && item.hideCheck) && item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
13888
|
+
color: colors$8.iconDisable,
|
|
13889
|
+
__self: undefined,
|
|
13890
|
+
__source: {
|
|
13891
|
+
fileName: _jsxFileName$w,
|
|
13892
|
+
lineNumber: 757,
|
|
13893
|
+
columnNumber: 19
|
|
13894
|
+
}
|
|
13895
|
+
}) : (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["default"].createElement(CheckOutline, {
|
|
13896
|
+
color: colors$8.iconGreen,
|
|
13897
|
+
__self: undefined,
|
|
13898
|
+
__source: {
|
|
13899
|
+
fileName: _jsxFileName$w,
|
|
13900
|
+
lineNumber: 759,
|
|
13901
|
+
columnNumber: 19
|
|
13902
|
+
}
|
|
13903
|
+
}) : (filterSelectedChild === null || filterSelectedChild === void 0 ? void 0 : filterSelectedChild.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled$1, {
|
|
13904
|
+
__self: undefined,
|
|
13905
|
+
__source: {
|
|
13906
|
+
fileName: _jsxFileName$w,
|
|
13907
|
+
lineNumber: 761,
|
|
13908
|
+
columnNumber: 19
|
|
13909
|
+
}
|
|
13910
|
+
}, "-") : null), /*#__PURE__*/React__default["default"].createElement(Item$3, {
|
|
13911
|
+
css: {
|
|
13912
|
+
backgroundColor: 'unset',
|
|
13913
|
+
width: '100%'
|
|
13914
|
+
},
|
|
13915
|
+
__self: undefined,
|
|
13916
|
+
__source: {
|
|
13917
|
+
fileName: _jsxFileName$w,
|
|
13918
|
+
lineNumber: 764,
|
|
13919
|
+
columnNumber: 15
|
|
13920
|
+
}
|
|
13921
|
+
}, item.render ? (_item$render2 = item.render) === null || _item$render2 === void 0 ? void 0 : _item$render2.call(item, item.name) : item.name)),
|
|
13922
|
+
__self: undefined,
|
|
13923
|
+
__source: {
|
|
13924
|
+
fileName: _jsxFileName$w,
|
|
13925
|
+
lineNumber: 733,
|
|
13926
|
+
columnNumber: 9
|
|
13927
|
+
}
|
|
13928
|
+
}, 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)));
|
|
13929
|
+
};
|
|
13588
13930
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper$1, _extends({
|
|
13589
13931
|
css: css
|
|
13590
13932
|
}, props, {
|
|
13591
13933
|
__self: undefined,
|
|
13592
13934
|
__source: {
|
|
13593
13935
|
fileName: _jsxFileName$w,
|
|
13594
|
-
lineNumber:
|
|
13936
|
+
lineNumber: 776,
|
|
13595
13937
|
columnNumber: 7
|
|
13596
13938
|
}
|
|
13597
13939
|
}), /*#__PURE__*/React__default["default"].createElement(Select, {
|
|
@@ -13601,7 +13943,7 @@
|
|
|
13601
13943
|
__self: undefined,
|
|
13602
13944
|
__source: {
|
|
13603
13945
|
fileName: _jsxFileName$w,
|
|
13604
|
-
lineNumber:
|
|
13946
|
+
lineNumber: 777,
|
|
13605
13947
|
columnNumber: 9
|
|
13606
13948
|
}
|
|
13607
13949
|
}, /*#__PURE__*/React__default["default"].createElement(InputWrapper$1, _extends({}, getComboboxProps(getDropdownProps({
|
|
@@ -13616,7 +13958,7 @@
|
|
|
13616
13958
|
__self: undefined,
|
|
13617
13959
|
__source: {
|
|
13618
13960
|
fileName: _jsxFileName$w,
|
|
13619
|
-
lineNumber:
|
|
13961
|
+
lineNumber: 778,
|
|
13620
13962
|
columnNumber: 11
|
|
13621
13963
|
}
|
|
13622
13964
|
}), /*#__PURE__*/React__default["default"].createElement(Input$6, _extends({}, getInputProps({
|
|
@@ -13634,7 +13976,7 @@
|
|
|
13634
13976
|
__self: undefined,
|
|
13635
13977
|
__source: {
|
|
13636
13978
|
fileName: _jsxFileName$w,
|
|
13637
|
-
lineNumber:
|
|
13979
|
+
lineNumber: 788,
|
|
13638
13980
|
columnNumber: 13
|
|
13639
13981
|
}
|
|
13640
13982
|
})), /*#__PURE__*/React__default["default"].createElement(Button$2, _extends({}, getToggleButtonProps({
|
|
@@ -13647,7 +13989,7 @@
|
|
|
13647
13989
|
__self: undefined,
|
|
13648
13990
|
__source: {
|
|
13649
13991
|
fileName: _jsxFileName$w,
|
|
13650
|
-
lineNumber:
|
|
13992
|
+
lineNumber: 795,
|
|
13651
13993
|
columnNumber: 13
|
|
13652
13994
|
}
|
|
13653
13995
|
}), placeholder != null ? placeholder : t('placeholder', 'Pilih Item'))), /*#__PURE__*/React__default["default"].createElement(IconWrapper, _extends({}, getToggleButtonProps({
|
|
@@ -13658,7 +14000,7 @@
|
|
|
13658
14000
|
__self: undefined,
|
|
13659
14001
|
__source: {
|
|
13660
14002
|
fileName: _jsxFileName$w,
|
|
13661
|
-
lineNumber:
|
|
14003
|
+
lineNumber: 805,
|
|
13662
14004
|
columnNumber: 11
|
|
13663
14005
|
}
|
|
13664
14006
|
}), /*#__PURE__*/React__default["default"].createElement(IconCaretDown, {
|
|
@@ -13666,7 +14008,7 @@
|
|
|
13666
14008
|
__self: undefined,
|
|
13667
14009
|
__source: {
|
|
13668
14010
|
fileName: _jsxFileName$w,
|
|
13669
|
-
lineNumber:
|
|
14011
|
+
lineNumber: 810,
|
|
13670
14012
|
columnNumber: 13
|
|
13671
14013
|
}
|
|
13672
14014
|
}))), helperText && /*#__PURE__*/React__default["default"].createElement(Paragraph, {
|
|
@@ -13679,7 +14021,7 @@
|
|
|
13679
14021
|
__self: undefined,
|
|
13680
14022
|
__source: {
|
|
13681
14023
|
fileName: _jsxFileName$w,
|
|
13682
|
-
lineNumber:
|
|
14024
|
+
lineNumber: 814,
|
|
13683
14025
|
columnNumber: 11
|
|
13684
14026
|
}
|
|
13685
14027
|
}, helperText), showSelectedTag && !showCounter && selectedItems.length !== 0 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TagWrapper$2, {
|
|
@@ -13687,7 +14029,7 @@
|
|
|
13687
14029
|
__self: undefined,
|
|
13688
14030
|
__source: {
|
|
13689
14031
|
fileName: _jsxFileName$w,
|
|
13690
|
-
lineNumber:
|
|
14032
|
+
lineNumber: 820,
|
|
13691
14033
|
columnNumber: 13
|
|
13692
14034
|
}
|
|
13693
14035
|
}, isShowTagSelectAll ? /*#__PURE__*/React__default["default"].createElement(Tag, _extends({
|
|
@@ -13707,7 +14049,7 @@
|
|
|
13707
14049
|
__self: undefined,
|
|
13708
14050
|
__source: {
|
|
13709
14051
|
fileName: _jsxFileName$w,
|
|
13710
|
-
lineNumber:
|
|
14052
|
+
lineNumber: 822,
|
|
13711
14053
|
columnNumber: 17
|
|
13712
14054
|
}
|
|
13713
14055
|
}), 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) => {
|
|
@@ -13737,7 +14079,7 @@
|
|
|
13737
14079
|
__self: undefined,
|
|
13738
14080
|
__source: {
|
|
13739
14081
|
fileName: _jsxFileName$w,
|
|
13740
|
-
lineNumber:
|
|
14082
|
+
lineNumber: 850,
|
|
13741
14083
|
columnNumber: 21
|
|
13742
14084
|
}
|
|
13743
14085
|
}), selectedItem.name))), collapsible && !isShowTagSelectAll && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > 5 && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
@@ -13746,7 +14088,7 @@
|
|
|
13746
14088
|
__self: undefined,
|
|
13747
14089
|
__source: {
|
|
13748
14090
|
fileName: _jsxFileName$w,
|
|
13749
|
-
lineNumber:
|
|
14091
|
+
lineNumber: 872,
|
|
13750
14092
|
columnNumber: 15
|
|
13751
14093
|
}
|
|
13752
14094
|
}, /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
@@ -13756,14 +14098,14 @@
|
|
|
13756
14098
|
__self: undefined,
|
|
13757
14099
|
__source: {
|
|
13758
14100
|
fileName: _jsxFileName$w,
|
|
13759
|
-
lineNumber:
|
|
14101
|
+
lineNumber: 873,
|
|
13760
14102
|
columnNumber: 17
|
|
13761
14103
|
}
|
|
13762
14104
|
}, /*#__PURE__*/React__default["default"].createElement(Separator$2, {
|
|
13763
14105
|
__self: undefined,
|
|
13764
14106
|
__source: {
|
|
13765
14107
|
fileName: _jsxFileName$w,
|
|
13766
|
-
lineNumber:
|
|
14108
|
+
lineNumber: 874,
|
|
13767
14109
|
columnNumber: 19
|
|
13768
14110
|
}
|
|
13769
14111
|
}), /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
@@ -13777,7 +14119,7 @@
|
|
|
13777
14119
|
__self: undefined,
|
|
13778
14120
|
__source: {
|
|
13779
14121
|
fileName: _jsxFileName$w,
|
|
13780
|
-
lineNumber:
|
|
14122
|
+
lineNumber: 875,
|
|
13781
14123
|
columnNumber: 19
|
|
13782
14124
|
}
|
|
13783
14125
|
}, showAllTags ? /*#__PURE__*/React__default["default"].createElement(icons.ChevronUpOutline, {
|
|
@@ -13785,7 +14127,7 @@
|
|
|
13785
14127
|
__self: undefined,
|
|
13786
14128
|
__source: {
|
|
13787
14129
|
fileName: _jsxFileName$w,
|
|
13788
|
-
lineNumber:
|
|
14130
|
+
lineNumber: 881,
|
|
13789
14131
|
columnNumber: 23
|
|
13790
14132
|
}
|
|
13791
14133
|
}) : /*#__PURE__*/React__default["default"].createElement(icons.ChevronDownOutline, {
|
|
@@ -13793,7 +14135,7 @@
|
|
|
13793
14135
|
__self: undefined,
|
|
13794
14136
|
__source: {
|
|
13795
14137
|
fileName: _jsxFileName$w,
|
|
13796
|
-
lineNumber:
|
|
14138
|
+
lineNumber: 883,
|
|
13797
14139
|
columnNumber: 23
|
|
13798
14140
|
}
|
|
13799
14141
|
}), /*#__PURE__*/React__default["default"].createElement(Paragraph, {
|
|
@@ -13805,14 +14147,14 @@
|
|
|
13805
14147
|
__self: undefined,
|
|
13806
14148
|
__source: {
|
|
13807
14149
|
fileName: _jsxFileName$w,
|
|
13808
|
-
lineNumber:
|
|
14150
|
+
lineNumber: 885,
|
|
13809
14151
|
columnNumber: 21
|
|
13810
14152
|
}
|
|
13811
14153
|
}, showAllTags ? t('showSomeText', 'Tampilkan Sebagian') : t('showAllText', 'Tampilkan Semua'))), /*#__PURE__*/React__default["default"].createElement(Separator$2, {
|
|
13812
14154
|
__self: undefined,
|
|
13813
14155
|
__source: {
|
|
13814
14156
|
fileName: _jsxFileName$w,
|
|
13815
|
-
lineNumber:
|
|
14157
|
+
lineNumber: 889,
|
|
13816
14158
|
columnNumber: 19
|
|
13817
14159
|
}
|
|
13818
14160
|
})), /*#__PURE__*/React__default["default"].createElement(Paragraph, {
|
|
@@ -13823,7 +14165,7 @@
|
|
|
13823
14165
|
__self: undefined,
|
|
13824
14166
|
__source: {
|
|
13825
14167
|
fileName: _jsxFileName$w,
|
|
13826
|
-
lineNumber:
|
|
14168
|
+
lineNumber: 891,
|
|
13827
14169
|
columnNumber: 17
|
|
13828
14170
|
}
|
|
13829
14171
|
}, `${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["default"].createElement(Paragraph, {
|
|
@@ -13835,7 +14177,7 @@
|
|
|
13835
14177
|
__self: undefined,
|
|
13836
14178
|
__source: {
|
|
13837
14179
|
fileName: _jsxFileName$w,
|
|
13838
|
-
lineNumber:
|
|
14180
|
+
lineNumber: 901,
|
|
13839
14181
|
columnNumber: 11
|
|
13840
14182
|
}
|
|
13841
14183
|
}, `${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["default"].createElement(OptionWrapper$1, {
|
|
@@ -13848,7 +14190,7 @@
|
|
|
13848
14190
|
__self: undefined,
|
|
13849
14191
|
__source: {
|
|
13850
14192
|
fileName: _jsxFileName$w,
|
|
13851
|
-
lineNumber:
|
|
14193
|
+
lineNumber: 908,
|
|
13852
14194
|
columnNumber: 9
|
|
13853
14195
|
}
|
|
13854
14196
|
}, isLoading && /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
@@ -13870,7 +14212,7 @@
|
|
|
13870
14212
|
__self: undefined,
|
|
13871
14213
|
__source: {
|
|
13872
14214
|
fileName: _jsxFileName$w,
|
|
13873
|
-
lineNumber:
|
|
14215
|
+
lineNumber: 918,
|
|
13874
14216
|
columnNumber: 13
|
|
13875
14217
|
}
|
|
13876
14218
|
}, /*#__PURE__*/React__default["default"].createElement(Text$1, {
|
|
@@ -13878,7 +14220,7 @@
|
|
|
13878
14220
|
__self: undefined,
|
|
13879
14221
|
__source: {
|
|
13880
14222
|
fileName: _jsxFileName$w,
|
|
13881
|
-
lineNumber:
|
|
14223
|
+
lineNumber: 935,
|
|
13882
14224
|
columnNumber: 15
|
|
13883
14225
|
}
|
|
13884
14226
|
}, "Loading....")), items.length > 0 || isLoading ? /*#__PURE__*/React__default["default"].createElement(Option, _extends({}, getMenuProps({
|
|
@@ -13889,7 +14231,7 @@
|
|
|
13889
14231
|
__self: undefined,
|
|
13890
14232
|
__source: {
|
|
13891
14233
|
fileName: _jsxFileName$w,
|
|
13892
|
-
lineNumber:
|
|
14234
|
+
lineNumber: 941,
|
|
13893
14235
|
columnNumber: 13
|
|
13894
14236
|
}
|
|
13895
14237
|
}), /*#__PURE__*/React__default["default"].createElement(ConditionalWrapper, {
|
|
@@ -13904,92 +14246,17 @@
|
|
|
13904
14246
|
__self: undefined,
|
|
13905
14247
|
__source: {
|
|
13906
14248
|
fileName: _jsxFileName$w,
|
|
13907
|
-
lineNumber:
|
|
14249
|
+
lineNumber: 945,
|
|
13908
14250
|
columnNumber: 19
|
|
13909
14251
|
}
|
|
13910
14252
|
}, child),
|
|
13911
14253
|
__self: undefined,
|
|
13912
14254
|
__source: {
|
|
13913
14255
|
fileName: _jsxFileName$w,
|
|
13914
|
-
lineNumber:
|
|
14256
|
+
lineNumber: 942,
|
|
13915
14257
|
columnNumber: 15
|
|
13916
14258
|
}
|
|
13917
|
-
}, isOpen && items.map((item, index) => {
|
|
13918
|
-
var _item$render;
|
|
13919
|
-
return /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
|
|
13920
|
-
key: item.id
|
|
13921
|
-
}, getItemProps({
|
|
13922
|
-
item,
|
|
13923
|
-
index: index,
|
|
13924
|
-
disabled: item.isDisabled
|
|
13925
|
-
}), {
|
|
13926
|
-
css: {
|
|
13927
|
-
backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
|
|
13928
|
-
cursor: item.isDisabled ? 'not-allowed' : 'pointer',
|
|
13929
|
-
color: item.isDisabled ? '$textDisable' : 'textPrimary'
|
|
13930
|
-
},
|
|
13931
|
-
__self: undefined,
|
|
13932
|
-
__source: {
|
|
13933
|
-
fileName: _jsxFileName$w,
|
|
13934
|
-
lineNumber: 807,
|
|
13935
|
-
columnNumber: 21
|
|
13936
|
-
}
|
|
13937
|
-
}), /*#__PURE__*/React__default["default"].createElement(IconWrapper, {
|
|
13938
|
-
css: {
|
|
13939
|
-
width: '16px',
|
|
13940
|
-
height: '16px',
|
|
13941
|
-
border: '1px solid $bgBorder',
|
|
13942
|
-
cursor: item.isDisabled ? 'not-allowed' : 'pointer'
|
|
13943
|
-
},
|
|
13944
|
-
__self: undefined,
|
|
13945
|
-
__source: {
|
|
13946
|
-
fileName: _jsxFileName$w,
|
|
13947
|
-
lineNumber: 820,
|
|
13948
|
-
columnNumber: 23
|
|
13949
|
-
}
|
|
13950
|
-
}, !(item !== null && item !== void 0 && item.hideCheck) && (item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
13951
|
-
color: colors$8.iconDisable,
|
|
13952
|
-
__self: undefined,
|
|
13953
|
-
__source: {
|
|
13954
|
-
fileName: _jsxFileName$w,
|
|
13955
|
-
lineNumber: 830,
|
|
13956
|
-
columnNumber: 29
|
|
13957
|
-
}
|
|
13958
|
-
}) : selectedValue.includes(item.id) && (item.isDisabled === false || item.isDisabled === undefined) && /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
|
|
13959
|
-
color: colors$8.iconGreen,
|
|
13960
|
-
__self: undefined,
|
|
13961
|
-
__source: {
|
|
13962
|
-
fileName: _jsxFileName$w,
|
|
13963
|
-
lineNumber: 834,
|
|
13964
|
-
columnNumber: 31
|
|
13965
|
-
}
|
|
13966
|
-
})), 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["default"].createElement(IndeterminateFilled$1, {
|
|
13967
|
-
__self: undefined,
|
|
13968
|
-
__source: {
|
|
13969
|
-
fileName: _jsxFileName$w,
|
|
13970
|
-
lineNumber: 841,
|
|
13971
|
-
columnNumber: 27
|
|
13972
|
-
}
|
|
13973
|
-
}, "-") : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
13974
|
-
__self: undefined,
|
|
13975
|
-
__source: {
|
|
13976
|
-
fileName: _jsxFileName$w,
|
|
13977
|
-
lineNumber: 843,
|
|
13978
|
-
columnNumber: 27
|
|
13979
|
-
}
|
|
13980
|
-
})), /*#__PURE__*/React__default["default"].createElement(Item$3, {
|
|
13981
|
-
css: {
|
|
13982
|
-
backgroundColor: 'unset',
|
|
13983
|
-
width: '100%'
|
|
13984
|
-
},
|
|
13985
|
-
__self: undefined,
|
|
13986
|
-
__source: {
|
|
13987
|
-
fileName: _jsxFileName$w,
|
|
13988
|
-
lineNumber: 846,
|
|
13989
|
-
columnNumber: 23
|
|
13990
|
-
}
|
|
13991
|
-
}, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
|
|
13992
|
-
}))) : /*#__PURE__*/React__default["default"].createElement(Option, _extends({
|
|
14259
|
+
}, isOpen && items.map((item, index) => item !== null && item !== void 0 && item.children ? renderOptionGroupItem(item, index) : renderOptionItem(item, index)))) : /*#__PURE__*/React__default["default"].createElement(Option, _extends({
|
|
13993
14260
|
css: {
|
|
13994
14261
|
height: 'auto'
|
|
13995
14262
|
}
|
|
@@ -13999,14 +14266,14 @@
|
|
|
13999
14266
|
__self: undefined,
|
|
14000
14267
|
__source: {
|
|
14001
14268
|
fileName: _jsxFileName$w,
|
|
14002
|
-
lineNumber:
|
|
14269
|
+
lineNumber: 962,
|
|
14003
14270
|
columnNumber: 13
|
|
14004
14271
|
}
|
|
14005
14272
|
}), /*#__PURE__*/React__default["default"].createElement(StyledDiv, {
|
|
14006
14273
|
__self: undefined,
|
|
14007
14274
|
__source: {
|
|
14008
14275
|
fileName: _jsxFileName$w,
|
|
14009
|
-
lineNumber:
|
|
14276
|
+
lineNumber: 963,
|
|
14010
14277
|
columnNumber: 15
|
|
14011
14278
|
}
|
|
14012
14279
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -14016,7 +14283,7 @@
|
|
|
14016
14283
|
__self: undefined,
|
|
14017
14284
|
__source: {
|
|
14018
14285
|
fileName: _jsxFileName$w,
|
|
14019
|
-
lineNumber:
|
|
14286
|
+
lineNumber: 964,
|
|
14020
14287
|
columnNumber: 17
|
|
14021
14288
|
}
|
|
14022
14289
|
}, /*#__PURE__*/React__default["default"].createElement(icons.CircleInfoOutline, {
|
|
@@ -14028,7 +14295,7 @@
|
|
|
14028
14295
|
__self: undefined,
|
|
14029
14296
|
__source: {
|
|
14030
14297
|
fileName: _jsxFileName$w,
|
|
14031
|
-
lineNumber:
|
|
14298
|
+
lineNumber: 965,
|
|
14032
14299
|
columnNumber: 19
|
|
14033
14300
|
}
|
|
14034
14301
|
})), textEmptyItem != null ? textEmptyItem : t('emptyItemText', 'Item tidak ditemukan')))));
|
|
@@ -19619,7 +19886,7 @@
|
|
|
19619
19886
|
display: 'none'
|
|
19620
19887
|
}
|
|
19621
19888
|
});
|
|
19622
|
-
const StyledTrigger
|
|
19889
|
+
const StyledTrigger = styled(TabsPrimitive__namespace.Trigger, {
|
|
19623
19890
|
all: 'unset',
|
|
19624
19891
|
fontFamily: 'inherit',
|
|
19625
19892
|
backgroundColor: 'white',
|
|
@@ -19850,7 +20117,7 @@
|
|
|
19850
20117
|
} = _ref3,
|
|
19851
20118
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$1);
|
|
19852
20119
|
const [isIconHovered, setIsIconHovered] = React.useState(false);
|
|
19853
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledTrigger
|
|
20120
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledTrigger, _extends({
|
|
19854
20121
|
value: value
|
|
19855
20122
|
}, props, {
|
|
19856
20123
|
__self: undefined,
|
|
@@ -20505,106 +20772,6 @@
|
|
|
20505
20772
|
layer: '$modal'
|
|
20506
20773
|
};
|
|
20507
20774
|
|
|
20508
|
-
var StyledAccordion = styled(AccordionPrimitive__namespace.Root, {});
|
|
20509
|
-
var Accordion = /*#__PURE__*/React__namespace.forwardRef(function (_a, forwardedRef) {
|
|
20510
|
-
var children = _a.children,
|
|
20511
|
-
props = __rest(_a, ["children"]);
|
|
20512
|
-
return jsxRuntime.jsx(StyledAccordion, __assign({
|
|
20513
|
-
ref: forwardedRef
|
|
20514
|
-
}, props, props.type === 'single' ? {
|
|
20515
|
-
collapsible: true
|
|
20516
|
-
} : {}, {
|
|
20517
|
-
children: children
|
|
20518
|
-
}), void 0);
|
|
20519
|
-
});
|
|
20520
|
-
var StyledItem$1 = styled(AccordionPrimitive__namespace.Item, {
|
|
20521
|
-
borderTop: '1px solid $colors$slate6',
|
|
20522
|
-
'&:last-of-type': {
|
|
20523
|
-
borderBottom: '1px solid $colors$slate6'
|
|
20524
|
-
}
|
|
20525
|
-
});
|
|
20526
|
-
var StyledHeader = styled(AccordionPrimitive__namespace.Header, {
|
|
20527
|
-
all: 'unset'
|
|
20528
|
-
});
|
|
20529
|
-
var StyledTrigger = styled(AccordionPrimitive__namespace.Trigger, {
|
|
20530
|
-
all: 'unset',
|
|
20531
|
-
boxSizing: 'border-box',
|
|
20532
|
-
userSelect: 'none',
|
|
20533
|
-
'&::before': {
|
|
20534
|
-
boxSizing: 'border-box'
|
|
20535
|
-
},
|
|
20536
|
-
'&::after': {
|
|
20537
|
-
boxSizing: 'border-box'
|
|
20538
|
-
},
|
|
20539
|
-
cursor: 'pointer',
|
|
20540
|
-
display: 'flex',
|
|
20541
|
-
alignItems: 'center',
|
|
20542
|
-
color: '$hiContrast',
|
|
20543
|
-
width: '100%',
|
|
20544
|
-
'@hover': {
|
|
20545
|
-
'&:hover': {
|
|
20546
|
-
backgroundColor: '$slate2'
|
|
20547
|
-
}
|
|
20548
|
-
},
|
|
20549
|
-
'&:focus': {
|
|
20550
|
-
outline: 'none',
|
|
20551
|
-
boxShadow: 'inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8'
|
|
20552
|
-
},
|
|
20553
|
-
'& svg.icon-cdf': {
|
|
20554
|
-
color: '$white',
|
|
20555
|
-
size: '24px',
|
|
20556
|
-
transition: 'transform 175ms cubic-bezier(0.65, 0, 0.35, 1)'
|
|
20557
|
-
},
|
|
20558
|
-
'& svg.right': {
|
|
20559
|
-
marginRight: '$spacing-05'
|
|
20560
|
-
},
|
|
20561
|
-
'&[data-state="open"]': {
|
|
20562
|
-
'& svg.icon-cdf': {
|
|
20563
|
-
transform: 'rotate(180deg)'
|
|
20564
|
-
}
|
|
20565
|
-
},
|
|
20566
|
-
variants: {
|
|
20567
|
-
arrowPosition: {
|
|
20568
|
-
right: {
|
|
20569
|
-
justifyContent: 'space-between'
|
|
20570
|
-
},
|
|
20571
|
-
left: {
|
|
20572
|
-
justifyContent: 'start'
|
|
20573
|
-
}
|
|
20574
|
-
}
|
|
20575
|
-
}
|
|
20576
|
-
});
|
|
20577
|
-
var AccordionTrigger = /*#__PURE__*/React__namespace.forwardRef(function (_a, forwardedRef) {
|
|
20578
|
-
var children = _a.children,
|
|
20579
|
-
_b = _a.arrowPosition,
|
|
20580
|
-
arrowPosition = _b === void 0 ? 'right' : _b,
|
|
20581
|
-
_c = _a.hasContent,
|
|
20582
|
-
hasContent = _c === void 0 ? true : _c,
|
|
20583
|
-
_d = _a.arrowColor,
|
|
20584
|
-
arrowColor = _d === void 0 ? 'white' : _d,
|
|
20585
|
-
props = __rest(_a, ["children", "arrowPosition", "hasContent", "arrowColor"]);
|
|
20586
|
-
return jsxRuntime.jsx(StyledHeader, {
|
|
20587
|
-
children: jsxRuntime.jsx(StyledTrigger, __assign({}, props, {
|
|
20588
|
-
arrowPosition: arrowPosition,
|
|
20589
|
-
ref: forwardedRef
|
|
20590
|
-
}, {
|
|
20591
|
-
children: arrowPosition === 'right' ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
20592
|
-
children: [children, hasContent && jsxRuntime.jsx(icons.ChevronDownOutline, {
|
|
20593
|
-
className: "icon-cdf right",
|
|
20594
|
-
color: arrowColor
|
|
20595
|
-
}, void 0)]
|
|
20596
|
-
}, void 0) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
20597
|
-
children: [hasContent && jsxRuntime.jsx(icons.ChevronDownOutline, {
|
|
20598
|
-
className: "icon-cdf left",
|
|
20599
|
-
color: arrowColor
|
|
20600
|
-
}, void 0), children]
|
|
20601
|
-
}, void 0)
|
|
20602
|
-
}), void 0)
|
|
20603
|
-
}, void 0);
|
|
20604
|
-
});
|
|
20605
|
-
var AccordionItem = StyledItem$1;
|
|
20606
|
-
var AccordionContent = AccordionPrimitive__namespace.Content;
|
|
20607
|
-
|
|
20608
20775
|
const removeUndefinedFields = obj => {
|
|
20609
20776
|
let newObj = {};
|
|
20610
20777
|
Object.keys(obj).forEach(key => {
|
|
@@ -22669,7 +22836,7 @@
|
|
|
22669
22836
|
}, [selectedRowIds]);
|
|
22670
22837
|
reactTable.useMountedLayoutEffect(function () {
|
|
22671
22838
|
stateSelectedRowIds.length && (onSelectedChange === null || onSelectedChange === void 0 ? void 0 : onSelectedChange(stateSelectedRowIds));
|
|
22672
|
-
}, [
|
|
22839
|
+
}, [stateSelectedRowIds]);
|
|
22673
22840
|
React.useEffect(function () {
|
|
22674
22841
|
var _a;
|
|
22675
22842
|
if (isInfiniteScroll && rawData.length <= rowLimit) {
|
|
@@ -32464,12 +32631,16 @@
|
|
|
32464
32631
|
color: '$textRed !important'
|
|
32465
32632
|
});
|
|
32466
32633
|
function EditableTableMobile(props) {
|
|
32467
|
-
var
|
|
32634
|
+
var _a, _b;
|
|
32635
|
+
var rowVirtualizer = props.rowVirtualizer,
|
|
32636
|
+
tableContainerRef = props.tableContainerRef,
|
|
32637
|
+
instance = props.instance,
|
|
32468
32638
|
showCheckbox = props.showCheckbox,
|
|
32469
32639
|
customRows = props.customRows,
|
|
32470
32640
|
onExpand = props.onExpand,
|
|
32471
32641
|
hiddenColumns = props.hiddenColumns,
|
|
32472
|
-
customEmptyDataProps = props.customEmptyDataProps
|
|
32642
|
+
customEmptyDataProps = props.customEmptyDataProps,
|
|
32643
|
+
virtualized = props.virtualized;
|
|
32473
32644
|
var getTableProps = instance.getTableProps,
|
|
32474
32645
|
getTableBodyProps = instance.getTableBodyProps,
|
|
32475
32646
|
headerGroups = instance.headerGroups,
|
|
@@ -32511,121 +32682,129 @@
|
|
|
32511
32682
|
showInMobile: showInMobile
|
|
32512
32683
|
};
|
|
32513
32684
|
};
|
|
32514
|
-
var renderTableRow = function renderTableRow(row,
|
|
32685
|
+
var renderTableRow = function renderTableRow(row, customStyle) {
|
|
32686
|
+
var _a;
|
|
32515
32687
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
32516
|
-
children: [
|
|
32688
|
+
children: [jsxRuntime.jsx(TableRow$2, __assign({
|
|
32517
32689
|
css: customStyle
|
|
32518
32690
|
}, row.getRowProps(), {
|
|
32519
|
-
|
|
32520
|
-
|
|
32521
|
-
|
|
32522
|
-
|
|
32523
|
-
|
|
32524
|
-
|
|
32525
|
-
|
|
32526
|
-
|
|
32527
|
-
|
|
32528
|
-
|
|
32529
|
-
}
|
|
32530
|
-
|
|
32531
|
-
|
|
32532
|
-
}), jsxRuntime.jsxs(Flex$1, __assign({
|
|
32533
|
-
align: "center",
|
|
32534
|
-
justify: "between",
|
|
32535
|
-
css: {
|
|
32536
|
-
cursor: 'pointer',
|
|
32537
|
-
minHeight: 40
|
|
32538
|
-
}
|
|
32539
|
-
}, {
|
|
32540
|
-
children: [jsxRuntime.jsx(Box, {
|
|
32541
|
-
children: cell.render('Cell')
|
|
32542
|
-
}, void 0), !isSelector && jsxRuntime.jsx(Flex$1, __assign({
|
|
32543
|
-
justify: "center",
|
|
32691
|
+
children: row.cells.map(function (cell, index) {
|
|
32692
|
+
var _a, _b;
|
|
32693
|
+
var isMobileHeader = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.isMobileHeader;
|
|
32694
|
+
var isSelector = ((_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.id) === 'selection';
|
|
32695
|
+
return (isMobileHeader || isSelector) && /*#__PURE__*/React.createElement(TableCell$2, __assign({}, cell.getCellProps({
|
|
32696
|
+
style: {
|
|
32697
|
+
minWidth: cell.column.minWidth,
|
|
32698
|
+
width: isSelector ? 10 : cell.column.width,
|
|
32699
|
+
maxWidth: isSelector ? 10 : cell.column.maxWidth
|
|
32700
|
+
}
|
|
32701
|
+
}), {
|
|
32702
|
+
key: "cell-body-".concat(index)
|
|
32703
|
+
}), jsxRuntime.jsxs(Flex$1, __assign({
|
|
32544
32704
|
align: "center",
|
|
32545
|
-
|
|
32546
|
-
|
|
32547
|
-
|
|
32548
|
-
|
|
32549
|
-
}
|
|
32550
|
-
row.toggleRowExpanded(!row.isExpanded);
|
|
32551
|
-
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!row.isExpanded);
|
|
32705
|
+
justify: "between",
|
|
32706
|
+
css: {
|
|
32707
|
+
cursor: 'pointer',
|
|
32708
|
+
minHeight: 40
|
|
32552
32709
|
}
|
|
32553
32710
|
}, {
|
|
32554
|
-
children:
|
|
32555
|
-
|
|
32556
|
-
|
|
32557
|
-
|
|
32558
|
-
|
|
32711
|
+
children: [jsxRuntime.jsx(Box, {
|
|
32712
|
+
children: cell.render('Cell')
|
|
32713
|
+
}, void 0), !isSelector && jsxRuntime.jsx(Flex$1, __assign({
|
|
32714
|
+
justify: "center",
|
|
32715
|
+
align: "center",
|
|
32716
|
+
onClick: function () {
|
|
32717
|
+
var _a;
|
|
32718
|
+
if (!((_a = Object.keys(state.expanded)) === null || _a === void 0 ? void 0 : _a.includes(row.id))) {
|
|
32719
|
+
toggleAllRowsExpanded(false);
|
|
32720
|
+
}
|
|
32721
|
+
row.toggleRowExpanded(!row.isExpanded);
|
|
32722
|
+
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!row.isExpanded);
|
|
32723
|
+
}
|
|
32724
|
+
}, {
|
|
32725
|
+
children: row.isExpanded ? jsxRuntime.jsx(icons.ChevronUpOutline, {}, void 0) : jsxRuntime.jsx(icons.ChevronDownOutline, {}, void 0)
|
|
32726
|
+
}), void 0)]
|
|
32727
|
+
}), void 0));
|
|
32728
|
+
})
|
|
32729
|
+
}), void 0), jsxRuntime.jsxs(TableRowCollapse, __assign({
|
|
32559
32730
|
css: {
|
|
32560
32731
|
backgroundColor: '$gray50'
|
|
32561
32732
|
}
|
|
32562
|
-
}
|
|
32563
|
-
children: jsxRuntime.jsx(
|
|
32564
|
-
|
|
32565
|
-
|
|
32566
|
-
children: jsxRuntime.jsx(Flex$1, __assign({
|
|
32567
|
-
direction: "column",
|
|
32568
|
-
css: {
|
|
32569
|
-
borderTop: '1pt solid $bgBorder'
|
|
32570
|
-
}
|
|
32733
|
+
}, {
|
|
32734
|
+
children: [showCheckbox && jsxRuntime.jsx(TableCell$2, {}, void 0), jsxRuntime.jsx(TableCellCollapse, {
|
|
32735
|
+
children: jsxRuntime.jsx(Collapalse, __assign({
|
|
32736
|
+
isOpen: row.isExpanded
|
|
32571
32737
|
}, {
|
|
32572
|
-
children:
|
|
32573
|
-
|
|
32574
|
-
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
|
|
32579
|
-
|
|
32580
|
-
|
|
32581
|
-
|
|
32582
|
-
|
|
32583
|
-
|
|
32584
|
-
|
|
32585
|
-
|
|
32586
|
-
|
|
32587
|
-
|
|
32588
|
-
|
|
32589
|
-
children: jsxRuntime.jsxs(Grid, __assign({
|
|
32590
|
-
columns: 6,
|
|
32591
|
-
flow: "row",
|
|
32738
|
+
children: jsxRuntime.jsx(Flex$1, __assign({
|
|
32739
|
+
direction: "column",
|
|
32740
|
+
css: {
|
|
32741
|
+
borderTop: '1pt solid $bgBorder'
|
|
32742
|
+
}
|
|
32743
|
+
}, {
|
|
32744
|
+
children: row.cells.filter(function (cell) {
|
|
32745
|
+
var _a, _b, _c, _d;
|
|
32746
|
+
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));
|
|
32747
|
+
}).map(function (cell, index) {
|
|
32748
|
+
var _a, _b, _c, _d;
|
|
32749
|
+
var headerRender = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.Header;
|
|
32750
|
+
var isMobileHeader = (_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.isMobileHeader;
|
|
32751
|
+
var isSelector = ((_c = cell === null || cell === void 0 ? void 0 : cell.column) === null || _c === void 0 ? void 0 : _c.id) === 'selection';
|
|
32752
|
+
return !isMobileHeader && !isSelector && jsxRuntime.jsx(Flex$1, __assign({
|
|
32753
|
+
direction: "column",
|
|
32754
|
+
justify: "center",
|
|
32592
32755
|
css: {
|
|
32593
|
-
|
|
32594
|
-
|
|
32595
|
-
|
|
32756
|
+
borderBottom: '1pt solid $bgBorder',
|
|
32757
|
+
padding: '10px 12px',
|
|
32758
|
+
minHeight: 52
|
|
32596
32759
|
}
|
|
32597
32760
|
}, {
|
|
32598
|
-
children:
|
|
32599
|
-
|
|
32761
|
+
children: jsxRuntime.jsxs(Grid, __assign({
|
|
32762
|
+
columns: 6,
|
|
32763
|
+
flow: "row",
|
|
32764
|
+
css: {
|
|
32765
|
+
gridRowGap: '$spacing-04',
|
|
32766
|
+
gridColumnGap: '$spacing-04',
|
|
32767
|
+
alignItems: 'center'
|
|
32768
|
+
}
|
|
32600
32769
|
}, {
|
|
32601
|
-
children: jsxRuntime.jsx(
|
|
32602
|
-
|
|
32603
|
-
color: "secondary"
|
|
32770
|
+
children: [jsxRuntime.jsx(GridItem, __assign({
|
|
32771
|
+
colSpan: 3
|
|
32604
32772
|
}, {
|
|
32605
|
-
children:
|
|
32606
|
-
|
|
32607
|
-
|
|
32608
|
-
|
|
32609
|
-
|
|
32610
|
-
|
|
32611
|
-
|
|
32612
|
-
|
|
32613
|
-
|
|
32614
|
-
|
|
32615
|
-
|
|
32773
|
+
children: jsxRuntime.jsx(Heading, __assign({
|
|
32774
|
+
heading: "headerTable",
|
|
32775
|
+
color: "secondary"
|
|
32776
|
+
}, {
|
|
32777
|
+
children: typeof headerRender === 'string' ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
32778
|
+
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) ? jsxRuntime.jsx(Required$2, {
|
|
32779
|
+
children: "*"
|
|
32780
|
+
}, void 0) : '']
|
|
32781
|
+
}, void 0) : headerRender
|
|
32782
|
+
}), void 0)
|
|
32783
|
+
}), void 0), jsxRuntime.jsx(GridItem, __assign({
|
|
32784
|
+
colSpan: 3
|
|
32616
32785
|
}, {
|
|
32617
|
-
children:
|
|
32618
|
-
|
|
32619
|
-
|
|
32620
|
-
|
|
32621
|
-
|
|
32622
|
-
|
|
32786
|
+
children: jsxRuntime.jsx(Flex$1, __assign({
|
|
32787
|
+
justify: "end"
|
|
32788
|
+
}, {
|
|
32789
|
+
children: cell.render('Cell')
|
|
32790
|
+
}), void 0)
|
|
32791
|
+
}), void 0)]
|
|
32792
|
+
}), void 0)
|
|
32793
|
+
}), "cell-collapse-".concat(index));
|
|
32794
|
+
})
|
|
32795
|
+
}), void 0)
|
|
32623
32796
|
}), void 0)
|
|
32624
|
-
}
|
|
32625
|
-
}, void 0))]
|
|
32797
|
+
}, void 0)]
|
|
32798
|
+
}), 'row-collapse-' + ((_a = row.getRowProps()) === null || _a === void 0 ? void 0 : _a.key))]
|
|
32626
32799
|
}, void 0);
|
|
32627
32800
|
};
|
|
32801
|
+
var virtualRows = rowVirtualizer.virtualItems,
|
|
32802
|
+
totalSize = rowVirtualizer.totalSize;
|
|
32803
|
+
var paddingTop = virtualRows.length > 0 ? ((_a = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
32804
|
+
var 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;
|
|
32805
|
+
var tableRowData = virtualized ? virtualRows : rows;
|
|
32628
32806
|
return jsxRuntime.jsx(TableContainer$2, __assign({
|
|
32807
|
+
ref: tableContainerRef,
|
|
32629
32808
|
css: props === null || props === void 0 ? void 0 : props.css
|
|
32630
32809
|
}, {
|
|
32631
32810
|
children: jsxRuntime.jsxs(TableContent$2, __assign({}, getTableProps(), {
|
|
@@ -32636,7 +32815,7 @@
|
|
|
32636
32815
|
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));
|
|
32637
32816
|
});
|
|
32638
32817
|
return /*#__PURE__*/React.createElement(TableHeadRow$2, __assign({}, headerGroup.getHeaderGroupProps(), {
|
|
32639
|
-
key: index
|
|
32818
|
+
key: "head-row-".concat(index)
|
|
32640
32819
|
}), visibleHeaders.map(function (column, index) {
|
|
32641
32820
|
var isMobileHeader = column === null || column === void 0 ? void 0 : column.isMobileHeader;
|
|
32642
32821
|
var isSelector = (column === null || column === void 0 ? void 0 : column.id) === 'selection';
|
|
@@ -32647,27 +32826,40 @@
|
|
|
32647
32826
|
maxWidth: isSelector ? 10 : column.maxWidth
|
|
32648
32827
|
}
|
|
32649
32828
|
}), {
|
|
32650
|
-
key: index
|
|
32829
|
+
key: "head-cell-".concat(index)
|
|
32651
32830
|
}), column.render('Header'), (column === null || column === void 0 ? void 0 : column.isRequired) ? jsxRuntime.jsx(Required$2, {
|
|
32652
32831
|
children: "*"
|
|
32653
32832
|
}, void 0) : '');
|
|
32654
32833
|
}));
|
|
32655
32834
|
})
|
|
32656
|
-
}, void 0), jsxRuntime.
|
|
32657
|
-
children:
|
|
32835
|
+
}, void 0), jsxRuntime.jsxs(TableBody$2, __assign({}, getTableBodyProps(), {
|
|
32836
|
+
children: [virtualized && paddingTop > 0 && jsxRuntime.jsx("tr", {
|
|
32837
|
+
children: jsxRuntime.jsx("td", {
|
|
32838
|
+
style: {
|
|
32839
|
+
height: "".concat(paddingTop, "px")
|
|
32840
|
+
}
|
|
32841
|
+
}, void 0)
|
|
32842
|
+
}, void 0), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.map(function (dataRow, index) {
|
|
32843
|
+
var row = virtualized ? rows === null || rows === void 0 ? void 0 : rows[dataRow === null || dataRow === void 0 ? void 0 : dataRow.index] : dataRow;
|
|
32658
32844
|
prepareRow(row);
|
|
32659
32845
|
var customStyle = getCustomRows(row).customStyle;
|
|
32660
32846
|
var _a = getCustomRows(row, function () {
|
|
32661
|
-
return renderTableRow(row,
|
|
32847
|
+
return renderTableRow(row, customStyle);
|
|
32662
32848
|
}),
|
|
32663
32849
|
CustomRow = _a.CustomRow,
|
|
32664
32850
|
showInMobile = _a.showInMobile;
|
|
32665
32851
|
return jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
32666
32852
|
children: CustomRow && showInMobile ? jsxRuntime.jsx(CustomRow, {
|
|
32667
32853
|
style: customStyle
|
|
32668
|
-
}, void 0) : renderTableRow(row,
|
|
32854
|
+
}, void 0) : renderTableRow(row, customStyle)
|
|
32669
32855
|
}, index);
|
|
32670
|
-
})
|
|
32856
|
+
}), virtualized && paddingBottom > 0 && jsxRuntime.jsx("tr", {
|
|
32857
|
+
children: jsxRuntime.jsx("td", {
|
|
32858
|
+
style: {
|
|
32859
|
+
height: "".concat(paddingBottom, "px")
|
|
32860
|
+
}
|
|
32861
|
+
}, void 0)
|
|
32862
|
+
}, void 0)]
|
|
32671
32863
|
}), void 0), rows.length < 1 && jsxRuntime.jsx(TableFoot$1, {
|
|
32672
32864
|
children: jsxRuntime.jsx(TableFootRow$1, {
|
|
32673
32865
|
children: jsxRuntime.jsx(TableFootCell$1, __assign({
|
|
@@ -50169,6 +50361,7 @@
|
|
|
50169
50361
|
}, void 0);
|
|
50170
50362
|
}
|
|
50171
50363
|
function EditableTable(props) {
|
|
50364
|
+
var _a, _b;
|
|
50172
50365
|
var columns = props.columns,
|
|
50173
50366
|
data = props.data,
|
|
50174
50367
|
rowHeight = props.rowHeight,
|
|
@@ -50177,17 +50370,20 @@
|
|
|
50177
50370
|
showCheckbox = props.showCheckbox,
|
|
50178
50371
|
onSelectedChange = props.onSelectedChange,
|
|
50179
50372
|
getCheckboxProps = props.getCheckboxProps,
|
|
50180
|
-
|
|
50181
|
-
keyId =
|
|
50373
|
+
_c = props.keyId,
|
|
50374
|
+
keyId = _c === void 0 ? 'id' : _c,
|
|
50182
50375
|
selectedIds = props.selectedIds,
|
|
50183
50376
|
onExpand = props.onExpand,
|
|
50184
50377
|
isMobileLayout = props.isMobileLayout,
|
|
50185
50378
|
hiddenColumns = props.hiddenColumns,
|
|
50186
|
-
emptyDataProps = props.customEmptyDataProps
|
|
50379
|
+
emptyDataProps = props.customEmptyDataProps,
|
|
50380
|
+
_d = props.virtualized,
|
|
50381
|
+
virtualized = _d === void 0 ? false : _d;
|
|
50187
50382
|
var t = reactI18next.useTranslation('MajooUI/table').t;
|
|
50188
|
-
var
|
|
50189
|
-
selectedIndex =
|
|
50190
|
-
setSelectedIndex =
|
|
50383
|
+
var _e = React.useState(null),
|
|
50384
|
+
selectedIndex = _e[0],
|
|
50385
|
+
setSelectedIndex = _e[1];
|
|
50386
|
+
var isMobile = useMediaQuery(isMobileLayout === undefined ? '(max-width: 767px)' : isMobileLayout ? '(max-width: 8000px)' : '(max-width: 0px)');
|
|
50191
50387
|
var IndeterminateCheckbox = function IndeterminateCheckbox(props) {
|
|
50192
50388
|
function handleCheckedChange(checked) {
|
|
50193
50389
|
props === null || props === void 0 ? void 0 : props.onChange({
|
|
@@ -50246,6 +50442,19 @@
|
|
|
50246
50442
|
visibleColumns = instance.visibleColumns,
|
|
50247
50443
|
setHiddenColumns = instance.setHiddenColumns,
|
|
50248
50444
|
selectedRowIds = instance.state.selectedRowIds;
|
|
50445
|
+
var tableContainerRef = React.useRef(null);
|
|
50446
|
+
var rowVirtualizer = reactVirtual.useVirtual({
|
|
50447
|
+
parentRef: tableContainerRef,
|
|
50448
|
+
size: data === null || data === void 0 ? void 0 : data.length,
|
|
50449
|
+
overscan: isMobile ? 20 : 10,
|
|
50450
|
+
estimateSize: React.useCallback(function () {
|
|
50451
|
+
return isMobile ? 40 : rowHeight || 80;
|
|
50452
|
+
}, [isMobile, rowHeight])
|
|
50453
|
+
});
|
|
50454
|
+
var virtualRows = rowVirtualizer.virtualItems,
|
|
50455
|
+
totalSize = rowVirtualizer.totalSize;
|
|
50456
|
+
var paddingTop = virtualRows.length > 0 ? ((_a = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
50457
|
+
var 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;
|
|
50249
50458
|
React.useEffect(function () {
|
|
50250
50459
|
if (hiddenColumns) setHiddenColumns(hiddenColumns);
|
|
50251
50460
|
}, [hiddenColumns, setHiddenColumns]);
|
|
@@ -50259,7 +50468,6 @@
|
|
|
50259
50468
|
});
|
|
50260
50469
|
}
|
|
50261
50470
|
}, [selectedRowIds, data, onSelectedChange, selectedIndex]);
|
|
50262
|
-
var isMobile = useMediaQuery(isMobileLayout === undefined ? '(max-width: 767px)' : isMobileLayout ? '(max-width: 8000px)' : '(max-width: 0px)');
|
|
50263
50471
|
var customEmptyDataProps = emptyDataProps || defaultEmptyDataProps(t, isMobile);
|
|
50264
50472
|
var getCustomRows = function getCustomRows(row, renderRow) {
|
|
50265
50473
|
var _a;
|
|
@@ -50315,7 +50523,9 @@
|
|
|
50315
50523
|
})
|
|
50316
50524
|
}), void 0);
|
|
50317
50525
|
};
|
|
50526
|
+
var tableRowData = virtualized ? virtualRows : rows;
|
|
50318
50527
|
return !isMobile ? jsxRuntime.jsx(TableContainer$1, __assign({
|
|
50528
|
+
ref: tableContainerRef,
|
|
50319
50529
|
css: props === null || props === void 0 ? void 0 : props.css
|
|
50320
50530
|
}, {
|
|
50321
50531
|
children: jsxRuntime.jsxs(TableContent$1, __assign({}, getTableProps(), {
|
|
@@ -50341,8 +50551,15 @@
|
|
|
50341
50551
|
})
|
|
50342
50552
|
}), void 0);
|
|
50343
50553
|
})
|
|
50344
|
-
}, void 0), jsxRuntime.
|
|
50345
|
-
children:
|
|
50554
|
+
}, void 0), jsxRuntime.jsxs(TableBody$1, __assign({}, getTableBodyProps(), {
|
|
50555
|
+
children: [virtualized && paddingTop > 0 && jsxRuntime.jsx("tr", {
|
|
50556
|
+
children: jsxRuntime.jsx("td", {
|
|
50557
|
+
style: {
|
|
50558
|
+
height: "".concat(paddingTop, "px")
|
|
50559
|
+
}
|
|
50560
|
+
}, void 0)
|
|
50561
|
+
}, void 0), tableRowData.map(function (dataRow, index) {
|
|
50562
|
+
var row = virtualized ? rows === null || rows === void 0 ? void 0 : rows[dataRow === null || dataRow === void 0 ? void 0 : dataRow.index] : dataRow;
|
|
50346
50563
|
prepareRow(row);
|
|
50347
50564
|
var subRowCells = row.cells.filter(function (cell) {
|
|
50348
50565
|
return cell.column.isSubRow;
|
|
@@ -50399,7 +50616,13 @@
|
|
|
50399
50616
|
}), cell.column.id);
|
|
50400
50617
|
})]
|
|
50401
50618
|
}, index);
|
|
50402
|
-
})
|
|
50619
|
+
}), virtualized && paddingBottom > 0 && jsxRuntime.jsx("tr", {
|
|
50620
|
+
children: jsxRuntime.jsx("td", {
|
|
50621
|
+
style: {
|
|
50622
|
+
height: "".concat(paddingBottom, "px")
|
|
50623
|
+
}
|
|
50624
|
+
}, void 0)
|
|
50625
|
+
}, void 0)]
|
|
50403
50626
|
}), void 0), rows.length < 1 && jsxRuntime.jsx(TableFoot, {
|
|
50404
50627
|
children: jsxRuntime.jsx(TableFootRow, {
|
|
50405
50628
|
children: jsxRuntime.jsx(TableFootCell, __assign({
|
|
@@ -50427,7 +50650,10 @@
|
|
|
50427
50650
|
customRows: customRows,
|
|
50428
50651
|
onExpand: onExpand,
|
|
50429
50652
|
hiddenColumns: hiddenColumns,
|
|
50430
|
-
customEmptyDataProps: customEmptyDataProps
|
|
50653
|
+
customEmptyDataProps: customEmptyDataProps,
|
|
50654
|
+
virtualized: virtualized,
|
|
50655
|
+
rowVirtualizer: rowVirtualizer,
|
|
50656
|
+
tableContainerRef: tableContainerRef
|
|
50431
50657
|
}, void 0);
|
|
50432
50658
|
}
|
|
50433
50659
|
EditableTable.Product = Product;
|