tntd 2.8.0-beta.7 → 2.8.0-beta.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.
Files changed (50) hide show
  1. package/es/drawer/drawer.js +108 -13
  2. package/es/drawer/drawer.js.map +1 -1
  3. package/es/drawer/index.js +1 -1
  4. package/es/drawer/index.js.map +1 -1
  5. package/es/drawer/index.less +154 -0
  6. package/es/drawer/style/drawer.less +2 -4
  7. package/es/input/style/mixin.less +1 -2
  8. package/es/locale/en_US.js +5 -1
  9. package/es/locale/en_US.js.map +1 -1
  10. package/es/locale/zh_CN.js +5 -1
  11. package/es/locale/zh_CN.js.map +1 -1
  12. package/es/page-loading/index.js +8 -4
  13. package/es/page-loading/index.js.map +1 -1
  14. package/es/page-loading/index.less +33 -17
  15. package/es/table-container/index.less +1 -1
  16. package/es/tabs-container/index.js +1 -0
  17. package/es/tabs-container/index.js.map +1 -1
  18. package/es/tabs-container/index.less +3 -3
  19. package/lib/drawer/drawer.d.ts +25 -2
  20. package/lib/drawer/drawer.d.ts.map +1 -1
  21. package/lib/drawer/drawer.js +115 -13
  22. package/lib/drawer/drawer.js.map +1 -1
  23. package/lib/drawer/index.d.ts +1 -1
  24. package/lib/drawer/index.d.ts.map +1 -1
  25. package/lib/drawer/index.js +5 -5
  26. package/lib/drawer/index.js.map +1 -1
  27. package/lib/drawer/index.less +154 -0
  28. package/lib/drawer/style/drawer.less +2 -4
  29. package/lib/input/style/mixin.less +1 -2
  30. package/lib/locale/default.d.ts +4 -0
  31. package/lib/locale/default.d.ts.map +1 -1
  32. package/lib/locale/en_US.d.ts +4 -0
  33. package/lib/locale/en_US.d.ts.map +1 -1
  34. package/lib/locale/en_US.js +5 -1
  35. package/lib/locale/en_US.js.map +1 -1
  36. package/lib/locale/zh_CN.d.ts +4 -0
  37. package/lib/locale/zh_CN.d.ts.map +1 -1
  38. package/lib/locale/zh_CN.js +5 -1
  39. package/lib/locale/zh_CN.js.map +1 -1
  40. package/lib/page-loading/index.d.ts.map +1 -1
  41. package/lib/page-loading/index.js +7 -3
  42. package/lib/page-loading/index.js.map +1 -1
  43. package/lib/page-loading/index.less +33 -17
  44. package/lib/table-container/index.less +1 -1
  45. package/lib/tabs-container/index.d.ts +2 -1
  46. package/lib/tabs-container/index.d.ts.map +1 -1
  47. package/lib/tabs-container/index.js +3 -2
  48. package/lib/tabs-container/index.js.map +1 -1
  49. package/lib/tabs-container/index.less +3 -3
  50. package/package.json +2 -2
@@ -4,11 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Drawer = void 0;
7
- var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
8
- var _classnames = _interopRequireDefault(require("classnames"));
9
- var _react = _interopRequireDefault(require("react"));
10
7
  var _configProvider = require("antd/lib/config-provider");
11
8
  var _drawer = _interopRequireDefault(require("antd/lib/drawer"));
9
+ var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _button = require("../button");
13
+ var _icon = _interopRequireDefault(require("../icon"));
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
12
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
17
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
14
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -22,20 +26,118 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
22
26
  }
23
27
  return t;
24
28
  };
29
+ var DefaultFooter = function DefaultFooter(_ref) {
30
+ var locale = _ref.locale,
31
+ onClose = _ref.onClose,
32
+ onSubmit = _ref.onSubmit,
33
+ onCancel = _ref.onCancel,
34
+ onOk = _ref.onOk,
35
+ okText = _ref.okText,
36
+ okType = _ref.okType,
37
+ cancelText = _ref.cancelText,
38
+ confirmLoading = _ref.confirmLoading,
39
+ okButtonProps = _ref.okButtonProps,
40
+ cancelButtonProps = _ref.cancelButtonProps,
41
+ cancelType = _ref.cancelType;
42
+ return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_button.Button, Object.assign({
43
+ onClick: onCancel || onClose,
44
+ style: {
45
+ marginRight: 8
46
+ },
47
+ type: cancelType || 'default'
48
+ }, cancelButtonProps), cancelText || (locale === null || locale === void 0 ? void 0 : locale.cancelText)), _react["default"].createElement(_button.Button, Object.assign({
49
+ onClick: onOk || onSubmit,
50
+ type: okType || 'primary',
51
+ loading: confirmLoading
52
+ }, okButtonProps), okText || (locale === null || locale === void 0 ? void 0 : locale.okText)));
53
+ };
25
54
  var Drawer = exports.Drawer = function Drawer(_a) {
26
- var closable = _a.closable,
55
+ var _a$closable = _a.closable,
56
+ closable = _a$closable === void 0 ? true : _a$closable,
27
57
  className = _a.className,
28
- rest = __rest(_a, ["closable", "className"]);
29
- return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref) {
30
- var getPrefixCls = _ref.getPrefixCls;
58
+ footer = _a.footer,
59
+ showFooter = _a.showFooter,
60
+ onClose = _a.onClose,
61
+ onSubmit = _a.onSubmit,
62
+ onCancel = _a.onCancel,
63
+ onOk = _a.onOk,
64
+ _a$okText = _a.okText,
65
+ okText = _a$okText === void 0 ? '' : _a$okText,
66
+ _a$cancelText = _a.cancelText,
67
+ cancelText = _a$cancelText === void 0 ? '' : _a$cancelText,
68
+ locale = _a.locale,
69
+ _a$okType = _a.okType,
70
+ okType = _a$okType === void 0 ? 'primary' : _a$okType,
71
+ _a$cancelType = _a.cancelType,
72
+ cancelType = _a$cancelType === void 0 ? 'default' : _a$cancelType,
73
+ _a$confirmLoading = _a.confirmLoading,
74
+ confirmLoading = _a$confirmLoading === void 0 ? false : _a$confirmLoading,
75
+ _a$okButtonProps = _a.okButtonProps,
76
+ okButtonProps = _a$okButtonProps === void 0 ? {} : _a$okButtonProps,
77
+ _a$cancelButtonProps = _a.cancelButtonProps,
78
+ cancelButtonProps = _a$cancelButtonProps === void 0 ? {} : _a$cancelButtonProps,
79
+ _a$clickOnBlankToClos = _a.clickOnBlankToClose,
80
+ clickOnBlankToClose = _a$clickOnBlankToClos === void 0 ? false : _a$clickOnBlankToClos,
81
+ rest = __rest(_a, ["closable", "className", "footer", "showFooter", "onClose", "onSubmit", "onCancel", "onOk", "okText", "cancelText", "locale", "okType", "cancelType", "confirmLoading", "okButtonProps", "cancelButtonProps", "clickOnBlankToClose"]);
82
+ var drawerDom = _react["default"].useRef(null);
83
+ var _onCancel = onCancel || onClose;
84
+ (0, _react.useEffect)(function () {
85
+ if (clickOnBlankToClose) {
86
+ var handleOutsideClick = function handleOutsideClick(event) {
87
+ var drawer = drawerDom.current;
88
+ var targetElement = event.target;
89
+ var isInDrawer = false;
90
+ if (drawer && targetElement) {
91
+ isInDrawer = drawer.contains(targetElement) || targetElement === drawer;
92
+ }
93
+ drawerDom.current = null;
94
+ if (rest.visible && !isInDrawer && _onCancel) {
95
+ _onCancel();
96
+ }
97
+ };
98
+ document.removeEventListener('click', handleOutsideClick);
99
+ document.addEventListener('click', handleOutsideClick);
100
+ return function () {
101
+ document.removeEventListener('click', handleOutsideClick);
102
+ };
103
+ }
104
+ }, [rest.visible, clickOnBlankToClose, _onCancel]);
105
+ return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref2) {
106
+ var getPrefixCls = _ref2.getPrefixCls;
31
107
  var prefixCls = getPrefixCls('drawer');
32
108
  return _react["default"].createElement(_LocaleReceiver["default"], {
33
- componentName: "Drawer"
34
- }, function () {
35
- return _react["default"].createElement(_drawer["default"], Object.assign({
36
- className: (0, _classnames["default"])(prefixCls, 'tntd-drawer', className, _defineProperty({}, "".concat(prefixCls, "-contain-closable"), closable !== false)),
37
- closable: closable
38
- }, rest));
109
+ componentName: "Drawer",
110
+ defaultLocale: locale
111
+ }, function (locale) {
112
+ return _react["default"].createElement("div", {
113
+ onClick: function onClick(event) {
114
+ drawerDom.current = event.target;
115
+ }
116
+ }, _react["default"].createElement(_drawer["default"], Object.assign({
117
+ className: (0, _classnames["default"])(prefixCls, 'tnt-drawer', 'tntd-drawer', className, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-contain-closable"), closable !== false), "".concat(prefixCls, "-footer"), showFooter || footer)),
118
+ closable: false,
119
+ onClose: onClose,
120
+ width: 480
121
+ }, rest), _react["default"].createElement(_react["default"].Fragment, null, closable !== false && _react["default"].createElement(_icon["default"], {
122
+ type: "close",
123
+ className: "".concat(prefixCls, "-close"),
124
+ onClick: onClose
125
+ }), rest.children, _react["default"].createElement("div", {
126
+ className: "".concat(prefixCls, "-footer-style")
127
+ }, !footer ? showFooter && _react["default"].createElement(DefaultFooter, {
128
+ confirmLoading: confirmLoading,
129
+ okButtonProps: okButtonProps,
130
+ cancelButtonProps: cancelButtonProps,
131
+ okType: okType,
132
+ locale: locale,
133
+ okText: okText,
134
+ cancelType: cancelType,
135
+ cancelText: cancelText,
136
+ onClose: onClose,
137
+ onSubmit: onSubmit,
138
+ onOk: onOk,
139
+ onCancel: onCancel
140
+ }) : footer))));
39
141
  });
40
142
  });
41
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AASA,4FAAmE;AACnE,4DAAmC;AACnC,kDAAiC;AAEjC,6DAAwD;AACxD,4DAAsD;AAE/C,MAAM,MAAM,GAAwB,CAAC,EAAgC,EAAE,EAAE;QAApC,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAAO,OAAA,CAC/E,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;QACxC,OAAO,CACL,8BAAC,wBAAc,IAAC,aAAa,EAAC,QAAQ,IACnC,GAAG,EAAE,CAAC,CACL,8BAAC,gBAAU,kBACT,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE;gBACzD,CAAC,GAAG,SAAS,mBAAmB,CAAC,EAAE,QAAQ,KAAK,KAAK;aACtD,CAAC,EACF,QAAQ,EAAE,QAAQ,IACd,IAAI,EACR,CACH,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;CAAA,CAAA;AAnBY,QAAA,MAAM,UAmBlB","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-03-08 16:45:46\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2023-03-08 18:56:20\n * @FilePath: /tntd/packages/tntd/src/drawer/drawer.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport type { DrawerProps as AntdDrawerProps } from 'antd/lib/drawer'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport React, { FC } from 'react'\n\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport { default as AntdDrawer } from 'antd/lib/drawer'\n\nexport const Drawer: FC<AntdDrawerProps> = ({ closable, className, ...rest }) => (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('drawer')\n return (\n <LocaleReceiver componentName=\"Drawer\">\n {() => (\n <AntdDrawer\n className={classNames(prefixCls, 'tntd-drawer', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n })}\n closable={closable}\n {...rest}\n />\n )}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n)\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":"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","sourcesContent":["import { ConfigConsumer } from 'antd/lib/config-provider'\nimport type { DrawerProps as AntdDrawerProps } from 'antd/lib/drawer'\nimport { default as AntdDrawer } from 'antd/lib/drawer'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport type { BaseButtonProps } from 'antd/lib/button/button'\nimport type { ButtonType } from '../button/button'\n\nimport React, { FC, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\n onClose,\n onSubmit,\n onCancel,\n onOk,\n okText,\n okType,\n cancelText,\n confirmLoading,\n okButtonProps,\n cancelButtonProps,\n cancelType,\n}: {\n locale?: {\n okText?: string\n cancelText?: string\n }\n onClose?: () => void\n onSubmit?: () => void\n onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: ButtonType\n cancelType: ButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button\n onClick={onCancel || onClose}\n style={{ marginRight: 8 }}\n type={cancelType || 'default'}\n {...cancelButtonProps}\n >\n {cancelText || locale?.cancelText}\n </Button>\n <Button\n onClick={onOk || onSubmit}\n type={okType || 'primary'}\n loading={confirmLoading}\n {...okButtonProps}\n >\n {okText || locale?.okText}\n </Button>\n </>\n )\n}\n\ninterface CustomDrawerProps extends AntdDrawerProps {\n footer?: React.ReactNode\n showFooter?: boolean\n onClose?: () => void\n onSubmit?: () => void\n onCancel?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: ButtonType\n cancelType?: ButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n onSubmit,\n onCancel,\n onOk,\n okText = '',\n cancelText = '',\n locale,\n okType = 'primary',\n cancelType = 'default',\n confirmLoading = false,\n okButtonProps = {},\n cancelButtonProps = {},\n clickOnBlankToClose = false,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = onCancel || onClose\n\n useEffect(() => {\n if (clickOnBlankToClose) {\n const handleOutsideClick = (event: Event) => {\n const drawer = drawerDom.current as Node\n const targetElement = event.target as Node\n\n let isInDrawer = false\n if (drawer && targetElement) {\n isInDrawer = drawer.contains(targetElement as Node) || targetElement === drawer\n }\n drawerDom.current = null\n if (rest.visible && !isInDrawer && _onCancel) {\n _onCancel()\n }\n }\n document.removeEventListener('click', handleOutsideClick)\n document.addEventListener('click', handleOutsideClick)\n return () => {\n document.removeEventListener('click', handleOutsideClick)\n }\n }\n }, [rest.visible, clickOnBlankToClose, _onCancel])\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('drawer')\n return (\n <LocaleReceiver componentName=\"Drawer\" defaultLocale={locale}>\n {(locale) => {\n return (\n <div\n onClick={(event: React.MouseEvent<HTMLDivElement>) => {\n drawerDom.current = event.target\n }}\n >\n <AntdDrawer\n className={classNames(prefixCls, 'tnt-drawer', 'tntd-drawer', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={onClose}\n width={480}\n {...rest}\n >\n <>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={onClose} />\n )}\n {rest.children}\n <div className={`${prefixCls}-footer-style`}>\n {!footer\n ? showFooter && (\n <DefaultFooter\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n cancelButtonProps={cancelButtonProps}\n okType={okType}\n locale={locale}\n okText={okText}\n cancelType={cancelType}\n cancelText={cancelText}\n onClose={onClose}\n onSubmit={onSubmit}\n onOk={onOk}\n onCancel={onCancel}\n />\n )\n : footer}\n </div>\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import './style';
2
2
  import { Drawer } from './drawer';
3
- import './drawer.less';
3
+ import './index.less';
4
4
  export * from 'antd/lib/drawer';
5
5
  export default Drawer;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,eAAe,CAAA;AACtB,cAAc,gBAAgB,CAAA;AAE9B,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,cAAc,CAAA;AACrB,cAAc,gBAAgB,CAAA;AAE9B,eAAe,MAAM,CAAA"}
@@ -7,16 +7,16 @@ var _exportNames = {};
7
7
  exports["default"] = void 0;
8
8
  require("./style");
9
9
  var _drawer = require("./drawer");
10
- require("./drawer.less");
11
- var _drawer3 = require("antd/lib/drawer");
12
- Object.keys(_drawer3).forEach(function (key) {
10
+ require("./index.less");
11
+ var _drawer2 = require("antd/lib/drawer");
12
+ Object.keys(_drawer2).forEach(function (key) {
13
13
  if (key === "default" || key === "__esModule") return;
14
14
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
15
- if (key in exports && exports[key] === _drawer3[key]) return;
15
+ if (key in exports && exports[key] === _drawer2[key]) return;
16
16
  Object.defineProperty(exports, key, {
17
17
  enumerable: true,
18
18
  get: function get() {
19
- return _drawer3[key];
19
+ return _drawer2[key];
20
20
  }
21
21
  });
22
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drawer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mBAAgB;AAChB,qCAAiC;AAEjC,yBAAsB;AACtB,iDAA8B;AAE9B,kBAAe,eAAM,CAAA","sourcesContent":["import './style'\nimport { Drawer } from './drawer'\n\nimport './drawer.less'\nexport * from 'antd/lib/drawer'\n\nexport default Drawer\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drawer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mBAAgB;AAChB,qCAAiC;AAEjC,wBAAqB;AACrB,iDAA8B;AAE9B,kBAAe,eAAM,CAAA","sourcesContent":["import './style'\nimport { Drawer } from './drawer'\n\nimport './index.less'\nexport * from 'antd/lib/drawer'\n\nexport default Drawer\n"]}
@@ -0,0 +1,154 @@
1
+ @drawer-prefix-cls: ~'@{ant-prefix}-drawer';
2
+
3
+
4
+ .tnt-drawer.@{drawer-prefix-cls} {
5
+ &-top {
6
+ .@{drawer-prefix-cls}-wrapper-body {
7
+ margin-top: 48px;
8
+ }
9
+
10
+ .@{drawer-prefix-cls}-content-wrapper {
11
+ height: 480px !important;
12
+ }
13
+ }
14
+
15
+ &-bottom {
16
+ .@{drawer-prefix-cls}-content-wrapper {
17
+ height: 480px !important;
18
+ }
19
+ }
20
+
21
+ .@{drawer-prefix-cls}-wrapper-body {
22
+ margin-top: 48px;
23
+ max-height: ~'calc(100vh - 50px)';
24
+ }
25
+
26
+ &-footer {
27
+ .@{drawer-prefix-cls}-header {
28
+ border-bottom: none;
29
+ position: absolute;
30
+ right: 0;
31
+ top: 0;
32
+ background: #fff;
33
+ width: 100%;
34
+ }
35
+
36
+ .@{drawer-prefix-cls}-wrapper-body {
37
+ max-height: ~'calc(100vh - 98px)' !important;
38
+ margin-top: 48px !important;
39
+ margin-bottom: 48px !important;
40
+ }
41
+
42
+ }
43
+
44
+ .@{drawer-prefix-cls}-title {
45
+ font-size: 16px !important;
46
+ font-weight: 500 !important;
47
+ }
48
+
49
+ .@{drawer-prefix-cls}-close {
50
+ color: fade(@text-color, 50%);
51
+ width: 62px;
52
+ top: -4px;
53
+
54
+
55
+ position: absolute;
56
+ top: -2px;
57
+ right: 0;
58
+ z-index: 10;
59
+ display: block;
60
+ width: 48px;
61
+ height: 48px;
62
+ padding: 0;
63
+ color: rgba(23, 35, 61, 0.8);
64
+ font-weight: 700;
65
+ font-size: 20px;
66
+ font-style: normal;
67
+ line-height: 56px;
68
+ text-align: center;
69
+ text-transform: none;
70
+ text-decoration: none;
71
+ background: transparent;
72
+ border: 0;
73
+ outline: 0;
74
+ cursor: pointer;
75
+ transition: color 0.3s;
76
+ text-rendering: auto;
77
+ }
78
+
79
+
80
+ .@{drawer-prefix-cls}-contain-closable {
81
+ .@{drawer-prefix-cls}-header {
82
+ padding: 12px 36px 12px 20px;
83
+ }
84
+ }
85
+
86
+ &-right {
87
+ .@{drawer-prefix-cls}-content {
88
+ border-radius: @border-radius-base 0px 0px @border-radius-base;
89
+ background: #F8F9FB;
90
+ }
91
+ }
92
+
93
+ &-left {
94
+ .@{drawer-prefix-cls}-content {
95
+ border-radius: 0px @border-radius-base @border-radius-base 0px;
96
+ background: #F8F9FB;
97
+ }
98
+ }
99
+
100
+ &-top {
101
+ .@{drawer-prefix-cls}-content {
102
+ border-radius: 0px 0px @border-radius-base @border-radius-base;
103
+ background: #F8F9FB;
104
+ padding-top: 48px;
105
+ }
106
+
107
+ .@{drawer-prefix-cls}-wrapper-body {
108
+ margin-top: 0px !important;
109
+ }
110
+ }
111
+
112
+ &-bottom {
113
+ .@{drawer-prefix-cls}-content {
114
+ border-radius: @border-radius-base @border-radius-base 0px 0px;
115
+ background: #F8F9FB;
116
+ padding-top: 48px;
117
+ }
118
+
119
+ .@{drawer-prefix-cls}-wrapper-body {
120
+ margin-top: 0px !important;
121
+ }
122
+ }
123
+
124
+
125
+ .@{drawer-prefix-cls}-header {
126
+ padding: 13px 24px;
127
+ border-bottom: none;
128
+ position: absolute;
129
+ right: 0;
130
+ top: 0;
131
+ width: 100%;
132
+ background: #fff;
133
+ }
134
+
135
+ .@{drawer-prefix-cls}-body {
136
+ padding: @padding-lg !important;
137
+
138
+ }
139
+
140
+
141
+ .@{drawer-prefix-cls}-wrapper-body {
142
+
143
+ .@{drawer-prefix-cls}-footer-style {
144
+ position: absolute;
145
+ right: 0;
146
+ bottom: 0;
147
+ width: 100%;
148
+ padding: 8px 24px;
149
+ background: #fff;
150
+ text-align: right;
151
+ }
152
+
153
+ }
154
+ }
@@ -157,7 +157,7 @@
157
157
  padding: 0;
158
158
  color: @text-color-secondary;
159
159
  font-weight: 700;
160
- font-size: 20px;
160
+ font-size: @font-size-lg;
161
161
  font-style: normal;
162
162
  line-height: 56px;
163
163
  text-align: center;
@@ -169,9 +169,7 @@
169
169
  cursor: pointer;
170
170
  transition: color @animation-duration-slow;
171
171
  text-rendering: auto;
172
- .tntd-anticon {
173
- font-size: 20px;
174
- }
172
+
175
173
  &:focus,
176
174
  &:hover {
177
175
  color: @icon-color-hover;
@@ -170,8 +170,7 @@
170
170
 
171
171
  // Reset Select's style in addon
172
172
  .@{ant-prefix}-select {
173
- margin: calc(1px - @input-padding-vertical-base) (-@input-padding-horizontal-base);
174
-
173
+ margin: calc(-1px - @input-padding-vertical-base) (-@input-padding-horizontal-base);
175
174
  .@{ant-prefix}-select-selection {
176
175
  margin: -1px;
177
176
  background-color: inherit;
@@ -168,6 +168,10 @@ declare const defaultLocale: {
168
168
  back: string;
169
169
  };
170
170
  ColorPicker: {};
171
+ Drawer: {
172
+ okText: string;
173
+ cancelText: string;
174
+ };
171
175
  };
172
176
  export default defaultLocale;
173
177
  //# sourceMappingURL=default.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/locale/default.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAiC,CAAA;AAEpD,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/locale/default.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAiC,CAAA;AAEpD,eAAe,aAAa,CAAA"}
@@ -108,6 +108,10 @@ declare const en_US: {
108
108
  back: string;
109
109
  };
110
110
  ColorPicker: {};
111
+ Drawer: {
112
+ okText: string;
113
+ cancelText: string;
114
+ };
111
115
  };
112
116
  export default en_US;
113
117
  //# sourceMappingURL=en_US.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"en_US.d.ts","sourceRoot":"","sources":["../../src/locale/en_US.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CT,CAAA;AAEF,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"en_US.d.ts","sourceRoot":"","sources":["../../src/locale/en_US.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CT,CAAA;AAEF,eAAe,KAAK,CAAA"}
@@ -58,6 +58,10 @@ var en_US = (0, _merge2["default"])(_en_US["default"], {
58
58
  TntdSecondPage: {
59
59
  back: 'Back'
60
60
  },
61
- ColorPicker: {}
61
+ ColorPicker: {},
62
+ Drawer: {
63
+ okText: 'Submit',
64
+ cancelText: 'Cancel'
65
+ }
62
66
  });
63
67
  var _default = exports["default"] = en_US;
@@ -1 +1 @@
1
- {"version":3,"file":"en_US.js","sourceRoot":"","sources":["../../src/locale/en_US.ts"],"names":[],"mappings":";;;;;AAAA;;;;;;;GAOG;AACH,iEAA+C;AAE/C,mCAA8B;AAE9B,yCAAyC;AACzC,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,eAAY,EAAE;IAChC,KAAK,EAAE;QACL,kBAAkB,EAAE,YAAY;QAChC,gBAAgB,EAAE,SAAS;QAC3B,KAAK,EAAE,4BAA4B;KACpC;IACD,KAAK,EAAE;QACL,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,eAAe;QAC7B,mBAAmB,EAAE,sBAAsB;QAC3C,cAAc,EAAE,iBAAiB;QACjC,SAAS,EAAE,uBAAuB;QAClC,MAAM,EAAE,SAAS;KAClB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,UAAU,EAAE,aAAa;YACzB,EAAE,EAAE,IAAI;YACR,UAAU,EAAE,aAAa;SAC1B;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;KACb;IACD,SAAS,EAAE;QACT,KAAK,EAAE,0CAA0C;QACjD,KAAK,EAAE,0CAA0C;QACjD,KAAK,EAAE,yCAAyC;KACjD;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,SAAS;KAClB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,SAAS;KAClB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,YAAY;KACnB;IACD,cAAc,EAAE;QACd,IAAI,EAAE,MAAM;KACb;IACD,WAAW,EAAE,EAAE;CAChB,CAAC,CAAA;AAEF,kBAAe,KAAK,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-11-01 17:14:46\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2023-11-03 17:02:30\n * @FilePath: /tntd/packages/tntd/src/locale/en_US.ts\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport sourceLocale from 'antd/lib/locale/en_US'\n\nimport { merge } from 'lodash'\n\n// 覆盖原始的语言包,以便在使用 LocalReceiver 时获取正确的语言包\nconst en_US = merge(sourceLocale, {\n Table: {\n loadingDescription: 'loading...',\n emptyDescription: 'No data',\n total: 'Totally ${total} Record(s)',\n },\n Empty: {\n noGraphData: 'No data',\n noPermission: 'No permission',\n createdSuccessfully: 'Created successfully',\n creationFailed: 'Creation failed',\n noNetwork: 'Network not connected',\n noData: 'No data',\n },\n Calendar: {\n lang: {\n timeSelect: 'Select time',\n ok: 'OK',\n dateSelect: 'Select date',\n },\n },\n Handle: {\n more: 'More',\n },\n Exception: {\n '403': \"Sorry, we don't have access to this page\",\n '404': 'Sorry, there are no results on this page',\n '500': \"I'm sorry, the server reported an error\",\n },\n TntdCascader: {\n noData: 'No data',\n },\n TntdSelect: {\n noData: 'No data',\n },\n PageLoading: {\n text: 'loading...',\n },\n TntdSecondPage: {\n back: 'Back',\n },\n ColorPicker: {},\n})\n\nexport default en_US\n"]}
1
+ {"version":3,"file":"en_US.js","sourceRoot":"","sources":["../../src/locale/en_US.ts"],"names":[],"mappings":";;;;;AAAA;;;;;;;GAOG;AACH,iEAA+C;AAE/C,mCAA8B;AAE9B,yCAAyC;AACzC,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,eAAY,EAAE;IAChC,KAAK,EAAE;QACL,kBAAkB,EAAE,YAAY;QAChC,gBAAgB,EAAE,SAAS;QAC3B,KAAK,EAAE,4BAA4B;KACpC;IACD,KAAK,EAAE;QACL,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,eAAe;QAC7B,mBAAmB,EAAE,sBAAsB;QAC3C,cAAc,EAAE,iBAAiB;QACjC,SAAS,EAAE,uBAAuB;QAClC,MAAM,EAAE,SAAS;KAClB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,UAAU,EAAE,aAAa;YACzB,EAAE,EAAE,IAAI;YACR,UAAU,EAAE,aAAa;SAC1B;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;KACb;IACD,SAAS,EAAE;QACT,KAAK,EAAE,0CAA0C;QACjD,KAAK,EAAE,0CAA0C;QACjD,KAAK,EAAE,yCAAyC;KACjD;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,SAAS;KAClB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,SAAS;KAClB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,YAAY;KACnB;IACD,cAAc,EAAE;QACd,IAAI,EAAE,MAAM;KACb;IACD,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAA;AAEF,kBAAe,KAAK,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-11-01 17:14:46\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2023-11-03 17:02:30\n * @FilePath: /tntd/packages/tntd/src/locale/en_US.ts\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport sourceLocale from 'antd/lib/locale/en_US'\n\nimport { merge } from 'lodash'\n\n// 覆盖原始的语言包,以便在使用 LocalReceiver 时获取正确的语言包\nconst en_US = merge(sourceLocale, {\n Table: {\n loadingDescription: 'loading...',\n emptyDescription: 'No data',\n total: 'Totally ${total} Record(s)',\n },\n Empty: {\n noGraphData: 'No data',\n noPermission: 'No permission',\n createdSuccessfully: 'Created successfully',\n creationFailed: 'Creation failed',\n noNetwork: 'Network not connected',\n noData: 'No data',\n },\n Calendar: {\n lang: {\n timeSelect: 'Select time',\n ok: 'OK',\n dateSelect: 'Select date',\n },\n },\n Handle: {\n more: 'More',\n },\n Exception: {\n '403': \"Sorry, we don't have access to this page\",\n '404': 'Sorry, there are no results on this page',\n '500': \"I'm sorry, the server reported an error\",\n },\n TntdCascader: {\n noData: 'No data',\n },\n TntdSelect: {\n noData: 'No data',\n },\n PageLoading: {\n text: 'loading...',\n },\n TntdSecondPage: {\n back: 'Back',\n },\n ColorPicker: {},\n Drawer: {\n okText: 'Submit',\n cancelText: 'Cancel',\n },\n})\n\nexport default en_US\n"]}
@@ -100,6 +100,10 @@ declare const zh_CN: {
100
100
  back: string;
101
101
  };
102
102
  ColorPicker: {};
103
+ Drawer: {
104
+ okText: string;
105
+ cancelText: string;
106
+ };
103
107
  };
104
108
  export default zh_CN;
105
109
  //# sourceMappingURL=zh_CN.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zh_CN.d.ts","sourceRoot":"","sources":["../../src/locale/zh_CN.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCT,CAAA;AAEF,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"zh_CN.d.ts","sourceRoot":"","sources":["../../src/locale/zh_CN.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCT,CAAA;AAEF,eAAe,KAAK,CAAA"}
@@ -42,6 +42,10 @@ var zh_CN = (0, _merge2["default"])(_zh_CN["default"], {
42
42
  TntdSecondPage: {
43
43
  back: '返回'
44
44
  },
45
- ColorPicker: {}
45
+ ColorPicker: {},
46
+ Drawer: {
47
+ okText: '确定',
48
+ cancelText: '取消'
49
+ }
46
50
  });
47
51
  var _default = exports["default"] = zh_CN;
@@ -1 +1 @@
1
- {"version":3,"file":"zh_CN.js","sourceRoot":"","sources":["../../src/locale/zh_CN.ts"],"names":[],"mappings":";;;;;AAAA,iEAA+C;AAE/C,mCAA8B;AAE9B,yCAAyC;AACzC,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,eAAY,EAAE;IAChC,KAAK,EAAE;QACL,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB,EAAE,MAAM;QACxB,KAAK,EAAE,gBAAgB;KACxB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM;QACpB,mBAAmB,EAAE,MAAM;QAC3B,cAAc,EAAE,MAAM;QACtB,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,MAAM;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,IAAI;KACX;IACD,SAAS,EAAE;QACT,KAAK,EAAE,eAAe;QACtB,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,WAAW;KACnB;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM;KACf;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;KACf;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM;KACf;IACD,cAAc,EAAE;QACd,IAAI,EAAE,IAAI;KACX;IACD,WAAW,EAAE,EAAE;CAChB,CAAC,CAAA;AAEF,kBAAe,KAAK,CAAA","sourcesContent":["import sourceLocale from 'antd/lib/locale/zh_CN'\n\nimport { merge } from 'lodash'\n\n// 覆盖原始的语言包,以便在使用 LocalReceiver 时获取正确的语言包\nconst zh_CN = merge(sourceLocale, {\n Table: {\n loadingDescription: '数据加载中...',\n emptyDescription: '暂无数据',\n total: '共 ${total} 条记录',\n },\n Empty: {\n noGraphData: '暂无图表',\n noPermission: '暂无权限',\n createdSuccessfully: '创建成功',\n creationFailed: '创建失败',\n noNetwork: '网络未连接',\n noData: '暂无数据',\n },\n Handle: {\n more: '更多',\n },\n Exception: {\n '403': '很抱歉,暂无该页面访问权限',\n '404': '很抱歉,本页暂无结果',\n '500': '很抱歉,服务器报错',\n },\n TntdCascader: {\n noData: '暂无数据',\n },\n PageLoading: {\n text: '加载中...',\n },\n TntdSelect: {\n noData: '暂无数据',\n },\n TntdSecondPage: {\n back: '返回',\n },\n ColorPicker: {},\n})\n\nexport default zh_CN\n"]}
1
+ {"version":3,"file":"zh_CN.js","sourceRoot":"","sources":["../../src/locale/zh_CN.ts"],"names":[],"mappings":";;;;;AAAA,iEAA+C;AAE/C,mCAA8B;AAE9B,yCAAyC;AACzC,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,eAAY,EAAE;IAChC,KAAK,EAAE;QACL,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB,EAAE,MAAM;QACxB,KAAK,EAAE,gBAAgB;KACxB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM;QACpB,mBAAmB,EAAE,MAAM;QAC3B,cAAc,EAAE,MAAM;QACtB,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,MAAM;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,IAAI;KACX;IACD,SAAS,EAAE;QACT,KAAK,EAAE,eAAe;QACtB,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,WAAW;KACnB;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM;KACf;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;KACf;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM;KACf;IACD,cAAc,EAAE;QACd,IAAI,EAAE,IAAI;KACX;IACD,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;KACjB;CACF,CAAC,CAAA;AAEF,kBAAe,KAAK,CAAA","sourcesContent":["import sourceLocale from 'antd/lib/locale/zh_CN'\n\nimport { merge } from 'lodash'\n\n// 覆盖原始的语言包,以便在使用 LocalReceiver 时获取正确的语言包\nconst zh_CN = merge(sourceLocale, {\n Table: {\n loadingDescription: '数据加载中...',\n emptyDescription: '暂无数据',\n total: '共 ${total} 条记录',\n },\n Empty: {\n noGraphData: '暂无图表',\n noPermission: '暂无权限',\n createdSuccessfully: '创建成功',\n creationFailed: '创建失败',\n noNetwork: '网络未连接',\n noData: '暂无数据',\n },\n Handle: {\n more: '更多',\n },\n Exception: {\n '403': '很抱歉,暂无该页面访问权限',\n '404': '很抱歉,本页暂无结果',\n '500': '很抱歉,服务器报错',\n },\n TntdCascader: {\n noData: '暂无数据',\n },\n PageLoading: {\n text: '加载中...',\n },\n TntdSelect: {\n noData: '暂无数据',\n },\n TntdSecondPage: {\n back: '返回',\n },\n ColorPicker: {},\n Drawer: {\n okText: '确定',\n cancelText: '取消',\n },\n})\n\nexport default zh_CN\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page-loading/index.js"],"names":[],"mappings":"AAMe,yDAad"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page-loading/index.js"],"names":[],"mappings":"AAMe,yDAgBd"}
@@ -19,12 +19,16 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
19
19
  };
20
20
  var _default = exports["default"] = function _default(props) {
21
21
  var className = props.className,
22
- other = __rest(props, ["className"]);
22
+ version = props.version,
23
+ other = __rest(props, ["className", "version"]);
24
+ var currentVersion = version || localStorage.getItem('app_version') || 'v2';
23
25
  return _react["default"].createElement(_LocaleReceiver["default"], {
24
26
  componentName: "PageLoading"
25
27
  }, function (locale, localeCode) {
26
28
  return _react["default"].createElement("div", Object.assign({
27
- className: (0, _classnames["default"])('tnt-page-loading-container', className)
28
- }, other), _react["default"].createElement("span", null, locale.text));
29
+ className: (0, _classnames["default"])('tnt-page-loading-container', 'tnt-current-' + currentVersion, className)
30
+ }, other), _react["default"].createElement("div", {
31
+ className: "tnt-page-loading-bg"
32
+ }, _react["default"].createElement("span", null, locale.text)));
29
33
  });
30
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-loading/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,4DAA2B;AAC3B,4FAAmE;AAEnE,wBAAqB;AAErB,kBAAe,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,EAAE,SAAS,KAAe,KAAK,EAAf,KAAK,UAAK,KAAK,EAA/B,aAAuB,CAAQ,CAAA;IACrC,OAAO,CACH,8BAAC,wBAAc,IAAC,aAAa,EAAC,aAAa,IACxC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACtB,OAAO,CACH,qDAAK,SAAS,EAAE,IAAA,oBAAE,EAAC,4BAA4B,EAAE,SAAS,CAAC,IAAM,KAAK;YACtE,4CAAO,MAAM,CAAC,IAAI,CAAQ,CACxB,CACL,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACP,CAAC,CAAC","sourcesContent":["import React from 'react'\nimport cn from 'classnames'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\n\nimport './index.less'\n\nexport default (props) => {\n const { className, ...other } = props\n return (\n <LocaleReceiver componentName=\"PageLoading\">\n {(locale, localeCode) => {\n return (\n <div className={cn('tnt-page-loading-container', className)} {...other}>\n <span>{locale.text}</span>\n </div>\n )\n }}\n </LocaleReceiver>\n ) \n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-loading/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,4DAA2B;AAC3B,4FAAmE;AAEnE,wBAAqB;AAErB,kBAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EAAE,SAAS,EAAE,OAAO,KAAe,KAAK,EAAf,KAAK,UAAK,KAAK,EAAxC,wBAAgC,CAAQ,CAAA;IAC9C,MAAM,cAAc,GAAG,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,IAAI,CAAA;IAC7E,OAAO,CACL,8BAAC,wBAAc,IAAC,aAAa,EAAC,aAAa,IACxC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACtB,OAAO,CACL,qDAAK,SAAS,EAAE,IAAA,oBAAE,EAAC,4BAA4B,EAAE,cAAc,GAAG,cAAc,EAAE,SAAS,CAAC,IAAM,KAAK;YACrG,uCAAK,SAAS,EAAC,qBAAqB;gBAClC,4CAAO,MAAM,CAAC,IAAI,CAAQ,CACtB,CACF,CACP,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAC","sourcesContent":["import React from 'react'\nimport cn from 'classnames'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\n\nimport './index.less'\n\nexport default (props) => {\n const { className, version, ...other } = props\n const currentVersion = version || localStorage.getItem('app_version') || 'v2'\n return (\n <LocaleReceiver componentName=\"PageLoading\">\n {(locale, localeCode) => {\n return (\n <div className={cn('tnt-page-loading-container', 'tnt-current-' + currentVersion, className)} {...other}>\n <div className=\"tnt-page-loading-bg\">\n <span>{locale.text}</span>\n </div>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n};\n"]}
@@ -1,22 +1,38 @@
1
1
  .tnt-page-loading-container {
2
- position: fixed;
3
- top: 140px;
4
- left: 50%;
5
- width: 70px;
6
- height: 70px;
7
- background-size: 100% 100%;
8
- transform: translate(-50%, 0);
9
- background-repeat: no-repeat;
10
- background-image: url("./loading.gif");
11
- z-index: 99999999999;
12
- text-align: center;
13
- span {
2
+ position: relative;
3
+ &.tnt-current-v2 {
4
+ height: calc(-50px + 100vh) !important;
5
+ }
6
+ &.tnt-current-v3 {
7
+ height: calc(-60px + 100vh) !important;
8
+ }
9
+ .tnt-page-loading-bg {
14
10
  position: absolute;
11
+ top: 45%;
15
12
  left: 50%;
16
- bottom: 0;
17
- transform: translate(-50%, 0);
18
- width: 100%;
19
- font-size: 12px;
20
- color: #17233D;
13
+ width: 70px;
14
+ height: 70px;
15
+ background-size: 100% 100%;
16
+ transform: translate(-50%, -50%);
17
+ background-repeat: no-repeat;
18
+ background-image: url("./loading.gif");
19
+ z-index: 99999999999;
20
+ text-align: center;
21
+ span {
22
+ position: absolute;
23
+ left: 50%;
24
+ bottom: 0;
25
+ transform: translate(-50%, 0);
26
+ width: 100%;
27
+ font-size: 12px;
28
+ color: #17233D;
29
+ }
30
+ }
31
+ }
32
+ .tnt-themeS2,.tnt-themeS3 {
33
+ .tnt-current-v3.tnt-page-loading-container {
34
+ span {
35
+ color: #fff;
36
+ }
21
37
  }
22
38
  }
@@ -3,7 +3,7 @@
3
3
  background: #fff;
4
4
  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.05);
5
5
  padding: 20px 16px 16px 16px;
6
- height: calc(-84px + 100vh) !important;
6
+ max-height: calc(-84px + 100vh) !important;
7
7
  overflow-y: auto;
8
8
 
9
9
  .tnt-querylistscene-content {
@@ -1,3 +1,4 @@
1
- declare function _default(WrappedComponent: any, options?: {}): (props: any) => import("react").JSX.Element;
1
+ declare function _default(WrappedComponent: any, options?: {}): (props: any) => React.JSX.Element;
2
2
  export default _default;
3
+ import React from "react";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tabs-container/index.js"],"names":[],"mappings":"AAIe,4GASd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tabs-container/index.js"],"names":[],"mappings":"AAKe,kGASd"}