@creekjs/web-components 1.0.8 → 1.0.9

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.
@@ -1,55 +1,55 @@
1
1
 
2
2
  
3
- > @creekjs/web-components@1.0.7 father:build /Users/ernestwang/Documents/code-resoorce/creek/packages/web-components
3
+ > @creekjs/web-components@1.0.9 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
8
  event - Bundless CreekConfigContext.tsx to dist/creek-config-provider/CreekConfigContext.js (with declaration)
9
- event - Bundless index.tsx to dist/creek-config-provider/index.js (with declaration)
10
- event - Bundless CreekI18nProvider.tsx to dist/creek-config-provider/CreekI18nProvider.js (with declaration)
9
+ event - Bundless DrawerHelper.tsx to dist/creek-hooks/useApp/DrawerHelper.js (with declaration)
11
10
  event - Bundless index.ts to dist/creek-hooks/index.js (with declaration)
12
- event - Bundless ModalHelper.tsx to dist/creek-hooks/useApp/ModalHelper.js (with declaration)
13
- event - Bundless index.tsx to dist/creek-hooks/useApp/index.js (with declaration)
14
11
  event - Bundless useViewportHeight.tsx to dist/creek-hooks/useViewportHeight.js (with declaration)
15
- event - Bundless types.ts to dist/creek-hooks/useApp/types.js (with declaration)
16
- event - Bundless index.tsx to dist/creek-keep-alive/index.js (with declaration)
12
+ event - Bundless CreekI18nProvider.tsx to dist/creek-config-provider/CreekI18nProvider.js (with declaration)
13
+ event - Bundless index.tsx to dist/creek-hooks/useApp/index.js (with declaration)
17
14
  event - Bundless index.tsx to dist/creek-icon/index.js (with declaration)
18
- event - Bundless DrawerHelper.tsx to dist/creek-hooks/useApp/DrawerHelper.js (with declaration)
15
+ event - Bundless types.ts to dist/creek-hooks/useApp/types.js (with declaration)
19
16
  event - Bundless FullScreen.tsx to dist/creek-layout/ActionRender/FullScreen.js (with declaration)
20
- event - Bundless index.tsx to dist/creek-layout/ActionRender/index.js (with declaration)
21
17
  event - Bundless UserInfo.tsx to dist/creek-layout/ActionRender/UserInfo.js (with declaration)
18
+ event - Bundless ModalHelper.tsx to dist/creek-hooks/useApp/ModalHelper.js (with declaration)
19
+ event - Bundless index.tsx to dist/creek-keep-alive/index.js (with declaration)
22
20
  event - Bundless index.tsx to dist/creek-layout/Exception/index.js (with declaration)
23
21
  event - Bundless NotFound.tsx to dist/creek-layout/Exception/NotFound.js (with declaration)
24
- event - Bundless LayoutSettings.tsx to dist/creek-layout/ActionRender/LayoutSettings.js (with declaration)
25
22
  event - Bundless CollapseButton.tsx to dist/creek-layout/CollapseButton.js (with declaration)
26
- event - Bundless index.ts to dist/creek-style/index.js (with declaration)
27
- event - Bundless index.tsx to dist/creek-locale-button/index.js (with declaration)
28
- event - Bundless index.tsx to dist/creek-page-container/index.js (with declaration)
29
- event - Bundless scrollbar.ts to dist/creek-style/scrollbar.js (with declaration)
30
- event - Bundless useLayoutSettingsStore.ts to dist/creek-layout/useLayoutSettingsStore.js (with declaration)
23
+ event - Bundless NotFoundPage.tsx to dist/creek-layout/Exception/NotFoundPage.js (with declaration)
24
+ event - Bundless index.tsx to dist/creek-layout/ActionRender/index.js (with declaration)
31
25
  event - Bundless index.tsx to dist/creek-loading/index.js (with declaration)
32
- event - Bundless DensityIcon.tsx to dist/creek-table/components/DensityIcon.js (with declaration)
33
26
  event - Bundless index.tsx to dist/creek-layout/index.js (with declaration)
27
+ event - Bundless LayoutSettings.tsx to dist/creek-layout/ActionRender/LayoutSettings.js (with declaration)
28
+ event - Bundless index.tsx to dist/creek-page-container/index.js (with declaration)
29
+ event - Bundless useLayoutSettingsStore.ts to dist/creek-layout/useLayoutSettingsStore.js (with declaration)
30
+ event - Bundless index.ts to dist/creek-style/index.js (with declaration)
31
+ event - Bundless scrollbar.ts to dist/creek-style/scrollbar.js (with declaration)
32
+ event - Bundless index.tsx to dist/creek-locale-button/index.js (with declaration)
34
33
  event - Bundless index.tsx to dist/creek-table/components/index.js (with declaration)
35
- event - Bundless EllipsisTooltip.tsx to dist/creek-table/components/EllipsisTooltip.js (with declaration)
36
- event - Bundless NotFoundPage.tsx to dist/creek-layout/Exception/NotFoundPage.js (with declaration)
37
34
  event - Bundless index.ts to dist/creek-table/hooks/index.js (with declaration)
35
+ event - Bundless DensityIcon.tsx to dist/creek-table/components/DensityIcon.js (with declaration)
38
36
  event - Bundless useAdaptiveToolBar.tsx to dist/creek-table/hooks/useAdaptiveToolBar.js (with declaration)
39
- event - Bundless useEllipsisColumns.tsx to dist/creek-table/hooks/useEllipsisColumns.js (with declaration)
40
- event - Bundless useResizableColumns.tsx to dist/creek-table/hooks/useResizableColumns.js (with declaration)
37
+ event - Bundless useIndexColumn.tsx to dist/creek-table/hooks/useIndexColumn.js (with declaration)
41
38
  event - Bundless useAutoWidthColumns.tsx to dist/creek-table/hooks/useAutoWidthColumns.js (with declaration)
42
- event - Bundless useTableOptions.tsx to dist/creek-table/hooks/useTableOptions.js (with declaration)
39
+ event - Bundless useEllipsisColumns.tsx to dist/creek-table/hooks/useEllipsisColumns.js (with declaration)
40
+ event - Bundless EllipsisTooltip.tsx to dist/creek-table/components/EllipsisTooltip.js (with declaration)
41
+ event - Bundless useElementDistance.tsx to dist/creek-table/hooks/useElementDistance.js (with declaration)
43
42
  event - Bundless index.tsx to dist/creek-table/index.js (with declaration)
44
- event - Bundless useIndexColumn.tsx to dist/creek-table/hooks/useIndexColumn.js (with declaration)
45
43
  event - Bundless useTableScrollHeight.tsx to dist/creek-table/hooks/useTableScrollHeight.js (with declaration)
46
- event - Bundless useElementDistance.tsx to dist/creek-table/hooks/useElementDistance.js (with declaration)
44
+ event - Bundless useTableOptions.tsx to dist/creek-table/hooks/useTableOptions.js (with declaration)
47
45
  event - Bundless useStatusColumns.tsx to dist/creek-table/hooks/useStatusColumns.js (with declaration)
48
- event - Bundless type.ts to dist/creek-table/type.js (with declaration)
49
- event - Bundless zh-CN.ts to dist/locales/zh-CN.js (with declaration)
50
46
  event - Bundless index.tsx to dist/index.js (with declaration)
51
- event - Bundless SearchTable.tsx to dist/creek-table/SearchTable.js (with declaration)
47
+ event - Bundless zh-CN.ts to dist/locales/zh-CN.js (with declaration)
52
48
  event - Bundless en-US.ts to dist/locales/en-US.js (with declaration)
49
+ event - Bundless useResizableColumns.tsx to dist/creek-table/hooks/useResizableColumns.js (with declaration)
53
50
  event - Bundless i18n.ts to dist/utils/i18n.js (with declaration)
51
+ event - Bundless index.tsx to dist/creek-config-provider/index.js (with declaration)
52
+ event - Bundless type.ts to dist/creek-table/type.js (with declaration)
53
+ event - Bundless SearchTable.tsx to dist/creek-table/SearchTable.js (with declaration)
54
54
  event - Generate declaration files...
55
- event - Transformed successfully in 8670 ms (46 files)
55
+ event - Transformed successfully in 3948 ms (46 files)
@@ -76,13 +76,15 @@ var CreekLayout = (props) => {
76
76
  const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton;
77
77
  const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;
78
78
  const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;
79
- console.log(actualKeepAlive, "actualKeepAlive");
79
+ const _userConfig = { ...userConfig, ...runtimeConfig };
80
80
  const menuDataRender = (0, import_ahooks.useMemoizedFn)((menuData) => {
81
+ var _a, _b;
82
+ const isLocaleEnabled = ((_a = more.menu) == null ? void 0 : _a.locale) !== false && ((_b = _userConfig.menu) == null ? void 0 : _b.locale) !== false;
81
83
  const mapMenu = (items) => {
82
84
  return items.map((item) => {
83
85
  return {
84
86
  ...item,
85
- name: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuName, { name: item.name, path: item.path }),
87
+ name: isLocaleEnabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuName, { name: item.name, path: item.path }) : item.name,
86
88
  children: item.children ? mapMenu(item.children) : void 0
87
89
  };
88
90
  });
@@ -128,7 +130,6 @@ var CreekLayout = (props) => {
128
130
  actions.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionRender.LayoutSettings, { defaultShowFullScreen: showFullScreen, defaultShowLocaleButton: showLocaleButton, defaultKeepAlive: import_lodash.default.isBoolean(keepAlive) ? keepAlive : true }, "settings"));
129
131
  }
130
132
  const keepAliveProps = import_lodash.default.isBoolean(keepAlive) ? {} : keepAlive;
131
- const _userConfig = { ...userConfig, ...runtimeConfig };
132
133
  const layoutContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
133
134
  import_pro_components.ProLayout,
134
135
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/creek-layout/index.tsx"],
4
- "sourcesContent": ["import { ProLayout, ProLayoutProps } from '@ant-design/pro-components';\nimport { useMemoizedFn } from 'ahooks';\nimport { theme } from 'antd';\nimport _ from 'lodash';\n\nimport classnames from 'classnames';\n\nimport { 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 console.log(actualKeepAlive, 'actualKeepAlive');\n\n const menuDataRender = useMemoizedFn((menuData: any[]) => {\n const mapMenu = (items: any[]): any[] => {\n return items.map((item) => {\n return {\n ...item,\n name: <MenuName name={item.name} path={item.path} />,\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) => {\n const findTitle = (routes: any[]): string | React.ReactNode | undefined => {\n for (const r of routes) {\n if (r.path === pathname) return r.name || r.title;\n if (r.children) {\n const found = findTitle(r.children);\n if (found) return found;\n }\n }\n return undefined;\n };\n return findTitle(route?.routes || []) || pathname;\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 _userConfig = { ...userConfig, ...runtimeConfig };\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,4BAA0C;AAC1C,oBAA8B;AAC9B,kBAAsB;AACtB,oBAAc;AAEd,wBAAuB;AAEvB,mBAAqB;AAErB,8BAAoD;AACpD,iCAAkC;AAClC,uBAAqC;AACrC,0BAA2C;AAC3C,4BAAmD;AACnD,uBAA0B;AAC1B,oCAAuC;AA+JvC,iCAAc,wBA9Kd;AAoCS;AAHT,IAAM,WAAW,CAAC,EAAE,MAAM,KAAK,MAAuC;AACpE,QAAM,QAAI,mBAAK;AACf,QAAM,MAAM,CAAC,QAAQ,SAAS,MAAM,cAAc,OAAO,KAAK,QAAQ,OA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,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;",
4
+ "sourcesContent": ["import { ProLayout, ProLayoutProps } from '@ant-design/pro-components';\nimport { useMemoizedFn } from 'ahooks';\nimport { theme } from 'antd';\nimport _ from 'lodash';\n\nimport classnames from 'classnames';\n\nimport { 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 menuDataRender = useMemoizedFn((menuData: any[]) => {\n const isLocaleEnabled = more.menu?.locale !== false && _userConfig.menu?.locale !== false;\n\n const mapMenu = (items: any[]): any[] => {\n return items.map((item) => {\n return {\n ...item,\n name: isLocaleEnabled ? <MenuName name={item.name} path={item.path} /> : item.name,\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) => {\n const findTitle = (routes: any[]): string | React.ReactNode | undefined => {\n for (const r of routes) {\n if (r.path === pathname) return r.name || r.title;\n if (r.children) {\n const found = findTitle(r.children);\n if (found) return found;\n }\n }\n return undefined;\n };\n return findTitle(route?.routes || []) || pathname;\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,4BAA0C;AAC1C,oBAA8B;AAC9B,kBAAsB;AACtB,oBAAc;AAEd,wBAAuB;AAEvB,mBAAqB;AAErB,8BAAoD;AACpD,iCAAkC;AAClC,uBAAqC;AACrC,0BAA2C;AAC3C,4BAAmD;AACnD,uBAA0B;AAC1B,oCAAuC;AA+JvC,iCAAc,wBA9Kd;AAoCS;AAHT,IAAM,WAAW,CAAC,EAAE,MAAM,KAAK,MA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AClB,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": ["_", "classnames", "collapsed"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creekjs/web-components",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],
@@ -14,7 +14,7 @@
14
14
  "react-resizable": "^3.1.3",
15
15
  "react-router-dom": "^7.13.0",
16
16
  "zustand": "^5.0.1",
17
- "@creekjs/i18n": "^1.0.0"
17
+ "@creekjs/i18n": "^1.0.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/lodash": "^4.17.20",
@@ -64,14 +64,16 @@ export const CreekLayout = (props: LayoutProps) => {
64
64
  const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;
65
65
  const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;
66
66
 
67
- console.log(actualKeepAlive, 'actualKeepAlive');
67
+ const _userConfig = { ...userConfig, ...runtimeConfig };
68
68
 
69
69
  const menuDataRender = useMemoizedFn((menuData: any[]) => {
70
+ const isLocaleEnabled = more.menu?.locale !== false && _userConfig.menu?.locale !== false;
71
+
70
72
  const mapMenu = (items: any[]): any[] => {
71
73
  return items.map((item) => {
72
74
  return {
73
75
  ...item,
74
- name: <MenuName name={item.name} path={item.path} />,
76
+ name: isLocaleEnabled ? <MenuName name={item.name} path={item.path} /> : item.name,
75
77
  children: item.children ? mapMenu(item.children) : undefined,
76
78
  };
77
79
  });
@@ -123,8 +125,6 @@ export const CreekLayout = (props: LayoutProps) => {
123
125
 
124
126
  const keepAliveProps = _.isBoolean(keepAlive) ? {} : keepAlive;
125
127
 
126
- const _userConfig = { ...userConfig, ...runtimeConfig };
127
-
128
128
  const layoutContent = (
129
129
  <ProLayout
130
130
  className={classnames('creek-layout-container', _userConfig?.className)}