@para-ui/core 3.0.45 → 3.0.46

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.
@@ -8,7 +8,7 @@ import SearchIcon from '@para-ui/icons/Search';
8
8
  import CloseIcon from '@para-ui/icons/Close';
9
9
  import CloseCircle from '@para-ui/icons/CloseCircle';
10
10
  import Table from '../Table/index.js';
11
- import { T as Tree } from '../_verture/index-da441266.js';
11
+ import { T as Tree } from '../_verture/index-fbebe666.js';
12
12
  import { Button } from '../Button/index.js';
13
13
  import { D as Dropdown } from '../_verture/index-be4faaee.js';
14
14
  import { Popover } from '../Popover/index.js';
@@ -72,7 +72,7 @@ import '@para-ui/icons/Left';
72
72
  import 'rc-pagination';
73
73
  import '@para-ui/icons/Right';
74
74
  import '@para-ui/icons/DoubleRight';
75
- import '../_verture/index-da441266.js';
75
+ import '../_verture/index-fbebe666.js';
76
76
  import 'rc-tree';
77
77
  import '@para-ui/icons/Document';
78
78
  import 'react-dom';
package/Form/index.js CHANGED
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-708dbb18.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
  import { DeepClone } from '@paraview/lib';
5
5
  import React__default from 'react';
6
- import { F as FormItem, v as validate } from '../_verture/index-f006937d.js';
6
+ import { F as FormItem, v as validate } from '../_verture/index-b3e53188.js';
7
7
  import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
8
8
  import '../TextField/index.js';
9
9
  import '../_verture/typeof-498dd2b1.js';
@@ -68,7 +68,7 @@ import '@para-ui/icons/Left';
68
68
  import 'rc-pagination';
69
69
  import '@para-ui/icons/Right';
70
70
  import '@para-ui/icons/DoubleRight';
71
- import '../_verture/index-da441266.js';
71
+ import '../_verture/index-fbebe666.js';
72
72
  import 'rc-tree';
73
73
  import '@para-ui/icons/Document';
74
74
  import 'react-dom';
package/FormItem/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { F as default } from '../_verture/index-f006937d.js';
3
+ export { F as default } from '../_verture/index-b3e53188.js';
4
4
  import 'clsx';
5
5
  import '../Label/index.js';
6
6
  import '../_verture/constant-66aa48a1.js';
@@ -68,7 +68,7 @@ import '@para-ui/icons/Left';
68
68
  import 'rc-pagination';
69
69
  import '@para-ui/icons/Right';
70
70
  import '@para-ui/icons/DoubleRight';
71
- import '../_verture/index-da441266.js';
71
+ import '../_verture/index-fbebe666.js';
72
72
  import 'rc-tree';
73
73
  import '@para-ui/icons/Document';
74
74
  import 'react-dom';
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 版本: 3.0.46
2
+ para-ui/core@3.0.46 发布
3
+ 【Upload】ImageUpload增加 readonly 属性,实现照片墙预览模式
4
+ 【树形控件-Tree】添加headers入参
5
+
1
6
  ## 版本: 3.0.45
2
7
 
3
8
  para-ui/core@3.0.45 发布
package/Tree/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { T as Tree } from '../_verture/index-da441266.js';
2
- export { T as default } from '../_verture/index-da441266.js';
1
+ import { T as Tree } from '../_verture/index-fbebe666.js';
2
+ export { T as default } from '../_verture/index-fbebe666.js';
3
3
  import '../_verture/toConsumableArray-57dd2e23.js';
4
4
  import '../_verture/slicedToArray-708dbb18.js';
5
5
  import '../_verture/defineProperty-62acccfc.js';
@@ -7,6 +7,7 @@ import { ReactNode } from "react";
7
7
  import { TreeProps as RcTreeProps } from 'rc-tree';
8
8
  import { DataNode, EventDataNode, Key } from "rc-tree/lib/interface";
9
9
  import { EmptyProps } from "../Empty";
10
+ import { ParaRequestConfig as RequestConfig } from "@paraview/lib/http/interface";
10
11
  type HasAction = (nodeData: DataNode) => boolean;
11
12
  type ActionItem = boolean | {
12
13
  text: string;
@@ -100,6 +101,8 @@ export interface TreeProps extends Omit<RcTreeProps, 'prefixCls' | 'showLine' |
100
101
  url?: string;
101
102
  /** 请求上下文 */
102
103
  ctx?: string;
104
+ /** 请求头 */
105
+ headers?: RequestConfig['headers'];
103
106
  /** 请求参数 */
104
107
  params?: Object | null;
105
108
  /** 请求方法*/
@@ -9,6 +9,8 @@ export type ImageUploadProps = Omit<UploadProps, 'type'> & {
9
9
  /** 图片名称 */
10
10
  imageName?: string;
11
11
  };
12
+ /** 用于控制这个组件只回显图片 不能上传和删除 */
13
+ readonly?: boolean;
12
14
  };
13
15
  declare const ImageUpload: FunctionComponent<ImageUploadProps>;
14
16
  export default ImageUpload;
package/Upload/index.js CHANGED
@@ -43,7 +43,7 @@ import '@para-ui/icons/CloseCircleF';
43
43
  import '@para-ui/icons/WarningCircle';
44
44
  import '@para-ui/icons/WarningCircleF';
45
45
 
46
- var css_248z$4 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午3:08\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-upload-list-text .upload-list-item {\n margin-top: 8px;\n}\n.paraui-v3-upload-list-text .upload-list-item-info {\n display: flex;\n align-items: center;\n padding: 0 8px;\n line-height: 28px;\n font-size: 14px;\n color: rgb(46, 55, 67);\n border-radius: 4px;\n transition: background-color 0.3s;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-fileicon {\n line-height: 0;\n opacity: 1;\n transition: opacity 0.3s;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-fileicon svg {\n color: inherit;\n font-size: inherit;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text-name {\n margin-left: 10px;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-actions {\n position: absolute;\n opacity: 0;\n visibility: hidden;\n line-height: 0;\n transition: opacity 0.3s;\n cursor: pointer;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-actions svg {\n color: rgb(235, 96, 84);\n font-size: inherit;\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover .upload-list-text .upload-list-actions {\n visibility: visible;\n opacity: 1;\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover .upload-list-text .upload-list-fileicon-active {\n opacity: 0;\n}\n.paraui-v3-upload-list-picture {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item {\n position: relative;\n display: inline-block;\n width: 100px;\n height: 100px;\n margin-right: 16px;\n border-radius: 4px;\n cursor: default;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item::before {\n content: \" \";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 4px;\n opacity: 0;\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item img {\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-picture-name {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 0 10px;\n font-size: 12px;\n line-height: 24px;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 0 0 4px 4px;\n color: rgb(255, 255, 255);\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-actions {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n line-height: 0;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-actions svg {\n color: rgb(255, 255, 255);\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover::before {\n opacity: 1;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover .upload-list-actions {\n opacity: 1;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover .upload-list-picture-name {\n opacity: 0;\n}";
46
+ var css_248z$4 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午3:08\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-upload-list-text .upload-list-item {\n margin-top: 8px;\n}\n.paraui-v3-upload-list-text .upload-list-item-info {\n display: flex;\n align-items: center;\n padding: 0 8px;\n line-height: 28px;\n font-size: 14px;\n color: rgb(46, 55, 67);\n border-radius: 4px;\n transition: background-color 0.3s;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-fileicon {\n line-height: 0;\n opacity: 1;\n transition: opacity 0.3s;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-fileicon svg {\n color: inherit;\n font-size: inherit;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text-name {\n margin-left: 10px;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-actions {\n position: absolute;\n opacity: 0;\n visibility: hidden;\n line-height: 0;\n transition: opacity 0.3s;\n cursor: pointer;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-actions svg {\n color: rgb(235, 96, 84);\n font-size: inherit;\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover .upload-list-text .upload-list-actions {\n visibility: visible;\n opacity: 1;\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover .upload-list-text .upload-list-fileicon-active {\n opacity: 0;\n}\n.paraui-v3-upload-list-picture {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item {\n position: relative;\n display: inline-block;\n width: 100px;\n height: 100px;\n margin-right: 16px;\n border-radius: 4px;\n cursor: default;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item::before {\n content: \" \";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 4px;\n opacity: 0;\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item img {\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-picture-name {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 0 10px;\n font-size: 12px;\n line-height: 24px;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 0 0 4px 4px;\n color: rgb(255, 255, 255);\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-actions {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n line-height: 0;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-actions svg {\n color: rgb(255, 255, 255);\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover:not(.upload-list-picture-item-readonly)::before {\n opacity: 1;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover:not(.upload-list-picture-item-readonly) .upload-list-actions {\n opacity: 1;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover:not(.upload-list-picture-item-readonly) .upload-list-picture-name {\n opacity: 0;\n}";
47
47
  styleInject(css_248z$4);
48
48
 
49
49
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
@@ -59,7 +59,8 @@ var UploadList = function UploadList(props) {
59
59
  _props$showRemoveIcon = props.showRemoveIcon,
60
60
  showRemoveIcon = _props$showRemoveIcon === void 0 ? true : _props$showRemoveIcon,
61
61
  removeIcon = props.removeIcon,
62
- itemRender = props.itemRender;
62
+ itemRender = props.itemRender,
63
+ readonly = props.readonly;
63
64
  var _useState = useState([]),
64
65
  _useState2 = _slicedToArray(_useState, 2),
65
66
  uploadList = _useState2[0],
@@ -71,7 +72,7 @@ var UploadList = function UploadList(props) {
71
72
  };
72
73
  //渲染列表actions
73
74
  var renderActions = function renderActions(file) {
74
- return showRemoveIcon && jsx("span", Object.assign({
75
+ return showRemoveIcon && !readonly && jsx("span", Object.assign({
75
76
  className: 'upload-list-actions',
76
77
  onClick: function onClick(evt) {
77
78
  return handleRemove(file, evt);
@@ -120,7 +121,7 @@ var UploadList = function UploadList(props) {
120
121
  //自定义渲染
121
122
  return itemRender(file, uploadList);
122
123
  return jsxs("div", Object.assign({
123
- className: 'upload-list-picture-item'
124
+ className: "upload-list-picture-item ".concat(readonly ? 'upload-list-picture-item-readonly' : '')
124
125
  }, {
125
126
  children: [jsx("img", {
126
127
  src: file.dataUrl || file.url,
@@ -302,7 +303,8 @@ var ImageUpload = function ImageUpload(props) {
302
303
  _props$showLoading = props.showLoading,
303
304
  loading = _props$showLoading === void 0 ? true : _props$showLoading,
304
305
  defaultImage = props.defaultImage,
305
- restProps = __rest(props, ["className", "style", "onStart", "onSuccess", "onError", "onProgress", "onRemove", "beforeUpload", "onChange", "defaultFileList", "fileList", "showUploadList", "maxCount", "children", "itemRender", "showUploadError", "stash", "uploading", "showLoading", "defaultImage"]);
306
+ readonly = props.readonly,
307
+ restProps = __rest(props, ["className", "style", "onStart", "onSuccess", "onError", "onProgress", "onRemove", "beforeUpload", "onChange", "defaultFileList", "fileList", "showUploadList", "maxCount", "children", "itemRender", "showUploadError", "stash", "uploading", "showLoading", "defaultImage", "readonly"]);
306
308
  var intl = useFormatMessage('Upload', localeJson);
307
309
  var _useState = useState(defaultFileList),
308
310
  _useState2 = _slicedToArray(_useState, 2),
@@ -546,6 +548,7 @@ var ImageUpload = function ImageUpload(props) {
546
548
  var renderUploadList = function renderUploadList() {
547
549
  return showUploadList && jsx(UploadList, {
548
550
  listType: 'picture-card',
551
+ readonly: readonly,
549
552
  items: uploadFileList,
550
553
  showRemoveIcon: showRemoveIcon,
551
554
  removeIcon: removeIcon,
@@ -590,6 +593,7 @@ var ImageUpload = function ImageUpload(props) {
590
593
  };
591
594
  //渲染上传控件
592
595
  var renderUploadSelector = function renderUploadSelector() {
596
+ if (readonly) return null;
593
597
  return jsxs("div", Object.assign({
594
598
  className: clsx('upload-image-select', showLoading && 'upload-image-select-loading')
595
599
  }, {
@@ -131,4 +131,6 @@ export interface UploadListProps<T = any> {
131
131
  removeIcon?: React.ReactNode | ((file: UploadFile) => React.ReactNode);
132
132
  /**自定义上传列表项*/
133
133
  itemRender?: ItemRender<T>;
134
+ /**用于控制这个组件只回显图片 不能上传和删除*/
135
+ readonly?: boolean;
134
136
  }
@@ -567,6 +567,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
567
567
  params = _props$params === void 0 ? null : _props$params,
568
568
  _props$method = props.method,
569
569
  method = _props$method === void 0 ? 'GET' : _props$method,
570
+ headers = props.headers,
570
571
  requestCallback = props.requestCallback,
571
572
  refresh = props.refresh,
572
573
  _props$replaceFields = props.replaceFields,
@@ -879,22 +880,23 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
879
880
  ctx: ctx,
880
881
  method: m
881
882
  }, m === 'GET' ? 'params' : 'data', tParams || {});
882
- _context.next = 8;
883
+ if (headers) opts.headers = headers;
884
+ _context.next = 9;
883
885
  return Request(opts);
884
- case 8:
886
+ case 9:
885
887
  _yield$Request = _context.sent;
886
888
  data = _yield$Request.data;
887
889
  err = _yield$Request.err;
888
890
  //分页数据格式 {list,page,size,total},否则 []
889
891
  showLoading && setLoading(false);
890
892
  if (!err) {
891
- _context.next = 14;
893
+ _context.next = 15;
892
894
  break;
893
895
  }
894
896
  return _context.abrupt("return", pagination ? {} : []);
895
- case 14:
896
- return _context.abrupt("return", pagination ? data.data || {} : data.data || []);
897
897
  case 15:
898
+ return _context.abrupt("return", pagination ? data.data || {} : data.data || []);
899
+ case 16:
898
900
  case "end":
899
901
  return _context.stop();
900
902
  }
package/index.js CHANGED
@@ -22,7 +22,7 @@ export { D as Dropdown } from './_verture/index-be4faaee.js';
22
22
  export { default as DynamicMultiBox } from './DynamicMultiBox/index.js';
23
23
  export { default as Empty } from './Empty/index.js';
24
24
  export { default as Form } from './Form/index.js';
25
- export { F as FormItem } from './_verture/index-f006937d.js';
25
+ export { F as FormItem } from './_verture/index-b3e53188.js';
26
26
  export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-d01400f6.js';
27
27
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
28
28
  export { default as Help } from './Help/index.js';
@@ -69,7 +69,7 @@ export { Title } from './Title/index.js';
69
69
  export { ToggleButton, ToggleButtonGroup } from './ToggleButton/index.js';
70
70
  export { Tooltip } from './Tooltip/index.js';
71
71
  export { SSortablejs, Transfer } from './Transfer/index.js';
72
- export { T as Tree } from './_verture/index-da441266.js';
72
+ export { T as Tree } from './_verture/index-fbebe666.js';
73
73
  export { default as Upload } from './Upload/index.js';
74
74
  import './_verture/slicedToArray-708dbb18.js';
75
75
  import 'react/jsx-runtime';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@para-ui/core",
3
3
  "private": false,
4
- "version": "3.0.45",
4
+ "version": "3.0.46",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",