@baishuyun/ui-mobile 0.4.0 → 0.6.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/README.md +2 -11
- package/dist/AMap/AMap-BWZ2lhXr.js +683 -0
- package/dist/AMap/index.js +5 -0
- package/dist/ActionSheet/ActionSheet-DbrKxa_y.js +133 -0
- package/dist/ActionSheet/index.js +5 -0
- package/dist/Calendar/Calendar-Bd6CS8y7.js +1580 -0
- package/dist/Calendar/index.js +4 -3
- package/dist/Calendar/timeUtils-t4A3-Hr6.js +27 -0
- package/dist/ConfigProvider/ConfigProvider-DnlakyRE.js +208 -0
- package/dist/ConfigProvider/index.js +4 -4
- package/dist/ConfigProvider/useLocale-CP8NRZoj.js +115 -0
- package/dist/Gantt/Gantt-CR7eRNVP.js +1094 -0
- package/dist/Gantt/index.js +7 -3
- package/dist/Icon/Icon-CFvcrGGg.js +23 -0
- package/dist/Icon/index.js +3 -0
- package/dist/components/AMap/AMap.d.ts +3 -0
- package/dist/components/AMap/Controls/Controls.d.ts +3 -0
- package/dist/components/AMap/Controls/index.d.ts +1 -0
- package/dist/components/AMap/Locate/Locate.d.ts +3 -0
- package/dist/components/AMap/Locate/index.d.ts +1 -0
- package/dist/components/AMap/Markers/Markers.d.ts +3 -0
- package/dist/components/AMap/Markers/index.d.ts +1 -0
- package/dist/components/AMap/PoiSearch/PoiSearch.d.ts +3 -0
- package/dist/components/AMap/PoiSearch/index.d.ts +1 -0
- package/dist/components/AMap/context.d.ts +7 -0
- package/dist/components/AMap/ensureAMap.d.ts +7 -0
- package/dist/components/AMap/index.d.ts +15 -0
- package/dist/components/AMap/interface.d.ts +66 -0
- package/dist/components/AMap/utils/cx.d.ts +1 -0
- package/dist/components/AMap/utils/geometry.d.ts +21 -0
- package/dist/components/AMap/utils/markerHtml.d.ts +21 -0
- package/dist/components/AMap/utils/searchPois.d.ts +6 -0
- package/dist/components/ActionSheet/ActionSheet.d.ts +3 -0
- package/dist/components/ActionSheet/index.d.ts +2 -0
- package/dist/components/ActionSheet/interface.d.ts +75 -0
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/Calendar/interface.d.ts +59 -1
- package/dist/components/ConfigProvider/ConfigContext.d.ts +11 -0
- package/dist/components/ConfigProvider/ConfigProvider.d.ts +1 -1
- package/dist/components/ConfigProvider/context.d.ts +18 -0
- package/dist/components/ConfigProvider/index.d.ts +2 -1
- package/dist/components/Gantt/Gantt.d.ts +1 -1
- package/dist/components/Gantt/GanttBar.d.ts +12 -0
- package/dist/components/Gantt/GanttHeader.d.ts +2 -0
- package/dist/components/Gantt/GanttTimeLine.d.ts +9 -0
- package/dist/components/Gantt/HeaderToolbar.d.ts +6 -0
- package/dist/components/Gantt/OffscreenIndicatorArrow.d.ts +8 -0
- package/dist/components/Gantt/OffscreenIndicatorOverlay.d.ts +14 -0
- package/dist/components/Gantt/StickyLabel.d.ts +10 -0
- package/dist/components/Gantt/TodayIndicator.d.ts +14 -0
- package/dist/components/Gantt/context.d.ts +27 -0
- package/dist/components/Gantt/hooks/useGanttScroll.d.ts +23 -0
- package/dist/components/Gantt/hooks/useGanttViewport.d.ts +20 -0
- package/dist/components/Gantt/hooks/useTodayTracker.d.ts +7 -0
- package/dist/components/Gantt/index.d.ts +2 -1
- package/dist/components/Gantt/interface.d.ts +27 -2
- package/dist/components/Gantt/utils/calcTodayLeft.d.ts +8 -0
- package/dist/components/Gantt/utils/color.d.ts +2 -0
- package/dist/components/Gantt/utils/cx.d.ts +1 -0
- package/dist/components/Gantt/utils/dateRangeNormalizer.d.ts +25 -0
- package/dist/components/Gantt/utils/dayScale.d.ts +30 -0
- package/dist/components/Gantt/utils/headerTimeUtils.d.ts +43 -0
- package/dist/components/Gantt/utils/layoutBars.d.ts +26 -0
- package/dist/components/Gantt/utils/msUntilNextDay.d.ts +2 -0
- package/dist/components/Gantt/utils/time.d.ts +4 -0
- package/dist/components/Gantt/utils/viewportDateUtils.d.ts +11 -0
- package/dist/components/Gantt/utils/zoomReanchor.d.ts +18 -0
- package/dist/components/Icon/Icon.d.ts +6 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Icon/interface.d.ts +19 -0
- package/dist/components/Icon/loadIconfont.d.ts +1 -0
- package/dist/components/index.d.ts +10 -3
- package/dist/index.js +10 -6
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/lang/en-US.json.d.ts +52 -0
- package/dist/locale/lang/zh-CN.json.d.ts +52 -0
- package/dist/locale/lang/zh-TW.json.d.ts +52 -0
- package/dist/style.css +1 -1
- package/dist/vendors/{version-v6TU1ff1.js → version-qi3OapTz.js} +1 -1
- package/dist/vite-env.d.ts +1 -0
- package/package.json +7 -1
- package/dist/Calendar/Calendar-C63wg0aw.js +0 -1601
- package/dist/ConfigProvider/ConfigProvider-E792q6ny.js +0 -99
- package/dist/Gantt/Gantt-DLmqZPAQ.js +0 -8
- package/dist/locale/context/LocaleContext.d.ts +0 -7
- package/dist/vendors/useLocale-BbUDQCzl.js +0 -57
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { t as e } from "../Icon/Icon-CFvcrGGg.js";
|
|
2
|
+
import { t } from "../ConfigProvider/useLocale-CP8NRZoj.js";
|
|
3
|
+
import { useEffect as n, useId as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
|
|
4
|
+
import { createPortal as s } from "react-dom";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/ActionSheet/ActionSheet.module.scss
|
|
7
|
+
var u = {
|
|
8
|
+
"bsy-action-sheet": "_bsy-action-sheet_1uhjc_2",
|
|
9
|
+
"bsy-action-sheet__mask": "_bsy-action-sheet__mask_1uhjc_8",
|
|
10
|
+
"bsy-action-sheet__panel": "_bsy-action-sheet__panel_1uhjc_19",
|
|
11
|
+
"bsy-action-sheet--open": "_bsy-action-sheet--open_1uhjc_36",
|
|
12
|
+
"bsy-action-sheet__header": "_bsy-action-sheet__header_1uhjc_42",
|
|
13
|
+
"bsy-action-sheet__title": "_bsy-action-sheet__title_1uhjc_52",
|
|
14
|
+
"bsy-action-sheet__close": "_bsy-action-sheet__close_1uhjc_63",
|
|
15
|
+
"bsy-action-sheet__body": "_bsy-action-sheet__body_1uhjc_77",
|
|
16
|
+
"bsy-action-sheet__list": "_bsy-action-sheet__list_1uhjc_82",
|
|
17
|
+
"bsy-action-sheet--menu": "_bsy-action-sheet--menu_1uhjc_85",
|
|
18
|
+
"bsy-action-sheet__item": "_bsy-action-sheet__item_1uhjc_85",
|
|
19
|
+
"bsy-action-sheet__item--selected": "_bsy-action-sheet__item--selected_1uhjc_109",
|
|
20
|
+
"bsy-action-sheet__item--disabled": "_bsy-action-sheet__item--disabled_1uhjc_112",
|
|
21
|
+
"bsy-action-sheet__item-inner": "_bsy-action-sheet__item-inner_1uhjc_116",
|
|
22
|
+
"bsy-action-sheet--select": "_bsy-action-sheet--select_1uhjc_122",
|
|
23
|
+
"bsy-action-sheet__item-icon": "_bsy-action-sheet__item-icon_1uhjc_125",
|
|
24
|
+
"bsy-action-sheet__item-label": "_bsy-action-sheet__item-label_1uhjc_134",
|
|
25
|
+
"bsy-action-sheet__check": "_bsy-action-sheet__check_1uhjc_143"
|
|
26
|
+
}, d = (...e) => e.filter(Boolean).join(" "), f = ({ open: f, onClose: p, mode: m = "select", title: h, actions: g, onAction: _, children: v, zIndex: y = 1e3, getPopupContainer: b, className: x }) => {
|
|
27
|
+
let { t: S } = t(), C = r(), [w, T] = o(f), [E, D] = o(!1), O = a(!1), k = a({
|
|
28
|
+
title: h,
|
|
29
|
+
actions: g,
|
|
30
|
+
children: v,
|
|
31
|
+
mode: m
|
|
32
|
+
});
|
|
33
|
+
f && (k.current = {
|
|
34
|
+
title: h,
|
|
35
|
+
actions: g,
|
|
36
|
+
children: v,
|
|
37
|
+
mode: m
|
|
38
|
+
});
|
|
39
|
+
let A = k.current, j = A.mode === "menu";
|
|
40
|
+
n(() => {
|
|
41
|
+
if (f) {
|
|
42
|
+
T(!0);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
D(!1), O.current || T(!1);
|
|
46
|
+
}, [f]), i(() => {
|
|
47
|
+
if (!w || !f) return;
|
|
48
|
+
let e = 0, t = requestAnimationFrame(() => {
|
|
49
|
+
e = requestAnimationFrame(() => {
|
|
50
|
+
O.current = !0, D(!0);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
cancelAnimationFrame(t), cancelAnimationFrame(e);
|
|
55
|
+
};
|
|
56
|
+
}, [w, f]), n(() => {
|
|
57
|
+
if (!w) return;
|
|
58
|
+
let e = document.body.style.overflow;
|
|
59
|
+
return document.body.style.overflow = "hidden", () => {
|
|
60
|
+
document.body.style.overflow = e;
|
|
61
|
+
};
|
|
62
|
+
}, [w]);
|
|
63
|
+
let M = typeof document > "u" ? null : b?.() || document.body;
|
|
64
|
+
if (!w || !M) return null;
|
|
65
|
+
let N = A.children !== void 0 && A.children !== null, P = S("actionSheet.close");
|
|
66
|
+
return s(/* @__PURE__ */ l("div", {
|
|
67
|
+
className: d(u["bsy-action-sheet"], j ? u["bsy-action-sheet--menu"] : u["bsy-action-sheet--select"], E && f && u["bsy-action-sheet--open"], x),
|
|
68
|
+
style: { zIndex: y },
|
|
69
|
+
children: [/* @__PURE__ */ c("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
className: u["bsy-action-sheet__mask"],
|
|
72
|
+
"aria-label": P,
|
|
73
|
+
onClick: p
|
|
74
|
+
}), /* @__PURE__ */ l("div", {
|
|
75
|
+
className: u["bsy-action-sheet__panel"],
|
|
76
|
+
role: "dialog",
|
|
77
|
+
"aria-modal": "true",
|
|
78
|
+
"aria-labelledby": A.title !== void 0 && A.title !== null ? C : void 0,
|
|
79
|
+
onTransitionEnd: (e) => {
|
|
80
|
+
e.propertyName === "transform" && (f || (O.current = !1, T(!1)));
|
|
81
|
+
},
|
|
82
|
+
children: [/* @__PURE__ */ l("div", {
|
|
83
|
+
className: u["bsy-action-sheet__header"],
|
|
84
|
+
children: [/* @__PURE__ */ c("div", {
|
|
85
|
+
id: C,
|
|
86
|
+
className: u["bsy-action-sheet__title"],
|
|
87
|
+
children: A.title
|
|
88
|
+
}), /* @__PURE__ */ c("button", {
|
|
89
|
+
type: "button",
|
|
90
|
+
className: u["bsy-action-sheet__close"],
|
|
91
|
+
"aria-label": P,
|
|
92
|
+
onClick: p,
|
|
93
|
+
children: /* @__PURE__ */ c(e, {
|
|
94
|
+
name: "close",
|
|
95
|
+
size: 18
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
}), /* @__PURE__ */ c("div", {
|
|
99
|
+
className: u["bsy-action-sheet__body"],
|
|
100
|
+
children: N ? A.children : /* @__PURE__ */ c("div", {
|
|
101
|
+
className: u["bsy-action-sheet__list"],
|
|
102
|
+
children: A.actions?.map((t) => /* @__PURE__ */ l("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
disabled: t.disabled,
|
|
105
|
+
className: d(u["bsy-action-sheet__item"], !j && t.selected && u["bsy-action-sheet__item--selected"], t.disabled && u["bsy-action-sheet__item--disabled"]),
|
|
106
|
+
style: j && !t.disabled && t.color ? { color: t.color } : void 0,
|
|
107
|
+
onClick: () => {
|
|
108
|
+
_?.(t), p();
|
|
109
|
+
},
|
|
110
|
+
children: [/* @__PURE__ */ l("span", {
|
|
111
|
+
className: u["bsy-action-sheet__item-inner"],
|
|
112
|
+
children: [j && t.icon ? /* @__PURE__ */ c("span", {
|
|
113
|
+
className: u["bsy-action-sheet__item-icon"],
|
|
114
|
+
children: t.icon
|
|
115
|
+
}) : null, /* @__PURE__ */ c("span", {
|
|
116
|
+
className: u["bsy-action-sheet__item-label"],
|
|
117
|
+
children: t.text
|
|
118
|
+
})]
|
|
119
|
+
}), !j && t.selected ? /* @__PURE__ */ c("span", {
|
|
120
|
+
className: u["bsy-action-sheet__check"],
|
|
121
|
+
children: /* @__PURE__ */ c(e, {
|
|
122
|
+
name: "checkthebox",
|
|
123
|
+
size: 16
|
|
124
|
+
})
|
|
125
|
+
}) : null]
|
|
126
|
+
}, t.key))
|
|
127
|
+
})
|
|
128
|
+
})]
|
|
129
|
+
})]
|
|
130
|
+
}), M);
|
|
131
|
+
};
|
|
132
|
+
//#endregion
|
|
133
|
+
export { f as t };
|