@teamias/rex-design 0.0.40 → 0.0.42

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.
@@ -111,7 +111,8 @@ export var BaseTable = function BaseTable(_ref) {
111
111
  position: 'absolute',
112
112
  inset: 0,
113
113
  zIndex: 1,
114
- padding: 'inherit'
114
+ padding: 'inherit',
115
+ overflow: 'hidden'
115
116
  }, headerStyle !== null && headerStyle !== void 0 ? headerStyle : topHeaderStyle),
116
117
  children: title
117
118
  })]
@@ -21,7 +21,8 @@ export default (function () {
21
21
  }, {
22
22
  title: 'SPU/组合SKU',
23
23
  dataIndex: 'goods_spu_info',
24
- key: 'goods_spu_info'
24
+ key: 'goods_spu_info',
25
+ width: 150
25
26
  }, {
26
27
  title: '图片',
27
28
  dataIndex: 'goods_image',
@@ -51,7 +52,9 @@ export default (function () {
51
52
  },
52
53
  dataSource: tableData.items,
53
54
  pagination: false,
54
- indexColumn: {}
55
+ indexColumn: {
56
+ width: 150
57
+ }
55
58
  })
56
59
  });
57
60
  });
@@ -34,8 +34,9 @@ export default (function () {
34
34
  value: '{{ eeeeeeqw }}'
35
35
  }, {
36
36
  type: 'text',
37
- action: 'default',
38
- value: 'eeeeeeqw'
37
+ action: 'file',
38
+ value: 'eeeeeeqw',
39
+ url: 'http://localhost:6660/components/data-cell'
39
40
  }],
40
41
  itemsDirection: 'row',
41
42
  itemsGap: 4,
@@ -1,4 +1,4 @@
1
- import { DataCell } from "../../..";
1
+ import { DataCell, FileViewerRoot } from "../../..";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Fragment as _Fragment } from "react/jsx-runtime";
4
4
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -9,7 +9,7 @@ export default (function () {
9
9
  target: "_blank",
10
10
  rel: "noreferrer",
11
11
  children: "baidu"
12
- }), /*#__PURE__*/_jsx(DataCell, {
12
+ }), /*#__PURE__*/_jsx(FileViewerRoot, {}), /*#__PURE__*/_jsx(DataCell, {
13
13
  items: [{
14
14
  type: 'text',
15
15
  props: {
@@ -31,6 +31,7 @@ export default (function () {
31
31
  }, {
32
32
  type: 'link',
33
33
  props: {
34
+ action: 'file',
34
35
  label: 'link-baidu-blank',
35
36
  value: 'http://baidu.com'
36
37
  // urlTarget: '_self',
@@ -4,13 +4,14 @@ var _excluded = ["ellipsis", "tooltip", "copyable", "action", "urlTarget", "url"
4
4
  _excluded4 = ["iconsType"];
5
5
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
6
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
+ 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); }
7
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
- 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); }
13
- import { Icons, MediaViewer } from "../../..";
13
+ import { EyeOutlined } from '@ant-design/icons';
14
+ import { downloadResourceFile, Icons, MediaViewer, showFileViewer } from "../../..";
14
15
  import { Tag, Tooltip, Typography } from 'antd';
15
16
  import React from 'react';
16
17
  import { Navigate } from 'react-router';
@@ -82,12 +83,42 @@ var actionRender = function actionRender(item, action, node, click) {
82
83
  children: node
83
84
  }));
84
85
  };
86
+
87
+ /** 创建 file node */
88
+ var createFileNode = function createFileNode() {
89
+ return tooltipBox( /*#__PURE__*/_jsxs("a", {
90
+ href: "void",
91
+ style: _objectSpread({
92
+ wordBreak: 'break-all'
93
+ }, item.style),
94
+ onClick: function onClick(e) {
95
+ e.preventDefault();
96
+ e.stopPropagation();
97
+ downloadResourceFile(item.value || '');
98
+ },
99
+ children: [/*#__PURE__*/_jsx(EyeOutlined, {
100
+ style: {
101
+ marginRight: 4
102
+ },
103
+ onClick: function onClick(e) {
104
+ e.preventDefault();
105
+ e.stopPropagation();
106
+ showFileViewer({
107
+ fileUrl: item.value || ''
108
+ });
109
+ }
110
+ }), node]
111
+ }));
112
+ };
85
113
  if (action === 'default') {
86
114
  return tooltipBox( /*#__PURE__*/_jsx("span", {
87
115
  style: item.style,
88
116
  children: node
89
117
  }));
90
118
  }
119
+ if (action === 'file') {
120
+ return createFileNode();
121
+ }
91
122
 
92
123
  // 自定义
93
124
  if (action === 'custom') {
@@ -319,6 +350,31 @@ export var cellItemMap = {
319
350
  children: afterContent
320
351
  }, "renderItem-".concat(index, "-").concat(count++));
321
352
  }
353
+ if (action === 'file') {
354
+ return /*#__PURE__*/_jsxs("a", {
355
+ href: "void",
356
+ style: _objectSpread({
357
+ wordBreak: 'break-all'
358
+ }, style),
359
+ onClick: function onClick(e) {
360
+ e.preventDefault();
361
+ e.stopPropagation();
362
+ downloadResourceFile(url || '');
363
+ },
364
+ children: [/*#__PURE__*/_jsx(EyeOutlined, {
365
+ style: {
366
+ marginRight: 4
367
+ },
368
+ onClick: function onClick(e) {
369
+ e.preventDefault();
370
+ e.stopPropagation();
371
+ showFileViewer({
372
+ fileUrl: url || ''
373
+ });
374
+ }
375
+ }), afterContent]
376
+ }, "renderItem-".concat(index, "-").concat(count++));
377
+ }
322
378
  if (action === 'custom') {
323
379
  return /*#__PURE__*/_jsx("a", {
324
380
  href: "void",
@@ -135,6 +135,7 @@ export type TGroupV2 = {
135
135
  colSpan?: number;
136
136
  };
137
137
  };
138
+ /** 为 group-v2 公共属性 */
138
139
  export interface ICommonGroupV2 {
139
140
  /**
140
141
  * 缺省
@@ -148,11 +149,12 @@ export interface ICommonGroupV2 {
148
149
  /**
149
150
  * 触发类型
150
151
  * - url 跳转路由
152
+ * - file 资源文件
151
153
  * - custom 透传出去
152
154
  * - default 什么都不做
153
155
  * @default default
154
156
  */
155
- action?: 'url' | 'custom' | 'default';
157
+ action?: 'url' | 'file' | 'custom' | 'default';
156
158
  /**
157
159
  * url 跳转类型
158
160
  * - a 标签的 target 属性
@@ -171,12 +173,11 @@ export type TCellActionExtend = {
171
173
  /**
172
174
  * 触发类型
173
175
  * - url 跳转路由
174
- * - modal-form 弹出表单窗口(未实现)
175
- * - modal-search 弹出搜索窗口(未实现)
176
+ * - file 资源文件
176
177
  * - custom 透传出去
177
178
  * - default 什么都不做
178
179
  */
179
- action: 'url' | 'custom' | 'default';
180
+ action: 'url' | 'file' | 'custom' | 'default';
180
181
  /**
181
182
  * url 跳转类型
182
183
  * - a 标签的 target 属性
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamias/rex-design",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -69,7 +69,7 @@
69
69
  "@tiptap/react": "^2.12.0",
70
70
  "@tiptap/starter-kit": "^2.12.0",
71
71
  "ahooks": "^3.9.0",
72
- "antd": "^5.26.7",
72
+ "antd": "^5.29.3",
73
73
  "classnames": "^2.5.1",
74
74
  "dayjs": "^1.11.13",
75
75
  "lodash": "^4.17.21",