@swisspost/design-system-components 2.1.0 → 7.0.0
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/README.md +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/check-one-of-f4f5d0c0.js +8 -0
- package/dist/cjs/{index-f243643b.js → index-3b732d59.js} +85 -25
- package/dist/cjs/{index-8c288b1a.js → index-a1440961.js} +2 -6
- package/dist/cjs/index.cjs.js +20 -15
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/{package-96a46572.js → package-45af106a.js} +1 -1
- package/dist/cjs/{post-accordion-9d27458a.js → post-accordion-7507f838.js} +22 -20
- package/dist/cjs/post-accordion-item-5bf4d98b.js +53 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +5 -4
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/post-alert-9c39c854.js +98 -0
- package/dist/cjs/post-alert.cjs.entry.js +5 -4
- package/dist/cjs/post-card-control-4a16b3d7.js +311 -0
- package/dist/cjs/post-card-control.cjs.entry.js +14 -0
- package/dist/cjs/{post-collapsible-1867015c.js → post-collapsible-00319f1f.js} +7 -7
- package/dist/cjs/post-collapsible.cjs.entry.js +5 -4
- package/dist/cjs/post-components.cjs.js +6 -4
- package/dist/cjs/{post-icon-07a67b83.js → post-icon-09845341.js} +5 -5
- package/dist/cjs/post-icon.cjs.entry.js +5 -4
- package/dist/cjs/post-popover-3b6aaeae.js +104 -0
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/{post-popovercontainer-003c0819.js → post-popovercontainer-0b8343ac.js} +26 -45
- package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
- package/dist/cjs/post-rating-285f966e.js +88 -0
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-f1c16656.js +32 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-6a9c4a4f.js → post-tab-panel-9c20a84e.js} +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-2eb6f376.js → post-tabs-75e71078.js} +23 -21
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/post-tag-942085fd.js +43 -0
- package/dist/cjs/post-tag.cjs.entry.js +11 -0
- package/dist/cjs/{post-tooltip-260d0627.js → post-tooltip-94d4f21f.js} +12 -9
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/post-accordion/post-accordion.js +22 -20
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +7 -5
- package/dist/collection/components/post-alert/alert-types.js +1 -1
- package/dist/collection/components/post-alert/post-alert.css +2 -2
- package/dist/collection/components/post-alert/post-alert.js +6 -6
- package/dist/collection/components/post-card-control/post-card-control.css +31 -0
- package/dist/collection/components/post-card-control/post-card-control.js +520 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -4
- package/dist/collection/components/post-icon/post-icon.js +2 -2
- package/dist/collection/components/post-popover/post-popover.css +29 -1
- package/dist/collection/components/post-popover/post-popover.js +2 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +6 -6
- package/dist/collection/components/post-rating/post-rating.css +28 -0
- package/dist/collection/components/post-rating/post-rating.js +7 -7
- package/dist/collection/components/post-tab-header/post-tab-header.css +29 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +21 -19
- package/dist/collection/components/post-tag/post-tag.css +31 -0
- package/dist/collection/components/post-tag/post-tag.js +115 -0
- package/dist/collection/components/post-tooltip/post-tooltip.js +11 -8
- package/dist/collection/index.js +2 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/sass-export.js +16 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index2.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +7 -5
- package/dist/components/post-accordion2.js +21 -19
- package/dist/components/post-alert2.js +7 -7
- package/dist/components/post-card-control.d.ts +11 -0
- package/dist/components/post-card-control.js +6 -0
- package/dist/components/post-card-control2.js +342 -0
- package/dist/components/post-collapsible2.js +5 -5
- package/dist/components/post-icon2.js +3 -3
- package/dist/components/post-popover2.js +2 -2
- package/dist/components/post-popovercontainer2.js +24 -43
- package/dist/components/post-rating2.js +6 -6
- package/dist/components/post-tab-header2.js +2 -2
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +21 -19
- package/dist/components/post-tag.d.ts +11 -0
- package/dist/components/post-tag.js +6 -0
- package/dist/components/post-tag2.js +70 -0
- package/dist/components/post-tooltip2.js +10 -7
- package/dist/docs.json +477 -18
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/check-one-of-6b3ef8eb.js +6 -0
- package/dist/esm/{index-1708db56.js → index-961099d2.js} +85 -25
- package/dist/esm/{index-b444db27.js → index-d1eba94c.js} +1 -5
- package/dist/esm/index.js +18 -15
- package/dist/esm/loader.js +6 -4
- package/dist/esm/{package-50a9c0c3.js → package-1242b80d.js} +1 -1
- package/dist/esm/{post-accordion-33fe4f0e.js → post-accordion-bfd058bc.js} +22 -20
- package/dist/esm/post-accordion-item-4fa44842.js +51 -0
- package/dist/esm/post-accordion-item.entry.js +5 -4
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/post-alert-192d0176.js +96 -0
- package/dist/esm/post-alert.entry.js +5 -4
- package/dist/esm/post-card-control-b23e1e6f.js +309 -0
- package/dist/esm/post-card-control.entry.js +6 -0
- package/dist/esm/{post-collapsible-50dc361b.js → post-collapsible-d848eb2a.js} +7 -7
- package/dist/esm/post-collapsible.entry.js +5 -4
- package/dist/esm/post-components.js +7 -5
- package/dist/esm/{post-icon-00f314ae.js → post-icon-811654f7.js} +5 -5
- package/dist/esm/post-icon.entry.js +5 -4
- package/dist/esm/post-popover-b48a9d7c.js +102 -0
- package/dist/esm/post-popover.entry.js +3 -3
- package/dist/esm/{post-popovercontainer-62e1fd82.js → post-popovercontainer-7413bb41.js} +26 -45
- package/dist/esm/post-popovercontainer.entry.js +3 -3
- package/dist/esm/post-rating-806de800.js +86 -0
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-95f0dc6a.js +30 -0
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-37a1331f.js → post-tab-panel-d7145a70.js} +3 -3
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-c4e65a45.js → post-tabs-f130a7d8.js} +23 -21
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/post-tag-7c329d6c.js +41 -0
- package/dist/esm/post-tag.entry.js +3 -0
- package/dist/esm/{post-tooltip-033f63fa.js → post-tooltip-942bd014.js} +12 -9
- package/dist/esm/post-tooltip.entry.js +3 -3
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0d4e50a9.js +1 -0
- package/dist/post-components/p-1c780bac.entry.js +1 -0
- package/dist/post-components/p-2524b6b9.entry.js +1 -0
- package/dist/post-components/p-2ee23269.entry.js +1 -0
- package/dist/post-components/p-416426cc.js +1 -0
- package/dist/post-components/p-41c9c59f.js +1 -0
- package/dist/post-components/p-46cea7ee.js +1 -0
- package/dist/post-components/p-4aa14704.js +1 -0
- package/dist/post-components/p-579f55af.js +1 -0
- package/dist/post-components/p-5b2cdcf0.js +2 -0
- package/dist/post-components/p-60b02cbb.entry.js +1 -0
- package/dist/post-components/p-611b3c41.js +1 -0
- package/dist/post-components/p-62407836.entry.js +1 -0
- package/dist/post-components/p-6308fd47.js +1 -0
- package/dist/post-components/p-6fba8cb2.entry.js +1 -0
- package/dist/post-components/p-86acda91.entry.js +1 -0
- package/dist/post-components/{p-7e7833f7.js → p-93ba2827.js} +3 -3
- package/dist/post-components/p-94b5c41e.entry.js +1 -0
- package/dist/post-components/p-a3b54b5f.js +1 -0
- package/dist/post-components/p-a4b6b950.js +1 -0
- package/dist/post-components/p-b4abbb28.js +1 -0
- package/dist/post-components/p-c0f8e385.entry.js +1 -0
- package/dist/post-components/p-c4fe5052.entry.js +1 -0
- package/dist/post-components/p-c9004503.js +1 -0
- package/dist/post-components/p-cd9c10dd.entry.js +1 -0
- package/dist/post-components/p-d4cd7bb0.js +1 -0
- package/dist/post-components/p-d8d76dd1.entry.js +1 -0
- package/dist/post-components/p-e1255160.js +1 -0
- package/dist/post-components/p-e819d5fb.entry.js +1 -0
- package/dist/post-components/p-f44c172a.js +1 -0
- package/dist/post-components/p-f91c0e1b.js +1 -0
- package/dist/post-components/p-f9e58309.js +1 -0
- package/dist/post-components/p-ffb9a651.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +1 -1
- package/dist/types/components/post-alert/alert-types.d.ts +2 -2
- package/dist/types/components/post-alert/post-alert.d.ts +2 -2
- package/dist/types/components/post-card-control/post-card-control.d.ts +109 -0
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +1 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-rating/post-rating.d.ts +2 -2
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +27 -0
- package/dist/types/components.d.ts +178 -12
- package/dist/types/css-modules.js +0 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/css-modules.d.ts +6 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/sass-export.d.ts +2 -0
- package/package.json +17 -17
- package/dist/cjs/post-accordion-item-61fb55fa.js +0 -51
- package/dist/cjs/post-alert-a810f5b9.js +0 -98
- package/dist/cjs/post-popover-9610b64c.js +0 -104
- package/dist/cjs/post-rating-75574abd.js +0 -88
- package/dist/cjs/post-tab-header-85424e32.js +0 -32
- package/dist/esm/post-accordion-item-1fd95c9f.js +0 -49
- package/dist/esm/post-alert-65d67f69.js +0 -96
- package/dist/esm/post-popover-40bfd1b7.js +0 -102
- package/dist/esm/post-rating-f7a79ed4.js +0 -86
- package/dist/esm/post-tab-header-0683252a.js +0 -30
- package/dist/post-components/p-00dcad55.js +0 -1
- package/dist/post-components/p-01e57281.entry.js +0 -1
- package/dist/post-components/p-06c989fb.entry.js +0 -1
- package/dist/post-components/p-07ffb6de.entry.js +0 -1
- package/dist/post-components/p-10b4cf7a.js +0 -2
- package/dist/post-components/p-26c658c1.entry.js +0 -1
- package/dist/post-components/p-2a964700.js +0 -1
- package/dist/post-components/p-35f14000.js +0 -1
- package/dist/post-components/p-3fb09ecd.js +0 -1
- package/dist/post-components/p-4b0a45d8.entry.js +0 -1
- package/dist/post-components/p-53e8e4e7.entry.js +0 -1
- package/dist/post-components/p-598b11b6.js +0 -1
- package/dist/post-components/p-5b6ee52a.entry.js +0 -1
- package/dist/post-components/p-8139faa4.entry.js +0 -1
- package/dist/post-components/p-8cd6d7c2.js +0 -1
- package/dist/post-components/p-99a9602e.js +0 -1
- package/dist/post-components/p-a2775477.entry.js +0 -1
- package/dist/post-components/p-a905b16b.entry.js +0 -1
- package/dist/post-components/p-aa02111b.js +0 -1
- package/dist/post-components/p-b135d3e2.js +0 -1
- package/dist/post-components/p-b81e61ed.entry.js +0 -1
- package/dist/post-components/p-d6bc34ff.js +0 -1
- package/dist/post-components/p-da2b8e26.entry.js +0 -1
- package/dist/post-components/p-f0476913.js +0 -1
- package/dist/post-components/p-f0e82e63.js +0 -1
- package/dist/post-components/p-ff0e1564.js +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A collection of web components built with Stencil JS for the Swiss Post Design S
|
|
|
6
6
|
|
|
7
7
|
## Documentation
|
|
8
8
|
|
|
9
|
-
- Technical docs: [Swiss Post Design System](https://
|
|
9
|
+
- Technical docs: [Swiss Post Design System](https://design-system.post.ch)
|
|
10
10
|
- Design docs: [Experience Hub](https://www.experience-hub.ch/document/2803)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
@@ -32,6 +32,7 @@ const NAMESPACE = 'post-components';
|
|
|
32
32
|
*/
|
|
33
33
|
let scopeId;
|
|
34
34
|
let hostTagName;
|
|
35
|
+
let useNativeShadowDom = false;
|
|
35
36
|
let isSvgMode = false;
|
|
36
37
|
let queuePending = false;
|
|
37
38
|
const createTime = (fnName, tagName = '') => {
|
|
@@ -56,6 +57,12 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
|
56
57
|
* support as of Stencil v4.
|
|
57
58
|
*/
|
|
58
59
|
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
60
|
+
const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
61
|
+
'formAssociatedCallback',
|
|
62
|
+
'formResetCallback',
|
|
63
|
+
'formDisabledCallback',
|
|
64
|
+
'formStateRestoreCallback',
|
|
65
|
+
];
|
|
59
66
|
/**
|
|
60
67
|
* Default style mode id
|
|
61
68
|
*/
|
|
@@ -946,8 +953,7 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
946
953
|
const text = newVNode.$text$;
|
|
947
954
|
if (text === null) {
|
|
948
955
|
{
|
|
949
|
-
if (tag === 'slot')
|
|
950
|
-
;
|
|
956
|
+
if (tag === 'slot' && !useNativeShadowDom) ;
|
|
951
957
|
else {
|
|
952
958
|
// either this is the first render of an element OR it's an update
|
|
953
959
|
// AND we already know it's possible it could have changed
|
|
@@ -1008,6 +1014,7 @@ const nullifyVNodeRefs = (vNode) => {
|
|
|
1008
1014
|
*/
|
|
1009
1015
|
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1010
1016
|
const hostElm = hostRef.$hostElement$;
|
|
1017
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1011
1018
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1012
1019
|
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
1013
1020
|
// we need to call `h` again to wrap the children of our component in a
|
|
@@ -1044,6 +1051,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1044
1051
|
{
|
|
1045
1052
|
scopeId = hostElm['s-sc'];
|
|
1046
1053
|
}
|
|
1054
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1047
1055
|
// synchronous patch
|
|
1048
1056
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1049
1057
|
};
|
|
@@ -1237,6 +1245,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1237
1245
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1238
1246
|
const instance = hostRef.$lazyInstance$ ;
|
|
1239
1247
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1248
|
+
{
|
|
1249
|
+
safeCall(instance, 'componentDidRender');
|
|
1250
|
+
}
|
|
1240
1251
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1241
1252
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1242
1253
|
{
|
|
@@ -1363,6 +1374,28 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1363
1374
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1364
1375
|
var _a;
|
|
1365
1376
|
const prototype = Cstr.prototype;
|
|
1377
|
+
/**
|
|
1378
|
+
* proxy form associated custom element lifecycle callbacks
|
|
1379
|
+
* @ref https://web.dev/articles/more-capable-form-controls#lifecycle_callbacks
|
|
1380
|
+
*/
|
|
1381
|
+
if (cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */ && flags & 1 /* PROXY_FLAGS.isElementConstructor */) {
|
|
1382
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => Object.defineProperty(prototype, cbName, {
|
|
1383
|
+
value(...args) {
|
|
1384
|
+
const hostRef = getHostRef(this);
|
|
1385
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1386
|
+
if (!instance) {
|
|
1387
|
+
hostRef.$onReadyPromise$.then((instance) => {
|
|
1388
|
+
const cb = instance[cbName];
|
|
1389
|
+
typeof cb === 'function' && cb.call(instance, ...args);
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
else {
|
|
1393
|
+
const cb = instance[cbName];
|
|
1394
|
+
typeof cb === 'function' && cb.call(instance, ...args);
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
}));
|
|
1398
|
+
}
|
|
1366
1399
|
if (cmpMeta.$members$) {
|
|
1367
1400
|
if (Cstr.watchers) {
|
|
1368
1401
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
@@ -1510,7 +1543,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1510
1543
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1511
1544
|
// Let the runtime know that the component has been initialized
|
|
1512
1545
|
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1513
|
-
|
|
1546
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1547
|
+
if (bundleId) {
|
|
1514
1548
|
// lazy loaded components
|
|
1515
1549
|
// request the component's implementation to be
|
|
1516
1550
|
// wired up with the host element
|
|
@@ -1557,6 +1591,14 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1557
1591
|
endNewInstance();
|
|
1558
1592
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1559
1593
|
}
|
|
1594
|
+
else {
|
|
1595
|
+
// sync constructor component
|
|
1596
|
+
Cstr = elm.constructor;
|
|
1597
|
+
// wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
|
1598
|
+
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
|
1599
|
+
// Stencil has completed instantiating the component.
|
|
1600
|
+
customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
|
|
1601
|
+
}
|
|
1560
1602
|
if (Cstr.style) {
|
|
1561
1603
|
// this component has styles but we haven't registered them yet
|
|
1562
1604
|
let style = Cstr.style;
|
|
@@ -1743,6 +1785,12 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1743
1785
|
return getHostRef(this).$onReadyPromise$;
|
|
1744
1786
|
}
|
|
1745
1787
|
};
|
|
1788
|
+
// if the component is formAssociated we need to set that on the host
|
|
1789
|
+
// element so that it will be ready for `attachInternals` to be called on
|
|
1790
|
+
// it later on
|
|
1791
|
+
if (cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */) {
|
|
1792
|
+
HostElement.formAssociated = true;
|
|
1793
|
+
}
|
|
1746
1794
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1747
1795
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1748
1796
|
cmpTags.push(tagName);
|
|
@@ -1750,25 +1798,29 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1750
1798
|
}
|
|
1751
1799
|
});
|
|
1752
1800
|
});
|
|
1753
|
-
//
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
//
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1801
|
+
// Only bother generating CSS if we have components
|
|
1802
|
+
// TODO(STENCIL-1118): Add test cases for CSS content based on conditionals
|
|
1803
|
+
if (cmpTags.length > 0) {
|
|
1804
|
+
// Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
|
|
1805
|
+
if (hasSlotRelocation) {
|
|
1806
|
+
dataStyles.textContent += SLOT_FB_CSS;
|
|
1807
|
+
}
|
|
1808
|
+
// Add hydration styles
|
|
1809
|
+
{
|
|
1810
|
+
dataStyles.textContent += cmpTags + HYDRATED_CSS;
|
|
1811
|
+
}
|
|
1812
|
+
// If we have styles, add them to the DOM
|
|
1813
|
+
if (dataStyles.innerHTML.length) {
|
|
1814
|
+
dataStyles.setAttribute('data-styles', '');
|
|
1815
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1816
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1817
|
+
if (nonce != null) {
|
|
1818
|
+
dataStyles.setAttribute('nonce', nonce);
|
|
1819
|
+
}
|
|
1820
|
+
// Insert the styles into the document head
|
|
1821
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
1822
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1768
1823
|
}
|
|
1769
|
-
// Insert the styles into the document head
|
|
1770
|
-
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
1771
|
-
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1772
1824
|
}
|
|
1773
1825
|
// Process deferred connectedCallbacks now all components have been registered
|
|
1774
1826
|
isBootstrapping = false;
|
|
@@ -1914,6 +1966,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1914
1966
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1915
1967
|
/* webpackMode: "lazy" */
|
|
1916
1968
|
'./post-alert.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1969
|
+
case 'post-card-control.cjs':
|
|
1970
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1971
|
+
/* webpackMode: "lazy" */
|
|
1972
|
+
'./post-card-control.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1917
1973
|
case 'post-popover.cjs':
|
|
1918
1974
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1919
1975
|
/* webpackMode: "lazy" */
|
|
@@ -1934,6 +1990,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1934
1990
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1935
1991
|
/* webpackMode: "lazy" */
|
|
1936
1992
|
'./post-tabs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1993
|
+
case 'post-tag.cjs':
|
|
1994
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1995
|
+
/* webpackMode: "lazy" */
|
|
1996
|
+
'./post-tag.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1937
1997
|
case 'post-tooltip.cjs':
|
|
1938
1998
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1939
1999
|
/* webpackMode: "lazy" */
|
|
@@ -1942,14 +2002,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1942
2002
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1943
2003
|
/* webpackMode: "lazy" */
|
|
1944
2004
|
'./post-collapsible.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1945
|
-
case 'post-icon.cjs':
|
|
1946
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1947
|
-
/* webpackMode: "lazy" */
|
|
1948
|
-
'./post-icon.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1949
2005
|
case 'post-popovercontainer.cjs':
|
|
1950
2006
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1951
2007
|
/* webpackMode: "lazy" */
|
|
1952
2008
|
'./post-popovercontainer.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2009
|
+
case 'post-icon.cjs':
|
|
2010
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2011
|
+
/* webpackMode: "lazy" */
|
|
2012
|
+
'./post-icon.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1953
2013
|
}
|
|
1954
2014
|
}
|
|
1955
2015
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const constants = require('./constants-238701d3.js');
|
|
4
|
+
const checkOneOf = require('./check-one-of-f4f5d0c0.js');
|
|
4
5
|
|
|
5
6
|
function emptyOr(check) {
|
|
6
7
|
return (...args) => {
|
|
@@ -10,11 +11,6 @@ function emptyOr(check) {
|
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
function checkOneOf(value, possibleValues, error) {
|
|
14
|
-
if (!possibleValues.includes(value))
|
|
15
|
-
throw new Error(error);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
14
|
function checkPattern(value, pattern, errorMessage) {
|
|
19
15
|
if (typeof value !== 'string' || !pattern.test(value))
|
|
20
16
|
throw new Error(errorMessage);
|
|
@@ -33,7 +29,7 @@ function checkType(value, type, error) {
|
|
|
33
29
|
}
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
32
|
+
const checkEmptyOrOneOf = emptyOr(checkOneOf.checkOneOf);
|
|
37
33
|
const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
38
34
|
const checkEmptyOrType = emptyOr(checkType);
|
|
39
35
|
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postAccordion = require('./post-accordion-
|
|
6
|
-
const postAccordionItem = require('./post-accordion-item-
|
|
7
|
-
const postAlert = require('./post-alert-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
require('./
|
|
18
|
-
require('./
|
|
19
|
-
require('./index-
|
|
5
|
+
const postAccordion = require('./post-accordion-7507f838.js');
|
|
6
|
+
const postAccordionItem = require('./post-accordion-item-5bf4d98b.js');
|
|
7
|
+
const postAlert = require('./post-alert-9c39c854.js');
|
|
8
|
+
const postCardControl = require('./post-card-control-4a16b3d7.js');
|
|
9
|
+
const postCollapsible = require('./post-collapsible-00319f1f.js');
|
|
10
|
+
const postIcon = require('./post-icon-09845341.js');
|
|
11
|
+
const postPopover = require('./post-popover-3b6aaeae.js');
|
|
12
|
+
const postPopovercontainer = require('./post-popovercontainer-0b8343ac.js');
|
|
13
|
+
const postRating = require('./post-rating-285f966e.js');
|
|
14
|
+
const postTabs = require('./post-tabs-75e71078.js');
|
|
15
|
+
const postTabHeader = require('./post-tab-header-f1c16656.js');
|
|
16
|
+
const postTabPanel = require('./post-tab-panel-9c20a84e.js');
|
|
17
|
+
const postTooltip = require('./post-tooltip-94d4f21f.js');
|
|
18
|
+
const postTag = require('./post-tag-942085fd.js');
|
|
19
|
+
require('./index-3b732d59.js');
|
|
20
|
+
require('./package-45af106a.js');
|
|
21
|
+
require('./index-a1440961.js');
|
|
20
22
|
require('./constants-238701d3.js');
|
|
23
|
+
require('./check-one-of-f4f5d0c0.js');
|
|
21
24
|
require('./fade-35a3633a.js');
|
|
22
25
|
require('./check-non-empty-eeaa8f77.js');
|
|
23
26
|
require('./attribute-observer-10f08c04.js');
|
|
@@ -27,6 +30,7 @@ require('./attribute-observer-10f08c04.js');
|
|
|
27
30
|
exports.PostAccordion = postAccordion.PostAccordion;
|
|
28
31
|
exports.PostAccordionItem = postAccordionItem.PostAccordionItem;
|
|
29
32
|
exports.PostAlert = postAlert.PostAlert;
|
|
33
|
+
exports.PostCardControl = postCardControl.PostCardControl;
|
|
30
34
|
exports.PostCollapsible = postCollapsible.PostCollapsible;
|
|
31
35
|
exports.PostIcon = postIcon.PostIcon;
|
|
32
36
|
exports.PostPopover = postPopover.PostPopover;
|
|
@@ -36,3 +40,4 @@ exports.PostTabs = postTabs.PostTabs;
|
|
|
36
40
|
exports.PostTabHeader = postTabHeader.PostTabHeader;
|
|
37
41
|
exports.PostTabPanel = postTabPanel.PostTabPanel;
|
|
38
42
|
exports.PostTooltip = postTooltip.PostTooltip;
|
|
43
|
+
exports.PostTag = postTag.PostTag;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3b732d59.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
6
7
|
|
|
7
|
-
const defineCustomElements = (win, options) => {
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
8
9
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
return index.bootstrapLazy([["post-accordion-item.cjs",[[1,"post-accordion-item",{"collapsed":[4],"headingLevel":[2,"heading-level"],"id":[32],"isOpen":[32],"toggle":[64]},[[0,"postToggle","onCollapseToggle"]],{"headingLevel":["validateHeadingLevel"]}]]],["post-alert.cjs",[[1,"post-alert",{"dismissible":[4],"dismissLabel":[1,"dismiss-label"],"fixed":[4],"icon":[1],"type":[1],"alertId":[32],"classes":[32],"hasActions":[32],"hasHeading":[32],"onDismissButtonClick":[32],"dismiss":[64]},null,{"dismissible":["validateDismissible"],"dismissLabel":["validateDismissLabel"],"fixed":["validateFixed"],"icon":["validateIcon"],"type":["validateType"]}]]],["post-card-control.cjs",[[65,"post-card-control",{"label":[1],"description":[1],"type":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[1028],"validity":[1025],"icon":[1],"focused":[32],"reset":[64],"groupReset":[64]},null,{"label":["validateControlLabel"],"type":["validateControlType"],"checked":["updateControlChecked"],"disabled":["updateControlDisbled"]}]]],["post-popovercontainer.cjs",[[1,"post-popovercontainer",{"placement":[1],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]}]]],["post-popover.cjs",[[1,"post-popover",{"placement":[1],"closeButtonCaption":[1,"close-button-caption"],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]}]]],["post-icon.cjs",[[1,"post-icon",{"animation":[1],"base":[1],"flipH":[4,"flip-h"],"flipV":[4,"flip-v"],"name":[1],"rotate":[2],"scale":[2],"svgStyles":[32],"svgOutput":[32]},null,{"animation":["validateAnimation"],"base":["validateBase"],"flipH":["validateFlipH"],"flipV":["validateFlipV"],"name":["validateName"],"rotate":["validateRotate"],"scale":["validateScale"]}]]],["post-rating.cjs",[[1,"post-rating",{"label":[1],"stars":[2],"currentRating":[1026,"current-rating"],"readonly":[4],"hoveredIndex":[32]}]]],["post-tag.cjs",[[1,"post-tag",{"variant":[1],"size":[1],"icon":[1],"classes":[32]},null,{"variant":["variantChanged"],"size":["sizeChanged"]}]]],["post-tooltip.cjs",[[1,"post-tooltip",{"placement":[1],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]}]]],["post-accordion.cjs",[[1,"post-accordion",{"multiple":[4],"toggle":[64],"expandAll":[64],"collapseAll":[64]},[[0,"postToggle","collapseToggleHandler"]]]]],["post-tab-header.cjs",[[1,"post-tab-header",{"panel":[1],"tabId":[32]},null,{"panel":["validateFor"]}]]],["post-tab-panel.cjs",[[1,"post-tab-panel",{"name":[1],"panelId":[32]}]]],["post-tabs.cjs",[[1,"post-tabs",{"activePanel":[1,"active-panel"],"show":[64]}]]],["post-collapsible.cjs",[[1,"post-collapsible",{"collapsed":[4],"id":[32],"isOpen":[32],"toggle":[64]},null,{"collapsed":["validateCollapsed"]}]]]], options);
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const _package = require('./package-
|
|
3
|
+
const index = require('./index-3b732d59.js');
|
|
4
|
+
const _package = require('./package-45af106a.js');
|
|
5
5
|
|
|
6
6
|
const postAccordionCss = ":host{display:block}";
|
|
7
7
|
const PostAccordionStyle0 = postAccordionCss;
|
|
@@ -24,24 +24,26 @@ const PostAccordion = class {
|
|
|
24
24
|
throw new Error(`No post-accordion-item found with id #${id}.`);
|
|
25
25
|
await itemToToggle.toggle();
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
event.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
collapseToggleHandler(event) {
|
|
28
|
+
if (event.target.localName === 'post-accordion-item') {
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
const toggledItem = event.target;
|
|
31
|
+
const isClosing = this.expandedItems.has(toggledItem);
|
|
32
|
+
if (isClosing) {
|
|
33
|
+
this.expandedItems.delete(toggledItem);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.expandedItems.add(toggledItem);
|
|
37
|
+
}
|
|
38
|
+
if (this.multiple || isClosing)
|
|
39
|
+
return;
|
|
40
|
+
// close other open accordion items to have only one opened at a time
|
|
41
|
+
Array.from(this.expandedItems.values())
|
|
42
|
+
.filter(item => item !== toggledItem)
|
|
43
|
+
.forEach(item => {
|
|
44
|
+
item.toggle(false);
|
|
45
|
+
});
|
|
36
46
|
}
|
|
37
|
-
if (this.multiple || isClosing)
|
|
38
|
-
return;
|
|
39
|
-
// close other open accordion items to have only one opened at a time
|
|
40
|
-
Array.from(this.expandedItems.values())
|
|
41
|
-
.filter(item => item !== toggledItem)
|
|
42
|
-
.forEach(item => {
|
|
43
|
-
item.toggle(false);
|
|
44
|
-
});
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Expands all `post-accordion-item`.
|
|
@@ -78,7 +80,7 @@ const PostAccordion = class {
|
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
82
|
render() {
|
|
81
|
-
return (index.h(index.Host, { key: '
|
|
83
|
+
return (index.h(index.Host, { key: '4e45abc399bebb6027e8bf6703526f45700559f9', "data-version": _package.version }, index.h("div", { key: 'aa6224cbdeeba3d3f4080f79800006103e265938', class: "accordion" }, index.h("slot", { key: '565fe15122467f6fb56eae0eca94d1935b38caca', onSlotchange: () => this.registerAccordionItems() }))));
|
|
82
84
|
}
|
|
83
85
|
get host() { return index.getElement(this); }
|
|
84
86
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-3b732d59.js');
|
|
4
|
+
const _package = require('./package-45af106a.js');
|
|
5
|
+
const index$1 = require('./index-a1440961.js');
|
|
6
|
+
|
|
7
|
+
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
|
|
8
|
+
|
|
9
|
+
const postAccordionItemCss = "post-accordion-item::part(accordion-item),.bg-yellow post-accordion-item::part(accordion-item),.bg-white post-accordion-item::part(accordion-item),.bg-light post-accordion-item::part(accordion-item),.bg-gray post-accordion-item::part(accordion-item),.bg-dark post-accordion-item::part(accordion-item),.bg-black post-accordion-item::part(accordion-item),.bg-primary post-accordion-item::part(accordion-item),.bg-secondary post-accordion-item::part(accordion-item),.bg-success post-accordion-item::part(accordion-item),.bg-warning post-accordion-item::part(accordion-item),.bg-error post-accordion-item::part(accordion-item),.bg-info post-accordion-item::part(accordion-item),.bg-success-background post-accordion-item::part(accordion-item),.bg-warning-background post-accordion-item::part(accordion-item),.bg-error-background post-accordion-item::part(accordion-item),.bg-nightblue post-accordion-item::part(accordion-item),.bg-nightblue-bright post-accordion-item::part(accordion-item),.bg-petrol post-accordion-item::part(accordion-item),.bg-petrol-bright post-accordion-item::part(accordion-item),.bg-coral post-accordion-item::part(accordion-item),.bg-coral-bright post-accordion-item::part(accordion-item),.bg-olive post-accordion-item::part(accordion-item),.bg-olive-bright post-accordion-item::part(accordion-item),.bg-purple post-accordion-item::part(accordion-item),.bg-purple-bright post-accordion-item::part(accordion-item),.bg-aubergine post-accordion-item::part(accordion-item),.bg-aubergine-bright post-accordion-item::part(accordion-item),.accordion-item,.bg-yellow .accordion-item,.bg-white .accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item,.bg-dark .accordion-item,.bg-black .accordion-item,.bg-primary .accordion-item,.bg-secondary .accordion-item,.bg-success .accordion-item,.bg-warning .accordion-item,.bg-error .accordion-item,.bg-info .accordion-item,.bg-success-background .accordion-item,.bg-warning-background .accordion-item,.bg-error-background .accordion-item,.bg-nightblue .accordion-item,.bg-nightblue-bright .accordion-item,.bg-petrol .accordion-item,.bg-petrol-bright .accordion-item,.bg-coral .accordion-item,.bg-coral-bright .accordion-item,.bg-olive .accordion-item,.bg-olive-bright .accordion-item,.bg-purple .accordion-item,.bg-purple-bright .accordion-item,.bg-aubergine .accordion-item,.bg-aubergine-bright .accordion-item{--post-bg-opacity:1;background-color:rgba(var(--post-bg-rgb), var(--post-bg-opacity)) !important;color:var(--post-contrast-color) !important}post-accordion-item::part(accordion-item),.bg-yellow post-accordion-item::part(accordion-item),.bg-white post-accordion-item::part(accordion-item),.bg-light post-accordion-item::part(accordion-item),.bg-gray post-accordion-item::part(accordion-item),.bg-dark post-accordion-item::part(accordion-item),.bg-black post-accordion-item::part(accordion-item),.bg-primary post-accordion-item::part(accordion-item),.bg-secondary post-accordion-item::part(accordion-item),.bg-success post-accordion-item::part(accordion-item),.bg-warning post-accordion-item::part(accordion-item),.bg-error post-accordion-item::part(accordion-item),.bg-info post-accordion-item::part(accordion-item),.bg-success-background post-accordion-item::part(accordion-item),.bg-warning-background post-accordion-item::part(accordion-item),.bg-error-background post-accordion-item::part(accordion-item),.bg-nightblue post-accordion-item::part(accordion-item),.bg-nightblue-bright post-accordion-item::part(accordion-item),.bg-petrol post-accordion-item::part(accordion-item),.bg-petrol-bright post-accordion-item::part(accordion-item),.bg-coral post-accordion-item::part(accordion-item),.bg-coral-bright post-accordion-item::part(accordion-item),.bg-olive post-accordion-item::part(accordion-item),.bg-olive-bright post-accordion-item::part(accordion-item),.bg-purple post-accordion-item::part(accordion-item),.bg-purple-bright post-accordion-item::part(accordion-item),.bg-aubergine post-accordion-item::part(accordion-item),.bg-aubergine-bright post-accordion-item::part(accordion-item),.accordion-item,.bg-yellow .accordion-item,.bg-white .accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item,.bg-dark .accordion-item,.bg-black .accordion-item,.bg-primary .accordion-item,.bg-secondary .accordion-item,.bg-success .accordion-item,.bg-warning .accordion-item,.bg-error .accordion-item,.bg-info .accordion-item,.bg-success-background .accordion-item,.bg-warning-background .accordion-item,.bg-error-background .accordion-item,.bg-nightblue .accordion-item,.bg-nightblue-bright .accordion-item,.bg-petrol .accordion-item,.bg-petrol-bright .accordion-item,.bg-coral .accordion-item,.bg-coral-bright .accordion-item,.bg-olive .accordion-item,.bg-olive-bright .accordion-item,.bg-purple .accordion-item,.bg-purple-bright .accordion-item,.bg-aubergine .accordion-item,.bg-aubergine-bright .accordion-item{--post-contrast-color:#000;--post-focus-color:#1976c8;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-white:#fff;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-black:#000;--post-primary:hsl(0, 0%, 20%);--post-secondary:hsl(0, 0%, 40%);--post-success:#2c871d;--post-warning:#f49e00;--post-error:#a51728;--post-info:#cce4ee;--post-success-background:#c0debb;--post-warning-background:#fce2b2;--post-error-background:#ffdade;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-black-alpha-10-rgba:rgba(0, 0, 0, 0.1);--post-black-alpha-20-rgba:rgba(0, 0, 0, 0.2);--post-black-alpha-40-rgba:rgba(0, 0, 0, 0.4);--post-black-alpha-60-rgba:rgba(0, 0, 0, 0.6);--post-black-alpha-80-rgba:rgba(0, 0, 0, 0.8);--post-white-alpha-10-rgba:rgba(255, 255, 255, 0.1);--post-white-alpha-20-rgba:rgba(255, 255, 255, 0.2);--post-white-alpha-40-rgba:rgba(255, 255, 255, 0.4);--post-white-alpha-60-rgba:rgba(255, 255, 255, 0.6);--post-white-alpha-80-rgba:rgba(255, 255, 255, 0.8);--post-yellow-rgb:255, 204, 0;--post-white-rgb:255, 255, 255;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-black-rgb:0, 0, 0;--post-primary-rgb:51, 51, 51;--post-secondary-rgb:102, 102, 102;--post-success-rgb:44, 135, 29;--post-warning-rgb:244, 158, 0;--post-error-rgb:165, 23, 40;--post-info-rgb:204, 228, 238;--post-success-background-rgb:192, 222, 187;--post-warning-background-rgb:252, 226, 178;--post-error-background-rgb:255, 218, 222;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160}.accordion-item{--post-bg-rgb:244, 243, 241;border-block:2px solid #666}.bg-yellow .accordion-item{--post-bg-rgb:255, 255, 255}.bg-white .accordion-item{--post-bg-rgb:244, 243, 241}.bg-light .accordion-item{--post-bg-rgb:255, 255, 255}.bg-gray .accordion-item{--post-bg-rgb:255, 255, 255}.bg-dark .accordion-item{--post-bg-rgb:255, 255, 255}.bg-black .accordion-item{--post-bg-rgb:255, 255, 255}.bg-primary .accordion-item{--post-bg-rgb:255, 255, 255}.bg-secondary .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning .accordion-item{--post-bg-rgb:255, 255, 255}.bg-error .accordion-item{--post-bg-rgb:255, 255, 255}.bg-info .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-error-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-nightblue .accordion-item{--post-bg-rgb:255, 255, 255}.bg-nightblue-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-petrol .accordion-item{--post-bg-rgb:255, 255, 255}.bg-petrol-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-coral .accordion-item{--post-bg-rgb:255, 255, 255}.bg-coral-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-olive .accordion-item{--post-bg-rgb:255, 255, 255}.bg-olive-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-purple .accordion-item{--post-bg-rgb:255, 255, 255}.bg-purple-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-aubergine .accordion-item{--post-bg-rgb:255, 255, 255}.bg-aubergine-bright .accordion-item{--post-bg-rgb:255, 255, 255}.accordion-item+.accordion-item{border-block-start:0}.accordion-header{color:#333;font-size:1rem;font-weight:700;line-height:1.5;margin:0}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:3rem;text-align:start;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms}.accordion-button:focus-visible{outline:2px solid #1976c8}.accordion-button:hover{color:#000;background-color:#e6e6e6}.accordion-button:disabled{opacity:.4;pointer-events:none}.accordion-button::after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem;position:absolute;inset-inline-end:1rem;inset-block-start:50%;transform:translateY(-50%);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed::after{transform:translateY(-50%) rotate(-180deg)}.accordion-button>.text-truncate{display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover:not(:disabled),.accordion-button:focus-visible:not(:disabled){outline:2px solid Highlight}.accordion-button:disabled{opacity:1 !important}}.accordion-body{padding:.5rem 1rem 1rem;font-weight:300}.accordion-button>*,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>*,.accordion-body>:last-child{margin-block-end:0 !important}:host{display:block}.accordion-button{cursor:pointer}.accordion-button>::slotted(.text-truncate){display:block}post-accordion-item::part(accordion-item){--post-bg-rgb:244, 243, 241}.bg-yellow post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-white post-accordion-item::part(accordion-item){--post-bg-rgb:244, 243, 241}.bg-light post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-gray post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-dark post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-black post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-primary post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-secondary post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-error post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-info post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-error-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-nightblue post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-nightblue-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-petrol post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-petrol-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-coral post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-coral-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-olive post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-olive-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-purple post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-purple-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-aubergine post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-aubergine-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}:host(:not(:first-of-type)) .accordion-item{border-block-start:0}";
|
|
10
|
+
const PostAccordionItemStyle0 = postAccordionItemCss;
|
|
11
|
+
|
|
12
|
+
const PostAccordionItem = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
this.id = undefined;
|
|
16
|
+
this.isOpen = undefined;
|
|
17
|
+
this.collapsed = false;
|
|
18
|
+
this.headingLevel = 2;
|
|
19
|
+
}
|
|
20
|
+
validateHeadingLevel(newValue = this.headingLevel) {
|
|
21
|
+
index$1.checkEmptyOrOneOf(newValue, HEADING_LEVELS, 'The `headingLevel` property of the `post-accordion-item` must be a number between 1 and 6.');
|
|
22
|
+
}
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this.validateHeadingLevel();
|
|
25
|
+
}
|
|
26
|
+
componentWillLoad() {
|
|
27
|
+
this.isOpen = !this.collapsed;
|
|
28
|
+
this.id = this.host.id || `a${crypto.randomUUID()}`;
|
|
29
|
+
}
|
|
30
|
+
onCollapseToggle(event) {
|
|
31
|
+
if (event.target.localName === 'post-collapsible') {
|
|
32
|
+
this.isOpen = event.detail;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Triggers the collapse programmatically.
|
|
37
|
+
*/
|
|
38
|
+
async toggle(force) {
|
|
39
|
+
return this.collapsible.toggle(force);
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
var _a;
|
|
43
|
+
const HeadingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
44
|
+
return (index.h(index.Host, { key: '1cae3baea73ec4bb9c1f4096cf0fafda59532052', id: this.id, "data-version": _package.version }, index.h("div", { key: 'd9df9d0b0bc1a2b5f13a4dafb9368dbd4785b611', part: "accordion-item", class: "accordion-item" }, index.h(HeadingTag, { key: '41ee8b8b145c8fa1c91c31c1385b818214b8e5a3', class: "accordion-header", id: `${this.id}--header` }, index.h("button", { key: '0794762996913eb8f071b342c1e77f209254f6c8', "aria-controls": `${this.id}--collapse`, "aria-expanded": `${this.isOpen}`, class: `accordion-button${this.isOpen ? '' : ' collapsed'}`, onClick: () => this.toggle(), type: "button" }, index.h("slot", { key: '9274641e3955c0960856c4dc818b68a2dcf5c805', name: "header" }))), index.h("post-collapsible", { key: '87abfbaa0d5e9bdd1476f0204fa84b7980e5ae6a', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, index.h("div", { key: 'b0907132bb9cb0684f8e001a13b641bbb3a77db8', class: "accordion-body" }, index.h("slot", { key: 'c71712f3005bd626d3c708607d4f6617de4a9039' }))))));
|
|
45
|
+
}
|
|
46
|
+
get host() { return index.getElement(this); }
|
|
47
|
+
static get watchers() { return {
|
|
48
|
+
"headingLevel": ["validateHeadingLevel"]
|
|
49
|
+
}; }
|
|
50
|
+
};
|
|
51
|
+
PostAccordionItem.style = PostAccordionItemStyle0;
|
|
52
|
+
|
|
53
|
+
exports.PostAccordionItem = PostAccordionItem;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postAccordionItem = require('./post-accordion-item-
|
|
6
|
-
require('./index-
|
|
7
|
-
require('./package-
|
|
8
|
-
require('./index-
|
|
5
|
+
const postAccordionItem = require('./post-accordion-item-5bf4d98b.js');
|
|
6
|
+
require('./index-3b732d59.js');
|
|
7
|
+
require('./package-45af106a.js');
|
|
8
|
+
require('./index-a1440961.js');
|
|
9
9
|
require('./constants-238701d3.js');
|
|
10
|
+
require('./check-one-of-f4f5d0c0.js');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postAccordion = require('./post-accordion-
|
|
6
|
-
require('./index-
|
|
7
|
-
require('./package-
|
|
5
|
+
const postAccordion = require('./post-accordion-7507f838.js');
|
|
6
|
+
require('./index-3b732d59.js');
|
|
7
|
+
require('./package-45af106a.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|