tntd 3.0.4 → 3.0.5

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.
@@ -25,7 +25,7 @@
25
25
 
26
26
  .title-left {
27
27
  float: left;
28
- color: #17233d;
28
+ color: @text-color;
29
29
  font-size: 14px;
30
30
  }
31
31
  .title-extra {
@@ -49,7 +49,7 @@
49
49
  height: 48px;
50
50
  line-height: 48px;
51
51
  border-bottom: 1px solid #e1e6ee;
52
- color: #17233d;
52
+ color: @text-color;
53
53
  font-size: 14px;
54
54
 
55
55
  .tab-item {
@@ -70,7 +70,7 @@
70
70
  height: calc(~'100% - 48px');
71
71
  padding: 10px 20px;
72
72
  overflow-y: scroll;
73
- color: #17233d;
73
+ color: @text-color;
74
74
  }
75
75
  }
76
76
  }
@@ -50,7 +50,7 @@ export const Drawer = _a => {
50
50
  cancelText = '',
51
51
  locale,
52
52
  okType = 'primary',
53
- cancelType = 'default',
53
+ cancelType = 'tertiary',
54
54
  confirmLoading = false,
55
55
  okButtonProps = {},
56
56
  cancelButtonProps = {},
@@ -114,12 +114,14 @@ export const Drawer = _a => {
114
114
  onClose: _onCancel,
115
115
  width: 480
116
116
  }, rest, {
117
- title: !unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title
118
- }), React.createElement(React.Fragment, null, closable !== false && React.createElement(Icon, {
119
- type: "close",
120
- className: `${prefixCls}-close`,
121
- onClick: _onCancel
122
- }), rest.children, (showFooter || footer) && React.createElement("div", {
117
+ title: React.createElement(React.Fragment, null, React.createElement("div", {
118
+ className: "tnt-drawer-title-content"
119
+ }, !unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title), closable !== false && React.createElement(Icon, {
120
+ type: "close",
121
+ className: `${prefixCls}-close`,
122
+ onClick: _onCancel
123
+ }))
124
+ }), React.createElement(React.Fragment, null, rest.children, (showFooter || footer) && React.createElement("div", {
123
125
  className: `${prefixCls}-footer-style`
124
126
  }, footer || React.createElement(DefaultFooter, {
125
127
  confirmLoading: confirmLoading,
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,KAAK,EAAE,EAAM,WAAW,EAAE,SAAS,EAAU,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,GAeX,EAAE,EAAE;IACH,OAAO,CACL;QACE,oBAAC,MAAM,kBAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,IAAI,UAAU,IAAM,iBAAiB,GAC7E,UAAU,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAA,CAC1B;QACT,oBAAC,MAAM,kBAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,SAAS,EAAE,OAAO,EAAE,cAAc,IAAM,aAAa,GACzF,MAAM,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,CAClB,CACR,CACJ,CAAA;AACH,CAAC,CAAA;AA0BD,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAuB7C,EAAE,EAAE;QAvByC,EAC5C,QAAQ,GAAG,IAAI,EACf,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO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AAC,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,OAAO,EAAE,SAAS,GAAI,CAC3E;wBACA,IAAI,CAAC,QAAQ;wBACb,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CACzB,6BAAK,SAAS,EAAE,GAAG,SAAS,eAAe,IACxC,MAAM,IAAI,CACT,oBAAC,aAAa,IACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,GACnB,CACH,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/es/config-provider'\nimport type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer'\nimport { default as AntdDrawer } from 'antd/es/drawer'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport type { BaseButtonProps } from 'antd/es/button/button'\nimport type { TntButtonType } from '../button/button'\nimport { doUpperTitle } from '../utils'\nimport React, { FC, useCallback, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\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 onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: TntButtonType\n cancelType: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onCancel} type={cancelType || 'tertiary'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onOk} type={okType || 'primary'} loading={confirmLoading} {...okButtonProps}>\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 afterClose?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: TntButtonType\n cancelType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n upperCaseIgnore?: []\n unUpperConverted: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n afterClose,\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 upperCaseIgnore,\n unUpperConverted,\n title,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = useCallback(() => {\n if (onCancel) {\n onCancel()\n } else if (onClose) {\n onClose()\n }\n if (afterClose) {\n afterClose()\n }\n }, [onCancel, onClose, afterClose])\n const _onOk = onOk || onSubmit\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', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\n >\n <>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={_onCancel} />\n )}\n {rest.children}\n {(showFooter || footer) && (\n <div className={`${prefixCls}-footer-style`}>\n {footer || (\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 onOk={_onOk}\n onCancel={_onCancel}\n />\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,KAAK,EAAE,EAAM,WAAW,EAAE,SAAS,EAAU,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OA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EACX,QAAQ,EAAE,SAAS,GACnB,CACH,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/es/config-provider'\nimport type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer'\nimport { default as AntdDrawer } from 'antd/es/drawer'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport type { BaseButtonProps } from 'antd/es/button/button'\nimport type { TntButtonType } from '../button/button'\nimport { doUpperTitle } from '../utils'\nimport React, { FC, useCallback, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\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 onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: TntButtonType\n cancelType: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onCancel} type={cancelType || 'tertiary'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onOk} type={okType || 'primary'} loading={confirmLoading} {...okButtonProps}>\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 afterClose?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: TntButtonType\n cancelType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n upperCaseIgnore?: []\n unUpperConverted: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n afterClose,\n onSubmit,\n onCancel,\n onOk,\n okText = '',\n cancelText = '',\n locale,\n okType = 'primary',\n cancelType = 'tertiary',\n confirmLoading = false,\n okButtonProps = {},\n cancelButtonProps = {},\n clickOnBlankToClose = false,\n upperCaseIgnore,\n unUpperConverted,\n title,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = useCallback(() => {\n if (onCancel) {\n onCancel()\n } else if (onClose) {\n onClose()\n }\n if (afterClose) {\n afterClose()\n }\n }, [onCancel, onClose, afterClose])\n const _onOk = onOk || onSubmit\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', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={\n <>\n <div className=\"tnt-drawer-title-content\">\n {!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\n </div>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={_onCancel} />\n )}\n </>\n }\n >\n <>\n {rest.children}\n {(showFooter || footer) && (\n <div className={`${prefixCls}-footer-style`}>\n {footer || (\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 onOk={_onOk}\n onCancel={_onCancel}\n />\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  @drawer-prefix-cls: ~'@{ant-prefix}-drawer';
2
2
 
3
-
4
3
  .tnt-drawer.@{drawer-prefix-cls} {
5
4
  &-top {
6
5
  .@{drawer-prefix-cls}-wrapper-body {
@@ -72,7 +71,7 @@
72
71
  }
73
72
 
74
73
 
75
- .@{drawer-prefix-cls}-contain-closable {
74
+ &.@{drawer-prefix-cls}-contain-closable {
76
75
  .@{drawer-prefix-cls}-header {
77
76
  padding: 12px 36px 12px 20px;
78
77
  }
@@ -106,7 +106,7 @@
106
106
  border-radius: 0 0 @border-radius-base @border-radius-base;
107
107
  button + button {
108
108
  margin-bottom: 0;
109
- margin-left: @margin-xs;
109
+ margin-left: @margin-base;
110
110
  }
111
111
  }
112
112
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  & > span {
19
19
  font-size: 14px;
20
- color: #17233d;
20
+ color: @text-color;
21
21
  letter-spacing: 0;
22
22
  }
23
23
  }
@@ -80,7 +80,6 @@
80
80
  top: 45%;
81
81
  left: 58%;
82
82
  transform: rotate(-45deg);
83
- -webkit-transform: rotate(-45deg);
84
83
  }
85
84
  }
86
85
  &.small {
@@ -93,8 +92,8 @@
93
92
  font-size: 14px;
94
93
  }
95
94
  &::before {
96
- height: 14px;
97
- top: 7px;
95
+ height: 12px;
96
+ top: 8px;
98
97
  }
99
98
  }
100
99
  }
@@ -108,8 +107,8 @@
108
107
  font-size: 18px;
109
108
  }
110
109
  &::before {
111
- height: 18px;
112
- top: 9px;
110
+ height: 14px;
111
+ top: 10px;
113
112
  }
114
113
  }
115
114
  }
@@ -123,8 +122,8 @@
123
122
  font-size: 20px;
124
123
  }
125
124
  &::before {
126
- height: 20px;
127
- top: 9px;
125
+ height: 16px;
126
+ top: 10px;
128
127
  }
129
128
  }
130
129
  }
@@ -135,7 +134,7 @@
135
134
  }
136
135
  h3 {
137
136
  font-size: 16px;
138
- color: #17233d;
137
+ color: @text-color;
139
138
  font-weight: normal;
140
139
  margin: 0;
141
140
  margin-right: 10px;
@@ -153,12 +152,13 @@
153
152
  &::before {
154
153
  position: absolute;
155
154
  left: 0;
156
- top: 8px;
157
- background-color: #126bfb;
155
+ top: 9px;
156
+ background-color: @primary-color;
158
157
  content: '';
159
- width: 3px;
160
- height: 16px;
158
+ width: 4px;
159
+ height: 12px;
161
160
  margin-right: 8px;
161
+ border-radius: 2px;
162
162
  }
163
163
  }
164
164
  .tntd-title-extra {
@@ -11,7 +11,7 @@ const App = styled.li`
11
11
  font-size: 20px;
12
12
  cursor: pointer;
13
13
  .tnt-icon {
14
- color: #17233d99;
14
+ color: #17233d;
15
15
  .tnt-themeS1 & {
16
16
  color: rgba(255, 255, 255, 0.85);
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Application.js","sourceRoot":"","sources":["../../src/tntd-layout/Application.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,QAAQ,MAAM,YAAY,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C,IAAI,EAAE,GAAG,CAAC;YAElC,6BACE,GAAG,EAAE,GAAG,CAAC,eAAe,EAAE,GAAG,GAAG,OAAO,EAAE,WAAW,CAAC,EACrD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;oBACvB,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,WAAW,CAAA;gBAC5B,CAAC,GACD;YACF,iCACG,GAAG,CACF,eAAe,EACf,GAAG,GAAG,IACJ;gBACE,EAAE,EAAE,MAAM;gBACV,EAAE,EAAE,QAAQ;aACb,CAAC,QAAQ,IAAI,IAAI,CACpB,EAAE,EACF,GAAG,CACJ,CACG,CACE,CACX,CAAC,CACI,CACQ,CACrB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CACxB,oBAAC,GAAG;IACF,oBAAC,OAAO,IACN,SAAS,EAAC,aAAa,EACvB,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,oBAAC,UAAU,oBAAK,KAAK,EAAI,EAClC,OAAO,EAAC,OAAO;QAEf,oBAAC,QAAQ,IAAC,IAAI,EAAC,aAAa,GAAG,CACvB,CACN,CACP,CAAA","sourcesContent":["import { systemMap as applicationsMap } from '@tntx/logo-icon'\nimport cn from 'classnames'\nimport { get } from 'lodash'\nimport React, { useState } from 'react'\nimport styled from 'styled-components'\nimport Popover from '../popover'\nimport Iconfont from './Iconfont'\nimport { defaultLogo } from './images'\n\nconst App = styled.li`\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n`\n\nconst AppList = styled.ul`\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n`\n\nconst AppItem = styled.li`\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover,\n &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n`\n\nconst AppContentWrapper = styled.div`\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n`\n\nconst AppContent = (props) => {\n const { language, apps, onChange } = props\n const [appKey, setAppKey] = useState(props.appKey)\n const changeApp = (appKey) => {\n setAppKey(appKey)\n onChange && onChange(appKey)\n }\n\n return (\n <AppContentWrapper>\n <AppList>\n {apps\n .sort(\n (a, b) =>\n get(applicationsMap, `${a.appKey}.sort`, 1) -\n get(applicationsMap, `${b.appKey}.sort`, 1)\n )\n .map(({ appKey: key }) => (\n <AppItem\n key={key}\n className={cn({ active: appKey === key })}\n onClick={changeApp.bind(this, key)}\n >\n <img\n src={get(applicationsMap, `${key}.logo`, defaultLogo)}\n onError={(e) => {\n e.target.onerror = null\n e.target.src = defaultLogo\n }}\n />\n <div>\n {get(\n applicationsMap,\n `${key}.${\n {\n cn: 'name',\n en: 'enName',\n }[language || 'cn']\n }`,\n key\n )}\n </div>\n </AppItem>\n ))}\n </AppList>\n </AppContentWrapper>\n )\n}\n\nexport default (props) => (\n <App>\n <Popover\n placement=\"bottomRight\"\n title={null}\n content={<AppContent {...props} />}\n trigger=\"click\"\n >\n <Iconfont type=\"application\" />\n </Popover>\n </App>\n)\n"]}
1
+ {"version":3,"file":"Application.js","sourceRoot":"","sources":["../../src/tntd-layout/Application.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,O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EACR,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC,EACzC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC;YAElC,6BACE,GAAG,EAAE,GAAG,CAAC,eAAe,EAAE,GAAG,GAAG,OAAO,EAAE,WAAW,CAAC,EACrD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;oBACvB,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,WAAW,CAAA;gBAC5B,CAAC,GACD;YACF,iCACG,GAAG,CACF,eAAe,EACf,GAAG,GAAG,IACJ;gBACE,EAAE,EAAE,MAAM;gBACV,EAAE,EAAE,QAAQ;aACb,CAAC,QAAQ,IAAI,IAAI,CACpB,EAAE,EACF,GAAG,CACJ,CACG,CACE,CACX,CAAC,CACI,CACQ,CACrB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CACxB,oBAAC,GAAG;IACF,oBAAC,OAAO,IACN,SAAS,EAAC,aAAa,EACvB,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,oBAAC,UAAU,oBAAK,KAAK,EAAI,EAClC,OAAO,EAAC,OAAO;QAEf,oBAAC,QAAQ,IAAC,IAAI,EAAC,aAAa,GAAG,CACvB,CACN,CACP,CAAA","sourcesContent":["import { systemMap as applicationsMap } from '@tntx/logo-icon'\nimport cn from 'classnames'\nimport { get } from 'lodash'\nimport React, { useState } from 'react'\nimport styled from 'styled-components'\nimport Popover from '../popover'\nimport Iconfont from './Iconfont'\nimport { defaultLogo } from './images'\n\nconst App = styled.li`\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n`\n\nconst AppList = styled.ul`\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n`\n\nconst AppItem = styled.li`\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover,\n &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n`\n\nconst AppContentWrapper = styled.div`\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n`\n\nconst AppContent = (props) => {\n const { language, apps, onChange } = props\n const [appKey, setAppKey] = useState(props.appKey)\n const changeApp = (appKey) => {\n setAppKey(appKey)\n onChange && onChange(appKey)\n }\n\n return (\n <AppContentWrapper>\n <AppList>\n {apps\n .sort(\n (a, b) =>\n get(applicationsMap, `${a.appKey}.sort`, 1) -\n get(applicationsMap, `${b.appKey}.sort`, 1)\n )\n .map(({ appKey: key }) => (\n <AppItem\n key={key}\n className={cn({ active: appKey === key })}\n onClick={changeApp.bind(this, key)}\n >\n <img\n src={get(applicationsMap, `${key}.logo`, defaultLogo)}\n onError={(e) => {\n e.target.onerror = null\n e.target.src = defaultLogo\n }}\n />\n <div>\n {get(\n applicationsMap,\n `${key}.${\n {\n cn: 'name',\n en: 'enName',\n }[language || 'cn']\n }`,\n key\n )}\n </div>\n </AppItem>\n ))}\n </AppList>\n </AppContentWrapper>\n )\n}\n\nexport default (props) => (\n <App>\n <Popover\n placement=\"bottomRight\"\n title={null}\n content={<AppContent {...props} />}\n trigger=\"click\"\n >\n <Iconfont type=\"application\" />\n </Popover>\n </App>\n)\n"]}
@@ -21,12 +21,12 @@
21
21
  &-back {
22
22
  font-size: 14px;
23
23
  font-weight: 400;
24
- color: #17233d;
24
+ color: @text-color;
25
25
  margin-right: 10px;
26
26
  }
27
27
  &-title {
28
28
  font-size: 14px;
29
- color: #17233d;
29
+ color: @text-color;
30
30
  }
31
31
  &-toolbar {
32
32
  float: right;
@@ -25,7 +25,7 @@
25
25
 
26
26
  .title-left {
27
27
  float: left;
28
- color: #17233d;
28
+ color: @text-color;
29
29
  font-size: 14px;
30
30
  }
31
31
  .title-extra {
@@ -49,7 +49,7 @@
49
49
  height: 48px;
50
50
  line-height: 48px;
51
51
  border-bottom: 1px solid #e1e6ee;
52
- color: #17233d;
52
+ color: @text-color;
53
53
  font-size: 14px;
54
54
 
55
55
  .tab-item {
@@ -70,7 +70,7 @@
70
70
  height: calc(~'100% - 48px');
71
71
  padding: 10px 20px;
72
72
  overflow-y: scroll;
73
- color: #17233d;
73
+ color: @text-color;
74
74
  }
75
75
  }
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,KAAK,EAAE,EAAE,EAAE,EAAkC,MAAM,OAAO,CAAA;AAyCjE,UAAU,iBAAkB,SAAQ,eAAe;IACjD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE;QACP,MAAM,CAAC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,MAAM,CAAA;KACpB,CAAA;IACD,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,eAAe,CAAA;IAC/B,iBAAiB,CAAC,EAAE,eAAe,CAAA;IACnC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,eAAe,CAAC,EAAE,EAAE,CAAA;IACpB,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,iBAAiB,CA2HxC,CAAA"}
@@ -66,7 +66,7 @@ var Drawer = exports.Drawer = function Drawer(_a) {
66
66
  _a$okType = _a.okType,
67
67
  okType = _a$okType === void 0 ? 'primary' : _a$okType,
68
68
  _a$cancelType = _a.cancelType,
69
- cancelType = _a$cancelType === void 0 ? 'default' : _a$cancelType,
69
+ cancelType = _a$cancelType === void 0 ? 'tertiary' : _a$cancelType,
70
70
  _a$confirmLoading = _a.confirmLoading,
71
71
  confirmLoading = _a$confirmLoading === void 0 ? false : _a$confirmLoading,
72
72
  _a$okButtonProps = _a.okButtonProps,
@@ -129,12 +129,14 @@ var Drawer = exports.Drawer = function Drawer(_a) {
129
129
  onClose: _onCancel,
130
130
  width: 480
131
131
  }, rest, {
132
- title: !unUpperConverted ? (0, _utils.doUpperTitle)(title, upperCaseIgnore) : title
133
- }), _react["default"].createElement(_react["default"].Fragment, null, closable !== false && _react["default"].createElement(_icon["default"], {
134
- type: "close",
135
- className: "".concat(prefixCls, "-close"),
136
- onClick: _onCancel
137
- }), rest.children, (showFooter || footer) && _react["default"].createElement("div", {
132
+ title: _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("div", {
133
+ className: "tnt-drawer-title-content"
134
+ }, !unUpperConverted ? (0, _utils.doUpperTitle)(title, upperCaseIgnore) : title), closable !== false && _react["default"].createElement(_icon["default"], {
135
+ type: "close",
136
+ className: "".concat(prefixCls, "-close"),
137
+ onClick: _onCancel
138
+ }))
139
+ }), _react["default"].createElement(_react["default"].Fragment, null, rest.children, (showFooter || footer) && _react["default"].createElement("div", {
138
140
  className: "".concat(prefixCls, "-footer-style")
139
141
  }, footer || _react["default"].createElement(DefaultFooter, {
140
142
  confirmLoading: confirmLoading,
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAwD;AAExD,4DAAsD;AACtD,4FAAmE;AACnE,4DAAmC;AAGnC,oCAAuC;AACvC,+CAAiE;AACjE,sCAAkC;AAClC,mDAA0B;AAC1B,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,GAeX,EAAE,EAAE;IACH,OAAO,CACL;QACE,8BAAC,eAAM,kBAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,IAAI,UAAU,IAAM,iBAAiB,GAC7E,UAAU,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAA,CAC1B;QACT,8BAAC,eAAM,kBAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,SAAS,EAAE,OAAO,EAAE,cAAc,IAAM,aAAa,GACzF,MAAM,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,CAClB,CACR,CACJ,CAAA;AACH,CAAC,CAAA;AA0BM,MAAM,MAAM,GAA0B,CAAC,EAuB7C,EAAE,EAAE;QAvByC,EAC5C,QAAQ,GAAG,IAAI,EACf,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,MAAM,GAAG,EAAE,EACX,UAAU,GAAG,E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AS,GAAI,CAC3E;wBACA,IAAI,CAAC,QAAQ;wBACb,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CACzB,uCAAK,SAAS,EAAE,GAAG,SAAS,eAAe,IACxC,MAAM,IAAI,CACT,8BAAC,aAAa,IACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,GACnB,CACH,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AArHY,QAAA,MAAM,UAqHlB","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 { TntButtonType } from '../button/button'\nimport { doUpperTitle } from '../utils'\nimport React, { FC, useCallback, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\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 onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: TntButtonType\n cancelType: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onCancel} type={cancelType || 'tertiary'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onOk} type={okType || 'primary'} loading={confirmLoading} {...okButtonProps}>\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 afterClose?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: TntButtonType\n cancelType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n upperCaseIgnore?: []\n unUpperConverted: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n afterClose,\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 upperCaseIgnore,\n unUpperConverted,\n title,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = useCallback(() => {\n if (onCancel) {\n onCancel()\n } else if (onClose) {\n onClose()\n }\n if (afterClose) {\n afterClose()\n }\n }, [onCancel, onClose, afterClose])\n const _onOk = onOk || onSubmit\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', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\n >\n <>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={_onCancel} />\n )}\n {rest.children}\n {(showFooter || footer) && (\n <div className={`${prefixCls}-footer-style`}>\n {footer || (\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 onOk={_onOk}\n onCancel={_onCancel}\n />\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAwD;AAExD,4DAAsD;AACtD,4FAAmE;AACnE,4DAAmC;AAGnC,oCAAuC;AACvC,+CAAiE;AACjE,sCAAkC;AAClC,mDAA0B;AAC1B,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,GAeX,EAAE,EAAE;IACH,OAAO,CACL;QACE,8BAAC,eAAM,kBAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,E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kBACT,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;wBACxD,CAAC,GAAG,SAAS,mBAAmB,CAAC,EAAE,QAAQ,KAAK,KAAK;wBACrD,CAAC,GAAG,SAAS,SAAS,CAAC,EAAE,UAAU,IAAI,MAAM;qBAC9C,CAAC,EACF,QAAQ,EAAE,KAAK,EACf,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,GAAG,IACN,IAAI,IACR,KAAK,EACH;wBACE,uCAAK,SAAS,EAAC,0BAA0B,IACtC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAA,oBAAY,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAC7D;wBACL,QAAQ,KAAK,KAAK,IAAI,CACrB,8BAAC,cAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,OAAO,EAAE,SAAS,GAAI,CAC3E,CACA;oBAGL;wBACG,IAAI,CAAC,QAAQ;wBACb,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CACzB,uCAAK,SAAS,EAAE,GAAG,SAAS,eAAe,IACxC,MAAM,IAAI,CACT,8BAAC,aAAa,IACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,GACnB,CACH,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AA3HY,QAAA,MAAM,UA2HlB","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 { TntButtonType } from '../button/button'\nimport { doUpperTitle } from '../utils'\nimport React, { FC, useCallback, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\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 onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: TntButtonType\n cancelType: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onCancel} type={cancelType || 'tertiary'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onOk} type={okType || 'primary'} loading={confirmLoading} {...okButtonProps}>\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 afterClose?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: TntButtonType\n cancelType?: TntButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n upperCaseIgnore?: []\n unUpperConverted: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n afterClose,\n onSubmit,\n onCancel,\n onOk,\n okText = '',\n cancelText = '',\n locale,\n okType = 'primary',\n cancelType = 'tertiary',\n confirmLoading = false,\n okButtonProps = {},\n cancelButtonProps = {},\n clickOnBlankToClose = false,\n upperCaseIgnore,\n unUpperConverted,\n title,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = useCallback(() => {\n if (onCancel) {\n onCancel()\n } else if (onClose) {\n onClose()\n }\n if (afterClose) {\n afterClose()\n }\n }, [onCancel, onClose, afterClose])\n const _onOk = onOk || onSubmit\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', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={\n <>\n <div className=\"tnt-drawer-title-content\">\n {!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\n </div>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={_onCancel} />\n )}\n </>\n }\n >\n <>\n {rest.children}\n {(showFooter || footer) && (\n <div className={`${prefixCls}-footer-style`}>\n {footer || (\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 onOk={_onOk}\n onCancel={_onCancel}\n />\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  @drawer-prefix-cls: ~'@{ant-prefix}-drawer';
2
2
 
3
-
4
3
  .tnt-drawer.@{drawer-prefix-cls} {
5
4
  &-top {
6
5
  .@{drawer-prefix-cls}-wrapper-body {
@@ -72,7 +71,7 @@
72
71
  }
73
72
 
74
73
 
75
- .@{drawer-prefix-cls}-contain-closable {
74
+ &.@{drawer-prefix-cls}-contain-closable {
76
75
  .@{drawer-prefix-cls}-header {
77
76
  padding: 12px 36px 12px 20px;
78
77
  }
@@ -106,7 +106,7 @@
106
106
  border-radius: 0 0 @border-radius-base @border-radius-base;
107
107
  button + button {
108
108
  margin-bottom: 0;
109
- margin-left: @margin-xs;
109
+ margin-left: @margin-base;
110
110
  }
111
111
  }
112
112
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  & > span {
19
19
  font-size: 14px;
20
- color: #17233d;
20
+ color: @text-color;
21
21
  letter-spacing: 0;
22
22
  }
23
23
  }
@@ -80,7 +80,6 @@
80
80
  top: 45%;
81
81
  left: 58%;
82
82
  transform: rotate(-45deg);
83
- -webkit-transform: rotate(-45deg);
84
83
  }
85
84
  }
86
85
  &.small {
@@ -93,8 +92,8 @@
93
92
  font-size: 14px;
94
93
  }
95
94
  &::before {
96
- height: 14px;
97
- top: 7px;
95
+ height: 12px;
96
+ top: 8px;
98
97
  }
99
98
  }
100
99
  }
@@ -108,8 +107,8 @@
108
107
  font-size: 18px;
109
108
  }
110
109
  &::before {
111
- height: 18px;
112
- top: 9px;
110
+ height: 14px;
111
+ top: 10px;
113
112
  }
114
113
  }
115
114
  }
@@ -123,8 +122,8 @@
123
122
  font-size: 20px;
124
123
  }
125
124
  &::before {
126
- height: 20px;
127
- top: 9px;
125
+ height: 16px;
126
+ top: 10px;
128
127
  }
129
128
  }
130
129
  }
@@ -135,7 +134,7 @@
135
134
  }
136
135
  h3 {
137
136
  font-size: 16px;
138
- color: #17233d;
137
+ color: @text-color;
139
138
  font-weight: normal;
140
139
  margin: 0;
141
140
  margin-right: 10px;
@@ -153,12 +152,13 @@
153
152
  &::before {
154
153
  position: absolute;
155
154
  left: 0;
156
- top: 8px;
157
- background-color: #126bfb;
155
+ top: 9px;
156
+ background-color: @primary-color;
158
157
  content: '';
159
- width: 3px;
160
- height: 16px;
158
+ width: 4px;
159
+ height: 12px;
161
160
  margin-right: 8px;
161
+ border-radius: 2px;
162
162
  }
163
163
  }
164
164
  .tntd-title-extra {
@@ -28,7 +28,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
28
28
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
29
29
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
30
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
31
- var App = _styledComponents["default"].li(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));
31
+ var App = _styledComponents["default"].li(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));
32
32
  var AppList = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n"])));
33
33
  var AppItem = _styledComponents["default"].li(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover,\n &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n"])));
34
34
  var AppContentWrapper = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"])));
@@ -1 +1 @@
1
- {"version":3,"file":"Application.js","sourceRoot":"","sources":["../../src/tntd-layout/Application.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,4DAA2B;AAC3B,mCAA4B;AAC5B,+CAAuC;AACvC,0EAAsC;AACtC,yDAAgC;AAChC,0DAAiC;AACjC,qCAAsC;AAEtC,MAAM,GAAG,GAAG,2BAAM,CAAC,EAAE,CAAA;;;;;;;;;;CAUpB,CAAA;AAED,MAAM,OAAO,GAAG,2BAAM,CAAC,EAAE,CAAA;;;;;CAKxB,CAAA;AAED,MAAM,OAAO,GAAG,2BAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxB,CAAA;AAED,MAAM,iBAAiB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAInC,CAAA;AAED,MAAM,UAAU,GA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J;gBACE,EAAE,EAAE,MAAM;gBACV,EAAE,EAAE,QAAQ;aACb,CAAC,QAAQ,IAAI,IAAI,CACpB,EAAE,EACF,GAAG,CACJ,CACG,CACE,CACX,CAAC,CACI,CACQ,CACrB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CACxB,8BAAC,GAAG;IACF,8BAAC,iBAAO,IACN,SAAS,EAAC,aAAa,EACvB,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,8BAAC,UAAU,oBAAK,KAAK,EAAI,EAClC,OAAO,EAAC,OAAO;QAEf,8BAAC,kBAAQ,IAAC,IAAI,EAAC,aAAa,GAAG,CACvB,CACN,CACP,CAAA","sourcesContent":["import { systemMap as applicationsMap } from '@tntx/logo-icon'\nimport cn from 'classnames'\nimport { get } from 'lodash'\nimport React, { useState } from 'react'\nimport styled from 'styled-components'\nimport Popover from '../popover'\nimport Iconfont from './Iconfont'\nimport { defaultLogo } from './images'\n\nconst App = styled.li`\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n`\n\nconst AppList = styled.ul`\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n`\n\nconst AppItem = styled.li`\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover,\n &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n`\n\nconst AppContentWrapper = styled.div`\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n`\n\nconst AppContent = (props) => {\n const { language, apps, onChange } = props\n const [appKey, setAppKey] = useState(props.appKey)\n const changeApp = (appKey) => {\n setAppKey(appKey)\n onChange && onChange(appKey)\n }\n\n return (\n <AppContentWrapper>\n <AppList>\n {apps\n .sort(\n (a, b) =>\n get(applicationsMap, `${a.appKey}.sort`, 1) -\n get(applicationsMap, `${b.appKey}.sort`, 1)\n )\n .map(({ appKey: key }) => (\n <AppItem\n key={key}\n className={cn({ active: appKey === key })}\n onClick={changeApp.bind(this, key)}\n >\n <img\n src={get(applicationsMap, `${key}.logo`, defaultLogo)}\n onError={(e) => {\n e.target.onerror = null\n e.target.src = defaultLogo\n }}\n />\n <div>\n {get(\n applicationsMap,\n `${key}.${\n {\n cn: 'name',\n en: 'enName',\n }[language || 'cn']\n }`,\n key\n )}\n </div>\n </AppItem>\n ))}\n </AppList>\n </AppContentWrapper>\n )\n}\n\nexport default (props) => (\n <App>\n <Popover\n placement=\"bottomRight\"\n title={null}\n content={<AppContent {...props} />}\n trigger=\"click\"\n >\n <Iconfont type=\"application\" />\n </Popover>\n </App>\n)\n"]}
1
+ {"version":3,"file":"Application.js","sourceRoot":"","sources":["../../src/tntd-layout/Application.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,4DAA2B;AAC3B,mCAA4B;AAC5B,+CAAuC;AACvC,0EAAsC;AACtC,yDAAgC;AAChC,0DAAiC;AACjC,qCAAsC;AAEtC,MAAM,GAAG,GAAG,2BAAM,CAAC,EAAE,CAAA;;;;;;;;;;CAUpB,CAAA;AAED,MAAM,OAAO,GAAG,2BAAM,CAAC,EAAE,CAAA;;;;;CAKxB,CAAA;AAED,MAAM,OAAO,GAAG,2BAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxB,CAAA;AAED,MAAM,iBAAiB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAInC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,EAAE;IAC3B,MAAM,EAAE,QAA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;aACb,CAAC,QAAQ,IAAI,IAAI,CACpB,EAAE,EACF,GAAG,CACJ,CACG,CACE,CACX,CAAC,CACI,CACQ,CACrB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CACxB,8BAAC,GAAG;IACF,8BAAC,iBAAO,IACN,SAAS,EAAC,aAAa,EACvB,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,8BAAC,UAAU,oBAAK,KAAK,EAAI,EAClC,OAAO,EAAC,OAAO;QAEf,8BAAC,kBAAQ,IAAC,IAAI,EAAC,aAAa,GAAG,CACvB,CACN,CACP,CAAA","sourcesContent":["import { systemMap as applicationsMap } from '@tntx/logo-icon'\nimport cn from 'classnames'\nimport { get } from 'lodash'\nimport React, { useState } from 'react'\nimport styled from 'styled-components'\nimport Popover from '../popover'\nimport Iconfont from './Iconfont'\nimport { defaultLogo } from './images'\n\nconst App = styled.li`\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n`\n\nconst AppList = styled.ul`\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n`\n\nconst AppItem = styled.li`\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover,\n &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n`\n\nconst AppContentWrapper = styled.div`\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n`\n\nconst AppContent = (props) => {\n const { language, apps, onChange } = props\n const [appKey, setAppKey] = useState(props.appKey)\n const changeApp = (appKey) => {\n setAppKey(appKey)\n onChange && onChange(appKey)\n }\n\n return (\n <AppContentWrapper>\n <AppList>\n {apps\n .sort(\n (a, b) =>\n get(applicationsMap, `${a.appKey}.sort`, 1) -\n get(applicationsMap, `${b.appKey}.sort`, 1)\n )\n .map(({ appKey: key }) => (\n <AppItem\n key={key}\n className={cn({ active: appKey === key })}\n onClick={changeApp.bind(this, key)}\n >\n <img\n src={get(applicationsMap, `${key}.logo`, defaultLogo)}\n onError={(e) => {\n e.target.onerror = null\n e.target.src = defaultLogo\n }}\n />\n <div>\n {get(\n applicationsMap,\n `${key}.${\n {\n cn: 'name',\n en: 'enName',\n }[language || 'cn']\n }`,\n key\n )}\n </div>\n </AppItem>\n ))}\n </AppList>\n </AppContentWrapper>\n )\n}\n\nexport default (props) => (\n <App>\n <Popover\n placement=\"bottomRight\"\n title={null}\n content={<AppContent {...props} />}\n trigger=\"click\"\n >\n <Iconfont type=\"application\" />\n </Popover>\n </App>\n)\n"]}
@@ -21,12 +21,12 @@
21
21
  &-back {
22
22
  font-size: 14px;
23
23
  font-weight: 400;
24
- color: #17233d;
24
+ color: @text-color;
25
25
  margin-right: 10px;
26
26
  }
27
27
  &-title {
28
28
  font-size: 14px;
29
- color: #17233d;
29
+ color: @text-color;
30
30
  }
31
31
  &-toolbar {
32
32
  float: right;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tntd",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "start": "heft start --storybook",