@creekjs/web-components 1.0.13 → 1.0.15

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 (78) hide show
  1. package/.turbo/turbo-father$colon$build.log +34 -34
  2. package/dist/creek-config-provider/index.js +13 -13
  3. package/dist/creek-config-provider/index.js.map +3 -3
  4. package/dist/creek-keep-alive/index.d.ts +0 -4
  5. package/dist/creek-keep-alive/index.js +13 -8
  6. package/dist/creek-keep-alive/index.js.map +2 -2
  7. package/dist/creek-layout/ActionRender/LayoutSettings.d.ts +2 -1
  8. package/dist/creek-layout/ActionRender/LayoutSettings.js +7 -6
  9. package/dist/creek-layout/ActionRender/LayoutSettings.js.map +2 -2
  10. package/dist/creek-layout/index.d.ts +1 -0
  11. package/dist/creek-layout/index.js +5 -4
  12. package/dist/creek-layout/index.js.map +2 -2
  13. package/dist/creek-layout/useLayoutSettingsStore.d.ts +2 -2
  14. package/dist/creek-layout/useLayoutSettingsStore.js +11 -4
  15. package/dist/creek-layout/useLayoutSettingsStore.js.map +2 -2
  16. package/dist/creek-table/SearchTable.js +18 -0
  17. package/dist/creek-table/SearchTable.js.map +2 -2
  18. package/dist/creek-table/components/EllipsisTooltip.js +6 -2
  19. package/dist/creek-table/components/EllipsisTooltip.js.map +2 -2
  20. package/dist/creek-table/hooks/useEllipsisColumns.js +3 -0
  21. package/dist/creek-table/hooks/useEllipsisColumns.js.map +2 -2
  22. package/dist/creek-table/hooks/useIndexColumn.js +1 -1
  23. package/dist/creek-table/hooks/useIndexColumn.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/creek-config-provider/index.tsx +16 -15
  26. package/src/creek-keep-alive/index.tsx +15 -12
  27. package/src/creek-layout/ActionRender/LayoutSettings.tsx +30 -20
  28. package/src/creek-layout/index.tsx +6 -4
  29. package/src/creek-layout/useLayoutSettingsStore.ts +12 -3
  30. package/src/creek-table/SearchTable.tsx +22 -1
  31. package/src/creek-table/components/EllipsisTooltip.tsx +6 -2
  32. package/src/creek-table/hooks/useEllipsisColumns.tsx +5 -0
  33. package/src/creek-table/hooks/useIndexColumn.tsx +1 -1
  34. package/dist/creek-config-provider/CreekConfigContext.d.ts.map +0 -1
  35. package/dist/creek-config-provider/CreekI18nProvider.d.ts.map +0 -1
  36. package/dist/creek-config-provider/index.d.ts.map +0 -1
  37. package/dist/creek-hooks/index.d.ts.map +0 -1
  38. package/dist/creek-hooks/useApp/DrawerHelper.d.ts.map +0 -1
  39. package/dist/creek-hooks/useApp/ModalHelper.d.ts.map +0 -1
  40. package/dist/creek-hooks/useApp/index.d.ts.map +0 -1
  41. package/dist/creek-hooks/useApp/types.d.ts.map +0 -1
  42. package/dist/creek-hooks/useViewportHeight.d.ts.map +0 -1
  43. package/dist/creek-icon/index.d.ts.map +0 -1
  44. package/dist/creek-keep-alive/index.d.ts.map +0 -1
  45. package/dist/creek-layout/ActionRender/FullScreen.d.ts.map +0 -1
  46. package/dist/creek-layout/ActionRender/LayoutSettings.d.ts.map +0 -1
  47. package/dist/creek-layout/ActionRender/UserInfo.d.ts.map +0 -1
  48. package/dist/creek-layout/ActionRender/index.d.ts.map +0 -1
  49. package/dist/creek-layout/CollapseButton.d.ts.map +0 -1
  50. package/dist/creek-layout/Exception/NotFound.d.ts.map +0 -1
  51. package/dist/creek-layout/Exception/NotFoundPage.d.ts.map +0 -1
  52. package/dist/creek-layout/Exception/index.d.ts.map +0 -1
  53. package/dist/creek-layout/index.d.ts.map +0 -1
  54. package/dist/creek-layout/useLayoutSettingsStore.d.ts.map +0 -1
  55. package/dist/creek-loading/index.d.ts.map +0 -1
  56. package/dist/creek-locale-button/index.d.ts.map +0 -1
  57. package/dist/creek-page-container/index.d.ts.map +0 -1
  58. package/dist/creek-style/index.d.ts.map +0 -1
  59. package/dist/creek-style/scrollbar.d.ts.map +0 -1
  60. package/dist/creek-table/SearchTable.d.ts.map +0 -1
  61. package/dist/creek-table/components/DensityIcon.d.ts.map +0 -1
  62. package/dist/creek-table/components/EllipsisTooltip.d.ts.map +0 -1
  63. package/dist/creek-table/components/index.d.ts.map +0 -1
  64. package/dist/creek-table/hooks/index.d.ts.map +0 -1
  65. package/dist/creek-table/hooks/useAdaptiveToolBar.d.ts.map +0 -1
  66. package/dist/creek-table/hooks/useAutoWidthColumns.d.ts.map +0 -1
  67. package/dist/creek-table/hooks/useElementDistance.d.ts.map +0 -1
  68. package/dist/creek-table/hooks/useEllipsisColumns.d.ts.map +0 -1
  69. package/dist/creek-table/hooks/useIndexColumn.d.ts.map +0 -1
  70. package/dist/creek-table/hooks/useResizableColumns.d.ts.map +0 -1
  71. package/dist/creek-table/hooks/useStatusColumns.d.ts.map +0 -1
  72. package/dist/creek-table/hooks/useTableOptions.d.ts.map +0 -1
  73. package/dist/creek-table/hooks/useTableScrollHeight.d.ts.map +0 -1
  74. package/dist/creek-table/index.d.ts.map +0 -1
  75. package/dist/creek-table/type.d.ts.map +0 -1
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/locales/en_US.d.ts.map +0 -1
  78. package/dist/locales/zh_CN.d.ts.map +0 -1
@@ -1,54 +1,54 @@
1
1
 
2
2
  
3
- > @creekjs/web-components@1.0.11 father:build /Users/ernestwang/Documents/code-resoorce/creek/packages/web-components
3
+ > @creekjs/web-components@1.0.14 father:build /Users/ernestwang/Documents/code-resoorce/creek/packages/web-components
4
4
  > father build
5
5
 
6
6
  info - Clean output directories
7
7
  info - Bundless for src directory to cjs format
8
- event - Bundless index.tsx to dist/creek-config-provider/index.js (with declaration)
9
8
  event - Bundless CreekConfigContext.tsx to dist/creek-config-provider/CreekConfigContext.js (with declaration)
10
- event - Bundless index.ts to dist/creek-hooks/index.js (with declaration)
11
- event - Bundless CreekI18nProvider.tsx to dist/creek-config-provider/CreekI18nProvider.js (with declaration)
12
- event - Bundless DrawerHelper.tsx to dist/creek-hooks/useApp/DrawerHelper.js (with declaration)
13
- event - Bundless index.tsx to dist/creek-hooks/useApp/index.js (with declaration)
14
- event - Bundless ModalHelper.tsx to dist/creek-hooks/useApp/ModalHelper.js (with declaration)
9
+ event - Bundless useViewportHeight.tsx to dist/creek-hooks/useViewportHeight.js (with declaration)
10
+ event - Bundless type.ts to dist/creek-table/type.js (with declaration)
11
+ event - Bundless useIndexColumn.tsx to dist/creek-table/hooks/useIndexColumn.js (with declaration)
12
+ event - Bundless NotFoundPage.tsx to dist/creek-layout/Exception/NotFoundPage.js (with declaration)
13
+ event - Bundless useTableOptions.tsx to dist/creek-table/hooks/useTableOptions.js (with declaration)
15
14
  event - Bundless types.ts to dist/creek-hooks/useApp/types.js (with declaration)
16
- event - Bundless index.tsx to dist/creek-icon/index.js (with declaration)
17
- event - Bundless FullScreen.tsx to dist/creek-layout/ActionRender/FullScreen.js (with declaration)
18
- event - Bundless index.tsx to dist/creek-keep-alive/index.js (with declaration)
19
- event - Bundless index.tsx to dist/creek-layout/ActionRender/index.js (with declaration)
15
+ event - Bundless useEllipsisColumns.tsx to dist/creek-table/hooks/useEllipsisColumns.js (with declaration)
16
+ event - Bundless DrawerHelper.tsx to dist/creek-hooks/useApp/DrawerHelper.js (with declaration)
17
+ event - Bundless useElementDistance.tsx to dist/creek-table/hooks/useElementDistance.js (with declaration)
18
+ event - Bundless useLayoutSettingsStore.ts to dist/creek-layout/useLayoutSettingsStore.js (with declaration)
20
19
  event - Bundless UserInfo.tsx to dist/creek-layout/ActionRender/UserInfo.js (with declaration)
21
- event - Bundless LayoutSettings.tsx to dist/creek-layout/ActionRender/LayoutSettings.js (with declaration)
22
- event - Bundless index.tsx to dist/creek-layout/Exception/index.js (with declaration)
23
20
  event - Bundless NotFound.tsx to dist/creek-layout/Exception/NotFound.js (with declaration)
24
- event - Bundless CollapseButton.tsx to dist/creek-layout/CollapseButton.js (with declaration)
25
- event - Bundless NotFoundPage.tsx to dist/creek-layout/Exception/NotFoundPage.js (with declaration)
26
- event - Bundless index.tsx to dist/creek-layout/index.js (with declaration)
27
- event - Bundless index.tsx to dist/creek-loading/index.js (with declaration)
28
- event - Bundless index.tsx to dist/creek-locale-button/index.js (with declaration)
29
- event - Bundless index.ts to dist/creek-style/index.js (with declaration)
21
+ event - Bundless index.tsx to dist/creek-layout/Exception/index.js (with declaration)
30
22
  event - Bundless scrollbar.ts to dist/creek-style/scrollbar.js (with declaration)
31
- event - Bundless index.tsx to dist/creek-page-container/index.js (with declaration)
32
- event - Bundless EllipsisTooltip.tsx to dist/creek-table/components/EllipsisTooltip.js (with declaration)
33
- event - Bundless DensityIcon.tsx to dist/creek-table/components/DensityIcon.js (with declaration)
34
- event - Bundless index.ts to dist/creek-table/hooks/index.js (with declaration)
35
23
  event - Bundless index.tsx to dist/creek-table/components/index.js (with declaration)
24
+ event - Bundless index.ts to dist/creek-style/index.js (with declaration)
25
+ event - Bundless index.tsx to dist/creek-layout/ActionRender/index.js (with declaration)
26
+ event - Bundless useTableScrollHeight.tsx to dist/creek-table/hooks/useTableScrollHeight.js (with declaration)
27
+ event - Bundless DensityIcon.tsx to dist/creek-table/components/DensityIcon.js (with declaration)
28
+ event - Bundless index.tsx to dist/creek-locale-button/index.js (with declaration)
36
29
  event - Bundless useAdaptiveToolBar.tsx to dist/creek-table/hooks/useAdaptiveToolBar.js (with declaration)
37
- event - Bundless useEllipsisColumns.tsx to dist/creek-table/hooks/useEllipsisColumns.js (with declaration)
38
- event - Bundless useAutoWidthColumns.tsx to dist/creek-table/hooks/useAutoWidthColumns.js (with declaration)
39
- event - Bundless useIndexColumn.tsx to dist/creek-table/hooks/useIndexColumn.js (with declaration)
40
- event - Bundless useResizableColumns.tsx to dist/creek-table/hooks/useResizableColumns.js (with declaration)
41
- event - Bundless useElementDistance.tsx to dist/creek-table/hooks/useElementDistance.js (with declaration)
30
+ event - Bundless CreekI18nProvider.tsx to dist/creek-config-provider/CreekI18nProvider.js (with declaration)
31
+ event - Bundless ModalHelper.tsx to dist/creek-hooks/useApp/ModalHelper.js (with declaration)
42
32
  event - Bundless index.tsx to dist/creek-table/index.js (with declaration)
43
- event - Bundless useTableOptions.tsx to dist/creek-table/hooks/useTableOptions.js (with declaration)
44
- event - Bundless useTableScrollHeight.tsx to dist/creek-table/hooks/useTableScrollHeight.js (with declaration)
45
- event - Bundless type.ts to dist/creek-table/type.js (with declaration)
46
33
  event - Bundless zh_CN.ts to dist/locales/zh_CN.js (with declaration)
47
- event - Bundless useViewportHeight.tsx to dist/creek-hooks/useViewportHeight.js (with declaration)
34
+ event - Bundless FullScreen.tsx to dist/creek-layout/ActionRender/FullScreen.js (with declaration)
35
+ event - Bundless index.ts to dist/creek-hooks/index.js (with declaration)
36
+ event - Bundless CollapseButton.tsx to dist/creek-layout/CollapseButton.js (with declaration)
48
37
  event - Bundless index.tsx to dist/index.js (with declaration)
49
- event - Bundless useLayoutSettingsStore.ts to dist/creek-layout/useLayoutSettingsStore.js (with declaration)
50
38
  event - Bundless en_US.ts to dist/locales/en_US.js (with declaration)
39
+ event - Bundless index.tsx to dist/creek-page-container/index.js (with declaration)
40
+ event - Bundless index.tsx to dist/creek-config-provider/index.js (with declaration)
41
+ event - Bundless useAutoWidthColumns.tsx to dist/creek-table/hooks/useAutoWidthColumns.js (with declaration)
42
+ event - Bundless index.tsx to dist/creek-hooks/useApp/index.js (with declaration)
43
+ event - Bundless index.tsx to dist/creek-loading/index.js (with declaration)
44
+ event - Bundless index.tsx to dist/creek-keep-alive/index.js (with declaration)
45
+ event - Bundless index.tsx to dist/creek-icon/index.js (with declaration)
51
46
  event - Bundless useStatusColumns.tsx to dist/creek-table/hooks/useStatusColumns.js (with declaration)
52
47
  event - Bundless SearchTable.tsx to dist/creek-table/SearchTable.js (with declaration)
48
+ event - Bundless LayoutSettings.tsx to dist/creek-layout/ActionRender/LayoutSettings.js (with declaration)
49
+ event - Bundless index.ts to dist/creek-table/hooks/index.js (with declaration)
50
+ event - Bundless EllipsisTooltip.tsx to dist/creek-table/components/EllipsisTooltip.js (with declaration)
51
+ event - Bundless index.tsx to dist/creek-layout/index.js (with declaration)
52
+ event - Bundless useResizableColumns.tsx to dist/creek-table/hooks/useResizableColumns.js (with declaration)
53
53
  event - Generate declaration files...
54
- event - Transformed successfully in 6572 ms (45 files)
54
+ event - Transformed successfully in 6931 ms (45 files)
@@ -38,7 +38,6 @@ module.exports = __toCommonJS(creek_config_provider_exports);
38
38
  var import_antd = require("antd");
39
39
  var import_en_US = __toESM(require("antd/locale/en_US"));
40
40
  var import_zh_CN = __toESM(require("antd/locale/zh_CN"));
41
- var import_merge = __toESM(require("lodash/merge"));
42
41
  var import_creek_hooks = require("../creek-hooks");
43
42
  var import_useLayoutSettingsStore = require("../creek-layout/useLayoutSettingsStore");
44
43
  var import_CreekConfigContext = require("./CreekConfigContext");
@@ -54,18 +53,19 @@ var InnerConfigProvider = (props) => {
54
53
  const { locale } = (0, import_CreekI18nProvider.useAppLocale)();
55
54
  const settingsStore = (0, import_useLayoutSettingsStore.useLayoutSettingsStore)();
56
55
  const activeColorPrimary = settingsStore.colorPrimary || ((_a = theme == null ? void 0 : theme.token) == null ? void 0 : _a.colorPrimary);
57
- let finalTheme = (0, import_merge.default)(
58
- {},
59
- theme,
60
- activeColorPrimary ? {
61
- token: {
62
- colorPrimary: activeColorPrimary,
63
- colorLink: activeColorPrimary,
64
- colorLinkHover: activeColorPrimary,
65
- colorLinkActive: activeColorPrimary
66
- }
67
- } : {}
68
- );
56
+ const colorPrimaryToken = activeColorPrimary ? {
57
+ colorPrimary: activeColorPrimary,
58
+ colorLink: activeColorPrimary,
59
+ colorLinkHover: activeColorPrimary,
60
+ colorLinkActive: activeColorPrimary
61
+ } : {};
62
+ let finalTheme = {
63
+ ...theme,
64
+ token: {
65
+ ...theme == null ? void 0 : theme.token,
66
+ ...colorPrimaryToken
67
+ }
68
+ };
69
69
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { locale: ANTD_LOCALE_MAP[locale] || import_zh_CN.default, theme: finalTheme, ...more, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CreekConfigContext.CreekConfigContext.Provider, { value: more, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.App, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_creek_hooks.AppProvider, { children }) }) }) });
70
70
  };
71
71
  var CreekConfigProvider = (props) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/creek-config-provider/index.tsx"],
4
- "sourcesContent": ["import type { ConfigProviderProps } from 'antd';\nimport { App, ConfigProvider } from 'antd';\nimport enUS_antd from 'antd/locale/en_US';\nimport zhCN_antd from 'antd/locale/zh_CN';\nimport merge from 'lodash/merge';\n\nimport { AppProvider } from '../creek-hooks';\nimport { useLayoutSettingsStore } from '../creek-layout/useLayoutSettingsStore';\nimport { CreekConfigContext, CreekConfigContextProps } from './CreekConfigContext';\nimport { CreekI18nProvider, CreekI18nProviderProps, LocaleCode, LocaleContext, useAppLocale } from './CreekI18nProvider';\n\nconst ANTD_LOCALE_MAP: Record<LocaleCode, any> = {\n zh_CN: zhCN_antd,\n en_US: enUS_antd,\n};\n\nexport type CreekConfigProviderProps = CreekConfigContextProps & Omit<ConfigProviderProps, 'locale'> & CreekI18nProviderProps;\n\nexport { CreekI18nProvider, LocaleContext, useAppLocale };\nexport type { CreekI18nProviderProps };\n\nconst InnerConfigProvider = (props: Omit<CreekConfigProviderProps, 'locale' | 'messages'>) => {\n const { children, theme, ...more } = props;\n const { locale } = useAppLocale();\n const settingsStore = useLayoutSettingsStore();\n\n const activeColorPrimary = settingsStore.colorPrimary || theme?.token?.colorPrimary;\n\n let finalTheme = merge(\n {},\n theme,\n activeColorPrimary\n ? {\n token: {\n colorPrimary: activeColorPrimary,\n colorLink: activeColorPrimary,\n colorLinkHover: activeColorPrimary,\n colorLinkActive: activeColorPrimary,\n },\n }\n : {},\n );\n\n return (\n <ConfigProvider locale={ANTD_LOCALE_MAP[locale] || zhCN_antd} theme={finalTheme} {...more}>\n <CreekConfigContext.Provider value={more as any}>\n <App>\n <AppProvider>{children}</AppProvider>\n </App>\n </CreekConfigContext.Provider>\n </ConfigProvider>\n );\n};\n\nexport const CreekConfigProvider = (props: CreekConfigProviderProps) => {\n const { children, locale, messages, ...more } = props;\n\n return (\n <CreekI18nProvider locale={locale} messages={messages}>\n <InnerConfigProvider {...more}>{children}</InnerConfigProvider>\n </CreekI18nProvider>\n );\n};\n\nCreekConfigProvider.CreekConfigContext = CreekConfigContext;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAoC;AACpC,mBAAsB;AACtB,mBAAsB;AACtB,mBAAkB;AAElB,yBAA4B;AAC5B,oCAAuC;AACvC,gCAA4D;AAC5D,+BAAmG;AAsCzF;AApCV,IAAM,kBAA2C;AAAA,EAC/C,OAAO,aAAAA;AAAA,EACP,OAAO,aAAAC;AACT;AAOA,IAAM,sBAAsB,CAAC,UAAiE;AArB9F;AAsBE,QAAM,EAAE,UAAU,OAAO,GAAG,KAAK,IAAI;AACrC,QAAM,EAAE,OAAO,QAAI,uCAAa;AAChC,QAAM,oBAAgB,sDAAuB;AAE7C,QAAM,qBAAqB,cAAc,kBAAgB,oCAAO,UAAP,mBAAc;AAEvE,MAAI,iBAAa,aAAAC;AAAA,IACf,CAAC;AAAA,IACD;AAAA,IACA,qBACI;AAAA,MACE,OAAO;AAAA,QACL,cAAc;AAAA,QACd,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,MACnB;AAAA,IACF,IACA,CAAC;AAAA,EACP;AAEA,SACE,4CAAC,8BAAe,QAAQ,gBAAgB,MAAM,KAAK,aAAAC,SAAW,OAAO,YAAa,GAAG,MACnF,sDAAC,6CAAmB,UAAnB,EAA4B,OAAO,MAClC,sDAAC,mBACC,sDAAC,kCAAa,UAAS,GACzB,GACF,GACF;AAEJ;AAEO,IAAM,sBAAsB,CAAC,UAAoC;AACtE,QAAM,EAAE,UAAU,QAAQ,UAAU,GAAG,KAAK,IAAI;AAEhD,SACE,4CAAC,8CAAkB,QAAgB,UACjC,sDAAC,uBAAqB,GAAG,MAAO,UAAS,GAC3C;AAEJ;AAEA,oBAAoB,qBAAqB;",
6
- "names": ["zhCN_antd", "enUS_antd", "merge", "zhCN_antd"]
4
+ "sourcesContent": ["import type { ConfigProviderProps } from 'antd';\nimport { App, ConfigProvider } from 'antd';\nimport enUS_antd from 'antd/locale/en_US';\nimport zhCN_antd from 'antd/locale/zh_CN';\n\nimport { AppProvider } from '../creek-hooks';\nimport { useLayoutSettingsStore } from '../creek-layout/useLayoutSettingsStore';\nimport { CreekConfigContext, CreekConfigContextProps } from './CreekConfigContext';\nimport { CreekI18nProvider, CreekI18nProviderProps, LocaleCode, LocaleContext, useAppLocale } from './CreekI18nProvider';\n\nconst ANTD_LOCALE_MAP: Record<LocaleCode, any> = {\n zh_CN: zhCN_antd,\n en_US: enUS_antd,\n};\n\nexport type CreekConfigProviderProps = CreekConfigContextProps & Omit<ConfigProviderProps, 'locale'> & CreekI18nProviderProps;\n\nexport { CreekI18nProvider, LocaleContext, useAppLocale };\nexport type { CreekI18nProviderProps };\n\nconst InnerConfigProvider = (props: Omit<CreekConfigProviderProps, 'locale' | 'messages'>) => {\n const { children, theme, ...more } = props;\n const { locale } = useAppLocale();\n const settingsStore = useLayoutSettingsStore();\n\n const activeColorPrimary = settingsStore.colorPrimary || theme?.token?.colorPrimary;\n\n const colorPrimaryToken = activeColorPrimary\n ? {\n colorPrimary: activeColorPrimary,\n colorLink: activeColorPrimary,\n colorLinkHover: activeColorPrimary,\n colorLinkActive: activeColorPrimary,\n }\n : {};\n\n let finalTheme: ConfigProviderProps['theme'] = {\n ...theme,\n token: {\n ...theme?.token,\n ...colorPrimaryToken,\n },\n };\n\n return (\n <ConfigProvider locale={ANTD_LOCALE_MAP[locale] || zhCN_antd} theme={finalTheme} {...more}>\n <CreekConfigContext.Provider value={more as any}>\n <App>\n <AppProvider>{children}</AppProvider>\n </App>\n </CreekConfigContext.Provider>\n </ConfigProvider>\n );\n};\n\nexport const CreekConfigProvider = (props: CreekConfigProviderProps) => {\n const { children, locale, messages, ...more } = props;\n\n return (\n <CreekI18nProvider locale={locale} messages={messages}>\n <InnerConfigProvider {...more}>{children}</InnerConfigProvider>\n </CreekI18nProvider>\n );\n};\n\nCreekConfigProvider.CreekConfigContext = CreekConfigContext;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAoC;AACpC,mBAAsB;AACtB,mBAAsB;AAEtB,yBAA4B;AAC5B,oCAAuC;AACvC,gCAA4D;AAC5D,+BAAmG;AAwCzF;AAtCV,IAAM,kBAA2C;AAAA,EAC/C,OAAO,aAAAA;AAAA,EACP,OAAO,aAAAC;AACT;AAOA,IAAM,sBAAsB,CAAC,UAAiE;AApB9F;AAqBE,QAAM,EAAE,UAAU,OAAO,GAAG,KAAK,IAAI;AACrC,QAAM,EAAE,OAAO,QAAI,uCAAa;AAChC,QAAM,oBAAgB,sDAAuB;AAE7C,QAAM,qBAAqB,cAAc,kBAAgB,oCAAO,UAAP,mBAAc;AAEvE,QAAM,oBAAoB,qBACtB;AAAA,IACE,cAAc;AAAA,IACd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,EACnB,IACA,CAAC;AAEL,MAAI,aAA2C;AAAA,IAC7C,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,+BAAO;AAAA,MACV,GAAG;AAAA,IACL;AAAA,EACF;AAEA,SACE,4CAAC,8BAAe,QAAQ,gBAAgB,MAAM,KAAK,aAAAC,SAAW,OAAO,YAAa,GAAG,MACnF,sDAAC,6CAAmB,UAAnB,EAA4B,OAAO,MAClC,sDAAC,mBACC,sDAAC,kCAAa,UAAS,GACzB,GACF,GACF;AAEJ;AAEO,IAAM,sBAAsB,CAAC,UAAoC;AACtE,QAAM,EAAE,UAAU,QAAQ,UAAU,GAAG,KAAK,IAAI;AAEhD,SACE,4CAAC,8CAAkB,QAAgB,UACjC,sDAAC,uBAAqB,GAAG,MAAO,UAAS,GAC3C;AAEJ;AAEA,oBAAoB,qBAAqB;",
6
+ "names": ["zhCN_antd", "enUS_antd", "zhCN_antd"]
7
7
  }
@@ -8,10 +8,6 @@ export interface CreekKeepAliveProps {
8
8
  * 自定义Tab标题获取方法
9
9
  */
10
10
  getTabTitle?: (pathname: string) => React.ReactNode;
11
- /**
12
- * 默认首页路径
13
- */
14
- homePath?: string;
15
11
  /**
16
12
  * Tabs的样式
17
13
  */
@@ -30,7 +30,7 @@ var import_react_router_dom = require("react-router-dom");
30
30
  var import_react2 = require("@creekjs/i18n/react");
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
32
  var CreekKeepAlive = (props) => {
33
- const { exclude = [], getTabTitle, homePath = "/", tabBarStyle, maxTabCount = 20 } = props;
33
+ const { exclude = [], getTabTitle, tabBarStyle, maxTabCount = 20 } = props;
34
34
  const t = (0, import_react2.useT)();
35
35
  const outlet = (0, import_react_router_dom.useOutlet)();
36
36
  const location = (0, import_react_router_dom.useLocation)();
@@ -63,10 +63,14 @@ var CreekKeepAlive = (props) => {
63
63
  });
64
64
  setTabItems((prev) => {
65
65
  if (prev.find((i) => i.key === currentPath)) {
66
- return prev;
66
+ const updated = prev.map((i) => ({ ...i, closable: prev.length > 1 }));
67
+ return updated;
67
68
  }
68
69
  const title = (getTabTitle == null ? void 0 : getTabTitle(currentPath)) || currentPath;
69
- const newItems = [...prev, { key: currentPath, label: title, closable: currentPath !== homePath }];
70
+ const newItems = [...prev, { key: currentPath, label: title, closable: prev.length > 0 }];
71
+ if (newItems.length === 1) {
72
+ newItems[0].closable = false;
73
+ }
70
74
  if (newItems.length > maxTabCount) {
71
75
  const indexToRemove = newItems.findIndex((item) => item.closable && item.key !== currentPath);
72
76
  if (indexToRemove !== -1) {
@@ -77,7 +81,7 @@ var CreekKeepAlive = (props) => {
77
81
  }
78
82
  return newItems;
79
83
  });
80
- }, [location.pathname, outlet, getTabTitle, homePath, maxTabCount]);
84
+ }, [location.pathname, outlet, getTabTitle, maxTabCount]);
81
85
  (0, import_react.useEffect)(() => {
82
86
  }, []);
83
87
  const closeTab = (0, import_ahooks.useMemoizedFn)((targetKey) => {
@@ -90,13 +94,14 @@ var CreekKeepAlive = (props) => {
90
94
  const nextIndex = targetIndex >= newTabItems.length ? newTabItems.length - 1 : targetIndex;
91
95
  const nextKey = newTabItems[nextIndex].key;
92
96
  navigate(nextKey);
93
- } else {
94
- navigate(homePath);
95
97
  }
96
98
  }
97
99
  });
98
100
  const closeOtherTabs = (0, import_ahooks.useMemoizedFn)((currentKey) => {
99
- const newTabItems = tabItems.filter((item) => item.key === currentKey || item.key === homePath);
101
+ const currentTab = tabItems.find((item) => item.key === currentKey);
102
+ if (!currentTab)
103
+ return;
104
+ const newTabItems = [{ ...currentTab, closable: false }];
100
105
  setTabItems(newTabItems);
101
106
  const keepKeys = newTabItems.map((i) => i.key);
102
107
  setCachedPages((prev) => {
@@ -135,7 +140,7 @@ var CreekKeepAlive = (props) => {
135
140
  {
136
141
  key: "close",
137
142
  label: t("creek-keep-alive.index.guanBiDangQian", "关闭当前"),
138
- disabled: item.key === homePath,
143
+ disabled: tabItems.length <= 1,
139
144
  onClick: () => closeTab(item.key)
140
145
  },
141
146
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/creek-keep-alive/index.tsx"],
4
- "sourcesContent": ["import { useMemoizedFn } from 'ahooks';\nimport { Dropdown, MenuProps, Tabs } from 'antd';\nimport { isRegExp, isString, omit } from 'lodash';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation, useNavigate, useOutlet } from 'react-router-dom';\n\nimport { useT } from '@creekjs/i18n/react';\n\nexport interface CreekKeepAliveProps {\n /**\n * 不需要缓存的路径\n */\n exclude?: (string | RegExp)[];\n /**\n * 自定义Tab标题获取方法\n */\n getTabTitle?: (pathname: string) => React.ReactNode;\n /**\n * 默认首页路径\n */\n homePath?: string;\n /**\n * Tabs的样式\n */\n tabBarStyle?: React.CSSProperties;\n /**\n * 最大缓存数量,默认为 20\n */\n maxTabCount?: number;\n}\n\ninterface TabItem {\n key: string;\n label: React.ReactNode;\n closable?: boolean;\n}\n\nexport const CreekKeepAlive: React.FC<CreekKeepAliveProps> = (props) => {\n const { exclude = [], getTabTitle, homePath = '/', tabBarStyle, maxTabCount = 20 } = props;\n\n const t = useT();\n const outlet = useOutlet();\n const location = useLocation();\n const navigate = useNavigate();\n\n const [tabItems, setTabItems] = useState<TabItem[]>([]);\n const [activeKey, setActiveKey] = useState<string>('');\n const [cachedPages, setCachedPages] = useState<Record<string, React.ReactNode>>({});\n\n // 判断是否不需要缓存\n const isPathExcluded = (path: string) => {\n return exclude.some((item) => {\n if (isString(item)) {\n return item === path;\n }\n if (isRegExp(item)) {\n return item.test(path);\n }\n return false;\n });\n };\n\n // 初始化或路由变化时更新\n useEffect(() => {\n const currentPath = location.pathname;\n setActiveKey(currentPath);\n\n // 更新页面内容缓存\n setCachedPages((prev) => {\n if (prev[currentPath]) {\n return prev;\n }\n return {\n ...prev,\n [currentPath]: outlet,\n };\n });\n\n // 更新 Tab 列表\n setTabItems((prev) => {\n if (prev.find((i) => i.key === currentPath)) {\n return prev;\n }\n const title = getTabTitle?.(currentPath) || currentPath;\n const newItems = [...prev, { key: currentPath, label: title, closable: currentPath !== homePath }];\n\n // 超过最大数量限制\n if (newItems.length > maxTabCount) {\n // 找到第一个可以关闭的 Tab(非首页、非当前页)\n // 这里策略是移除最早加入的那个可关闭 Tab。prev[0] 是最早的。\n // 但要注意不要移除当前页(currentPath),虽然 currentPath 是刚加进去的,但在极端情况下(比如 max=1)\n // 简单策略:移除第一个 closable 且 key !== currentPath 的 item\n const indexToRemove = newItems.findIndex((item) => item.closable && item.key !== currentPath);\n if (indexToRemove !== -1) {\n const itemToRemove = newItems[indexToRemove];\n // 顺便移除缓存\n setCachedPages((currentCached) => omit(currentCached, [itemToRemove.key]));\n newItems.splice(indexToRemove, 1);\n }\n }\n return newItems;\n });\n }, [location.pathname, outlet, getTabTitle, homePath, maxTabCount]);\n\n // 清理不需要缓存的页面\n useEffect(() => {\n // 监听路由离开\n // 这里比较 tricky,因为 useEffect 拿到的 activeKey 已经是新的了\n // 我们需要知道\"上一个\"路径\n // 简化处理:每次 render 时,检查 pages 里哪些是不需要缓存且不处于 active 状态的,将其移除?\n // 但如果在 setState 里做会导致死循环。\n // 另一种策略:不缓存 = 离开时销毁。\n // 我们可以在 pages 渲染时控制。\n }, []);\n\n const closeTab = useMemoizedFn((targetKey: string) => {\n const targetIndex = tabItems.findIndex((item) => item.key === targetKey);\n const newTabItems = tabItems.filter((item) => item.key !== targetKey);\n\n // 移除缓存\n setCachedPages((prev) => omit(prev, [targetKey]));\n setTabItems(newTabItems);\n\n // 如果关闭的是当前页,跳转到临近页\n if (targetKey === activeKey) {\n if (newTabItems.length > 0) {\n // 尝试跳到右边,没有则左边\n const nextIndex = targetIndex >= newTabItems.length ? newTabItems.length - 1 : targetIndex;\n const nextKey = newTabItems[nextIndex].key;\n navigate(nextKey);\n } else {\n navigate(homePath);\n }\n }\n });\n\n const closeOtherTabs = useMemoizedFn((currentKey: string) => {\n const newTabItems = tabItems.filter((item) => item.key === currentKey || item.key === homePath);\n setTabItems(newTabItems);\n\n const keepKeys = newTabItems.map((i) => i.key);\n setCachedPages((prev) => {\n const newCachedPages: Record<string, React.ReactNode> = {};\n keepKeys.forEach((k) => {\n if (prev[k]) newCachedPages[k] = prev[k];\n });\n return newCachedPages;\n });\n\n if (activeKey !== currentKey) {\n navigate(currentKey);\n }\n });\n\n const closeRightTabs = useMemoizedFn((currentKey: string) => {\n const currentIndex = tabItems.findIndex((i) => i.key === currentKey);\n const rightItems = tabItems.slice(currentIndex + 1);\n const rightKeys = rightItems.map((i) => i.key);\n\n const newTabItems = tabItems.filter((i) => !rightKeys.includes(i.key));\n setTabItems(newTabItems);\n\n setCachedPages((prev) => omit(prev, rightKeys));\n\n if (rightKeys.includes(activeKey)) {\n navigate(currentKey);\n }\n });\n\n const handleTabEdit = (targetKey: React.MouseEvent | React.KeyboardEvent | string, action: 'add' | 'remove') => {\n if (action === 'remove' && isString(targetKey)) {\n closeTab(targetKey);\n }\n };\n\n const handleTabClick = (key: string) => {\n navigate(key);\n };\n\n const renderTabLabel = (item: TabItem) => {\n const menuItems: MenuProps['items'] = [\n {\n key: 'close',\n label: t('creek-keep-alive.index.guanBiDangQian', '关闭当前'),\n disabled: item.key === homePath,\n onClick: () => closeTab(item.key),\n },\n {\n key: 'closeOthers',\n label: t('creek-keep-alive.index.guanBiQiTa', '关闭其他'),\n onClick: () => closeOtherTabs(item.key),\n },\n {\n key: 'closeRight',\n label: t('creek-keep-alive.index.guanBiYouCe', '关闭右侧'),\n onClick: () => closeRightTabs(item.key),\n },\n ];\n\n return (\n <Dropdown menu={{ items: menuItems }} trigger={['contextMenu']}>\n <span>{item.label}</span>\n </Dropdown>\n );\n };\n\n return (\n <div className=\"creek-keep-alive\">\n <Tabs\n activeKey={activeKey}\n type=\"editable-card\"\n hideAdd\n onChange={handleTabClick}\n onEdit={handleTabEdit}\n tabBarStyle={{ margin: 0, ...tabBarStyle }}\n items={tabItems.map((item) => ({\n ...item,\n label: renderTabLabel(item),\n children: (\n <div key={item.key} style={{ height: '100%', display: activeKey === item.key ? 'block' : 'none' }}>\n {/* 如果是不缓存的页面,且不是当前页,则不渲染(销毁) */}\n {/* 如果是缓存页面,或者是当前页,则渲染 */}\n {!isPathExcluded(item.key) || activeKey === item.key ? cachedPages[item.key] : null}\n </div>\n ),\n }))}\n />\n </div>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA8B;AAC9B,kBAA0C;AAC1C,oBAAyC;AACzC,mBAA2C;AAC3C,8BAAoD;AAEpD,IAAAA,gBAAqB;AAmMb;AApKD,IAAM,iBAAgD,C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AA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,SAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,aAAa,EAAE,QAAQ,GAAG,GAAG,YAAY;AAAA,MACzC,OAAO,SAAS,IAAI,CAAC,UAAU;AAAA,QAC7B,GAAG;AAAA,QACH,OAAO,eAAe,IAAI;AAAA,QAC1B,UACE,4CAAC,SAAmB,OAAO,EAAE,QAAQ,QAAQ,SAAS,cAAc,KAAK,MAAM,UAAU,OAAO,GAG7F,WAAC,eAAe,KAAK,GAAG,KAAK,cAAc,KAAK,MAAM,YAAY,KAAK,GAAG,IAAI,QAHvE,KAAK,GAIf;AAAA,MAEJ,EAAE;AAAA;AAAA,EACJ,GACF;AAEJ;",
4
+ "sourcesContent": ["import { useMemoizedFn } from 'ahooks';\nimport { Dropdown, MenuProps, Tabs } from 'antd';\nimport { isRegExp, isString, omit } from 'lodash';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation, useNavigate, useOutlet } from 'react-router-dom';\n\nimport { useT } from '@creekjs/i18n/react';\n\nexport interface CreekKeepAliveProps {\n /**\n * 不需要缓存的路径\n */\n exclude?: (string | RegExp)[];\n /**\n * 自定义Tab标题获取方法\n */\n getTabTitle?: (pathname: string) => React.ReactNode;\n /**\n * Tabs的样式\n */\n tabBarStyle?: React.CSSProperties;\n /**\n * 最大缓存数量,默认为 20\n */\n maxTabCount?: number;\n}\n\ninterface TabItem {\n key: string;\n label: React.ReactNode;\n closable?: boolean;\n}\n\nexport const CreekKeepAlive: React.FC<CreekKeepAliveProps> = (props) => {\n const { exclude = [], getTabTitle, tabBarStyle, maxTabCount = 20 } = props;\n\n const t = useT();\n const outlet = useOutlet();\n const location = useLocation();\n const navigate = useNavigate();\n\n const [tabItems, setTabItems] = useState<TabItem[]>([]);\n const [activeKey, setActiveKey] = useState<string>('');\n const [cachedPages, setCachedPages] = useState<Record<string, React.ReactNode>>({});\n\n // 判断是否不需要缓存\n const isPathExcluded = (path: string) => {\n return exclude.some((item) => {\n if (isString(item)) {\n return item === path;\n }\n if (isRegExp(item)) {\n return item.test(path);\n }\n return false;\n });\n };\n\n // 初始化或路由变化时更新\n useEffect(() => {\n const currentPath = location.pathname;\n setActiveKey(currentPath);\n\n // 更新页面内容缓存\n setCachedPages((prev) => {\n if (prev[currentPath]) {\n return prev;\n }\n return {\n ...prev,\n [currentPath]: outlet,\n };\n });\n\n // 更新 Tab 列表\n setTabItems((prev) => {\n if (prev.find((i) => i.key === currentPath)) {\n // 更新现有 tab 的 closable 状态(只有最后一个 tab 时不可关闭)\n const updated = prev.map((i) => ({ ...i, closable: prev.length > 1 }));\n return updated;\n }\n const title = getTabTitle?.(currentPath) || currentPath;\n const newItems = [...prev, { key: currentPath, label: title, closable: prev.length > 0 }];\n\n // 更新所有 tab 的 closable 状态:只有1个 tab 时全部不可关闭\n if (newItems.length === 1) {\n newItems[0].closable = false;\n }\n\n // 超过最大数量限制\n if (newItems.length > maxTabCount) {\n // 找到第一个可以关闭的 Tab(非首页、非当前页)\n // 这里策略是移除最早加入的那个可关闭 Tab。prev[0] 是最早的。\n // 但要注意不要移除当前页(currentPath),虽然 currentPath 是刚加进去的,但在极端情况下(比如 max=1)\n // 简单策略:移除第一个 closable 且 key !== currentPath 的 item\n const indexToRemove = newItems.findIndex((item) => item.closable && item.key !== currentPath);\n if (indexToRemove !== -1) {\n const itemToRemove = newItems[indexToRemove];\n // 顺便移除缓存\n setCachedPages((currentCached) => omit(currentCached, [itemToRemove.key]));\n newItems.splice(indexToRemove, 1);\n }\n }\n return newItems;\n });\n }, [location.pathname, outlet, getTabTitle, maxTabCount]);\n\n // 清理不需要缓存的页面\n useEffect(() => {\n // 监听路由离开\n // 这里比较 tricky,因为 useEffect 拿到的 activeKey 已经是新的了\n // 我们需要知道\"上一个\"路径\n // 简化处理:每次 render 时,检查 pages 里哪些是不需要缓存且不处于 active 状态的,将其移除?\n // 但如果在 setState 里做会导致死循环。\n // 另一种策略:不缓存 = 离开时销毁。\n // 我们可以在 pages 渲染时控制。\n }, []);\n\n const closeTab = useMemoizedFn((targetKey: string) => {\n const targetIndex = tabItems.findIndex((item) => item.key === targetKey);\n const newTabItems = tabItems.filter((item) => item.key !== targetKey);\n\n // 移除缓存\n setCachedPages((prev) => omit(prev, [targetKey]));\n setTabItems(newTabItems);\n\n // 如果关闭的是当前页,跳转到临近页\n if (targetKey === activeKey) {\n if (newTabItems.length > 0) {\n // 尝试跳到右边,没有则左边\n const nextIndex = targetIndex >= newTabItems.length ? newTabItems.length - 1 : targetIndex;\n const nextKey = newTabItems[nextIndex].key;\n navigate(nextKey);\n }\n }\n });\n\n const closeOtherTabs = useMemoizedFn((currentKey: string) => {\n const currentTab = tabItems.find((item) => item.key === currentKey);\n if (!currentTab) return;\n const newTabItems = [{ ...currentTab, closable: false }];\n setTabItems(newTabItems);\n\n const keepKeys = newTabItems.map((i) => i.key);\n setCachedPages((prev) => {\n const newCachedPages: Record<string, React.ReactNode> = {};\n keepKeys.forEach((k) => {\n if (prev[k]) newCachedPages[k] = prev[k];\n });\n return newCachedPages;\n });\n\n if (activeKey !== currentKey) {\n navigate(currentKey);\n }\n });\n\n const closeRightTabs = useMemoizedFn((currentKey: string) => {\n const currentIndex = tabItems.findIndex((i) => i.key === currentKey);\n const rightItems = tabItems.slice(currentIndex + 1);\n const rightKeys = rightItems.map((i) => i.key);\n\n const newTabItems = tabItems.filter((i) => !rightKeys.includes(i.key));\n setTabItems(newTabItems);\n\n setCachedPages((prev) => omit(prev, rightKeys));\n\n if (rightKeys.includes(activeKey)) {\n navigate(currentKey);\n }\n });\n\n const handleTabEdit = (targetKey: React.MouseEvent | React.KeyboardEvent | string, action: 'add' | 'remove') => {\n if (action === 'remove' && isString(targetKey)) {\n closeTab(targetKey);\n }\n };\n\n const handleTabClick = (key: string) => {\n navigate(key);\n };\n\n const renderTabLabel = (item: TabItem) => {\n const menuItems: MenuProps['items'] = [\n {\n key: 'close',\n label: t('creek-keep-alive.index.guanBiDangQian', '关闭当前'),\n disabled: tabItems.length <= 1,\n onClick: () => closeTab(item.key),\n },\n {\n key: 'closeOthers',\n label: t('creek-keep-alive.index.guanBiQiTa', '关闭其他'),\n onClick: () => closeOtherTabs(item.key),\n },\n {\n key: 'closeRight',\n label: t('creek-keep-alive.index.guanBiYouCe', '关闭右侧'),\n onClick: () => closeRightTabs(item.key),\n },\n ];\n\n return (\n <Dropdown menu={{ items: menuItems }} trigger={['contextMenu']}>\n <span>{item.label}</span>\n </Dropdown>\n );\n };\n\n return (\n <div className=\"creek-keep-alive\">\n <Tabs\n activeKey={activeKey}\n type=\"editable-card\"\n hideAdd\n onChange={handleTabClick}\n onEdit={handleTabEdit}\n tabBarStyle={{ margin: 0, ...tabBarStyle }}\n items={tabItems.map((item) => ({\n ...item,\n label: renderTabLabel(item),\n children: (\n <div key={item.key} style={{ height: '100%', display: activeKey === item.key ? 'block' : 'none' }}>\n {/* 如果是不缓存的页面,且不是当前页,则不渲染(销毁) */}\n {/* 如果是缓存页面,或者是当前页,则渲染 */}\n {!isPathExcluded(item.key) || activeKey === item.key ? cachedPages[item.key] : null}\n </div>\n ),\n }))}\n />\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA8B;AAC9B,kBAA0C;AAC1C,oBAAyC;AACzC,mBAA2C;AAC3C,8BAAoD;AAEpD,IAAAA,gBAAqB;AAsMb;AA3KD,IAAM,iBAAgD,CAAC,UAAU;AACtE,QAAM,EAAE,UAAU,CAAC,GAAG,aAAa,aAAa,cAAc,GAAG,IAAI;AAErE,QAAM,QAAI,oBAAK;AACf,QAAM,aAAS,mCAAU;AACzB,QAAM,eAAW,qCAAY;AAC7B,QAAM,eAAW,qCAAY;AAE7B,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAoB,CAAC,CAAC;AACtD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAiB,EAAE;AACrD,QAAM,CA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AAG,GAAG,YAAY;AAAA,MACzC,OAAO,SAAS,IAAI,CAAC,UAAU;AAAA,QAC7B,GAAG;AAAA,QACH,OAAO,eAAe,IAAI;AAAA,QAC1B,UACE,4CAAC,SAAmB,OAAO,EAAE,QAAQ,QAAQ,SAAS,cAAc,KAAK,MAAM,UAAU,OAAO,GAG7F,WAAC,eAAe,KAAK,GAAG,KAAK,cAAc,KAAK,MAAM,YAAY,KAAK,GAAG,IAAI,QAHvE,KAAK,GAIf;AAAA,MAEJ,EAAE;AAAA;AAAA,EACJ,GACF;AAEJ;",
6
6
  "names": ["import_react"]
7
7
  }
@@ -1,5 +1,6 @@
1
- export declare const LayoutSettings: ({ defaultShowFullScreen, defaultShowLocaleButton, defaultKeepAlive, }: {
1
+ export declare const LayoutSettings: ({ defaultShowFullScreen, defaultShowLocaleButton, defaultShowThemeColor, defaultKeepAlive, }: {
2
2
  defaultShowFullScreen?: boolean | undefined;
3
3
  defaultShowLocaleButton?: boolean | undefined;
4
+ defaultShowThemeColor?: boolean | undefined;
4
5
  defaultKeepAlive?: boolean | undefined;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -28,14 +28,14 @@ var import_react = require("@creekjs/i18n/react");
28
28
  var import_creek_hooks = require("../../creek-hooks");
29
29
  var import_useLayoutSettingsStore = require("../useLayoutSettingsStore");
30
30
  var import_jsx_runtime = require("react/jsx-runtime");
31
- var SettingsForm = ({ defaultShowFullScreen, defaultShowLocaleButton, defaultKeepAlive }) => {
31
+ var SettingsForm = ({ defaultShowFullScreen, defaultShowLocaleButton, defaultShowThemeColor, defaultKeepAlive }) => {
32
32
  const t = (0, import_react.useT)();
33
33
  const { colorPrimary, showFullScreen, showLocaleButton, keepAlive, setSettings } = (0, import_useLayoutSettingsStore.useLayoutSettingsStore)();
34
34
  const currentShowFullScreen = showFullScreen ?? defaultShowFullScreen ?? false;
35
35
  const currentShowLocaleButton = showLocaleButton ?? defaultShowLocaleButton ?? true;
36
36
  const currentKeepAlive = keepAlive ?? defaultKeepAlive ?? true;
37
37
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Form, { layout: "vertical", children: [
38
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.themeColor", "主题色"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
38
+ defaultShowThemeColor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.themeColor", "主题色"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
39
39
  import_antd.ColorPicker,
40
40
  {
41
41
  value: colorPrimary,
@@ -45,14 +45,15 @@ var SettingsForm = ({ defaultShowFullScreen, defaultShowLocaleButton, defaultKee
45
45
  allowClear: true
46
46
  }
47
47
  ) }),
48
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.showFullScreen", "展示全屏按钮"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Switch, { checked: currentShowFullScreen, onChange: (checked) => setSettings({ showFullScreen: checked }) }) }),
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.showLocaleButton", "展示国际化按钮"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Switch, { checked: currentShowLocaleButton, onChange: (checked) => setSettings({ showLocaleButton: checked }) }) }),
50
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.keepAlive", "开启页面缓存 (Keep Alive)"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Switch, { checked: currentKeepAlive, onChange: (checked) => setSettings({ keepAlive: checked }) }) })
48
+ defaultShowFullScreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.showFullScreen", "展示全屏按钮"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Switch, { checked: currentShowFullScreen, onChange: (checked) => setSettings({ showFullScreen: checked }) }) }),
49
+ defaultShowLocaleButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.showLocaleButton", "展示国际化按钮"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Switch, { checked: currentShowLocaleButton, onChange: (checked) => setSettings({ showLocaleButton: checked }) }) }),
50
+ defaultKeepAlive && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: t("creek-layout.ActionRender.LayoutSettings.keepAlive", "开启页面缓存 (Keep Alive)"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Switch, { checked: currentKeepAlive, onChange: (checked) => setSettings({ keepAlive: checked }) }) })
51
51
  ] });
52
52
  };
53
53
  var LayoutSettings = ({
54
54
  defaultShowFullScreen,
55
55
  defaultShowLocaleButton,
56
+ defaultShowThemeColor,
56
57
  defaultKeepAlive
57
58
  }) => {
58
59
  const t = (0, import_react.useT)();
@@ -61,7 +62,7 @@ var LayoutSettings = ({
61
62
  drawer.open({
62
63
  title: t("creek-layout.ActionRender.LayoutSettings.title", "系统设置"),
63
64
  placement: "right",
64
- content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SettingsForm, { defaultShowFullScreen, defaultShowLocaleButton, defaultKeepAlive })
65
+ content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SettingsForm, { defaultShowFullScreen, defaultShowLocaleButton, defaultShowThemeColor, defaultKeepAlive })
65
66
  });
66
67
  };
67
68
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: t("creek-layout.ActionRender.LayoutSettings.title", "系统设置"), placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SettingOutlined, { onClick: handleOpenSettings }) });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/creek-layout/ActionRender/LayoutSettings.tsx"],
4
- "sourcesContent": ["import { SettingOutlined } from '@ant-design/icons';\nimport { ColorPicker, Form, Switch, Tooltip } from 'antd';\n\nimport { useT } from '@creekjs/i18n/react';\n\nimport { useApp } from '../../creek-hooks';\nimport { useLayoutSettingsStore } from '../useLayoutSettingsStore';\n\nconst SettingsForm = ({ defaultShowFullScreen, defaultShowLocaleButton, defaultKeepAlive }: { defaultShowFullScreen?: boolean; defaultShowLocaleButton?: boolean; defaultKeepAlive?: boolean }) => {\n const t = useT();\n const { colorPrimary, showFullScreen, showLocaleButton, keepAlive, setSettings } = useLayoutSettingsStore();\n\n const currentShowFullScreen = showFullScreen ?? defaultShowFullScreen ?? false;\n const currentShowLocaleButton = showLocaleButton ?? defaultShowLocaleButton ?? true;\n const currentKeepAlive = keepAlive ?? defaultKeepAlive ?? true;\n\n return (\n <Form layout=\"vertical\">\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.themeColor', '主题色')}>\n <ColorPicker\n value={colorPrimary}\n onChange={(color, hex) => {\n setSettings({ colorPrimary: hex || undefined });\n }}\n allowClear\n />\n </Form.Item>\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.showFullScreen', '展示全屏按钮')}>\n <Switch checked={currentShowFullScreen} onChange={(checked) => setSettings({ showFullScreen: checked })} />\n </Form.Item>\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.showLocaleButton', '展示国际化按钮')}>\n <Switch checked={currentShowLocaleButton} onChange={(checked) => setSettings({ showLocaleButton: checked })} />\n </Form.Item>\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.keepAlive', '开启页面缓存 (Keep Alive)')}>\n <Switch checked={currentKeepAlive} onChange={(checked) => setSettings({ keepAlive: checked })} />\n </Form.Item>\n </Form>\n );\n};\n\nexport const LayoutSettings = ({\n defaultShowFullScreen,\n defaultShowLocaleButton,\n defaultKeepAlive,\n}: {\n defaultShowFullScreen?: boolean;\n defaultShowLocaleButton?: boolean;\n defaultKeepAlive?: boolean;\n}) => {\n const t = useT();\n const { drawer } = useApp();\n\n const handleOpenSettings = () => {\n drawer.open({\n title: t('creek-layout.ActionRender.LayoutSettings.title', '系统设置'),\n placement: 'right',\n\n content: <SettingsForm defaultShowFullScreen={defaultShowFullScreen} defaultShowLocaleButton={defaultShowLocaleButton} defaultKeepAlive={defaultKeepAlive} />,\n });\n };\n\n return (\n <Tooltip title={t('creek-layout.ActionRender.LayoutSettings.title', '系统设置')} placement=\"top\">\n <SettingOutlined onClick={handleOpenSettings} />\n </Tooltip>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgC;AAChC,kBAAmD;AAEnD,mBAAqB;AAErB,yBAAuB;AACvB,oCAAuC;AAWnC;AATJ,IAAM,eAAe,CAAC,EAAE,uBAAuB,yBAAyB,iBAAiB,MAA0G;AACjM,QAAM,QAAI,mBAAK;AACf,QAAM,EAAE,cAAc,gBAAgB,kBAAkB,WAAW,YAAY,QAAI,sDAAuB;AAE1G,QAAM,wBAAwB,kBAAkB,yBAAyB;AACzE,QAAM,0BAA0B,oBAAoB,2BAA2B;AAC/E,QAAM,mBAAmB,aAAa,oBAAoB;AAE1D,SACE,6CAAC,oBAAK,QAAO,YACX;AAAA,gDAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,uDAAuD,KAAK,GAC9E;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU,CAAC,OAAO,QAAQ;AACxB,sBAAY,EAAE,cAAc,OAAO,OAAU,CAAC;AAAA,QAChD;AAAA,QACA,YAAU;AAAA;AAAA,IACZ,GACF;AAAA,IACA,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,2DAA2D,QAAQ,GACrF,sDAAC,sBAAO,SAAS,uBAAuB,UAAU,CAAC,YAAY,YAAY,EAAE,gBAAgB,QAAQ,CAAC,GAAG,GAC3G;AAAA,IACA,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,6DAA6D,SAAS,GACxF,sDAAC,sBAAO,SAAS,yBAAyB,UAAU,CAAC,YAAY,YAAY,EAAE,kBAAkB,QAAQ,CAAC,GAAG,GAC/G;AAAA,IACA,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,sDAAsD,qBAAqB,GAC7F,sDAAC,sBAAO,SAAS,kBAAkB,UAAU,CAAC,YAAY,YAAY,EAAE,WAAW,QAAQ,CAAC,GAAG,GACjG;AAAA,KACF;AAEJ;AAEO,IAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,QAAI,mBAAK;AACf,QAAM,EAAE,OAAO,QAAI,2BAAO;AAE1B,QAAM,qBAAqB,MAAM;AAC/B,WAAO,KAAK;AAAA,MACV,OAAO,EAAE,kDAAkD,MAAM;AAAA,MACjE,WAAW;AAAA,MAEX,SAAS,4CAAC,gBAAa,uBAA8C,yBAAkD,kBAAoC;AAAA,IAC7J,CAAC;AAAA,EACH;AAEA,SACE,4CAAC,uBAAQ,OAAO,EAAE,kDAAkD,MAAM,GAAG,WAAU,OACrF,sDAAC,gCAAgB,SAAS,oBAAoB,GAChD;AAEJ;",
4
+ "sourcesContent": ["import { SettingOutlined } from '@ant-design/icons';\nimport { ColorPicker, Form, Switch, Tooltip } from 'antd';\n\nimport { useT } from '@creekjs/i18n/react';\n\nimport { useApp } from '../../creek-hooks';\nimport { useLayoutSettingsStore } from '../useLayoutSettingsStore';\n\nconst SettingsForm = ({ defaultShowFullScreen, defaultShowLocaleButton, defaultShowThemeColor, defaultKeepAlive }: { defaultShowFullScreen?: boolean; defaultShowLocaleButton?: boolean; defaultShowThemeColor?: boolean; defaultKeepAlive?: boolean }) => {\n const t = useT();\n const { colorPrimary, showFullScreen, showLocaleButton, keepAlive, setSettings } = useLayoutSettingsStore();\n\n const currentShowFullScreen = showFullScreen ?? defaultShowFullScreen ?? false;\n const currentShowLocaleButton = showLocaleButton ?? defaultShowLocaleButton ?? true;\n const currentKeepAlive = keepAlive ?? defaultKeepAlive ?? true;\n\n return (\n <Form layout=\"vertical\">\n {defaultShowThemeColor && (\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.themeColor', '主题色')}>\n <ColorPicker\n value={colorPrimary}\n onChange={(color, hex) => {\n setSettings({ colorPrimary: hex || undefined });\n }}\n allowClear\n />\n </Form.Item>\n )}\n {defaultShowFullScreen && (\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.showFullScreen', '展示全屏按钮')}>\n <Switch checked={currentShowFullScreen} onChange={(checked) => setSettings({ showFullScreen: checked })} />\n </Form.Item>\n )}\n {defaultShowLocaleButton && (\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.showLocaleButton', '展示国际化按钮')}>\n <Switch checked={currentShowLocaleButton} onChange={(checked) => setSettings({ showLocaleButton: checked })} />\n </Form.Item>\n )}\n {defaultKeepAlive && (\n <Form.Item label={t('creek-layout.ActionRender.LayoutSettings.keepAlive', '开启页面缓存 (Keep Alive)')}>\n <Switch checked={currentKeepAlive} onChange={(checked) => setSettings({ keepAlive: checked })} />\n </Form.Item>\n )}\n </Form>\n );\n};\n\nexport const LayoutSettings = ({\n defaultShowFullScreen,\n defaultShowLocaleButton,\n defaultShowThemeColor,\n defaultKeepAlive,\n}: {\n defaultShowFullScreen?: boolean;\n defaultShowLocaleButton?: boolean;\n defaultShowThemeColor?: boolean;\n defaultKeepAlive?: boolean;\n}) => {\n const t = useT();\n const { drawer } = useApp();\n\n const handleOpenSettings = () => {\n drawer.open({\n title: t('creek-layout.ActionRender.LayoutSettings.title', '系统设置'),\n placement: 'right',\n\n content: <SettingsForm defaultShowFullScreen={defaultShowFullScreen} defaultShowLocaleButton={defaultShowLocaleButton} defaultShowThemeColor={defaultShowThemeColor} defaultKeepAlive={defaultKeepAlive} />,\n });\n };\n\n return (\n <Tooltip title={t('creek-layout.ActionRender.LayoutSettings.title', '系统设置')} placement=\"top\">\n <SettingOutlined onClick={handleOpenSettings} />\n </Tooltip>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgC;AAChC,kBAAmD;AAEnD,mBAAqB;AAErB,yBAAuB;AACvB,oCAAuC;AAWnC;AATJ,IAAM,eAAe,CAAC,EAAE,uBAAuB,yBAAyB,uBAAuB,iBAAiB,MAA2I;AACzP,QAAM,QAAI,mBAAK;AACf,QAAM,EAAE,cAAc,gBAAgB,kBAAkB,WAAW,YAAY,QAAI,sDAAuB;AAE1G,QAAM,wBAAwB,kBAAkB,yBAAyB;AACzE,QAAM,0BAA0B,oBAAoB,2BAA2B;AAC/E,QAAM,mBAAmB,aAAa,oBAAoB;AAE1D,SACE,6CAAC,oBAAK,QAAO,YACV;AAAA,6BACC,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,uDAAuD,KAAK,GAC9E;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU,CAAC,OAAO,QAAQ;AACxB,sBAAY,EAAE,cAAc,OAAO,OAAU,CAAC;AAAA,QAChD;AAAA,QACA,YAAU;AAAA;AAAA,IACZ,GACF;AAAA,IAED,yBACC,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,2DAA2D,QAAQ,GACrF,sDAAC,sBAAO,SAAS,uBAAuB,UAAU,CAAC,YAAY,YAAY,EAAE,gBAAgB,QAAQ,CAAC,GAAG,GAC3G;AAAA,IAED,2BACC,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,6DAA6D,SAAS,GACxF,sDAAC,sBAAO,SAAS,yBAAyB,UAAU,CAAC,YAAY,YAAY,EAAE,kBAAkB,QAAQ,CAAC,GAAG,GAC/G;AAAA,IAED,oBACC,4CAAC,iBAAK,MAAL,EAAU,OAAO,EAAE,sDAAsD,qBAAqB,GAC7F,sDAAC,sBAAO,SAAS,kBAAkB,UAAU,CAAC,YAAY,YAAY,EAAE,WAAW,QAAQ,CAAC,GAAG,GACjG;AAAA,KAEJ;AAEJ;AAEO,IAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,QAAM,QAAI,mBAAK;AACf,QAAM,EAAE,OAAO,QAAI,2BAAO;AAE1B,QAAM,qBAAqB,MAAM;AAC/B,WAAO,KAAK;AAAA,MACV,OAAO,EAAE,kDAAkD,MAAM;AAAA,MACjE,WAAW;AAAA,MAEX,SAAS,4CAAC,gBAAa,uBAA8C,yBAAkD,uBAA8C,kBAAoC;AAAA,IAC3M,CAAC;AAAA,EACH;AAEA,SACE,4CAAC,uBAAQ,OAAO,EAAE,kDAAkD,MAAM,GAAG,WAAU,OACrF,sDAAC,gCAAgB,SAAS,oBAAoB,GAChD;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -8,6 +8,7 @@ export type LayoutProps = ProLayoutProps & {
8
8
  showFullScreen?: boolean;
9
9
  showLocaleButton?: boolean;
10
10
  showSettingsButton?: boolean;
11
+ showThemeColor?: boolean;
11
12
  initialInfo?: {
12
13
  initialState: any;
13
14
  loading: boolean;
@@ -65,6 +65,7 @@ var CreekLayout = (props) => {
65
65
  showFullScreen = false,
66
66
  showLocaleButton = false,
67
67
  showSettingsButton = false,
68
+ showThemeColor = true,
68
69
  keepAlive = false,
69
70
  extraActions = [],
70
71
  ...more
@@ -73,10 +74,10 @@ var CreekLayout = (props) => {
73
74
  const { token } = useToken();
74
75
  const { collapsed } = (0, import_CollapseButton.useCollapsedStore)();
75
76
  const settingsStore = (0, import_useLayoutSettingsStore.useLayoutSettingsStore)();
76
- const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen;
77
- const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton;
77
+ const actualShowFullScreen = showFullScreen && (settingsStore.showFullScreen ?? true);
78
+ const actualShowLocaleButton = showLocaleButton && (settingsStore.showLocaleButton ?? true);
78
79
  const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;
79
- const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;
80
+ const actualKeepAlive = keepAlive && (settingsStore.keepAlive ?? true);
80
81
  const _userConfig = { ...userConfig, ...runtimeConfig };
81
82
  const intlContext = (0, import_react.useContext)(import_react2.IntlContext);
82
83
  const hasI18n = !!intlContext && actualShowLocaleButton;
@@ -130,7 +131,7 @@ var CreekLayout = (props) => {
130
131
  actions.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_creek_locale_button.CreekLocaleButton, {}, "locale-button"));
131
132
  }
132
133
  if (showSettingsButton) {
133
- actions.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionRender.LayoutSettings, { defaultShowFullScreen: showFullScreen, defaultShowLocaleButton: showLocaleButton, defaultKeepAlive: import_lodash.default.isBoolean(keepAlive) ? keepAlive : true }, "settings"));
134
+ actions.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionRender.LayoutSettings, { defaultShowFullScreen: showFullScreen, defaultShowLocaleButton: showLocaleButton, defaultShowThemeColor: showThemeColor, defaultKeepAlive: import_lodash.default.isBoolean(keepAlive) ? keepAlive : true }, "settings"));
134
135
  }
135
136
  const keepAliveProps = import_lodash.default.isBoolean(keepAlive) ? {} : keepAlive;
136
137
  const layoutContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/creek-layout/index.tsx"],
4
- "sourcesContent": ["import { MenuDataItem, ProLayout, ProLayoutProps } from '@ant-design/pro-components';\nimport { useMemoizedFn } from 'ahooks';\nimport { theme } from 'antd';\nimport _ from 'lodash';\nimport { useContext } from 'react';\n\nimport classnames from 'classnames';\n\nimport { IntlContext, useT } from '@creekjs/i18n/react';\n\nimport { CreekKeepAlive, CreekKeepAliveProps } from '../creek-keep-alive';\nimport { CreekLocaleButton } from '../creek-locale-button';\nimport { GlobalScrollbarStyle } from '../creek-style/scrollbar';\nimport { FullScreen, LayoutSettings } from './ActionRender';\nimport { CollapsedButton, useCollapsedStore } from './CollapseButton';\nimport { Exception } from './Exception';\nimport { useLayoutSettingsStore } from './useLayoutSettingsStore';\n\nexport type LayoutProps = ProLayoutProps & {\n runtimeConfig: ProLayoutProps;\n userConfig?: ProLayoutProps;\n navigate?: (path?: string | number) => void;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n showSettingsButton?: boolean;\n initialInfo?: {\n initialState: any;\n loading: boolean;\n setInitialState: () => void;\n };\n keepAlive?: boolean | CreekKeepAliveProps;\n extraActions?: React.ReactNode[];\n};\n\nconst MenuName = ({ name, path }: { name?: string; path?: string }) => {\n const t = useT();\n const key = !path || path === '/' ? 'menu.home' : `menu${path.replace(/\\//g, '.')}`;\n return t(key, name);\n};\n\nexport const CreekLayout = (props: LayoutProps) => {\n const {\n route,\n userConfig,\n runtimeConfig,\n children,\n location,\n navigate,\n showFullScreen = false,\n showLocaleButton = false,\n showSettingsButton = false,\n keepAlive = false,\n extraActions = [],\n ...more\n } = props;\n\n const { useToken } = theme;\n const { token } = useToken();\n\n const { collapsed } = useCollapsedStore();\n const settingsStore = useLayoutSettingsStore();\n\n const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen;\n const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton;\n const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;\n const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;\n\n const _userConfig = { ...userConfig, ...runtimeConfig };\n\n const intlContext = useContext(IntlContext);\n const hasI18n = !!intlContext && actualShowLocaleButton;\n\n const menuDataRender = useMemoizedFn((menuData: MenuDataItem[]) => {\n // 根据当前是否开启了国际化(上下文是否存在)以及用户配置来判断是否包裹菜单翻译\n const isLocaleEnabled = hasI18n;\n\n const mapMenu = (items: MenuDataItem[]): MenuDataItem[] => {\n return items.map((item) => {\n return {\n ...item,\n name: (isLocaleEnabled ? <MenuName name={item.name} path={item.path} /> : item.name) as string,\n children: item.children ? mapMenu(item.children) : undefined,\n };\n });\n };\n return mapMenu(menuData);\n });\n\n const menuItemRender: ProLayoutProps['menuItemRender'] = useMemoizedFn((itemProps, defaultDom) => {\n return (\n <span\n onClick={() => {\n if (navigate) {\n navigate(itemProps.path);\n }\n }}\n >\n {defaultDom}\n </span>\n );\n });\n\n const getTabTitle = useMemoizedFn((pathname: string): string | React.ReactNode => {\n const routes = (route?.routes ?? []) as MenuDataItem[];\n\n const findTitle = (items: MenuDataItem[]): string | undefined => {\n for (const item of items) {\n if (item.path === pathname) return item.name ?? item.title;\n if (item.children) {\n const found = findTitle(item.children);\n if (found) return found;\n }\n }\n };\n\n const title = findTitle(routes) ?? pathname;\n\n return hasI18n ? <MenuName name={title} path={pathname} /> : title;\n });\n\n const actions: React.ReactNode[] = [...extraActions];\n\n if (actualShowFullScreen) {\n actions.push(<FullScreen key=\"full-screen\" />);\n }\n\n if (actualShowLocaleButton) {\n actions.push(<CreekLocaleButton key=\"locale-button\" />);\n }\n\n if (showSettingsButton) {\n actions.push(<LayoutSettings key=\"settings\" defaultShowFullScreen={showFullScreen} defaultShowLocaleButton={showLocaleButton} defaultKeepAlive={_.isBoolean(keepAlive) ? keepAlive : true} />);\n }\n\n const keepAliveProps = _.isBoolean(keepAlive) ? {} : keepAlive;\n\n const layoutContent = (\n <ProLayout\n className={classnames('creek-layout-container', _userConfig?.className)}\n route={route}\n title={_userConfig?.title}\n siderWidth={200}\n location={location}\n menuDataRender={menuDataRender}\n menuItemRender={menuItemRender}\n actionsRender={() => actions}\n token={{\n header: {\n colorBgHeader: '#fff',\n colorHeaderTitle: 'rgba(0, 0, 0, 0.80);',\n colorTextMenuSelected: colorPrimary,\n heightLayoutHeader: 48,\n },\n sider: {\n colorMenuBackground: '#f7f8fa',\n colorBgMenuItemSelected: 'transparent',\n colorTextMenuActive: colorPrimary,\n colorTextMenuSelected: colorPrimary,\n colorTextMenuItemHover: colorPrimary,\n colorTextMenu: '#333',\n },\n pageContainer: {\n paddingBlockPageContainerContent: 0,\n paddingInlinePageContainerContent: 0,\n colorBgPageContainer: 'linear-gradient(180deg, #F7F9FF 0%, #FFF 45.59%);',\n },\n }}\n fixSiderbar\n fixedHeader\n collapsed={collapsed}\n collapsedButtonRender={(collapsed) => {\n return <CollapsedButton collapsed={collapsed} />;\n }}\n {...more}\n >\n <GlobalScrollbarStyle />\n <Exception>{actualKeepAlive ? <CreekKeepAlive getTabTitle={getTabTitle} {...keepAliveProps} /> : children}</Exception>\n </ProLayout>\n );\n\n return layoutContent;\n};\n\nexport * from './Exception';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAwD;AACxD,oBAA8B;AAC9B,kBAAsB;AACtB,oBAAc;AACd,mBAA2B;AAE3B,wBAAuB;AAEvB,IAAAA,gBAAkC;AAElC,8BAAoD;AACpD,iCAAkC;AAClC,uBAAqC;AACrC,0BAA2C;AAC3C,4BAAmD;AACnD,uBAA0B;AAC1B,oCAAuC;AAuKvC,iCAAc,wBAvLd;AAgFmC;AA9CnC,IAAM,WAAW,CAAC,EAAE,MAAM,KAAK,MAAwC;AACrE,QAAM,QAAI,oBAAK;AACf,QAAM,MAAM,CAAC,QAAQ,SAAS,MAAM,cAAc,OAAO,KAAK,QAAQ,OAAO,GAAG;AAChF,SAAO,EAAE,KAAK,IAAI;AACpB;AAEO,IAAM,cAAc,CAAC,UAAuB;AACjD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,YAAY;AAAA,IACZ,eAAe,CAAC;AAAA,IAChB,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,EAAE,MAAM,IAAI,SAAS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yCAAgB,WAAWA,YAAW;AAAA,MAChD;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,oDAAC,yCAAqB;AAAA,QACtB,4CAAC,8BAAW,4BAAkB,4CAAC,0CAAe,aAA2B,GAAG,gBAAgB,IAAK,UAAS;AAAA;AAAA;AAAA,EAC5G;AAGF,SAAO;AACT;",
4
+ "sourcesContent": ["import { MenuDataItem, ProLayout, ProLayoutProps } from '@ant-design/pro-components';\nimport { useMemoizedFn } from 'ahooks';\nimport { theme } from 'antd';\nimport _ from 'lodash';\nimport { useContext } from 'react';\n\nimport classnames from 'classnames';\n\nimport { IntlContext, useT } from '@creekjs/i18n/react';\n\nimport { CreekKeepAlive, CreekKeepAliveProps } from '../creek-keep-alive';\nimport { CreekLocaleButton } from '../creek-locale-button';\nimport { GlobalScrollbarStyle } from '../creek-style/scrollbar';\nimport { FullScreen, LayoutSettings } from './ActionRender';\nimport { CollapsedButton, useCollapsedStore } from './CollapseButton';\nimport { Exception } from './Exception';\nimport { useLayoutSettingsStore } from './useLayoutSettingsStore';\n\nexport type LayoutProps = ProLayoutProps & {\n runtimeConfig: ProLayoutProps;\n userConfig?: ProLayoutProps;\n navigate?: (path?: string | number) => void;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n showSettingsButton?: boolean;\n showThemeColor?: boolean;\n initialInfo?: {\n initialState: any;\n loading: boolean;\n setInitialState: () => void;\n };\n keepAlive?: boolean | CreekKeepAliveProps;\n extraActions?: React.ReactNode[];\n};\n\nconst MenuName = ({ name, path }: { name?: string; path?: string }) => {\n const t = useT();\n const key = !path || path === '/' ? 'menu.home' : `menu${path.replace(/\\//g, '.')}`;\n return t(key, name);\n};\n\nexport const CreekLayout = (props: LayoutProps) => {\n const {\n route,\n userConfig,\n runtimeConfig,\n children,\n location,\n navigate,\n showFullScreen = false,\n showLocaleButton = false,\n showSettingsButton = false,\n showThemeColor = true,\n keepAlive = false,\n extraActions = [],\n ...more\n } = props;\n\n const { useToken } = theme;\n const { token } = useToken();\n\n const { collapsed } = useCollapsedStore();\n const settingsStore = useLayoutSettingsStore();\n\n const actualShowFullScreen = showFullScreen && (settingsStore.showFullScreen ?? true);\n const actualShowLocaleButton = showLocaleButton && (settingsStore.showLocaleButton ?? true);\n const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;\n const actualKeepAlive = keepAlive && (settingsStore.keepAlive ?? true);\n\n const _userConfig = { ...userConfig, ...runtimeConfig };\n\n const intlContext = useContext(IntlContext);\n const hasI18n = !!intlContext && actualShowLocaleButton;\n\n const menuDataRender = useMemoizedFn((menuData: MenuDataItem[]) => {\n // 根据当前是否开启了国际化(上下文是否存在)以及用户配置来判断是否包裹菜单翻译\n const isLocaleEnabled = hasI18n;\n\n const mapMenu = (items: MenuDataItem[]): MenuDataItem[] => {\n return items.map((item) => {\n return {\n ...item,\n name: (isLocaleEnabled ? <MenuName name={item.name} path={item.path} /> : item.name) as string,\n children: item.children ? mapMenu(item.children) : undefined,\n };\n });\n };\n return mapMenu(menuData);\n });\n\n const menuItemRender: ProLayoutProps['menuItemRender'] = useMemoizedFn((itemProps, defaultDom) => {\n return (\n <span\n onClick={() => {\n if (navigate) {\n navigate(itemProps.path);\n }\n }}\n >\n {defaultDom}\n </span>\n );\n });\n\n const getTabTitle = useMemoizedFn((pathname: string): string | React.ReactNode => {\n const routes = (route?.routes ?? []) as MenuDataItem[];\n\n const findTitle = (items: MenuDataItem[]): string | undefined => {\n for (const item of items) {\n if (item.path === pathname) return item.name ?? item.title;\n if (item.children) {\n const found = findTitle(item.children);\n if (found) return found;\n }\n }\n };\n\n const title = findTitle(routes) ?? pathname;\n\n return hasI18n ? <MenuName name={title} path={pathname} /> : title;\n });\n\n const actions: React.ReactNode[] = [...extraActions];\n\n if (actualShowFullScreen) {\n actions.push(<FullScreen key=\"full-screen\" />);\n }\n\n if (actualShowLocaleButton) {\n actions.push(<CreekLocaleButton key=\"locale-button\" />);\n }\n\n if (showSettingsButton) {\n actions.push(<LayoutSettings key=\"settings\" defaultShowFullScreen={showFullScreen} defaultShowLocaleButton={showLocaleButton} defaultShowThemeColor={showThemeColor} defaultKeepAlive={_.isBoolean(keepAlive) ? keepAlive : true} />);\n }\n\n const keepAliveProps = _.isBoolean(keepAlive) ? {} : keepAlive;\n\n const layoutContent = (\n <ProLayout\n className={classnames('creek-layout-container', _userConfig?.className)}\n route={route}\n title={_userConfig?.title}\n siderWidth={200}\n location={location}\n menuDataRender={menuDataRender}\n menuItemRender={menuItemRender}\n actionsRender={() => actions}\n token={{\n header: {\n colorBgHeader: '#fff',\n colorHeaderTitle: 'rgba(0, 0, 0, 0.80);',\n colorTextMenuSelected: colorPrimary,\n heightLayoutHeader: 48,\n },\n sider: {\n colorMenuBackground: '#f7f8fa',\n colorBgMenuItemSelected: 'transparent',\n colorTextMenuActive: colorPrimary,\n colorTextMenuSelected: colorPrimary,\n colorTextMenuItemHover: colorPrimary,\n colorTextMenu: '#333',\n },\n pageContainer: {\n paddingBlockPageContainerContent: 0,\n paddingInlinePageContainerContent: 0,\n colorBgPageContainer: 'linear-gradient(180deg, #F7F9FF 0%, #FFF 45.59%);',\n },\n }}\n fixSiderbar\n fixedHeader\n collapsed={collapsed}\n collapsedButtonRender={(collapsed) => {\n return <CollapsedButton collapsed={collapsed} />;\n }}\n {...more}\n >\n <GlobalScrollbarStyle />\n <Exception>{actualKeepAlive ? <CreekKeepAlive getTabTitle={getTabTitle} {...keepAliveProps} /> : children}</Exception>\n </ProLayout>\n );\n\n return layoutContent;\n};\n\nexport * from './Exception';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAwD;AACxD,oBAA8B;AAC9B,kBAAsB;AACtB,oBAAc;AACd,mBAA2B;AAE3B,wBAAuB;AAEvB,IAAAA,gBAAkC;AAElC,8BAAoD;AACpD,iCAAkC;AAClC,uBAAqC;AACrC,0BAA2C;AAC3C,4BAAmD;AACnD,uBAA0B;AAC1B,oCAA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BAA0B,2CAAa,SAAS;AAAA,MACtE;AAAA,MACA,OAAO,2CAAa;AAAA,MACpB,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe,MAAM;AAAA,MACrB,OAAO;AAAA,QACL,QAAQ;AAAA,UACN,eAAe;AAAA,UACf,kBAAkB;AAAA,UAClB,uBAAuB;AAAA,UACvB,oBAAoB;AAAA,QACtB;AAAA,QACA,OAAO;AAAA,UACL,qBAAqB;AAAA,UACrB,yBAAyB;AAAA,UACzB,qBAAqB;AAAA,UACrB,uBAAuB;AAAA,UACvB,wBAAwB;AAAA,UACxB,eAAe;AAAA,QACjB;AAAA,QACA,eAAe;AAAA,UACb,kCAAkC;AAAA,UAClC,mCAAmC;AAAA,UACnC,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MACA,aAAW;AAAA,MACX,aAAW;AAAA,MACX;AAAA,MACA,uBAAuB,CAACC,eAAc;AACpC,eAAO,4CAAC,yCAAgB,WAAWA,YAAW;AAAA,MAChD;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,oDAAC,yCAAqB;AAAA,QACtB,4CAAC,8BAAW,4BAAkB,4CAAC,0CAAe,aAA2B,GAAG,gBAAgB,IAAK,UAAS;AAAA;AAAA;AAAA,EAC5G;AAGF,SAAO;AACT;",
6
6
  "names": ["import_react", "_", "classnames", "collapsed"]
7
7
  }
@@ -9,12 +9,12 @@ export declare const useLayoutSettingsStore: import("zustand").UseBoundStore<Omi
9
9
  setState(partial: LayoutSettingsStore | Partial<LayoutSettingsStore> | ((state: LayoutSettingsStore) => LayoutSettingsStore | Partial<LayoutSettingsStore>), replace?: false | undefined): unknown;
10
10
  setState(state: LayoutSettingsStore | ((state: LayoutSettingsStore) => LayoutSettingsStore), replace: true): unknown;
11
11
  persist: {
12
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<LayoutSettingsStore, LayoutSettingsStore, unknown>>) => void;
12
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<LayoutSettingsStore, any, unknown>>) => void;
13
13
  clearStorage: () => void;
14
14
  rehydrate: () => void | Promise<void>;
15
15
  hasHydrated: () => boolean;
16
16
  onHydrate: (fn: (state: LayoutSettingsStore) => void) => () => void;
17
17
  onFinishHydration: (fn: (state: LayoutSettingsStore) => void) => () => void;
18
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<LayoutSettingsStore, LayoutSettingsStore, unknown>>;
18
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<LayoutSettingsStore, any, unknown>>;
19
19
  };
20
20
  }>;
@@ -28,13 +28,20 @@ var useLayoutSettingsStore = (0, import_zustand.create)()(
28
28
  (0, import_middleware.persist)(
29
29
  (set) => ({
30
30
  colorPrimary: void 0,
31
- showFullScreen: false,
32
- showLocaleButton: false,
33
- keepAlive: false,
31
+ showFullScreen: void 0,
32
+ showLocaleButton: void 0,
33
+ keepAlive: void 0,
34
34
  setSettings: (settings) => set((state) => ({ ...state, ...settings }))
35
35
  }),
36
36
  {
37
- name: "creek-layout-settings"
37
+ name: "creek-layout-settings",
38
+ version: 2,
39
+ migrate: (persistedState, version) => {
40
+ if (version < 2) {
41
+ return { ...persistedState, showFullScreen: void 0, showLocaleButton: void 0, keepAlive: void 0 };
42
+ }
43
+ return persistedState;
44
+ }
38
45
  }
39
46
  )
40
47
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/creek-layout/useLayoutSettingsStore.ts"],
4
- "sourcesContent": ["import { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\n\nexport type LayoutSettingsStore = {\n colorPrimary?: string;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n keepAlive?: boolean;\n setSettings: (settings: Partial<LayoutSettingsStore>) => void;\n};\n\nexport const useLayoutSettingsStore = create<LayoutSettingsStore>()(\n persist(\n (set) => ({\n colorPrimary: undefined,\n showFullScreen: false,\n showLocaleButton: false,\n keepAlive: false,\n setSettings: (settings) => set((state) => ({ ...state, ...settings })),\n }),\n {\n name: 'creek-layout-settings',\n }\n )\n);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AACvB,wBAAwB;AAUjB,IAAM,6BAAyB,uBAA4B;AAAA,MAChE;AAAA,IACE,CAAC,SAAS;AAAA,MACR,cAAc;AAAA,MACd,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,aAAa,CAAC,aAAa,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,GAAG,SAAS,EAAE;AAAA,IACvE;AAAA,IACA;AAAA,MACE,MAAM;AAAA,IACR;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\n\nexport type LayoutSettingsStore = {\n colorPrimary?: string;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n keepAlive?: boolean;\n setSettings: (settings: Partial<LayoutSettingsStore>) => void;\n};\n\nexport const useLayoutSettingsStore = create<LayoutSettingsStore>()(\n persist(\n (set) => ({\n colorPrimary: undefined,\n showFullScreen: undefined,\n showLocaleButton: undefined,\n keepAlive: undefined,\n setSettings: (settings) => set((state) => ({ ...state, ...settings })),\n }),\n {\n name: 'creek-layout-settings',\n version: 2,\n migrate: (persistedState: any, version: number) => {\n if (version < 2) {\n // 旧版本布尔默认值为 false,新版本改为 undefined\n // 清除旧版本的布尔类型字段,让外层配置优先生效\n return { ...persistedState, showFullScreen: undefined, showLocaleButton: undefined, keepAlive: undefined };\n }\n return persistedState;\n },\n }\n )\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AACvB,wBAAwB;AAUjB,IAAM,6BAAyB,uBAA4B;AAAA,MAChE;AAAA,IACE,CAAC,SAAS;AAAA,MACR,cAAc;AAAA,MACd,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,aAAa,CAAC,aAAa,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,GAAG,SAAS,EAAE;AAAA,IACvE;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS,CAAC,gBAAqB,YAAoB;AACjD,YAAI,UAAU,GAAG;AAGf,iBAAO,EAAE,GAAG,gBAAgB,gBAAgB,QAAW,kBAAkB,QAAW,WAAW,OAAU;AAAA,QAC3G;AACA,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -92,6 +92,11 @@ var useStyles = (0, import_antd_style.createStyles)(({ token }, options) => {
92
92
  padding: token.paddingXS
93
93
  }
94
94
  },
95
+ // 树形数据展开图标样式
96
+ [`.${prefixCls}-table-row-expand-icon`]: {
97
+ marginInlineEnd: 4,
98
+ flexShrink: 0
99
+ },
95
100
  // 如果没有 headerTitle,toolbar 展示在 headerTitle 的区域
96
101
  [`.${prefixCls}-pro-table-list-toolbar-right`]: !hasHeaderTitle ? {
97
102
  flex: 1
@@ -119,8 +124,19 @@ var SearchProTable = (props) => {
119
124
  size,
120
125
  headerTitle,
121
126
  showIndex = true,
127
+ expandable,
122
128
  ...restProps
123
129
  } = props;
130
+ const finalExpandable = (0, import_react.useMemo)(() => {
131
+ if (!showIndex)
132
+ return expandable;
133
+ if (!expandable)
134
+ return { columnPos: 1 };
135
+ if (expandable.columnPos === void 0) {
136
+ return { ...expandable, columnPos: 1 };
137
+ }
138
+ return expandable;
139
+ }, [expandable, showIndex]);
124
140
  const proTableRef = (0, import_react.useRef)(null);
125
141
  const [resizedWidths, setResizedWidths] = (0, import_ahooks.useSafeState)({});
126
142
  const { finalOptions, tableSize, finalOptionsRender } = (0, import_hooks.useTableOptions)(options, size, optionsRender);
@@ -141,6 +157,8 @@ var SearchProTable = (props) => {
141
157
  optionsRender: finalOptionsRender,
142
158
  size: tableSize,
143
159
  ...restProps,
160
+ pagination,
161
+ expandable: finalExpandable,
144
162
  className: (0, import_classnames.default)(styles["creek-table-container"], className),
145
163
  columns: resizableColumns,
146
164
  bordered,