@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.
- package/dist/Dialog/Dialog.js +5 -6
- package/dist/Dialog/DialogContext.d.ts +1 -1
- package/dist/Dialog/DialogContext.js +1 -1
- package/dist/Drawer/Drawer.d.ts +2 -5
- package/dist/Drawer/Drawer.js +98 -35
- package/dist/Drawer/DrawerBody.js +6 -12
- package/dist/Drawer/DrawerContext.d.ts +1 -13
- package/dist/Drawer/DrawerContext.js +1 -11
- package/dist/Drawer/DrawerHeader.js +5 -18
- package/dist/Drawer/typings.d.ts +31 -10
- package/dist/InputNumber/InputNumber.d.ts +2 -2
- package/dist/InputNumber/InputNumber.js +3 -3
- package/dist/Loading/Loading.d.ts +7 -2
- package/dist/Loading/Loading.js +108 -57
- package/dist/Loading/typings.d.ts +7 -1
- package/dist/Message/Main.d.ts +0 -7
- package/dist/Message/Main.js +0 -7
- package/dist/Message/Message.d.ts +2 -2
- package/dist/Message/Message.js +4 -3
- package/dist/Message/index.d.ts +0 -8
- package/dist/Message/index.js +5 -9
- package/dist/MessageBox/MessageBox.js +2 -1
- package/dist/MessageBox/index.d.ts +5 -5
- package/dist/MessageBox/index.js +1 -0
- package/dist/Notification/Main.d.ts +0 -7
- package/dist/Notification/Main.js +0 -7
- package/dist/Popover/Popover.d.ts +3 -2
- package/dist/Popover/Popover.js +10 -5
- package/dist/Popover/typings.d.ts +0 -1
- package/dist/Skeleton/PlaceholderGraph.d.ts +1 -1
- package/dist/Skeleton/PlaceholderGraph.js +3 -3
- package/dist/Skeleton/PlaceholderGrid.d.ts +1 -1
- package/dist/Skeleton/PlaceholderGrid.js +3 -3
- package/dist/Skeleton/PlaceholderParagraph.d.ts +2 -2
- package/dist/Skeleton/PlaceholderParagraph.js +13 -8
- package/dist/Skeleton/Skeleton.d.ts +2 -9
- package/dist/Skeleton/Skeleton.js +94 -7
- package/dist/Skeleton/SkeletonContext.d.ts +17 -0
- package/dist/Skeleton/SkeletonContext.js +5 -0
- package/dist/Skeleton/SkeletonItem.d.ts +4 -0
- package/dist/Skeleton/SkeletonItem.js +47 -0
- package/dist/Skeleton/index.d.ts +2 -3
- package/dist/Skeleton/index.js +2 -1
- package/dist/Skeleton/typings.d.ts +29 -0
- package/dist/Skeleton/typings.js +1 -0
- package/dist/Table/Table.d.ts +0 -1
- package/dist/Table/Table.js +1 -1
- package/dist/Table/hooks/useSelection.d.ts +1 -1
- package/dist/Tooltip/Tooltip.d.ts +3 -3
- package/dist/Tooltip/Tooltip.js +6 -6
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/theme-chalk/drawer/index.scss +61 -65
- package/theme-chalk/message/index.scss +11 -3
- package/theme-chalk/placeholder/index.scss +22 -37
- package/dist/theme-chalk/avatar/index.scss +0 -50
- package/dist/theme-chalk/badge/index.scss +0 -63
- package/dist/theme-chalk/breadcrumb/index.scss +0 -65
- package/dist/theme-chalk/build.scss +0 -2
- package/dist/theme-chalk/button/_mixins.scss +0 -317
- package/dist/theme-chalk/button/button-group.scss +0 -83
- package/dist/theme-chalk/button/button.scss +0 -382
- package/dist/theme-chalk/button/index.scss +0 -2
- package/dist/theme-chalk/calendar/date-picker.scss +0 -112
- package/dist/theme-chalk/calendar/date-range-picker.scss +0 -139
- package/dist/theme-chalk/calendar/date-table.scss +0 -156
- package/dist/theme-chalk/calendar/index.scss +0 -6
- package/dist/theme-chalk/calendar/month-table.scss +0 -92
- package/dist/theme-chalk/calendar/picker-panel.scss +0 -136
- package/dist/theme-chalk/calendar/year-table.scss +0 -107
- package/dist/theme-chalk/card/index.scss +0 -44
- package/dist/theme-chalk/carousel/index.scss +0 -237
- package/dist/theme-chalk/cascader/cascader-panel.scss +0 -184
- package/dist/theme-chalk/cascader/cascader.scss +0 -239
- package/dist/theme-chalk/cascader/index.scss +0 -2
- package/dist/theme-chalk/checkbox/index.scss +0 -255
- package/dist/theme-chalk/checkbox-button/index.scss +0 -117
- package/dist/theme-chalk/checkbox-group/index.scss +0 -33
- package/dist/theme-chalk/col/_mixins.scss +0 -62
- package/dist/theme-chalk/col/index.scss +0 -50
- package/dist/theme-chalk/collapse/index.scss +0 -84
- package/dist/theme-chalk/color-picker/index.scss +0 -340
- package/dist/theme-chalk/common/_var.scss +0 -6
- package/dist/theme-chalk/common/index.d.ts +0 -1
- package/dist/theme-chalk/common/index.js +0 -1
- package/dist/theme-chalk/common/index.scss +0 -222
- package/dist/theme-chalk/date-picker/index.scss +0 -253
- package/dist/theme-chalk/date-time-picker/index.scss +0 -3
- package/dist/theme-chalk/date-time-picker/time-picker.scss +0 -83
- package/dist/theme-chalk/date-time-picker/time-range-picker.scss +0 -32
- package/dist/theme-chalk/descriptions/descriptions-item.scss +0 -66
- package/dist/theme-chalk/descriptions/descriptions.scss +0 -160
- package/dist/theme-chalk/descriptions/index.scss +0 -2
- package/dist/theme-chalk/dev.scss +0 -2
- package/dist/theme-chalk/dialog/index.scss +0 -190
- package/dist/theme-chalk/display.scss +0 -46
- package/dist/theme-chalk/divider/index.scss +0 -51
- package/dist/theme-chalk/doc.scss +0 -2
- package/dist/theme-chalk/drawer/index.scss +0 -250
- package/dist/theme-chalk/dropdown/index.scss +0 -147
- package/dist/theme-chalk/empty/index.scss +0 -69
- package/dist/theme-chalk/fonts/fa-brands-400.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-brands-400.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-duotone-900.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-duotone-900.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-light-300.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-light-300.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-regular-400.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-regular-400.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-solid-900.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-solid-900.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-thin-100.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-thin-100.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-v4compatibility.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-v4compatibility.woff2 +0 -0
- package/dist/theme-chalk/form/index.scss +0 -378
- package/dist/theme-chalk/icon/fonts.scss +0 -9
- package/dist/theme-chalk/icon/index.scss +0 -44
- package/dist/theme-chalk/icon/scss/_animated.scss +0 -205
- package/dist/theme-chalk/icon/scss/_bordered-pulled.scss +0 -20
- package/dist/theme-chalk/icon/scss/_core.scss +0 -33
- package/dist/theme-chalk/icon/scss/_duotone-icons.scss +0 -12
- package/dist/theme-chalk/icon/scss/_fixed-width.scss +0 -7
- package/dist/theme-chalk/icon/scss/_functions.scss +0 -57
- package/dist/theme-chalk/icon/scss/_icons.scss +0 -11
- package/dist/theme-chalk/icon/scss/_list.scss +0 -20
- package/dist/theme-chalk/icon/scss/_mixins.scss +0 -102
- package/dist/theme-chalk/icon/scss/_rotated-flipped.scss +0 -31
- package/dist/theme-chalk/icon/scss/_screen-reader.scss +0 -14
- package/dist/theme-chalk/icon/scss/_shims.scss +0 -2606
- package/dist/theme-chalk/icon/scss/_sizing.scss +0 -16
- package/dist/theme-chalk/icon/scss/_stacked.scss +0 -32
- package/dist/theme-chalk/icon/scss/_variables.scss +0 -9189
- package/dist/theme-chalk/icon/scss/brands.scss +0 -27
- package/dist/theme-chalk/icon/scss/duotone.scss +0 -72
- package/dist/theme-chalk/icon/scss/fontawesome.scss +0 -13
- package/dist/theme-chalk/icon/scss/index.scss +0 -15
- package/dist/theme-chalk/icon/scss/light.scss +0 -21
- package/dist/theme-chalk/icon/scss/regular.scss +0 -21
- package/dist/theme-chalk/icon/scss/solid.scss +0 -21
- package/dist/theme-chalk/icon/scss/thin.scss +0 -21
- package/dist/theme-chalk/icon/scss/v4-shims.scss +0 -3
- package/dist/theme-chalk/index.scss +0 -67
- package/dist/theme-chalk/input/_mixins.scss +0 -16
- package/dist/theme-chalk/input/index.scss +0 -3
- package/dist/theme-chalk/input/input-range.scss +0 -208
- package/dist/theme-chalk/input/input.scss +0 -577
- package/dist/theme-chalk/input-number/index.scss +0 -172
- package/dist/theme-chalk/link/index.scss +0 -99
- package/dist/theme-chalk/loading/index.scss +0 -94
- package/dist/theme-chalk/message/index.scss +0 -169
- package/dist/theme-chalk/message-box/index.scss +0 -184
- package/dist/theme-chalk/notification/index.scss +0 -155
- package/dist/theme-chalk/pagination/index.scss +0 -515
- package/dist/theme-chalk/placeholder/index.scss +0 -135
- package/dist/theme-chalk/popconfirm/index.scss +0 -35
- package/dist/theme-chalk/popover/index.scss +0 -54
- package/dist/theme-chalk/popper/index.scss +0 -86
- package/dist/theme-chalk/progress/index.scss +0 -155
- package/dist/theme-chalk/radio/index.scss +0 -2
- package/dist/theme-chalk/radio/radio-button.scss +0 -128
- package/dist/theme-chalk/radio/radio.scss +0 -171
- package/dist/theme-chalk/radio-group/index.scss +0 -31
- package/dist/theme-chalk/row/index.scss +0 -30
- package/dist/theme-chalk/scrollbar/index.scss +0 -103
- package/dist/theme-chalk/select/index.scss +0 -244
- package/dist/theme-chalk/select/option-group.scss +0 -54
- package/dist/theme-chalk/select/option.scss +0 -63
- package/dist/theme-chalk/select/select-dropdown.scss +0 -57
- package/dist/theme-chalk/switch/index.scss +0 -273
- package/dist/theme-chalk/table/index.scss +0 -714
- package/dist/theme-chalk/tabs/index.scss +0 -620
- package/dist/theme-chalk/tag/index.scss +0 -360
- package/dist/theme-chalk/time-line/_timeline-item.scss +0 -90
- package/dist/theme-chalk/time-line/_timeline.scss +0 -50
- package/dist/theme-chalk/time-line/index.scss +0 -2
- package/dist/theme-chalk/time-picker/index.scss +0 -109
- package/dist/theme-chalk/tooltip/index.scss +0 -13
- package/dist/theme-chalk/transfer/index.scss +0 -247
- package/dist/theme-chalk/transition/index.scss +0 -756
- package/dist/theme-chalk/tree/_directory.scss +0 -73
- package/dist/theme-chalk/tree/_tree.scss +0 -401
- package/dist/theme-chalk/tree/index.scss +0 -2
- package/dist/theme-chalk/tree-select/index.scss +0 -25
- package/dist/theme-chalk/upload/index.scss +0 -631
|
@@ -1,8 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import debounce from 'lodash/debounce';
|
|
11
|
+
import React, { Children, useEffect, useRef } from 'react';
|
|
12
|
+
import { mergeDefaultProps } from "../Util";
|
|
13
|
+
import { useClassNames, useControlled } from "../hooks";
|
|
14
|
+
import { SkeletonContext } from "./SkeletonContext";
|
|
15
|
+
import SkeletonItem from "./SkeletonItem";
|
|
16
|
+
var SkeletonCore = function SkeletonCore(props) {
|
|
17
|
+
var animated = props.animated,
|
|
18
|
+
_props$rows = props.rows,
|
|
19
|
+
rows = _props$rows === void 0 ? 4 : _props$rows,
|
|
20
|
+
variant = props.variant,
|
|
21
|
+
_props$rowHeight = props.rowHeight,
|
|
22
|
+
rowHeight = _props$rowHeight === void 0 ? 16 : _props$rowHeight,
|
|
23
|
+
_props$rowMargin = props.rowMargin,
|
|
24
|
+
rowMargin = _props$rowMargin === void 0 ? 16 : _props$rowMargin,
|
|
25
|
+
_props$classPrefix = props.classPrefix,
|
|
26
|
+
classPrefix = _props$classPrefix === void 0 ? 'skeleton' : _props$classPrefix,
|
|
27
|
+
formatter = props.formatter,
|
|
28
|
+
className = props.className,
|
|
29
|
+
style = props.style;
|
|
30
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
31
|
+
b = _useClassNames.b,
|
|
32
|
+
wb = _useClassNames.wb;
|
|
33
|
+
return /*#__PURE__*/React.createElement(SkeletonContext.Provider, {
|
|
34
|
+
value: {
|
|
35
|
+
rowHeight: rowHeight,
|
|
36
|
+
rowMargin: rowMargin,
|
|
37
|
+
rows: rows
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: classNames(className, wb('paragraph', {
|
|
41
|
+
active: animated
|
|
42
|
+
})),
|
|
43
|
+
style: style
|
|
44
|
+
}, variant && /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: b('paragraph-graph', "paragraph-graph-".concat(variant))
|
|
46
|
+
}, variant === 'image' ? /*#__PURE__*/React.createElement("svg", {
|
|
47
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
48
|
+
viewBox: "0 0 1024 1024"
|
|
49
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
50
|
+
fill: "currentColor",
|
|
51
|
+
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"
|
|
52
|
+
})) : null, /*#__PURE__*/React.createElement("span", {
|
|
53
|
+
className: b(_templateObject || (_templateObject = _taggedTemplateLiteral(["paragraph-graph-inner"])))
|
|
54
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: b(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["paragraph-rows"])))
|
|
56
|
+
}, Children.count(formatter) === 0 ? new Array(rows).fill(0).map(function (_, index) {
|
|
57
|
+
return /*#__PURE__*/React.createElement(SkeletonItem, {
|
|
58
|
+
key: index,
|
|
59
|
+
isFirst: index === 0
|
|
60
|
+
});
|
|
61
|
+
}) : formatter)));
|
|
62
|
+
};
|
|
63
|
+
var Skeleton = function Skeleton(props) {
|
|
64
|
+
var _throttle$leading, _throttle$trailing;
|
|
65
|
+
props = mergeDefaultProps({
|
|
66
|
+
visible: true
|
|
67
|
+
}, props);
|
|
68
|
+
var _props = props,
|
|
69
|
+
defaultVisible = _props.defaultVisible,
|
|
70
|
+
throttle = _props.throttle,
|
|
71
|
+
children = _props.children;
|
|
72
|
+
var initLoad = useRef(false);
|
|
73
|
+
var _useControlled = useControlled(undefined, defaultVisible !== null && defaultVisible !== void 0 ? defaultVisible : props.visible),
|
|
74
|
+
_useControlled2 = _slicedToArray(_useControlled, 2),
|
|
75
|
+
visible = _useControlled2[0],
|
|
76
|
+
setVisible = _useControlled2[1];
|
|
77
|
+
var display = debounce(function () {
|
|
78
|
+
return setVisible(true);
|
|
79
|
+
}, typeof throttle === 'number' ? throttle : (_throttle$leading = throttle === null || throttle === void 0 ? void 0 : throttle.leading) !== null && _throttle$leading !== void 0 ? _throttle$leading : 0);
|
|
80
|
+
var hide = debounce(function () {
|
|
81
|
+
return setVisible(false);
|
|
82
|
+
}, typeof throttle !== 'number' ? (_throttle$trailing = throttle === null || throttle === void 0 ? void 0 : throttle.trailing) !== null && _throttle$trailing !== void 0 ? _throttle$trailing : 0 : 0);
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
if (defaultVisible === true && !initLoad.current) {
|
|
85
|
+
setVisible(true);
|
|
86
|
+
} else {
|
|
87
|
+
props.visible ? display() : hide();
|
|
88
|
+
}
|
|
89
|
+
initLoad.current = true;
|
|
90
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
|
+
}, [props.visible]);
|
|
92
|
+
return visible ? /*#__PURE__*/React.createElement(SkeletonCore, props) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
93
|
+
};
|
|
94
|
+
Skeleton.displayName = 'ElSkeleton';
|
|
8
95
|
export default Skeleton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SkeletonContext: import("react").Context<{
|
|
3
|
+
/** 骨架屏段落数量 */
|
|
4
|
+
rows?: number;
|
|
5
|
+
/** 是否使用动画 */
|
|
6
|
+
animated?: boolean;
|
|
7
|
+
rowHeight?: number;
|
|
8
|
+
rowMargin?: number;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useSkeletonContext: () => {
|
|
11
|
+
/** 骨架屏段落数量 */
|
|
12
|
+
rows?: number;
|
|
13
|
+
/** 是否使用动画 */
|
|
14
|
+
animated?: boolean;
|
|
15
|
+
rowHeight?: number;
|
|
16
|
+
rowMargin?: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
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 _templateObject, _templateObject2;
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { useClassNames } from "../hooks";
|
|
12
|
+
import { useSkeletonContext } from "./SkeletonContext";
|
|
13
|
+
var SkeletonItem = function SkeletonItem(props) {
|
|
14
|
+
var _props$rowHeight, _props$rowMargin, _props$rowMargin2;
|
|
15
|
+
var isFirst = props.isFirst,
|
|
16
|
+
variant = props.variant,
|
|
17
|
+
className = props.className,
|
|
18
|
+
style = props.style,
|
|
19
|
+
_props$classPrefix = props.classPrefix,
|
|
20
|
+
classPrefix = _props$classPrefix === void 0 ? 'skeleton' : _props$classPrefix;
|
|
21
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
22
|
+
b = _useClassNames.b,
|
|
23
|
+
e = _useClassNames.e;
|
|
24
|
+
var _useSkeletonContext = useSkeletonContext(),
|
|
25
|
+
rowHeight = _useSkeletonContext.rowHeight,
|
|
26
|
+
rowMargin = _useSkeletonContext.rowMargin;
|
|
27
|
+
return variant ? /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: classNames(b('paragraph-graph', "paragraph-graph-".concat(variant)), className),
|
|
29
|
+
style: style
|
|
30
|
+
}, variant === 'image' ? /*#__PURE__*/React.createElement("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
viewBox: "0 0 1024 1024"
|
|
33
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
34
|
+
fill: "currentColor",
|
|
35
|
+
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"
|
|
36
|
+
})) : null, /*#__PURE__*/React.createElement("span", {
|
|
37
|
+
className: b(_templateObject || (_templateObject = _taggedTemplateLiteral(["paragraph-graph-inner"])))
|
|
38
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: classNames(e(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["item"]))), className),
|
|
40
|
+
style: _objectSpread({
|
|
41
|
+
width: "".concat(Math.random() * 75 + 25, "%"),
|
|
42
|
+
height: (_props$rowHeight = props.rowHeight) !== null && _props$rowHeight !== void 0 ? _props$rowHeight : rowHeight,
|
|
43
|
+
marginTop: isFirst ? Number((_props$rowMargin = props.rowMargin) !== null && _props$rowMargin !== void 0 ? _props$rowMargin : rowMargin) / 2 : (_props$rowMargin2 = props.rowMargin) !== null && _props$rowMargin2 !== void 0 ? _props$rowMargin2 : rowMargin
|
|
44
|
+
}, style)
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export default SkeletonItem;
|
package/dist/Skeleton/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type { SkeletonGraphProps } from './PlaceholderGraph';
|
|
2
|
-
export type { PlaceholderGridProps } from './PlaceholderGrid';
|
|
3
|
-
export type { PlaceholderParagraphProps } from './PlaceholderParagraph';
|
|
4
1
|
export { default as Skeleton } from './Skeleton';
|
|
2
|
+
export { default as SkeletonItem } from './SkeletonItem';
|
|
3
|
+
export type { SkeletonItemProps, SkeletonProps } from './typings';
|
package/dist/Skeleton/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as Skeleton } from "./Skeleton";
|
|
1
|
+
export { default as Skeleton } from "./Skeleton";
|
|
2
|
+
export { default as SkeletonItem } from "./SkeletonItem";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { BaseProps, NativeProps } from '../types/common';
|
|
3
|
+
export interface SkeletonProps extends BaseProps, NativeProps {
|
|
4
|
+
/** 是否显示模态框(可控) */
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
/** 默认是否显示模态框 */
|
|
7
|
+
defaultVisible?: boolean;
|
|
8
|
+
/** 骨架屏段落数量 */
|
|
9
|
+
rows?: number;
|
|
10
|
+
/** 是否使用动画 */
|
|
11
|
+
animated?: boolean;
|
|
12
|
+
rowHeight?: number;
|
|
13
|
+
rowMargin?: number;
|
|
14
|
+
/** 当前渲染 skeleton 类型 */
|
|
15
|
+
variant?: 'image' | 'circle' | 'rect';
|
|
16
|
+
/** 渲染延迟(以毫秒为单位) 数字代表延迟显示, 也可以设置为延迟隐藏, 例如 { leading: 500, trailing: 500 } 当需要控制初始加载值时,您可以设置 { initVal: true } */
|
|
17
|
+
throttle?: number | {
|
|
18
|
+
leading?: number;
|
|
19
|
+
trailing?: number;
|
|
20
|
+
};
|
|
21
|
+
formatter?: ReactElement;
|
|
22
|
+
}
|
|
23
|
+
export interface SkeletonItemProps extends BaseProps, NativeProps {
|
|
24
|
+
/** 当前渲染 skeleton 类型 */
|
|
25
|
+
variant?: 'image' | 'circle' | 'rect';
|
|
26
|
+
isFirst?: boolean;
|
|
27
|
+
rowHeight?: number;
|
|
28
|
+
rowMargin?: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Table/Table.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ declare const ForwardTable: <RecordType extends object = any>(props: TableProps<
|
|
|
6
6
|
type InternalTableType = typeof ForwardTable;
|
|
7
7
|
interface TableInterface extends InternalTableType {
|
|
8
8
|
displayName?: string;
|
|
9
|
-
defaultProps?: Partial<TableProps<any>>;
|
|
10
9
|
}
|
|
11
10
|
declare const Table: TableInterface;
|
|
12
11
|
export default Table;
|
package/dist/Table/Table.js
CHANGED
|
@@ -39,4 +39,4 @@ export declare const activeRow: <T>(payload: T) => Action;
|
|
|
39
39
|
* @param payload
|
|
40
40
|
* @returns
|
|
41
41
|
*/
|
|
42
|
-
export declare const onCheck: <T>(payload: Pick<State<T>, "
|
|
42
|
+
export declare const onCheck: <T>(payload: Pick<State<T>, "selection" | "isIndeterminate">) => Action;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TooltipProps } from './typings';
|
|
3
|
-
declare const Tooltip:
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipProps, TooltipRef } from './typings';
|
|
3
|
+
declare const Tooltip: React.MemoExoticComponent<React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<TooltipRef>>>;
|
|
4
4
|
export default Tooltip;
|
package/dist/Tooltip/Tooltip.js
CHANGED
|
@@ -18,12 +18,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
18
18
|
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; }
|
|
19
19
|
import classNames from 'classnames';
|
|
20
20
|
import noop from 'lodash/noop';
|
|
21
|
-
import React, { Children, cloneElement, forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
|
21
|
+
import React, { Children, cloneElement, forwardRef, memo, useCallback, useImperativeHandle, useRef } from 'react';
|
|
22
22
|
import * as ReactIs from 'react-is';
|
|
23
|
-
import { partitionAnimationProps, partitionPopperPropsUtils, useClassNames, useControlled } from "../hooks";
|
|
24
23
|
import Popper from "../Popper/Popper";
|
|
24
|
+
import { partitionAnimationProps, partitionPopperPropsUtils, useClassNames, useControlled } from "../hooks";
|
|
25
25
|
import { TooltipContext } from "./TooltipContext";
|
|
26
|
-
var Tooltip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
|
+
var Tooltip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
27
27
|
var _props$classPrefix = props.classPrefix,
|
|
28
28
|
classPrefix = _props$classPrefix === void 0 ? 'tooltip' : _props$classPrefix,
|
|
29
29
|
_props$effect = props.effect,
|
|
@@ -37,7 +37,7 @@ var Tooltip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
37
37
|
_props$showAfter = props.showAfter,
|
|
38
38
|
showAfter = _props$showAfter === void 0 ? 0 : _props$showAfter,
|
|
39
39
|
_props$hideAfter = props.hideAfter,
|
|
40
|
-
hideAfter = _props$hideAfter === void 0 ?
|
|
40
|
+
hideAfter = _props$hideAfter === void 0 ? 100 : _props$hideAfter,
|
|
41
41
|
onMouseEnter = props.onMouseEnter,
|
|
42
42
|
onMouseLeave = props.onMouseLeave,
|
|
43
43
|
onEnter = props.onEnter,
|
|
@@ -194,6 +194,6 @@ var Tooltip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}, contentSlot !== null && contentSlot !== void 0 ? contentSlot : /*#__PURE__*/React.createElement("span", null, content))));
|
|
197
|
-
});
|
|
198
|
-
Tooltip.displayName = '
|
|
197
|
+
}));
|
|
198
|
+
Tooltip.displayName = 'ElTooltip';
|
|
199
199
|
export default Tooltip;
|