@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
|
@@ -1,77 +1,90 @@
|
|
|
1
|
+
html[data-prefers-color-scheme='dark'] .ebscn-number-keyboard-delete {
|
|
2
|
+
background: url(../../assets/images/delete_dark.png) var(--ebscn-color-keyboard-fckey-bg) no-repeat center;
|
|
3
|
+
background-size: 25px 25px;
|
|
4
|
+
}
|
|
1
5
|
.ebscn-number-keyboard {
|
|
2
6
|
display: none;
|
|
3
7
|
position: fixed;
|
|
8
|
+
z-index: 9999;
|
|
4
9
|
bottom: 0;
|
|
10
|
+
left: 0;
|
|
5
11
|
transform: translateY(101%);
|
|
6
12
|
display: flex;
|
|
7
13
|
flex-wrap: wrap;
|
|
8
14
|
width: 100%;
|
|
9
|
-
height:
|
|
10
|
-
padding:
|
|
15
|
+
height: 223px;
|
|
16
|
+
padding: 3px;
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
background-color: var(--ebscn-color-keyboard-bg);
|
|
19
|
+
box-sizing: border-box;
|
|
11
20
|
transition: all 0.5s;
|
|
12
21
|
align-content: flex-start;
|
|
13
22
|
}
|
|
14
|
-
.ebscn-number-keyboard :last-child {
|
|
15
|
-
background: var(--ebscn-color-primary);
|
|
16
|
-
color: var(--ebscn-color-background);
|
|
17
|
-
}
|
|
18
23
|
.ebscn-number-keyboard-key {
|
|
19
|
-
width: 25
|
|
20
|
-
height:
|
|
21
|
-
line-height:
|
|
24
|
+
width: calc(25% - 8.25px);
|
|
25
|
+
height: 46px;
|
|
26
|
+
line-height: 46px;
|
|
27
|
+
border-radius: 4.17px;
|
|
28
|
+
margin: 3px;
|
|
22
29
|
text-align: center;
|
|
23
|
-
font-
|
|
24
|
-
font-
|
|
25
|
-
color:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
background: var(--ebscn-color-
|
|
30
|
+
font-weight: 400;
|
|
31
|
+
font-size: 23px;
|
|
32
|
+
color: #333;
|
|
33
|
+
color: var(--ebscn-color-text);
|
|
34
|
+
background-color: #fff;
|
|
35
|
+
background-color: var(--ebscn-color-keyboard-key-bg);
|
|
36
|
+
border: 0.5px solid #888;
|
|
37
|
+
border-color: var(--ebscn-color-keyboard-key-border);
|
|
29
38
|
}
|
|
30
39
|
.ebscn-number-keyboard-key:active {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
font-size:
|
|
36
|
-
|
|
37
|
-
font-weight: 300;
|
|
38
|
-
box-shadow: 0 0 0 1px #cccccc;
|
|
39
|
-
background: var(--ebscn-color-border);
|
|
40
|
+
background-color: #e5e5e5;
|
|
41
|
+
background-color: var(--ebscn-color-keyboard-key-bg-active);
|
|
42
|
+
}
|
|
43
|
+
.ebscn-number-keyboard-ABC {
|
|
44
|
+
font-size: 19px;
|
|
45
|
+
font-size: var(--ebscn-font-size-11);
|
|
40
46
|
}
|
|
41
47
|
.ebscn-number-keyboard-option {
|
|
48
|
+
font-size: 19px;
|
|
42
49
|
font-size: var(--ebscn-font-size-11);
|
|
43
|
-
|
|
50
|
+
color: #333;
|
|
51
|
+
color: var(--ebscn-color-text);
|
|
52
|
+
background-color: #adb3bd;
|
|
53
|
+
background-color: var(--ebscn-color-keyboard-fckey-bg);
|
|
54
|
+
border-color: var(--ebscn-color-keyboard-fckey-border);
|
|
44
55
|
}
|
|
45
56
|
.ebscn-number-keyboard-option:active {
|
|
46
|
-
|
|
47
|
-
background:
|
|
57
|
+
background-color: #252525;
|
|
58
|
+
background-color: var(--ebscn-color-keyboard-fckey-bg-active);
|
|
48
59
|
}
|
|
49
60
|
.ebscn-number-keyboard-delete {
|
|
50
|
-
background: url(../../assets/images/delete.png)
|
|
51
|
-
background-
|
|
61
|
+
background: url(../../assets/images/delete.png) no-repeat center;
|
|
62
|
+
background-color: #adb3bd;
|
|
63
|
+
background-color: var(--ebscn-color-keyboard-fckey-bg);
|
|
64
|
+
background-size: 25px 25px;
|
|
65
|
+
border-color: var(--ebscn-color-keyboard-fckey-border);
|
|
52
66
|
}
|
|
53
67
|
.ebscn-number-keyboard-delete:active {
|
|
54
|
-
background: url(../../assets/images/delete.png)
|
|
55
|
-
background-
|
|
68
|
+
background: url(../../assets/images/delete.png) no-repeat center;
|
|
69
|
+
background-color: #252525;
|
|
70
|
+
background-color: var(--ebscn-color-keyboard-fckey-bg-active);
|
|
71
|
+
background-size: 25px 25px;
|
|
56
72
|
}
|
|
57
73
|
.ebscn-number-keyboard-confirmKey {
|
|
74
|
+
background-color: #e84225;
|
|
58
75
|
background-color: var(--ebscn-color-primary);
|
|
59
|
-
|
|
60
|
-
height: 54px;
|
|
61
|
-
line-height: 54px;
|
|
62
|
-
text-align: center;
|
|
76
|
+
font-size: 19px;
|
|
63
77
|
font-size: var(--ebscn-font-size-11);
|
|
64
|
-
color:
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
color: #fff;
|
|
79
|
+
color: var(--ebscn-color-white);
|
|
80
|
+
border-color: var(--ebscn-color-keyboard-fckey-border);
|
|
67
81
|
}
|
|
68
82
|
.ebscn-number-keyboard-confirmKey:active {
|
|
69
|
-
background-color: #
|
|
70
|
-
color: var(--ebscn-color-background);
|
|
83
|
+
background-color: #d13c21;
|
|
71
84
|
}
|
|
72
85
|
@supports (bottom: env(safe-area-inset-bottom)) or (constant(safe-area-inset-bottom)) {
|
|
73
86
|
.ebscn-number-keyboard {
|
|
74
|
-
height: calc(
|
|
75
|
-
height: calc(
|
|
87
|
+
height: calc(223px + env(safe-area-inset-bottom));
|
|
88
|
+
height: calc(223px + constant(safe-area-inset-bottom));
|
|
76
89
|
}
|
|
77
90
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import './number-keyboard.less';
|
|
3
4
|
export type NumberKeyboardProps = {
|
|
4
5
|
types?: 'fullKeyboard' | 'numberKeyboard' | 'numberKeyboardWithDot';
|
|
5
6
|
type?: 'fullKeyboard' | 'numberKeyboard' | 'numberKeyboardWithDot';
|
|
@@ -3,6 +3,7 @@ import { useEffect, useRef } from "react";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
|
+
import "./number-keyboard.css";
|
|
6
7
|
var classPrefix = 'ebscn-number-keyboard';
|
|
7
8
|
var defaultProps = {
|
|
8
9
|
types: 'numberKeyboard',
|
|
@@ -74,7 +75,7 @@ export function NumberKeyboard(p) {
|
|
|
74
75
|
}, keys.map(function (item, index) {
|
|
75
76
|
return React.createElement("div", {
|
|
76
77
|
key: item || index,
|
|
77
|
-
className: cns(
|
|
78
|
+
className: cns("".concat(classPrefix, "-key"), item === 'ABC' ? "".concat(classPrefix, "-ABC") : '', typeof item !== 'number' && item.length && item !== '.' && item !== '确定' && item !== 'ABC' ? "".concat(classPrefix, "-option") : item == '确定' ? "".concat(classPrefix, "-confirmKey") : "".concat(classPrefix, "-number-key"), item === 'X' && "".concat(classPrefix, "-delete")),
|
|
78
79
|
onClick: function () {
|
|
79
80
|
if (visible) {
|
|
80
81
|
onKeyPress(item);
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
padding: 4px 4px;
|
|
26
26
|
}
|
|
27
27
|
.ebscn-picker-header-button {
|
|
28
|
+
font-size: 14px;
|
|
28
29
|
font-size: var(--header-button-font-size);
|
|
29
30
|
display: inline-block;
|
|
30
31
|
padding: 8px 8px;
|
|
@@ -36,7 +37,9 @@
|
|
|
36
37
|
}
|
|
37
38
|
.ebscn-picker-header-title {
|
|
38
39
|
padding: 4px 4px;
|
|
40
|
+
font-size: 14px;
|
|
39
41
|
font-size: var(--title-font-size);
|
|
42
|
+
color: #333;
|
|
40
43
|
color: var(--ebscn-color-text);
|
|
41
44
|
text-align: center;
|
|
42
45
|
flex: 1;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
.ebscn-picker-view {
|
|
2
2
|
--height: 240px;
|
|
3
|
-
--item-height:
|
|
3
|
+
--item-height: 33px;
|
|
4
4
|
--item-font-size: var(--ebscn-font-size-8);
|
|
5
|
+
height: 240px;
|
|
5
6
|
height: var(--height);
|
|
6
7
|
width: 100%;
|
|
7
8
|
display: flex;
|
|
8
9
|
position: relative;
|
|
9
10
|
overflow: hidden;
|
|
11
|
+
background: #fff;
|
|
10
12
|
background: var(--ebscn-color-background);
|
|
11
13
|
}
|
|
12
14
|
.ebscn-picker-view-column {
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
cursor: -webkit-grab;
|
|
24
26
|
cursor: grab;
|
|
25
27
|
position: absolute;
|
|
28
|
+
top: calc(50% - 16.5px);
|
|
26
29
|
top: calc(50% - var(--item-height) / 2);
|
|
27
30
|
left: 0;
|
|
28
31
|
}
|
|
@@ -43,8 +46,10 @@
|
|
|
43
46
|
bottom: -100vh;
|
|
44
47
|
}
|
|
45
48
|
.ebscn-picker-view-column-item {
|
|
49
|
+
font-size: 16px;
|
|
46
50
|
font-size: var(--item-font-size);
|
|
47
51
|
padding: 0 6px;
|
|
52
|
+
height: 33px;
|
|
48
53
|
height: var(--item-height);
|
|
49
54
|
display: flex;
|
|
50
55
|
justify-content: center;
|
|
@@ -63,6 +68,7 @@
|
|
|
63
68
|
display: flex;
|
|
64
69
|
flex-direction: column;
|
|
65
70
|
position: relative;
|
|
71
|
+
top: -33px;
|
|
66
72
|
top: calc(var(--item-height) * -1);
|
|
67
73
|
z-index: 0;
|
|
68
74
|
padding-bottom: 1px;
|
|
@@ -96,10 +102,12 @@
|
|
|
96
102
|
flex: auto;
|
|
97
103
|
}
|
|
98
104
|
.ebscn-picker-view-mask-middle {
|
|
105
|
+
height: 33px;
|
|
99
106
|
height: var(--item-height);
|
|
107
|
+
margin: 0 16px;
|
|
100
108
|
box-sizing: border-box;
|
|
101
109
|
flex: none;
|
|
102
|
-
background-color: rgba(0, 0, 0, 0.
|
|
110
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
103
111
|
z-index: 0;
|
|
104
112
|
}
|
|
105
113
|
.ebscn-picker-view-mask-top {
|
|
@@ -123,6 +131,7 @@
|
|
|
123
131
|
position: relative;
|
|
124
132
|
left: 0;
|
|
125
133
|
top: 0;
|
|
134
|
+
height: 33px;
|
|
126
135
|
height: var(--item-height);
|
|
127
136
|
width: 0;
|
|
128
137
|
pointer-events: none;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
export var Arrow = memo(function (props) {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
viewBox: '0 0 30 16'
|
|
6
|
+
}, React.createElement("g", {
|
|
7
|
+
fill: 'currentColor'
|
|
8
|
+
}, React.createElement("path", {
|
|
9
|
+
d: 'M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z'
|
|
10
|
+
}))));
|
|
11
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './popover.less';
|
|
3
|
+
import './popover-menu.less';
|
|
4
|
+
export type { PopoverProps, PopoverRef } from './popover';
|
|
5
|
+
export type { PopoverMenuProps, Action } from './popover-menu';
|
|
6
|
+
export type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
7
|
+
export type DeprecatedPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
8
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
defaultVisible?: boolean | undefined;
|
|
10
|
+
visible?: boolean | undefined;
|
|
11
|
+
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
12
|
+
getContainer?: import("../../utils/render-to-container").GetContainer | undefined;
|
|
13
|
+
destroyOnHide?: boolean | undefined;
|
|
14
|
+
children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
mode?: "dark" | "light" | undefined;
|
|
16
|
+
trigger?: "click" | undefined;
|
|
17
|
+
placement?: Placement | DeprecatedPlacement | undefined;
|
|
18
|
+
stopPropagation?: "click"[] | undefined;
|
|
19
|
+
content: import("react").ReactNode;
|
|
20
|
+
} & {
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
style?: (import("react").CSSProperties & Partial<Record<"--z-index" | "--arrow-size", string>>) | undefined;
|
|
23
|
+
tabIndex?: number | undefined;
|
|
24
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
25
|
+
Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
|
|
26
|
+
actions: import("./popover-menu").Action[];
|
|
27
|
+
maxCount?: number | undefined;
|
|
28
|
+
onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
|
|
29
|
+
} & import("react").RefAttributes<import("./popover").PopoverRef>>;
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./popover.css";
|
|
2
|
+
import "./popover-menu.css";
|
|
3
|
+
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component';
|
|
4
|
+
import { PopoverMenu } from './popover-menu';
|
|
5
|
+
import { Popover } from './popover';
|
|
6
|
+
export default attachPropertiesToComponent(Popover, {
|
|
7
|
+
Menu: PopoverMenu
|
|
8
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var record = {
|
|
2
|
+
'topLeft': 'top-start',
|
|
3
|
+
'topRight': 'top-end',
|
|
4
|
+
'bottomLeft': 'bottom-start',
|
|
5
|
+
'bottomRight': 'bottom-end',
|
|
6
|
+
'leftTop': 'left-start',
|
|
7
|
+
'leftBottom': 'left-end',
|
|
8
|
+
'rightTop': 'right-start',
|
|
9
|
+
'rightBottom': 'right-end'
|
|
10
|
+
};
|
|
11
|
+
export function normalizePlacement(placement) {
|
|
12
|
+
var _a;
|
|
13
|
+
return (_a = record[placement]) !== null && _a !== void 0 ? _a : placement;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.ebscn-popover-menu {
|
|
2
|
+
--border-color: var(--ebscn-color-border);
|
|
3
|
+
}
|
|
4
|
+
.ebscn-popover-menu.ebscn-popover {
|
|
5
|
+
--content-padding: 0;
|
|
6
|
+
}
|
|
7
|
+
.ebscn-popover-menu-list {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
min-width: 120px;
|
|
10
|
+
}
|
|
11
|
+
.ebscn-popover-menu-list-inner {
|
|
12
|
+
margin-top: -1px;
|
|
13
|
+
}
|
|
14
|
+
.ebscn-popover-menu-list-scroll {
|
|
15
|
+
padding-right: 2px;
|
|
16
|
+
overflow-y: scroll;
|
|
17
|
+
-webkit-overflow-scrolling: auto;
|
|
18
|
+
}
|
|
19
|
+
.ebscn-popover-menu-list-scroll::-webkit-scrollbar {
|
|
20
|
+
-webkit-appearance: none;
|
|
21
|
+
width: 4px;
|
|
22
|
+
}
|
|
23
|
+
.ebscn-popover-menu-list-scroll::-webkit-scrollbar-thumb {
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
background-color: #ddd;
|
|
26
|
+
}
|
|
27
|
+
.ebscn-popover-menu-item {
|
|
28
|
+
display: flex;
|
|
29
|
+
padding-left: 20px;
|
|
30
|
+
justify-content: flex-start;
|
|
31
|
+
align-items: center;
|
|
32
|
+
position: relative;
|
|
33
|
+
}
|
|
34
|
+
.ebscn-popover-menu-item-icon {
|
|
35
|
+
flex: none;
|
|
36
|
+
padding-right: 8px;
|
|
37
|
+
font-size: 20px;
|
|
38
|
+
}
|
|
39
|
+
.ebscn-popover-menu-item-text {
|
|
40
|
+
flex: auto;
|
|
41
|
+
padding: 14px 20px 14px 0;
|
|
42
|
+
border-top: solid 1px var(--border-color);
|
|
43
|
+
}
|
|
44
|
+
.ebscn-popover-menu-item-disabled {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
.ebscn-popover-menu-item-disabled > * {
|
|
48
|
+
opacity: 0.4;
|
|
49
|
+
}
|
|
50
|
+
.ebscn-popover-menu-item:active:not(.ebscn-popover-menu-item-disabled) {
|
|
51
|
+
background-color: var(--border-color);
|
|
52
|
+
}
|
|
53
|
+
.ebscn-popover-menu-item:active:not(.ebscn-popover-menu-item-disabled)::after {
|
|
54
|
+
content: ' ';
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: 100%;
|
|
58
|
+
bottom: -1px;
|
|
59
|
+
left: 0;
|
|
60
|
+
border-bottom: solid 1px var(--border-color);
|
|
61
|
+
}
|
|
62
|
+
.ebscn-popover.ebscn-popover-dark.ebscn-popover-menu {
|
|
63
|
+
--border-color: var(--ebscn-color-text);
|
|
64
|
+
--background: rgba(0, 0, 0, 0.9);
|
|
65
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { PopoverProps, PopoverRef } from './popover';
|
|
4
|
+
export type Action = {
|
|
5
|
+
text: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
key?: string | number;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type PopoverMenuProps = Omit<PopoverProps, 'content'> & {
|
|
12
|
+
actions: Action[];
|
|
13
|
+
maxCount?: number;
|
|
14
|
+
onAction?: (item: Action) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const PopoverMenu: React.ForwardRefExoticComponent<Omit<PopoverProps, "content"> & {
|
|
17
|
+
actions: Action[];
|
|
18
|
+
maxCount?: number | undefined;
|
|
19
|
+
onAction?: ((item: Action) => void) | undefined;
|
|
20
|
+
} & React.RefAttributes<PopoverRef>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import { Popover } from './popover';
|
|
14
|
+
var classPrefix = "ebscn-popover-menu";
|
|
15
|
+
export var PopoverMenu = forwardRef(function (props, ref) {
|
|
16
|
+
var innerRef = useRef(null);
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
|
+
useImperativeHandle(ref, function () {
|
|
19
|
+
return innerRef.current;
|
|
20
|
+
}, []);
|
|
21
|
+
var onClick = useCallback(function (e) {
|
|
22
|
+
var _a;
|
|
23
|
+
var onAction = props.onAction;
|
|
24
|
+
if (onAction) {
|
|
25
|
+
onAction(e);
|
|
26
|
+
}
|
|
27
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.hide();
|
|
28
|
+
}, [props.onAction]);
|
|
29
|
+
var overlay = useMemo(function () {
|
|
30
|
+
var _a;
|
|
31
|
+
var whetherScroll = (props === null || props === void 0 ? void 0 : props.maxCount) && props.actions.length > (props === null || props === void 0 ? void 0 : props.maxCount);
|
|
32
|
+
var innerHeight = (props === null || props === void 0 ? void 0 : props.maxCount) && (props === null || props === void 0 ? void 0 : props.maxCount) * 48;
|
|
33
|
+
return React.createElement("div", {
|
|
34
|
+
className: "".concat(classPrefix, "-list")
|
|
35
|
+
}, React.createElement("div", {
|
|
36
|
+
className: classNames("".concat(classPrefix, "-list-inner"), (_a = {}, _a["".concat(classPrefix, "-list-scroll")] = whetherScroll, _a)),
|
|
37
|
+
style: {
|
|
38
|
+
height: innerHeight
|
|
39
|
+
}
|
|
40
|
+
}, props.actions.map(function (action, index) {
|
|
41
|
+
var _a;
|
|
42
|
+
var _b;
|
|
43
|
+
return React.createElement("a", {
|
|
44
|
+
key: (_b = action.key) !== null && _b !== void 0 ? _b : index,
|
|
45
|
+
className: classNames("".concat(classPrefix, "-item"), 'ebscn-plain-anchor', (_a = {}, _a["".concat(classPrefix, "-item-disabled")] = action.disabled, _a)),
|
|
46
|
+
onClick: function () {
|
|
47
|
+
var _a;
|
|
48
|
+
if (action.disabled) return;
|
|
49
|
+
onClick(action);
|
|
50
|
+
(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action);
|
|
51
|
+
}
|
|
52
|
+
}, action.icon && React.createElement("div", {
|
|
53
|
+
className: "".concat(classPrefix, "-item-icon")
|
|
54
|
+
}, action.icon), React.createElement("div", {
|
|
55
|
+
className: "".concat(classPrefix, "-item-text")
|
|
56
|
+
}, action.text));
|
|
57
|
+
})));
|
|
58
|
+
}, [props.actions, onClick]);
|
|
59
|
+
return React.createElement(Popover, __assign({
|
|
60
|
+
ref: innerRef
|
|
61
|
+
}, props, {
|
|
62
|
+
className: classNames(classPrefix, props.className),
|
|
63
|
+
content: overlay
|
|
64
|
+
}), props.children);
|
|
65
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.ebscn-popover {
|
|
2
|
+
--z-index: var(--ebscn-popover-z-index, 1030);
|
|
3
|
+
--background: #ffffff;
|
|
4
|
+
--arrow-size: 8px;
|
|
5
|
+
--content-padding: 8px 12px;
|
|
6
|
+
color: var(--ebscn-color-text);
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
z-index: var(--z-index);
|
|
11
|
+
white-space: normal;
|
|
12
|
+
text-align: left;
|
|
13
|
+
cursor: auto;
|
|
14
|
+
-webkit-user-select: text;
|
|
15
|
+
user-select: text;
|
|
16
|
+
animation: none;
|
|
17
|
+
}
|
|
18
|
+
.ebscn-popover.ebscn-popover-dark {
|
|
19
|
+
--background: rgba(0, 0, 0, 0.75);
|
|
20
|
+
--ebscn-color-text: #ffffff;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
.ebscn-popover.ebscn-popover-dark .ebscn-popover-inner {
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
}
|
|
26
|
+
.ebscn-popover::after {
|
|
27
|
+
position: absolute;
|
|
28
|
+
background: rgba(255, 255, 255, 0.01);
|
|
29
|
+
content: '';
|
|
30
|
+
}
|
|
31
|
+
.ebscn-popover-hidden {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
.ebscn-popover-inner {
|
|
35
|
+
background-color: var(--background);
|
|
36
|
+
background-clip: padding-box;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
box-shadow: 0 0 30px 0 rgba(51, 51, 51, 0.2);
|
|
39
|
+
font-size: var(--ebscn-font-size-7);
|
|
40
|
+
width: -webkit-max-content;
|
|
41
|
+
width: max-content;
|
|
42
|
+
min-width: 32px;
|
|
43
|
+
max-width: calc(100vw - 24px);
|
|
44
|
+
overflow-y: hidden;
|
|
45
|
+
}
|
|
46
|
+
.ebscn-popover-inner-content {
|
|
47
|
+
padding: var(--content-padding);
|
|
48
|
+
}
|
|
49
|
+
.ebscn-popover-arrow {
|
|
50
|
+
position: absolute;
|
|
51
|
+
display: block;
|
|
52
|
+
height: var(--arrow-size);
|
|
53
|
+
width: var(--arrow-size);
|
|
54
|
+
overflow: visible;
|
|
55
|
+
background: transparent;
|
|
56
|
+
}
|
|
57
|
+
.ebscn-popover-arrow-icon {
|
|
58
|
+
display: block;
|
|
59
|
+
height: var(--arrow-size);
|
|
60
|
+
width: calc(var(--arrow-size) / 8 * 15);
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 50%;
|
|
63
|
+
left: 50%;
|
|
64
|
+
transform: translate(-50%, -50%) rotate(var(--arrow-icon-rotate));
|
|
65
|
+
}
|
|
66
|
+
.ebscn-popover .ebscn-popover-arrow {
|
|
67
|
+
color: var(--background);
|
|
68
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { NativeProps } from '../../utils/native-props';
|
|
4
|
+
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
5
|
+
import { GetContainer } from '../../utils/render-to-container';
|
|
6
|
+
import { DeprecatedPlacement, Placement } from './index';
|
|
7
|
+
export type PopoverProps = {
|
|
8
|
+
defaultVisible?: boolean;
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
11
|
+
getContainer?: GetContainer;
|
|
12
|
+
destroyOnHide?: boolean;
|
|
13
|
+
children: ReactElement;
|
|
14
|
+
mode?: 'light' | 'dark';
|
|
15
|
+
trigger?: 'click';
|
|
16
|
+
placement?: Placement | DeprecatedPlacement;
|
|
17
|
+
stopPropagation?: PropagationEvent[];
|
|
18
|
+
content: ReactNode;
|
|
19
|
+
} & NativeProps<'--z-index' | '--arrow-size'>;
|
|
20
|
+
export type PopoverRef = {
|
|
21
|
+
show: () => void;
|
|
22
|
+
hide: () => void;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const Popover: React.ForwardRefExoticComponent<{
|
|
26
|
+
defaultVisible?: boolean | undefined;
|
|
27
|
+
visible?: boolean | undefined;
|
|
28
|
+
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
29
|
+
getContainer?: GetContainer | undefined;
|
|
30
|
+
destroyOnHide?: boolean | undefined;
|
|
31
|
+
children: ReactElement;
|
|
32
|
+
mode?: "dark" | "light" | undefined;
|
|
33
|
+
trigger?: "click" | undefined;
|
|
34
|
+
placement?: Placement | DeprecatedPlacement | undefined;
|
|
35
|
+
stopPropagation?: "click"[] | undefined;
|
|
36
|
+
content: ReactNode;
|
|
37
|
+
} & {
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
style?: (React.CSSProperties & Partial<Record<"--z-index" | "--arrow-size", string>>) | undefined;
|
|
40
|
+
tabIndex?: number | undefined;
|
|
41
|
+
} & React.AriaAttributes & React.RefAttributes<PopoverRef>>;
|