@dskripchenko/laravel-admin 1.43.0 → 1.44.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/.vite/manifest.json +2 -2
- package/dist/assets/app-CwIxrlX6.css +1 -0
- package/dist/assets/app-CxQTEfcf.js +44 -0
- package/dist/components/dashboard/GaugeWidget.vue.d.ts +1 -1
- package/dist/components/dashboard/StatWidget.vue.d.ts +9 -0
- package/dist/components/dashboard/chartGeometry.d.ts +2 -2
- package/dist/components/fields/repeaterOrder.test.d.ts +1 -0
- package/dist/components/hardcodedText.test.d.ts +1 -0
- package/dist/components/layouts/ResourceIndexLayout.vue.d.ts +8 -0
- package/dist/components/profile/ProfilePage.vue.d.ts +4 -4
- package/dist/components/resource/InlineEditCell.vue.d.ts +1 -1
- package/dist/components/resource/ResourceIndexPage.contract.test.d.ts +1 -0
- package/dist/components/resource/ResourceIndexPage.vue.d.ts +2 -2
- package/dist/components/resource/ResourceIndexRowClick.test.d.ts +1 -0
- package/dist/components/resource/reorder.d.ts +33 -0
- package/dist/components/resource/reorder.test.d.ts +1 -0
- package/dist/i18n-D77Oo6mM.js +89 -0
- package/dist/i18n-D77Oo6mM.js.map +1 -0
- package/dist/i18n-D98X6Xot.cjs +2 -0
- package/dist/i18n-D98X6Xot.cjs.map +1 -0
- package/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15357 -15057
- package/dist/index.mjs.map +1 -1
- package/dist/source-hash.txt +1 -1
- package/dist/stores/i18n.d.ts +17 -0
- package/dist/stores/resourceIndex.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/styles/tokens.guard.test.d.ts +1 -0
- package/dist/tinymce.cjs +1 -1
- package/dist/tinymce.mjs +1 -1
- package/package.json +3 -3
- package/dist/assets/app-By8uSJii.css +0 -1
- package/dist/assets/app-CIFUCoeu.js +0 -44
- package/dist/i18n-BxCQCcGB.cjs +0 -2
- package/dist/i18n-BxCQCcGB.cjs.map +0 -1
- package/dist/i18n-Vgxu-A6P.js +0 -66
- package/dist/i18n-Vgxu-A6P.js.map +0 -1
package/dist/i18n-BxCQCcGB.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const m=require("pinia"),i=require("vue");function v(e){try{return u().tr(e)}catch{return e}}function S(){if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang;try{const e=u().locale;if(e)return e}catch{}return"ru"}const u=m.defineStore("admin-i18n",()=>{const e=i.ref({}),n=i.ref("ru");function r(t){const c=t.translations;c&&typeof c=="object"&&(e.value={...c}),n.value=t.locale??"ru"}function o(t){e.value={...t}}function a(t,c={}){let s=e.value[t]??t;for(const[d,g]of Object.entries(c))s=s.replace(new RegExp(`:${d}`,"g"),String(g));return s}const l=t=>t in e.value;function f(t){return e.value[t]??t}return{messages:e,locale:n,hydrate:r,setMessages:o,t:a,tr:f,has:l,keys:i.computed(()=>Object.keys(e.value))}});function p(e,n){try{return u().t(e,n??{})}catch{let r=e;for(const[o,a]of Object.entries(n??{}))r=r.replace(new RegExp(`:${o}`,"g"),String(a));return r}}exports.currentLocale=S;exports.tRaw=p;exports.trSafe=v;exports.useI18nStore=u;
|
|
2
|
-
//# sourceMappingURL=i18n-BxCQCcGB.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-BxCQCcGB.cjs","sources":["../resources/ts/stores/i18n.ts"],"sourcesContent":["/**\n * The i18n store — a plain message bag plus the t() helper.\n *\n * The backend puts the bag into `bootstrap.translations`, a\n * Record<key, string>. When the locale changes (`/system/setLocale`) either\n * the bootstrap is raised again or the helper calls `loadLocale(locale)`,\n * which POSTs for the messages.\n *\n * The form:\n * t('admin.dashboard.add_widget') // 'Add widget'\n * t('admin.records.count', { n: 42 }) // 'Records: 42', interpolating :n\n *\n * The fallback: a key that is not found is returned as it is, which makes\n * missing translations easy to spot during development.\n */\nimport { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\nimport type { AdminBootstrap } from '../types/bootstrap'\n\n/**\n * A standalone wrapper around store.tr() for the components: it does not fall\n * over without an active Pinia (unit tests, SSR edges) and returns the source\n * string instead.\n */\nexport function trSafe(text: string): string {\n try {\n return useI18nStore().tr(text)\n } catch {\n return text\n }\n}\n\n/**\n * The panel's current language, for formatting — month names, numbers: the\n * document's lang, else the bootstrap locale, else Russian, the source\n * language.\n */\nexport function currentLocale(): string {\n // The locale store keeps <html lang> in step with a switch made in place.\n if (typeof document !== 'undefined' && document.documentElement.lang) {\n return document.documentElement.lang\n }\n try {\n const locale = useI18nStore().locale\n if (locale) return locale\n } catch {\n // no active Pinia\n }\n return 'ru'\n}\n\nexport const useI18nStore = defineStore('admin-i18n', () => {\n const messages = ref<Record<string, string>>({})\n const locale = ref<string>('ru')\n\n function hydrate(bootstrap: AdminBootstrap): void {\n // The backend may put the translations into the bootstrap.\n const t = (bootstrap as unknown as { translations?: Record<string, string> }).translations\n if (t && typeof t === 'object') {\n messages.value = { ...t }\n }\n locale.value = bootstrap.locale ?? 'ru'\n }\n\n function setMessages(next: Record<string, string>): void {\n messages.value = { ...next }\n }\n\n /**\n * Translates, supporting Laravel-style `:name` interpolation. A missing key\n * is returned as it is, which makes the gap visible.\n */\n function t(key: string, replace: Record<string, string | number> = {}): string {\n let str = messages.value[key] ?? key\n for (const [k, v] of Object.entries(replace)) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n return str\n }\n\n const has = (key: string): boolean => key in messages.value\n\n /**\n * Translates by a string key, JSON-style, where the key is the source string\n * in the development language. The backend mixes the current locale's JSON\n * translations — the host's lang/{locale}.json — into the bag. Without a\n * translation the string comes back untouched, with no interpolation.\n */\n function tr(text: string): string {\n return messages.value[text] ?? text\n }\n\n return {\n messages,\n locale,\n hydrate,\n setMessages,\n t,\n tr,\n has,\n keys: computed(() => Object.keys(messages.value)),\n }\n})\n\n/**\n * A convenience: the global t() for non-Vue contexts — utilities, services. In\n * a Vue component prefer `const { t } = useI18nStore()`.\n */\nexport function tRaw(key: string, replace?: Record<string, string | number>): string {\n try {\n return useI18nStore().t(key, replace ?? {})\n } catch {\n // Without an active Pinia — unit tests, a render before the\n // initialization — we return the source string with the values\n // substituted. This used to throw and take the whole component down: an\n // untranslated string beats an empty page.\n let str = key\n for (const [k, v] of Object.entries(replace ?? {})) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n\n return str\n }\n}\n"],"names":["trSafe","text","useI18nStore","currentLocale","locale","defineStore","messages","ref","hydrate","bootstrap","t","setMessages","next","key","replace","str","k","v","has","tr","computed","tRaw"],"mappings":"uDAwBO,SAASA,EAAOC,EAAsB,CAC3C,GAAI,CACF,OAAOC,EAAA,EAAe,GAAGD,CAAI,CAC/B,MAAQ,CACN,OAAOA,CACT,CACF,CAOO,SAASE,GAAwB,CAEtC,GAAI,OAAO,SAAa,KAAe,SAAS,gBAAgB,KAC9D,OAAO,SAAS,gBAAgB,KAElC,GAAI,CACF,MAAMC,EAASF,IAAe,OAC9B,GAAIE,EAAQ,OAAOA,CACrB,MAAQ,CAER,CACA,MAAO,IACT,CAEO,MAAMF,EAAeG,EAAAA,YAAY,aAAc,IAAM,CAC1D,MAAMC,EAAWC,EAAAA,IAA4B,EAAE,EACzCH,EAASG,EAAAA,IAAY,IAAI,EAE/B,SAASC,EAAQC,EAAiC,CAEhD,MAAMC,EAAKD,EAAmE,aAC1EC,GAAK,OAAOA,GAAM,WACpBJ,EAAS,MAAQ,CAAE,GAAGI,CAAAA,GAExBN,EAAO,MAAQK,EAAU,QAAU,IACrC,CAEA,SAASE,EAAYC,EAAoC,CACvDN,EAAS,MAAQ,CAAE,GAAGM,CAAA,CACxB,CAMA,SAASF,EAAEG,EAAaC,EAA2C,GAAY,CAC7E,IAAIC,EAAMT,EAAS,MAAMO,CAAG,GAAKA,EACjC,SAAW,CAACG,EAAGC,CAAC,IAAK,OAAO,QAAQH,CAAO,EACzCC,EAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,GAAI,GAAG,EAAG,OAAOC,CAAC,CAAC,EAEvD,OAAOF,CACT,CAEA,MAAMG,EAAOL,GAAyBA,KAAOP,EAAS,MAQtD,SAASa,EAAGlB,EAAsB,CAChC,OAAOK,EAAS,MAAML,CAAI,GAAKA,CACjC,CAEA,MAAO,CACL,SAAAK,EACA,OAAAF,EACA,QAAAI,EACA,YAAAG,EACA,EAAAD,EACA,GAAAS,EACA,IAAAD,EACA,KAAME,EAAAA,SAAS,IAAM,OAAO,KAAKd,EAAS,KAAK,CAAC,CAAA,CAEpD,CAAC,EAMM,SAASe,EAAKR,EAAaC,EAAmD,CACnF,GAAI,CACF,OAAOZ,IAAe,EAAEW,EAAKC,GAAW,CAAA,CAAE,CAC5C,MAAQ,CAKN,IAAIC,EAAMF,EACV,SAAW,CAACG,EAAGC,CAAC,IAAK,OAAO,QAAQH,GAAW,CAAA,CAAE,EAC/CC,EAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,GAAI,GAAG,EAAG,OAAOC,CAAC,CAAC,EAGvD,OAAOF,CACT,CACF"}
|
package/dist/i18n-Vgxu-A6P.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { defineStore as g } from "pinia";
|
|
2
|
-
import { ref as l, computed as v } from "vue";
|
|
3
|
-
function h(e) {
|
|
4
|
-
try {
|
|
5
|
-
return s().tr(e);
|
|
6
|
-
} catch {
|
|
7
|
-
return e;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
function S() {
|
|
11
|
-
if (typeof document < "u" && document.documentElement.lang)
|
|
12
|
-
return document.documentElement.lang;
|
|
13
|
-
try {
|
|
14
|
-
const e = s().locale;
|
|
15
|
-
if (e) return e;
|
|
16
|
-
} catch {
|
|
17
|
-
}
|
|
18
|
-
return "ru";
|
|
19
|
-
}
|
|
20
|
-
const s = g("admin-i18n", () => {
|
|
21
|
-
const e = l({}), n = l("ru");
|
|
22
|
-
function r(t) {
|
|
23
|
-
const c = t.translations;
|
|
24
|
-
c && typeof c == "object" && (e.value = { ...c }), n.value = t.locale ?? "ru";
|
|
25
|
-
}
|
|
26
|
-
function o(t) {
|
|
27
|
-
e.value = { ...t };
|
|
28
|
-
}
|
|
29
|
-
function u(t, c = {}) {
|
|
30
|
-
let a = e.value[t] ?? t;
|
|
31
|
-
for (const [m, d] of Object.entries(c))
|
|
32
|
-
a = a.replace(new RegExp(`:${m}`, "g"), String(d));
|
|
33
|
-
return a;
|
|
34
|
-
}
|
|
35
|
-
const f = (t) => t in e.value;
|
|
36
|
-
function i(t) {
|
|
37
|
-
return e.value[t] ?? t;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
messages: e,
|
|
41
|
-
locale: n,
|
|
42
|
-
hydrate: r,
|
|
43
|
-
setMessages: o,
|
|
44
|
-
t: u,
|
|
45
|
-
tr: i,
|
|
46
|
-
has: f,
|
|
47
|
-
keys: v(() => Object.keys(e.value))
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
function j(e, n) {
|
|
51
|
-
try {
|
|
52
|
-
return s().t(e, n ?? {});
|
|
53
|
-
} catch {
|
|
54
|
-
let r = e;
|
|
55
|
-
for (const [o, u] of Object.entries(n ?? {}))
|
|
56
|
-
r = r.replace(new RegExp(`:${o}`, "g"), String(u));
|
|
57
|
-
return r;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
j as a,
|
|
62
|
-
S as c,
|
|
63
|
-
h as t,
|
|
64
|
-
s as u
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=i18n-Vgxu-A6P.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-Vgxu-A6P.js","sources":["../resources/ts/stores/i18n.ts"],"sourcesContent":["/**\n * The i18n store — a plain message bag plus the t() helper.\n *\n * The backend puts the bag into `bootstrap.translations`, a\n * Record<key, string>. When the locale changes (`/system/setLocale`) either\n * the bootstrap is raised again or the helper calls `loadLocale(locale)`,\n * which POSTs for the messages.\n *\n * The form:\n * t('admin.dashboard.add_widget') // 'Add widget'\n * t('admin.records.count', { n: 42 }) // 'Records: 42', interpolating :n\n *\n * The fallback: a key that is not found is returned as it is, which makes\n * missing translations easy to spot during development.\n */\nimport { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\nimport type { AdminBootstrap } from '../types/bootstrap'\n\n/**\n * A standalone wrapper around store.tr() for the components: it does not fall\n * over without an active Pinia (unit tests, SSR edges) and returns the source\n * string instead.\n */\nexport function trSafe(text: string): string {\n try {\n return useI18nStore().tr(text)\n } catch {\n return text\n }\n}\n\n/**\n * The panel's current language, for formatting — month names, numbers: the\n * document's lang, else the bootstrap locale, else Russian, the source\n * language.\n */\nexport function currentLocale(): string {\n // The locale store keeps <html lang> in step with a switch made in place.\n if (typeof document !== 'undefined' && document.documentElement.lang) {\n return document.documentElement.lang\n }\n try {\n const locale = useI18nStore().locale\n if (locale) return locale\n } catch {\n // no active Pinia\n }\n return 'ru'\n}\n\nexport const useI18nStore = defineStore('admin-i18n', () => {\n const messages = ref<Record<string, string>>({})\n const locale = ref<string>('ru')\n\n function hydrate(bootstrap: AdminBootstrap): void {\n // The backend may put the translations into the bootstrap.\n const t = (bootstrap as unknown as { translations?: Record<string, string> }).translations\n if (t && typeof t === 'object') {\n messages.value = { ...t }\n }\n locale.value = bootstrap.locale ?? 'ru'\n }\n\n function setMessages(next: Record<string, string>): void {\n messages.value = { ...next }\n }\n\n /**\n * Translates, supporting Laravel-style `:name` interpolation. A missing key\n * is returned as it is, which makes the gap visible.\n */\n function t(key: string, replace: Record<string, string | number> = {}): string {\n let str = messages.value[key] ?? key\n for (const [k, v] of Object.entries(replace)) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n return str\n }\n\n const has = (key: string): boolean => key in messages.value\n\n /**\n * Translates by a string key, JSON-style, where the key is the source string\n * in the development language. The backend mixes the current locale's JSON\n * translations — the host's lang/{locale}.json — into the bag. Without a\n * translation the string comes back untouched, with no interpolation.\n */\n function tr(text: string): string {\n return messages.value[text] ?? text\n }\n\n return {\n messages,\n locale,\n hydrate,\n setMessages,\n t,\n tr,\n has,\n keys: computed(() => Object.keys(messages.value)),\n }\n})\n\n/**\n * A convenience: the global t() for non-Vue contexts — utilities, services. In\n * a Vue component prefer `const { t } = useI18nStore()`.\n */\nexport function tRaw(key: string, replace?: Record<string, string | number>): string {\n try {\n return useI18nStore().t(key, replace ?? {})\n } catch {\n // Without an active Pinia — unit tests, a render before the\n // initialization — we return the source string with the values\n // substituted. This used to throw and take the whole component down: an\n // untranslated string beats an empty page.\n let str = key\n for (const [k, v] of Object.entries(replace ?? {})) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n\n return str\n }\n}\n"],"names":["trSafe","text","useI18nStore","currentLocale","locale","defineStore","messages","ref","hydrate","bootstrap","t","setMessages","next","key","replace","str","k","v","has","tr","computed","tRaw"],"mappings":";;AAwBO,SAASA,EAAOC,GAAsB;AAC3C,MAAI;AACF,WAAOC,EAAA,EAAe,GAAGD,CAAI;AAAA,EAC/B,QAAQ;AACN,WAAOA;AAAA,EACT;AACF;AAOO,SAASE,IAAwB;AAEtC,MAAI,OAAO,WAAa,OAAe,SAAS,gBAAgB;AAC9D,WAAO,SAAS,gBAAgB;AAElC,MAAI;AACF,UAAMC,IAASF,IAAe;AAC9B,QAAIE,EAAQ,QAAOA;AAAA,EACrB,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAEO,MAAMF,IAAeG,EAAY,cAAc,MAAM;AAC1D,QAAMC,IAAWC,EAA4B,EAAE,GACzCH,IAASG,EAAY,IAAI;AAE/B,WAASC,EAAQC,GAAiC;AAEhD,UAAMC,IAAKD,EAAmE;AAC9E,IAAIC,KAAK,OAAOA,KAAM,aACpBJ,EAAS,QAAQ,EAAE,GAAGI,EAAAA,IAExBN,EAAO,QAAQK,EAAU,UAAU;AAAA,EACrC;AAEA,WAASE,EAAYC,GAAoC;AACvD,IAAAN,EAAS,QAAQ,EAAE,GAAGM,EAAA;AAAA,EACxB;AAMA,WAASF,EAAEG,GAAaC,IAA2C,IAAY;AAC7E,QAAIC,IAAMT,EAAS,MAAMO,CAAG,KAAKA;AACjC,eAAW,CAACG,GAAGC,CAAC,KAAK,OAAO,QAAQH,CAAO;AACzC,MAAAC,IAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,IAAI,GAAG,GAAG,OAAOC,CAAC,CAAC;AAEvD,WAAOF;AAAA,EACT;AAEA,QAAMG,IAAM,CAACL,MAAyBA,KAAOP,EAAS;AAQtD,WAASa,EAAGlB,GAAsB;AAChC,WAAOK,EAAS,MAAML,CAAI,KAAKA;AAAA,EACjC;AAEA,SAAO;AAAA,IACL,UAAAK;AAAA,IACA,QAAAF;AAAA,IACA,SAAAI;AAAA,IACA,aAAAG;AAAA,IACA,GAAAD;AAAA,IACA,IAAAS;AAAA,IACA,KAAAD;AAAA,IACA,MAAME,EAAS,MAAM,OAAO,KAAKd,EAAS,KAAK,CAAC;AAAA,EAAA;AAEpD,CAAC;AAMM,SAASe,EAAKR,GAAaC,GAAmD;AACnF,MAAI;AACF,WAAOZ,IAAe,EAAEW,GAAKC,KAAW,CAAA,CAAE;AAAA,EAC5C,QAAQ;AAKN,QAAIC,IAAMF;AACV,eAAW,CAACG,GAAGC,CAAC,KAAK,OAAO,QAAQH,KAAW,CAAA,CAAE;AAC/C,MAAAC,IAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,IAAI,GAAG,GAAG,OAAOC,CAAC,CAAC;AAGvD,WAAOF;AAAA,EACT;AACF;"}
|