@jc-times/business-ui 0.3.1 → 0.4.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 (65) hide show
  1. package/AGENTS.md +15 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +2 -0
  4. package/THIRD_PARTY_NOTICES.md +8 -0
  5. package/assets/pdf-fonts/NotoSans-Bold.ttf +0 -0
  6. package/assets/pdf-fonts/NotoSans-BoldItalic.ttf +0 -0
  7. package/assets/pdf-fonts/NotoSans-Italic.ttf +0 -0
  8. package/assets/pdf-fonts/NotoSans-Regular.ttf +0 -0
  9. package/assets/pdf-fonts/NotoSansHans-Regular.otf +0 -0
  10. package/assets/pdf-fonts/OFL-CJK.txt +92 -0
  11. package/assets/pdf-fonts/OFL-Latin.txt +94 -0
  12. package/assets/pdf-fonts/README.md +11 -0
  13. package/bin/business-ui-gate.mjs +2 -2
  14. package/dist/AntDateWheelView.js +131 -0
  15. package/dist/AntOptionWheelView.js +76 -0
  16. package/dist/Cascader.js +56 -51
  17. package/dist/DateInput.js +84 -66
  18. package/dist/DateWheelPicker.js +58 -0
  19. package/dist/ModalShell.js +84 -72
  20. package/dist/MultiSelect.js +5 -1
  21. package/dist/OptionWheelDialog.js +99 -0
  22. package/dist/Select.js +116 -61
  23. package/dist/StructuredAddressInput.js +72 -70
  24. package/dist/TreeSelect.js +4 -1
  25. package/dist/WheelCascader.js +123 -0
  26. package/dist/WheelDateInput.js +97 -0
  27. package/dist/business-ui.js +42 -39
  28. package/dist/date-wheel-model.js +27 -0
  29. package/dist/document-viewer-v2/DocumentViewerV2.js +49 -48
  30. package/dist/document-viewer-v2/HeadlessPdfViewer.js +128 -124
  31. package/dist/document-viewer-v2/pdf-font-fallback.js +35 -0
  32. package/dist/option-wheel-model.js +49 -0
  33. package/dist/styles.css +1 -1
  34. package/dist/types/AntDateWheelView.d.ts +9 -0
  35. package/dist/types/AntOptionWheelView.d.ts +8 -0
  36. package/dist/types/Cascader.d.ts +2 -0
  37. package/dist/types/DateInput.d.ts +4 -0
  38. package/dist/types/DateWheelPicker.d.ts +13 -0
  39. package/dist/types/ModalShell.d.ts +3 -1
  40. package/dist/types/OptionWheelDialog.d.ts +18 -0
  41. package/dist/types/Select.d.ts +4 -1
  42. package/dist/types/StructuredAddressInput.d.ts +3 -1
  43. package/dist/types/WheelCascader.d.ts +6 -0
  44. package/dist/types/WheelDateInput.d.ts +11 -0
  45. package/dist/types/date-wheel-model.d.ts +8 -0
  46. package/dist/types/document-viewer-v2/pdf-font-fallback.d.ts +2 -0
  47. package/dist/types/index.d.ts +3 -0
  48. package/dist/types/option-wheel-model.d.ts +19 -0
  49. package/dist/types/usePhoneWheel.d.ts +2 -0
  50. package/dist/types/useSheetViewport.d.ts +3 -0
  51. package/dist/usePhoneWheel.js +16 -0
  52. package/dist/useSheetViewport.js +26 -0
  53. package/docs/agent-guide.md +15 -5
  54. package/docs/api.md +14 -0
  55. package/docs/cascader.md +2 -0
  56. package/docs/component-strategy.md +3 -0
  57. package/docs/date-wheel.md +25 -0
  58. package/docs/dependencies.md +2 -0
  59. package/docs/document-viewer-v2.md +2 -2
  60. package/docs/mobile-controls.md +54 -0
  61. package/docs/modal-shell-migration.md +25 -0
  62. package/docs/release.md +7 -0
  63. package/docs/viewport-qa.md +38 -0
  64. package/licenses/antd-mobile-MIT.txt +22 -0
  65. package/package.json +17 -4
@@ -1,10 +1,11 @@
1
- import { Select as e } from "./Select.js";
2
- import { Cascader as t } from "./Cascader.js";
3
- import { useId as n, useMemo as r, useRef as i } from "react";
4
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
1
+ import { usePhoneWheel as e } from "./usePhoneWheel.js";
2
+ import { Select as t } from "./Select.js";
3
+ import { Cascader as n } from "./Cascader.js";
4
+ import { useId as r, useMemo as i, useRef as a } from "react";
5
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
5
6
  //#region src/StructuredAddressInput.tsx
6
- function c({ regions: c, value: l, onValueChange: u, label: d = "地址", required: f = !1, disabled: m = !1, annotation: h, dataVersion: g, className: _ = "", structuredModeLabel: v = "结构化地址", freeformModeLabel: y = "海外或非标准地址", showModeSelector: b = !1, regionLabel: x = "所在地区", detailLabel: S = "详细地址", freeformLabel: C = "完整地址", searchPlaceholder: w = "请选择或搜索地区", emptyText: T = "没有匹配的地区", maxLength: E = 500, regionInputRef: D, detailInputRef: O, freeformInputRef: k, regionInputProps: A, detailInputProps: j, freeformInputProps: M }) {
7
- let N = n().replaceAll(":", ""), P = A?.id ?? `ui-address-${N}-region`, F = i(null), I = r(() => {
7
+ function l({ regions: l, value: u, onValueChange: d, label: f = "地址", required: p = !1, disabled: h = !1, annotation: g, dataVersion: _, className: v = "", structuredModeLabel: y = "结构化地址", freeformModeLabel: b = "海外或非标准地址", showModeSelector: x = !1, regionLabel: S = "所在地区", detailLabel: C = "详细地址", freeformLabel: w = "完整地址", searchPlaceholder: T = "请选择或搜索地区", emptyText: E = "没有匹配的地区", maxLength: D = 500, regionInputRef: O, detailInputRef: k, freeformInputRef: A, regionInputProps: j, detailInputProps: M, freeformInputProps: N, mobileMode: P = "dropdown" }) {
8
+ let F = r().replaceAll(":", ""), I = e(P === "wheel"), L = j?.id ?? `ui-address-${F}-region`, R = a(null), z = i(() => {
8
9
  function e(t) {
9
10
  return t.map((t) => ({
10
11
  value: t.id,
@@ -13,105 +14,106 @@ function c({ regions: c, value: l, onValueChange: u, label: d = "地址", requir
13
14
  children: t.children ? e(t.children) : void 0
14
15
  }));
15
16
  }
16
- return e(c);
17
- }, [c]);
18
- function L(e) {
19
- u({
20
- ...l,
21
- ...b ? {} : { mode: "structured" },
17
+ return e(l);
18
+ }, [l]);
19
+ function B(e) {
20
+ d({
21
+ ...u,
22
+ ...x ? {} : { mode: "structured" },
22
23
  ...e
23
24
  });
24
25
  }
25
- return /* @__PURE__ */ s("fieldset", {
26
- className: `ui-structured-address ${_}`.trim(),
27
- disabled: m,
26
+ return /* @__PURE__ */ c("fieldset", {
27
+ className: `ui-structured-address ${v}`.trim(),
28
+ disabled: h,
28
29
  children: [
29
- /* @__PURE__ */ s("legend", { children: [
30
- f && /* @__PURE__ */ o("span", {
30
+ /* @__PURE__ */ c("legend", { children: [
31
+ p && /* @__PURE__ */ s("span", {
31
32
  className: "ui-required-mark",
32
33
  "aria-hidden": "true",
33
34
  children: "*"
34
35
  }),
35
- d,
36
- h !== void 0 && /* @__PURE__ */ o("span", {
36
+ f,
37
+ g !== void 0 && /* @__PURE__ */ s("span", {
37
38
  className: "ui-structured-address-annotation",
38
- children: h
39
+ children: g
39
40
  })
40
41
  ] }),
41
- b && /* @__PURE__ */ o("div", {
42
+ x && /* @__PURE__ */ s("div", {
42
43
  className: "ui-structured-address-mode",
43
- children: /* @__PURE__ */ o(e, {
44
+ children: /* @__PURE__ */ s(t, {
44
45
  label: "地址类型",
45
- value: l.mode,
46
- disabled: m,
47
- onValueChange: (e) => L({ mode: e }),
46
+ value: u.mode,
47
+ disabled: h,
48
+ onValueChange: (e) => B({ mode: e }),
48
49
  options: [{
49
50
  value: "structured",
50
- label: v
51
+ label: y
51
52
  }, {
52
53
  value: "freeform",
53
- label: y
54
+ label: b
54
55
  }]
55
56
  })
56
57
  }),
57
- b && l.mode === "freeform" ? /* @__PURE__ */ s("label", {
58
+ x && u.mode === "freeform" ? /* @__PURE__ */ c("label", {
58
59
  className: "ui-structured-address-full",
59
- children: [/* @__PURE__ */ o("span", { children: C }), /* @__PURE__ */ o("input", {
60
- ...M,
61
- ref: k,
60
+ children: [/* @__PURE__ */ s("span", { children: w }), /* @__PURE__ */ s("input", {
61
+ ...N,
62
+ ref: A,
62
63
  className: "ui-input",
63
64
  autoComplete: "street-address",
64
- maxLength: E,
65
- required: f,
66
- value: l.freeform,
67
- onChange: (e) => L({ freeform: e.target.value })
65
+ maxLength: D,
66
+ required: p,
67
+ value: u.freeform,
68
+ onChange: (e) => B({ freeform: e.target.value })
68
69
  })]
69
- }) : /* @__PURE__ */ s(a, { children: [
70
- /* @__PURE__ */ o("div", {
70
+ }) : /* @__PURE__ */ c(o, { children: [
71
+ /* @__PURE__ */ s("div", {
71
72
  className: "ui-structured-address-region",
72
- children: /* @__PURE__ */ o(t, {
73
- options: I,
74
- value: l.regionIds,
75
- label: x,
76
- id: P,
77
- disabled: m,
78
- required: f,
79
- placeholder: w,
80
- emptyText: T,
81
- inputProps: A,
82
- inputRef: D,
83
- changeOnSelect: !0,
73
+ children: /* @__PURE__ */ s(n, {
74
+ options: z,
75
+ value: u.regionIds,
76
+ label: S,
77
+ id: L,
78
+ disabled: h,
79
+ required: p,
80
+ placeholder: T,
81
+ emptyText: E,
82
+ inputProps: j,
83
+ inputRef: O,
84
+ changeOnSelect: !I,
85
+ mobileMode: P,
84
86
  onValueChange: (e, t) => {
85
- L({ regionIds: e });
87
+ B({ regionIds: e });
86
88
  let n = t.at(-1);
87
- n && !n.children?.length && queueMicrotask(() => F.current?.focus());
89
+ !I && n && !n.children?.length && queueMicrotask(() => R.current?.focus());
88
90
  }
89
91
  })
90
92
  }),
91
- /* @__PURE__ */ s("label", {
93
+ /* @__PURE__ */ c("label", {
92
94
  className: "ui-structured-address-detail",
93
- children: [/* @__PURE__ */ o("span", { children: S }), /* @__PURE__ */ o("input", {
94
- ...j,
95
+ children: [/* @__PURE__ */ s("span", { children: C }), /* @__PURE__ */ s("input", {
96
+ ...M,
95
97
  ref: (e) => {
96
- F.current = e, p(O, e);
98
+ R.current = e, m(k, e);
97
99
  },
98
100
  className: "ui-input",
99
101
  autoComplete: "street-address",
100
- maxLength: E,
101
- required: f,
102
- value: l.detail,
103
- onChange: (e) => L({ detail: e.target.value })
102
+ maxLength: D,
103
+ required: p,
104
+ value: u.detail,
105
+ onChange: (e) => B({ detail: e.target.value })
104
106
  })]
105
107
  }),
106
- g !== void 0 && /* @__PURE__ */ o("small", {
108
+ _ !== void 0 && /* @__PURE__ */ s("small", {
107
109
  className: "ui-structured-address-version",
108
- children: g
110
+ children: _
109
111
  })
110
112
  ] })
111
113
  ]
112
114
  });
113
115
  }
114
- function l(e) {
116
+ function u(e) {
115
117
  let t = [];
116
118
  function n(e, r, i) {
117
119
  for (let a of e) {
@@ -125,16 +127,16 @@ function l(e) {
125
127
  }
126
128
  return n(e, [], []), t;
127
129
  }
128
- function u(e, t, n = 20) {
129
- let r = f(t);
130
+ function d(e, t, n = 20) {
131
+ let r = p(t);
130
132
  if (!r) return [];
131
133
  let i = (e) => {
132
- let t = f(e.labels.at(-1) ?? "");
134
+ let t = p(e.labels.at(-1) ?? "");
133
135
  return t === r ? 0 : t.includes(r) ? 1 : 2;
134
136
  };
135
- return l(e).filter((e) => f(e.labels.join("/")).includes(r)).sort((e, t) => i(e) - i(t) || e.labels.join("/").localeCompare(t.labels.join("/"), "zh-CN")).slice(0, n);
137
+ return u(e).filter((e) => p(e.labels.join("/")).includes(r)).sort((e, t) => i(e) - i(t) || e.labels.join("/").localeCompare(t.labels.join("/"), "zh-CN")).slice(0, n);
136
138
  }
137
- function d(e, t) {
139
+ function f(e, t) {
138
140
  if (!t.length) return;
139
141
  let n = e, r = [], i = [], a;
140
142
  for (let e of t) {
@@ -147,11 +149,11 @@ function d(e, t) {
147
149
  leaf: a
148
150
  } : void 0;
149
151
  }
150
- function f(e) {
152
+ function p(e) {
151
153
  return e.replace(/[\s/]+/gu, "").toLocaleLowerCase();
152
154
  }
153
- function p(e, t) {
155
+ function m(e, t) {
154
156
  typeof e == "function" ? e(t) : e && (e.current = t);
155
157
  }
156
158
  //#endregion
157
- export { c as StructuredAddressInput, d as findAddressRegionPath, l as flattenAddressRegions, u as searchAddressRegions };
159
+ export { l as StructuredAddressInput, f as findAddressRegionPath, u as flattenAddressRegions, d as searchAddressRegions };
@@ -268,7 +268,10 @@ function ie({ items: n, value: d, defaultValue: ie = null, onValueChange: h, ope
268
268
  "aria-label": "已选节点",
269
269
  children: [R.map((e) => /* @__PURE__ */ u("span", {
270
270
  className: "ui-selection-tag",
271
- children: [I.get(e)?.label ?? e, /* @__PURE__ */ l("button", {
271
+ children: [/* @__PURE__ */ l("span", {
272
+ className: "ui-selection-tag-label",
273
+ children: I.get(e)?.label ?? e
274
+ }), /* @__PURE__ */ l("button", {
272
275
  type: "button",
273
276
  disabled: D,
274
277
  "aria-label": `移除 ${I.get(e)?.label ?? e}`,
@@ -0,0 +1,123 @@
1
+ import { FormField as e } from "./FormField.js";
2
+ import { enabledWheelOptions as t, resolveWheelPath as n, wheelOptionsKey as r } from "./option-wheel-model.js";
3
+ import { OptionWheelDialog as i } from "./OptionWheelDialog.js";
4
+ import { useCallback as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
+ //#region src/WheelCascader.tsx
7
+ function f(f) {
8
+ let p = s(), m = f.id ?? f.inputProps?.id ?? p, h = c(null), g = a((e) => {
9
+ h.current = e, typeof f.inputRef == "function" ? f.inputRef(e) : f.inputRef && (f.inputRef.current = e);
10
+ }, [f.inputRef]), [_, v] = l(!1), [y, b] = l();
11
+ o(() => {
12
+ (f.value.length || !f.required) && b(void 0);
13
+ }, [f.value.length, f.required]);
14
+ let x = f.error ?? y, S = JSON.stringify([
15
+ f.value,
16
+ r(f.options),
17
+ !!f.disabled,
18
+ !!f.inputProps?.readOnly
19
+ ]), [C, w] = l(S), T = C !== S, E = f.open ?? _, [D, O] = l(!1), k = E && !f.disabled && !f.inputProps?.readOnly && !T && !D;
20
+ function A() {
21
+ v(!1), f.onOpenChange?.(!1);
22
+ }
23
+ o(() => {
24
+ T && (w(S), E && (O(!0), A()));
25
+ }, [
26
+ S,
27
+ T,
28
+ E
29
+ ]), o(() => {
30
+ E || O(!1);
31
+ }, [E]);
32
+ function j() {
33
+ f.disabled || f.inputProps?.readOnly || (w(S), O(!1), v(!0), f.onOpenChange?.(!0));
34
+ }
35
+ let M = [], N = f.options;
36
+ for (let e of f.value) {
37
+ let t = N.find((t) => t.value === e);
38
+ if (!t) break;
39
+ M.push(t), N = t.children ?? [];
40
+ }
41
+ let { onClick: P, onKeyDown: F, ...I } = f.inputProps ?? {}, L = [
42
+ I["aria-describedby"],
43
+ f.helpText !== void 0 && `${m}-help`,
44
+ x && `${m}-error`
45
+ ].filter(Boolean).join(" ") || void 0;
46
+ function R(e) {
47
+ if (f.disabled || f.inputProps?.readOnly || T) return;
48
+ if (!e.length) {
49
+ if (f.required || f.allowClear === !1) return;
50
+ f.onValueChange([], []), A();
51
+ return;
52
+ }
53
+ let r = n(t(f.options), e);
54
+ if (JSON.stringify(r.value) !== JSON.stringify(e)) return;
55
+ let i = [], a = f.options;
56
+ for (let t of e) {
57
+ let e = a.find((e) => e.value === t);
58
+ i.push(e), a = e.children ?? [];
59
+ }
60
+ JSON.stringify(f.value) !== JSON.stringify(e) && f.onValueChange(e, i), A();
61
+ }
62
+ return /* @__PURE__ */ d(e, {
63
+ controlId: m,
64
+ label: f.label,
65
+ helpText: f.helpText,
66
+ error: x,
67
+ required: f.required,
68
+ children: [
69
+ f.required && /* @__PURE__ */ u("input", {
70
+ className: "ui-wheel-validation",
71
+ tabIndex: -1,
72
+ "aria-hidden": "true",
73
+ required: !0,
74
+ disabled: f.disabled,
75
+ value: f.value.length ? "selected" : "",
76
+ onChange: () => {},
77
+ onInvalid: (e) => {
78
+ e.preventDefault(), b("请选择一个选项"), h.current?.focus();
79
+ }
80
+ }),
81
+ /* @__PURE__ */ u("input", {
82
+ ...I,
83
+ id: m,
84
+ ref: g,
85
+ type: "text",
86
+ readOnly: !0,
87
+ inputMode: "none",
88
+ disabled: f.disabled,
89
+ className: `ui-input ui-wheel-cascader ${f.className ?? ""}`,
90
+ value: M.map((e) => e.label).join(" / "),
91
+ placeholder: f.placeholder ?? "请选择",
92
+ "aria-haspopup": "dialog",
93
+ "aria-expanded": k,
94
+ "aria-required": f.required || void 0,
95
+ "aria-invalid": x ? !0 : I["aria-invalid"],
96
+ "aria-describedby": L,
97
+ onClick: (e) => {
98
+ P?.(e), e.defaultPrevented || j();
99
+ },
100
+ onKeyDown: (e) => {
101
+ F?.(e), !e.defaultPrevented && [
102
+ "Enter",
103
+ " ",
104
+ "ArrowDown"
105
+ ].includes(e.key) && (e.preventDefault(), j());
106
+ }
107
+ }),
108
+ k && /* @__PURE__ */ u(i, {
109
+ options: f.options,
110
+ value: f.value,
111
+ title: f.label ?? "选择选项",
112
+ returnFocus: h,
113
+ clearLabel: f.clearLabel,
114
+ emptyText: f.emptyText,
115
+ allowClear: !f.required && f.allowClear !== !1,
116
+ onClose: A,
117
+ onConfirm: R
118
+ })
119
+ ]
120
+ });
121
+ }
122
+ //#endregion
123
+ export { f as WheelCascader };
@@ -0,0 +1,97 @@
1
+ import { Button as e } from "./Button.js";
2
+ import { useOverlayContainer as t } from "./OverlayContainer.js";
3
+ import { ModalShell as n } from "./ModalShell.js";
4
+ import { initialWheelDate as r, wheelBounds as i, wheelDate as a } from "./date-wheel-model.js";
5
+ import { DateWheelPicker as o } from "./DateWheelPicker.js";
6
+ import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
7
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
8
+ import { createPortal as g } from "react-dom";
9
+ //#region src/WheelDateInput.tsx
10
+ var _ = s(function({ value: s, onValueChange: _, minDate: v, maxDate: y, min: b, max: x, isDateUnavailable: S, inputRef: C, inputClassName: w, className: T = "", disabled: E, readOnly: D, required: O, onValidationError: k, onKeyDown: A, onClick: j, mobileMode: M, ...N }, P) {
11
+ let F = u(), I = d(null), L = t(), [R, z] = f(!1), [B, V] = f(""), [H, U] = f(!1), W = v ?? (b === void 0 ? void 0 : String(b)), G = y ?? (x === void 0 ? void 0 : String(x)), K = i(W, G), q = a(B), J = !K || !q || q.compare(K.min) < 0 || q.compare(K.max) > 0 || !!S?.(B), Y = E || D;
12
+ l(() => {
13
+ z(!1);
14
+ }, [s, Y]);
15
+ let X = c((e) => {
16
+ I.current = e;
17
+ for (let t of [P, C]) typeof t == "function" ? t(e) : t && (t.current = e);
18
+ }, [P, C]);
19
+ function Z() {
20
+ Y || (U(!1), V(r(s, W, G).toString()), z(!0));
21
+ }
22
+ function Q(e) {
23
+ Y || (e ? J || H : O) || (k?.(null), _(e), z(!1));
24
+ }
25
+ return /* @__PURE__ */ h("span", {
26
+ className: `ui-wheel-date-input ${T}`,
27
+ children: [/* @__PURE__ */ m("input", {
28
+ ...N,
29
+ ref: X,
30
+ className: w,
31
+ type: "text",
32
+ readOnly: !0,
33
+ inputMode: "none",
34
+ disabled: E,
35
+ required: O,
36
+ value: s.replaceAll("-", "/"),
37
+ placeholder: N.placeholder ?? "请选择日期",
38
+ "aria-haspopup": "dialog",
39
+ "aria-expanded": R && !Y,
40
+ "aria-controls": R && !Y ? `${F}-panel` : void 0,
41
+ onClick: (e) => {
42
+ j?.(e), e.defaultPrevented || Z();
43
+ },
44
+ onKeyDown: (e) => {
45
+ A?.(e), !e.defaultPrevented && [
46
+ "Enter",
47
+ " ",
48
+ "ArrowDown"
49
+ ].includes(e.key) && (e.preventDefault(), Z());
50
+ }
51
+ }), R && !Y && g(/* @__PURE__ */ h(n, {
52
+ titleId: `${F}-title`,
53
+ title: "选择日期",
54
+ closeLabel: "关闭日期选择",
55
+ returnFocus: I,
56
+ onClose: () => z(!1),
57
+ backdropClassName: "ui-date-wheel-backdrop",
58
+ panelClassName: "ui-date-wheel-panel",
59
+ contentClassName: "ui-date-wheel-content",
60
+ contentProps: { id: `${F}-panel` },
61
+ footerClassName: "ui-date-wheel-actions",
62
+ footer: /* @__PURE__ */ h(p, { children: [
63
+ /* @__PURE__ */ m(e, {
64
+ variant: "secondary",
65
+ onClick: () => z(!1),
66
+ children: "取消"
67
+ }),
68
+ !O && /* @__PURE__ */ m(e, {
69
+ variant: "secondary",
70
+ disabled: !s,
71
+ onClick: () => Q(""),
72
+ children: "清除"
73
+ }),
74
+ /* @__PURE__ */ m(e, {
75
+ variant: "primary",
76
+ disabled: J || H,
77
+ onClick: () => Q(B),
78
+ children: "确定日期"
79
+ })
80
+ ] }),
81
+ children: [/* @__PURE__ */ m(o, {
82
+ value: B,
83
+ onValueChange: V,
84
+ minDate: W,
85
+ maxDate: G,
86
+ isDateUnavailable: S,
87
+ onPendingChange: U
88
+ }), /* @__PURE__ */ m("p", {
89
+ className: J ? "ui-form-error" : "ui-date-wheel-summary",
90
+ role: "status",
91
+ children: J ? "当前日期不可选择,请选择其他日期" : B.replaceAll("-", "/")
92
+ })]
93
+ }), L ?? document.body)]
94
+ });
95
+ });
96
+ //#endregion
97
+ export { _ as WheelDateInput };
@@ -6,42 +6,45 @@ import { Skeleton as a, SkeletonText as o } from "./Skeleton.js";
6
6
  import { Popconfirm as s, Popover as c, Tooltip as l } from "./FloatingControls.js";
7
7
  import { UserProfilePopover as u } from "./UserProfilePopover.js";
8
8
  import { Checkbox as d, FormField as f, SelectInput as p, TextArea as m, TextInput as h } from "./FormField.js";
9
- import { Select as g } from "./Select.js";
10
- import { Combobox as _ } from "./Combobox.js";
11
- import { AutoComplete as v, Autocomplete as y } from "./AutoComplete.js";
12
- import { ToastProvider as b, useToast as x } from "./Toast.js";
13
- import { DataTableTheme as S } from "./DataTableTheme.js";
14
- import { DataTableMergedRows as C } from "./DataTableMergedRows.js";
15
- import { DataTable as w, DataTableView as T, sortRows as E, useDataTable as D } from "./data-table.js";
16
- import { ExplainableButton as O } from "./ExplainableButton.js";
17
- import { Dialog as k, ModalShell as A } from "./ModalShell.js";
18
- import { DateInput as j, calendarDays as M, parseDate as N } from "./DateInput.js";
19
- import { Pagination as P, clampPage as F, pageCount as I, visiblePages as L } from "./Pagination.js";
20
- import { RovingTabList as R, RovingTabPanel as z, nextRovingTabValue as B } from "./RovingTabs.js";
21
- import { ToggleSwitch as V } from "./ToggleSwitch.js";
22
- import { SegmentedControl as H } from "./SegmentedControl.js";
23
- import { AsyncState as U, RecoverableAsyncState as W } from "./RecoverableAsyncState.js";
24
- import { useModalFocusTrap as G } from "./useModalFocusTrap.js";
25
- import { AsyncSearchPicker as K } from "./AsyncSearchPicker.js";
26
- import { AsyncDirectoryPicker as q } from "./AsyncDirectoryPicker.js";
27
- import { DropdownMenu as J, Menu as Y } from "./DropdownMenu.js";
28
- import { ConfirmDialog as X } from "./ConfirmDialog.js";
29
- import { useDebouncedValue as Z } from "./useDebouncedValue.js";
30
- import { Badge as Q } from "./Badge.js";
31
- import { MetricCard as $ } from "./MetricCard.js";
32
- import { PageHeader as ee } from "./PageHeader.js";
33
- import { SectionCard as te } from "./SectionCard.js";
34
- import { useSortableTransferScope as ne } from "./sortable-transfer-scope.js";
35
- import { SortableList as re, moveSortableItems as ie } from "./SortableList.js";
36
- import { TreeSelect as ae, buildTreeSelectTree as oe, filterTreeSelectTree as se } from "./TreeSelect.js";
37
- import { Cascader as ce, buildCascaderOptions as le, indexCascaderPaths as ue } from "./Cascader.js";
38
- import { StructuredAddressInput as de, findAddressRegionPath as fe, flattenAddressRegions as pe, searchAddressRegions as me } from "./StructuredAddressInput.js";
39
- import { FileDropzone as he, acceptsFile as ge } from "./FileDropzone.js";
40
- import { useFilePreparation as _e } from "./useFilePreparation.js";
41
- import { FilePreparationDialog as ve } from "./FilePreparationDialog.js";
42
- import { PreparedFileDropzone as ye } from "./PreparedFileDropzone.js";
43
- import { formatDecimalAmount as be, formatScaledMoney as xe } from "./amount-format.js";
44
- import { NumericInput as Se, ScaledNumericInput as Ce } from "./NumericInput.js";
45
- import { MultiSelect as we } from "./MultiSelect.js";
46
- import { MultilineAutoComplete as Te } from "./MultilineAutoComplete.js";
47
- export { r as Alert, q as AsyncDirectoryPicker, K as AsyncSearchPicker, U as AsyncState, v as AutoComplete, y as Autocomplete, Q as Badge, e as Button, ce as Cascader, d as Checkbox, _ as Combobox, X as ConfirmDialog, w as DataTable, C as DataTableMergedRows, S as DataTableTheme, T as DataTableView, j as DateInput, k as Dialog, J as DropdownMenu, i as EmptyState, O as ExplainableButton, he as FileDropzone, ve as FilePreparationDialog, f as FormField, t as LinkButton, Y as Menu, $ as MetricCard, A as ModalShell, we as MultiSelect, Te as MultilineAutoComplete, Se as NumericInput, ee as PageHeader, P as Pagination, s as Popconfirm, c as Popover, ye as PreparedFileDropzone, W as RecoverableAsyncState, R as RovingTabList, z as RovingTabPanel, Ce as ScaledNumericInput, te as SectionCard, H as SegmentedControl, g as Select, p as SelectInput, a as Skeleton, o as SkeletonText, re as SortableList, de as StructuredAddressInput, m as TextArea, h as TextInput, b as ToastProvider, V as ToggleSwitch, l as Tooltip, ae as TreeSelect, u as UserProfilePopover, ge as acceptsFile, le as buildCascaderOptions, oe as buildTreeSelectTree, n as buttonClassName, M as calendarDays, F as clampPage, se as filterTreeSelectTree, fe as findAddressRegionPath, pe as flattenAddressRegions, be as formatDecimalAmount, xe as formatScaledMoney, ue as indexCascaderPaths, ie as moveSortableItems, B as nextRovingTabValue, I as pageCount, N as parseDate, me as searchAddressRegions, E as sortRows, D as useDataTable, Z as useDebouncedValue, _e as useFilePreparation, G as useModalFocusTrap, ne as useSortableTransferScope, x as useToast, L as visiblePages };
9
+ import { usePhoneWheel as g } from "./usePhoneWheel.js";
10
+ import { Dialog as _, ModalShell as v } from "./ModalShell.js";
11
+ import { AsyncState as y, RecoverableAsyncState as b } from "./RecoverableAsyncState.js";
12
+ import { Select as x } from "./Select.js";
13
+ import { Combobox as S } from "./Combobox.js";
14
+ import { AutoComplete as C, Autocomplete as w } from "./AutoComplete.js";
15
+ import { ToastProvider as T, useToast as E } from "./Toast.js";
16
+ import { DataTableTheme as D } from "./DataTableTheme.js";
17
+ import { DataTableMergedRows as O } from "./DataTableMergedRows.js";
18
+ import { DataTable as k, DataTableView as A, sortRows as j, useDataTable as M } from "./data-table.js";
19
+ import { ExplainableButton as N } from "./ExplainableButton.js";
20
+ import { DateWheelPicker as P } from "./DateWheelPicker.js";
21
+ import { WheelDateInput as F } from "./WheelDateInput.js";
22
+ import { DateInput as I, calendarDays as L, parseDate as R } from "./DateInput.js";
23
+ import { Pagination as z, clampPage as B, pageCount as V, visiblePages as H } from "./Pagination.js";
24
+ import { RovingTabList as U, RovingTabPanel as W, nextRovingTabValue as G } from "./RovingTabs.js";
25
+ import { ToggleSwitch as K } from "./ToggleSwitch.js";
26
+ import { SegmentedControl as q } from "./SegmentedControl.js";
27
+ import { useModalFocusTrap as J } from "./useModalFocusTrap.js";
28
+ import { AsyncSearchPicker as Y } from "./AsyncSearchPicker.js";
29
+ import { AsyncDirectoryPicker as X } from "./AsyncDirectoryPicker.js";
30
+ import { DropdownMenu as Z, Menu as Q } from "./DropdownMenu.js";
31
+ import { ConfirmDialog as $ } from "./ConfirmDialog.js";
32
+ import { useDebouncedValue as ee } from "./useDebouncedValue.js";
33
+ import { Badge as te } from "./Badge.js";
34
+ import { MetricCard as ne } from "./MetricCard.js";
35
+ import { PageHeader as re } from "./PageHeader.js";
36
+ import { SectionCard as ie } from "./SectionCard.js";
37
+ import { useSortableTransferScope as ae } from "./sortable-transfer-scope.js";
38
+ import { SortableList as oe, moveSortableItems as se } from "./SortableList.js";
39
+ import { TreeSelect as ce, buildTreeSelectTree as le, filterTreeSelectTree as ue } from "./TreeSelect.js";
40
+ import { Cascader as de, buildCascaderOptions as fe, indexCascaderPaths as pe } from "./Cascader.js";
41
+ import { StructuredAddressInput as me, findAddressRegionPath as he, flattenAddressRegions as ge, searchAddressRegions as _e } from "./StructuredAddressInput.js";
42
+ import { FileDropzone as ve, acceptsFile as ye } from "./FileDropzone.js";
43
+ import { useFilePreparation as be } from "./useFilePreparation.js";
44
+ import { FilePreparationDialog as xe } from "./FilePreparationDialog.js";
45
+ import { PreparedFileDropzone as Se } from "./PreparedFileDropzone.js";
46
+ import { formatDecimalAmount as Ce, formatScaledMoney as we } from "./amount-format.js";
47
+ import { NumericInput as Te, ScaledNumericInput as Ee } from "./NumericInput.js";
48
+ import { MultiSelect as De } from "./MultiSelect.js";
49
+ import { MultilineAutoComplete as Oe } from "./MultilineAutoComplete.js";
50
+ export { r as Alert, X as AsyncDirectoryPicker, Y as AsyncSearchPicker, y as AsyncState, C as AutoComplete, w as Autocomplete, te as Badge, e as Button, de as Cascader, d as Checkbox, S as Combobox, $ as ConfirmDialog, k as DataTable, O as DataTableMergedRows, D as DataTableTheme, A as DataTableView, I as DateInput, P as DateWheelPicker, _ as Dialog, Z as DropdownMenu, i as EmptyState, N as ExplainableButton, ve as FileDropzone, xe as FilePreparationDialog, f as FormField, t as LinkButton, Q as Menu, ne as MetricCard, v as ModalShell, De as MultiSelect, Oe as MultilineAutoComplete, Te as NumericInput, re as PageHeader, z as Pagination, s as Popconfirm, c as Popover, Se as PreparedFileDropzone, b as RecoverableAsyncState, U as RovingTabList, W as RovingTabPanel, Ee as ScaledNumericInput, ie as SectionCard, q as SegmentedControl, x as Select, p as SelectInput, a as Skeleton, o as SkeletonText, oe as SortableList, me as StructuredAddressInput, m as TextArea, h as TextInput, T as ToastProvider, K as ToggleSwitch, l as Tooltip, ce as TreeSelect, u as UserProfilePopover, F as WheelDateInput, ye as acceptsFile, fe as buildCascaderOptions, le as buildTreeSelectTree, n as buttonClassName, L as calendarDays, B as clampPage, ue as filterTreeSelectTree, he as findAddressRegionPath, ge as flattenAddressRegions, Ce as formatDecimalAmount, we as formatScaledMoney, pe as indexCascaderPaths, se as moveSortableItems, G as nextRovingTabValue, V as pageCount, R as parseDate, _e as searchAddressRegions, j as sortRows, M as useDataTable, ee as useDebouncedValue, be as useFilePreparation, J as useModalFocusTrap, g as usePhoneWheel, ae as useSortableTransferScope, E as useToast, H as visiblePages };
@@ -0,0 +1,27 @@
1
+ import { CalendarDate as e, getLocalTimeZone as t, parseDate as n, today as r } from "@internationalized/date";
2
+ //#region src/date-wheel-model.ts
3
+ function i(e) {
4
+ if (!e || !/^\d{4}-\d{2}-\d{2}$/.test(e)) return null;
5
+ try {
6
+ let t = n(e);
7
+ return t.toString() === e ? t : null;
8
+ } catch {
9
+ return null;
10
+ }
11
+ }
12
+ function a(t, n) {
13
+ let r = t === void 0 ? new e(1, 1, 1) : i(t), a = n === void 0 ? new e(9999, 12, 31) : i(n);
14
+ return r && a && r.compare(a) <= 0 ? {
15
+ min: r,
16
+ max: a
17
+ } : null;
18
+ }
19
+ function o(e, t) {
20
+ return e.compare(t.min) < 0 ? t.min : e.compare(t.max) > 0 ? t.max : e;
21
+ }
22
+ function s(e, n, s) {
23
+ let c = a(n, s), l = i(e) ?? r(t());
24
+ return c ? o(l, c) : l;
25
+ }
26
+ //#endregion
27
+ export { o as clampWheelDate, s as initialWheelDate, a as wheelBounds, i as wheelDate };