@baishuyun/ui-mobile 0.3.0 → 0.5.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.
Files changed (63) hide show
  1. package/README.md +2 -11
  2. package/dist/ActionSheet/ActionSheet-Ok-UTVMn.js +133 -0
  3. package/dist/ActionSheet/index.js +5 -0
  4. package/dist/Calendar/Calendar-ipjycVqK.js +1580 -0
  5. package/dist/Calendar/index.js +4 -3
  6. package/dist/Calendar/timeUtils-CPYfw0pt.js +27 -0
  7. package/dist/ConfigProvider/ConfigProvider-CNhaKMJa.js +181 -0
  8. package/dist/ConfigProvider/index.js +3 -3
  9. package/dist/Gantt/Gantt-DDItjDkR.js +1099 -0
  10. package/dist/Gantt/index.js +7 -3
  11. package/dist/Icon/Icon-CFvcrGGg.js +23 -0
  12. package/dist/Icon/index.js +3 -0
  13. package/dist/components/ActionSheet/ActionSheet.d.ts +3 -0
  14. package/dist/components/ActionSheet/index.d.ts +2 -0
  15. package/dist/components/ActionSheet/interface.d.ts +75 -0
  16. package/dist/components/Calendar/index.d.ts +1 -1
  17. package/dist/components/Calendar/interface.d.ts +65 -7
  18. package/dist/components/ConfigProvider/context.d.ts +4 -0
  19. package/dist/components/Gantt/Gantt.d.ts +1 -1
  20. package/dist/components/Gantt/GanttBar.d.ts +10 -0
  21. package/dist/components/Gantt/GanttHeader.d.ts +2 -0
  22. package/dist/components/Gantt/GanttTimeLine.d.ts +9 -0
  23. package/dist/components/Gantt/HeaderToolbar.d.ts +6 -0
  24. package/dist/components/Gantt/OffscreenIndicatorArrow.d.ts +8 -0
  25. package/dist/components/Gantt/OffscreenIndicatorOverlay.d.ts +14 -0
  26. package/dist/components/Gantt/StickyLabel.d.ts +10 -0
  27. package/dist/components/Gantt/TodayIndicator.d.ts +14 -0
  28. package/dist/components/Gantt/calcTodayLeft.d.ts +8 -0
  29. package/dist/components/Gantt/context.d.ts +27 -0
  30. package/dist/components/Gantt/hooks/useGanttScroll.d.ts +23 -0
  31. package/dist/components/Gantt/hooks/useGanttViewport.d.ts +20 -0
  32. package/dist/components/Gantt/hooks/useTodayTracker.d.ts +7 -0
  33. package/dist/components/Gantt/index.d.ts +2 -1
  34. package/dist/components/Gantt/interface.d.ts +27 -2
  35. package/dist/components/Gantt/msUntilNextDay.d.ts +2 -0
  36. package/dist/components/Gantt/utils/color.d.ts +2 -0
  37. package/dist/components/Gantt/utils/cx.d.ts +1 -0
  38. package/dist/components/Gantt/utils/dateRangeNormalizer.d.ts +25 -0
  39. package/dist/components/Gantt/utils/dayScale.d.ts +30 -0
  40. package/dist/components/Gantt/utils/headerTimeUtils.d.ts +43 -0
  41. package/dist/components/Gantt/utils/layoutBars.d.ts +26 -0
  42. package/dist/components/Gantt/utils/time.d.ts +4 -0
  43. package/dist/components/Gantt/utils/viewportDateUtils.d.ts +11 -0
  44. package/dist/components/Gantt/utils/zoomReanchor.d.ts +18 -0
  45. package/dist/components/Icon/Icon.d.ts +6 -0
  46. package/dist/components/Icon/index.d.ts +2 -0
  47. package/dist/components/Icon/interface.d.ts +19 -0
  48. package/dist/components/Icon/loadIconfont.d.ts +1 -0
  49. package/dist/components/index.d.ts +7 -2
  50. package/dist/index.js +9 -6
  51. package/dist/locale/index.d.ts +3 -0
  52. package/dist/locale/lang/en-US.json.d.ts +41 -0
  53. package/dist/locale/lang/zh-CN.json.d.ts +41 -0
  54. package/dist/locale/lang/zh-TW.json.d.ts +41 -0
  55. package/dist/style.css +1 -1
  56. package/dist/vendors/useLocale-CMHIlzlj.js +98 -0
  57. package/dist/vendors/{version-BVySNITW.js → version-3D9AaDf3.js} +1 -1
  58. package/dist/vite-env.d.ts +1 -0
  59. package/package.json +6 -1
  60. package/dist/Calendar/Calendar-6ibIyMx0.js +0 -1606
  61. package/dist/ConfigProvider/ConfigProvider-E792q6ny.js +0 -99
  62. package/dist/Gantt/Gantt-DLmqZPAQ.js +0 -8
  63. package/dist/vendors/useLocale-BbUDQCzl.js +0 -57
package/README.md CHANGED
@@ -10,19 +10,10 @@
10
10
  pnpm add @baishuyun/ui-mobile
11
11
  ```
12
12
 
13
- ## 引入
14
-
15
- 子路径导入(推荐):
16
-
17
- ```ts
18
- import Calendar from '@baishuyun/ui-mobile/Calendar';
19
- import '@baishuyun/ui-mobile/style.css';
20
- ```
21
-
22
- 或主入口:
13
+ ## 使用方式
23
14
 
24
15
  ```ts
25
- import { Calendar } from '@baishuyun/ui-mobile';
16
+ import { Calendar, Gantt } from '@baishuyun/ui-mobile';
26
17
  import '@baishuyun/ui-mobile/style.css';
27
18
  ```
28
19
 
@@ -0,0 +1,133 @@
1
+ import { t as e } from "../Icon/Icon-CFvcrGGg.js";
2
+ import { t } from "../vendors/useLocale-CMHIlzlj.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 };
@@ -0,0 +1,5 @@
1
+ import "../vendors/version-3D9AaDf3.js";
2
+ import { t as e } from "./ActionSheet-Ok-UTVMn.js";
3
+ import "../Icon/Icon-CFvcrGGg.js";
4
+ import "../vendors/useLocale-CMHIlzlj.js";
5
+ export { e as default };