@serendie/ui 2.1.3-dev.202509030422 → 2.1.3-dev.202509170003
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 +60 -57
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.js +4 -2
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- 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/index.js +56 -53
- package/dist/node_modules/@internationalized/date/dist/conversion.js +9 -9
- package/dist/node_modules/@internationalized/date/dist/string.js +30 -16
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +333 -327
- package/dist/preset.d.ts +8 -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 +1 -1
- package/styled-system/types/prop-type.d.ts +1 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { AnimatedArc as h } from "./AnimatedArc.js";
|
|
3
|
+
import { cx as c } from "../../styled-system/css/cx.js";
|
|
4
|
+
import { cva as o } from "../../styled-system/css/cva.js";
|
|
5
|
+
const m = o({
|
|
6
|
+
base: {
|
|
7
|
+
position: "relative",
|
|
8
|
+
display: "flex",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
justifyContent: "center",
|
|
11
|
+
overflow: "hidden"
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
type: {
|
|
15
|
+
linear: {
|
|
16
|
+
width: "100%",
|
|
17
|
+
borderRadius: "sd.system.dimension.radius.full"
|
|
18
|
+
},
|
|
19
|
+
circular: {}
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
small: {},
|
|
23
|
+
medium: {},
|
|
24
|
+
large: {}
|
|
25
|
+
},
|
|
26
|
+
color: {
|
|
27
|
+
primary: {},
|
|
28
|
+
subtle: {}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
compoundVariants: [
|
|
32
|
+
{
|
|
33
|
+
type: "linear",
|
|
34
|
+
size: "small",
|
|
35
|
+
css: {
|
|
36
|
+
height: "2px"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: "linear",
|
|
41
|
+
size: "medium",
|
|
42
|
+
css: {
|
|
43
|
+
height: "4px"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "linear",
|
|
48
|
+
size: "large",
|
|
49
|
+
css: {
|
|
50
|
+
height: "8px"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "circular",
|
|
55
|
+
size: "small",
|
|
56
|
+
css: {
|
|
57
|
+
width: "12px",
|
|
58
|
+
height: "12px"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "circular",
|
|
63
|
+
size: "medium",
|
|
64
|
+
css: {
|
|
65
|
+
width: "16px",
|
|
66
|
+
height: "16px"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "circular",
|
|
71
|
+
size: "large",
|
|
72
|
+
css: {
|
|
73
|
+
width: "40px",
|
|
74
|
+
height: "40px"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
defaultVariants: {
|
|
79
|
+
type: "linear",
|
|
80
|
+
size: "medium",
|
|
81
|
+
color: "primary"
|
|
82
|
+
}
|
|
83
|
+
}), g = o({
|
|
84
|
+
base: {
|
|
85
|
+
position: "absolute",
|
|
86
|
+
backgroundColor: "sd.reference.color.scale.gray.100"
|
|
87
|
+
},
|
|
88
|
+
variants: {
|
|
89
|
+
type: {
|
|
90
|
+
linear: {
|
|
91
|
+
width: "calc(100% - 4px)",
|
|
92
|
+
height: "100%",
|
|
93
|
+
borderRadius: "sd.system.dimension.radius.full"
|
|
94
|
+
},
|
|
95
|
+
circular: {
|
|
96
|
+
width: "100%",
|
|
97
|
+
height: "100%",
|
|
98
|
+
borderRadius: "50%",
|
|
99
|
+
fill: "none"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
size: {
|
|
103
|
+
small: {},
|
|
104
|
+
medium: {},
|
|
105
|
+
large: {}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
compoundVariants: []
|
|
109
|
+
}), u = o({
|
|
110
|
+
base: {
|
|
111
|
+
position: "absolute"
|
|
112
|
+
},
|
|
113
|
+
variants: {
|
|
114
|
+
type: {
|
|
115
|
+
linear: {
|
|
116
|
+
width: "50%",
|
|
117
|
+
height: "100%",
|
|
118
|
+
animation: "progressIndicatorSlide 1.7s cubic-bezier(0.65, 0.05, 0.36, 1) infinite"
|
|
119
|
+
},
|
|
120
|
+
circular: {
|
|
121
|
+
fill: "none",
|
|
122
|
+
strokeLinecap: "butt",
|
|
123
|
+
transformOrigin: "center"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
size: {
|
|
127
|
+
small: {},
|
|
128
|
+
medium: {},
|
|
129
|
+
large: {}
|
|
130
|
+
},
|
|
131
|
+
color: {
|
|
132
|
+
primary: {
|
|
133
|
+
backgroundColor: "sd.system.color.impression.primary",
|
|
134
|
+
stroke: "sd.system.color.impression.primary"
|
|
135
|
+
},
|
|
136
|
+
subtle: {
|
|
137
|
+
backgroundColor: "sd.reference.color.scale.gray.300",
|
|
138
|
+
stroke: "sd.reference.color.scale.gray.300"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
compoundVariants: []
|
|
143
|
+
}), y = (e) => ({
|
|
144
|
+
small: {
|
|
145
|
+
radius: 6,
|
|
146
|
+
strokeWidth: 2
|
|
147
|
+
},
|
|
148
|
+
medium: {
|
|
149
|
+
radius: 8,
|
|
150
|
+
strokeWidth: 6
|
|
151
|
+
},
|
|
152
|
+
large: {
|
|
153
|
+
radius: 20,
|
|
154
|
+
strokeWidth: 8
|
|
155
|
+
}
|
|
156
|
+
})[e], f = ({
|
|
157
|
+
type: e = "linear",
|
|
158
|
+
size: r = "medium",
|
|
159
|
+
color: s = "primary",
|
|
160
|
+
className: l,
|
|
161
|
+
style: n,
|
|
162
|
+
...d
|
|
163
|
+
}) => {
|
|
164
|
+
if (e === "circular") {
|
|
165
|
+
const { radius: a, strokeWidth: t } = y(r);
|
|
166
|
+
return /* @__PURE__ */ i(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: c(
|
|
170
|
+
m({ type: e, size: r, color: s }),
|
|
171
|
+
l
|
|
172
|
+
),
|
|
173
|
+
role: "progressbar",
|
|
174
|
+
"aria-valuetext": "Loading",
|
|
175
|
+
style: n,
|
|
176
|
+
...d,
|
|
177
|
+
children: /* @__PURE__ */ i(
|
|
178
|
+
"svg",
|
|
179
|
+
{
|
|
180
|
+
viewBox: `0 0 ${a * 2 + t * 2} ${a * 2 + t * 2}`,
|
|
181
|
+
children: /* @__PURE__ */ i(
|
|
182
|
+
h,
|
|
183
|
+
{
|
|
184
|
+
className: u({ type: e, size: r, color: s }),
|
|
185
|
+
radius: a,
|
|
186
|
+
width: t
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
return /* @__PURE__ */ p(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
className: c(
|
|
198
|
+
m({ type: e, size: r, color: s }),
|
|
199
|
+
l
|
|
200
|
+
),
|
|
201
|
+
role: "progressbar",
|
|
202
|
+
"aria-valuetext": "Loading",
|
|
203
|
+
style: n,
|
|
204
|
+
...d,
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ i("div", { className: g({ type: e, size: r }) }),
|
|
207
|
+
/* @__PURE__ */ i("div", { className: u({ type: e, size: r, color: s }) })
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
};
|
|
212
|
+
f.displayName = "ProgressIndicatorIndeterminate";
|
|
213
|
+
export {
|
|
214
|
+
f as ProgressIndicatorIndeterminate
|
|
215
|
+
};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { ProgressIndicator } from './ProgressIndicator';
|
|
2
|
+
export type { ProgressIndicatorProps } from './ProgressIndicator';
|
|
3
|
+
export { ProgressIndicatorIndeterminate } from './ProgressIndicatorIndeterminate';
|
|
4
|
+
export type { ProgressIndicatorIndeterminateProps } from './ProgressIndicatorIndeterminate';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ProgressIndicator as e
|
|
1
|
+
import { ProgressIndicator as e } from "./ProgressIndicator.js";
|
|
2
|
+
import { ProgressIndicatorIndeterminate as n } from "./ProgressIndicatorIndeterminate.js";
|
|
2
3
|
export {
|
|
3
4
|
e as ProgressIndicator,
|
|
4
|
-
|
|
5
|
+
n as ProgressIndicatorIndeterminate
|
|
5
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const describeArc: (cx: number, cy: number, radius: number, startAngle: number, endAngle: number) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const A = (n, e, t, o, s) => {
|
|
2
|
+
const a = (l, p, $, g) => {
|
|
3
|
+
const M = (g - 90) * Math.PI / 180;
|
|
4
|
+
return {
|
|
5
|
+
x: l + $ * Math.cos(M),
|
|
6
|
+
y: p + $ * Math.sin(M)
|
|
7
|
+
};
|
|
8
|
+
}, c = a(n, e, t, s), r = a(n, e, t, o), h = Math.abs((s - o) % 360) <= 180 ? "0" : "1";
|
|
9
|
+
return `M ${c.x} ${c.y} A ${t} ${t} 0 ${h} 0 ${r.x} ${r.y}`;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
A as describeArc
|
|
13
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { SerendiePreset as e } from "./preset.js";
|
|
2
2
|
import { Accordion as a } from "./components/Accordion/Accordion.js";
|
|
3
3
|
import { AccordionGroup as m } from "./components/Accordion/AccordionGroup.js";
|
|
4
|
-
import { Avatar as
|
|
5
|
-
import { Badge as
|
|
4
|
+
import { Avatar as i, AvatarStyle as n } from "./components/Avatar/Avatar.js";
|
|
5
|
+
import { Badge as s, BadgeCloseButton as c, BadgeStyle as d } from "./components/Badge/Badge.js";
|
|
6
6
|
import { Banner as h } from "./components/Banner/Banner.js";
|
|
7
7
|
import { BottomNavigation as S } from "./components/BottomNavigation/BottomNavigation.js";
|
|
8
8
|
import { BottomNavigationItem as g, BottomNavigationItemStyle as y } from "./components/BottomNavigation/BottomNavigationItem.js";
|
|
9
9
|
import { Button as I, ButtonStyle as T } from "./components/Button/Button.js";
|
|
10
|
-
import { SerendieChartTheme as
|
|
11
|
-
import { compactChartMargin as
|
|
10
|
+
import { SerendieChartTheme as D } from "./components/Chart/SerendieChartTheme.js";
|
|
11
|
+
import { compactChartMargin as k, defaultChartMargin as v, getChartColor as M, getChartColors as w, legendChartMargin as A, spaciousChartMargin as L, useBarChartProps as N, useChartProps as R, useLineChartProps as F, usePieChartProps as G } from "./components/Chart/SerendieChartProps.js";
|
|
12
12
|
import { CheckBox as W, CheckBoxStyle as j, checkboxCheckedIconCss as q, checkboxIconCss as z, checkboxUncheckedIconCss as E } from "./components/CheckBox/CheckBox.js";
|
|
13
13
|
import { ChoiceBox as J, ChoiceBoxStyle as K } from "./components/ChoiceBox/ChoiceBox.js";
|
|
14
14
|
import { DashboardWidget as Q } from "./components/DashboardWidget/DashboardWidget.js";
|
|
@@ -17,35 +17,37 @@ import { DatePicker as Z } from "./components/DatePicker/DatePicker.js";
|
|
|
17
17
|
import { Divider as $, DividerStyle as oo } from "./components/Divider/Divider.js";
|
|
18
18
|
import { Drawer as eo } from "./components/Drawer/Drawer.js";
|
|
19
19
|
import { DropdownMenu as ao, DropdownMenuStyle as po } from "./components/DropdownMenu/DropdownMenu.js";
|
|
20
|
-
import { IconButton as
|
|
20
|
+
import { IconButton as xo, IconButtonStyle as io } from "./components/IconButton/IconButton.js";
|
|
21
21
|
import { List as fo } from "./components/List/List.js";
|
|
22
|
-
import { ListItem as
|
|
22
|
+
import { ListItem as co, ListItemStyle as lo } from "./components/List/ListItem.js";
|
|
23
23
|
import { ModalDialog as Co } from "./components/ModalDialog/ModalDialog.js";
|
|
24
24
|
import { NotificationBadge as Bo } from "./components/NotificationBadge/NotificationBadge.js";
|
|
25
25
|
import { Pagination as yo, PaginationStyle as uo } from "./components/Pagination/Pagination.js";
|
|
26
26
|
import { PasswordField as To } from "./components/PasswordField/PasswordField.js";
|
|
27
|
-
import { ProgressIndicator as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
27
|
+
import { ProgressIndicator as Do } from "./components/ProgressIndicator/ProgressIndicator.js";
|
|
28
|
+
import { ProgressIndicatorIndeterminate as ko } from "./components/ProgressIndicator/ProgressIndicatorIndeterminate.js";
|
|
29
|
+
import { RadioButton as Mo, RadioButtonStyle as wo, radioCheckedIconCss as Ao, radioIconCss as Lo, radioUncheckedIconCss as No } from "./components/RadioButton/RadioButton.js";
|
|
30
|
+
import { RadioGroup as Fo } from "./components/RadioButton/RadioGroup.js";
|
|
31
|
+
import { Search as Uo, SearchStyle as Wo } from "./components/Search/Search.js";
|
|
32
|
+
import { Select as qo, SelectStyle as zo } from "./components/Select/Select.js";
|
|
33
|
+
import { Switch as Ho, SwitchStyle as Jo } from "./components/Switch/Switch.js";
|
|
34
|
+
import { Tabs as Oo, TabsStyle as Qo } from "./components/Tabs/Tabs.js";
|
|
35
|
+
import { TabItem as Xo, TabItemStyle as Yo } from "./components/Tabs/TabItem.js";
|
|
36
|
+
import { TextArea as _o } from "./components/TextArea/TextArea.js";
|
|
37
|
+
import { TextField as or } from "./components/TextField/TextField.js";
|
|
38
|
+
import { Toast as er, ToastStyle as tr, toaster as ar } from "./components/Toast/Toast.js";
|
|
39
|
+
import { Tooltip as mr } from "./components/Tooltip/Tooltip.js";
|
|
39
40
|
import { TopAppBar as ir } from "./components/TopAppBar/TopAppBar.js";
|
|
40
|
-
import { DataTableComponent as
|
|
41
|
+
import { DataTableComponent as fr } from "./components/DataTable/DataTableComponent.js";
|
|
42
|
+
import { parse as cr } from "./node_modules/@zag-js/date-picker/dist/index.js";
|
|
41
43
|
export {
|
|
42
44
|
a as Accordion,
|
|
43
45
|
m as AccordionGroup,
|
|
44
|
-
|
|
46
|
+
i as Avatar,
|
|
45
47
|
n as AvatarStyle,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
s as Badge,
|
|
49
|
+
c as BadgeCloseButton,
|
|
50
|
+
d as BadgeStyle,
|
|
49
51
|
h as Banner,
|
|
50
52
|
S as BottomNavigation,
|
|
51
53
|
g as BottomNavigationItem,
|
|
@@ -58,59 +60,60 @@ export {
|
|
|
58
60
|
K as ChoiceBoxStyle,
|
|
59
61
|
Q as DashboardWidget,
|
|
60
62
|
X as DataTable,
|
|
61
|
-
|
|
63
|
+
fr as DataTableComponent,
|
|
62
64
|
Z as DatePicker,
|
|
63
65
|
$ as Divider,
|
|
64
66
|
oo as DividerStyle,
|
|
65
67
|
eo as Drawer,
|
|
66
68
|
ao as DropdownMenu,
|
|
67
69
|
po as DropdownMenuStyle,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
xo as IconButton,
|
|
71
|
+
io as IconButtonStyle,
|
|
70
72
|
fo as List,
|
|
71
|
-
|
|
73
|
+
co as ListItem,
|
|
72
74
|
lo as ListItemStyle,
|
|
73
75
|
Co as ModalDialog,
|
|
74
76
|
Bo as NotificationBadge,
|
|
75
77
|
yo as Pagination,
|
|
76
78
|
uo as PaginationStyle,
|
|
77
79
|
To as PasswordField,
|
|
78
|
-
|
|
79
|
-
ko as
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
Do as ProgressIndicator,
|
|
81
|
+
ko as ProgressIndicatorIndeterminate,
|
|
82
|
+
Mo as RadioButton,
|
|
83
|
+
wo as RadioButtonStyle,
|
|
84
|
+
Fo as RadioGroup,
|
|
85
|
+
Uo as Search,
|
|
86
|
+
Wo as SearchStyle,
|
|
87
|
+
qo as Select,
|
|
88
|
+
zo as SelectStyle,
|
|
89
|
+
D as SerendieChartTheme,
|
|
88
90
|
e as SerendiePreset,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
Ho as Switch,
|
|
92
|
+
Jo as SwitchStyle,
|
|
93
|
+
Xo as TabItem,
|
|
94
|
+
Yo as TabItemStyle,
|
|
95
|
+
Oo as Tabs,
|
|
96
|
+
Qo as TabsStyle,
|
|
97
|
+
_o as TextArea,
|
|
98
|
+
or as TextField,
|
|
99
|
+
er as Toast,
|
|
100
|
+
tr as ToastStyle,
|
|
101
|
+
mr as Tooltip,
|
|
100
102
|
ir as TopAppBar,
|
|
101
103
|
q as checkboxCheckedIconCss,
|
|
102
104
|
z as checkboxIconCss,
|
|
103
105
|
E as checkboxUncheckedIconCss,
|
|
104
|
-
|
|
106
|
+
k as compactChartMargin,
|
|
105
107
|
v as defaultChartMargin,
|
|
106
108
|
M as getChartColor,
|
|
107
109
|
w as getChartColors,
|
|
108
110
|
A as legendChartMargin,
|
|
109
|
-
|
|
110
|
-
Ao as
|
|
111
|
-
Lo as
|
|
111
|
+
cr as parseDate,
|
|
112
|
+
Ao as radioCheckedIconCss,
|
|
113
|
+
Lo as radioIconCss,
|
|
114
|
+
No as radioUncheckedIconCss,
|
|
112
115
|
L as spaciousChartMargin,
|
|
113
|
-
|
|
116
|
+
ar as toaster,
|
|
114
117
|
N as useBarChartProps,
|
|
115
118
|
R as useChartProps,
|
|
116
119
|
F as useLineChartProps,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CalendarDateTime as C, CalendarDate as U, ZonedDateTime as b } from "./CalendarDate.js";
|
|
2
2
|
import { constrain as M } from "./manipulation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { getExtendedYear as h, GregorianCalendar as p } from "./GregorianCalendar.js";
|
|
4
|
+
import { getLocalTimeZone as y, isEqualCalendar as v } from "./queries.js";
|
|
5
5
|
function u(e) {
|
|
6
|
-
e = $(e, new
|
|
7
|
-
let t =
|
|
6
|
+
e = $(e, new p());
|
|
7
|
+
let t = h(e.era, e.year);
|
|
8
8
|
return T(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
|
|
9
9
|
}
|
|
10
10
|
function T(e, t, n, r, o, a, c) {
|
|
@@ -60,8 +60,8 @@ function D(e, t, n = "compatible") {
|
|
|
60
60
|
let r = B(e);
|
|
61
61
|
if (t === "UTC") return u(r);
|
|
62
62
|
if (t === y() && n === "compatible") {
|
|
63
|
-
r = $(r, new
|
|
64
|
-
let l = /* @__PURE__ */ new Date(), s =
|
|
63
|
+
r = $(r, new p());
|
|
64
|
+
let l = /* @__PURE__ */ new Date(), s = h(r.era, r.year);
|
|
65
65
|
return l.setFullYear(s, r.month - 1, r.day), l.setHours(r.hour, r.minute, r.second, r.millisecond), l.getTime();
|
|
66
66
|
}
|
|
67
67
|
let o = u(r), a = i(o - d, t), c = i(o + d, t), f = F(r, t, o - a, o - c);
|
|
@@ -93,13 +93,13 @@ function g(e, t) {
|
|
|
93
93
|
return new b(o < 1 ? "BC" : "AD", o < 1 ? -o + 1 : o, a, c, t, n, f, l, s, w);
|
|
94
94
|
}
|
|
95
95
|
function S(e) {
|
|
96
|
-
return new
|
|
96
|
+
return new U(e.calendar, e.era, e.year, e.month, e.day);
|
|
97
97
|
}
|
|
98
98
|
function B(e, t) {
|
|
99
99
|
let n = 0, r = 0, o = 0, a = 0;
|
|
100
100
|
if ("timeZone" in e) ({ hour: n, minute: r, second: o, millisecond: a } = e);
|
|
101
101
|
else if ("hour" in e && !t) return e;
|
|
102
|
-
return t && ({ hour: n, minute: r, second: o, millisecond: a } = t), new
|
|
102
|
+
return t && ({ hour: n, minute: r, second: o, millisecond: a } = t), new C(e.calendar, e.era, e.year, e.month, e.day, n, r, o, a);
|
|
103
103
|
}
|
|
104
104
|
function $(e, t) {
|
|
105
105
|
if (v(e.calendar, t)) return e;
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CalendarDate as $ } from "./CalendarDate.js";
|
|
2
|
+
import { toCalendar as o } from "./conversion.js";
|
|
3
|
+
import { GregorianCalendar as c } from "./GregorianCalendar.js";
|
|
4
|
+
const f = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
|
|
5
|
+
function u(a) {
|
|
6
|
+
let r = a.match(f);
|
|
7
|
+
if (!r) throw new Error("Invalid ISO 8601 date string: " + a);
|
|
8
|
+
let t = new $(n(r[1], 0, 9999), n(r[2], 1, 12), 1);
|
|
9
|
+
return t.day = n(r[3], 1, t.calendar.getDaysInMonth(t)), t;
|
|
10
|
+
}
|
|
11
|
+
function n(a, r, t) {
|
|
12
|
+
let e = Number(a);
|
|
13
|
+
if (e < r || e > t) throw new RangeError(`Value out of range: ${r} <= ${e} <= ${t}`);
|
|
14
|
+
return e;
|
|
15
|
+
}
|
|
3
16
|
function i(a) {
|
|
4
17
|
return `${String(a.hour).padStart(2, "0")}:${String(a.minute).padStart(2, "0")}:${String(a.second).padStart(2, "0")}${a.millisecond ? String(a.millisecond / 1e3).slice(1) : ""}`;
|
|
5
18
|
}
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
return
|
|
19
|
+
function d(a) {
|
|
20
|
+
let r = o(a, new c()), t;
|
|
21
|
+
return r.era === "BC" ? t = r.year === 1 ? "0000" : "-" + String(Math.abs(1 - r.year)).padStart(6, "00") : t = String(r.year).padStart(4, "0"), `${t}-${String(r.month).padStart(2, "0")}-${String(r.day).padStart(2, "0")}`;
|
|
9
22
|
}
|
|
10
|
-
function
|
|
11
|
-
return `${
|
|
23
|
+
function S(a) {
|
|
24
|
+
return `${d(a)}T${i(a)}`;
|
|
12
25
|
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
26
|
+
function g(a) {
|
|
27
|
+
let r = Math.sign(a) < 0 ? "-" : "+";
|
|
15
28
|
a = Math.abs(a);
|
|
16
|
-
let
|
|
17
|
-
return `${
|
|
29
|
+
let t = Math.floor(a / 36e5), e = a % 36e5 / 6e4;
|
|
30
|
+
return `${r}${String(t).padStart(2, "0")}:${String(e).padStart(2, "0")}`;
|
|
18
31
|
}
|
|
19
|
-
function
|
|
20
|
-
return `${
|
|
32
|
+
function b(a) {
|
|
33
|
+
return `${S(a)}${g(a.offset)}[${a.timeZone}]`;
|
|
21
34
|
}
|
|
22
35
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
36
|
+
S as dateTimeToString,
|
|
37
|
+
d as dateToString,
|
|
38
|
+
u as parseDate,
|
|
25
39
|
i as timeToString,
|
|
26
|
-
|
|
40
|
+
b as zonedDateTimeToString
|
|
27
41
|
};
|