@tiny-codes/react-easy 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/es/components/ConfigProvider/index.js +3 -2
- package/es/components/ConfigProvider/index.js.map +1 -1
- package/es/components/ConfigProvider/style/index.js +9 -72
- package/es/components/ConfigProvider/style/index.js.map +1 -1
- package/lib/components/ConfigProvider/index.js +2 -2
- package/lib/components/ConfigProvider/index.js.map +2 -2
- package/lib/components/ConfigProvider/style/index.js +15 -5
- package/lib/components/ConfigProvider/style/index.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -33,9 +33,10 @@ var ConfigProvider = function ConfigProvider(props) {
|
|
|
33
33
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
34
34
|
var langInProps = restProps.lang;
|
|
35
35
|
var _useContext = useContext(ReactConfigProvider.ConfigContext),
|
|
36
|
-
getPrefixCls = _useContext.getPrefixCls
|
|
36
|
+
getPrefixCls = _useContext.getPrefixCls,
|
|
37
|
+
rootPrefixCls = _useContext.rootPrefixCls;
|
|
37
38
|
var prefixCls = getPrefixCls('react-easy', prefixClsInProps);
|
|
38
|
-
var _useStyle = useStyle(prefixCls),
|
|
39
|
+
var _useStyle = useStyle(prefixCls, rootPrefixCls),
|
|
39
40
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
40
41
|
wrapCSSVar = _useStyle2[0],
|
|
41
42
|
hashId = _useStyle2[1],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useEffect","ConfigProvider","ReactConfigProvider","classNames","locales","langs","resources","ReactEasyContext","useStyle","jsx","_jsx","props","children","userLocales","prefixClsInProps","prefixCls","className","style","restProps","_objectWithoutProperties","_excluded","langInProps","lang","_useContext","ConfigContext","getPrefixCls","_useStyle","_useStyle2","_slicedToArray","wrapCSSVar","hashId","cssVarCls","includes","removeResourceBundle","addResourceBundle","_objectSpread","translation","en","changeLanguage","Provider","value","displayName"],"sources":["../../../src/components/ConfigProvider/index.tsx"],"sourcesContent":["import type { CSSProperties, FC, ReactNode } from 'react';\nimport { useContext, useEffect } from 'react';\nimport { ConfigProvider as ReactConfigProvider } from 'antd';\nimport classNames from 'classnames';\nimport locales, { langs, resources } from '../../locales';\nimport type localesEn from '../../locales/langs/en';\nimport ReactEasyContext, { type ReactEasyContextProps } from './context';\nimport useStyle from './style';\n\nexport interface ConfigProviderProps extends ReactEasyContextProps {\n prefixCls?: string;\n className?: string;\n style?: CSSProperties;\n /**\n * - **EN:** Custom localization resources, if `lang` exists, it will override the localization\n * resources of that language, otherwise, it will add a new language\n * - **CN:** 自定义本地化资源,如果`lang`存在,则会覆盖该语言的本地化资源,否则,会添加一种新的语言\n */\n locales?: Partial<typeof localesEn>;\n children: ReactNode;\n}\n\n/**\n * - **EN:** Provide global configuration for AntdHelper\n * - **CN:** 提供AntdHelper的全局配置\n */\nconst ConfigProvider: FC<ConfigProviderProps> = (props) => {\n const { children, locales: userLocales, prefixCls: prefixClsInProps, className, style, ...restProps } = props;\n const { lang: langInProps } = restProps;\n const { getPrefixCls } = useContext(ReactConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('react-easy', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n\n useEffect(() => {\n // Dynamically add language pack\n if (userLocales) {\n const lang = langInProps || 'en';\n if (lang && langs.includes(lang)) {\n locales.removeResourceBundle(lang, 'translation');\n locales.addResourceBundle(lang, 'translation', { ...resources[lang].translation, ...userLocales });\n } else {\n locales.addResourceBundle(lang, 'translation', { ...resources.en.translation, ...userLocales });\n }\n }\n }, [langInProps, userLocales]);\n\n useEffect(() => {\n // Set the language of the component\n locales.changeLanguage(langInProps || 'en');\n }, [langInProps]);\n\n return wrapCSSVar(\n <ReactEasyContext.Provider value={restProps}>\n <div className={classNames(hashId, cssVarCls, prefixCls, className)} style={style}>\n {children}\n </div>\n </ReactEasyContext.Provider>\n );\n};\nConfigProvider.displayName = 'ReactEasyConfigProvider';\n\nexport default ConfigProvider;\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7C,SAASC,cAAc,IAAIC,mBAAmB,QAAQ,MAAM;AAC5D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,IAAIC,KAAK,EAAEC,SAAS;AAElC,OAAOC,gBAAgB;AACvB,OAAOC,QAAQ;AAAgB,SAAAC,GAAA,IAAAC,IAAA;AAe/B;AACA;AACA;AACA;AACA,IAAMT,cAAuC,GAAG,SAA1CA,cAAuCA,CAAIU,KAAK,EAAK;EACzD,IAAQC,QAAQ,GAAwFD,KAAK,CAArGC,QAAQ;IAAWC,WAAW,GAAkEF,KAAK,CAA3FP,OAAO;IAA0BU,gBAAgB,GAAqCH,KAAK,CAArEI,SAAS;IAAoBC,SAAS,GAA0BL,KAAK,CAAxCK,SAAS;IAAEC,KAAK,GAAmBN,KAAK,CAA7BM,KAAK;IAAKC,SAAS,GAAAC,wBAAA,CAAKR,KAAK,EAAAS,SAAA;EAC7G,IAAcC,WAAW,GAAKH,SAAS,CAA/BI,IAAI;EACZ,IAAAC,WAAA,
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","ConfigProvider","ReactConfigProvider","classNames","locales","langs","resources","ReactEasyContext","useStyle","jsx","_jsx","props","children","userLocales","prefixClsInProps","prefixCls","className","style","restProps","_objectWithoutProperties","_excluded","langInProps","lang","_useContext","ConfigContext","getPrefixCls","rootPrefixCls","_useStyle","_useStyle2","_slicedToArray","wrapCSSVar","hashId","cssVarCls","includes","removeResourceBundle","addResourceBundle","_objectSpread","translation","en","changeLanguage","Provider","value","displayName"],"sources":["../../../src/components/ConfigProvider/index.tsx"],"sourcesContent":["import type { CSSProperties, FC, ReactNode } from 'react';\nimport { useContext, useEffect } from 'react';\nimport { ConfigProvider as ReactConfigProvider } from 'antd';\nimport classNames from 'classnames';\nimport locales, { langs, resources } from '../../locales';\nimport type localesEn from '../../locales/langs/en';\nimport ReactEasyContext, { type ReactEasyContextProps } from './context';\nimport useStyle from './style';\n\nexport interface ConfigProviderProps extends ReactEasyContextProps {\n prefixCls?: string;\n className?: string;\n style?: CSSProperties;\n /**\n * - **EN:** Custom localization resources, if `lang` exists, it will override the localization\n * resources of that language, otherwise, it will add a new language\n * - **CN:** 自定义本地化资源,如果`lang`存在,则会覆盖该语言的本地化资源,否则,会添加一种新的语言\n */\n locales?: Partial<typeof localesEn>;\n children: ReactNode;\n}\n\n/**\n * - **EN:** Provide global configuration for AntdHelper\n * - **CN:** 提供AntdHelper的全局配置\n */\nconst ConfigProvider: FC<ConfigProviderProps> = (props) => {\n const { children, locales: userLocales, prefixCls: prefixClsInProps, className, style, ...restProps } = props;\n const { lang: langInProps } = restProps;\n const { getPrefixCls, rootPrefixCls } = useContext(ReactConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('react-easy', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootPrefixCls);\n\n useEffect(() => {\n // Dynamically add language pack\n if (userLocales) {\n const lang = langInProps || 'en';\n if (lang && langs.includes(lang)) {\n locales.removeResourceBundle(lang, 'translation');\n locales.addResourceBundle(lang, 'translation', { ...resources[lang].translation, ...userLocales });\n } else {\n locales.addResourceBundle(lang, 'translation', { ...resources.en.translation, ...userLocales });\n }\n }\n }, [langInProps, userLocales]);\n\n useEffect(() => {\n // Set the language of the component\n locales.changeLanguage(langInProps || 'en');\n }, [langInProps]);\n\n return wrapCSSVar(\n <ReactEasyContext.Provider value={restProps}>\n <div className={classNames(hashId, cssVarCls, prefixCls, className)} style={style}>\n {children}\n </div>\n </ReactEasyContext.Provider>\n );\n};\nConfigProvider.displayName = 'ReactEasyConfigProvider';\n\nexport default ConfigProvider;\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7C,SAASC,cAAc,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jDlB,OAAO,CAAC+B,iBAAiB,CAACb,IAAI,EAAE,aAAa,EAAAc,aAAA,CAAAA,aAAA,KAAO9B,SAAS,CAACgB,IAAI,CAAC,CAACe,WAAW,GAAKxB,WAAW,CAAE,CAAC;MACpG,CAAC,MAAM;QACLT,OAAO,CAAC+B,iBAAiB,CAACb,IAAI,EAAE,aAAa,EAAAc,aAAA,CAAAA,aAAA,KAAO9B,SAAS,CAACgC,EAAE,CAACD,WAAW,GAAKxB,WAAW,CAAE,CAAC;MACjG;IACF;EACF,CAAC,EAAE,CAACQ,WAAW,EAAER,WAAW,CAAC,CAAC;EAE9Bb,SAAS,CAAC,YAAM;IACd;IACAI,OAAO,CAACmC,cAAc,CAAClB,WAAW,IAAI,IAAI,CAAC;EAC7C,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAEjB,OAAOS,UAAU,eACfpB,IAAA,CAACH,gBAAgB,CAACiC,QAAQ;IAACC,KAAK,EAAEvB,SAAU;IAAAN,QAAA,eAC1CF,IAAA;MAAKM,SAAS,EAAEb,UAAU,CAAC4B,MAAM,EAAEC,SAAS,EAAEjB,SAAS,EAAEC,SAAS,CAAE;MAACC,KAAK,EAAEA,KAAM;MAAAL,QAAA,EAC/EA;IAAQ,CACN;EAAC,CACmB,CAC7B,CAAC;AACH,CAAC;AACDX,cAAc,CAACyC,WAAW,GAAG,yBAAyB;AAEtD,eAAezC,cAAc"}
|
|
@@ -3,73 +3,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import { genStyleHooks } from 'antd/es/theme/internal';
|
|
6
|
-
// .full-height-table(@fullHeight:true, @depth: 1) when(@depth <= 2) {
|
|
7
|
-
// /* stylelint-disable-next-line function-no-unknown */
|
|
8
|
-
// height: if((@fullHeight = true), 100%, auto);
|
|
9
|
-
|
|
10
|
-
// .@{ant-prefix}-spin-nested-loading {
|
|
11
|
-
// /* stylelint-disable-next-line function-no-unknown */
|
|
12
|
-
// height: if((@fullHeight = true), 100%, auto);
|
|
13
|
-
|
|
14
|
-
// .@{ant-prefix}-spin-container {
|
|
15
|
-
// /* stylelint-disable-next-line function-no-unknown */
|
|
16
|
-
// display: if((@fullHeight = true), flex, block);
|
|
17
|
-
// flex-direction: column;
|
|
18
|
-
// /* stylelint-disable-next-line function-no-unknown */
|
|
19
|
-
// height: if((@fullHeight = true), 100%, auto);
|
|
20
|
-
|
|
21
|
-
// .@{ant-prefix}-table:not(.@{ant-prefix}-table-empty) {
|
|
22
|
-
// display: flex;
|
|
23
|
-
// flex: auto;
|
|
24
|
-
// flex-direction: column;
|
|
25
|
-
// width: 100%;
|
|
26
|
-
// min-height: 0;
|
|
27
|
-
|
|
28
|
-
// .@{ant-prefix}-table-container {
|
|
29
|
-
// flex: auto;
|
|
30
|
-
// min-height: 0;
|
|
31
|
-
|
|
32
|
-
// .@{ant-prefix}-table-content {
|
|
33
|
-
// /* stylelint-disable-next-line function-no-unknown */
|
|
34
|
-
// max-height: if((@fullHeight = true), 100%, auto);
|
|
35
|
-
// // 把容器再多撑高1px,否则会始终显示纵向滚动条
|
|
36
|
-
// padding-bottom: 1px;
|
|
37
|
-
// // 自动显示纵向滚动条
|
|
38
|
-
// // stylelint-disable-next-line declaration-no-important
|
|
39
|
-
// overflow: auto !important;
|
|
40
|
-
|
|
41
|
-
// & > table {
|
|
42
|
-
// /* stylelint-disable-next-line function-no-unknown */
|
|
43
|
-
// height: if((@fullHeight = true), 100%, auto);
|
|
44
|
-
|
|
45
|
-
// .@{ant-prefix}-table-thead {
|
|
46
|
-
// position: sticky;
|
|
47
|
-
// top: 0;
|
|
48
|
-
// z-index: 10;
|
|
49
|
-
// }
|
|
50
|
-
|
|
51
|
-
// td {
|
|
52
|
-
// // 当嵌套表格时,还原所有full-height样式,防止子表格受影响
|
|
53
|
-
// .full-height-table(false, @depth + 1);
|
|
54
|
-
// }
|
|
55
|
-
// }
|
|
56
|
-
// }
|
|
57
|
-
// }
|
|
58
|
-
// }
|
|
59
|
-
|
|
60
|
-
// & > .@{ant-prefix}-table-pagination {
|
|
61
|
-
// flex: none;
|
|
62
|
-
// margin-bottom: 0;
|
|
63
|
-
// }
|
|
64
|
-
// }
|
|
65
|
-
// }
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
// .full-height-table-container {
|
|
69
|
-
// .@{ant-prefix}-table-wrapper {
|
|
70
|
-
// .full-height-table();
|
|
71
|
-
// }
|
|
72
|
-
// }
|
|
73
6
|
var genStyle = function genStyle(token) {
|
|
74
7
|
var componentCls = token.componentCls;
|
|
75
8
|
return _defineProperty({}, componentCls, {
|
|
@@ -80,22 +13,24 @@ var genStyle = function genStyle(token) {
|
|
|
80
13
|
minHeight: 0,
|
|
81
14
|
'.easy-full-height-table': _defineProperty({
|
|
82
15
|
height: '100%'
|
|
83
|
-
}, "".concat(token.antCls, "-spin-nested-loading"), _defineProperty({
|
|
16
|
+
}, "& > ".concat(token.antCls, "-spin-nested-loading"), _defineProperty(_defineProperty({
|
|
84
17
|
height: '100%'
|
|
85
|
-
}, "".concat(token.antCls, "-spin
|
|
18
|
+
}, "& > div > ".concat(token.antCls, "-spin"), {
|
|
19
|
+
maxHeight: '100%'
|
|
20
|
+
}), "& > ".concat(token.antCls, "-spin-container"), _defineProperty(_defineProperty(_defineProperty({
|
|
86
21
|
display: 'flex',
|
|
87
22
|
flexDirection: 'column',
|
|
88
23
|
height: '100%'
|
|
89
|
-
}, "
|
|
24
|
+
}, "& > ".concat(token.antCls, "-table"), _defineProperty({
|
|
90
25
|
display: 'flex',
|
|
91
26
|
flex: 'auto',
|
|
92
27
|
flexDirection: 'column',
|
|
93
28
|
width: '100%',
|
|
94
29
|
minHeight: 0
|
|
95
|
-
}, "".concat(token.antCls, "-table-container"), _defineProperty({
|
|
30
|
+
}, "& > ".concat(token.antCls, "-table-container"), _defineProperty({
|
|
96
31
|
flex: 'auto',
|
|
97
32
|
minHeight: 0
|
|
98
|
-
}, "".concat(token.antCls, "-table-content"), {
|
|
33
|
+
}, "& > ".concat(token.antCls, "-table-content"), {
|
|
99
34
|
maxHeight: '100%',
|
|
100
35
|
// 把容器再多撑高1px,否则会始终显示纵向滚动条
|
|
101
36
|
paddingBottom: 1,
|
|
@@ -114,6 +49,8 @@ var genStyle = function genStyle(token) {
|
|
|
114
49
|
height: 'auto'
|
|
115
50
|
}
|
|
116
51
|
})
|
|
52
|
+
}))), "& > ".concat(token.antCls, "-table").concat(token.antCls, "-table-empty"), _defineProperty({}, "& > ".concat(token.antCls, "-table-container"), _defineProperty({}, "& > ".concat(token.antCls, "-table-content"), {
|
|
53
|
+
height: '100%'
|
|
117
54
|
}))), "& > ".concat(token.antCls, "-table-pagination"), {
|
|
118
55
|
flex: 'none',
|
|
119
56
|
marginBottom: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_defineProperty","width","height","flex","minWidth","minHeight","concat","antCls","
|
|
1
|
+
{"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_defineProperty","width","height","flex","minWidth","minHeight","concat","antCls","maxHeight","display","flexDirection","paddingBottom","overflow","position","top","zIndex","marginBottom"],"sources":["../../../../src/components/ConfigProvider/style/index.ts"],"sourcesContent":["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype OverflowTagsToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<OverflowTagsToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n width: '100%',\n height: '100%',\n flex: 'auto',\n minWidth: 0,\n minHeight: 0,\n\n '.easy-full-height-table': {\n height: '100%',\n\n [`& > ${token.antCls}-spin-nested-loading`]: {\n height: '100%',\n\n [`& > div > ${token.antCls}-spin`]: {\n maxHeight: '100%',\n },\n\n [`& > ${token.antCls}-spin-container`]: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n\n [`& > ${token.antCls}-table`]: {\n display: 'flex',\n flex: 'auto',\n flexDirection: 'column',\n width: '100%',\n minHeight: 0,\n\n [`& > ${token.antCls}-table-container`]: {\n flex: 'auto',\n minHeight: 0,\n\n [`& > ${token.antCls}-table-content`]: {\n maxHeight: '100%',\n // 把容器再多撑高1px,否则会始终显示纵向滚动条\n paddingBottom: 1,\n // 自动显示纵向滚动条\n // stylelint-disable-next-line declaration-no-important\n overflow: 'auto !important',\n\n '& > table': {\n height: '100%',\n\n [`${token.antCls}-table-thead`]: {\n position: 'sticky',\n top: 0,\n zIndex: 10,\n },\n\n td: {\n // 当嵌套表格时,还原所有full-height样式,防止子表格受影响\n '.easy-full-height-table': {\n height: 'auto',\n },\n },\n },\n },\n },\n },\n [`& > ${token.antCls}-table${token.antCls}-table-empty`]: {\n [`& > ${token.antCls}-table-container`]: {\n [`& > ${token.antCls}-table-content`]: {\n height: '100%',\n },\n },\n },\n\n [`& > ${token.antCls}-table-pagination`]: {\n flex: 'none',\n marginBottom: 0,\n },\n },\n },\n },\n },\n };\n};\n\nexport default genStyleHooks('EasyConfigProvider' as never, genStyle);\n"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAOtD,IAAMC,QAA0C,GAAG,SAA7CA,QAA0CA,CAAIC,KAAK,EAAgB;EACvE,IAAQC,YAAY,GAAKD,KAAK,CAAtBC,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,EAAG;IACdE,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;I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M,MAAA,CAC/BR,KAAK,CAACS,MAAM,uBAAAP,eAAA,YAAAM,MAAA,CACVR,KAAK,CAACS,MAAM,qBAAmB;MACrCL,MAAM,EAAE;IACV,CAAC,YAAAI,MAAA,CAIGR,KAAK,CAACS,MAAM,wBAAsB;MACxCJ,IAAI,EAAE,MAAM;MACZa,YAAY,EAAE;IAChB,CAAC;EAIT,CAAC;AAEL,CAAC;AAED,eAAepB,aAAa,CAAC,oBAAoB,EAAWC,QAAQ,CAAC"}
|
|
@@ -41,9 +41,9 @@ var import_style = __toESM(require("./style"));
|
|
|
41
41
|
var ConfigProvider = (props) => {
|
|
42
42
|
const { children, locales: userLocales, prefixCls: prefixClsInProps, className, style, ...restProps } = props;
|
|
43
43
|
const { lang: langInProps } = restProps;
|
|
44
|
-
const { getPrefixCls } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
|
|
44
|
+
const { getPrefixCls, rootPrefixCls } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
|
|
45
45
|
const prefixCls = getPrefixCls("react-easy", prefixClsInProps);
|
|
46
|
-
const [wrapCSSVar, hashId, cssVarCls] = (0, import_style.default)(prefixCls);
|
|
46
|
+
const [wrapCSSVar, hashId, cssVarCls] = (0, import_style.default)(prefixCls, rootPrefixCls);
|
|
47
47
|
(0, import_react.useEffect)(() => {
|
|
48
48
|
if (userLocales) {
|
|
49
49
|
const lang = langInProps || "en";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/ConfigProvider/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { CSSProperties, FC, ReactNode } from 'react';\nimport { useContext, useEffect } from 'react';\nimport { ConfigProvider as ReactConfigProvider } from 'antd';\nimport classNames from 'classnames';\nimport locales, { langs, resources } from '../../locales';\nimport type localesEn from '../../locales/langs/en';\nimport ReactEasyContext, { type ReactEasyContextProps } from './context';\nimport useStyle from './style';\n\nexport interface ConfigProviderProps extends ReactEasyContextProps {\n prefixCls?: string;\n className?: string;\n style?: CSSProperties;\n /**\n * - **EN:** Custom localization resources, if `lang` exists, it will override the localization\n * resources of that language, otherwise, it will add a new language\n * - **CN:** 自定义本地化资源,如果`lang`存在,则会覆盖该语言的本地化资源,否则,会添加一种新的语言\n */\n locales?: Partial<typeof localesEn>;\n children: ReactNode;\n}\n\n/**\n * - **EN:** Provide global configuration for AntdHelper\n * - **CN:** 提供AntdHelper的全局配置\n */\nconst ConfigProvider: FC<ConfigProviderProps> = (props) => {\n const { children, locales: userLocales, prefixCls: prefixClsInProps, className, style, ...restProps } = props;\n const { lang: langInProps } = restProps;\n const { getPrefixCls } = useContext(ReactConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('react-easy', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n\n useEffect(() => {\n // Dynamically add language pack\n if (userLocales) {\n const lang = langInProps || 'en';\n if (lang && langs.includes(lang)) {\n locales.removeResourceBundle(lang, 'translation');\n locales.addResourceBundle(lang, 'translation', { ...resources[lang].translation, ...userLocales });\n } else {\n locales.addResourceBundle(lang, 'translation', { ...resources.en.translation, ...userLocales });\n }\n }\n }, [langInProps, userLocales]);\n\n useEffect(() => {\n // Set the language of the component\n locales.changeLanguage(langInProps || 'en');\n }, [langInProps]);\n\n return wrapCSSVar(\n <ReactEasyContext.Provider value={restProps}>\n <div className={classNames(hashId, cssVarCls, prefixCls, className)} style={style}>\n {children}\n </div>\n </ReactEasyContext.Provider>\n );\n};\nConfigProvider.displayName = 'ReactEasyConfigProvider';\n\nexport default ConfigProvider;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAsC;AACtC,kBAAsD;AACtD,wBAAuB;AACvB,qBAA0C;AAE1C,qBAA6D;AAC7D,mBAAqB;AAmBrB,IAAM,iBAA0C,CAAC,UAAU;AACzD,QAAM,EAAE,UAAU,SAAS,aAAa,WAAW,kBAAkB,WAAW,OAAO,GAAG,UAAU,IAAI;AACxG,QAAM,EAAE,MAAM,YAAY,IAAI;AAC9B,QAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["import type { CSSProperties, FC, ReactNode } from 'react';\nimport { useContext, useEffect } from 'react';\nimport { ConfigProvider as ReactConfigProvider } from 'antd';\nimport classNames from 'classnames';\nimport locales, { langs, resources } from '../../locales';\nimport type localesEn from '../../locales/langs/en';\nimport ReactEasyContext, { type ReactEasyContextProps } from './context';\nimport useStyle from './style';\n\nexport interface ConfigProviderProps extends ReactEasyContextProps {\n prefixCls?: string;\n className?: string;\n style?: CSSProperties;\n /**\n * - **EN:** Custom localization resources, if `lang` exists, it will override the localization\n * resources of that language, otherwise, it will add a new language\n * - **CN:** 自定义本地化资源,如果`lang`存在,则会覆盖该语言的本地化资源,否则,会添加一种新的语言\n */\n locales?: Partial<typeof localesEn>;\n children: ReactNode;\n}\n\n/**\n * - **EN:** Provide global configuration for AntdHelper\n * - **CN:** 提供AntdHelper的全局配置\n */\nconst ConfigProvider: FC<ConfigProviderProps> = (props) => {\n const { children, locales: userLocales, prefixCls: prefixClsInProps, className, style, ...restProps } = props;\n const { lang: langInProps } = restProps;\n const { getPrefixCls, rootPrefixCls } = useContext(ReactConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('react-easy', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootPrefixCls);\n\n useEffect(() => {\n // Dynamically add language pack\n if (userLocales) {\n const lang = langInProps || 'en';\n if (lang && langs.includes(lang)) {\n locales.removeResourceBundle(lang, 'translation');\n locales.addResourceBundle(lang, 'translation', { ...resources[lang].translation, ...userLocales });\n } else {\n locales.addResourceBundle(lang, 'translation', { ...resources.en.translation, ...userLocales });\n }\n }\n }, [langInProps, userLocales]);\n\n useEffect(() => {\n // Set the language of the component\n locales.changeLanguage(langInProps || 'en');\n }, [langInProps]);\n\n return wrapCSSVar(\n <ReactEasyContext.Provider value={restProps}>\n <div className={classNames(hashId, cssVarCls, prefixCls, className)} style={style}>\n {children}\n </div>\n </ReactEasyContext.Provider>\n );\n};\nConfigProvider.displayName = 'ReactEasyConfigProvider';\n\nexport default ConfigProvider;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAsC;AACtC,kBAAsD;AACtD,wBAAuB;AACvB,qBAA0C;AAE1C,qBAA6D;AAC7D,mBAAqB;AAmBrB,IAAM,iBAA0C,CAAC,UAAU;AACzD,QAAM,EAAE,UAAU,SAAS,aAAa,WAAW,kBAAkB,WAAW,OAAO,GAAG,UAAU,IAAI;AACxG,QAAM,EAAE,MAAM,YAAY,IAAI;AAC9B,QAAM,EAAE,cAAc,cAAc,QAAI,yBAAW,YAAAA,eAAoB,aAAa;AACpF,QAAM,YAAY,aAAa,cAAc,gBAAgB;AAC7D,QAAM,CAAC,YAAY,QAAQ,SAAS,QAAI,aAAAC,SAAS,WAAW,aAAa;AAEzE,8BAAU,MAAM;AAEd,QAAI,aAAa;AACf,YAAM,OAAO,eAAe;AAC5B,UAAI,QAAQ,qBAAM,SAAS,IAAI,GAAG;AAChC,uBAAAC,QAAQ,qBAAqB,MAAM,aAAa;AAChD,uBAAAA,QAAQ,kBAAkB,MAAM,eAAe,EAAE,GAAG,yBAAU,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;AAAA,MACnG,OAAO;AACL,uBAAAA,QAAQ,kBAAkB,MAAM,eAAe,EAAE,GAAG,yBAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AAAA,MAChG;AAAA,IACF;AAAA,EACF,GAAG,CAAC,aAAa,WAAW,CAAC;AAE7B,8BAAU,MAAM;AAEd,mBAAAA,QAAQ,eAAe,eAAe,IAAI;AAAA,EAC5C,GAAG,CAAC,WAAW,CAAC;AAEhB,SAAO;AAAA,IACL,oCAAC,eAAAC,QAAiB,UAAjB,EAA0B,OAAO,aAChC,oCAAC,SAAI,eAAW,kBAAAC,SAAW,QAAQ,WAAW,WAAW,SAAS,GAAG,SAClE,QACH,CACF;AAAA,EACF;AACF;AACA,eAAe,cAAc;AAE7B,IAAO,yBAAQ;",
|
|
6
6
|
"names": ["ReactConfigProvider", "useStyle", "locales", "ReactEasyContext", "classNames"]
|
|
7
7
|
}
|
|
@@ -34,22 +34,25 @@ var genStyle = (token) => {
|
|
|
34
34
|
minHeight: 0,
|
|
35
35
|
".easy-full-height-table": {
|
|
36
36
|
height: "100%",
|
|
37
|
-
[
|
|
37
|
+
[`& > ${token.antCls}-spin-nested-loading`]: {
|
|
38
38
|
height: "100%",
|
|
39
|
-
[
|
|
39
|
+
[`& > div > ${token.antCls}-spin`]: {
|
|
40
|
+
maxHeight: "100%"
|
|
41
|
+
},
|
|
42
|
+
[`& > ${token.antCls}-spin-container`]: {
|
|
40
43
|
display: "flex",
|
|
41
44
|
flexDirection: "column",
|
|
42
45
|
height: "100%",
|
|
43
|
-
[
|
|
46
|
+
[`& > ${token.antCls}-table`]: {
|
|
44
47
|
display: "flex",
|
|
45
48
|
flex: "auto",
|
|
46
49
|
flexDirection: "column",
|
|
47
50
|
width: "100%",
|
|
48
51
|
minHeight: 0,
|
|
49
|
-
[
|
|
52
|
+
[`& > ${token.antCls}-table-container`]: {
|
|
50
53
|
flex: "auto",
|
|
51
54
|
minHeight: 0,
|
|
52
|
-
[
|
|
55
|
+
[`& > ${token.antCls}-table-content`]: {
|
|
53
56
|
maxHeight: "100%",
|
|
54
57
|
// 把容器再多撑高1px,否则会始终显示纵向滚动条
|
|
55
58
|
paddingBottom: 1,
|
|
@@ -73,6 +76,13 @@ var genStyle = (token) => {
|
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
},
|
|
79
|
+
[`& > ${token.antCls}-table${token.antCls}-table-empty`]: {
|
|
80
|
+
[`& > ${token.antCls}-table-container`]: {
|
|
81
|
+
[`& > ${token.antCls}-table-content`]: {
|
|
82
|
+
height: "100%"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
76
86
|
[`& > ${token.antCls}-table-pagination`]: {
|
|
77
87
|
flex: "none",
|
|
78
88
|
marginBottom: 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ConfigProvider/style/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype OverflowTagsToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;
|
|
4
|
+
"sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype OverflowTagsToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<OverflowTagsToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n width: '100%',\n height: '100%',\n flex: 'auto',\n minWidth: 0,\n minHeight: 0,\n\n '.easy-full-height-table': {\n height: '100%',\n\n [`& > ${token.antCls}-spin-nested-loading`]: {\n height: '100%',\n\n [`& > div > ${token.antCls}-spin`]: {\n maxHeight: '100%',\n },\n\n [`& > ${token.antCls}-spin-container`]: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n\n [`& > ${token.antCls}-table`]: {\n display: 'flex',\n flex: 'auto',\n flexDirection: 'column',\n width: '100%',\n minHeight: 0,\n\n [`& > ${token.antCls}-table-container`]: {\n flex: 'auto',\n minHeight: 0,\n\n [`& > ${token.antCls}-table-content`]: {\n maxHeight: '100%',\n // 把容器再多撑高1px,否则会始终显示纵向滚动条\n paddingBottom: 1,\n // 自动显示纵向滚动条\n // stylelint-disable-next-line declaration-no-important\n overflow: 'auto !important',\n\n '& > table': {\n height: '100%',\n\n [`${token.antCls}-table-thead`]: {\n position: 'sticky',\n top: 0,\n zIndex: 10,\n },\n\n td: {\n // 当嵌套表格时,还原所有full-height样式,防止子表格受影响\n '.easy-full-height-table': {\n height: 'auto',\n },\n },\n },\n },\n },\n },\n [`& > ${token.antCls}-table${token.antCls}-table-empty`]: {\n [`& > ${token.antCls}-table-container`]: {\n [`& > ${token.antCls}-table-content`]: {\n height: '100%',\n },\n },\n },\n\n [`& > ${token.antCls}-table-pagination`]: {\n flex: 'none',\n marginBottom: 0,\n },\n },\n },\n },\n },\n };\n};\n\nexport default genStyleHooks('EasyConfigProvider' as never, genStyle);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAO9B,IAAM,WAA6C,CAAC,UAAqB;AACvE,QAAM,EAAE,aAAa,IAAI;AACzB,SAAO;AAAA,IACL,CAAC,YAAY,GAAG;AAAA,MACd,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW;AAAA,MAEX,2BAA2B;AAAA,QACzB,QAAQ;AAAA,QAER,CAAC,OAAO,MAAM,4BAA4B,GAAG;AAAA,UAC3C,QAAQ;AAAA,UAER,CAAC,aAAa,MAAM,aAAa,GAAG;AAAA,YAClC,WAAW;AAAA,UACb;AAAA,UAEA,CAAC,OAAO,MAAM,uBAAuB,GAAG;AAAA,YACtC,SAAS;AAAA,YACT,eAAe;AAAA,YACf,QAAQ;AAAA,YAER,CAAC,OAAO,MAAM,cAAc,GAAG;AAAA,cAC7B,SAAS;AAAA,cACT,MAAM;AAAA,cACN,eAAe;AAAA,cACf,OAAO;AAAA,cACP,WAAW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