@bolio-ui/core 3.0.0-alpha.1 → 3.0.0
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/Alert/Alert.d.ts +20 -0
- package/dist/Alert/index.d.ts +3 -0
- package/dist/Alert/index.js +16 -0
- package/dist/BolioUIProvider/index.js +7 -6
- package/dist/Button/index.js +3 -3
- package/dist/ButtonDropdown/index.js +3 -2
- package/dist/Calendar/index.js +2 -2
- package/dist/Chip/Chip.d.ts +17 -0
- package/dist/Chip/ChipContext.d.ts +11 -0
- package/dist/Chip/ChipGroup.d.ts +16 -0
- package/dist/Chip/index.d.ts +9 -0
- package/dist/Chip/index.js +15 -0
- package/dist/ColorInput/index.js +3 -2
- package/dist/Combobox/index.js +3 -2
- package/dist/Command/index.js +9 -8
- package/dist/ContextMenu/index.js +5 -4
- package/dist/CssBaseline/index.js +2 -2
- package/dist/DatePicker/index.js +4 -3
- package/dist/DateRangePicker/index.js +4 -3
- package/dist/Drawer/index.js +6 -5
- package/dist/Grid/Grid.d.ts +16 -16
- package/dist/Grid/GridContainer.d.ts +16 -16
- package/dist/ImageZoom/ImageZoom.d.ts +14 -0
- package/dist/ImageZoom/index.d.ts +3 -0
- package/dist/ImageZoom/index.js +17 -0
- package/dist/Mention/Mention.d.ts +25 -0
- package/dist/Mention/index.d.ts +3 -0
- package/dist/Mention/index.js +17 -0
- package/dist/Menu/index.js +4 -3
- package/dist/Modal/index.js +8 -7
- package/dist/Note/Note.d.ts +10 -0
- package/dist/Note/index.js +3 -2
- package/dist/Popover/index.js +4 -3
- package/dist/Select/index.js +7 -6
- package/dist/Splitter/Splitter.d.ts +14 -0
- package/dist/Splitter/SplitterContext.d.ts +6 -0
- package/dist/Splitter/SplitterPanel.d.ts +13 -0
- package/dist/Splitter/index.d.ts +9 -0
- package/dist/Splitter/index.js +14 -0
- package/dist/Table/Table.d.ts +11 -1
- package/dist/Table/TableBody.d.ts +8 -2
- package/dist/Table/TableColumn.d.ts +2 -0
- package/dist/Table/TableHead.d.ts +9 -1
- package/dist/Table/TableSelectBox.d.ts +9 -0
- package/dist/Table/TableTypes.d.ts +8 -0
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +3 -3
- package/dist/Toolbar/Toolbar.d.ts +11 -0
- package/dist/Toolbar/ToolbarSeparator.d.ts +4 -0
- package/dist/Toolbar/index.d.ts +9 -0
- package/dist/Toolbar/index.js +14 -0
- package/dist/Tooltip/index.js +3 -2
- package/dist/Tour/Tour.d.ts +26 -0
- package/dist/Tour/index.d.ts +3 -0
- package/dist/Tour/index.js +24 -0
- package/dist/{chunk-PGQYW6YF.js → chunk-25NFUHLR.js} +12 -8
- package/dist/{chunk-AFBCMW2I.js → chunk-26KDVRFS.js} +1 -3
- package/dist/{chunk-4ZGR7UMX.js → chunk-4DH6SOK4.js} +10 -6
- package/dist/chunk-CGS2MT3G.js +10 -0
- package/dist/{chunk-6ZBFUZSL.js → chunk-CU6SNPIM.js} +25 -22
- package/dist/chunk-CY5KTINE.js +107 -0
- package/dist/{chunk-IJGIEX5J.js → chunk-DEMQXB46.js} +6 -2
- package/dist/{chunk-AVO2SK2I.js → chunk-DYYSUJ35.js} +2 -2
- package/dist/chunk-EUYSKHRS.js +13 -0
- package/dist/chunk-FFEAKF3A.js +220 -0
- package/dist/{chunk-XLPOECCE.js → chunk-FLUNRVVG.js} +12 -7
- package/dist/chunk-FQWH4PDK.js +165 -0
- package/dist/chunk-FSO65ZAH.js +249 -0
- package/dist/{chunk-2EYJZXS4.js → chunk-ICACLCJR.js} +13 -8
- package/dist/{chunk-XF4TPE2W.js → chunk-IL7L3BEL.js} +7 -2
- package/dist/{chunk-MGHMAZRL.js → chunk-KRSISARC.js} +7 -3
- package/dist/{chunk-4QA7Z7VP.js → chunk-M64V32WO.js} +6 -3
- package/dist/chunk-Q3I54DUS.js +131 -0
- package/dist/chunk-REWKR7S3.js +109 -0
- package/dist/{chunk-SGWX6H4Y.js → chunk-RWRFOGCU.js} +6 -2
- package/dist/chunk-SJVWKNGY.js +236 -0
- package/dist/{chunk-P245HSVB.js → chunk-TLVSZCKU.js} +2 -1
- package/dist/{chunk-AG2NWQYL.js → chunk-WCTANCLG.js} +3 -1
- package/dist/{chunk-TDJGMSGT.js → chunk-WIIDIZYK.js} +3 -1
- package/dist/{chunk-DIMJQLWY.js → chunk-XUNC7RB7.js} +9 -5
- package/dist/{chunk-GGCVPMXO.js → chunk-Y432C24Z.js} +2 -2
- package/dist/{chunk-TKICX5R6.js → chunk-Y5CFWIGV.js} +227 -35
- package/dist/{chunk-GYFW5NLU.js → chunk-YLLPYRJH.js} +34 -11
- package/dist/css/Alert.css +53 -0
- package/dist/css/ButtonDropdown-ButtonDropdownItem.css +0 -1
- package/dist/css/ButtonGroup.css +0 -1
- package/dist/css/Calendar.css +0 -1
- package/dist/css/Carousel.css +0 -1
- package/dist/css/Chip-ChipGroup.css +8 -0
- package/dist/css/Chip.css +65 -0
- package/dist/css/ColorInput.css +7 -3
- package/dist/css/ColorPicker.css +5 -4
- package/dist/css/Combobox.css +1 -2
- package/dist/css/DatePicker.css +1 -3
- package/dist/css/DateRangePicker.css +7 -3
- package/dist/css/Dropzone.css +0 -3
- package/dist/css/Fieldset-FieldsetGroup.css +0 -1
- package/dist/css/ImageZoom.css +93 -0
- package/dist/css/Input.css +1 -1
- package/dist/css/Mention.css +93 -0
- package/dist/css/Menu-MenuList.css +0 -1
- package/dist/css/Modal-ModalAction.css +6 -1
- package/dist/css/Modal-ModalActions.css +9 -2
- package/dist/css/NumberInput.css +1 -1
- package/dist/css/PinInput.css +1 -1
- package/dist/css/Radio.css +0 -1
- package/dist/css/SegmentedControl.css +0 -1
- package/dist/css/Select-SelectDropdown.css +0 -1
- package/dist/css/Select-SelectOption.css +0 -1
- package/dist/css/Select.css +0 -1
- package/dist/css/Splitter.css +77 -0
- package/dist/css/Table-TableBody.css +10 -0
- package/dist/css/Table-TableHead.css +41 -0
- package/dist/css/Table-TableSelectBox.css +11 -0
- package/dist/css/TagsInput.css +1 -2
- package/dist/css/Textarea.css +1 -1
- package/dist/css/Toggle.css +0 -1
- package/dist/css/Toolbar.css +32 -0
- package/dist/css/Tour.css +81 -0
- package/dist/css/use-toasts-toast-item.css +0 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +92 -62
- package/dist/styles.css +3571 -2997
- package/dist/utils/surface.d.ts +6 -0
- package/esm/Alert/Alert.d.ts +20 -0
- package/esm/Alert/index.d.ts +3 -0
- package/esm/Alert/index.js +16 -0
- package/esm/BolioUIProvider/index.js +6 -5
- package/esm/Button/index.js +2 -2
- package/esm/ButtonDropdown/index.js +2 -1
- package/esm/Calendar/index.js +1 -1
- package/esm/Chip/Chip.d.ts +17 -0
- package/esm/Chip/ChipContext.d.ts +11 -0
- package/esm/Chip/ChipGroup.d.ts +16 -0
- package/esm/Chip/index.d.ts +9 -0
- package/esm/Chip/index.js +15 -0
- package/esm/ColorInput/index.js +2 -1
- package/esm/Combobox/index.js +2 -1
- package/esm/Command/index.js +8 -7
- package/esm/ContextMenu/index.js +4 -3
- package/esm/CssBaseline/index.js +1 -1
- package/esm/DatePicker/index.js +3 -2
- package/esm/DateRangePicker/index.js +3 -2
- package/esm/Drawer/index.js +5 -4
- package/esm/Grid/Grid.d.ts +16 -16
- package/esm/Grid/GridContainer.d.ts +16 -16
- package/esm/ImageZoom/ImageZoom.d.ts +14 -0
- package/esm/ImageZoom/index.d.ts +3 -0
- package/esm/ImageZoom/index.js +17 -0
- package/esm/Mention/Mention.d.ts +25 -0
- package/esm/Mention/index.d.ts +3 -0
- package/esm/Mention/index.js +17 -0
- package/esm/Menu/index.js +3 -2
- package/esm/Modal/index.js +7 -6
- package/esm/Note/Note.d.ts +10 -0
- package/esm/Note/index.js +2 -1
- package/esm/Popover/index.js +3 -2
- package/esm/Select/index.js +6 -5
- package/esm/Splitter/Splitter.d.ts +14 -0
- package/esm/Splitter/SplitterContext.d.ts +6 -0
- package/esm/Splitter/SplitterPanel.d.ts +13 -0
- package/esm/Splitter/index.d.ts +9 -0
- package/esm/Splitter/index.js +14 -0
- package/esm/Table/Table.d.ts +11 -1
- package/esm/Table/TableBody.d.ts +8 -2
- package/esm/Table/TableColumn.d.ts +2 -0
- package/esm/Table/TableHead.d.ts +9 -1
- package/esm/Table/TableSelectBox.d.ts +9 -0
- package/esm/Table/TableTypes.d.ts +8 -0
- package/esm/Table/index.d.ts +1 -1
- package/esm/Table/index.js +2 -2
- package/esm/Toolbar/Toolbar.d.ts +11 -0
- package/esm/Toolbar/ToolbarSeparator.d.ts +4 -0
- package/esm/Toolbar/index.d.ts +9 -0
- package/esm/Toolbar/index.js +14 -0
- package/esm/Tooltip/index.js +2 -1
- package/esm/Tour/Tour.d.ts +26 -0
- package/esm/Tour/index.d.ts +3 -0
- package/esm/Tour/index.js +24 -0
- package/esm/{chunk-PGQYW6YF.js → chunk-25NFUHLR.js} +7 -3
- package/esm/{chunk-AFBCMW2I.js → chunk-26KDVRFS.js} +2 -4
- package/esm/{chunk-4ZGR7UMX.js → chunk-4DH6SOK4.js} +10 -6
- package/esm/chunk-CGS2MT3G.js +10 -0
- package/esm/{chunk-6ZBFUZSL.js → chunk-CU6SNPIM.js} +15 -12
- package/esm/chunk-CY5KTINE.js +107 -0
- package/esm/{chunk-IJGIEX5J.js → chunk-DEMQXB46.js} +6 -2
- package/esm/{chunk-AVO2SK2I.js → chunk-DYYSUJ35.js} +1 -1
- package/esm/chunk-EUYSKHRS.js +13 -0
- package/esm/chunk-FFEAKF3A.js +220 -0
- package/esm/{chunk-XLPOECCE.js → chunk-FLUNRVVG.js} +11 -6
- package/esm/chunk-FQWH4PDK.js +165 -0
- package/esm/chunk-FSO65ZAH.js +249 -0
- package/esm/{chunk-2EYJZXS4.js → chunk-ICACLCJR.js} +8 -3
- package/esm/{chunk-XF4TPE2W.js → chunk-IL7L3BEL.js} +7 -2
- package/esm/{chunk-MGHMAZRL.js → chunk-KRSISARC.js} +7 -3
- package/esm/{chunk-4QA7Z7VP.js → chunk-M64V32WO.js} +5 -2
- package/esm/chunk-Q3I54DUS.js +131 -0
- package/esm/chunk-REWKR7S3.js +109 -0
- package/esm/{chunk-SGWX6H4Y.js → chunk-RWRFOGCU.js} +6 -2
- package/esm/chunk-SJVWKNGY.js +236 -0
- package/esm/{chunk-P245HSVB.js → chunk-TLVSZCKU.js} +2 -1
- package/esm/{chunk-AG2NWQYL.js → chunk-WCTANCLG.js} +3 -1
- package/esm/{chunk-TDJGMSGT.js → chunk-WIIDIZYK.js} +3 -1
- package/esm/{chunk-DIMJQLWY.js → chunk-XUNC7RB7.js} +9 -5
- package/esm/{chunk-GGCVPMXO.js → chunk-Y432C24Z.js} +1 -1
- package/esm/chunk-Y5CFWIGV.js +543 -0
- package/esm/{chunk-GYFW5NLU.js → chunk-YLLPYRJH.js} +30 -7
- package/esm/css/Alert.css +53 -0
- package/esm/css/ButtonDropdown-ButtonDropdownItem.css +0 -1
- package/esm/css/ButtonGroup.css +0 -1
- package/esm/css/Calendar.css +0 -1
- package/esm/css/Carousel.css +0 -1
- package/esm/css/Chip-ChipGroup.css +8 -0
- package/esm/css/Chip.css +65 -0
- package/esm/css/ColorInput.css +7 -3
- package/esm/css/ColorPicker.css +5 -4
- package/esm/css/Combobox.css +1 -2
- package/esm/css/DatePicker.css +1 -3
- package/esm/css/DateRangePicker.css +7 -3
- package/esm/css/Dropzone.css +0 -3
- package/esm/css/Fieldset-FieldsetGroup.css +0 -1
- package/esm/css/ImageZoom.css +93 -0
- package/esm/css/Input.css +1 -1
- package/esm/css/Mention.css +93 -0
- package/esm/css/Menu-MenuList.css +0 -1
- package/esm/css/Modal-ModalAction.css +6 -1
- package/esm/css/Modal-ModalActions.css +9 -2
- package/esm/css/NumberInput.css +1 -1
- package/esm/css/PinInput.css +1 -1
- package/esm/css/Radio.css +0 -1
- package/esm/css/SegmentedControl.css +0 -1
- package/esm/css/Select-SelectDropdown.css +0 -1
- package/esm/css/Select-SelectOption.css +0 -1
- package/esm/css/Select.css +0 -1
- package/esm/css/Splitter.css +77 -0
- package/esm/css/Table-TableBody.css +10 -0
- package/esm/css/Table-TableHead.css +41 -0
- package/esm/css/Table-TableSelectBox.css +11 -0
- package/esm/css/TagsInput.css +1 -2
- package/esm/css/Textarea.css +1 -1
- package/esm/css/Toggle.css +0 -1
- package/esm/css/Toolbar.css +32 -0
- package/esm/css/Tour.css +81 -0
- package/esm/css/use-toasts-toast-item.css +0 -1
- package/esm/index.d.ts +15 -1
- package/esm/index.js +109 -79
- package/esm/styles.css +3206 -2632
- package/esm/utils/surface.d.ts +6 -0
- package/package.json +1 -1
- package/esm/chunk-TKICX5R6.js +0 -351
- package/dist/{chunk-DXHNQANX.js → chunk-TPZUTHTQ.js} +3 -3
- package/dist/{chunk-TKIUVNKP.js → chunk-XKJDF225.js} +2 -2
- package/esm/{chunk-DXHNQANX.js → chunk-TPZUTHTQ.js} +3 -3
- package/esm/{chunk-TKIUVNKP.js → chunk-XKJDF225.js} +3 -3
package/package.json
CHANGED
package/esm/chunk-TKICX5R6.js
DELETED
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Pagination_default
|
|
3
|
-
} from "./chunk-E5EDUOQT.js";
|
|
4
|
-
import {
|
|
5
|
-
use_resize_default
|
|
6
|
-
} from "./chunk-JJFOGZ6V.js";
|
|
7
|
-
import {
|
|
8
|
-
use_real_shape_default
|
|
9
|
-
} from "./chunk-HKOESPKZ.js";
|
|
10
|
-
import {
|
|
11
|
-
log_warning_default
|
|
12
|
-
} from "./chunk-AXYDJGTN.js";
|
|
13
|
-
import {
|
|
14
|
-
use_scale_default,
|
|
15
|
-
with_scale_default
|
|
16
|
-
} from "./chunk-MAICNLTY.js";
|
|
17
|
-
import {
|
|
18
|
-
use_theme_default
|
|
19
|
-
} from "./chunk-V5I4ORQQ.js";
|
|
20
|
-
import {
|
|
21
|
-
joinClasses,
|
|
22
|
-
use_classes_default
|
|
23
|
-
} from "./chunk-5KUROAEP.js";
|
|
24
|
-
|
|
25
|
-
// core/Table/Table.tsx
|
|
26
|
-
import React4, {
|
|
27
|
-
useCallback,
|
|
28
|
-
useEffect as useEffect2,
|
|
29
|
-
useImperativeHandle,
|
|
30
|
-
useMemo as useMemo2,
|
|
31
|
-
useRef,
|
|
32
|
-
useState
|
|
33
|
-
} from "react";
|
|
34
|
-
|
|
35
|
-
// core/Table/TableHead.tsx
|
|
36
|
-
import { useMemo } from "react";
|
|
37
|
-
|
|
38
|
-
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Table/TableHead.module.css.bolio-css-module-source
|
|
39
|
-
var TableHead_module_css_default = { "thead": "TableHead-module_thead__zMtMt", "th": "TableHead-module_th__GzIce", "theadBox": "TableHead-module_theadBox__6QaBJ" };
|
|
40
|
-
|
|
41
|
-
// core/Table/TableHead.tsx
|
|
42
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
-
var makeColgroup = (width, columns) => {
|
|
44
|
-
const unsetWidthCount = columns.filter((c) => !c.width).length;
|
|
45
|
-
const customWidthTotal = columns.reduce((pre, current) => {
|
|
46
|
-
return current.width ? pre + current.width : pre;
|
|
47
|
-
}, 0);
|
|
48
|
-
const averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
49
|
-
if (averageWidth <= 0) return /* @__PURE__ */ jsx("colgroup", {});
|
|
50
|
-
return /* @__PURE__ */ jsx("colgroup", { children: columns.map((column, index) => /* @__PURE__ */ jsx("col", { width: column.width || averageWidth }, `colgroup-${index}`)) });
|
|
51
|
-
};
|
|
52
|
-
var TableHead = (props) => {
|
|
53
|
-
const theme = use_theme_default();
|
|
54
|
-
const { columns, width } = props;
|
|
55
|
-
const isScalableWidth = useMemo(
|
|
56
|
-
() => columns.find((item) => !!item.width),
|
|
57
|
-
[columns]
|
|
58
|
-
);
|
|
59
|
-
const colgroup = useMemo(() => {
|
|
60
|
-
if (!isScalableWidth) return /* @__PURE__ */ jsx("colgroup", {});
|
|
61
|
-
return makeColgroup(width, columns);
|
|
62
|
-
}, [isScalableWidth, width, columns]);
|
|
63
|
-
const theadStyle = {
|
|
64
|
-
"--table-head-text-color": theme.palette.accents_5,
|
|
65
|
-
"--table-head-bg": theme.palette.accents_1,
|
|
66
|
-
"--table-head-border-color": theme.palette.border,
|
|
67
|
-
"--table-head-radius": theme.layout.radius
|
|
68
|
-
};
|
|
69
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
-
colgroup,
|
|
71
|
-
/* @__PURE__ */ jsx("thead", { className: TableHead_module_css_default.thead, style: theadStyle, children: /* @__PURE__ */ jsx("tr", { children: columns.map((column, index) => /* @__PURE__ */ jsx(
|
|
72
|
-
"th",
|
|
73
|
-
{
|
|
74
|
-
className: joinClasses(TableHead_module_css_default.th, column.className),
|
|
75
|
-
children: /* @__PURE__ */ jsx("div", { className: TableHead_module_css_default.theadBox, children: column.label })
|
|
76
|
-
},
|
|
77
|
-
`table-th-${String(column.prop)}-${index}`
|
|
78
|
-
)) }) })
|
|
79
|
-
] });
|
|
80
|
-
};
|
|
81
|
-
TableHead.displayName = "BolioUITableHead";
|
|
82
|
-
var TableHead_default = TableHead;
|
|
83
|
-
|
|
84
|
-
// core/Table/TableCell.tsx
|
|
85
|
-
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
86
|
-
var TableCell = ({
|
|
87
|
-
columns,
|
|
88
|
-
row,
|
|
89
|
-
rowIndex,
|
|
90
|
-
emptyText,
|
|
91
|
-
onCellClick
|
|
92
|
-
}) => {
|
|
93
|
-
return /* @__PURE__ */ jsx2(Fragment2, { children: columns.map((column, index) => {
|
|
94
|
-
const currentRowValue = row[column.prop];
|
|
95
|
-
const cellValue = currentRowValue || emptyText;
|
|
96
|
-
const shouldBeRenderElement = column.renderHandler(
|
|
97
|
-
currentRowValue,
|
|
98
|
-
row,
|
|
99
|
-
rowIndex
|
|
100
|
-
);
|
|
101
|
-
return /* @__PURE__ */ jsx2(
|
|
102
|
-
"td",
|
|
103
|
-
{
|
|
104
|
-
onClick: () => onCellClick && onCellClick(currentRowValue, rowIndex, index),
|
|
105
|
-
className: column.className,
|
|
106
|
-
children: /* @__PURE__ */ jsx2("div", { className: "cell", children: shouldBeRenderElement ? shouldBeRenderElement : cellValue })
|
|
107
|
-
},
|
|
108
|
-
`row-td-${index}-${String(column.prop)}`
|
|
109
|
-
);
|
|
110
|
-
}) });
|
|
111
|
-
};
|
|
112
|
-
var TableCell_default = TableCell;
|
|
113
|
-
|
|
114
|
-
// core/Table/TableContext.ts
|
|
115
|
-
import React2 from "react";
|
|
116
|
-
var defaultContext = {
|
|
117
|
-
columns: [],
|
|
118
|
-
updateColumn: () => {
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
var TableContext = React2.createContext(defaultContext);
|
|
122
|
-
var useTableContext = () => React2.useContext(TableContext);
|
|
123
|
-
|
|
124
|
-
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Table/TableBody.module.css.bolio-css-module-source
|
|
125
|
-
var TableBody_module_css_default = { "tr": "TableBody-module_tr__lTn-M", "hover": "TableBody-module_hover__AjVlq" };
|
|
126
|
-
|
|
127
|
-
// core/Table/TableBody.tsx
|
|
128
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
129
|
-
var TableBody = ({
|
|
130
|
-
data,
|
|
131
|
-
hover,
|
|
132
|
-
emptyText,
|
|
133
|
-
onRow,
|
|
134
|
-
onCell,
|
|
135
|
-
rowClassName
|
|
136
|
-
}) => {
|
|
137
|
-
const theme = use_theme_default();
|
|
138
|
-
const { columns } = useTableContext();
|
|
139
|
-
const rowClickHandler = (row, index) => {
|
|
140
|
-
if (onRow) onRow(row, index);
|
|
141
|
-
};
|
|
142
|
-
const trStyle = {
|
|
143
|
-
"--table-body-hover-bg": theme.palette.accents_1,
|
|
144
|
-
"--table-body-border-color": theme.palette.border,
|
|
145
|
-
"--table-body-text-color": theme.palette.accents_6
|
|
146
|
-
};
|
|
147
|
-
return /* @__PURE__ */ jsx3("tbody", { children: data.map((row, index) => {
|
|
148
|
-
const className = rowClassName(row, index);
|
|
149
|
-
return /* @__PURE__ */ jsx3(
|
|
150
|
-
"tr",
|
|
151
|
-
{
|
|
152
|
-
className: joinClasses(
|
|
153
|
-
TableBody_module_css_default.tr,
|
|
154
|
-
{ [TableBody_module_css_default.hover]: hover },
|
|
155
|
-
className
|
|
156
|
-
),
|
|
157
|
-
onClick: () => rowClickHandler(row, index),
|
|
158
|
-
style: trStyle,
|
|
159
|
-
children: /* @__PURE__ */ jsx3(
|
|
160
|
-
TableCell_default,
|
|
161
|
-
{
|
|
162
|
-
columns,
|
|
163
|
-
row,
|
|
164
|
-
rowIndex: index,
|
|
165
|
-
emptyText,
|
|
166
|
-
onCellClick: onCell
|
|
167
|
-
}
|
|
168
|
-
)
|
|
169
|
-
},
|
|
170
|
-
`tbody-row-${index}`
|
|
171
|
-
);
|
|
172
|
-
}) });
|
|
173
|
-
};
|
|
174
|
-
TableBody.displayName = "BolioUITableBody";
|
|
175
|
-
var TableBody_default = TableBody;
|
|
176
|
-
|
|
177
|
-
// core/Table/TableColumn.tsx
|
|
178
|
-
import { useEffect } from "react";
|
|
179
|
-
var defaultRender = () => {
|
|
180
|
-
};
|
|
181
|
-
var TableColumn = (columnProps) => {
|
|
182
|
-
const {
|
|
183
|
-
children,
|
|
184
|
-
prop,
|
|
185
|
-
label,
|
|
186
|
-
width,
|
|
187
|
-
className = "",
|
|
188
|
-
render: renderHandler = defaultRender
|
|
189
|
-
} = columnProps;
|
|
190
|
-
const { updateColumn } = useTableContext();
|
|
191
|
-
const safeProp = String(prop).trim();
|
|
192
|
-
if (!safeProp) {
|
|
193
|
-
log_warning_default('The props "prop" is required.', "Table.Column");
|
|
194
|
-
}
|
|
195
|
-
useEffect(() => {
|
|
196
|
-
updateColumn({
|
|
197
|
-
label: children || label,
|
|
198
|
-
prop: safeProp,
|
|
199
|
-
width,
|
|
200
|
-
className,
|
|
201
|
-
renderHandler
|
|
202
|
-
});
|
|
203
|
-
}, [children, label, safeProp, width, className, renderHandler, updateColumn]);
|
|
204
|
-
return null;
|
|
205
|
-
};
|
|
206
|
-
TableColumn.displayName = "BolioUITableColumn";
|
|
207
|
-
var TableColumn_default = TableColumn;
|
|
208
|
-
|
|
209
|
-
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Table/Table.module.css.bolio-css-module-source
|
|
210
|
-
var Table_module_css_default = { "table": "Table-module_table__H9ZOx", "footer": "Table-module_footer__7eFVi" };
|
|
211
|
-
|
|
212
|
-
// core/Table/Table.tsx
|
|
213
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
214
|
-
var defaultProps = {
|
|
215
|
-
hover: true,
|
|
216
|
-
initialData: [],
|
|
217
|
-
emptyText: "",
|
|
218
|
-
className: "",
|
|
219
|
-
rowClassName: () => ""
|
|
220
|
-
};
|
|
221
|
-
function TableComponent(tableProps, forwardedRef) {
|
|
222
|
-
var _a, _b;
|
|
223
|
-
const {
|
|
224
|
-
children,
|
|
225
|
-
data: customData,
|
|
226
|
-
initialData = defaultProps.initialData,
|
|
227
|
-
hover = defaultProps.hover,
|
|
228
|
-
emptyText = defaultProps.emptyText,
|
|
229
|
-
onRow,
|
|
230
|
-
onCell,
|
|
231
|
-
onChange,
|
|
232
|
-
pagination,
|
|
233
|
-
className = defaultProps.className,
|
|
234
|
-
rowClassName = defaultProps.rowClassName,
|
|
235
|
-
style,
|
|
236
|
-
...props
|
|
237
|
-
} = tableProps;
|
|
238
|
-
const { SCALES } = use_scale_default();
|
|
239
|
-
const tableRef = useRef(null);
|
|
240
|
-
useImperativeHandle(forwardedRef, () => tableRef.current);
|
|
241
|
-
const [{ width }, updateShape] = use_real_shape_default(tableRef);
|
|
242
|
-
const [columns, setColumns] = useState([]);
|
|
243
|
-
const [data, setData] = useState(initialData);
|
|
244
|
-
const updateColumn = useCallback(
|
|
245
|
-
(column) => {
|
|
246
|
-
setColumns((last) => {
|
|
247
|
-
const hasColumn = last.find((item) => item.prop === column.prop);
|
|
248
|
-
if (!hasColumn) return [...last, column];
|
|
249
|
-
return last.map((item) => {
|
|
250
|
-
if (item.prop !== column.prop) return item;
|
|
251
|
-
return column;
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
},
|
|
255
|
-
[]
|
|
256
|
-
);
|
|
257
|
-
const contextValue = useMemo2(
|
|
258
|
-
() => ({
|
|
259
|
-
columns,
|
|
260
|
-
updateColumn
|
|
261
|
-
}),
|
|
262
|
-
[columns, updateColumn]
|
|
263
|
-
);
|
|
264
|
-
useEffect2(() => {
|
|
265
|
-
if (typeof customData === "undefined") return;
|
|
266
|
-
setData(customData);
|
|
267
|
-
}, [customData]);
|
|
268
|
-
use_resize_default(() => updateShape());
|
|
269
|
-
const [selfPage, setSelfPage] = useState(1);
|
|
270
|
-
const pageSize = pagination ? Math.max(1, pagination.pageSize) : 0;
|
|
271
|
-
const totalRows = (_a = pagination == null ? void 0 : pagination.total) != null ? _a : data.length;
|
|
272
|
-
const pageCount = pagination ? Math.ceil(totalRows / pageSize) : 0;
|
|
273
|
-
const page = Math.min((_b = pagination == null ? void 0 : pagination.page) != null ? _b : selfPage, Math.max(pageCount, 1));
|
|
274
|
-
const rows = pagination && pagination.total === void 0 ? data.slice((page - 1) * pageSize, page * pageSize) : data;
|
|
275
|
-
const pageChangeHandler = (next) => {
|
|
276
|
-
if (next === page) return;
|
|
277
|
-
setSelfPage(next);
|
|
278
|
-
if (pagination == null ? void 0 : pagination.onPageChange) pagination.onPageChange(next);
|
|
279
|
-
};
|
|
280
|
-
const tableStyle = {
|
|
281
|
-
"--table-font-size": SCALES.font(1),
|
|
282
|
-
"--table-width": SCALES.width(1, "100%"),
|
|
283
|
-
"--table-height": SCALES.height(1, "auto"),
|
|
284
|
-
"--table-padding-top": SCALES.pt(0),
|
|
285
|
-
"--table-padding-right": SCALES.pr(0),
|
|
286
|
-
"--table-padding-bottom": SCALES.pb(0),
|
|
287
|
-
"--table-padding-left": SCALES.pl(0),
|
|
288
|
-
"--table-margin-top": SCALES.mt(0),
|
|
289
|
-
"--table-margin-right": SCALES.mr(0),
|
|
290
|
-
"--table-margin-bottom": SCALES.mb(0),
|
|
291
|
-
"--table-margin-left": SCALES.ml(0),
|
|
292
|
-
...style
|
|
293
|
-
};
|
|
294
|
-
return (
|
|
295
|
-
// the context is typed for any row: each Table provides its own
|
|
296
|
-
/* @__PURE__ */ jsxs2(
|
|
297
|
-
TableContext.Provider,
|
|
298
|
-
{
|
|
299
|
-
value: contextValue,
|
|
300
|
-
children: [
|
|
301
|
-
/* @__PURE__ */ jsxs2(
|
|
302
|
-
"table",
|
|
303
|
-
{
|
|
304
|
-
ref: tableRef,
|
|
305
|
-
className: use_classes_default(Table_module_css_default.table, className),
|
|
306
|
-
...props,
|
|
307
|
-
style: tableStyle,
|
|
308
|
-
children: [
|
|
309
|
-
/* @__PURE__ */ jsx4(TableHead_default, { columns, width }),
|
|
310
|
-
/* @__PURE__ */ jsx4(
|
|
311
|
-
TableBody_default,
|
|
312
|
-
{
|
|
313
|
-
data: rows,
|
|
314
|
-
hover,
|
|
315
|
-
emptyText,
|
|
316
|
-
onRow,
|
|
317
|
-
onCell,
|
|
318
|
-
rowClassName
|
|
319
|
-
}
|
|
320
|
-
),
|
|
321
|
-
children
|
|
322
|
-
]
|
|
323
|
-
}
|
|
324
|
-
),
|
|
325
|
-
pageCount > 1 && /* @__PURE__ */ jsx4("div", { className: Table_module_css_default.footer, children: /* @__PURE__ */ jsx4(
|
|
326
|
-
Pagination_default,
|
|
327
|
-
{
|
|
328
|
-
count: pageCount,
|
|
329
|
-
page,
|
|
330
|
-
onChange: pageChangeHandler
|
|
331
|
-
}
|
|
332
|
-
) })
|
|
333
|
-
]
|
|
334
|
-
}
|
|
335
|
-
)
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
TableComponent.displayName = "BolioUITable";
|
|
339
|
-
TableComponent.Column = TableColumn_default;
|
|
340
|
-
var Table = with_scale_default(
|
|
341
|
-
React4.forwardRef(TableComponent)
|
|
342
|
-
);
|
|
343
|
-
Table.Column = TableColumn_default;
|
|
344
|
-
var Table_default = Table;
|
|
345
|
-
|
|
346
|
-
// core/Table/index.ts
|
|
347
|
-
var Table_default2 = Table_default;
|
|
348
|
-
|
|
349
|
-
export {
|
|
350
|
-
Table_default2 as Table_default
|
|
351
|
-
};
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
var _chunkBSDZWWUSjs = require('./chunk-BSDZWWUS.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkNDERASK2js = require('./chunk-NDERASK2.js');
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
var _chunkGJZT47MPjs = require('./chunk-GJZT47MP.js');
|
|
8
11
|
|
|
@@ -13,9 +16,6 @@ var _chunkRZBEZ26Ajs = require('./chunk-RZBEZ26A.js');
|
|
|
13
16
|
var _chunkLMDBE6T6js = require('./chunk-LMDBE6T6.js');
|
|
14
17
|
|
|
15
18
|
|
|
16
|
-
var _chunkNDERASK2js = require('./chunk-NDERASK2.js');
|
|
17
|
-
|
|
18
|
-
|
|
19
19
|
|
|
20
20
|
var _chunkMAICNLTYjs = require('./chunk-MAICNLTY.js');
|
|
21
21
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var _chunkO3RTRCY5js = require('./chunk-O3RTRCY5.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk33BUV2RXjs = require('./chunk-33BUV2RX.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLDTDMDE6js = require('./chunk-LDTDMDE6.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
use_default_props_default
|
|
3
3
|
} from "./chunk-BSDZWWUS.js";
|
|
4
|
+
import {
|
|
5
|
+
useButtonGroupContext
|
|
6
|
+
} from "./chunk-NDERASK2.js";
|
|
4
7
|
import {
|
|
5
8
|
getVariantColors,
|
|
6
9
|
isSemanticColorType
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
import {
|
|
12
15
|
Loading_default
|
|
13
16
|
} from "./chunk-LMDBE6T6.js";
|
|
14
|
-
import {
|
|
15
|
-
useButtonGroupContext
|
|
16
|
-
} from "./chunk-NDERASK2.js";
|
|
17
17
|
import {
|
|
18
18
|
use_scale_default,
|
|
19
19
|
with_scale_default
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
use_body_scroll_default
|
|
3
3
|
} from "./chunk-O3RTRCY5.js";
|
|
4
|
-
import {
|
|
5
|
-
css_transition_default
|
|
6
|
-
} from "./chunk-LDTDMDE6.js";
|
|
7
4
|
import {
|
|
8
5
|
use_current_state_default
|
|
9
6
|
} from "./chunk-33BUV2RX.js";
|
|
7
|
+
import {
|
|
8
|
+
css_transition_default
|
|
9
|
+
} from "./chunk-LDTDMDE6.js";
|
|
10
10
|
import {
|
|
11
11
|
use_scale_default,
|
|
12
12
|
with_scale_default
|