tntd 3.0.70 → 3.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/array-input/index.js +3 -0
- package/es/array-input/index.js.map +1 -1
- package/es/button/button.js +2 -2
- package/es/button/button.js.map +1 -1
- package/es/button/button.less +175 -0
- package/es/button/style/index.less +7 -0
- package/es/button/style/mixin.less +118 -65
- package/es/prev-locale.js +4 -0
- package/es/prev-locale.js.map +1 -1
- package/es/style/themes/default.less +2 -4
- package/es/table/style/size.less +4 -2
- package/es/tntd-action/Action.js +87 -10
- package/es/tntd-action/index.js +61 -7
- package/es/tntd-action/index.js.map +1 -1
- package/es/tntd-action/index.less +35 -0
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +3 -0
- package/lib/array-input/index.js.map +1 -1
- package/lib/button/button.d.ts +2 -2
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +2 -2
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +175 -0
- package/lib/button/style/index.less +7 -0
- package/lib/button/style/mixin.less +118 -65
- package/lib/prev-locale.d.ts +3 -0
- package/lib/prev-locale.d.ts.map +1 -1
- package/lib/prev-locale.js +4 -0
- package/lib/prev-locale.js.map +1 -1
- package/lib/style/themes/default.less +2 -4
- package/lib/table/style/size.less +4 -2
- package/lib/tntd-action/index.d.ts +1 -2
- package/lib/tntd-action/index.d.ts.map +1 -1
- package/lib/tntd-action/index.js +61 -7
- package/lib/tntd-action/index.js.map +1 -1
- package/lib/tntd-action/index.less +35 -0
- package/package.json +2 -2
- package/themes/default/variables.less +8 -0
- package/themes/default/variablesVar.less +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceR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AE,SAAS,EAAE,CAAC,CAAC,CAAA;iBAClE;qBAAM;oBACL,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;oBACvC,IAAI,SAAS,EAAE;wBACb,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;qBACzB;iBACF;aACF;QACH,CAAC,CAAC,CAAA;QACF,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC9B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,EAAE;QAC1B,OAAO,CACL,8BAAC,cAAI,QACF,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;YAClB,OAAO,CACL,8BAAC,cAAI,CAAC,IAAI,IAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,CAAC,IAC7C,EAAE,CACO,CACb,CAAA;QACH,CAAC,CAAC,CACG,CACR,CAAA;IACH,CAAC,CAAA;IAED,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;QACxB,cAAc;QACd,OAAO,QAAQ,CAAA;KAChB;IAED,MAAM,cAAc,GAAG,IAAA,qBAAO,EAAC,gBAAgB,EAAE,IAAA,yBAAW,GAAE,CAAC,CAAA;IAE/D,OAAO,CACL;QACG,SAAS;QAGV,8BAAC,kBAAQ,IAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,gBAAgB,EAAC,qBAAqB;YAC7E,8BAAC,gBAAM,IAAC,SAAS,EAAC,yBAAyB;gBACxC,cAAc;;gBAAE,8BAAC,cAAI,IAAC,IAAI,EAAC,MAAM,GAAG,CAC9B,CACA,CACV,CACJ,CAAA;AACH,CAAC;AArDD,4BAqDC","sourcesContent":["import React, { useMemo } from 'react'\n// import Action from './Action'\nimport Tooltip from '../tooltip'\nimport Popconfirm from '../popconfirm'\nimport Dropdown from '../dropdown'\nimport Button from '../button'\nimport Icon from '../icon'\nimport Menu from '../menu'\nimport { getLanguage, getText } from '../prev-locale'\nimport './index.less'\n\nconst checkShowChild = (child) => {\n const { disabled, children, check, text } = child.props || {}\n // if (check && !disabled) {\n if (check) {\n return React.cloneElement(\n child,\n text\n ? {\n // children: (\n // <>\n // {children}\n // <span>{text}</span>\n // </>\n // ),\n children: text,\n type: 'link',\n }\n : { type: 'link' }\n )\n } else if (children) {\n const newChild = React.Children.map(children, (child) => {\n return checkShowChild(child)\n }).filter((i) => !!i)\n if (newChild.length > 0) {\n const newProps = { children: newChild }\n if (child.type === Tooltip) {\n newProps.visible = false\n } else if (child.type === Popconfirm) {\n newProps.hiddenArrow = true\n }\n return React.cloneElement(child, newProps)\n }\n }\n return false\n}\n\nconst checkIsDisabled = (child) => {\n const { disabled, children, check } = child.props || {}\n if (check) {\n return disabled\n } else if (children) {\n return (\n React.Children.map(children, (child) => {\n return checkIsDisabled(child)\n }).filter((i) => !!i).length > 0\n )\n }\n return false\n}\n\nexport default function ({ children, ...other }) {\n const [thisChild, popChild] = useMemo(() => {\n const thisChild = []\n const popChild = []\n React.Children.forEach(children, (child) => {\n if (child && child.props) {\n const { exclude } = child.props\n if (exclude) {\n thisChild.push(React.cloneElement(child, { exclude: undefined }))\n } else {\n const showChild = checkShowChild(child)\n if (showChild) {\n popChild.push(showChild)\n }\n }\n }\n })\n return [thisChild, popChild]\n }, [children])\n\n const createMenu = (list) => {\n return (\n <Menu>\n {list.map((it, i) => {\n return (\n <Menu.Item key={i} disabled={checkIsDisabled(it)}>\n {it}\n </Menu.Item>\n )\n })}\n </Menu>\n )\n }\n\n if (popChild.length <= 1) {\n // 如果只有一个,直接返回\n return children\n }\n\n const batchOperation = getText('batchOperation', getLanguage())\n\n return (\n <>\n {thisChild}\n\n {/* <Action data={popChild} {...other} /> */}\n <Dropdown overlay={createMenu(popChild)} overlayClassName=\"tnt-action-dropdown\">\n <Button className=\"tnt-action-dropdown-btn\">\n {batchOperation} <Icon type=\"down\" />\n </Button>\n </Dropdown>\n </>\n )\n}\n"]}
|
|
@@ -58,4 +58,39 @@
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
&-dropdown {
|
|
62
|
+
&-btn {
|
|
63
|
+
margin-left: 8px !important;
|
|
64
|
+
border-radius: @border-radius-base !important;
|
|
65
|
+
}
|
|
66
|
+
.ant-dropdown-menu-item {
|
|
67
|
+
.ant-btn {
|
|
68
|
+
display: inline;
|
|
69
|
+
padding: 0;
|
|
70
|
+
height: auto;
|
|
71
|
+
border: none;
|
|
72
|
+
background-color: transparent;
|
|
73
|
+
color: inherit;
|
|
74
|
+
&:hover,
|
|
75
|
+
&:active {
|
|
76
|
+
color: inherit;
|
|
77
|
+
}
|
|
78
|
+
&[disabled] {
|
|
79
|
+
color: @disabled-color;
|
|
80
|
+
&:hover,
|
|
81
|
+
&:active {
|
|
82
|
+
color: @disabled-color;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 全局设置
|
|
91
|
+
.ant-btn-group:has(.tnt-action-dropdown-btn) {
|
|
92
|
+
& > .ant-btn:nth-last-child(2) {
|
|
93
|
+
border-top-right-radius: @border-radius-base;
|
|
94
|
+
border-bottom-right-radius: @border-radius-base;
|
|
95
|
+
}
|
|
61
96
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tntd",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.71",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "heft start --storybook",
|
|
@@ -113,4 +113,4 @@
|
|
|
113
113
|
"main": "lib/index.js",
|
|
114
114
|
"module": "es/index.js",
|
|
115
115
|
"typings": "lib/index.d.ts"
|
|
116
|
-
}
|
|
116
|
+
}
|
|
@@ -160,6 +160,14 @@
|
|
|
160
160
|
|
|
161
161
|
@btn-tertiary-bg: #f8f9fb;
|
|
162
162
|
|
|
163
|
+
@btn-ai-bg: linear-gradient(128deg, #bf5fff 6.08%, #2e69ff 96.35%);
|
|
164
|
+
@btn-disable-bg-ai: linear-gradient(
|
|
165
|
+
0deg,
|
|
166
|
+
rgba(255, 255, 255, 0.7) 0%,
|
|
167
|
+
rgba(255, 255, 255, 0.7) 100%
|
|
168
|
+
),
|
|
169
|
+
linear-gradient(128deg, #bf5fff 6.08%, #2e69ff 96.35%);
|
|
170
|
+
|
|
163
171
|
@btn-danger-color: #fff;
|
|
164
172
|
@btn-danger-bg: @red-6;
|
|
165
173
|
@btn-danger-border: @red-6;
|
|
@@ -161,6 +161,14 @@
|
|
|
161
161
|
|
|
162
162
|
@btn-tertiary-bg: #f8f9fb;
|
|
163
163
|
|
|
164
|
+
@btn-ai-bg: linear-gradient(128deg, #bf5fff 6.08%, #2e69ff 96.35%);
|
|
165
|
+
@btn-disable-bg-ai: linear-gradient(
|
|
166
|
+
0deg,
|
|
167
|
+
rgba(255, 255, 255, 0.7) 0%,
|
|
168
|
+
rgba(255, 255, 255, 0.7) 100%
|
|
169
|
+
),
|
|
170
|
+
linear-gradient(128deg, #bf5fff 6.08%, #2e69ff 96.35%);
|
|
171
|
+
|
|
164
172
|
@btn-danger-color: #fff;
|
|
165
173
|
@btn-danger-bg: @red-6;
|
|
166
174
|
@btn-danger-border: @red-6;
|
|
@@ -686,6 +694,7 @@
|
|
|
686
694
|
|
|
687
695
|
// 新增less变量
|
|
688
696
|
@text-color-tertiary: var(--text-color-tertiary);
|
|
697
|
+
@text-color-tertiary: var(--text-color-tertiary);
|
|
689
698
|
@border-color: var(--border-color);
|
|
690
699
|
@border-color-secondary: var(--border-color-secondary);
|
|
691
700
|
@fill-color: var(--fill-color);
|