@swisspost/design-system-components 7.4.0 → 8.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/dist/cjs/{index-f32e5185.js → index-a1440961.js} +15 -2
- package/dist/cjs/{index-1cc8e4e1.js → index-baad16da.js} +8 -17
- package/dist/cjs/index.cjs.js +18 -20
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-549b9aab.js → package-28cba29c.js} +1 -1
- package/dist/cjs/{post-accordion-e0a2c3c3.js → post-accordion-fc746a6f.js} +2 -2
- package/dist/cjs/{post-accordion-item-772332db.js → post-accordion-item-c0492b73.js} +6 -7
- package/dist/cjs/post-accordion-item.cjs.entry.js +4 -5
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/{post-alert-42220c7a.js → post-alert-0612ad51.js} +8 -9
- package/dist/cjs/post-alert.cjs.entry.js +4 -5
- package/dist/cjs/{post-card-control-45047568.js → post-card-control-2fd18624.js} +4 -4
- package/dist/cjs/post-card-control.cjs.entry.js +3 -3
- package/dist/cjs/post-collapsible-trigger-8d39196e.js +206 -0
- package/dist/cjs/{post-collapsible-trigger.cjs.entry.js → post-collapsible_2.cjs.entry.js} +7 -5
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/{post-icon-d136be35.js → post-icon-bd260560.js} +5 -6
- package/dist/cjs/post-icon.cjs.entry.js +4 -5
- package/dist/cjs/{post-popover-1024d72f.js → post-popover-303e76ef.js} +3 -3
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/{post-popovercontainer-f5dd6284.js → post-popovercontainer-c64bde39.js} +8 -9
- package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
- package/dist/cjs/{post-rating-df981989.js → post-rating-dc7bd246.js} +3 -3
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-17fe11d6.js → post-tab-header-06c40218.js} +3 -3
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-a47c8cfe.js → post-tab-panel-54fbdb66.js} +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-766f8241.js → post-tabs-52b9d638.js} +3 -3
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tag-65ec8149.js → post-tag-4aba2155.js} +3 -3
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-tooltip-2efd6509.js → post-tooltip-3c695f60.js} +4 -4
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -5
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +7 -9
- package/dist/collection/components/post-alert/post-alert.js +3 -3
- package/dist/collection/components/post-card-control/post-card-control.js +2 -2
- package/dist/collection/components/post-collapsible/post-collapsible.js +12 -14
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +14 -19
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-popover/post-popover.js +2 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +3 -3
- package/dist/collection/components/post-rating/post-rating.js +1 -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.js +1 -1
- package/dist/collection/components/post-tag/post-tag.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
- package/dist/collection/utils/get-root.js +7 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +13 -9
- package/dist/components/post-alert2.js +3 -3
- package/dist/components/post-card-control2.js +2 -2
- package/dist/components/post-collapsible-trigger2.js +22 -10
- package/dist/components/post-collapsible2.js +12 -14
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-popover2.js +1 -1
- package/dist/components/post-popovercontainer2.js +6 -7
- package/dist/components/post-rating2.js +1 -1
- package/dist/components/post-tab-header2.js +1 -1
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +1 -1
- package/dist/components/post-tag2.js +1 -1
- package/dist/components/post-tooltip2.js +1 -1
- package/dist/docs.json +23 -22
- package/dist/esm/{index-9ace3232.js → index-189d3985.js} +8 -17
- package/dist/esm/{index-29d17d6d.js → index-d1eba94c.js} +14 -2
- package/dist/esm/index.js +17 -19
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{package-91140d77.js → package-3e4546f5.js} +1 -1
- package/dist/esm/{post-accordion-09978cd3.js → post-accordion-1cbd089a.js} +2 -2
- package/dist/esm/{post-accordion-item-4210d17f.js → post-accordion-item-316ee985.js} +6 -7
- package/dist/esm/post-accordion-item.entry.js +4 -5
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/{post-alert-64d34792.js → post-alert-6fa442b9.js} +6 -7
- package/dist/esm/post-alert.entry.js +4 -5
- package/dist/esm/{post-card-control-244f45f6.js → post-card-control-41356aa4.js} +4 -4
- package/dist/esm/post-card-control.entry.js +3 -3
- package/dist/esm/post-collapsible-trigger-6f4ba350.js +203 -0
- package/dist/esm/post-collapsible_2.entry.js +7 -0
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/{post-icon-f05c6d37.js → post-icon-fe467f6a.js} +4 -5
- package/dist/esm/post-icon.entry.js +4 -5
- package/dist/esm/{post-popover-a094d059.js → post-popover-c9998136.js} +3 -3
- package/dist/esm/post-popover.entry.js +3 -3
- package/dist/esm/{post-popovercontainer-1faa005e.js → post-popovercontainer-62ced3d7.js} +8 -9
- package/dist/esm/post-popovercontainer.entry.js +3 -3
- package/dist/esm/{post-rating-62590a88.js → post-rating-49ace0e9.js} +3 -3
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-1b88d56e.js → post-tab-header-696a7aae.js} +3 -3
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-fac73181.js → post-tab-panel-c00910fb.js} +3 -3
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-4528a1a5.js → post-tabs-a7990c9e.js} +3 -3
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tag-8b82ff5c.js → post-tag-d9650103.js} +3 -3
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-tooltip-1156bdc7.js → post-tooltip-cf07e816.js} +4 -4
- package/dist/esm/post-tooltip.entry.js +4 -5
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0aee269b.entry.js +1 -0
- package/dist/post-components/p-2240981f.entry.js +1 -0
- package/dist/post-components/{p-4dc0b726.js → p-266adbdd.js} +1 -1
- package/dist/post-components/p-27cb2e60.entry.js +1 -0
- package/dist/post-components/p-2c9277b1.entry.js +1 -0
- package/dist/post-components/p-3764a23a.entry.js +1 -0
- package/dist/post-components/{p-0df6bfe1.js → p-382f85c4.js} +1 -1
- package/dist/post-components/p-48ed21f0.entry.js +1 -0
- package/dist/post-components/p-496cee95.entry.js +1 -0
- package/dist/post-components/p-4ce46830.entry.js +1 -0
- package/dist/post-components/p-5135c965.entry.js +1 -0
- package/dist/post-components/{p-eff7cef8.js → p-5c4773cb.js} +2 -2
- package/dist/post-components/p-660ecc23.js +1 -0
- package/dist/post-components/p-69145fd2.js +1 -0
- package/dist/post-components/p-6af42a67.entry.js +1 -0
- package/dist/post-components/{p-21bdf1f3.js → p-6c701d9f.js} +1 -1
- package/dist/post-components/p-7095990e.js +1 -0
- package/dist/post-components/p-7481e37a.entry.js +1 -0
- package/dist/post-components/{p-04dc2d21.js → p-783e67bc.js} +1 -1
- package/dist/post-components/p-8f0ee57c.entry.js +1 -0
- package/dist/post-components/p-90479234.js +1 -0
- package/dist/post-components/p-a4794190.js +1 -0
- package/dist/post-components/{p-a8dc1aa1.js → p-a4e13e9c.js} +1 -1
- package/dist/post-components/{p-bdb6c1b8.js → p-ab26873d.js} +1 -1
- package/dist/post-components/p-b08aca79.entry.js +1 -0
- package/dist/post-components/p-beb27e06.js +1 -0
- package/dist/post-components/{p-8c7f0075.js → p-c0f265c8.js} +2 -2
- package/dist/post-components/{p-8e975b46.js → p-e024aa18.js} +1 -1
- package/dist/post-components/p-ea063aae.entry.js +1 -0
- package/dist/post-components/p-f732d73c.js +1 -0
- package/dist/post-components/p-f91c0e1b.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +2 -3
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +3 -4
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +6 -5
- package/dist/types/components.d.ts +4 -4
- package/dist/types/utils/get-root.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +10 -10
- package/dist/cjs/check-type-64af82a9.js +0 -16
- package/dist/cjs/post-collapsible-d71942e3.js +0 -87
- package/dist/cjs/post-collapsible-trigger-a7e32ead.js +0 -115
- package/dist/cjs/post-collapsible.cjs.entry.js +0 -15
- package/dist/esm/check-type-8828dbe4.js +0 -14
- package/dist/esm/post-collapsible-4ddc1db3.js +0 -85
- package/dist/esm/post-collapsible-trigger-b0100e8c.js +0 -113
- package/dist/esm/post-collapsible-trigger.entry.js +0 -6
- package/dist/esm/post-collapsible.entry.js +0 -7
- package/dist/post-components/p-10cd6860.entry.js +0 -1
- package/dist/post-components/p-158d0eee.entry.js +0 -1
- package/dist/post-components/p-1f9ddbd4.js +0 -1
- package/dist/post-components/p-2da9a13c.js +0 -1
- package/dist/post-components/p-39b6f635.entry.js +0 -1
- package/dist/post-components/p-3cb6b887.entry.js +0 -1
- package/dist/post-components/p-4a3f67ab.js +0 -1
- package/dist/post-components/p-5ef247ea.entry.js +0 -1
- package/dist/post-components/p-67d41a4b.entry.js +0 -1
- package/dist/post-components/p-78111d97.entry.js +0 -1
- package/dist/post-components/p-7f3045f5.entry.js +0 -1
- package/dist/post-components/p-80708279.entry.js +0 -1
- package/dist/post-components/p-8c9bd744.entry.js +0 -1
- package/dist/post-components/p-9170a653.js +0 -1
- package/dist/post-components/p-9656cf35.js +0 -1
- package/dist/post-components/p-9fa0742e.js +0 -1
- package/dist/post-components/p-ac500761.js +0 -1
- package/dist/post-components/p-b53753a0.js +0 -1
- package/dist/post-components/p-bd0695bf.js +0 -1
- package/dist/post-components/p-c297c7d1.entry.js +0 -1
- package/dist/post-components/p-c8fe8c37.js +0 -1
- package/dist/post-components/p-d1c71b7d.entry.js +0 -1
- package/dist/post-components/p-d9e5275c.entry.js +0 -1
- package/dist/post-components/p-f7101c7f.entry.js +0 -1
- package/dist/post-components/p-ffdd17d8.entry.js +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postTag = require('./post-tag-
|
|
6
|
-
require('./index-
|
|
7
|
-
require('./package-
|
|
5
|
+
const postTag = require('./post-tag-4aba2155.js');
|
|
6
|
+
require('./index-baad16da.js');
|
|
7
|
+
require('./package-28cba29c.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const _package = require('./package-
|
|
3
|
+
const index = require('./index-baad16da.js');
|
|
4
|
+
const _package = require('./package-28cba29c.js');
|
|
5
5
|
const attributeObserver = require('./attribute-observer-10f08c04.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-a1440961.js');
|
|
7
7
|
|
|
8
8
|
function timeout(delay) {
|
|
9
9
|
return new Promise(resolve => setTimeout(resolve, delay));
|
|
@@ -4957,7 +4957,7 @@ const PostTooltip = class {
|
|
|
4957
4957
|
}
|
|
4958
4958
|
render() {
|
|
4959
4959
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4960
|
-
return (index.h(index.Host, { key: '
|
|
4960
|
+
return (index.h(index.Host, { key: '939e17d222f1102dbfe3532d1cfe11b2777e4373', "data-version": _package.version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, index.h("post-popovercontainer", { key: 'fe5388550554ebb39c8f5b59668b86483b5cb141', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, index.h("slot", { key: '90275f38a63f5d6f18b915718b738f29246b2843' }))));
|
|
4961
4961
|
}
|
|
4962
4962
|
get host() { return index.getElement(this); }
|
|
4963
4963
|
static get watchers() { return {
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postTooltip = require('./post-tooltip-
|
|
6
|
-
require('./index-
|
|
7
|
-
require('./package-
|
|
5
|
+
const postTooltip = require('./post-tooltip-3c695f60.js');
|
|
6
|
+
require('./index-baad16da.js');
|
|
7
|
+
require('./package-28cba29c.js');
|
|
8
8
|
require('./attribute-observer-10f08c04.js');
|
|
9
|
-
require('./index-
|
|
9
|
+
require('./index-a1440961.js');
|
|
10
10
|
require('./constants-238701d3.js');
|
|
11
11
|
require('./check-one-of-f4f5d0c0.js');
|
|
12
|
-
require('./check-type-64af82a9.js');
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
|
|
@@ -9,7 +9,6 @@ import { checkEmptyOrOneOf } from "../../utils/index";
|
|
|
9
9
|
export class PostAccordionItem {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.id = undefined;
|
|
12
|
-
this.isOpen = undefined;
|
|
13
12
|
this.collapsed = false;
|
|
14
13
|
this.headingLevel = 2;
|
|
15
14
|
}
|
|
@@ -20,12 +19,12 @@ export class PostAccordionItem {
|
|
|
20
19
|
this.validateHeadingLevel();
|
|
21
20
|
}
|
|
22
21
|
componentWillLoad() {
|
|
23
|
-
this.isOpen = !this.collapsed;
|
|
24
22
|
this.id = this.host.id || `a${crypto.randomUUID()}`;
|
|
25
23
|
}
|
|
24
|
+
// capture to make sure the "collapsed" property is updated before the event is consumed
|
|
26
25
|
onCollapseToggle(event) {
|
|
27
26
|
if (event.target.localName === 'post-accordion-item') {
|
|
28
|
-
this.
|
|
27
|
+
this.collapsed = !event.detail;
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
@@ -37,7 +36,7 @@ export class PostAccordionItem {
|
|
|
37
36
|
render() {
|
|
38
37
|
var _a;
|
|
39
38
|
const HeadingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
40
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'd021bf895019606800fa6cf3a85a2ea0a2fea7e4', id: this.id, "data-version": version }, h("div", { key: '8a78f2511889eb90d2cbdccf00f76802e043a1e7', part: "accordion-item", class: "accordion-item" }, h("post-collapsible-trigger", { key: 'c4c09df6d5bb1b3883ad696a362b222cfcf1c9bb', for: `${this.id}--collapse` }, h(HeadingTag, { key: 'fbc49fcc1e4096193e1fd945b728b8c0caf6001d', class: "accordion-header", id: `${this.id}--header` }, h("button", { key: '2a55471aa04c5e676647a2e5c8cb2d587b74aed4', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}` }, h("slot", { key: '83b5811e74fb31f2fafd66e5aedc2f260d75e3e0', name: "header" })))), h("post-collapsible", { key: '8d0695dd8944bb77df60c43116be01ec2608dbb4', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, h("div", { key: '17c75ea9cf1e9adb95d176c65ab23322c994d388', class: "accordion-body" }, h("slot", { key: '21dc6d44c6bb009058e0e1e5dbcd4bfc2a9463ee' }))))));
|
|
41
40
|
}
|
|
42
41
|
static get is() { return "post-accordion-item"; }
|
|
43
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -55,7 +54,7 @@ export class PostAccordionItem {
|
|
|
55
54
|
return {
|
|
56
55
|
"collapsed": {
|
|
57
56
|
"type": "boolean",
|
|
58
|
-
"mutable":
|
|
57
|
+
"mutable": true,
|
|
59
58
|
"complexType": {
|
|
60
59
|
"original": "boolean",
|
|
61
60
|
"resolved": "boolean",
|
|
@@ -65,7 +64,7 @@ export class PostAccordionItem {
|
|
|
65
64
|
"optional": true,
|
|
66
65
|
"docs": {
|
|
67
66
|
"tags": [],
|
|
68
|
-
"text": "If `true`, the element is
|
|
67
|
+
"text": "If `true`, the element is collapsed otherwise it is displayed."
|
|
69
68
|
},
|
|
70
69
|
"attribute": "collapsed",
|
|
71
70
|
"reflect": false,
|
|
@@ -102,8 +101,7 @@ export class PostAccordionItem {
|
|
|
102
101
|
}
|
|
103
102
|
static get states() {
|
|
104
103
|
return {
|
|
105
|
-
"id": {}
|
|
106
|
-
"isOpen": {}
|
|
104
|
+
"id": {}
|
|
107
105
|
};
|
|
108
106
|
}
|
|
109
107
|
static get methods() {
|
|
@@ -143,7 +141,7 @@ export class PostAccordionItem {
|
|
|
143
141
|
"name": "postToggle",
|
|
144
142
|
"method": "onCollapseToggle",
|
|
145
143
|
"target": undefined,
|
|
146
|
-
"capture":
|
|
144
|
+
"capture": true,
|
|
147
145
|
"passive": false
|
|
148
146
|
}];
|
|
149
147
|
}
|
|
@@ -70,14 +70,14 @@ export class PostAlert {
|
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
72
|
const defaultAlertContent = [
|
|
73
|
-
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { key: '
|
|
73
|
+
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { key: '928eeaedc9a897394ef064a218b43a780dc10f0d', name: "heading" }))),
|
|
74
74
|
h("slot", { key: `${this.alertId}-message` }),
|
|
75
75
|
];
|
|
76
76
|
const actionAlertContent = [
|
|
77
77
|
h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
|
|
78
|
-
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { key: '
|
|
78
|
+
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { key: '67bcd576fb17374be6e0f9b3633a19aaff884b6a', name: "actions" })),
|
|
79
79
|
];
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: 'df4452a660ba217ad57d5ad69ee224a686f5537e', "data-version": version }, h("div", { key: 'f1d346826fee4629356c9e722ac619d9c7a34c17', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '0deb48cddffd2288dd4e2999f291179ca6cdc6b5', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: 'd252736e70ee4213d7c36e622181b640a8b3c4cb', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions ? actionAlertContent : defaultAlertContent)));
|
|
81
81
|
}
|
|
82
82
|
static get is() { return "post-alert"; }
|
|
83
83
|
static get encapsulation() { return "shadow"; }
|
|
@@ -221,14 +221,14 @@ export class PostCardControl {
|
|
|
221
221
|
this.hasIcon = Boolean(this.host.querySelector('[slot="icon"]') || this.icon);
|
|
222
222
|
}
|
|
223
223
|
render() {
|
|
224
|
-
return (h(Host, { key: '
|
|
224
|
+
return (h(Host, { key: 'a99c4d289e6546d08bc43b55347e3faab514a6ed', "data-version": version, onClick: this.cardClickHandler }, h("div", { key: '3d5f19d37ad0dac2c0526dfab9bc915609eb73b6', class: {
|
|
225
225
|
'card-control': true,
|
|
226
226
|
'is-checked': this.checked,
|
|
227
227
|
'is-disabled': this.disabled,
|
|
228
228
|
'is-focused': this.focused,
|
|
229
229
|
'is-valid': this.validity !== null && this.validity !== 'false',
|
|
230
230
|
'is-invalid': this.validity === 'false',
|
|
231
|
-
}, "data-host-context": this.hostContext.join(' ') }, h("input", { key: '
|
|
231
|
+
}, "data-host-context": this.hostContext.join(' ') }, h("input", { key: '305fce2f7405918dba56e604c6579aa96609034c', ref: el => (this.control = el), id: this.controlId, class: "card-control--input form-check-input", type: this.type, name: this.name, value: this.value, checked: this.checked, "aria-describedby": `${this.controlId}_label ${this.controlId}_content`, "aria-disabled": this.disabled, "aria-invalid": this.validity === 'false', onClick: this.controlClickHandler, onInput: this.controlChangeHandler, onChange: this.controlChangeHandler, onFocus: this.controlFocusHandler, onBlur: this.controlFocusHandler, onKeyDown: this.controlKeyDownHandler }), h("label", { key: 'e6de984f7e2cb6c6128f1875127e980c956fb5c8', id: `${this.controlId}_label`, htmlFor: this.controlId, class: "card-control--label form-check-label" }, this.label, this.description ? (h("div", { class: "card-control--description" }, this.description)) : null), this.hasIcon ? (h("div", { class: "card-control--icon" }, h("slot", { name: "icon" }, this.icon ? h("post-icon", { name: this.icon }) : null))) : null, h("div", { key: '770c2382527e7bfe90a520ac82b0219f26da75d0', id: `${this.controlId}_content`, class: "card-control--content" }, h("slot", { key: '5f0e50844a19db803257feb27a16ebfb9a55dddc' })))));
|
|
232
232
|
}
|
|
233
233
|
componentDidRender() {
|
|
234
234
|
this.groupCollectMembers();
|
|
@@ -11,15 +11,12 @@ export class PostCollapsible {
|
|
|
11
11
|
this.isOpen = true;
|
|
12
12
|
this.collapsed = false;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
checkEmptyOrType(
|
|
16
|
-
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
this.validateCollapsed();
|
|
14
|
+
collapsedChange() {
|
|
15
|
+
checkEmptyOrType(this.collapsed, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');
|
|
16
|
+
void this.toggle(!this.collapsed);
|
|
19
17
|
}
|
|
20
18
|
componentDidLoad() {
|
|
21
|
-
|
|
22
|
-
void this.toggle(false);
|
|
19
|
+
this.collapsedChange();
|
|
23
20
|
this.isLoaded = true;
|
|
24
21
|
this.updateTriggers();
|
|
25
22
|
}
|
|
@@ -31,15 +28,16 @@ export class PostCollapsible {
|
|
|
31
28
|
async toggle(open = !this.isOpen) {
|
|
32
29
|
if (open === this.isOpen)
|
|
33
30
|
return open;
|
|
34
|
-
this.isOpen =
|
|
31
|
+
this.isOpen = open;
|
|
32
|
+
this.collapsed = !open;
|
|
35
33
|
if (this.isLoaded)
|
|
36
|
-
this.postToggle.emit(
|
|
34
|
+
this.postToggle.emit(open);
|
|
37
35
|
const animation = open ? expand(this.host) : collapse(this.host);
|
|
38
36
|
if (!this.isLoaded || isMotionReduced())
|
|
39
37
|
animation.finish();
|
|
40
38
|
await animation.finished;
|
|
41
39
|
animation.commitStyles();
|
|
42
|
-
return
|
|
40
|
+
return open;
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
45
43
|
* Update all post-collapsible-trigger elements referring to the collapsible
|
|
@@ -49,7 +47,7 @@ export class PostCollapsible {
|
|
|
49
47
|
triggers.forEach(trigger => trigger.update());
|
|
50
48
|
}
|
|
51
49
|
render() {
|
|
52
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '47ab19bf719a505dce35955d6250462acea47eee', "data-version": version }, h("slot", { key: 'd7fe5746afe1c343e9ec4c02878d8dead9360c26' })));
|
|
53
51
|
}
|
|
54
52
|
static get is() { return "post-collapsible"; }
|
|
55
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -67,7 +65,7 @@ export class PostCollapsible {
|
|
|
67
65
|
return {
|
|
68
66
|
"collapsed": {
|
|
69
67
|
"type": "boolean",
|
|
70
|
-
"mutable":
|
|
68
|
+
"mutable": true,
|
|
71
69
|
"complexType": {
|
|
72
70
|
"original": "boolean",
|
|
73
71
|
"resolved": "boolean",
|
|
@@ -77,7 +75,7 @@ export class PostCollapsible {
|
|
|
77
75
|
"optional": true,
|
|
78
76
|
"docs": {
|
|
79
77
|
"tags": [],
|
|
80
|
-
"text": "If `true`, the element is
|
|
78
|
+
"text": "If `true`, the element is collapsed otherwise it is displayed."
|
|
81
79
|
},
|
|
82
80
|
"attribute": "collapsed",
|
|
83
81
|
"reflect": false,
|
|
@@ -132,7 +130,7 @@ export class PostCollapsible {
|
|
|
132
130
|
static get watchers() {
|
|
133
131
|
return [{
|
|
134
132
|
"propName": "collapsed",
|
|
135
|
-
"methodName": "
|
|
133
|
+
"methodName": "collapsedChange"
|
|
136
134
|
}];
|
|
137
135
|
}
|
|
138
136
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { version } from "../../../../package";
|
|
2
|
-
import { checkNonEmpty, checkType, debounce } from "../../utils/index";
|
|
2
|
+
import { checkNonEmpty, checkType, debounce, getRoot } from "../../utils/index";
|
|
3
3
|
export class PostCollapsibleTrigger {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.observer = new MutationObserver(() => this.setTrigger());
|
|
@@ -34,6 +34,18 @@ export class PostCollapsibleTrigger {
|
|
|
34
34
|
connectedCallback() {
|
|
35
35
|
this.observer.observe(this.host, { childList: true, subtree: true });
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Attach a "postToggle" event listener to the root node
|
|
39
|
+
* to update the trigger's "aria-expanded" attribute whenever the controlled post-collapsible is toggled
|
|
40
|
+
*/
|
|
41
|
+
componentWillLoad() {
|
|
42
|
+
this.root = getRoot(this.host);
|
|
43
|
+
this.root.addEventListener('postToggle', (e) => {
|
|
44
|
+
if (!this.trigger || !e.target.isEqualNode(this.collapsible))
|
|
45
|
+
return;
|
|
46
|
+
this.trigger.setAttribute('aria-expanded', `${e.detail}`);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
37
49
|
/**
|
|
38
50
|
* Add the "data-version" to the host element and set the trigger
|
|
39
51
|
*/
|
|
@@ -49,14 +61,6 @@ export class PostCollapsibleTrigger {
|
|
|
49
61
|
disconnectedCallback() {
|
|
50
62
|
this.observer.disconnect();
|
|
51
63
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Update the "aria-expanded" attribute on the trigger anytime the controlled post-collapsible is toggled
|
|
54
|
-
*/
|
|
55
|
-
setAriaExpanded(e) {
|
|
56
|
-
if (!this.trigger || !e.target.isEqualNode(this.collapsible))
|
|
57
|
-
return;
|
|
58
|
-
this.trigger.setAttribute('aria-expanded', `${e.detail}`);
|
|
59
|
-
}
|
|
60
64
|
/**
|
|
61
65
|
* Update the "aria-controls" and "aria-expanded" attributes on the trigger button
|
|
62
66
|
*/
|
|
@@ -74,7 +78,7 @@ export class PostCollapsibleTrigger {
|
|
|
74
78
|
* Retrieve the post-collapsible controlled by the trigger
|
|
75
79
|
*/
|
|
76
80
|
get collapsible() {
|
|
77
|
-
const ref =
|
|
81
|
+
const ref = this.root.getElementById(this.for);
|
|
78
82
|
if (ref && ref.localName === 'post-collapsible') {
|
|
79
83
|
return ref;
|
|
80
84
|
}
|
|
@@ -141,13 +145,4 @@ export class PostCollapsibleTrigger {
|
|
|
141
145
|
"methodName": "setAriaAttributes"
|
|
142
146
|
}];
|
|
143
147
|
}
|
|
144
|
-
static get listeners() {
|
|
145
|
-
return [{
|
|
146
|
-
"name": "postToggle",
|
|
147
|
-
"method": "setAriaExpanded",
|
|
148
|
-
"target": "document",
|
|
149
|
-
"capture": false,
|
|
150
|
-
"passive": false
|
|
151
|
-
}];
|
|
152
|
-
}
|
|
153
148
|
}
|
|
@@ -81,7 +81,7 @@ export class PostIcon {
|
|
|
81
81
|
})
|
|
82
82
|
.filter(([_key, value]) => value !== null)
|
|
83
83
|
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
84
|
-
return (h(Host, { key: '
|
|
84
|
+
return (h(Host, { key: '95fa0f7a09d3430bb5d621e01b57188742920eb4', "data-version": version }, h("span", { key: 'c824e3705dc83665bb6f7649381654e6d1e07dfb', style: svgStyles })));
|
|
85
85
|
}
|
|
86
86
|
static get is() { return "post-icon"; }
|
|
87
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -88,7 +88,7 @@ export class PostPopover {
|
|
|
88
88
|
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
91
|
-
return (h(Host, { key: '
|
|
91
|
+
return (h(Host, { key: '97db4a92db81f3a84ca272af8f79981cf181024d', "data-version": version }, h("post-popovercontainer", { key: '291247845dc11572a5722aa949c1dfa74e521edd', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '92137bf8c92633c8578c89c7b0c8252b0b59e2fa', class: "popover-container" }, h("div", { key: '06f79f59e90ca439b552380af0e151084adadf03', class: "popover-content" }, h("slot", { key: 'c37c742ac7cf24f9440ac3b862761fcd937f7658' })), h("button", { key: '0e6f316574720e0f901af56e0dbb99f86e36c5b4', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '77c41e8e8df74649ce9ca21740c77e78336905e6', class: "visually-hidden" }, this.closeButtonCaption))))));
|
|
92
92
|
}
|
|
93
93
|
static get is() { return "post-popover"; }
|
|
94
94
|
static get encapsulation() { return "shadow"; }
|
|
@@ -114,7 +114,7 @@ export class PostPopover {
|
|
|
114
114
|
"Placement": {
|
|
115
115
|
"location": "import",
|
|
116
116
|
"path": "@floating-ui/dom",
|
|
117
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
117
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.8/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
},
|
|
@@ -135,9 +135,9 @@ export class PostPopovercontainer {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
|
-
return (h(Host, { key: '
|
|
138
|
+
return (h(Host, { key: 'd157ffbb6acb382add7b003f7865eb7c7d77a2b5', "data-version": version }, this.arrow && (h("span", { key: 'cc47843bc00d401c0679474e41661b6b1dcbae01', class: "arrow", ref: el => {
|
|
139
139
|
this.arrowRef = el;
|
|
140
|
-
} })), h("slot", { key: '
|
|
140
|
+
} })), h("slot", { key: '75eb62cf77965fa96fbb3dabcf264c2daff3e2f4' })));
|
|
141
141
|
}
|
|
142
142
|
static get is() { return "post-popovercontainer"; }
|
|
143
143
|
static get originalStyleUrls() {
|
|
@@ -162,7 +162,7 @@ export class PostPopovercontainer {
|
|
|
162
162
|
"Placement": {
|
|
163
163
|
"location": "import",
|
|
164
164
|
"path": "@floating-ui/dom",
|
|
165
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
165
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.8/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
},
|
|
@@ -64,7 +64,7 @@ export class PostRating {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'ae0484c022555a4a5ed0343cc060b7076a1c581e', "data-version": version }, h("div", { key: '3765eaaccec1dd709b28d8a63b54fc0ed69b4c15', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} out of ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
|
|
68
68
|
'star': true,
|
|
69
69
|
'before-hover': i < this.hoveredIndex,
|
|
70
70
|
'active': i < Math.round(this.currentRating),
|
|
@@ -16,7 +16,7 @@ export class PostTabHeader {
|
|
|
16
16
|
this.tabId = `tab-${this.host.id || crypto.randomUUID()}`;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'ba101bdcdf05591293e07ab35aadb812862d8cc0', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '276d95c72fc7014f8002f249f2bbab591ee8754d' })));
|
|
20
20
|
}
|
|
21
21
|
static get is() { return "post-tab-header"; }
|
|
22
22
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,7 +13,7 @@ export class PostTabPanel {
|
|
|
13
13
|
this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: 'bd31fce17f303414e7d077fbc001b543d05e362c', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '746b85fa6378312abb2f1e92cb4fffceafac1fc7' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "post-tab-panel"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -141,7 +141,7 @@ export class PostTabs {
|
|
|
141
141
|
nextTab.focus();
|
|
142
142
|
}
|
|
143
143
|
render() {
|
|
144
|
-
return (h(Host, { key: '
|
|
144
|
+
return (h(Host, { key: 'd0f37718e538b9dd4b5e0eed0dde161576725e25', "data-version": version }, h("div", { key: '1d3380b6317cad0bde525136854e93ee20e3bfbf', class: "tabs-wrapper", part: "tabs" }, h("div", { key: 'bc5cf13c94629e2938eb4ea85deb5ebd6c2b2dac', class: "tabs", role: "tablist" }, h("slot", { key: '4fde604e204df192946080b652d60c27d7ff6cee', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '755b7153a2a8c683abf15d33a0d9180e8aa29db0', class: "tab-content", part: "content" }, h("slot", { key: '23263344474597c54a7d8cc355d22919cb8685f1', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
145
145
|
}
|
|
146
146
|
static get is() { return "post-tabs"; }
|
|
147
147
|
static get encapsulation() { return "shadow"; }
|
|
@@ -30,7 +30,7 @@ export class PostTag {
|
|
|
30
30
|
this.setClasses();
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
33
|
+
return (h(Host, { key: '5b29f617d1f9dbba914664263ccace77e18fdd10', "data-version": version }, h("div", { key: '25d9431e746f0d677704c97dc9bd27023a502efb', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: 'e13004f14169d4abccd3df8d0245bc2f361f0b81', class: "tag-text" }, h("slot", { key: '567d61fae24d649c64c9ea53685a627f7e45fde1' })))));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "post-tag"; }
|
|
36
36
|
static get encapsulation() { return "shadow"; }
|
|
@@ -179,7 +179,7 @@ export class PostTooltip {
|
|
|
179
179
|
}
|
|
180
180
|
render() {
|
|
181
181
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
182
|
-
return (h(Host, { key: '
|
|
182
|
+
return (h(Host, { key: '939e17d222f1102dbfe3532d1cfe11b2777e4373', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: 'fe5388550554ebb39c8f5b59668b86483b5cb141', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '90275f38a63f5d6f18b915718b738f29246b2843' }))));
|
|
183
183
|
}
|
|
184
184
|
static get is() { return "post-tooltip"; }
|
|
185
185
|
static get encapsulation() { return "shadow"; }
|
|
@@ -205,7 +205,7 @@ export class PostTooltip {
|
|
|
205
205
|
"Placement": {
|
|
206
206
|
"location": "import",
|
|
207
207
|
"path": "@floating-ui/dom",
|
|
208
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
208
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.8/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function getRoot(element) {
|
|
2
|
+
const root = element.getRootNode();
|
|
3
|
+
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
4
|
+
return root;
|
|
5
|
+
}
|
|
6
|
+
throw new Error('Attempting to access root node before the element is attached to the document or shadow tree.');
|
|
7
|
+
}
|
|
@@ -2,7 +2,8 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './heading-levels.js';
|
|
4
4
|
import { c as checkEmptyOrOneOf } from './index2.js';
|
|
5
|
-
import { d as defineCustomElement$
|
|
5
|
+
import { d as defineCustomElement$2 } from './post-collapsible2.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './post-collapsible-trigger2.js';
|
|
6
7
|
|
|
7
8
|
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;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:400}.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}";
|
|
8
9
|
const PostAccordionItemStyle0 = postAccordionItemCss;
|
|
@@ -13,7 +14,6 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
13
14
|
this.__registerHost();
|
|
14
15
|
this.__attachShadow();
|
|
15
16
|
this.id = undefined;
|
|
16
|
-
this.isOpen = undefined;
|
|
17
17
|
this.collapsed = false;
|
|
18
18
|
this.headingLevel = 2;
|
|
19
19
|
}
|
|
@@ -24,12 +24,12 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
24
24
|
this.validateHeadingLevel();
|
|
25
25
|
}
|
|
26
26
|
componentWillLoad() {
|
|
27
|
-
this.isOpen = !this.collapsed;
|
|
28
27
|
this.id = this.host.id || `a${crypto.randomUUID()}`;
|
|
29
28
|
}
|
|
29
|
+
// capture to make sure the "collapsed" property is updated before the event is consumed
|
|
30
30
|
onCollapseToggle(event) {
|
|
31
31
|
if (event.target.localName === 'post-accordion-item') {
|
|
32
|
-
this.
|
|
32
|
+
this.collapsed = !event.detail;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -41,7 +41,7 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
41
41
|
render() {
|
|
42
42
|
var _a;
|
|
43
43
|
const HeadingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: 'd021bf895019606800fa6cf3a85a2ea0a2fea7e4', id: this.id, "data-version": version }, h("div", { key: '8a78f2511889eb90d2cbdccf00f76802e043a1e7', part: "accordion-item", class: "accordion-item" }, h("post-collapsible-trigger", { key: 'c4c09df6d5bb1b3883ad696a362b222cfcf1c9bb', for: `${this.id}--collapse` }, h(HeadingTag, { key: 'fbc49fcc1e4096193e1fd945b728b8c0caf6001d', class: "accordion-header", id: `${this.id}--header` }, h("button", { key: '2a55471aa04c5e676647a2e5c8cb2d587b74aed4', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}` }, h("slot", { key: '83b5811e74fb31f2fafd66e5aedc2f260d75e3e0', name: "header" })))), h("post-collapsible", { key: '8d0695dd8944bb77df60c43116be01ec2608dbb4', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, h("div", { key: '17c75ea9cf1e9adb95d176c65ab23322c994d388', class: "accordion-body" }, h("slot", { key: '21dc6d44c6bb009058e0e1e5dbcd4bfc2a9463ee' }))))));
|
|
45
45
|
}
|
|
46
46
|
get host() { return this; }
|
|
47
47
|
static get watchers() { return {
|
|
@@ -49,19 +49,18 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
49
49
|
}; }
|
|
50
50
|
static get style() { return PostAccordionItemStyle0; }
|
|
51
51
|
}, [1, "post-accordion-item", {
|
|
52
|
-
"collapsed": [
|
|
52
|
+
"collapsed": [1028],
|
|
53
53
|
"headingLevel": [2, "heading-level"],
|
|
54
54
|
"id": [32],
|
|
55
|
-
"isOpen": [32],
|
|
56
55
|
"toggle": [64]
|
|
57
|
-
}, [[
|
|
56
|
+
}, [[2, "postToggle", "onCollapseToggle"]], {
|
|
58
57
|
"headingLevel": ["validateHeadingLevel"]
|
|
59
58
|
}]);
|
|
60
59
|
function defineCustomElement() {
|
|
61
60
|
if (typeof customElements === "undefined") {
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
|
-
const components = ["post-accordion-item", "post-collapsible"];
|
|
63
|
+
const components = ["post-accordion-item", "post-collapsible", "post-collapsible-trigger"];
|
|
65
64
|
components.forEach(tagName => { switch (tagName) {
|
|
66
65
|
case "post-accordion-item":
|
|
67
66
|
if (!customElements.get(tagName)) {
|
|
@@ -69,6 +68,11 @@ function defineCustomElement() {
|
|
|
69
68
|
}
|
|
70
69
|
break;
|
|
71
70
|
case "post-collapsible":
|
|
71
|
+
if (!customElements.get(tagName)) {
|
|
72
|
+
defineCustomElement$2();
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case "post-collapsible-trigger":
|
|
72
76
|
if (!customElements.get(tagName)) {
|
|
73
77
|
defineCustomElement$1();
|
|
74
78
|
}
|
|
@@ -77,14 +77,14 @@ const PostAlert = /*@__PURE__*/ proxyCustomElement(class PostAlert extends HTMLE
|
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
79
|
const defaultAlertContent = [
|
|
80
|
-
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { key: '
|
|
80
|
+
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { key: '928eeaedc9a897394ef064a218b43a780dc10f0d', name: "heading" }))),
|
|
81
81
|
h("slot", { key: `${this.alertId}-message` }),
|
|
82
82
|
];
|
|
83
83
|
const actionAlertContent = [
|
|
84
84
|
h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
|
|
85
|
-
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { key: '
|
|
85
|
+
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { key: '67bcd576fb17374be6e0f9b3633a19aaff884b6a', name: "actions" })),
|
|
86
86
|
];
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: 'df4452a660ba217ad57d5ad69ee224a686f5537e', "data-version": version }, h("div", { key: 'f1d346826fee4629356c9e722ac619d9c7a34c17', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '0deb48cddffd2288dd4e2999f291179ca6cdc6b5', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: 'd252736e70ee4213d7c36e622181b640a8b3c4cb', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions ? actionAlertContent : defaultAlertContent)));
|
|
88
88
|
}
|
|
89
89
|
get host() { return this; }
|
|
90
90
|
static get watchers() { return {
|