tntd 3.0.5 → 3.0.6

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.
@@ -13,7 +13,7 @@ import classNames from 'classnames';
13
13
  import { doUpperTitle } from '../utils';
14
14
  import React, { useCallback, useEffect } from 'react';
15
15
  import { Button } from '../button';
16
- import Icon from '../icon';
16
+ import '../icon';
17
17
  const DefaultFooter = ({
18
18
  locale,
19
19
  onCancel,
@@ -108,19 +108,14 @@ export const Drawer = _a => {
108
108
  }, React.createElement(AntdDrawer, Object.assign({
109
109
  className: classNames(prefixCls, 'tnt-drawer', className, {
110
110
  [`${prefixCls}-contain-closable`]: closable !== false,
111
+ [`${prefixCls}-no-header`]: closable === false && !title,
111
112
  [`${prefixCls}-footer`]: showFooter || footer
112
113
  }),
113
- closable: false,
114
+ closable: closable,
114
115
  onClose: _onCancel,
115
116
  width: 480
116
117
  }, rest, {
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
- }))
118
+ title: !unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title
124
119
  }), React.createElement(React.Fragment, null, rest.children, (showFooter || footer) && React.createElement("div", {
125
120
  className: `${prefixCls}-footer-style`
126
121
  }, footer || React.createElement(DefaultFooter, {
@@ -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,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AE,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 = '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
+ {"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,OAAiB,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,Q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oBAAC,UAAU,kBACT,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;wBACxD,CAAC,GAAG,SAAS,mBAAmB,CAAC,EAAE,QAAQ,KAAK,KAAK;wBACrD,CAAC,GAAG,SAAS,YAAY,CAAC,EAAE,QAAQ,KAAK,KAAK,IAAI,CAAC,KAAK;wBACxD,CAAC,GAAG,SAAS,SAAS,CAAC,EAAE,UAAU,IAAI,MAAM;qBAC9C,CAAC,EACF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,GAAG,IACN,IAAI,IACR,KAAK,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK;oBAEvE;wBACG,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 = '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}-no-header`]: closable === false && !title,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={closable}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\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"]}
@@ -22,6 +22,20 @@
22
22
  max-height: ~'calc(100vh - 48px)';
23
23
  }
24
24
 
25
+ &.@{drawer-prefix-cls}-no-header {
26
+ .@{drawer-prefix-cls}-wrapper-body{
27
+ margin-top: 0;
28
+ max-height: ~'calc(100vh)';
29
+ }
30
+ &.@{drawer-prefix-cls}-footer{
31
+ .@{drawer-prefix-cls}-wrapper-body{
32
+ margin-top:0 !important;
33
+ max-height: ~'calc(100vh - 48px)' !important;
34
+ margin-bottom: 48px !important;
35
+ }
36
+ }
37
+ }
38
+
25
39
  &-footer {
26
40
  .@{drawer-prefix-cls}-header {
27
41
  // border-bottom: none;
@@ -37,7 +51,6 @@
37
51
  margin-top: 48px !important;
38
52
  margin-bottom: 48px !important;
39
53
  }
40
-
41
54
  }
42
55
 
43
56
  .@{drawer-prefix-cls}-title {
@@ -58,7 +71,7 @@
58
71
  font-weight: 700;
59
72
  font-size: 20px;
60
73
  font-style: normal;
61
- line-height: 56px;
74
+ line-height: 48px;
62
75
  text-align: center;
63
76
  text-transform: none;
64
77
  text-decoration: none;
@@ -68,6 +81,9 @@
68
81
  cursor: pointer;
69
82
  transition: color 0.3s;
70
83
  text-rendering: auto;
84
+ i.tntd-anticon{
85
+ font-size:20px;
86
+ }
71
87
  }
72
88
 
73
89
 
@@ -147,6 +163,21 @@
147
163
  .@{ant-prefix}-btn {
148
164
  margin-left: 16px;
149
165
  }
166
+
167
+ // 如果button没有type类型默认设置为 type: tertiary的样式(兼容老业务用了footer的场景)
168
+ button:not([class*="ant-btn-"]):not([class*="tnt-btn-"]) {
169
+ color: #17233d;
170
+ background-color: #f8f9fb;
171
+ border-color: #f8f9fb;
172
+ text-shadow: none;
173
+ box-shadow: none;
174
+
175
+ &:hover{
176
+ color: var(--blue-6);
177
+ background-color: #f0f5ff;
178
+ border-color: #f0f5ff;
179
+ }
180
+ }
150
181
  }
151
182
 
152
183
  }
@@ -14,6 +14,9 @@
14
14
  &-title{
15
15
  line-height: @line-height-lg;
16
16
  }
17
+ div[aria-hidden=true]{
18
+ display: none;;
19
+ }
17
20
  }
18
21
 
19
22
  .@{confirm-prefix-cls}{
@@ -108,6 +108,20 @@
108
108
  margin-bottom: 0;
109
109
  margin-left: @margin-base;
110
110
  }
111
+ // 如果button没有type类型默认设置为type: tertiary的样式(兼容老业务用了footer的场景)
112
+ button:not([class*="ant-btn-"]):not([class*="tnt-btn-"]) {
113
+ color: #17233d;
114
+ background-color: #f8f9fb;
115
+ border-color: #f8f9fb;
116
+ text-shadow: none;
117
+ box-shadow: none;
118
+
119
+ &:hover{
120
+ color: var(--blue-6);
121
+ background-color: #f0f5ff;
122
+ border-color: #f0f5ff;
123
+ }
124
+ }
111
125
  }
112
126
 
113
127
  &.zoom-enter,
@@ -34,10 +34,7 @@ export default function getIcons({
34
34
  showSearch
35
35
  }) => {
36
36
  if (open && showSearch) {
37
- return getSuffixIconNode(React.createElement(Icon, {
38
- className: iconCls,
39
- type: "search"
40
- }));
37
+ return null;
41
38
  }
42
39
  return getSuffixIconNode(React.createElement(Icon, {
43
40
  className: iconCls,
@@ -1 +1 @@
1
- {"version":3,"file":"getIcons.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/AntdCascader/component/getIcons.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,eAAe,CAAA;AAIhC,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,GAYb;IACC,aAAa;IACb,MAAM,eAAe,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CAAA;IAEhF,2BAA2B;IAC3B,MAAM,iBAAiB,GAAG,CAAC,SAAqB,EAAE,EAAE,CAAC,CACnD;QACG,SAAS,KAAK,KAAK,IAAI,SAAS;QAChC,WAAW,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,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,gBAAgB;KAC7B,CAAA;AACH,CAAC","sourcesContent":["import type { ReactNode } from 'react'\nimport * as React from 'react'\nimport Icon from '../../../icon'\n\ntype RenderNode = React.ReactNode | ((props: any) => React.ReactNode)\n\nexport default function getIcons({\n suffixIcon,\n clearIcon,\n menuItemSelectedIcon,\n removeIcon,\n loading,\n multiple,\n hasFeedback,\n prefixCls,\n showArrow,\n feedbackIcon,\n}: {\n suffixIcon?: React.ReactNode\n clearIcon?: RenderNode\n menuItemSelectedIcon?: RenderNode\n removeIcon?: RenderNode\n loading?: boolean\n multiple?: boolean\n hasFeedback?: boolean\n feedbackIcon?: ReactNode\n prefixCls: string\n showArrow?: boolean\n}) {\n // Clear Icon\n const mergedClearIcon = clearIcon ?? <Icon type=\"close-circle\" theme=\"filled\" />\n\n // Validation Feedback Icon\n const getSuffixIconNode = (arrowIcon?: ReactNode) => (\n <>\n {showArrow !== false && arrowIcon}\n {hasFeedback && feedbackIcon}\n </>\n )\n\n // Arrow item icon\n let mergedSuffixIcon = null\n if (suffixIcon !== undefined) {\n mergedSuffixIcon = getSuffixIconNode(suffixIcon)\n } else if (loading) {\n mergedSuffixIcon = getSuffixIconNode(<Icon type=\"loading\" />)\n } else {\n const iconCls = `${prefixCls}-suffix`\n mergedSuffixIcon = ({ open, showSearch }: { open: boolean; showSearch: boolean }) => {\n if (open && showSearch) {\n return getSuffixIconNode(<Icon className={iconCls} type=\"search\" />)\n }\n return getSuffixIconNode(<Icon className={iconCls} type=\"down\" />)\n }\n }\n\n // Checked item icon\n let mergedItemIcon = null\n if (menuItemSelectedIcon !== undefined) {\n mergedItemIcon = menuItemSelectedIcon\n } else if (multiple) {\n mergedItemIcon = <Icon type=\"check\" />\n } else {\n mergedItemIcon = null\n }\n\n let mergedRemoveIcon = null\n if (removeIcon !== undefined) {\n mergedRemoveIcon = removeIcon\n } else {\n mergedRemoveIcon = <Icon type=\"close\" />\n }\n\n return {\n clearIcon: mergedClearIcon,\n suffixIcon: mergedSuffixIcon,\n itemIcon: mergedItemIcon,\n removeIcon: mergedRemoveIcon,\n }\n}\n"]}
1
+ {"version":3,"file":"getIcons.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/AntdCascader/component/getIcons.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,eAAe,CAAA;AAIhC,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,GAYb;IACC,aAAa;IACb,MAAM,eAAe,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CAAA;IAEhF,2BAA2B;IAC3B,MAAM,iBAAiB,GAAG,CAAC,SAAqB,EAAE,EAAE,CAAC,CACnD;QACG,SAAS,KAAK,KAAK,IAAI,SAAS;QAChC,WAAW,IAAI,YAAY,CAC3B,CACJ,CAAA;IAED,kBAAkB;IAClB,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAA;KACjD;SAAM,IAAI,OAAO,EAAE;QAClB,gBAAgB,GAAG,iBAAiB,CAAC,oBAAC,IAAI,IAAC,IAAI,EAAC,SAAS,GAAG,CAAC,CAAA;KAC9D;SAAM;QACL,MAAM,OAAO,GAAG,GAAG,SAAS,SAAS,CAAA;QACrC,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAA0C,EAAE,EAAE;YAClF,IAAI,IAAI,IAAI,UAAU,EAAE;gBACtB,OAAO,IAAI,CAAA;aACZ;YACD,OAAO,iBAAiB,CAAC,oBAAC,IAAI,IAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,GAAG,CAAC,CAAA;QACpE,CAAC,CAAA;KACF;IAED,oBAAoB;IACpB,IAAI,cAAc,GAAG,IAAI,CAAA;IACzB,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACtC,cAAc,GAAG,oBAAoB,CAAA;KACtC;SAAM,IAAI,QAAQ,EAAE;QACnB,cAAc,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACvC;SAAM;QACL,cAAc,GAAG,IAAI,CAAA;KACtB;IAED,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,UAAU,CAAA;KAC9B;SAAM;QACL,gBAAgB,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACzC;IAED,OAAO;QACL,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,gBAAgB;KAC7B,CAAA;AACH,CAAC","sourcesContent":["import type { ReactNode } from 'react'\nimport * as React from 'react'\nimport Icon from '../../../icon'\n\ntype RenderNode = React.ReactNode | ((props: any) => React.ReactNode)\n\nexport default function getIcons({\n suffixIcon,\n clearIcon,\n menuItemSelectedIcon,\n removeIcon,\n loading,\n multiple,\n hasFeedback,\n prefixCls,\n showArrow,\n feedbackIcon,\n}: {\n suffixIcon?: React.ReactNode\n clearIcon?: RenderNode\n menuItemSelectedIcon?: RenderNode\n removeIcon?: RenderNode\n loading?: boolean\n multiple?: boolean\n hasFeedback?: boolean\n feedbackIcon?: ReactNode\n prefixCls: string\n showArrow?: boolean\n}) {\n // Clear Icon\n const mergedClearIcon = clearIcon ?? <Icon type=\"close-circle\" theme=\"filled\" />\n\n // Validation Feedback Icon\n const getSuffixIconNode = (arrowIcon?: ReactNode) => (\n <>\n {showArrow !== false && arrowIcon}\n {hasFeedback && feedbackIcon}\n </>\n )\n\n // Arrow item icon\n let mergedSuffixIcon = null\n if (suffixIcon !== undefined) {\n mergedSuffixIcon = getSuffixIconNode(suffixIcon)\n } else if (loading) {\n mergedSuffixIcon = getSuffixIconNode(<Icon type=\"loading\" />)\n } else {\n const iconCls = `${prefixCls}-suffix`\n mergedSuffixIcon = ({ open, showSearch }: { open: boolean; showSearch: boolean }) => {\n if (open && showSearch) {\n return null\n }\n return getSuffixIconNode(<Icon className={iconCls} type=\"down\" />)\n }\n }\n\n // Checked item icon\n let mergedItemIcon = null\n if (menuItemSelectedIcon !== undefined) {\n mergedItemIcon = menuItemSelectedIcon\n } else if (multiple) {\n mergedItemIcon = <Icon type=\"check\" />\n } else {\n mergedItemIcon = null\n }\n\n let mergedRemoveIcon = null\n if (removeIcon !== undefined) {\n mergedRemoveIcon = removeIcon\n } else {\n mergedRemoveIcon = <Icon type=\"close\" />\n }\n\n return {\n clearIcon: mergedClearIcon,\n suffixIcon: mergedSuffixIcon,\n itemIcon: mergedItemIcon,\n removeIcon: mergedRemoveIcon,\n }\n}\n"]}
@@ -1239,7 +1239,7 @@
1239
1239
 
1240
1240
  .tntd-cascader-menu {
1241
1241
  -ms-overflow-style: -ms-autohiding-scrollbar;
1242
- border-right: 2px solid @grey-split;
1242
+ border-right: 1px solid @grey-split;
1243
1243
  flex-grow: 1;
1244
1244
  height: 180px;
1245
1245
  list-style: none;
@@ -1877,7 +1877,7 @@
1877
1877
 
1878
1878
  .tntd-select:not(.tntd-select-customize-input) .tntd-select-selector {
1879
1879
  background-color: @white;
1880
- border: 1px solid @grey-d;
1880
+ border: @border-width-base @border-style-base @select-border-color;
1881
1881
  border-radius: @border-radius-base;
1882
1882
  position: relative;
1883
1883
  transition: all .3s cubic-bezier(.645, .045, .355, 1)
@@ -1969,7 +1969,7 @@
1969
1969
  }
1970
1970
 
1971
1971
  .tntd-select-selection-placeholder {
1972
- color: #bfbfbf;
1972
+ color: @input-placeholder-color;;
1973
1973
  flex: 1 1;
1974
1974
  overflow: hidden;
1975
1975
  pointer-events: none;
@@ -1990,7 +1990,7 @@
1990
1990
  -moz-osx-font-smoothing: grayscale;
1991
1991
  align-items: center;
1992
1992
  color: inherit;
1993
- color: rgba(0, 0, 0, .25);
1993
+ color: @input-placeholder-color;
1994
1994
  display: inline-block;
1995
1995
  display: flex;
1996
1996
  font-size: 12px;
@@ -2056,10 +2056,10 @@
2056
2056
  font-style: normal;
2057
2057
  height: 12px;
2058
2058
  line-height: 1;
2059
- margin-top: -6px;
2059
+ margin-top: -7px;
2060
2060
  opacity: 0;
2061
2061
  position: absolute;
2062
- right: 11px;
2062
+ right: 13px;
2063
2063
  text-align: center;
2064
2064
  text-rendering: auto;
2065
2065
  text-transform: none;
@@ -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,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CAAC,EAAE,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,CAmHxC,CAAA"}
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _utils = require("../utils");
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _button = require("../button");
14
- var _icon = _interopRequireDefault(require("../icon"));
14
+ require("../icon");
15
15
  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); }
16
16
  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; }
17
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -124,18 +124,12 @@ var Drawer = exports.Drawer = function Drawer(_a) {
124
124
  drawerDom.current = event.target;
125
125
  }
126
126
  }, _react["default"].createElement(_drawer["default"], Object.assign({
127
- className: (0, _classnames["default"])(prefixCls, 'tnt-drawer', className, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-contain-closable"), closable !== false), "".concat(prefixCls, "-footer"), showFooter || footer)),
128
- closable: false,
127
+ className: (0, _classnames["default"])(prefixCls, 'tnt-drawer', className, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-contain-closable"), closable !== false), "".concat(prefixCls, "-no-header"), closable === false && !title), "".concat(prefixCls, "-footer"), showFooter || footer)),
128
+ closable: closable,
129
129
  onClose: _onCancel,
130
130
  width: 480
131
131
  }, rest, {
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
- }))
132
+ title: !unUpperConverted ? (0, _utils.doUpperTitle)(title, upperCaseIgnore) : title
139
133
  }), _react["default"].createElement(_react["default"].Fragment, null, rest.children, (showFooter || footer) && _react["default"].createElement("div", {
140
134
  className: "".concat(prefixCls, "-footer-style")
141
135
  }, footer || _react["default"].createElement(DefaultFooter, {
@@ -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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S,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
+ {"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,mBAA0B;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,EAAE,EACf,MAAM,EACN,MAAM,GAAG,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AAS,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;AAnHY,QAAA,MAAM,UAmHlB","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}-no-header`]: closable === false && !title,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={closable}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\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"]}
@@ -22,6 +22,20 @@
22
22
  max-height: ~'calc(100vh - 48px)';
23
23
  }
24
24
 
25
+ &.@{drawer-prefix-cls}-no-header {
26
+ .@{drawer-prefix-cls}-wrapper-body{
27
+ margin-top: 0;
28
+ max-height: ~'calc(100vh)';
29
+ }
30
+ &.@{drawer-prefix-cls}-footer{
31
+ .@{drawer-prefix-cls}-wrapper-body{
32
+ margin-top:0 !important;
33
+ max-height: ~'calc(100vh - 48px)' !important;
34
+ margin-bottom: 48px !important;
35
+ }
36
+ }
37
+ }
38
+
25
39
  &-footer {
26
40
  .@{drawer-prefix-cls}-header {
27
41
  // border-bottom: none;
@@ -37,7 +51,6 @@
37
51
  margin-top: 48px !important;
38
52
  margin-bottom: 48px !important;
39
53
  }
40
-
41
54
  }
42
55
 
43
56
  .@{drawer-prefix-cls}-title {
@@ -58,7 +71,7 @@
58
71
  font-weight: 700;
59
72
  font-size: 20px;
60
73
  font-style: normal;
61
- line-height: 56px;
74
+ line-height: 48px;
62
75
  text-align: center;
63
76
  text-transform: none;
64
77
  text-decoration: none;
@@ -68,6 +81,9 @@
68
81
  cursor: pointer;
69
82
  transition: color 0.3s;
70
83
  text-rendering: auto;
84
+ i.tntd-anticon{
85
+ font-size:20px;
86
+ }
71
87
  }
72
88
 
73
89
 
@@ -147,6 +163,21 @@
147
163
  .@{ant-prefix}-btn {
148
164
  margin-left: 16px;
149
165
  }
166
+
167
+ // 如果button没有type类型默认设置为 type: tertiary的样式(兼容老业务用了footer的场景)
168
+ button:not([class*="ant-btn-"]):not([class*="tnt-btn-"]) {
169
+ color: #17233d;
170
+ background-color: #f8f9fb;
171
+ border-color: #f8f9fb;
172
+ text-shadow: none;
173
+ box-shadow: none;
174
+
175
+ &:hover{
176
+ color: var(--blue-6);
177
+ background-color: #f0f5ff;
178
+ border-color: #f0f5ff;
179
+ }
180
+ }
150
181
  }
151
182
 
152
183
  }
@@ -14,6 +14,9 @@
14
14
  &-title{
15
15
  line-height: @line-height-lg;
16
16
  }
17
+ div[aria-hidden=true]{
18
+ display: none;;
19
+ }
17
20
  }
18
21
 
19
22
  .@{confirm-prefix-cls}{
@@ -108,6 +108,20 @@
108
108
  margin-bottom: 0;
109
109
  margin-left: @margin-base;
110
110
  }
111
+ // 如果button没有type类型默认设置为type: tertiary的样式(兼容老业务用了footer的场景)
112
+ button:not([class*="ant-btn-"]):not([class*="tnt-btn-"]) {
113
+ color: #17233d;
114
+ background-color: #f8f9fb;
115
+ border-color: #f8f9fb;
116
+ text-shadow: none;
117
+ box-shadow: none;
118
+
119
+ &:hover{
120
+ color: var(--blue-6);
121
+ background-color: #f0f5ff;
122
+ border-color: #f0f5ff;
123
+ }
124
+ }
111
125
  }
112
126
 
113
127
  &.zoom-enter,
@@ -17,7 +17,7 @@ export default function getIcons({ suffixIcon, clearIcon, menuItemSelectedIcon,
17
17
  suffixIcon: React.JSX.Element | (({ open, showSearch }: {
18
18
  open: boolean;
19
19
  showSearch: boolean;
20
- }) => React.JSX.Element);
20
+ }) => React.JSX.Element | null);
21
21
  itemIcon: {} | null;
22
22
  removeIcon: {} | null;
23
23
  };
@@ -44,10 +44,7 @@ function getIcons(_ref) {
44
44
  var open = _ref2.open,
45
45
  showSearch = _ref2.showSearch;
46
46
  if (open && showSearch) {
47
- return getSuffixIconNode(React.createElement(_icon["default"], {
48
- className: iconCls,
49
- type: "search"
50
- }));
47
+ return null;
51
48
  }
52
49
  return getSuffixIconNode(React.createElement(_icon["default"], {
53
50
  className: iconCls,
@@ -1 +1 @@
1
- {"version":3,"file":"getIcons.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/AntdCascader/component/getIcons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA8B;AAC9B,yDAAgC;AAIhC,SAAwB,QAAQ,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,GAYb;IACC,aAAa;IACb,MAAM,eAAe,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,oBAAC,cAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CAAA;IAEhF,2BAA2B;IAC3B,MAAM,iBAAiB,GAAG,CAAC,SAAqB,EAAE,EAAE,CAAC,CACnD;QACG,SAAS,KAAK,KAAK,IAAI,SAAS;QAChC,WAAW,IAAI,YAAY,CAC3B,CACJ,CAAA;IAED,kBAAkB;IAClB,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAA;KACjD;SAAM,IAAI,OAAO,EAAE;QAClB,gBAAgB,GAAG,iBAAiB,CAAC,oBAAC,cAAI,IAAC,IAAI,EAAC,SAAS,GAAG,CAAC,CAAA;KAC9D;SAAM;QACL,MAAM,OAAO,GAAG,GAAG,SAAS,SAAS,CAAA;QACrC,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAA0C,EAAE,EAAE;YAClF,IAAI,IAAI,IAAI,UAAU,EAAE;gBACtB,OAAO,iBAAiB,CAAC,oBAAC,cAAI,IAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,GAAG,CAAC,CAAA;aACrE;YACD,OAAO,iBAAiB,CAAC,oBAAC,cAAI,IAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,GAAG,CAAC,CAAA;QACpE,CAAC,CAAA;KACF;IAED,oBAAoB;IACpB,IAAI,cAAc,GAAG,IAAI,CAAA;IACzB,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACtC,cAAc,GAAG,oBAAoB,CAAA;KACtC;SAAM,IAAI,QAAQ,EAAE;QACnB,cAAc,GAAG,oBAAC,cAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACvC;SAAM;QACL,cAAc,GAAG,IAAI,CAAA;KACtB;IAED,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,UAAU,CAAA;KAC9B;SAAM;QACL,gBAAgB,GAAG,oBAAC,cAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACzC;IAED,OAAO;QACL,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,gBAAgB;KAC7B,CAAA;AACH,CAAC;AAzED,2BAyEC","sourcesContent":["import type { ReactNode } from 'react'\nimport * as React from 'react'\nimport Icon from '../../../icon'\n\ntype RenderNode = React.ReactNode | ((props: any) => React.ReactNode)\n\nexport default function getIcons({\n suffixIcon,\n clearIcon,\n menuItemSelectedIcon,\n removeIcon,\n loading,\n multiple,\n hasFeedback,\n prefixCls,\n showArrow,\n feedbackIcon,\n}: {\n suffixIcon?: React.ReactNode\n clearIcon?: RenderNode\n menuItemSelectedIcon?: RenderNode\n removeIcon?: RenderNode\n loading?: boolean\n multiple?: boolean\n hasFeedback?: boolean\n feedbackIcon?: ReactNode\n prefixCls: string\n showArrow?: boolean\n}) {\n // Clear Icon\n const mergedClearIcon = clearIcon ?? <Icon type=\"close-circle\" theme=\"filled\" />\n\n // Validation Feedback Icon\n const getSuffixIconNode = (arrowIcon?: ReactNode) => (\n <>\n {showArrow !== false && arrowIcon}\n {hasFeedback && feedbackIcon}\n </>\n )\n\n // Arrow item icon\n let mergedSuffixIcon = null\n if (suffixIcon !== undefined) {\n mergedSuffixIcon = getSuffixIconNode(suffixIcon)\n } else if (loading) {\n mergedSuffixIcon = getSuffixIconNode(<Icon type=\"loading\" />)\n } else {\n const iconCls = `${prefixCls}-suffix`\n mergedSuffixIcon = ({ open, showSearch }: { open: boolean; showSearch: boolean }) => {\n if (open && showSearch) {\n return getSuffixIconNode(<Icon className={iconCls} type=\"search\" />)\n }\n return getSuffixIconNode(<Icon className={iconCls} type=\"down\" />)\n }\n }\n\n // Checked item icon\n let mergedItemIcon = null\n if (menuItemSelectedIcon !== undefined) {\n mergedItemIcon = menuItemSelectedIcon\n } else if (multiple) {\n mergedItemIcon = <Icon type=\"check\" />\n } else {\n mergedItemIcon = null\n }\n\n let mergedRemoveIcon = null\n if (removeIcon !== undefined) {\n mergedRemoveIcon = removeIcon\n } else {\n mergedRemoveIcon = <Icon type=\"close\" />\n }\n\n return {\n clearIcon: mergedClearIcon,\n suffixIcon: mergedSuffixIcon,\n itemIcon: mergedItemIcon,\n removeIcon: mergedRemoveIcon,\n }\n}\n"]}
1
+ {"version":3,"file":"getIcons.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/AntdCascader/component/getIcons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA8B;AAC9B,yDAAgC;AAIhC,SAAwB,QAAQ,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,oBAAoB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AAA;KACtB;IAED,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,UAAU,CAAA;KAC9B;SAAM;QACL,gBAAgB,GAAG,oBAAC,cAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACzC;IAED,OAAO;QACL,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,gBAAgB;KAC7B,CAAA;AACH,CAAC;AAzED,2BAyEC","sourcesContent":["import type { ReactNode } from 'react'\nimport * as React from 'react'\nimport Icon from '../../../icon'\n\ntype RenderNode = React.ReactNode | ((props: any) => React.ReactNode)\n\nexport default function getIcons({\n suffixIcon,\n clearIcon,\n menuItemSelectedIcon,\n removeIcon,\n loading,\n multiple,\n hasFeedback,\n prefixCls,\n showArrow,\n feedbackIcon,\n}: {\n suffixIcon?: React.ReactNode\n clearIcon?: RenderNode\n menuItemSelectedIcon?: RenderNode\n removeIcon?: RenderNode\n loading?: boolean\n multiple?: boolean\n hasFeedback?: boolean\n feedbackIcon?: ReactNode\n prefixCls: string\n showArrow?: boolean\n}) {\n // Clear Icon\n const mergedClearIcon = clearIcon ?? <Icon type=\"close-circle\" theme=\"filled\" />\n\n // Validation Feedback Icon\n const getSuffixIconNode = (arrowIcon?: ReactNode) => (\n <>\n {showArrow !== false && arrowIcon}\n {hasFeedback && feedbackIcon}\n </>\n )\n\n // Arrow item icon\n let mergedSuffixIcon = null\n if (suffixIcon !== undefined) {\n mergedSuffixIcon = getSuffixIconNode(suffixIcon)\n } else if (loading) {\n mergedSuffixIcon = getSuffixIconNode(<Icon type=\"loading\" />)\n } else {\n const iconCls = `${prefixCls}-suffix`\n mergedSuffixIcon = ({ open, showSearch }: { open: boolean; showSearch: boolean }) => {\n if (open && showSearch) {\n return null\n }\n return getSuffixIconNode(<Icon className={iconCls} type=\"down\" />)\n }\n }\n\n // Checked item icon\n let mergedItemIcon = null\n if (menuItemSelectedIcon !== undefined) {\n mergedItemIcon = menuItemSelectedIcon\n } else if (multiple) {\n mergedItemIcon = <Icon type=\"check\" />\n } else {\n mergedItemIcon = null\n }\n\n let mergedRemoveIcon = null\n if (removeIcon !== undefined) {\n mergedRemoveIcon = removeIcon\n } else {\n mergedRemoveIcon = <Icon type=\"close\" />\n }\n\n return {\n clearIcon: mergedClearIcon,\n suffixIcon: mergedSuffixIcon,\n itemIcon: mergedItemIcon,\n removeIcon: mergedRemoveIcon,\n }\n}\n"]}
@@ -1239,7 +1239,7 @@
1239
1239
 
1240
1240
  .tntd-cascader-menu {
1241
1241
  -ms-overflow-style: -ms-autohiding-scrollbar;
1242
- border-right: 2px solid @grey-split;
1242
+ border-right: 1px solid @grey-split;
1243
1243
  flex-grow: 1;
1244
1244
  height: 180px;
1245
1245
  list-style: none;
@@ -1877,7 +1877,7 @@
1877
1877
 
1878
1878
  .tntd-select:not(.tntd-select-customize-input) .tntd-select-selector {
1879
1879
  background-color: @white;
1880
- border: 1px solid @grey-d;
1880
+ border: @border-width-base @border-style-base @select-border-color;
1881
1881
  border-radius: @border-radius-base;
1882
1882
  position: relative;
1883
1883
  transition: all .3s cubic-bezier(.645, .045, .355, 1)
@@ -1969,7 +1969,7 @@
1969
1969
  }
1970
1970
 
1971
1971
  .tntd-select-selection-placeholder {
1972
- color: #bfbfbf;
1972
+ color: @input-placeholder-color;;
1973
1973
  flex: 1 1;
1974
1974
  overflow: hidden;
1975
1975
  pointer-events: none;
@@ -1990,7 +1990,7 @@
1990
1990
  -moz-osx-font-smoothing: grayscale;
1991
1991
  align-items: center;
1992
1992
  color: inherit;
1993
- color: rgba(0, 0, 0, .25);
1993
+ color: @input-placeholder-color;
1994
1994
  display: inline-block;
1995
1995
  display: flex;
1996
1996
  font-size: 12px;
@@ -2056,10 +2056,10 @@
2056
2056
  font-style: normal;
2057
2057
  height: 12px;
2058
2058
  line-height: 1;
2059
- margin-top: -6px;
2059
+ margin-top: -7px;
2060
2060
  opacity: 0;
2061
2061
  position: absolute;
2062
- right: 11px;
2062
+ right: 13px;
2063
2063
  text-align: center;
2064
2064
  text-rendering: auto;
2065
2065
  text-transform: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tntd",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "start": "heft start --storybook",