@univerjs/design 0.3.0 → 0.4.0-alpha.0
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/lib/es/index.js
CHANGED
|
@@ -13502,7 +13502,8 @@ function calcPopupPosition(layout) {
|
|
|
13502
13502
|
}
|
|
13503
13503
|
__name(calcPopupPosition, "calcPopupPosition");
|
|
13504
13504
|
function RectPopup(props) {
|
|
13505
|
-
const { children, anchorRect, direction = "vertical", onClickOutside, excludeOutside, excludeRects,
|
|
13505
|
+
const { children, anchorRect, direction = "vertical", onClickOutside, excludeOutside, excludeRects, onPointerEnter, onPointerLeave, onClick, hidden, onContextMenu } = props, nodeRef = useRef(null), clickOtherFn = useEvent(onClickOutside != null ? onClickOutside : () => {
|
|
13506
|
+
}), contextMenuFn = useEvent(onContextMenu != null ? onContextMenu : () => {
|
|
13506
13507
|
}), [position, setPosition] = useState({
|
|
13507
13508
|
top: -9999,
|
|
13508
13509
|
left: -9999
|
|
@@ -13547,11 +13548,15 @@ function RectPopup(props) {
|
|
|
13547
13548
|
return;
|
|
13548
13549
|
clickOtherFn(e2);
|
|
13549
13550
|
}, "handleClickOther");
|
|
13550
|
-
return window.addEventListener("pointerdown", handleClickOther), () =>
|
|
13551
|
-
|
|
13551
|
+
return window.addEventListener("pointerdown", handleClickOther), () => {
|
|
13552
|
+
window.removeEventListener("pointerdown", handleClickOther);
|
|
13553
|
+
};
|
|
13554
|
+
}, [anchorRect, anchorRect.bottom, anchorRect.left, anchorRect.right, anchorRect.top, clickOtherFn, excludeOutside]), useEffect(() => (window.addEventListener("contextmenu", contextMenuFn), () => {
|
|
13555
|
+
window.removeEventListener("contextmenu", contextMenuFn);
|
|
13556
|
+
}), [contextMenuFn]), /* @__PURE__ */ React__default.createElement(
|
|
13552
13557
|
"section",
|
|
13553
13558
|
{
|
|
13554
|
-
onPointerEnter
|
|
13559
|
+
onPointerEnter,
|
|
13555
13560
|
onPointerLeave,
|
|
13556
13561
|
ref: nodeRef,
|
|
13557
13562
|
style: { ...style2, ...hidden ? { display: "none" } : null },
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"design": {
|
|
3
|
+
"Confirm": {
|
|
4
|
+
"cancel": "لغو",
|
|
5
|
+
"confirm": "باشه"
|
|
6
|
+
},
|
|
7
|
+
"Slider": {
|
|
8
|
+
"resetTo": "بازنشانی به"
|
|
9
|
+
},
|
|
10
|
+
"Picker": {
|
|
11
|
+
"name": "en",
|
|
12
|
+
"weekdays": [
|
|
13
|
+
"Sunday",
|
|
14
|
+
"Monday",
|
|
15
|
+
"Tuesday",
|
|
16
|
+
"Wednesday",
|
|
17
|
+
"Thursday",
|
|
18
|
+
"Friday",
|
|
19
|
+
"Saturday"
|
|
20
|
+
],
|
|
21
|
+
"months": [
|
|
22
|
+
"January",
|
|
23
|
+
"February",
|
|
24
|
+
"March",
|
|
25
|
+
"April",
|
|
26
|
+
"May",
|
|
27
|
+
"June",
|
|
28
|
+
"July",
|
|
29
|
+
"August",
|
|
30
|
+
"September",
|
|
31
|
+
"October",
|
|
32
|
+
"November",
|
|
33
|
+
"December"
|
|
34
|
+
],
|
|
35
|
+
"yearFormat": "YYYY",
|
|
36
|
+
"dayFormat": "D",
|
|
37
|
+
"cellMeridiemFormat": "A",
|
|
38
|
+
"monthBeforeYear": true,
|
|
39
|
+
"locale": "en_US",
|
|
40
|
+
"today": "Today",
|
|
41
|
+
"now": "Now",
|
|
42
|
+
"backToToday": "Back to today",
|
|
43
|
+
"ok": "OK",
|
|
44
|
+
"clear": "Clear",
|
|
45
|
+
"month": "Month",
|
|
46
|
+
"year": "Year",
|
|
47
|
+
"timeSelect": "select time",
|
|
48
|
+
"dateSelect": "select date",
|
|
49
|
+
"weekSelect": "Choose a week",
|
|
50
|
+
"monthSelect": "Choose a month",
|
|
51
|
+
"yearSelect": "Choose a year",
|
|
52
|
+
"decadeSelect": "Choose a decade",
|
|
53
|
+
"dateFormat": "M/D/YYYY",
|
|
54
|
+
"dateTimeFormat": "M/D/YYYY HH:mm:ss",
|
|
55
|
+
"previousMonth": "Previous month (PageUp)",
|
|
56
|
+
"nextMonth": "Next month (PageDown)",
|
|
57
|
+
"previousYear": "Last year (Control + left)",
|
|
58
|
+
"nextYear": "Next year (Control + right)",
|
|
59
|
+
"previousDecade": "Last decade",
|
|
60
|
+
"nextDecade": "Next decade",
|
|
61
|
+
"previousCentury": "Last century",
|
|
62
|
+
"nextCentury": "Next century"
|
|
63
|
+
},
|
|
64
|
+
"CascaderList": {
|
|
65
|
+
"empty": "هیچ کدام"
|
|
66
|
+
},
|
|
67
|
+
"Select": {
|
|
68
|
+
"empty": "هیچکدام"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -16,7 +16,8 @@ export interface IRectPopupProps {
|
|
|
16
16
|
hidden?: boolean;
|
|
17
17
|
onClickOutside?: (e: MouseEvent) => void;
|
|
18
18
|
excludeOutside?: HTMLElement[];
|
|
19
|
-
|
|
19
|
+
onContextMenu?: () => void;
|
|
20
|
+
onPointerEnter?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
20
21
|
onPointerLeave?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
21
22
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
22
23
|
}
|