@helpdice/ui 1.3.5 → 1.3.7
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/dist/index.js +556 -535
- package/dist/popover/index.js +6 -1
- package/dist/popover/popover-item.d.ts +1 -0
- package/dist/table/index.js +1323 -1302
- package/esm/popover/popover-item.d.ts +1 -0
- package/esm/popover/popover-item.js +6 -1
- package/esm/table/data-table.js +7 -6
- package/esm/table/table-body.js +23 -7
- package/esm/table/table-cell.js +1 -1
- package/package.json +1 -1
package/dist/table/index.js
CHANGED
|
@@ -20023,7 +20023,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
20023
20023
|
color: "".concat(column === null || column === undefined ? undefined : column.color),
|
|
20024
20024
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
20025
20025
|
}, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
|
|
20026
|
-
"data-column": column.label,
|
|
20026
|
+
"data-column": String(column.label).toLowerCase(),
|
|
20027
20027
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
20028
20028
|
onClick: function onClick() {
|
|
20029
20029
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
@@ -20599,247 +20599,6 @@ function Placeholder(_ref) {
|
|
|
20599
20599
|
}, msg));
|
|
20600
20600
|
}
|
|
20601
20601
|
|
|
20602
|
-
var TableBody = function TableBody(_ref) {
|
|
20603
|
-
var data = _ref.data,
|
|
20604
|
-
emptyText = _ref.emptyText,
|
|
20605
|
-
onRow = _ref.onRow,
|
|
20606
|
-
onCell = _ref.onCell,
|
|
20607
|
-
rowClassName = _ref.rowClassName,
|
|
20608
|
-
_ref$rowDraggable = _ref.rowDraggable,
|
|
20609
|
-
rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
|
|
20610
|
-
_ref$readOnly = _ref.readOnly,
|
|
20611
|
-
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
20612
|
-
onSelected = _ref.onSelected;
|
|
20613
|
-
var theme = useTheme();
|
|
20614
|
-
var _useState = React.useState([]),
|
|
20615
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20616
|
-
selected = _useState2[0],
|
|
20617
|
-
setSelected = _useState2[1];
|
|
20618
|
-
var _useTableContext = useTableContext(),
|
|
20619
|
-
columns = _useTableContext.columns;
|
|
20620
|
-
// const rowClickHandler = (row: TableDataItem, index: number) => {
|
|
20621
|
-
// onRow && onRow(row, index)
|
|
20622
|
-
// }
|
|
20623
|
-
|
|
20624
|
-
var handleClick = function handleClick(_event, id) {
|
|
20625
|
-
if (readOnly) {
|
|
20626
|
-
return true;
|
|
20627
|
-
}
|
|
20628
|
-
var selectedIndex = selected.indexOf(id);
|
|
20629
|
-
var newSelected = [];
|
|
20630
|
-
if (selectedIndex === -1) {
|
|
20631
|
-
newSelected = newSelected.concat(selected, id);
|
|
20632
|
-
} else if (selectedIndex === 0) {
|
|
20633
|
-
newSelected = newSelected.concat(selected.slice(1));
|
|
20634
|
-
} else if (selectedIndex === selected.length - 1) {
|
|
20635
|
-
newSelected = newSelected.concat(selected.slice(0, -1));
|
|
20636
|
-
} else if (selectedIndex > 0) {
|
|
20637
|
-
newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
|
|
20638
|
-
}
|
|
20639
|
-
setSelected(newSelected);
|
|
20640
|
-
};
|
|
20641
|
-
|
|
20642
|
-
// const handleSelectAllClick = (event: { target: { checked: any } }) => {
|
|
20643
|
-
// if (event.target.checked) {
|
|
20644
|
-
// const newSelecteds = data.map((n: any) => n._id);
|
|
20645
|
-
// setSelected(newSelecteds as never[]);
|
|
20646
|
-
// return;
|
|
20647
|
-
// }
|
|
20648
|
-
// setSelected([]);
|
|
20649
|
-
// };
|
|
20650
|
-
|
|
20651
|
-
// Push Selected Rows
|
|
20652
|
-
React.useEffect(function () {
|
|
20653
|
-
if (selected.length > 0 && onSelected) {
|
|
20654
|
-
onSelected(selected);
|
|
20655
|
-
}
|
|
20656
|
-
}, [selected]);
|
|
20657
|
-
function renderRow(cols, row, index) {
|
|
20658
|
-
var _row$style;
|
|
20659
|
-
var urid = _.uniqueId();
|
|
20660
|
-
var className = rowClassName(row, index);
|
|
20661
|
-
var rw = _objectSpread2({}, row);
|
|
20662
|
-
var rowStyle = (_row$style = row === null || row === undefined ? undefined : row.style) !== null && _row$style !== undefined ? _row$style : {};
|
|
20663
|
-
var onDragStart = row === null || row === undefined ? undefined : row.onDragStart;
|
|
20664
|
-
delete rw.table;
|
|
20665
|
-
delete rw.style;
|
|
20666
|
-
delete rw.onDragStart;
|
|
20667
|
-
// console.log(row);
|
|
20668
|
-
// const frow = Object.fromEntries(
|
|
20669
|
-
// Object.entries(row).filter(([ky, _]) => ky !== '_id' && cols.map((col: any) => col.id).includes(ky))
|
|
20670
|
-
// ) as unknown as TableDataItem
|
|
20671
|
-
// console.log(frow);
|
|
20672
|
-
var isRowSelected = selected.indexOf(row) !== -1;
|
|
20673
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
|
|
20674
|
-
draggable: rowDraggable,
|
|
20675
|
-
role: "checkbox",
|
|
20676
|
-
onDragStart: onDragStart,
|
|
20677
|
-
"aria-checked": selected.indexOf(row) !== -1,
|
|
20678
|
-
tabIndex: -1,
|
|
20679
|
-
key: urid,
|
|
20680
|
-
style: _objectSpread2({
|
|
20681
|
-
cursor: 'pointer',
|
|
20682
|
-
backgroundColor: isRowSelected ? '#efefef' : ''
|
|
20683
|
-
}, rowStyle),
|
|
20684
|
-
onClick: function onClick(e) {
|
|
20685
|
-
if (!rowDraggable) {
|
|
20686
|
-
if (onRow) {
|
|
20687
|
-
onRow(row, index);
|
|
20688
|
-
} else {
|
|
20689
|
-
handleClick(e, row);
|
|
20690
|
-
}
|
|
20691
|
-
}
|
|
20692
|
-
},
|
|
20693
|
-
className: _JSXStyle.dynamic([["2019708038", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
|
|
20694
|
-
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
20695
|
-
columns: cols,
|
|
20696
|
-
row: rw,
|
|
20697
|
-
rowIndex: index,
|
|
20698
|
-
emptyText: emptyText,
|
|
20699
|
-
onCellClick: onCell
|
|
20700
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
20701
|
-
id: "2019708038",
|
|
20702
|
-
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
20703
|
-
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
20704
|
-
}
|
|
20705
|
-
if ((data === null || data === undefined ? undefined : data.length) === 0) {
|
|
20706
|
-
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
20707
|
-
colSpan: columns === null || columns === undefined ? undefined : columns.length
|
|
20708
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Placeholder, {
|
|
20709
|
-
empty: true,
|
|
20710
|
-
msg: "No Entries Found"
|
|
20711
|
-
})))));
|
|
20712
|
-
}
|
|
20713
|
-
return /*#__PURE__*/React.createElement("tbody", {
|
|
20714
|
-
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
20715
|
-
}, data.map(function (row, index) {
|
|
20716
|
-
var qid = _.uniqueId();
|
|
20717
|
-
if (row === null || row === undefined) {
|
|
20718
|
-
var uid = _.uniqueId();
|
|
20719
|
-
return /*#__PURE__*/React.createElement("tr", {
|
|
20720
|
-
key: uid,
|
|
20721
|
-
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
20722
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
20723
|
-
colSpan: columns.length,
|
|
20724
|
-
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
20725
|
-
}, "\u2003"));
|
|
20726
|
-
}
|
|
20727
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index), (row === null || row === undefined ? undefined : row.table) && /*#__PURE__*/React.createElement("tr", {
|
|
20728
|
-
key: qid,
|
|
20729
|
-
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
20730
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
20731
|
-
style: {
|
|
20732
|
-
padding: '1rem'
|
|
20733
|
-
},
|
|
20734
|
-
colSpan: columns.length,
|
|
20735
|
-
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
20736
|
-
})));
|
|
20737
|
-
|
|
20738
|
-
// return (
|
|
20739
|
-
// <tr
|
|
20740
|
-
// key={`tbody-row-${index}`}
|
|
20741
|
-
// className={useClasses({ hover }, className)}
|
|
20742
|
-
// onClick={() => rowClickHandler(row, index)}>
|
|
20743
|
-
// <TableCell<TableDataItem>
|
|
20744
|
-
// columns={columns}
|
|
20745
|
-
// row={row}
|
|
20746
|
-
// rowIndex={index}
|
|
20747
|
-
// emptyText={emptyText}
|
|
20748
|
-
// onCellClick={onCell}
|
|
20749
|
-
// />
|
|
20750
|
-
// </tr>
|
|
20751
|
-
// )
|
|
20752
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
20753
|
-
id: "1422656197",
|
|
20754
|
-
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
20755
|
-
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
20756
|
-
};
|
|
20757
|
-
TableBody.displayName = 'TableBody';
|
|
20758
|
-
|
|
20759
|
-
var getRealShape = function getRealShape(el) {
|
|
20760
|
-
var defaultShape = {
|
|
20761
|
-
width: 0,
|
|
20762
|
-
height: 0
|
|
20763
|
-
};
|
|
20764
|
-
if (!el || typeof window === 'undefined') return defaultShape;
|
|
20765
|
-
var rect = el.getBoundingClientRect();
|
|
20766
|
-
var _window$getComputedSt = window.getComputedStyle(el),
|
|
20767
|
-
width = _window$getComputedSt.width,
|
|
20768
|
-
height = _window$getComputedSt.height;
|
|
20769
|
-
var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
|
|
20770
|
-
if (!str) return 0;
|
|
20771
|
-
var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
|
|
20772
|
-
return Number.isNaN(+strVal) ? 0 : +strVal;
|
|
20773
|
-
};
|
|
20774
|
-
return {
|
|
20775
|
-
width: getCSSStyleVal("".concat(width), rect.width),
|
|
20776
|
-
height: getCSSStyleVal("".concat(height), rect.height)
|
|
20777
|
-
};
|
|
20778
|
-
};
|
|
20779
|
-
var useRealShape = function useRealShape(ref) {
|
|
20780
|
-
var _useState = React.useState({
|
|
20781
|
-
width: 0,
|
|
20782
|
-
height: 0
|
|
20783
|
-
}),
|
|
20784
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20785
|
-
state = _useState2[0],
|
|
20786
|
-
setState = _useState2[1];
|
|
20787
|
-
var update = function update() {
|
|
20788
|
-
var _getRealShape = getRealShape(ref.current),
|
|
20789
|
-
width = _getRealShape.width,
|
|
20790
|
-
height = _getRealShape.height;
|
|
20791
|
-
setState({
|
|
20792
|
-
width: width,
|
|
20793
|
-
height: height
|
|
20794
|
-
});
|
|
20795
|
-
};
|
|
20796
|
-
React.useEffect(function () {
|
|
20797
|
-
return update();
|
|
20798
|
-
}, [ref.current]);
|
|
20799
|
-
return [state, update];
|
|
20800
|
-
};
|
|
20801
|
-
|
|
20802
|
-
/* "use client" */
|
|
20803
|
-
|
|
20804
|
-
var TableColumn = function TableColumn(columnProps) {
|
|
20805
|
-
var _ref = columnProps,
|
|
20806
|
-
children = _ref.children,
|
|
20807
|
-
prop = _ref.prop,
|
|
20808
|
-
label = _ref.label,
|
|
20809
|
-
width = _ref.width,
|
|
20810
|
-
filter = _ref.filter,
|
|
20811
|
-
options = _ref.options,
|
|
20812
|
-
noWrap = _ref.noWrap,
|
|
20813
|
-
align = _ref.align,
|
|
20814
|
-
_ref$fontSize = _ref.fontSize,
|
|
20815
|
-
fontSize = _ref$fontSize === undefined ? 'smaller' : _ref$fontSize,
|
|
20816
|
-
_ref$className = _ref.className,
|
|
20817
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
20818
|
-
renderHandler = _ref.render;
|
|
20819
|
-
var _useTableContext = useTableContext(),
|
|
20820
|
-
updateColumn = _useTableContext.updateColumn;
|
|
20821
|
-
var safeProp = "".concat(prop.toString()).trim();
|
|
20822
|
-
if (!safeProp) {
|
|
20823
|
-
useWarning('The props "prop" is required.', 'Table.Column');
|
|
20824
|
-
}
|
|
20825
|
-
React.useEffect(function () {
|
|
20826
|
-
updateColumn({
|
|
20827
|
-
label: children || label,
|
|
20828
|
-
filter: filter,
|
|
20829
|
-
noWrap: noWrap,
|
|
20830
|
-
options: options,
|
|
20831
|
-
prop: safeProp,
|
|
20832
|
-
width: width,
|
|
20833
|
-
align: align,
|
|
20834
|
-
fontSize: fontSize,
|
|
20835
|
-
className: className,
|
|
20836
|
-
renderHandler: function renderHandler() {}
|
|
20837
|
-
});
|
|
20838
|
-
}, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
20839
|
-
return null;
|
|
20840
|
-
};
|
|
20841
|
-
TableColumn.displayName = 'TableColumn';
|
|
20842
|
-
|
|
20843
20602
|
// import { IconContext } from "./context.js";
|
|
20844
20603
|
const createIcon = (Component) => {
|
|
20845
20604
|
const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
|
|
@@ -30716,21 +30475,203 @@ const HelpCircle = ({ color, strokeWidth, set }) => {
|
|
|
30716
30475
|
HelpCircle.displayName = "HelpCircle";
|
|
30717
30476
|
createIcon(HelpCircle);
|
|
30718
30477
|
|
|
30719
|
-
var
|
|
30720
|
-
var
|
|
30721
|
-
|
|
30722
|
-
|
|
30723
|
-
|
|
30724
|
-
|
|
30725
|
-
|
|
30726
|
-
|
|
30727
|
-
|
|
30728
|
-
|
|
30729
|
-
|
|
30730
|
-
var
|
|
30731
|
-
|
|
30732
|
-
|
|
30733
|
-
|
|
30478
|
+
var ButtonDrip = function ButtonDrip(_ref) {
|
|
30479
|
+
var _ref$x = _ref.x,
|
|
30480
|
+
x = _ref$x === undefined ? 0 : _ref$x,
|
|
30481
|
+
_ref$y = _ref.y,
|
|
30482
|
+
y = _ref$y === undefined ? 0 : _ref$y,
|
|
30483
|
+
color = _ref.color,
|
|
30484
|
+
onCompleted = _ref.onCompleted;
|
|
30485
|
+
var dripRef = React.useRef(null);
|
|
30486
|
+
/* istanbul ignore next */
|
|
30487
|
+
var top = Number.isNaN(+y) ? 0 : y - 10;
|
|
30488
|
+
/* istanbul ignore next */
|
|
30489
|
+
var left = Number.isNaN(+x) ? 0 : x - 10;
|
|
30490
|
+
React.useEffect(function () {
|
|
30491
|
+
/* istanbul ignore next */
|
|
30492
|
+
if (!dripRef.current) return;
|
|
30493
|
+
dripRef.current.addEventListener('animationend', onCompleted);
|
|
30494
|
+
return function () {
|
|
30495
|
+
/* istanbul ignore next */
|
|
30496
|
+
if (!dripRef.current) return;
|
|
30497
|
+
dripRef.current.removeEventListener('animationend', onCompleted);
|
|
30498
|
+
};
|
|
30499
|
+
});
|
|
30500
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30501
|
+
ref: dripRef,
|
|
30502
|
+
className: "jsx-3424889537" + " " + "drip"
|
|
30503
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
30504
|
+
width: "20",
|
|
30505
|
+
height: "20",
|
|
30506
|
+
viewBox: "0 0 20 20",
|
|
30507
|
+
style: {
|
|
30508
|
+
top: top,
|
|
30509
|
+
left: left
|
|
30510
|
+
},
|
|
30511
|
+
className: "jsx-3424889537"
|
|
30512
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
30513
|
+
stroke: "none",
|
|
30514
|
+
strokeWidth: "1",
|
|
30515
|
+
fill: "none",
|
|
30516
|
+
fillRule: "evenodd",
|
|
30517
|
+
className: "jsx-3424889537"
|
|
30518
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
30519
|
+
fill: color,
|
|
30520
|
+
className: "jsx-3424889537"
|
|
30521
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
30522
|
+
width: "100%",
|
|
30523
|
+
height: "100%",
|
|
30524
|
+
rx: "10",
|
|
30525
|
+
className: "jsx-3424889537"
|
|
30526
|
+
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30527
|
+
id: "3424889537"
|
|
30528
|
+
}, ".drip.jsx-3424889537{position:absolute;left:0;right:0;top:0;bottom:0;}svg.jsx-3424889537{position:absolute;-webkit-animation:350ms ease-in expand-jsx-3424889537;animation:350ms ease-in expand-jsx-3424889537;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:1rem;height:1rem;}@-webkit-keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}@keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}"));
|
|
30529
|
+
};
|
|
30530
|
+
ButtonDrip.displayName = 'ButtonDrip';
|
|
30531
|
+
|
|
30532
|
+
var _excluded$a = ["children", "type", "color", "className", "spaceRatio"];
|
|
30533
|
+
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
30534
|
+
var colors = {
|
|
30535
|
+
"default": palette.accents_6,
|
|
30536
|
+
secondary: palette.secondary,
|
|
30537
|
+
success: palette.success,
|
|
30538
|
+
warning: palette.warning,
|
|
30539
|
+
error: palette.error
|
|
30540
|
+
};
|
|
30541
|
+
return color ? color : colors[type];
|
|
30542
|
+
};
|
|
30543
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
|
30544
|
+
var children = _ref.children,
|
|
30545
|
+
_ref$type = _ref.type,
|
|
30546
|
+
type = _ref$type === undefined ? 'default' : _ref$type,
|
|
30547
|
+
color = _ref.color,
|
|
30548
|
+
_ref$className = _ref.className,
|
|
30549
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
30550
|
+
_ref$spaceRatio = _ref.spaceRatio,
|
|
30551
|
+
spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
|
|
30552
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
30553
|
+
var theme = useTheme();
|
|
30554
|
+
var _useScale = useScale(),
|
|
30555
|
+
SCALES = _useScale.SCALES;
|
|
30556
|
+
var classes = useClasses('loading-container', className);
|
|
30557
|
+
var bgColor = React.useMemo(function () {
|
|
30558
|
+
return getIconBgColor(type, theme.palette, color);
|
|
30559
|
+
}, [type, theme.palette, color]);
|
|
30560
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
30561
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
30562
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
30563
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
|
|
30564
|
+
}, children && /*#__PURE__*/React.createElement("label", {
|
|
30565
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
30566
|
+
}, children), /*#__PURE__*/React.createElement("i", {
|
|
30567
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
30568
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
30569
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
30570
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
30571
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
30572
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30573
|
+
id: "2201634259",
|
|
30574
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]
|
|
30575
|
+
}, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
|
|
30576
|
+
};
|
|
30577
|
+
LoadingComponent.displayName = 'Loading';
|
|
30578
|
+
var Loading = withScale(LoadingComponent);
|
|
30579
|
+
|
|
30580
|
+
var ButtonLoading = function ButtonLoading(_ref) {
|
|
30581
|
+
var color = _ref.color;
|
|
30582
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30583
|
+
className: "jsx-212623367" + " " + "btn-loading"
|
|
30584
|
+
}, /*#__PURE__*/React.createElement(Loading, {
|
|
30585
|
+
color: color
|
|
30586
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30587
|
+
id: "212623367"
|
|
30588
|
+
}, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
|
|
30589
|
+
};
|
|
30590
|
+
ButtonLoading.displayName = 'GeistButtonLoading';
|
|
30591
|
+
|
|
30592
|
+
var _excluded$9 = ["isRight", "isSingle", "children", "className"];
|
|
30593
|
+
var ButtonIcon = function ButtonIcon(_ref) {
|
|
30594
|
+
var _ref$isRight = _ref.isRight,
|
|
30595
|
+
isRight = _ref$isRight === undefined ? false : _ref$isRight,
|
|
30596
|
+
isSingle = _ref.isSingle,
|
|
30597
|
+
children = _ref.children,
|
|
30598
|
+
_ref$className = _ref.className,
|
|
30599
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
30600
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
30601
|
+
var classes = useClasses('icon', {
|
|
30602
|
+
right: isRight,
|
|
30603
|
+
single: isSingle
|
|
30604
|
+
}, className);
|
|
30605
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
30606
|
+
className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
|
|
30607
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30608
|
+
id: "2467502931"
|
|
30609
|
+
}, ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"));
|
|
30610
|
+
};
|
|
30611
|
+
ButtonIcon.displayName = 'ButtonIcon';
|
|
30612
|
+
|
|
30613
|
+
var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
|
|
30614
|
+
var icon = icons.icon,
|
|
30615
|
+
iconRight = icons.iconRight;
|
|
30616
|
+
var hasIcon = icon || iconRight;
|
|
30617
|
+
var isRight = Boolean(iconRight);
|
|
30618
|
+
var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
|
|
30619
|
+
var classes = useClasses('text', isRight ? 'right' : 'left');
|
|
30620
|
+
if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
|
|
30621
|
+
className: "text"
|
|
30622
|
+
}, children);
|
|
30623
|
+
if (React.Children.count(children) === 0) {
|
|
30624
|
+
return /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
30625
|
+
isRight: isRight,
|
|
30626
|
+
isSingle: true
|
|
30627
|
+
}, hasIcon);
|
|
30628
|
+
}
|
|
30629
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
30630
|
+
isRight: isRight
|
|
30631
|
+
}, hasIcon), /*#__PURE__*/React.createElement("div", {
|
|
30632
|
+
className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
|
|
30633
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30634
|
+
id: "3568181479",
|
|
30635
|
+
dynamic: [paddingForAutoMode, paddingForAutoMode]
|
|
30636
|
+
}, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
|
|
30637
|
+
};
|
|
30638
|
+
var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
|
|
30639
|
+
if (!config.isButtonGroup) return props;
|
|
30640
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30641
|
+
auto: true,
|
|
30642
|
+
shadow: false,
|
|
30643
|
+
ghost: config.ghost || props.ghost,
|
|
30644
|
+
type: config.type || props.type,
|
|
30645
|
+
disabled: config.disabled || props.disabled
|
|
30646
|
+
});
|
|
30647
|
+
};
|
|
30648
|
+
|
|
30649
|
+
/* "use client" */
|
|
30650
|
+
|
|
30651
|
+
var defaultContext$2 = {
|
|
30652
|
+
isButtonGroup: false,
|
|
30653
|
+
disabled: false
|
|
30654
|
+
};
|
|
30655
|
+
var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$2);
|
|
30656
|
+
var useButtonGroupContext = function useButtonGroupContext() {
|
|
30657
|
+
return React.useContext(ButtonGroupContext);
|
|
30658
|
+
};
|
|
30659
|
+
|
|
30660
|
+
var hexToRgb = function hexToRgb(color) {
|
|
30661
|
+
var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
30662
|
+
var full = color.replace(fullReg, function (_, r, g, b) {
|
|
30663
|
+
return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
|
|
30664
|
+
});
|
|
30665
|
+
var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
|
|
30666
|
+
if (!values) {
|
|
30667
|
+
throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
|
|
30668
|
+
}
|
|
30669
|
+
return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
|
|
30670
|
+
};
|
|
30671
|
+
var colorToRgbValues = function colorToRgbValues(color) {
|
|
30672
|
+
if (color.charAt(0) === '#') return hexToRgb(color);
|
|
30673
|
+
var safeColor = color.replace(/ /g, '');
|
|
30674
|
+
var colorType = color.substr(0, 4);
|
|
30734
30675
|
var regArray = safeColor.match(/\((.+)\)/);
|
|
30735
30676
|
if (!colorType.startsWith('rgb') || !regArray) {
|
|
30736
30677
|
console.log(color);
|
|
@@ -30751,1093 +30692,474 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
|
30751
30692
|
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
30752
30693
|
};
|
|
30753
30694
|
|
|
30754
|
-
var
|
|
30755
|
-
var
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
|
|
30764
|
-
|
|
30765
|
-
|
|
30766
|
-
|
|
30767
|
-
|
|
30768
|
-
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
30695
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, type) {
|
|
30696
|
+
var colors = {
|
|
30697
|
+
secondary: {
|
|
30698
|
+
bg: palette.background,
|
|
30699
|
+
border: palette.foreground,
|
|
30700
|
+
color: palette.foreground
|
|
30701
|
+
},
|
|
30702
|
+
success: {
|
|
30703
|
+
bg: palette.background,
|
|
30704
|
+
border: palette.success,
|
|
30705
|
+
color: palette.success
|
|
30706
|
+
},
|
|
30707
|
+
warning: {
|
|
30708
|
+
bg: palette.background,
|
|
30709
|
+
border: palette.warning,
|
|
30710
|
+
color: palette.warning
|
|
30711
|
+
},
|
|
30712
|
+
error: {
|
|
30713
|
+
bg: palette.background,
|
|
30714
|
+
border: palette.error,
|
|
30715
|
+
color: palette.error
|
|
30716
|
+
}
|
|
30775
30717
|
};
|
|
30776
|
-
return
|
|
30777
|
-
className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]])
|
|
30778
|
-
}, /*#__PURE__*/React.createElement("button", _extends({
|
|
30779
|
-
onClick: clickHandler
|
|
30780
|
-
}, props, {
|
|
30781
|
-
className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
30782
|
-
}), children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30783
|
-
id: "1657796974",
|
|
30784
|
-
dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
30785
|
-
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
30786
|
-
};
|
|
30787
|
-
PaginationItem.displayName = 'GeistPaginationItem';
|
|
30788
|
-
|
|
30789
|
-
/* "use client" */
|
|
30790
|
-
|
|
30791
|
-
tuple('prev', 'next', 'click');
|
|
30792
|
-
var defaultContext$2 = {};
|
|
30793
|
-
var PaginationContext = /*#__PURE__*/React.createContext(defaultContext$2);
|
|
30794
|
-
var usePaginationContext = function usePaginationContext() {
|
|
30795
|
-
return React.useContext(PaginationContext);
|
|
30718
|
+
return colors[type] || null;
|
|
30796
30719
|
};
|
|
30797
|
-
|
|
30798
|
-
var
|
|
30799
|
-
|
|
30800
|
-
|
|
30801
|
-
|
|
30802
|
-
|
|
30803
|
-
|
|
30804
|
-
|
|
30805
|
-
|
|
30806
|
-
onClick: function onClick() {
|
|
30807
|
-
return update && update('prev');
|
|
30720
|
+
var getButtonColors = function getButtonColors(palette, props) {
|
|
30721
|
+
var type = props.type,
|
|
30722
|
+
disabled = props.disabled,
|
|
30723
|
+
ghost = props.ghost;
|
|
30724
|
+
var colors = {
|
|
30725
|
+
"default": {
|
|
30726
|
+
bg: palette.background,
|
|
30727
|
+
border: palette.border,
|
|
30728
|
+
color: palette.accents_5
|
|
30808
30729
|
},
|
|
30809
|
-
|
|
30810
|
-
|
|
30811
|
-
|
|
30812
|
-
|
|
30813
|
-
|
|
30814
|
-
var _excluded$8 = ["children"];
|
|
30815
|
-
var PaginationNext = function PaginationNext(_ref) {
|
|
30816
|
-
var children = _ref.children,
|
|
30817
|
-
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
30818
|
-
var _usePaginationContext = usePaginationContext(),
|
|
30819
|
-
update = _usePaginationContext.update,
|
|
30820
|
-
isLast = _usePaginationContext.isLast;
|
|
30821
|
-
return /*#__PURE__*/React.createElement(PaginationItem, _extends({
|
|
30822
|
-
onClick: function onClick() {
|
|
30823
|
-
return update && update('next');
|
|
30730
|
+
secondary: {
|
|
30731
|
+
bg: palette.foreground,
|
|
30732
|
+
border: palette.foreground,
|
|
30733
|
+
color: palette.background
|
|
30824
30734
|
},
|
|
30825
|
-
|
|
30826
|
-
|
|
30827
|
-
|
|
30828
|
-
|
|
30829
|
-
|
|
30830
|
-
var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
30831
|
-
var isBefore = _ref.isBefore,
|
|
30832
|
-
_onClick = _ref.onClick;
|
|
30833
|
-
var _useState = React.useState(false),
|
|
30834
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
30835
|
-
showMore = _useState2[0],
|
|
30836
|
-
setShowMore = _useState2[1];
|
|
30837
|
-
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
30838
|
-
onClick: function onClick(e) {
|
|
30839
|
-
return _onClick && _onClick(e);
|
|
30735
|
+
success: {
|
|
30736
|
+
bg: palette.success,
|
|
30737
|
+
border: palette.success,
|
|
30738
|
+
color: '#fff'
|
|
30840
30739
|
},
|
|
30841
|
-
|
|
30842
|
-
|
|
30740
|
+
warning: {
|
|
30741
|
+
bg: palette.warning,
|
|
30742
|
+
border: palette.warning,
|
|
30743
|
+
color: '#fff'
|
|
30843
30744
|
},
|
|
30844
|
-
|
|
30845
|
-
|
|
30745
|
+
error: {
|
|
30746
|
+
bg: palette.error,
|
|
30747
|
+
border: palette.error,
|
|
30748
|
+
color: '#fff'
|
|
30749
|
+
},
|
|
30750
|
+
abort: {
|
|
30751
|
+
bg: 'transparent',
|
|
30752
|
+
border: 'transparent',
|
|
30753
|
+
color: palette.accents_5
|
|
30846
30754
|
}
|
|
30847
|
-
}
|
|
30848
|
-
|
|
30849
|
-
|
|
30850
|
-
|
|
30851
|
-
|
|
30852
|
-
|
|
30853
|
-
fill: "none",
|
|
30854
|
-
shapeRendering: "geometricPrecision",
|
|
30855
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]) + " " + "more"
|
|
30856
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
30857
|
-
d: "M13 17l5-5-5-5",
|
|
30858
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
30859
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
30860
|
-
d: "M6 17l5-5-5-5",
|
|
30861
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
30862
|
-
})) : /*#__PURE__*/React.createElement("svg", {
|
|
30863
|
-
viewBox: "0 0 24 24",
|
|
30864
|
-
strokeWidth: "1.5",
|
|
30865
|
-
strokeLinecap: "round",
|
|
30866
|
-
strokeLinejoin: "round",
|
|
30867
|
-
fill: "none",
|
|
30868
|
-
shapeRendering: "geometricPrecision",
|
|
30869
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
30870
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
30871
|
-
cx: "12",
|
|
30872
|
-
cy: "12",
|
|
30873
|
-
r: "1",
|
|
30874
|
-
fill: "currentColor",
|
|
30875
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
30876
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
30877
|
-
cx: "19",
|
|
30878
|
-
cy: "12",
|
|
30879
|
-
r: "1",
|
|
30880
|
-
fill: "currentColor",
|
|
30881
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
30882
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
30883
|
-
cx: "5",
|
|
30884
|
-
cy: "12",
|
|
30885
|
-
r: "1",
|
|
30886
|
-
fill: "currentColor",
|
|
30887
|
-
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
30888
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30889
|
-
id: "2928474255",
|
|
30890
|
-
dynamic: [isBefore ? '180deg' : '0deg']
|
|
30891
|
-
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
30892
|
-
};
|
|
30893
|
-
PaginationEllipsis.displayName = 'GeistPaginationEllipsis';
|
|
30755
|
+
};
|
|
30756
|
+
if (disabled) return {
|
|
30757
|
+
bg: palette.accents_1,
|
|
30758
|
+
border: palette.accents_2,
|
|
30759
|
+
color: '#ccc'
|
|
30760
|
+
};
|
|
30894
30761
|
|
|
30895
|
-
|
|
30896
|
-
|
|
30897
|
-
|
|
30898
|
-
|
|
30899
|
-
|
|
30900
|
-
|
|
30901
|
-
|
|
30902
|
-
|
|
30903
|
-
|
|
30904
|
-
|
|
30905
|
-
|
|
30906
|
-
|
|
30907
|
-
|
|
30908
|
-
|
|
30909
|
-
|
|
30910
|
-
|
|
30911
|
-
|
|
30912
|
-
|
|
30913
|
-
|
|
30914
|
-
|
|
30915
|
-
|
|
30916
|
-
|
|
30917
|
-
|
|
30918
|
-
|
|
30919
|
-
|
|
30920
|
-
|
|
30921
|
-
|
|
30922
|
-
|
|
30923
|
-
|
|
30924
|
-
|
|
30925
|
-
|
|
30926
|
-
|
|
30927
|
-
|
|
30928
|
-
var middlePages = pagesArray.map(function (_, index) {
|
|
30929
|
-
var middleIndexNumber = middleNumber - (index + 1);
|
|
30930
|
-
var value = current - middleIndexNumber;
|
|
30931
|
-
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
30932
|
-
key: "pagination-middle-".concat(index),
|
|
30933
|
-
active: index + 1 === middleNumber,
|
|
30934
|
-
onClick: function onClick() {
|
|
30935
|
-
return setPage(value);
|
|
30936
|
-
}
|
|
30937
|
-
}, value);
|
|
30938
|
-
});
|
|
30939
|
-
var endPages = pagesArray.map(function (_, index) {
|
|
30940
|
-
var value = count - (showPages - index);
|
|
30941
|
-
return renderItem(value, current);
|
|
30942
|
-
});
|
|
30943
|
-
if (count <= limit) {
|
|
30944
|
-
/* eslint-disable react/jsx-no-useless-fragment */
|
|
30945
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, _toConsumableArray(new Array(count)).map(function (_, index) {
|
|
30946
|
-
var value = index + 1;
|
|
30947
|
-
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
30948
|
-
key: "pagination-item-".concat(value),
|
|
30949
|
-
active: value === current,
|
|
30950
|
-
onClick: function onClick() {
|
|
30951
|
-
return setPage(value);
|
|
30952
|
-
}
|
|
30953
|
-
}, value);
|
|
30954
|
-
}));
|
|
30955
|
-
/* eslint-enable */
|
|
30956
|
-
}
|
|
30957
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderItem(1, current), showBeforeEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
30958
|
-
key: "pagination-ellipsis-before",
|
|
30959
|
-
isBefore: true,
|
|
30960
|
-
onClick: function onClick() {
|
|
30961
|
-
return setPage(function (last) {
|
|
30962
|
-
return last - 5 >= 1 ? last - 5 : 1;
|
|
30963
|
-
});
|
|
30964
|
-
}
|
|
30965
|
-
}), showBeforeEllipsis && showAfterEllipsis ? middlePages : showBeforeEllipsis ? endPages : startPages, showAfterEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
30966
|
-
key: "pagination-ellipsis-after",
|
|
30967
|
-
onClick: function onClick() {
|
|
30968
|
-
return setPage(function (last) {
|
|
30969
|
-
return last + 5 <= count ? last + 5 : count;
|
|
30970
|
-
});
|
|
30762
|
+
/**
|
|
30763
|
+
* The '-light' type is the same color as the common type,
|
|
30764
|
+
* only hover's color is different.
|
|
30765
|
+
* e.g.
|
|
30766
|
+
* Color['success'] === Color['success-light']
|
|
30767
|
+
* Color['warning'] === Color['warning-light']
|
|
30768
|
+
*/
|
|
30769
|
+
var withoutLightType = type === null || type === undefined ? undefined : type.replace('-light', '');
|
|
30770
|
+
var defaultColor = colors["default"];
|
|
30771
|
+
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
30772
|
+
return colors[withoutLightType] || defaultColor;
|
|
30773
|
+
};
|
|
30774
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type) {
|
|
30775
|
+
var colors = {
|
|
30776
|
+
secondary: {
|
|
30777
|
+
bg: palette.foreground,
|
|
30778
|
+
border: palette.background,
|
|
30779
|
+
color: palette.background
|
|
30780
|
+
},
|
|
30781
|
+
success: {
|
|
30782
|
+
bg: palette.success,
|
|
30783
|
+
border: palette.background,
|
|
30784
|
+
color: 'white'
|
|
30785
|
+
},
|
|
30786
|
+
warning: {
|
|
30787
|
+
bg: palette.warning,
|
|
30788
|
+
border: palette.background,
|
|
30789
|
+
color: 'white'
|
|
30790
|
+
},
|
|
30791
|
+
error: {
|
|
30792
|
+
bg: palette.error,
|
|
30793
|
+
border: palette.background,
|
|
30794
|
+
color: 'white'
|
|
30971
30795
|
}
|
|
30972
|
-
}
|
|
30796
|
+
};
|
|
30797
|
+
var withoutLightType = type.replace('-light', '');
|
|
30798
|
+
return colors[withoutLightType] || null;
|
|
30973
30799
|
};
|
|
30974
|
-
|
|
30975
|
-
|
|
30976
|
-
|
|
30977
|
-
|
|
30978
|
-
|
|
30979
|
-
|
|
30980
|
-
|
|
30981
|
-
|
|
30982
|
-
|
|
30983
|
-
|
|
30984
|
-
|
|
30985
|
-
|
|
30986
|
-
|
|
30987
|
-
|
|
30988
|
-
|
|
30989
|
-
|
|
30990
|
-
|
|
30991
|
-
|
|
30992
|
-
|
|
30993
|
-
|
|
30994
|
-
|
|
30995
|
-
|
|
30996
|
-
|
|
30997
|
-
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
}
|
|
31011
|
-
|
|
31012
|
-
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
|
|
31017
|
-
|
|
31018
|
-
|
|
31019
|
-
}
|
|
31020
|
-
if (type === 'next' && pageRef.current < count) {
|
|
31021
|
-
setPage(function (last) {
|
|
31022
|
-
return last + 1;
|
|
31023
|
-
});
|
|
31024
|
-
}
|
|
30800
|
+
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
30801
|
+
var type = props.type,
|
|
30802
|
+
disabled = props.disabled,
|
|
30803
|
+
loading = props.loading,
|
|
30804
|
+
shadow = props.shadow,
|
|
30805
|
+
ghost = props.ghost;
|
|
30806
|
+
var defaultColor = getButtonColors(palette, props);
|
|
30807
|
+
var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
|
|
30808
|
+
var colors = {
|
|
30809
|
+
"default": {
|
|
30810
|
+
bg: palette.background,
|
|
30811
|
+
border: palette.foreground
|
|
30812
|
+
},
|
|
30813
|
+
secondary: {
|
|
30814
|
+
bg: palette.background,
|
|
30815
|
+
border: palette.foreground
|
|
30816
|
+
},
|
|
30817
|
+
success: {
|
|
30818
|
+
bg: palette.background,
|
|
30819
|
+
border: palette.success
|
|
30820
|
+
},
|
|
30821
|
+
warning: {
|
|
30822
|
+
bg: palette.background,
|
|
30823
|
+
border: palette.warning
|
|
30824
|
+
},
|
|
30825
|
+
error: {
|
|
30826
|
+
bg: palette.background,
|
|
30827
|
+
border: palette.error
|
|
30828
|
+
},
|
|
30829
|
+
abort: {
|
|
30830
|
+
bg: 'transparent',
|
|
30831
|
+
border: 'transparent',
|
|
30832
|
+
color: palette.accents_5
|
|
30833
|
+
},
|
|
30834
|
+
'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
30835
|
+
bg: alphaBackground
|
|
30836
|
+
}),
|
|
30837
|
+
'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
30838
|
+
bg: alphaBackground
|
|
30839
|
+
}),
|
|
30840
|
+
'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
30841
|
+
bg: alphaBackground
|
|
30842
|
+
}),
|
|
30843
|
+
'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
30844
|
+
bg: alphaBackground
|
|
30845
|
+
})
|
|
31025
30846
|
};
|
|
31026
|
-
|
|
31027
|
-
|
|
31028
|
-
|
|
31029
|
-
|
|
31030
|
-
|
|
31031
|
-
|
|
31032
|
-
|
|
31033
|
-
|
|
31034
|
-
|
|
31035
|
-
|
|
31036
|
-
|
|
31037
|
-
|
|
31038
|
-
|
|
31039
|
-
|
|
31040
|
-
|
|
31041
|
-
|
|
31042
|
-
|
|
31043
|
-
|
|
31044
|
-
|
|
31045
|
-
|
|
31046
|
-
|
|
31047
|
-
|
|
31048
|
-
|
|
31049
|
-
|
|
31050
|
-
|
|
31051
|
-
|
|
31052
|
-
|
|
31053
|
-
|
|
30847
|
+
if (disabled) return {
|
|
30848
|
+
bg: palette.accents_1,
|
|
30849
|
+
border: palette.accents_2,
|
|
30850
|
+
color: '#ccc'
|
|
30851
|
+
};
|
|
30852
|
+
if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
30853
|
+
color: 'transparent'
|
|
30854
|
+
});
|
|
30855
|
+
if (shadow) return defaultColor;
|
|
30856
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, type) : colors[type]) || colors["default"];
|
|
30857
|
+
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
30858
|
+
color: hoverColor.color || hoverColor.border
|
|
30859
|
+
});
|
|
30860
|
+
};
|
|
30861
|
+
var getButtonCursor = function getButtonCursor(disabled, loading) {
|
|
30862
|
+
if (disabled) return {
|
|
30863
|
+
cursor: 'not-allowed',
|
|
30864
|
+
events: 'auto'
|
|
30865
|
+
};
|
|
30866
|
+
if (loading) return {
|
|
30867
|
+
cursor: 'default',
|
|
30868
|
+
events: 'none'
|
|
30869
|
+
};
|
|
30870
|
+
return {
|
|
30871
|
+
cursor: 'pointer',
|
|
30872
|
+
events: 'auto'
|
|
30873
|
+
};
|
|
30874
|
+
};
|
|
30875
|
+
var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
30876
|
+
var type = props.type;
|
|
30877
|
+
var isLightHover = type ? type.endsWith('light') : false;
|
|
30878
|
+
var hoverColors = getButtonHoverColors(palette, props);
|
|
30879
|
+
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
31054
30880
|
};
|
|
31055
|
-
PaginationComponent.displayName = 'Pagination';
|
|
31056
|
-
var Pagination = withScale(PaginationComponent);
|
|
31057
|
-
|
|
31058
|
-
Pagination.Previous = PaginationPrevious;
|
|
31059
|
-
Pagination.Next = PaginationNext;
|
|
31060
30881
|
|
|
31061
|
-
var _excluded$
|
|
31062
|
-
function
|
|
31063
|
-
|
|
31064
|
-
var _ref = tableProps,
|
|
31065
|
-
children = _ref.children,
|
|
31066
|
-
customData = _ref.data,
|
|
31067
|
-
_ref$initialData = _ref.initialData,
|
|
31068
|
-
initialData = _ref$initialData === undefined ? [] : _ref$initialData,
|
|
31069
|
-
_ref$hover = _ref.hover,
|
|
31070
|
-
hover = _ref$hover === undefined ? true : _ref$hover,
|
|
31071
|
-
_ref$emptyText = _ref.emptyText,
|
|
31072
|
-
emptyText = _ref$emptyText === undefined ? '' : _ref$emptyText,
|
|
31073
|
-
_ref$rowDraggable = _ref.rowDraggable,
|
|
31074
|
-
rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
|
|
31075
|
-
_ref$readOnly = _ref.readOnly,
|
|
31076
|
-
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
31077
|
-
onRow = _ref.onRow,
|
|
31078
|
-
onCell = _ref.onCell;
|
|
31079
|
-
_ref.onChange;
|
|
31080
|
-
var onFilters = _ref.onFilters,
|
|
31081
|
-
onPageChange = _ref.onPageChange,
|
|
31082
|
-
_ref$showFilters = _ref.showFilters,
|
|
31083
|
-
showFilters = _ref$showFilters === undefined ? false : _ref$showFilters,
|
|
31084
|
-
_ref$stickyHeader = _ref.stickyHeader,
|
|
31085
|
-
stickyHeader = _ref$stickyHeader === undefined ? false : _ref$stickyHeader,
|
|
31086
|
-
onSelected = _ref.onSelected,
|
|
31087
|
-
dataLength = _ref.dataLength,
|
|
31088
|
-
viewLength = _ref.viewLength,
|
|
31089
|
-
_ref$className = _ref.className,
|
|
31090
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
31091
|
-
_ref$rowClassName = _ref.rowClassName,
|
|
31092
|
-
rowClassName = _ref$rowClassName === undefined ? function () {
|
|
31093
|
-
return '';
|
|
31094
|
-
} : _ref$rowClassName,
|
|
31095
|
-
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
31096
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
30882
|
+
var _excluded$8 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
|
|
30883
|
+
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
30884
|
+
var theme = useTheme();
|
|
31097
30885
|
var _useScale = useScale(),
|
|
31098
30886
|
SCALES = _useScale.SCALES;
|
|
31099
|
-
var
|
|
31100
|
-
|
|
31101
|
-
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
var _useState = React.useState([]),
|
|
30887
|
+
var buttonRef = React.useRef(null);
|
|
30888
|
+
React.useImperativeHandle(ref, function () {
|
|
30889
|
+
return buttonRef.current;
|
|
30890
|
+
});
|
|
30891
|
+
var _useState = React.useState(false),
|
|
31105
30892
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31106
|
-
|
|
31107
|
-
|
|
31108
|
-
var _useState3 = React.useState(
|
|
30893
|
+
dripShow = _useState2[0],
|
|
30894
|
+
setDripShow = _useState2[1];
|
|
30895
|
+
var _useState3 = React.useState(0),
|
|
31109
30896
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31110
|
-
|
|
31111
|
-
|
|
31112
|
-
var
|
|
31113
|
-
|
|
31114
|
-
|
|
31115
|
-
|
|
31116
|
-
|
|
31117
|
-
|
|
31118
|
-
|
|
31119
|
-
|
|
31120
|
-
|
|
31121
|
-
|
|
31122
|
-
|
|
31123
|
-
|
|
31124
|
-
|
|
31125
|
-
|
|
31126
|
-
|
|
31127
|
-
|
|
31128
|
-
|
|
31129
|
-
|
|
31130
|
-
|
|
31131
|
-
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
|
|
31135
|
-
|
|
31136
|
-
|
|
30897
|
+
dripX = _useState4[0],
|
|
30898
|
+
setDripX = _useState4[1];
|
|
30899
|
+
var _useState5 = React.useState(0),
|
|
30900
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
30901
|
+
dripY = _useState6[0],
|
|
30902
|
+
setDripY = _useState6[1];
|
|
30903
|
+
var groupConfig = useButtonGroupContext();
|
|
30904
|
+
var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
|
|
30905
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
30906
|
+
var children = filteredProps.children,
|
|
30907
|
+
_filteredProps$disabl = filteredProps.disabled,
|
|
30908
|
+
disabled = _filteredProps$disabl === undefined ? false : _filteredProps$disabl;
|
|
30909
|
+
filteredProps.type;
|
|
30910
|
+
var _filteredProps$loadin = filteredProps.loading,
|
|
30911
|
+
loading = _filteredProps$loadin === undefined ? false : _filteredProps$loadin,
|
|
30912
|
+
_filteredProps$shadow = filteredProps.shadow,
|
|
30913
|
+
shadow = _filteredProps$shadow === undefined ? false : _filteredProps$shadow,
|
|
30914
|
+
_filteredProps$ghost = filteredProps.ghost,
|
|
30915
|
+
ghost = _filteredProps$ghost === undefined ? false : _filteredProps$ghost,
|
|
30916
|
+
_filteredProps$effect = filteredProps.effect,
|
|
30917
|
+
effect = _filteredProps$effect === undefined ? true : _filteredProps$effect,
|
|
30918
|
+
onClick = filteredProps.onClick,
|
|
30919
|
+
_filteredProps$auto = filteredProps.auto,
|
|
30920
|
+
auto = _filteredProps$auto === undefined ? false : _filteredProps$auto,
|
|
30921
|
+
icon = filteredProps.icon,
|
|
30922
|
+
_filteredProps$htmlTy = filteredProps.htmlType,
|
|
30923
|
+
htmlType = _filteredProps$htmlTy === undefined ? 'button' : _filteredProps$htmlTy,
|
|
30924
|
+
iconRight = filteredProps.iconRight,
|
|
30925
|
+
_filteredProps$classN = filteredProps.className,
|
|
30926
|
+
className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
|
|
30927
|
+
filteredProps.crossOrigin;
|
|
30928
|
+
var props = _objectWithoutProperties(filteredProps, _excluded$8);
|
|
30929
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
31137
30930
|
|
|
31138
|
-
|
|
31139
|
-
|
|
31140
|
-
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31144
|
-
|
|
31145
|
-
|
|
31146
|
-
};
|
|
31147
|
-
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
31155
|
-
columns: columns,
|
|
31156
|
-
onFilters: onFilters,
|
|
31157
|
-
showFilters: showFilters,
|
|
31158
|
-
width: width
|
|
31159
|
-
}), /*#__PURE__*/React.createElement(TableBody, {
|
|
31160
|
-
data: data,
|
|
31161
|
-
hover: hover,
|
|
31162
|
-
emptyText: emptyText,
|
|
31163
|
-
onRow: onRow,
|
|
31164
|
-
onCell: onCell,
|
|
31165
|
-
rowClassName: rowClassName,
|
|
31166
|
-
rowDraggable: rowDraggable,
|
|
31167
|
-
readOnly: readOnly,
|
|
31168
|
-
onSelected: onSelected
|
|
31169
|
-
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31170
|
-
id: "2132340556",
|
|
31171
|
-
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
31172
|
-
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")), dataLength && viewLength && onPageChange ? /*#__PURE__*/React.createElement("tfoot", {
|
|
31173
|
-
className: _JSXStyle.dynamic([["2132340556", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
31174
|
-
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
31175
|
-
onChange: function onChange(pageNumber) {
|
|
31176
|
-
// Get the range for the current page
|
|
31177
|
-
var _getDataRange = getDataRange(pageNumber, viewLength, dataLength),
|
|
31178
|
-
startIndex = _getDataRange.startIndex,
|
|
31179
|
-
endIndex = _getDataRange.endIndex;
|
|
31180
|
-
onPageChange(pageNumber, startIndex, endIndex);
|
|
31181
|
-
},
|
|
31182
|
-
limit: 5,
|
|
31183
|
-
count: Number(dataLength / viewLength)
|
|
31184
|
-
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight$1, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft$1, null)))) : null));
|
|
31185
|
-
}
|
|
31186
|
-
TableComponent.displayName = 'Table';
|
|
31187
|
-
TableComponent.Column = TableColumn;
|
|
31188
|
-
var Table = withScale(TableComponent);
|
|
31189
|
-
Table.Column = TableColumn;
|
|
30931
|
+
var _useMemo = React.useMemo(function () {
|
|
30932
|
+
return getButtonColors(theme.palette, filteredProps);
|
|
30933
|
+
}, [theme.palette, filteredProps]),
|
|
30934
|
+
bg = _useMemo.bg,
|
|
30935
|
+
border = _useMemo.border,
|
|
30936
|
+
color = _useMemo.color;
|
|
30937
|
+
var hover = React.useMemo(function () {
|
|
30938
|
+
return getButtonHoverColors(theme.palette, filteredProps);
|
|
30939
|
+
}, [theme.palette, filteredProps]);
|
|
30940
|
+
var _useMemo2 = React.useMemo(function () {
|
|
30941
|
+
return getButtonCursor(disabled, loading);
|
|
30942
|
+
}, [disabled, loading]),
|
|
30943
|
+
cursor = _useMemo2.cursor,
|
|
30944
|
+
events = _useMemo2.events;
|
|
30945
|
+
var dripColor = React.useMemo(function () {
|
|
30946
|
+
return getButtonDripColor(theme.palette, filteredProps);
|
|
30947
|
+
}, [theme.palette, filteredProps]);
|
|
31190
30948
|
|
|
31191
|
-
var ButtonDrip = function ButtonDrip(_ref) {
|
|
31192
|
-
var _ref$x = _ref.x,
|
|
31193
|
-
x = _ref$x === undefined ? 0 : _ref$x,
|
|
31194
|
-
_ref$y = _ref.y,
|
|
31195
|
-
y = _ref$y === undefined ? 0 : _ref$y,
|
|
31196
|
-
color = _ref.color,
|
|
31197
|
-
onCompleted = _ref.onCompleted;
|
|
31198
|
-
var dripRef = React.useRef(null);
|
|
31199
30949
|
/* istanbul ignore next */
|
|
31200
|
-
var
|
|
31201
|
-
|
|
31202
|
-
|
|
31203
|
-
|
|
30950
|
+
var dripCompletedHandle = function dripCompletedHandle() {
|
|
30951
|
+
setDripShow(false);
|
|
30952
|
+
setDripX(0);
|
|
30953
|
+
setDripY(0);
|
|
30954
|
+
};
|
|
30955
|
+
var clickHandler = function clickHandler(event) {
|
|
30956
|
+
if (disabled || loading) return;
|
|
30957
|
+
var showDrip = !shadow && !ghost && effect;
|
|
31204
30958
|
/* istanbul ignore next */
|
|
31205
|
-
if (
|
|
31206
|
-
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
|
|
31212
|
-
}
|
|
31213
|
-
|
|
31214
|
-
|
|
31215
|
-
|
|
31216
|
-
|
|
31217
|
-
|
|
31218
|
-
|
|
31219
|
-
|
|
31220
|
-
|
|
31221
|
-
|
|
31222
|
-
|
|
31223
|
-
|
|
31224
|
-
|
|
31225
|
-
|
|
31226
|
-
|
|
31227
|
-
|
|
31228
|
-
|
|
31229
|
-
|
|
31230
|
-
|
|
31231
|
-
|
|
31232
|
-
|
|
31233
|
-
|
|
31234
|
-
|
|
31235
|
-
|
|
31236
|
-
|
|
31237
|
-
|
|
31238
|
-
|
|
31239
|
-
|
|
31240
|
-
|
|
31241
|
-
|
|
31242
|
-
};
|
|
31243
|
-
ButtonDrip.displayName = 'ButtonDrip';
|
|
30959
|
+
if (showDrip && buttonRef.current) {
|
|
30960
|
+
var rect = buttonRef.current.getBoundingClientRect();
|
|
30961
|
+
setDripShow(true);
|
|
30962
|
+
setDripX(event.clientX - rect.left);
|
|
30963
|
+
setDripY(event.clientY - rect.top);
|
|
30964
|
+
}
|
|
30965
|
+
onClick && onClick(event);
|
|
30966
|
+
};
|
|
30967
|
+
var childrenWithIcon = React.useMemo(function () {
|
|
30968
|
+
return getButtonChildrenWithIcon(auto, children, {
|
|
30969
|
+
icon: icon,
|
|
30970
|
+
iconRight: iconRight
|
|
30971
|
+
});
|
|
30972
|
+
}, [auto, children, icon, iconRight]);
|
|
30973
|
+
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
30974
|
+
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
30975
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
30976
|
+
ref: buttonRef,
|
|
30977
|
+
type: htmlType,
|
|
30978
|
+
disabled: disabled,
|
|
30979
|
+
onClick: clickHandler
|
|
30980
|
+
}, props, {
|
|
30981
|
+
className: _JSXStyle.dynamic([["22324076", [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
|
|
30982
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
30983
|
+
color: color
|
|
30984
|
+
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
30985
|
+
x: dripX,
|
|
30986
|
+
y: dripY,
|
|
30987
|
+
color: dripColor,
|
|
30988
|
+
onCompleted: dripCompletedHandle
|
|
30989
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30990
|
+
id: "22324076",
|
|
30991
|
+
dynamic: [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
|
|
30992
|
+
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(theme.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}")));
|
|
30993
|
+
});
|
|
30994
|
+
ButtonComponent.displayName = 'Button';
|
|
30995
|
+
var Button = withScale(ButtonComponent);
|
|
31244
30996
|
|
|
31245
|
-
var
|
|
31246
|
-
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
30997
|
+
var getColors = function getColors(type, palette) {
|
|
31247
30998
|
var colors = {
|
|
31248
|
-
"default": palette.
|
|
31249
|
-
secondary: palette.secondary,
|
|
30999
|
+
"default": palette.background,
|
|
31250
31000
|
success: palette.success,
|
|
31251
31001
|
warning: palette.warning,
|
|
31252
|
-
error: palette.error
|
|
31002
|
+
error: palette.error,
|
|
31003
|
+
secondary: palette.secondary,
|
|
31004
|
+
dark: palette.foreground,
|
|
31005
|
+
lite: palette.background
|
|
31006
|
+
};
|
|
31007
|
+
var color = type === 'lite' || type === 'default' ? palette.foreground : palette.background;
|
|
31008
|
+
return {
|
|
31009
|
+
color: color,
|
|
31010
|
+
bgColor: colors[type]
|
|
31253
31011
|
};
|
|
31254
|
-
return color ? color : colors[type];
|
|
31255
|
-
};
|
|
31256
|
-
var LoadingComponent = function LoadingComponent(_ref) {
|
|
31257
|
-
var children = _ref.children,
|
|
31258
|
-
_ref$type = _ref.type,
|
|
31259
|
-
type = _ref$type === undefined ? 'default' : _ref$type,
|
|
31260
|
-
color = _ref.color,
|
|
31261
|
-
_ref$className = _ref.className,
|
|
31262
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
31263
|
-
_ref$spaceRatio = _ref.spaceRatio,
|
|
31264
|
-
spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
|
|
31265
|
-
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
31266
|
-
var theme = useTheme();
|
|
31267
|
-
var _useScale = useScale(),
|
|
31268
|
-
SCALES = _useScale.SCALES;
|
|
31269
|
-
var classes = useClasses('loading-container', className);
|
|
31270
|
-
var bgColor = React.useMemo(function () {
|
|
31271
|
-
return getIconBgColor(type, theme.palette, color);
|
|
31272
|
-
}, [type, theme.palette, color]);
|
|
31273
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
31274
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
31275
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
31276
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
|
|
31277
|
-
}, children && /*#__PURE__*/React.createElement("label", {
|
|
31278
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
31279
|
-
}, children), /*#__PURE__*/React.createElement("i", {
|
|
31280
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
31281
|
-
}), /*#__PURE__*/React.createElement("i", {
|
|
31282
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
31283
|
-
}), /*#__PURE__*/React.createElement("i", {
|
|
31284
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
|
|
31285
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31286
|
-
id: "2201634259",
|
|
31287
|
-
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]
|
|
31288
|
-
}, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
|
|
31289
|
-
};
|
|
31290
|
-
LoadingComponent.displayName = 'Loading';
|
|
31291
|
-
var Loading = withScale(LoadingComponent);
|
|
31292
|
-
|
|
31293
|
-
var ButtonLoading = function ButtonLoading(_ref) {
|
|
31294
|
-
var color = _ref.color;
|
|
31295
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31296
|
-
className: "jsx-212623367" + " " + "btn-loading"
|
|
31297
|
-
}, /*#__PURE__*/React.createElement(Loading, {
|
|
31298
|
-
color: color
|
|
31299
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31300
|
-
id: "212623367"
|
|
31301
|
-
}, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
|
|
31302
31012
|
};
|
|
31303
|
-
ButtonLoading.displayName = 'GeistButtonLoading';
|
|
31304
31013
|
|
|
31305
|
-
var
|
|
31306
|
-
|
|
31307
|
-
|
|
31308
|
-
|
|
31309
|
-
isSingle = _ref.isSingle,
|
|
31310
|
-
children = _ref.children,
|
|
31311
|
-
_ref$className = _ref.className,
|
|
31312
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
31313
|
-
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
31314
|
-
var classes = useClasses('icon', {
|
|
31315
|
-
right: isRight,
|
|
31316
|
-
single: isSingle
|
|
31317
|
-
}, className);
|
|
31318
|
-
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
31319
|
-
className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
|
|
31320
|
-
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31321
|
-
id: "2467502931"
|
|
31322
|
-
}, ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"));
|
|
31014
|
+
var defaultTooltipPosition = {
|
|
31015
|
+
top: '-1000px',
|
|
31016
|
+
left: '-1000px',
|
|
31017
|
+
transform: 'none'
|
|
31323
31018
|
};
|
|
31324
|
-
|
|
31325
|
-
|
|
31326
|
-
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31330
|
-
var isRight = Boolean(iconRight);
|
|
31331
|
-
var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
|
|
31332
|
-
var classes = useClasses('text', isRight ? 'right' : 'left');
|
|
31333
|
-
if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
|
|
31334
|
-
className: "text"
|
|
31335
|
-
}, children);
|
|
31336
|
-
if (React.Children.count(children) === 0) {
|
|
31337
|
-
return /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
31338
|
-
isRight: isRight,
|
|
31339
|
-
isSingle: true
|
|
31340
|
-
}, hasIcon);
|
|
31341
|
-
}
|
|
31342
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
31343
|
-
isRight: isRight
|
|
31344
|
-
}, hasIcon), /*#__PURE__*/React.createElement("div", {
|
|
31345
|
-
className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
|
|
31346
|
-
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31347
|
-
id: "3568181479",
|
|
31348
|
-
dynamic: [paddingForAutoMode, paddingForAutoMode]
|
|
31349
|
-
}, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
|
|
31350
|
-
};
|
|
31351
|
-
var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
|
|
31352
|
-
if (!config.isButtonGroup) return props;
|
|
31353
|
-
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
31354
|
-
auto: true,
|
|
31355
|
-
shadow: false,
|
|
31356
|
-
ghost: config.ghost || props.ghost,
|
|
31357
|
-
type: config.type || props.type,
|
|
31358
|
-
disabled: config.disabled || props.disabled
|
|
31359
|
-
});
|
|
31360
|
-
};
|
|
31361
|
-
|
|
31362
|
-
/* "use client" */
|
|
31363
|
-
|
|
31364
|
-
var defaultContext$1 = {
|
|
31365
|
-
isButtonGroup: false,
|
|
31366
|
-
disabled: false
|
|
31367
|
-
};
|
|
31368
|
-
var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$1);
|
|
31369
|
-
var useButtonGroupContext = function useButtonGroupContext() {
|
|
31370
|
-
return React.useContext(ButtonGroupContext);
|
|
31371
|
-
};
|
|
31372
|
-
|
|
31373
|
-
var getButtonGhostColors = function getButtonGhostColors(palette, type) {
|
|
31374
|
-
var colors = {
|
|
31375
|
-
secondary: {
|
|
31376
|
-
bg: palette.background,
|
|
31377
|
-
border: palette.foreground,
|
|
31378
|
-
color: palette.foreground
|
|
31019
|
+
var getPosition = function getPosition(placement, rect, offset) {
|
|
31020
|
+
var positions = {
|
|
31021
|
+
top: {
|
|
31022
|
+
top: "".concat(rect.top - offset, "px"),
|
|
31023
|
+
left: "".concat(rect.left + rect.width / 2, "px"),
|
|
31024
|
+
transform: 'translate(-50%, -100%)'
|
|
31379
31025
|
},
|
|
31380
|
-
|
|
31381
|
-
|
|
31382
|
-
|
|
31383
|
-
|
|
31026
|
+
topStart: {
|
|
31027
|
+
top: "".concat(rect.top - offset, "px"),
|
|
31028
|
+
left: "".concat(rect.left, "px"),
|
|
31029
|
+
transform: 'translate(0, -100%)'
|
|
31384
31030
|
},
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
|
|
31388
|
-
|
|
31031
|
+
topEnd: {
|
|
31032
|
+
top: "".concat(rect.top - offset, "px"),
|
|
31033
|
+
left: "".concat(rect.left + rect.width, "px"),
|
|
31034
|
+
transform: 'translate(-100%, -100%)'
|
|
31389
31035
|
},
|
|
31390
|
-
|
|
31391
|
-
|
|
31392
|
-
|
|
31393
|
-
|
|
31394
|
-
}
|
|
31395
|
-
};
|
|
31396
|
-
return colors[type] || null;
|
|
31397
|
-
};
|
|
31398
|
-
var getButtonColors = function getButtonColors(palette, props) {
|
|
31399
|
-
var type = props.type,
|
|
31400
|
-
disabled = props.disabled,
|
|
31401
|
-
ghost = props.ghost;
|
|
31402
|
-
var colors = {
|
|
31403
|
-
"default": {
|
|
31404
|
-
bg: palette.background,
|
|
31405
|
-
border: palette.border,
|
|
31406
|
-
color: palette.accents_5
|
|
31036
|
+
bottom: {
|
|
31037
|
+
top: "".concat(rect.bottom + offset, "px"),
|
|
31038
|
+
left: "".concat(rect.left + rect.width / 2, "px"),
|
|
31039
|
+
transform: 'translate(-50%, 0)'
|
|
31407
31040
|
},
|
|
31408
|
-
|
|
31409
|
-
|
|
31410
|
-
|
|
31411
|
-
|
|
31041
|
+
bottomStart: {
|
|
31042
|
+
top: "".concat(rect.bottom + offset, "px"),
|
|
31043
|
+
left: "".concat(rect.left, "px"),
|
|
31044
|
+
transform: 'translate(0, 0)'
|
|
31412
31045
|
},
|
|
31413
|
-
|
|
31414
|
-
|
|
31415
|
-
|
|
31416
|
-
|
|
31046
|
+
bottomEnd: {
|
|
31047
|
+
top: "".concat(rect.bottom + offset, "px"),
|
|
31048
|
+
left: "".concat(rect.left + rect.width, "px"),
|
|
31049
|
+
transform: 'translate(-100%, 0)'
|
|
31417
31050
|
},
|
|
31418
|
-
|
|
31419
|
-
|
|
31420
|
-
|
|
31421
|
-
|
|
31051
|
+
left: {
|
|
31052
|
+
top: "".concat(rect.top + rect.height / 2, "px"),
|
|
31053
|
+
left: "".concat(rect.left - offset, "px"),
|
|
31054
|
+
transform: 'translate(-100%, -50%)'
|
|
31422
31055
|
},
|
|
31423
|
-
|
|
31424
|
-
|
|
31425
|
-
|
|
31426
|
-
|
|
31056
|
+
leftStart: {
|
|
31057
|
+
top: "".concat(rect.top, "px"),
|
|
31058
|
+
left: "".concat(rect.left - offset, "px"),
|
|
31059
|
+
transform: 'translate(-100%, 0)'
|
|
31427
31060
|
},
|
|
31428
|
-
|
|
31429
|
-
|
|
31430
|
-
|
|
31431
|
-
|
|
31432
|
-
}
|
|
31433
|
-
};
|
|
31434
|
-
if (disabled) return {
|
|
31435
|
-
bg: palette.accents_1,
|
|
31436
|
-
border: palette.accents_2,
|
|
31437
|
-
color: '#ccc'
|
|
31438
|
-
};
|
|
31439
|
-
|
|
31440
|
-
/**
|
|
31441
|
-
* The '-light' type is the same color as the common type,
|
|
31442
|
-
* only hover's color is different.
|
|
31443
|
-
* e.g.
|
|
31444
|
-
* Color['success'] === Color['success-light']
|
|
31445
|
-
* Color['warning'] === Color['warning-light']
|
|
31446
|
-
*/
|
|
31447
|
-
var withoutLightType = type === null || type === undefined ? undefined : type.replace('-light', '');
|
|
31448
|
-
var defaultColor = colors["default"];
|
|
31449
|
-
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
31450
|
-
return colors[withoutLightType] || defaultColor;
|
|
31451
|
-
};
|
|
31452
|
-
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type) {
|
|
31453
|
-
var colors = {
|
|
31454
|
-
secondary: {
|
|
31455
|
-
bg: palette.foreground,
|
|
31456
|
-
border: palette.background,
|
|
31457
|
-
color: palette.background
|
|
31061
|
+
leftEnd: {
|
|
31062
|
+
top: "".concat(rect.top + rect.height, "px"),
|
|
31063
|
+
left: "".concat(rect.left - offset, "px"),
|
|
31064
|
+
transform: 'translate(-100%, -100%)'
|
|
31458
31065
|
},
|
|
31459
|
-
|
|
31460
|
-
|
|
31461
|
-
|
|
31462
|
-
|
|
31066
|
+
right: {
|
|
31067
|
+
top: "".concat(rect.top + rect.height / 2, "px"),
|
|
31068
|
+
left: "".concat(rect.right + offset, "px"),
|
|
31069
|
+
transform: 'translate(0, -50%)'
|
|
31463
31070
|
},
|
|
31464
|
-
|
|
31465
|
-
|
|
31466
|
-
|
|
31467
|
-
|
|
31071
|
+
rightStart: {
|
|
31072
|
+
top: "".concat(rect.top, "px"),
|
|
31073
|
+
left: "".concat(rect.right + offset, "px"),
|
|
31074
|
+
transform: 'translate(0, 0)'
|
|
31468
31075
|
},
|
|
31469
|
-
|
|
31470
|
-
|
|
31471
|
-
|
|
31472
|
-
|
|
31076
|
+
rightEnd: {
|
|
31077
|
+
top: "".concat(rect.top + rect.height, "px"),
|
|
31078
|
+
left: "".concat(rect.right + offset, "px"),
|
|
31079
|
+
transform: 'translate(0, -100%)'
|
|
31473
31080
|
}
|
|
31474
31081
|
};
|
|
31475
|
-
|
|
31476
|
-
return colors[withoutLightType] || null;
|
|
31082
|
+
return positions[placement] || positions.top;
|
|
31477
31083
|
};
|
|
31478
|
-
var
|
|
31479
|
-
var
|
|
31480
|
-
|
|
31481
|
-
|
|
31482
|
-
|
|
31483
|
-
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31487
|
-
"default": {
|
|
31488
|
-
bg: palette.background,
|
|
31489
|
-
border: palette.foreground
|
|
31084
|
+
var getIconPosition = function getIconPosition(placement, offsetX, offsetY) {
|
|
31085
|
+
var offsetAbsolute = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '3px';
|
|
31086
|
+
var positions = {
|
|
31087
|
+
top: {
|
|
31088
|
+
top: 'auto',
|
|
31089
|
+
right: 'auto',
|
|
31090
|
+
left: '50%',
|
|
31091
|
+
bottom: "".concat(offsetAbsolute),
|
|
31092
|
+
transform: 'translate(-50%, 100%) rotate(-90deg)'
|
|
31490
31093
|
},
|
|
31491
|
-
|
|
31492
|
-
|
|
31493
|
-
|
|
31094
|
+
topStart: {
|
|
31095
|
+
top: 'auto',
|
|
31096
|
+
right: 'auto',
|
|
31097
|
+
left: "".concat(offsetX),
|
|
31098
|
+
bottom: "".concat(offsetAbsolute),
|
|
31099
|
+
transform: 'translate(0, 100%) rotate(-90deg)'
|
|
31494
31100
|
},
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31101
|
+
topEnd: {
|
|
31102
|
+
top: 'auto',
|
|
31103
|
+
right: "".concat(offsetX),
|
|
31104
|
+
left: 'auto',
|
|
31105
|
+
bottom: "".concat(offsetAbsolute),
|
|
31106
|
+
transform: 'translate(0, 100%) rotate(-90deg)'
|
|
31498
31107
|
},
|
|
31499
|
-
|
|
31500
|
-
|
|
31501
|
-
|
|
31108
|
+
bottom: {
|
|
31109
|
+
top: "".concat(offsetAbsolute),
|
|
31110
|
+
right: 'auto',
|
|
31111
|
+
left: '50%',
|
|
31112
|
+
bottom: 'auto',
|
|
31113
|
+
transform: 'translate(-50%, -100%) rotate(90deg)'
|
|
31502
31114
|
},
|
|
31503
|
-
|
|
31504
|
-
|
|
31505
|
-
|
|
31115
|
+
bottomStart: {
|
|
31116
|
+
top: "".concat(offsetAbsolute),
|
|
31117
|
+
right: 'auto',
|
|
31118
|
+
left: "".concat(offsetX),
|
|
31119
|
+
bottom: 'auto',
|
|
31120
|
+
transform: 'translate(0, -100%) rotate(90deg)'
|
|
31506
31121
|
},
|
|
31507
|
-
|
|
31508
|
-
|
|
31509
|
-
|
|
31510
|
-
|
|
31511
|
-
|
|
31512
|
-
|
|
31513
|
-
bg: alphaBackground
|
|
31514
|
-
}),
|
|
31515
|
-
'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
31516
|
-
bg: alphaBackground
|
|
31517
|
-
}),
|
|
31518
|
-
'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
31519
|
-
bg: alphaBackground
|
|
31520
|
-
}),
|
|
31521
|
-
'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
31522
|
-
bg: alphaBackground
|
|
31523
|
-
})
|
|
31524
|
-
};
|
|
31525
|
-
if (disabled) return {
|
|
31526
|
-
bg: palette.accents_1,
|
|
31527
|
-
border: palette.accents_2,
|
|
31528
|
-
color: '#ccc'
|
|
31529
|
-
};
|
|
31530
|
-
if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
31531
|
-
color: 'transparent'
|
|
31532
|
-
});
|
|
31533
|
-
if (shadow) return defaultColor;
|
|
31534
|
-
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, type) : colors[type]) || colors["default"];
|
|
31535
|
-
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
31536
|
-
color: hoverColor.color || hoverColor.border
|
|
31537
|
-
});
|
|
31538
|
-
};
|
|
31539
|
-
var getButtonCursor = function getButtonCursor(disabled, loading) {
|
|
31540
|
-
if (disabled) return {
|
|
31541
|
-
cursor: 'not-allowed',
|
|
31542
|
-
events: 'auto'
|
|
31543
|
-
};
|
|
31544
|
-
if (loading) return {
|
|
31545
|
-
cursor: 'default',
|
|
31546
|
-
events: 'none'
|
|
31547
|
-
};
|
|
31548
|
-
return {
|
|
31549
|
-
cursor: 'pointer',
|
|
31550
|
-
events: 'auto'
|
|
31551
|
-
};
|
|
31552
|
-
};
|
|
31553
|
-
var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
31554
|
-
var type = props.type;
|
|
31555
|
-
var isLightHover = type ? type.endsWith('light') : false;
|
|
31556
|
-
var hoverColors = getButtonHoverColors(palette, props);
|
|
31557
|
-
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
31558
|
-
};
|
|
31559
|
-
|
|
31560
|
-
var _excluded$3 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
|
|
31561
|
-
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
31562
|
-
var theme = useTheme();
|
|
31563
|
-
var _useScale = useScale(),
|
|
31564
|
-
SCALES = _useScale.SCALES;
|
|
31565
|
-
var buttonRef = React.useRef(null);
|
|
31566
|
-
React.useImperativeHandle(ref, function () {
|
|
31567
|
-
return buttonRef.current;
|
|
31568
|
-
});
|
|
31569
|
-
var _useState = React.useState(false),
|
|
31570
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31571
|
-
dripShow = _useState2[0],
|
|
31572
|
-
setDripShow = _useState2[1];
|
|
31573
|
-
var _useState3 = React.useState(0),
|
|
31574
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
31575
|
-
dripX = _useState4[0],
|
|
31576
|
-
setDripX = _useState4[1];
|
|
31577
|
-
var _useState5 = React.useState(0),
|
|
31578
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
31579
|
-
dripY = _useState6[0],
|
|
31580
|
-
setDripY = _useState6[1];
|
|
31581
|
-
var groupConfig = useButtonGroupContext();
|
|
31582
|
-
var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
|
|
31583
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
31584
|
-
var children = filteredProps.children,
|
|
31585
|
-
_filteredProps$disabl = filteredProps.disabled,
|
|
31586
|
-
disabled = _filteredProps$disabl === undefined ? false : _filteredProps$disabl;
|
|
31587
|
-
filteredProps.type;
|
|
31588
|
-
var _filteredProps$loadin = filteredProps.loading,
|
|
31589
|
-
loading = _filteredProps$loadin === undefined ? false : _filteredProps$loadin,
|
|
31590
|
-
_filteredProps$shadow = filteredProps.shadow,
|
|
31591
|
-
shadow = _filteredProps$shadow === undefined ? false : _filteredProps$shadow,
|
|
31592
|
-
_filteredProps$ghost = filteredProps.ghost,
|
|
31593
|
-
ghost = _filteredProps$ghost === undefined ? false : _filteredProps$ghost,
|
|
31594
|
-
_filteredProps$effect = filteredProps.effect,
|
|
31595
|
-
effect = _filteredProps$effect === undefined ? true : _filteredProps$effect,
|
|
31596
|
-
onClick = filteredProps.onClick,
|
|
31597
|
-
_filteredProps$auto = filteredProps.auto,
|
|
31598
|
-
auto = _filteredProps$auto === undefined ? false : _filteredProps$auto,
|
|
31599
|
-
icon = filteredProps.icon,
|
|
31600
|
-
_filteredProps$htmlTy = filteredProps.htmlType,
|
|
31601
|
-
htmlType = _filteredProps$htmlTy === undefined ? 'button' : _filteredProps$htmlTy,
|
|
31602
|
-
iconRight = filteredProps.iconRight,
|
|
31603
|
-
_filteredProps$classN = filteredProps.className,
|
|
31604
|
-
className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
|
|
31605
|
-
filteredProps.crossOrigin;
|
|
31606
|
-
var props = _objectWithoutProperties(filteredProps, _excluded$3);
|
|
31607
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
31608
|
-
|
|
31609
|
-
var _useMemo = React.useMemo(function () {
|
|
31610
|
-
return getButtonColors(theme.palette, filteredProps);
|
|
31611
|
-
}, [theme.palette, filteredProps]),
|
|
31612
|
-
bg = _useMemo.bg,
|
|
31613
|
-
border = _useMemo.border,
|
|
31614
|
-
color = _useMemo.color;
|
|
31615
|
-
var hover = React.useMemo(function () {
|
|
31616
|
-
return getButtonHoverColors(theme.palette, filteredProps);
|
|
31617
|
-
}, [theme.palette, filteredProps]);
|
|
31618
|
-
var _useMemo2 = React.useMemo(function () {
|
|
31619
|
-
return getButtonCursor(disabled, loading);
|
|
31620
|
-
}, [disabled, loading]),
|
|
31621
|
-
cursor = _useMemo2.cursor,
|
|
31622
|
-
events = _useMemo2.events;
|
|
31623
|
-
var dripColor = React.useMemo(function () {
|
|
31624
|
-
return getButtonDripColor(theme.palette, filteredProps);
|
|
31625
|
-
}, [theme.palette, filteredProps]);
|
|
31626
|
-
|
|
31627
|
-
/* istanbul ignore next */
|
|
31628
|
-
var dripCompletedHandle = function dripCompletedHandle() {
|
|
31629
|
-
setDripShow(false);
|
|
31630
|
-
setDripX(0);
|
|
31631
|
-
setDripY(0);
|
|
31632
|
-
};
|
|
31633
|
-
var clickHandler = function clickHandler(event) {
|
|
31634
|
-
if (disabled || loading) return;
|
|
31635
|
-
var showDrip = !shadow && !ghost && effect;
|
|
31636
|
-
/* istanbul ignore next */
|
|
31637
|
-
if (showDrip && buttonRef.current) {
|
|
31638
|
-
var rect = buttonRef.current.getBoundingClientRect();
|
|
31639
|
-
setDripShow(true);
|
|
31640
|
-
setDripX(event.clientX - rect.left);
|
|
31641
|
-
setDripY(event.clientY - rect.top);
|
|
31642
|
-
}
|
|
31643
|
-
onClick && onClick(event);
|
|
31644
|
-
};
|
|
31645
|
-
var childrenWithIcon = React.useMemo(function () {
|
|
31646
|
-
return getButtonChildrenWithIcon(auto, children, {
|
|
31647
|
-
icon: icon,
|
|
31648
|
-
iconRight: iconRight
|
|
31649
|
-
});
|
|
31650
|
-
}, [auto, children, icon, iconRight]);
|
|
31651
|
-
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
31652
|
-
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
31653
|
-
return /*#__PURE__*/React.createElement("button", _extends({
|
|
31654
|
-
ref: buttonRef,
|
|
31655
|
-
type: htmlType,
|
|
31656
|
-
disabled: disabled,
|
|
31657
|
-
onClick: clickHandler
|
|
31658
|
-
}, props, {
|
|
31659
|
-
className: _JSXStyle.dynamic([["22324076", [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
|
|
31660
|
-
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
31661
|
-
color: color
|
|
31662
|
-
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
31663
|
-
x: dripX,
|
|
31664
|
-
y: dripY,
|
|
31665
|
-
color: dripColor,
|
|
31666
|
-
onCompleted: dripCompletedHandle
|
|
31667
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31668
|
-
id: "22324076",
|
|
31669
|
-
dynamic: [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
|
|
31670
|
-
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(theme.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}")));
|
|
31671
|
-
});
|
|
31672
|
-
ButtonComponent.displayName = 'Button';
|
|
31673
|
-
var Button = withScale(ButtonComponent);
|
|
31674
|
-
|
|
31675
|
-
var getColors = function getColors(type, palette) {
|
|
31676
|
-
var colors = {
|
|
31677
|
-
"default": palette.background,
|
|
31678
|
-
success: palette.success,
|
|
31679
|
-
warning: palette.warning,
|
|
31680
|
-
error: palette.error,
|
|
31681
|
-
secondary: palette.secondary,
|
|
31682
|
-
dark: palette.foreground,
|
|
31683
|
-
lite: palette.background
|
|
31684
|
-
};
|
|
31685
|
-
var color = type === 'lite' || type === 'default' ? palette.foreground : palette.background;
|
|
31686
|
-
return {
|
|
31687
|
-
color: color,
|
|
31688
|
-
bgColor: colors[type]
|
|
31689
|
-
};
|
|
31690
|
-
};
|
|
31691
|
-
|
|
31692
|
-
var defaultTooltipPosition = {
|
|
31693
|
-
top: '-1000px',
|
|
31694
|
-
left: '-1000px',
|
|
31695
|
-
transform: 'none'
|
|
31696
|
-
};
|
|
31697
|
-
var getPosition = function getPosition(placement, rect, offset) {
|
|
31698
|
-
var positions = {
|
|
31699
|
-
top: {
|
|
31700
|
-
top: "".concat(rect.top - offset, "px"),
|
|
31701
|
-
left: "".concat(rect.left + rect.width / 2, "px"),
|
|
31702
|
-
transform: 'translate(-50%, -100%)'
|
|
31703
|
-
},
|
|
31704
|
-
topStart: {
|
|
31705
|
-
top: "".concat(rect.top - offset, "px"),
|
|
31706
|
-
left: "".concat(rect.left, "px"),
|
|
31707
|
-
transform: 'translate(0, -100%)'
|
|
31708
|
-
},
|
|
31709
|
-
topEnd: {
|
|
31710
|
-
top: "".concat(rect.top - offset, "px"),
|
|
31711
|
-
left: "".concat(rect.left + rect.width, "px"),
|
|
31712
|
-
transform: 'translate(-100%, -100%)'
|
|
31713
|
-
},
|
|
31714
|
-
bottom: {
|
|
31715
|
-
top: "".concat(rect.bottom + offset, "px"),
|
|
31716
|
-
left: "".concat(rect.left + rect.width / 2, "px"),
|
|
31717
|
-
transform: 'translate(-50%, 0)'
|
|
31718
|
-
},
|
|
31719
|
-
bottomStart: {
|
|
31720
|
-
top: "".concat(rect.bottom + offset, "px"),
|
|
31721
|
-
left: "".concat(rect.left, "px"),
|
|
31722
|
-
transform: 'translate(0, 0)'
|
|
31723
|
-
},
|
|
31724
|
-
bottomEnd: {
|
|
31725
|
-
top: "".concat(rect.bottom + offset, "px"),
|
|
31726
|
-
left: "".concat(rect.left + rect.width, "px"),
|
|
31727
|
-
transform: 'translate(-100%, 0)'
|
|
31122
|
+
bottomEnd: {
|
|
31123
|
+
top: "".concat(offsetAbsolute),
|
|
31124
|
+
right: "".concat(offsetX),
|
|
31125
|
+
left: 'auto',
|
|
31126
|
+
bottom: 'auto',
|
|
31127
|
+
transform: 'translate(0, -100%) rotate(90deg)'
|
|
31728
31128
|
},
|
|
31729
31129
|
left: {
|
|
31730
|
-
top:
|
|
31731
|
-
|
|
31732
|
-
|
|
31130
|
+
top: '50%',
|
|
31131
|
+
right: '0',
|
|
31132
|
+
left: 'auto',
|
|
31133
|
+
bottom: 'auto',
|
|
31134
|
+
transform: 'translate(100%, -50%) rotate(180deg)'
|
|
31733
31135
|
},
|
|
31734
31136
|
leftStart: {
|
|
31735
|
-
top: "".concat(
|
|
31736
|
-
|
|
31737
|
-
|
|
31137
|
+
top: "".concat(offsetY),
|
|
31138
|
+
right: '0',
|
|
31139
|
+
left: 'auto',
|
|
31140
|
+
bottom: 'auto',
|
|
31141
|
+
transform: 'translate(100%, -50%) rotate(180deg)'
|
|
31738
31142
|
},
|
|
31739
31143
|
leftEnd: {
|
|
31740
|
-
top:
|
|
31741
|
-
|
|
31742
|
-
|
|
31144
|
+
top: 'auto',
|
|
31145
|
+
right: '0',
|
|
31146
|
+
left: 'auto',
|
|
31147
|
+
bottom: "".concat(offsetY),
|
|
31148
|
+
transform: 'translate(100%, 50%) rotate(180deg)'
|
|
31743
31149
|
},
|
|
31744
31150
|
right: {
|
|
31745
|
-
top:
|
|
31746
|
-
|
|
31747
|
-
|
|
31151
|
+
top: '50%',
|
|
31152
|
+
right: 'auto',
|
|
31153
|
+
left: '0',
|
|
31154
|
+
bottom: 'auto',
|
|
31155
|
+
transform: 'translate(-100%, -50%) rotate(0deg)'
|
|
31748
31156
|
},
|
|
31749
31157
|
rightStart: {
|
|
31750
|
-
top: "".concat(
|
|
31751
|
-
|
|
31752
|
-
|
|
31753
|
-
|
|
31754
|
-
|
|
31755
|
-
top: "".concat(rect.top + rect.height, "px"),
|
|
31756
|
-
left: "".concat(rect.right + offset, "px"),
|
|
31757
|
-
transform: 'translate(0, -100%)'
|
|
31758
|
-
}
|
|
31759
|
-
};
|
|
31760
|
-
return positions[placement] || positions.top;
|
|
31761
|
-
};
|
|
31762
|
-
var getIconPosition = function getIconPosition(placement, offsetX, offsetY) {
|
|
31763
|
-
var offsetAbsolute = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '3px';
|
|
31764
|
-
var positions = {
|
|
31765
|
-
top: {
|
|
31766
|
-
top: 'auto',
|
|
31767
|
-
right: 'auto',
|
|
31768
|
-
left: '50%',
|
|
31769
|
-
bottom: "".concat(offsetAbsolute),
|
|
31770
|
-
transform: 'translate(-50%, 100%) rotate(-90deg)'
|
|
31771
|
-
},
|
|
31772
|
-
topStart: {
|
|
31773
|
-
top: 'auto',
|
|
31774
|
-
right: 'auto',
|
|
31775
|
-
left: "".concat(offsetX),
|
|
31776
|
-
bottom: "".concat(offsetAbsolute),
|
|
31777
|
-
transform: 'translate(0, 100%) rotate(-90deg)'
|
|
31778
|
-
},
|
|
31779
|
-
topEnd: {
|
|
31780
|
-
top: 'auto',
|
|
31781
|
-
right: "".concat(offsetX),
|
|
31782
|
-
left: 'auto',
|
|
31783
|
-
bottom: "".concat(offsetAbsolute),
|
|
31784
|
-
transform: 'translate(0, 100%) rotate(-90deg)'
|
|
31785
|
-
},
|
|
31786
|
-
bottom: {
|
|
31787
|
-
top: "".concat(offsetAbsolute),
|
|
31788
|
-
right: 'auto',
|
|
31789
|
-
left: '50%',
|
|
31790
|
-
bottom: 'auto',
|
|
31791
|
-
transform: 'translate(-50%, -100%) rotate(90deg)'
|
|
31792
|
-
},
|
|
31793
|
-
bottomStart: {
|
|
31794
|
-
top: "".concat(offsetAbsolute),
|
|
31795
|
-
right: 'auto',
|
|
31796
|
-
left: "".concat(offsetX),
|
|
31797
|
-
bottom: 'auto',
|
|
31798
|
-
transform: 'translate(0, -100%) rotate(90deg)'
|
|
31799
|
-
},
|
|
31800
|
-
bottomEnd: {
|
|
31801
|
-
top: "".concat(offsetAbsolute),
|
|
31802
|
-
right: "".concat(offsetX),
|
|
31803
|
-
left: 'auto',
|
|
31804
|
-
bottom: 'auto',
|
|
31805
|
-
transform: 'translate(0, -100%) rotate(90deg)'
|
|
31806
|
-
},
|
|
31807
|
-
left: {
|
|
31808
|
-
top: '50%',
|
|
31809
|
-
right: '0',
|
|
31810
|
-
left: 'auto',
|
|
31811
|
-
bottom: 'auto',
|
|
31812
|
-
transform: 'translate(100%, -50%) rotate(180deg)'
|
|
31813
|
-
},
|
|
31814
|
-
leftStart: {
|
|
31815
|
-
top: "".concat(offsetY),
|
|
31816
|
-
right: '0',
|
|
31817
|
-
left: 'auto',
|
|
31818
|
-
bottom: 'auto',
|
|
31819
|
-
transform: 'translate(100%, -50%) rotate(180deg)'
|
|
31820
|
-
},
|
|
31821
|
-
leftEnd: {
|
|
31822
|
-
top: 'auto',
|
|
31823
|
-
right: '0',
|
|
31824
|
-
left: 'auto',
|
|
31825
|
-
bottom: "".concat(offsetY),
|
|
31826
|
-
transform: 'translate(100%, 50%) rotate(180deg)'
|
|
31827
|
-
},
|
|
31828
|
-
right: {
|
|
31829
|
-
top: '50%',
|
|
31830
|
-
right: 'auto',
|
|
31831
|
-
left: '0',
|
|
31832
|
-
bottom: 'auto',
|
|
31833
|
-
transform: 'translate(-100%, -50%) rotate(0deg)'
|
|
31834
|
-
},
|
|
31835
|
-
rightStart: {
|
|
31836
|
-
top: "".concat(offsetY),
|
|
31837
|
-
right: 'auto',
|
|
31838
|
-
left: '0',
|
|
31839
|
-
bottom: 'auto',
|
|
31840
|
-
transform: 'translate(-100%, -50%) rotate(0deg)'
|
|
31158
|
+
top: "".concat(offsetY),
|
|
31159
|
+
right: 'auto',
|
|
31160
|
+
left: '0',
|
|
31161
|
+
bottom: 'auto',
|
|
31162
|
+
transform: 'translate(-100%, -50%) rotate(0deg)'
|
|
31841
31163
|
},
|
|
31842
31164
|
rightEnd: {
|
|
31843
31165
|
top: 'auto',
|
|
@@ -31973,7 +31295,7 @@ var useClickAway = function useClickAway(ref, handler) {
|
|
|
31973
31295
|
}, [ref]);
|
|
31974
31296
|
};
|
|
31975
31297
|
|
|
31976
|
-
var _excluded$
|
|
31298
|
+
var _excluded$7 = ["children", "initialVisible", "text", "offset", "placement", "portalClassName", "enterDelay", "leaveDelay", "trigger", "type", "className", "onVisibleChange", "hideArrow", "visible"];
|
|
31977
31299
|
var TooltipComponent = function TooltipComponent(_ref) {
|
|
31978
31300
|
var children = _ref.children,
|
|
31979
31301
|
_ref$initialVisible = _ref.initialVisible,
|
|
@@ -32000,7 +31322,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
|
|
|
32000
31322
|
_ref$hideArrow = _ref.hideArrow,
|
|
32001
31323
|
hideArrow = _ref$hideArrow === undefined ? false : _ref$hideArrow,
|
|
32002
31324
|
customVisible = _ref.visible,
|
|
32003
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
31325
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
32004
31326
|
var timer = React.useRef();
|
|
32005
31327
|
var ref = React.useRef(null);
|
|
32006
31328
|
var _useState = React.useState(initialVisible),
|
|
@@ -32083,16 +31405,16 @@ var Tooltip = withScale(TooltipComponent);
|
|
|
32083
31405
|
|
|
32084
31406
|
/* "use client" */
|
|
32085
31407
|
|
|
32086
|
-
var defaultContext = {
|
|
31408
|
+
var defaultContext$1 = {
|
|
32087
31409
|
disableItemsAutoClose: false,
|
|
32088
31410
|
onItemClick: function onItemClick() {}
|
|
32089
31411
|
};
|
|
32090
|
-
var PopoverContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
31412
|
+
var PopoverContext = /*#__PURE__*/React.createContext(defaultContext$1);
|
|
32091
31413
|
var usePopoverContext = function usePopoverContext() {
|
|
32092
31414
|
return React.useContext(PopoverContext);
|
|
32093
31415
|
};
|
|
32094
31416
|
|
|
32095
|
-
var _excluded$
|
|
31417
|
+
var _excluded$6 = ["child", "children", "enterDelay", "leaveDelay", "offset", "type", "trigger", "placement", "initialVisible", "portalClassName", "disableItemsAutoClose", "onVisibleChange", "visible"];
|
|
32096
31418
|
var PopoverComponent = function PopoverComponent(_ref) {
|
|
32097
31419
|
var child = _ref.child,
|
|
32098
31420
|
children = _ref.children,
|
|
@@ -32117,7 +31439,7 @@ var PopoverComponent = function PopoverComponent(_ref) {
|
|
|
32117
31439
|
_ref$onVisibleChange = _ref.onVisibleChange,
|
|
32118
31440
|
onVisibleChange = _ref$onVisibleChange === undefined ? function () {} : _ref$onVisibleChange,
|
|
32119
31441
|
customVisible = _ref.visible,
|
|
32120
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
31442
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
32121
31443
|
var _useScale = useScale(),
|
|
32122
31444
|
SCALES = _useScale.SCALES;
|
|
32123
31445
|
var _useState = React.useState(initialVisible),
|
|
@@ -32166,7 +31488,7 @@ var PopoverComponent = function PopoverComponent(_ref) {
|
|
|
32166
31488
|
PopoverComponent.displayName = 'Popover';
|
|
32167
31489
|
var Popover = withScale(PopoverComponent);
|
|
32168
31490
|
|
|
32169
|
-
var _excluded = ["children", "line", "showTitle", "className", "onClick", "disableAutoClose"];
|
|
31491
|
+
var _excluded$5 = ["children", "line", "showTitle", "className", "onClick", "selected", "disableAutoClose"];
|
|
32170
31492
|
var PopoverItemComponent = function PopoverItemComponent(_ref) {
|
|
32171
31493
|
var children = _ref.children,
|
|
32172
31494
|
_ref$line = _ref.line,
|
|
@@ -32176,9 +31498,11 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
|
|
|
32176
31498
|
_ref$className = _ref.className,
|
|
32177
31499
|
className = _ref$className === undefined ? '' : _ref$className,
|
|
32178
31500
|
onClick = _ref.onClick,
|
|
31501
|
+
_ref$selected = _ref.selected,
|
|
31502
|
+
selected = _ref$selected === undefined ? false : _ref$selected,
|
|
32179
31503
|
_ref$disableAutoClose = _ref.disableAutoClose,
|
|
32180
31504
|
disableAutoClose = _ref$disableAutoClose === undefined ? false : _ref$disableAutoClose,
|
|
32181
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
31505
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
32182
31506
|
var theme = useTheme();
|
|
32183
31507
|
var _useScale = useScale(),
|
|
32184
31508
|
SCALES = _useScale.SCALES;
|
|
@@ -32199,6 +31523,9 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
|
|
|
32199
31523
|
onItemClick(event);
|
|
32200
31524
|
};
|
|
32201
31525
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
31526
|
+
style: {
|
|
31527
|
+
backgroundColor: selected ? '#efefef' : ''
|
|
31528
|
+
},
|
|
32202
31529
|
onClick: clickHandler
|
|
32203
31530
|
}, props, {
|
|
32204
31531
|
className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
@@ -32291,11 +31618,11 @@ function DataTable(_ref) {
|
|
|
32291
31618
|
React.useEffect(function () {
|
|
32292
31619
|
cols.forEach(function (col) {
|
|
32293
31620
|
if (hideColumn.includes(col.name)) {
|
|
32294
|
-
document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
|
|
32295
|
-
el.style.display = 'none';
|
|
31621
|
+
document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
|
|
31622
|
+
el.style.display = 'none !important';
|
|
32296
31623
|
});
|
|
32297
31624
|
} else {
|
|
32298
|
-
document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
|
|
31625
|
+
document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
|
|
32299
31626
|
el.style.display = '';
|
|
32300
31627
|
});
|
|
32301
31628
|
}
|
|
@@ -32356,10 +31683,10 @@ function DataTable(_ref) {
|
|
|
32356
31683
|
var content = function content() {
|
|
32357
31684
|
return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
|
|
32358
31685
|
var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
|
|
31686
|
+
var isSelected = !hideColumn.includes(option.name);
|
|
32359
31687
|
return /*#__PURE__*/React.createElement(Popover.Item, {
|
|
32360
|
-
|
|
32361
|
-
|
|
32362
|
-
,
|
|
31688
|
+
selected: isSelected,
|
|
31689
|
+
key: colunqid,
|
|
32363
31690
|
onClick: function onClick(e) {
|
|
32364
31691
|
return handleHideColumnClick(e, option.name);
|
|
32365
31692
|
}
|
|
@@ -32367,6 +31694,7 @@ function DataTable(_ref) {
|
|
|
32367
31694
|
}));
|
|
32368
31695
|
};
|
|
32369
31696
|
return /*#__PURE__*/React.createElement(GridContainer, {
|
|
31697
|
+
className: "helpdice-ui-table-container",
|
|
32370
31698
|
direction: "column"
|
|
32371
31699
|
}, /*#__PURE__*/React.createElement(Grid.Container, {
|
|
32372
31700
|
style: {
|
|
@@ -32538,7 +31866,700 @@ function DataTable(_ref) {
|
|
|
32538
31866
|
});
|
|
32539
31867
|
})))));
|
|
32540
31868
|
}
|
|
32541
|
-
var
|
|
31869
|
+
var DataTable$1 = /*#__PURE__*/React.memo(DataTable);
|
|
31870
|
+
|
|
31871
|
+
var TableBody = function TableBody(_ref) {
|
|
31872
|
+
var data = _ref.data,
|
|
31873
|
+
emptyText = _ref.emptyText,
|
|
31874
|
+
onRow = _ref.onRow,
|
|
31875
|
+
onCell = _ref.onCell,
|
|
31876
|
+
rowClassName = _ref.rowClassName,
|
|
31877
|
+
_ref$rowDraggable = _ref.rowDraggable,
|
|
31878
|
+
rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
|
|
31879
|
+
_ref$readOnly = _ref.readOnly,
|
|
31880
|
+
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
31881
|
+
onSelected = _ref.onSelected;
|
|
31882
|
+
var theme = useTheme();
|
|
31883
|
+
var _useState = React.useState([]),
|
|
31884
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31885
|
+
selected = _useState2[0],
|
|
31886
|
+
setSelected = _useState2[1];
|
|
31887
|
+
var _useTableContext = useTableContext(),
|
|
31888
|
+
columns = _useTableContext.columns;
|
|
31889
|
+
// const rowClickHandler = (row: TableDataItem, index: number) => {
|
|
31890
|
+
// onRow && onRow(row, index)
|
|
31891
|
+
// }
|
|
31892
|
+
|
|
31893
|
+
var handleClick = function handleClick(_event, id) {
|
|
31894
|
+
if (readOnly) {
|
|
31895
|
+
return true;
|
|
31896
|
+
}
|
|
31897
|
+
var selectedIndex = selected.indexOf(id);
|
|
31898
|
+
var newSelected = [];
|
|
31899
|
+
if (selectedIndex === -1) {
|
|
31900
|
+
newSelected = newSelected.concat(selected, id);
|
|
31901
|
+
} else if (selectedIndex === 0) {
|
|
31902
|
+
newSelected = newSelected.concat(selected.slice(1));
|
|
31903
|
+
} else if (selectedIndex === selected.length - 1) {
|
|
31904
|
+
newSelected = newSelected.concat(selected.slice(0, -1));
|
|
31905
|
+
} else if (selectedIndex > 0) {
|
|
31906
|
+
newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
|
|
31907
|
+
}
|
|
31908
|
+
setSelected(newSelected);
|
|
31909
|
+
if (newSelected.length > 0 && onSelected) {
|
|
31910
|
+
onSelected(newSelected);
|
|
31911
|
+
}
|
|
31912
|
+
};
|
|
31913
|
+
|
|
31914
|
+
// const handleSelectAllClick = (event: { target: { checked: any } }) => {
|
|
31915
|
+
// if (event.target.checked) {
|
|
31916
|
+
// const newSelecteds = data.map((n: any) => n._id);
|
|
31917
|
+
// setSelected(newSelecteds as never[]);
|
|
31918
|
+
// return;
|
|
31919
|
+
// }
|
|
31920
|
+
// setSelected([]);
|
|
31921
|
+
// };
|
|
31922
|
+
|
|
31923
|
+
// Push Selected Rows
|
|
31924
|
+
// useEffect(() => {
|
|
31925
|
+
// if (selected.length > 0 && onSelected) {
|
|
31926
|
+
// onSelected(selected);
|
|
31927
|
+
// }
|
|
31928
|
+
// }, [selected]);
|
|
31929
|
+
|
|
31930
|
+
function renderRow(cols, row, index) {
|
|
31931
|
+
var _row$style;
|
|
31932
|
+
var urid = _.uniqueId();
|
|
31933
|
+
var className = rowClassName(row, index);
|
|
31934
|
+
var rw = _objectSpread2({}, row);
|
|
31935
|
+
var rowStyle = (_row$style = row === null || row === undefined ? undefined : row.style) !== null && _row$style !== undefined ? _row$style : {};
|
|
31936
|
+
var onDragStart = row === null || row === undefined ? undefined : row.onDragStart;
|
|
31937
|
+
delete rw.table;
|
|
31938
|
+
delete rw.style;
|
|
31939
|
+
delete rw.onDragStart;
|
|
31940
|
+
// console.log(row);
|
|
31941
|
+
// const frow = Object.fromEntries(
|
|
31942
|
+
// Object.entries(row).filter(([ky, _]) => ky !== '_id' && cols.map((col: any) => col.id).includes(ky))
|
|
31943
|
+
// ) as unknown as TableDataItem
|
|
31944
|
+
// console.log(frow);
|
|
31945
|
+
var isRowSelected = selected.indexOf(row) !== -1;
|
|
31946
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
|
|
31947
|
+
draggable: rowDraggable,
|
|
31948
|
+
role: "checkbox",
|
|
31949
|
+
onDragStart: onDragStart,
|
|
31950
|
+
"aria-checked": selected.indexOf(row) !== -1,
|
|
31951
|
+
tabIndex: -1,
|
|
31952
|
+
key: urid,
|
|
31953
|
+
style: _objectSpread2({
|
|
31954
|
+
cursor: 'pointer',
|
|
31955
|
+
backgroundColor: isRowSelected ? '#efefef' : ''
|
|
31956
|
+
}, rowStyle),
|
|
31957
|
+
onClick: function onClick(e) {
|
|
31958
|
+
if (!rowDraggable) {
|
|
31959
|
+
if (onRow) {
|
|
31960
|
+
onRow(row, index);
|
|
31961
|
+
} else {
|
|
31962
|
+
handleClick(e, row);
|
|
31963
|
+
}
|
|
31964
|
+
}
|
|
31965
|
+
},
|
|
31966
|
+
className: _JSXStyle.dynamic([["2019708038", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
|
|
31967
|
+
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
31968
|
+
columns: cols,
|
|
31969
|
+
row: rw,
|
|
31970
|
+
rowIndex: index,
|
|
31971
|
+
emptyText: emptyText,
|
|
31972
|
+
onCellClick: onCell
|
|
31973
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31974
|
+
id: "2019708038",
|
|
31975
|
+
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
31976
|
+
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
31977
|
+
}
|
|
31978
|
+
if ((data === null || data === undefined ? undefined : data.length) === 0) {
|
|
31979
|
+
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
31980
|
+
colSpan: columns === null || columns === undefined ? undefined : columns.length
|
|
31981
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Placeholder, {
|
|
31982
|
+
empty: true,
|
|
31983
|
+
msg: "No Entries Found"
|
|
31984
|
+
})))));
|
|
31985
|
+
}
|
|
31986
|
+
return /*#__PURE__*/React.createElement("tbody", {
|
|
31987
|
+
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
31988
|
+
}, data.map(function (row, index) {
|
|
31989
|
+
var _row$table, _row$table2, _row$table3, _row$table4, _row$table5;
|
|
31990
|
+
var qid = _.uniqueId();
|
|
31991
|
+
if (row === null || row === undefined) {
|
|
31992
|
+
var uid = _.uniqueId();
|
|
31993
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
31994
|
+
key: uid,
|
|
31995
|
+
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
31996
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
31997
|
+
colSpan: columns.length,
|
|
31998
|
+
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
31999
|
+
}, "\u2003"));
|
|
32000
|
+
}
|
|
32001
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index), (row === null || row === undefined ? undefined : row.table) && /*#__PURE__*/React.createElement("tr", {
|
|
32002
|
+
key: qid,
|
|
32003
|
+
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
32004
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
32005
|
+
style: {
|
|
32006
|
+
padding: '1rem'
|
|
32007
|
+
},
|
|
32008
|
+
colSpan: columns.length,
|
|
32009
|
+
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
32010
|
+
}, /*#__PURE__*/React.createElement(DataTable$1, {
|
|
32011
|
+
readOnly: true,
|
|
32012
|
+
stickyHeader: false,
|
|
32013
|
+
style: _objectSpread2({
|
|
32014
|
+
height: 'auto !important'
|
|
32015
|
+
}, row === null || row === undefined || (_row$table = row.table) === null || _row$table === undefined ? undefined : _row$table.style),
|
|
32016
|
+
menu: (_row$table2 = row.table) === null || _row$table2 === undefined ? undefined : _row$table2.menu,
|
|
32017
|
+
rows: (_row$table3 = row.table) === null || _row$table3 === undefined ? undefined : _row$table3.rows,
|
|
32018
|
+
heading: (_row$table4 = row.table) === null || _row$table4 === undefined ? undefined : _row$table4.heading,
|
|
32019
|
+
cols: (_row$table5 = row.table) === null || _row$table5 === undefined ? undefined : _row$table5.cols
|
|
32020
|
+
}))));
|
|
32021
|
+
|
|
32022
|
+
// return (
|
|
32023
|
+
// <tr
|
|
32024
|
+
// key={`tbody-row-${index}`}
|
|
32025
|
+
// className={useClasses({ hover }, className)}
|
|
32026
|
+
// onClick={() => rowClickHandler(row, index)}>
|
|
32027
|
+
// <TableCell<TableDataItem>
|
|
32028
|
+
// columns={columns}
|
|
32029
|
+
// row={row}
|
|
32030
|
+
// rowIndex={index}
|
|
32031
|
+
// emptyText={emptyText}
|
|
32032
|
+
// onCellClick={onCell}
|
|
32033
|
+
// />
|
|
32034
|
+
// </tr>
|
|
32035
|
+
// )
|
|
32036
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32037
|
+
id: "1422656197",
|
|
32038
|
+
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
32039
|
+
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
32040
|
+
};
|
|
32041
|
+
TableBody.displayName = 'TableBody';
|
|
32042
|
+
|
|
32043
|
+
var getRealShape = function getRealShape(el) {
|
|
32044
|
+
var defaultShape = {
|
|
32045
|
+
width: 0,
|
|
32046
|
+
height: 0
|
|
32047
|
+
};
|
|
32048
|
+
if (!el || typeof window === 'undefined') return defaultShape;
|
|
32049
|
+
var rect = el.getBoundingClientRect();
|
|
32050
|
+
var _window$getComputedSt = window.getComputedStyle(el),
|
|
32051
|
+
width = _window$getComputedSt.width,
|
|
32052
|
+
height = _window$getComputedSt.height;
|
|
32053
|
+
var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
|
|
32054
|
+
if (!str) return 0;
|
|
32055
|
+
var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
|
|
32056
|
+
return Number.isNaN(+strVal) ? 0 : +strVal;
|
|
32057
|
+
};
|
|
32058
|
+
return {
|
|
32059
|
+
width: getCSSStyleVal("".concat(width), rect.width),
|
|
32060
|
+
height: getCSSStyleVal("".concat(height), rect.height)
|
|
32061
|
+
};
|
|
32062
|
+
};
|
|
32063
|
+
var useRealShape = function useRealShape(ref) {
|
|
32064
|
+
var _useState = React.useState({
|
|
32065
|
+
width: 0,
|
|
32066
|
+
height: 0
|
|
32067
|
+
}),
|
|
32068
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32069
|
+
state = _useState2[0],
|
|
32070
|
+
setState = _useState2[1];
|
|
32071
|
+
var update = function update() {
|
|
32072
|
+
var _getRealShape = getRealShape(ref.current),
|
|
32073
|
+
width = _getRealShape.width,
|
|
32074
|
+
height = _getRealShape.height;
|
|
32075
|
+
setState({
|
|
32076
|
+
width: width,
|
|
32077
|
+
height: height
|
|
32078
|
+
});
|
|
32079
|
+
};
|
|
32080
|
+
React.useEffect(function () {
|
|
32081
|
+
return update();
|
|
32082
|
+
}, [ref.current]);
|
|
32083
|
+
return [state, update];
|
|
32084
|
+
};
|
|
32085
|
+
|
|
32086
|
+
/* "use client" */
|
|
32087
|
+
|
|
32088
|
+
var TableColumn = function TableColumn(columnProps) {
|
|
32089
|
+
var _ref = columnProps,
|
|
32090
|
+
children = _ref.children,
|
|
32091
|
+
prop = _ref.prop,
|
|
32092
|
+
label = _ref.label,
|
|
32093
|
+
width = _ref.width,
|
|
32094
|
+
filter = _ref.filter,
|
|
32095
|
+
options = _ref.options,
|
|
32096
|
+
noWrap = _ref.noWrap,
|
|
32097
|
+
align = _ref.align,
|
|
32098
|
+
_ref$fontSize = _ref.fontSize,
|
|
32099
|
+
fontSize = _ref$fontSize === undefined ? 'smaller' : _ref$fontSize,
|
|
32100
|
+
_ref$className = _ref.className,
|
|
32101
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
32102
|
+
renderHandler = _ref.render;
|
|
32103
|
+
var _useTableContext = useTableContext(),
|
|
32104
|
+
updateColumn = _useTableContext.updateColumn;
|
|
32105
|
+
var safeProp = "".concat(prop.toString()).trim();
|
|
32106
|
+
if (!safeProp) {
|
|
32107
|
+
useWarning('The props "prop" is required.', 'Table.Column');
|
|
32108
|
+
}
|
|
32109
|
+
React.useEffect(function () {
|
|
32110
|
+
updateColumn({
|
|
32111
|
+
label: children || label,
|
|
32112
|
+
filter: filter,
|
|
32113
|
+
noWrap: noWrap,
|
|
32114
|
+
options: options,
|
|
32115
|
+
prop: safeProp,
|
|
32116
|
+
width: width,
|
|
32117
|
+
align: align,
|
|
32118
|
+
fontSize: fontSize,
|
|
32119
|
+
className: className,
|
|
32120
|
+
renderHandler: function renderHandler() {}
|
|
32121
|
+
});
|
|
32122
|
+
}, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
32123
|
+
return null;
|
|
32124
|
+
};
|
|
32125
|
+
TableColumn.displayName = 'TableColumn';
|
|
32126
|
+
|
|
32127
|
+
var _excluded$4 = ["active", "children", "disabled", "onClick"];
|
|
32128
|
+
var PaginationItem = function PaginationItem(_ref) {
|
|
32129
|
+
var active = _ref.active,
|
|
32130
|
+
children = _ref.children,
|
|
32131
|
+
disabled = _ref.disabled,
|
|
32132
|
+
onClick = _ref.onClick,
|
|
32133
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
32134
|
+
var theme = useTheme();
|
|
32135
|
+
var _useMemo = React.useMemo(function () {
|
|
32136
|
+
return [addColorAlpha(theme.palette.success, 0.1), addColorAlpha(theme.palette.success, 0.8)];
|
|
32137
|
+
}, [theme.palette.success]),
|
|
32138
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
32139
|
+
hover = _useMemo2[0],
|
|
32140
|
+
activeHover = _useMemo2[1];
|
|
32141
|
+
var classes = useClasses({
|
|
32142
|
+
active: active,
|
|
32143
|
+
disabled: disabled
|
|
32144
|
+
});
|
|
32145
|
+
var clickHandler = function clickHandler(event) {
|
|
32146
|
+
if (disabled) return;
|
|
32147
|
+
onClick && onClick(event);
|
|
32148
|
+
};
|
|
32149
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
32150
|
+
className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]])
|
|
32151
|
+
}, /*#__PURE__*/React.createElement("button", _extends({
|
|
32152
|
+
onClick: clickHandler
|
|
32153
|
+
}, props, {
|
|
32154
|
+
className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
32155
|
+
}), children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32156
|
+
id: "1657796974",
|
|
32157
|
+
dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
32158
|
+
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
32159
|
+
};
|
|
32160
|
+
PaginationItem.displayName = 'GeistPaginationItem';
|
|
32161
|
+
|
|
32162
|
+
/* "use client" */
|
|
32163
|
+
|
|
32164
|
+
tuple('prev', 'next', 'click');
|
|
32165
|
+
var defaultContext = {};
|
|
32166
|
+
var PaginationContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
32167
|
+
var usePaginationContext = function usePaginationContext() {
|
|
32168
|
+
return React.useContext(PaginationContext);
|
|
32169
|
+
};
|
|
32170
|
+
|
|
32171
|
+
var _excluded$3 = ["children"];
|
|
32172
|
+
var PaginationPrevious = function PaginationPrevious(_ref) {
|
|
32173
|
+
var children = _ref.children,
|
|
32174
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
32175
|
+
var _usePaginationContext = usePaginationContext(),
|
|
32176
|
+
update = _usePaginationContext.update,
|
|
32177
|
+
isFirst = _usePaginationContext.isFirst;
|
|
32178
|
+
return /*#__PURE__*/React.createElement(PaginationItem, _extends({
|
|
32179
|
+
onClick: function onClick() {
|
|
32180
|
+
return update && update('prev');
|
|
32181
|
+
},
|
|
32182
|
+
disabled: isFirst
|
|
32183
|
+
}, props), children);
|
|
32184
|
+
};
|
|
32185
|
+
PaginationPrevious.displayName = 'GeistPaginationPrevious';
|
|
32186
|
+
|
|
32187
|
+
var _excluded$2 = ["children"];
|
|
32188
|
+
var PaginationNext = function PaginationNext(_ref) {
|
|
32189
|
+
var children = _ref.children,
|
|
32190
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
32191
|
+
var _usePaginationContext = usePaginationContext(),
|
|
32192
|
+
update = _usePaginationContext.update,
|
|
32193
|
+
isLast = _usePaginationContext.isLast;
|
|
32194
|
+
return /*#__PURE__*/React.createElement(PaginationItem, _extends({
|
|
32195
|
+
onClick: function onClick() {
|
|
32196
|
+
return update && update('next');
|
|
32197
|
+
},
|
|
32198
|
+
disabled: isLast
|
|
32199
|
+
}, props), children);
|
|
32200
|
+
};
|
|
32201
|
+
PaginationNext.displayName = 'GeistPaginationNext';
|
|
32202
|
+
|
|
32203
|
+
var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
32204
|
+
var isBefore = _ref.isBefore,
|
|
32205
|
+
_onClick = _ref.onClick;
|
|
32206
|
+
var _useState = React.useState(false),
|
|
32207
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32208
|
+
showMore = _useState2[0],
|
|
32209
|
+
setShowMore = _useState2[1];
|
|
32210
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
32211
|
+
onClick: function onClick(e) {
|
|
32212
|
+
return _onClick && _onClick(e);
|
|
32213
|
+
},
|
|
32214
|
+
onMouseEnter: function onMouseEnter() {
|
|
32215
|
+
return setShowMore(true);
|
|
32216
|
+
},
|
|
32217
|
+
onMouseLeave: function onMouseLeave() {
|
|
32218
|
+
return setShowMore(false);
|
|
32219
|
+
}
|
|
32220
|
+
}, showMore ? /*#__PURE__*/React.createElement("svg", {
|
|
32221
|
+
viewBox: "0 0 24 24",
|
|
32222
|
+
stroke: "currentColor",
|
|
32223
|
+
strokeWidth: "1.5",
|
|
32224
|
+
strokeLinecap: "round",
|
|
32225
|
+
strokeLinejoin: "round",
|
|
32226
|
+
fill: "none",
|
|
32227
|
+
shapeRendering: "geometricPrecision",
|
|
32228
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]) + " " + "more"
|
|
32229
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
32230
|
+
d: "M13 17l5-5-5-5",
|
|
32231
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
32232
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
32233
|
+
d: "M6 17l5-5-5-5",
|
|
32234
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
32235
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
32236
|
+
viewBox: "0 0 24 24",
|
|
32237
|
+
strokeWidth: "1.5",
|
|
32238
|
+
strokeLinecap: "round",
|
|
32239
|
+
strokeLinejoin: "round",
|
|
32240
|
+
fill: "none",
|
|
32241
|
+
shapeRendering: "geometricPrecision",
|
|
32242
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
32243
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
32244
|
+
cx: "12",
|
|
32245
|
+
cy: "12",
|
|
32246
|
+
r: "1",
|
|
32247
|
+
fill: "currentColor",
|
|
32248
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
32249
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
32250
|
+
cx: "19",
|
|
32251
|
+
cy: "12",
|
|
32252
|
+
r: "1",
|
|
32253
|
+
fill: "currentColor",
|
|
32254
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
32255
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
32256
|
+
cx: "5",
|
|
32257
|
+
cy: "12",
|
|
32258
|
+
r: "1",
|
|
32259
|
+
fill: "currentColor",
|
|
32260
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
32261
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32262
|
+
id: "2928474255",
|
|
32263
|
+
dynamic: [isBefore ? '180deg' : '0deg']
|
|
32264
|
+
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
32265
|
+
};
|
|
32266
|
+
PaginationEllipsis.displayName = 'GeistPaginationEllipsis';
|
|
32267
|
+
|
|
32268
|
+
var PaginationPages = function PaginationPages(_ref) {
|
|
32269
|
+
var limit = _ref.limit,
|
|
32270
|
+
count = _ref.count,
|
|
32271
|
+
current = _ref.current,
|
|
32272
|
+
setPage = _ref.setPage;
|
|
32273
|
+
var showPages = React.useMemo(function () {
|
|
32274
|
+
var oddLimit = limit % 2 === 0 ? limit - 1 : limit;
|
|
32275
|
+
return oddLimit - 2;
|
|
32276
|
+
}, [limit]);
|
|
32277
|
+
var middleNumber = (showPages + 1) / 2;
|
|
32278
|
+
var _useMemo = React.useMemo(function () {
|
|
32279
|
+
var showEllipsis = count > limit;
|
|
32280
|
+
return [showEllipsis && current > middleNumber + 1, showEllipsis && current < count - middleNumber];
|
|
32281
|
+
}, [current, showPages, middleNumber, count, limit]),
|
|
32282
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
32283
|
+
showBeforeEllipsis = _useMemo2[0],
|
|
32284
|
+
showAfterEllipsis = _useMemo2[1];
|
|
32285
|
+
var pagesArray = React.useMemo(function () {
|
|
32286
|
+
return _toConsumableArray(new Array(showPages));
|
|
32287
|
+
}, [showPages]);
|
|
32288
|
+
var renderItem = React.useCallback(function (value, active) {
|
|
32289
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
32290
|
+
key: "pagination-item-".concat(value),
|
|
32291
|
+
active: value === active,
|
|
32292
|
+
onClick: function onClick() {
|
|
32293
|
+
return setPage(value);
|
|
32294
|
+
}
|
|
32295
|
+
}, value);
|
|
32296
|
+
}, []);
|
|
32297
|
+
var startPages = pagesArray.map(function (_, index) {
|
|
32298
|
+
var value = index + 2;
|
|
32299
|
+
return renderItem(value, current);
|
|
32300
|
+
});
|
|
32301
|
+
var middlePages = pagesArray.map(function (_, index) {
|
|
32302
|
+
var middleIndexNumber = middleNumber - (index + 1);
|
|
32303
|
+
var value = current - middleIndexNumber;
|
|
32304
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
32305
|
+
key: "pagination-middle-".concat(index),
|
|
32306
|
+
active: index + 1 === middleNumber,
|
|
32307
|
+
onClick: function onClick() {
|
|
32308
|
+
return setPage(value);
|
|
32309
|
+
}
|
|
32310
|
+
}, value);
|
|
32311
|
+
});
|
|
32312
|
+
var endPages = pagesArray.map(function (_, index) {
|
|
32313
|
+
var value = count - (showPages - index);
|
|
32314
|
+
return renderItem(value, current);
|
|
32315
|
+
});
|
|
32316
|
+
if (count <= limit) {
|
|
32317
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
32318
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, _toConsumableArray(new Array(count)).map(function (_, index) {
|
|
32319
|
+
var value = index + 1;
|
|
32320
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
32321
|
+
key: "pagination-item-".concat(value),
|
|
32322
|
+
active: value === current,
|
|
32323
|
+
onClick: function onClick() {
|
|
32324
|
+
return setPage(value);
|
|
32325
|
+
}
|
|
32326
|
+
}, value);
|
|
32327
|
+
}));
|
|
32328
|
+
/* eslint-enable */
|
|
32329
|
+
}
|
|
32330
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderItem(1, current), showBeforeEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
32331
|
+
key: "pagination-ellipsis-before",
|
|
32332
|
+
isBefore: true,
|
|
32333
|
+
onClick: function onClick() {
|
|
32334
|
+
return setPage(function (last) {
|
|
32335
|
+
return last - 5 >= 1 ? last - 5 : 1;
|
|
32336
|
+
});
|
|
32337
|
+
}
|
|
32338
|
+
}), showBeforeEllipsis && showAfterEllipsis ? middlePages : showBeforeEllipsis ? endPages : startPages, showAfterEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
32339
|
+
key: "pagination-ellipsis-after",
|
|
32340
|
+
onClick: function onClick() {
|
|
32341
|
+
return setPage(function (last) {
|
|
32342
|
+
return last + 5 <= count ? last + 5 : count;
|
|
32343
|
+
});
|
|
32344
|
+
}
|
|
32345
|
+
}), renderItem(count, current));
|
|
32346
|
+
};
|
|
32347
|
+
PaginationPages.displayName = 'GeistPaginationPages';
|
|
32348
|
+
|
|
32349
|
+
var _excluded$1 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
|
|
32350
|
+
var PaginationComponent = function PaginationComponent(_ref) {
|
|
32351
|
+
var customPage = _ref.page,
|
|
32352
|
+
_ref$initialPage = _ref.initialPage,
|
|
32353
|
+
initialPage = _ref$initialPage === undefined ? 1 : _ref$initialPage,
|
|
32354
|
+
_ref$count = _ref.count,
|
|
32355
|
+
count = _ref$count === undefined ? 1 : _ref$count,
|
|
32356
|
+
_ref$limit = _ref.limit,
|
|
32357
|
+
limit = _ref$limit === undefined ? 7 : _ref$limit,
|
|
32358
|
+
children = _ref.children,
|
|
32359
|
+
onChange = _ref.onChange,
|
|
32360
|
+
_ref$className = _ref.className,
|
|
32361
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
32362
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
32363
|
+
var _useScale = useScale(),
|
|
32364
|
+
SCALES = _useScale.SCALES;
|
|
32365
|
+
var _useCurrentState = useCurrentState(initialPage),
|
|
32366
|
+
_useCurrentState2 = _slicedToArray(_useCurrentState, 3),
|
|
32367
|
+
page = _useCurrentState2[0],
|
|
32368
|
+
setPage = _useCurrentState2[1],
|
|
32369
|
+
pageRef = _useCurrentState2[2];
|
|
32370
|
+
var _pickChild = pickChild(children, PaginationPrevious),
|
|
32371
|
+
_pickChild2 = _slicedToArray(_pickChild, 2),
|
|
32372
|
+
prevChildren = _pickChild2[1];
|
|
32373
|
+
var _pickChild3 = pickChild(children, PaginationNext),
|
|
32374
|
+
_pickChild4 = _slicedToArray(_pickChild3, 2),
|
|
32375
|
+
nextChildren = _pickChild4[1];
|
|
32376
|
+
var _useMemo = React.useMemo(function () {
|
|
32377
|
+
var hasChildren = function hasChildren(c) {
|
|
32378
|
+
return React.Children.count(c) > 0;
|
|
32379
|
+
};
|
|
32380
|
+
var prevDefault = /*#__PURE__*/React.createElement(PaginationPrevious, null, "prev");
|
|
32381
|
+
var nextDefault = /*#__PURE__*/React.createElement(PaginationNext, null, "next");
|
|
32382
|
+
return [hasChildren(prevChildren) ? prevChildren : prevDefault, hasChildren(nextChildren) ? nextChildren : nextDefault];
|
|
32383
|
+
}, [prevChildren, nextChildren]),
|
|
32384
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
32385
|
+
prevItem = _useMemo2[0],
|
|
32386
|
+
nextItem = _useMemo2[1];
|
|
32387
|
+
var update = function update(type) {
|
|
32388
|
+
if (type === 'prev' && pageRef.current > 1) {
|
|
32389
|
+
setPage(function (last) {
|
|
32390
|
+
return last - 1;
|
|
32391
|
+
});
|
|
32392
|
+
}
|
|
32393
|
+
if (type === 'next' && pageRef.current < count) {
|
|
32394
|
+
setPage(function (last) {
|
|
32395
|
+
return last + 1;
|
|
32396
|
+
});
|
|
32397
|
+
}
|
|
32398
|
+
};
|
|
32399
|
+
var values = React.useMemo(function () {
|
|
32400
|
+
return {
|
|
32401
|
+
isFirst: page <= 1,
|
|
32402
|
+
isLast: page >= count,
|
|
32403
|
+
update: update
|
|
32404
|
+
};
|
|
32405
|
+
}, [page, count]);
|
|
32406
|
+
React.useEffect(function () {
|
|
32407
|
+
onChange && onChange(page);
|
|
32408
|
+
}, [page]);
|
|
32409
|
+
React.useEffect(function () {
|
|
32410
|
+
if (customPage !== undefined) {
|
|
32411
|
+
setPage(customPage);
|
|
32412
|
+
}
|
|
32413
|
+
}, [customPage]);
|
|
32414
|
+
return /*#__PURE__*/React.createElement(PaginationContext.Provider, {
|
|
32415
|
+
value: values
|
|
32416
|
+
}, /*#__PURE__*/React.createElement("nav", _extends({}, props, {
|
|
32417
|
+
className: _JSXStyle.dynamic([["3826701357", [SCALES.font(2), SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
32418
|
+
}), prevItem, /*#__PURE__*/React.createElement(PaginationPages, {
|
|
32419
|
+
count: count,
|
|
32420
|
+
current: page,
|
|
32421
|
+
limit: limit,
|
|
32422
|
+
setPage: setPage
|
|
32423
|
+
}), nextItem), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32424
|
+
id: "3826701357",
|
|
32425
|
+
dynamic: [SCALES.font(2), SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
32426
|
+
}, "nav.__jsx-style-dynamic-selector{font-variant:tabular-nums;font-feature-settings:'tnum';--pagination-size:".concat(SCALES.font(2), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}nav.__jsx-style-dynamic-selector button:last-of-type{margin-right:0;}")));
|
|
32427
|
+
};
|
|
32428
|
+
PaginationComponent.displayName = 'Pagination';
|
|
32429
|
+
var Pagination = withScale(PaginationComponent);
|
|
32430
|
+
|
|
32431
|
+
Pagination.Previous = PaginationPrevious;
|
|
32432
|
+
Pagination.Next = PaginationNext;
|
|
32433
|
+
|
|
32434
|
+
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
32435
|
+
function TableComponent(tableProps) {
|
|
32436
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
32437
|
+
var _ref = tableProps,
|
|
32438
|
+
children = _ref.children,
|
|
32439
|
+
customData = _ref.data,
|
|
32440
|
+
_ref$initialData = _ref.initialData,
|
|
32441
|
+
initialData = _ref$initialData === undefined ? [] : _ref$initialData,
|
|
32442
|
+
_ref$hover = _ref.hover,
|
|
32443
|
+
hover = _ref$hover === undefined ? true : _ref$hover,
|
|
32444
|
+
_ref$emptyText = _ref.emptyText,
|
|
32445
|
+
emptyText = _ref$emptyText === undefined ? '' : _ref$emptyText,
|
|
32446
|
+
_ref$rowDraggable = _ref.rowDraggable,
|
|
32447
|
+
rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
|
|
32448
|
+
_ref$readOnly = _ref.readOnly,
|
|
32449
|
+
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
32450
|
+
onRow = _ref.onRow,
|
|
32451
|
+
onCell = _ref.onCell;
|
|
32452
|
+
_ref.onChange;
|
|
32453
|
+
var onFilters = _ref.onFilters,
|
|
32454
|
+
onPageChange = _ref.onPageChange,
|
|
32455
|
+
_ref$showFilters = _ref.showFilters,
|
|
32456
|
+
showFilters = _ref$showFilters === undefined ? false : _ref$showFilters,
|
|
32457
|
+
_ref$stickyHeader = _ref.stickyHeader,
|
|
32458
|
+
stickyHeader = _ref$stickyHeader === undefined ? false : _ref$stickyHeader,
|
|
32459
|
+
onSelected = _ref.onSelected,
|
|
32460
|
+
dataLength = _ref.dataLength,
|
|
32461
|
+
viewLength = _ref.viewLength,
|
|
32462
|
+
_ref$className = _ref.className,
|
|
32463
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
32464
|
+
_ref$rowClassName = _ref.rowClassName,
|
|
32465
|
+
rowClassName = _ref$rowClassName === undefined ? function () {
|
|
32466
|
+
return '';
|
|
32467
|
+
} : _ref$rowClassName,
|
|
32468
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
32469
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
32470
|
+
var _useScale = useScale(),
|
|
32471
|
+
SCALES = _useScale.SCALES;
|
|
32472
|
+
var ref = React.useRef(null);
|
|
32473
|
+
var _useRealShape = useRealShape(ref),
|
|
32474
|
+
_useRealShape2 = _slicedToArray(_useRealShape, 2),
|
|
32475
|
+
width = _useRealShape2[0].width,
|
|
32476
|
+
updateShape = _useRealShape2[1];
|
|
32477
|
+
var _useState = React.useState([]),
|
|
32478
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32479
|
+
columns = _useState2[0],
|
|
32480
|
+
setColumns = _useState2[1];
|
|
32481
|
+
var _useState3 = React.useState(initialData),
|
|
32482
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32483
|
+
data = _useState4[0],
|
|
32484
|
+
setData = _useState4[1];
|
|
32485
|
+
var updateColumn = function updateColumn(column) {
|
|
32486
|
+
setColumns(function (last) {
|
|
32487
|
+
var hasColumn = last.find(function (item) {
|
|
32488
|
+
return item.prop === column.prop;
|
|
32489
|
+
});
|
|
32490
|
+
if (!hasColumn) return [].concat(_toConsumableArray(last), [column]);
|
|
32491
|
+
return last.map(function (item) {
|
|
32492
|
+
if (item.prop !== column.prop) return item;
|
|
32493
|
+
return column;
|
|
32494
|
+
});
|
|
32495
|
+
});
|
|
32496
|
+
};
|
|
32497
|
+
var contextValue = React.useMemo(function () {
|
|
32498
|
+
return {
|
|
32499
|
+
columns: columns,
|
|
32500
|
+
updateColumn: updateColumn
|
|
32501
|
+
};
|
|
32502
|
+
}, [columns]);
|
|
32503
|
+
React.useEffect(function () {
|
|
32504
|
+
if (typeof customData === 'undefined') return;
|
|
32505
|
+
setData(customData);
|
|
32506
|
+
}, [customData]);
|
|
32507
|
+
useResize(function () {
|
|
32508
|
+
return updateShape();
|
|
32509
|
+
});
|
|
32510
|
+
|
|
32511
|
+
// Function to calculate start and end index for a given page
|
|
32512
|
+
var getDataRange = function getDataRange(pageNumber, itemsPerPage, dataLength) {
|
|
32513
|
+
var startIndex = (pageNumber - 1) * itemsPerPage;
|
|
32514
|
+
var endIndex = Math.min(startIndex + itemsPerPage - 1, dataLength - 1);
|
|
32515
|
+
return {
|
|
32516
|
+
startIndex: startIndex,
|
|
32517
|
+
endIndex: endIndex
|
|
32518
|
+
};
|
|
32519
|
+
};
|
|
32520
|
+
return /*#__PURE__*/React.createElement(TableContext.Provider, {
|
|
32521
|
+
value: contextValue
|
|
32522
|
+
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
32523
|
+
ref: ref
|
|
32524
|
+
}, props, {
|
|
32525
|
+
className: _JSXStyle.dynamic([["2132340556", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
32526
|
+
}), /*#__PURE__*/React.createElement(TableHead, {
|
|
32527
|
+
stickyHeader: stickyHeader,
|
|
32528
|
+
columns: columns,
|
|
32529
|
+
onFilters: onFilters,
|
|
32530
|
+
showFilters: showFilters,
|
|
32531
|
+
width: width
|
|
32532
|
+
}), /*#__PURE__*/React.createElement(TableBody, {
|
|
32533
|
+
data: data,
|
|
32534
|
+
hover: hover,
|
|
32535
|
+
emptyText: emptyText,
|
|
32536
|
+
onRow: onRow,
|
|
32537
|
+
onCell: onCell,
|
|
32538
|
+
rowClassName: rowClassName,
|
|
32539
|
+
rowDraggable: rowDraggable,
|
|
32540
|
+
readOnly: readOnly,
|
|
32541
|
+
onSelected: onSelected
|
|
32542
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32543
|
+
id: "2132340556",
|
|
32544
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
32545
|
+
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")), dataLength && viewLength && onPageChange ? /*#__PURE__*/React.createElement("tfoot", {
|
|
32546
|
+
className: _JSXStyle.dynamic([["2132340556", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
32547
|
+
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
32548
|
+
onChange: function onChange(pageNumber) {
|
|
32549
|
+
// Get the range for the current page
|
|
32550
|
+
var _getDataRange = getDataRange(pageNumber, viewLength, dataLength),
|
|
32551
|
+
startIndex = _getDataRange.startIndex,
|
|
32552
|
+
endIndex = _getDataRange.endIndex;
|
|
32553
|
+
onPageChange(pageNumber, startIndex, endIndex);
|
|
32554
|
+
},
|
|
32555
|
+
limit: 5,
|
|
32556
|
+
count: Number(dataLength / viewLength)
|
|
32557
|
+
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight$1, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft$1, null)))) : null));
|
|
32558
|
+
}
|
|
32559
|
+
TableComponent.displayName = 'Table';
|
|
32560
|
+
TableComponent.Column = TableColumn;
|
|
32561
|
+
var Table = withScale(TableComponent);
|
|
32562
|
+
Table.Column = TableColumn;
|
|
32542
32563
|
|
|
32543
|
-
exports.DataTable =
|
|
32564
|
+
exports.DataTable = DataTable$1;
|
|
32544
32565
|
exports.default = Table;
|