bitz-react-admin-ui 2.0.1 → 2.0.2

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.
Files changed (28) hide show
  1. package/dist/_virtual/dayjs.min.mjs +5 -2
  2. package/dist/_virtual/dayjs.min2.mjs +4 -0
  3. package/dist/components/BitzCalendar/index.mjs +1 -1
  4. package/dist/components/BitzConfigProvider/context.d.ts +0 -2
  5. package/dist/components/BitzDayJs/index.mjs +1 -1
  6. package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
  7. package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
  8. package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
  9. package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
  10. package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
  11. package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
  12. package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
  13. package/dist/components/BitzMeetingTime/index.mjs +1 -1
  14. package/dist/components/BitzTable/Store/index.d.ts +5 -3
  15. package/dist/components/BitzTable/Store/index.mjs +127 -147
  16. package/dist/components/BitzTable/Table/index.d.ts +1 -1
  17. package/dist/components/BitzTable/Table/index.mjs +30 -24
  18. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +41 -39
  19. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +41 -41
  20. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +4 -3
  21. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +17 -17
  22. package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +2 -2
  23. package/dist/components/BitzTable/ToolBar/index.mjs +4 -4
  24. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
  25. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
  26. package/dist/style.css +1 -1
  27. package/dist/utils/time.mjs +1 -1
  28. package/package.json +1 -1
@@ -1,4 +1,7 @@
1
- var a = { exports: {} };
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
- a as __module
6
+ s as default
4
7
  };
@@ -0,0 +1,4 @@
1
+ var a = { exports: {} };
2
+ export {
3
+ a as __module
4
+ };
@@ -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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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);
@@ -16,8 +16,6 @@ export interface TableComponentContextProps {
16
16
  defaultSize?: DensitySize;
17
17
  /** 是否开启斑马纹,填充偶数行背景色 */
18
18
  zebra?: boolean;
19
- /** 外观配置作用域 */
20
- scope?: boolean;
21
19
  /** 是否开启rowHover样式 */
22
20
  rowHoverable?: boolean;
23
21
  /** 根据从左到右方向排序,不在数组中则不显示 */
@@ -1,4 +1,4 @@
1
- import t from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
1
+ import t from "../../_virtual/dayjs.min.mjs";
2
2
  import "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs";
3
3
  const m = {
4
4
  dayjs() {
@@ -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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
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 "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
5
+ import m from "../../_virtual/dayjs.min.mjs";
6
6
  import "./index.less.mjs";
7
7
  m.extend(p);
8
8
  const x = (a) => {
@@ -26,8 +26,8 @@ export interface StylesConfigProps {
26
26
  size?: DensitySize;
27
27
  bordered?: BitzTableBorderedType;
28
28
  zebra?: boolean;
29
- scope?: boolean;
30
29
  }
30
+ export type StylesConfigScopeType = 'current' | 'global';
31
31
  export interface StylesStateType<TableKey = any> {
32
32
  persistenceType?: 'localStorage' | 'sessionStorage' | 'online';
33
33
  persistenceKey?: TableKey;
@@ -53,8 +53,6 @@ export type UseContainerProps<T = any> = {
53
53
  defaultZebra?: StylesConfigProps['zebra'];
54
54
  bordered?: BitzTableBorderedType;
55
55
  defaultBordered?: BitzTableBorderedType;
56
- scope?: boolean;
57
- defaultScope?: boolean;
58
56
  };
59
57
  declare function useContainer(props: UseContainerProps): {
60
58
  uuid: string;
@@ -65,6 +63,8 @@ declare function useContainer(props: UseContainerProps): {
65
63
  setSortKeyColumns: (keys: string[]) => void;
66
64
  columnsMap: Record<string, ColumnsConfigProps>;
67
65
  setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
66
+ scope: StylesConfigScopeType;
67
+ setScope: import("react").Dispatch<import("react").SetStateAction<StylesConfigScopeType>>;
68
68
  stylesConfig: StylesConfigProps;
69
69
  setTableStylesConfig: (updater: StylesConfigProps | ((origin: StylesConfigProps) => StylesConfigProps), ignoreDestroy?: boolean | undefined) => void;
70
70
  defaultTableSize: "xl" | "lg" | "md" | "sm" | "xs";
@@ -87,6 +87,8 @@ declare const BitzTableContext: import("react").Context<{
87
87
  setSortKeyColumns: (keys: string[]) => void;
88
88
  columnsMap: Record<string, ColumnsConfigProps>;
89
89
  setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
90
+ scope: StylesConfigScopeType;
91
+ setScope: import("react").Dispatch<import("react").SetStateAction<StylesConfigScopeType>>;
90
92
  stylesConfig: StylesConfigProps;
91
93
  setTableStylesConfig: (updater: StylesConfigProps | ((origin: StylesConfigProps) => StylesConfigProps), ignoreDestroy?: boolean | undefined) => void;
92
94
  defaultTableSize: "xl" | "lg" | "md" | "sm" | "xs";
@@ -1,65 +1,43 @@
1
- import { j as oe } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import X from "../../../hooks/useMergedState.mjs";
3
- import { createContext as fe, useRef as Y, useContext as ye, useEffect as S, useMemo as re, useCallback as _ } from "react";
4
- import { genColumnKey as Se } from "./utils/index.mjs";
1
+ import { j as se } 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 ue, useRef as W, useContext as oe, useState as fe, useEffect as m, useMemo as re, useCallback as X } from "react";
4
+ import { genColumnKey as ye } from "./utils/index.mjs";
5
5
  import { getUuid as de } from "../../../utils/uuid.mjs";
6
- import { BitzConfigContext as me } from "../../BitzConfigProvider/context.mjs";
7
- import d from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
8
- function ge(e) {
9
- var z, J, N, I, M, j, B, D, P, k, E, Z, G, R, U, q, A, F;
10
- const h = Y(de()), T = Y([]), y = ye(me).Table, $ = y == null ? void 0 : y.defaultSize, O = e.defaultSize ?? $ ?? "lg", p = y == null ? void 0 : y.zebra, ee = e.defaultZebra ?? p ?? !0, te = y == null ? void 0 : y.bordered, ne = e.defaultBordered ?? te ?? "row-column", ce = y == null ? void 0 : y.scope, ie = e.defaultScope ?? ce ?? !1, m = e.defaultStylesConfig || {
11
- size: O,
12
- zebra: ee,
13
- bordered: ne,
14
- scope: ie
15
- }, [V, g] = X(
6
+ import { BitzConfigContext as Se } from "../../BitzConfigProvider/context.mjs";
7
+ import g from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
8
+ function me(e) {
9
+ var O, J, M, N, j, I, B, P, k, D, E, Z, R, G, U, q;
10
+ const C = W(de()), h = W([]), r = oe(Se).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
+ }, [te, ne] = fe("current"), [T, x] = Q(
16
15
  () => {
17
- var n, l, i, a;
18
- const { persistenceType: t, persistenceKey: c, onlineGet: s } = e.stylesConfigState || {};
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 ? d(
23
+ return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ? g(
25
24
  JSON.parse(u),
26
- (l = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : l.defaultValue
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 || ((i = e.stylesConfigState) == null ? void 0 : i.value) || ((a = e.stylesConfigState) == null ? void 0 : a.defaultValue) || m;
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: ((z = e.stylesConfigState) == null ? void 0 : z.value) || e.stylesConfig,
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
- S(() => {
40
- var n, l;
41
- const { persistenceType: t, persistenceKey: c, onlineGet: s } = e.stylesConfigState || {};
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 l = window[t];
48
+ const a = window[t];
71
49
  try {
72
- l == null || l.setItem(c, JSON.stringify(K));
73
- } catch (i) {
74
- console.warn(i), v();
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
- V,
80
- (j = e.stylesConfigState) == null ? void 0 : j.persistenceType
81
- ]), S(() => {
82
- var t, c, s;
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: l } = e.stylesConfigState;
62
+ const { onlineGet: n, persistenceKey: a } = e.stylesConfigState;
85
63
  try {
86
- (s = n == null ? void 0 : n(l)) == null || s.then((i) => {
64
+ (i = n == null ? void 0 : n(a)) == null || i.then((l) => {
87
65
  var o, u;
88
- const a = d(i, (o = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : o.value);
89
- g(
90
- (u = Object.keys(a ?? {})) != null && u.length ? a ?? {} : m
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 (i) {
94
- console.warn(i);
71
+ } catch (l) {
72
+ console.warn(l);
95
73
  }
96
74
  }
97
75
  }, []);
98
- const C = re(() => {
99
- var i, a, o, u, H, L, Q;
100
- if ((i = e == null ? void 0 : e.columnsState) != null && i.defaultValue)
76
+ const d = re(() => {
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 = (a = e.columns) == null ? void 0 : a.filter((f) => f.fixed === "left")) == null ? void 0 : o.map((f, r) => ({ ...f, order: r }))) ?? [], c = ((H = (u = e.columns) == null ? void 0 : u.filter((f) => f.fixed === "right")) == null ? void 0 : H.map((f, r) => ({ ...f, order: r }))) ?? [], s = ((Q = (L = e.columns) == null ? void 0 : L.filter((f) => !["left", "right"].includes(f.fixed))) == null ? void 0 : Q.map((f, r) => ({ ...f, order: r }))) ?? [], n = [...t, ...s, ...c], l = {};
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: r, order: le, fixed: ae, disabled: se }, ue) => {
105
- const W = Se(f ?? r, ue);
106
- W && (l[W] = {
82
+ ({ key: f, dataIndex: y, order: ce, fixed: ie, disabled: le }, ae) => {
83
+ const L = ye(f ?? y, ae);
84
+ L && (a[L] = {
107
85
  show: !0,
108
- order: le,
109
- fixed: ae,
110
- disabled: se
86
+ order: ce,
87
+ fixed: ie,
88
+ disabled: le
111
89
  });
112
90
  }
113
- ), l;
114
- }, [e.columns]), [K, w] = X(
91
+ ), a;
92
+ }, [e.columns]), [w, S] = Q(
115
93
  () => {
116
- var n, l, i, a;
117
- const { persistenceType: t, persistenceKey: c, onlineGet: s } = e.columnsState || {};
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 ? d(
101
+ return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? g(
124
102
  JSON.parse(u),
125
- (l = e == null ? void 0 : e.columnsState) == null ? void 0 : l.defaultValue
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 || ((i = e.columnsState) == null ? void 0 : i.value) || ((a = e.columnsState) == null ? void 0 : a.defaultValue) || C;
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: ((B = e.columnsState) == null ? void 0 : B.value) || e.columnsStateMap,
135
- onChange: ((D = e.columnsState) == null ? void 0 : D.onChange) || e.onColumnsStateChange
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
- S(() => {
139
- var n, l;
140
- const { persistenceType: t, persistenceKey: c, onlineGet: s } = e.columnsState || {};
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 i = window[t];
120
+ const l = window[t];
143
121
  try {
144
- const a = i == null ? void 0 : i.getItem(c);
145
- a ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? w(
146
- d(
147
- JSON.parse(a),
148
- (l = e == null ? void 0 : e.columnsState) == null ? void 0 : l.defaultValue
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
- ) : w(JSON.parse(a)) : w(C);
151
- } catch (a) {
152
- console.warn(a);
128
+ ) : S(JSON.parse(s)) : S(d);
129
+ } catch (s) {
130
+ console.warn(s);
153
131
  }
154
132
  }
155
133
  }, [
156
- (P = e.columnsState) == null ? void 0 : P.persistenceKey,
157
- (k = e.columnsState) == null ? void 0 : k.persistenceType,
158
- C
134
+ (B = e.columnsState) == null ? void 0 : B.persistenceKey,
135
+ (P = e.columnsState) == null ? void 0 : P.persistenceType,
136
+ d
159
137
  ]);
160
- const b = _(() => {
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 s = window[t];
142
+ const i = window[t];
165
143
  try {
166
- s == null || s.removeItem(c);
144
+ i == null || i.removeItem(c);
167
145
  } catch (n) {
168
146
  console.warn(n);
169
147
  }
170
- }, [e.columnsState]), v = _(() => {
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 s = window[t];
152
+ const i = window[t];
175
153
  try {
176
- s == null || s.removeItem(c);
154
+ i == null || i.removeItem(c);
177
155
  } catch (n) {
178
156
  console.warn(n);
179
157
  }
180
158
  }, [e.stylesConfigState]);
181
- S(() => {
182
- var s, n;
183
- if (!((s = e.columnsState) != null && s.persistenceKey) || !((n = e.columnsState) != null && n.persistenceType) || typeof window > "u")
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,71 @@ function ge(e) {
188
166
  // onlineChange
189
167
  } = e.columnsState;
190
168
  if (t !== "online") {
191
- const l = window[t];
169
+ const a = window[t];
192
170
  try {
193
- l == null || l.setItem(c, JSON.stringify(K));
194
- } catch (i) {
195
- console.warn(i), b();
171
+ a == null || a.setItem(c, JSON.stringify(w));
172
+ } catch (l) {
173
+ console.warn(l), v();
196
174
  }
197
175
  }
198
176
  }, [
199
- (E = e.columnsState) == null ? void 0 : E.persistenceKey,
200
- K,
201
- (Z = e.columnsState) == null ? void 0 : Z.persistenceType
202
- ]), S(() => {
203
- var t, c, s;
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: l } = e.columnsState;
183
+ const { onlineGet: n, persistenceKey: a } = e.columnsState;
206
184
  try {
207
- (s = n == null ? void 0 : n(l)) == null || s.then((i) => {
185
+ (i = n == null ? void 0 : n(a)) == null || i.then((l) => {
208
186
  var o, u;
209
- const a = d(i, (o = e == null ? void 0 : e.columnsState) == null ? void 0 : o.value);
210
- w(
211
- (u = Object.keys(a ?? {})) != null && u.length ? a ?? {} : C
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 (i) {
215
- console.warn(i);
192
+ } catch (l) {
193
+ console.warn(l);
216
194
  }
217
195
  }
218
196
  }, []);
219
- const x = {
220
- uuid: h.current,
221
- persistenceType: (G = e.columnsState) == null ? void 0 : G.persistenceType,
222
- persistenceKey: (R = e.columnsState) == null ? void 0 : R.persistenceKey,
223
- onlineChange: (U = e.columnsState) == null ? void 0 : U.onlineChange,
224
- sortKeyColumns: T.current,
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
- T.current = t;
204
+ h.current = t;
227
205
  },
228
- columnsMap: K,
229
- setColumnsMap: w,
230
- stylesConfig: V,
231
- setTableStylesConfig: g,
232
- defaultTableSize: O,
233
- tableSize: V.size,
234
- stylesStorageType: (q = e.stylesConfigState) == null ? void 0 : q.persistenceType,
235
- stylesStorageKey: (A = e.stylesConfigState) == null ? void 0 : A.persistenceKey,
236
- onlineStylesConfigChange: (F = e.stylesConfigState) == null ? void 0 : F.onlineChange,
206
+ columnsMap: w,
207
+ setColumnsMap: S,
208
+ scope: te,
209
+ setScope: ne,
210
+ stylesConfig: T,
211
+ setTableStylesConfig: x,
212
+ defaultTableSize: b,
213
+ tableSize: T.size,
214
+ stylesStorageType: (G = e.stylesConfigState) == null ? void 0 : G.persistenceType,
215
+ stylesStorageKey: (U = e.stylesConfigState) == null ? void 0 : U.persistenceKey,
216
+ onlineStylesConfigChange: (q = e.stylesConfigState) == null ? void 0 : q.onlineChange,
237
217
  columns: e.columns,
238
- clearPersistenceStorage: b,
239
- clearStylesConfigCache: v,
240
- defaultTableStylesConfig: m,
241
- defaultColumnKeyMap: C
218
+ clearPersistenceStorage: v,
219
+ clearStylesConfigCache: z,
220
+ defaultTableStylesConfig: K,
221
+ defaultColumnKeyMap: d
242
222
  };
243
- return Object.defineProperty(x, "sortKeyColumns", {
244
- get: () => T.current
245
- }), Object.defineProperty(x, "uuid", {
223
+ return Object.defineProperty(V, "sortKeyColumns", {
246
224
  get: () => h.current
247
- }), x;
225
+ }), Object.defineProperty(V, "uuid", {
226
+ get: () => C.current
227
+ }), V;
248
228
  }
249
- const Ce = fe({}), be = (e) => {
250
- const h = ge(e.initValue);
251
- return /* @__PURE__ */ oe.jsx(Ce.Provider, { value: h, children: e.children });
229
+ const ge = ue({}), xe = (e) => {
230
+ const C = me(e.initValue);
231
+ return /* @__PURE__ */ se.jsx(ge.Provider, { value: C, children: e.children });
252
232
  };
253
233
  export {
254
- Ce as BitzTableContext,
255
- be as default
234
+ ge as BitzTableContext,
235
+ xe as default
256
236
  };
@@ -19,7 +19,7 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
19
19
  /** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
20
20
  height?: number;
21
21
  /** table可滚动区域的最大宽高的值 */
22
- scroll: {
22
+ scroll?: {
23
23
  x?: number;
24
24
  y?: number;
25
25
  };