@ebscn/ui 1.0.3-beta.3 → 1.0.3-beta.30
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/assets/images/delete_dark.png +0 -0
- package/assets/images/keybord_keybord_dark.png +0 -0
- package/assets/images/keybord_shift2.png +0 -0
- package/assets/images/keybord_shift2_dark.png +0 -0
- package/assets/images/keybord_shift_dark.png +0 -0
- package/assets/images/loading.gif +0 -0
- package/cjs/assets/images/delete_dark.png +0 -0
- package/cjs/assets/images/keybord_keybord_dark.png +0 -0
- package/cjs/assets/images/keybord_shift2.png +0 -0
- package/cjs/assets/images/keybord_shift2_dark.png +0 -0
- package/cjs/assets/images/keybord_shift_dark.png +0 -0
- package/cjs/assets/images/loading.gif +0 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.css +108 -43
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.js +1 -2
- package/cjs/components/button/selectorButton.css +2 -0
- package/cjs/components/button/selectorButton.js +1 -5
- package/cjs/components/card/card.css +1 -1
- package/cjs/components/card/card.js +2 -2
- package/cjs/components/checkbox/checkbox.css +8 -2
- package/cjs/components/date-range-picker/date-range-picker.css +31 -7
- package/cjs/components/date-range-picker/date-range-picker.d.ts +1 -0
- package/cjs/components/date-range-picker/date-range-picker.js +18 -9
- package/cjs/components/divider/divider.css +4 -3
- package/cjs/components/header/header.css +7 -1
- package/cjs/components/header/header.js +4 -2
- package/cjs/components/icons/back-icon.js +1 -0
- package/cjs/components/icons/clear-icon.js +1 -0
- package/cjs/components/icons/close-icon.js +2 -1
- package/cjs/components/icons/down-icon.d.ts +4 -0
- package/cjs/components/icons/down-icon.js +26 -0
- package/cjs/components/icons/dustbin-icon.d.ts +4 -0
- package/cjs/components/icons/dustbin-icon.js +26 -0
- package/cjs/components/icons/index.d.ts +3 -0
- package/cjs/components/icons/index.js +21 -0
- package/cjs/components/icons/notice-icon.js +2 -2
- package/cjs/components/icons/right-icon.js +1 -0
- package/cjs/components/icons/search-icon.js +2 -1
- package/cjs/components/icons/up-icon.d.ts +4 -0
- package/cjs/components/icons/up-icon.js +26 -0
- package/cjs/components/icons/warning-icon.js +2 -1
- package/cjs/components/infinite-scroll/index.d.ts +4 -0
- package/cjs/components/infinite-scroll/index.js +9 -0
- package/cjs/components/infinite-scroll/infinite-scroll.css +27 -0
- package/cjs/components/infinite-scroll/infinite-scroll.d.ts +11 -0
- package/cjs/components/infinite-scroll/infinite-scroll.js +278 -0
- package/cjs/components/input/input.css +27 -27
- package/cjs/components/input/input.js +1 -1
- package/cjs/components/list/index.d.ts +16 -0
- package/cjs/components/list/index.js +13 -0
- package/cjs/components/list/list-item.d.ts +15 -0
- package/cjs/components/list/list-item.js +38 -0
- package/cjs/components/list/list.css +101 -0
- package/cjs/components/list/list.d.ts +20 -0
- package/cjs/components/list/list.js +38 -0
- package/cjs/components/number-keyboard/number-keyboard.css +55 -42
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -0
- package/cjs/components/number-keyboard/number-keyboard.js +2 -1
- package/cjs/components/picker/picker.css +3 -0
- package/cjs/components/picker-view/picker-view.css +11 -2
- package/cjs/components/popover/arrow.d.ts +3 -0
- package/cjs/components/popover/arrow.js +19 -0
- package/cjs/components/popover/index.d.ts +31 -0
- package/cjs/components/popover/index.js +14 -0
- package/cjs/components/popover/normalize-placement.d.ts +2 -0
- package/cjs/components/popover/normalize-placement.js +20 -0
- package/cjs/components/popover/popover-menu.css +65 -0
- package/cjs/components/popover/popover-menu.d.ts +20 -0
- package/cjs/components/popover/popover-menu.js +74 -0
- package/cjs/components/popover/popover.css +68 -0
- package/cjs/components/popover/popover.d.ts +41 -0
- package/cjs/components/popover/popover.js +280 -0
- package/cjs/components/popover/wrapper.d.ts +10 -0
- package/cjs/components/popover/wrapper.js +53 -0
- package/cjs/components/popup/popup.css +4 -16
- package/cjs/components/protocol/protocol.js +1 -2
- package/cjs/components/pull-to-refresh/pull-to-refresh.css +10 -1
- package/cjs/components/pull-to-refresh/pull-to-refresh.d.ts +1 -1
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +5 -5
- package/cjs/components/radio/radio.css +5 -0
- package/cjs/components/selector/selector.css +1 -1
- package/cjs/components/skeleton/skeleton.css +4 -4
- package/cjs/components/squared-grid/squared-grid.css +1 -2
- package/cjs/components/squared-grid/squared-grid.d.ts +2 -1
- package/cjs/components/squared-grid/squared-grid.js +11 -2
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.css +48 -41
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.js +1 -1
- package/cjs/components/stock-keyboard/alphabet-keyboard.css +186 -0
- package/cjs/components/stock-keyboard/alphabet-keyboard.d.ts +11 -0
- package/cjs/components/stock-keyboard/alphabet-keyboard.js +106 -0
- package/cjs/components/stock-keyboard/index.d.ts +1 -0
- package/cjs/components/stock-keyboard/index.js +1 -0
- package/cjs/components/stock-keyboard/stock-keyboard.css +135 -76
- package/cjs/components/stock-keyboard/stock-keyboard.d.ts +2 -2
- package/cjs/components/stock-keyboard/stock-keyboard.js +42 -10
- package/cjs/components/switch/switch.css +2 -3
- package/cjs/components/tabs/tabs.css +6 -4
- package/cjs/components/tabs/tabs.js +5 -5
- package/cjs/components/tabs/tabs.patch.css +1 -0
- package/cjs/components/toast/index.d.ts +9 -0
- package/cjs/components/toast/index.js +14 -0
- package/cjs/components/toast/methods.d.ts +8 -0
- package/cjs/components/toast/methods.js +72 -0
- package/cjs/components/toast/toast.css +45 -0
- package/cjs/components/toast/toast.d.ts +18 -0
- package/cjs/components/toast/toast.js +85 -0
- package/cjs/components/toast/toast.patch.css +11 -0
- package/cjs/global/global.css +20 -5
- package/cjs/global/theme-dark.css +11 -3
- package/cjs/global/theme-default.css +9 -2
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +33 -1
- package/es/assets/images/delete_dark.png +0 -0
- package/es/assets/images/keybord_keybord_dark.png +0 -0
- package/es/assets/images/keybord_shift2.png +0 -0
- package/es/assets/images/keybord_shift2_dark.png +0 -0
- package/es/assets/images/keybord_shift_dark.png +0 -0
- package/es/assets/images/loading.gif +0 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.css +108 -43
- package/es/components/alphabet-keyboard/alphabet-keyboard.js +2 -4
- package/es/components/button/selectorButton.css +2 -0
- package/es/components/button/selectorButton.js +1 -5
- package/es/components/card/card.css +1 -1
- package/es/components/card/card.js +2 -2
- package/es/components/checkbox/checkbox.css +8 -2
- package/es/components/date-range-picker/date-range-picker.css +31 -7
- package/es/components/date-range-picker/date-range-picker.d.ts +1 -0
- package/es/components/date-range-picker/date-range-picker.js +17 -9
- package/es/components/divider/divider.css +4 -3
- package/es/components/header/header.css +7 -1
- package/es/components/header/header.js +4 -2
- package/es/components/icons/back-icon.js +1 -0
- package/es/components/icons/clear-icon.js +1 -0
- package/es/components/icons/close-icon.js +2 -1
- package/es/components/icons/down-icon.d.ts +4 -0
- package/es/components/icons/down-icon.js +18 -0
- package/es/components/icons/dustbin-icon.d.ts +4 -0
- package/es/components/icons/dustbin-icon.js +18 -0
- package/es/components/icons/index.d.ts +3 -0
- package/es/components/icons/index.js +3 -0
- package/es/components/icons/notice-icon.js +2 -2
- package/es/components/icons/right-icon.js +1 -0
- package/es/components/icons/search-icon.js +2 -1
- package/es/components/icons/up-icon.d.ts +4 -0
- package/es/components/icons/up-icon.js +18 -0
- package/es/components/icons/warning-icon.js +2 -1
- package/es/components/infinite-scroll/index.d.ts +4 -0
- package/es/components/infinite-scroll/index.js +3 -0
- package/es/components/infinite-scroll/infinite-scroll.css +27 -0
- package/es/components/infinite-scroll/infinite-scroll.d.ts +11 -0
- package/es/components/infinite-scroll/infinite-scroll.js +268 -0
- package/es/components/input/input.css +27 -27
- package/es/components/input/input.js +1 -1
- package/es/components/list/index.d.ts +16 -0
- package/es/components/list/index.js +7 -0
- package/es/components/list/list-item.d.ts +15 -0
- package/es/components/list/list-item.js +30 -0
- package/es/components/list/list.css +101 -0
- package/es/components/list/list.d.ts +20 -0
- package/es/components/list/list.js +29 -0
- package/es/components/number-keyboard/number-keyboard.css +55 -42
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -0
- package/es/components/number-keyboard/number-keyboard.js +2 -1
- package/es/components/picker/picker.css +3 -0
- package/es/components/picker-view/picker-view.css +11 -2
- package/es/components/popover/arrow.d.ts +3 -0
- package/es/components/popover/arrow.js +11 -0
- package/es/components/popover/index.d.ts +31 -0
- package/es/components/popover/index.js +8 -0
- package/es/components/popover/normalize-placement.d.ts +2 -0
- package/es/components/popover/normalize-placement.js +14 -0
- package/es/components/popover/popover-menu.css +65 -0
- package/es/components/popover/popover-menu.d.ts +20 -0
- package/es/components/popover/popover-menu.js +65 -0
- package/es/components/popover/popover.css +68 -0
- package/es/components/popover/popover.d.ts +41 -0
- package/es/components/popover/popover.js +271 -0
- package/es/components/popover/wrapper.d.ts +10 -0
- package/es/components/popover/wrapper.js +47 -0
- package/es/components/popup/popup.css +4 -16
- package/es/components/protocol/protocol.js +1 -2
- package/es/components/pull-to-refresh/pull-to-refresh.css +10 -1
- package/es/components/pull-to-refresh/pull-to-refresh.d.ts +1 -1
- package/es/components/pull-to-refresh/pull-to-refresh.js +5 -5
- package/es/components/radio/radio.css +5 -0
- package/es/components/selector/selector.css +1 -1
- package/es/components/skeleton/skeleton.css +4 -4
- package/es/components/squared-grid/squared-grid.css +1 -2
- package/es/components/squared-grid/squared-grid.d.ts +2 -1
- package/es/components/squared-grid/squared-grid.js +11 -2
- package/es/components/stock-count-keyboard/stock-count-keyboard.css +48 -41
- package/es/components/stock-count-keyboard/stock-count-keyboard.js +1 -1
- package/es/components/stock-keyboard/alphabet-keyboard.css +186 -0
- package/es/components/stock-keyboard/alphabet-keyboard.d.ts +11 -0
- package/es/components/stock-keyboard/alphabet-keyboard.js +98 -0
- package/es/components/stock-keyboard/index.d.ts +1 -0
- package/es/components/stock-keyboard/index.js +1 -0
- package/es/components/stock-keyboard/stock-keyboard.css +135 -76
- package/es/components/stock-keyboard/stock-keyboard.d.ts +2 -2
- package/es/components/stock-keyboard/stock-keyboard.js +44 -13
- package/es/components/switch/switch.css +2 -3
- package/es/components/tabs/tabs.css +6 -4
- package/es/components/tabs/tabs.js +5 -5
- package/es/components/tabs/tabs.patch.css +1 -0
- package/es/components/toast/index.d.ts +9 -0
- package/es/components/toast/index.js +8 -0
- package/es/components/toast/methods.d.ts +8 -0
- package/es/components/toast/methods.js +63 -0
- package/es/components/toast/toast.css +45 -0
- package/es/components/toast/toast.d.ts +18 -0
- package/es/components/toast/toast.js +75 -0
- package/es/components/toast/toast.patch.css +11 -0
- package/es/global/global.css +20 -5
- package/es/global/theme-dark.css +11 -3
- package/es/global/theme-default.css +9 -2
- package/es/index.d.ts +4 -0
- package/es/index.js +8 -4
- package/package.json +6 -12
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) {
|
|
3
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
4
|
+
resolve(value);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) {
|
|
9
|
+
try {
|
|
10
|
+
step(generator.next(value));
|
|
11
|
+
} catch (e) {
|
|
12
|
+
reject(e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function rejected(value) {
|
|
16
|
+
try {
|
|
17
|
+
step(generator["throw"](value));
|
|
18
|
+
} catch (e) {
|
|
19
|
+
reject(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function step(result) {
|
|
23
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
24
|
+
}
|
|
25
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
29
|
+
var _ = {
|
|
30
|
+
label: 0,
|
|
31
|
+
sent: function () {
|
|
32
|
+
if (t[0] & 1) throw t[1];
|
|
33
|
+
return t[1];
|
|
34
|
+
},
|
|
35
|
+
trys: [],
|
|
36
|
+
ops: []
|
|
37
|
+
},
|
|
38
|
+
f,
|
|
39
|
+
y,
|
|
40
|
+
t,
|
|
41
|
+
g;
|
|
42
|
+
return g = {
|
|
43
|
+
next: verb(0),
|
|
44
|
+
"throw": verb(1),
|
|
45
|
+
"return": verb(2)
|
|
46
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
47
|
+
return this;
|
|
48
|
+
}), g;
|
|
49
|
+
function verb(n) {
|
|
50
|
+
return function (v) {
|
|
51
|
+
return step([n, v]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function step(op) {
|
|
55
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
+
switch (op[0]) {
|
|
60
|
+
case 0:
|
|
61
|
+
case 1:
|
|
62
|
+
t = op;
|
|
63
|
+
break;
|
|
64
|
+
case 4:
|
|
65
|
+
_.label++;
|
|
66
|
+
return {
|
|
67
|
+
value: op[1],
|
|
68
|
+
done: false
|
|
69
|
+
};
|
|
70
|
+
case 5:
|
|
71
|
+
_.label++;
|
|
72
|
+
y = op[1];
|
|
73
|
+
op = [0];
|
|
74
|
+
continue;
|
|
75
|
+
case 7:
|
|
76
|
+
op = _.ops.pop();
|
|
77
|
+
_.trys.pop();
|
|
78
|
+
continue;
|
|
79
|
+
default:
|
|
80
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
81
|
+
_ = 0;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
85
|
+
_.label = op[1];
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
89
|
+
_.label = t[1];
|
|
90
|
+
t = op;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (t && _.label < t[2]) {
|
|
94
|
+
_.label = t[2];
|
|
95
|
+
_.ops.push(op);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
if (t[2]) _.ops.pop();
|
|
99
|
+
_.trys.pop();
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
op = body.call(thisArg, _);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
op = [6, e];
|
|
105
|
+
y = 0;
|
|
106
|
+
} finally {
|
|
107
|
+
f = t = 0;
|
|
108
|
+
}
|
|
109
|
+
if (op[0] & 5) throw op[1];
|
|
110
|
+
return {
|
|
111
|
+
value: op[0] ? op[1] : void 0,
|
|
112
|
+
done: true
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
import React, { forwardRef, useImperativeHandle, useRef, useState, useEffect } from 'react';
|
|
117
|
+
import classNames from 'classnames';
|
|
118
|
+
import { usePropsValue } from '../../utils/use-props-value';
|
|
119
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
120
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
121
|
+
import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
122
|
+
import { Arrow } from './arrow';
|
|
123
|
+
import { renderToContainer } from '../../utils/render-to-container';
|
|
124
|
+
import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from '@floating-ui/dom';
|
|
125
|
+
import { Wrapper } from './wrapper';
|
|
126
|
+
import { useShouldRender } from '../../utils/should-render';
|
|
127
|
+
import { useClickAway, useIsomorphicLayoutEffect } from 'ahooks';
|
|
128
|
+
import { normalizePlacement } from './normalize-placement';
|
|
129
|
+
import { convertPx } from '../../utils/convert-px';
|
|
130
|
+
var classPrefix = "ebscn-popover";
|
|
131
|
+
var defaultProps = {
|
|
132
|
+
placement: 'top',
|
|
133
|
+
defaultVisible: false,
|
|
134
|
+
stopPropagation: ['click'],
|
|
135
|
+
getContainer: function () {
|
|
136
|
+
return document.body;
|
|
137
|
+
},
|
|
138
|
+
mode: 'light'
|
|
139
|
+
};
|
|
140
|
+
export var Popover = forwardRef(function (p, ref) {
|
|
141
|
+
var _a;
|
|
142
|
+
var props = mergeProps(defaultProps, p);
|
|
143
|
+
var placement = normalizePlacement(props.placement);
|
|
144
|
+
var _b = usePropsValue({
|
|
145
|
+
value: props.visible,
|
|
146
|
+
defaultValue: props.defaultVisible,
|
|
147
|
+
onChange: props.onVisibleChange
|
|
148
|
+
}),
|
|
149
|
+
visible = _b[0],
|
|
150
|
+
setVisible = _b[1];
|
|
151
|
+
useImperativeHandle(ref, function () {
|
|
152
|
+
return {
|
|
153
|
+
show: function () {
|
|
154
|
+
return setVisible(true);
|
|
155
|
+
},
|
|
156
|
+
hide: function () {
|
|
157
|
+
return setVisible(false);
|
|
158
|
+
},
|
|
159
|
+
visible: visible
|
|
160
|
+
};
|
|
161
|
+
}, [visible]);
|
|
162
|
+
var targetRef = useRef(null);
|
|
163
|
+
var floatingRef = useRef(null);
|
|
164
|
+
var arrowRef = useRef(null);
|
|
165
|
+
var floating = withStopPropagation(props.stopPropagation, withNativeProps(props, React.createElement("div", {
|
|
166
|
+
className: classNames(classPrefix, "".concat(classPrefix, "-").concat(props.mode), (_a = {}, _a["".concat(classPrefix, "-hidden")] = !visible, _a)),
|
|
167
|
+
ref: floatingRef
|
|
168
|
+
}, React.createElement("div", {
|
|
169
|
+
className: "".concat(classPrefix, "-arrow"),
|
|
170
|
+
ref: arrowRef
|
|
171
|
+
}, React.createElement(Arrow, {
|
|
172
|
+
className: "".concat(classPrefix, "-arrow-icon")
|
|
173
|
+
})), React.createElement("div", {
|
|
174
|
+
className: "".concat(classPrefix, "-inner")
|
|
175
|
+
}, React.createElement("div", {
|
|
176
|
+
className: "".concat(classPrefix, "-inner-content")
|
|
177
|
+
}, props.content)))));
|
|
178
|
+
var _c = useState(null),
|
|
179
|
+
targetElement = _c[0],
|
|
180
|
+
setTargetElement = _c[1];
|
|
181
|
+
function update() {
|
|
182
|
+
var _a, _b, _c;
|
|
183
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
+
var target, floating, arrowElement, _d, x, y, realPlacement, middlewareData, side, arrowSide, _e, arrowX, arrowY, arrowRotate;
|
|
185
|
+
var _f;
|
|
186
|
+
return __generator(this, function (_g) {
|
|
187
|
+
switch (_g.label) {
|
|
188
|
+
case 0:
|
|
189
|
+
target = (_b = (_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.element) !== null && _b !== void 0 ? _b : null;
|
|
190
|
+
floating = floatingRef.current;
|
|
191
|
+
arrowElement = arrowRef.current;
|
|
192
|
+
setTargetElement(target);
|
|
193
|
+
if (!target || !floating || !arrowElement) return [2 /*return*/];
|
|
194
|
+
return [4 /*yield*/, computePosition(target, floating, {
|
|
195
|
+
placement: placement,
|
|
196
|
+
middleware: [offset(convertPx(12)), shift({
|
|
197
|
+
padding: convertPx(4),
|
|
198
|
+
crossAxis: false,
|
|
199
|
+
limiter: limitShift()
|
|
200
|
+
}), flip(), hide(), arrow({
|
|
201
|
+
element: arrowElement,
|
|
202
|
+
padding: convertPx(12)
|
|
203
|
+
})]
|
|
204
|
+
})];
|
|
205
|
+
case 1:
|
|
206
|
+
_d = _g.sent(), x = _d.x, y = _d.y, realPlacement = _d.placement, middlewareData = _d.middlewareData;
|
|
207
|
+
Object.assign(floating.style, {
|
|
208
|
+
left: "".concat(x, "px"),
|
|
209
|
+
top: "".concat(y, "px")
|
|
210
|
+
});
|
|
211
|
+
side = realPlacement.split('-')[0];
|
|
212
|
+
arrowSide = {
|
|
213
|
+
top: 'bottom',
|
|
214
|
+
right: 'left',
|
|
215
|
+
bottom: 'top',
|
|
216
|
+
left: 'right'
|
|
217
|
+
}[side];
|
|
218
|
+
_e = (_c = middlewareData.arrow) !== null && _c !== void 0 ? _c : {}, arrowX = _e.x, arrowY = _e.y;
|
|
219
|
+
Object.assign(arrowElement.style, (_f = {
|
|
220
|
+
left: arrowX != null ? "".concat(arrowX, "px") : '',
|
|
221
|
+
top: arrowY != null ? "".concat(arrowY, "px") : '',
|
|
222
|
+
right: '',
|
|
223
|
+
bottom: ''
|
|
224
|
+
}, _f[arrowSide] = 'calc(var(--arrow-size) * -1)', _f));
|
|
225
|
+
arrowRotate = {
|
|
226
|
+
top: '0deg',
|
|
227
|
+
bottom: '180deg',
|
|
228
|
+
left: '270deg',
|
|
229
|
+
right: '90deg'
|
|
230
|
+
}[side];
|
|
231
|
+
arrowElement.style.setProperty('--arrow-icon-rotate', arrowRotate);
|
|
232
|
+
return [2 /*return*/];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
useIsomorphicLayoutEffect(function () {
|
|
238
|
+
update();
|
|
239
|
+
});
|
|
240
|
+
useEffect(function () {
|
|
241
|
+
if (!targetElement) return;
|
|
242
|
+
if (!props.trigger) return;
|
|
243
|
+
function handleClick() {
|
|
244
|
+
setVisible(function (v) {
|
|
245
|
+
return !v;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
targetElement.addEventListener('click', handleClick);
|
|
249
|
+
return function () {
|
|
250
|
+
targetElement.removeEventListener('click', handleClick);
|
|
251
|
+
};
|
|
252
|
+
}, [targetElement, props.trigger]);
|
|
253
|
+
useEffect(function () {
|
|
254
|
+
var floatingElement = floatingRef.current;
|
|
255
|
+
if (!targetElement || !floatingElement) return;
|
|
256
|
+
return autoUpdate(targetElement, floatingElement, update, {
|
|
257
|
+
elementResize: typeof ResizeObserver !== 'undefined'
|
|
258
|
+
});
|
|
259
|
+
}, [targetElement]);
|
|
260
|
+
useClickAway(function () {
|
|
261
|
+
if (!props.trigger) return;
|
|
262
|
+
setVisible(false);
|
|
263
|
+
}, [function () {
|
|
264
|
+
var _a;
|
|
265
|
+
return (_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.element;
|
|
266
|
+
}, floatingRef], ['click', 'touchmove']);
|
|
267
|
+
var shouldRender = useShouldRender(visible, false, props.destroyOnHide);
|
|
268
|
+
return React.createElement(React.Fragment, null, React.createElement(Wrapper, {
|
|
269
|
+
ref: targetRef
|
|
270
|
+
}, props.children), shouldRender && renderToContainer(props.getContainer, floating));
|
|
271
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export declare class Wrapper extends React.Component<{
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}, {}> {
|
|
6
|
+
element: Element | null;
|
|
7
|
+
componentDidMount(): void;
|
|
8
|
+
componentDidUpdate(): void;
|
|
9
|
+
render(): React.ReactNode;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __extends = this && this.__extends || function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf || {
|
|
4
|
+
__proto__: []
|
|
5
|
+
} instanceof Array && function (d, b) {
|
|
6
|
+
d.__proto__ = b;
|
|
7
|
+
} || function (d, b) {
|
|
8
|
+
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
9
|
+
};
|
|
10
|
+
return extendStatics(d, b);
|
|
11
|
+
};
|
|
12
|
+
return function (d, b) {
|
|
13
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
14
|
+
extendStatics(d, b);
|
|
15
|
+
function __() {
|
|
16
|
+
this.constructor = d;
|
|
17
|
+
}
|
|
18
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
+
};
|
|
20
|
+
}();
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { findDOMNode } from 'react-dom';
|
|
23
|
+
var Wrapper = /** @class */function (_super) {
|
|
24
|
+
__extends(Wrapper, _super);
|
|
25
|
+
function Wrapper() {
|
|
26
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
+
_this.element = null;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
Wrapper.prototype.componentDidMount = function () {
|
|
31
|
+
this.componentDidUpdate();
|
|
32
|
+
};
|
|
33
|
+
Wrapper.prototype.componentDidUpdate = function () {
|
|
34
|
+
// eslint-disable-next-line
|
|
35
|
+
var node = findDOMNode(this);
|
|
36
|
+
if (node instanceof Element) {
|
|
37
|
+
this.element = node;
|
|
38
|
+
} else {
|
|
39
|
+
this.element = null;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
Wrapper.prototype.render = function () {
|
|
43
|
+
return React.Children.only(this.props.children);
|
|
44
|
+
};
|
|
45
|
+
return Wrapper;
|
|
46
|
+
}(React.Component);
|
|
47
|
+
export { Wrapper };
|
|
@@ -12,42 +12,30 @@
|
|
|
12
12
|
position: absolute;
|
|
13
13
|
z-index: 100;
|
|
14
14
|
}
|
|
15
|
+
.ebscn-popup-body .ebscn-popup-close-icon {
|
|
16
|
+
left: 16px;
|
|
17
|
+
top: 22.5px;
|
|
18
|
+
}
|
|
15
19
|
.ebscn-popup-body-position-bottom {
|
|
16
20
|
width: 100%;
|
|
17
21
|
bottom: 0;
|
|
18
22
|
left: 0;
|
|
19
23
|
}
|
|
20
|
-
.ebscn-popup-body-position-bottom .ebscn-popup-close-icon {
|
|
21
|
-
left: 8px;
|
|
22
|
-
top: 8px;
|
|
23
|
-
}
|
|
24
24
|
.ebscn-popup-body-position-top {
|
|
25
25
|
width: 100%;
|
|
26
26
|
top: 0;
|
|
27
27
|
left: 0;
|
|
28
28
|
}
|
|
29
|
-
.ebscn-popup-body-position-top .ebscn-popup-close-icon {
|
|
30
|
-
left: 8px;
|
|
31
|
-
bottom: 8px;
|
|
32
|
-
}
|
|
33
29
|
.ebscn-popup-body-position-left {
|
|
34
30
|
height: 100%;
|
|
35
31
|
top: 0;
|
|
36
32
|
left: 0;
|
|
37
33
|
}
|
|
38
|
-
.ebscn-popup-body-position-left .ebscn-popup-close-icon {
|
|
39
|
-
left: 8px;
|
|
40
|
-
top: 8px;
|
|
41
|
-
}
|
|
42
34
|
.ebscn-popup-body-position-right {
|
|
43
35
|
height: 100%;
|
|
44
36
|
top: 0;
|
|
45
37
|
right: 0;
|
|
46
38
|
}
|
|
47
|
-
.ebscn-popup-body-position-right .ebscn-popup-close-icon {
|
|
48
|
-
left: 8px;
|
|
49
|
-
top: 8px;
|
|
50
|
-
}
|
|
51
39
|
.ebscn-popup-close-icon {
|
|
52
40
|
cursor: pointer;
|
|
53
41
|
padding: 4px;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Checkbox, Button } from '../..';
|
|
2
|
-
import { Popover } from 'antd-mobile';
|
|
1
|
+
import { Checkbox, Button, Popover } from '../..';
|
|
3
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
5
4
|
var defaultProps = {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
align-items: center;
|
|
15
15
|
}
|
|
16
16
|
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-grey {
|
|
17
|
-
--background-color: #
|
|
17
|
+
--background-color: #f5f6fa;
|
|
18
18
|
}
|
|
19
19
|
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-grey .ebscn-pull-to-refresh-complete,
|
|
20
20
|
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-grey .ebscn-pull-to-refresh-canRelease,
|
|
@@ -22,6 +22,15 @@
|
|
|
22
22
|
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-grey .ebscn-pull-to-refresh-refreshing {
|
|
23
23
|
color: #666;
|
|
24
24
|
}
|
|
25
|
+
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-dark {
|
|
26
|
+
--background-color: #111111;
|
|
27
|
+
}
|
|
28
|
+
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-dark .ebscn-pull-to-refresh-complete,
|
|
29
|
+
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-dark .ebscn-pull-to-refresh-canRelease,
|
|
30
|
+
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-dark .ebscn-pull-to-refresh-pulling,
|
|
31
|
+
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-dark .ebscn-pull-to-refresh-refreshing {
|
|
32
|
+
color: white;
|
|
33
|
+
}
|
|
25
34
|
.ebscn-pull-to-refresh-head.ebscn-pull-to-refresh-head-primary {
|
|
26
35
|
--background-color: var(--ebscn-color-primary);
|
|
27
36
|
}
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export type PullStatus = 'pulling' | 'canRelease' | 'refreshing' | 'complete';
|
|
4
4
|
export type PullToRefreshProps = {
|
|
5
|
-
color?: 'primary' | 'grey';
|
|
5
|
+
color?: 'primary' | 'grey' | 'dark';
|
|
6
6
|
onRefresh?: () => Promise<any>;
|
|
7
7
|
pullingText?: ReactNode;
|
|
8
8
|
canReleaseText?: ReactNode;
|
|
@@ -141,28 +141,28 @@ export var PullToRefresh = function (p) {
|
|
|
141
141
|
var props = mergeProps(defaultProps, {
|
|
142
142
|
refreshingText: React.createElement("div", {
|
|
143
143
|
className: "".concat(classPrefix, "-refreshing")
|
|
144
|
-
}, React.createElement(Suspense, null, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color)
|
|
144
|
+
}, React.createElement(Suspense, null, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color) !== 'grey' ? React.createElement("img", {
|
|
145
145
|
src: PullLoadingRefreshingWhite
|
|
146
146
|
}) : React.createElement("img", {
|
|
147
147
|
src: PullLoadingRefreshingGrey
|
|
148
148
|
})), React.createElement("p", null, " "))),
|
|
149
149
|
pullingText: React.createElement("div", {
|
|
150
150
|
className: "".concat(classPrefix, "-pulling")
|
|
151
|
-
}, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color)
|
|
151
|
+
}, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color) !== 'grey' ? React.createElement("img", {
|
|
152
152
|
src: PullLoadingWhite
|
|
153
153
|
}) : React.createElement("img", {
|
|
154
154
|
src: PullLoadingGrey
|
|
155
155
|
})), React.createElement("p", null, " ")),
|
|
156
156
|
canReleaseText: React.createElement("div", {
|
|
157
157
|
className: "".concat(classPrefix, "-canRelease")
|
|
158
|
-
}, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color)
|
|
158
|
+
}, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color) !== 'grey' ? React.createElement("img", {
|
|
159
159
|
src: PullLoadingWhite
|
|
160
160
|
}) : React.createElement("img", {
|
|
161
161
|
src: PullLoadingGrey
|
|
162
162
|
})), React.createElement("p", null, "\u677E\u5F00\u5237\u65B0")),
|
|
163
163
|
completeText: React.createElement("div", {
|
|
164
164
|
className: "".concat(classPrefix, "-complete")
|
|
165
|
-
}, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color)
|
|
165
|
+
}, React.createElement("div", null, (p === null || p === void 0 ? void 0 : p.color) !== 'grey' ? React.createElement("img", {
|
|
166
166
|
src: PullLoadingWhite
|
|
167
167
|
}) : React.createElement("img", {
|
|
168
168
|
src: PullLoadingGrey
|
|
@@ -323,7 +323,7 @@ export var PullToRefresh = function (p) {
|
|
|
323
323
|
className: classPrefix
|
|
324
324
|
}, React.createElement(animated.div, {
|
|
325
325
|
style: springStyles,
|
|
326
|
-
className: classNames("".concat(classPrefix, "-head"), (_a = {}, _a["".concat(classPrefix, "-head-primary")] = props.color === 'primary', _a["".concat(classPrefix, "-head-grey")] = props.color === 'grey', _a))
|
|
326
|
+
className: classNames("".concat(classPrefix, "-head"), (_a = {}, _a["".concat(classPrefix, "-head-primary")] = props.color === 'primary', _a["".concat(classPrefix, "-head-grey")] = props.color === 'grey', _a["".concat(classPrefix, "-head-dark")] = props.color === 'dark', _a))
|
|
327
327
|
}, React.createElement("div", {
|
|
328
328
|
className: "".concat(classPrefix, "-head-content"),
|
|
329
329
|
style: {
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
border-radius: var(--icon-size);
|
|
22
22
|
border: 1px solid var(--ebscn-color-light);
|
|
23
23
|
box-sizing: border-box;
|
|
24
|
+
width: 24px;
|
|
24
25
|
width: var(--icon-size);
|
|
26
|
+
height: 24px;
|
|
25
27
|
height: var(--icon-size);
|
|
26
28
|
color: var(--ebscn-color-text-light-solid);
|
|
27
29
|
}
|
|
@@ -37,6 +39,9 @@
|
|
|
37
39
|
.ebscn-radio.ebscn-radio-block {
|
|
38
40
|
display: flex;
|
|
39
41
|
}
|
|
42
|
+
.ebscn-radio.ebscn-radio-checked.ebscn-radio-icon-right {
|
|
43
|
+
color: var(--ebscn-color-primary);
|
|
44
|
+
}
|
|
40
45
|
.ebscn-radio.ebscn-radio-checked .ebscn-radio-icon {
|
|
41
46
|
border-color: var(--ebscn-color-primary);
|
|
42
47
|
background-color: var(--ebscn-color-primary);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
---gap-horizontal: var(--gap-horizontal, var(--gap));
|
|
13
13
|
---gap-vertical: var(--gap-vertical, var(--gap));
|
|
14
14
|
overflow: hidden;
|
|
15
|
-
font-size: var(--ebscn-font-size-
|
|
15
|
+
font-size: var(--ebscn-font-size-6);
|
|
16
16
|
line-height: 1.4;
|
|
17
17
|
}
|
|
18
18
|
.ebscn-selector .ebscn-space.ebscn-space {
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
--width: 100%;
|
|
3
3
|
--height: 0;
|
|
4
4
|
--border-radius: 3px;
|
|
5
|
-
background-color:
|
|
5
|
+
background-color: #f8f9fc;
|
|
6
6
|
border-radius: var(--border-radius);
|
|
7
7
|
width: var(--width);
|
|
8
8
|
height: var(--height);
|
|
9
9
|
display: block;
|
|
10
10
|
}
|
|
11
11
|
.ebscn-skeleton.ebscn-skeleton-animated {
|
|
12
|
-
background: linear-gradient(90deg, rgba(
|
|
12
|
+
background: linear-gradient(90deg, rgba(248, 249, 245) 25%, rgba(248, 249, 245, 0.3) 37%, rgba(248, 249, 245) 63%);
|
|
13
13
|
background-size: 400% 100%;
|
|
14
14
|
animation: ebscn-skeleton-loading 1.3s ease infinite;
|
|
15
15
|
}
|
|
16
16
|
.ebscn-skeleton.ebscn-skeleton-primary {
|
|
17
|
-
background-color: rgba(
|
|
17
|
+
background-color: rgba(255, 66, 37, 0.2);
|
|
18
18
|
}
|
|
19
19
|
.ebscn-skeleton.ebscn-skeleton-primary.ebscn-skeleton.ebscn-skeleton-primary-animated {
|
|
20
|
-
background: linear-gradient(90deg, rgba(
|
|
20
|
+
background: linear-gradient(90deg, rgba(255, 216, 214) 25%, rgba(255, 216, 214, 0.3) 37%, rgba(255, 216, 214) 63%);
|
|
21
21
|
background-size: 400% 100%;
|
|
22
22
|
animation: ebscn-skeleton-loading 1.3s ease infinite;
|
|
23
23
|
}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
.ebscn-squared-grid-item {
|
|
13
13
|
flex: 0 0 var(--flex-basic);
|
|
14
14
|
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
15
|
align-items: center;
|
|
17
16
|
flex-direction: var(--item-flex-direction);
|
|
18
17
|
}
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
width: var(--icon-size);
|
|
21
20
|
height: var(--icon-size);
|
|
22
21
|
font-size: var(--icon-size);
|
|
23
|
-
|
|
22
|
+
padding: 6px;
|
|
24
23
|
}
|
|
25
24
|
.ebscn-squared-grid-item-label {
|
|
26
25
|
font-size: var(--ebscn-font-size-5);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
1
|
+
import type { CSSProperties, FC, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import { PageIndicatorProps } from '../page-indicator';
|
|
5
5
|
export type SquaredGridProps = {
|
|
6
6
|
maxColumns?: number;
|
|
7
7
|
maxRow?: number;
|
|
8
|
+
justifyContent?: CSSProperties['justifyContent'];
|
|
8
9
|
children?: ReactNode;
|
|
9
10
|
indicatorProps?: Pick<PageIndicatorProps, 'color' | 'style' | 'className'>;
|
|
10
11
|
} & NativeProps<'--row-gap' | '--icon-size'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Swiper } from '../..';
|
|
2
1
|
import classnames from 'classnames';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { Swiper } from '../..';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
6
|
var classPrefix = "ebscn-squared-grid";
|
|
@@ -31,8 +31,17 @@ export var SquaredGrid = function (p) {
|
|
|
31
31
|
var children = React.Children.toArray(props === null || props === void 0 ? void 0 : props.children);
|
|
32
32
|
var pageSize = maxColumns * maxRow;
|
|
33
33
|
var overPage = pageSize < children.length;
|
|
34
|
+
var justifyContent = props.justifyContent;
|
|
35
|
+
if (!justifyContent) {
|
|
36
|
+
if (children.length > maxColumns) {
|
|
37
|
+
justifyContent = 'flex-start';
|
|
38
|
+
} else {
|
|
39
|
+
justifyContent = 'space-around';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
34
42
|
var style = {
|
|
35
|
-
'--flex': "".concat(100 / maxColumns, "%")
|
|
43
|
+
'--flex': "".concat(100 / maxColumns, "%"),
|
|
44
|
+
justifyContent: justifyContent
|
|
36
45
|
};
|
|
37
46
|
var renderSwiperItems = function () {
|
|
38
47
|
var pages = chunkArray(children, pageSize);
|