weg-shared-layout 0.0.14 → 0.0.16
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-CmiaQ_Dj.js → index-CC8e1qRm.js} +112 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/weg-footer_2.cjs.entry.js +438 -0
- package/dist/cjs/weg-shared-layout.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/weg-footer/weg-footer.css +1 -24
- package/dist/collection/components/weg-footer/weg-footer.js +5 -40
- package/dist/collection/components/weg-header/logo-data.js +2 -0
- package/dist/collection/components/weg-header/weg-header.cmp.test.js +77 -0
- package/dist/collection/components/weg-header/weg-header.css +327 -0
- package/dist/collection/components/weg-header/weg-header.js +344 -0
- package/dist/collection/styles/shared.css +49 -0
- package/dist/collection/utils/layout.js +33 -0
- package/dist/collection/utils/layout.unit.test.js +36 -0
- package/dist/components/index.js +1 -1
- package/dist/components/my-component.js +1 -1
- package/dist/components/p-CtYuWNO6.js +1 -0
- package/dist/components/p-DbIEJ3IT.js +1 -0
- package/dist/components/weg-footer.js +1 -1
- package/dist/components/weg-header.d.ts +11 -0
- package/dist/components/weg-header.js +1 -0
- package/dist/esm/{index-QiJxC4Ow.js → index-D8pmhPiH.js} +111 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/weg-footer_2.entry.js +435 -0
- package/dist/esm/weg-shared-layout.js +3 -3
- package/dist/types/components/weg-header/logo-data.d.ts +2 -0
- package/dist/types/components/weg-header/weg-header.cmp.test.d.ts +1 -0
- package/dist/types/components/weg-header/weg-header.d.ts +56 -0
- package/dist/types/components.d.ts +56 -2
- package/dist/types/types/layout-data.d.ts +21 -4
- package/dist/types/utils/layout.d.ts +4 -0
- package/dist/types/utils/layout.unit.test.d.ts +1 -0
- package/dist/weg-shared-layout/p-D8pmhPiH.js +2 -0
- package/dist/weg-shared-layout/{p-d1addb13.entry.js → p-d61033bd.entry.js} +1 -1
- package/dist/weg-shared-layout/p-eaf953a4.entry.js +1 -0
- package/dist/weg-shared-layout/weg-shared-layout.esm.js +1 -1
- package/docs/angular.md +66 -18
- package/docs/nextjs.md +145 -111
- package/docs/react.md +123 -59
- package/docs/vanilla.md +99 -3
- package/package.json +5 -1
- package/readme.md +29 -3
- package/src/assets/dummy-data.json +41 -1
- package/dist/cjs/weg-footer.cjs.entry.js +0 -189
- package/dist/components/p-BTQYW5OR.js +0 -1
- package/dist/esm/weg-footer.entry.js +0 -187
- package/dist/weg-shared-layout/p-0c28f34f.entry.js +0 -1
- package/dist/weg-shared-layout/p-QiJxC4Ow.js +0 -2
|
@@ -138,6 +138,23 @@ var plt = {
|
|
|
138
138
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
139
139
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
140
140
|
};
|
|
141
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
142
|
+
var _a;
|
|
143
|
+
let supportsListenerOptions2 = false;
|
|
144
|
+
try {
|
|
145
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
146
|
+
"e",
|
|
147
|
+
null,
|
|
148
|
+
Object.defineProperty({}, "passive", {
|
|
149
|
+
get() {
|
|
150
|
+
supportsListenerOptions2 = true;
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
} catch (e) {
|
|
155
|
+
}
|
|
156
|
+
return supportsListenerOptions2;
|
|
157
|
+
})();
|
|
141
158
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
142
159
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
143
160
|
try {
|
|
@@ -489,6 +506,11 @@ var normalizeWatchers = (raw) => {
|
|
|
489
506
|
// src/runtime/parse-property-value.ts
|
|
490
507
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
491
508
|
if (propValue != null && !isComplexType(propValue)) {
|
|
509
|
+
if (propType & 4 /* Boolean */) {
|
|
510
|
+
{
|
|
511
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
492
514
|
if (propType & 1 /* String */) {
|
|
493
515
|
return String(propValue);
|
|
494
516
|
}
|
|
@@ -496,6 +518,25 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
496
518
|
}
|
|
497
519
|
return propValue;
|
|
498
520
|
};
|
|
521
|
+
var getElement = (ref) => {
|
|
522
|
+
var _a;
|
|
523
|
+
return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
// src/runtime/event-emitter.ts
|
|
527
|
+
var createEvent = (ref, name, flags) => {
|
|
528
|
+
const elm = getElement(ref);
|
|
529
|
+
return {
|
|
530
|
+
emit: (detail) => {
|
|
531
|
+
return emitEvent(elm, name, {
|
|
532
|
+
bubbles: true,
|
|
533
|
+
composed: true,
|
|
534
|
+
cancelable: true,
|
|
535
|
+
detail
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
};
|
|
499
540
|
var emitEvent = (elm, name, opts) => {
|
|
500
541
|
const ev = plt.ce(name, opts);
|
|
501
542
|
elm.dispatchEvent(ev);
|
|
@@ -923,10 +964,19 @@ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
|
923
964
|
};
|
|
924
965
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
925
966
|
const hostElm = hostRef.$hostElement$;
|
|
967
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
926
968
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
927
969
|
const isHostElement = isHost(renderFnResults);
|
|
928
970
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
929
971
|
hostTagName = hostElm.tagName;
|
|
972
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
973
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
974
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
975
|
+
{
|
|
976
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
}
|
|
930
980
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
931
981
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
932
982
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -985,6 +1035,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
985
1035
|
let maybePromise;
|
|
986
1036
|
if (isInitialLoad) {
|
|
987
1037
|
{
|
|
1038
|
+
{
|
|
1039
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1040
|
+
if (hostRef.$queuedListeners$) {
|
|
1041
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
1042
|
+
hostRef.$queuedListeners$ = void 0;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
988
1045
|
if (hostRef.$fetchedCbList$.length) {
|
|
989
1046
|
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
990
1047
|
}
|
|
@@ -1301,8 +1358,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1301
1358
|
/* @__PURE__ */ new Set([
|
|
1302
1359
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1303
1360
|
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
1361
|
+
var _a2;
|
|
1304
1362
|
const attrName = m[1] || propName;
|
|
1305
1363
|
attrNameToPropName.set(attrName, propName);
|
|
1364
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1365
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1366
|
+
}
|
|
1306
1367
|
return attrName;
|
|
1307
1368
|
})
|
|
1308
1369
|
])
|
|
@@ -1434,6 +1495,7 @@ var connectedCallback = (elm) => {
|
|
|
1434
1495
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1435
1496
|
}
|
|
1436
1497
|
} else {
|
|
1498
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1437
1499
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1438
1500
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1439
1501
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -1451,6 +1513,12 @@ var disconnectInstance = (instance, elm) => {
|
|
|
1451
1513
|
var disconnectedCallback = async (elm) => {
|
|
1452
1514
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1453
1515
|
const hostRef = getHostRef(elm);
|
|
1516
|
+
{
|
|
1517
|
+
if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
|
|
1518
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1519
|
+
hostRef.$rmListeners$ = void 0;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1454
1522
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1455
1523
|
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1456
1524
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -1496,6 +1564,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1496
1564
|
{
|
|
1497
1565
|
cmpMeta.$members$ = compactMeta[2];
|
|
1498
1566
|
}
|
|
1567
|
+
{
|
|
1568
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1569
|
+
}
|
|
1570
|
+
{
|
|
1571
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1572
|
+
}
|
|
1499
1573
|
{
|
|
1500
1574
|
cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
|
|
1501
1575
|
cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
|
|
@@ -1532,6 +1606,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1532
1606
|
}
|
|
1533
1607
|
if (!this.hasRegisteredEventListeners) {
|
|
1534
1608
|
this.hasRegisteredEventListeners = true;
|
|
1609
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1535
1610
|
}
|
|
1536
1611
|
if (appLoadFallback) {
|
|
1537
1612
|
clearTimeout(appLoadFallback);
|
|
@@ -1598,6 +1673,41 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1598
1673
|
}
|
|
1599
1674
|
endBootstrap();
|
|
1600
1675
|
};
|
|
1676
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1677
|
+
if (listeners && win.document) {
|
|
1678
|
+
listeners.map(([flags, name, method]) => {
|
|
1679
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1680
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1681
|
+
const opts = hostListenerOpts(flags);
|
|
1682
|
+
plt.ael(target, name, handler, opts);
|
|
1683
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1688
|
+
var _a;
|
|
1689
|
+
try {
|
|
1690
|
+
{
|
|
1691
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
1692
|
+
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
1693
|
+
} else {
|
|
1694
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
} catch (e) {
|
|
1698
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1702
|
+
if (flags & 8 /* TargetWindow */) {
|
|
1703
|
+
return win;
|
|
1704
|
+
}
|
|
1705
|
+
return elm;
|
|
1706
|
+
};
|
|
1707
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1708
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
1709
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
1710
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
1601
1711
|
|
|
1602
1712
|
// src/runtime/nonce.ts
|
|
1603
1713
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
@@ -1606,6 +1716,8 @@ function transformTag(tag) {
|
|
|
1606
1716
|
}
|
|
1607
1717
|
|
|
1608
1718
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1719
|
+
exports.createEvent = createEvent;
|
|
1720
|
+
exports.getElement = getElement;
|
|
1609
1721
|
exports.h = h;
|
|
1610
1722
|
exports.promiseResolve = promiseResolve;
|
|
1611
1723
|
exports.registerInstance = registerInstance;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CC8e1qRm.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["
|
|
9
|
+
return index.bootstrapLazy([["weg-footer_2.cjs",[[513,"weg-footer",{"layout":[1],"resolved":[32]},null,{"layout":[{"watchLayout":0}]}],[513,"weg-header",{"layout":[1],"signedIn":[516,"signed-in"],"resolved":[32],"menuOpen":[32],"openDropdown":[32],"expandedSection":[32]},[[8,"keydown","handleKeyDown"]],{"layout":[{"watchLayout":0}]}]]],["my-component.cjs",[[513,"my-component",{"first":[1],"middle":[1],"last":[1]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|