@serendie/ui 2.1.3 → 2.2.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/dist/client.js +79 -74
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/DatePicker.d.ts +13 -0
- package/dist/components/DatePicker/DatePicker.js +203 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +6 -0
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/components/DatePicker/styles.js +224 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
- package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
- package/dist/components/ProgressIndicator/index.d.ts +4 -1
- package/dist/components/ProgressIndicator/index.js +3 -2
- package/dist/components/ProgressIndicator/util.d.ts +1 -0
- package/dist/components/ProgressIndicator/util.js +13 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextField/TextField.js +59 -156
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -75
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
- package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
- package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
- package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
- package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
- package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
- package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
- package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
- package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
- package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
- package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
- package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
- package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
- package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
- package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
- package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
- package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
- package/dist/preset.d.ts +11 -1
- package/dist/recipes/index.d.ts +3 -2
- package/dist/recipes/index.js +5 -2
- package/dist/recipes/textFieldRecipe.d.ts +6 -0
- package/dist/recipes/textFieldRecipe.js +107 -0
- package/dist/styled-system/css/cva.js +43 -38
- package/dist/styled-system/recipes/create-recipe.js +37 -0
- package/dist/styled-system/recipes/text-field-recipe.js +61 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/keyframes/index.d.ts +8 -0
- package/dist/tokens/keyframes/index.js +6 -2
- package/package.json +3 -3
- package/styled-system/recipes/create-recipe.js +82 -0
- package/styled-system/recipes/index.d.ts +2 -0
- package/styled-system/recipes/index.js +1 -0
- package/styled-system/recipes/text-field-recipe.d.ts +28 -0
- package/styled-system/recipes/text-field-recipe.js +72 -0
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
- package/dist/node_modules/proxy-compare/dist/index.js +0 -7
|
@@ -1,131 +1,136 @@
|
|
|
1
1
|
function c() {
|
|
2
2
|
return typeof window < "u";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return p(
|
|
4
|
+
function u(t) {
|
|
5
|
+
return p(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
6
6
|
}
|
|
7
|
-
function i(
|
|
8
|
-
var
|
|
9
|
-
return (
|
|
7
|
+
function i(t) {
|
|
8
|
+
var e;
|
|
9
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
return (
|
|
11
|
+
function N(t) {
|
|
12
|
+
var e;
|
|
13
|
+
return (e = (p(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
14
14
|
}
|
|
15
|
-
function p(
|
|
16
|
-
return c() ?
|
|
15
|
+
function p(t) {
|
|
16
|
+
return c() ? t instanceof Node || t instanceof i(t).Node : !1;
|
|
17
17
|
}
|
|
18
|
-
function m(
|
|
19
|
-
return c() ?
|
|
18
|
+
function m(t) {
|
|
19
|
+
return c() ? t instanceof Element || t instanceof i(t).Element : !1;
|
|
20
20
|
}
|
|
21
|
-
function w(
|
|
22
|
-
return c() ?
|
|
21
|
+
function w(t) {
|
|
22
|
+
return c() ? t instanceof HTMLElement || t instanceof i(t).HTMLElement : !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return !c() || typeof ShadowRoot > "u" ? !1 :
|
|
24
|
+
function f(t) {
|
|
25
|
+
return !c() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof i(t).ShadowRoot;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const E = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
28
|
+
function y(t) {
|
|
28
29
|
const {
|
|
29
|
-
overflow:
|
|
30
|
-
overflowX:
|
|
30
|
+
overflow: e,
|
|
31
|
+
overflowX: n,
|
|
31
32
|
overflowY: o,
|
|
32
33
|
display: r
|
|
33
|
-
} =
|
|
34
|
-
return /auto|scroll|overlay|hidden|clip/.test(
|
|
34
|
+
} = S(t);
|
|
35
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !E.has(r);
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
const T = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
38
|
+
function A(t) {
|
|
39
|
+
return T.has(u(t));
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
const v = [":popover-open", ":modal"];
|
|
42
|
+
function L(t) {
|
|
43
|
+
return v.some((e) => {
|
|
41
44
|
try {
|
|
42
|
-
return
|
|
45
|
+
return t.matches(e);
|
|
43
46
|
} catch {
|
|
44
47
|
return !1;
|
|
45
48
|
}
|
|
46
49
|
});
|
|
47
50
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
const D = ["transform", "translate", "scale", "rotate", "perspective"], C = ["transform", "translate", "scale", "rotate", "perspective", "filter"], k = ["paint", "layout", "strict", "content"];
|
|
52
|
+
function V(t) {
|
|
53
|
+
const e = O(), n = m(t) ? S(t) : t;
|
|
54
|
+
return D.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || C.some((o) => (n.willChange || "").includes(o)) || k.some((o) => (n.contain || "").includes(o));
|
|
55
|
+
}
|
|
56
|
+
function B(t) {
|
|
57
|
+
let e = s(t);
|
|
58
|
+
for (; w(e) && !h(e); ) {
|
|
59
|
+
if (V(e))
|
|
60
|
+
return e;
|
|
61
|
+
if (L(e))
|
|
58
62
|
return null;
|
|
59
|
-
|
|
63
|
+
e = s(e);
|
|
60
64
|
}
|
|
61
65
|
return null;
|
|
62
66
|
}
|
|
63
|
-
function
|
|
67
|
+
function O() {
|
|
64
68
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
65
69
|
}
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
const R = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
71
|
+
function h(t) {
|
|
72
|
+
return R.has(u(t));
|
|
68
73
|
}
|
|
69
|
-
function
|
|
70
|
-
return i(
|
|
74
|
+
function S(t) {
|
|
75
|
+
return i(t).getComputedStyle(t);
|
|
71
76
|
}
|
|
72
|
-
function
|
|
73
|
-
return m(
|
|
74
|
-
scrollLeft:
|
|
75
|
-
scrollTop:
|
|
77
|
+
function F(t) {
|
|
78
|
+
return m(t) ? {
|
|
79
|
+
scrollLeft: t.scrollLeft,
|
|
80
|
+
scrollTop: t.scrollTop
|
|
76
81
|
} : {
|
|
77
|
-
scrollLeft:
|
|
78
|
-
scrollTop:
|
|
82
|
+
scrollLeft: t.scrollX,
|
|
83
|
+
scrollTop: t.scrollY
|
|
79
84
|
};
|
|
80
85
|
}
|
|
81
|
-
function
|
|
82
|
-
if (
|
|
83
|
-
return
|
|
84
|
-
const
|
|
86
|
+
function s(t) {
|
|
87
|
+
if (u(t) === "html")
|
|
88
|
+
return t;
|
|
89
|
+
const e = (
|
|
85
90
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
t.assignedSlot || // DOM Element detected.
|
|
92
|
+
t.parentNode || // ShadowRoot detected.
|
|
93
|
+
f(t) && t.host || // Fallback.
|
|
94
|
+
N(t)
|
|
90
95
|
);
|
|
91
|
-
return
|
|
96
|
+
return f(e) ? e.host : e;
|
|
92
97
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return
|
|
98
|
+
function b(t) {
|
|
99
|
+
const e = s(t);
|
|
100
|
+
return h(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : w(e) && y(e) ? e : b(e);
|
|
96
101
|
}
|
|
97
|
-
function d(
|
|
102
|
+
function d(t, e, n) {
|
|
98
103
|
var o;
|
|
99
|
-
|
|
100
|
-
const r =
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
105
|
+
const r = b(t), g = r === ((o = t.ownerDocument) == null ? void 0 : o.body), l = i(r);
|
|
106
|
+
if (g) {
|
|
107
|
+
const a = _(l);
|
|
108
|
+
return e.concat(l, l.visualViewport || [], y(r) ? r : [], a && n ? d(a) : []);
|
|
104
109
|
}
|
|
105
|
-
return
|
|
110
|
+
return e.concat(r, d(r, [], n));
|
|
106
111
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
112
|
+
function _(t) {
|
|
113
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
109
114
|
}
|
|
110
115
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
S as getComputedStyle,
|
|
117
|
+
B as getContainingBlock,
|
|
118
|
+
N as getDocumentElement,
|
|
119
|
+
_ as getFrameElement,
|
|
120
|
+
b as getNearestOverflowAncestor,
|
|
121
|
+
u as getNodeName,
|
|
122
|
+
F as getNodeScroll,
|
|
118
123
|
d as getOverflowAncestors,
|
|
119
|
-
|
|
124
|
+
s as getParentNode,
|
|
120
125
|
i as getWindow,
|
|
121
|
-
|
|
126
|
+
V as isContainingBlock,
|
|
122
127
|
m as isElement,
|
|
123
128
|
w as isHTMLElement,
|
|
124
|
-
|
|
129
|
+
h as isLastTraversableNode,
|
|
125
130
|
p as isNode,
|
|
126
131
|
y as isOverflowElement,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
f as isShadowRoot,
|
|
133
|
+
A as isTableElement,
|
|
134
|
+
L as isTopLayer,
|
|
135
|
+
O as isWebKit
|
|
131
136
|
};
|
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
const
|
|
1
|
+
const j = ["top", "right", "bottom", "left"], m = Math.min, p = Math.max, C = Math.round, L = Math.floor, E = (t) => ({
|
|
2
2
|
x: t,
|
|
3
3
|
y: t
|
|
4
|
-
}),
|
|
4
|
+
}), h = {
|
|
5
5
|
left: "right",
|
|
6
6
|
right: "left",
|
|
7
7
|
bottom: "top",
|
|
8
8
|
top: "bottom"
|
|
9
|
-
},
|
|
9
|
+
}, x = {
|
|
10
10
|
start: "end",
|
|
11
11
|
end: "start"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function R(t, e, n) {
|
|
14
|
+
return p(t, m(e, n));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return typeof t == "function" ? t(
|
|
16
|
+
function T(t, e) {
|
|
17
|
+
return typeof t == "function" ? t(e) : t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function g(t) {
|
|
20
20
|
return t.split("-")[0];
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function a(t) {
|
|
23
23
|
return t.split("-")[1];
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function b(t) {
|
|
26
26
|
return t === "x" ? "y" : "x";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function d(t) {
|
|
29
29
|
return t === "y" ? "height" : "width";
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const A = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
32
|
+
function P(t) {
|
|
33
|
+
return A.has(g(t)) ? "y" : "x";
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
35
|
+
function y(t) {
|
|
36
|
+
return b(P(t));
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
const r =
|
|
40
|
-
let c =
|
|
41
|
-
return
|
|
38
|
+
function k(t, e, n) {
|
|
39
|
+
n === void 0 && (n = !1);
|
|
40
|
+
const r = a(t), i = y(t), o = d(i);
|
|
41
|
+
let c = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
42
|
+
return e.reference[o] > e.floating[o] && (c = f(c)), [c, f(c)];
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
return [s(t),
|
|
44
|
+
function q(t) {
|
|
45
|
+
const e = f(t);
|
|
46
|
+
return [s(t), e, s(e)];
|
|
46
47
|
}
|
|
47
48
|
function s(t) {
|
|
48
|
-
return t.replace(/start|end/g, (
|
|
49
|
+
return t.replace(/start|end/g, (e) => x[e]);
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
const u = ["left", "right"], l = ["right", "left"], M = ["top", "bottom"], O = ["bottom", "top"];
|
|
52
|
+
function S(t, e, n) {
|
|
52
53
|
switch (t) {
|
|
53
54
|
case "top":
|
|
54
55
|
case "bottom":
|
|
55
|
-
return
|
|
56
|
+
return n ? e ? l : u : e ? u : l;
|
|
56
57
|
case "left":
|
|
57
58
|
case "right":
|
|
58
|
-
return
|
|
59
|
+
return e ? M : O;
|
|
59
60
|
default:
|
|
60
61
|
return [];
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
return
|
|
64
|
+
function z(t, e, n, r) {
|
|
65
|
+
const i = a(t);
|
|
66
|
+
let o = S(g(t), n === "start", r);
|
|
67
|
+
return i && (o = o.map((c) => c + "-" + i), e && (o = o.concat(o.map(s)))), o;
|
|
67
68
|
}
|
|
68
69
|
function f(t) {
|
|
69
|
-
return t.replace(/left|right|bottom|top/g, (
|
|
70
|
+
return t.replace(/left|right|bottom|top/g, (e) => h[e]);
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function w(t) {
|
|
72
73
|
return {
|
|
73
74
|
top: 0,
|
|
74
75
|
right: 0,
|
|
@@ -77,53 +78,53 @@ function y(t) {
|
|
|
77
78
|
...t
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
return typeof t != "number" ?
|
|
81
|
+
function B(t) {
|
|
82
|
+
return typeof t != "number" ? w(t) : {
|
|
82
83
|
top: t,
|
|
83
84
|
right: t,
|
|
84
85
|
bottom: t,
|
|
85
86
|
left: t
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function D(t) {
|
|
89
90
|
const {
|
|
90
|
-
x:
|
|
91
|
-
y:
|
|
91
|
+
x: e,
|
|
92
|
+
y: n,
|
|
92
93
|
width: r,
|
|
93
|
-
height:
|
|
94
|
+
height: i
|
|
94
95
|
} = t;
|
|
95
96
|
return {
|
|
96
97
|
width: r,
|
|
97
|
-
height:
|
|
98
|
-
top:
|
|
99
|
-
left:
|
|
100
|
-
right:
|
|
101
|
-
bottom:
|
|
102
|
-
x:
|
|
103
|
-
y:
|
|
98
|
+
height: i,
|
|
99
|
+
top: n,
|
|
100
|
+
left: e,
|
|
101
|
+
right: e + r,
|
|
102
|
+
bottom: n + i,
|
|
103
|
+
x: e,
|
|
104
|
+
y: n
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
R as clamp,
|
|
109
|
+
E as createCoords,
|
|
110
|
+
T as evaluate,
|
|
111
|
+
w as expandPaddingObject,
|
|
112
|
+
L as floor,
|
|
113
|
+
a as getAlignment,
|
|
114
|
+
y as getAlignmentAxis,
|
|
115
|
+
k as getAlignmentSides,
|
|
116
|
+
d as getAxisLength,
|
|
117
|
+
q as getExpandedPlacements,
|
|
117
118
|
s as getOppositeAlignmentPlacement,
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
b as getOppositeAxis,
|
|
120
|
+
z as getOppositeAxisPlacements,
|
|
120
121
|
f as getOppositePlacement,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
B as getPaddingObject,
|
|
123
|
+
g as getSide,
|
|
124
|
+
P as getSideAxis,
|
|
125
|
+
p as max,
|
|
126
|
+
m as min,
|
|
127
|
+
D as rectToClientRect,
|
|
128
|
+
C as round,
|
|
129
|
+
j as sides
|
|
129
130
|
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { add as l, subtract as u, set as m, cycleDate as y, constrain as c, setTime as v, cycleTime as w, addZoned as T, subtractZoned as Z, setZoned as S, cycleZoned as C } from "./manipulation.js";
|
|
2
|
+
import { compareDate as p, compareTime as k } from "./queries.js";
|
|
3
|
+
import { dateToString as M, dateTimeToString as W, zonedDateTimeToString as z } from "./string.js";
|
|
4
|
+
import { GregorianCalendar as A } from "./GregorianCalendar.js";
|
|
5
|
+
import { toDate as b, toCalendarDateTime as _, zonedToDate as j, toZoned as E } from "./conversion.js";
|
|
6
|
+
import { _ as f } from "../../../@swc/helpers/esm/_class_private_field_init.js";
|
|
7
|
+
function $(a) {
|
|
8
|
+
let t = typeof a[0] == "object" ? a.shift() : new A(), e;
|
|
9
|
+
if (typeof a[0] == "string") e = a.shift();
|
|
10
|
+
else {
|
|
11
|
+
let s = t.getEras();
|
|
12
|
+
e = s[s.length - 1];
|
|
13
|
+
}
|
|
14
|
+
let i = a.shift(), r = a.shift(), h = a.shift();
|
|
15
|
+
return [
|
|
16
|
+
t,
|
|
17
|
+
e,
|
|
18
|
+
i,
|
|
19
|
+
r,
|
|
20
|
+
h
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
var G = /* @__PURE__ */ new WeakMap();
|
|
24
|
+
class d {
|
|
25
|
+
/** Returns a copy of this date. */
|
|
26
|
+
copy() {
|
|
27
|
+
return this.era ? new d(this.calendar, this.era, this.year, this.month, this.day) : new d(this.calendar, this.year, this.month, this.day);
|
|
28
|
+
}
|
|
29
|
+
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
30
|
+
add(t) {
|
|
31
|
+
return l(this, t);
|
|
32
|
+
}
|
|
33
|
+
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
34
|
+
subtract(t) {
|
|
35
|
+
return u(this, t);
|
|
36
|
+
}
|
|
37
|
+
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
38
|
+
set(t) {
|
|
39
|
+
return m(this, t);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
43
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
44
|
+
*/
|
|
45
|
+
cycle(t, e, i) {
|
|
46
|
+
return y(this, t, e, i);
|
|
47
|
+
}
|
|
48
|
+
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
49
|
+
toDate(t) {
|
|
50
|
+
return b(this, t);
|
|
51
|
+
}
|
|
52
|
+
/** Converts the date to an ISO 8601 formatted string. */
|
|
53
|
+
toString() {
|
|
54
|
+
return M(this);
|
|
55
|
+
}
|
|
56
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
57
|
+
compare(t) {
|
|
58
|
+
return p(this, t);
|
|
59
|
+
}
|
|
60
|
+
constructor(...t) {
|
|
61
|
+
f(this, G, {
|
|
62
|
+
writable: !0,
|
|
63
|
+
value: void 0
|
|
64
|
+
});
|
|
65
|
+
let [e, i, r, h, s] = $(t);
|
|
66
|
+
this.calendar = e, this.era = i, this.year = r, this.month = h, this.day = s, c(this);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var I = /* @__PURE__ */ new WeakMap();
|
|
70
|
+
class n {
|
|
71
|
+
/** Returns a copy of this date. */
|
|
72
|
+
copy() {
|
|
73
|
+
return this.era ? new n(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new n(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
74
|
+
}
|
|
75
|
+
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
76
|
+
add(t) {
|
|
77
|
+
return l(this, t);
|
|
78
|
+
}
|
|
79
|
+
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
80
|
+
subtract(t) {
|
|
81
|
+
return u(this, t);
|
|
82
|
+
}
|
|
83
|
+
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
84
|
+
set(t) {
|
|
85
|
+
return m(v(this, t), t);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
89
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
90
|
+
*/
|
|
91
|
+
cycle(t, e, i) {
|
|
92
|
+
switch (t) {
|
|
93
|
+
case "era":
|
|
94
|
+
case "year":
|
|
95
|
+
case "month":
|
|
96
|
+
case "day":
|
|
97
|
+
return y(this, t, e, i);
|
|
98
|
+
default:
|
|
99
|
+
return w(this, t, e, i);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
103
|
+
toDate(t, e) {
|
|
104
|
+
return b(this, t, e);
|
|
105
|
+
}
|
|
106
|
+
/** Converts the date to an ISO 8601 formatted string. */
|
|
107
|
+
toString() {
|
|
108
|
+
return W(this);
|
|
109
|
+
}
|
|
110
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
111
|
+
compare(t) {
|
|
112
|
+
let e = p(this, t);
|
|
113
|
+
return e === 0 ? k(this, _(t)) : e;
|
|
114
|
+
}
|
|
115
|
+
constructor(...t) {
|
|
116
|
+
f(this, I, {
|
|
117
|
+
writable: !0,
|
|
118
|
+
value: void 0
|
|
119
|
+
});
|
|
120
|
+
let [e, i, r, h, s] = $(t);
|
|
121
|
+
this.calendar = e, this.era = i, this.year = r, this.month = h, this.day = s, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, c(this);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
var O = /* @__PURE__ */ new WeakMap();
|
|
125
|
+
class o {
|
|
126
|
+
/** Returns a copy of this date. */
|
|
127
|
+
copy() {
|
|
128
|
+
return this.era ? new o(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond) : new o(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
129
|
+
}
|
|
130
|
+
/** Returns a new `ZonedDateTime` with the given duration added to it. */
|
|
131
|
+
add(t) {
|
|
132
|
+
return T(this, t);
|
|
133
|
+
}
|
|
134
|
+
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
|
|
135
|
+
subtract(t) {
|
|
136
|
+
return Z(this, t);
|
|
137
|
+
}
|
|
138
|
+
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
139
|
+
set(t, e) {
|
|
140
|
+
return S(this, t, e);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
144
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
145
|
+
*/
|
|
146
|
+
cycle(t, e, i) {
|
|
147
|
+
return C(this, t, e, i);
|
|
148
|
+
}
|
|
149
|
+
/** Converts the date to a native JavaScript Date object. */
|
|
150
|
+
toDate() {
|
|
151
|
+
return j(this);
|
|
152
|
+
}
|
|
153
|
+
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
|
|
154
|
+
toString() {
|
|
155
|
+
return z(this);
|
|
156
|
+
}
|
|
157
|
+
/** Converts the date to an ISO 8601 formatted string in UTC. */
|
|
158
|
+
toAbsoluteString() {
|
|
159
|
+
return this.toDate().toISOString();
|
|
160
|
+
}
|
|
161
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
162
|
+
compare(t) {
|
|
163
|
+
return this.toDate().getTime() - E(t, this.timeZone).toDate().getTime();
|
|
164
|
+
}
|
|
165
|
+
constructor(...t) {
|
|
166
|
+
f(this, O, {
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: void 0
|
|
169
|
+
});
|
|
170
|
+
let [e, i, r, h, s] = $(t), x = t.shift(), D = t.shift();
|
|
171
|
+
this.calendar = e, this.era = i, this.year = r, this.month = h, this.day = s, this.timeZone = x, this.offset = D, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, c(this);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
d as CalendarDate,
|
|
176
|
+
n as CalendarDateTime,
|
|
177
|
+
o as ZonedDateTime
|
|
178
|
+
};
|