@majoo-ui/react 1.54.16 → 1.54.18-rc.1
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.
|
@@ -23,6 +23,8 @@ interface IInputResourceListProps {
|
|
|
23
23
|
onQueryChange?(query: string): void;
|
|
24
24
|
css?: Stitches.CSS;
|
|
25
25
|
defaultSort?: 'asc' | 'desc';
|
|
26
|
+
title?: string;
|
|
27
|
+
hideSelectAll?: boolean;
|
|
26
28
|
}
|
|
27
|
-
declare function InputResourceList({ data, disabled, onItemCheck, onItemUncheck, searchPlaceholder, counterFooterText, isLoading, enabledItems, value, fetchData, onQueryChange, css, defaultSort, }: IInputResourceListProps): JSX.Element;
|
|
29
|
+
declare function InputResourceList({ data, disabled, onItemCheck, onItemUncheck, searchPlaceholder, counterFooterText, isLoading, enabledItems, value, fetchData, onQueryChange, css, defaultSort, title, hideSelectAll }: IInputResourceListProps): JSX.Element;
|
|
28
30
|
export default InputResourceList;
|
|
@@ -97,7 +97,9 @@ export declare const TableContent: import("@stitches/react/types/styled-componen
|
|
|
97
97
|
backgroundColor: string;
|
|
98
98
|
};
|
|
99
99
|
}>>;
|
|
100
|
-
export declare const TableHead: import("@stitches/react/types/styled-component").StyledComponent<"thead", {
|
|
100
|
+
export declare const TableHead: import("@stitches/react/types/styled-component").StyledComponent<"thead", {
|
|
101
|
+
isInfiniteScroll?: boolean | "true" | undefined;
|
|
102
|
+
}, {
|
|
101
103
|
sm: "(min-width: 359px)";
|
|
102
104
|
md: "(min-width: 767px)";
|
|
103
105
|
lg: "(min-width: 1023px)";
|
|
@@ -194,9 +196,11 @@ export declare const TableHead: import("@stitches/react/types/styled-component")
|
|
|
194
196
|
};
|
|
195
197
|
}>>;
|
|
196
198
|
export declare const TableHeaderCellContainer: import("@stitches/react/types/styled-component").StyledComponent<any, {
|
|
197
|
-
isSortedDesc?: boolean | "
|
|
199
|
+
isSortedDesc?: boolean | "true" | "false" | undefined;
|
|
198
200
|
unsortable?: boolean | "true" | undefined;
|
|
199
201
|
isMobile?: boolean | "true" | undefined;
|
|
202
|
+
isToggleable?: boolean | "true" | undefined;
|
|
203
|
+
isToggled?: boolean | "true" | undefined;
|
|
200
204
|
}, {
|
|
201
205
|
sm: "(min-width: 359px)";
|
|
202
206
|
md: "(min-width: 767px)";
|
|
@@ -1231,7 +1235,7 @@ export interface TableProps {
|
|
|
1231
1235
|
showDuplicatedData?: boolean;
|
|
1232
1236
|
onRowClick?: (record: Row, index: number) => void;
|
|
1233
1237
|
}
|
|
1234
|
-
export declare function Table({ columns, data, keyId, pageIndex: controlledPageIndex, totalData, fetchData, hideDataInfo, rowsPerPageOptions, emptyDataMessage, customEmptyDataProps, isLoading, css, headerCss, onSelectedChange, isInfiniteScroll, hasMoreItems, rowLimit, cellAlign, selectedIds, rowGroup, hiddenColumns, columnOrder, customRowsStyle, isMobileLayout, showDuplicatedData, onRowClick, }: TableProps): JSX.Element;
|
|
1238
|
+
export declare function Table({ columns, data: rawData, keyId, pageIndex: controlledPageIndex, totalData, fetchData, hideDataInfo, rowsPerPageOptions, emptyDataMessage, customEmptyDataProps, isLoading, css, headerCss, onSelectedChange, isInfiniteScroll, hasMoreItems, rowLimit, cellAlign, selectedIds, rowGroup, hiddenColumns, columnOrder, customRowsStyle, isMobileLayout, showDuplicatedData, onRowClick, }: TableProps): JSX.Element;
|
|
1235
1239
|
export interface TableColumnProps {
|
|
1236
1240
|
/**
|
|
1237
1241
|
* Required if accessor is a function<br/>
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useState, createContext, useContext, useEffect, useRef, createElement as createElement$2, forwardRef, cloneElement, useLayoutEffect, useCallback, useReducer } from 'react';
|
|
2
|
+
import React__default, { useState, createContext, useContext, useEffect, useRef, createElement as createElement$2, forwardRef, cloneElement, useLayoutEffect, useCallback, useReducer, useMemo } from 'react';
|
|
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';
|
|
@@ -10669,7 +10669,9 @@ function InputResourceList({
|
|
|
10669
10669
|
fetchData,
|
|
10670
10670
|
onQueryChange,
|
|
10671
10671
|
css,
|
|
10672
|
-
defaultSort
|
|
10672
|
+
defaultSort,
|
|
10673
|
+
title,
|
|
10674
|
+
hideSelectAll
|
|
10673
10675
|
}) {
|
|
10674
10676
|
const [checkedResources, setCheckedResources] = useState([]);
|
|
10675
10677
|
const [query, setQuery] = useState();
|
|
@@ -10852,18 +10854,18 @@ function InputResourceList({
|
|
|
10852
10854
|
align: "center",
|
|
10853
10855
|
gap: 4,
|
|
10854
10856
|
css: {
|
|
10855
|
-
paddingLeft: 16,
|
|
10857
|
+
paddingLeft: !hideSelectAll ? 16 : 0,
|
|
10856
10858
|
marginTop: '$spacing-04'
|
|
10857
10859
|
}
|
|
10858
10860
|
}, {
|
|
10859
|
-
children: [jsx(InputCheckbox, {
|
|
10861
|
+
children: [!hideSelectAll && jsx(InputCheckbox, {
|
|
10860
10862
|
checked: (value === null || value === void 0 ? void 0 : value.length) === (data === null || data === void 0 ? void 0 : data.length),
|
|
10861
10863
|
indeterminate: Boolean((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) < (data === null || data === void 0 ? void 0 : data.length)),
|
|
10862
10864
|
onCheckedChange: toggleCheckAll
|
|
10863
10865
|
}, void 0), jsx(Paragraph, Object.assign({
|
|
10864
10866
|
paragraph: "shortContentBold"
|
|
10865
10867
|
}, {
|
|
10866
|
-
children:
|
|
10868
|
+
children: title || 'DATA TITLE'
|
|
10867
10869
|
}), void 0), jsx(SortingIcon, {
|
|
10868
10870
|
onClick: toggleSort
|
|
10869
10871
|
}, void 0)]
|
|
@@ -12758,7 +12760,7 @@ ButtonGroupItem.defaultProps = {
|
|
|
12758
12760
|
isToggle: true
|
|
12759
12761
|
};
|
|
12760
12762
|
|
|
12761
|
-
const _excluded$7 = ["children"];
|
|
12763
|
+
const _excluded$7 = ["children", "variantIcon"];
|
|
12762
12764
|
var _jsxFileName$o = "/home/alfiantryp/Project/majoo-ui/packages/react/src/components/notificationBadge/NotificationBadge.js";
|
|
12763
12765
|
const NotificationBadgeRootStyle = styled('span', {
|
|
12764
12766
|
position: 'relative',
|
|
@@ -12859,18 +12861,28 @@ const NotificationBadgeStyle = styled('span', {
|
|
|
12859
12861
|
|
|
12860
12862
|
const NotificationBadge = _ref => {
|
|
12861
12863
|
let {
|
|
12862
|
-
children
|
|
12864
|
+
children,
|
|
12865
|
+
variantIcon
|
|
12863
12866
|
} = _ref,
|
|
12864
12867
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
12865
12868
|
|
|
12869
|
+
const getIcon = () => {
|
|
12870
|
+
const isLeading = variantIcon === 'leading';
|
|
12871
|
+
return {
|
|
12872
|
+
max: isLeading ? '+99' : '99+',
|
|
12873
|
+
min: isLeading ? -99 : '99-'
|
|
12874
|
+
};
|
|
12875
|
+
};
|
|
12876
|
+
|
|
12866
12877
|
const getValue = () => {
|
|
12867
12878
|
let value = props == null ? void 0 : props.value;
|
|
12879
|
+
const isTrailing = variantIcon === 'trailing';
|
|
12868
12880
|
|
|
12869
12881
|
if (typeof value === 'number' || parseInt(value)) {
|
|
12870
12882
|
if (Math.sign(value) === 1 || Math.sign(value) === 0) {
|
|
12871
|
-
return value > 99 ?
|
|
12883
|
+
return value > 99 ? getIcon().max : value;
|
|
12872
12884
|
} else {
|
|
12873
|
-
return value < -99 ? -
|
|
12885
|
+
return value < -99 ? getIcon().min : isTrailing ? Math.abs(value) + '-' : value;
|
|
12874
12886
|
}
|
|
12875
12887
|
}
|
|
12876
12888
|
};
|
|
@@ -12879,14 +12891,14 @@ const NotificationBadge = _ref => {
|
|
|
12879
12891
|
__self: undefined,
|
|
12880
12892
|
__source: {
|
|
12881
12893
|
fileName: _jsxFileName$o,
|
|
12882
|
-
lineNumber:
|
|
12894
|
+
lineNumber: 118,
|
|
12883
12895
|
columnNumber: 5
|
|
12884
12896
|
}
|
|
12885
12897
|
}, children, /*#__PURE__*/React__default.createElement(NotificationBadgeStyle, _extends({}, props, {
|
|
12886
12898
|
__self: undefined,
|
|
12887
12899
|
__source: {
|
|
12888
12900
|
fileName: _jsxFileName$o,
|
|
12889
|
-
lineNumber:
|
|
12901
|
+
lineNumber: 120,
|
|
12890
12902
|
columnNumber: 7
|
|
12891
12903
|
}
|
|
12892
12904
|
}), props.value && getValue()));
|
|
@@ -12896,6 +12908,7 @@ NotificationBadge.defaultProps = {
|
|
|
12896
12908
|
anchorHorizontal: 'right',
|
|
12897
12909
|
anchorVertical: 'top',
|
|
12898
12910
|
variant: 'important',
|
|
12911
|
+
variantIcon: 'trailing',
|
|
12899
12912
|
value: undefined,
|
|
12900
12913
|
dot: false
|
|
12901
12914
|
};
|
|
@@ -12903,6 +12916,7 @@ NotificationBadge.propTypes = {
|
|
|
12903
12916
|
anchorHorizontal: PropTypes.oneOf(['left', 'right']),
|
|
12904
12917
|
anchorVertical: PropTypes.oneOf(['top', 'bottom']),
|
|
12905
12918
|
variant: PropTypes.oneOf(['info', 'important', 'warning', 'success', 'alpha']),
|
|
12919
|
+
variantIcon: PropTypes.oneOf(['leading', 'trailing']),
|
|
12906
12920
|
value: PropTypes.number,
|
|
12907
12921
|
dot: PropTypes.bool
|
|
12908
12922
|
};
|
|
@@ -17590,6 +17604,9 @@ const PrevNextButton = styled(Text$1, {
|
|
|
17590
17604
|
variants: {
|
|
17591
17605
|
isDisabled: {
|
|
17592
17606
|
true: {
|
|
17607
|
+
'&:hover': {
|
|
17608
|
+
backgroundColor: 'transparent'
|
|
17609
|
+
},
|
|
17593
17610
|
cursor: 'default'
|
|
17594
17611
|
}
|
|
17595
17612
|
}
|
|
@@ -17617,7 +17634,7 @@ const PageButton = _ref => {
|
|
|
17617
17634
|
__self: undefined,
|
|
17618
17635
|
__source: {
|
|
17619
17636
|
fileName: _jsxFileName$j,
|
|
17620
|
-
lineNumber:
|
|
17637
|
+
lineNumber: 34,
|
|
17621
17638
|
columnNumber: 5
|
|
17622
17639
|
}
|
|
17623
17640
|
}));
|
|
@@ -17638,7 +17655,9 @@ const PaginationButton = ({
|
|
|
17638
17655
|
|
|
17639
17656
|
const inputPageRef = useRef();
|
|
17640
17657
|
useEffect(() => {
|
|
17641
|
-
inputPageRef.current
|
|
17658
|
+
if (inputPageRef.current) {
|
|
17659
|
+
inputPageRef.current.value = '';
|
|
17660
|
+
}
|
|
17642
17661
|
}, [currentPage]);
|
|
17643
17662
|
const debouncedGoToPage = useCallback(debounce(handleSelectPage, 1000), [totalPages]);
|
|
17644
17663
|
|
|
@@ -17693,7 +17712,7 @@ const PaginationButton = ({
|
|
|
17693
17712
|
__self: undefined,
|
|
17694
17713
|
__source: {
|
|
17695
17714
|
fileName: _jsxFileName$j,
|
|
17696
|
-
lineNumber:
|
|
17715
|
+
lineNumber: 106,
|
|
17697
17716
|
columnNumber: 5
|
|
17698
17717
|
}
|
|
17699
17718
|
}, /*#__PURE__*/React__default.createElement(Flex$1, {
|
|
@@ -17702,17 +17721,18 @@ const PaginationButton = ({
|
|
|
17702
17721
|
__self: undefined,
|
|
17703
17722
|
__source: {
|
|
17704
17723
|
fileName: _jsxFileName$j,
|
|
17705
|
-
lineNumber:
|
|
17724
|
+
lineNumber: 112,
|
|
17706
17725
|
columnNumber: 7
|
|
17707
17726
|
}
|
|
17708
|
-
}, currentPage > 1 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isLg && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
17727
|
+
}, (currentPage > 1 || totalPages === 1) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isLg && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
17728
|
+
type: "button",
|
|
17709
17729
|
buttonType: "secondary",
|
|
17710
17730
|
disabled: currentPage === 1,
|
|
17711
17731
|
onClick: () => handleSelectPage(1),
|
|
17712
17732
|
__self: undefined,
|
|
17713
17733
|
__source: {
|
|
17714
17734
|
fileName: _jsxFileName$j,
|
|
17715
|
-
lineNumber:
|
|
17735
|
+
lineNumber: 116,
|
|
17716
17736
|
columnNumber: 15
|
|
17717
17737
|
}
|
|
17718
17738
|
}, /*#__PURE__*/React__default.createElement(ArrowLeftOutline, {
|
|
@@ -17720,7 +17740,7 @@ const PaginationButton = ({
|
|
|
17720
17740
|
__self: undefined,
|
|
17721
17741
|
__source: {
|
|
17722
17742
|
fileName: _jsxFileName$j,
|
|
17723
|
-
lineNumber:
|
|
17743
|
+
lineNumber: 117,
|
|
17724
17744
|
columnNumber: 17
|
|
17725
17745
|
}
|
|
17726
17746
|
})), /*#__PURE__*/React__default.createElement(PrevNextButton, {
|
|
@@ -17731,7 +17751,7 @@ const PaginationButton = ({
|
|
|
17731
17751
|
__self: undefined,
|
|
17732
17752
|
__source: {
|
|
17733
17753
|
fileName: _jsxFileName$j,
|
|
17734
|
-
lineNumber:
|
|
17754
|
+
lineNumber: 120,
|
|
17735
17755
|
columnNumber: 13
|
|
17736
17756
|
}
|
|
17737
17757
|
}, "Sebelumnya")), generatePages().map((page, index) => {
|
|
@@ -17742,11 +17762,11 @@ const PaginationButton = ({
|
|
|
17742
17762
|
__self: undefined,
|
|
17743
17763
|
__source: {
|
|
17744
17764
|
fileName: _jsxFileName$j,
|
|
17745
|
-
lineNumber:
|
|
17765
|
+
lineNumber: 132,
|
|
17746
17766
|
columnNumber: 13
|
|
17747
17767
|
}
|
|
17748
17768
|
}, page);
|
|
17749
|
-
}), currentPage < totalPages && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PrevNextButton, {
|
|
17769
|
+
}), (currentPage < totalPages || totalPages === 1) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PrevNextButton, {
|
|
17750
17770
|
variant: "caption",
|
|
17751
17771
|
isDisabled: currentPage === totalPages,
|
|
17752
17772
|
color: currentPage === totalPages ? 'disable' : 'primary',
|
|
@@ -17754,17 +17774,18 @@ const PaginationButton = ({
|
|
|
17754
17774
|
__self: undefined,
|
|
17755
17775
|
__source: {
|
|
17756
17776
|
fileName: _jsxFileName$j,
|
|
17757
|
-
lineNumber:
|
|
17777
|
+
lineNumber: 143,
|
|
17758
17778
|
columnNumber: 13
|
|
17759
17779
|
}
|
|
17760
17780
|
}, "Selanjutnya"), !isLg && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
17781
|
+
type: "button",
|
|
17761
17782
|
buttonType: "secondary",
|
|
17762
17783
|
disabled: currentPage === totalPages,
|
|
17763
17784
|
onClick: () => handleSelectPage(totalPages),
|
|
17764
17785
|
__self: undefined,
|
|
17765
17786
|
__source: {
|
|
17766
17787
|
fileName: _jsxFileName$j,
|
|
17767
|
-
lineNumber:
|
|
17788
|
+
lineNumber: 152,
|
|
17768
17789
|
columnNumber: 15
|
|
17769
17790
|
}
|
|
17770
17791
|
}, /*#__PURE__*/React__default.createElement(ArrowRightOutline, {
|
|
@@ -17772,10 +17793,10 @@ const PaginationButton = ({
|
|
|
17772
17793
|
__self: undefined,
|
|
17773
17794
|
__source: {
|
|
17774
17795
|
fileName: _jsxFileName$j,
|
|
17775
|
-
lineNumber:
|
|
17796
|
+
lineNumber: 158,
|
|
17776
17797
|
columnNumber: 17
|
|
17777
17798
|
}
|
|
17778
|
-
})))), /*#__PURE__*/React__default.createElement(Separator$2, {
|
|
17799
|
+
})))), totalPages > 1 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Separator$2, {
|
|
17779
17800
|
orientation: "vertical",
|
|
17780
17801
|
css: {
|
|
17781
17802
|
height: '100%',
|
|
@@ -17785,8 +17806,8 @@ const PaginationButton = ({
|
|
|
17785
17806
|
__self: undefined,
|
|
17786
17807
|
__source: {
|
|
17787
17808
|
fileName: _jsxFileName$j,
|
|
17788
|
-
lineNumber:
|
|
17789
|
-
columnNumber:
|
|
17809
|
+
lineNumber: 169,
|
|
17810
|
+
columnNumber: 13
|
|
17790
17811
|
}
|
|
17791
17812
|
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
17792
17813
|
css: {
|
|
@@ -17798,8 +17819,8 @@ const PaginationButton = ({
|
|
|
17798
17819
|
__self: undefined,
|
|
17799
17820
|
__source: {
|
|
17800
17821
|
fileName: _jsxFileName$j,
|
|
17801
|
-
lineNumber:
|
|
17802
|
-
columnNumber:
|
|
17822
|
+
lineNumber: 177,
|
|
17823
|
+
columnNumber: 13
|
|
17803
17824
|
}
|
|
17804
17825
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
17805
17826
|
variant: "caption",
|
|
@@ -17811,8 +17832,8 @@ const PaginationButton = ({
|
|
|
17811
17832
|
__self: undefined,
|
|
17812
17833
|
__source: {
|
|
17813
17834
|
fileName: _jsxFileName$j,
|
|
17814
|
-
lineNumber:
|
|
17815
|
-
columnNumber:
|
|
17835
|
+
lineNumber: 178,
|
|
17836
|
+
columnNumber: 15
|
|
17816
17837
|
}
|
|
17817
17838
|
}, "Ke Halaman"), /*#__PURE__*/React__default.createElement(InputNumber, {
|
|
17818
17839
|
ref: inputPageRef,
|
|
@@ -17838,10 +17859,10 @@ const PaginationButton = ({
|
|
|
17838
17859
|
__self: undefined,
|
|
17839
17860
|
__source: {
|
|
17840
17861
|
fileName: _jsxFileName$j,
|
|
17841
|
-
lineNumber:
|
|
17842
|
-
columnNumber:
|
|
17862
|
+
lineNumber: 181,
|
|
17863
|
+
columnNumber: 15
|
|
17843
17864
|
}
|
|
17844
|
-
})));
|
|
17865
|
+
}))));
|
|
17845
17866
|
};
|
|
17846
17867
|
|
|
17847
17868
|
const _excluded$3 = ["limits", "selectedLimit", "currentPage", "totalData", "onChange"];
|
|
@@ -18029,21 +18050,21 @@ function Pagination(_ref) {
|
|
|
18029
18050
|
lineNumber: 31,
|
|
18030
18051
|
columnNumber: 9
|
|
18031
18052
|
}
|
|
18032
|
-
}),
|
|
18053
|
+
}), /*#__PURE__*/React__default.createElement(PaginationButton, {
|
|
18033
18054
|
currentPage: currentPage,
|
|
18034
18055
|
totalPages: totalPages,
|
|
18035
18056
|
onSelect: onPageChange,
|
|
18036
18057
|
__self: this,
|
|
18037
18058
|
__source: {
|
|
18038
18059
|
fileName: _jsxFileName$h,
|
|
18039
|
-
lineNumber:
|
|
18040
|
-
columnNumber:
|
|
18060
|
+
lineNumber: 34,
|
|
18061
|
+
columnNumber: 7
|
|
18041
18062
|
}
|
|
18042
18063
|
})) : /*#__PURE__*/React__default.createElement(Box, {
|
|
18043
18064
|
__self: this,
|
|
18044
18065
|
__source: {
|
|
18045
18066
|
fileName: _jsxFileName$h,
|
|
18046
|
-
lineNumber:
|
|
18067
|
+
lineNumber: 37,
|
|
18047
18068
|
columnNumber: 5
|
|
18048
18069
|
}
|
|
18049
18070
|
});
|
|
@@ -18273,11 +18294,15 @@ const MobileTable = /*#__PURE__*/React__default.forwardRef(({
|
|
|
18273
18294
|
const headerRender = column.render('Header');
|
|
18274
18295
|
return jsx(TableHeadCell$4, Object.assign({}, column.getHeaderProps(!column.unsortable ? column.getSortByToggleProps({
|
|
18275
18296
|
title: 'Urutkan'
|
|
18276
|
-
}) : {
|
|
18297
|
+
}) : {
|
|
18298
|
+
onClick: column.onToggle
|
|
18299
|
+
}), {
|
|
18277
18300
|
children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
|
|
18278
18301
|
isMobile: true,
|
|
18279
18302
|
isSortedDesc: column.isSortedDesc,
|
|
18280
|
-
unsortable: column.unsortable
|
|
18303
|
+
unsortable: column.unsortable,
|
|
18304
|
+
isToggleable: !!column.onToggle,
|
|
18305
|
+
isToggled: column.isToggled
|
|
18281
18306
|
}, {
|
|
18282
18307
|
children: jsx(TableHeadCellContent, Object.assign({
|
|
18283
18308
|
isMobile: true,
|
|
@@ -18425,7 +18450,14 @@ const TableHead$3 = styled('thead', {
|
|
|
18425
18450
|
backgroundColor: '$bgWhite',
|
|
18426
18451
|
boxShadow: '0 4px 4px rgba(0, 0, 0, 0.025)',
|
|
18427
18452
|
borderBottom: '1pt solid $bgBorder',
|
|
18428
|
-
color: '$textPrimary'
|
|
18453
|
+
color: '$textPrimary',
|
|
18454
|
+
variants: {
|
|
18455
|
+
isInfiniteScroll: {
|
|
18456
|
+
true: {
|
|
18457
|
+
top: '-1px'
|
|
18458
|
+
}
|
|
18459
|
+
}
|
|
18460
|
+
}
|
|
18429
18461
|
});
|
|
18430
18462
|
const TableHeadRow$3 = styled('tr');
|
|
18431
18463
|
const TableHeadCell$3 = styled('th', {
|
|
@@ -18508,8 +18540,40 @@ const TableHeaderCellContainer = styled(Flex$1, {
|
|
|
18508
18540
|
justifyContent: 'space-between',
|
|
18509
18541
|
gap: 0
|
|
18510
18542
|
}
|
|
18543
|
+
},
|
|
18544
|
+
isToggleable: {
|
|
18545
|
+
true: {}
|
|
18546
|
+
},
|
|
18547
|
+
isToggled: {
|
|
18548
|
+
true: {
|
|
18549
|
+
'&::after': {
|
|
18550
|
+
opacity: 1
|
|
18551
|
+
}
|
|
18552
|
+
}
|
|
18511
18553
|
}
|
|
18512
|
-
}
|
|
18554
|
+
},
|
|
18555
|
+
compoundVariants: [{
|
|
18556
|
+
unsortable: true,
|
|
18557
|
+
isToggleable: true,
|
|
18558
|
+
css: {
|
|
18559
|
+
cursor: 'pointer',
|
|
18560
|
+
'@lg': {
|
|
18561
|
+
'&:hover': {
|
|
18562
|
+
'&::after': {
|
|
18563
|
+
opacity: 1
|
|
18564
|
+
}
|
|
18565
|
+
}
|
|
18566
|
+
}
|
|
18567
|
+
}
|
|
18568
|
+
}, {
|
|
18569
|
+
isToggleable: true,
|
|
18570
|
+
isMobile: true,
|
|
18571
|
+
css: {
|
|
18572
|
+
'&::after': {
|
|
18573
|
+
opacity: 1
|
|
18574
|
+
}
|
|
18575
|
+
}
|
|
18576
|
+
}]
|
|
18513
18577
|
});
|
|
18514
18578
|
const TableHeadCellContent = styled(Heading, {
|
|
18515
18579
|
userSelect: 'none',
|
|
@@ -18648,6 +18712,7 @@ const stickyShadowStyling = (column, tableScrollPosition, scrollAreaWidth) => {
|
|
|
18648
18712
|
|
|
18649
18713
|
const formattingData = (rawData, groupKey) => {
|
|
18650
18714
|
if (groupKey) {
|
|
18715
|
+
const modifiedData = [];
|
|
18651
18716
|
rawData.forEach((item, index) => {
|
|
18652
18717
|
if (item[groupKey] && item[groupKey].length > 0) {
|
|
18653
18718
|
const newElement = item[groupKey].map((childItem, index) => Object.assign(Object.assign({}, childItem), {
|
|
@@ -18655,10 +18720,12 @@ const formattingData = (rawData, groupKey) => {
|
|
|
18655
18720
|
parentOriginal: item,
|
|
18656
18721
|
isBottomChild: index === item[groupKey].length - 1
|
|
18657
18722
|
}));
|
|
18658
|
-
|
|
18659
|
-
|
|
18723
|
+
modifiedData.push(...newElement);
|
|
18724
|
+
} else {
|
|
18725
|
+
modifiedData.push(item);
|
|
18660
18726
|
}
|
|
18661
18727
|
});
|
|
18728
|
+
return modifiedData;
|
|
18662
18729
|
}
|
|
18663
18730
|
|
|
18664
18731
|
return rawData;
|
|
@@ -18686,7 +18753,7 @@ const defaultEmptyDataProps = {
|
|
|
18686
18753
|
};
|
|
18687
18754
|
function Table({
|
|
18688
18755
|
columns,
|
|
18689
|
-
data,
|
|
18756
|
+
data: rawData,
|
|
18690
18757
|
keyId = 'id',
|
|
18691
18758
|
pageIndex: controlledPageIndex = 0,
|
|
18692
18759
|
totalData = 0,
|
|
@@ -18737,7 +18804,7 @@ function Table({
|
|
|
18737
18804
|
|
|
18738
18805
|
const instance = useTable({
|
|
18739
18806
|
columns,
|
|
18740
|
-
data: formattingData(
|
|
18807
|
+
data: useMemo(() => formattingData(rawData, rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.groupKey), [rawData, rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.groupKey]),
|
|
18741
18808
|
initialState: getInitialState(),
|
|
18742
18809
|
manualPagination: !!fetchData,
|
|
18743
18810
|
manualSortBy: !!fetchData,
|
|
@@ -18808,7 +18875,7 @@ function Table({
|
|
|
18808
18875
|
}, void 0);
|
|
18809
18876
|
|
|
18810
18877
|
const renderInfiniteScrollWrapper = children => jsx(ConditionalWrapper, Object.assign({
|
|
18811
|
-
condition: isInfiniteScroll &&
|
|
18878
|
+
condition: isInfiniteScroll && rawData.length > 0,
|
|
18812
18879
|
wrapper: children => jsx(InfiniteScroll, Object.assign({
|
|
18813
18880
|
loadMore: _ => {
|
|
18814
18881
|
if (!isLoading) doFetchData(controlledPageIndex + 1, rowLimit);
|
|
@@ -18897,29 +18964,29 @@ function Table({
|
|
|
18897
18964
|
gotoPage(controlledPageIndex);
|
|
18898
18965
|
}, [controlledPageIndex]);
|
|
18899
18966
|
useEffect(() => {
|
|
18900
|
-
if (
|
|
18967
|
+
if (rawData && rawData.length > 0) doFetchData(0, isInfiniteScroll ? rowLimit : pageSize);
|
|
18901
18968
|
}, [sortBy]);
|
|
18902
18969
|
useMountedLayoutEffect(() => {
|
|
18903
|
-
if (
|
|
18970
|
+
if (rawData && rawData.length > 0 && selectedRowIds && onSelectedChange) onSelectedChange(selectedRowIds ? Object.keys(selectedRowIds) : []);
|
|
18904
18971
|
}, [selectedRowIds]);
|
|
18905
18972
|
useEffect(() => {
|
|
18906
18973
|
var _a;
|
|
18907
18974
|
|
|
18908
|
-
if (isInfiniteScroll &&
|
|
18975
|
+
if (isInfiniteScroll && rawData.length <= rowLimit) {
|
|
18909
18976
|
(_a = scrollerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
18910
18977
|
top: 0
|
|
18911
18978
|
});
|
|
18912
18979
|
}
|
|
18913
|
-
}, [
|
|
18980
|
+
}, [rawData]);
|
|
18914
18981
|
useEffect(() => {
|
|
18915
|
-
if (selectedIds &&
|
|
18982
|
+
if (selectedIds && rawData.length > 0) {
|
|
18916
18983
|
const selectedIdsKeys = Object.keys(selectedIds);
|
|
18917
18984
|
selectedIdsKeys.map(key => {
|
|
18918
18985
|
toggleRowSelected(key, true);
|
|
18919
18986
|
return key;
|
|
18920
18987
|
});
|
|
18921
18988
|
}
|
|
18922
|
-
}, [
|
|
18989
|
+
}, [rawData, selectedIds]);
|
|
18923
18990
|
return jsxs(Box, Object.assign({
|
|
18924
18991
|
css: {
|
|
18925
18992
|
position: 'relative',
|
|
@@ -18964,7 +19031,8 @@ function Table({
|
|
|
18964
19031
|
}, {
|
|
18965
19032
|
children: [renderInfiniteScrollWrapper(jsxs(TableContent$3, Object.assign({}, getTableProps(), {
|
|
18966
19033
|
children: [jsx(TableHead$3, Object.assign({
|
|
18967
|
-
css: headerCss
|
|
19034
|
+
css: headerCss,
|
|
19035
|
+
isInfiniteScroll: isInfiniteScroll
|
|
18968
19036
|
}, {
|
|
18969
19037
|
children: headerGroups.map(headerGroup => {
|
|
18970
19038
|
const visibleHeaders = headerGroup.headers.filter(column => !column.isSubRow);
|
|
@@ -18973,7 +19041,9 @@ function Table({
|
|
|
18973
19041
|
const headerRender = column.render('Header');
|
|
18974
19042
|
return jsx(TableHeadCell$3, Object.assign({}, column.getHeaderProps(props => [props, !column.unsortable ? column.getSortByToggleProps({
|
|
18975
19043
|
title: 'Urutkan'
|
|
18976
|
-
}) : {
|
|
19044
|
+
}) : {
|
|
19045
|
+
onClick: column.onToggle
|
|
19046
|
+
}, {
|
|
18977
19047
|
style: {
|
|
18978
19048
|
width: column.colWidth,
|
|
18979
19049
|
maxWidth: column.colMaxWidth,
|
|
@@ -18984,7 +19054,9 @@ function Table({
|
|
|
18984
19054
|
}, {
|
|
18985
19055
|
children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
|
|
18986
19056
|
isSortedDesc: column.isSortedDesc,
|
|
18987
|
-
unsortable: column.unsortable
|
|
19057
|
+
unsortable: column.unsortable,
|
|
19058
|
+
isToggleable: !!column.onToggle,
|
|
19059
|
+
isToggled: column.isToggled
|
|
18988
19060
|
}, {
|
|
18989
19061
|
children: jsx(TableHeadCellContent, Object.assign({
|
|
18990
19062
|
heading: "headerTable"
|
|
@@ -25105,6 +25177,7 @@ const Device = props => {
|
|
|
25105
25177
|
gap: "6"
|
|
25106
25178
|
}, {
|
|
25107
25179
|
children: [props.carousel && jsx(IconStyled, Object.assign({
|
|
25180
|
+
type: "button",
|
|
25108
25181
|
onClick: prevSlide,
|
|
25109
25182
|
buttonType: "secondary"
|
|
25110
25183
|
}, {
|
|
@@ -32113,7 +32186,49 @@ const Container$1 = styled('div', {
|
|
|
32113
32186
|
'& > .wrapper-root > .editor-root': {
|
|
32114
32187
|
height: value
|
|
32115
32188
|
}
|
|
32116
|
-
}), 1000)
|
|
32189
|
+
}), 1000),
|
|
32190
|
+
disabled: {
|
|
32191
|
+
true: {
|
|
32192
|
+
'& > .wrapper-root > .editor-root': {
|
|
32193
|
+
backgroundColor: '$formDisable',
|
|
32194
|
+
color: '$textDisable'
|
|
32195
|
+
},
|
|
32196
|
+
'& > .wrapper-root > .toolbar-root': {
|
|
32197
|
+
backgroundColor: '$formDisable',
|
|
32198
|
+
color: '$textDisable'
|
|
32199
|
+
},
|
|
32200
|
+
'& > .wrapper-root > .toolbar-root > div > .rdw-option-wrapper': {
|
|
32201
|
+
backgroundColor: '$formDisable !important',
|
|
32202
|
+
'& img': {
|
|
32203
|
+
filter: 'contrast(0)'
|
|
32204
|
+
}
|
|
32205
|
+
},
|
|
32206
|
+
'& > .wrapper-root > .toolbar-root > .rdw-dropdown-wrapper': {
|
|
32207
|
+
backgroundColor: '$formDisable !important',
|
|
32208
|
+
'& img': {
|
|
32209
|
+
filter: 'contrast(0)'
|
|
32210
|
+
},
|
|
32211
|
+
'& a': {
|
|
32212
|
+
pointerEvents: 'none'
|
|
32213
|
+
},
|
|
32214
|
+
'& > a > div': {
|
|
32215
|
+
borderTop: '6px solid $textDisable'
|
|
32216
|
+
}
|
|
32217
|
+
},
|
|
32218
|
+
'& > .wrapper-root > .toolbar-root > div > .rdw-dropdown-wrapper': {
|
|
32219
|
+
backgroundColor: '$formDisable !important',
|
|
32220
|
+
'& a': {
|
|
32221
|
+
pointerEvents: 'none'
|
|
32222
|
+
},
|
|
32223
|
+
'& > a > span': {
|
|
32224
|
+
color: '$textDisable'
|
|
32225
|
+
},
|
|
32226
|
+
'& > a > div': {
|
|
32227
|
+
borderTop: '6px solid $textDisable'
|
|
32228
|
+
}
|
|
32229
|
+
}
|
|
32230
|
+
}
|
|
32231
|
+
}
|
|
32117
32232
|
}
|
|
32118
32233
|
});
|
|
32119
32234
|
const MaxLengthText = styled('p', {
|
|
@@ -32140,7 +32255,8 @@ function ContentEditor(props) {
|
|
|
32140
32255
|
toolbar,
|
|
32141
32256
|
editorHeight,
|
|
32142
32257
|
uploadCallback,
|
|
32143
|
-
maxLength
|
|
32258
|
+
maxLength,
|
|
32259
|
+
disabled
|
|
32144
32260
|
} = props;
|
|
32145
32261
|
const [editorState, setEditorState] = useState(() => EditorState.createEmpty());
|
|
32146
32262
|
useEffect(() => {
|
|
@@ -32226,7 +32342,8 @@ function ContentEditor(props) {
|
|
|
32226
32342
|
};
|
|
32227
32343
|
return jsxs(Container$1, Object.assign({
|
|
32228
32344
|
css: css,
|
|
32229
|
-
editorHeight: editorHeight
|
|
32345
|
+
editorHeight: editorHeight,
|
|
32346
|
+
disabled: disabled
|
|
32230
32347
|
}, {
|
|
32231
32348
|
children: [jsx(Editor, {
|
|
32232
32349
|
wrapperClassName: "wrapper-root",
|
|
@@ -32234,7 +32351,8 @@ function ContentEditor(props) {
|
|
|
32234
32351
|
toolbarClassName: "toolbar-root",
|
|
32235
32352
|
editorState: editorState,
|
|
32236
32353
|
onEditorStateChange: onEditorStateChange,
|
|
32237
|
-
toolbar: toolbar ? toolbar(config) : config
|
|
32354
|
+
toolbar: toolbar ? toolbar(config) : config,
|
|
32355
|
+
readOnly: disabled
|
|
32238
32356
|
}, void 0), maxLength && typeof maxLength === 'number' && jsx(MaxLengthText, Object.assign({
|
|
32239
32357
|
warning: ((_b = (_a = editorState === null || editorState === void 0 ? void 0 : editorState.getCurrentContent()) === null || _a === void 0 ? void 0 : _a.getPlainText()) === null || _b === void 0 ? void 0 : _b.length) > maxLength
|
|
32240
32358
|
}, {
|
package/index.umd.js
CHANGED
|
@@ -10808,7 +10808,9 @@
|
|
|
10808
10808
|
fetchData = _a.fetchData,
|
|
10809
10809
|
onQueryChange = _a.onQueryChange,
|
|
10810
10810
|
css = _a.css,
|
|
10811
|
-
defaultSort = _a.defaultSort
|
|
10811
|
+
defaultSort = _a.defaultSort,
|
|
10812
|
+
title = _a.title,
|
|
10813
|
+
hideSelectAll = _a.hideSelectAll;
|
|
10812
10814
|
|
|
10813
10815
|
var _f = React.useState([]),
|
|
10814
10816
|
checkedResources = _f[0],
|
|
@@ -11016,18 +11018,18 @@
|
|
|
11016
11018
|
align: "center",
|
|
11017
11019
|
gap: 4,
|
|
11018
11020
|
css: {
|
|
11019
|
-
paddingLeft: 16,
|
|
11021
|
+
paddingLeft: !hideSelectAll ? 16 : 0,
|
|
11020
11022
|
marginTop: '$spacing-04'
|
|
11021
11023
|
}
|
|
11022
11024
|
}, {
|
|
11023
|
-
children: [jsxRuntime.jsx(InputCheckbox, {
|
|
11025
|
+
children: [!hideSelectAll && jsxRuntime.jsx(InputCheckbox, {
|
|
11024
11026
|
checked: (value === null || value === void 0 ? void 0 : value.length) === (data === null || data === void 0 ? void 0 : data.length),
|
|
11025
11027
|
indeterminate: Boolean((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) < (data === null || data === void 0 ? void 0 : data.length)),
|
|
11026
11028
|
onCheckedChange: toggleCheckAll
|
|
11027
11029
|
}, void 0), jsxRuntime.jsx(Paragraph, __assign({
|
|
11028
11030
|
paragraph: "shortContentBold"
|
|
11029
11031
|
}, {
|
|
11030
|
-
children:
|
|
11032
|
+
children: title || 'DATA TITLE'
|
|
11031
11033
|
}), void 0), jsxRuntime.jsx(SortingIcon, {
|
|
11032
11034
|
onClick: toggleSort
|
|
11033
11035
|
}, void 0)]
|
|
@@ -12932,7 +12934,7 @@
|
|
|
12932
12934
|
isToggle: true
|
|
12933
12935
|
};
|
|
12934
12936
|
|
|
12935
|
-
const _excluded$7 = ["children"];
|
|
12937
|
+
const _excluded$7 = ["children", "variantIcon"];
|
|
12936
12938
|
var _jsxFileName$o = "/home/alfiantryp/Project/majoo-ui/packages/react/src/components/notificationBadge/NotificationBadge.js";
|
|
12937
12939
|
const NotificationBadgeRootStyle = styled('span', {
|
|
12938
12940
|
position: 'relative',
|
|
@@ -13033,18 +13035,28 @@
|
|
|
13033
13035
|
|
|
13034
13036
|
const NotificationBadge = _ref => {
|
|
13035
13037
|
let {
|
|
13036
|
-
children
|
|
13038
|
+
children,
|
|
13039
|
+
variantIcon
|
|
13037
13040
|
} = _ref,
|
|
13038
13041
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
13039
13042
|
|
|
13043
|
+
const getIcon = () => {
|
|
13044
|
+
const isLeading = variantIcon === 'leading';
|
|
13045
|
+
return {
|
|
13046
|
+
max: isLeading ? '+99' : '99+',
|
|
13047
|
+
min: isLeading ? -99 : '99-'
|
|
13048
|
+
};
|
|
13049
|
+
};
|
|
13050
|
+
|
|
13040
13051
|
const getValue = () => {
|
|
13041
13052
|
let value = props == null ? void 0 : props.value;
|
|
13053
|
+
const isTrailing = variantIcon === 'trailing';
|
|
13042
13054
|
|
|
13043
13055
|
if (typeof value === 'number' || parseInt(value)) {
|
|
13044
13056
|
if (Math.sign(value) === 1 || Math.sign(value) === 0) {
|
|
13045
|
-
return value > 99 ?
|
|
13057
|
+
return value > 99 ? getIcon().max : value;
|
|
13046
13058
|
} else {
|
|
13047
|
-
return value < -99 ? -
|
|
13059
|
+
return value < -99 ? getIcon().min : isTrailing ? Math.abs(value) + '-' : value;
|
|
13048
13060
|
}
|
|
13049
13061
|
}
|
|
13050
13062
|
};
|
|
@@ -13053,14 +13065,14 @@
|
|
|
13053
13065
|
__self: undefined,
|
|
13054
13066
|
__source: {
|
|
13055
13067
|
fileName: _jsxFileName$o,
|
|
13056
|
-
lineNumber:
|
|
13068
|
+
lineNumber: 118,
|
|
13057
13069
|
columnNumber: 5
|
|
13058
13070
|
}
|
|
13059
13071
|
}, children, /*#__PURE__*/React__default["default"].createElement(NotificationBadgeStyle, _extends({}, props, {
|
|
13060
13072
|
__self: undefined,
|
|
13061
13073
|
__source: {
|
|
13062
13074
|
fileName: _jsxFileName$o,
|
|
13063
|
-
lineNumber:
|
|
13075
|
+
lineNumber: 120,
|
|
13064
13076
|
columnNumber: 7
|
|
13065
13077
|
}
|
|
13066
13078
|
}), props.value && getValue()));
|
|
@@ -13070,6 +13082,7 @@
|
|
|
13070
13082
|
anchorHorizontal: 'right',
|
|
13071
13083
|
anchorVertical: 'top',
|
|
13072
13084
|
variant: 'important',
|
|
13085
|
+
variantIcon: 'trailing',
|
|
13073
13086
|
value: undefined,
|
|
13074
13087
|
dot: false
|
|
13075
13088
|
};
|
|
@@ -13077,6 +13090,7 @@
|
|
|
13077
13090
|
anchorHorizontal: PropTypes__default["default"].oneOf(['left', 'right']),
|
|
13078
13091
|
anchorVertical: PropTypes__default["default"].oneOf(['top', 'bottom']),
|
|
13079
13092
|
variant: PropTypes__default["default"].oneOf(['info', 'important', 'warning', 'success', 'alpha']),
|
|
13093
|
+
variantIcon: PropTypes__default["default"].oneOf(['leading', 'trailing']),
|
|
13080
13094
|
value: PropTypes__default["default"].number,
|
|
13081
13095
|
dot: PropTypes__default["default"].bool
|
|
13082
13096
|
};
|
|
@@ -17879,6 +17893,9 @@
|
|
|
17879
17893
|
variants: {
|
|
17880
17894
|
isDisabled: {
|
|
17881
17895
|
true: {
|
|
17896
|
+
'&:hover': {
|
|
17897
|
+
backgroundColor: 'transparent'
|
|
17898
|
+
},
|
|
17882
17899
|
cursor: 'default'
|
|
17883
17900
|
}
|
|
17884
17901
|
}
|
|
@@ -17906,7 +17923,7 @@
|
|
|
17906
17923
|
__self: undefined,
|
|
17907
17924
|
__source: {
|
|
17908
17925
|
fileName: _jsxFileName$j,
|
|
17909
|
-
lineNumber:
|
|
17926
|
+
lineNumber: 34,
|
|
17910
17927
|
columnNumber: 5
|
|
17911
17928
|
}
|
|
17912
17929
|
}));
|
|
@@ -17927,7 +17944,9 @@
|
|
|
17927
17944
|
|
|
17928
17945
|
const inputPageRef = React.useRef();
|
|
17929
17946
|
React.useEffect(() => {
|
|
17930
|
-
inputPageRef.current
|
|
17947
|
+
if (inputPageRef.current) {
|
|
17948
|
+
inputPageRef.current.value = '';
|
|
17949
|
+
}
|
|
17931
17950
|
}, [currentPage]);
|
|
17932
17951
|
const debouncedGoToPage = React.useCallback(debounce__default["default"](handleSelectPage, 1000), [totalPages]);
|
|
17933
17952
|
|
|
@@ -17982,7 +18001,7 @@
|
|
|
17982
18001
|
__self: undefined,
|
|
17983
18002
|
__source: {
|
|
17984
18003
|
fileName: _jsxFileName$j,
|
|
17985
|
-
lineNumber:
|
|
18004
|
+
lineNumber: 106,
|
|
17986
18005
|
columnNumber: 5
|
|
17987
18006
|
}
|
|
17988
18007
|
}, /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
@@ -17991,17 +18010,18 @@
|
|
|
17991
18010
|
__self: undefined,
|
|
17992
18011
|
__source: {
|
|
17993
18012
|
fileName: _jsxFileName$j,
|
|
17994
|
-
lineNumber:
|
|
18013
|
+
lineNumber: 112,
|
|
17995
18014
|
columnNumber: 7
|
|
17996
18015
|
}
|
|
17997
|
-
}, currentPage > 1 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isLg && /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
18016
|
+
}, (currentPage > 1 || totalPages === 1) && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isLg && /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
18017
|
+
type: "button",
|
|
17998
18018
|
buttonType: "secondary",
|
|
17999
18019
|
disabled: currentPage === 1,
|
|
18000
18020
|
onClick: () => handleSelectPage(1),
|
|
18001
18021
|
__self: undefined,
|
|
18002
18022
|
__source: {
|
|
18003
18023
|
fileName: _jsxFileName$j,
|
|
18004
|
-
lineNumber:
|
|
18024
|
+
lineNumber: 116,
|
|
18005
18025
|
columnNumber: 15
|
|
18006
18026
|
}
|
|
18007
18027
|
}, /*#__PURE__*/React__default["default"].createElement(icons.ArrowLeftOutline, {
|
|
@@ -18009,7 +18029,7 @@
|
|
|
18009
18029
|
__self: undefined,
|
|
18010
18030
|
__source: {
|
|
18011
18031
|
fileName: _jsxFileName$j,
|
|
18012
|
-
lineNumber:
|
|
18032
|
+
lineNumber: 117,
|
|
18013
18033
|
columnNumber: 17
|
|
18014
18034
|
}
|
|
18015
18035
|
})), /*#__PURE__*/React__default["default"].createElement(PrevNextButton, {
|
|
@@ -18020,7 +18040,7 @@
|
|
|
18020
18040
|
__self: undefined,
|
|
18021
18041
|
__source: {
|
|
18022
18042
|
fileName: _jsxFileName$j,
|
|
18023
|
-
lineNumber:
|
|
18043
|
+
lineNumber: 120,
|
|
18024
18044
|
columnNumber: 13
|
|
18025
18045
|
}
|
|
18026
18046
|
}, "Sebelumnya")), generatePages().map((page, index) => {
|
|
@@ -18031,11 +18051,11 @@
|
|
|
18031
18051
|
__self: undefined,
|
|
18032
18052
|
__source: {
|
|
18033
18053
|
fileName: _jsxFileName$j,
|
|
18034
|
-
lineNumber:
|
|
18054
|
+
lineNumber: 132,
|
|
18035
18055
|
columnNumber: 13
|
|
18036
18056
|
}
|
|
18037
18057
|
}, page);
|
|
18038
|
-
}), currentPage < totalPages && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(PrevNextButton, {
|
|
18058
|
+
}), (currentPage < totalPages || totalPages === 1) && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(PrevNextButton, {
|
|
18039
18059
|
variant: "caption",
|
|
18040
18060
|
isDisabled: currentPage === totalPages,
|
|
18041
18061
|
color: currentPage === totalPages ? 'disable' : 'primary',
|
|
@@ -18043,17 +18063,18 @@
|
|
|
18043
18063
|
__self: undefined,
|
|
18044
18064
|
__source: {
|
|
18045
18065
|
fileName: _jsxFileName$j,
|
|
18046
|
-
lineNumber:
|
|
18066
|
+
lineNumber: 143,
|
|
18047
18067
|
columnNumber: 13
|
|
18048
18068
|
}
|
|
18049
18069
|
}, "Selanjutnya"), !isLg && /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
18070
|
+
type: "button",
|
|
18050
18071
|
buttonType: "secondary",
|
|
18051
18072
|
disabled: currentPage === totalPages,
|
|
18052
18073
|
onClick: () => handleSelectPage(totalPages),
|
|
18053
18074
|
__self: undefined,
|
|
18054
18075
|
__source: {
|
|
18055
18076
|
fileName: _jsxFileName$j,
|
|
18056
|
-
lineNumber:
|
|
18077
|
+
lineNumber: 152,
|
|
18057
18078
|
columnNumber: 15
|
|
18058
18079
|
}
|
|
18059
18080
|
}, /*#__PURE__*/React__default["default"].createElement(icons.ArrowRightOutline, {
|
|
@@ -18061,10 +18082,10 @@
|
|
|
18061
18082
|
__self: undefined,
|
|
18062
18083
|
__source: {
|
|
18063
18084
|
fileName: _jsxFileName$j,
|
|
18064
|
-
lineNumber:
|
|
18085
|
+
lineNumber: 158,
|
|
18065
18086
|
columnNumber: 17
|
|
18066
18087
|
}
|
|
18067
|
-
})))), /*#__PURE__*/React__default["default"].createElement(Separator$2, {
|
|
18088
|
+
})))), totalPages > 1 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Separator$2, {
|
|
18068
18089
|
orientation: "vertical",
|
|
18069
18090
|
css: {
|
|
18070
18091
|
height: '100%',
|
|
@@ -18074,8 +18095,8 @@
|
|
|
18074
18095
|
__self: undefined,
|
|
18075
18096
|
__source: {
|
|
18076
18097
|
fileName: _jsxFileName$j,
|
|
18077
|
-
lineNumber:
|
|
18078
|
-
columnNumber:
|
|
18098
|
+
lineNumber: 169,
|
|
18099
|
+
columnNumber: 13
|
|
18079
18100
|
}
|
|
18080
18101
|
}), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
18081
18102
|
css: {
|
|
@@ -18087,8 +18108,8 @@
|
|
|
18087
18108
|
__self: undefined,
|
|
18088
18109
|
__source: {
|
|
18089
18110
|
fileName: _jsxFileName$j,
|
|
18090
|
-
lineNumber:
|
|
18091
|
-
columnNumber:
|
|
18111
|
+
lineNumber: 177,
|
|
18112
|
+
columnNumber: 13
|
|
18092
18113
|
}
|
|
18093
18114
|
}, /*#__PURE__*/React__default["default"].createElement(Text$1, {
|
|
18094
18115
|
variant: "caption",
|
|
@@ -18100,8 +18121,8 @@
|
|
|
18100
18121
|
__self: undefined,
|
|
18101
18122
|
__source: {
|
|
18102
18123
|
fileName: _jsxFileName$j,
|
|
18103
|
-
lineNumber:
|
|
18104
|
-
columnNumber:
|
|
18124
|
+
lineNumber: 178,
|
|
18125
|
+
columnNumber: 15
|
|
18105
18126
|
}
|
|
18106
18127
|
}, "Ke Halaman"), /*#__PURE__*/React__default["default"].createElement(InputNumber, {
|
|
18107
18128
|
ref: inputPageRef,
|
|
@@ -18127,10 +18148,10 @@
|
|
|
18127
18148
|
__self: undefined,
|
|
18128
18149
|
__source: {
|
|
18129
18150
|
fileName: _jsxFileName$j,
|
|
18130
|
-
lineNumber:
|
|
18131
|
-
columnNumber:
|
|
18151
|
+
lineNumber: 181,
|
|
18152
|
+
columnNumber: 15
|
|
18132
18153
|
}
|
|
18133
|
-
})));
|
|
18154
|
+
}))));
|
|
18134
18155
|
};
|
|
18135
18156
|
|
|
18136
18157
|
const _excluded$3 = ["limits", "selectedLimit", "currentPage", "totalData", "onChange"];
|
|
@@ -18318,21 +18339,21 @@
|
|
|
18318
18339
|
lineNumber: 31,
|
|
18319
18340
|
columnNumber: 9
|
|
18320
18341
|
}
|
|
18321
|
-
}),
|
|
18342
|
+
}), /*#__PURE__*/React__default["default"].createElement(PaginationButton, {
|
|
18322
18343
|
currentPage: currentPage,
|
|
18323
18344
|
totalPages: totalPages,
|
|
18324
18345
|
onSelect: onPageChange,
|
|
18325
18346
|
__self: this,
|
|
18326
18347
|
__source: {
|
|
18327
18348
|
fileName: _jsxFileName$h,
|
|
18328
|
-
lineNumber:
|
|
18329
|
-
columnNumber:
|
|
18349
|
+
lineNumber: 34,
|
|
18350
|
+
columnNumber: 7
|
|
18330
18351
|
}
|
|
18331
18352
|
})) : /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
18332
18353
|
__self: this,
|
|
18333
18354
|
__source: {
|
|
18334
18355
|
fileName: _jsxFileName$h,
|
|
18335
|
-
lineNumber:
|
|
18356
|
+
lineNumber: 37,
|
|
18336
18357
|
columnNumber: 5
|
|
18337
18358
|
}
|
|
18338
18359
|
});
|
|
@@ -18560,11 +18581,15 @@
|
|
|
18560
18581
|
var headerRender = column.render('Header');
|
|
18561
18582
|
return jsxRuntime.jsx(TableHeadCell$4, __assign({}, column.getHeaderProps(!column.unsortable ? column.getSortByToggleProps({
|
|
18562
18583
|
title: 'Urutkan'
|
|
18563
|
-
}) : {
|
|
18584
|
+
}) : {
|
|
18585
|
+
onClick: column.onToggle
|
|
18586
|
+
}), {
|
|
18564
18587
|
children: typeof headerRender === 'string' ? jsxRuntime.jsx(TableHeaderCellContainer, __assign({
|
|
18565
18588
|
isMobile: true,
|
|
18566
18589
|
isSortedDesc: column.isSortedDesc,
|
|
18567
|
-
unsortable: column.unsortable
|
|
18590
|
+
unsortable: column.unsortable,
|
|
18591
|
+
isToggleable: !!column.onToggle,
|
|
18592
|
+
isToggled: column.isToggled
|
|
18568
18593
|
}, {
|
|
18569
18594
|
children: jsxRuntime.jsx(TableHeadCellContent, __assign({
|
|
18570
18595
|
isMobile: true,
|
|
@@ -18721,7 +18746,14 @@
|
|
|
18721
18746
|
backgroundColor: '$bgWhite',
|
|
18722
18747
|
boxShadow: '0 4px 4px rgba(0, 0, 0, 0.025)',
|
|
18723
18748
|
borderBottom: '1pt solid $bgBorder',
|
|
18724
|
-
color: '$textPrimary'
|
|
18749
|
+
color: '$textPrimary',
|
|
18750
|
+
variants: {
|
|
18751
|
+
isInfiniteScroll: {
|
|
18752
|
+
true: {
|
|
18753
|
+
top: '-1px'
|
|
18754
|
+
}
|
|
18755
|
+
}
|
|
18756
|
+
}
|
|
18725
18757
|
});
|
|
18726
18758
|
var TableHeadRow$3 = styled('tr');
|
|
18727
18759
|
var TableHeadCell$3 = styled('th', {
|
|
@@ -18804,8 +18836,40 @@
|
|
|
18804
18836
|
justifyContent: 'space-between',
|
|
18805
18837
|
gap: 0
|
|
18806
18838
|
}
|
|
18839
|
+
},
|
|
18840
|
+
isToggleable: {
|
|
18841
|
+
true: {}
|
|
18842
|
+
},
|
|
18843
|
+
isToggled: {
|
|
18844
|
+
true: {
|
|
18845
|
+
'&::after': {
|
|
18846
|
+
opacity: 1
|
|
18847
|
+
}
|
|
18848
|
+
}
|
|
18807
18849
|
}
|
|
18808
|
-
}
|
|
18850
|
+
},
|
|
18851
|
+
compoundVariants: [{
|
|
18852
|
+
unsortable: true,
|
|
18853
|
+
isToggleable: true,
|
|
18854
|
+
css: {
|
|
18855
|
+
cursor: 'pointer',
|
|
18856
|
+
'@lg': {
|
|
18857
|
+
'&:hover': {
|
|
18858
|
+
'&::after': {
|
|
18859
|
+
opacity: 1
|
|
18860
|
+
}
|
|
18861
|
+
}
|
|
18862
|
+
}
|
|
18863
|
+
}
|
|
18864
|
+
}, {
|
|
18865
|
+
isToggleable: true,
|
|
18866
|
+
isMobile: true,
|
|
18867
|
+
css: {
|
|
18868
|
+
'&::after': {
|
|
18869
|
+
opacity: 1
|
|
18870
|
+
}
|
|
18871
|
+
}
|
|
18872
|
+
}]
|
|
18809
18873
|
});
|
|
18810
18874
|
var TableHeadCellContent = styled(Heading, {
|
|
18811
18875
|
userSelect: 'none',
|
|
@@ -18944,6 +19008,7 @@
|
|
|
18944
19008
|
|
|
18945
19009
|
var formattingData = function formattingData(rawData, groupKey) {
|
|
18946
19010
|
if (groupKey) {
|
|
19011
|
+
var modifiedData_1 = [];
|
|
18947
19012
|
rawData.forEach(function (item, index) {
|
|
18948
19013
|
if (item[groupKey] && item[groupKey].length > 0) {
|
|
18949
19014
|
var newElement = item[groupKey].map(function (childItem, index) {
|
|
@@ -18953,10 +19018,12 @@
|
|
|
18953
19018
|
isBottomChild: index === item[groupKey].length - 1
|
|
18954
19019
|
});
|
|
18955
19020
|
});
|
|
18956
|
-
|
|
18957
|
-
|
|
19021
|
+
modifiedData_1.push.apply(modifiedData_1, newElement);
|
|
19022
|
+
} else {
|
|
19023
|
+
modifiedData_1.push(item);
|
|
18958
19024
|
}
|
|
18959
19025
|
});
|
|
19026
|
+
return modifiedData_1;
|
|
18960
19027
|
}
|
|
18961
19028
|
|
|
18962
19029
|
return rawData;
|
|
@@ -18984,7 +19051,7 @@
|
|
|
18984
19051
|
};
|
|
18985
19052
|
function Table(_a) {
|
|
18986
19053
|
var columns = _a.columns,
|
|
18987
|
-
|
|
19054
|
+
rawData = _a.data,
|
|
18988
19055
|
_b = _a.keyId,
|
|
18989
19056
|
keyId = _b === void 0 ? 'id' : _b,
|
|
18990
19057
|
_c = _a.pageIndex,
|
|
@@ -19057,7 +19124,9 @@
|
|
|
19057
19124
|
|
|
19058
19125
|
var instance = reactTable.useTable({
|
|
19059
19126
|
columns: columns,
|
|
19060
|
-
data:
|
|
19127
|
+
data: React.useMemo(function () {
|
|
19128
|
+
return formattingData(rawData, rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.groupKey);
|
|
19129
|
+
}, [rawData, rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.groupKey]),
|
|
19061
19130
|
initialState: getInitialState(),
|
|
19062
19131
|
manualPagination: !!fetchData,
|
|
19063
19132
|
manualSortBy: !!fetchData,
|
|
@@ -19138,7 +19207,7 @@
|
|
|
19138
19207
|
|
|
19139
19208
|
var renderInfiniteScrollWrapper = function renderInfiniteScrollWrapper(children) {
|
|
19140
19209
|
return jsxRuntime.jsx(ConditionalWrapper, __assign({
|
|
19141
|
-
condition: isInfiniteScroll &&
|
|
19210
|
+
condition: isInfiniteScroll && rawData.length > 0,
|
|
19142
19211
|
wrapper: function (children) {
|
|
19143
19212
|
return jsxRuntime.jsx(InfiniteScroll__default["default"], __assign({
|
|
19144
19213
|
loadMore: function (_) {
|
|
@@ -19232,29 +19301,29 @@
|
|
|
19232
19301
|
gotoPage(controlledPageIndex);
|
|
19233
19302
|
}, [controlledPageIndex]);
|
|
19234
19303
|
React.useEffect(function () {
|
|
19235
|
-
if (
|
|
19304
|
+
if (rawData && rawData.length > 0) doFetchData(0, isInfiniteScroll ? rowLimit : pageSize);
|
|
19236
19305
|
}, [sortBy]);
|
|
19237
19306
|
reactTable.useMountedLayoutEffect(function () {
|
|
19238
|
-
if (
|
|
19307
|
+
if (rawData && rawData.length > 0 && selectedRowIds && onSelectedChange) onSelectedChange(selectedRowIds ? Object.keys(selectedRowIds) : []);
|
|
19239
19308
|
}, [selectedRowIds]);
|
|
19240
19309
|
React.useEffect(function () {
|
|
19241
19310
|
var _a;
|
|
19242
19311
|
|
|
19243
|
-
if (isInfiniteScroll &&
|
|
19312
|
+
if (isInfiniteScroll && rawData.length <= rowLimit) {
|
|
19244
19313
|
(_a = scrollerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
19245
19314
|
top: 0
|
|
19246
19315
|
});
|
|
19247
19316
|
}
|
|
19248
|
-
}, [
|
|
19317
|
+
}, [rawData]);
|
|
19249
19318
|
React.useEffect(function () {
|
|
19250
|
-
if (selectedIds &&
|
|
19319
|
+
if (selectedIds && rawData.length > 0) {
|
|
19251
19320
|
var selectedIdsKeys = Object.keys(selectedIds);
|
|
19252
19321
|
selectedIdsKeys.map(function (key) {
|
|
19253
19322
|
toggleRowSelected(key, true);
|
|
19254
19323
|
return key;
|
|
19255
19324
|
});
|
|
19256
19325
|
}
|
|
19257
|
-
}, [
|
|
19326
|
+
}, [rawData, selectedIds]);
|
|
19258
19327
|
return jsxRuntime.jsxs(Box, __assign({
|
|
19259
19328
|
css: {
|
|
19260
19329
|
position: 'relative',
|
|
@@ -19299,7 +19368,8 @@
|
|
|
19299
19368
|
}, {
|
|
19300
19369
|
children: [renderInfiniteScrollWrapper(jsxRuntime.jsxs(TableContent$3, __assign({}, getTableProps(), {
|
|
19301
19370
|
children: [jsxRuntime.jsx(TableHead$3, __assign({
|
|
19302
|
-
css: headerCss
|
|
19371
|
+
css: headerCss,
|
|
19372
|
+
isInfiniteScroll: isInfiniteScroll
|
|
19303
19373
|
}, {
|
|
19304
19374
|
children: headerGroups.map(function (headerGroup) {
|
|
19305
19375
|
var visibleHeaders = headerGroup.headers.filter(function (column) {
|
|
@@ -19311,7 +19381,9 @@
|
|
|
19311
19381
|
return jsxRuntime.jsx(TableHeadCell$3, __assign({}, column.getHeaderProps(function (props) {
|
|
19312
19382
|
return [props, !column.unsortable ? column.getSortByToggleProps({
|
|
19313
19383
|
title: 'Urutkan'
|
|
19314
|
-
}) : {
|
|
19384
|
+
}) : {
|
|
19385
|
+
onClick: column.onToggle
|
|
19386
|
+
}, {
|
|
19315
19387
|
style: {
|
|
19316
19388
|
width: column.colWidth,
|
|
19317
19389
|
maxWidth: column.colMaxWidth,
|
|
@@ -19323,7 +19395,9 @@
|
|
|
19323
19395
|
}, {
|
|
19324
19396
|
children: typeof headerRender === 'string' ? jsxRuntime.jsx(TableHeaderCellContainer, __assign({
|
|
19325
19397
|
isSortedDesc: column.isSortedDesc,
|
|
19326
|
-
unsortable: column.unsortable
|
|
19398
|
+
unsortable: column.unsortable,
|
|
19399
|
+
isToggleable: !!column.onToggle,
|
|
19400
|
+
isToggled: column.isToggled
|
|
19327
19401
|
}, {
|
|
19328
19402
|
children: jsxRuntime.jsx(TableHeadCellContent, __assign({
|
|
19329
19403
|
heading: "headerTable"
|
|
@@ -25516,6 +25590,7 @@
|
|
|
25516
25590
|
gap: "6"
|
|
25517
25591
|
}, {
|
|
25518
25592
|
children: [props.carousel && jsxRuntime.jsx(IconStyled, __assign({
|
|
25593
|
+
type: "button",
|
|
25519
25594
|
onClick: prevSlide,
|
|
25520
25595
|
buttonType: "secondary"
|
|
25521
25596
|
}, {
|
|
@@ -32661,7 +32736,49 @@
|
|
|
32661
32736
|
height: value
|
|
32662
32737
|
}
|
|
32663
32738
|
};
|
|
32664
|
-
}, 1000)
|
|
32739
|
+
}, 1000),
|
|
32740
|
+
disabled: {
|
|
32741
|
+
true: {
|
|
32742
|
+
'& > .wrapper-root > .editor-root': {
|
|
32743
|
+
backgroundColor: '$formDisable',
|
|
32744
|
+
color: '$textDisable'
|
|
32745
|
+
},
|
|
32746
|
+
'& > .wrapper-root > .toolbar-root': {
|
|
32747
|
+
backgroundColor: '$formDisable',
|
|
32748
|
+
color: '$textDisable'
|
|
32749
|
+
},
|
|
32750
|
+
'& > .wrapper-root > .toolbar-root > div > .rdw-option-wrapper': {
|
|
32751
|
+
backgroundColor: '$formDisable !important',
|
|
32752
|
+
'& img': {
|
|
32753
|
+
filter: 'contrast(0)'
|
|
32754
|
+
}
|
|
32755
|
+
},
|
|
32756
|
+
'& > .wrapper-root > .toolbar-root > .rdw-dropdown-wrapper': {
|
|
32757
|
+
backgroundColor: '$formDisable !important',
|
|
32758
|
+
'& img': {
|
|
32759
|
+
filter: 'contrast(0)'
|
|
32760
|
+
},
|
|
32761
|
+
'& a': {
|
|
32762
|
+
pointerEvents: 'none'
|
|
32763
|
+
},
|
|
32764
|
+
'& > a > div': {
|
|
32765
|
+
borderTop: '6px solid $textDisable'
|
|
32766
|
+
}
|
|
32767
|
+
},
|
|
32768
|
+
'& > .wrapper-root > .toolbar-root > div > .rdw-dropdown-wrapper': {
|
|
32769
|
+
backgroundColor: '$formDisable !important',
|
|
32770
|
+
'& a': {
|
|
32771
|
+
pointerEvents: 'none'
|
|
32772
|
+
},
|
|
32773
|
+
'& > a > span': {
|
|
32774
|
+
color: '$textDisable'
|
|
32775
|
+
},
|
|
32776
|
+
'& > a > div': {
|
|
32777
|
+
borderTop: '6px solid $textDisable'
|
|
32778
|
+
}
|
|
32779
|
+
}
|
|
32780
|
+
}
|
|
32781
|
+
}
|
|
32665
32782
|
}
|
|
32666
32783
|
});
|
|
32667
32784
|
var MaxLengthText = styled('p', {
|
|
@@ -32687,7 +32804,8 @@
|
|
|
32687
32804
|
toolbar = props.toolbar,
|
|
32688
32805
|
editorHeight = props.editorHeight,
|
|
32689
32806
|
uploadCallback = props.uploadCallback,
|
|
32690
|
-
maxLength = props.maxLength
|
|
32807
|
+
maxLength = props.maxLength,
|
|
32808
|
+
disabled = props.disabled;
|
|
32691
32809
|
|
|
32692
32810
|
var _e = React.useState(function () {
|
|
32693
32811
|
return draftJs.EditorState.createEmpty();
|
|
@@ -32778,7 +32896,8 @@
|
|
|
32778
32896
|
};
|
|
32779
32897
|
return jsxRuntime.jsxs(Container$1, __assign({
|
|
32780
32898
|
css: css,
|
|
32781
|
-
editorHeight: editorHeight
|
|
32899
|
+
editorHeight: editorHeight,
|
|
32900
|
+
disabled: disabled
|
|
32782
32901
|
}, {
|
|
32783
32902
|
children: [jsxRuntime.jsx(reactDraftWysiwyg.Editor, {
|
|
32784
32903
|
wrapperClassName: "wrapper-root",
|
|
@@ -32786,7 +32905,8 @@
|
|
|
32786
32905
|
toolbarClassName: "toolbar-root",
|
|
32787
32906
|
editorState: editorState,
|
|
32788
32907
|
onEditorStateChange: onEditorStateChange,
|
|
32789
|
-
toolbar: toolbar ? toolbar(config) : config
|
|
32908
|
+
toolbar: toolbar ? toolbar(config) : config,
|
|
32909
|
+
readOnly: disabled
|
|
32790
32910
|
}, void 0), maxLength && typeof maxLength === 'number' && jsxRuntime.jsx(MaxLengthText, __assign({
|
|
32791
32911
|
warning: ((_b = (_a = editorState === null || editorState === void 0 ? void 0 : editorState.getCurrentContent()) === null || _a === void 0 ? void 0 : _a.getPlainText()) === null || _b === void 0 ? void 0 : _b.length) > maxLength
|
|
32792
32912
|
}, {
|