linkmore-design 1.0.62 → 1.0.63
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/AutoComplete/demos/basic.d.ts +3 -0
- package/dist/AutoComplete/index.d.ts +30 -0
- package/dist/AutoComplete/style/index.d.ts +1 -0
- package/dist/Avatar/demos/basic.d.ts +2 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/style/index.d.ts +1 -0
- package/dist/Breadcrumb/demos/basic.d.ts +2 -0
- package/dist/Breadcrumb/demos/basic1.d.ts +2 -0
- package/dist/Breadcrumb/index.d.ts +4 -0
- package/dist/Breadcrumb/style/index.d.ts +1 -0
- package/dist/CardTable/utils.d.ts +1 -1
- package/dist/Col/demos/basic.d.ts +2 -0
- package/dist/Col/index.d.ts +3 -0
- package/dist/Col/style/index.d.ts +1 -0
- package/dist/Form/index.d.ts +1 -1
- package/dist/Grid/RowContext.d.ts +8 -0
- package/dist/Grid/col.d.ts +28 -0
- package/dist/Grid/demos/basic.d.ts +2 -0
- package/dist/Grid/hooks/useBreakpoint.d.ts +3 -0
- package/dist/Grid/index.d.ts +11 -0
- package/dist/Grid/row.d.ts +14 -0
- package/dist/Grid/style/index.d.ts +1 -0
- package/dist/Layout/demos/basic.d.ts +2 -0
- package/dist/Layout/index.d.ts +4 -0
- package/dist/Layout/style/index.d.ts +1 -0
- package/dist/LmEditTable/EditTable.d.ts +2 -0
- package/dist/LmEditTable/demos/colsort.d.ts +2 -0
- package/dist/LmEditTable/demos/size.d.ts +2 -0
- package/dist/LmEditTable/sortableBoxCol.d.ts +5 -0
- package/dist/LmEditTable/sortableItemCol.d.ts +1 -0
- package/dist/LmFilter/components/CustomSelectFilter.d.ts +4 -0
- package/dist/LmFilter/filterFns/index.d.ts +27 -17
- package/dist/LmFilter/utils.d.ts +2 -0
- package/dist/PageHeader/demos/basic.d.ts +2 -0
- package/dist/PageHeader/index.d.ts +24 -0
- package/dist/PageHeader/style/index.d.ts +1 -0
- package/dist/Popover/demos/basic.d.ts +2 -0
- package/dist/Popover/demos/basic1.d.ts +2 -0
- package/dist/Popover/index.d.ts +11 -0
- package/dist/Popover/style/index.d.ts +1 -0
- package/dist/Row/demos/basic.d.ts +2 -0
- package/dist/Row/index.d.ts +3 -0
- package/dist/Row/style/index.d.ts +1 -0
- package/dist/Tooltip/index.d.ts +43 -1
- package/dist/Typography/Base/Ellipsis.d.ts +14 -0
- package/dist/Typography/Base/EllipsisTooltip.d.ts +13 -0
- package/dist/Typography/Base/index.d.ts +54 -0
- package/dist/Typography/Editable.d.ts +20 -0
- package/dist/Typography/Link.d.ts +7 -0
- package/dist/Typography/Paragraph.d.ts +7 -0
- package/dist/Typography/Text.d.ts +8 -0
- package/dist/Typography/Title.d.ts +9 -0
- package/dist/Typography/Typography.d.ts +11 -0
- package/dist/Typography/demos/basic.d.ts +2 -0
- package/dist/Typography/hooks/useMergedConfig.d.ts +1 -0
- package/dist/Typography/hooks/useUpdatedEffect.d.ts +3 -0
- package/dist/Typography/index.d.ts +15 -0
- package/dist/Typography/style/index.d.ts +1 -0
- package/dist/_util/colors.d.ts +5 -0
- package/dist/_util/getRenderPropValue.d.ts +3 -0
- package/dist/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/dist/_util/hooks/useForceUpdate.d.ts +2 -0
- package/dist/_util/placements.d.ts +16 -0
- package/dist/_util/responsiveObserve.d.ts +21 -0
- package/dist/_util/styleChecker.d.ts +4 -0
- package/dist/_util/transButton.d.ts +9 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.umd.js +17359 -8951
- package/dist/index.umd.min.js +6 -6
- package/es/AutoComplete/index.d.ts +30 -0
- package/es/AutoComplete/index.js +101 -0
- package/es/AutoComplete/style/index.css +505 -0
- package/es/AutoComplete/style/index.d.ts +1 -0
- package/es/AutoComplete/style/index.js +1 -0
- package/es/Avatar/index.d.ts +3 -0
- package/es/Avatar/index.js +3 -0
- package/es/Avatar/style/index.css +505 -0
- package/es/Avatar/style/index.d.ts +1 -0
- package/es/Avatar/style/index.js +1 -0
- package/es/Breadcrumb/index.d.ts +4 -0
- package/es/Breadcrumb/index.js +3 -0
- package/es/Breadcrumb/style/index.css +505 -0
- package/es/Breadcrumb/style/index.d.ts +1 -0
- package/es/Breadcrumb/style/index.js +1 -0
- package/es/Col/README.md.old +22 -0
- package/es/Col/index.d.ts +3 -0
- package/es/Col/index.js +2 -0
- package/es/Col/style/index.css +505 -0
- package/es/Col/style/index.d.ts +1 -0
- package/es/Col/style/index.js +1 -0
- package/es/Form/index.d.ts +1 -1
- package/es/Form/style/index.css +14 -14
- package/es/Grid/RowContext.d.ts +8 -0
- package/es/Grid/RowContext.js +3 -0
- package/es/Grid/col.d.ts +28 -0
- package/es/Grid/col.js +112 -0
- package/es/Grid/hooks/useBreakpoint.d.ts +3 -0
- package/es/Grid/hooks/useBreakpoint.js +24 -0
- package/es/Grid/index.d.ts +11 -0
- package/es/Grid/index.js +14 -0
- package/es/Grid/row.d.ts +14 -0
- package/es/Grid/row.js +142 -0
- package/es/Grid/style/index.css +505 -0
- package/es/Grid/style/index.d.ts +1 -0
- package/es/Grid/style/index.js +1 -0
- package/es/Layout/index.d.ts +4 -0
- package/es/Layout/index.js +3 -0
- package/es/Layout/style/index.css +505 -0
- package/es/Layout/style/index.d.ts +1 -0
- package/es/Layout/style/index.js +1 -0
- package/es/LmEditTable/EditTable.d.ts +2 -0
- package/es/LmEditTable/EditTable.js +170 -52
- package/es/LmEditTable/sortableBoxCol.d.ts +5 -0
- package/es/LmEditTable/sortableBoxCol.js +13 -0
- package/es/LmEditTable/sortableItemCol.d.ts +1 -0
- package/es/LmEditTable/sortableItemCol.js +48 -0
- package/es/LmFilter/{icon_placeholder.png → assets/empty.png} +0 -0
- package/es/LmFilter/clearFilter/index.js +3 -5
- package/es/LmFilter/complexFilter/drawer.js +24 -4
- package/es/LmFilter/components/CheckboxFilter.js +1 -1
- package/es/LmFilter/components/CustomSelectFilter.js +128 -0
- package/es/LmFilter/components/EmptyFilter.js +2 -2
- package/es/LmFilter/components/SelectFilter.js +1 -1
- package/es/LmFilter/customFilter/index.js +75 -2
- package/es/LmFilter/filterFns/index.js +181 -66
- package/es/LmFilter/style/style.css +49 -5
- package/es/LmFilter/utils.js +34 -0
- package/es/LmFilter/wrapper/FilterRoot.js +16 -48
- package/es/PageHeader/index.d.ts +24 -0
- package/es/PageHeader/index.js +169 -0
- package/es/PageHeader/style/index.css +505 -0
- package/es/PageHeader/style/index.d.ts +1 -0
- package/es/PageHeader/style/index.js +1 -0
- package/es/Popover/index.d.ts +11 -0
- package/es/Popover/index.js +63 -0
- package/es/Popover/style/index.css +505 -0
- package/es/Popover/style/index.d.ts +1 -0
- package/es/Popover/style/index.js +1 -0
- package/es/Row/README.md.old +22 -0
- package/es/Row/index.d.ts +3 -0
- package/es/Row/index.js +2 -0
- package/es/Row/style/index.css +505 -0
- package/es/Row/style/index.d.ts +1 -0
- package/es/Row/style/index.js +1 -0
- package/es/Tooltip/index.d.ts +43 -1
- package/es/Tooltip/index.js +236 -1
- package/es/Typography/Base/Ellipsis.d.ts +14 -0
- package/es/Typography/Base/Ellipsis.js +197 -0
- package/es/Typography/Base/EllipsisTooltip.d.ts +13 -0
- package/es/Typography/Base/EllipsisTooltip.js +23 -0
- package/es/Typography/Base/index.d.ts +54 -0
- package/es/Typography/Base/index.js +509 -0
- package/es/Typography/Editable.d.ts +20 -0
- package/es/Typography/Editable.js +117 -0
- package/es/Typography/Link.d.ts +7 -0
- package/es/Typography/Link.js +43 -0
- package/es/Typography/Paragraph.d.ts +7 -0
- package/es/Typography/Paragraph.js +12 -0
- package/es/Typography/Text.d.ts +8 -0
- package/es/Typography/Text.js +41 -0
- package/es/Typography/Title.d.ts +9 -0
- package/es/Typography/Title.js +41 -0
- package/es/Typography/Typography.d.ts +11 -0
- package/es/Typography/Typography.js +61 -0
- package/es/Typography/hooks/useMergedConfig.d.ts +1 -0
- package/es/Typography/hooks/useMergedConfig.js +8 -0
- package/es/Typography/hooks/useUpdatedEffect.d.ts +3 -0
- package/es/Typography/hooks/useUpdatedEffect.js +13 -0
- package/es/Typography/index.d.ts +15 -0
- package/es/Typography/index.js +14 -0
- package/es/Typography/style/index.css +505 -0
- package/es/Typography/style/index.d.ts +1 -0
- package/es/Typography/style/index.js +1 -0
- package/es/_util/colors.d.ts +5 -0
- package/es/_util/colors.js +4 -0
- package/es/_util/getRenderPropValue.d.ts +3 -0
- package/es/_util/getRenderPropValue.js +13 -0
- package/es/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/es/_util/hooks/useFlexGapSupport.js +14 -0
- package/es/_util/hooks/useForceUpdate.d.ts +2 -0
- package/es/_util/hooks/useForceUpdate.js +11 -0
- package/es/_util/placements.d.ts +16 -0
- package/es/_util/placements.js +87 -0
- package/es/_util/responsiveObserve.d.ts +21 -0
- package/es/_util/responsiveObserve.js +66 -0
- package/es/_util/styleChecker.d.ts +4 -0
- package/es/_util/styleChecker.js +31 -0
- package/es/_util/transButton.d.ts +9 -0
- package/es/_util/transButton.js +73 -0
- package/es/index.d.ts +14 -0
- package/es/index.js +8 -1
- package/lib/AutoComplete/index.d.ts +30 -0
- package/lib/AutoComplete/index.js +125 -0
- package/lib/AutoComplete/style/index.css +505 -0
- package/lib/AutoComplete/style/index.d.ts +1 -0
- package/lib/AutoComplete/style/index.js +3 -0
- package/lib/Avatar/index.d.ts +3 -0
- package/lib/Avatar/index.js +15 -0
- package/lib/Avatar/style/index.css +505 -0
- package/lib/Avatar/style/index.d.ts +1 -0
- package/lib/Avatar/style/index.js +3 -0
- package/lib/Breadcrumb/index.d.ts +4 -0
- package/lib/Breadcrumb/index.js +15 -0
- package/lib/Breadcrumb/style/index.css +505 -0
- package/lib/Breadcrumb/style/index.d.ts +1 -0
- package/lib/Breadcrumb/style/index.js +3 -0
- package/lib/Col/README.md.old +22 -0
- package/lib/Col/index.d.ts +3 -0
- package/lib/Col/index.js +11 -0
- package/lib/Col/style/index.css +505 -0
- package/lib/Col/style/index.d.ts +1 -0
- package/lib/Col/style/index.js +3 -0
- package/lib/Form/index.d.ts +1 -1
- package/lib/Form/style/index.css +14 -14
- package/lib/Grid/RowContext.d.ts +8 -0
- package/lib/Grid/RowContext.js +12 -0
- package/lib/Grid/col.d.ts +28 -0
- package/lib/Grid/col.js +128 -0
- package/lib/Grid/hooks/useBreakpoint.d.ts +3 -0
- package/lib/Grid/hooks/useBreakpoint.js +37 -0
- package/lib/Grid/index.d.ts +11 -0
- package/lib/Grid/index.js +45 -0
- package/lib/Grid/row.d.ts +14 -0
- package/lib/Grid/row.js +164 -0
- package/lib/Grid/style/index.css +505 -0
- package/lib/Grid/style/index.d.ts +1 -0
- package/lib/Grid/style/index.js +3 -0
- package/lib/Layout/index.d.ts +4 -0
- package/lib/Layout/index.js +15 -0
- package/lib/Layout/style/index.css +505 -0
- package/lib/Layout/style/index.d.ts +1 -0
- package/lib/Layout/style/index.js +3 -0
- package/lib/LmEditTable/EditTable.d.ts +2 -0
- package/lib/LmEditTable/EditTable.js +171 -53
- package/lib/LmEditTable/sortableBoxCol.d.ts +5 -0
- package/lib/LmEditTable/sortableBoxCol.js +24 -0
- package/lib/LmEditTable/sortableItemCol.d.ts +1 -0
- package/lib/LmEditTable/sortableItemCol.js +61 -0
- package/lib/LmFilter/{icon_placeholder.png → assets/empty.png} +0 -0
- package/lib/LmFilter/clearFilter/index.js +3 -5
- package/lib/LmFilter/complexFilter/drawer.js +24 -4
- package/lib/LmFilter/components/CheckboxFilter.js +1 -1
- package/lib/LmFilter/components/CustomSelectFilter.js +128 -0
- package/lib/LmFilter/components/EmptyFilter.js +2 -2
- package/lib/LmFilter/components/SelectFilter.js +1 -1
- package/lib/LmFilter/customFilter/index.js +75 -2
- package/lib/LmFilter/filterFns/index.js +181 -66
- package/lib/LmFilter/style/style.css +49 -5
- package/lib/LmFilter/utils.js +34 -0
- package/lib/LmFilter/wrapper/FilterRoot.js +16 -48
- package/lib/PageHeader/index.d.ts +24 -0
- package/lib/PageHeader/index.js +194 -0
- package/lib/PageHeader/style/index.css +505 -0
- package/lib/PageHeader/style/index.d.ts +1 -0
- package/lib/PageHeader/style/index.js +3 -0
- package/lib/Popover/index.d.ts +11 -0
- package/lib/Popover/index.js +81 -0
- package/lib/Popover/style/index.css +505 -0
- package/lib/Popover/style/index.d.ts +1 -0
- package/lib/Popover/style/index.js +3 -0
- package/lib/Row/README.md.old +22 -0
- package/lib/Row/index.d.ts +3 -0
- package/lib/Row/index.js +11 -0
- package/lib/Row/style/index.css +505 -0
- package/lib/Row/style/index.d.ts +1 -0
- package/lib/Row/style/index.js +3 -0
- package/lib/Tooltip/index.d.ts +43 -1
- package/lib/Tooltip/index.js +247 -1
- package/lib/Typography/Base/Ellipsis.d.ts +14 -0
- package/lib/Typography/Base/Ellipsis.js +212 -0
- package/lib/Typography/Base/EllipsisTooltip.d.ts +13 -0
- package/lib/Typography/Base/EllipsisTooltip.js +36 -0
- package/lib/Typography/Base/index.d.ts +54 -0
- package/lib/Typography/Base/index.js +545 -0
- package/lib/Typography/Editable.d.ts +20 -0
- package/lib/Typography/Editable.js +137 -0
- package/lib/Typography/Link.d.ts +7 -0
- package/lib/Typography/Link.js +58 -0
- package/lib/Typography/Paragraph.d.ts +7 -0
- package/lib/Typography/Paragraph.js +26 -0
- package/lib/Typography/Text.d.ts +8 -0
- package/lib/Typography/Text.js +57 -0
- package/lib/Typography/Title.d.ts +9 -0
- package/lib/Typography/Title.js +58 -0
- package/lib/Typography/Typography.d.ts +11 -0
- package/lib/Typography/Typography.js +77 -0
- package/lib/Typography/hooks/useMergedConfig.d.ts +1 -0
- package/lib/Typography/hooks/useMergedConfig.js +21 -0
- package/lib/Typography/hooks/useUpdatedEffect.d.ts +3 -0
- package/lib/Typography/hooks/useUpdatedEffect.js +24 -0
- package/lib/Typography/index.d.ts +15 -0
- package/lib/Typography/index.js +31 -0
- package/lib/Typography/style/index.css +505 -0
- package/lib/Typography/style/index.d.ts +1 -0
- package/lib/Typography/style/index.js +3 -0
- package/lib/_util/colors.d.ts +5 -0
- package/lib/_util/colors.js +14 -0
- package/lib/_util/getRenderPropValue.d.ts +3 -0
- package/lib/_util/getRenderPropValue.js +22 -0
- package/lib/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/lib/_util/hooks/useFlexGapSupport.js +30 -0
- package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
- package/lib/_util/hooks/useForceUpdate.js +24 -0
- package/lib/_util/placements.d.ts +16 -0
- package/lib/_util/placements.js +98 -0
- package/lib/_util/responsiveObserve.d.ts +21 -0
- package/lib/_util/responsiveObserve.js +79 -0
- package/lib/_util/styleChecker.d.ts +4 -0
- package/lib/_util/styleChecker.js +52 -0
- package/lib/_util/transButton.d.ts +9 -0
- package/lib/_util/transButton.js +87 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +57 -1
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
export var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
3
|
+
export var responsiveMap = {
|
|
4
|
+
xs: '(max-width: 575px)',
|
|
5
|
+
sm: '(min-width: 576px)',
|
|
6
|
+
md: '(min-width: 768px)',
|
|
7
|
+
lg: '(min-width: 992px)',
|
|
8
|
+
xl: '(min-width: 1200px)',
|
|
9
|
+
xxl: '(min-width: 1600px)'
|
|
10
|
+
};
|
|
11
|
+
var subscribers = new Map();
|
|
12
|
+
var subUid = -1;
|
|
13
|
+
var screens = {};
|
|
14
|
+
var responsiveObserve = {
|
|
15
|
+
matchHandlers: {},
|
|
16
|
+
dispatch: function dispatch(pointMap) {
|
|
17
|
+
screens = pointMap;
|
|
18
|
+
subscribers.forEach(function (func) {
|
|
19
|
+
return func(screens);
|
|
20
|
+
});
|
|
21
|
+
return subscribers.size >= 1;
|
|
22
|
+
},
|
|
23
|
+
subscribe: function subscribe(func) {
|
|
24
|
+
if (!subscribers.size) this.register();
|
|
25
|
+
subUid += 1;
|
|
26
|
+
subscribers.set(subUid, func);
|
|
27
|
+
func(screens);
|
|
28
|
+
return subUid;
|
|
29
|
+
},
|
|
30
|
+
unsubscribe: function unsubscribe(token) {
|
|
31
|
+
subscribers.delete(token);
|
|
32
|
+
if (!subscribers.size) this.unregister();
|
|
33
|
+
},
|
|
34
|
+
unregister: function unregister() {
|
|
35
|
+
var _this = this;
|
|
36
|
+
|
|
37
|
+
Object.keys(responsiveMap).forEach(function (screen) {
|
|
38
|
+
var matchMediaQuery = responsiveMap[screen];
|
|
39
|
+
var handler = _this.matchHandlers[matchMediaQuery];
|
|
40
|
+
handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);
|
|
41
|
+
});
|
|
42
|
+
subscribers.clear();
|
|
43
|
+
},
|
|
44
|
+
register: function register() {
|
|
45
|
+
var _this2 = this;
|
|
46
|
+
|
|
47
|
+
Object.keys(responsiveMap).forEach(function (screen) {
|
|
48
|
+
var matchMediaQuery = responsiveMap[screen];
|
|
49
|
+
|
|
50
|
+
var listener = function listener(_ref) {
|
|
51
|
+
var matches = _ref.matches;
|
|
52
|
+
|
|
53
|
+
_this2.dispatch(Object.assign(Object.assign({}, screens), _defineProperty({}, screen, matches)));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var mql = window.matchMedia(matchMediaQuery);
|
|
57
|
+
mql.addListener(listener);
|
|
58
|
+
_this2.matchHandlers[matchMediaQuery] = {
|
|
59
|
+
mql: mql,
|
|
60
|
+
listener: listener
|
|
61
|
+
};
|
|
62
|
+
listener(mql);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
export default responsiveObserve;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
|
2
|
+
import { isStyleSupport } from 'rc-util/lib/Dom/styleChecker';
|
|
3
|
+
export var canUseDocElement = function canUseDocElement() {
|
|
4
|
+
return canUseDom() && window.document.documentElement;
|
|
5
|
+
};
|
|
6
|
+
export { isStyleSupport };
|
|
7
|
+
var flexGapSupported;
|
|
8
|
+
export var detectFlexGapSupported = function detectFlexGapSupported() {
|
|
9
|
+
if (!canUseDocElement()) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (flexGapSupported !== undefined) {
|
|
14
|
+
return flexGapSupported;
|
|
15
|
+
} // create flex container with row-gap set
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var flex = document.createElement('div');
|
|
19
|
+
flex.style.display = 'flex';
|
|
20
|
+
flex.style.flexDirection = 'column';
|
|
21
|
+
flex.style.rowGap = '1px'; // create two, elements inside it
|
|
22
|
+
|
|
23
|
+
flex.appendChild(document.createElement('div'));
|
|
24
|
+
flex.appendChild(document.createElement('div')); // append to the DOM (needed to obtain scrollHeight)
|
|
25
|
+
|
|
26
|
+
document.body.appendChild(flex);
|
|
27
|
+
flexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
|
|
28
|
+
|
|
29
|
+
document.body.removeChild(flex);
|
|
30
|
+
return flexGapSupported;
|
|
31
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface TransButtonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
onClick?: (e?: React.MouseEvent<HTMLDivElement>) => void;
|
|
4
|
+
noStyle?: boolean;
|
|
5
|
+
autoFocus?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const TransButton: React.ForwardRefExoticComponent<TransButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default TransButton;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
|
|
4
|
+
for (var p in s) {
|
|
5
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Wrap of sub component which need use as Button capacity (like Icon component).
|
|
15
|
+
*
|
|
16
|
+
* This helps accessibility reader to tread as a interactive button to operation.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
import KeyCode from 'rc-util/lib/KeyCode';
|
|
21
|
+
import * as React from 'react';
|
|
22
|
+
var inlineStyle = {
|
|
23
|
+
border: 0,
|
|
24
|
+
background: 'transparent',
|
|
25
|
+
padding: 0,
|
|
26
|
+
lineHeight: 'inherit',
|
|
27
|
+
display: 'inline-block'
|
|
28
|
+
};
|
|
29
|
+
var TransButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
30
|
+
var onKeyDown = function onKeyDown(event) {
|
|
31
|
+
var keyCode = event.keyCode;
|
|
32
|
+
|
|
33
|
+
if (keyCode === KeyCode.ENTER) {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var onKeyUp = function onKeyUp(event) {
|
|
39
|
+
var keyCode = event.keyCode;
|
|
40
|
+
var onClick = props.onClick;
|
|
41
|
+
|
|
42
|
+
if (keyCode === KeyCode.ENTER && onClick) {
|
|
43
|
+
onClick();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var style = props.style,
|
|
48
|
+
noStyle = props.noStyle,
|
|
49
|
+
disabled = props.disabled,
|
|
50
|
+
restProps = __rest(props, ["style", "noStyle", "disabled"]);
|
|
51
|
+
|
|
52
|
+
var mergedStyle = {};
|
|
53
|
+
|
|
54
|
+
if (!noStyle) {
|
|
55
|
+
mergedStyle = Object.assign({}, inlineStyle);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (disabled) {
|
|
59
|
+
mergedStyle.pointerEvents = 'none';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
mergedStyle = Object.assign(Object.assign({}, mergedStyle), style);
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
64
|
+
role: "button",
|
|
65
|
+
tabIndex: 0,
|
|
66
|
+
ref: ref
|
|
67
|
+
}, restProps, {
|
|
68
|
+
onKeyDown: onKeyDown,
|
|
69
|
+
onKeyUp: onKeyUp,
|
|
70
|
+
style: mergedStyle
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
73
|
+
export default TransButton;
|
package/es/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export { default as CustomTableOption } from './CustomTableOption';
|
|
|
45
45
|
export { default as Upload } from './Upload';
|
|
46
46
|
export type { UploadProps, UploadFile, RcFile } from './Upload';
|
|
47
47
|
export { default as Tooltip } from './Tooltip';
|
|
48
|
+
export type { TooltipProps } from './Tooltip';
|
|
48
49
|
export { default as Form } from './Form';
|
|
49
50
|
export { default as Spin } from './Spin';
|
|
50
51
|
export { default as LmEditTable } from './LmEditTable';
|
|
@@ -52,3 +53,16 @@ export { default as List } from './List';
|
|
|
52
53
|
export { default as LMQuickMenu } from './QuickMenu';
|
|
53
54
|
export { default as DatePicker } from './DatePicker';
|
|
54
55
|
export type { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './DatePicker';
|
|
56
|
+
export { default as Popover } from './Popover';
|
|
57
|
+
export type { PopoverProps } from './Popover';
|
|
58
|
+
export { default as Typography } from './Typography';
|
|
59
|
+
export type { TypographyProps } from './Typography';
|
|
60
|
+
export { default as AutoComplete } from './AutoComplete';
|
|
61
|
+
export type { AutoCompleteProps } from './AutoComplete';
|
|
62
|
+
export { default as Grid } from './Grid';
|
|
63
|
+
export { default as Row } from './Row';
|
|
64
|
+
export type { RowProps } from './Row';
|
|
65
|
+
export { default as Col } from './Col';
|
|
66
|
+
export type { ColProps } from './Col';
|
|
67
|
+
export { default as Layout } from './Layout';
|
|
68
|
+
export type { LayoutProps, SiderProps } from './Layout';
|
package/es/index.js
CHANGED
|
@@ -48,4 +48,11 @@ export { default as Spin } from './Spin';
|
|
|
48
48
|
export { default as LmEditTable } from './LmEditTable';
|
|
49
49
|
export { default as List } from './List';
|
|
50
50
|
export { default as LMQuickMenu } from './QuickMenu';
|
|
51
|
-
export { default as DatePicker } from './DatePicker';
|
|
51
|
+
export { default as DatePicker } from './DatePicker';
|
|
52
|
+
export { default as Popover } from './Popover';
|
|
53
|
+
export { default as Typography } from './Typography';
|
|
54
|
+
export { default as AutoComplete } from './AutoComplete';
|
|
55
|
+
export { default as Grid } from './Grid';
|
|
56
|
+
export { default as Row } from './Row';
|
|
57
|
+
export { default as Col } from './Col';
|
|
58
|
+
export { default as Layout } from './Layout';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO: 4.0
|
|
3
|
+
*
|
|
4
|
+
* - Remove `dataSource`
|
|
5
|
+
* - `size` not work with customizeInput
|
|
6
|
+
* - CustomizeInput not feedback `ENTER` key since accessibility enhancement
|
|
7
|
+
*/
|
|
8
|
+
import type { BaseSelectRef } from 'rc-select';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import type { BaseOptionType, DefaultOptionType, InternalSelectProps } from 'antd/es/select';
|
|
11
|
+
import type { InputStatus } from '../_util/statusUtils';
|
|
12
|
+
import { AutoComplete as AntdAutoComplete } from 'antd';
|
|
13
|
+
export interface DataSourceItemObject {
|
|
14
|
+
value: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
export declare type DataSourceItemType = DataSourceItemObject | React.ReactNode;
|
|
18
|
+
export interface AutoCompleteProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<InternalSelectProps<ValueType, OptionType>, 'inputIcon' | 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue'> {
|
|
19
|
+
dataSource?: DataSourceItemType[];
|
|
20
|
+
status?: InputStatus;
|
|
21
|
+
}
|
|
22
|
+
declare const RefAutoComplete: (<ValueType = any, OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: AutoCompleteProps<ValueType, OptionType> & {
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
} & {
|
|
25
|
+
ref?: React.Ref<BaseSelectRef>;
|
|
26
|
+
}) => React.ReactElement) & {
|
|
27
|
+
Option: import("rc-select/lib/Option").OptionFC;
|
|
28
|
+
AntdAutoComplete: typeof AntdAutoComplete;
|
|
29
|
+
};
|
|
30
|
+
export default RefAutoComplete;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
require("antd/es/auto-complete/style");
|
|
13
|
+
|
|
14
|
+
var _autoComplete = _interopRequireDefault(require("antd/es/auto-complete"));
|
|
15
|
+
|
|
16
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
+
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
+
|
|
20
|
+
require("antd/es/select/style");
|
|
21
|
+
|
|
22
|
+
var _select = _interopRequireDefault(require("antd/es/select"));
|
|
23
|
+
|
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
+
|
|
26
|
+
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
|
|
27
|
+
|
|
28
|
+
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
|
29
|
+
|
|
30
|
+
var React = _interopRequireWildcard(require("react"));
|
|
31
|
+
|
|
32
|
+
var _configProvider = require("antd/es/config-provider");
|
|
33
|
+
|
|
34
|
+
var _reactNode = require("../_util/reactNode");
|
|
35
|
+
|
|
36
|
+
var _warning = _interopRequireDefault(require("../_util/warning"));
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* TODO: 4.0
|
|
40
|
+
*
|
|
41
|
+
* - Remove `dataSource`
|
|
42
|
+
* - `size` not work with customizeInput
|
|
43
|
+
* - CustomizeInput not feedback `ENTER` key since accessibility enhancement
|
|
44
|
+
*/
|
|
45
|
+
var Option = _select.default.Option;
|
|
46
|
+
|
|
47
|
+
function isSelectOptionOrSelectOptGroup(child) {
|
|
48
|
+
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var AutoComplete = function AutoComplete(props, ref) {
|
|
52
|
+
var customizePrefixCls = props.prefixCls,
|
|
53
|
+
className = props.className,
|
|
54
|
+
children = props.children,
|
|
55
|
+
dataSource = props.dataSource;
|
|
56
|
+
var childNodes = (0, _toArray.default)(children); // ============================= Input =============================
|
|
57
|
+
|
|
58
|
+
var customizeInput;
|
|
59
|
+
|
|
60
|
+
if (childNodes.length === 1 && (0, _reactNode.isValidElement)(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
|
61
|
+
var _childNodes = (0, _slicedToArray2.default)(childNodes, 1);
|
|
62
|
+
|
|
63
|
+
customizeInput = _childNodes[0];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var getInputElement = customizeInput ? function () {
|
|
67
|
+
return customizeInput;
|
|
68
|
+
} : undefined; // ============================ Options ============================
|
|
69
|
+
|
|
70
|
+
var optionChildren; // [Legacy] convert `children` or `dataSource` into option children
|
|
71
|
+
|
|
72
|
+
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
|
73
|
+
optionChildren = children;
|
|
74
|
+
} else {
|
|
75
|
+
optionChildren = dataSource ? dataSource.map(function (item) {
|
|
76
|
+
if ((0, _reactNode.isValidElement)(item)) {
|
|
77
|
+
return item;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
switch ((0, _typeof2.default)(item)) {
|
|
81
|
+
case 'string':
|
|
82
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
83
|
+
key: item,
|
|
84
|
+
value: item
|
|
85
|
+
}, item);
|
|
86
|
+
|
|
87
|
+
case 'object':
|
|
88
|
+
{
|
|
89
|
+
var optionValue = item.value;
|
|
90
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
91
|
+
key: optionValue,
|
|
92
|
+
value: optionValue
|
|
93
|
+
}, item.text);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
default:
|
|
97
|
+
(0, _warning.default)(false, 'AutoComplete', '`dataSource` is only supports type `string[] | Object[]`.');
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
}) : [];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
(0, _warning.default)(!('dataSource' in props), 'AutoComplete', '`dataSource` is deprecated, please use `options` instead.');
|
|
104
|
+
(0, _warning.default)(!customizeInput || !('size' in props), 'AutoComplete', 'You need to control style self instead of setting `size` when using customize input.');
|
|
105
|
+
return /*#__PURE__*/React.createElement(_configProvider.ConfigConsumer, null, function (_ref) {
|
|
106
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
107
|
+
var prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
108
|
+
return /*#__PURE__*/React.createElement(_select.default, Object.assign({
|
|
109
|
+
ref: ref
|
|
110
|
+
}, (0, _omit.default)(props, ['dataSource']), {
|
|
111
|
+
prefixCls: prefixCls,
|
|
112
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-auto-complete"), className),
|
|
113
|
+
mode: _select.default.SECRET_COMBOBOX_MODE_DO_NOT_USE
|
|
114
|
+
}, {
|
|
115
|
+
// Internal api
|
|
116
|
+
getInputElement: getInputElement
|
|
117
|
+
}), optionChildren);
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
var RefAutoComplete = /*#__PURE__*/React.forwardRef(AutoComplete);
|
|
122
|
+
RefAutoComplete.Option = Option;
|
|
123
|
+
RefAutoComplete.AntdAutoComplete = _autoComplete.default;
|
|
124
|
+
var _default = RefAutoComplete;
|
|
125
|
+
exports.default = _default;
|