@wssto2/vue-core 0.16.0 → 0.18.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 +32 -0
- package/README.md +5 -3
- package/bin/architecture/engine.mjs +3 -0
- package/bin/architecture/permissions.mjs +56 -0
- package/bin/architecture/rules.mjs +17 -0
- package/bin/commands/check-architecture.mjs +19 -0
- package/bin/config.mjs +2 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-BH3f0hda.js → AccessGate.vue_vue_type_script_setup_true_lang-Bg8JFAOT.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js → ActionRow.vue_vue_type_script_setup_true_lang-B5IMNnTf.js} +4 -4
- package/dist/{Activity-DOUuIkZR.js → Activity-CiYn5E6A.js} +7 -7
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-d_dPurWG.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js} +1 -1
- package/dist/{Changes-BfcbVgmu.js → Changes-Cy8STpLX.js} +3 -3
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-B5hSkJ2N.js → CollectionPage.vue_vue_type_script_setup_true_lang-Dr6nFNBB.js} +6 -6
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DbRS37n3.js → DataTable.vue_vue_type_script_setup_true_lang-D372wlxR.js} +1 -1
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-DzCvYHAf.js → DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js} +17 -16
- package/dist/{DeadLetters-CuMvfXH8.js → DeadLetters-DhJkMpd_.js} +4 -4
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js → FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js} +2 -2
- package/dist/FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js +160 -0
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js → FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js} +5 -5
- package/dist/{General-B5vcSEhP.js → General-CwTPC5UP.js} +10 -10
- package/dist/{IncidentRecord-wmStcEag.js → IncidentRecord-hXEGuLGg.js} +13 -13
- package/dist/{IncidentsList-CFx5tsxP.js → IncidentsList-C41VyDwK.js} +6 -6
- package/dist/{NewRolePage-CZxAp7LR.js → NewRolePage-BYYZJkK7.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-U-_kcnGr.js → NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js} +7 -6
- package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-BPDh9s2m.js → PersonAccess.vue_vue_type_script_setup_true_lang-mYFuG-Y3.js} +56 -56
- package/dist/{ProfilePage-B-T8kBcc.js → ProfilePage-DGEsIycR.js} +13 -13
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-Bt5mT19g.js → RecordHeader.vue_vue_type_script_setup_true_lang-B3BnYg1x.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DOiFuJnH.js → ResourcePage.vue_vue_type_script_setup_true_lang-1iZtj3rh.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CqSsNPCw.js → RoleEditor.vue_vue_type_script_setup_true_lang-BslSDDiM.js} +9 -9
- package/dist/{RolePage-zcUWpuDE.js → RolePage-C08ZUqw1.js} +9 -9
- package/dist/{RolesPage-C7_zWw-c.js → RolesPage-FOuY1VKg.js} +10 -10
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BlCx9dVL.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DCTFxfPB.js} +2 -2
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js → SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js} +13 -12
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js → SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js} +10 -9
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C2D_D5Hi.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CDr4WNIb.js} +9 -9
- package/dist/{ServiceAccountRecord-BYxpHzTR.js → ServiceAccountRecord-kWwIQGZb.js} +12 -12
- package/dist/{ServiceAccountsList-BUuK-RUj.js → ServiceAccountsList-CKy9_YHP.js} +8 -8
- package/dist/{Sessions-Cm-Kilwl.js → Sessions-BDc8gdYH.js} +4 -4
- package/dist/{SettingsPage-Bavl0K-F.js → SettingsPage-t-8kmFVT.js} +13 -13
- package/dist/{SignIn-SfEhFiyM.js → SignIn-CqtkvtCZ.js} +7 -7
- package/dist/{SignInPage-BU0n2ehq.js → SignInPage-DcdNKZIb.js} +4 -4
- package/dist/{SignIns-Ahbn5cO6.js → SignIns-D4-nGu0B.js} +3 -3
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js → SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js} +15 -14
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js → TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js} +7 -6
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js → TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js} +6 -5
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-C1mLvOkc.js → TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js} +30 -29
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-jCXYFLtq.js → Timestamp.vue_vue_type_script_setup_true_lang-d_KuxWjH.js} +1 -1
- package/dist/{UserRecord-3pCKMHkq.js → UserRecord-CwZCr9Im.js} +10 -10
- package/dist/{UsersList-vw3aDpvo.js → UsersList-Cn19sFgv.js} +4 -4
- package/dist/access/index.js +4 -4
- package/dist/app/application.d.ts +2 -0
- package/dist/app/index.js +2 -2
- package/dist/app/validate.d.ts +3 -1
- package/dist/{application-CHPpOssP.js → application-CDSweJb9.js} +144 -142
- package/dist/collection/DynamicCollection.vue.d.ts +69 -0
- package/dist/collection/authors.d.ts +27 -0
- package/dist/collection/definition.d.ts +4 -4
- package/dist/collection/dynamicColumns.d.ts +13 -0
- package/dist/collection/index.d.ts +3 -0
- package/dist/collection/index.js +196 -142
- package/dist/config/index.d.ts +42 -0
- package/dist/config/index.js +12 -3
- package/dist/content/Panel.vue.d.ts +1 -1
- package/dist/content/index.js +2 -2
- package/dist/{contributions-9CPT-Z5v.js → contributions-B0x5x5xD.js} +1 -1
- package/dist/form/CommandDialog.vue.d.ts +1 -1
- package/dist/form/DateField.vue.d.ts +1 -1
- package/dist/form/DateTimeField.vue.d.ts +1 -1
- package/dist/form/FileField.vue.d.ts +1 -1
- package/dist/form/FormRow.vue.d.ts +2 -2
- package/dist/form/I18nField.vue.d.ts +2 -2
- package/dist/form/TextField.vue.d.ts +1 -1
- package/dist/form/TextareaField.vue.d.ts +2 -2
- package/dist/form/date/value.d.ts +21 -0
- package/dist/form/dynamic/DynamicForm.vue.d.ts +46 -0
- package/dist/form/dynamic/RepeatField.vue.d.ts +47 -0
- package/dist/form/dynamic/ResourceField.vue.d.ts +38 -0
- package/dist/form/dynamic/ResourcePickerList.vue.d.ts +12 -0
- package/dist/form/dynamic/RichTextField.vue.d.ts +40 -0
- package/dist/form/dynamic/localeMode.d.ts +5 -0
- package/dist/form/dynamic/resources.d.ts +34 -0
- package/dist/form/dynamic/schema.d.ts +73 -0
- package/dist/form/dynamic/validator.d.ts +30 -0
- package/dist/form/dynamic/visibility.d.ts +12 -0
- package/dist/form/index.d.ts +12 -0
- package/dist/form/index.js +2100 -1260
- package/dist/format/format.d.ts +8 -2
- package/dist/format/index.js +1 -1
- package/dist/format-C_HXlOYQ.js +136 -0
- package/dist/{guards-6fJxfUtk.js → guards-CNJ0ATVC.js} +1 -1
- package/dist/i18n/index.d.ts +14 -2
- package/dist/i18n/index.js +86 -75
- package/dist/i18n/messages.d.ts +10 -1
- package/dist/i18n/runtime.d.ts +3 -1
- package/dist/identity/index.js +3 -3
- package/dist/identity/profile/EmailChangeDialog.vue.d.ts +2 -2
- package/dist/identity/users/list.d.ts +1 -1
- package/dist/incidents/index.js +1 -1
- package/dist/{index-D9_xqF5g.js → index-1HS7O2-e.js} +9 -9
- package/dist/{index-nByFc1eL.js → index-BA2w8uwD.js} +86 -86
- package/dist/{index-Ct7W_gYE.js → index-SLJWm40T.js} +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modal/DiscardChangesModal.vue.d.ts +2 -2
- package/dist/modal/Modal.vue.d.ts +2 -2
- package/dist/modal/Sheet.vue.d.ts +2 -2
- package/dist/modules/identity/routes.d.ts +1 -1
- package/dist/modules/identity/schemas.d.ts +2 -2
- package/dist/{navigation-DMJ6akat.js → navigation-d-JAPBGA.js} +1 -1
- package/dist/{neighbors-BpypL3Wb.js → neighbors-Dg_LU9ry.js} +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/onboarding/index.js +1 -1
- package/dist/options-mOOX6JSS.js +214 -0
- package/dist/overlay/AlertDialog.vue.d.ts +3 -3
- package/dist/overlay/Menu.vue.d.ts +2 -2
- package/dist/overlay/PhotoViewer.vue.d.ts +2 -2
- package/dist/overlay/Popover.vue.d.ts +2 -2
- package/dist/page/SectionNavigator.vue.d.ts +1 -1
- package/dist/page/SectionPanel.vue.d.ts +1 -1
- package/dist/page/index.js +3 -3
- package/dist/phone/index.js +57 -56
- package/dist/platform/index.d.ts +10 -1
- package/dist/platform/index.js +16 -15
- package/dist/platform/platform.d.ts +4 -2
- package/dist/{platform-ORzRR3Tw.js → platform-DU9QFts8.js} +7 -6
- package/dist/playwright/config.d.ts +33 -0
- package/dist/playwright/index.d.ts +2 -0
- package/dist/playwright/index.js +192 -171
- package/dist/resource/index.js +1 -1
- package/dist/resources-BZLlAtoS.js +62 -0
- package/dist/router/index.js +3 -3
- package/dist/{rowLayout-QKfNHsML.js → rowLayout-PIuD7MGo.js} +2 -2
- package/dist/{sections-CSpJN0Z7.js → sections-BpiRLntE.js} +1 -1
- package/dist/{serverMessages-Ce8-MK4e.js → serverMessages-C_KkDvpT.js} +1 -1
- package/dist/shell/index.js +4 -4
- package/dist/state/NextStepPanel.vue.d.ts +63 -0
- package/dist/state/PhaseTiles.vue.d.ts +20 -0
- package/dist/state/PhaseTrack.vue.d.ts +48 -0
- package/dist/state/RequirementList.vue.d.ts +10 -0
- package/dist/state/TodoRow.vue.d.ts +52 -0
- package/dist/state/index.d.ts +9 -0
- package/dist/state/index.js +731 -126
- package/dist/state/phaseStep.d.ts +7 -0
- package/dist/state/phaseTile.d.ts +10 -0
- package/dist/state/requirementItem.d.ts +16 -0
- package/dist/state/todoRow.d.ts +8 -0
- package/dist/{state-QDaxntgR.js → state-z1iPF1DT.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{suggestions-q_v3M7G6.js → suggestions-DeMgs_ki.js} +1 -1
- package/dist/testing/format.d.ts +1 -1
- package/dist/testing/index.js +31 -31
- package/dist/{useCommand-DAMgQ5NE.js → useCommand-DQKvro1n.js} +2 -2
- package/dist/{useGroupSheet-B-Hs4gNO.js → useGroupSheet-CRw3MUmX.js} +3 -3
- package/dist/{usePreferences-BfMXVbSO.js → usePreferences-DB29UTFD.js} +1 -1
- package/dist/{useRecordDialog-QPKFH1Ww.js → useRecordDialog-0azHxxvm.js} +1 -1
- package/dist/{useResourceForm-Oa6bk3NI.js → useResourceForm-zVuWerSn.js} +1 -1
- package/dist/{useTypedEntry-CITij2C_.js → useTypedEntry-BsMV66Yc.js} +46 -45
- package/package.json +6 -1
- package/dist/format-Cp1h0vsC.js +0 -125
- package/dist/options-B48UiYsG.js +0 -368
package/dist/format/format.d.ts
CHANGED
|
@@ -79,6 +79,12 @@ export interface Formatting {
|
|
|
79
79
|
day(value: DateInput, options?: DayOptions): string;
|
|
80
80
|
/** `day` and the time, "Today · 12:57" / "13.09.2026. · 12:57". */
|
|
81
81
|
dayTime(value: DateInput, options?: DayOptions): string;
|
|
82
|
+
/**
|
|
83
|
+
* A moment as people say it: "just now", "20 min ago", "today at 09:12", "yesterday at 21:05", "tomorrow at 11:00", else the `date` and
|
|
84
|
+
* the time ("24.09.2026. at 14:12"). The words are the `core.when.*` texts; a moment ahead of `now` (an expiry) is a day and a time.
|
|
85
|
+
* Empty for a value that is no date. Without a `translate` in the options it is the `dateTime`.
|
|
86
|
+
*/
|
|
87
|
+
when(value: DateInput, now?: Date): string;
|
|
82
88
|
/** The BCP 47 tag the active locale is given to `Intl` as (the application's `intlLocale` map over the library's), for a caller that uses `Intl` itself. */
|
|
83
89
|
readonly intlLocale: string;
|
|
84
90
|
}
|
|
@@ -109,8 +115,8 @@ export interface FormattingOptions extends FormatterSettings {
|
|
|
109
115
|
currencySymbol?: string;
|
|
110
116
|
/** What `number` returns for a value with nothing to show (null, undefined, NaN): `"0"`. Default: the empty string, like the other functions. */
|
|
111
117
|
emptyNumber?: string;
|
|
112
|
-
/** A message in the active language, for the words of `day` ("core.activity.today"). Without it `day` is `date`. */
|
|
113
|
-
translate?: (key: string) => string;
|
|
118
|
+
/** A message in the active language, for the words of `day` and `when` ("core.activity.today"). Without it `day` is `date`. */
|
|
119
|
+
translate?: (key: string, params?: Record<string, unknown>) => string;
|
|
114
120
|
}
|
|
115
121
|
/** The part of the options an application passes next to its formatters (`createApplication`'s `formatting`): the rest it already owns. */
|
|
116
122
|
export type FormattingSettings = Omit<FormattingOptions, "locale" | "formatters" | "translate">;
|
package/dist/format/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as o, f as s, i, a as l, t as n, u as g } from "../format-
|
|
1
|
+
import { c as o, f as s, i, a as l, t as n, u as g } from "../format-C_HXlOYQ.js";
|
|
2
2
|
function e(a) {
|
|
3
3
|
return a.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[đĐ]/g, "d").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4
4
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { d as x } from "./context-Ch1r4fdN.js";
|
|
2
|
+
const E = { bs: "sr-Latn-BA" }, S = (r, a = {}) => a[r] ?? E[r] ?? r, L = /^(\d{4})-(\d{2})-(\d{2})$/, A = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}/, Y = ["0000-00-00", "0001-01-01", "1970-01-01"];
|
|
3
|
+
function D(r) {
|
|
4
|
+
if (r == null || r === "") return null;
|
|
5
|
+
let a;
|
|
6
|
+
if (r instanceof Date) a = r;
|
|
7
|
+
else if (typeof r == "number") a = new Date(r);
|
|
8
|
+
else {
|
|
9
|
+
if (Y.some((o) => r.startsWith(o))) return null;
|
|
10
|
+
const i = L.exec(r);
|
|
11
|
+
i ? a = new Date(Number(i[1]), Number(i[2]) - 1, Number(i[3])) : a = new Date(A.test(r) ? r.replace(" ", "T") : r);
|
|
12
|
+
}
|
|
13
|
+
return Number.isNaN(a.getTime()) || a.getTime() <= 0 ? null : a;
|
|
14
|
+
}
|
|
15
|
+
const N = { year: "numeric", month: "2-digit", day: "2-digit" }, M = { hour: "2-digit", minute: "2-digit" }, T = [
|
|
16
|
+
["year", 31536e3],
|
|
17
|
+
["month", 2592e3],
|
|
18
|
+
["week", 604800],
|
|
19
|
+
["day", 86400],
|
|
20
|
+
["hour", 3600],
|
|
21
|
+
["minute", 60],
|
|
22
|
+
["second", 1]
|
|
23
|
+
], _ = "sr-Latn-BA", $ = ["januar", "februar", "mart", "april", "maj", "juni", "juli", "august", "septembar", "oktobar", "novembar", "decembar"], j = ["januara", "februara", "marta", "aprila", "maja", "juna", "jula", "augusta", "septembra", "oktobra", "novembra", "decembra"];
|
|
24
|
+
function H(r, a, i) {
|
|
25
|
+
const o = new Intl.DateTimeFormat(a, i);
|
|
26
|
+
if (a !== _ || i.month !== "long" && i.month !== "short") return o.format(r);
|
|
27
|
+
const d = r.getMonth();
|
|
28
|
+
return o.formatToParts(r).map((g) => g.type !== "month" ? g.value : i.month === "short" ? $[d].slice(0, 3) : (i.day === void 0 ? $ : j)[d]).join("");
|
|
29
|
+
}
|
|
30
|
+
const b = (r, a = 2) => String(r).padStart(a, "0");
|
|
31
|
+
function I(r, a, { group: i, decimal: o }) {
|
|
32
|
+
const d = a?.minimumFractionDigits ?? 0, g = Math.max(d, a?.maximumFractionDigits ?? 3), [l = "", y = ""] = r.toFixed(g).split(".");
|
|
33
|
+
let f = y;
|
|
34
|
+
for (; f.length > d && f.endsWith("0"); ) f = f.slice(0, -1);
|
|
35
|
+
const t = a?.useGrouping === !1 ? l : l.replace(/\B(?=(\d{3})+(?!\d))/g, i);
|
|
36
|
+
return f ? `${t}${o}${f}` : t;
|
|
37
|
+
}
|
|
38
|
+
function O(r = {}) {
|
|
39
|
+
const a = /* @__PURE__ */ new Map(), i = (t, e) => {
|
|
40
|
+
let n = a.get(t);
|
|
41
|
+
return n || (n = e(), a.set(t, n)), n;
|
|
42
|
+
}, o = (t) => S(t, r.intlLocale), d = (t, e) => i(`d|${t}|${JSON.stringify(e)}`, () => new Intl.DateTimeFormat(o(t), e)), g = (t, e) => i(`n|${t}|${JSON.stringify(e ?? {})}`, () => new Intl.NumberFormat(o(t), e)), { datePattern: l, numberSymbols: y } = r, f = (t, e) => e.replace(
|
|
43
|
+
/YYYY|MM|DD|HH|mm/g,
|
|
44
|
+
(n) => n === "YYYY" ? b(t.getFullYear(), 4) : b(n === "MM" ? t.getMonth() + 1 : n === "DD" ? t.getDate() : n === "HH" ? t.getHours() : t.getMinutes())
|
|
45
|
+
);
|
|
46
|
+
return {
|
|
47
|
+
date: (t, e) => l?.[e] ? f(t, l[e]) : d(e, N).format(t),
|
|
48
|
+
dateTime: (t, e) => l?.[e] ? f(t, `${l[e]} HH:mm`) : d(e, { ...N, ...M }).format(t),
|
|
49
|
+
time: (t, e) => d(e, M).format(t),
|
|
50
|
+
number: (t, e, n) => y && (n?.style ?? "decimal") === "decimal" ? I(t, n, y) : g(e, n).format(t),
|
|
51
|
+
money(t, e, n, m) {
|
|
52
|
+
const s = i(`m|${n}|${e}|${JSON.stringify(m ?? {})}`, () => new Intl.NumberFormat(o(n), { ...m, style: "currency", currency: e }));
|
|
53
|
+
if (!y) return s.format(t);
|
|
54
|
+
const u = s.formatToParts(t).find((h) => h.type === "currency")?.value ?? e, c = m?.maximumFractionDigits ?? s.resolvedOptions().maximumFractionDigits ?? 2;
|
|
55
|
+
return `${I(t, { minimumFractionDigits: c, maximumFractionDigits: c }, y)} ${u}`;
|
|
56
|
+
},
|
|
57
|
+
relative(t, e, n) {
|
|
58
|
+
const m = Math.trunc((t.getTime() - n.getTime()) / 1e3), [s, u] = T.find(([, c]) => Math.abs(m) >= c) ?? T[T.length - 1];
|
|
59
|
+
return i(`r|${e}`, () => new Intl.RelativeTimeFormat(o(e), { numeric: "auto" })).format(Math.trunc(m / u), s);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const F = (r, a) => r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth() && r.getDate() === a.getDate();
|
|
64
|
+
function P(r) {
|
|
65
|
+
const a = { ...O(r), ...r.formatters }, i = (t) => typeof t == "number" && Number.isFinite(t), o = () => S(r.locale(), r.intlLocale), d = (t) => {
|
|
66
|
+
const e = D(t);
|
|
67
|
+
return e ? a.time(e, r.locale()) : "";
|
|
68
|
+
}, g = (t, e) => {
|
|
69
|
+
const n = D(t);
|
|
70
|
+
return n ? e ? H(n, o(), e) : a.date(n, r.locale()) : "";
|
|
71
|
+
}, l = (t, { inSentence: e = !1, now: n = /* @__PURE__ */ new Date() } = {}) => {
|
|
72
|
+
const m = D(t);
|
|
73
|
+
if (!m || !r.translate) return g(t);
|
|
74
|
+
const s = new Date(n.getFullYear(), n.getMonth(), n.getDate() - 1), u = F(m, n) ? "core.activity.today" : F(m, s) ? "core.activity.yesterday" : null;
|
|
75
|
+
if (!u) return g(t);
|
|
76
|
+
const c = r.translate(u);
|
|
77
|
+
return e ? c.toLocaleLowerCase(o()) : c.charAt(0).toLocaleUpperCase(o()) + c.slice(1);
|
|
78
|
+
}, y = (t) => `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
79
|
+
return {
|
|
80
|
+
get locale() {
|
|
81
|
+
return r.locale();
|
|
82
|
+
},
|
|
83
|
+
get intlLocale() {
|
|
84
|
+
return o();
|
|
85
|
+
},
|
|
86
|
+
date: g,
|
|
87
|
+
dateTime: (t) => {
|
|
88
|
+
const e = D(t);
|
|
89
|
+
return e ? a.dateTime(e, r.locale()) : "";
|
|
90
|
+
},
|
|
91
|
+
time: d,
|
|
92
|
+
number: (t, e) => i(t) ? a.number(t, r.locale(), e) : r.emptyNumber ?? "",
|
|
93
|
+
get currencySymbol() {
|
|
94
|
+
return r.currencySymbol ?? "";
|
|
95
|
+
},
|
|
96
|
+
money: (t, { currency: e, decimals: n, whole: m, symbol: s = !0 } = {}) => {
|
|
97
|
+
if (!i(t)) return "";
|
|
98
|
+
const u = t, c = m && Number.isInteger(u) ? 0 : n, h = c === void 0 ? void 0 : { minimumFractionDigits: c, maximumFractionDigits: c };
|
|
99
|
+
if (e && s) return a.money(u, e, r.locale(), h);
|
|
100
|
+
const w = a.number(u, r.locale(), h ?? { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
101
|
+
return s && !e && r.currencySymbol ? `${w} ${r.currencySymbol}` : w;
|
|
102
|
+
},
|
|
103
|
+
relative: (t, e = /* @__PURE__ */ new Date()) => {
|
|
104
|
+
const n = D(t);
|
|
105
|
+
return n ? a.relative(n, r.locale(), e) : "";
|
|
106
|
+
},
|
|
107
|
+
day: l,
|
|
108
|
+
when: (t, e = /* @__PURE__ */ new Date()) => {
|
|
109
|
+
const n = D(t);
|
|
110
|
+
if (!n) return "";
|
|
111
|
+
const m = r.translate;
|
|
112
|
+
if (!m) return a.dateTime(n, r.locale());
|
|
113
|
+
const s = Math.floor((e.getTime() - n.getTime()) / 6e4);
|
|
114
|
+
if (s >= 0 && s < 1) return m("core.when.just_now");
|
|
115
|
+
if (s >= 1 && s < 60) return m("core.when.minutes_ago", { n: s });
|
|
116
|
+
const u = (h) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + h), c = y(n);
|
|
117
|
+
return F(n, e) ? m("core.when.today_at", { time: c }) : F(n, u(-1)) ? m("core.when.yesterday_at", { time: c }) : F(n, u(1)) ? m("core.when.tomorrow_at", { time: c }) : m("core.when.date_at", { date: g(t), time: c });
|
|
118
|
+
},
|
|
119
|
+
dayTime: (t, e) => {
|
|
120
|
+
const n = l(t, e);
|
|
121
|
+
return n ? `${n} · ${d(t)}` : "";
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const [C, V] = x("vue-core.formatting");
|
|
126
|
+
function G(r, a) {
|
|
127
|
+
r.provide(C, a);
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
O as a,
|
|
131
|
+
P as c,
|
|
132
|
+
C as f,
|
|
133
|
+
G as i,
|
|
134
|
+
D as t,
|
|
135
|
+
V as u
|
|
136
|
+
};
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -376,6 +376,18 @@ export type CoreMessages = {
|
|
|
376
376
|
views: Texts<"all" | "failed">;
|
|
377
377
|
};
|
|
378
378
|
};
|
|
379
|
+
/** `PhaseTrack`: where a record stands in its process. */
|
|
380
|
+
stepper: Texts<"step_of" | "history" | "current" | "completed">;
|
|
381
|
+
/** `NextStepPanel`; `menu_hint` is for the note an application writes under the action (`{action}`, or `{first}` and `{second}`). */
|
|
382
|
+
next_step: Texts<"title" | "menu_hint" | "menu_hint_many">;
|
|
383
|
+
/** `RequirementList`. */
|
|
384
|
+
requirements: Texts<"all_met" | "met" | "not_met">;
|
|
385
|
+
/** `TodoRow`: the state a screen reader hears. */
|
|
386
|
+
todo_state: Texts<"done" | "missing" | "waiting" | "optional">;
|
|
387
|
+
/** `PhaseTiles`. */
|
|
388
|
+
phase_tiles: Texts<"position" | "timeline" | "done" | "current" | "skipped">;
|
|
389
|
+
/** `format.when`: a moment as people say it; `{n}` minutes, `{time}` as HH:mm, `{date}` as the application writes dates. */
|
|
390
|
+
when: Texts<"just_now" | "minutes_ago" | "today_at" | "yesterday_at" | "tomorrow_at" | "date_at">;
|
|
379
391
|
startup: {
|
|
380
392
|
title: string;
|
|
381
393
|
session: string;
|
|
@@ -397,8 +409,8 @@ export declare const coreMessages: {
|
|
|
397
409
|
readonly "sr-Latn": CoreMessages;
|
|
398
410
|
};
|
|
399
411
|
export type CoreLocale = keyof typeof coreMessages;
|
|
400
|
-
export { localeMessages } from "./messages";
|
|
401
|
-
export type { LocaleMessagesOptions, MessageLoader, MessageNamespace, Messages } from "./messages";
|
|
412
|
+
export { localeMessages, messageLoaders } from "./messages";
|
|
413
|
+
export type { LocaleFiles, LocaleMessagesOptions, MessageLoader, MessageNamespace, Messages } from "./messages";
|
|
402
414
|
export { createMessageRuntime } from "./runtime";
|
|
403
415
|
export type { MessageFailure, MessageRuntime, MessageRuntimeOptions, MessageTarget } from "./runtime";
|
|
404
416
|
export { fieldMessageWith, useServerMessages } from "./serverMessages";
|