@bridge-ui/vue 0.14.0 → 0.15.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/ai/AGENTS.md +1 -1
- package/ai/README.md +1 -1
- package/ai/llms.txt +4 -3
- package/ai/skills/bridge-ui-setup/SKILL.md +9 -8
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
- package/dist/Adapters/Icon/mockIconAdapter.d.ts +5 -0
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +1 -1
- package/dist/Components/ActionFooter/ActionFooter.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/Components/ActionFooter/actionFooter.types.d.ts +7 -12
- package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +4 -4
- package/dist/Components/ActionFooter/composables/useActionFooter.js +3 -4
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +2 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -3
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -0
- package/dist/Components/BaseField/composables/useBaseField.js +1 -0
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -0
- package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/ColorField/composables/useColorField.d.ts +2 -2
- package/dist/Components/ColorField/composables/useColorField.js +2 -0
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +8 -2
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +2 -2
- package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -0
- package/dist/Components/DateField/DateField.vue.d.ts +2 -2
- package/dist/Components/DateField/composables/useDateField.d.ts +2 -2
- package/dist/Components/DateField/composables/useDateField.js +2 -0
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
- package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +2 -2
- package/dist/Components/DateRangeField/composables/useDateRangeField.js +2 -0
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +2 -2
- package/dist/Components/DateTimeField/composables/useDateTimeField.js +2 -0
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.js +2 -0
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +2 -2
- package/dist/Components/FormControl/composables/useFormControl.js +46 -45
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.js +144 -143
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +0 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/Components/Modal/Modal.vue.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.js +1 -0
- package/dist/Components/OtpField/composables/useOtpField.js +1 -0
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/PasswordField/composables/usePasswordField.js +1 -0
- package/dist/Components/Radio/composables/useRadio.js +1 -0
- package/dist/Components/Rating/composables/useRating.js +1 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +36 -32
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +2 -1
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +143 -141
- package/dist/Components/Select/Select.vue.d.ts +2 -2
- package/dist/Components/Select/composables/useSelect.d.ts +3 -3
- package/dist/Components/Select/composables/useSelect.js +2 -0
- package/dist/Components/Slider/composables/useSlider.js +1 -0
- package/dist/Components/Switch/composables/useSwitch.js +1 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +0 -156
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.js +1 -0
- package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.js +2 -0
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/TimePicker/composables/useTimePicker.js +1 -0
- package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +2 -0
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +1 -0
- package/dist/Components/Tooltip/Tooltip.vue.d.ts +0 -1
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Utils/index.d.ts +16 -6
- package/dist/Utils/index.js +39 -35
- package/dist/augments.d.ts +1 -1
- package/dist/theme.css +10 -1
- package/docs/README.md +27 -13
- package/docs/components/ActionFooter.md +16 -14
- package/docs/components/BridgeUIProvider.md +108 -16
- package/docs/components/ColorPicker.md +14 -13
- package/docs/components/I18n.md +6 -6
- package/docs/components/Icon.md +10 -10
- package/docs/components/RichTextEditor.md +4 -4
- package/package.json +3 -92
- package/dist/Adapters/Examples/date-date-fns.d.ts +0 -9
- package/dist/Adapters/Examples/date-date-fns.js +0 -151
- package/dist/Adapters/Examples/date-dayjs.d.ts +0 -19
- package/dist/Adapters/Examples/date-dayjs.js +0 -174
- package/dist/Adapters/Examples/date-luxon.d.ts +0 -7
- package/dist/Adapters/Examples/date-luxon.js +0 -164
- package/dist/Adapters/Examples/date-moment.d.ts +0 -19
- package/dist/Adapters/Examples/date-moment.js +0 -172
- package/dist/Adapters/Examples/i18n-dictionary.d.ts +0 -15
- package/dist/Adapters/Examples/i18n-dictionary.js +0 -97
- package/dist/Adapters/Examples/i18n-vue-i18n.d.ts +0 -7
- package/dist/Adapters/Examples/i18n-vue-i18n.js +0 -14
- package/dist/Adapters/Examples/icon-fontawesome.d.ts +0 -19
- package/dist/Adapters/Examples/icon-fontawesome.js +0 -82
- package/dist/Adapters/Examples/icon-heroicons.d.ts +0 -5
- package/dist/Adapters/Examples/icon-heroicons.js +0 -56
- package/dist/Adapters/Examples/icon-lucide.d.ts +0 -5
- package/dist/Adapters/Examples/icon-lucide.js +0 -56
- package/dist/Adapters/Examples/icon-phosphor.d.ts +0 -5
- package/dist/Adapters/Examples/icon-phosphor.js +0 -56
- package/dist/Adapters/Examples/icon-tabler.d.ts +0 -5
- package/dist/Adapters/Examples/icon-tabler.js +0 -56
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +0 -5
- package/dist/Adapters/Examples/rich-text-tiptap.js +0 -131
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { clamp as e, isNil as t, isString as n, range as r } from "es-toolkit/compat";
|
|
2
|
-
import { addDays as i, addMonths as a, addYears as o, endOfMonth as s, format as c, getDate as l, getDay as u, getHours as d, getMinutes as f, getMonth as p, getSeconds as m, getYear as h, isAfter as g, isBefore as _, isSameDay as v, isSameMonth as y, isSameYear as b, isValid as x, parse as S, parseISO as C, setDate as w, setHours as T, setMinutes as E, setMonth as D, setSeconds as O, setYear as k, startOfDay as A, startOfMonth as j } from "date-fns";
|
|
3
|
-
//#region src/Adapters/Examples/date-date-fns.ts
|
|
4
|
-
function M() {
|
|
5
|
-
let S, M = () => S, P = (e) => e instanceof Date && x(e), F = {
|
|
6
|
-
now() {
|
|
7
|
-
return /* @__PURE__ */ new Date();
|
|
8
|
-
},
|
|
9
|
-
setLocale(e) {
|
|
10
|
-
S = e;
|
|
11
|
-
},
|
|
12
|
-
getDay(e) {
|
|
13
|
-
return u(e);
|
|
14
|
-
},
|
|
15
|
-
getDate(e) {
|
|
16
|
-
return l(e);
|
|
17
|
-
},
|
|
18
|
-
getYear(e) {
|
|
19
|
-
return h(e);
|
|
20
|
-
},
|
|
21
|
-
getMonth(e) {
|
|
22
|
-
return p(e);
|
|
23
|
-
},
|
|
24
|
-
getHours(e) {
|
|
25
|
-
return d(e);
|
|
26
|
-
},
|
|
27
|
-
isSameDay(e, t) {
|
|
28
|
-
return v(e, t);
|
|
29
|
-
},
|
|
30
|
-
getMinutes(e) {
|
|
31
|
-
return f(e);
|
|
32
|
-
},
|
|
33
|
-
getSeconds(e) {
|
|
34
|
-
return m(e);
|
|
35
|
-
},
|
|
36
|
-
isSameYear(e, t) {
|
|
37
|
-
return b(e, t);
|
|
38
|
-
},
|
|
39
|
-
startOfDay(e) {
|
|
40
|
-
return A(e);
|
|
41
|
-
},
|
|
42
|
-
endOfMonth(e) {
|
|
43
|
-
return s(e);
|
|
44
|
-
},
|
|
45
|
-
isSameMonth(e, t) {
|
|
46
|
-
return y(e, t);
|
|
47
|
-
},
|
|
48
|
-
startOfMonth(e) {
|
|
49
|
-
return j(e);
|
|
50
|
-
},
|
|
51
|
-
setDate(e, t) {
|
|
52
|
-
return w(e, t);
|
|
53
|
-
},
|
|
54
|
-
setYear(e, t) {
|
|
55
|
-
return k(e, t);
|
|
56
|
-
},
|
|
57
|
-
setMonth(e, t) {
|
|
58
|
-
return D(e, t);
|
|
59
|
-
},
|
|
60
|
-
addDays(e, t) {
|
|
61
|
-
return i(e, t);
|
|
62
|
-
},
|
|
63
|
-
addYears(e, t) {
|
|
64
|
-
return o(e, t);
|
|
65
|
-
},
|
|
66
|
-
addMonths(e, t) {
|
|
67
|
-
return a(e, t);
|
|
68
|
-
},
|
|
69
|
-
isAfter(e, t) {
|
|
70
|
-
return g(A(e), A(t));
|
|
71
|
-
},
|
|
72
|
-
isBefore(e, t) {
|
|
73
|
-
return _(A(e), A(t));
|
|
74
|
-
},
|
|
75
|
-
setHours(t, n) {
|
|
76
|
-
return T(t, e(n, 0, 23));
|
|
77
|
-
},
|
|
78
|
-
setMinutes(t, n) {
|
|
79
|
-
return E(t, e(n, 0, 59));
|
|
80
|
-
},
|
|
81
|
-
setSeconds(t, n) {
|
|
82
|
-
return O(t, e(n, 0, 59));
|
|
83
|
-
},
|
|
84
|
-
parseTime(e, t, n) {
|
|
85
|
-
return N({
|
|
86
|
-
value: e,
|
|
87
|
-
adapter: F,
|
|
88
|
-
timeZone: t,
|
|
89
|
-
timeOptions: n
|
|
90
|
-
});
|
|
91
|
-
},
|
|
92
|
-
isSameTime(e, t) {
|
|
93
|
-
return d(e) === d(t) && f(e) === f(t) && m(e) === m(t);
|
|
94
|
-
},
|
|
95
|
-
getMonthNames() {
|
|
96
|
-
let e = M();
|
|
97
|
-
return r(12).map((t) => new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2021, t, 1)));
|
|
98
|
-
},
|
|
99
|
-
getWeekdayNames() {
|
|
100
|
-
let e = M(), t = new Intl.DateTimeFormat(e, { weekday: "short" }), n = new Date(2021, 0, 3);
|
|
101
|
-
return r(7).map((e) => {
|
|
102
|
-
let r = new Date(n);
|
|
103
|
-
return r.setDate(n.getDate() + e), t.format(r);
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
parse(e) {
|
|
107
|
-
if (!n(e) || e.trim() === "") return null;
|
|
108
|
-
let t = e.trim(), r = C(t);
|
|
109
|
-
if (x(r) && /^\d{4}-\d{2}-\d{2}/.test(t)) return A(r);
|
|
110
|
-
let i = new Date(t);
|
|
111
|
-
return P(i) ? A(i) : null;
|
|
112
|
-
},
|
|
113
|
-
formatTime(e, t, n) {
|
|
114
|
-
if (!P(e)) return "";
|
|
115
|
-
let r = M(), i = n?.ampm === !0, a = n?.showSeconds === !0;
|
|
116
|
-
return new Intl.DateTimeFormat(r, {
|
|
117
|
-
hour12: i,
|
|
118
|
-
hour: "2-digit",
|
|
119
|
-
minute: "2-digit",
|
|
120
|
-
...a ? { second: "2-digit" } : {}
|
|
121
|
-
}).format(e);
|
|
122
|
-
},
|
|
123
|
-
getCalendarDays(e, t, n) {
|
|
124
|
-
let i = F.startOfMonth(e, n), a = (F.getDay(i, n) - (t % 7 + 7) % 7 + 7) % 7, o = F.addDays(i, -a, n);
|
|
125
|
-
return r(42).map((e) => F.addDays(o, e, n));
|
|
126
|
-
},
|
|
127
|
-
format(e, n, r) {
|
|
128
|
-
if (!P(e)) return "";
|
|
129
|
-
let i = M(), a = r?.granularity ?? "day";
|
|
130
|
-
return a === "year" ? new Intl.DateTimeFormat(i, { year: "numeric" }).format(e) : a === "month" ? new Intl.DateTimeFormat(i, {
|
|
131
|
-
month: "long",
|
|
132
|
-
year: "numeric"
|
|
133
|
-
}).format(e) : t(i) ? c(e, "P") : new Intl.DateTimeFormat(i, {
|
|
134
|
-
day: "2-digit",
|
|
135
|
-
year: "numeric",
|
|
136
|
-
month: "2-digit"
|
|
137
|
-
}).format(e);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
return F;
|
|
141
|
-
}
|
|
142
|
-
function N(e) {
|
|
143
|
-
let { value: t, adapter: r, timeZone: i, timeOptions: a } = e;
|
|
144
|
-
if (!n(t) || t.trim() === "") return null;
|
|
145
|
-
let o = t.trim(), s = a?.ampm === !0, c = a?.showSeconds === !0, l = S(o, s ? c ? "h:mm:ss a" : "h:mm a" : c ? "H:mm:ss" : "H:mm", r.now(i));
|
|
146
|
-
if (!x(l)) return null;
|
|
147
|
-
let u = r.now(i);
|
|
148
|
-
return O(E(T(u, d(l)), f(l)), c ? m(l) : 0);
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
export { M as createDateFnsDateAdapter };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DateAdapter } from '@bridge-ui/core/Adapters';
|
|
2
|
-
/**
|
|
3
|
-
* Maps Bridge locales (`en-US`, `pt-BR`) to Day.js locale ids (`en`, `pt-br`).
|
|
4
|
-
* Import matching `dayjs/locale/*` files in the app.
|
|
5
|
-
*/
|
|
6
|
-
export type DayjsDateAdapterLocales = Record<string, string>;
|
|
7
|
-
/**
|
|
8
|
-
* Builds a Day.js-backed {@link DateAdapter} (`TDate = Date`) for Bridge calendars.
|
|
9
|
-
* Locale and default IANA zone start unset until {@link DateAdapter.setLocale} /
|
|
10
|
-
* {@link DateAdapter.setTimeZone}.
|
|
11
|
-
*
|
|
12
|
-
* `setLocale` still receives Bridge tags. Unmapped `en-US` becomes `en`; other
|
|
13
|
-
* tags are lowercased (`pt-BR` → `pt-br`) unless {@link DayjsDateAdapterLocales}
|
|
14
|
-
* has an entry.
|
|
15
|
-
*
|
|
16
|
-
* Extend `utc` and `timezone` in the app for IANA zones. Without `dayjs.tz`,
|
|
17
|
-
* `timeZone` arguments are ignored.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createDayjsDateAdapter(locales?: DayjsDateAdapterLocales): DateAdapter<Date>;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { clamp as e, isNil as t, isString as n, range as r } from "es-toolkit/compat";
|
|
2
|
-
import i from "dayjs";
|
|
3
|
-
import a from "dayjs/plugin/customParseFormat";
|
|
4
|
-
//#region src/Adapters/Examples/date-dayjs.ts
|
|
5
|
-
i.extend(a);
|
|
6
|
-
var o = i;
|
|
7
|
-
function s(e, n) {
|
|
8
|
-
return t(n) ? e : e.tz?.(n) ?? e;
|
|
9
|
-
}
|
|
10
|
-
function c(e, n) {
|
|
11
|
-
return t(n) ? i(e) : o.tz?.(e, n) ?? i(e);
|
|
12
|
-
}
|
|
13
|
-
function l(a = {}) {
|
|
14
|
-
let o, l, d = () => o, f = () => {
|
|
15
|
-
if (!t(o)) return a[o] ?? (o === "en-US" ? "en" : o.toLowerCase());
|
|
16
|
-
}, p = (e) => e ?? l, m = (e, n) => {
|
|
17
|
-
let r = f(), a = p(n), o = s(i(e), a);
|
|
18
|
-
return t(r) || (o = o.locale(r)), o;
|
|
19
|
-
}, h = (e) => e.toDate(), g = (e) => e instanceof Date && !Number.isNaN(e.getTime()), _ = {
|
|
20
|
-
setLocale(e) {
|
|
21
|
-
o = e;
|
|
22
|
-
},
|
|
23
|
-
setTimeZone(e) {
|
|
24
|
-
l = e;
|
|
25
|
-
},
|
|
26
|
-
getDay(e, t) {
|
|
27
|
-
return m(e, t).day();
|
|
28
|
-
},
|
|
29
|
-
getDate(e, t) {
|
|
30
|
-
return m(e, t).date();
|
|
31
|
-
},
|
|
32
|
-
getYear(e, t) {
|
|
33
|
-
return m(e, t).year();
|
|
34
|
-
},
|
|
35
|
-
getHours(e, t) {
|
|
36
|
-
return m(e, t).hour();
|
|
37
|
-
},
|
|
38
|
-
getMonth(e, t) {
|
|
39
|
-
return m(e, t).month();
|
|
40
|
-
},
|
|
41
|
-
isAfter(e, t, n) {
|
|
42
|
-
return _.isBefore(t, e, n);
|
|
43
|
-
},
|
|
44
|
-
getMinutes(e, t) {
|
|
45
|
-
return m(e, t).minute();
|
|
46
|
-
},
|
|
47
|
-
getSeconds(e, t) {
|
|
48
|
-
return m(e, t).second();
|
|
49
|
-
},
|
|
50
|
-
setDate(e, t, n) {
|
|
51
|
-
return h(m(e, n).date(t));
|
|
52
|
-
},
|
|
53
|
-
setYear(e, t, n) {
|
|
54
|
-
return h(m(e, n).year(t));
|
|
55
|
-
},
|
|
56
|
-
startOfDay(e, t) {
|
|
57
|
-
return h(m(e, t).startOf("day"));
|
|
58
|
-
},
|
|
59
|
-
endOfMonth(e, t) {
|
|
60
|
-
return h(m(e, t).endOf("month"));
|
|
61
|
-
},
|
|
62
|
-
setMonth(e, t, n) {
|
|
63
|
-
return h(m(e, n).month(t));
|
|
64
|
-
},
|
|
65
|
-
startOfMonth(e, t) {
|
|
66
|
-
return h(m(e, t).startOf("month"));
|
|
67
|
-
},
|
|
68
|
-
isSameDay(e, t, n) {
|
|
69
|
-
return m(e, n).isSame(m(t, n), "day");
|
|
70
|
-
},
|
|
71
|
-
isSameYear(e, t, n) {
|
|
72
|
-
return m(e, n).isSame(m(t, n), "year");
|
|
73
|
-
},
|
|
74
|
-
addDays(e, t, n) {
|
|
75
|
-
return h(m(e, n).add(t, "day"));
|
|
76
|
-
},
|
|
77
|
-
isSameMonth(e, t, n) {
|
|
78
|
-
return m(e, n).isSame(m(t, n), "month");
|
|
79
|
-
},
|
|
80
|
-
addYears(e, t, n) {
|
|
81
|
-
return h(m(e, n).add(t, "year"));
|
|
82
|
-
},
|
|
83
|
-
addMonths(e, t, n) {
|
|
84
|
-
return h(m(e, n).add(t, "month"));
|
|
85
|
-
},
|
|
86
|
-
setHours(t, n, r) {
|
|
87
|
-
return h(m(t, r).hour(e(n, 0, 23)));
|
|
88
|
-
},
|
|
89
|
-
setMinutes(t, n, r) {
|
|
90
|
-
return h(m(t, r).minute(e(n, 0, 59)));
|
|
91
|
-
},
|
|
92
|
-
setSeconds(t, n, r) {
|
|
93
|
-
return h(m(t, r).second(e(n, 0, 59)));
|
|
94
|
-
},
|
|
95
|
-
isBefore(e, t, n) {
|
|
96
|
-
return m(e, n).startOf("day").isBefore(m(t, n).startOf("day"));
|
|
97
|
-
},
|
|
98
|
-
parseTime(e, t, n) {
|
|
99
|
-
return u({
|
|
100
|
-
value: e,
|
|
101
|
-
adapter: _,
|
|
102
|
-
toDayjs: m,
|
|
103
|
-
timeZone: t,
|
|
104
|
-
fromDayjs: h,
|
|
105
|
-
timeOptions: n
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
getMonthNames() {
|
|
109
|
-
let e = d();
|
|
110
|
-
return r(12).map((t) => new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2021, t, 1)));
|
|
111
|
-
},
|
|
112
|
-
isSameTime(e, t, n) {
|
|
113
|
-
let r = m(e, n), i = m(t, n);
|
|
114
|
-
return r.hour() === i.hour() && r.minute() === i.minute() && r.second() === i.second();
|
|
115
|
-
},
|
|
116
|
-
now(e) {
|
|
117
|
-
let n = p(e), r = f(), a = s(i(), n);
|
|
118
|
-
return t(r) || (a = a.locale(r)), h(a);
|
|
119
|
-
},
|
|
120
|
-
parse(e, t) {
|
|
121
|
-
if (!n(e) || e.trim() === "") return null;
|
|
122
|
-
let r = c(e.trim(), p(t));
|
|
123
|
-
return r.isValid() ? h(r.startOf("day")) : null;
|
|
124
|
-
},
|
|
125
|
-
getWeekdayNames() {
|
|
126
|
-
let e = d(), t = new Intl.DateTimeFormat(e, { weekday: "short" }), n = new Date(2021, 0, 3);
|
|
127
|
-
return r(7).map((e) => {
|
|
128
|
-
let r = new Date(n);
|
|
129
|
-
return r.setDate(n.getDate() + e), t.format(r);
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
getCalendarDays(e, t, n) {
|
|
133
|
-
let i = _.startOfMonth(e, n), a = (_.getDay(i, n) - (t % 7 + 7) % 7 + 7) % 7, o = _.addDays(i, -a, n);
|
|
134
|
-
return r(42).map((e) => _.addDays(o, e, n));
|
|
135
|
-
},
|
|
136
|
-
formatTime(e, t, n) {
|
|
137
|
-
if (!g(e)) return "";
|
|
138
|
-
let r = d(), i = p(t), a = n?.ampm === !0, o = n?.showSeconds === !0;
|
|
139
|
-
return new Intl.DateTimeFormat(r, {
|
|
140
|
-
hour12: a,
|
|
141
|
-
timeZone: i,
|
|
142
|
-
hour: "2-digit",
|
|
143
|
-
minute: "2-digit",
|
|
144
|
-
...o ? { second: "2-digit" } : {}
|
|
145
|
-
}).format(e);
|
|
146
|
-
},
|
|
147
|
-
format(e, t, n) {
|
|
148
|
-
if (!g(e)) return "";
|
|
149
|
-
let r = d(), i = p(t), a = n?.granularity ?? "day";
|
|
150
|
-
return a === "year" ? new Intl.DateTimeFormat(r, {
|
|
151
|
-
timeZone: i,
|
|
152
|
-
year: "numeric"
|
|
153
|
-
}).format(e) : a === "month" ? new Intl.DateTimeFormat(r, {
|
|
154
|
-
month: "long",
|
|
155
|
-
timeZone: i,
|
|
156
|
-
year: "numeric"
|
|
157
|
-
}).format(e) : new Intl.DateTimeFormat(r, {
|
|
158
|
-
timeZone: i,
|
|
159
|
-
day: "2-digit",
|
|
160
|
-
year: "numeric",
|
|
161
|
-
month: "2-digit"
|
|
162
|
-
}).format(e);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
return _;
|
|
166
|
-
}
|
|
167
|
-
function u(e) {
|
|
168
|
-
let { value: t, adapter: r, toDayjs: a, timeZone: o, fromDayjs: s, timeOptions: c } = e;
|
|
169
|
-
if (!n(t) || t.trim() === "") return null;
|
|
170
|
-
let l = t.trim(), u = c?.ampm === !0, d = c?.showSeconds === !0, f = i(l, u ? d ? "h:mm:ss A" : "h:mm A" : d ? "H:mm:ss" : "H:mm", !0);
|
|
171
|
-
return f.isValid() ? s(a(r.now(o), o).hour(f.hour()).minute(f.minute()).second(d ? f.second() : 0).millisecond(0)) : null;
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
|
-
export { l as createDayjsDateAdapter };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DateAdapter } from '@bridge-ui/core/Adapters';
|
|
2
|
-
/**
|
|
3
|
-
* Builds a Luxon-backed {@link DateAdapter} (`TDate = Date`) for Bridge calendars.
|
|
4
|
-
* Locale and default IANA zone start unset until {@link DateAdapter.setLocale} /
|
|
5
|
-
* {@link DateAdapter.setTimeZone}.
|
|
6
|
-
*/
|
|
7
|
-
export declare function createLuxonDateAdapter(): DateAdapter<Date>;
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { clamp as e, isNil as t, isString as n, range as r } from "es-toolkit/compat";
|
|
2
|
-
import { DateTime as i, Info as a } from "luxon";
|
|
3
|
-
//#region src/Adapters/Examples/date-luxon.ts
|
|
4
|
-
function o() {
|
|
5
|
-
let o, c, l = () => o, u = (e) => e ?? c, d = (e, n) => {
|
|
6
|
-
let r = l(), a = u(n), o = i.fromJSDate(e);
|
|
7
|
-
return t(a) || (o = o.setZone(a)), t(r) || (o = o.setLocale(r)), o;
|
|
8
|
-
}, f = (e) => e.toJSDate(), p = (e) => e instanceof Date && !Number.isNaN(e.getTime()), m = {
|
|
9
|
-
setLocale(e) {
|
|
10
|
-
o = e;
|
|
11
|
-
},
|
|
12
|
-
setTimeZone(e) {
|
|
13
|
-
c = e;
|
|
14
|
-
},
|
|
15
|
-
getDate(e, t) {
|
|
16
|
-
return d(e, t).day;
|
|
17
|
-
},
|
|
18
|
-
getYear(e, t) {
|
|
19
|
-
return d(e, t).year;
|
|
20
|
-
},
|
|
21
|
-
getHours(e, t) {
|
|
22
|
-
return d(e, t).hour;
|
|
23
|
-
},
|
|
24
|
-
isAfter(e, t, n) {
|
|
25
|
-
return m.isBefore(t, e, n);
|
|
26
|
-
},
|
|
27
|
-
getMinutes(e, t) {
|
|
28
|
-
return d(e, t).minute;
|
|
29
|
-
},
|
|
30
|
-
getSeconds(e, t) {
|
|
31
|
-
return d(e, t).second;
|
|
32
|
-
},
|
|
33
|
-
getMonth(e, t) {
|
|
34
|
-
return d(e, t).month - 1;
|
|
35
|
-
},
|
|
36
|
-
getDay(e, t) {
|
|
37
|
-
return d(e, t).weekday % 7;
|
|
38
|
-
},
|
|
39
|
-
startOfDay(e, t) {
|
|
40
|
-
return f(d(e, t).startOf("day"));
|
|
41
|
-
},
|
|
42
|
-
setDate(e, t, n) {
|
|
43
|
-
return f(d(e, n).set({ day: t }));
|
|
44
|
-
},
|
|
45
|
-
setYear(e, t, n) {
|
|
46
|
-
return f(d(e, n).set({ year: t }));
|
|
47
|
-
},
|
|
48
|
-
startOfMonth(e, t) {
|
|
49
|
-
return f(d(e, t).startOf("month"));
|
|
50
|
-
},
|
|
51
|
-
isSameDay(e, t, n) {
|
|
52
|
-
return d(e, n).hasSame(d(t, n), "day");
|
|
53
|
-
},
|
|
54
|
-
isSameYear(e, t, n) {
|
|
55
|
-
return d(e, n).hasSame(d(t, n), "year");
|
|
56
|
-
},
|
|
57
|
-
isSameMonth(e, t, n) {
|
|
58
|
-
return d(e, n).hasSame(d(t, n), "month");
|
|
59
|
-
},
|
|
60
|
-
addDays(e, t, n) {
|
|
61
|
-
return f(d(e, n).plus({ days: t }));
|
|
62
|
-
},
|
|
63
|
-
addYears(e, t, n) {
|
|
64
|
-
return f(d(e, n).plus({ years: t }));
|
|
65
|
-
},
|
|
66
|
-
getMonthNames() {
|
|
67
|
-
let e = l() ?? "en-US";
|
|
68
|
-
return a.months("long", { locale: e });
|
|
69
|
-
},
|
|
70
|
-
setMonth(e, t, n) {
|
|
71
|
-
return f(d(e, n).set({ month: t + 1 }));
|
|
72
|
-
},
|
|
73
|
-
addMonths(e, t, n) {
|
|
74
|
-
return f(d(e, n).plus({ months: t }));
|
|
75
|
-
},
|
|
76
|
-
endOfMonth(e, t) {
|
|
77
|
-
return f(d(e, t).endOf("month").startOf("second"));
|
|
78
|
-
},
|
|
79
|
-
setHours(t, n, r) {
|
|
80
|
-
return f(d(t, r).set({ hour: e(n, 0, 23) }));
|
|
81
|
-
},
|
|
82
|
-
isBefore(e, t, n) {
|
|
83
|
-
return d(e, n).startOf("day") < d(t, n).startOf("day");
|
|
84
|
-
},
|
|
85
|
-
setMinutes(t, n, r) {
|
|
86
|
-
return f(d(t, r).set({ minute: e(n, 0, 59) }));
|
|
87
|
-
},
|
|
88
|
-
setSeconds(t, n, r) {
|
|
89
|
-
return f(d(t, r).set({ second: e(n, 0, 59) }));
|
|
90
|
-
},
|
|
91
|
-
parseTime(e, t, n) {
|
|
92
|
-
return s({
|
|
93
|
-
value: e,
|
|
94
|
-
adapter: m,
|
|
95
|
-
timeZone: t,
|
|
96
|
-
toDateTime: d,
|
|
97
|
-
timeOptions: n,
|
|
98
|
-
fromDateTime: f
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
getWeekdayNames() {
|
|
102
|
-
let e = l() ?? "en-US", t = a.weekdays("short", { locale: e });
|
|
103
|
-
return [t[6], ...t.slice(0, 6)];
|
|
104
|
-
},
|
|
105
|
-
isSameTime(e, t, n) {
|
|
106
|
-
let r = d(e, n), i = d(t, n);
|
|
107
|
-
return r.hour === i.hour && r.minute === i.minute && r.second === i.second;
|
|
108
|
-
},
|
|
109
|
-
now(e) {
|
|
110
|
-
let n = u(e), r = l(), a = i.now();
|
|
111
|
-
return t(n) || (a = a.setZone(n)), t(r) || (a = a.setLocale(r)), f(a);
|
|
112
|
-
},
|
|
113
|
-
formatTime(e, t, n) {
|
|
114
|
-
if (!p(e)) return "";
|
|
115
|
-
let r = n?.ampm === !0, i = n?.showSeconds === !0;
|
|
116
|
-
return d(e, t).toLocaleString({
|
|
117
|
-
hour: "2-digit",
|
|
118
|
-
minute: "2-digit",
|
|
119
|
-
hourCycle: r ? "h12" : "h23",
|
|
120
|
-
...i ? { second: "2-digit" } : {}
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
getCalendarDays(e, t, n) {
|
|
124
|
-
let i = m.startOfMonth(e, n), a = (m.getDay(i, n) - (t % 7 + 7) % 7 + 7) % 7, o = m.addDays(i, -a, n);
|
|
125
|
-
return r(42).map((e) => m.addDays(o, e, n));
|
|
126
|
-
},
|
|
127
|
-
parse(e, t) {
|
|
128
|
-
if (!n(e) || e.trim() === "") return null;
|
|
129
|
-
let r = e.trim(), a = i.fromISO(r, {
|
|
130
|
-
locale: l(),
|
|
131
|
-
zone: u(t)
|
|
132
|
-
});
|
|
133
|
-
if (a.isValid) return f(a.startOf("day"));
|
|
134
|
-
let o = i.fromJSDate(new Date(r), { zone: u(t) });
|
|
135
|
-
return o.isValid ? f(o.startOf("day")) : null;
|
|
136
|
-
},
|
|
137
|
-
format(e, t, n) {
|
|
138
|
-
if (!p(e)) return "";
|
|
139
|
-
let r = n?.granularity ?? "day";
|
|
140
|
-
return r === "year" ? d(e, t).toLocaleString({ year: "numeric" }) : r === "month" ? d(e, t).toLocaleString({
|
|
141
|
-
month: "long",
|
|
142
|
-
year: "numeric"
|
|
143
|
-
}) : d(e, t).toLocaleString({
|
|
144
|
-
day: "2-digit",
|
|
145
|
-
year: "numeric",
|
|
146
|
-
month: "2-digit"
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
return m;
|
|
151
|
-
}
|
|
152
|
-
function s(e) {
|
|
153
|
-
let { value: t, adapter: r, timeZone: a, toDateTime: o, timeOptions: s, fromDateTime: c } = e;
|
|
154
|
-
if (!n(t) || t.trim() === "") return null;
|
|
155
|
-
let l = t.trim(), u = s?.ampm === !0, d = s?.showSeconds === !0, f = u ? d ? "h:mm:ss a" : "h:mm a" : d ? "H:mm:ss" : "H:mm", p = i.fromFormat(l, f, { locale: "en-US" });
|
|
156
|
-
return p.isValid ? c(o(r.now(a), a).set({
|
|
157
|
-
millisecond: 0,
|
|
158
|
-
hour: p.hour,
|
|
159
|
-
minute: p.minute,
|
|
160
|
-
second: d ? p.second : 0
|
|
161
|
-
})) : null;
|
|
162
|
-
}
|
|
163
|
-
//#endregion
|
|
164
|
-
export { o as createLuxonDateAdapter };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DateAdapter } from '@bridge-ui/core/Adapters';
|
|
2
|
-
/**
|
|
3
|
-
* Maps Bridge locales (`en-US`, `pt-BR`) to Moment locale ids (`en`, `pt-br`).
|
|
4
|
-
* Import matching `moment/locale/*` files in the app.
|
|
5
|
-
*/
|
|
6
|
-
export type MomentDateAdapterLocales = Record<string, string>;
|
|
7
|
-
/**
|
|
8
|
-
* Builds a Moment-backed {@link DateAdapter} (`TDate = Date`) for Bridge calendars.
|
|
9
|
-
* Locale and default IANA zone start unset until {@link DateAdapter.setLocale} /
|
|
10
|
-
* {@link DateAdapter.setTimeZone}.
|
|
11
|
-
*
|
|
12
|
-
* `setLocale` still receives Bridge tags. Unmapped `en-US` becomes `en`; other
|
|
13
|
-
* tags are lowercased (`pt-BR` → `pt-br`) unless {@link MomentDateAdapterLocales}
|
|
14
|
-
* has an entry.
|
|
15
|
-
*
|
|
16
|
-
* Import `moment-timezone` in the app for IANA zones. Without `moment.tz`,
|
|
17
|
-
* `timeZone` arguments are ignored.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createMomentDateAdapter(locales?: MomentDateAdapterLocales): DateAdapter<Date>;
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { clamp as e, isFunction as t, isNil as n, isString as r, range as i } from "es-toolkit/compat";
|
|
2
|
-
import a from "moment";
|
|
3
|
-
//#region src/Adapters/Examples/date-moment.ts
|
|
4
|
-
var o = a;
|
|
5
|
-
function s(e, t) {
|
|
6
|
-
return n(t) ? e : e.tz?.(t) ?? e;
|
|
7
|
-
}
|
|
8
|
-
function c(e, r) {
|
|
9
|
-
return n(r) || !t(o.tz) ? a(e) : o.tz(e, r);
|
|
10
|
-
}
|
|
11
|
-
function l(t = {}) {
|
|
12
|
-
let o, l, d = () => o, f = () => {
|
|
13
|
-
if (!n(o)) return t[o] ?? (o === "en-US" ? "en" : o.toLowerCase());
|
|
14
|
-
}, p = (e) => e ?? l, m = (e, t) => {
|
|
15
|
-
let r = f(), i = p(t), o = s(a(e), i);
|
|
16
|
-
return n(r) || (o = o.locale(r)), o;
|
|
17
|
-
}, h = (e) => e.toDate(), g = (e) => e instanceof Date && !Number.isNaN(e.getTime()), _ = {
|
|
18
|
-
setLocale(e) {
|
|
19
|
-
o = e;
|
|
20
|
-
},
|
|
21
|
-
setTimeZone(e) {
|
|
22
|
-
l = e;
|
|
23
|
-
},
|
|
24
|
-
getDay(e, t) {
|
|
25
|
-
return m(e, t).day();
|
|
26
|
-
},
|
|
27
|
-
getDate(e, t) {
|
|
28
|
-
return m(e, t).date();
|
|
29
|
-
},
|
|
30
|
-
getYear(e, t) {
|
|
31
|
-
return m(e, t).year();
|
|
32
|
-
},
|
|
33
|
-
getHours(e, t) {
|
|
34
|
-
return m(e, t).hour();
|
|
35
|
-
},
|
|
36
|
-
isAfter(e, t, n) {
|
|
37
|
-
return _.isBefore(t, e, n);
|
|
38
|
-
},
|
|
39
|
-
getMonth(e, t) {
|
|
40
|
-
return m(e, t).month();
|
|
41
|
-
},
|
|
42
|
-
getMinutes(e, t) {
|
|
43
|
-
return m(e, t).minute();
|
|
44
|
-
},
|
|
45
|
-
getSeconds(e, t) {
|
|
46
|
-
return m(e, t).second();
|
|
47
|
-
},
|
|
48
|
-
setDate(e, t, n) {
|
|
49
|
-
return h(m(e, n).clone().date(t));
|
|
50
|
-
},
|
|
51
|
-
isSameDay(e, t, n) {
|
|
52
|
-
return m(e, n).isSame(m(t, n), "day");
|
|
53
|
-
},
|
|
54
|
-
setYear(e, t, n) {
|
|
55
|
-
return h(m(e, n).clone().year(t));
|
|
56
|
-
},
|
|
57
|
-
isSameYear(e, t, n) {
|
|
58
|
-
return m(e, n).isSame(m(t, n), "year");
|
|
59
|
-
},
|
|
60
|
-
startOfDay(e, t) {
|
|
61
|
-
return h(m(e, t).clone().startOf("day"));
|
|
62
|
-
},
|
|
63
|
-
endOfMonth(e, t) {
|
|
64
|
-
return h(m(e, t).clone().endOf("month"));
|
|
65
|
-
},
|
|
66
|
-
isSameMonth(e, t, n) {
|
|
67
|
-
return m(e, n).isSame(m(t, n), "month");
|
|
68
|
-
},
|
|
69
|
-
setMonth(e, t, n) {
|
|
70
|
-
return h(m(e, n).clone().month(t));
|
|
71
|
-
},
|
|
72
|
-
startOfMonth(e, t) {
|
|
73
|
-
return h(m(e, t).clone().startOf("month"));
|
|
74
|
-
},
|
|
75
|
-
addDays(e, t, n) {
|
|
76
|
-
return h(m(e, n).clone().add(t, "days"));
|
|
77
|
-
},
|
|
78
|
-
addYears(e, t, n) {
|
|
79
|
-
return h(m(e, n).clone().add(t, "years"));
|
|
80
|
-
},
|
|
81
|
-
addMonths(e, t, n) {
|
|
82
|
-
return h(m(e, n).clone().add(t, "months"));
|
|
83
|
-
},
|
|
84
|
-
setHours(t, n, r) {
|
|
85
|
-
return h(m(t, r).clone().hour(e(n, 0, 23)));
|
|
86
|
-
},
|
|
87
|
-
setMinutes(t, n, r) {
|
|
88
|
-
return h(m(t, r).clone().minute(e(n, 0, 59)));
|
|
89
|
-
},
|
|
90
|
-
setSeconds(t, n, r) {
|
|
91
|
-
return h(m(t, r).clone().second(e(n, 0, 59)));
|
|
92
|
-
},
|
|
93
|
-
isBefore(e, t, n) {
|
|
94
|
-
return m(e, n).clone().startOf("day").isBefore(m(t, n).clone().startOf("day"));
|
|
95
|
-
},
|
|
96
|
-
parseTime(e, t, n) {
|
|
97
|
-
return u({
|
|
98
|
-
value: e,
|
|
99
|
-
adapter: _,
|
|
100
|
-
toMoment: m,
|
|
101
|
-
timeZone: t,
|
|
102
|
-
fromMoment: h,
|
|
103
|
-
timeOptions: n
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
getMonthNames() {
|
|
107
|
-
let e = d();
|
|
108
|
-
return i(12).map((t) => new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2021, t, 1)));
|
|
109
|
-
},
|
|
110
|
-
isSameTime(e, t, n) {
|
|
111
|
-
let r = m(e, n), i = m(t, n);
|
|
112
|
-
return r.hour() === i.hour() && r.minute() === i.minute() && r.second() === i.second();
|
|
113
|
-
},
|
|
114
|
-
now(e) {
|
|
115
|
-
let t = p(e), r = f(), i = s(a(), t);
|
|
116
|
-
return n(r) || (i = i.locale(r)), h(i);
|
|
117
|
-
},
|
|
118
|
-
parse(e, t) {
|
|
119
|
-
if (!r(e) || e.trim() === "") return null;
|
|
120
|
-
let n = c(e.trim(), p(t));
|
|
121
|
-
return n.isValid() ? h(n.startOf("day")) : null;
|
|
122
|
-
},
|
|
123
|
-
getWeekdayNames() {
|
|
124
|
-
let e = d(), t = new Intl.DateTimeFormat(e, { weekday: "short" }), n = new Date(2021, 0, 3);
|
|
125
|
-
return i(7).map((e) => {
|
|
126
|
-
let r = new Date(n);
|
|
127
|
-
return r.setDate(n.getDate() + e), t.format(r);
|
|
128
|
-
});
|
|
129
|
-
},
|
|
130
|
-
getCalendarDays(e, t, n) {
|
|
131
|
-
let r = _.startOfMonth(e, n), a = (_.getDay(r, n) - (t % 7 + 7) % 7 + 7) % 7, o = _.addDays(r, -a, n);
|
|
132
|
-
return i(42).map((e) => _.addDays(o, e, n));
|
|
133
|
-
},
|
|
134
|
-
formatTime(e, t, n) {
|
|
135
|
-
if (!g(e)) return "";
|
|
136
|
-
let r = d(), i = p(t), a = n?.ampm === !0, o = n?.showSeconds === !0;
|
|
137
|
-
return new Intl.DateTimeFormat(r, {
|
|
138
|
-
hour12: a,
|
|
139
|
-
timeZone: i,
|
|
140
|
-
hour: "2-digit",
|
|
141
|
-
minute: "2-digit",
|
|
142
|
-
...o ? { second: "2-digit" } : {}
|
|
143
|
-
}).format(e);
|
|
144
|
-
},
|
|
145
|
-
format(e, t, n) {
|
|
146
|
-
if (!g(e)) return "";
|
|
147
|
-
let r = d(), i = p(t), a = n?.granularity ?? "day";
|
|
148
|
-
return a === "year" ? new Intl.DateTimeFormat(r, {
|
|
149
|
-
timeZone: i,
|
|
150
|
-
year: "numeric"
|
|
151
|
-
}).format(e) : a === "month" ? new Intl.DateTimeFormat(r, {
|
|
152
|
-
month: "long",
|
|
153
|
-
timeZone: i,
|
|
154
|
-
year: "numeric"
|
|
155
|
-
}).format(e) : new Intl.DateTimeFormat(r, {
|
|
156
|
-
timeZone: i,
|
|
157
|
-
day: "2-digit",
|
|
158
|
-
year: "numeric",
|
|
159
|
-
month: "2-digit"
|
|
160
|
-
}).format(e);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
return _;
|
|
164
|
-
}
|
|
165
|
-
function u(e) {
|
|
166
|
-
let { value: t, adapter: n, toMoment: i, timeZone: o, fromMoment: s, timeOptions: c } = e;
|
|
167
|
-
if (!r(t) || t.trim() === "") return null;
|
|
168
|
-
let l = t.trim(), u = c?.ampm === !0, d = c?.showSeconds === !0, f = a(l, u ? d ? "h:mm:ss A" : "h:mm A" : d ? "H:mm:ss" : "H:mm", !0);
|
|
169
|
-
return f.isValid() ? s(i(n.now(o), o).clone().hour(f.hour()).minute(f.minute()).second(d ? f.second() : 0).millisecond(0)) : null;
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
export { l as createMomentDateAdapter };
|