es-grid-template 1.8.57 → 1.8.59
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/es/grid-component/InternalTable.js +12 -5
- package/es/grid-component/TableGrid.js +2 -2
- package/es/grid-component/hooks/useColumns.js +2 -1
- package/es/grid-component/hooks/utils.d.ts +1 -1
- package/es/grid-component/hooks/utils.js +4 -9
- package/es/grid-component/type.d.ts +6 -1
- package/es/table-component/InternalTable.js +0 -5
- package/es/table-component/TableContainer.js +4 -11
- package/es/table-component/body/TableBody.js +0 -27
- package/es/table-component/body/TableBodyCell.js +6 -4
- package/es/table-component/footer/TableFooterCell.js +0 -4
- package/es/table-component/hook/useColumns.js +6 -3
- package/es/table-component/style.d.ts +22 -0
- package/es/table-component/style.js +48 -0
- package/es/table-component/style.scss +28 -67
- package/es/table-component/table/Grid.js +14 -7
- package/es/table-component/type.d.ts +6 -1
- package/lib/grid-component/InternalTable.js +11 -5
- package/lib/grid-component/TableGrid.js +2 -2
- package/lib/grid-component/hooks/useColumns.js +2 -1
- package/lib/grid-component/hooks/utils.d.ts +1 -1
- package/lib/grid-component/hooks/utils.js +4 -9
- package/lib/grid-component/type.d.ts +6 -1
- package/lib/table-component/InternalTable.js +0 -6
- package/lib/table-component/TableContainer.js +4 -14
- package/lib/table-component/body/TableBody.js +0 -27
- package/lib/table-component/body/TableBodyCell.js +6 -4
- package/lib/table-component/footer/TableFooterCell.js +0 -6
- package/lib/table-component/hook/useColumns.js +6 -3
- package/lib/table-component/style.d.ts +22 -0
- package/lib/table-component/style.js +55 -0
- package/lib/table-component/style.scss +28 -67
- package/lib/table-component/table/Grid.js +14 -7
- package/lib/table-component/type.d.ts +6 -1
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ var _operator = require("../features/operator");
|
|
|
18
18
|
var _utils = require("../hook/utils");
|
|
19
19
|
var _TableContainerEdit = _interopRequireDefault(require("../TableContainerEdit"));
|
|
20
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
+
var _style = require("../style");
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
24
|
// import { makeData } from "../default/makeData";
|
|
@@ -28,7 +29,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
28
29
|
|
|
29
30
|
const Grid = props => {
|
|
30
31
|
const {
|
|
31
|
-
theme
|
|
32
|
+
theme,
|
|
32
33
|
t,
|
|
33
34
|
id,
|
|
34
35
|
prefix,
|
|
@@ -259,14 +260,20 @@ const Grid = props => {
|
|
|
259
260
|
}
|
|
260
261
|
const sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.MouseSensor, {}), (0, _core.useSensor)(_core.TouchSensor, {}), (0, _core.useSensor)(_core.KeyboardSensor, {}));
|
|
261
262
|
const ContainerComponent = editAble ? _TableContainerEdit.default : _TableContainer.default;
|
|
262
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
263
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_style.GridStyle, {
|
|
264
|
+
$prefix: prefix,
|
|
265
|
+
$theme: {
|
|
266
|
+
theme: theme?.theme,
|
|
267
|
+
...theme
|
|
268
|
+
},
|
|
263
269
|
className: (0, _classnames.default)(`${prefix}-grid`, {
|
|
264
|
-
[`${prefix}-grid-light`]: theme === 'light',
|
|
265
|
-
[`${prefix}-grid-dark`]: theme === 'dark'
|
|
270
|
+
[`${prefix}-grid-light`]: !theme || theme.theme === 'light',
|
|
271
|
+
[`${prefix}-grid-dark`]: theme?.theme === 'dark'
|
|
266
272
|
}),
|
|
267
273
|
style: {
|
|
268
274
|
minHeight: minHeight ?? undefined,
|
|
269
|
-
maxHeight: height ?? undefined
|
|
275
|
+
maxHeight: height ?? undefined,
|
|
276
|
+
backgroundColor: theme?.backgroundColor ?? undefined
|
|
270
277
|
}
|
|
271
278
|
}, /*#__PURE__*/_react.default.createElement(_core.DndContext, {
|
|
272
279
|
collisionDetection: _core.closestCenter,
|
|
@@ -337,8 +344,8 @@ const Grid = props => {
|
|
|
337
344
|
}
|
|
338
345
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
339
346
|
className: (0, _classnames.default)(`${prefix}-grid`, {
|
|
340
|
-
[`${prefix}-grid-light`]: theme === 'light',
|
|
341
|
-
[`${prefix}-grid-dark`]: theme === 'dark'
|
|
347
|
+
[`${prefix}-grid-light`]: !theme || theme.theme === 'light',
|
|
348
|
+
[`${prefix}-grid-dark`]: theme?.theme === 'dark'
|
|
342
349
|
}),
|
|
343
350
|
style: {
|
|
344
351
|
// minHeight: minHeight ?? undefined,
|
|
@@ -154,6 +154,7 @@ export type ColumnTable<RecordType = AnyObject> = {
|
|
|
154
154
|
headerTextWrap?: boolean;
|
|
155
155
|
ellipsis?: boolean;
|
|
156
156
|
allowResizing?: boolean;
|
|
157
|
+
allowSelection?: boolean | ((rowData: RecordType) => boolean);
|
|
157
158
|
onCellStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cellValue: any, cell: Cell<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
|
|
158
159
|
onCellHeaderStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
|
|
159
160
|
onCellFooterStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cellValue: any, cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
|
|
@@ -191,7 +192,11 @@ export type Locale = TableLocale & {
|
|
|
191
192
|
};
|
|
192
193
|
export type ColumnsTable<RecordType = AnyObject> = ColumnTable<RecordType>[];
|
|
193
194
|
export type TableProps<RecordType = AnyObject> = {
|
|
194
|
-
theme?:
|
|
195
|
+
theme?: {
|
|
196
|
+
theme?: 'dark' | 'light';
|
|
197
|
+
backgroundColor?: string;
|
|
198
|
+
color?: string;
|
|
199
|
+
};
|
|
195
200
|
title?: ReactNode | ((data: RecordType) => ReactNode);
|
|
196
201
|
editAble?: boolean;
|
|
197
202
|
infiniteScroll?: boolean;
|