pangea-lib 1.16.13 → 1.17.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/main.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var mp = Object.defineProperty;
2
2
  var dp = (e, c, a) => c in e ? mp(e, c, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[c] = a;
3
3
  var U = (e, c, a) => (dp(e, typeof c != "symbol" ? c + "" : c, a), a);
4
- import { defineComponent as A1, openBlock as N, createElementBlock as I, normalizeClass as x1, renderSlot as o1, computed as Y, resolveComponent as w3, normalizeStyle as O2, createBlock as b1, withModifiers as b0, createElementVNode as z1, toDisplayString as G1, createCommentVNode as q, watch as X2, h as h6, unref as y, createVNode as b2, mergeModels as i0, useModel as Q8, withCtx as y1, Fragment as k1, renderList as q1, version as vp, ref as a1, shallowRef as Ft, onMounted as y2, onUnmounted as L0, toRaw as S7, nextTick as K2, isProxy as Ot, reactive as y0, useSlots as Y4, toRef as n0, mergeProps as g2, isRef as Lc, createSlots as S2, normalizeProps as V2, guardReactiveProps as R2, resolveDynamicComponent as J8, Teleport as pp, Transition as C6, render as yc, createTextVNode as W3, onBeforeUpdate as zp, withDirectives as U6, vShow as H8, withKeys as Hp, getCurrentScope as Mp, onScopeDispose as gp, useCssVars as Vp } from "vue";
4
+ import { defineComponent as A1, openBlock as N, createElementBlock as I, normalizeClass as x1, renderSlot as o1, computed as Y, resolveComponent as w3, normalizeStyle as O2, createBlock as b1, withModifiers as b0, createElementVNode as z1, toDisplayString as G1, createCommentVNode as q, watch as X2, h as h6, unref as y, createVNode as b2, ref as a1, mergeModels as i0, useModel as Q8, withCtx as y1, Fragment as k1, renderList as q1, version as vp, shallowRef as Ft, onMounted as y2, onUnmounted as L0, toRaw as S7, nextTick as K2, isProxy as Ot, reactive as y0, useSlots as Y4, toRef as n0, mergeProps as g2, isRef as Lc, createSlots as S2, normalizeProps as V2, guardReactiveProps as R2, resolveDynamicComponent as J8, Teleport as pp, Transition as C6, render as yc, createTextVNode as W3, onBeforeUpdate as zp, withDirectives as U6, vShow as H8, withKeys as Hp, getCurrentScope as Mp, onScopeDispose as gp, useCssVars as Vp } from "vue";
5
5
  import { defineStore as Cp } from "pinia";
6
6
  const xc = {
7
7
  colors: {
@@ -14066,18 +14066,17 @@ const g61 = /* @__PURE__ */ h3(M61, [["__scopeId", "data-v-68e8fb55"]]), V61 = {
14066
14066
  PgaModal: C61
14067
14067
  };
14068
14068
  function L61(e, c) {
14069
- return Cp({
14070
- id: e,
14071
- state: () => ({
14072
- currentLanguage: c
14073
- }),
14074
- actions: {
14075
- setLanguage(a) {
14076
- this.currentLanguage = a;
14069
+ return Cp(
14070
+ e,
14071
+ () => {
14072
+ const a = a1(c);
14073
+ function t(i) {
14074
+ a.value = i;
14077
14075
  }
14076
+ return { currentLanguage: a, setLanguage: t };
14078
14077
  },
14079
- persist: !0
14080
- });
14078
+ { persist: !0 }
14079
+ );
14081
14080
  }
14082
14081
  function y61(e, c, a) {
14083
14082
  const t = L61(e, c);
@@ -2,11 +2,16 @@ export type Props = {
2
2
  [prop: string]: string | number;
3
3
  count?: number;
4
4
  };
5
- export declare function createI18n(storeId: string, defaultLanguage: string, messages: any): {
6
- useI18nStore: import('pinia').StoreDefinition<string, {
7
- currentLanguage: string;
8
- }, {}, {
9
- setLanguage(language: string): void;
10
- }>;
11
- useI18n: (fileName: string) => (messageKey: string, props?: Props) => string;
5
+ export declare function createI18n<L extends string, M extends Record<string, Record<L, Record<string, string>>>>(storeId: string, defaultLanguage: L, messages: M): {
6
+ useI18nStore: import('pinia').StoreDefinition<string, import('pinia')._UnwrapAll<Pick<{
7
+ currentLanguage: import('vue').Ref<import('vue').UnwrapRef<L>>;
8
+ setLanguage: (language: import('vue').UnwrapRef<L>) => void;
9
+ }, "currentLanguage">>, Pick<{
10
+ currentLanguage: import('vue').Ref<import('vue').UnwrapRef<L>>;
11
+ setLanguage: (language: import('vue').UnwrapRef<L>) => void;
12
+ }, never>, Pick<{
13
+ currentLanguage: import('vue').Ref<import('vue').UnwrapRef<L>>;
14
+ setLanguage: (language: import('vue').UnwrapRef<L>) => void;
15
+ }, "setLanguage">>;
16
+ useI18n: <FN extends keyof M>(fileName: FN) => <MK extends keyof M[FN][L]>(messageKey: MK, props?: Props) => string;
12
17
  };
@@ -1,5 +1,23 @@
1
- export declare const useI18nStore: import('pinia').StoreDefinition<string, {
2
- currentLanguage: string;
3
- }, {}, {
4
- setLanguage(language: string): void;
5
- }>, useI18n: (fileName: string) => (messageKey: string, props?: import('./create-i18n').Props) => string;
1
+ export declare const useI18nStore: import('pinia').StoreDefinition<string, import('pinia')._UnwrapAll<Pick<{
2
+ currentLanguage: import('vue').Ref<"es">;
3
+ setLanguage: (language: "es") => void;
4
+ }, "currentLanguage">>, Pick<{
5
+ currentLanguage: import('vue').Ref<"es">;
6
+ setLanguage: (language: "es") => void;
7
+ }, never>, Pick<{
8
+ currentLanguage: import('vue').Ref<"es">;
9
+ setLanguage: (language: "es") => void;
10
+ }, "setLanguage">>, useI18n: <FN extends "PgaDatePicker" | "PgaModal">(fileName: FN) => <MK extends keyof {
11
+ PgaDatePicker: {
12
+ es: {
13
+ cancelBtn: string;
14
+ selectBtn: string;
15
+ };
16
+ };
17
+ PgaModal: {
18
+ es: {
19
+ cancelBtn: string;
20
+ acceptBtn: string;
21
+ };
22
+ };
23
+ }[FN]["es"]>(messageKey: MK, props?: import('./create-i18n').Props) => string;
@@ -1,5 +1,12 @@
1
- export declare function createI18nStore<L extends string>(id: string, defaultLanguage: L): import('pinia').StoreDefinition<string, {
2
- currentLanguage: L;
3
- }, {}, {
4
- setLanguage(language: L): void;
5
- }>;
1
+ import { UnwrapRef } from 'vue';
2
+
3
+ export declare function createI18nStore<L extends string>(id: string, defaultLanguage: L): import('pinia').StoreDefinition<string, import('pinia')._UnwrapAll<Pick<{
4
+ currentLanguage: import('vue').Ref<UnwrapRef<L>>;
5
+ setLanguage: (language: UnwrapRef<L>) => void;
6
+ }, "currentLanguage">>, Pick<{
7
+ currentLanguage: import('vue').Ref<UnwrapRef<L>>;
8
+ setLanguage: (language: UnwrapRef<L>) => void;
9
+ }, never>, Pick<{
10
+ currentLanguage: import('vue').Ref<UnwrapRef<L>>;
11
+ setLanguage: (language: UnwrapRef<L>) => void;
12
+ }, "setLanguage">>;
@@ -3,6 +3,6 @@ import { PangeaOptions } from './types/pangea-options';
3
3
 
4
4
  declare const _default: (app: App, userOptions?: PangeaOptions) => void;
5
5
  export default _default;
6
- export * from './i18n';
7
6
  export * from './helpers';
7
+ export * from './i18n';
8
8
  export * from './types';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-lib",
3
3
  "description": "",
4
- "version": "1.16.13",
4
+ "version": "1.17.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1,5 +0,0 @@
1
- import { default as messages } from './i18n.messages';
2
-
3
- export type Language = 'es';
4
- export type FileName = keyof typeof messages;
5
- export type MessageKey<T extends FileName> = keyof (typeof messages)[T][Language];