@swisspost/design-system-components 2.0.3 → 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} +89 -25
- package/dist/cjs/{index-8c288b1a.js → index-a1440961.js} +2 -6
- package/dist/cjs/index.cjs.js +21 -14
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/{package-628f6e9c.js → package-45af106a.js} +1 -1
- package/dist/cjs/{post-accordion-da546aa2.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-278b2a71.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-fd09bc54.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-5e355de3.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 +11 -0
- 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-67ba226d.js → post-tab-panel-9c20a84e.js} +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-71510ced.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-b6bbb3e4.js → post-tooltip-94d4f21f.js} +12 -9
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +6 -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 +31 -0
- package/dist/collection/components/post-rating/post-rating.js +202 -0
- 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 +3 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/sass-export.js +16 -0
- package/dist/components/index.js +3 -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-rating.d.ts +11 -0
- package/dist/components/post-rating.js +6 -0
- package/dist/components/post-rating2.js +113 -0
- 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 +622 -16
- 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} +89 -25
- package/dist/esm/{index-b444db27.js → index-d1eba94c.js} +1 -5
- package/dist/esm/index.js +18 -14
- package/dist/esm/loader.js +6 -4
- package/dist/esm/{package-15929f57.js → package-1242b80d.js} +1 -1
- package/dist/esm/{post-accordion-be080240.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-967bb191.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-ba163099.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-da870ff0.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 -0
- 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-d89c4c50.js → post-tab-panel-d7145a70.js} +3 -3
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-e995886a.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-0ec6a388.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-94256868.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 +43 -0
- 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 +243 -8
- 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 +3 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/sass-export.d.ts +2 -0
- package/package.json +18 -18
- package/dist/cjs/post-accordion-item-33d5593a.js +0 -51
- package/dist/cjs/post-alert-26c1bcda.js +0 -98
- package/dist/cjs/post-popover-1e454296.js +0 -104
- package/dist/cjs/post-tab-header-5c8b9a0d.js +0 -32
- package/dist/esm/post-accordion-item-7b3c726b.js +0 -49
- package/dist/esm/post-alert-37f853eb.js +0 -96
- package/dist/esm/post-popover-69694fa6.js +0 -102
- package/dist/esm/post-tab-header-14ed99cd.js +0 -30
- package/dist/post-components/p-00ab91d9.entry.js +0 -1
- package/dist/post-components/p-04f47e54.entry.js +0 -1
- package/dist/post-components/p-10b4cf7a.js +0 -2
- package/dist/post-components/p-1f284e66.js +0 -1
- package/dist/post-components/p-209e33a5.js +0 -1
- package/dist/post-components/p-282e21c2.entry.js +0 -1
- package/dist/post-components/p-34a772e3.entry.js +0 -1
- package/dist/post-components/p-46c47aa4.entry.js +0 -1
- package/dist/post-components/p-51fe19e0.js +0 -1
- package/dist/post-components/p-557f0f10.entry.js +0 -1
- package/dist/post-components/p-5ecceba0.js +0 -1
- package/dist/post-components/p-61d98756.js +0 -1
- package/dist/post-components/p-6b3ba10a.js +0 -1
- package/dist/post-components/p-82f4f464.entry.js +0 -1
- package/dist/post-components/p-98cb0bbd.entry.js +0 -1
- package/dist/post-components/p-9ee95668.entry.js +0 -1
- package/dist/post-components/p-a0d342e4.entry.js +0 -1
- package/dist/post-components/p-a9d59b04.js +0 -1
- package/dist/post-components/p-ac7b779e.js +0 -1
- package/dist/post-components/p-d9c9ed63.js +0 -1
- package/dist/post-components/p-e1bf894f.entry.js +0 -1
- package/dist/post-components/p-e8d17225.js +0 -1
- package/dist/post-components/p-f0e82e63.js +0 -1
- package/dist/post-components/p-f47b0207.js +0 -1
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
import { checkNonEmpty, checkOneOf } from "../../utils";
|
|
3
|
+
import { version } from "../../../package.json";
|
|
4
|
+
// remove as soon as all browser support :host-context()
|
|
5
|
+
// https://caniuse.com/?search=%3Ahost-context()
|
|
6
|
+
import scss from "./post-card-control.module.scss";
|
|
7
|
+
import { parse } from "../../utils/sass-export";
|
|
8
|
+
const SCSS_VARIABLES = parse(scss);
|
|
9
|
+
const EVENT_MAP = {
|
|
10
|
+
input: 'postInput',
|
|
11
|
+
change: 'postChange',
|
|
12
|
+
};
|
|
13
|
+
let cardControlIds = 0;
|
|
14
|
+
/**
|
|
15
|
+
* @class PostCardControl - representing a stencil component
|
|
16
|
+
*
|
|
17
|
+
* @slot default - Content to place into the `default` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Block-level_contentt" target="_blank">block content</a>.<p className="alert alert-sm alert-warning">Even if it is generally possible, we do not recommend using interactive elements in this slot because the background of the card control is clickable.<br/>This can lead to confusion when the hit box of nested interactive controls is not clearly separated from the background, is invalid HTML and click events bubbling up to the card control will unexpectedly toggle it if they're not captured.<br/>More info: <a href="https://accessibilityinsights.io/info-examples/web/nested-interactive/">https://accessibilityinsights.io/info-examples/web/nested-interactive/</a></p>
|
|
18
|
+
* @slot icon - To insert a custom icon into the named `icon` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content" target="_blank">inline content</a>.<p className="alert alert-sm alert-info">It is only meant for <code>img</code> or <code>svg</code> elements and overrides the `icon` property.</p>
|
|
19
|
+
*/
|
|
20
|
+
export class PostCardControl {
|
|
21
|
+
/**
|
|
22
|
+
* A public method to reset the controls `checked` and `validity` state.
|
|
23
|
+
* The validity state is set to `null`, so it's neither valid nor invalid.
|
|
24
|
+
*/
|
|
25
|
+
async reset() {
|
|
26
|
+
this.validity = null;
|
|
27
|
+
this.controlSetChecked(this.initialChecked);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A hidden public method to reset the group controls `checked` state to `false`.
|
|
31
|
+
*/
|
|
32
|
+
async groupReset() {
|
|
33
|
+
if (this.disabled)
|
|
34
|
+
this.control.checked = this.checked = false;
|
|
35
|
+
this.controlSetChecked(false);
|
|
36
|
+
}
|
|
37
|
+
validateControlLabel(label = this.label) {
|
|
38
|
+
checkNonEmpty(label, 'The "post-card-control" element requires its "label" property to be set.');
|
|
39
|
+
}
|
|
40
|
+
validateControlType(type = this.type) {
|
|
41
|
+
checkOneOf(type, ['checkbox', 'radio'], 'The "post-card-control" element requires its "type" prop to be one of either "checkbox" or "radio".');
|
|
42
|
+
}
|
|
43
|
+
updateControlChecked(checked = this.checked) {
|
|
44
|
+
this.controlSetChecked(checked);
|
|
45
|
+
}
|
|
46
|
+
updateControlDisbled() {
|
|
47
|
+
this.controlSetChecked(this.checked);
|
|
48
|
+
}
|
|
49
|
+
constructor() {
|
|
50
|
+
this.KEYCODES = {
|
|
51
|
+
SPACE: 'Space',
|
|
52
|
+
LEFT: 'ArrowLeft',
|
|
53
|
+
UP: 'ArrowUp',
|
|
54
|
+
RIGHT: 'ArrowRight',
|
|
55
|
+
DOWN: 'ArrowDown',
|
|
56
|
+
};
|
|
57
|
+
this.group = {
|
|
58
|
+
hosts: [],
|
|
59
|
+
members: [],
|
|
60
|
+
first: null,
|
|
61
|
+
last: null,
|
|
62
|
+
checked: null,
|
|
63
|
+
focused: null,
|
|
64
|
+
};
|
|
65
|
+
this.controlId = `PostCardControl_${cardControlIds++}`;
|
|
66
|
+
// remove as soon as all browser support the :host-context() selector
|
|
67
|
+
this.HOST_CONTEXT_FILTERS = ['fieldset', ...SCSS_VARIABLES['dark-bg-selectors']];
|
|
68
|
+
this.focused = false;
|
|
69
|
+
this.label = undefined;
|
|
70
|
+
this.description = null;
|
|
71
|
+
this.type = undefined;
|
|
72
|
+
this.name = null;
|
|
73
|
+
this.value = null;
|
|
74
|
+
this.checked = false;
|
|
75
|
+
this.disabled = false;
|
|
76
|
+
this.validity = null;
|
|
77
|
+
this.icon = null;
|
|
78
|
+
this.cardClickHandler = this.cardClickHandler.bind(this);
|
|
79
|
+
this.controlClickHandler = this.controlClickHandler.bind(this);
|
|
80
|
+
this.controlChangeHandler = this.controlChangeHandler.bind(this);
|
|
81
|
+
this.controlFocusHandler = this.controlFocusHandler.bind(this);
|
|
82
|
+
this.controlKeyDownHandler = this.controlKeyDownHandler.bind(this);
|
|
83
|
+
}
|
|
84
|
+
cardClickHandler(e) {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
// if this was not the clicked element anyway, trigger click on control to change it
|
|
87
|
+
if (e.target !== this.control)
|
|
88
|
+
this.control.click();
|
|
89
|
+
}
|
|
90
|
+
controlClickHandler(e) {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
// if control is disabled do nothing
|
|
93
|
+
// else control value will fire a change event, which is handled in the controlChangeHandler method
|
|
94
|
+
if (this.disabled)
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
}
|
|
97
|
+
controlChangeHandler(e) {
|
|
98
|
+
e.stopPropagation();
|
|
99
|
+
this.groupCollectMembers();
|
|
100
|
+
this.controlSetChecked(this.control.checked, e);
|
|
101
|
+
this.groupSetChecked(this.control, e);
|
|
102
|
+
}
|
|
103
|
+
controlFocusHandler() {
|
|
104
|
+
this.focused = this.host === document.activeElement;
|
|
105
|
+
}
|
|
106
|
+
// https://googlechromelabs.github.io/howto-components/howto-radio-group/
|
|
107
|
+
controlKeyDownHandler(e) {
|
|
108
|
+
if (this.type === 'radio') {
|
|
109
|
+
e.stopPropagation();
|
|
110
|
+
if (Object.values(this.KEYCODES).includes(e.code))
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
this.groupCollectMembers();
|
|
113
|
+
switch (e.code) {
|
|
114
|
+
case this.KEYCODES.UP:
|
|
115
|
+
case this.KEYCODES.LEFT:
|
|
116
|
+
this.groupSetChecked(this.groupGetPrev(), e);
|
|
117
|
+
break;
|
|
118
|
+
case this.KEYCODES.DOWN:
|
|
119
|
+
case this.KEYCODES.RIGHT:
|
|
120
|
+
this.groupSetChecked(this.groupGetNext(), e);
|
|
121
|
+
break;
|
|
122
|
+
case this.KEYCODES.SPACE:
|
|
123
|
+
this.groupSetChecked(this.control, e);
|
|
124
|
+
break;
|
|
125
|
+
default:
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
controlSetChecked(checked, e) {
|
|
131
|
+
if (!this.control)
|
|
132
|
+
return;
|
|
133
|
+
if (this.disabled) {
|
|
134
|
+
this.internals.setFormValue(null);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.control.checked = this.checked = checked;
|
|
138
|
+
this.internals.setFormValue(this.checked ? this.control.value : null);
|
|
139
|
+
if (e) {
|
|
140
|
+
const isCheckbox = this.type === 'checkbox';
|
|
141
|
+
const isRadioAndChecked = this.type === 'radio' && this.checked;
|
|
142
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
|
|
143
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio
|
|
144
|
+
// if an event parameter is given and a native control would fire an event, emit the corresponding event to the light dom
|
|
145
|
+
if (isCheckbox || isRadioAndChecked)
|
|
146
|
+
this[EVENT_MAP[e.type]].emit({ state: this.checked, value: this.value });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
groupCollectMembers() {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
if (this.type === 'radio' && this.name) {
|
|
153
|
+
this.group.hosts = Array.from(document.querySelectorAll(`post-card-control[type="radio"][name="${this.name}"]`));
|
|
154
|
+
this.group.members = this.group.hosts
|
|
155
|
+
.map(m => m.shadowRoot.querySelector('input[type="radio"]'))
|
|
156
|
+
.filter(m => m !== null);
|
|
157
|
+
if (this.group.members.length > 1) {
|
|
158
|
+
this.group.first = this.group.members[0];
|
|
159
|
+
this.group.last = this.group.members[this.group.members.length - 1];
|
|
160
|
+
this.group.checked = (_a = this.group.members.find(m => m.checked)) !== null && _a !== void 0 ? _a : null;
|
|
161
|
+
this.group.focused =
|
|
162
|
+
(_b = this.group.members.find(m => m.getRootNode().host === document.activeElement)) !== null && _b !== void 0 ? _b : this.group.first;
|
|
163
|
+
const focusableMember = this.group.checked || this.group.focused || this.group.first;
|
|
164
|
+
this.group.members.forEach(m => {
|
|
165
|
+
m.tabIndex = m === focusableMember ? 0 : -1;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
groupGetPrev() {
|
|
171
|
+
var _a;
|
|
172
|
+
const focusedIndex = this.group.members.findIndex(m => m.id === this.group.focused.id);
|
|
173
|
+
return (_a = this.group.members.find((_m, i) => i === focusedIndex - 1)) !== null && _a !== void 0 ? _a : this.group.last;
|
|
174
|
+
}
|
|
175
|
+
groupGetNext() {
|
|
176
|
+
var _a;
|
|
177
|
+
const focusedIndex = this.group.members.findIndex(m => m.id === this.group.focused.id);
|
|
178
|
+
return (_a = this.group.members.find((_m, i) => i === focusedIndex + 1)) !== null && _a !== void 0 ? _a : this.group.first;
|
|
179
|
+
}
|
|
180
|
+
groupSetChecked(newChecked, e) {
|
|
181
|
+
if (this.group.members.length > 1) {
|
|
182
|
+
const isKeyboardEvent = e.type === 'keydown';
|
|
183
|
+
const newIsAriaDisabled = newChecked.hasAttribute('aria-disabled');
|
|
184
|
+
const newIndex = this.group.members.findIndex(m => m === newChecked);
|
|
185
|
+
if (isKeyboardEvent)
|
|
186
|
+
newChecked.focus();
|
|
187
|
+
// if new is disabled, do not reset/set anything
|
|
188
|
+
if (!newIsAriaDisabled) {
|
|
189
|
+
// reset all group members but the newChecked
|
|
190
|
+
this.group.hosts
|
|
191
|
+
.filter((_h, i) => i !== newIndex)
|
|
192
|
+
.forEach(h => {
|
|
193
|
+
h.groupReset();
|
|
194
|
+
});
|
|
195
|
+
// if method was called by keyboard event, select newChecked
|
|
196
|
+
// else this has already been done by clicking on the newChecked element already
|
|
197
|
+
if (isKeyboardEvent)
|
|
198
|
+
newChecked.click();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
setHostContext() {
|
|
203
|
+
this.hostContext = [];
|
|
204
|
+
let element = this.host;
|
|
205
|
+
while (element) {
|
|
206
|
+
const localName = element.localName;
|
|
207
|
+
const id = element.id ? `#${element.id}` : '';
|
|
208
|
+
const classes = element.classList.length > 0 ? `.${Array.from(element.classList).join('.')}` : '';
|
|
209
|
+
this.hostContext.push(`${localName}${id}${classes}`);
|
|
210
|
+
element = element.parentElement;
|
|
211
|
+
}
|
|
212
|
+
this.hostContext = this.hostContext.filter(ctx => this.HOST_CONTEXT_FILTERS.find(f => ctx.includes(f)));
|
|
213
|
+
}
|
|
214
|
+
connectedCallback() {
|
|
215
|
+
// remove as soon as all browser support :host-context()
|
|
216
|
+
this.setHostContext();
|
|
217
|
+
this.initialChecked = this.checked;
|
|
218
|
+
}
|
|
219
|
+
render() {
|
|
220
|
+
return (h(Host, { key: '80ac610a41127d4f58b9b4277fae53d505d8ecf6', "data-version": version, onClick: this.cardClickHandler }, h("div", { key: 'b9726bfed9d88d9399abfffde9ddf0f0f32ff7c2', class: {
|
|
221
|
+
'card-control': true,
|
|
222
|
+
'is-checked': this.checked,
|
|
223
|
+
'is-disabled': this.disabled,
|
|
224
|
+
'is-focused': this.focused,
|
|
225
|
+
'is-valid': this.validity !== null && this.validity !== 'false',
|
|
226
|
+
'is-invalid': this.validity === 'false',
|
|
227
|
+
}, "data-host-context": this.hostContext.join(' ') }, h("input", { key: '82b481fed1726afb514c1047996eefcd2dd006c0', 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: 'bb69978f1b17d58f9b5c6c36dc7c19b3054f9205', 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), h("div", { key: '813965edb2e131981d22c587a09c5f231ded6591', class: "card-control--icon" }, h("slot", { key: 'b9b40240a3517178d8e211d1528008409a8a0052', name: "icon" }, this.icon ? h("post-icon", { name: this.icon }) : null)), h("div", { key: 'fb88d67194b81635246f580d8beddc3675f071ec', id: `${this.controlId}_content`, class: "card-control--content" }, h("slot", { key: 'c37fa28651f213d8ae9e8e0cee7ff16bcfae4dca' })))));
|
|
228
|
+
}
|
|
229
|
+
componentDidRender() {
|
|
230
|
+
this.groupCollectMembers();
|
|
231
|
+
}
|
|
232
|
+
componentDidLoad() {
|
|
233
|
+
this.validateControlLabel();
|
|
234
|
+
this.validateControlType();
|
|
235
|
+
}
|
|
236
|
+
// https://stenciljs.com/docs/form-associated
|
|
237
|
+
/* eslint-disable @stencil-community/own-methods-must-be-private */
|
|
238
|
+
formAssociatedCallback() {
|
|
239
|
+
this.controlSetChecked(this.checked);
|
|
240
|
+
}
|
|
241
|
+
formDisabledCallback(disabled) {
|
|
242
|
+
this.disabled = disabled;
|
|
243
|
+
}
|
|
244
|
+
formStateRestoreCallback(checked) {
|
|
245
|
+
this.controlSetChecked(checked);
|
|
246
|
+
}
|
|
247
|
+
formResetCallback() {
|
|
248
|
+
this.reset();
|
|
249
|
+
}
|
|
250
|
+
static get is() { return "post-card-control"; }
|
|
251
|
+
static get encapsulation() { return "shadow"; }
|
|
252
|
+
static get formAssociated() { return true; }
|
|
253
|
+
static get originalStyleUrls() {
|
|
254
|
+
return {
|
|
255
|
+
"$": ["post-card-control.scss"]
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
static get styleUrls() {
|
|
259
|
+
return {
|
|
260
|
+
"$": ["post-card-control.css"]
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
static get properties() {
|
|
264
|
+
return {
|
|
265
|
+
"label": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"mutable": false,
|
|
268
|
+
"complexType": {
|
|
269
|
+
"original": "string",
|
|
270
|
+
"resolved": "string",
|
|
271
|
+
"references": {}
|
|
272
|
+
},
|
|
273
|
+
"required": true,
|
|
274
|
+
"optional": false,
|
|
275
|
+
"docs": {
|
|
276
|
+
"tags": [],
|
|
277
|
+
"text": "Defines the text in the control-label."
|
|
278
|
+
},
|
|
279
|
+
"attribute": "label",
|
|
280
|
+
"reflect": false
|
|
281
|
+
},
|
|
282
|
+
"description": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "string",
|
|
287
|
+
"resolved": "string",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": "Defines the description in the control-label."
|
|
295
|
+
},
|
|
296
|
+
"attribute": "description",
|
|
297
|
+
"reflect": false,
|
|
298
|
+
"defaultValue": "null"
|
|
299
|
+
},
|
|
300
|
+
"type": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "'checkbox' | 'radio'",
|
|
305
|
+
"resolved": "\"checkbox\" | \"radio\"",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": true,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": "Defines the `type` attribute of the control."
|
|
313
|
+
},
|
|
314
|
+
"attribute": "type",
|
|
315
|
+
"reflect": false
|
|
316
|
+
},
|
|
317
|
+
"name": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"mutable": false,
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "string",
|
|
322
|
+
"resolved": "string",
|
|
323
|
+
"references": {}
|
|
324
|
+
},
|
|
325
|
+
"required": false,
|
|
326
|
+
"optional": false,
|
|
327
|
+
"docs": {
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": "Defines the `name` attribute of the control.\n<span className=\"alert alert-sm alert-info\">This is a required property, when the control should participate in a native `form`. If not specified, a native `form` will never contain this controls value.</span>\n<span className=\"alert alert-sm alert-info\">This is a required property, when the control is used with type `radio`.</span>"
|
|
330
|
+
},
|
|
331
|
+
"attribute": "name",
|
|
332
|
+
"reflect": false,
|
|
333
|
+
"defaultValue": "null"
|
|
334
|
+
},
|
|
335
|
+
"value": {
|
|
336
|
+
"type": "string",
|
|
337
|
+
"mutable": false,
|
|
338
|
+
"complexType": {
|
|
339
|
+
"original": "string",
|
|
340
|
+
"resolved": "string",
|
|
341
|
+
"references": {}
|
|
342
|
+
},
|
|
343
|
+
"required": false,
|
|
344
|
+
"optional": false,
|
|
345
|
+
"docs": {
|
|
346
|
+
"tags": [],
|
|
347
|
+
"text": "Defines the `value` attribute of the control. <span className=\"alert alert-sm alert-info\">This is a required property, when the control is used with type `radio`.</span>"
|
|
348
|
+
},
|
|
349
|
+
"attribute": "value",
|
|
350
|
+
"reflect": false,
|
|
351
|
+
"defaultValue": "null"
|
|
352
|
+
},
|
|
353
|
+
"checked": {
|
|
354
|
+
"type": "boolean",
|
|
355
|
+
"mutable": true,
|
|
356
|
+
"complexType": {
|
|
357
|
+
"original": "boolean",
|
|
358
|
+
"resolved": "boolean",
|
|
359
|
+
"references": {}
|
|
360
|
+
},
|
|
361
|
+
"required": false,
|
|
362
|
+
"optional": false,
|
|
363
|
+
"docs": {
|
|
364
|
+
"tags": [],
|
|
365
|
+
"text": "Defines the `checked` attribute of the control. If `true`, the control is selected at its value will be included in the forms data."
|
|
366
|
+
},
|
|
367
|
+
"attribute": "checked",
|
|
368
|
+
"reflect": false,
|
|
369
|
+
"defaultValue": "false"
|
|
370
|
+
},
|
|
371
|
+
"disabled": {
|
|
372
|
+
"type": "boolean",
|
|
373
|
+
"mutable": true,
|
|
374
|
+
"complexType": {
|
|
375
|
+
"original": "boolean",
|
|
376
|
+
"resolved": "boolean",
|
|
377
|
+
"references": {}
|
|
378
|
+
},
|
|
379
|
+
"required": false,
|
|
380
|
+
"optional": false,
|
|
381
|
+
"docs": {
|
|
382
|
+
"tags": [],
|
|
383
|
+
"text": "Defines the `disabled` attribute of the control. If `true`, the user can not interact with the control and the controls value will not be included in the forms data."
|
|
384
|
+
},
|
|
385
|
+
"attribute": "disabled",
|
|
386
|
+
"reflect": false,
|
|
387
|
+
"defaultValue": "false"
|
|
388
|
+
},
|
|
389
|
+
"validity": {
|
|
390
|
+
"type": "string",
|
|
391
|
+
"mutable": true,
|
|
392
|
+
"complexType": {
|
|
393
|
+
"original": "null | 'true' | 'false'",
|
|
394
|
+
"resolved": "\"false\" | \"true\"",
|
|
395
|
+
"references": {}
|
|
396
|
+
},
|
|
397
|
+
"required": false,
|
|
398
|
+
"optional": false,
|
|
399
|
+
"docs": {
|
|
400
|
+
"tags": [],
|
|
401
|
+
"text": "Defines the validation `validity` of the control.\nTo reset validity to an undefiend state, simply remove the attribute from the control."
|
|
402
|
+
},
|
|
403
|
+
"attribute": "validity",
|
|
404
|
+
"reflect": false,
|
|
405
|
+
"defaultValue": "null"
|
|
406
|
+
},
|
|
407
|
+
"icon": {
|
|
408
|
+
"type": "string",
|
|
409
|
+
"mutable": false,
|
|
410
|
+
"complexType": {
|
|
411
|
+
"original": "string",
|
|
412
|
+
"resolved": "string",
|
|
413
|
+
"references": {}
|
|
414
|
+
},
|
|
415
|
+
"required": false,
|
|
416
|
+
"optional": false,
|
|
417
|
+
"docs": {
|
|
418
|
+
"tags": [],
|
|
419
|
+
"text": "Defines the icon `name` inside of the card.\n<span className=\"alert alert-sm alert-info\">If not set the icon will not show up.</span>"
|
|
420
|
+
},
|
|
421
|
+
"attribute": "icon",
|
|
422
|
+
"reflect": false,
|
|
423
|
+
"defaultValue": "null"
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
static get states() {
|
|
428
|
+
return {
|
|
429
|
+
"focused": {}
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
static get events() {
|
|
433
|
+
return [{
|
|
434
|
+
"method": "postInput",
|
|
435
|
+
"name": "postInput",
|
|
436
|
+
"bubbles": true,
|
|
437
|
+
"cancelable": true,
|
|
438
|
+
"composed": true,
|
|
439
|
+
"docs": {
|
|
440
|
+
"tags": [],
|
|
441
|
+
"text": "An event emitted whenever the components checked state is toggled.\nThe event payload (emitted under `event.detail.state`) is a boolean: `true` if the component is checked, `false` if it is unchecked."
|
|
442
|
+
},
|
|
443
|
+
"complexType": {
|
|
444
|
+
"original": "{ state: boolean; value: string }",
|
|
445
|
+
"resolved": "{ state: boolean; value: string; }",
|
|
446
|
+
"references": {}
|
|
447
|
+
}
|
|
448
|
+
}, {
|
|
449
|
+
"method": "postChange",
|
|
450
|
+
"name": "postChange",
|
|
451
|
+
"bubbles": true,
|
|
452
|
+
"cancelable": true,
|
|
453
|
+
"composed": true,
|
|
454
|
+
"docs": {
|
|
455
|
+
"tags": [],
|
|
456
|
+
"text": "An event emitted whenever the components checked state is toggled.\nThe event payload (emitted under `event.detail.state`) is a boolean: `true` if the component is checked, `false` if it is unchecked.\n<span className=\"alert alert-sm alert-info\">If the component is used with type `radio`, it will only emit this event, when the checked state is changing to `true`.</span>"
|
|
457
|
+
},
|
|
458
|
+
"complexType": {
|
|
459
|
+
"original": "{ state: boolean; value: string }",
|
|
460
|
+
"resolved": "{ state: boolean; value: string; }",
|
|
461
|
+
"references": {}
|
|
462
|
+
}
|
|
463
|
+
}];
|
|
464
|
+
}
|
|
465
|
+
static get methods() {
|
|
466
|
+
return {
|
|
467
|
+
"reset": {
|
|
468
|
+
"complexType": {
|
|
469
|
+
"signature": "() => Promise<void>",
|
|
470
|
+
"parameters": [],
|
|
471
|
+
"references": {
|
|
472
|
+
"Promise": {
|
|
473
|
+
"location": "global",
|
|
474
|
+
"id": "global::Promise"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"return": "Promise<void>"
|
|
478
|
+
},
|
|
479
|
+
"docs": {
|
|
480
|
+
"text": "A public method to reset the controls `checked` and `validity` state.\nThe validity state is set to `null`, so it's neither valid nor invalid.",
|
|
481
|
+
"tags": []
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
"groupReset": {
|
|
485
|
+
"complexType": {
|
|
486
|
+
"signature": "() => Promise<void>",
|
|
487
|
+
"parameters": [],
|
|
488
|
+
"references": {
|
|
489
|
+
"Promise": {
|
|
490
|
+
"location": "global",
|
|
491
|
+
"id": "global::Promise"
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"return": "Promise<void>"
|
|
495
|
+
},
|
|
496
|
+
"docs": {
|
|
497
|
+
"text": "A hidden public method to reset the group controls `checked` state to `false`.",
|
|
498
|
+
"tags": []
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
static get elementRef() { return "host"; }
|
|
504
|
+
static get watchers() {
|
|
505
|
+
return [{
|
|
506
|
+
"propName": "label",
|
|
507
|
+
"methodName": "validateControlLabel"
|
|
508
|
+
}, {
|
|
509
|
+
"propName": "type",
|
|
510
|
+
"methodName": "validateControlType"
|
|
511
|
+
}, {
|
|
512
|
+
"propName": "checked",
|
|
513
|
+
"methodName": "updateControlChecked"
|
|
514
|
+
}, {
|
|
515
|
+
"propName": "disabled",
|
|
516
|
+
"methodName": "updateControlDisbled"
|
|
517
|
+
}];
|
|
518
|
+
}
|
|
519
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
520
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{display:block}
|
|
1
|
+
:host{display:block}.collapse{overflow:hidden}
|
|
@@ -36,7 +36,7 @@ export class PostCollapsible {
|
|
|
36
36
|
return open;
|
|
37
37
|
this.isOpen = !this.isOpen;
|
|
38
38
|
if (this.isLoaded)
|
|
39
|
-
this.
|
|
39
|
+
this.postToggle.emit(this.isOpen);
|
|
40
40
|
const animation = open ? expand(this.collapsible) : collapse(this.collapsible);
|
|
41
41
|
if (!this.isLoaded || isMotionReduced())
|
|
42
42
|
animation.finish();
|
|
@@ -45,7 +45,7 @@ export class PostCollapsible {
|
|
|
45
45
|
return this.isOpen;
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '24c0478b14a05f9d4ed60d2b0ab8c51de191be79', id: this.id, "data-version": version }, h("div", { key: 'ee070ba509f73e9ebe5bbc82276fe9be14ed4065', class: "collapse", id: `${this.id}--collapse`, ref: el => (this.collapsible = el) }, h("slot", { key: 'a2381f2fe4f777b68219a12efb8cbc90fe5e8206' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "post-collapsible"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -89,8 +89,8 @@ export class PostCollapsible {
|
|
|
89
89
|
}
|
|
90
90
|
static get events() {
|
|
91
91
|
return [{
|
|
92
|
-
"method": "
|
|
93
|
-
"name": "
|
|
92
|
+
"method": "postToggle",
|
|
93
|
+
"name": "postToggle",
|
|
94
94
|
"bubbles": true,
|
|
95
95
|
"cancelable": true,
|
|
96
96
|
"composed": true,
|
|
@@ -67,7 +67,7 @@ export class PostIcon {
|
|
|
67
67
|
const metaBase = (_b = (_a = document.head
|
|
68
68
|
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-post-icon-base')) !== null && _b !== void 0 ? _b : null;
|
|
69
69
|
const fileBase = `${(_d = (_c = this.base) !== null && _c !== void 0 ? _c : metaBase) !== null && _d !== void 0 ? _d : CDN_URL}/`.replace(/\/\/$/, '/');
|
|
70
|
-
const fileName = `${this.name}.svg
|
|
70
|
+
const fileName = `${this.name}.svg`;
|
|
71
71
|
const filePath = `${fileBase}${fileName}`;
|
|
72
72
|
this.path = new URL(filePath, window.location.origin).toString();
|
|
73
73
|
}
|
|
@@ -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: '67d24132c9748fda27201089dc343db992035d9c', "data-version": version }, h("span", { key: '1333b3fd2b809c8baf13f6fbd3aa443e43a1bd66', style: svgStyles })));
|
|
85
85
|
}
|
|
86
86
|
static get is() { return "post-icon"; }
|
|
87
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,3 +1,31 @@
|
|
|
1
1
|
/*!
|
|
2
|
+
* Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2021 The Bootstrap Authors
|
|
4
|
+
* Copyright 2011-2021 Twitter, Inc.
|
|
5
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
* The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
* Copyright (c) 2011-2020 Twitter, Inc.
|
|
10
|
+
* Copyright (c) 2011-2020 The Bootstrap Authors
|
|
11
|
+
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in
|
|
20
|
+
* all copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
28
|
+
* THE SOFTWARE.
|
|
29
|
+
*//*!
|
|
2
30
|
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;
|
|
31
|
+
*/.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{outline-style:none !important;outline-offset:2px !important;outline-width:2px !important;outline-color:var(--post-focus-color) !important}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:solid !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:solid !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%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='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:1.5rem;width:1.5rem}:is(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.alert-primary,post-alert[type=primary],.alert-success,post-alert[type=success],.alert-danger,post-alert[type=danger],.alert-notification,post-alert[type=notification],.alert-error,post-alert[type=error]) .btn-close{color:var(--post-contrast-color)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{--post-contrast-color: #fff;--post-bg-rgb: 51, 51, 51;display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{display:flex;align-items:self-start;padding:.5em;max-width:min(66vw,60rem)}@media(max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em}
|
|
@@ -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: '0ff53c82fb4ea06b0112cce0845e3ae06bdec959', "data-version": version }, h("post-popovercontainer", { key: '7375b83987e86015ee3892c5a9a829c6d04f78d3', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '6c6859eeb8d6abdf82757d8ea785e52ba2640243', class: "popover-container" }, h("div", { key: '7c28716d8b3c1d0322cf59781ae514e99ea5360f', class: "popover-content" }, h("slot", { key: 'e2c1f5166b2212f408932680cf6b33372404e28e' })), h("button", { key: 'ced34214917296d0b2f24a4584c409d9f3ee2d2d', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '36ad0884209774bf95ab0cef26ae27a531eca2f8', 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.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
},
|