@qsxy/element-plus-react 1.0.0-next.12 → 1.0.0-next.15

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.
Files changed (187) hide show
  1. package/dist/Dialog/Dialog.js +5 -6
  2. package/dist/Dialog/DialogContext.d.ts +1 -1
  3. package/dist/Dialog/DialogContext.js +1 -1
  4. package/dist/Drawer/Drawer.d.ts +2 -5
  5. package/dist/Drawer/Drawer.js +98 -35
  6. package/dist/Drawer/DrawerBody.js +6 -12
  7. package/dist/Drawer/DrawerContext.d.ts +1 -13
  8. package/dist/Drawer/DrawerContext.js +1 -11
  9. package/dist/Drawer/DrawerHeader.js +5 -18
  10. package/dist/Drawer/typings.d.ts +31 -10
  11. package/dist/InputNumber/InputNumber.d.ts +2 -2
  12. package/dist/InputNumber/InputNumber.js +3 -3
  13. package/dist/Loading/Loading.d.ts +7 -2
  14. package/dist/Loading/Loading.js +108 -57
  15. package/dist/Loading/typings.d.ts +7 -1
  16. package/dist/Message/Main.d.ts +0 -7
  17. package/dist/Message/Main.js +0 -7
  18. package/dist/Message/Message.d.ts +2 -2
  19. package/dist/Message/Message.js +4 -3
  20. package/dist/Message/index.d.ts +0 -8
  21. package/dist/Message/index.js +5 -9
  22. package/dist/MessageBox/MessageBox.js +2 -1
  23. package/dist/MessageBox/index.d.ts +5 -5
  24. package/dist/MessageBox/index.js +1 -0
  25. package/dist/Notification/Main.d.ts +0 -7
  26. package/dist/Notification/Main.js +0 -7
  27. package/dist/Popover/Popover.d.ts +3 -2
  28. package/dist/Popover/Popover.js +10 -5
  29. package/dist/Popover/typings.d.ts +0 -1
  30. package/dist/Skeleton/PlaceholderGraph.d.ts +1 -1
  31. package/dist/Skeleton/PlaceholderGraph.js +3 -3
  32. package/dist/Skeleton/PlaceholderGrid.d.ts +1 -1
  33. package/dist/Skeleton/PlaceholderGrid.js +3 -3
  34. package/dist/Skeleton/PlaceholderParagraph.d.ts +2 -2
  35. package/dist/Skeleton/PlaceholderParagraph.js +13 -8
  36. package/dist/Skeleton/Skeleton.d.ts +2 -9
  37. package/dist/Skeleton/Skeleton.js +94 -7
  38. package/dist/Skeleton/SkeletonContext.d.ts +17 -0
  39. package/dist/Skeleton/SkeletonContext.js +5 -0
  40. package/dist/Skeleton/SkeletonItem.d.ts +4 -0
  41. package/dist/Skeleton/SkeletonItem.js +47 -0
  42. package/dist/Skeleton/index.d.ts +2 -3
  43. package/dist/Skeleton/index.js +2 -1
  44. package/dist/Skeleton/typings.d.ts +29 -0
  45. package/dist/Skeleton/typings.js +1 -0
  46. package/dist/Table/Table.d.ts +0 -1
  47. package/dist/Table/Table.js +1 -1
  48. package/dist/Table/hooks/useSelection.d.ts +1 -1
  49. package/dist/Tooltip/Tooltip.d.ts +3 -3
  50. package/dist/Tooltip/Tooltip.js +6 -6
  51. package/dist/index.css +1 -1
  52. package/dist/index.d.ts +2 -2
  53. package/dist/index.js +1 -1
  54. package/package.json +1 -1
  55. package/theme-chalk/drawer/index.scss +61 -65
  56. package/theme-chalk/message/index.scss +11 -3
  57. package/theme-chalk/placeholder/index.scss +22 -37
  58. package/dist/theme-chalk/avatar/index.scss +0 -50
  59. package/dist/theme-chalk/badge/index.scss +0 -63
  60. package/dist/theme-chalk/breadcrumb/index.scss +0 -65
  61. package/dist/theme-chalk/build.scss +0 -2
  62. package/dist/theme-chalk/button/_mixins.scss +0 -317
  63. package/dist/theme-chalk/button/button-group.scss +0 -83
  64. package/dist/theme-chalk/button/button.scss +0 -382
  65. package/dist/theme-chalk/button/index.scss +0 -2
  66. package/dist/theme-chalk/calendar/date-picker.scss +0 -112
  67. package/dist/theme-chalk/calendar/date-range-picker.scss +0 -139
  68. package/dist/theme-chalk/calendar/date-table.scss +0 -156
  69. package/dist/theme-chalk/calendar/index.scss +0 -6
  70. package/dist/theme-chalk/calendar/month-table.scss +0 -92
  71. package/dist/theme-chalk/calendar/picker-panel.scss +0 -136
  72. package/dist/theme-chalk/calendar/year-table.scss +0 -107
  73. package/dist/theme-chalk/card/index.scss +0 -44
  74. package/dist/theme-chalk/carousel/index.scss +0 -237
  75. package/dist/theme-chalk/cascader/cascader-panel.scss +0 -184
  76. package/dist/theme-chalk/cascader/cascader.scss +0 -239
  77. package/dist/theme-chalk/cascader/index.scss +0 -2
  78. package/dist/theme-chalk/checkbox/index.scss +0 -255
  79. package/dist/theme-chalk/checkbox-button/index.scss +0 -117
  80. package/dist/theme-chalk/checkbox-group/index.scss +0 -33
  81. package/dist/theme-chalk/col/_mixins.scss +0 -62
  82. package/dist/theme-chalk/col/index.scss +0 -50
  83. package/dist/theme-chalk/collapse/index.scss +0 -84
  84. package/dist/theme-chalk/color-picker/index.scss +0 -340
  85. package/dist/theme-chalk/common/_var.scss +0 -6
  86. package/dist/theme-chalk/common/index.d.ts +0 -1
  87. package/dist/theme-chalk/common/index.js +0 -1
  88. package/dist/theme-chalk/common/index.scss +0 -222
  89. package/dist/theme-chalk/date-picker/index.scss +0 -253
  90. package/dist/theme-chalk/date-time-picker/index.scss +0 -3
  91. package/dist/theme-chalk/date-time-picker/time-picker.scss +0 -83
  92. package/dist/theme-chalk/date-time-picker/time-range-picker.scss +0 -32
  93. package/dist/theme-chalk/descriptions/descriptions-item.scss +0 -66
  94. package/dist/theme-chalk/descriptions/descriptions.scss +0 -160
  95. package/dist/theme-chalk/descriptions/index.scss +0 -2
  96. package/dist/theme-chalk/dev.scss +0 -2
  97. package/dist/theme-chalk/dialog/index.scss +0 -190
  98. package/dist/theme-chalk/display.scss +0 -46
  99. package/dist/theme-chalk/divider/index.scss +0 -51
  100. package/dist/theme-chalk/doc.scss +0 -2
  101. package/dist/theme-chalk/drawer/index.scss +0 -250
  102. package/dist/theme-chalk/dropdown/index.scss +0 -147
  103. package/dist/theme-chalk/empty/index.scss +0 -69
  104. package/dist/theme-chalk/fonts/fa-brands-400.ttf +0 -0
  105. package/dist/theme-chalk/fonts/fa-brands-400.woff2 +0 -0
  106. package/dist/theme-chalk/fonts/fa-duotone-900.ttf +0 -0
  107. package/dist/theme-chalk/fonts/fa-duotone-900.woff2 +0 -0
  108. package/dist/theme-chalk/fonts/fa-light-300.ttf +0 -0
  109. package/dist/theme-chalk/fonts/fa-light-300.woff2 +0 -0
  110. package/dist/theme-chalk/fonts/fa-regular-400.ttf +0 -0
  111. package/dist/theme-chalk/fonts/fa-regular-400.woff2 +0 -0
  112. package/dist/theme-chalk/fonts/fa-solid-900.ttf +0 -0
  113. package/dist/theme-chalk/fonts/fa-solid-900.woff2 +0 -0
  114. package/dist/theme-chalk/fonts/fa-thin-100.ttf +0 -0
  115. package/dist/theme-chalk/fonts/fa-thin-100.woff2 +0 -0
  116. package/dist/theme-chalk/fonts/fa-v4compatibility.ttf +0 -0
  117. package/dist/theme-chalk/fonts/fa-v4compatibility.woff2 +0 -0
  118. package/dist/theme-chalk/form/index.scss +0 -378
  119. package/dist/theme-chalk/icon/fonts.scss +0 -9
  120. package/dist/theme-chalk/icon/index.scss +0 -44
  121. package/dist/theme-chalk/icon/scss/_animated.scss +0 -205
  122. package/dist/theme-chalk/icon/scss/_bordered-pulled.scss +0 -20
  123. package/dist/theme-chalk/icon/scss/_core.scss +0 -33
  124. package/dist/theme-chalk/icon/scss/_duotone-icons.scss +0 -12
  125. package/dist/theme-chalk/icon/scss/_fixed-width.scss +0 -7
  126. package/dist/theme-chalk/icon/scss/_functions.scss +0 -57
  127. package/dist/theme-chalk/icon/scss/_icons.scss +0 -11
  128. package/dist/theme-chalk/icon/scss/_list.scss +0 -20
  129. package/dist/theme-chalk/icon/scss/_mixins.scss +0 -102
  130. package/dist/theme-chalk/icon/scss/_rotated-flipped.scss +0 -31
  131. package/dist/theme-chalk/icon/scss/_screen-reader.scss +0 -14
  132. package/dist/theme-chalk/icon/scss/_shims.scss +0 -2606
  133. package/dist/theme-chalk/icon/scss/_sizing.scss +0 -16
  134. package/dist/theme-chalk/icon/scss/_stacked.scss +0 -32
  135. package/dist/theme-chalk/icon/scss/_variables.scss +0 -9189
  136. package/dist/theme-chalk/icon/scss/brands.scss +0 -27
  137. package/dist/theme-chalk/icon/scss/duotone.scss +0 -72
  138. package/dist/theme-chalk/icon/scss/fontawesome.scss +0 -13
  139. package/dist/theme-chalk/icon/scss/index.scss +0 -15
  140. package/dist/theme-chalk/icon/scss/light.scss +0 -21
  141. package/dist/theme-chalk/icon/scss/regular.scss +0 -21
  142. package/dist/theme-chalk/icon/scss/solid.scss +0 -21
  143. package/dist/theme-chalk/icon/scss/thin.scss +0 -21
  144. package/dist/theme-chalk/icon/scss/v4-shims.scss +0 -3
  145. package/dist/theme-chalk/index.scss +0 -67
  146. package/dist/theme-chalk/input/_mixins.scss +0 -16
  147. package/dist/theme-chalk/input/index.scss +0 -3
  148. package/dist/theme-chalk/input/input-range.scss +0 -208
  149. package/dist/theme-chalk/input/input.scss +0 -577
  150. package/dist/theme-chalk/input-number/index.scss +0 -172
  151. package/dist/theme-chalk/link/index.scss +0 -99
  152. package/dist/theme-chalk/loading/index.scss +0 -94
  153. package/dist/theme-chalk/message/index.scss +0 -169
  154. package/dist/theme-chalk/message-box/index.scss +0 -184
  155. package/dist/theme-chalk/notification/index.scss +0 -155
  156. package/dist/theme-chalk/pagination/index.scss +0 -515
  157. package/dist/theme-chalk/placeholder/index.scss +0 -135
  158. package/dist/theme-chalk/popconfirm/index.scss +0 -35
  159. package/dist/theme-chalk/popover/index.scss +0 -54
  160. package/dist/theme-chalk/popper/index.scss +0 -86
  161. package/dist/theme-chalk/progress/index.scss +0 -155
  162. package/dist/theme-chalk/radio/index.scss +0 -2
  163. package/dist/theme-chalk/radio/radio-button.scss +0 -128
  164. package/dist/theme-chalk/radio/radio.scss +0 -171
  165. package/dist/theme-chalk/radio-group/index.scss +0 -31
  166. package/dist/theme-chalk/row/index.scss +0 -30
  167. package/dist/theme-chalk/scrollbar/index.scss +0 -103
  168. package/dist/theme-chalk/select/index.scss +0 -244
  169. package/dist/theme-chalk/select/option-group.scss +0 -54
  170. package/dist/theme-chalk/select/option.scss +0 -63
  171. package/dist/theme-chalk/select/select-dropdown.scss +0 -57
  172. package/dist/theme-chalk/switch/index.scss +0 -273
  173. package/dist/theme-chalk/table/index.scss +0 -714
  174. package/dist/theme-chalk/tabs/index.scss +0 -620
  175. package/dist/theme-chalk/tag/index.scss +0 -360
  176. package/dist/theme-chalk/time-line/_timeline-item.scss +0 -90
  177. package/dist/theme-chalk/time-line/_timeline.scss +0 -50
  178. package/dist/theme-chalk/time-line/index.scss +0 -2
  179. package/dist/theme-chalk/time-picker/index.scss +0 -109
  180. package/dist/theme-chalk/tooltip/index.scss +0 -13
  181. package/dist/theme-chalk/transfer/index.scss +0 -247
  182. package/dist/theme-chalk/transition/index.scss +0 -756
  183. package/dist/theme-chalk/tree/_directory.scss +0 -73
  184. package/dist/theme-chalk/tree/_tree.scss +0 -401
  185. package/dist/theme-chalk/tree/index.scss +0 -2
  186. package/dist/theme-chalk/tree-select/index.scss +0 -25
  187. package/dist/theme-chalk/upload/index.scss +0 -631
@@ -1,6 +1,9 @@
1
1
  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); }
2
2
  var _templateObject, _templateObject2, _templateObject3;
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
7
  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; }
5
8
  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; }
6
9
  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; }
@@ -8,77 +11,127 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
8
11
  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); }
9
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
10
13
  import classNames from 'classnames';
11
- import { addClass } from 'dom-lib';
12
- import React, { useEffect, useRef } from 'react';
14
+ import { addClass, removeClass } from 'dom-lib';
15
+ import React, { createRef, forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
13
16
  import { createPortal } from 'react-dom';
14
17
  import { createRoot } from 'react-dom/client';
15
18
  import Icon from "../Icon/Icon";
16
19
  import Transition from "../Transition/Transition";
17
20
  import { PopupManager } from "../Util";
18
21
  import { useClassNames } from "../hooks";
19
- var Main = function Main(props) {
22
+ var LoadingMain = /*#__PURE__*/forwardRef(function (props, ref) {
20
23
  var visible = props.visible,
21
24
  text = props.text,
22
- _props$fullscreen = props.fullscreen,
23
- fullscreen = _props$fullscreen === void 0 ? true : _props$fullscreen,
25
+ fullscreen = props.fullscreen,
24
26
  spinner = props.spinner,
25
- background = props.background;
27
+ background = props.background,
28
+ svg = props.svg,
29
+ svgViewBox = props.svgViewBox;
26
30
  var _useClassNames = useClassNames('loading'),
27
31
  b = _useClassNames.b,
28
32
  is = _useClassNames.is,
29
33
  bm = _useClassNames.bm;
30
34
  var nodeRef = useRef(null);
31
- useEffect(function () {
35
+ var onEnter = useCallback(function () {
32
36
  var _nodeRef$current;
33
- if ((_nodeRef$current = nodeRef.current) !== null && _nodeRef$current !== void 0 && _nodeRef$current.parentNode) {
37
+ if (!props.children && (_nodeRef$current = nodeRef.current) !== null && _nodeRef$current !== void 0 && _nodeRef$current.parentNode) {
34
38
  addClass(nodeRef.current.parentNode, bm('parent', 'relative'));
39
+ addClass(nodeRef.current.parentNode, bm('parent', 'hidden'));
40
+ }
41
+ }, [bm, props.children]);
42
+ var onDestory = useCallback(function () {
43
+ var _nodeRef$current2;
44
+ if (!props.children && (_nodeRef$current2 = nodeRef.current) !== null && _nodeRef$current2 !== void 0 && _nodeRef$current2.parentNode) {
45
+ removeClass(nodeRef.current.parentNode, bm('parent', 'relative'));
46
+ removeClass(nodeRef.current.parentNode, bm('parent', 'hidden'));
47
+ }
48
+ }, [bm, props.children]);
49
+ useEffect(function () {
50
+ if (!visible) {
51
+ onDestory();
35
52
  }
36
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
- }, []);
38
- return /*#__PURE__*/React.createElement(Transition, {
39
- nodeRef: nodeRef,
40
- name: "loading-fade",
41
- visible: visible
42
- }, /*#__PURE__*/React.createElement("div", {
43
- ref: nodeRef,
44
- className: classNames(b(_templateObject || (_templateObject = _taggedTemplateLiteral(["mask"]))), is({
45
- fullscreen: fullscreen
46
- }), props.className),
47
- style: _objectSpread(_objectSpread({}, props.style), {}, {
48
- background: background,
49
- zIndex: PopupManager.nextZIndex()
50
- })
51
- }, /*#__PURE__*/React.createElement("div", {
52
- className: b(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["spinner"])))
53
- }, spinner ? /*#__PURE__*/React.createElement(Icon, {
54
- name: spinner,
55
- spin: true
56
- }) : /*#__PURE__*/React.createElement("svg", {
57
- className: "circular",
58
- viewBox: "25 25 50 50"
59
- }, /*#__PURE__*/React.createElement("circle", {
60
- className: "path",
61
- cx: "50",
62
- cy: "50",
63
- r: "20",
64
- fill: "none"
65
- })), text && /*#__PURE__*/React.createElement("p", {
66
- className: b(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["text"])))
67
- }, text))));
68
- };
54
+ }, [visible]);
55
+ useImperativeHandle(ref, function () {
56
+ return {
57
+ onDestory: onDestory
58
+ };
59
+ });
60
+ var content = useMemo(function () {
61
+ return /*#__PURE__*/React.createElement(Transition, {
62
+ nodeRef: nodeRef,
63
+ name: "loading-fade",
64
+ transitionAppear: true,
65
+ unmountOnExit: true,
66
+ visible: visible,
67
+ onEnter: onEnter
68
+ }, /*#__PURE__*/React.createElement("div", {
69
+ ref: nodeRef,
70
+ className: classNames(b(_templateObject || (_templateObject = _taggedTemplateLiteral(["mask"]))), is({
71
+ fullscreen: fullscreen
72
+ }), props.className),
73
+ style: _objectSpread(_objectSpread({}, props.style), {}, {
74
+ background: background,
75
+ zIndex: PopupManager.nextZIndex()
76
+ })
77
+ }, /*#__PURE__*/React.createElement("div", {
78
+ className: b(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["spinner"])))
79
+ }, spinner ? /*#__PURE__*/React.createElement(Icon, {
80
+ name: spinner,
81
+ spin: true
82
+ }) : /*#__PURE__*/React.createElement("svg", {
83
+ className: "circular",
84
+ viewBox: svgViewBox !== null && svgViewBox !== void 0 ? svgViewBox : '25 25 50 50'
85
+ }, svg ? svg : /*#__PURE__*/React.createElement("circle", {
86
+ className: "path",
87
+ cx: "50",
88
+ cy: "50",
89
+ r: "20",
90
+ fill: "none"
91
+ })), text && /*#__PURE__*/React.createElement("p", {
92
+ className: b(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["text"])))
93
+ }, text))));
94
+ }, [b, background, fullscreen, is, onEnter, props.className, props.style, spinner, svg, svgViewBox, text, visible]);
95
+ return props.children ? /*#__PURE__*/React.createElement("div", {
96
+ className: classNames(bm('parent', 'relative'), bm('parent', 'hidden'))
97
+ }, content, props.children) : content;
98
+ });
99
+ export var Main = /*#__PURE__*/function () {
100
+ function Main(props) {
101
+ _classCallCheck(this, Main);
102
+ _defineProperty(this, "ref", void 0);
103
+ _defineProperty(this, "root", void 0);
104
+ this.ref = /*#__PURE__*/createRef();
105
+ this.render(props);
106
+ }
107
+ _createClass(Main, [{
108
+ key: "render",
109
+ value: function render(props) {
110
+ var _props$target = props.target,
111
+ target = _props$target === void 0 ? {
112
+ current: document.body
113
+ } : _props$target;
114
+ var renderDom = document.createDocumentFragment();
115
+ this.root = createRoot(renderDom);
116
+ this.root.render( /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(LoadingMain, _extends({}, props, {
117
+ visible: true,
118
+ ref: this.ref
119
+ })), target.current));
120
+ }
121
+ }]);
122
+ return Main;
123
+ }();
69
124
  var service = function service() {
70
125
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
71
- var _props$target = props.target,
72
- target = _props$target === void 0 ? {
73
- current: document.body
74
- } : _props$target;
75
- var renderDom = document.createDocumentFragment();
76
- var root = createRoot(renderDom);
77
- root.render( /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Main, _extends({}, props, {
78
- visible: true
79
- })), target.current));
126
+ var instance = new Main(_objectSpread({
127
+ fullscreen: true
128
+ }, props));
129
+ var ref = instance.ref,
130
+ root = instance.root;
80
131
  return {
81
132
  close: function close() {
133
+ var _ref$current;
134
+ (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.onDestory();
82
135
  setTimeout(function () {
83
136
  root.unmount();
84
137
  }, 200);
@@ -87,16 +140,14 @@ var service = function service() {
87
140
  };
88
141
  var Loading = function Loading(props) {
89
142
  var target = props.target,
90
- visible = props.visible;
91
- // if (!target.current) {
92
- // return;
93
- // }
94
- if (target !== null && target !== void 0 && target.current) {
95
- return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Main, _extends({}, props, {
143
+ visible = props.visible,
144
+ fullscreen = props.fullscreen;
145
+ if (target !== null && target !== void 0 && target.current || fullscreen) {
146
+ return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(LoadingMain, _extends({}, props, {
96
147
  visible: visible
97
- })), target.current);
148
+ })), fullscreen ? document.body : target.current);
98
149
  }
99
- return /*#__PURE__*/React.createElement(Main, _extends({}, props, {
150
+ return /*#__PURE__*/React.createElement(LoadingMain, _extends({}, props, {
100
151
  visible: visible
101
152
  }));
102
153
  };
@@ -1,17 +1,23 @@
1
- import { RefObject } from 'react';
1
+ import { ReactElement, RefObject } from 'react';
2
2
  import { IconName } from '../Icon';
3
3
  import { BaseProps, NativeProps } from '../types/common';
4
4
  export interface LoadingProps extends BaseProps, NativeProps {
5
5
  /** Loading 需要覆盖的 DOM 节点。 可传入一个 DOM 对象或字符串; 若传入字符串,则会将其作为参数传入 document.querySelector以获取到对应 DOM 节点 */
6
6
  target?: RefObject<HTMLElement>;
7
+ /** 是否显示Loading */
7
8
  visible?: boolean;
8
9
  /** 是否让加载组件铺满整个屏幕 */
9
10
  fullscreen?: boolean;
11
+ /** 是否锁定父级元素滚动 */
10
12
  lock?: boolean;
11
13
  /** 显示在加载图标下方的加载文案 */
12
14
  text?: string;
13
15
  /** 自定义加载图标类名 */
14
16
  spinner?: IconName;
17
+ /** 自定义 SVG 元素覆盖默认加载器 */
18
+ svg?: ReactElement;
19
+ /** 设置用于加载 svg 元素的 viewBox 属性 */
20
+ svgViewBox?: string;
15
21
  /** 遮罩背景色 */
16
22
  background?: string;
17
23
  }
@@ -1,12 +1,5 @@
1
1
  import React from 'react';
2
2
  import { MessageProps, MessageRef } from './typings';
3
- /**
4
- * @author Parker
5
- * @CreateTime 2022/5/2 21:15:44
6
- * @LastEditor Parker
7
- * @ModifyTime 2022/5/3 12:09:53
8
- * @Description
9
- */
10
3
  export declare class Main {
11
4
  ref: React.RefObject<MessageRef>;
12
5
  constructor(props: MessageProps);
@@ -9,13 +9,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
9
9
  import React, { createRef } from 'react';
10
10
  import { createRoot } from 'react-dom/client';
11
11
  import Message from "./Message";
12
- /**
13
- * @author Parker
14
- * @CreateTime 2022/5/2 21:15:44
15
- * @LastEditor Parker
16
- * @ModifyTime 2022/5/3 12:09:53
17
- * @Description
18
- */
19
12
  export var Main = /*#__PURE__*/function () {
20
13
  function Main(props) {
21
14
  _classCallCheck(this, Main);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { MessageProps, MessageRef } from './typings';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<MessageRef>>>;
4
- export default _default;
3
+ declare const Message: React.MemoExoticComponent<React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<MessageRef>>>;
4
+ export default Message;
@@ -26,7 +26,7 @@ import { EVENT_CODE, TypeMap } from "../config/Constants";
26
26
  import { useClassNames } from "../hooks";
27
27
  // import { ConfigProvider } from '../ConfigProvider';
28
28
 
29
- var Message = /*#__PURE__*/forwardRef(function (props, ref) {
29
+ var Message = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
30
30
  var _props2;
31
31
  props = mergeDefaultProps({
32
32
  duration: 3000,
@@ -191,5 +191,6 @@ var Message = /*#__PURE__*/forwardRef(function (props, ref) {
191
191
  }), /*#__PURE__*/React.createElement("p", {
192
192
  className: e(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["content"])))
193
193
  }, message), closeIcon)), document.body);
194
- });
195
- export default /*#__PURE__*/memo(Message);
194
+ }));
195
+ Message.displayName = 'ElMessage';
196
+ export default Message;
@@ -1,14 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { MessageMethod, MessageQueue } from './typings';
3
3
  export declare const instances: MessageQueue;
4
- /**
5
- * 消息提示组件
6
- * @author Parker
7
- * @CreateTime 2022/3/10 12:45:48
8
- * @LastEditor Parker
9
- * @ModifyTime 2022/5/3 12:10:04
10
- * @Description Element Plus 消息提示组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
11
- */
12
4
  export declare const Message: MessageMethod;
13
5
  export declare function close(id: string, userOnClose?: (el?: RefObject<HTMLElement>) => void): void;
14
6
  export declare function closeAll(): void;
@@ -9,15 +9,6 @@ import { isEmpty } from "../Util";
9
9
  import Main from "./Main";
10
10
  export var instances = [];
11
11
  var seed = 1;
12
-
13
- /**
14
- * 消息提示组件
15
- * @author Parker
16
- * @CreateTime 2022/3/10 12:45:48
17
- * @LastEditor Parker
18
- * @ModifyTime 2022/5/3 12:10:04
19
- * @Description Element Plus 消息提示组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
20
- */
21
12
  export var Message = function Message() {
22
13
  var _opts, _ref$current, _ref$current2;
23
14
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -119,6 +110,11 @@ export function closeAll() {
119
110
  return Message(options);
120
111
  };
121
112
  });
113
+
114
+ // const config = (opts: MessageParams = {} as MessageParams) => {
115
+
116
+ // }
117
+
122
118
  Object.assign(Message, {
123
119
  closeAll: closeAll
124
120
  });
@@ -80,7 +80,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
80
80
  _useState6 = _slicedToArray(_useState5, 2),
81
81
  confirmButtonText = _useState6[0],
82
82
  setConfirmButtonText = _useState6[1];
83
- var _useControlled = useControlled(options.inputValue),
83
+ var _useControlled = useControlled(undefined, options.inputValue),
84
84
  _useControlled2 = _slicedToArray(_useControlled, 2),
85
85
  inputValue = _useControlled2[0],
86
86
  setInputValue = _useControlled2[1];
@@ -236,6 +236,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
236
236
  }, messageContainer)), boxType === 'prompt' && showInput && /*#__PURE__*/React.createElement("div", {
237
237
  className: e(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["input"])))
238
238
  }, /*#__PURE__*/React.createElement(Input, {
239
+ value: inputValue,
239
240
  type: inputType,
240
241
  error: validateError,
241
242
  placeholder: inputPlaceholder,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { MessageBoxData, MessageBoxProps } from './typings';
2
+ import { Action, MessageBoxInputData, MessageBoxProps } from './typings';
3
3
  export declare const MessageBox: {
4
- (options?: MessageBoxProps): Promise<unknown>;
4
+ (options?: MessageBoxProps): Promise<Action>;
5
5
  /**
6
6
  * 消息弹窗提示
7
7
  * @param message 消息内容
@@ -9,7 +9,7 @@ export declare const MessageBox: {
9
9
  * @param options 其他设置项
10
10
  * @returns
11
11
  */
12
- alert: (message: string | React.ReactElement, title: string | React.ReactElement | MessageBoxProps, options?: MessageBoxProps) => Promise<MessageBoxData>;
12
+ alert: (message: string | React.ReactElement, title?: string | React.ReactElement | MessageBoxProps, options?: MessageBoxProps) => Promise<Action>;
13
13
  /**
14
14
  * 确认消息
15
15
  * @param message 消息内容
@@ -17,7 +17,7 @@ export declare const MessageBox: {
17
17
  * @param options 其他设置项
18
18
  * @returns
19
19
  */
20
- confirm: (message: string | React.ReactElement, title: string | React.ReactElement | MessageBoxProps, options?: MessageBoxProps) => Promise<MessageBoxData>;
21
- prompt: (message: string | React.ReactElement, title: string | React.ReactElement | MessageBoxProps, options?: MessageBoxProps) => Promise<MessageBoxData>;
20
+ confirm: (message: string | React.ReactElement, title?: string | React.ReactElement | MessageBoxProps, options?: MessageBoxProps) => Promise<Action>;
21
+ prompt: (message: string | React.ReactElement, title?: string | React.ReactElement | MessageBoxProps, options?: MessageBoxProps) => Promise<MessageBoxInputData>;
22
22
  };
23
23
  export type { Action as MessageBoxAction, MessageBoxMethod, MessageBoxProps, MessageBoxRef } from './typings';
@@ -41,6 +41,7 @@ var instanceFactory = function instanceFactory(boxType) {
41
41
  }, MESSAGE_BOX_DEFAULT_OPTS[boxType]), options),
42
42
  onAction: function onAction(action, value) {
43
43
  if (action === 'confirm') {
44
+ // @ts-ignore
44
45
  resolve(boxType === 'prompt' ? {
45
46
  value: value,
46
47
  action: action
@@ -1,12 +1,5 @@
1
1
  import { RefObject } from 'react';
2
2
  import { NotificationProps, NotificationRef } from './typings';
3
- /**
4
- * @author Parker
5
- * @CreateTime 2022/3/10 12:45:48
6
- * @LastEditor Parker
7
- * @ModifyTime 2022/5/3 12:24:58
8
- * @Description
9
- */
10
3
  export declare class Main {
11
4
  ref: RefObject<NotificationRef>;
12
5
  constructor(props: NotificationProps);
@@ -9,13 +9,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
9
9
  import React, { createRef } from 'react';
10
10
  import { createRoot } from 'react-dom/client';
11
11
  import Notification from "./Notification";
12
- /**
13
- * @author Parker
14
- * @CreateTime 2022/3/10 12:45:48
15
- * @LastEditor Parker
16
- * @ModifyTime 2022/5/3 12:24:58
17
- * @Description
18
- */
19
12
  export var Main = /*#__PURE__*/function () {
20
13
  function Main(props) {
21
14
  _classCallCheck(this, Main);
@@ -1,4 +1,5 @@
1
- import { FC } from 'react';
1
+ import React from 'react';
2
+ import { TooltipRef } from '../Tooltip/typings';
2
3
  import { PopoverProps } from './typings';
3
- declare const Popover: FC<PopoverProps>;
4
+ declare const Popover: React.MemoExoticComponent<React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<TooltipRef>>>;
4
5
  export default Popover;
@@ -15,16 +15,16 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  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; }
16
16
  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; }
17
17
  import classNames from 'classnames';
18
- import React, { useCallback } from 'react';
18
+ import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef } from 'react';
19
19
  import Tooltip from "../Tooltip/Tooltip";
20
20
  import { mergeDefaultProps } from "../Util";
21
21
  import { partitionAnimationProps, partitionPopperPropsUtils, useClassNames } from "../hooks";
22
- var Popover = function Popover(props) {
22
+ var Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
23
23
  props = mergeDefaultProps({
24
24
  placement: 'bottom',
25
25
  showArrow: true,
26
26
  showTimeout: 0,
27
- hideTimeout: 300,
27
+ hideTimeout: 100,
28
28
  width: 200,
29
29
  trigger: 'click'
30
30
  }, props);
@@ -54,6 +54,7 @@ var Popover = function Popover(props) {
54
54
  var _partitionAnimationPr = partitionAnimationProps(rest),
55
55
  _partitionAnimationPr2 = _slicedToArray(_partitionAnimationPr, 1),
56
56
  transitionProps = _partitionAnimationPr2[0];
57
+ var tooltipRef = useRef(null);
57
58
 
58
59
  /** 显示 */
59
60
  var handleMouseEnter = useCallback(function (event) {
@@ -64,7 +65,11 @@ var Popover = function Popover(props) {
64
65
  var handleMouseLeave = useCallback(function (event) {
65
66
  onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave(event);
66
67
  }, [onMouseLeave]);
68
+ useImperativeHandle(ref, function () {
69
+ return tooltipRef.current;
70
+ });
67
71
  return /*#__PURE__*/React.createElement(Tooltip, _extends({
72
+ ref: tooltipRef,
68
73
  classPrefix: classPrefix,
69
74
  popperClass: classNames(b(), _defineProperty({}, m(_templateObject || (_templateObject = _taggedTemplateLiteral(["plain"]))), plain)),
70
75
  popperStyle: {
@@ -85,6 +90,6 @@ var Popover = function Popover(props) {
85
90
  className: e(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["title"])))
86
91
  }, title), content)
87
92
  }, popperProps, transitionProps));
88
- };
89
- Popover.displayName = 'Popover';
93
+ }));
94
+ Popover.displayName = 'ElPopover';
90
95
  export default Popover;
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { PopperOptions } from '../Popper';
3
3
  import { TransitionProps } from '../Transition';
4
4
  import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
5
- /** Dropdown 属性 */
6
5
  export interface PopoverProps extends BaseProps<React.ReactElement>, NativeProps, PopperOptions, AnimationEventProps, Omit<TransitionProps, 'children'> {
7
6
  /** 触发下拉的行为 */
8
7
  trigger?: 'hover' | 'click' | 'contextmenu';
@@ -3,7 +3,7 @@ export interface SkeletonGraphProps {
3
3
  height?: number;
4
4
  width?: number;
5
5
  /** Placeholder status */
6
- active?: boolean;
6
+ animated?: boolean;
7
7
  /** The prefix of the component CSS class */
8
8
  classPrefix?: string;
9
9
  /** Additional classes */
@@ -1,5 +1,5 @@
1
1
  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); }
2
- var _excluded = ["className", "width", "height", "style", "active", "classPrefix"];
2
+ var _excluded = ["className", "width", "height", "style", "animated", "classPrefix"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  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; }
5
5
  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; }
@@ -17,9 +17,9 @@ var SkeletonGraph = /*#__PURE__*/forwardRef(function (props, ref) {
17
17
  _props$height = props.height,
18
18
  height = _props$height === void 0 ? 200 : _props$height,
19
19
  style = props.style,
20
- active = props.active,
20
+ active = props.animated,
21
21
  _props$classPrefix = props.classPrefix,
22
- classPrefix = _props$classPrefix === void 0 ? 'placeholder' : _props$classPrefix,
22
+ classPrefix = _props$classPrefix === void 0 ? 'skeleton' : _props$classPrefix,
23
23
  rest = _objectWithoutProperties(props, _excluded);
24
24
  var _useClassNames = useClassNames(classPrefix),
25
25
  wb = _useClassNames.wb;
@@ -5,7 +5,7 @@ export interface PlaceholderGridProps {
5
5
  rowMargin?: number;
6
6
  columns?: number;
7
7
  /** Placeholder status */
8
- active?: boolean;
8
+ animated?: boolean;
9
9
  /** The prefix of the component CSS class */
10
10
  classPrefix?: string;
11
11
  /** Additional classes */
@@ -1,5 +1,5 @@
1
1
  var _templateObject;
2
- var _excluded = ["className", "classPrefix", "rows", "columns", "rowHeight", "rowMargin", "active"];
2
+ var _excluded = ["className", "classPrefix", "rows", "columns", "rowHeight", "rowMargin", "animated"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
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; }
@@ -10,7 +10,7 @@ import { useClassNames } from "../hooks";
10
10
  var PlaceholderGrid = /*#__PURE__*/forwardRef(function (props, ref) {
11
11
  var className = props.className,
12
12
  _props$classPrefix = props.classPrefix,
13
- classPrefix = _props$classPrefix === void 0 ? 'placeholder' : _props$classPrefix,
13
+ classPrefix = _props$classPrefix === void 0 ? 'skeleton' : _props$classPrefix,
14
14
  _props$rows = props.rows,
15
15
  rows = _props$rows === void 0 ? 5 : _props$rows,
16
16
  _props$columns = props.columns,
@@ -19,7 +19,7 @@ var PlaceholderGrid = /*#__PURE__*/forwardRef(function (props, ref) {
19
19
  rowHeight = _props$rowHeight === void 0 ? 10 : _props$rowHeight,
20
20
  _props$rowMargin = props.rowMargin,
21
21
  rowMargin = _props$rowMargin === void 0 ? 20 : _props$rowMargin,
22
- active = props.active,
22
+ active = props.animated,
23
23
  rest = _objectWithoutProperties(props, _excluded);
24
24
  var _useClassNames = useClassNames(classPrefix),
25
25
  b = _useClassNames.b,
@@ -3,9 +3,9 @@ export interface PlaceholderParagraphProps {
3
3
  rows?: number;
4
4
  rowHeight?: number;
5
5
  rowMargin?: number;
6
- graph?: boolean | 'circle' | 'square' | 'image';
6
+ variant?: 'circle' | 'rect' | 'image';
7
7
  /** Placeholder status */
8
- active?: boolean;
8
+ animated?: boolean;
9
9
  /** The prefix of the component CSS class */
10
10
  classPrefix?: string;
11
11
  /** Additional classes */
@@ -1,5 +1,5 @@
1
1
  var _templateObject, _templateObject2;
2
- var _excluded = ["className", "rows", "rowHeight", "rowMargin", "graph", "active", "classPrefix"];
2
+ var _excluded = ["className", "rows", "rowHeight", "rowMargin", "variant", "animated", "classPrefix"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
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; }
@@ -15,15 +15,14 @@ var PlaceholderParagraph = /*#__PURE__*/forwardRef(function (props, ref) {
15
15
  rowHeight = _props$rowHeight === void 0 ? 16 : _props$rowHeight,
16
16
  _props$rowMargin = props.rowMargin,
17
17
  rowMargin = _props$rowMargin === void 0 ? 16 : _props$rowMargin,
18
- graph = props.graph,
19
- active = props.active,
18
+ graph = props.variant,
19
+ active = props.animated,
20
20
  _props$classPrefix = props.classPrefix,
21
- classPrefix = _props$classPrefix === void 0 ? 'placeholder' : _props$classPrefix,
21
+ classPrefix = _props$classPrefix === void 0 ? 'skeleton' : _props$classPrefix,
22
22
  rest = _objectWithoutProperties(props, _excluded);
23
23
  var _useClassNames = useClassNames(classPrefix),
24
24
  b = _useClassNames.b,
25
25
  wb = _useClassNames.wb;
26
- var graphShape = graph === true ? 'square' : graph;
27
26
  var rowElements = useMemo(function () {
28
27
  var rowArr = [];
29
28
  for (var i = 0; i < rows; i++) {
@@ -42,13 +41,19 @@ var PlaceholderParagraph = /*#__PURE__*/forwardRef(function (props, ref) {
42
41
  var classes = classNames(className, wb('paragraph', {
43
42
  active: active
44
43
  }));
45
- var graphClasses = b('paragraph-graph', "paragraph-graph-".concat(graphShape));
44
+ var graphClasses = b('paragraph-graph', "paragraph-graph-".concat(graph));
46
45
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
47
46
  ref: ref,
48
47
  className: classes
49
- }), graphShape && /*#__PURE__*/React.createElement("div", {
48
+ }), graph && /*#__PURE__*/React.createElement("div", {
50
49
  className: graphClasses
51
- }, /*#__PURE__*/React.createElement("span", {
50
+ }, graph === 'image' ? /*#__PURE__*/React.createElement("svg", {
51
+ xmlns: "http://www.w3.org/2000/svg",
52
+ viewBox: "0 0 1024 1024"
53
+ }, /*#__PURE__*/React.createElement("path", {
54
+ fill: "currentColor",
55
+ d: "M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384"
56
+ })) : null, /*#__PURE__*/React.createElement("span", {
52
57
  className: b(_templateObject || (_templateObject = _taggedTemplateLiteral(["paragraph-graph-inner"])))
53
58
  })), /*#__PURE__*/React.createElement("div", {
54
59
  className: b(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["paragraph-rows"])))
@@ -1,11 +1,4 @@
1
1
  import { FC } from 'react';
2
- import SkeletonGraph from './PlaceholderGraph';
3
- import PlaceholderGrid from './PlaceholderGrid';
4
- import PlaceholderParagraph, { PlaceholderParagraphProps } from './PlaceholderParagraph';
5
- export interface Skeleton extends FC<PlaceholderParagraphProps> {
6
- Paragraph: typeof PlaceholderParagraph;
7
- Grid: typeof PlaceholderGrid;
8
- Graph: typeof SkeletonGraph;
9
- }
10
- declare const Skeleton: Skeleton;
2
+ import { SkeletonProps } from './typings';
3
+ declare const Skeleton: FC<SkeletonProps>;
11
4
  export default Skeleton;