@estjs/shared 0.0.15-beta.14 → 0.0.15-beta.17
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/shared.cjs.js +400 -2
- package/dist/shared.cjs.js.map +1 -1
- package/dist/shared.d.cts +204 -153
- package/dist/shared.d.ts +204 -153
- package/dist/shared.dev.cjs.js +1 -523
- package/dist/shared.dev.cjs.js.map +1 -1
- package/dist/shared.dev.esm.js +1 -429
- package/dist/shared.dev.esm.js.map +1 -1
- package/dist/shared.esm.js +333 -2
- package/dist/shared.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/shared.dev.esm.js
CHANGED
|
@@ -1,431 +1,3 @@
|
|
|
1
|
-
// src/is.ts
|
|
2
|
-
var isObject = (val) => val !== null && typeof val === "object";
|
|
3
|
-
function isPromise(val) {
|
|
4
|
-
return _toString.call(val) === "[object Promise]";
|
|
5
|
-
}
|
|
6
|
-
var isArray = Array.isArray;
|
|
7
|
-
function isString(val) {
|
|
8
|
-
return typeof val === "string";
|
|
9
|
-
}
|
|
10
|
-
function isNumber(val) {
|
|
11
|
-
return typeof val === "number";
|
|
12
|
-
}
|
|
13
|
-
function isNull(val) {
|
|
14
|
-
return val === null;
|
|
15
|
-
}
|
|
16
|
-
function isSymbol(val) {
|
|
17
|
-
return typeof val === "symbol";
|
|
18
|
-
}
|
|
19
|
-
function isSet(val) {
|
|
20
|
-
return _toString.call(val) === "[object Set]";
|
|
21
|
-
}
|
|
22
|
-
function isWeakMap(val) {
|
|
23
|
-
return _toString.call(val) === "[object WeakMap]";
|
|
24
|
-
}
|
|
25
|
-
function isWeakSet(val) {
|
|
26
|
-
return _toString.call(val) === "[object WeakSet]";
|
|
27
|
-
}
|
|
28
|
-
function isMap(val) {
|
|
29
|
-
return _toString.call(val) === "[object Map]";
|
|
30
|
-
}
|
|
31
|
-
function isNil(val) {
|
|
32
|
-
return val === null || val === void 0;
|
|
33
|
-
}
|
|
34
|
-
var isFunction = (val) => typeof val === "function";
|
|
35
|
-
function isFalsy(val) {
|
|
36
|
-
return val === false || val === null || val === void 0;
|
|
37
|
-
}
|
|
38
|
-
var isPrimitive = (val) => ["string", "number", "boolean", "symbol", "undefined"].includes(typeof val) || isNull(val);
|
|
39
|
-
function isHTMLElement(val) {
|
|
40
|
-
return val instanceof HTMLElement;
|
|
41
|
-
}
|
|
42
|
-
var isPlainObject = (val) => _toString.call(val) === "[object Object]";
|
|
43
|
-
function isStringNumber(val) {
|
|
44
|
-
if (!isString(val) || val === "") {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return !Number.isNaN(Number(val));
|
|
48
|
-
}
|
|
49
|
-
function isUndefined(val) {
|
|
50
|
-
return typeof val === "undefined";
|
|
51
|
-
}
|
|
52
|
-
function isBoolean(val) {
|
|
53
|
-
return typeof val === "boolean";
|
|
54
|
-
}
|
|
55
|
-
function isNaN(val) {
|
|
56
|
-
return Number.isNaN(val);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// src/base.ts
|
|
60
|
-
var _toString = Object.prototype.toString;
|
|
61
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
62
|
-
var extend = Object.assign;
|
|
63
|
-
var hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
64
|
-
function coerceArray(data) {
|
|
65
|
-
return isArray(data) ? data : [data];
|
|
66
|
-
}
|
|
67
|
-
var hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
68
|
-
var noop = Function.prototype;
|
|
69
|
-
function startsWith(str, searchString) {
|
|
70
|
-
if (!isString(str)) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
return str.indexOf(searchString) === 0;
|
|
74
|
-
}
|
|
75
|
-
function generateUniqueId() {
|
|
76
|
-
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
77
|
-
let result = "";
|
|
78
|
-
const charactersLength = characters.length;
|
|
79
|
-
for (let i = 0; i < 8; i++) {
|
|
80
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
81
|
-
}
|
|
82
|
-
return result;
|
|
83
|
-
}
|
|
84
|
-
function isBrowser() {
|
|
85
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
86
|
-
}
|
|
87
|
-
var cacheStringFunction = (fn) => {
|
|
88
|
-
const cache = /* @__PURE__ */ Object.create(null);
|
|
89
|
-
return ((str) => {
|
|
90
|
-
const hit = cache[str];
|
|
91
|
-
return hit || (cache[str] = fn(str));
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
var EMPTY_OBJ = Object.freeze({});
|
|
95
|
-
var EMPTY_ARR = Object.freeze([]);
|
|
96
|
-
var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && key.charCodeAt(2) >= 65 && // uppercase letter A-Z
|
|
97
|
-
key.charCodeAt(2) <= 90;
|
|
98
|
-
var _globalThis;
|
|
99
|
-
var getGlobalThis = () => {
|
|
100
|
-
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// src/string.ts
|
|
104
|
-
var hyphenateRE = /\B([A-Z])/g;
|
|
105
|
-
var kebabCase = cacheStringFunction(
|
|
106
|
-
(str) => str.replaceAll(hyphenateRE, "-$1").toLowerCase()
|
|
107
|
-
);
|
|
108
|
-
var camelizeRE = /[_-](\w)/g;
|
|
109
|
-
var camelCase = cacheStringFunction((str) => {
|
|
110
|
-
str = str.replaceAll(/^[_-]+|[_-]+$/g, "");
|
|
111
|
-
str = str.replaceAll(/[_-]+/g, "-");
|
|
112
|
-
return str.replaceAll(camelizeRE, (_, c) => c.toUpperCase());
|
|
113
|
-
});
|
|
114
|
-
var capitalize = cacheStringFunction(
|
|
115
|
-
(str) => {
|
|
116
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// src/logger.ts
|
|
121
|
-
function warn(msg, ...args) {
|
|
122
|
-
console.warn(`[Essor warn]: ${msg}`, ...args);
|
|
123
|
-
}
|
|
124
|
-
function info(msg, ...args) {
|
|
125
|
-
console.info(`[Essor info]: ${msg}`, ...args);
|
|
126
|
-
}
|
|
127
|
-
function error(msg, ...args) {
|
|
128
|
-
console.error(`[Essor error]: ${msg}`, ...args);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/escape.ts
|
|
132
|
-
var escapeRE = /["&'<>]/;
|
|
133
|
-
function escapeHTML(string) {
|
|
134
|
-
const str = `${string}`;
|
|
135
|
-
const match = escapeRE.exec(str);
|
|
136
|
-
if (!match) {
|
|
137
|
-
return str;
|
|
138
|
-
}
|
|
139
|
-
let html = "";
|
|
140
|
-
let escaped;
|
|
141
|
-
let index;
|
|
142
|
-
let lastIndex = 0;
|
|
143
|
-
for (index = match.index; index < str.length; index++) {
|
|
144
|
-
switch (str.charCodeAt(index)) {
|
|
145
|
-
case 34:
|
|
146
|
-
escaped = """;
|
|
147
|
-
break;
|
|
148
|
-
case 38:
|
|
149
|
-
escaped = "&";
|
|
150
|
-
break;
|
|
151
|
-
case 39:
|
|
152
|
-
escaped = "'";
|
|
153
|
-
break;
|
|
154
|
-
case 60:
|
|
155
|
-
escaped = "<";
|
|
156
|
-
break;
|
|
157
|
-
case 62:
|
|
158
|
-
escaped = ">";
|
|
159
|
-
break;
|
|
160
|
-
default:
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
if (lastIndex !== index) {
|
|
164
|
-
html += str.slice(lastIndex, index);
|
|
165
|
-
}
|
|
166
|
-
lastIndex = index + 1;
|
|
167
|
-
html += escaped;
|
|
168
|
-
}
|
|
169
|
-
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
|
|
170
|
-
}
|
|
171
|
-
var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
|
|
172
|
-
function escapeHTMLComment(src) {
|
|
173
|
-
return src.replaceAll(commentStripRE, "");
|
|
174
|
-
}
|
|
175
|
-
var cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
|
|
176
|
-
function getEscapedCssVarName(key, doubleEscape) {
|
|
177
|
-
return key.replaceAll(
|
|
178
|
-
cssVarNameEscapeSymbolsRE,
|
|
179
|
-
(s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}`
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// src/dom.ts
|
|
184
|
-
function makeMap(str) {
|
|
185
|
-
const map = /* @__PURE__ */ Object.create(null);
|
|
186
|
-
for (const key of str.split(",")) {
|
|
187
|
-
map[key] = 1;
|
|
188
|
-
}
|
|
189
|
-
return (val) => val in map;
|
|
190
|
-
}
|
|
191
|
-
var specialBooleanAttrs = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";
|
|
192
|
-
var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
193
|
-
var isBooleanAttr = /* @__PURE__ */ makeMap(
|
|
194
|
-
`${specialBooleanAttrs},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
|
195
|
-
);
|
|
196
|
-
function includeBooleanAttr(value) {
|
|
197
|
-
return !!value || value === "";
|
|
198
|
-
}
|
|
199
|
-
var unsafeAttrCharRE = /[\t\n\f "'/=>]/;
|
|
200
|
-
var attrValidationCache = {};
|
|
201
|
-
function isSSRSafeAttrName(name) {
|
|
202
|
-
if (hasOwn(attrValidationCache, name)) {
|
|
203
|
-
return attrValidationCache[name];
|
|
204
|
-
}
|
|
205
|
-
const isUnsafe = unsafeAttrCharRE.test(name);
|
|
206
|
-
if (isUnsafe) {
|
|
207
|
-
if (__DEV__) {
|
|
208
|
-
error(`unsafe attribute name: ${name}`);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return attrValidationCache[name] = !isUnsafe;
|
|
212
|
-
}
|
|
213
|
-
var propsToAttrMap = {
|
|
214
|
-
acceptCharset: "accept-charset",
|
|
215
|
-
className: "class",
|
|
216
|
-
htmlFor: "for",
|
|
217
|
-
httpEquiv: "http-equiv"
|
|
218
|
-
};
|
|
219
|
-
var isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
|
220
|
-
"accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"
|
|
221
|
-
);
|
|
222
|
-
var isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
|
223
|
-
"xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan"
|
|
224
|
-
);
|
|
225
|
-
function isRenderAbleAttrValue(value) {
|
|
226
|
-
if (value == null) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
const type = typeof value;
|
|
230
|
-
return type === "string" || type === "number" || type === "boolean";
|
|
231
|
-
}
|
|
232
|
-
var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
|
233
|
-
var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
|
234
|
-
var MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
|
|
235
|
-
var DELEGATED_EVENTS = "beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart";
|
|
236
|
-
var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
237
|
-
var SELFCLOSING_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
238
|
-
var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
239
|
-
var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
240
|
-
var isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
241
|
-
var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
242
|
-
var isSelfClosingTag = /* @__PURE__ */ makeMap(SELFCLOSING_TAGS);
|
|
243
|
-
var isDelegatedEvent = /* @__PURE__ */ makeMap(DELEGATED_EVENTS);
|
|
244
|
-
|
|
245
|
-
// src/dom-types.ts
|
|
246
|
-
function isHtmlInputElement(val) {
|
|
247
|
-
return val instanceof HTMLInputElement;
|
|
248
|
-
}
|
|
249
|
-
function isHtmlSelectElement(val) {
|
|
250
|
-
return val instanceof HTMLSelectElement;
|
|
251
|
-
}
|
|
252
|
-
function isHtmlTextAreaElement(val) {
|
|
253
|
-
return val instanceof HTMLTextAreaElement;
|
|
254
|
-
}
|
|
255
|
-
function isHtmlFormElement(val) {
|
|
256
|
-
return val instanceof HTMLFormElement;
|
|
257
|
-
}
|
|
258
|
-
function isTextNode(val) {
|
|
259
|
-
return val instanceof Text;
|
|
260
|
-
}
|
|
261
|
-
function isNode(val) {
|
|
262
|
-
return val instanceof Node;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// src/normalize.ts
|
|
266
|
-
var STYLE_SEPARATOR_REGEX = /;(?![^(]*\))/g;
|
|
267
|
-
var PROPERTY_VALUE_SEPARATOR_REGEX = /:([\s\S]+)/;
|
|
268
|
-
var STYLE_COMMENT_REGEX = /\/\*[\s\S]*?\*\//g;
|
|
269
|
-
function parseStyleString(cssText) {
|
|
270
|
-
const styleObject = {};
|
|
271
|
-
cssText.replaceAll(STYLE_COMMENT_REGEX, "").split(STYLE_SEPARATOR_REGEX).forEach((styleItem) => {
|
|
272
|
-
if (styleItem) {
|
|
273
|
-
const parts = styleItem.split(PROPERTY_VALUE_SEPARATOR_REGEX);
|
|
274
|
-
if (parts.length > 1) {
|
|
275
|
-
styleObject[parts[0].trim()] = parts[1].trim();
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
return styleObject;
|
|
280
|
-
}
|
|
281
|
-
function normalizeStyle(styleValue) {
|
|
282
|
-
if (isArray(styleValue)) {
|
|
283
|
-
const normalizedStyleObject = {};
|
|
284
|
-
for (const styleItem of styleValue) {
|
|
285
|
-
const normalizedItem = isString(styleItem) ? parseStyleString(styleItem) : normalizeStyle(styleItem);
|
|
286
|
-
if (normalizedItem) {
|
|
287
|
-
for (const key in normalizedItem) {
|
|
288
|
-
normalizedStyleObject[key] = normalizedItem[key];
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
return normalizedStyleObject;
|
|
293
|
-
}
|
|
294
|
-
if (isString(styleValue) || isObject(styleValue)) {
|
|
295
|
-
return styleValue;
|
|
296
|
-
}
|
|
297
|
-
return void 0;
|
|
298
|
-
}
|
|
299
|
-
function styleToString(styleValue) {
|
|
300
|
-
if (!styleValue) {
|
|
301
|
-
return "";
|
|
302
|
-
}
|
|
303
|
-
if (isString(styleValue)) {
|
|
304
|
-
return styleValue;
|
|
305
|
-
}
|
|
306
|
-
let cssText = "";
|
|
307
|
-
for (const propName in styleValue) {
|
|
308
|
-
const propValue = styleValue[propName];
|
|
309
|
-
if (isString(propValue) || isNumber(propValue)) {
|
|
310
|
-
const normalizedPropName = propName.startsWith("--") ? propName : kebabCase(propName);
|
|
311
|
-
cssText += `${normalizedPropName}:${propValue};`;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return cssText;
|
|
315
|
-
}
|
|
316
|
-
function normalizeClassName(classValue) {
|
|
317
|
-
if (classValue == null) {
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
if (isString(classValue)) {
|
|
321
|
-
return classValue.trim();
|
|
322
|
-
}
|
|
323
|
-
if (isArray(classValue)) {
|
|
324
|
-
return classValue.map(normalizeClassName).filter(Boolean).join(" ");
|
|
325
|
-
}
|
|
326
|
-
if (isObject(classValue)) {
|
|
327
|
-
let count = 0;
|
|
328
|
-
for (const key in classValue) {
|
|
329
|
-
if (classValue[key]) count++;
|
|
330
|
-
}
|
|
331
|
-
if (count === 0) return "";
|
|
332
|
-
const result = new Array(count);
|
|
333
|
-
let index = 0;
|
|
334
|
-
for (const key in classValue) {
|
|
335
|
-
if (classValue[key]) {
|
|
336
|
-
result[index++] = key;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
return result.join(" ");
|
|
340
|
-
}
|
|
341
|
-
return String(classValue).trim();
|
|
342
|
-
}
|
|
343
|
-
function styleObjectToString(styleValue) {
|
|
344
|
-
if (!styleValue) {
|
|
345
|
-
return "";
|
|
346
|
-
}
|
|
347
|
-
if (isString(styleValue)) {
|
|
348
|
-
return styleValue;
|
|
349
|
-
}
|
|
350
|
-
let cssText = "";
|
|
351
|
-
for (const propName in styleValue) {
|
|
352
|
-
const propValue = styleValue[propName];
|
|
353
|
-
if (isString(propValue) || isNumber(propValue)) {
|
|
354
|
-
const normalizedPropName = propName.startsWith("--") ? propName : kebabCase(propName);
|
|
355
|
-
cssText += `${normalizedPropName}:${propValue};`;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return cssText;
|
|
359
|
-
}
|
|
360
|
-
export {
|
|
361
|
-
EMPTY_ARR,
|
|
362
|
-
EMPTY_OBJ,
|
|
363
|
-
cacheStringFunction,
|
|
364
|
-
camelCase,
|
|
365
|
-
capitalize,
|
|
366
|
-
coerceArray,
|
|
367
|
-
error,
|
|
368
|
-
escapeHTML,
|
|
369
|
-
escapeHTMLComment,
|
|
370
|
-
extend,
|
|
371
|
-
generateUniqueId,
|
|
372
|
-
getEscapedCssVarName,
|
|
373
|
-
getGlobalThis,
|
|
374
|
-
hasChanged,
|
|
375
|
-
hasOwn,
|
|
376
|
-
includeBooleanAttr,
|
|
377
|
-
info,
|
|
378
|
-
isArray,
|
|
379
|
-
isBoolean,
|
|
380
|
-
isBooleanAttr,
|
|
381
|
-
isBrowser,
|
|
382
|
-
isDelegatedEvent,
|
|
383
|
-
isFalsy,
|
|
384
|
-
isFunction,
|
|
385
|
-
isHTMLElement,
|
|
386
|
-
isHTMLTag,
|
|
387
|
-
isHtmlFormElement,
|
|
388
|
-
isHtmlInputElement,
|
|
389
|
-
isHtmlSelectElement,
|
|
390
|
-
isHtmlTextAreaElement,
|
|
391
|
-
isKnownHtmlAttr,
|
|
392
|
-
isKnownSvgAttr,
|
|
393
|
-
isMap,
|
|
394
|
-
isMathMLTag,
|
|
395
|
-
isNaN,
|
|
396
|
-
isNil,
|
|
397
|
-
isNode,
|
|
398
|
-
isNull,
|
|
399
|
-
isNumber,
|
|
400
|
-
isObject,
|
|
401
|
-
isOn,
|
|
402
|
-
isPlainObject,
|
|
403
|
-
isPrimitive,
|
|
404
|
-
isPromise,
|
|
405
|
-
isRenderAbleAttrValue,
|
|
406
|
-
isSSRSafeAttrName,
|
|
407
|
-
isSVGTag,
|
|
408
|
-
isSelfClosingTag,
|
|
409
|
-
isSet,
|
|
410
|
-
isSpecialBooleanAttr,
|
|
411
|
-
isString,
|
|
412
|
-
isStringNumber,
|
|
413
|
-
isSymbol,
|
|
414
|
-
isTextNode,
|
|
415
|
-
isUndefined,
|
|
416
|
-
isVoidTag,
|
|
417
|
-
isWeakMap,
|
|
418
|
-
isWeakSet,
|
|
419
|
-
kebabCase,
|
|
420
|
-
noop,
|
|
421
|
-
normalizeClassName,
|
|
422
|
-
normalizeStyle,
|
|
423
|
-
parseStyleString,
|
|
424
|
-
propsToAttrMap,
|
|
425
|
-
startsWith,
|
|
426
|
-
styleObjectToString,
|
|
427
|
-
styleToString,
|
|
428
|
-
warn
|
|
429
|
-
};
|
|
1
|
+
var f=e=>e!==null&&typeof e=="object";function A(e){return p.call(e)==="[object Promise]"}var u=Array.isArray;function i(e){return typeof e=="string"}function g(e){return typeof e=="number"}function E(e){return e===null}function M(e){return typeof e=="symbol"}function N(e){return p.call(e)==="[object Set]"}function C(e){return p.call(e)==="[object WeakMap]"}function z(e){return p.call(e)==="[object WeakSet]"}function L(e){return p.call(e)==="[object Map]"}function O(e){return e==null}var j=e=>typeof e=="function";function H(e){return e===!1||e===null||e===void 0}var R=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="undefined";function _(e){return e instanceof HTMLElement}var P=e=>p.call(e)==="[object Object]";function B(e){return!i(e)||e===""?!1:!Number.isNaN(Number(e))}function F(e){return typeof e=="undefined"}function U(e){return typeof e=="boolean"}function G(e){return Number.isNaN(e)}function $(e){return typeof e=="bigint"}var p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,D=Object.assign,h=(e,t)=>q.call(e,t);function W(e){return u(e)?e:[e]}var I=(e,t)=>!Object.is(e,t),Y=Function.prototype;function X(e,t){return i(e)?e.indexOf(t)===0:!1}function K(){return Math.random().toString(36).slice(2,10)}function J(){return typeof window!="undefined"&&typeof document!="undefined"}var d=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Z=Object.freeze({}),V=Object.freeze([]),Q=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90,k,ee=()=>k||(k=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var te=/\B([A-Z])/g,b=d(e=>e.replaceAll(te,"-$1").toLowerCase()),ne=/[_-](\w)/g,oe=d(e=>(e=e.replaceAll(/^[_-]+|[_-]+$/g,""),e=e.replaceAll(/[_-]+/g,"-"),e.replaceAll(ne,(t,n)=>n.toUpperCase()))),re=d(e=>e.charAt(0).toUpperCase()+e.slice(1));function ie(e,...t){console.warn(`[Essor warn]: ${e}`,...t)}function se(e,...t){console.info(`[Essor info]: ${e}`,...t)}function y(e,...t){console.error(`[Essor error]: ${e}`,...t)}var ae=/["&'<>]/;function le(e){let t=`${e}`,n=ae.exec(t);if(!n)return t;let o="",r,s,m=0;for(s=n.index;s<t.length;s++){switch(t.charCodeAt(s)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}m!==s&&(o+=t.slice(m,s)),m=s+1,o+=r}return m!==s?o+t.slice(m,s):o}var ce=/^-?>|<!--|-->|--!>|<!-$/g;function pe(e){return e.replaceAll(ce,"")}var ue=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function me(e,t){return e.replaceAll(ue,n=>t?n==='"'?'\\\\\\"':`\\\\${n}`:`\\${n}`)}function a(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var w="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",de=a(w),fe=a(`${w},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function ge(e){return!!e||e===""}var he=/[\t\n\f "'/=>]/,x={};function be(e){if(h(x,e))return x[e];let t=he.test(e);return t&&__DEV__&&y(`unsafe attribute name: ${e}`),x[e]=!t}var ye={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},xe=a("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),ke=a("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan"),we="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Se="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Te="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",ve="beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart",Ae="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ee=a(we),Me=a(Se),Ne=a(Te),Ce=a(Ae),ze=a(ve);function Le(e){return e instanceof HTMLInputElement}function Oe(e){return e instanceof HTMLSelectElement}function je(e){return e instanceof HTMLTextAreaElement}function He(e){return e instanceof HTMLFormElement}function Re(e){return e instanceof Text}function _e(e){return e instanceof Node}var Pe=/;(?![^(]*\))/g,Be=/:([\s\S]+)/,Fe=/\/\*[\s\S]*?\*\//g;function S(e){let t={};return e.replaceAll(Fe,"").split(Pe).forEach(n=>{if(n){let o=n.split(Be);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function T(e){if(u(e)){let t={};for(let n of e){let o=i(n)?S(n):T(n);if(o)for(let r in o)t[r]=o[r]}return t}if(i(e)||f(e))return e}function Ue(e){if(!e)return"";if(i(e))return e;let t="";for(let n in e){let o=e[n];if(i(o)||g(o)){let r=n.startsWith("--")?n:b(n);t+=`${r}:${o};`}}return t}function v(e){if(e==null)return"";if(i(e))return e.trim();if(u(e))return e.map(v).filter(Boolean).join(" ");if(f(e)){let t=0;for(let r in e)e[r]&&t++;if(t===0)return"";let n=new Array(t),o=0;for(let r in e)e[r]&&(n[o++]=r);return n.join(" ")}return String(e).trim()}export{V as EMPTY_ARR,Z as EMPTY_OBJ,d as cacheStringFunction,oe as camelCase,re as capitalize,W as coerceArray,y as error,le as escapeHTML,pe as escapeHTMLComment,D as extend,K as generateUniqueId,me as getEscapedCssVarName,ee as getGlobalThis,I as hasChanged,h as hasOwn,ge as includeBooleanAttr,se as info,u as isArray,$ as isBigint,U as isBoolean,fe as isBooleanAttr,J as isBrowser,ze as isDelegatedEvent,H as isFalsy,j as isFunction,_ as isHTMLElement,Ee as isHTMLTag,He as isHtmlFormElement,Le as isHtmlInputElement,Oe as isHtmlSelectElement,je as isHtmlTextAreaElement,xe as isKnownHtmlAttr,ke as isKnownSvgAttr,L as isMap,Ne as isMathMLTag,G as isNaN,O as isNil,_e as isNode,E as isNull,g as isNumber,f as isObject,Q as isOn,P as isPlainObject,R as isPrimitive,A as isPromise,be as isSSRSafeAttrName,Me as isSVGTag,Ce as isSelfClosingTag,N as isSet,de as isSpecialBooleanAttr,i as isString,B as isStringNumber,M as isSymbol,Re as isTextNode,F as isUndefined,C as isWeakMap,z as isWeakSet,b as kebabCase,Y as noop,v as normalizeClassName,T as normalizeStyle,S as parseStyleString,ye as propsToAttrMap,X as startsWith,Ue as styleToString,ie as warn};
|
|
430
2
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
431
3
|
//# sourceMappingURL=shared.dev.esm.js.map
|