@everymatrix/ui-skeleton 1.60.0 → 1.60.2
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/cjs/{index-00751390.js → index-946ac65b.js} +13 -50
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/ui-skeleton-1b7315dc.js +171 -0
- package/dist/cjs/ui-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ui-skeleton.cjs.js +2 -2
- package/dist/collection/components/ui-skeleton/ui-skeleton.css +12 -0
- package/dist/collection/components/ui-skeleton/ui-skeleton.js +105 -87
- package/dist/esm/{index-ae04a8b1.js → index-b2193545.js} +13 -51
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/ui-skeleton-ea659b95.js +169 -0
- package/dist/esm/ui-skeleton.entry.js +2 -2
- package/dist/esm/ui-skeleton.js +3 -3
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/ui-skeleton/ui-skeleton.d.ts +8 -12
- package/dist/types/components.d.ts +2 -2
- package/dist/ui-skeleton/index.esm.js +1 -1
- package/dist/ui-skeleton/p-4928252f.js +2 -0
- package/dist/ui-skeleton/p-73f0c8e4.js +1 -0
- package/dist/ui-skeleton/p-c73b7e7d.entry.js +1 -0
- package/dist/ui-skeleton/ui-skeleton.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/ui-skeleton-ce8e4a69.js +0 -146
- package/dist/esm/ui-skeleton-a642cced.js +0 -144
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/stencil.config.dev.d.ts +0 -2
- package/dist/ui-skeleton/p-59752f80.js +0 -2
- package/dist/ui-skeleton/p-ea31f18e.entry.js +0 -1
- package/dist/ui-skeleton/p-fe2a4a98.js +0 -1
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'ui-skeleton';
|
|
2
|
-
const BUILD = /* ui-skeleton */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad:
|
|
2
|
+
const BUILD = /* ui-skeleton */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: false, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: false, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -358,32 +358,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
358
358
|
const newClasses = parseClassList(newValue);
|
|
359
359
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
360
360
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
361
|
-
}
|
|
362
|
-
{
|
|
363
|
-
for (const prop in oldValue) {
|
|
364
|
-
if (!newValue || newValue[prop] == null) {
|
|
365
|
-
if (prop.includes("-")) {
|
|
366
|
-
elm.style.removeProperty(prop);
|
|
367
|
-
} else {
|
|
368
|
-
elm.style[prop] = "";
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
for (const prop in newValue) {
|
|
374
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
375
|
-
if (prop.includes("-")) {
|
|
376
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
377
|
-
} else {
|
|
378
|
-
elm.style[prop] = newValue[prop];
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
383
|
-
if (newValue) {
|
|
384
|
-
newValue(elm);
|
|
385
|
-
}
|
|
386
|
-
} else ;
|
|
361
|
+
}
|
|
387
362
|
}
|
|
388
363
|
};
|
|
389
364
|
var parseClassListRegex = /\s/;
|
|
@@ -421,7 +396,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
421
396
|
let i2 = 0;
|
|
422
397
|
let elm;
|
|
423
398
|
let childNode;
|
|
424
|
-
{
|
|
399
|
+
if (newVNode2.$text$ !== null) {
|
|
400
|
+
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
401
|
+
} else {
|
|
425
402
|
elm = newVNode2.$elm$ = doc.createElement(
|
|
426
403
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
427
404
|
);
|
|
@@ -458,7 +435,6 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
458
435
|
const vnode = vnodes[index];
|
|
459
436
|
if (vnode) {
|
|
460
437
|
const elm = vnode.$elm$;
|
|
461
|
-
nullifyVNodeRefs(vnode);
|
|
462
438
|
if (elm) {
|
|
463
439
|
elm.remove();
|
|
464
440
|
}
|
|
@@ -562,7 +538,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
562
538
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
563
539
|
const oldChildren = oldVNode.$children$;
|
|
564
540
|
const newChildren = newVNode2.$children$;
|
|
565
|
-
|
|
541
|
+
const text = newVNode2.$text$;
|
|
542
|
+
if (text === null) {
|
|
566
543
|
{
|
|
567
544
|
{
|
|
568
545
|
updateElement(oldVNode, newVNode2);
|
|
@@ -571,16 +548,15 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
571
548
|
if (oldChildren !== null && newChildren !== null) {
|
|
572
549
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
573
550
|
} else if (newChildren !== null) {
|
|
551
|
+
if (oldVNode.$text$ !== null) {
|
|
552
|
+
elm.textContent = "";
|
|
553
|
+
}
|
|
574
554
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
575
555
|
} else if (oldChildren !== null) {
|
|
576
556
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
577
557
|
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
var nullifyVNodeRefs = (vNode) => {
|
|
581
|
-
{
|
|
582
|
-
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
583
|
-
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
558
|
+
} else if (oldVNode.$text$ !== text) {
|
|
559
|
+
elm.data = text;
|
|
584
560
|
}
|
|
585
561
|
};
|
|
586
562
|
var insertBefore = (parent, newNode, reference) => {
|
|
@@ -698,16 +674,12 @@ var postUpdateComponent = (hostRef) => {
|
|
|
698
674
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
699
675
|
const elm = hostRef.$hostElement$;
|
|
700
676
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
701
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
702
677
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
703
678
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
704
679
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
705
680
|
{
|
|
706
681
|
addHydratedFlag(elm);
|
|
707
682
|
}
|
|
708
|
-
{
|
|
709
|
-
safeCall(instance, "componentDidLoad");
|
|
710
|
-
}
|
|
711
683
|
endPostUpdate();
|
|
712
684
|
{
|
|
713
685
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -735,16 +707,6 @@ var appDidLoad = (who) => {
|
|
|
735
707
|
}
|
|
736
708
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
737
709
|
};
|
|
738
|
-
var safeCall = (instance, method, arg) => {
|
|
739
|
-
if (instance && instance[method]) {
|
|
740
|
-
try {
|
|
741
|
-
return instance[method](arg);
|
|
742
|
-
} catch (e) {
|
|
743
|
-
consoleError(e);
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
return void 0;
|
|
747
|
-
};
|
|
748
710
|
var addHydratedFlag = (elm) => {
|
|
749
711
|
var _a;
|
|
750
712
|
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
|
@@ -1077,4 +1039,4 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1077
1039
|
// src/runtime/nonce.ts
|
|
1078
1040
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1079
1041
|
|
|
1080
|
-
export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1042
|
+
export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { U as UiSkeleton } from './ui-skeleton-
|
|
2
|
-
import './index-
|
|
1
|
+
export { U as UiSkeleton } from './ui-skeleton-ea659b95.js';
|
|
2
|
+
import './index-b2193545.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-b2193545.js';
|
|
2
|
+
export { s as setNonce } from './index-b2193545.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["ui-skeleton",[[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]
|
|
8
|
+
return bootstrapLazy([["ui-skeleton",[[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-b2193545.js';
|
|
2
|
+
|
|
3
|
+
const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 250px);height:var(--emw-skeleton-image-height, 200px);border-radius:var(--emw-skeleton-image-border-radius, 10px)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
|
|
4
|
+
const UiSkeletonStyle0 = uiSkeletonCss;
|
|
5
|
+
|
|
6
|
+
const UiSkeleton = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.structure = undefined;
|
|
10
|
+
this.width = undefined;
|
|
11
|
+
this.height = undefined;
|
|
12
|
+
this.borderRadius = undefined;
|
|
13
|
+
this.marginBottom = undefined;
|
|
14
|
+
this.marginTop = undefined;
|
|
15
|
+
this.marginLeft = undefined;
|
|
16
|
+
this.marginRight = undefined;
|
|
17
|
+
this.animation = true;
|
|
18
|
+
this.rows = undefined;
|
|
19
|
+
this.size = undefined;
|
|
20
|
+
this.color = undefined;
|
|
21
|
+
this.primaryColor = undefined;
|
|
22
|
+
this.secondaryColor = undefined;
|
|
23
|
+
}
|
|
24
|
+
handleStructureChange(newValue, oldValue) {
|
|
25
|
+
if (oldValue !== newValue) {
|
|
26
|
+
this.handleStructure(newValue);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handleStructure(structure) {
|
|
30
|
+
switch (structure) {
|
|
31
|
+
case 'logo':
|
|
32
|
+
return this.renderLogo();
|
|
33
|
+
case 'image':
|
|
34
|
+
return this.renderImage();
|
|
35
|
+
case 'title':
|
|
36
|
+
return this.renderTitle();
|
|
37
|
+
case 'text':
|
|
38
|
+
return this.renderText();
|
|
39
|
+
case 'rectangle':
|
|
40
|
+
return this.renderRectangle();
|
|
41
|
+
case 'circle':
|
|
42
|
+
return this.renderCircle();
|
|
43
|
+
default:
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
renderLogo() {
|
|
48
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Logo " + (this.animation ? 'Skeleton' : '') })));
|
|
49
|
+
}
|
|
50
|
+
renderImage() {
|
|
51
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Image " + (this.animation ? 'Skeleton' : '') })));
|
|
52
|
+
}
|
|
53
|
+
renderTitle() {
|
|
54
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Title " + (this.animation ? 'Skeleton' : '') })));
|
|
55
|
+
}
|
|
56
|
+
renderText() {
|
|
57
|
+
return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: "Text " + (this.animation ? 'Skeleton' : '') })))));
|
|
58
|
+
}
|
|
59
|
+
renderRectangle() {
|
|
60
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Rectangle " + (this.animation ? 'Skeleton' : '') })));
|
|
61
|
+
}
|
|
62
|
+
renderCircle() {
|
|
63
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Circle " + (this.animation ? 'Skeleton' : '') })));
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
let styleBlock = '';
|
|
67
|
+
switch (this.structure) {
|
|
68
|
+
case 'logo':
|
|
69
|
+
styleBlock = `
|
|
70
|
+
:host {
|
|
71
|
+
--emw-skeleton-logo-width: ${this.width};
|
|
72
|
+
--emw-skeleton-logo-height: ${this.height};
|
|
73
|
+
--emw-skeleton-logo-border-radius: ${this.borderRadius}px;
|
|
74
|
+
--emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;
|
|
75
|
+
--emw-skeleton-logo-margin-top: ${this.marginTop}px;
|
|
76
|
+
--emw-skeleton-logo-margin-left: ${this.marginLeft}px;
|
|
77
|
+
--emw-skeleton-logo-margin-right: ${this.marginRight}px;
|
|
78
|
+
--emw-skeleton-logo-background: ${this.color};
|
|
79
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
80
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
break;
|
|
84
|
+
case 'image':
|
|
85
|
+
styleBlock = `
|
|
86
|
+
:host {
|
|
87
|
+
--emw-skeleton-image-width: ${this.width};
|
|
88
|
+
--emw-skeleton-image-height: ${this.height};
|
|
89
|
+
--emw-skeleton-image-border-radius: ${this.borderRadius}px;
|
|
90
|
+
--emw-skeleton-image-margin-bottom: ${this.marginBottom}px;
|
|
91
|
+
--emw-skeleton-image-margin-top: ${this.marginTop}px;
|
|
92
|
+
--emw-skeleton-image-margin-left: ${this.marginLeft}px;
|
|
93
|
+
--emw-skeleton-image-margin-right: ${this.marginRight}px;
|
|
94
|
+
--emw-skeleton-image-background: ${this.color};
|
|
95
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
96
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
break;
|
|
100
|
+
case 'title':
|
|
101
|
+
styleBlock = `
|
|
102
|
+
:host {
|
|
103
|
+
--emw-skeleton-title-width: ${this.width};
|
|
104
|
+
--emw-skeleton-title-height: ${this.height};
|
|
105
|
+
--emw-skeleton-title-border-radius: ${this.borderRadius}px;
|
|
106
|
+
--emw-skeleton-title-margin-bottom: ${this.marginBottom}px;
|
|
107
|
+
--emw-skeleton-title-margin-top: ${this.marginTop}px;
|
|
108
|
+
--emw-skeleton-title-margin-left: ${this.marginLeft}px;
|
|
109
|
+
--emw-skeleton-title-margin-right: ${this.marginRight}px;
|
|
110
|
+
--emw-skeleton-title-background: ${this.color};
|
|
111
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
112
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
break;
|
|
116
|
+
case 'text':
|
|
117
|
+
styleBlock = `
|
|
118
|
+
:host {
|
|
119
|
+
--emw-skeleton-text-width: ${this.width};
|
|
120
|
+
--emw-skeleton-text-height: ${this.height};
|
|
121
|
+
--emw-skeleton-text-border-radius: ${this.borderRadius}px;
|
|
122
|
+
--emw-skeleton-text-margin-bottom: ${this.marginBottom}px;
|
|
123
|
+
--emw-skeleton-text-margin-top: ${this.marginTop}px;
|
|
124
|
+
--emw-skeleton-text-margin-left: ${this.marginLeft}px;
|
|
125
|
+
--emw-skeleton-text-margin-right: ${this.marginRight}px;
|
|
126
|
+
--emw-skeleton-text-background: ${this.color};
|
|
127
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
128
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
break;
|
|
132
|
+
case 'rectangle':
|
|
133
|
+
styleBlock = `
|
|
134
|
+
:host {
|
|
135
|
+
--emw-skeleton-rectangle-width: ${this.width};
|
|
136
|
+
--emw-skeleton-rectangle-height: ${this.height};
|
|
137
|
+
--emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;
|
|
138
|
+
--emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;
|
|
139
|
+
--emw-skeleton-rectangle-margin-top: ${this.marginTop}px;
|
|
140
|
+
--emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;
|
|
141
|
+
--emw-skeleton-rectangle-margin-right: ${this.marginRight}px;
|
|
142
|
+
--emw-skeleton-rectangle-background: ${this.color};
|
|
143
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
144
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
145
|
+
}
|
|
146
|
+
`;
|
|
147
|
+
break;
|
|
148
|
+
case 'circle':
|
|
149
|
+
styleBlock = `
|
|
150
|
+
:host {
|
|
151
|
+
--emw-skeleton-circle-size: ${this.size};
|
|
152
|
+
--emw-skeleton-circle-background: ${this.color};
|
|
153
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
154
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
break;
|
|
158
|
+
default:
|
|
159
|
+
styleBlock = '';
|
|
160
|
+
}
|
|
161
|
+
return (h(Host, { key: '58f7f9acd15f0f96b8b6f47f6bea81d49a3857c5' }, h("style", { key: 'c72ac31d1c55fd5d18ec334629db45977a0f6124' }, styleBlock), this.handleStructure(this.structure)));
|
|
162
|
+
}
|
|
163
|
+
static get watchers() { return {
|
|
164
|
+
"structure": ["handleStructureChange"]
|
|
165
|
+
}; }
|
|
166
|
+
};
|
|
167
|
+
UiSkeleton.style = UiSkeletonStyle0;
|
|
168
|
+
|
|
169
|
+
export { UiSkeleton as U };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { U as ui_skeleton } from './ui-skeleton-
|
|
2
|
-
import './index-
|
|
1
|
+
export { U as ui_skeleton } from './ui-skeleton-ea659b95.js';
|
|
2
|
+
import './index-b2193545.js';
|
package/dist/esm/ui-skeleton.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-b2193545.js';
|
|
2
|
+
export { s as setNonce } from './index-b2193545.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["ui-skeleton",[[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]
|
|
19
|
+
return bootstrapLazy([["ui-skeleton",[[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -40,7 +40,7 @@ export declare class UiSkeleton {
|
|
|
40
40
|
*/
|
|
41
41
|
rows: number;
|
|
42
42
|
/**
|
|
43
|
-
* The size of the circle - only for `circle - it can either be a value in px (150px) or in percentage (100%)
|
|
43
|
+
* The size of the circle - only for `circle` - it can either be a value in px (150px) or in percentage (100%)
|
|
44
44
|
*/
|
|
45
45
|
size: string;
|
|
46
46
|
/**
|
|
@@ -55,17 +55,13 @@ export declare class UiSkeleton {
|
|
|
55
55
|
* Secondary color of the skeleton when animation is `on` - hexa value (e.g. #ffffff)
|
|
56
56
|
*/
|
|
57
57
|
secondaryColor: string;
|
|
58
|
-
private skeletonContainer;
|
|
59
|
-
constructor();
|
|
60
58
|
handleStructureChange(newValue: any, oldValue: any): void;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
renderCircle(): any;
|
|
69
|
-
componentDidLoad(): void;
|
|
59
|
+
private handleStructure;
|
|
60
|
+
private renderLogo;
|
|
61
|
+
private renderImage;
|
|
62
|
+
private renderTitle;
|
|
63
|
+
private renderText;
|
|
64
|
+
private renderRectangle;
|
|
65
|
+
private renderCircle;
|
|
70
66
|
render(): any;
|
|
71
67
|
}
|
|
@@ -52,7 +52,7 @@ export namespace Components {
|
|
|
52
52
|
*/
|
|
53
53
|
"secondaryColor": string;
|
|
54
54
|
/**
|
|
55
|
-
* The size of the circle - only for `circle - it can either be a value in px (150px) or in percentage (100%)
|
|
55
|
+
* The size of the circle - only for `circle` - it can either be a value in px (150px) or in percentage (100%)
|
|
56
56
|
*/
|
|
57
57
|
"size": string;
|
|
58
58
|
/**
|
|
@@ -123,7 +123,7 @@ declare namespace LocalJSX {
|
|
|
123
123
|
*/
|
|
124
124
|
"secondaryColor"?: string;
|
|
125
125
|
/**
|
|
126
|
-
* The size of the circle - only for `circle - it can either be a value in px (150px) or in percentage (100%)
|
|
126
|
+
* The size of the circle - only for `circle` - it can either be a value in px (150px) or in percentage (100%)
|
|
127
127
|
*/
|
|
128
128
|
"size"?: string;
|
|
129
129
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{U as UiSkeleton}from"./p-
|
|
1
|
+
export{U as UiSkeleton}from"./p-73f0c8e4.js";import"./p-4928252f.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>(0,console.error)(e,t),s=new Map,r=new Map,i="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="undefined"!=typeof window?window:{},u=c.document||{head:{}},a={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},f=e=>Promise.resolve(e),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,d=[],p=[],y=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&a.l?w(v):a.raf(v))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){o(e)}e.length=0},v=()=>{$(d),$(p),(m=d.length>0)&&a.raf(v)},w=e=>f().then(e),b=y(p,!0),S={},g=e=>"object"==(e=typeof e)||"function"===e;function j(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>E,ok:()=>k,unwrap:()=>M,unwrapErr:()=>P});var k=e=>({isOk:!0,isErr:!1,value:e}),O=e=>({isOk:!1,isErr:!0,value:e});function E(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>k(e))):k(n)}if(e.isErr)return O(e.value);throw"should never get here"}var C,M=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},x=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!g(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),A={},F=new WeakMap,H=e=>"sc-"+e.v,N=(e,t,n,l)=>{if(n!==l&&(t.toLowerCase(),"class"===t)){const t=e.classList,o=L(n),s=L(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}},R=/\s/,L=e=>e?e.split(R):[],U=(e,t)=>{const n=11===t.$.nodeType&&t.$.host?t.$.host:t.$,l=e&&e.u||S,o=t.u||S;for(const e of W(Object.keys(l)))e in o||N(n,e,l[e],void 0);for(const e of W(Object.keys(o)))N(n,e,l[e],o[e])};function W(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var q=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=u.createTextNode(l.i);else if(o=l.$=u.createElement(l.p),U(null,l),l.h)for(r=0;r<l.h.length;++r)s=q(e,l,r),s&&o.appendChild(s);return o["s-hn"]=C,o},D=(e,t,n,l,o,s)=>{let r,i=e;for(;o<=s;++o)l[o]&&(r=q(null,n,o),r&&(l[o].$=r,z(i,r,t)))},G=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;e&&e.remove()}}},V=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),_=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(U(e,t),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],m=t[f],d=l.length-1,p=l[0],y=l[d];for(;i<=f&&c<=d;)if(null==h)h=t[++i];else if(null==m)m=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--d];else if(V(h,p,o))_(h,p,o),h=t[++i],p=l[++c];else if(V(m,y,o))_(m,y,o),m=t[--f],y=l[--d];else if(V(h,y,o))_(h,y,o),z(e,h.$,m.$.nextSibling),h=t[++i],y=l[--d];else if(V(m,p,o))_(m,p,o),z(e,m.$,h.$),m=t[--f],p=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(r=t[u],r.p!==p.p?s=q(t&&t[c],n,u):(_(r,p,o),t[u]=void 0,s=r.$),p=l[++c]):(s=q(t&&t[c],n,c),p=l[++c]),s&&z(h.$.parentNode,s,h.$)}i>f?D(e,null==l[d+1]?null:l[d+1].$,n,l,c,d):c>d&&G(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),D(l,null,t,s,0,s.length-1)):null!==o&&G(o,0,o.length-1)):e.i!==r&&(l.data=r)},z=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),B=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},I=(e,t)=>{if(e.l|=16,!(4&e.l))return B(e,e.j),b((()=>J(e,t)));e.l|=512},J=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return K(void 0,(()=>X(e,n,t)))},K=(e,t)=>Q(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),Q=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,X=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k;((e,t)=>{var n;const l=H(t),o=r.get(l);if(e=11===e.nodeType?e:u,o)if("string"==typeof o){let s,r=F.get(e=e.head||e);if(r||F.set(e,r=new Set),!r.has(l)){{s=u.createElement("style"),s.innerHTML=o;const t=null!=(n=a.O)?n:j(u);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=i),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o])})(e.$hostElement$.getRootNode(),t)})(e);Y(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>Z(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},Y=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.C||T(null,null),s=(e=>e&&e.p===A)(t)?t:x(null,null,t);if(C=l.tagName,n&&s.u)for(const e of Object.keys(s.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(s.u[e]=l[e]);s.p=null,s.l|=4,e.C=s,s.$=o.$=l,_(o,s,n)})(e,t,l)}catch(t){o(t,e.$hostElement$)}return null},Z=e=>{const t=e.$hostElement$,n=e.j;64&e.l||(e.l|=64,te(t),e.M(t),n||ee()),e.S&&(e.S(),e.S=void 0),512&e.l&&w((()=>I(e,!1))),e.l&=-517},ee=()=>{te(u.documentElement),w((()=>(e=>{const t=a.ce("appload",{detail:{namespace:"ui-skeleton"}});return e.dispatchEvent(t),t})(c)))},te=e=>e.classList.add("hydrated"),ne=(e,t,l)=>{var s,r;const i=e.prototype;if(t.P||t.T||e.watchers){e.watchers&&!t.T&&(t.T=e.watchers);const c=Object.entries(null!=(s=t.P)?s:{});if(c.map((([e,[s]])=>{(31&s||2&l&&32&s)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).A.get(t))(0,e)},set(l){((e,t,l,s)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${s.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.A.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||g(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,s.P[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.A.set(t,l),a)){if(s.T&&128&u){const e=s.T[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){o(e,i)}}))}2==(18&u)&&I(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){a.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.T)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.T)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,t])=>{const n=t[1]||e;return l.set(n,e),n}))]))}}return e},le=(e,l={})=>{var f;const m=[],d=l.exclude||[],p=c.customElements,y=u.head,$=y.querySelector("meta[charset]"),v=u.createElement("style"),w=[];let b,S=!0;Object.assign(a,l),a.o=new URL(l.resourcesUrl||"./",u.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((l=>{var i;const c={l:l[0],v:l[1],P:l[2],F:l[3]};4&c.l&&(g=!0),c.P=l[2],c.T=null!=(i=l[4])?i:{};const u=c.v,f=class extends HTMLElement{constructor(e){super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,A:new Map};l.H=new Promise((e=>l.M=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c)}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),S?w.push(this):a.jmp((()=>(e=>{if(!(1&a.l)){const t=n(e),l=t.k,i=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.H)&&t.H.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){B(t,t.j=n);break}}l.P&&Object.entries(l.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.N){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.N;if(!n)return;const l=s.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(s.set(n,e),e[t])),o)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.R}" was not found`);l.isProxied||(n.T=l.watchers,ne(l,n,2),l.isProxied=!0);const r=()=>{};t.l|=8;try{new l(t)}catch(e){o(e)}t.l&=-9,t.l|=128,r()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=H(n);if(!r.has(t)){const l=()=>{};((e,t,n)=>{let l=r.get(e);h&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,r.set(e,l)})(t,e,!!(1&n.l)),l()}}}const i=t.j,c=()=>I(t,!0);i&&i["s-rc"]?i["s-rc"].push(c):c()})(e,t,l)}i()}})(this)))}disconnectedCallback(){a.jmp((()=>(async()=>{if(!(1&a.l)){const e=n(this);(null==e?void 0:e.t)||(null==e?void 0:e.H)&&e.H.then((()=>{}))}})()))}componentOnReady(){return n(this).H}};c.N=e[0],d.includes(u)||p.get(u)||(m.push(u),p.define(u,ne(f,c,1)))}))})),m.length>0&&(g&&(v.textContent+=i),v.textContent+=m.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const e=null!=(f=a.O)?f:j(u);null!=e&&v.setAttribute("nonce",e),y.insertBefore(v,$?$.nextSibling:y.firstChild)}S=!1,w.length?w.map((e=>e.connectedCallback())):a.jmp((()=>b=setTimeout(ee,30)))},oe=e=>a.O=e;export{A as H,le as b,x as h,f as p,l as r,oe as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,H as n}from"./p-4928252f.js";const o=class{constructor(t){e(this,t),this.structure=void 0,this.width=void 0,this.height=void 0,this.borderRadius=void 0,this.marginBottom=void 0,this.marginTop=void 0,this.marginLeft=void 0,this.marginRight=void 0,this.animation=!0,this.rows=void 0,this.size=void 0,this.color=void 0,this.primaryColor=void 0,this.secondaryColor=void 0}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Image "+(this.animation?"Skeleton":"")}))}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.width};\n --emw-skeleton-logo-height: ${this.height};\n --emw-skeleton-logo-border-radius: ${this.borderRadius}px;\n --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-logo-margin-top: ${this.marginTop}px;\n --emw-skeleton-logo-margin-left: ${this.marginLeft}px;\n --emw-skeleton-logo-margin-right: ${this.marginRight}px;\n --emw-skeleton-logo-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.width};\n --emw-skeleton-image-height: ${this.height};\n --emw-skeleton-image-border-radius: ${this.borderRadius}px;\n --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-image-margin-top: ${this.marginTop}px;\n --emw-skeleton-image-margin-left: ${this.marginLeft}px;\n --emw-skeleton-image-margin-right: ${this.marginRight}px;\n --emw-skeleton-image-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.width};\n --emw-skeleton-title-height: ${this.height};\n --emw-skeleton-title-border-radius: ${this.borderRadius}px;\n --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-title-margin-top: ${this.marginTop}px;\n --emw-skeleton-title-margin-left: ${this.marginLeft}px;\n --emw-skeleton-title-margin-right: ${this.marginRight}px;\n --emw-skeleton-title-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.width};\n --emw-skeleton-text-height: ${this.height};\n --emw-skeleton-text-border-radius: ${this.borderRadius}px;\n --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-text-margin-top: ${this.marginTop}px;\n --emw-skeleton-text-margin-left: ${this.marginLeft}px;\n --emw-skeleton-text-margin-right: ${this.marginRight}px;\n --emw-skeleton-text-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.width};\n --emw-skeleton-rectangle-height: ${this.height};\n --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;\n --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;\n --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;\n --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;\n --emw-skeleton-rectangle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.size};\n --emw-skeleton-circle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;default:e=""}return t(n,{key:"58f7f9acd15f0f96b8b6f47f6bea81d49a3857c5"},t("style",{key:"c72ac31d1c55fd5d18ec334629db45977a0f6124"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};o.style=":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 250px);height:var(--emw-skeleton-image-height, 200px);border-radius:var(--emw-skeleton-image-border-radius, 10px)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";export{o as U}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{U as ui_skeleton}from"./p-73f0c8e4.js";import"./p-4928252f.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,b as o}from"./p-
|
|
1
|
+
import{p as r,b as o}from"./p-4928252f.js";export{s as setNonce}from"./p-4928252f.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),r(t)})().then((async r=>(await t(),o([["p-c73b7e7d",[[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[2,"border-radius"],marginBottom:[2,"margin-bottom"],marginTop:[2,"margin-top"],marginLeft:[2,"margin-left"],marginRight:[2,"margin-right"],animation:[4],rows:[2],size:[1],color:[1],primaryColor:[1,"primary-color"],secondaryColor:[1,"secondary-color"]},null,{structure:["handleStructureChange"]}]]]],r))));
|
package/package.json
CHANGED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-00751390.js');
|
|
4
|
-
|
|
5
|
-
const uiSkeletonCss = ".Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 250px);height:var(--emw-skeleton-image-height, 200px);border-radius:var(--emw-skeleton-image-border-radius, 10px)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
|
|
6
|
-
const UiSkeletonStyle0 = uiSkeletonCss;
|
|
7
|
-
|
|
8
|
-
const UiSkeleton = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
index.registerInstance(this, hostRef);
|
|
11
|
-
this.structure = undefined;
|
|
12
|
-
this.width = undefined;
|
|
13
|
-
this.height = undefined;
|
|
14
|
-
this.borderRadius = undefined;
|
|
15
|
-
this.marginBottom = undefined;
|
|
16
|
-
this.marginTop = undefined;
|
|
17
|
-
this.marginLeft = undefined;
|
|
18
|
-
this.marginRight = undefined;
|
|
19
|
-
this.animation = true;
|
|
20
|
-
this.rows = undefined;
|
|
21
|
-
this.size = undefined;
|
|
22
|
-
this.color = undefined;
|
|
23
|
-
this.primaryColor = undefined;
|
|
24
|
-
this.secondaryColor = undefined;
|
|
25
|
-
}
|
|
26
|
-
handleStructureChange(newValue, oldValue) {
|
|
27
|
-
if (oldValue !== newValue) {
|
|
28
|
-
this.handleStructure(newValue);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
updateStyles() {
|
|
32
|
-
if (this.primaryColor) {
|
|
33
|
-
this.skeletonContainer.style.setProperty('--emw-skeleton-primary-color', this.primaryColor);
|
|
34
|
-
}
|
|
35
|
-
if (this.secondaryColor) {
|
|
36
|
-
this.skeletonContainer.style.setProperty('--emw-skeleton-secondary-color', this.secondaryColor);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
handleStructure(structure) {
|
|
40
|
-
switch (structure) {
|
|
41
|
-
case 'logo':
|
|
42
|
-
return this.renderLogo();
|
|
43
|
-
case 'image':
|
|
44
|
-
return this.renderImage();
|
|
45
|
-
case 'title':
|
|
46
|
-
return this.renderTitle();
|
|
47
|
-
case 'text':
|
|
48
|
-
return this.renderText();
|
|
49
|
-
case 'rectangle':
|
|
50
|
-
return this.renderRectangle();
|
|
51
|
-
case 'circle':
|
|
52
|
-
return this.renderCircle();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
renderLogo() {
|
|
56
|
-
const styles = {
|
|
57
|
-
width: `${this.width}`,
|
|
58
|
-
height: `${this.height}`,
|
|
59
|
-
'background-color': `${this.color}`,
|
|
60
|
-
'border-radius': `${this.borderRadius}px`,
|
|
61
|
-
'margin-bottom': `${this.marginBottom}px`,
|
|
62
|
-
'margin-top': `${this.marginTop}px`,
|
|
63
|
-
'margin-left': `${this.marginLeft}px`,
|
|
64
|
-
'margin-right': `${this.marginRight}px`
|
|
65
|
-
};
|
|
66
|
-
return (index.h("div", { ref: el => this.skeletonContainer = el }, index.h("div", { style: styles, class: "Logo " + (this.animation ? 'Skeleton' : '') })));
|
|
67
|
-
}
|
|
68
|
-
renderImage() {
|
|
69
|
-
const styles = {
|
|
70
|
-
width: `${this.width}`,
|
|
71
|
-
height: `${this.height}`,
|
|
72
|
-
'background-color': `${this.color}`,
|
|
73
|
-
'border-radius': `${this.borderRadius}px`,
|
|
74
|
-
'margin-bottom': `${this.marginBottom}px`,
|
|
75
|
-
'margin-top': `${this.marginTop}px`,
|
|
76
|
-
'margin-left': `${this.marginLeft}px`,
|
|
77
|
-
'margin-right': `${this.marginRight}px`
|
|
78
|
-
};
|
|
79
|
-
return (index.h("div", { ref: el => this.skeletonContainer = el }, index.h("div", { style: styles, class: "Image " + (this.animation ? 'Skeleton' : '') })));
|
|
80
|
-
}
|
|
81
|
-
renderTitle() {
|
|
82
|
-
const styles = {
|
|
83
|
-
width: `${this.width}`,
|
|
84
|
-
height: `${this.height}`,
|
|
85
|
-
'background-color': `${this.color}`,
|
|
86
|
-
'border-radius': `${this.borderRadius}px`,
|
|
87
|
-
'margin-bottom': `${this.marginBottom}px`,
|
|
88
|
-
'margin-top': `${this.marginTop}px`,
|
|
89
|
-
'margin-left': `${this.marginLeft}px`,
|
|
90
|
-
'margin-right': `${this.marginRight}px`
|
|
91
|
-
};
|
|
92
|
-
return (index.h("div", { ref: el => this.skeletonContainer = el }, index.h("div", { style: styles, class: "Title " + (this.animation ? 'Skeleton' : '') })));
|
|
93
|
-
}
|
|
94
|
-
renderText() {
|
|
95
|
-
const styles = {
|
|
96
|
-
width: `${this.width}`,
|
|
97
|
-
height: `${this.height}`,
|
|
98
|
-
'background-color': `${this.color}`,
|
|
99
|
-
'border-radius': `${this.borderRadius}px`,
|
|
100
|
-
'margin-bottom': `${this.marginBottom}px`,
|
|
101
|
-
'margin-top': `${this.marginTop}px`,
|
|
102
|
-
'margin-left': `${this.marginLeft}px`,
|
|
103
|
-
'margin-right': `${this.marginRight}px`
|
|
104
|
-
};
|
|
105
|
-
return (Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { style: styles, key: index$1, class: "Text " + (this.animation ? 'Skeleton' : '') }))));
|
|
106
|
-
}
|
|
107
|
-
renderRectangle() {
|
|
108
|
-
const styles = {
|
|
109
|
-
width: `${this.width}`,
|
|
110
|
-
height: `${this.height}`,
|
|
111
|
-
'background-color': `${this.color}`,
|
|
112
|
-
'border-radius': `${this.borderRadius}px`,
|
|
113
|
-
'margin-bottom': `${this.marginBottom}px`,
|
|
114
|
-
'margin-top': `${this.marginTop}px`,
|
|
115
|
-
'margin-left': `${this.marginLeft}px`,
|
|
116
|
-
'margin-right': `${this.marginRight}px`
|
|
117
|
-
};
|
|
118
|
-
return (index.h("div", { ref: el => this.skeletonContainer = el }, index.h("div", { style: styles, class: "Rectangle " + (this.animation ? 'Skeleton' : '') })));
|
|
119
|
-
}
|
|
120
|
-
renderCircle() {
|
|
121
|
-
const styles = {
|
|
122
|
-
width: `${this.size}`,
|
|
123
|
-
height: `${this.size}`,
|
|
124
|
-
'background-color': `${this.color}`,
|
|
125
|
-
'margin-bottom': `${this.marginBottom}px`,
|
|
126
|
-
'margin-top': `${this.marginTop}px`,
|
|
127
|
-
'margin-left': `${this.marginLeft}px`,
|
|
128
|
-
'margin-right': `${this.marginRight}px`
|
|
129
|
-
};
|
|
130
|
-
return (index.h("div", { ref: el => this.skeletonContainer = el }, index.h("div", { style: styles, class: "Circle " + (this.animation ? 'Skeleton' : '') })));
|
|
131
|
-
}
|
|
132
|
-
componentDidLoad() {
|
|
133
|
-
this.updateStyles();
|
|
134
|
-
}
|
|
135
|
-
render() {
|
|
136
|
-
return (this.handleStructure(this.structure));
|
|
137
|
-
}
|
|
138
|
-
static get watchers() { return {
|
|
139
|
-
"structure": ["handleStructureChange"],
|
|
140
|
-
"primaryColor": ["updateStyles"],
|
|
141
|
-
"secondaryColor": ["updateStyles"]
|
|
142
|
-
}; }
|
|
143
|
-
};
|
|
144
|
-
UiSkeleton.style = UiSkeletonStyle0;
|
|
145
|
-
|
|
146
|
-
exports.UiSkeleton = UiSkeleton;
|