@kong-ui-public/i18n 0.5.1-pr.518.1c0e93e.0 → 0.5.1-pr.518.916f129.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/i18n.es.js CHANGED
@@ -3301,7 +3301,7 @@ const pr = (e, t, n = !1) => {
3301
3301
  ...o,
3302
3302
  source: t
3303
3303
  };
3304
- return typeof n == "boolean" && n === !0 || typeof n != "boolean" && n.isGlobal === !0 ? (console.log("!!!!!!!!!!! global"), Ve = u) : console.log("!!!!!!!!!!! local"), u;
3304
+ return (typeof n == "boolean" && n === !0 || typeof n != "boolean" && n.isGlobal === !0) && (Ve = u), u;
3305
3305
  };
3306
3306
  function gr() {
3307
3307
  return Ve;
package/dist/i18n.umd.js CHANGED
@@ -19,4 +19,4 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
19
19
  Try polyfilling it using "@formatjs/intl-relativetimeformat"
20
20
  `,P.MISSING_INTL_API));try{return nr(e,t,i).format(n,r)}catch(o){e.onError(new I("Error formatting relative time.",e.locale,o))}return String(n)}var ar=["style","currency","currencyDisplay","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem"];function Ge(e,t,n){var r=e.locale,i=e.formats,a=e.onError;n===void 0&&(n={});var o=n.format,s=o&&ae(i,"number",o,a)||{},h=M(n,ar,s);return t(r,h)}function or(e,t,n,r){r===void 0&&(r={});try{return Ge(e,t,r).format(n)}catch(i){e.onError(new I("Error formatting number.",e.locale,i))}return String(n)}function sr(e,t,n,r){r===void 0&&(r={});try{return Ge(e,t,r).formatToParts(n)}catch(i){e.onError(new I("Error formatting number.",e.locale,i))}return[]}function ur(e){var t=e?e[Object.keys(e)[0]]:void 0;return typeof t=="string"}function hr(e){e.onWarn&&e.defaultRichTextElements&&ur(e.messages||{})&&e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
21
21
  Please consider using "@formatjs/cli" to pre-compile your messages for performance.
22
- For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function lr(e,t){var n=Vt(t),r=m(m({},jt),e),i=r.locale,a=r.defaultLocale,o=r.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&o?o(new Oe('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&o&&o(new Oe('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(o&&o(new Dt('"locale" was not configured, using "'.concat(a,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),hr(r),m(m({},r),{formatters:n,formatNumber:or.bind(null,r,n.getNumberFormat),formatNumberToParts:sr.bind(null,r,n.getNumberFormat),formatRelativeTime:ir.bind(null,r,n.getRelativeTimeFormat),formatDate:Xt.bind(null,r,n.getDateTimeFormat),formatDateToParts:zt.bind(null,r,n.getDateTimeFormat),formatTime:Zt.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:Wt.bind(null,r,n.getDateTimeFormat),formatTimeToParts:qt.bind(null,r,n.getDateTimeFormat),formatPlural:tr.bind(null,r,n.getPluralRules),formatMessage:Ce.bind(null,r,n),$t:Ce.bind(null,r,n),formatList:Kt.bind(null,r,n.getListFormat),formatListToParts:Fe.bind(null,r,n.getListFormat),formatDisplayName:Qt.bind(null,r,n.getDisplayNames)})}var fr=U;U.flatten=U,U.unflatten=Ve;function Ue(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function je(e){return e}function U(e,t){t=t||{};const n=t.delimiter||".",r=t.maxDepth,i=t.transformKey||je,a={};function o(s,h,l){l=l||1,Object.keys(s).forEach(function(u){const f=s[u],c=t.safe&&Array.isArray(f),p=Object.prototype.toString.call(f),b=Ue(f),E=p==="[object Object]"||p==="[object Array]",y=h?h+n+i(u):i(u);if(!c&&!b&&E&&Object.keys(f).length&&(!t.maxDepth||l<r))return o(f,y,l+1);a[y]=f})}return o(e),a}function Ve(e,t){t=t||{};const n=t.delimiter||".",r=t.overwrite||!1,i=t.transformKey||je,a={};if(Ue(e)||Object.prototype.toString.call(e)!=="[object Object]")return e;function s(u){const f=Number(u);return isNaN(f)||u.indexOf(".")!==-1||t.object?u:f}function h(u,f,c){return Object.keys(c).reduce(function(p,b){return p[u+n+b]=c[b],p},f)}function l(u){const f=Object.prototype.toString.call(u),c=f==="[object Array]",p=f==="[object Object]";if(u){if(c)return!u.length;if(p)return!Object.keys(u).length}else return!0}return e=Object.keys(e).reduce(function(u,f){const c=Object.prototype.toString.call(e[f]);return!(c==="[object Object]"||c==="[object Array]")||l(e[f])?(u[f]=e[f],u):h(f,u,U(e[f],t))},{}),Object.keys(e).forEach(function(u){const f=u.split(n).map(i);let c=s(f.shift()),p=s(f[0]),b=a;for(;p!==void 0;){if(c==="__proto__")return;const E=Object.prototype.toString.call(b[c]),y=E==="[object Object]"||E==="[object Array]";if(!r&&!y&&typeof b[c]<"u")return;(r&&!y||!r&&b[c]==null)&&(b[c]=typeof p=="number"&&!t.object?[]:{}),b=b[c],f.length>0&&(c=s(f.shift()),p=s(f[0]))}b[c]=Ve(e[u],t)}),a}const cr=Re();let ke;const mr=(e,t,n=!1)=>{const r=lr({...typeof n=="boolean"?null:n,locale:e,messages:fr.flatten(t,{safe:!0})},cr),{$t:i,...a}=r,o=a,u={t:(f,c,p)=>o.formatMessage({id:f},c,p),te:f=>!!o.messages[f],tm:f=>o.messages[f]||[],...o,source:t};return typeof n=="boolean"&&n===!0||typeof n!="boolean"&&n.isGlobal===!0?(console.log("!!!!!!!!!!! global"),ke=u):console.log("!!!!!!!!!!! local"),u};function pr(){return ke}const Xe=(e=null)=>D.defineComponent({name:"I18nT",props:{i18n:{type:Object,default:null},keypath:{type:String,required:!0},tag:{type:String,default:"span"}},setup(t,{slots:n}){const r=i=>{if(!i)return[];const a=/(\{[^}]+\})/g;return i.split(a).filter(Boolean)};return()=>{const i=Object.keys(n).filter(s=>s!=="_"),a=(e||t.i18n).messages[t.keypath].toString();let o=r(a);return o=o.filter(s=>s!==""),o.forEach((s,h)=>{if(!s.startsWith("{")&&!s.endsWith("}"))return;const l=s.replace(/[\{\}]/g,"");l==="0"&&n.default?o[h]=n.default():i.includes(l)&&n[l]&&(o[h]=n[l]())}),D.h(t.tag,t,o)}}}),gr={install(e,t){const{i18n:n}=t;e.component("I18nT",Xe(n))}};N.Translation=gr,N.createI18n=mr,N.i18nTComponent=Xe,N.useI18n=pr,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
22
+ For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function lr(e,t){var n=Vt(t),r=m(m({},jt),e),i=r.locale,a=r.defaultLocale,o=r.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&o?o(new Oe('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&o&&o(new Oe('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(o&&o(new Dt('"locale" was not configured, using "'.concat(a,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),hr(r),m(m({},r),{formatters:n,formatNumber:or.bind(null,r,n.getNumberFormat),formatNumberToParts:sr.bind(null,r,n.getNumberFormat),formatRelativeTime:ir.bind(null,r,n.getRelativeTimeFormat),formatDate:Xt.bind(null,r,n.getDateTimeFormat),formatDateToParts:zt.bind(null,r,n.getDateTimeFormat),formatTime:Zt.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:Wt.bind(null,r,n.getDateTimeFormat),formatTimeToParts:qt.bind(null,r,n.getDateTimeFormat),formatPlural:tr.bind(null,r,n.getPluralRules),formatMessage:Ce.bind(null,r,n),$t:Ce.bind(null,r,n),formatList:Kt.bind(null,r,n.getListFormat),formatListToParts:Fe.bind(null,r,n.getListFormat),formatDisplayName:Qt.bind(null,r,n.getDisplayNames)})}var fr=U;U.flatten=U,U.unflatten=Ve;function Ue(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function je(e){return e}function U(e,t){t=t||{};const n=t.delimiter||".",r=t.maxDepth,i=t.transformKey||je,a={};function o(s,h,l){l=l||1,Object.keys(s).forEach(function(u){const f=s[u],c=t.safe&&Array.isArray(f),p=Object.prototype.toString.call(f),b=Ue(f),E=p==="[object Object]"||p==="[object Array]",y=h?h+n+i(u):i(u);if(!c&&!b&&E&&Object.keys(f).length&&(!t.maxDepth||l<r))return o(f,y,l+1);a[y]=f})}return o(e),a}function Ve(e,t){t=t||{};const n=t.delimiter||".",r=t.overwrite||!1,i=t.transformKey||je,a={};if(Ue(e)||Object.prototype.toString.call(e)!=="[object Object]")return e;function s(u){const f=Number(u);return isNaN(f)||u.indexOf(".")!==-1||t.object?u:f}function h(u,f,c){return Object.keys(c).reduce(function(p,b){return p[u+n+b]=c[b],p},f)}function l(u){const f=Object.prototype.toString.call(u),c=f==="[object Array]",p=f==="[object Object]";if(u){if(c)return!u.length;if(p)return!Object.keys(u).length}else return!0}return e=Object.keys(e).reduce(function(u,f){const c=Object.prototype.toString.call(e[f]);return!(c==="[object Object]"||c==="[object Array]")||l(e[f])?(u[f]=e[f],u):h(f,u,U(e[f],t))},{}),Object.keys(e).forEach(function(u){const f=u.split(n).map(i);let c=s(f.shift()),p=s(f[0]),b=a;for(;p!==void 0;){if(c==="__proto__")return;const E=Object.prototype.toString.call(b[c]),y=E==="[object Object]"||E==="[object Array]";if(!r&&!y&&typeof b[c]<"u")return;(r&&!y||!r&&b[c]==null)&&(b[c]=typeof p=="number"&&!t.object?[]:{}),b=b[c],f.length>0&&(c=s(f.shift()),p=s(f[0]))}b[c]=Ve(e[u],t)}),a}const cr=Re();let ke;const mr=(e,t,n=!1)=>{const r=lr({...typeof n=="boolean"?null:n,locale:e,messages:fr.flatten(t,{safe:!0})},cr),{$t:i,...a}=r,o=a,u={t:(f,c,p)=>o.formatMessage({id:f},c,p),te:f=>!!o.messages[f],tm:f=>o.messages[f]||[],...o,source:t};return(typeof n=="boolean"&&n===!0||typeof n!="boolean"&&n.isGlobal===!0)&&(ke=u),u};function pr(){return ke}const Xe=(e=null)=>D.defineComponent({name:"I18nT",props:{i18n:{type:Object,default:null},keypath:{type:String,required:!0},tag:{type:String,default:"span"}},setup(t,{slots:n}){const r=i=>{if(!i)return[];const a=/(\{[^}]+\})/g;return i.split(a).filter(Boolean)};return()=>{const i=Object.keys(n).filter(s=>s!=="_"),a=(e||t.i18n).messages[t.keypath].toString();let o=r(a);return o=o.filter(s=>s!==""),o.forEach((s,h)=>{if(!s.startsWith("{")&&!s.endsWith("}"))return;const l=s.replace(/[\{\}]/g,"");l==="0"&&n.default?o[h]=n.default():i.includes(l)&&n[l]&&(o[h]=n[l]())}),D.h(t.tag,t,o)}}}),gr={install(e,t){const{i18n:n}=t;e.component("I18nT",Xe(n))}};N.Translation=gr,N.createI18n=mr,N.i18nTComponent=Xe,N.useI18n=pr,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAqB,gBAAgB,EAA+B,cAAc,EAAE,MAAM,SAAS,CAAA;AAS5H;;;;;;EAME;AACF,eAAO,MAAM,UAAU,sDACd,gBAAgB,oCAAmC,OAAO,GAAC,cAAc,+BA+CjF,CAAA;AAGD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,WAAW,CAAC,aAAa,CAAC,CAEvG"}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAqB,gBAAgB,EAA+B,cAAc,EAAE,MAAM,SAAS,CAAA;AAS5H;;;;;;EAME;AACF,eAAO,MAAM,UAAU,sDACd,gBAAgB,oCAAmC,OAAO,GAAC,cAAc,+BA4CjF,CAAA;AAGD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,WAAW,CAAC,aAAa,CAAC,CAEvG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/i18n",
3
- "version": "0.5.1-pr.518.1c0e93e.0",
3
+ "version": "0.5.1-pr.518.916f129.0",
4
4
  "type": "module",
5
5
  "main": "./dist/i18n.umd.js",
6
6
  "module": "./dist/i18n.es.js",