@e1011/es-kit 1.0.34 → 1.0.38
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/hooks/esm/index.css +27 -22
- package/dist/hooks/index.css +27 -22
- package/dist/lib/cjs/index.css +8 -3
- package/dist/lib/cjs/src/core/ui/components/container/FBox.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/FBox.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/icon.module.scss.js +1 -1
- package/dist/lib/cjs/src/core/utils/webComponents/webComponent.utils.js +2 -0
- package/dist/lib/cjs/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/dist/lib/cjs/src/index.js +1 -1
- package/dist/lib/esm/index.css +8 -3
- package/dist/lib/esm/src/core/ui/components/container/FBox.js +1 -1
- package/dist/lib/esm/src/core/ui/components/container/FBox.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/icon.module.scss.js +1 -1
- package/dist/lib/esm/src/core/utils/webComponents/webComponent.utils.js +2 -0
- package/dist/lib/esm/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/dist/lib/esm/src/index.js +1 -1
- package/dist/lib/src/core/ui/components/container/FBox.js +1 -1
- package/dist/lib/src/core/ui/components/container/FBox.js.map +1 -1
- package/dist/lib/src/core/ui/components/icon/IconBase.js +5 -5
- package/dist/lib/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/lib/src/core/ui/components/icon/IconWC.js +10 -15
- package/dist/lib/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/src/core/utils/index.js +1 -1
- package/dist/lib/src/core/utils/index.js.map +1 -1
- package/dist/lib/src/core/utils/webComponents/exampleCustomElement.js +41 -0
- package/dist/lib/src/core/utils/webComponents/exampleCustomElement.js.map +1 -0
- package/dist/lib/src/core/utils/webComponents/index.js +2 -0
- package/dist/lib/src/core/utils/webComponents/index.js.map +1 -0
- package/dist/lib/src/core/utils/webComponents/webComponent.utils.js +29 -0
- package/dist/lib/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/ui/components/container/Flex.d.ts +6 -6
- package/dist/types/src/core/ui/components/icon/IconBase.d.ts +12 -1
- package/dist/types/src/core/ui/components/icon/IconBase.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/icon/IconWC.d.ts +12 -0
- package/dist/types/src/core/ui/components/icon/IconWC.d.ts.map +1 -1
- package/dist/types/src/core/utils/index.d.ts +1 -1
- package/dist/types/src/core/utils/index.d.ts.map +1 -1
- package/dist/types/src/core/utils/webComponents/exampleCustomElement.d.ts +7 -0
- package/dist/types/src/core/utils/webComponents/exampleCustomElement.d.ts.map +1 -0
- package/dist/types/src/core/utils/webComponents/index.d.ts +2 -0
- package/dist/types/src/core/utils/webComponents/index.d.ts.map +1 -0
- package/dist/types/src/core/utils/webComponents/webComponent.utils.d.ts +9 -0
- package/dist/types/src/core/utils/webComponents/webComponent.utils.d.ts.map +1 -0
- package/dist/ui/esm/index.css +8 -3
- package/dist/ui/esm/node_modules/core-js/internals/a-possible-prototype.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/a-possible-prototype.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/array-for-each.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/array-for-each.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/dom-iterables.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/dom-iterables.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/dom-token-list-prototype.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/dom-token-list-prototype.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/function-uncurry-this-accessor.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/function-uncurry-this-accessor.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/inherit-if-required.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/inherit-if-required.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/is-pure.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/is-pure.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/object-set-prototype-of.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/object-set-prototype-of.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/path.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/path.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/this-number-value.js +2 -0
- package/dist/ui/esm/node_modules/core-js/internals/this-number-value.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/modules/es.number.constructor.js +2 -0
- package/dist/ui/esm/node_modules/core-js/modules/es.number.constructor.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/modules/web.dom-collections.for-each.js +2 -0
- package/dist/ui/esm/node_modules/core-js/modules/web.dom-collections.for-each.js.map +1 -0
- package/dist/ui/esm/src/core/ui/components/container/FBox.js +1 -1
- package/dist/ui/esm/src/core/ui/components/container/FBox.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/icon.module.scss.js +1 -1
- package/dist/ui/esm/src/core/utils/webComponents/webComponent.utils.js +2 -0
- package/dist/ui/esm/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/dist/ui/index.css +8 -3
- package/dist/ui/node_modules/core-js/internals/a-possible-prototype.js +2 -0
- package/dist/ui/node_modules/core-js/internals/a-possible-prototype.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/array-for-each.js +2 -0
- package/dist/ui/node_modules/core-js/internals/array-for-each.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/dom-iterables.js +2 -0
- package/dist/ui/node_modules/core-js/internals/dom-iterables.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/dom-token-list-prototype.js +2 -0
- package/dist/ui/node_modules/core-js/internals/dom-token-list-prototype.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/function-uncurry-this-accessor.js +2 -0
- package/dist/ui/node_modules/core-js/internals/function-uncurry-this-accessor.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/inherit-if-required.js +2 -0
- package/dist/ui/node_modules/core-js/internals/inherit-if-required.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/is-pure.js +2 -0
- package/dist/ui/node_modules/core-js/internals/is-pure.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/object-set-prototype-of.js +2 -0
- package/dist/ui/node_modules/core-js/internals/object-set-prototype-of.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/path.js +2 -0
- package/dist/ui/node_modules/core-js/internals/path.js.map +1 -0
- package/dist/ui/node_modules/core-js/internals/this-number-value.js +2 -0
- package/dist/ui/node_modules/core-js/internals/this-number-value.js.map +1 -0
- package/dist/ui/node_modules/core-js/modules/es.number.constructor.js +2 -0
- package/dist/ui/node_modules/core-js/modules/es.number.constructor.js.map +1 -0
- package/dist/ui/node_modules/core-js/modules/web.dom-collections.for-each.js +2 -0
- package/dist/ui/node_modules/core-js/modules/web.dom-collections.for-each.js.map +1 -0
- package/dist/ui/src/core/ui/components/container/FBox.js +1 -1
- package/dist/ui/src/core/ui/components/container/FBox.js.map +1 -1
- package/dist/ui/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/ui/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/ui/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/ui/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/ui/src/core/ui/components/icon/icon.module.scss.js +1 -1
- package/dist/ui/src/core/utils/webComponents/webComponent.utils.js +2 -0
- package/dist/ui/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/dist/utils/esm/index.css +27 -22
- package/dist/utils/esm/src/core/utils/index.js +1 -1
- package/dist/utils/esm/src/core/utils/webComponents/webComponent.utils.js +2 -0
- package/dist/utils/esm/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/dist/utils/index.css +27 -22
- package/dist/utils/src/core/utils/index.js +1 -1
- package/dist/utils/src/core/utils/webComponents/webComponent.utils.js +2 -0
- package/dist/utils/src/core/utils/webComponents/webComponent.utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,11 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
var IconBase_1;
|
|
8
|
+
import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils';
|
|
8
9
|
import classes from './icon.module.scss';
|
|
9
10
|
const template = document.createElement('template');
|
|
10
11
|
template.innerHTML = '<span class="icon-base"></span>';
|
|
11
|
-
let IconBase = class IconBase extends HTMLElement {
|
|
12
|
+
let IconBase = IconBase_1 = class IconBase extends HTMLElement {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
14
15
|
this.render = () => {
|
|
@@ -16,13 +17,14 @@ let IconBase = class IconBase extends HTMLElement {
|
|
|
16
17
|
if (!this.mainElement) {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
20
|
+
this.classList.add(classes['icon-base-parent']);
|
|
19
21
|
this.mainElement.classList.add(classes['icon-base']);
|
|
20
22
|
const styles = {
|
|
21
|
-
'--min-width': this.minWidth || 'unset',
|
|
22
|
-
'--min-height': this.minHeight || 'unset',
|
|
23
|
+
'--min-width': Math.min(Number(this.minWidth), Number(this.size || this.width)) || 'unset',
|
|
24
|
+
'--min-height': Math.min(Number(this.minHeight), Number(this.size || this.height)) || 'unset',
|
|
23
25
|
'--width': this.size || this.width || 'unset',
|
|
24
26
|
'--height': this.size || this.height || 'unset',
|
|
25
|
-
...(this.
|
|
27
|
+
...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),
|
|
26
28
|
...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),
|
|
27
29
|
...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),
|
|
28
30
|
};
|
|
@@ -31,21 +33,14 @@ let IconBase = class IconBase extends HTMLElement {
|
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
static get observedAttributes() {
|
|
34
|
-
return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'color', 'className'];
|
|
36
|
+
return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className'];
|
|
35
37
|
}
|
|
36
38
|
connectedCallback() {
|
|
37
39
|
if (this.innerHTML) {
|
|
38
40
|
this.content = this.content || this.innerHTML || this.getAttribute('content');
|
|
39
41
|
}
|
|
40
42
|
this.innerHTML = template.innerHTML;
|
|
41
|
-
this
|
|
42
|
-
this.minWidth = this.minWidth || this.getAttribute('minWidth');
|
|
43
|
-
this.minHeight = this.minHeight || this.getAttribute('minHeight');
|
|
44
|
-
this.width = this.width || this.getAttribute('width');
|
|
45
|
-
this.height = this.height || this.getAttribute('height');
|
|
46
|
-
this.size = this.size || this.getAttribute('size');
|
|
47
|
-
this.color = this.color || this.getAttribute('color');
|
|
48
|
-
this.className = (this.className || this.getAttribute('className'));
|
|
43
|
+
resolveAttributes(this, IconBase_1.observedAttributes);
|
|
49
44
|
this.render();
|
|
50
45
|
}
|
|
51
46
|
attributeChangedCallback(attrName, oldVal, newVal) {
|
|
@@ -63,7 +58,7 @@ let IconBase = class IconBase extends HTMLElement {
|
|
|
63
58
|
this.render();
|
|
64
59
|
}
|
|
65
60
|
};
|
|
66
|
-
IconBase = __decorate([
|
|
61
|
+
IconBase = IconBase_1 = __decorate([
|
|
67
62
|
ced('icon-base')
|
|
68
63
|
], IconBase);
|
|
69
64
|
export default IconBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWC.js","sourceRoot":"","sources":["../../../../../../../src/core/ui/components/icon/IconWC.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconWC.js","sourceRoot":"","sources":["../../../../../../../src/core/ui/components/icon/IconWC.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAExF,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAIxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;AAEnD,QAAQ,CAAC,SAAS,GAAG,iCAAiC,CAAA;AAevC,IAAM,QAAQ,gBAAd,MAAM,QAAS,SAAQ,WAAW;IAAlC;;QAoDb,WAAM,GAAG,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,aAAa,CAAC,YAAY,CAAgB,CAAA;YACtF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;gBACrB,OAAM;aACP;YACD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;YAC/C,IAAI,CA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;AA1EoB,QAAQ;IAD5B,GAAG,CAAC,WAAW,CAAC;GACI,QAAQ,CA0E5B;eA1EoB,QAAQ;AAqF7B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU,EAAE,QAAQ;CACrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,QAAQ,CAAA;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { ced } from './webComponent.utils';
|
|
11
|
+
let CustomTitle = class CustomTitle extends HTMLElement {
|
|
12
|
+
static get observedAttributes() {
|
|
13
|
+
return ['text'];
|
|
14
|
+
}
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.attachShadow({ mode: 'open' });
|
|
18
|
+
this.shadowRoot.innerHTML = '<div class=\'title\'><b>Title</b><i><slot id=\'subtitle\'></slot></i></div>';
|
|
19
|
+
}
|
|
20
|
+
attributeChangedCallback(attrName, oldVal, newVal) {
|
|
21
|
+
switch (attrName) {
|
|
22
|
+
case 'text': {
|
|
23
|
+
this.text = newVal;
|
|
24
|
+
const mainElement = this.shadowRoot?.querySelector('b');
|
|
25
|
+
if (mainElement) {
|
|
26
|
+
mainElement.innerText = newVal;
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
default: {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
CustomTitle = __decorate([
|
|
37
|
+
ced('custom-title'),
|
|
38
|
+
__metadata("design:paramtypes", [])
|
|
39
|
+
], CustomTitle);
|
|
40
|
+
export { CustomTitle };
|
|
41
|
+
//# sourceMappingURL=exampleCustomElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exampleCustomElement.js","sourceRoot":"","sources":["../../../../../../src/core/utils/webComponents/exampleCustomElement.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGnC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAG1C,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,MAAM,CAAC,CAAA;IACjB,CAAC;IAED;QACE,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;QACnC,IAAI,CAAC,UAAW,CAAC,SAAS,GAAG,6EAA6E,CAAA;IAC5G,CAAC;IAED,wBAAwB,CAAC,QAAgB,EAAE,MAAc,EAAE,MAAc;QACvE,QAAQ,QAAQ,EAAE;YAChB,KAAK,MAAM,CAAC,CAAC;gBACX,IAAI,CAAC,IAAI,GAAG,MAAM,CAAA;gBAClB,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAgB,CAAA;gBAEtE,IAAI,WAAW,EAAE;oBACf,WAAW,CAAC,SAAS,GAAG,MAAM,CAAA;iBAC/B;gBACD,MAAK;aACN;YACD,OAAO,CAAC,CAAC;gBACP,MAAK;aACN;SACF;IACH,CAAC;CACF,CAAA;AA7BY,WAAW;IADvB,GAAG,CAAC,cAAc,CAAC;;GACP,WAAW,CA6BvB;SA7BY,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/core/utils/webComponents/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* custom elements define */
|
|
2
|
+
export const ced = (name) => (componentClass) => {
|
|
3
|
+
customElements.get(name) || customElements.define(name, componentClass);
|
|
4
|
+
};
|
|
5
|
+
export const customElementDefine = ced;
|
|
6
|
+
export const createResolveAttribute = (component) => (attributeName,
|
|
7
|
+
// eslint-disable-next-line default-param-last
|
|
8
|
+
overrideProperty = true, valueMap) => {
|
|
9
|
+
const attrValue = component.getAttribute(attributeName);
|
|
10
|
+
const attrValueDefined = attrValue !== undefined;
|
|
11
|
+
if (overrideProperty && attrValueDefined && component[attributeName] === undefined) {
|
|
12
|
+
// eslint-disable-next-line no-param-reassign
|
|
13
|
+
component[attributeName] = valueMap ? valueMap(attrValue) : attrValue;
|
|
14
|
+
}
|
|
15
|
+
return attrValueDefined;
|
|
16
|
+
};
|
|
17
|
+
export const resolveAttributes = (component, attributes) => {
|
|
18
|
+
const resolver = createResolveAttribute(component);
|
|
19
|
+
attributes.forEach((attribute) => {
|
|
20
|
+
if (typeof attribute === 'string') {
|
|
21
|
+
resolver(attribute);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { name, override, valueMap } = attribute;
|
|
25
|
+
resolver(name, override, valueMap);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=webComponent.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webComponent.utils.js","sourceRoot":"","sources":["../../../../../../src/core/utils/webComponents/webComponent.utils.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CACnC,cAAkC,EAClC,EAAE;IACF,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAA;AACzE,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAItC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,SAAwC,EACxC,EAAE,CAAC,CACH,aAAqB;AACrB,8CAA8C;AAC9C,gBAAgB,GAAG,IAAI,EACvB,QAAsC,EAC7B,EAAE;IACX,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;IACvD,MAAM,gBAAgB,GAAG,SAAS,KAAK,SAAS,CAAA;IAEhD,IAAI,gBAAgB,IAAI,gBAAgB,IAAI,SAAS,CAAC,aAAa,CAAC,KAAK,SAAS,EAAE;QAClF,6CAA6C;QAC7C,SAAS,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;KACtE;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,SAAwC,EACxC,UAAoG,EACpG,EAAE;IACF,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAA;IAElD,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;Q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