@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
|
@@ -1199,8 +1199,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1199
1199
|
if (domElement) {
|
|
1200
1200
|
const win = getWindow(domElement);
|
|
1201
1201
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1202
|
-
let
|
|
1203
|
-
|
|
1202
|
+
let currentWin = win;
|
|
1203
|
+
let currentIFrame = currentWin.frameElement;
|
|
1204
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1204
1205
|
const iframeScale = getScale(currentIFrame);
|
|
1205
1206
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1206
1207
|
const css = getComputedStyle(currentIFrame);
|
|
@@ -1212,7 +1213,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1212
1213
|
height *= iframeScale.y;
|
|
1213
1214
|
x += left;
|
|
1214
1215
|
y += top;
|
|
1215
|
-
|
|
1216
|
+
currentWin = getWindow(currentIFrame);
|
|
1217
|
+
currentIFrame = currentWin.frameElement;
|
|
1216
1218
|
}
|
|
1217
1219
|
}
|
|
1218
1220
|
return rectToClientRect({
|
|
@@ -1224,27 +1226,14 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1224
1226
|
}
|
|
1225
1227
|
|
|
1226
1228
|
const topLayerSelectors = [':popover-open', ':modal'];
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
-
let x = 0;
|
|
1230
|
-
let y = 0;
|
|
1231
|
-
function setIsTopLayer(selector) {
|
|
1229
|
+
function isTopLayer(floating) {
|
|
1230
|
+
return topLayerSelectors.some(selector => {
|
|
1232
1231
|
try {
|
|
1233
|
-
|
|
1234
|
-
} catch (e) {
|
|
1235
|
-
|
|
1236
|
-
topLayerSelectors.forEach(selector => {
|
|
1237
|
-
setIsTopLayer(selector);
|
|
1238
|
-
});
|
|
1239
|
-
if (isTopLayer) {
|
|
1240
|
-
const containingBlock = getContainingBlock(floating);
|
|
1241
|
-
if (containingBlock) {
|
|
1242
|
-
const rect = containingBlock.getBoundingClientRect();
|
|
1243
|
-
x = rect.x;
|
|
1244
|
-
y = rect.y;
|
|
1232
|
+
return floating.matches(selector);
|
|
1233
|
+
} catch (e) {
|
|
1234
|
+
return false;
|
|
1245
1235
|
}
|
|
1246
|
-
}
|
|
1247
|
-
return [isTopLayer, x, y];
|
|
1236
|
+
});
|
|
1248
1237
|
}
|
|
1249
1238
|
|
|
1250
1239
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -1254,9 +1243,10 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1254
1243
|
offsetParent,
|
|
1255
1244
|
strategy
|
|
1256
1245
|
} = _ref;
|
|
1246
|
+
const isFixed = strategy === 'fixed';
|
|
1257
1247
|
const documentElement = getDocumentElement(offsetParent);
|
|
1258
|
-
const
|
|
1259
|
-
if (offsetParent === documentElement ||
|
|
1248
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1249
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1260
1250
|
return rect;
|
|
1261
1251
|
}
|
|
1262
1252
|
let scroll = {
|
|
@@ -1266,7 +1256,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1266
1256
|
let scale = createCoords(1);
|
|
1267
1257
|
const offsets = createCoords(0);
|
|
1268
1258
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1269
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement &&
|
|
1259
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1270
1260
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1271
1261
|
scroll = getNodeScroll(offsetParent);
|
|
1272
1262
|
}
|
|
@@ -1457,7 +1447,7 @@ function getDimensions(element) {
|
|
|
1457
1447
|
};
|
|
1458
1448
|
}
|
|
1459
1449
|
|
|
1460
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy
|
|
1450
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1461
1451
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1462
1452
|
const documentElement = getDocumentElement(offsetParent);
|
|
1463
1453
|
const isFixed = strategy === 'fixed';
|
|
@@ -1479,17 +1469,8 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy, floating
|
|
|
1479
1469
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
1480
1470
|
}
|
|
1481
1471
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
const [isTopLayer, topLayerX, topLayerY] = topLayer(floating);
|
|
1485
|
-
if (isTopLayer) {
|
|
1486
|
-
x += topLayerX;
|
|
1487
|
-
y += topLayerY;
|
|
1488
|
-
if (isOffsetParentAnElement) {
|
|
1489
|
-
x += offsetParent.clientLeft;
|
|
1490
|
-
y += offsetParent.clientTop;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1472
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
1473
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
1493
1474
|
return {
|
|
1494
1475
|
x,
|
|
1495
1476
|
y,
|
|
@@ -1512,7 +1493,7 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
1512
1493
|
// such as table ancestors and cross browser bugs.
|
|
1513
1494
|
function getOffsetParent(element, polyfill) {
|
|
1514
1495
|
const window = getWindow(element);
|
|
1515
|
-
if (!isHTMLElement(element)) {
|
|
1496
|
+
if (!isHTMLElement(element) || isTopLayer(element)) {
|
|
1516
1497
|
return window;
|
|
1517
1498
|
}
|
|
1518
1499
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
@@ -1529,7 +1510,7 @@ const getElementRects = async function (data) {
|
|
|
1529
1510
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1530
1511
|
const getDimensionsFn = this.getDimensions;
|
|
1531
1512
|
return {
|
|
1532
|
-
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy
|
|
1513
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1533
1514
|
floating: {
|
|
1534
1515
|
x: 0,
|
|
1535
1516
|
y: 0,
|
|
@@ -1846,7 +1827,7 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1846
1827
|
super();
|
|
1847
1828
|
this.__registerHost();
|
|
1848
1829
|
this.__attachShadow();
|
|
1849
|
-
this.
|
|
1830
|
+
this.postToggle = createEvent(this, "postToggle", 7);
|
|
1850
1831
|
this.placement = 'top';
|
|
1851
1832
|
this.arrow = false;
|
|
1852
1833
|
}
|
|
@@ -1911,7 +1892,7 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1911
1892
|
if (typeof this.clearAutoUpdate === 'function')
|
|
1912
1893
|
this.clearAutoUpdate();
|
|
1913
1894
|
}
|
|
1914
|
-
this.
|
|
1895
|
+
this.postToggle.emit(isOpen);
|
|
1915
1896
|
}
|
|
1916
1897
|
/**
|
|
1917
1898
|
* Start listening for DOM updates, scroll events etc. that have
|
|
@@ -1970,9 +1951,9 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1970
1951
|
}
|
|
1971
1952
|
}
|
|
1972
1953
|
render() {
|
|
1973
|
-
return (h(Host, { key: '
|
|
1954
|
+
return (h(Host, { key: '885b256b85ee57c3114243c980db51bb4c7eef92', "data-version": version }, h("div", { key: 'e3ae342b6c0bb6b241141c5ee0d2a95ab0ba169e', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { class: "arrow", ref: el => {
|
|
1974
1955
|
this.arrowRef = el;
|
|
1975
|
-
} })), h("slot", { key: '
|
|
1956
|
+
} })), h("slot", { key: 'bc8d1e026b248c4c3cafa28c8cbdabe3610604e7' }))));
|
|
1976
1957
|
}
|
|
1977
1958
|
get host() { return this; }
|
|
1978
1959
|
static get style() { return PostPopovercontainerStyle0; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostRating extends Components.PostRating, HTMLElement {}
|
|
4
|
+
export const PostRating: {
|
|
5
|
+
prototype: PostRating;
|
|
6
|
+
new (): PostRating;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
4
|
+
|
|
5
|
+
const postRatingCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 -0.25rem;border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:2px;outline:2px solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}";
|
|
6
|
+
const PostRatingStyle0 = postRatingCss;
|
|
7
|
+
|
|
8
|
+
const PostRating = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
this.postInput = createEvent(this, "postInput", 7);
|
|
14
|
+
this.postChange = createEvent(this, "postChange", 7);
|
|
15
|
+
this.hasChanged = false;
|
|
16
|
+
this.hoveredIndex = undefined;
|
|
17
|
+
this.label = 'Rating';
|
|
18
|
+
this.stars = 5;
|
|
19
|
+
this.currentRating = 0;
|
|
20
|
+
this.readonly = false;
|
|
21
|
+
this.keydownHandler = this.keydownHandler.bind(this);
|
|
22
|
+
this.blurHandler = this.blurHandler.bind(this);
|
|
23
|
+
this.hoverHandler = this.hoverHandler.bind(this);
|
|
24
|
+
}
|
|
25
|
+
update(value) {
|
|
26
|
+
if (this.readonly || value < 0 || value > this.stars)
|
|
27
|
+
return;
|
|
28
|
+
this.currentRating = this.currentRating !== value ? value : 0; // If a star is clicked the second time, the rating gets set to 0.
|
|
29
|
+
this.postInput.emit({ value: this.currentRating });
|
|
30
|
+
this.hasChanged = true;
|
|
31
|
+
}
|
|
32
|
+
keydownHandler(e) {
|
|
33
|
+
switch (e.key) {
|
|
34
|
+
case 'ArrowDown':
|
|
35
|
+
case 'ArrowLeft':
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
this.update(this.currentRating - 1);
|
|
38
|
+
break;
|
|
39
|
+
case 'ArrowUp':
|
|
40
|
+
case 'ArrowRight':
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
this.update(this.currentRating + 1);
|
|
43
|
+
break;
|
|
44
|
+
case 'Home':
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
this.update(0);
|
|
47
|
+
break;
|
|
48
|
+
case 'End':
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
this.update(this.stars);
|
|
51
|
+
break;
|
|
52
|
+
case 'Enter':
|
|
53
|
+
case ' ':
|
|
54
|
+
this.blurHandler();
|
|
55
|
+
break;
|
|
56
|
+
default:
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
blurHandler() {
|
|
61
|
+
if (this.hasChanged) {
|
|
62
|
+
this.postChange.emit({ value: this.currentRating });
|
|
63
|
+
this.hasChanged = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
hoverHandler(index, e) {
|
|
67
|
+
if (this.readonly)
|
|
68
|
+
return;
|
|
69
|
+
if (e.type === 'mouseenter') {
|
|
70
|
+
this.hoveredIndex = index;
|
|
71
|
+
}
|
|
72
|
+
else if (e.type === 'mouseleave') {
|
|
73
|
+
this.hoveredIndex = undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return (h(Host, { key: '9423629ce4f05cacb20fb3476d036dc175d21f98', "data-version": version }, h("div", { key: '99efcd3cad667d24ea27a4c592d5c3b202191ed4', 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: {
|
|
78
|
+
'star': true,
|
|
79
|
+
'before-hover': i < this.hoveredIndex,
|
|
80
|
+
'active': i < Math.round(this.currentRating),
|
|
81
|
+
'hover': i === this.hoveredIndex,
|
|
82
|
+
'after-active': i > this.hoveredIndex && i < this.currentRating,
|
|
83
|
+
}, onClick: () => this.update(i + 1), onMouseEnter: e => this.hoverHandler(i, e), onMouseLeave: e => this.hoverHandler(i, e) }, h("post-icon", { name: "2062", class: "stroke" }), h("post-icon", { name: "2574", class: "fill" })))))));
|
|
84
|
+
}
|
|
85
|
+
get host() { return this; }
|
|
86
|
+
static get style() { return PostRatingStyle0; }
|
|
87
|
+
}, [1, "post-rating", {
|
|
88
|
+
"label": [1],
|
|
89
|
+
"stars": [2],
|
|
90
|
+
"currentRating": [1026, "current-rating"],
|
|
91
|
+
"readonly": [4],
|
|
92
|
+
"hoveredIndex": [32]
|
|
93
|
+
}]);
|
|
94
|
+
function defineCustomElement() {
|
|
95
|
+
if (typeof customElements === "undefined") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const components = ["post-rating", "post-icon"];
|
|
99
|
+
components.forEach(tagName => { switch (tagName) {
|
|
100
|
+
case "post-rating":
|
|
101
|
+
if (!customElements.get(tagName)) {
|
|
102
|
+
customElements.define(tagName, PostRating);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "post-icon":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
defineCustomElement$1();
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
} });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { PostRating as P, defineCustomElement as d };
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
4
4
|
|
|
5
|
-
const postTabHeaderCss = ".tab-title[role=tab]{display:inline-block;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:var(--post-contrast-color);text-decoration:none}.tab-title[role=tab]:focus{background-color:unset;color:var(--post-contrast-color)}.tab-title[role=tab]:hover{opacity:1;background-color
|
|
5
|
+
const postTabHeaderCss = ".tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:var(--post-contrast-color);text-decoration:none;background-color:var(--post-contrast-color-inverted)}.tab-title[role=tab]:focus{background-color:unset;color:var(--post-contrast-color)}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(var(--post-contrast-color-rgb), 0.6);color:var(--post-contrast-color-inverted)}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(var(--post-contrast-color-rgb), 0.6);color:var(--post-contrast-color-inverted);box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:\"\";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:var(--post-contrast-color-inverted);color:var(--post-contrast-color);font-weight:700}.tab-title[role=tab].active::before{content:\"\";display:block;position:absolute;top:0;right:-1px;left:-1px;height:.25rem;background-color:#fc0}: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]) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}: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]) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:2px solid Highlight;outline-offset:-0.25rem}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}.bg-yellow .tab-title{background-color:#fc0}.bg-yellow .tab-title.active{background-color:#fc0}.bg-yellow .nav-item{background-color:#fc0}.bg-white .tab-title{background-color:#fff}.bg-white .tab-title.active{background-color:#fff}.bg-white .nav-item{background-color:#fff}.bg-light .tab-title{background-color:#faf9f8}.bg-light .tab-title.active{background-color:#faf9f8}.bg-light .nav-item{background-color:#faf9f8}.bg-gray .tab-title{background-color:#f4f3f1}.bg-gray .tab-title.active{background-color:#f4f3f1}.bg-gray .nav-item{background-color:#f4f3f1}.bg-dark .tab-title{background-color:#333}.bg-dark .tab-title.active{background-color:#333}.bg-dark .nav-item{background-color:#333}.bg-black .tab-title{background-color:#000}.bg-black .tab-title.active{background-color:#000}.bg-black .nav-item{background-color:#000}.bg-primary .tab-title{background-color:#333}.bg-primary .tab-title.active{background-color:#333}.bg-primary .nav-item{background-color:#333}.bg-secondary .tab-title{background-color:#666}.bg-secondary .tab-title.active{background-color:#666}.bg-secondary .nav-item{background-color:#666}.bg-success .tab-title{background-color:#2c871d}.bg-success .tab-title.active{background-color:#2c871d}.bg-success .nav-item{background-color:#2c871d}.bg-warning .tab-title{background-color:#f49e00}.bg-warning .tab-title.active{background-color:#f49e00}.bg-warning .nav-item{background-color:#f49e00}.bg-error .tab-title{background-color:#a51728}.bg-error .tab-title.active{background-color:#a51728}.bg-error .nav-item{background-color:#a51728}.bg-info .tab-title{background-color:#cce4ee}.bg-info .tab-title.active{background-color:#cce4ee}.bg-info .nav-item{background-color:#cce4ee}.bg-success-background .tab-title{background-color:#c0debb}.bg-success-background .tab-title.active{background-color:#c0debb}.bg-success-background .nav-item{background-color:#c0debb}.bg-warning-background .tab-title{background-color:#fce2b2}.bg-warning-background .tab-title.active{background-color:#fce2b2}.bg-warning-background .nav-item{background-color:#fce2b2}.bg-error-background .tab-title{background-color:#ffdade}.bg-error-background .tab-title.active{background-color:#ffdade}.bg-error-background .nav-item{background-color:#ffdade}.bg-nightblue .tab-title{background-color:#004976}.bg-nightblue .tab-title.active{background-color:#004976}.bg-nightblue .nav-item{background-color:#004976}.bg-nightblue-bright .tab-title{background-color:#0076a8}.bg-nightblue-bright .tab-title.active{background-color:#0076a8}.bg-nightblue-bright .nav-item{background-color:#0076a8}.bg-petrol .tab-title{background-color:#006d68}.bg-petrol .tab-title.active{background-color:#006d68}.bg-petrol .nav-item{background-color:#006d68}.bg-petrol-bright .tab-title{background-color:#00968f}.bg-petrol-bright .tab-title.active{background-color:#00968f}.bg-petrol-bright .nav-item{background-color:#00968f}.bg-coral .tab-title{background-color:#9e2a2f}.bg-coral .tab-title.active{background-color:#9e2a2f}.bg-coral .nav-item{background-color:#9e2a2f}.bg-coral-bright .tab-title{background-color:#e03c31}.bg-coral-bright .tab-title.active{background-color:#e03c31}.bg-coral-bright .nav-item{background-color:#e03c31}.bg-olive .tab-title{background-color:#716135}.bg-olive .tab-title.active{background-color:#716135}.bg-olive .nav-item{background-color:#716135}.bg-olive-bright .tab-title{background-color:#aa9d2e}.bg-olive-bright .tab-title.active{background-color:#aa9d2e}.bg-olive-bright .nav-item{background-color:#aa9d2e}.bg-purple .tab-title{background-color:#80276c}.bg-purple .tab-title.active{background-color:#80276c}.bg-purple .nav-item{background-color:#80276c}.bg-purple-bright .tab-title{background-color:#c5299b}.bg-purple-bright .tab-title.active{background-color:#c5299b}.bg-purple-bright .nav-item{background-color:#c5299b}.bg-aubergine .tab-title{background-color:#523178}.bg-aubergine .tab-title.active{background-color:#523178}.bg-aubergine .nav-item{background-color:#523178}.bg-aubergine-bright .tab-title{background-color:#7566a0}.bg-aubergine-bright .tab-title.active{background-color:#7566a0}.bg-aubergine-bright .nav-item{background-color:#7566a0}[class*=bg-] .tab-title.active:focus::after{background-color:rgba(255,255,255,.2)}@supports selector(*:focus-visible){[class*=bg-] .tab-title.active:focus::after{background-color:unset}[class*=bg-] .tab-title.active:focus-visible::after{background-color:rgba(255,255,255,.2)}}/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button}";
|
|
6
6
|
const PostTabHeaderStyle0 = postTabHeaderCss;
|
|
7
7
|
|
|
8
8
|
const PostTabHeader = /*@__PURE__*/ proxyCustomElement(class PostTabHeader extends HTMLElement {
|
|
@@ -20,7 +20,7 @@ const PostTabHeader = /*@__PURE__*/ proxyCustomElement(class PostTabHeader exten
|
|
|
20
20
|
this.tabId = `tab-${this.host.id || crypto.randomUUID()}`;
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: '7574d4ab05fae64a57f718e8c185c3aec1690e0f', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title" }, h("slot", { key: 'c8af8275935433eba2d673fe283412a2a9266340' })));
|
|
24
24
|
}
|
|
25
25
|
get host() { return this; }
|
|
26
26
|
static get watchers() { return {
|
|
@@ -17,7 +17,7 @@ const PostTabPanel = /*@__PURE__*/ proxyCustomElement(class PostTabPanel extends
|
|
|
17
17
|
this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '3833b2f565d457ea6f8c35273f0fe310b56b2d00', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '299c354b73a8d04ebab94ad7bc10cb703127ee65' })));
|
|
21
21
|
}
|
|
22
22
|
get host() { return this; }
|
|
23
23
|
static get style() { return PostTabPanelStyle0; }
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { f as fadeOut, a as fadeIn } from './fade.js';
|
|
4
4
|
|
|
5
|
-
const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color
|
|
5
|
+
const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(var(--post-contrast-color-rgb), 0.02)}.tabs-wrapper::after{content:\"\";position:absolute;bottom:0;width:100%;height:1px;background-color:#ccc}.tabs-wrapper .tabs{background-color:rgba(0,0,0,0) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tabs-wrapper::after{background-color:ButtonBorder}}.tabs{margin:0;padding:0;list-style:none;display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap}.tabs::after{content:\"\";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem}.bg-yellow .tabs-wrapper{background-color:#fc0}.bg-white .tabs-wrapper{background-color:#fff}.bg-light .tabs-wrapper{background-color:#faf9f8}.bg-gray .tabs-wrapper{background-color:#f4f3f1}.bg-dark .tabs-wrapper{background-color:#333}.bg-black .tabs-wrapper{background-color:#000}.bg-primary .tabs-wrapper{background-color:#333}.bg-secondary .tabs-wrapper{background-color:#666}.bg-success .tabs-wrapper{background-color:#2c871d}.bg-warning .tabs-wrapper{background-color:#f49e00}.bg-error .tabs-wrapper{background-color:#a51728}.bg-info .tabs-wrapper{background-color:#cce4ee}.bg-success-background .tabs-wrapper{background-color:#c0debb}.bg-warning-background .tabs-wrapper{background-color:#fce2b2}.bg-error-background .tabs-wrapper{background-color:#ffdade}.bg-nightblue .tabs-wrapper{background-color:#004976}.bg-nightblue-bright .tabs-wrapper{background-color:#0076a8}.bg-petrol .tabs-wrapper{background-color:#006d68}.bg-petrol-bright .tabs-wrapper{background-color:#00968f}.bg-coral .tabs-wrapper{background-color:#9e2a2f}.bg-coral-bright .tabs-wrapper{background-color:#e03c31}.bg-olive .tabs-wrapper{background-color:#716135}.bg-olive-bright .tabs-wrapper{background-color:#aa9d2e}.bg-purple .tabs-wrapper{background-color:#80276c}.bg-purple-bright .tabs-wrapper{background-color:#c5299b}.bg-aubergine .tabs-wrapper{background-color:#523178}.bg-aubergine-bright .tabs-wrapper{background-color:#7566a0}:host{display:block}";
|
|
6
6
|
const PostTabsStyle0 = postTabsCss;
|
|
7
7
|
|
|
8
8
|
const PostTabs = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLElement {
|
|
@@ -10,7 +10,7 @@ const PostTabs = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLEle
|
|
|
10
10
|
super();
|
|
11
11
|
this.__registerHost();
|
|
12
12
|
this.__attachShadow();
|
|
13
|
-
this.
|
|
13
|
+
this.postChange = createEvent(this, "postChange", 7);
|
|
14
14
|
this.isLoaded = false;
|
|
15
15
|
this.activePanel = undefined;
|
|
16
16
|
}
|
|
@@ -55,7 +55,7 @@ const PostTabs = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLEle
|
|
|
55
55
|
if (this.showing) {
|
|
56
56
|
await this.showing.finished;
|
|
57
57
|
}
|
|
58
|
-
this.
|
|
58
|
+
this.postChange.emit(this.activeTab.panel);
|
|
59
59
|
}
|
|
60
60
|
moveMisplacedTabs() {
|
|
61
61
|
if (!this.tabs)
|
|
@@ -71,16 +71,21 @@ const PostTabs = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLEle
|
|
|
71
71
|
return;
|
|
72
72
|
this.tabs.forEach(async (tab) => {
|
|
73
73
|
await tab.componentOnReady();
|
|
74
|
-
const tabTitle = tab.shadowRoot.querySelector('.tab-title');
|
|
75
74
|
// if the tab has an "aria-controls" attribute it was already linked to its panel: do nothing
|
|
76
|
-
if (
|
|
75
|
+
if (tab.getAttribute('aria-controls'))
|
|
77
76
|
return;
|
|
78
|
-
const tabPanel = this.getPanel(tab.panel)
|
|
79
|
-
|
|
80
|
-
tabPanel.setAttribute('aria-labelledby',
|
|
77
|
+
const tabPanel = this.getPanel(tab.panel);
|
|
78
|
+
tab.setAttribute('aria-controls', tabPanel.id);
|
|
79
|
+
tabPanel.setAttribute('aria-labelledby', tab.id);
|
|
81
80
|
tab.addEventListener('click', () => {
|
|
82
81
|
void this.show(tab.panel);
|
|
83
82
|
});
|
|
83
|
+
tab.addEventListener('keydown', (e) => {
|
|
84
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
void this.show(tab.panel);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
84
89
|
tab.addEventListener('keydown', ({ key }) => {
|
|
85
90
|
if (key === 'ArrowRight' || key === 'ArrowLeft')
|
|
86
91
|
this.navigateTabs(tab, key);
|
|
@@ -93,15 +98,13 @@ const PostTabs = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLEle
|
|
|
93
98
|
}
|
|
94
99
|
activateTab(tab) {
|
|
95
100
|
if (this.activeTab) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
tabTitle.classList.remove('active');
|
|
101
|
+
this.activeTab.setAttribute('aria-selected', 'false');
|
|
102
|
+
this.activeTab.setAttribute('tabindex', '-1');
|
|
103
|
+
this.activeTab.classList.remove('active');
|
|
100
104
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
tabTitle.classList.add('active');
|
|
105
|
+
tab.setAttribute('aria-selected', 'true');
|
|
106
|
+
tab.setAttribute('tabindex', '0');
|
|
107
|
+
tab.classList.add('active');
|
|
105
108
|
this.activeTab = tab;
|
|
106
109
|
}
|
|
107
110
|
hidePanel(panelName) {
|
|
@@ -139,11 +142,10 @@ const PostTabs = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLEle
|
|
|
139
142
|
}
|
|
140
143
|
if (!nextTab)
|
|
141
144
|
return;
|
|
142
|
-
|
|
143
|
-
nextTabTitle.focus();
|
|
145
|
+
nextTab.focus();
|
|
144
146
|
}
|
|
145
147
|
render() {
|
|
146
|
-
return (h(Host, { key: '
|
|
148
|
+
return (h(Host, { key: '3af6b715a2ff43314fbc6c436a7693345baabbdb', "data-version": version }, h("div", { key: 'a63850f142b198057a11039101c9ca3c3793f564', class: "tabs-wrapper" }, h("div", { key: '3c3592ea6241f07d672bc4cc049e7f582ba35fef', class: "tabs", role: "tablist" }, h("slot", { key: 'da38ec0fc7cd43588b151f6675458eb0f34b911e', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '451cc4a29b77f3055f469ff18081c5292e21bf36', class: "tab-content" }, h("slot", { key: '32902b5e314c29e74bf4f6c5f02e22c301a47f6f', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
147
149
|
}
|
|
148
150
|
get host() { return this; }
|
|
149
151
|
static get style() { return PostTabsStyle0; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostTag extends Components.PostTag, HTMLElement {}
|
|
4
|
+
export const PostTag: {
|
|
5
|
+
prototype: PostTag;
|
|
6
|
+
new (): PostTag;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
4
|
+
|
|
5
|
+
const postTagCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.tag,.tag:where(:has(:not(pre))){--post-tag-bg:hsl(0, 0%, 90%);--post-tag-fg:#000;display:inline-flex;align-items:center;gap:.25rem;padding:0 .5rem;max-width:18.5rem;background-color:var(--post-tag-bg);border:1px solid rgba(0,0,0,0);border-radius:.25rem;font-size:1rem;line-height:1.875rem;white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:1.5rem}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg:#fff;--post-tag-fg:#000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg:#fc0;--post-tag-fg:#000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg:#2c871d;--post-tag-fg:#fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg:#f49e00;--post-tag-fg:#000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg:#a51728;--post-tag-fg:#fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg:#cce4ee;--post-tag-fg:#000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:var(--post-contrast-color)}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}";
|
|
6
|
+
const PostTagStyle0 = postTagCss;
|
|
7
|
+
|
|
8
|
+
const PostTag = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
this.classes = undefined;
|
|
14
|
+
this.variant = undefined;
|
|
15
|
+
this.size = null;
|
|
16
|
+
this.icon = null;
|
|
17
|
+
this.setClasses = this.setClasses.bind(this);
|
|
18
|
+
}
|
|
19
|
+
variantChanged() {
|
|
20
|
+
this.setClasses();
|
|
21
|
+
}
|
|
22
|
+
sizeChanged() {
|
|
23
|
+
this.setClasses();
|
|
24
|
+
}
|
|
25
|
+
setClasses() {
|
|
26
|
+
this.classes = ['tag', this.size ? `tag-${this.size}` : null, this.variant ? `tag-${this.variant}` : null]
|
|
27
|
+
.filter(c => c !== null)
|
|
28
|
+
.join(' ');
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
this.setClasses();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h(Host, { key: '2b5b8cf859417949329040bad1f03d94b090fcaa', "data-version": version }, h("div", { key: 'b3e8e5b78959b3036e708faa209d57c75c570e60', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '152f8db8aa831d05545ae3f5555083299132ad2f', class: "tag-text" }, h("slot", { key: '043aa0a1f6bceb3757c1bc7a528fb29eaa1b6b22' })))));
|
|
35
|
+
}
|
|
36
|
+
get host() { return this; }
|
|
37
|
+
static get watchers() { return {
|
|
38
|
+
"variant": ["variantChanged"],
|
|
39
|
+
"size": ["sizeChanged"]
|
|
40
|
+
}; }
|
|
41
|
+
static get style() { return PostTagStyle0; }
|
|
42
|
+
}, [1, "post-tag", {
|
|
43
|
+
"variant": [1],
|
|
44
|
+
"size": [1],
|
|
45
|
+
"icon": [1],
|
|
46
|
+
"classes": [32]
|
|
47
|
+
}, undefined, {
|
|
48
|
+
"variant": ["variantChanged"],
|
|
49
|
+
"size": ["sizeChanged"]
|
|
50
|
+
}]);
|
|
51
|
+
function defineCustomElement() {
|
|
52
|
+
if (typeof customElements === "undefined") {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const components = ["post-tag", "post-icon"];
|
|
56
|
+
components.forEach(tagName => { switch (tagName) {
|
|
57
|
+
case "post-tag":
|
|
58
|
+
if (!customElements.get(tagName)) {
|
|
59
|
+
customElements.define(tagName, PostTag);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case "post-icon":
|
|
63
|
+
if (!customElements.get(tagName)) {
|
|
64
|
+
defineCustomElement$1();
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
} });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { PostTag as P, defineCustomElement as d };
|
|
@@ -4783,6 +4783,7 @@ const PostTooltipStyle0 = postTooltipCss;
|
|
|
4783
4783
|
let tooltipInstances = 0;
|
|
4784
4784
|
let hideTooltipTimeout = null;
|
|
4785
4785
|
const tooltipTargetAttribute = 'data-tooltip-target';
|
|
4786
|
+
const tooltipTargetAttributeSelector = `[${tooltipTargetAttribute}]`;
|
|
4786
4787
|
/**
|
|
4787
4788
|
* Global event listener to show tooltips. This is globalized so that triggers that are rendered
|
|
4788
4789
|
* async will still work without the need to set listeners on the element itself
|
|
@@ -4790,14 +4791,14 @@ const tooltipTargetAttribute = 'data-tooltip-target';
|
|
|
4790
4791
|
* @returns
|
|
4791
4792
|
*/
|
|
4792
4793
|
const globalInterestHandler = (e) => {
|
|
4793
|
-
const
|
|
4794
|
-
if (!
|
|
4794
|
+
const targetElement = e.target.closest(tooltipTargetAttributeSelector);
|
|
4795
|
+
if (!targetElement || !('getAttribute' in targetElement))
|
|
4795
4796
|
return;
|
|
4796
|
-
const tooltipTarget =
|
|
4797
|
+
const tooltipTarget = targetElement.getAttribute(tooltipTargetAttribute);
|
|
4797
4798
|
if (!tooltipTarget || tooltipTarget === '')
|
|
4798
4799
|
return;
|
|
4799
4800
|
const tooltip = document.getElementById(tooltipTarget);
|
|
4800
|
-
tooltip === null || tooltip === void 0 ? void 0 : tooltip.show(
|
|
4801
|
+
void (tooltip === null || tooltip === void 0 ? void 0 : tooltip.show(targetElement));
|
|
4801
4802
|
if (hideTooltipTimeout) {
|
|
4802
4803
|
window.clearTimeout(hideTooltipTimeout);
|
|
4803
4804
|
hideTooltipTimeout = null;
|
|
@@ -4810,8 +4811,10 @@ const globalInterestHandler = (e) => {
|
|
|
4810
4811
|
* @returns
|
|
4811
4812
|
*/
|
|
4812
4813
|
const globalInterestLostHandler = (e) => {
|
|
4813
|
-
const
|
|
4814
|
-
|
|
4814
|
+
const targetElement = e.target.closest(tooltipTargetAttributeSelector);
|
|
4815
|
+
if (!targetElement || !('getAttribute' in targetElement))
|
|
4816
|
+
return;
|
|
4817
|
+
const tooltipTarget = targetElement.getAttribute(tooltipTargetAttribute);
|
|
4815
4818
|
if (!tooltipTarget || tooltipTarget === '')
|
|
4816
4819
|
return;
|
|
4817
4820
|
const tooltip = document.getElementById(tooltipTarget);
|
|
@@ -4939,7 +4942,7 @@ const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H
|
|
|
4939
4942
|
}
|
|
4940
4943
|
render() {
|
|
4941
4944
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4942
|
-
return (h(Host, { key: '
|
|
4945
|
+
return (h(Host, { key: '32701caefa668ce5f140389a5bff2fc879571575', "data-version": version$1, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '34d458686b09255fc0601cb23dec295cf21f826c', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: 'f99391db0594c9a65939c9e03719e39bf7d26fde' }))));
|
|
4943
4946
|
}
|
|
4944
4947
|
get host() { return this; }
|
|
4945
4948
|
static get style() { return PostTooltipStyle0; }
|