@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.
Files changed (86) hide show
  1. package/README.md +2 -11
  2. package/dist/AMap/AMap-BWZ2lhXr.js +683 -0
  3. package/dist/AMap/index.js +5 -0
  4. package/dist/ActionSheet/ActionSheet-DbrKxa_y.js +133 -0
  5. package/dist/ActionSheet/index.js +5 -0
  6. package/dist/Calendar/Calendar-Bd6CS8y7.js +1580 -0
  7. package/dist/Calendar/index.js +4 -3
  8. package/dist/Calendar/timeUtils-t4A3-Hr6.js +27 -0
  9. package/dist/ConfigProvider/ConfigProvider-DnlakyRE.js +208 -0
  10. package/dist/ConfigProvider/index.js +4 -4
  11. package/dist/ConfigProvider/useLocale-CP8NRZoj.js +115 -0
  12. package/dist/Gantt/Gantt-CR7eRNVP.js +1094 -0
  13. package/dist/Gantt/index.js +7 -3
  14. package/dist/Icon/Icon-CFvcrGGg.js +23 -0
  15. package/dist/Icon/index.js +3 -0
  16. package/dist/components/AMap/AMap.d.ts +3 -0
  17. package/dist/components/AMap/Controls/Controls.d.ts +3 -0
  18. package/dist/components/AMap/Controls/index.d.ts +1 -0
  19. package/dist/components/AMap/Locate/Locate.d.ts +3 -0
  20. package/dist/components/AMap/Locate/index.d.ts +1 -0
  21. package/dist/components/AMap/Markers/Markers.d.ts +3 -0
  22. package/dist/components/AMap/Markers/index.d.ts +1 -0
  23. package/dist/components/AMap/PoiSearch/PoiSearch.d.ts +3 -0
  24. package/dist/components/AMap/PoiSearch/index.d.ts +1 -0
  25. package/dist/components/AMap/context.d.ts +7 -0
  26. package/dist/components/AMap/ensureAMap.d.ts +7 -0
  27. package/dist/components/AMap/index.d.ts +15 -0
  28. package/dist/components/AMap/interface.d.ts +66 -0
  29. package/dist/components/AMap/utils/cx.d.ts +1 -0
  30. package/dist/components/AMap/utils/geometry.d.ts +21 -0
  31. package/dist/components/AMap/utils/markerHtml.d.ts +21 -0
  32. package/dist/components/AMap/utils/searchPois.d.ts +6 -0
  33. package/dist/components/ActionSheet/ActionSheet.d.ts +3 -0
  34. package/dist/components/ActionSheet/index.d.ts +2 -0
  35. package/dist/components/ActionSheet/interface.d.ts +75 -0
  36. package/dist/components/Calendar/index.d.ts +1 -1
  37. package/dist/components/Calendar/interface.d.ts +59 -1
  38. package/dist/components/ConfigProvider/ConfigContext.d.ts +11 -0
  39. package/dist/components/ConfigProvider/ConfigProvider.d.ts +1 -1
  40. package/dist/components/ConfigProvider/context.d.ts +18 -0
  41. package/dist/components/ConfigProvider/index.d.ts +2 -1
  42. package/dist/components/Gantt/Gantt.d.ts +1 -1
  43. package/dist/components/Gantt/GanttBar.d.ts +12 -0
  44. package/dist/components/Gantt/GanttHeader.d.ts +2 -0
  45. package/dist/components/Gantt/GanttTimeLine.d.ts +9 -0
  46. package/dist/components/Gantt/HeaderToolbar.d.ts +6 -0
  47. package/dist/components/Gantt/OffscreenIndicatorArrow.d.ts +8 -0
  48. package/dist/components/Gantt/OffscreenIndicatorOverlay.d.ts +14 -0
  49. package/dist/components/Gantt/StickyLabel.d.ts +10 -0
  50. package/dist/components/Gantt/TodayIndicator.d.ts +14 -0
  51. package/dist/components/Gantt/context.d.ts +27 -0
  52. package/dist/components/Gantt/hooks/useGanttScroll.d.ts +23 -0
  53. package/dist/components/Gantt/hooks/useGanttViewport.d.ts +20 -0
  54. package/dist/components/Gantt/hooks/useTodayTracker.d.ts +7 -0
  55. package/dist/components/Gantt/index.d.ts +2 -1
  56. package/dist/components/Gantt/interface.d.ts +27 -2
  57. package/dist/components/Gantt/utils/calcTodayLeft.d.ts +8 -0
  58. package/dist/components/Gantt/utils/color.d.ts +2 -0
  59. package/dist/components/Gantt/utils/cx.d.ts +1 -0
  60. package/dist/components/Gantt/utils/dateRangeNormalizer.d.ts +25 -0
  61. package/dist/components/Gantt/utils/dayScale.d.ts +30 -0
  62. package/dist/components/Gantt/utils/headerTimeUtils.d.ts +43 -0
  63. package/dist/components/Gantt/utils/layoutBars.d.ts +26 -0
  64. package/dist/components/Gantt/utils/msUntilNextDay.d.ts +2 -0
  65. package/dist/components/Gantt/utils/time.d.ts +4 -0
  66. package/dist/components/Gantt/utils/viewportDateUtils.d.ts +11 -0
  67. package/dist/components/Gantt/utils/zoomReanchor.d.ts +18 -0
  68. package/dist/components/Icon/Icon.d.ts +6 -0
  69. package/dist/components/Icon/index.d.ts +2 -0
  70. package/dist/components/Icon/interface.d.ts +19 -0
  71. package/dist/components/Icon/loadIconfont.d.ts +1 -0
  72. package/dist/components/index.d.ts +10 -3
  73. package/dist/index.js +10 -6
  74. package/dist/locale/index.d.ts +3 -0
  75. package/dist/locale/lang/en-US.json.d.ts +52 -0
  76. package/dist/locale/lang/zh-CN.json.d.ts +52 -0
  77. package/dist/locale/lang/zh-TW.json.d.ts +52 -0
  78. package/dist/style.css +1 -1
  79. package/dist/vendors/{version-v6TU1ff1.js → version-qi3OapTz.js} +1 -1
  80. package/dist/vite-env.d.ts +1 -0
  81. package/package.json +7 -1
  82. package/dist/Calendar/Calendar-C63wg0aw.js +0 -1601
  83. package/dist/ConfigProvider/ConfigProvider-E792q6ny.js +0 -99
  84. package/dist/Gantt/Gantt-DLmqZPAQ.js +0 -8
  85. package/dist/locale/context/LocaleContext.d.ts +0 -7
  86. package/dist/vendors/useLocale-BbUDQCzl.js +0 -57
@@ -1,4 +1,5 @@
1
- import "../vendors/version-v6TU1ff1.js";
2
- import { t as e } from "./Calendar-C63wg0aw.js";
3
- import "../vendors/useLocale-BbUDQCzl.js";
1
+ import "../vendors/version-qi3OapTz.js";
2
+ import { t as e } from "./Calendar-Bd6CS8y7.js";
3
+ import "../ConfigProvider/useLocale-CP8NRZoj.js";
4
+ import "./timeUtils-t4A3-Hr6.js";
4
5
  export { e as default };
@@ -0,0 +1,27 @@
1
+ import e from "dayjs";
2
+ import t from "dayjs/plugin/isoWeek";
3
+ import n from "dayjs/plugin/timezone";
4
+ import r from "dayjs/plugin/utc";
5
+ //#region src/components/Calendar/utils/ensureDayjsPlugins.ts
6
+ var i = !1;
7
+ i ||= (e.extend(r), e.extend(n), e.extend(t), !0);
8
+ //#endregion
9
+ //#region src/components/Calendar/utils/timeUtils.ts
10
+ var a = () => e(null), o = (e, t) => !!(t && e.$x?.$timezone === t), s = (t, n) => {
11
+ if (t == null || t === "") return a();
12
+ if (e.isDayjs(t)) return t.isValid() ? !n || o(t, n) ? t : t.tz(n) : a();
13
+ if (typeof t == "number" || t instanceof Date) {
14
+ let r = e(t);
15
+ return r.isValid() ? n ? r.tz(n) : r : a();
16
+ }
17
+ if (typeof t == "string") {
18
+ let r = e(t);
19
+ return r.isValid() ? n ? r.tz(n) : r : a();
20
+ }
21
+ return a();
22
+ }, c = (t) => t ? e().tz(t) : e(), l = (t) => {
23
+ let n = t ? e().tz(t).utcOffset() : e().utcOffset(), r = n >= 0 ? "+" : "-", i = Math.abs(n), a = Math.floor(i / 60), o = i % 60;
24
+ return o === 0 ? `GMT${r}${a}` : `GMT${r}${a}:${String(o).padStart(2, "0")}`;
25
+ };
26
+ //#endregion
27
+ export { l as n, s as r, c as t };
@@ -0,0 +1,208 @@
1
+ import { a as e, i as t, n } from "./useLocale-CP8NRZoj.js";
2
+ import { useCallback as r, useContext as i, useMemo as a } from "react";
3
+ import { jsx as o } from "react/jsx-runtime";
4
+ var s = {
5
+ actionSheet: { close: "關閉" },
6
+ calendar: {
7
+ today: "今天",
8
+ viewDay: "日",
9
+ viewThreeDay: "三天",
10
+ viewMonth: "月",
11
+ yearMonth: "{year}年{monthShort}",
12
+ monthShort: {
13
+ 1: "1月",
14
+ 2: "2月",
15
+ 3: "3月",
16
+ 4: "4月",
17
+ 5: "5月",
18
+ 6: "6月",
19
+ 7: "7月",
20
+ 8: "8月",
21
+ 9: "9月",
22
+ 10: "10月",
23
+ 11: "11月",
24
+ 12: "12月"
25
+ },
26
+ weekday: {
27
+ 1: "一",
28
+ 2: "二",
29
+ 3: "三",
30
+ 4: "四",
31
+ 5: "五",
32
+ 6: "六",
33
+ 7: "日"
34
+ },
35
+ weekdayPrefixed: {
36
+ 1: "週一",
37
+ 2: "週二",
38
+ 3: "週三",
39
+ 4: "週四",
40
+ 5: "週五",
41
+ 6: "週六",
42
+ 7: "週日"
43
+ },
44
+ collapse: "收合",
45
+ moreRecords: "還有 {count} 筆"
46
+ },
47
+ gantt: {
48
+ today: "今天",
49
+ zoomSheetTitle: "切換時間查看",
50
+ prevScreen: "上一屏",
51
+ nextScreen: "下一屏",
52
+ locateTask: "定位到任務",
53
+ week: "{week}週",
54
+ year: "{year}年",
55
+ yearMonthDay: "{year}年{month}月{day}日",
56
+ hour: "{hour}點",
57
+ hourRange: "{start}-{end}時",
58
+ monthDayHour: "{month}月{day}日{hour}點",
59
+ am: "上午",
60
+ pm: "下午",
61
+ firstHalfYear: "上半年",
62
+ secondHalfYear: "下半年",
63
+ yearQuarter: "{year}年{quarter}",
64
+ quarter: {
65
+ 1: "一季度",
66
+ 2: "二季度",
67
+ 3: "三季度",
68
+ 4: "四季度"
69
+ },
70
+ zoom: {
71
+ oneMinute: "按分鐘查看",
72
+ tenMinute: "按10分鐘查看",
73
+ halfHour: "按半小時查看",
74
+ hour: "按小時查看",
75
+ sixHour: "按6小時查看",
76
+ halfDay: "按半天查看",
77
+ day: "按日查看",
78
+ week: "按週查看",
79
+ month: "按月查看",
80
+ quarter: "按季查看",
81
+ quarterMonth: "按季/月查看",
82
+ year: "按年查看"
83
+ }
84
+ },
85
+ amap: {
86
+ poi: {
87
+ placeholder: "搜尋定位中心",
88
+ loading: "搜尋中...",
89
+ empty: "暫無結果"
90
+ },
91
+ locate: {
92
+ ariaLabel: "定位",
93
+ failed: "定位失敗,請檢查是否開啟定位權限"
94
+ }
95
+ }
96
+ }, c = {
97
+ actionSheet: { close: "Close" },
98
+ calendar: {
99
+ today: "Today",
100
+ viewDay: "Day",
101
+ viewThreeDay: "3-Day",
102
+ viewMonth: "Month",
103
+ yearMonth: "{monthShort} {year}",
104
+ monthShort: {
105
+ 1: "Jan",
106
+ 2: "Feb",
107
+ 3: "Mar",
108
+ 4: "Apr",
109
+ 5: "May",
110
+ 6: "Jun",
111
+ 7: "Jul",
112
+ 8: "Aug",
113
+ 9: "Sep",
114
+ 10: "Oct",
115
+ 11: "Nov",
116
+ 12: "Dec"
117
+ },
118
+ weekday: {
119
+ 1: "Mon",
120
+ 2: "Tue",
121
+ 3: "Wed",
122
+ 4: "Thu",
123
+ 5: "Fri",
124
+ 6: "Sat",
125
+ 7: "Sun"
126
+ },
127
+ weekdayPrefixed: {
128
+ 1: "Mon",
129
+ 2: "Tue",
130
+ 3: "Wed",
131
+ 4: "Thu",
132
+ 5: "Fri",
133
+ 6: "Sat",
134
+ 7: "Sun"
135
+ },
136
+ collapse: "Show less",
137
+ moreRecords: "{count} more"
138
+ },
139
+ gantt: {
140
+ today: "Today",
141
+ zoomSheetTitle: "Change time scale",
142
+ prevScreen: "Previous screen",
143
+ nextScreen: "Next screen",
144
+ locateTask: "Jump to task",
145
+ week: "W{week}",
146
+ year: "{year}",
147
+ yearMonthDay: "{monthShort} {day}, {year}",
148
+ hour: "{hour}:00",
149
+ hourRange: "{start}–{end}h",
150
+ monthDayHour: "{monthShort} {day}, {hour}:00",
151
+ am: "AM",
152
+ pm: "PM",
153
+ firstHalfYear: "H1",
154
+ secondHalfYear: "H2",
155
+ yearQuarter: "{quarter} {year}",
156
+ quarter: {
157
+ 1: "Q1",
158
+ 2: "Q2",
159
+ 3: "Q3",
160
+ 4: "Q4"
161
+ },
162
+ zoom: {
163
+ oneMinute: "Minute view",
164
+ tenMinute: "10-minute view",
165
+ halfHour: "Half-hour view",
166
+ hour: "Hour view",
167
+ sixHour: "6-hour view",
168
+ halfDay: "Half-day view",
169
+ day: "Day view",
170
+ week: "Week view",
171
+ month: "Month view",
172
+ quarter: "Quarter view",
173
+ quarterMonth: "Quarter/month view",
174
+ year: "Year view"
175
+ }
176
+ },
177
+ amap: {
178
+ poi: {
179
+ placeholder: "Search location center",
180
+ loading: "Searching...",
181
+ empty: "No results"
182
+ },
183
+ locate: {
184
+ ariaLabel: "Locate",
185
+ failed: "Location failed. Check that location access is enabled"
186
+ }
187
+ }
188
+ }, l = {
189
+ "zh-CN": e,
190
+ "zh-TW": s,
191
+ "en-US": c
192
+ }, u = ({ locale: e, amap: s, children: c }) => {
193
+ let u = i(n), d = e ?? u.locale, f = s ?? u.amap, p = r((e, n) => t(l[d], e, n), [d]), m = a(() => ({
194
+ locale: d,
195
+ t: p,
196
+ amap: f
197
+ }), [
198
+ d,
199
+ p,
200
+ f
201
+ ]);
202
+ return /* @__PURE__ */ o(n.Provider, {
203
+ value: m,
204
+ children: c
205
+ });
206
+ };
207
+ //#endregion
208
+ export { u as t };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-v6TU1ff1.js";
2
- import { t as e } from "../vendors/useLocale-BbUDQCzl.js";
3
- import { t } from "./ConfigProvider-E792q6ny.js";
4
- export { t as ConfigProvider, t as default, e as useLocale };
1
+ import "../vendors/version-qi3OapTz.js";
2
+ import { r as e, t } from "./useLocale-CP8NRZoj.js";
3
+ import { t as n } from "./ConfigProvider-DnlakyRE.js";
4
+ export { n as ConfigProvider, n as default, e as useAMapConfig, t as useLocale };
@@ -0,0 +1,115 @@
1
+ import { createContext as e, useContext as t } from "react";
2
+ var n = {
3
+ actionSheet: { close: "关闭" },
4
+ calendar: {
5
+ today: "今天",
6
+ viewDay: "日",
7
+ viewThreeDay: "三日",
8
+ viewMonth: "月",
9
+ yearMonth: "{year}年{monthShort}",
10
+ monthShort: {
11
+ 1: "1月",
12
+ 2: "2月",
13
+ 3: "3月",
14
+ 4: "4月",
15
+ 5: "5月",
16
+ 6: "6月",
17
+ 7: "7月",
18
+ 8: "8月",
19
+ 9: "9月",
20
+ 10: "10月",
21
+ 11: "11月",
22
+ 12: "12月"
23
+ },
24
+ weekday: {
25
+ 1: "一",
26
+ 2: "二",
27
+ 3: "三",
28
+ 4: "四",
29
+ 5: "五",
30
+ 6: "六",
31
+ 7: "日"
32
+ },
33
+ weekdayPrefixed: {
34
+ 1: "周一",
35
+ 2: "周二",
36
+ 3: "周三",
37
+ 4: "周四",
38
+ 5: "周五",
39
+ 6: "周六",
40
+ 7: "周日"
41
+ },
42
+ collapse: "收起",
43
+ moreRecords: "还有{count}条记录"
44
+ },
45
+ gantt: {
46
+ today: "今天",
47
+ zoomSheetTitle: "切换时间查看",
48
+ prevScreen: "上一屏",
49
+ nextScreen: "下一屏",
50
+ locateTask: "定位到任务",
51
+ week: "{week}周",
52
+ year: "{year}年",
53
+ yearMonthDay: "{year}年{month}月{day}日",
54
+ hour: "{hour}点",
55
+ hourRange: "{start}-{end}时",
56
+ monthDayHour: "{month}月{day}日{hour}点",
57
+ am: "上午",
58
+ pm: "下午",
59
+ firstHalfYear: "上半年",
60
+ secondHalfYear: "下半年",
61
+ yearQuarter: "{year}年{quarter}",
62
+ quarter: {
63
+ 1: "一季度",
64
+ 2: "二季度",
65
+ 3: "三季度",
66
+ 4: "四季度"
67
+ },
68
+ zoom: {
69
+ oneMinute: "按分钟查看",
70
+ tenMinute: "按10分钟查看",
71
+ halfHour: "按半小时查看",
72
+ hour: "按小时查看",
73
+ sixHour: "按6小时查看",
74
+ halfDay: "按半天查看",
75
+ day: "按日查看",
76
+ week: "按周查看",
77
+ month: "按月查看",
78
+ quarter: "按季查看",
79
+ quarterMonth: "按季/月查看",
80
+ year: "按年查看"
81
+ }
82
+ },
83
+ amap: {
84
+ poi: {
85
+ placeholder: "搜索定位中心",
86
+ loading: "搜索中...",
87
+ empty: "暂无结果"
88
+ },
89
+ locate: {
90
+ ariaLabel: "定位",
91
+ failed: "定位失败,请检查是否开启定位权限"
92
+ }
93
+ }
94
+ }, r = (e, t) => t ? e.replace(/\{\{(\w+)\}\}|\{(\w+)\}/g, (e, n, r) => {
95
+ let i = t[n || r];
96
+ return i === void 0 ? e : String(i);
97
+ }) : e, i = (e, t, n) => {
98
+ let i = t.split("."), a = e;
99
+ for (let e of i) {
100
+ if (!a || typeof a != "object" || !(e in a)) return console.warn(`[ConfigProvider] Cannot find translation for key: ${t}`), t;
101
+ a = a[e];
102
+ }
103
+ return typeof a == "string" ? r(a, n) : t;
104
+ }, a = e({
105
+ locale: "zh-CN",
106
+ t: (e, t) => i(n, e, t)
107
+ }), o = () => t(a).amap, s = () => {
108
+ let { locale: e, t: n } = t(a);
109
+ return {
110
+ locale: e,
111
+ t: n
112
+ };
113
+ };
114
+ //#endregion
115
+ export { n as a, i, a as n, o as r, s as t };