yootd 0.0.69 → 0.0.70
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.
@@ -12,6 +12,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
12
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
13
13
|
import { DndContext } from '@dnd-kit/core';
|
14
14
|
import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
|
15
|
+
import { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
15
16
|
import { CSS } from '@dnd-kit/utilities';
|
16
17
|
import React, { useContext, useMemo } from 'react';
|
17
18
|
import { Checkbox } from "../../../checkbox";
|
@@ -20,7 +21,6 @@ import { Popover } from "../../../popover";
|
|
20
21
|
import { TableRowContext } from "../..";
|
21
22
|
import { DragHandler } from "../icons/DragHandler";
|
22
23
|
import { SettingFilled } from "../icons/SettingFilled";
|
23
|
-
import { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
24
24
|
import "./index.scss";
|
25
25
|
var renderColumnTitle = function renderColumnTitle(title) {
|
26
26
|
if (typeof title === 'function') {
|
@@ -73,7 +73,8 @@ export var PrimaryHeaderRow = function PrimaryHeaderRow(_ref2) {
|
|
73
73
|
updateKeys = _useContext.updateKeys,
|
74
74
|
type = _useContext.type,
|
75
75
|
showSetting = _useContext.showSetting,
|
76
|
-
|
76
|
+
headerBgColor = _useContext.headerBgColor,
|
77
|
+
headerTextColor = _useContext.headerTextColor;
|
77
78
|
var bem = useBem('table');
|
78
79
|
var handleDragEnd = function handleDragEnd(event) {
|
79
80
|
var active = event.active,
|
@@ -92,11 +93,11 @@ export var PrimaryHeaderRow = function PrimaryHeaderRow(_ref2) {
|
|
92
93
|
})) !== null && _columns$map !== void 0 ? _columns$map : [] : []);
|
93
94
|
};
|
94
95
|
return /*#__PURE__*/React.createElement("tr", _extends({
|
95
|
-
className: "".concat(type === 'primary' ? bem.b('thead').b('row').m('primary') : '', " ").concat(
|
96
|
-
// @ts-expect-error
|
97
|
-
,
|
96
|
+
className: "\n ".concat(bem.b('thead').b('row'), "\n ").concat(type === 'primary' ? bem.b('thead').b('row').m('primary') : '', " ").concat(headerBgColor != null ? bem.b('thead').b('row').m('header-bg-colored') : '', "\n ").concat(className !== null && className !== void 0 ? className : ''),
|
98
97
|
style: _objectSpread(_objectSpread({}, style !== null && style !== void 0 ? style : {}), {}, {
|
99
|
-
|
98
|
+
// @ts-expect-error
|
99
|
+
'--th-bg-color': headerBgColor,
|
100
|
+
'--th-text-color': headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : '#fff'
|
100
101
|
})
|
101
102
|
}, props), children, showSetting ? /*#__PURE__*/React.createElement("th", {
|
102
103
|
className: "ant-table-cell ".concat(bem.b('setting'), " ").concat(type === 'primary' ? bem.b('setting').m('primary') : '')
|
@@ -4,16 +4,18 @@
|
|
4
4
|
&--primary {
|
5
5
|
th {
|
6
6
|
background-color: var(--ant-color-primary) !important;
|
7
|
-
color: #fff !important;
|
8
7
|
}
|
9
8
|
}
|
10
9
|
|
11
|
-
&--colored {
|
10
|
+
&--header-bg-colored {
|
12
11
|
th {
|
13
12
|
background-color: var(--th-bg-color) !important;
|
14
|
-
color: #fff !important;
|
15
13
|
}
|
16
14
|
}
|
15
|
+
|
16
|
+
th {
|
17
|
+
color: var(--th-text-color) !important;
|
18
|
+
}
|
17
19
|
}
|
18
20
|
}
|
19
21
|
|
@@ -50,7 +52,7 @@
|
|
50
52
|
&__icon {
|
51
53
|
cursor: pointer;
|
52
54
|
path {
|
53
|
-
fill: var(--
|
55
|
+
fill: var(--th-text-color) !important;
|
54
56
|
}
|
55
57
|
}
|
56
58
|
|
package/dist/table/index.d.ts
CHANGED
@@ -11,7 +11,8 @@ export type { ColumnFilterItem, ColumnTitle, ColumnTitleProps, CompareFn, Expand
|
|
11
11
|
export interface TableProps<T = AnyObject> extends Omit<AntTableProps<T>, 'columns'> {
|
12
12
|
columns?: ColumnsType<T>;
|
13
13
|
type?: 'primary' | 'default';
|
14
|
-
|
14
|
+
headerBgColor?: string;
|
15
|
+
headerTextColor?: string;
|
15
16
|
showSetting?: boolean;
|
16
17
|
}
|
17
18
|
export interface ColumnType<T = AnyObject> extends Omit<AntColumnType<T>, 'key'> {
|
@@ -35,7 +36,8 @@ export interface ITableRowContext {
|
|
35
36
|
updateKeys?: (keys: React.Key[]) => void;
|
36
37
|
showSetting?: boolean;
|
37
38
|
type?: 'primary' | 'default';
|
38
|
-
|
39
|
+
headerBgColor?: string;
|
40
|
+
headerTextColor?: string;
|
39
41
|
}
|
40
42
|
export declare const TableRowContext: React.Context<ITableRowContext>;
|
41
43
|
declare const Table: RefTable & {
|
package/dist/table/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["type", "showSetting", "columns", "components", "
|
1
|
+
var _excluded = ["type", "showSetting", "columns", "components", "headerBgColor", "headerTextColor"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -29,7 +29,8 @@ var InternalTable = function InternalTable(_ref, ref) {
|
|
29
29
|
showSetting = _ref.showSetting,
|
30
30
|
columns = _ref.columns,
|
31
31
|
components = _ref.components,
|
32
|
-
|
32
|
+
headerBgColor = _ref.headerBgColor,
|
33
|
+
headerTextColor = _ref.headerTextColor,
|
33
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
34
35
|
var _useState = useState([]),
|
35
36
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -127,7 +128,8 @@ var InternalTable = function InternalTable(_ref, ref) {
|
|
127
128
|
updateKeys: updateKeys,
|
128
129
|
showSetting: showSetting,
|
129
130
|
type: type,
|
130
|
-
|
131
|
+
headerBgColor: headerBgColor,
|
132
|
+
headerTextColor: headerTextColor
|
131
133
|
}
|
132
134
|
}, /*#__PURE__*/React.createElement(AntTable, _extends({}, rest, {
|
133
135
|
ref: ref,
|