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.
Files changed (29) 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 +6 -3
  5. package/dist/components/BitzConfigProvider/index.mjs +22 -9
  6. package/dist/components/BitzDayJs/index.mjs +1 -1
  7. package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
  8. package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
  9. package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
  10. package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
  11. package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
  12. package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
  13. package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
  14. package/dist/components/BitzMeetingTime/index.mjs +1 -1
  15. package/dist/components/BitzTable/Store/index.d.ts +9 -9
  16. package/dist/components/BitzTable/Store/index.mjs +126 -148
  17. package/dist/components/BitzTable/Table/index.d.ts +1 -1
  18. package/dist/components/BitzTable/Table/index.mjs +30 -24
  19. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +53 -51
  20. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +67 -65
  21. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +4 -3
  22. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +17 -17
  23. package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +32 -32
  24. package/dist/components/BitzTable/ToolBar/index.mjs +4 -4
  25. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
  26. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
  27. package/dist/style.css +1 -1
  28. package/dist/utils/time.mjs +1 -1
  29. 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);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DensitySize } from '../BitzTable/Store';
3
- export type ToolEnum = 'export' | 'refresh' | 'fullscreen' | 'stylesConfig';
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 r } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { ConfigProvider as e } from "antd";
3
- import { BitzConfigContext as n } from "./context.mjs";
4
- const x = ({
5
- children: o,
6
- context: i,
7
- ...t
8
- }) => /* @__PURE__ */ r.jsx(e, { ...t, children: /* @__PURE__ */ r.jsx(n.Provider, { value: i ?? {}, children: o }) });
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
- x as default
23
+ v as default
11
24
  };
@@ -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) => {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ColumnsConfigProps, BitzTableColumnsType } from '..';
3
- import { BitzTableBorderedType } from '@/components/BitzConfigProvider/context';
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
- scope?: boolean;
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: StylesConfigProps) => void;
37
- onlineChange?: (key: TableKey, sizeState: StylesConfigProps) => void;
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: StylesConfigProps) => void;
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: StylesConfigProps) => void) | undefined;
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: StylesConfigProps) => void) | undefined;
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 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";
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(
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, 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 = 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 = (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: te, fixed: ne, disabled: ce }, ie) => {
83
+ const L = oe(f ?? y, ie);
84
+ L && (a[L] = {
107
85
  show: !0,
108
- order: le,
109
- fixed: ae,
110
- disabled: se
86
+ order: te,
87
+ fixed: ne,
88
+ disabled: ce
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,69 @@ 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
+ 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: b,
239
- clearStylesConfigCache: v,
240
- defaultTableStylesConfig: m,
241
- defaultColumnKeyMap: C
216
+ clearPersistenceStorage: v,
217
+ clearStylesConfigCache: z,
218
+ defaultTableStylesConfig: K,
219
+ defaultColumnKeyMap: d
242
220
  };
243
- return Object.defineProperty(x, "sortKeyColumns", {
244
- get: () => T.current
245
- }), Object.defineProperty(x, "uuid", {
221
+ return Object.defineProperty(V, "sortKeyColumns", {
246
222
  get: () => h.current
247
- }), x;
223
+ }), Object.defineProperty(V, "uuid", {
224
+ get: () => C.current
225
+ }), V;
248
226
  }
249
- const Ce = fe({}), be = (e) => {
250
- const h = ge(e.initValue);
251
- return /* @__PURE__ */ oe.jsx(Ce.Provider, { value: h, children: e.children });
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
- Ce as BitzTableContext,
255
- be as default
232
+ de as BitzTableContext,
233
+ Te as default
256
234
  };