bitz-react-admin-ui 2.0.1 → 2.0.3
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/_virtual/dayjs.min.mjs +5 -2
- package/dist/_virtual/dayjs.min2.mjs +4 -0
- package/dist/components/BitzCalendar/index.mjs +1 -1
- package/dist/components/BitzConfigProvider/context.d.ts +6 -3
- package/dist/components/BitzConfigProvider/index.mjs +22 -9
- package/dist/components/BitzDayJs/index.mjs +1 -1
- package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
- package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
- package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
- package/dist/components/BitzMeetingTime/index.mjs +1 -1
- package/dist/components/BitzTable/Store/index.d.ts +9 -9
- package/dist/components/BitzTable/Store/index.mjs +126 -148
- package/dist/components/BitzTable/Table/index.d.ts +1 -1
- package/dist/components/BitzTable/Table/index.mjs +30 -24
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +53 -51
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +67 -65
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +4 -3
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +17 -17
- package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +32 -32
- package/dist/components/BitzTable/ToolBar/index.mjs +4 -4
- package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
- package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
- package/dist/style.css +1 -1
- package/dist/utils/time.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.mjs";
|
|
2
|
+
import { __require as o } from "../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
|
|
3
|
+
var t = o();
|
|
4
|
+
const s = /* @__PURE__ */ r(t);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
s as default
|
|
4
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as n } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import { useRef as O, useEffect as R } from "react";
|
|
3
3
|
import { Calendar as k, Select as a, Row as w, Col as y } from "antd";
|
|
4
|
-
import N from "../../
|
|
4
|
+
import N from "../../_virtual/dayjs.min.mjs";
|
|
5
5
|
import B from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/weekOfYear.mjs";
|
|
6
6
|
import "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs";
|
|
7
7
|
N.extend(B);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DensitySize } from '../BitzTable/Store';
|
|
3
|
-
export type ToolEnum = 'export' | 'refresh' | 'fullscreen' | '
|
|
3
|
+
export type ToolEnum = 'export' | 'refresh' | 'fullscreen' | 'config';
|
|
4
4
|
/**
|
|
5
5
|
* @type1 hide:隐藏行列分割线
|
|
6
6
|
* @type2 row:显示行分割线
|
|
@@ -8,6 +8,7 @@ export type ToolEnum = 'export' | 'refresh' | 'fullscreen' | 'stylesConfig';
|
|
|
8
8
|
* @type4 row-column:显示行列分割线
|
|
9
9
|
*/
|
|
10
10
|
export type BitzTableBorderedType = 'hide' | 'row' | 'column' | 'row-column';
|
|
11
|
+
export type StylesConfigScopeType = 'current' | 'global';
|
|
11
12
|
/** 控制table的全局行为 */
|
|
12
13
|
export interface TableComponentContextProps {
|
|
13
14
|
/** 是否显示外边框和列边框 */
|
|
@@ -16,12 +17,14 @@ export interface TableComponentContextProps {
|
|
|
16
17
|
defaultSize?: DensitySize;
|
|
17
18
|
/** 是否开启斑马纹,填充偶数行背景色 */
|
|
18
19
|
zebra?: boolean;
|
|
19
|
-
/** 外观配置作用域 */
|
|
20
|
-
scope?: boolean;
|
|
21
20
|
/** 是否开启rowHover样式 */
|
|
22
21
|
rowHoverable?: boolean;
|
|
23
22
|
/** 根据从左到右方向排序,不在数组中则不显示 */
|
|
24
23
|
toolbar?: ToolEnum[];
|
|
24
|
+
/** 外观配置的作用域 */
|
|
25
|
+
stylesScope: StylesConfigScopeType;
|
|
26
|
+
/** 外观配置的作用域 */
|
|
27
|
+
setStylesScope: (value: StylesConfigScopeType) => void;
|
|
25
28
|
}
|
|
26
29
|
export interface BitzConfigProviderContextProps {
|
|
27
30
|
Table?: TableComponentContextProps;
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { j as o } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { ConfigProvider as f } from "antd";
|
|
3
|
+
import { useState as d, useMemo as p } from "react";
|
|
4
|
+
import { BitzConfigContext as u } from "./context.mjs";
|
|
5
|
+
import t from "../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
6
|
+
const v = ({
|
|
7
|
+
children: s,
|
|
8
|
+
context: e,
|
|
9
|
+
...m
|
|
10
|
+
}) => {
|
|
11
|
+
const [r, i] = d("current"), n = {
|
|
12
|
+
Table: {
|
|
13
|
+
stylesScope: r,
|
|
14
|
+
setStylesScope: i
|
|
15
|
+
}
|
|
16
|
+
}, a = p(() => {
|
|
17
|
+
const l = t(e == null ? void 0 : e.Table, n.Table);
|
|
18
|
+
return t(e, { Table: l });
|
|
19
|
+
}, [e, r]);
|
|
20
|
+
return /* @__PURE__ */ o.jsx(f, { ...m, children: /* @__PURE__ */ o.jsx(u.Provider, { value: a, children: s }) });
|
|
21
|
+
};
|
|
9
22
|
export {
|
|
10
|
-
|
|
23
|
+
v as default
|
|
11
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { create as a } from "../../node_modules/.store/zustand@4.5.2/node_modules/zustand/esm/index.mjs";
|
|
2
|
-
import o from "../../
|
|
2
|
+
import o from "../../_virtual/dayjs.min.mjs";
|
|
3
3
|
var d = /* @__PURE__ */ ((e) => (e.day = "day", e.workWeek = "workWeek", e.week = "week", e.agendum = "agendum", e))(d || {});
|
|
4
4
|
const i = a((e, k) => ({
|
|
5
5
|
colHeight: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as d } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import { useState as y, useEffect as j, useMemo as D } from "react";
|
|
3
3
|
import M from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isToday.mjs";
|
|
4
|
-
import n from "../../
|
|
4
|
+
import n from "../../_virtual/dayjs.min.mjs";
|
|
5
5
|
import { useBitzFuiCalendarStore as S, CalendarTypeEnum as C } from "./BitzFuiCalendarStore.mjs";
|
|
6
6
|
import N from "./CalendarAgendumItem.mjs";
|
|
7
7
|
import x from "./CalendarAgendum.module.less.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as i } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import { useMemo as a } from "react";
|
|
3
3
|
import e from "./CalendarAgendum.module.less.mjs";
|
|
4
|
-
import l from "../../
|
|
4
|
+
import l from "../../_virtual/dayjs.min.mjs";
|
|
5
5
|
import { Button as c } from "antd";
|
|
6
6
|
const d = (_, s) => {
|
|
7
7
|
let t = s.diff(_, "minute"), m;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as a } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import { memo as m, useMemo as r } from "react";
|
|
3
|
-
import d from "../../
|
|
3
|
+
import d from "../../_virtual/dayjs.min.mjs";
|
|
4
4
|
import i from "../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
5
5
|
const n = (t) => {
|
|
6
6
|
const { time: e } = t, s = r(() => e.isSame(d(), "day"), [e]);
|
|
@@ -2,7 +2,7 @@ import { j as e } from "../../node_modules/.store/react@18.2.0/node_modules/reac
|
|
|
2
2
|
import { memo as C, useMemo as i } from "react";
|
|
3
3
|
import { Space as c, Button as o, DatePicker as b, Dropdown as h } from "antd";
|
|
4
4
|
import { useBitzFuiCalendarStore as w, CalendarTypeEnum as a } from "./BitzFuiCalendarStore.mjs";
|
|
5
|
-
import g from "../../
|
|
5
|
+
import g from "../../_virtual/dayjs.min.mjs";
|
|
6
6
|
import T from "../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/AppstoreOutlined.mjs";
|
|
7
7
|
import v from "../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/LeftOutlined.mjs";
|
|
8
8
|
import _ from "../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/RightOutlined.mjs";
|
|
@@ -4,7 +4,7 @@ import E from "./FuiCalendarItem.mjs";
|
|
|
4
4
|
import b from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrAfter.mjs";
|
|
5
5
|
import F from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrBefore.mjs";
|
|
6
6
|
import M from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/utc.mjs";
|
|
7
|
-
import r from "../../
|
|
7
|
+
import r from "../../_virtual/dayjs.min.mjs";
|
|
8
8
|
import { useBitzFuiCalendarStore as z } from "./BitzFuiCalendarStore.mjs";
|
|
9
9
|
r.extend(M);
|
|
10
10
|
r.extend(F);
|
|
@@ -3,7 +3,7 @@ import { useState as w, useMemo as x, useEffect as E } from "react";
|
|
|
3
3
|
import A from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/objectSupport.mjs";
|
|
4
4
|
import H from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrAfter.mjs";
|
|
5
5
|
import D from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/utc.mjs";
|
|
6
|
-
import e from "../../
|
|
6
|
+
import e from "../../_virtual/dayjs.min.mjs";
|
|
7
7
|
import "./index.less.mjs";
|
|
8
8
|
e.extend(A);
|
|
9
9
|
e.extend(H);
|
|
@@ -2,7 +2,7 @@ import { j as e } from "../../node_modules/.store/react@18.2.0/node_modules/reac
|
|
|
2
2
|
import { useMemo as d } from "react";
|
|
3
3
|
import p from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/objectSupport.mjs";
|
|
4
4
|
import T from "./BitzMeetingTimeItem.mjs";
|
|
5
|
-
import m from "../../
|
|
5
|
+
import m from "../../_virtual/dayjs.min.mjs";
|
|
6
6
|
import "./index.less.mjs";
|
|
7
7
|
m.extend(p);
|
|
8
8
|
const x = (a) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnsConfigProps, BitzTableColumnsType } from '..';
|
|
3
|
-
import { BitzTableBorderedType } from '
|
|
3
|
+
import { BitzTableBorderedType, StylesConfigScopeType } from '../../BitzConfigProvider/context';
|
|
4
4
|
export type DensitySize = 'xl' | 'lg' | 'md' | 'sm' | 'xs' | undefined;
|
|
5
5
|
export type ColumnStateType<TableKey extends string = any> = {
|
|
6
6
|
/**
|
|
@@ -26,15 +26,17 @@ export interface StylesConfigProps {
|
|
|
26
26
|
size?: DensitySize;
|
|
27
27
|
bordered?: BitzTableBorderedType;
|
|
28
28
|
zebra?: boolean;
|
|
29
|
-
|
|
29
|
+
}
|
|
30
|
+
export interface StylesConfigOnChangeValue extends StylesConfigProps {
|
|
31
|
+
stylesScope?: StylesConfigScopeType;
|
|
30
32
|
}
|
|
31
33
|
export interface StylesStateType<TableKey = any> {
|
|
32
34
|
persistenceType?: 'localStorage' | 'sessionStorage' | 'online';
|
|
33
35
|
persistenceKey?: TableKey;
|
|
34
36
|
defaultValue?: StylesConfigProps;
|
|
35
37
|
value?: StylesConfigProps;
|
|
36
|
-
onChange?: (val:
|
|
37
|
-
onlineChange?: (key: TableKey, sizeState:
|
|
38
|
+
onChange?: (val: StylesConfigOnChangeValue) => void;
|
|
39
|
+
onlineChange?: (key: TableKey, sizeState: StylesConfigOnChangeValue) => void;
|
|
38
40
|
onlineGet?: (key: TableKey) => Promise<StylesConfigProps | null | undefined>;
|
|
39
41
|
}
|
|
40
42
|
export type UseContainerProps<T = any> = {
|
|
@@ -46,15 +48,13 @@ export type UseContainerProps<T = any> = {
|
|
|
46
48
|
stylesConfigState?: StylesStateType;
|
|
47
49
|
defaultStylesConfig?: StylesConfigProps;
|
|
48
50
|
stylesConfig?: StylesConfigProps;
|
|
49
|
-
onStylesConfigChange?: (value:
|
|
51
|
+
onStylesConfigChange?: (value: StylesConfigOnChangeValue) => void;
|
|
50
52
|
size?: StylesConfigProps['size'];
|
|
51
53
|
defaultSize?: StylesConfigProps['size'];
|
|
52
54
|
zebra?: StylesConfigProps['zebra'];
|
|
53
55
|
defaultZebra?: StylesConfigProps['zebra'];
|
|
54
56
|
bordered?: BitzTableBorderedType;
|
|
55
57
|
defaultBordered?: BitzTableBorderedType;
|
|
56
|
-
scope?: boolean;
|
|
57
|
-
defaultScope?: boolean;
|
|
58
58
|
};
|
|
59
59
|
declare function useContainer(props: UseContainerProps): {
|
|
60
60
|
uuid: string;
|
|
@@ -71,7 +71,7 @@ declare function useContainer(props: UseContainerProps): {
|
|
|
71
71
|
tableSize: DensitySize;
|
|
72
72
|
stylesStorageType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
73
73
|
stylesStorageKey: any;
|
|
74
|
-
onlineStylesConfigChange: ((key: any, sizeState:
|
|
74
|
+
onlineStylesConfigChange: ((key: any, sizeState: StylesConfigOnChangeValue) => void) | undefined;
|
|
75
75
|
columns: BitzTableColumnsType<any> | undefined;
|
|
76
76
|
clearPersistenceStorage: () => void;
|
|
77
77
|
clearStylesConfigCache: () => void;
|
|
@@ -93,7 +93,7 @@ declare const BitzTableContext: import("react").Context<{
|
|
|
93
93
|
tableSize: DensitySize;
|
|
94
94
|
stylesStorageType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
95
95
|
stylesStorageKey: any;
|
|
96
|
-
onlineStylesConfigChange: ((key: any, sizeState:
|
|
96
|
+
onlineStylesConfigChange: ((key: any, sizeState: StylesConfigOnChangeValue) => void) | undefined;
|
|
97
97
|
columns: BitzTableColumnsType<any> | undefined;
|
|
98
98
|
clearPersistenceStorage: () => void;
|
|
99
99
|
clearStylesConfigCache: () => void;
|
|
@@ -1,65 +1,43 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { genColumnKey as
|
|
5
|
-
import { getUuid as
|
|
6
|
-
import { BitzConfigContext as
|
|
7
|
-
import
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
size:
|
|
12
|
-
zebra:
|
|
13
|
-
bordered:
|
|
14
|
-
|
|
15
|
-
}, [V, g] = X(
|
|
1
|
+
import { j as le } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import Q from "../../../hooks/useMergedState.mjs";
|
|
3
|
+
import { createContext as ae, useRef as W, useContext as se, useEffect as m, useMemo as ue, useCallback as X } from "react";
|
|
4
|
+
import { genColumnKey as oe } from "./utils/index.mjs";
|
|
5
|
+
import { getUuid as fe } from "../../../utils/uuid.mjs";
|
|
6
|
+
import { BitzConfigContext as re } from "../../BitzConfigProvider/context.mjs";
|
|
7
|
+
import g from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
8
|
+
function ye(e) {
|
|
9
|
+
var O, J, M, N, j, I, B, P, k, D, E, Z, R, G, U, q;
|
|
10
|
+
const C = W(fe()), h = W([]), r = se(re).Table, Y = r == null ? void 0 : r.defaultSize, b = e.defaultSize ?? Y ?? "lg", _ = r == null ? void 0 : r.zebra, $ = e.defaultZebra ?? _ ?? !0, p = r == null ? void 0 : r.bordered, ee = e.defaultBordered ?? p ?? "row-column", K = e.defaultStylesConfig || {
|
|
11
|
+
size: b,
|
|
12
|
+
zebra: $,
|
|
13
|
+
bordered: ee
|
|
14
|
+
}, [T, x] = Q(
|
|
16
15
|
() => {
|
|
17
|
-
var n,
|
|
18
|
-
const { persistenceType: t, persistenceKey: c, onlineGet:
|
|
16
|
+
var n, a, l, s;
|
|
17
|
+
const { persistenceType: t, persistenceKey: c, onlineGet: i } = e.stylesConfigState || {};
|
|
19
18
|
if (c && t && typeof window < "u" && t !== "online") {
|
|
20
19
|
const o = window[t];
|
|
21
20
|
try {
|
|
22
21
|
const u = o == null ? void 0 : o.getItem(c);
|
|
23
22
|
if (u)
|
|
24
|
-
return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ?
|
|
23
|
+
return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ? g(
|
|
25
24
|
JSON.parse(u),
|
|
26
|
-
(
|
|
25
|
+
(a = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : a.defaultValue
|
|
27
26
|
) : JSON.parse(u);
|
|
28
27
|
} catch (u) {
|
|
29
28
|
console.warn(u);
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
|
-
return e.stylesConfig || ((
|
|
31
|
+
return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) || ((s = e.stylesConfigState) == null ? void 0 : s.defaultValue) || K;
|
|
33
32
|
},
|
|
34
33
|
{
|
|
35
|
-
value: ((
|
|
34
|
+
value: ((O = e.stylesConfigState) == null ? void 0 : O.value) || e.stylesConfig,
|
|
36
35
|
onChange: ((J = e.stylesConfigState) == null ? void 0 : J.onChange) || e.onStylesConfigChange
|
|
37
36
|
}
|
|
38
37
|
);
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
if (c && t && typeof window < "u" && t !== "online") {
|
|
43
|
-
const i = window[t];
|
|
44
|
-
try {
|
|
45
|
-
const a = i == null ? void 0 : i.getItem(c);
|
|
46
|
-
a ? (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ? g(
|
|
47
|
-
d(
|
|
48
|
-
JSON.parse(a),
|
|
49
|
-
(l = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : l.defaultValue
|
|
50
|
-
)
|
|
51
|
-
) : g(JSON.parse(a)) : g(m);
|
|
52
|
-
} catch (a) {
|
|
53
|
-
console.warn(a);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, [
|
|
57
|
-
(N = e.stylesConfigState) == null ? void 0 : N.persistenceKey,
|
|
58
|
-
(I = e.stylesConfigState) == null ? void 0 : I.persistenceType,
|
|
59
|
-
m
|
|
60
|
-
]), S(() => {
|
|
61
|
-
var s, n;
|
|
62
|
-
if (!((s = e.stylesConfigState) != null && s.persistenceKey) || !((n = e.stylesConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
38
|
+
m(() => {
|
|
39
|
+
var i, n;
|
|
40
|
+
if (!((i = e.stylesConfigState) != null && i.persistenceKey) || !((n = e.stylesConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
63
41
|
return;
|
|
64
42
|
const {
|
|
65
43
|
persistenceType: t,
|
|
@@ -67,120 +45,120 @@ function ge(e) {
|
|
|
67
45
|
// onlineChange
|
|
68
46
|
} = e.stylesConfigState;
|
|
69
47
|
if (t !== "online") {
|
|
70
|
-
const
|
|
48
|
+
const a = window[t];
|
|
71
49
|
try {
|
|
72
|
-
|
|
73
|
-
} catch (
|
|
74
|
-
console.warn(
|
|
50
|
+
a == null || a.setItem(c, JSON.stringify(w));
|
|
51
|
+
} catch (l) {
|
|
52
|
+
console.warn(l), z();
|
|
75
53
|
}
|
|
76
54
|
}
|
|
77
55
|
}, [
|
|
78
56
|
(M = e.stylesConfigState) == null ? void 0 : M.persistenceKey,
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
]),
|
|
82
|
-
var t, c,
|
|
57
|
+
T,
|
|
58
|
+
(N = e.stylesConfigState) == null ? void 0 : N.persistenceType
|
|
59
|
+
]), m(() => {
|
|
60
|
+
var t, c, i;
|
|
83
61
|
if ((t = e.stylesConfigState) != null && t.persistenceKey && ((c = e.stylesConfigState) == null ? void 0 : c.persistenceType) === "online") {
|
|
84
|
-
const { onlineGet: n, persistenceKey:
|
|
62
|
+
const { onlineGet: n, persistenceKey: a } = e.stylesConfigState;
|
|
85
63
|
try {
|
|
86
|
-
(
|
|
64
|
+
(i = n == null ? void 0 : n(a)) == null || i.then((l) => {
|
|
87
65
|
var o, u;
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
(u = Object.keys(
|
|
66
|
+
const s = g(l, (o = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : o.value);
|
|
67
|
+
x(
|
|
68
|
+
(u = Object.keys(s ?? {})) != null && u.length ? s ?? {} : K
|
|
91
69
|
);
|
|
92
70
|
});
|
|
93
|
-
} catch (
|
|
94
|
-
console.warn(
|
|
71
|
+
} catch (l) {
|
|
72
|
+
console.warn(l);
|
|
95
73
|
}
|
|
96
74
|
}
|
|
97
75
|
}, []);
|
|
98
|
-
const
|
|
99
|
-
var
|
|
100
|
-
if ((
|
|
76
|
+
const d = ue(() => {
|
|
77
|
+
var l, s, o, u, A, F, H;
|
|
78
|
+
if ((l = e == null ? void 0 : e.columnsState) != null && l.defaultValue)
|
|
101
79
|
return e.columnsState.defaultValue;
|
|
102
|
-
const t = ((o = (
|
|
80
|
+
const t = ((o = (s = e.columns) == null ? void 0 : s.filter((f) => f.fixed === "left")) == null ? void 0 : o.map((f, y) => ({ ...f, order: y }))) ?? [], c = ((A = (u = e.columns) == null ? void 0 : u.filter((f) => f.fixed === "right")) == null ? void 0 : A.map((f, y) => ({ ...f, order: y }))) ?? [], i = ((H = (F = e.columns) == null ? void 0 : F.filter((f) => !["left", "right"].includes(f.fixed))) == null ? void 0 : H.map((f, y) => ({ ...f, order: y }))) ?? [], n = [...t, ...i, ...c], a = {};
|
|
103
81
|
return n == null || n.forEach(
|
|
104
|
-
({ key: f, dataIndex:
|
|
105
|
-
const
|
|
106
|
-
|
|
82
|
+
({ key: f, dataIndex: y, order: te, fixed: ne, disabled: ce }, ie) => {
|
|
83
|
+
const L = oe(f ?? y, ie);
|
|
84
|
+
L && (a[L] = {
|
|
107
85
|
show: !0,
|
|
108
|
-
order:
|
|
109
|
-
fixed:
|
|
110
|
-
disabled:
|
|
86
|
+
order: te,
|
|
87
|
+
fixed: ne,
|
|
88
|
+
disabled: ce
|
|
111
89
|
});
|
|
112
90
|
}
|
|
113
|
-
),
|
|
114
|
-
}, [e.columns]), [
|
|
91
|
+
), a;
|
|
92
|
+
}, [e.columns]), [w, S] = Q(
|
|
115
93
|
() => {
|
|
116
|
-
var n,
|
|
117
|
-
const { persistenceType: t, persistenceKey: c, onlineGet:
|
|
94
|
+
var n, a, l, s;
|
|
95
|
+
const { persistenceType: t, persistenceKey: c, onlineGet: i } = e.columnsState || {};
|
|
118
96
|
if (c && t && typeof window < "u" && t !== "online") {
|
|
119
97
|
const o = window[t];
|
|
120
98
|
try {
|
|
121
99
|
const u = o == null ? void 0 : o.getItem(c);
|
|
122
100
|
if (u)
|
|
123
|
-
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ?
|
|
101
|
+
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? g(
|
|
124
102
|
JSON.parse(u),
|
|
125
|
-
(
|
|
103
|
+
(a = e == null ? void 0 : e.columnsState) == null ? void 0 : a.defaultValue
|
|
126
104
|
) : JSON.parse(u);
|
|
127
105
|
} catch (u) {
|
|
128
106
|
console.warn(u);
|
|
129
107
|
}
|
|
130
108
|
}
|
|
131
|
-
return e.columnsStateMap || ((
|
|
109
|
+
return e.columnsStateMap || ((l = e.columnsState) == null ? void 0 : l.value) || ((s = e.columnsState) == null ? void 0 : s.defaultValue) || d;
|
|
132
110
|
},
|
|
133
111
|
{
|
|
134
|
-
value: ((
|
|
135
|
-
onChange: ((
|
|
112
|
+
value: ((j = e.columnsState) == null ? void 0 : j.value) || e.columnsStateMap,
|
|
113
|
+
onChange: ((I = e.columnsState) == null ? void 0 : I.onChange) || e.onColumnsStateChange
|
|
136
114
|
}
|
|
137
115
|
);
|
|
138
|
-
|
|
139
|
-
var n,
|
|
140
|
-
const { persistenceType: t, persistenceKey: c, onlineGet:
|
|
116
|
+
m(() => {
|
|
117
|
+
var n, a;
|
|
118
|
+
const { persistenceType: t, persistenceKey: c, onlineGet: i } = e.columnsState || {};
|
|
141
119
|
if (c && t && typeof window < "u" && t !== "online") {
|
|
142
|
-
const
|
|
120
|
+
const l = window[t];
|
|
143
121
|
try {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
JSON.parse(
|
|
148
|
-
(
|
|
122
|
+
const s = l == null ? void 0 : l.getItem(c);
|
|
123
|
+
s ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? S(
|
|
124
|
+
g(
|
|
125
|
+
JSON.parse(s),
|
|
126
|
+
(a = e == null ? void 0 : e.columnsState) == null ? void 0 : a.defaultValue
|
|
149
127
|
)
|
|
150
|
-
) :
|
|
151
|
-
} catch (
|
|
152
|
-
console.warn(
|
|
128
|
+
) : S(JSON.parse(s)) : S(d);
|
|
129
|
+
} catch (s) {
|
|
130
|
+
console.warn(s);
|
|
153
131
|
}
|
|
154
132
|
}
|
|
155
133
|
}, [
|
|
156
|
-
(
|
|
157
|
-
(
|
|
158
|
-
|
|
134
|
+
(B = e.columnsState) == null ? void 0 : B.persistenceKey,
|
|
135
|
+
(P = e.columnsState) == null ? void 0 : P.persistenceType,
|
|
136
|
+
d
|
|
159
137
|
]);
|
|
160
|
-
const
|
|
138
|
+
const v = X(() => {
|
|
161
139
|
const { persistenceType: t, persistenceKey: c } = e.columnsState || {};
|
|
162
140
|
if (!c || !t || typeof window > "u")
|
|
163
141
|
return;
|
|
164
|
-
const
|
|
142
|
+
const i = window[t];
|
|
165
143
|
try {
|
|
166
|
-
|
|
144
|
+
i == null || i.removeItem(c);
|
|
167
145
|
} catch (n) {
|
|
168
146
|
console.warn(n);
|
|
169
147
|
}
|
|
170
|
-
}, [e.columnsState]),
|
|
148
|
+
}, [e.columnsState]), z = X(() => {
|
|
171
149
|
const { persistenceType: t, persistenceKey: c } = e.stylesConfigState || {};
|
|
172
150
|
if (!c || !t || typeof window > "u")
|
|
173
151
|
return;
|
|
174
|
-
const
|
|
152
|
+
const i = window[t];
|
|
175
153
|
try {
|
|
176
|
-
|
|
154
|
+
i == null || i.removeItem(c);
|
|
177
155
|
} catch (n) {
|
|
178
156
|
console.warn(n);
|
|
179
157
|
}
|
|
180
158
|
}, [e.stylesConfigState]);
|
|
181
|
-
|
|
182
|
-
var
|
|
183
|
-
if (!((
|
|
159
|
+
m(() => {
|
|
160
|
+
var i, n;
|
|
161
|
+
if (!((i = e.columnsState) != null && i.persistenceKey) || !((n = e.columnsState) != null && n.persistenceType) || typeof window > "u")
|
|
184
162
|
return;
|
|
185
163
|
const {
|
|
186
164
|
persistenceType: t,
|
|
@@ -188,69 +166,69 @@ function ge(e) {
|
|
|
188
166
|
// onlineChange
|
|
189
167
|
} = e.columnsState;
|
|
190
168
|
if (t !== "online") {
|
|
191
|
-
const
|
|
169
|
+
const a = window[t];
|
|
192
170
|
try {
|
|
193
|
-
|
|
194
|
-
} catch (
|
|
195
|
-
console.warn(
|
|
171
|
+
a == null || a.setItem(c, JSON.stringify(w));
|
|
172
|
+
} catch (l) {
|
|
173
|
+
console.warn(l), v();
|
|
196
174
|
}
|
|
197
175
|
}
|
|
198
176
|
}, [
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
(
|
|
202
|
-
]),
|
|
203
|
-
var t, c,
|
|
177
|
+
(k = e.columnsState) == null ? void 0 : k.persistenceKey,
|
|
178
|
+
w,
|
|
179
|
+
(D = e.columnsState) == null ? void 0 : D.persistenceType
|
|
180
|
+
]), m(() => {
|
|
181
|
+
var t, c, i;
|
|
204
182
|
if ((t = e.columnsState) != null && t.persistenceKey && ((c = e.columnsState) == null ? void 0 : c.persistenceType) === "online") {
|
|
205
|
-
const { onlineGet: n, persistenceKey:
|
|
183
|
+
const { onlineGet: n, persistenceKey: a } = e.columnsState;
|
|
206
184
|
try {
|
|
207
|
-
(
|
|
185
|
+
(i = n == null ? void 0 : n(a)) == null || i.then((l) => {
|
|
208
186
|
var o, u;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
(u = Object.keys(
|
|
187
|
+
const s = g(l, (o = e == null ? void 0 : e.columnsState) == null ? void 0 : o.value);
|
|
188
|
+
S(
|
|
189
|
+
(u = Object.keys(s ?? {})) != null && u.length ? s ?? {} : d
|
|
212
190
|
);
|
|
213
191
|
});
|
|
214
|
-
} catch (
|
|
215
|
-
console.warn(
|
|
192
|
+
} catch (l) {
|
|
193
|
+
console.warn(l);
|
|
216
194
|
}
|
|
217
195
|
}
|
|
218
196
|
}, []);
|
|
219
|
-
const
|
|
220
|
-
uuid:
|
|
221
|
-
persistenceType: (
|
|
222
|
-
persistenceKey: (
|
|
223
|
-
onlineChange: (
|
|
224
|
-
sortKeyColumns:
|
|
197
|
+
const V = {
|
|
198
|
+
uuid: C.current,
|
|
199
|
+
persistenceType: (E = e.columnsState) == null ? void 0 : E.persistenceType,
|
|
200
|
+
persistenceKey: (Z = e.columnsState) == null ? void 0 : Z.persistenceKey,
|
|
201
|
+
onlineChange: (R = e.columnsState) == null ? void 0 : R.onlineChange,
|
|
202
|
+
sortKeyColumns: h.current,
|
|
225
203
|
setSortKeyColumns: (t) => {
|
|
226
|
-
|
|
204
|
+
h.current = t;
|
|
227
205
|
},
|
|
228
|
-
columnsMap:
|
|
229
|
-
setColumnsMap:
|
|
230
|
-
stylesConfig:
|
|
231
|
-
setTableStylesConfig:
|
|
232
|
-
defaultTableSize:
|
|
233
|
-
tableSize:
|
|
234
|
-
stylesStorageType: (
|
|
235
|
-
stylesStorageKey: (
|
|
236
|
-
onlineStylesConfigChange: (
|
|
206
|
+
columnsMap: w,
|
|
207
|
+
setColumnsMap: S,
|
|
208
|
+
stylesConfig: T,
|
|
209
|
+
setTableStylesConfig: x,
|
|
210
|
+
defaultTableSize: b,
|
|
211
|
+
tableSize: T.size,
|
|
212
|
+
stylesStorageType: (G = e.stylesConfigState) == null ? void 0 : G.persistenceType,
|
|
213
|
+
stylesStorageKey: (U = e.stylesConfigState) == null ? void 0 : U.persistenceKey,
|
|
214
|
+
onlineStylesConfigChange: (q = e.stylesConfigState) == null ? void 0 : q.onlineChange,
|
|
237
215
|
columns: e.columns,
|
|
238
|
-
clearPersistenceStorage:
|
|
239
|
-
clearStylesConfigCache:
|
|
240
|
-
defaultTableStylesConfig:
|
|
241
|
-
defaultColumnKeyMap:
|
|
216
|
+
clearPersistenceStorage: v,
|
|
217
|
+
clearStylesConfigCache: z,
|
|
218
|
+
defaultTableStylesConfig: K,
|
|
219
|
+
defaultColumnKeyMap: d
|
|
242
220
|
};
|
|
243
|
-
return Object.defineProperty(
|
|
244
|
-
get: () => T.current
|
|
245
|
-
}), Object.defineProperty(x, "uuid", {
|
|
221
|
+
return Object.defineProperty(V, "sortKeyColumns", {
|
|
246
222
|
get: () => h.current
|
|
247
|
-
}),
|
|
223
|
+
}), Object.defineProperty(V, "uuid", {
|
|
224
|
+
get: () => C.current
|
|
225
|
+
}), V;
|
|
248
226
|
}
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
return /* @__PURE__ */
|
|
227
|
+
const de = ae({}), Te = (e) => {
|
|
228
|
+
const C = ye(e.initValue);
|
|
229
|
+
return /* @__PURE__ */ le.jsx(de.Provider, { value: C, children: e.children });
|
|
252
230
|
};
|
|
253
231
|
export {
|
|
254
|
-
|
|
255
|
-
|
|
232
|
+
de as BitzTableContext,
|
|
233
|
+
Te as default
|
|
256
234
|
};
|