@ai-matrx/records-ui 0.107.3 → 0.108.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/CHANGELOG.md +19 -0
- package/dist/first-page.cjs +487 -0
- package/dist/first-page.cjs.map +1 -0
- package/dist/first-page.d.cts +35 -0
- package/dist/first-page.d.ts +35 -0
- package/dist/first-page.js +474 -0
- package/dist/first-page.js.map +1 -0
- package/dist/index.cjs +2698 -2372
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -599
- package/dist/index.d.ts +190 -599
- package/dist/index.js +1619 -1289
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +109 -76
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +34 -1
- package/dist/pickers.js.map +1 -1
- package/dist/views-VPwb3QQk.d.cts +505 -0
- package/dist/views-VPwb3QQk.d.ts +505 -0
- package/package.json +17 -6
package/dist/pickers.js
CHANGED
|
@@ -3072,6 +3072,38 @@ function formatControl(args) {
|
|
|
3072
3072
|
import { useState as useState13 } from "react";
|
|
3073
3073
|
import { Popover as Popover2, PopoverContent as PopoverContent2, PopoverTrigger as PopoverTrigger2, cn as cn12 } from "@ai-matrx/design-system";
|
|
3074
3074
|
import { readTypedDate, readTypedTime, typedDateText, typedTimeText } from "@ai-matrx/records";
|
|
3075
|
+
|
|
3076
|
+
// src/personTime.ts
|
|
3077
|
+
import { useSyncExternalStore } from "react";
|
|
3078
|
+
var zone = null;
|
|
3079
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
3080
|
+
function usePersonTimeZone() {
|
|
3081
|
+
return useSyncExternalStore(
|
|
3082
|
+
(cb) => {
|
|
3083
|
+
listeners.add(cb);
|
|
3084
|
+
return () => listeners.delete(cb);
|
|
3085
|
+
},
|
|
3086
|
+
() => zone,
|
|
3087
|
+
() => null
|
|
3088
|
+
);
|
|
3089
|
+
}
|
|
3090
|
+
function personWallNow(at = /* @__PURE__ */ new Date()) {
|
|
3091
|
+
if (!zone) return at;
|
|
3092
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
3093
|
+
timeZone: zone,
|
|
3094
|
+
year: "numeric",
|
|
3095
|
+
month: "2-digit",
|
|
3096
|
+
day: "2-digit",
|
|
3097
|
+
hour: "2-digit",
|
|
3098
|
+
minute: "2-digit",
|
|
3099
|
+
second: "2-digit",
|
|
3100
|
+
hourCycle: "h23"
|
|
3101
|
+
}).formatToParts(at);
|
|
3102
|
+
const n = (t) => Number(parts.find((p) => p.type === t)?.value ?? 0);
|
|
3103
|
+
return new Date(n("year"), n("month") - 1, n("day"), n("hour"), n("minute"), n("second"));
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
// src/typedDateHelper.tsx
|
|
3075
3107
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3076
3108
|
var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
3077
3109
|
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
@@ -3121,7 +3153,8 @@ function TypedDateHelper({
|
|
|
3121
3153
|
}) {
|
|
3122
3154
|
const [open, setOpen] = useState13(false);
|
|
3123
3155
|
const held = readBox(text, kind);
|
|
3124
|
-
|
|
3156
|
+
usePersonTimeZone();
|
|
3157
|
+
const today = personWallNow();
|
|
3125
3158
|
const start = held.day ? new Date(Number(held.day.slice(0, 4)), Number(held.day.slice(5, 7)) - 1, 1) : new Date(today.getFullYear(), today.getMonth(), 1);
|
|
3126
3159
|
const [month, setMonth] = useState13(null);
|
|
3127
3160
|
const shown2 = month ?? { y: start.getFullYear(), m: start.getMonth() };
|