tntd 3.0.74 → 3.0.76

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.
@@ -256,7 +256,7 @@
256
256
 
257
257
  // link button style
258
258
  .btn-link() {
259
- .button-variant-other(@link-color, transparent, @btn-default-border);
259
+ .button-variant-other(@link-color, transparent, transparent);
260
260
  box-shadow: none;
261
261
 
262
262
  &:hover,
@@ -1,14 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) {
4
- "@babel/helpers - typeof";
5
-
6
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7
- return typeof o;
8
- } : function (o) {
9
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
- }, _typeof(o);
11
- }
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
4
  Object.defineProperty(exports, "__esModule", {
13
5
  value: true
14
6
  });
@@ -19,84 +11,15 @@ var _configProvider = require("antd/es/config-provider");
19
11
  var _LocaleReceiver = _interopRequireDefault(require("antd/es/locale-provider/LocaleReceiver"));
20
12
  var _classnames = _interopRequireDefault(require("classnames"));
21
13
  var _button = require("../button");
22
- function _interopRequireDefault(e) {
23
- return e && e.__esModule ? e : {
24
- "default": e
25
- };
26
- }
27
- function _getRequireWildcardCache(e) {
28
- if ("function" != typeof WeakMap) return null;
29
- var r = new WeakMap(),
30
- t = new WeakMap();
31
- return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
32
- return e ? t : r;
33
- })(e);
34
- }
35
- function _interopRequireWildcard(e, r) {
36
- if (!r && e && e.__esModule) return e;
37
- if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
38
- "default": e
39
- };
40
- var t = _getRequireWildcardCache(r);
41
- if (t && t.has(e)) return t.get(e);
42
- var n = {
43
- __proto__: null
44
- },
45
- a = Object.defineProperty && Object.getOwnPropertyDescriptor;
46
- for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
47
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
48
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
49
- }
50
- return n["default"] = e, t && t.set(e, n), n;
51
- }
52
- function _slicedToArray(r, e) {
53
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
54
- }
55
- function _nonIterableRest() {
56
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
57
- }
58
- function _unsupportedIterableToArray(r, a) {
59
- if (r) {
60
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
61
- var t = {}.toString.call(r).slice(8, -1);
62
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
63
- }
64
- }
65
- function _arrayLikeToArray(r, a) {
66
- (null == a || a > r.length) && (a = r.length);
67
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
68
- return n;
69
- }
70
- function _iterableToArrayLimit(r, l) {
71
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
72
- if (null != t) {
73
- var e,
74
- n,
75
- i,
76
- u,
77
- a = [],
78
- f = !0,
79
- o = !1;
80
- try {
81
- if (i = (t = t.call(r)).next, 0 === l) {
82
- if (Object(t) !== t) return;
83
- f = !1;
84
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
85
- } catch (r) {
86
- o = !0, n = r;
87
- } finally {
88
- try {
89
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
90
- } finally {
91
- if (o) throw n;
92
- }
93
- }
94
- return a;
95
- }
96
- }
97
- function _arrayWithHoles(r) {
98
- if (Array.isArray(r)) return r;
99
- }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
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
+ 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
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
18
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
20
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
21
+ 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; } }
22
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
100
23
  var __rest = void 0 && (void 0).__rest || function (s, e) {
101
24
  var t = {};
102
25
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -6,13 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = _default;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _Action = _interopRequireDefault(require("./Action"));
9
10
  var _tooltip = _interopRequireDefault(require("../tooltip"));
10
- var _popconfirm = _interopRequireDefault(require("../popconfirm"));
11
- var _dropdown = _interopRequireDefault(require("../dropdown"));
12
- var _button = _interopRequireDefault(require("../button"));
13
- var _icon = _interopRequireDefault(require("../icon"));
14
- var _menu = _interopRequireDefault(require("../menu"));
15
- var _prevLocale = require("../prev-locale");
16
11
  require("./index.less");
17
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
18
13
  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); }
@@ -31,29 +26,16 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
31
26
  }
32
27
  return t;
33
28
  };
34
-
35
- // import Action from './Action'
36
-
37
29
  var _checkShowChild = function checkShowChild(child) {
38
30
  var _ref = child.props || {},
39
31
  disabled = _ref.disabled,
40
32
  children = _ref.children,
41
33
  check = _ref.check,
42
34
  text = _ref.text;
43
- // if (check && !disabled) {
44
- if (check) {
35
+ if (check && !disabled) {
45
36
  return _react["default"].cloneElement(child, text ? {
46
- // children: (
47
- // <>
48
- // {children}
49
- // <span>{text}</span>
50
- // </>
51
- // ),
52
- children: text,
53
- type: 'link'
54
- } : {
55
- type: 'link'
56
- });
37
+ children: _react["default"].createElement(_react["default"].Fragment, null, children, text)
38
+ } : {});
57
39
  } else if (children) {
58
40
  var newChild = _react["default"].Children.map(children, function (child) {
59
41
  return _checkShowChild(child);
@@ -66,30 +48,12 @@ var _checkShowChild = function checkShowChild(child) {
66
48
  };
67
49
  if (child.type === _tooltip["default"]) {
68
50
  newProps.visible = false;
69
- } else if (child.type === _popconfirm["default"]) {
70
- newProps.hiddenArrow = true;
71
51
  }
72
52
  return _react["default"].cloneElement(child, newProps);
73
53
  }
74
54
  }
75
55
  return false;
76
56
  };
77
- var _checkIsDisabled = function checkIsDisabled(child) {
78
- var _ref2 = child.props || {},
79
- disabled = _ref2.disabled,
80
- children = _ref2.children,
81
- check = _ref2.check;
82
- if (check) {
83
- return disabled;
84
- } else if (children) {
85
- return _react["default"].Children.map(children, function (child) {
86
- return _checkIsDisabled(child);
87
- }).filter(function (i) {
88
- return !!i;
89
- }).length > 0;
90
- }
91
- return false;
92
- };
93
57
  function _default(_a) {
94
58
  var children = _a.children,
95
59
  other = __rest(_a, ["children"]);
@@ -116,25 +80,7 @@ function _default(_a) {
116
80
  _useMemo2 = _slicedToArray(_useMemo, 2),
117
81
  thisChild = _useMemo2[0],
118
82
  popChild = _useMemo2[1];
119
- var createMenu = function createMenu(list) {
120
- return _react["default"].createElement(_menu["default"], null, list.map(function (it, i) {
121
- return _react["default"].createElement(_menu["default"].Item, {
122
- key: i,
123
- disabled: _checkIsDisabled(it)
124
- }, it);
125
- }));
126
- };
127
- if (popChild.length <= 1) {
128
- // 如果只有一个,直接返回
129
- return children;
130
- }
131
- var batchOperation = (0, _prevLocale.getText)('batchOperation', (0, _prevLocale.getLanguage)());
132
- return _react["default"].createElement(_react["default"].Fragment, null, thisChild, _react["default"].createElement(_dropdown["default"], {
133
- overlay: createMenu(popChild),
134
- overlayClassName: "tnt-action-dropdown"
135
- }, _react["default"].createElement(_button["default"], {
136
- className: "tnt-action-dropdown-btn"
137
- }, batchOperation, " ", _react["default"].createElement(_icon["default"], {
138
- type: "down"
139
- }))));
83
+ return _react["default"].createElement(_react["default"].Fragment, null, thisChild, _react["default"].createElement(_Action["default"], Object.assign({
84
+ data: popChild
85
+ }, other)));
140
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,gCAAgC;AAChC,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,UAAU,MAAM,eAAe,CAAA;AACtC,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,cAAc,CAAA;AAErB,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,EAAE;IAC/B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAA;IAC7D,4BAA4B;IAC5B,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC,YAAY,CACvB,KAAK,EACL,IAAI;YACF,CAAC,CAAC;gBACE,cAAc;gBACd,OAAO;gBACP,iBAAiB;gBACjB,0BAA0B;gBAC1B,QAAQ;gBACR,KAAK;gBACL,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,MAAM;aACb;YACH,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CACrB,CAAA;KACF;SAAM,IAAI,QAAQ,EAAE;QACnB,MAA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KAChB;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAA;IAE/D,OAAO,CACL;QACG,SAAS;QAGV,oBAAC,QAAQ,IAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,gBAAgB,EAAC,qBAAqB;YAC7E,oBAAC,MAAM,IAAC,SAAS,EAAC,yBAAyB;gBACxC,cAAc;;gBAAE,oBAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,CAC9B,CACA,CACV,CACJ,CAAA;AACH,CAAC","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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,cAAc,CAAA;AAErB,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,EAAE;IAC/B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAA;IAC7D,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE;QACtB,OAAO,KAAK,CAAC,YAAY,CACvB,KAAK,EACL,IAAI;YACF,CAAC,CAAC;gBACE,QAAQ,EAAE,CACR;oBACG,QAAQ;oBACR,IAAI,CACJ,CACJ;aACF;YACH,CAAC,CAAC,EAAE,CACP,CAAA;KACF;SAAM,IAAI,QAAQ,EAAE;QACnB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,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,CAAC,CAAA;QACF,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC9B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,OAAO,CACL;QACG,SAAS;QAEV,oBAAC,MAAM,kBAAC,IAAI,EAAE,QAAQ,IAAM,KAAK,EAAI,CACpC,CACJ,CAAA;AACH,CAAC","sourcesContent":["import React, { useMemo } from 'react'\nimport Action from './Action'\nimport Tooltip from '../tooltip'\nimport './index.less'\n\nconst checkShowChild = (child) => {\n const { disabled, children, check, text } = child.props || {}\n if (check && !disabled) {\n return React.cloneElement(\n child,\n text\n ? {\n children: (\n <>\n {children}\n {text}\n </>\n ),\n }\n : {}\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 }\n return React.cloneElement(child, newProps)\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 return (\n <>\n {thisChild}\n\n <Action data={popChild} {...other} />\n </>\n )\n}\n"]}
@@ -67,48 +67,4 @@
67
67
  }
68
68
  }
69
69
  }
70
-
71
- &-dropdown {
72
- &-btn {
73
- margin-left: 8px !important;
74
- border-radius: @border-radius-base !important;
75
- }
76
-
77
- .ant-dropdown-menu-item {
78
- .ant-btn {
79
- display: block;
80
- padding: 0;
81
- height: auto;
82
- border: none;
83
- background-color: transparent;
84
- color: inherit;
85
- width: calc(100% + 24px);
86
- text-align: left;
87
- padding: 5px 12px;
88
- margin: -5px -12px;
89
-
90
- &:hover,
91
- &:active {
92
- color: inherit;
93
- }
94
-
95
- &[disabled] {
96
- color: @disabled-color;
97
-
98
- &:hover,
99
- &:active {
100
- color: @disabled-color;
101
- }
102
- }
103
- }
104
- }
105
- }
106
- }
107
-
108
- // 全局设置
109
- .ant-btn-group:has(.tnt-action-dropdown-btn) {
110
- &>.ant-btn:nth-last-child(2) {
111
- border-top-right-radius: @border-radius-base;
112
- border-bottom-right-radius: @border-radius-base;
113
- }
114
70
  }
@@ -0,0 +1,114 @@
1
+ .tnt-action {
2
+ position: fixed;
3
+ // bottom: 100px;
4
+ // width: @tnt-action-width;
5
+ // left: calc(50vw - @tnt-action-width / 2);
6
+ padding: 10px 16px;
7
+ background-color: @text-color;
8
+ border-radius: @border-radius-base;
9
+ z-index: 200;
10
+ cursor: grab;
11
+ box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.25), 0px 1px 1px 0px #263354 inset;
12
+
13
+ &-text {
14
+ color: @white;
15
+ margin-left: 20px;
16
+ font-size: 14px;
17
+ user-select: none;
18
+
19
+ .num {
20
+ display: inline-block;
21
+ width: 16px;
22
+ height: 16px;
23
+ background: #454f64;
24
+ border-radius: 8px;
25
+ font-size: 10px;
26
+ margin-right: 4px;
27
+ vertical-align: text-bottom;
28
+ text-align: center;
29
+ }
30
+ }
31
+
32
+ >.tnt-btn-tertiary {
33
+ opacity: 0.5;
34
+ background: #454f64;
35
+ color: @white;
36
+ border-width: 0;
37
+ width: @tnt-action-close-width;
38
+ height: @tnt-action-close-width;
39
+ min-width: @tnt-action-close-width;
40
+ line-height: @tnt-action-close-width;
41
+ margin-top: 4px;
42
+ font-size: 14px;
43
+
44
+ &:hover {
45
+ opacity: 0.8;
46
+ }
47
+ }
48
+
49
+ .fr {
50
+ float: right;
51
+
52
+ .ant-btn {
53
+ margin-left: 10px;
54
+
55
+ .tntd-anticon {
56
+ margin-right: 4px;
57
+ }
58
+ }
59
+
60
+ .ant-btn:not(.ant-btn-danger) {
61
+ background: rgba(69, 79, 100, 0.5);
62
+ color: @white;
63
+ border-width: 0;
64
+
65
+ &:hover {
66
+ background: rgba(69, 79, 100, 0.8);
67
+ }
68
+ }
69
+ }
70
+
71
+ &-dropdown {
72
+ &-btn {
73
+ margin-left: 8px !important;
74
+ border-radius: @border-radius-base !important;
75
+ }
76
+
77
+ .ant-dropdown-menu-item {
78
+ .ant-btn {
79
+ display: block;
80
+ padding: 0;
81
+ height: auto;
82
+ border: none;
83
+ background-color: transparent;
84
+ color: inherit;
85
+ width: calc(100% + 24px);
86
+ text-align: left;
87
+ padding: 5px 12px;
88
+ margin: -5px -12px;
89
+
90
+ &:hover,
91
+ &:active {
92
+ color: inherit;
93
+ }
94
+
95
+ &[disabled] {
96
+ color: @disabled-color;
97
+
98
+ &:hover,
99
+ &:active {
100
+ color: @disabled-color;
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ // 全局设置
109
+ .ant-btn-group:has(.tnt-action-dropdown-btn) {
110
+ &>.ant-btn:nth-last-child(2) {
111
+ border-top-right-radius: @border-radius-base;
112
+ border-bottom-right-radius: @border-radius-base;
113
+ }
114
+ }
@@ -256,7 +256,7 @@
256
256
 
257
257
  // link button style
258
258
  .btn-link() {
259
- .button-variant-other(@link-color, transparent, @btn-default-border);
259
+ .button-variant-other(@link-color, transparent, transparent);
260
260
  box-shadow: none;
261
261
 
262
262
  &:hover,
@@ -1,5 +1,6 @@
1
1
  export default function _default({ children, ...other }: {
2
2
  [x: string]: any;
3
3
  children: any;
4
- }): any;
4
+ }): React.JSX.Element;
5
+ import React from "react";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":"AA6DA;;;QAqDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":"AAoCA;;;sBA2BC"}
@@ -14,13 +14,8 @@ Object.defineProperty(exports, "__esModule", {
14
14
  });
15
15
  exports["default"] = _default;
16
16
  var _react = _interopRequireWildcard(require("react"));
17
+ var _Action = _interopRequireDefault(require("./Action"));
17
18
  var _tooltip = _interopRequireDefault(require("../tooltip"));
18
- var _popconfirm = _interopRequireDefault(require("../popconfirm"));
19
- var _dropdown = _interopRequireDefault(require("../dropdown"));
20
- var _button = _interopRequireDefault(require("../button"));
21
- var _icon = _interopRequireDefault(require("../icon"));
22
- var _menu = _interopRequireDefault(require("../menu"));
23
- var _prevLocale = require("../prev-locale");
24
19
  require("./index.less");
25
20
  function _interopRequireDefault(e) {
26
21
  return e && e.__esModule ? e : {
@@ -108,29 +103,16 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
108
103
  }
109
104
  return t;
110
105
  };
111
-
112
- // import Action from './Action'
113
-
114
106
  var _checkShowChild = function checkShowChild(child) {
115
107
  var _ref = child.props || {},
116
108
  disabled = _ref.disabled,
117
109
  children = _ref.children,
118
110
  check = _ref.check,
119
111
  text = _ref.text;
120
- // if (check && !disabled) {
121
- if (check) {
112
+ if (check && !disabled) {
122
113
  return _react["default"].cloneElement(child, text ? {
123
- // children: (
124
- // <>
125
- // {children}
126
- // <span>{text}</span>
127
- // </>
128
- // ),
129
- children: text,
130
- type: 'link'
131
- } : {
132
- type: 'link'
133
- });
114
+ children: _react["default"].createElement(_react["default"].Fragment, null, children, text)
115
+ } : {});
134
116
  } else if (children) {
135
117
  var newChild = _react["default"].Children.map(children, function (child) {
136
118
  return _checkShowChild(child);
@@ -143,30 +125,12 @@ var _checkShowChild = function checkShowChild(child) {
143
125
  };
144
126
  if (child.type === _tooltip["default"]) {
145
127
  newProps.visible = false;
146
- } else if (child.type === _popconfirm["default"]) {
147
- newProps.hiddenArrow = true;
148
128
  }
149
129
  return _react["default"].cloneElement(child, newProps);
150
130
  }
151
131
  }
152
132
  return false;
153
133
  };
154
- var _checkIsDisabled = function checkIsDisabled(child) {
155
- var _ref2 = child.props || {},
156
- disabled = _ref2.disabled,
157
- children = _ref2.children,
158
- check = _ref2.check;
159
- if (check) {
160
- return disabled;
161
- } else if (children) {
162
- return _react["default"].Children.map(children, function (child) {
163
- return _checkIsDisabled(child);
164
- }).filter(function (i) {
165
- return !!i;
166
- }).length > 0;
167
- }
168
- return false;
169
- };
170
134
  function _default(_a) {
171
135
  var children = _a.children,
172
136
  other = __rest(_a, ["children"]);
@@ -193,25 +157,7 @@ function _default(_a) {
193
157
  _useMemo2 = _slicedToArray(_useMemo, 2),
194
158
  thisChild = _useMemo2[0],
195
159
  popChild = _useMemo2[1];
196
- var createMenu = function createMenu(list) {
197
- return _react["default"].createElement(_menu["default"], null, list.map(function (it, i) {
198
- return _react["default"].createElement(_menu["default"].Item, {
199
- key: i,
200
- disabled: _checkIsDisabled(it)
201
- }, it);
202
- }));
203
- };
204
- if (popChild.length <= 1) {
205
- // 如果只有一个,直接返回
206
- return children;
207
- }
208
- var batchOperation = (0, _prevLocale.getText)('batchOperation', (0, _prevLocale.getLanguage)());
209
- return _react["default"].createElement(_react["default"].Fragment, null, thisChild, _react["default"].createElement(_dropdown["default"], {
210
- overlay: createMenu(popChild),
211
- overlayClassName: "tnt-action-dropdown"
212
- }, _react["default"].createElement(_button["default"], {
213
- className: "tnt-action-dropdown-btn"
214
- }, batchOperation, " ", _react["default"].createElement(_icon["default"], {
215
- type: "down"
216
- }))));
160
+ return _react["default"].createElement(_react["default"].Fragment, null, thisChild, _react["default"].createElement(_Action["default"], Object.assign({
161
+ data: popChild
162
+ }, other)));
217
163
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,gCAAgC;AAChC,yDAAgC;AAChC,+DAAsC;AACtC,2DAAkC;AAClC,uDAA8B;AAC9B,mDAA0B;AAC1B,mDAA0B;AAC1B,gDAAqD;AACrD,wBAAqB;AAErB,MAAM,cAAc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,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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-action/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,sDAA6B;AAC7B,yDAAgC;AAChC,wBAAqB;AAErB,MAAM,cAAc,GAAG,CAAC,KAAK,EAA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AAK,EAAE,EAAE;YACzC,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE;gBACxB,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,CAAA;gBAC/B,IAAI,OAAO,EAAE;oBACX,SAAS,CAAC,IAAI,CAAC,eAAK,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,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,OAAO,CACL;QACG,SAAS;QAEV,8BAAC,gBAAM,kBAAC,IAAI,EAAE,QAAQ,IAAM,KAAK,EAAI,CACpC,CACJ,CAAA;AACH,CAAC;AA3BD,4BA2BC","sourcesContent":["import React, { useMemo } from 'react'\nimport Action from './Action'\nimport Tooltip from '../tooltip'\nimport './index.less'\n\nconst checkShowChild = (child) => {\n const { disabled, children, check, text } = child.props || {}\n if (check && !disabled) {\n return React.cloneElement(\n child,\n text\n ? {\n children: (\n <>\n {children}\n {text}\n </>\n ),\n }\n : {}\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 }\n return React.cloneElement(child, newProps)\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 return (\n <>\n {thisChild}\n\n <Action data={popChild} {...other} />\n </>\n )\n}\n"]}
@@ -67,48 +67,4 @@
67
67
  }
68
68
  }
69
69
  }
70
-
71
- &-dropdown {
72
- &-btn {
73
- margin-left: 8px !important;
74
- border-radius: @border-radius-base !important;
75
- }
76
-
77
- .ant-dropdown-menu-item {
78
- .ant-btn {
79
- display: block;
80
- padding: 0;
81
- height: auto;
82
- border: none;
83
- background-color: transparent;
84
- color: inherit;
85
- width: calc(100% + 24px);
86
- text-align: left;
87
- padding: 5px 12px;
88
- margin: -5px -12px;
89
-
90
- &:hover,
91
- &:active {
92
- color: inherit;
93
- }
94
-
95
- &[disabled] {
96
- color: @disabled-color;
97
-
98
- &:hover,
99
- &:active {
100
- color: @disabled-color;
101
- }
102
- }
103
- }
104
- }
105
- }
106
- }
107
-
108
- // 全局设置
109
- .ant-btn-group:has(.tnt-action-dropdown-btn) {
110
- &>.ant-btn:nth-last-child(2) {
111
- border-top-right-radius: @border-radius-base;
112
- border-bottom-right-radius: @border-radius-base;
113
- }
114
70
  }
@@ -0,0 +1,114 @@
1
+ .tnt-action {
2
+ position: fixed;
3
+ // bottom: 100px;
4
+ // width: @tnt-action-width;
5
+ // left: calc(50vw - @tnt-action-width / 2);
6
+ padding: 10px 16px;
7
+ background-color: @text-color;
8
+ border-radius: @border-radius-base;
9
+ z-index: 200;
10
+ cursor: grab;
11
+ box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.25), 0px 1px 1px 0px #263354 inset;
12
+
13
+ &-text {
14
+ color: @white;
15
+ margin-left: 20px;
16
+ font-size: 14px;
17
+ user-select: none;
18
+
19
+ .num {
20
+ display: inline-block;
21
+ width: 16px;
22
+ height: 16px;
23
+ background: #454f64;
24
+ border-radius: 8px;
25
+ font-size: 10px;
26
+ margin-right: 4px;
27
+ vertical-align: text-bottom;
28
+ text-align: center;
29
+ }
30
+ }
31
+
32
+ >.tnt-btn-tertiary {
33
+ opacity: 0.5;
34
+ background: #454f64;
35
+ color: @white;
36
+ border-width: 0;
37
+ width: @tnt-action-close-width;
38
+ height: @tnt-action-close-width;
39
+ min-width: @tnt-action-close-width;
40
+ line-height: @tnt-action-close-width;
41
+ margin-top: 4px;
42
+ font-size: 14px;
43
+
44
+ &:hover {
45
+ opacity: 0.8;
46
+ }
47
+ }
48
+
49
+ .fr {
50
+ float: right;
51
+
52
+ .ant-btn {
53
+ margin-left: 10px;
54
+
55
+ .tntd-anticon {
56
+ margin-right: 4px;
57
+ }
58
+ }
59
+
60
+ .ant-btn:not(.ant-btn-danger) {
61
+ background: rgba(69, 79, 100, 0.5);
62
+ color: @white;
63
+ border-width: 0;
64
+
65
+ &:hover {
66
+ background: rgba(69, 79, 100, 0.8);
67
+ }
68
+ }
69
+ }
70
+
71
+ &-dropdown {
72
+ &-btn {
73
+ margin-left: 8px !important;
74
+ border-radius: @border-radius-base !important;
75
+ }
76
+
77
+ .ant-dropdown-menu-item {
78
+ .ant-btn {
79
+ display: block;
80
+ padding: 0;
81
+ height: auto;
82
+ border: none;
83
+ background-color: transparent;
84
+ color: inherit;
85
+ width: calc(100% + 24px);
86
+ text-align: left;
87
+ padding: 5px 12px;
88
+ margin: -5px -12px;
89
+
90
+ &:hover,
91
+ &:active {
92
+ color: inherit;
93
+ }
94
+
95
+ &[disabled] {
96
+ color: @disabled-color;
97
+
98
+ &:hover,
99
+ &:active {
100
+ color: @disabled-color;
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ // 全局设置
109
+ .ant-btn-group:has(.tnt-action-dropdown-btn) {
110
+ &>.ant-btn:nth-last-child(2) {
111
+ border-top-right-radius: @border-radius-base;
112
+ border-bottom-right-radius: @border-radius-base;
113
+ }
114
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tntd",
3
- "version": "3.0.74",
3
+ "version": "3.0.76",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "start": "heft start --storybook",