@onu-ui/utils
Advanced tools
Comparing version 1.1.2 to 1.1.3
import * as vue from 'vue'; | ||
import { Plugin, AppContext, Ref, InjectionKey, App, ComponentPublicInstance, VNode, VNodeTypes, Component, Slots, CSSProperties } from 'vue'; | ||
declare const _default$2: { | ||
name: string; | ||
locales: { | ||
empty: { | ||
emptyText: string; | ||
}; | ||
}; | ||
}; | ||
declare const _default$1: { | ||
name: string; | ||
locales: { | ||
empty: { | ||
emptyText: string; | ||
}; | ||
}; | ||
}; | ||
declare const _default: { | ||
name: string; | ||
locales: { | ||
empty: { | ||
emptyText: string; | ||
}; | ||
}; | ||
}; | ||
interface TranslatePair { | ||
[key: string]: string | string[] | TranslatePair; | ||
} | ||
interface language { | ||
name: string; | ||
locales: TranslatePair; | ||
} | ||
type SFCWithInstall<T> = T & Plugin; | ||
@@ -11,5 +46,38 @@ type SFCInstallWithContext<T> = SFCWithInstall<T> & { | ||
declare function withInstall<T, E extends Record<string, any>>(main: T, extra?: E): SFCWithInstall<T> & E; | ||
declare function withInstallFunction<T>(fn: T, name: string): SFCInstallWithContext<T>; | ||
interface InstallOptions { | ||
prefix?: string; | ||
namespace?: MaybeRef<string>; | ||
locale?: MaybeRef<language>; | ||
zIndex?: MaybeRef<number>; | ||
size?: MaybeRef<string>; | ||
} | ||
declare const configProviderContextKey = "__onu_config_provider"; | ||
/** | ||
* 获取全局配置 Hooks | ||
* @param key | ||
* @param defaultValue | ||
*/ | ||
declare function useGlobalConfig<T extends keyof InstallOptions, U extends InstallOptions[T]>(key: T, defaultValue?: U): Ref<Exclude<InstallOptions[T], undefined | U>>; | ||
declare function useGlobalConfig(): Ref<InstallOptions>; | ||
/** | ||
* 注入配置 | ||
* @param config | ||
* @param app | ||
* @param global | ||
*/ | ||
declare function provideGlobalConfig(config: MaybeRef<InstallOptions>, app?: App, global?: boolean): globalThis.ComputedRef<InstallOptions | Record<string, any>> | undefined; | ||
type OnuTranslatorOption = Record<string, string | number>; | ||
type OnuTranslator = (path: string, option?: OnuTranslatorOption) => string; | ||
interface OnuLocaleContext { | ||
locale: Ref<language>; | ||
lang: Ref<string>; | ||
t: OnuTranslator; | ||
} | ||
declare function translate(path: string, option: OnuTranslatorOption | undefined, locale: language): string; | ||
declare const buildTranslator: (locale: MaybeRef<language>) => OnuTranslator; | ||
declare function buildLocaleContext(locale: MaybeRef<language>): OnuLocaleContext; | ||
declare function useLocale(): OnuLocaleContext; | ||
declare function hash(str: string): string; | ||
@@ -31,2 +99,9 @@ /** | ||
declare const isServerRendering: boolean; | ||
declare function querySelector(selectors: string, container?: Document | HTMLElement): HTMLElement | undefined; | ||
declare function getElement(target: string | HTMLElement | undefined, container?: Document | HTMLElement): HTMLElement | undefined; | ||
/** for element eventListener */ | ||
declare const on: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, event: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void; | ||
declare const off: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, type: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void; | ||
declare const toTypeString: (v: any) => string; | ||
@@ -55,2 +130,7 @@ declare const isDef: <T = any>(val?: T) => val is T; | ||
declare function isScroll(el: HTMLElement, isVertical?: boolean): boolean; | ||
declare function getScrollContainer(el: HTMLElement, isVertical?: boolean): Window | HTMLElement | undefined; | ||
declare function getStyle(element: HTMLElement, styleName: keyof CSSProperties): string; | ||
declare function getChildrenArray(vn: VNode): VNode<vue.RendererNode, vue.RendererElement, { | ||
@@ -83,85 +163,5 @@ [key: string]: any; | ||
declare const isServerRendering: boolean; | ||
declare function querySelector(selectors: string, container?: Document | HTMLElement): HTMLElement | undefined; | ||
declare function getElement(target: string | HTMLElement | undefined, container?: Document | HTMLElement): HTMLElement | undefined; | ||
/** for element eventListener */ | ||
declare const on: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, event: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void; | ||
declare const off: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, type: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void; | ||
declare function withInstall<T, E extends Record<string, any>>(main: T, extra?: E): SFCWithInstall<T> & E; | ||
declare function withInstallFunction<T>(fn: T, name: string): SFCInstallWithContext<T>; | ||
declare function isScroll(el: HTMLElement, isVertical?: boolean): boolean; | ||
declare function getScrollContainer(el: HTMLElement, isVertical?: boolean): Window | HTMLElement | undefined; | ||
declare function getStyle(element: HTMLElement, styleName: keyof CSSProperties): string; | ||
declare const _default$2: { | ||
name: string; | ||
locales: { | ||
empty: { | ||
emptyText: string; | ||
}; | ||
}; | ||
}; | ||
declare const _default$1: { | ||
name: string; | ||
locales: { | ||
empty: { | ||
emptyText: string; | ||
}; | ||
}; | ||
}; | ||
declare const _default: { | ||
name: string; | ||
locales: { | ||
empty: { | ||
emptyText: string; | ||
}; | ||
}; | ||
}; | ||
interface TranslatePair { | ||
[key: string]: string | string[] | TranslatePair; | ||
} | ||
interface language { | ||
name: string; | ||
locales: TranslatePair; | ||
} | ||
interface InstallOptions { | ||
prefix?: string; | ||
namespace?: MaybeRef<string>; | ||
locale?: MaybeRef<language>; | ||
zIndex?: MaybeRef<number>; | ||
size?: MaybeRef<string>; | ||
} | ||
declare const configProviderContextKey = "__onu_config_provider"; | ||
/** | ||
* 获取全局配置 Hooks | ||
* @param key | ||
* @param defaultValue | ||
*/ | ||
declare function useGlobalConfig<T extends keyof InstallOptions, U extends InstallOptions[T]>(key: T, defaultValue?: U): Ref<Exclude<InstallOptions[T], undefined | U>>; | ||
declare function useGlobalConfig(): Ref<InstallOptions>; | ||
/** | ||
* 注入配置 | ||
* @param config | ||
* @param app | ||
* @param global | ||
*/ | ||
declare function provideGlobalConfig(config: MaybeRef<InstallOptions>, app?: App, global?: boolean): vue.ComputedRef<Record<string, any> | InstallOptions> | undefined; | ||
type OnuTranslatorOption = Record<string, string | number>; | ||
type OnuTranslator = (path: string, option?: OnuTranslatorOption) => string; | ||
interface OnuLocaleContext { | ||
locale: Ref<language>; | ||
lang: Ref<string>; | ||
t: OnuTranslator; | ||
} | ||
declare function translate(path: string, option: OnuTranslatorOption | undefined, locale: language): string; | ||
declare const buildTranslator: (locale: MaybeRef<language>) => OnuTranslator; | ||
declare function buildLocaleContext(locale: MaybeRef<language>): OnuLocaleContext; | ||
declare function useLocale(): OnuLocaleContext; | ||
export { type DeepPartial, type InstallOptions, type MaybeRef, type OnuLocaleContext, type OnuTranslator, type OnuTranslatorOption, type ProvideFn, type SFCInstallWithContext, type SFCWithInstall, type TranslatePair, buildLocaleContext, buildTranslator, configProviderContextKey, deepGet, deepMerge, _default$2 as en, generateId, getChildrenArray, getElement, getFirstElementFromChildren, getFirstElementFromVNode, getScrollContainer, getStyle, hash, isArray, isArrayChildren, isBoolean, isComponent, isComponentInstance, isDate, isDef, isElement, isEmptyChildren, isFunction, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isScroll, isServerRendering, isSet, isSlotsChildren, isString, isSymbol, isText, isValue, type language, mergeFirstChild, mergeObjects, off, on, provideGlobalConfig, _default$1 as pt, querySelector, toTypeString, translate, useGlobalConfig, useLocale, withInstall, withInstallFunction, _default as zhCn }; |
@@ -1,1 +0,1 @@ | ||
var S=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},O=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of G(t))!Y.call(e,o)&&o!==n&&S(e,o,{get:()=>t[o],enumerable:!(r=B(t,o))||r.enumerable});return e},s=(e,t,n)=>(O(e,t,"default"),n&&O(n,t,"default"));function ve(e,t){if(e.install=n=>{for(let r of[e,...Object.values(t!=null?t:{})])n.component(r.name,r)},t)for(let[n,r]of Object.entries(t))e[n]=r;return e}function he(e,t){return e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e}var m=e=>Object.prototype.toString.call(e),xe=e=>typeof e!="undefined",be=e=>typeof e=="boolean",d=e=>typeof e=="function",we=e=>typeof e=="number",E=e=>typeof e=="string";function a(e){return e!==null&&typeof e=="object"}function Te(e){return m(e)==="[object Object]"}var l=Array.isArray;function Oe(e){return m(e)==="[object Map]"}function Se(e){return m(e)==="[object Set]"}var Ee=e=>e instanceof Date,Me=e=>e instanceof RegExp,Ae=e=>typeof e=="symbol",Ce=e=>a(e)&&d(e.then)&&d(e.catch),Pe=e=>e!=null,Le=e=>(e==null?void 0:e.$)!==void 0,y=(e,t)=>!!(e&&e.shapeFlag&6),v=e=>!!(e&&e.shapeFlag&1),Ie=(e,t)=>!!(e&&e.shapeFlag&8),Fe=(e,t)=>!!(e&&e.shapeFlag&32),M=(e,t)=>!!(e&&e.shapeFlag&16);function De(e){let t,n,r=2166136261;for(t=0,n=e.length;t<n;t++)r^=e.charCodeAt(t),r+=(r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24);return`00000${(r>>>0).toString(36)}`.slice(-6)}var _e=()=>Math.floor(Math.random()*1e4);function A(e,t){let n=[...new Set([...Object.keys(e),...Object.keys(t)])],r={};return n.forEach(o=>{var u;r[o]=(u=t[o])!=null?u:e[o]}),r}function C(e,t,n){if(!Array.isArray(t)&&typeof t!="string")throw new TypeError("path must be string or array");if(e===null)return n;let r=t;typeof t=="string"&&(t=t.replace(/\[(\w*)\]/g,".$1"),t=t.startsWith(".")?t.slice(1):t,r=t.split("."));let o=0,u;for(;e!==null&&o<r.length;)u=r[o++],e=e[u];return o===r.length?e:n}function K(e,t){let n=e,r=t;if(l(n)&&l(r))return[...n,...r];if(l(n))return[...n];let o={...n};return a(n)&&a(r)&&Object.keys(r).forEach(u=>{a(r[u])?u in n?o[u]=K(n[u],r[u]):Object.assign(o,{[u]:r[u]}):Object.assign(o,{[u]:r[u]})}),o}import{cloneVNode as q}from"vue";function P(e){if(M(e,e.children))return e.children;if(l(e))return e}function Z(e){if(e&&e.length>0)for(let t of e){let n=L(t);if(n)return n}}function L(e){var t;if(v(e))return e.el;if(y(e)){if(e.el.nodeType===1)return e.el;if((t=e.component)!=null&&t.subTree){let n=L(e.component.subTree);if(n)return n}}else{let n=P(e);return Z(n)}}function X(e,t){if(e&&e.length>0)for(let n=0;n<e.length;n++){let r=e[n];if(v(r)||y(r)){let u=d(t)?t(r):t;return e[n]=q(r,u,!0),!0}let o=P(r);if(o&&o.length>0&&X(o,t))return!0}return!1}function He(e){if(!e)return!0;for(let t of e)if(t.children)return!1;return!0}var h=(()=>{try{return!(typeof window!="undefined"&&document!==void 0)}catch(e){return!0}})();function I(){}function J(e,t){var n;return h?void 0:(n=(t!=null?t:document).querySelector(e))!=null?n:void 0}function Ue(e,t){if(E(e)){let n=e[0]==="#"?`[id='${e.slice(1)}']`:e;return J(n,t)}return e}var Be=h?I:(e,t,n,r=!1)=>{e.addEventListener(t,n,r)},Ge=h?I:(e,t,n,r=!1)=>{e.removeEventListener(t,n,r)};var i={};z(i,{Vue:()=>Q,Vue2:()=>ee,del:()=>ne,install:()=>te,isVue2:()=>F,isVue3:()=>R,set:()=>N});s(i,ze);import*as Q from"vue";import*as ze from"vue";var F=!1,R=!0,ee=void 0;function te(){}function N(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function ne(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}var c=typeof window!="undefined"&&typeof document!="undefined",qe=typeof WorkerGlobalScope!="undefined"&&globalThis instanceof WorkerGlobalScope;function D(e){let t=Object.create(null);return n=>t[n]||(t[n]=e(n))}var re=/\B([A-Z])/g,Ze=D(e=>e.replace(re,"-$1").toLowerCase()),oe=/-(\w)/g,Xe=D(e=>e.replace(oe,(t,n)=>n?n.toUpperCase():""));import{camelize as ie}from"vue";function _(e,t){var r;if(!c||!e||!t)return"";let n=ie(t);n==="float"&&(n="cssFloat");try{let o=e.style[n];if(o)return o;let u=(r=document.defaultView)==null?void 0:r.getComputedStyle(e,"");return u?u[n]:""}catch(o){return e.style[n]}}function ue(e,t){if(!c)return!1;let n={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)],r=_(e,n);return["scroll","auto","overlay"].some(o=>r.includes(o))}function ot(e,t){if(!c)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(ue(n,t))return n;n=n.parentNode}return n}var g={name:"en",locales:{empty:{emptyText:"No data"}}};var se={name:"pt",locales:{empty:{emptyText:"Sem dados"}}};var le={name:"zh-cn",locales:{empty:{emptyText:"\u6682\u65E0\u6570\u636E"}}};var f="__onu_config_provider";import{computed as k,getCurrentInstance as V,inject as ae,provide as j,ref as H,unref as W}from"vue";var x=H();function b(e,t=void 0){let n=V(),r=ae(f);return W(r)||(r=H(n?n.appContext.provides[f]:x.value),j(f,r)),e?k(()=>{var o,u;return(u=(o=r.value)==null?void 0:o[e])!=null?u:t}):r}function ht(e,t,n=!1){var w;let r=!!V(),o=r?b():void 0,u=(w=t==null?void 0:t.provide)!=null?w:r?j:void 0;if(!u)return;let p=k(()=>{let T=W(e);return o!=null&&o.value?A(o.value,T):T});return u(f,p),(n||!x.value)&&(x.value=p.value),p}import{computed as $,isRef as ce,ref as fe,unref as U}from"vue";function de(e,t,n){return C(n,e,e).replace(/\{(\w+)\}/g,(r,o)=>{var u;return`${(u=t==null?void 0:t[o])!=null?u:`{${o}}`}`})}var pe=e=>(t,n)=>de(t,n,U(e));function me(e){let t=$(()=>U(e).name);return{locale:ce(e)?e:fe(e),lang:t,t:pe(e)}}function Ot(){let e=b("locale");return me($(()=>e.value||g))}export{me as buildLocaleContext,pe as buildTranslator,f as configProviderContextKey,C as deepGet,K as deepMerge,g as en,_e as generateId,P as getChildrenArray,Ue as getElement,Z as getFirstElementFromChildren,L as getFirstElementFromVNode,ot as getScrollContainer,_ as getStyle,De as hash,l as isArray,M as isArrayChildren,be as isBoolean,y as isComponent,Le as isComponentInstance,Ee as isDate,xe as isDef,v as isElement,He as isEmptyChildren,d as isFunction,Oe as isMap,we as isNumber,a as isObject,Te as isPlainObject,Ce as isPromise,Me as isRegExp,ue as isScroll,h as isServerRendering,Se as isSet,Fe as isSlotsChildren,E as isString,Ae as isSymbol,Ie as isText,Pe as isValue,X as mergeFirstChild,A as mergeObjects,Ge as off,Be as on,ht as provideGlobalConfig,se as pt,J as querySelector,m as toTypeString,de as translate,b as useGlobalConfig,Ot as useLocale,ve as withInstall,he as withInstallFunction,le as zhCn}; | ||
var S=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},O=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of G(t))!Y.call(e,o)&&o!==n&&S(e,o,{get:()=>t[o],enumerable:!(r=B(t,o))||r.enumerable});return e},s=(e,t,n)=>(O(e,t,"default"),n&&O(n,t,"default"));import{computed as k,getCurrentInstance as V,inject as se,provide as j,ref as H,unref as W}from"vue";var m=e=>Object.prototype.toString.call(e),ve=e=>typeof e!="undefined",he=e=>typeof e=="boolean",d=e=>typeof e=="function",ge=e=>typeof e=="number",E=e=>typeof e=="string";function a(e){return e!==null&&typeof e=="object"}function xe(e){return m(e)==="[object Object]"}var l=Array.isArray;function be(e){return m(e)==="[object Map]"}function we(e){return m(e)==="[object Set]"}var Te=e=>e instanceof Date,Oe=e=>e instanceof RegExp,Se=e=>typeof e=="symbol",Ee=e=>a(e)&&d(e.then)&&d(e.catch),Me=e=>e!=null,Ae=e=>(e==null?void 0:e.$)!==void 0,y=(e,t)=>!!(e&&e.shapeFlag&6),v=e=>!!(e&&e.shapeFlag&1),Ce=(e,t)=>!!(e&&e.shapeFlag&8),Pe=(e,t)=>!!(e&&e.shapeFlag&32),M=(e,t)=>!!(e&&e.shapeFlag&16);function Fe(e){let t,n,r=2166136261;for(t=0,n=e.length;t<n;t++)r^=e.charCodeAt(t),r+=(r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24);return`00000${(r>>>0).toString(36)}`.slice(-6)}var Re=()=>Math.floor(Math.random()*1e4);function A(e,t){let n=[...new Set([...Object.keys(e),...Object.keys(t)])],r={};return n.forEach(o=>{var u;r[o]=(u=t[o])!=null?u:e[o]}),r}function C(e,t,n){if(!Array.isArray(t)&&typeof t!="string")throw new TypeError("path must be string or array");if(e===null)return n;let r=t;typeof t=="string"&&(t=t.replace(/\[(\w*)\]/g,".$1"),t=t.startsWith(".")?t.slice(1):t,r=t.split("."));let o=0,u;for(;e!==null&&o<r.length;)u=r[o++],e=e[u];return o===r.length?e:n}function K(e,t){let n=e,r=t;if(l(n)&&l(r))return[...n,...r];if(l(n))return[...n];let o={...n};return a(n)&&a(r)&&Object.keys(r).forEach(u=>{a(r[u])?u in n?o[u]=K(n[u],r[u]):Object.assign(o,{[u]:r[u]}):Object.assign(o,{[u]:r[u]})}),o}var h=(()=>{try{return!(typeof window!="undefined"&&document!==void 0)}catch(e){return!0}})();function P(){}function q(e,t){var n;return h?void 0:(n=(t!=null?t:document).querySelector(e))!=null?n:void 0}function _e(e,t){if(E(e)){let n=e[0]==="#"?`[id='${e.slice(1)}']`:e;return q(n,t)}return e}var ke=h?P:(e,t,n,r=!1)=>{e.addEventListener(t,n,r)},Ve=h?P:(e,t,n,r=!1)=>{e.removeEventListener(t,n,r)};var i={};z(i,{Vue:()=>Z,Vue2:()=>X,del:()=>Q,install:()=>J,isVue2:()=>L,isVue3:()=>I,set:()=>F});s(i,He);import*as Z from"vue";import*as He from"vue";var L=!1,I=!0,X=void 0;function J(){}function F(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function Q(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}var c=typeof window!="undefined"&&typeof document!="undefined",$e=typeof WorkerGlobalScope!="undefined"&&globalThis instanceof WorkerGlobalScope;function R(e){let t=Object.create(null);return n=>t[n]||(t[n]=e(n))}var ee=/\B([A-Z])/g,Ue=R(e=>e.replace(ee,"-$1").toLowerCase()),te=/-(\w)/g,Be=R(e=>e.replace(te,(t,n)=>n?n.toUpperCase():""));import{camelize as ne}from"vue";function N(e,t){var r;if(!c||!e||!t)return"";let n=ne(t);n==="float"&&(n="cssFloat");try{let o=e.style[n];if(o)return o;let u=(r=document.defaultView)==null?void 0:r.getComputedStyle(e,"");return u?u[n]:""}catch(o){return e.style[n]}}function re(e,t){if(!c)return!1;let n={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)],r=N(e,n);return["scroll","auto","overlay"].some(o=>r.includes(o))}function Xe(e,t){if(!c)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(re(n,t))return n;n=n.parentNode}return n}import{cloneVNode as oe}from"vue";function D(e){if(M(e,e.children))return e.children;if(l(e))return e}function ie(e){if(e&&e.length>0)for(let t of e){let n=_(t);if(n)return n}}function _(e){var t;if(v(e))return e.el;if(y(e)){if(e.el.nodeType===1)return e.el;if((t=e.component)!=null&&t.subTree){let n=_(e.component.subTree);if(n)return n}}else{let n=D(e);return ie(n)}}function ue(e,t){if(e&&e.length>0)for(let n=0;n<e.length;n++){let r=e[n];if(v(r)||y(r)){let u=d(t)?t(r):t;return e[n]=oe(r,u,!0),!0}let o=D(r);if(o&&o.length>0&&ue(o,t))return!0}return!1}function tt(e){if(!e)return!0;for(let t of e)if(t.children)return!1;return!0}var f="__onu_config_provider";var g=H();function x(e,t=void 0){let n=V(),r=se(f);return W(r)||(r=H(n?n.appContext.provides[f]:g.value),j(f,r)),e?k(()=>{var o,u;return(u=(o=r.value)==null?void 0:o[e])!=null?u:t}):r}function st(e,t,n=!1){var w;let r=!!V(),o=r?x():void 0,u=(w=t==null?void 0:t.provide)!=null?w:r?j:void 0;if(!u)return;let p=k(()=>{let T=W(e);return o!=null&&o.value?A(o.value,T):T});return u(f,p),(n||!g.value)&&(g.value=p.value),p}import{computed as $,isRef as ce,ref as fe,unref as U}from"vue";var b={name:"en",locales:{empty:{emptyText:"No data"}}};var le={name:"pt",locales:{empty:{emptyText:"Sem dados"}}};var ae={name:"zh-cn",locales:{empty:{emptyText:"\u6682\u65E0\u6570\u636E"}}};function de(e,t,n){return C(n,e,e).replace(/\{(\w+)\}/g,(r,o)=>{var u;return`${(u=t==null?void 0:t[o])!=null?u:`{${o}}`}`})}var pe=e=>(t,n)=>de(t,n,U(e));function me(e){let t=$(()=>U(e).name);return{locale:ce(e)?e:fe(e),lang:t,t:pe(e)}}function bt(){let e=x("locale");return me($(()=>e.value||b))}function Tt(e,t){if(e.install=n=>{for(let r of[e,...Object.values(t!=null?t:{})])n.component(r.name,r)},t)for(let[n,r]of Object.entries(t))e[n]=r;return e}function Ot(e,t){return e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e}export{me as buildLocaleContext,pe as buildTranslator,f as configProviderContextKey,C as deepGet,K as deepMerge,b as en,Re as generateId,D as getChildrenArray,_e as getElement,ie as getFirstElementFromChildren,_ as getFirstElementFromVNode,Xe as getScrollContainer,N as getStyle,Fe as hash,l as isArray,M as isArrayChildren,he as isBoolean,y as isComponent,Ae as isComponentInstance,Te as isDate,ve as isDef,v as isElement,tt as isEmptyChildren,d as isFunction,be as isMap,ge as isNumber,a as isObject,xe as isPlainObject,Ee as isPromise,Oe as isRegExp,re as isScroll,h as isServerRendering,we as isSet,Pe as isSlotsChildren,E as isString,Se as isSymbol,Ce as isText,Me as isValue,ue as mergeFirstChild,A as mergeObjects,Ve as off,ke as on,st as provideGlobalConfig,le as pt,q as querySelector,m as toTypeString,de as translate,x as useGlobalConfig,bt as useLocale,Tt as withInstall,Ot as withInstallFunction,ae as zhCn}; |
{ | ||
"name": "@onu-ui/utils", | ||
"type": "module", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Onu-UI utils library", | ||
@@ -6,0 +6,0 @@ "author": "Chris <https://github.com/zyyv>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16252