@fle-ui/next 1.0.5-alpha.4 → 1.0.5-alpha.5
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/@fle-ui/next.css +1859 -5161
- package/dist/@fle-ui/next.css.map +1 -1
- package/dist/@fle-ui/next.js +6349 -6355
- package/dist/@fle-ui/next.js.map +1 -1
- package/dist/@fle-ui/next.min.css +2 -2
- package/dist/@fle-ui/next.min.css.map +1 -1
- package/dist/@fle-ui/next.min.js +4 -4
- package/dist/@fle-ui/next.min.js.map +1 -1
- package/es/affix/style/index.css +0 -42
- package/es/alert/style/index.css +17 -59
- package/es/anchor/Anchor.d.ts +1 -1
- package/es/anchor/style/index.css +5 -47
- package/es/auto-complete/style/index.css +1 -43
- package/es/avatar/avatar.js +8 -4
- package/es/avatar/style/index.css +1 -43
- package/es/back-top/style/index.css +3 -45
- package/es/badge/style/index.css +23 -65
- package/es/breadcrumb/style/index.css +7 -49
- package/es/button/button.d.ts +1 -1
- package/es/button/button.js +11 -7
- package/es/button/style/index.css +156 -206
- package/es/calendar/style/index.css +8 -50
- package/es/card/style/index.css +17 -59
- package/es/carousel/style/index.css +1 -43
- package/es/cascader/index.d.ts +1 -1
- package/es/cascader/index.js +13 -9
- package/es/cascader/style/index.css +24 -66
- package/es/checkbox/Checkbox.js +8 -4
- package/es/checkbox/style/index.css +17 -59
- package/es/collapse/style/index.css +8 -50
- package/es/comment/style/index.css +5 -47
- package/es/config-provider/context.js +5 -1
- package/es/config-provider/style/index.css +0 -42
- package/es/date-picker/style/index.css +84 -126
- package/es/descriptions/style/index.css +8 -50
- package/es/divider/style/index.css +7 -49
- package/es/drawer/index.js +5 -1
- package/es/drawer/style/index.css +5 -47
- package/es/dropdown/style/index.css +17 -59
- package/es/empty/style/index.css +2 -44
- package/es/form/style/index.css +18 -60
- package/es/grid/col.js +5 -1
- package/es/grid/row.js +5 -1
- package/es/grid/style/index.css +0 -42
- package/es/icon/style/index.css +0 -42
- package/es/image/style/index.css +1 -43
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/input/Password.d.ts +1 -1
- package/es/input/Password.js +9 -5
- package/es/input/Search.js +9 -5
- package/es/input/style/index.css +65 -107
- package/es/input-number/index.js +1 -1
- package/es/input-number/style/index.css +68 -110
- package/es/layout/Sider.js +11 -7
- package/es/layout/layout.js +6 -2
- package/es/layout/style/index.css +4 -46
- package/es/list/style/index.css +17 -59
- package/es/locale-provider/index.d.ts +2 -2
- package/es/locale-provider/style/index.css +0 -42
- package/es/mentions/index.d.ts +1 -1
- package/es/mentions/index.js +8 -4
- package/es/mentions/style/index.css +32 -74
- package/es/menu/style/index.css +46 -88
- package/es/message/style/index.css +5 -47
- package/es/modal/style/confirm.less +2 -2
- package/es/modal/style/css.js +2 -1
- package/es/modal/style/index.css +3 -45
- package/es/modal/style/index.js +2 -1
- package/es/modal/style/index.less +0 -1
- package/es/modal/style/modal.less +1 -1
- package/es/modal/style/rtl.less +2 -1
- package/es/notification/style/index.css +8 -50
- package/es/page-header/style/index.css +6 -48
- package/es/pagination/style/index.css +99 -118
- package/es/pagination/style/index.less +63 -22
- package/es/popconfirm/style/index.css +0 -42
- package/es/popover/index.js +5 -1
- package/es/popover/style/index.css +17 -59
- package/es/progress/style/index.css +17 -59
- package/es/radio/radio.js +9 -5
- package/es/radio/style/index.css +49 -91
- package/es/rate/index.js +5 -1
- package/es/rate/style/index.css +2 -44
- package/es/result/style/index.css +6 -48
- package/es/segmented/index.d.ts +1 -1
- package/es/segmented/index.js +6 -2
- package/es/segmented/style/index.css +3 -45
- package/es/select/style/index.css +32 -74
- package/es/skeleton/style/index.css +10 -52
- package/es/skeleton/style/index.less +3 -3
- package/es/slider/index.d.ts +1 -1
- package/es/slider/index.js +8 -4
- package/es/slider/style/index.css +22 -56
- package/es/slider/style/index.less +9 -0
- package/es/space/style/index.css +0 -42
- package/es/spin/style/index.css +4 -46
- package/es/statistic/style/index.css +3 -45
- package/es/steps/style/index.css +44 -86
- package/es/style/color/colors.less +6 -6
- package/es/style/index.css +13 -55
- package/es/style/themes/compact.less +6 -12
- package/es/style/themes/dark.less +106 -445
- package/es/style/themes/default.less +35 -61
- package/es/style/themes/index.less +2 -3
- package/es/style/themes/variable.less +39 -80
- package/es/switch/index.js +10 -6
- package/es/switch/style/index.css +6 -48
- package/es/table/hooks/useFilter/FilterDropdown.js +2 -16
- package/es/table/style/index.css +35 -77
- package/es/table/util.d.ts +1 -1
- package/es/tabs/style/index.css +22 -64
- package/es/tag/index.d.ts +1 -1
- package/es/tag/index.js +8 -4
- package/es/tag/style/index.css +39 -81
- package/es/time-picker/index.js +5 -1
- package/es/time-picker/style/index.css +0 -42
- package/es/timeline/index.d.ts +2 -2
- package/es/timeline/style/index.css +15 -57
- package/es/tooltip/index.d.ts +3 -3
- package/es/tooltip/index.js +9 -5
- package/es/tooltip/style/index.css +12 -54
- package/es/transfer/index.d.ts +3 -3
- package/es/transfer/style/index.css +28 -70
- package/es/tree/DirectoryTree.js +5 -1
- package/es/tree/index.d.ts +2 -2
- package/es/tree/style/index.css +29 -71
- package/es/tree-select/style/index.css +27 -69
- package/es/typography/Typography.js +6 -2
- package/es/typography/style/index.css +24 -66
- package/es/upload/Dragger.js +5 -1
- package/es/upload/Upload.js +10 -6
- package/es/upload/UploadList/index.js +13 -9
- package/es/upload/index.d.ts +1 -1
- package/es/upload/style/index.css +23 -65
- package/lib/affix/style/index.css +0 -42
- package/lib/alert/style/index.css +17 -59
- package/lib/anchor/Anchor.d.ts +1 -1
- package/lib/anchor/style/index.css +5 -47
- package/lib/auto-complete/style/index.css +1 -43
- package/lib/avatar/avatar.js +9 -5
- package/lib/avatar/style/index.css +1 -43
- package/lib/back-top/style/index.css +3 -45
- package/lib/badge/style/index.css +23 -65
- package/lib/breadcrumb/style/index.css +7 -49
- package/lib/button/button.d.ts +1 -1
- package/lib/button/button.js +13 -9
- package/lib/button/style/index.css +156 -206
- package/lib/calendar/style/index.css +8 -50
- package/lib/card/style/index.css +17 -59
- package/lib/carousel/style/index.css +1 -43
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cascader/index.js +16 -12
- package/lib/cascader/style/index.css +24 -66
- package/lib/checkbox/Checkbox.js +10 -6
- package/lib/checkbox/style/index.css +17 -59
- package/lib/collapse/style/index.css +8 -50
- package/lib/comment/style/index.css +5 -47
- package/lib/config-provider/context.js +5 -1
- package/lib/config-provider/style/index.css +0 -42
- package/lib/date-picker/style/index.css +84 -126
- package/lib/descriptions/style/index.css +8 -50
- package/lib/divider/style/index.css +7 -49
- package/lib/drawer/index.js +5 -1
- package/lib/drawer/style/index.css +5 -47
- package/lib/dropdown/style/index.css +17 -59
- package/lib/empty/style/index.css +2 -44
- package/lib/form/style/index.css +18 -60
- package/lib/grid/col.js +5 -1
- package/lib/grid/row.js +5 -1
- package/lib/grid/style/index.css +0 -42
- package/lib/icon/style/index.css +0 -42
- package/lib/image/style/index.css +1 -43
- package/lib/index.d.ts +1 -2
- package/lib/index.js +0 -8
- package/lib/input/Password.d.ts +1 -1
- package/lib/input/Password.js +10 -6
- package/lib/input/Search.js +11 -7
- package/lib/input/style/index.css +65 -107
- package/lib/input-number/index.js +1 -1
- package/lib/input-number/style/index.css +68 -110
- package/lib/layout/Sider.js +13 -9
- package/lib/layout/layout.js +7 -3
- package/lib/layout/style/index.css +4 -46
- package/lib/list/style/index.css +17 -59
- package/lib/locale-provider/index.d.ts +2 -2
- package/lib/locale-provider/style/index.css +0 -42
- package/lib/mentions/index.d.ts +1 -1
- package/lib/mentions/index.js +10 -6
- package/lib/mentions/style/index.css +32 -74
- package/lib/menu/style/index.css +46 -88
- package/lib/message/style/index.css +5 -47
- package/lib/modal/style/confirm.less +2 -2
- package/lib/modal/style/index.css +3 -45
- package/lib/modal/style/index.less +0 -1
- package/lib/modal/style/modal.less +1 -1
- package/lib/modal/style/rtl.less +2 -1
- package/lib/notification/style/index.css +8 -50
- package/lib/page-header/style/index.css +6 -48
- package/lib/pagination/style/index.css +99 -118
- package/lib/pagination/style/index.less +63 -22
- package/lib/popconfirm/style/index.css +0 -42
- package/lib/popover/index.js +5 -1
- package/lib/popover/style/index.css +17 -59
- package/lib/progress/style/index.css +17 -59
- package/lib/radio/radio.js +11 -7
- package/lib/radio/style/index.css +49 -91
- package/lib/rate/index.js +5 -1
- package/lib/rate/style/index.css +2 -44
- package/lib/result/style/index.css +6 -48
- package/lib/segmented/index.d.ts +1 -1
- package/lib/segmented/index.js +7 -3
- package/lib/segmented/style/index.css +3 -45
- package/lib/select/style/index.css +32 -74
- package/lib/skeleton/style/index.css +10 -52
- package/lib/skeleton/style/index.less +3 -3
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +9 -5
- package/lib/slider/style/index.css +22 -56
- package/lib/slider/style/index.less +9 -0
- package/lib/space/style/index.css +0 -42
- package/lib/spin/style/index.css +4 -46
- package/lib/statistic/style/index.css +3 -45
- package/lib/steps/style/index.css +44 -86
- package/lib/style/color/colors.less +6 -6
- package/lib/style/index.css +13 -55
- package/lib/style/themes/compact.less +6 -12
- package/lib/style/themes/dark.less +106 -445
- package/lib/style/themes/default.less +35 -61
- package/lib/style/themes/index.less +2 -3
- package/lib/style/themes/variable.less +39 -80
- package/lib/switch/index.js +12 -8
- package/lib/switch/style/index.css +6 -48
- package/lib/table/hooks/useFilter/FilterDropdown.js +2 -16
- package/lib/table/style/index.css +35 -77
- package/lib/table/util.d.ts +1 -1
- package/lib/tabs/style/index.css +22 -64
- package/lib/tag/index.d.ts +1 -1
- package/lib/tag/index.js +9 -5
- package/lib/tag/style/index.css +39 -81
- package/lib/time-picker/index.js +5 -1
- package/lib/time-picker/style/index.css +0 -42
- package/lib/timeline/index.d.ts +2 -2
- package/lib/timeline/style/index.css +15 -57
- package/lib/tooltip/index.d.ts +3 -3
- package/lib/tooltip/index.js +11 -7
- package/lib/tooltip/style/index.css +12 -54
- package/lib/transfer/index.d.ts +3 -3
- package/lib/transfer/style/index.css +28 -70
- package/lib/tree/DirectoryTree.js +5 -1
- package/lib/tree/index.d.ts +2 -2
- package/lib/tree/style/index.css +29 -71
- package/lib/tree-select/style/index.css +27 -69
- package/lib/typography/Typography.js +7 -3
- package/lib/typography/style/index.css +24 -66
- package/lib/upload/Dragger.js +5 -1
- package/lib/upload/Upload.js +12 -8
- package/lib/upload/UploadList/index.js +16 -12
- package/lib/upload/index.d.ts +1 -1
- package/lib/upload/style/index.css +23 -65
- package/package.json +2 -2
- package/report.html +2 -2
- package/es/config-provider/renderEmpty.d.ts +0 -4
- package/es/config-provider/renderEmpty.js +0 -41
- package/es/pagination/MiniSelect.d.ts +0 -7
- package/es/pagination/MiniSelect.js +0 -12
- package/es/typography/util.d.ts +0 -11
- package/es/typography/util.js +0 -234
- package/es/version/index.d.ts +0 -2
- package/es/version/index.js +0 -4
- package/es/version/style/css.js +0 -2
- package/es/version/style/index.d.ts +0 -1
- package/es/version/style/index.js +0 -2
- package/es/version/version.d.ts +0 -2
- package/es/version/version.js +0 -1
- package/lib/config-provider/renderEmpty.d.ts +0 -4
- package/lib/config-provider/renderEmpty.js +0 -59
- package/lib/pagination/MiniSelect.d.ts +0 -7
- package/lib/pagination/MiniSelect.js +0 -30
- package/lib/typography/util.d.ts +0 -11
- package/lib/typography/util.js +0 -254
- package/lib/version/index.d.ts +0 -2
- package/lib/version/index.js +0 -15
- package/lib/version/style/css.js +0 -3
- package/lib/version/style/index.d.ts +0 -1
- package/lib/version/style/index.js +0 -3
- package/lib/version/version.d.ts +0 -2
- package/lib/version/version.js +0 -8
@@ -1,41 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: your name
|
3
|
-
* @Date: 2021-09-17 13:39:58
|
4
|
-
* @LastEditTime: 2021-09-17 13:40:08
|
5
|
-
* @LastEditors: your name
|
6
|
-
* @Description: In User Settings Edit
|
7
|
-
* @FilePath: /fle-ui-next/components/config-provider/renderEmpty.tsx
|
8
|
-
*/
|
9
|
-
import * as React from 'react';
|
10
|
-
import Empty from '../empty';
|
11
|
-
import { ConfigConsumer } from '.';
|
12
|
-
|
13
|
-
var renderEmpty = function renderEmpty(componentName) {
|
14
|
-
return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {
|
15
|
-
var getPrefixCls = _ref.getPrefixCls;
|
16
|
-
var prefix = getPrefixCls('empty');
|
17
|
-
|
18
|
-
switch (componentName) {
|
19
|
-
case 'Table':
|
20
|
-
case 'List':
|
21
|
-
return /*#__PURE__*/React.createElement(Empty, {
|
22
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE
|
23
|
-
});
|
24
|
-
|
25
|
-
case 'Select':
|
26
|
-
case 'TreeSelect':
|
27
|
-
case 'Cascader':
|
28
|
-
case 'Transfer':
|
29
|
-
case 'Mentions':
|
30
|
-
return /*#__PURE__*/React.createElement(Empty, {
|
31
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
32
|
-
className: "".concat(prefix, "-small")
|
33
|
-
});
|
34
|
-
|
35
|
-
default:
|
36
|
-
return /*#__PURE__*/React.createElement(Empty, null);
|
37
|
-
}
|
38
|
-
});
|
39
|
-
};
|
40
|
-
|
41
|
-
export default renderEmpty;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import * as React from 'react';
|
3
|
-
import Select from '../select';
|
4
|
-
|
5
|
-
var MiniSelect = function MiniSelect(props) {
|
6
|
-
return /*#__PURE__*/React.createElement(Select, _extends({
|
7
|
-
size: "small"
|
8
|
-
}, props));
|
9
|
-
};
|
10
|
-
|
11
|
-
MiniSelect.Option = Select.Option;
|
12
|
-
export default MiniSelect;
|
package/es/typography/util.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
interface Option {
|
3
|
-
rows: number;
|
4
|
-
suffix?: string;
|
5
|
-
}
|
6
|
-
declare const _default: (originElement: HTMLElement, option: Option, content: React.ReactNode, fixedContent: React.ReactNode[], ellipsisStr: string) => {
|
7
|
-
content: React.ReactNode;
|
8
|
-
text: string;
|
9
|
-
ellipsis: boolean;
|
10
|
-
};
|
11
|
-
export default _default;
|
package/es/typography/util.js
DELETED
@@ -1,234 +0,0 @@
|
|
1
|
-
import { render, unmountComponentAtNode } from 'react-dom';
|
2
|
-
import * as React from 'react';
|
3
|
-
import toArray from "rc-util/es/Children/toArray"; // We only handle element & text node.
|
4
|
-
|
5
|
-
var ELEMENT_NODE = 1;
|
6
|
-
var TEXT_NODE = 3;
|
7
|
-
var COMMENT_NODE = 8;
|
8
|
-
var ellipsisContainer;
|
9
|
-
var wrapperStyle = {
|
10
|
-
padding: 0,
|
11
|
-
margin: 0,
|
12
|
-
display: 'inline',
|
13
|
-
lineHeight: 'inherit'
|
14
|
-
};
|
15
|
-
|
16
|
-
function pxToNumber(value) {
|
17
|
-
if (!value) {
|
18
|
-
return 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
var match = value.match(/^\d*(\.\d*)?/);
|
22
|
-
return match ? Number(match[0]) : 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
function styleToString(style) {
|
26
|
-
// There are some different behavior between Firefox & Chrome.
|
27
|
-
// We have to handle this ourself.
|
28
|
-
var styleNames = Array.prototype.slice.apply(style);
|
29
|
-
return styleNames.map(function (name) {
|
30
|
-
return "".concat(name, ": ").concat(style.getPropertyValue(name), ";");
|
31
|
-
}).join('');
|
32
|
-
}
|
33
|
-
|
34
|
-
function mergeChildren(children) {
|
35
|
-
var childList = [];
|
36
|
-
children.forEach(function (child) {
|
37
|
-
var prevChild = childList[childList.length - 1];
|
38
|
-
|
39
|
-
if (typeof child === 'string' && typeof prevChild === 'string') {
|
40
|
-
childList[childList.length - 1] += child;
|
41
|
-
} else {
|
42
|
-
childList.push(child);
|
43
|
-
}
|
44
|
-
});
|
45
|
-
return childList;
|
46
|
-
}
|
47
|
-
|
48
|
-
function resetDomStyles(target, origin) {
|
49
|
-
target.setAttribute('aria-hidden', 'true');
|
50
|
-
var originStyle = window.getComputedStyle(origin);
|
51
|
-
var originCSS = styleToString(originStyle); // Set shadow
|
52
|
-
|
53
|
-
target.setAttribute('style', originCSS);
|
54
|
-
target.style.position = 'fixed';
|
55
|
-
target.style.left = '0';
|
56
|
-
target.style.height = 'auto';
|
57
|
-
target.style.minHeight = 'auto';
|
58
|
-
target.style.maxHeight = 'auto';
|
59
|
-
target.style.top = '-999999px';
|
60
|
-
target.style.zIndex = '-1000'; // clean up css overflow
|
61
|
-
|
62
|
-
target.style.textOverflow = 'clip';
|
63
|
-
target.style.whiteSpace = 'normal';
|
64
|
-
target.style.webkitLineClamp = 'none';
|
65
|
-
}
|
66
|
-
|
67
|
-
function getRealLineHeight(originElement) {
|
68
|
-
var heightContainer = document.createElement('div');
|
69
|
-
resetDomStyles(heightContainer, originElement);
|
70
|
-
heightContainer.appendChild(document.createTextNode('text'));
|
71
|
-
document.body.appendChild(heightContainer);
|
72
|
-
var offsetHeight = heightContainer.offsetHeight;
|
73
|
-
var lineHeight = pxToNumber(window.getComputedStyle(originElement).lineHeight);
|
74
|
-
document.body.removeChild(heightContainer);
|
75
|
-
return offsetHeight > lineHeight ? offsetHeight : lineHeight;
|
76
|
-
}
|
77
|
-
|
78
|
-
export default (function (originElement, option, content, fixedContent, ellipsisStr) {
|
79
|
-
if (!ellipsisContainer) {
|
80
|
-
ellipsisContainer = document.createElement('div');
|
81
|
-
ellipsisContainer.setAttribute('aria-hidden', 'true');
|
82
|
-
} // HMR will remove this from body which should patch back
|
83
|
-
|
84
|
-
|
85
|
-
if (!ellipsisContainer.parentNode) {
|
86
|
-
document.body.appendChild(ellipsisContainer);
|
87
|
-
}
|
88
|
-
|
89
|
-
var rows = option.rows,
|
90
|
-
_option$suffix = option.suffix,
|
91
|
-
suffix = _option$suffix === void 0 ? '' : _option$suffix; // Get origin style
|
92
|
-
|
93
|
-
var originStyle = window.getComputedStyle(originElement);
|
94
|
-
var lineHeight = getRealLineHeight(originElement);
|
95
|
-
var maxHeight = Math.floor(lineHeight) * (rows + 1) + pxToNumber(originStyle.paddingTop) + pxToNumber(originStyle.paddingBottom);
|
96
|
-
resetDomStyles(ellipsisContainer, originElement); // Render in the fake container
|
97
|
-
|
98
|
-
var contentList = mergeChildren(toArray(content));
|
99
|
-
render( /*#__PURE__*/React.createElement("div", {
|
100
|
-
style: wrapperStyle
|
101
|
-
}, /*#__PURE__*/React.createElement("span", {
|
102
|
-
style: wrapperStyle
|
103
|
-
}, contentList, suffix), /*#__PURE__*/React.createElement("span", {
|
104
|
-
style: wrapperStyle
|
105
|
-
}, fixedContent)), ellipsisContainer); // wrap in an div for old version react
|
106
|
-
// Check if ellipsis in measure div is height enough for content
|
107
|
-
|
108
|
-
function inRange() {
|
109
|
-
return Math.ceil(ellipsisContainer.getBoundingClientRect().height) < maxHeight;
|
110
|
-
} // Skip ellipsis if already match
|
111
|
-
|
112
|
-
|
113
|
-
if (inRange()) {
|
114
|
-
unmountComponentAtNode(ellipsisContainer);
|
115
|
-
return {
|
116
|
-
content: content,
|
117
|
-
text: ellipsisContainer.innerHTML,
|
118
|
-
ellipsis: false
|
119
|
-
};
|
120
|
-
} // We should clone the childNode since they're controlled by React and we can't reuse it without warning
|
121
|
-
|
122
|
-
|
123
|
-
var childNodes = Array.prototype.slice.apply(ellipsisContainer.childNodes[0].childNodes[0].cloneNode(true).childNodes).filter(function (_ref) {
|
124
|
-
var nodeType = _ref.nodeType;
|
125
|
-
return nodeType !== COMMENT_NODE;
|
126
|
-
});
|
127
|
-
var fixedNodes = Array.prototype.slice.apply(ellipsisContainer.childNodes[0].childNodes[1].cloneNode(true).childNodes);
|
128
|
-
unmountComponentAtNode(ellipsisContainer); // ========================= Find match ellipsis content =========================
|
129
|
-
|
130
|
-
var ellipsisChildren = [];
|
131
|
-
ellipsisContainer.innerHTML = ''; // Create origin content holder
|
132
|
-
|
133
|
-
var ellipsisContentHolder = document.createElement('span');
|
134
|
-
ellipsisContainer.appendChild(ellipsisContentHolder);
|
135
|
-
var ellipsisTextNode = document.createTextNode(ellipsisStr + suffix);
|
136
|
-
ellipsisContentHolder.appendChild(ellipsisTextNode);
|
137
|
-
fixedNodes.forEach(function (childNode) {
|
138
|
-
ellipsisContainer.appendChild(childNode);
|
139
|
-
}); // Append before fixed nodes
|
140
|
-
|
141
|
-
function appendChildNode(node) {
|
142
|
-
ellipsisContentHolder.insertBefore(node, ellipsisTextNode);
|
143
|
-
} // Get maximum text
|
144
|
-
|
145
|
-
|
146
|
-
function measureText(textNode, fullText) {
|
147
|
-
var startLoc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
148
|
-
var endLoc = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fullText.length;
|
149
|
-
var lastSuccessLoc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
150
|
-
var midLoc = Math.floor((startLoc + endLoc) / 2);
|
151
|
-
var currentText = fullText.slice(0, midLoc);
|
152
|
-
textNode.textContent = currentText;
|
153
|
-
|
154
|
-
if (startLoc >= endLoc - 1) {
|
155
|
-
// Loop when step is small
|
156
|
-
for (var step = endLoc; step >= startLoc; step -= 1) {
|
157
|
-
var currentStepText = fullText.slice(0, step);
|
158
|
-
textNode.textContent = currentStepText;
|
159
|
-
|
160
|
-
if (inRange() || !currentStepText) {
|
161
|
-
return step === fullText.length ? {
|
162
|
-
finished: false,
|
163
|
-
reactNode: fullText
|
164
|
-
} : {
|
165
|
-
finished: true,
|
166
|
-
reactNode: currentStepText
|
167
|
-
};
|
168
|
-
}
|
169
|
-
}
|
170
|
-
}
|
171
|
-
|
172
|
-
if (inRange()) {
|
173
|
-
return measureText(textNode, fullText, midLoc, endLoc, midLoc);
|
174
|
-
}
|
175
|
-
|
176
|
-
return measureText(textNode, fullText, startLoc, midLoc, lastSuccessLoc);
|
177
|
-
}
|
178
|
-
|
179
|
-
function measureNode(childNode, index) {
|
180
|
-
var type = childNode.nodeType;
|
181
|
-
|
182
|
-
if (type === ELEMENT_NODE) {
|
183
|
-
// We don't split element, it will keep if whole element can be displayed.
|
184
|
-
appendChildNode(childNode);
|
185
|
-
|
186
|
-
if (inRange()) {
|
187
|
-
return {
|
188
|
-
finished: false,
|
189
|
-
reactNode: contentList[index]
|
190
|
-
};
|
191
|
-
} // Clean up if can not pull in
|
192
|
-
|
193
|
-
|
194
|
-
ellipsisContentHolder.removeChild(childNode);
|
195
|
-
return {
|
196
|
-
finished: true,
|
197
|
-
reactNode: null
|
198
|
-
};
|
199
|
-
}
|
200
|
-
|
201
|
-
if (type === TEXT_NODE) {
|
202
|
-
var fullText = childNode.textContent || '';
|
203
|
-
var textNode = document.createTextNode(fullText);
|
204
|
-
appendChildNode(textNode);
|
205
|
-
return measureText(textNode, fullText);
|
206
|
-
} // Not handle other type of content
|
207
|
-
// PS: This code should not be attached after react 16
|
208
|
-
|
209
|
-
/* istanbul ignore next */
|
210
|
-
|
211
|
-
|
212
|
-
return {
|
213
|
-
finished: false,
|
214
|
-
reactNode: null
|
215
|
-
};
|
216
|
-
}
|
217
|
-
|
218
|
-
childNodes.some(function (childNode, index) {
|
219
|
-
var _measureNode = measureNode(childNode, index),
|
220
|
-
finished = _measureNode.finished,
|
221
|
-
reactNode = _measureNode.reactNode;
|
222
|
-
|
223
|
-
if (reactNode) {
|
224
|
-
ellipsisChildren.push(reactNode);
|
225
|
-
}
|
226
|
-
|
227
|
-
return finished;
|
228
|
-
});
|
229
|
-
return {
|
230
|
-
content: ellipsisChildren,
|
231
|
-
text: ellipsisContainer.innerHTML,
|
232
|
-
ellipsis: true
|
233
|
-
};
|
234
|
-
});
|
package/es/version/index.d.ts
DELETED
package/es/version/index.js
DELETED
package/es/version/style/css.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import '../../style/index.less';
|
package/es/version/version.d.ts
DELETED
package/es/version/version.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export default '4.17.0-alpha.3';
|
@@ -1,59 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
-
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
8
|
-
value: true
|
9
|
-
});
|
10
|
-
exports["default"] = void 0;
|
11
|
-
|
12
|
-
var React = _interopRequireWildcard(require("react"));
|
13
|
-
|
14
|
-
var _empty = _interopRequireDefault(require("../empty"));
|
15
|
-
|
16
|
-
var _ = require(".");
|
17
|
-
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
-
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
-
|
22
|
-
/*
|
23
|
-
* @Author: your name
|
24
|
-
* @Date: 2021-09-17 13:39:58
|
25
|
-
* @LastEditTime: 2021-09-17 13:40:08
|
26
|
-
* @LastEditors: your name
|
27
|
-
* @Description: In User Settings Edit
|
28
|
-
* @FilePath: /fle-ui-next/components/config-provider/renderEmpty.tsx
|
29
|
-
*/
|
30
|
-
var renderEmpty = function renderEmpty(componentName) {
|
31
|
-
return /*#__PURE__*/React.createElement(_.ConfigConsumer, null, function (_ref) {
|
32
|
-
var getPrefixCls = _ref.getPrefixCls;
|
33
|
-
var prefix = getPrefixCls('empty');
|
34
|
-
|
35
|
-
switch (componentName) {
|
36
|
-
case 'Table':
|
37
|
-
case 'List':
|
38
|
-
return /*#__PURE__*/React.createElement(_empty["default"], {
|
39
|
-
image: _empty["default"].PRESENTED_IMAGE_SIMPLE
|
40
|
-
});
|
41
|
-
|
42
|
-
case 'Select':
|
43
|
-
case 'TreeSelect':
|
44
|
-
case 'Cascader':
|
45
|
-
case 'Transfer':
|
46
|
-
case 'Mentions':
|
47
|
-
return /*#__PURE__*/React.createElement(_empty["default"], {
|
48
|
-
image: _empty["default"].PRESENTED_IMAGE_SIMPLE,
|
49
|
-
className: "".concat(prefix, "-small")
|
50
|
-
});
|
51
|
-
|
52
|
-
default:
|
53
|
-
return /*#__PURE__*/React.createElement(_empty["default"], null);
|
54
|
-
}
|
55
|
-
});
|
56
|
-
};
|
57
|
-
|
58
|
-
var _default = renderEmpty;
|
59
|
-
exports["default"] = _default;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
-
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
8
|
-
value: true
|
9
|
-
});
|
10
|
-
exports["default"] = void 0;
|
11
|
-
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
|
-
|
14
|
-
var React = _interopRequireWildcard(require("react"));
|
15
|
-
|
16
|
-
var _select = _interopRequireDefault(require("../select"));
|
17
|
-
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
-
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
-
|
22
|
-
var MiniSelect = function MiniSelect(props) {
|
23
|
-
return /*#__PURE__*/React.createElement(_select["default"], (0, _extends2["default"])({
|
24
|
-
size: "small"
|
25
|
-
}, props));
|
26
|
-
};
|
27
|
-
|
28
|
-
MiniSelect.Option = _select["default"].Option;
|
29
|
-
var _default = MiniSelect;
|
30
|
-
exports["default"] = _default;
|
package/lib/typography/util.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
interface Option {
|
3
|
-
rows: number;
|
4
|
-
suffix?: string;
|
5
|
-
}
|
6
|
-
declare const _default: (originElement: HTMLElement, option: Option, content: React.ReactNode, fixedContent: React.ReactNode[], ellipsisStr: string) => {
|
7
|
-
content: React.ReactNode;
|
8
|
-
text: string;
|
9
|
-
ellipsis: boolean;
|
10
|
-
};
|
11
|
-
export default _default;
|