@cumulus-ui/components 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alert/internal.d.ts.map +1 -1
- package/dist/cards/index.d.ts +5 -0
- package/dist/cards/index.d.ts.map +1 -0
- package/dist/cards/internal.d.ts +35 -0
- package/dist/cards/internal.d.ts.map +1 -0
- package/dist/cards/styles.d.ts +5 -0
- package/dist/cards/styles.d.ts.map +1 -0
- package/dist/collection-preferences/index.d.ts +5 -0
- package/dist/collection-preferences/index.d.ts.map +1 -0
- package/dist/collection-preferences/internal.d.ts +42 -0
- package/dist/collection-preferences/internal.d.ts.map +1 -0
- package/dist/collection-preferences/styles.d.ts +5 -0
- package/dist/collection-preferences/styles.d.ts.map +1 -0
- package/dist/file-upload/styles.d.ts +5 -0
- package/dist/file-upload/styles.d.ts.map +1 -0
- package/dist/form/styles.d.ts +5 -0
- package/dist/form/styles.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2512 -45
- package/dist/internal/collection-controller.d.ts +72 -0
- package/dist/internal/collection-controller.d.ts.map +1 -0
- package/dist/internal/styles/property-filter-filtering-token.d.ts +2 -0
- package/dist/internal/styles/property-filter-filtering-token.d.ts.map +1 -0
- package/dist/internal/styles/table-body-cell.d.ts +2 -0
- package/dist/internal/styles/table-body-cell.d.ts.map +1 -0
- package/dist/internal/styles/table-header-cell.d.ts +2 -0
- package/dist/internal/styles/table-header-cell.d.ts.map +1 -0
- package/dist/internal/styles/table-progressive-loading.d.ts +2 -0
- package/dist/internal/styles/table-progressive-loading.d.ts.map +1 -0
- package/dist/internal/styles/table-resizer.d.ts +2 -0
- package/dist/internal/styles/table-resizer.d.ts.map +1 -0
- package/dist/internal/styles/table-selection.d.ts +2 -0
- package/dist/internal/styles/table-selection.d.ts.map +1 -0
- package/dist/internal/styles/table-sticky-scrollbar.d.ts +2 -0
- package/dist/internal/styles/table-sticky-scrollbar.d.ts.map +1 -0
- package/dist/key-value-pairs/index.d.ts +5 -0
- package/dist/key-value-pairs/index.d.ts.map +1 -0
- package/dist/key-value-pairs/internal.d.ts +15 -0
- package/dist/key-value-pairs/internal.d.ts.map +1 -0
- package/dist/key-value-pairs/styles.d.ts +5 -0
- package/dist/key-value-pairs/styles.d.ts.map +1 -0
- package/dist/modal/styles.d.ts +5 -0
- package/dist/modal/styles.d.ts.map +1 -0
- package/dist/progress-bar/index.d.ts +5 -0
- package/dist/progress-bar/index.d.ts.map +1 -0
- package/dist/progress-bar/internal.d.ts +18 -0
- package/dist/progress-bar/internal.d.ts.map +1 -0
- package/dist/progress-bar/styles.d.ts +5 -0
- package/dist/progress-bar/styles.d.ts.map +1 -0
- package/dist/property-filter/index.d.ts +6 -0
- package/dist/property-filter/index.d.ts.map +1 -0
- package/dist/property-filter/internal.d.ts +41 -0
- package/dist/property-filter/internal.d.ts.map +1 -0
- package/dist/property-filter/styles.d.ts +5 -0
- package/dist/property-filter/styles.d.ts.map +1 -0
- package/dist/steps/index.d.ts +5 -0
- package/dist/steps/index.d.ts.map +1 -0
- package/dist/steps/internal.d.ts +18 -0
- package/dist/steps/internal.d.ts.map +1 -0
- package/dist/steps/styles.d.ts +5 -0
- package/dist/steps/styles.d.ts.map +1 -0
- package/dist/table/index.d.ts +5 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/internal.d.ts +56 -0
- package/dist/table/internal.d.ts.map +1 -0
- package/dist/table/styles.d.ts +5 -0
- package/dist/table/styles.d.ts.map +1 -0
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -64,8 +64,8 @@ function FormAssociatedMixin(superClass) {
|
|
|
64
64
|
this._defaultValue = this.value;
|
|
65
65
|
}
|
|
66
66
|
// ── Public API (thin wrappers around ElementInternals) ────────────
|
|
67
|
-
setFormValue(value,
|
|
68
|
-
this._internals.setFormValue(value,
|
|
67
|
+
setFormValue(value, state18) {
|
|
68
|
+
this._internals.setFormValue(value, state18);
|
|
69
69
|
}
|
|
70
70
|
setValidity(flags, message, anchor) {
|
|
71
71
|
if (flags && message) {
|
|
@@ -99,9 +99,9 @@ function FormAssociatedMixin(superClass) {
|
|
|
99
99
|
* @param state - Previously saved value or `FormData` entry.
|
|
100
100
|
* @param _mode - `'restore'` (bfcache) or `'autocomplete'`.
|
|
101
101
|
*/
|
|
102
|
-
formStateRestoreCallback(
|
|
103
|
-
if (typeof
|
|
104
|
-
this.value =
|
|
102
|
+
formStateRestoreCallback(state18, _mode) {
|
|
103
|
+
if (typeof state18 === "string") {
|
|
104
|
+
this.value = state18;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -5844,7 +5844,7 @@ var CsAlertInternal = class extends CsBaseElement {
|
|
|
5844
5844
|
const alertClasses = {
|
|
5845
5845
|
"alert": true,
|
|
5846
5846
|
[`type-${this.type}`]: true,
|
|
5847
|
-
"icon-size-
|
|
5847
|
+
"icon-size-normal": true
|
|
5848
5848
|
};
|
|
5849
5849
|
return html18`
|
|
5850
5850
|
<div class=${classMap16(rootClasses)}>
|
|
@@ -5854,13 +5854,12 @@ var CsAlertInternal = class extends CsBaseElement {
|
|
|
5854
5854
|
<div class="text icon">
|
|
5855
5855
|
<cs-icon
|
|
5856
5856
|
name=${iconName}
|
|
5857
|
-
size="medium"
|
|
5858
5857
|
aria-label=${ifDefined9(this.statusIconAriaLabel || void 0)}
|
|
5859
5858
|
></cs-icon>
|
|
5860
5859
|
</div>
|
|
5861
5860
|
<div class="text message">
|
|
5862
5861
|
${this.header ? html18`<div class="header">${this.header}</div>` : nothing5}
|
|
5863
|
-
<div>
|
|
5862
|
+
<div class="content">
|
|
5864
5863
|
<slot></slot>
|
|
5865
5864
|
</div>
|
|
5866
5865
|
</div>
|
|
@@ -6097,7 +6096,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
6097
6096
|
}
|
|
6098
6097
|
return coords;
|
|
6099
6098
|
}
|
|
6100
|
-
async function detectOverflow(
|
|
6099
|
+
async function detectOverflow(state18, options) {
|
|
6101
6100
|
var _await$platform$isEle;
|
|
6102
6101
|
if (options === void 0) {
|
|
6103
6102
|
options = {};
|
|
@@ -6109,14 +6108,14 @@ async function detectOverflow(state15, options) {
|
|
|
6109
6108
|
rects,
|
|
6110
6109
|
elements,
|
|
6111
6110
|
strategy
|
|
6112
|
-
} =
|
|
6111
|
+
} = state18;
|
|
6113
6112
|
const {
|
|
6114
6113
|
boundary = "clippingAncestors",
|
|
6115
6114
|
rootBoundary = "viewport",
|
|
6116
6115
|
elementContext = "floating",
|
|
6117
6116
|
altBoundary = false,
|
|
6118
6117
|
padding = 0
|
|
6119
|
-
} = evaluate(options,
|
|
6118
|
+
} = evaluate(options, state18);
|
|
6120
6119
|
const paddingObject = getPaddingObject(padding);
|
|
6121
6120
|
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
6122
6121
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
@@ -6248,7 +6247,7 @@ var flip = function(options) {
|
|
|
6248
6247
|
return {
|
|
6249
6248
|
name: "flip",
|
|
6250
6249
|
options,
|
|
6251
|
-
async fn(
|
|
6250
|
+
async fn(state18) {
|
|
6252
6251
|
var _middlewareData$arrow, _middlewareData$flip;
|
|
6253
6252
|
const {
|
|
6254
6253
|
placement,
|
|
@@ -6257,7 +6256,7 @@ var flip = function(options) {
|
|
|
6257
6256
|
initialPlacement,
|
|
6258
6257
|
platform: platform2,
|
|
6259
6258
|
elements
|
|
6260
|
-
} =
|
|
6259
|
+
} = state18;
|
|
6261
6260
|
const {
|
|
6262
6261
|
mainAxis: checkMainAxis = true,
|
|
6263
6262
|
crossAxis: checkCrossAxis = true,
|
|
@@ -6266,7 +6265,7 @@ var flip = function(options) {
|
|
|
6266
6265
|
fallbackAxisSideDirection = "none",
|
|
6267
6266
|
flipAlignment = true,
|
|
6268
6267
|
...detectOverflowOptions
|
|
6269
|
-
} = evaluate(options,
|
|
6268
|
+
} = evaluate(options, state18);
|
|
6270
6269
|
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
6271
6270
|
return {};
|
|
6272
6271
|
}
|
|
@@ -6280,7 +6279,7 @@ var flip = function(options) {
|
|
|
6280
6279
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
6281
6280
|
}
|
|
6282
6281
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
6283
|
-
const overflow = await platform2.detectOverflow(
|
|
6282
|
+
const overflow = await platform2.detectOverflow(state18, detectOverflowOptions);
|
|
6284
6283
|
const overflows = [];
|
|
6285
6284
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
6286
6285
|
if (checkMainAxis) {
|
|
@@ -6351,19 +6350,19 @@ var flip = function(options) {
|
|
|
6351
6350
|
};
|
|
6352
6351
|
};
|
|
6353
6352
|
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
6354
|
-
async function convertValueToCoords(
|
|
6353
|
+
async function convertValueToCoords(state18, options) {
|
|
6355
6354
|
const {
|
|
6356
6355
|
placement,
|
|
6357
6356
|
platform: platform2,
|
|
6358
6357
|
elements
|
|
6359
|
-
} =
|
|
6358
|
+
} = state18;
|
|
6360
6359
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
6361
6360
|
const side = getSide(placement);
|
|
6362
6361
|
const alignment = getAlignment(placement);
|
|
6363
6362
|
const isVertical = getSideAxis(placement) === "y";
|
|
6364
6363
|
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
6365
6364
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
6366
|
-
const rawValue = evaluate(options,
|
|
6365
|
+
const rawValue = evaluate(options, state18);
|
|
6367
6366
|
let {
|
|
6368
6367
|
mainAxis,
|
|
6369
6368
|
crossAxis,
|
|
@@ -6395,15 +6394,15 @@ var offset = function(options) {
|
|
|
6395
6394
|
return {
|
|
6396
6395
|
name: "offset",
|
|
6397
6396
|
options,
|
|
6398
|
-
async fn(
|
|
6397
|
+
async fn(state18) {
|
|
6399
6398
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
6400
6399
|
const {
|
|
6401
6400
|
x,
|
|
6402
6401
|
y,
|
|
6403
6402
|
placement,
|
|
6404
6403
|
middlewareData
|
|
6405
|
-
} =
|
|
6406
|
-
const diffCoords = await convertValueToCoords(
|
|
6404
|
+
} = state18;
|
|
6405
|
+
const diffCoords = await convertValueToCoords(state18, options);
|
|
6407
6406
|
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
6408
6407
|
return {};
|
|
6409
6408
|
}
|
|
@@ -6425,13 +6424,13 @@ var shift = function(options) {
|
|
|
6425
6424
|
return {
|
|
6426
6425
|
name: "shift",
|
|
6427
6426
|
options,
|
|
6428
|
-
async fn(
|
|
6427
|
+
async fn(state18) {
|
|
6429
6428
|
const {
|
|
6430
6429
|
x,
|
|
6431
6430
|
y,
|
|
6432
6431
|
placement,
|
|
6433
6432
|
platform: platform2
|
|
6434
|
-
} =
|
|
6433
|
+
} = state18;
|
|
6435
6434
|
const {
|
|
6436
6435
|
mainAxis: checkMainAxis = true,
|
|
6437
6436
|
crossAxis: checkCrossAxis = false,
|
|
@@ -6448,12 +6447,12 @@ var shift = function(options) {
|
|
|
6448
6447
|
}
|
|
6449
6448
|
},
|
|
6450
6449
|
...detectOverflowOptions
|
|
6451
|
-
} = evaluate(options,
|
|
6450
|
+
} = evaluate(options, state18);
|
|
6452
6451
|
const coords = {
|
|
6453
6452
|
x,
|
|
6454
6453
|
y
|
|
6455
6454
|
};
|
|
6456
|
-
const overflow = await platform2.detectOverflow(
|
|
6455
|
+
const overflow = await platform2.detectOverflow(state18, detectOverflowOptions);
|
|
6457
6456
|
const crossAxis = getSideAxis(getSide(placement));
|
|
6458
6457
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
6459
6458
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -6473,7 +6472,7 @@ var shift = function(options) {
|
|
|
6473
6472
|
crossAxisCoord = clamp(min2, crossAxisCoord, max2);
|
|
6474
6473
|
}
|
|
6475
6474
|
const limitedCoords = limiter.fn({
|
|
6476
|
-
...
|
|
6475
|
+
...state18,
|
|
6477
6476
|
[mainAxis]: mainAxisCoord,
|
|
6478
6477
|
[crossAxis]: crossAxisCoord
|
|
6479
6478
|
});
|
|
@@ -6564,8 +6563,8 @@ var containRe = /paint|layout|strict|content/;
|
|
|
6564
6563
|
var isNotNone = (value) => !!value && value !== "none";
|
|
6565
6564
|
var isWebKitValue;
|
|
6566
6565
|
function isContainingBlock(elementOrCss) {
|
|
6567
|
-
const
|
|
6568
|
-
return isNotNone(
|
|
6566
|
+
const css119 = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
|
|
6567
|
+
return isNotNone(css119.transform) || isNotNone(css119.translate) || isNotNone(css119.scale) || isNotNone(css119.rotate) || isNotNone(css119.perspective) || !isWebKit() && (isNotNone(css119.backdropFilter) || isNotNone(css119.filter)) || willChangeRe.test(css119.willChange || "") || containRe.test(css119.contain || "");
|
|
6569
6568
|
}
|
|
6570
6569
|
function getContainingBlock(element) {
|
|
6571
6570
|
let currentNode = getParentNode(element);
|
|
@@ -6650,9 +6649,9 @@ function getFrameElement(win) {
|
|
|
6650
6649
|
|
|
6651
6650
|
// node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
6652
6651
|
function getCssDimensions(element) {
|
|
6653
|
-
const
|
|
6654
|
-
let width = parseFloat(
|
|
6655
|
-
let height = parseFloat(
|
|
6652
|
+
const css119 = getComputedStyle2(element);
|
|
6653
|
+
let width = parseFloat(css119.width) || 0;
|
|
6654
|
+
let height = parseFloat(css119.height) || 0;
|
|
6656
6655
|
const hasOffset = isHTMLElement(element);
|
|
6657
6656
|
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
6658
6657
|
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
@@ -6746,9 +6745,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
6746
6745
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
6747
6746
|
const iframeScale = getScale(currentIFrame);
|
|
6748
6747
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
6749
|
-
const
|
|
6750
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(
|
|
6751
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(
|
|
6748
|
+
const css119 = getComputedStyle2(currentIFrame);
|
|
6749
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css119.paddingLeft)) * iframeScale.x;
|
|
6750
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css119.paddingTop)) * iframeScale.y;
|
|
6752
6751
|
x *= iframeScale.x;
|
|
6753
6752
|
y *= iframeScale.y;
|
|
6754
6753
|
width *= iframeScale.x;
|
|
@@ -6825,15 +6824,15 @@ function getClientRects(element) {
|
|
|
6825
6824
|
return Array.from(element.getClientRects());
|
|
6826
6825
|
}
|
|
6827
6826
|
function getDocumentRect(element) {
|
|
6828
|
-
const
|
|
6827
|
+
const html55 = getDocumentElement(element);
|
|
6829
6828
|
const scroll = getNodeScroll(element);
|
|
6830
6829
|
const body = element.ownerDocument.body;
|
|
6831
|
-
const width = max(
|
|
6832
|
-
const height = max(
|
|
6830
|
+
const width = max(html55.scrollWidth, html55.clientWidth, body.scrollWidth, body.clientWidth);
|
|
6831
|
+
const height = max(html55.scrollHeight, html55.clientHeight, body.scrollHeight, body.clientHeight);
|
|
6833
6832
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
6834
6833
|
const y = -scroll.scrollTop;
|
|
6835
6834
|
if (getComputedStyle2(body).direction === "rtl") {
|
|
6836
|
-
x += max(
|
|
6835
|
+
x += max(html55.clientWidth, body.clientWidth) - width;
|
|
6837
6836
|
}
|
|
6838
6837
|
return {
|
|
6839
6838
|
width,
|
|
@@ -6845,10 +6844,10 @@ function getDocumentRect(element) {
|
|
|
6845
6844
|
var SCROLLBAR_MAX = 25;
|
|
6846
6845
|
function getViewportRect(element, strategy) {
|
|
6847
6846
|
const win = getWindow(element);
|
|
6848
|
-
const
|
|
6847
|
+
const html55 = getDocumentElement(element);
|
|
6849
6848
|
const visualViewport = win.visualViewport;
|
|
6850
|
-
let width =
|
|
6851
|
-
let height =
|
|
6849
|
+
let width = html55.clientWidth;
|
|
6850
|
+
let height = html55.clientHeight;
|
|
6852
6851
|
let x = 0;
|
|
6853
6852
|
let y = 0;
|
|
6854
6853
|
if (visualViewport) {
|
|
@@ -6860,13 +6859,13 @@ function getViewportRect(element, strategy) {
|
|
|
6860
6859
|
y = visualViewport.offsetTop;
|
|
6861
6860
|
}
|
|
6862
6861
|
}
|
|
6863
|
-
const windowScrollbarX = getWindowScrollBarX(
|
|
6862
|
+
const windowScrollbarX = getWindowScrollBarX(html55);
|
|
6864
6863
|
if (windowScrollbarX <= 0) {
|
|
6865
|
-
const doc =
|
|
6864
|
+
const doc = html55.ownerDocument;
|
|
6866
6865
|
const body = doc.body;
|
|
6867
6866
|
const bodyStyles = getComputedStyle(body);
|
|
6868
6867
|
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
6869
|
-
const clippingStableScrollbarWidth = Math.abs(
|
|
6868
|
+
const clippingStableScrollbarWidth = Math.abs(html55.clientWidth - body.clientWidth - bodyMarginInline);
|
|
6870
6869
|
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
6871
6870
|
width -= clippingStableScrollbarWidth;
|
|
6872
6871
|
}
|
|
@@ -16426,7 +16425,7 @@ var CsMultiselectInternal = class extends Base7 {
|
|
|
16426
16425
|
/>
|
|
16427
16426
|
</div>
|
|
16428
16427
|
` : nothing20}
|
|
16429
|
-
<ul class="option-list" role="listbox" aria-label=${ifDefined24(this.ariaLabel || void 0)}>
|
|
16428
|
+
<ul class="option-list" role="listbox" aria-multiselectable="true" aria-label=${ifDefined24(this.ariaLabel || void 0)}>
|
|
16430
16429
|
${items}
|
|
16431
16430
|
</ul>
|
|
16432
16431
|
`;
|
|
@@ -17376,6 +17375,2467 @@ __decorateClass([
|
|
|
17376
17375
|
var CsSegmentedControl = class extends CsSegmentedControlInternal {
|
|
17377
17376
|
};
|
|
17378
17377
|
customElements.define("cs-segmented-control", CsSegmentedControl);
|
|
17378
|
+
|
|
17379
|
+
// src/cards/internal.ts
|
|
17380
|
+
import { css as css106, html as html48, nothing as nothing22 } from "lit";
|
|
17381
|
+
import { property as property47, state as state15 } from "lit/decorators.js";
|
|
17382
|
+
import { classMap as classMap41 } from "lit/directives/class-map.js";
|
|
17383
|
+
|
|
17384
|
+
// src/cards/styles.ts
|
|
17385
|
+
import { css as css105 } from "lit";
|
|
17386
|
+
var componentStyles46 = css105`
|
|
17387
|
+
.root {
|
|
17388
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
17389
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
17390
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
17391
|
+
font-weight: 400;
|
|
17392
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
17393
|
+
-webkit-font-smoothing: auto;
|
|
17394
|
+
-moz-osx-font-smoothing: auto;
|
|
17395
|
+
}
|
|
17396
|
+
|
|
17397
|
+
.header-variant-full-page.header-refresh {
|
|
17398
|
+
padding-block-start: 0;
|
|
17399
|
+
padding-inline-start: 0;
|
|
17400
|
+
padding-inline-end: 0;
|
|
17401
|
+
padding-block-end: calc(var(--space-container-header-bottom-2taq8v, 8px) + var(--space-table-header-tools-full-page-bottom-9m47g6, 4px));
|
|
17402
|
+
}
|
|
17403
|
+
|
|
17404
|
+
.list {
|
|
17405
|
+
display: flex;
|
|
17406
|
+
flex-wrap: wrap;
|
|
17407
|
+
box-sizing: border-box;
|
|
17408
|
+
padding-block: 0;
|
|
17409
|
+
padding-inline: 0;
|
|
17410
|
+
list-style: none;
|
|
17411
|
+
margin-block: 0;
|
|
17412
|
+
margin-inline-start: calc(var(--space-grid-gutter-whc3jp, 20px) * -1);
|
|
17413
|
+
margin-inline-end: 0;
|
|
17414
|
+
}
|
|
17415
|
+
.list.list-grid-1 > .card {
|
|
17416
|
+
inline-size: 100%;
|
|
17417
|
+
}
|
|
17418
|
+
.list.list-grid-2 > .card {
|
|
17419
|
+
inline-size: 50%;
|
|
17420
|
+
}
|
|
17421
|
+
.list.list-grid-3 > .card {
|
|
17422
|
+
inline-size: 33.3333333333%;
|
|
17423
|
+
}
|
|
17424
|
+
.list.list-grid-4 > .card {
|
|
17425
|
+
inline-size: 25%;
|
|
17426
|
+
}
|
|
17427
|
+
.list.list-grid-5 > .card {
|
|
17428
|
+
inline-size: 20%;
|
|
17429
|
+
}
|
|
17430
|
+
.list.list-grid-6 > .card {
|
|
17431
|
+
inline-size: 16.6666666667%;
|
|
17432
|
+
}
|
|
17433
|
+
.list.list-grid-7 > .card {
|
|
17434
|
+
inline-size: 14.2857142857%;
|
|
17435
|
+
}
|
|
17436
|
+
.list.list-grid-8 > .card {
|
|
17437
|
+
inline-size: 12.5%;
|
|
17438
|
+
}
|
|
17439
|
+
.list.list-grid-9 > .card {
|
|
17440
|
+
inline-size: 11.1111111111%;
|
|
17441
|
+
}
|
|
17442
|
+
.list.list-grid-10 > .card {
|
|
17443
|
+
inline-size: 10%;
|
|
17444
|
+
}
|
|
17445
|
+
.list.list-grid-11 > .card {
|
|
17446
|
+
inline-size: 9.0909090909%;
|
|
17447
|
+
}
|
|
17448
|
+
.list.list-grid-12 > .card {
|
|
17449
|
+
inline-size: 8.3333333333%;
|
|
17450
|
+
}
|
|
17451
|
+
.list.list-grid-13 > .card {
|
|
17452
|
+
inline-size: 7.6923076923%;
|
|
17453
|
+
}
|
|
17454
|
+
.list.list-grid-14 > .card {
|
|
17455
|
+
inline-size: 7.1428571429%;
|
|
17456
|
+
}
|
|
17457
|
+
.list.list-grid-15 > .card {
|
|
17458
|
+
inline-size: 6.6666666667%;
|
|
17459
|
+
}
|
|
17460
|
+
.list.list-grid-16 > .card {
|
|
17461
|
+
inline-size: 6.25%;
|
|
17462
|
+
}
|
|
17463
|
+
.list.list-grid-17 > .card {
|
|
17464
|
+
inline-size: 5.8823529412%;
|
|
17465
|
+
}
|
|
17466
|
+
.list.list-grid-18 > .card {
|
|
17467
|
+
inline-size: 5.5555555556%;
|
|
17468
|
+
}
|
|
17469
|
+
.list.list-grid-19 > .card {
|
|
17470
|
+
inline-size: 5.2631578947%;
|
|
17471
|
+
}
|
|
17472
|
+
.list.list-grid-20 > .card {
|
|
17473
|
+
inline-size: 5%;
|
|
17474
|
+
}
|
|
17475
|
+
|
|
17476
|
+
.selection-control {
|
|
17477
|
+
position: absolute;
|
|
17478
|
+
box-sizing: border-box;
|
|
17479
|
+
inline-size: calc(var(--size-control-adm93y, 16px) + 2 * var(--space-card-horizontal-default-pihe12, 20px));
|
|
17480
|
+
inset-block-start: 0;
|
|
17481
|
+
inset-inline-end: 0;
|
|
17482
|
+
padding-block: var(--space-card-vertical-default-e40tif, 16px);
|
|
17483
|
+
padding-inline: var(--space-card-horizontal-default-pihe12, 20px);
|
|
17484
|
+
}
|
|
17485
|
+
|
|
17486
|
+
.loading,
|
|
17487
|
+
.empty {
|
|
17488
|
+
overflow: hidden;
|
|
17489
|
+
text-align: center;
|
|
17490
|
+
color: var(--color-text-empty-tlohug, #656871);
|
|
17491
|
+
margin-block-end: var(--space-scaled-l-sej05l, 20px);
|
|
17492
|
+
}
|
|
17493
|
+
|
|
17494
|
+
.has-header {
|
|
17495
|
+
margin-block-start: var(--space-grid-gutter-whc3jp, 20px);
|
|
17496
|
+
}
|
|
17497
|
+
.has-header.refresh.header-variant-full-page {
|
|
17498
|
+
margin-block-start: var(--space-scaled-s-8ozaad, 12px);
|
|
17499
|
+
}
|
|
17500
|
+
|
|
17501
|
+
.card {
|
|
17502
|
+
overflow-wrap: break-word;
|
|
17503
|
+
word-wrap: break-word;
|
|
17504
|
+
box-sizing: border-box;
|
|
17505
|
+
margin-block: 0;
|
|
17506
|
+
margin-inline: 0;
|
|
17507
|
+
padding-block-start: 0;
|
|
17508
|
+
padding-block-end: var(--space-grid-gutter-whc3jp, 20px);
|
|
17509
|
+
padding-inline-start: var(--space-grid-gutter-whc3jp, 20px);
|
|
17510
|
+
padding-inline-end: 0;
|
|
17511
|
+
list-style: none;
|
|
17512
|
+
}
|
|
17513
|
+
.card-header {
|
|
17514
|
+
font-family: var(--font-family-heading-ugphat, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
17515
|
+
font-size: var(--font-size-heading-m-170yiy, 18px);
|
|
17516
|
+
line-height: var(--line-height-heading-m-uoaqdh, 22px);
|
|
17517
|
+
letter-spacing: var(--letter-spacing-heading-m-29ewnk, -0.01em);
|
|
17518
|
+
font-weight: var(--font-weight-heading-m-zf82dr, 700);
|
|
17519
|
+
-webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
|
|
17520
|
+
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
|
|
17521
|
+
}
|
|
17522
|
+
.card-header-inner-selectable {
|
|
17523
|
+
inline-size: 90%;
|
|
17524
|
+
}
|
|
17525
|
+
.card-selected {
|
|
17526
|
+
/* Used in test utils */
|
|
17527
|
+
}
|
|
17528
|
+
|
|
17529
|
+
.section {
|
|
17530
|
+
display: inline-block;
|
|
17531
|
+
box-sizing: border-box;
|
|
17532
|
+
padding-block-end: var(--space-scaled-xs-xwoogq, 8px);
|
|
17533
|
+
padding-inline: 0;
|
|
17534
|
+
vertical-align: top;
|
|
17535
|
+
}
|
|
17536
|
+
.section-header {
|
|
17537
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
17538
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
17539
|
+
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
17540
|
+
color: var(--color-text-label-28gfmc, #0f141a);
|
|
17541
|
+
}
|
|
17542
|
+
|
|
17543
|
+
.section:not(:first-child) {
|
|
17544
|
+
padding-block-start: var(--space-xs-ymlm0b, 8px);
|
|
17545
|
+
}
|
|
17546
|
+
|
|
17547
|
+
.section:last-child {
|
|
17548
|
+
padding-block-end: 0;
|
|
17549
|
+
}
|
|
17550
|
+
|
|
17551
|
+
.footer-pagination {
|
|
17552
|
+
display: flex;
|
|
17553
|
+
justify-content: flex-end;
|
|
17554
|
+
}
|
|
17555
|
+
`;
|
|
17556
|
+
|
|
17557
|
+
// src/cards/internal.ts
|
|
17558
|
+
var hostStyles47 = css106`:host { display: block; }`;
|
|
17559
|
+
var DEFAULT_CARDS_PER_ROW = [
|
|
17560
|
+
{ cards: 1 },
|
|
17561
|
+
{ minWidth: 768, cards: 2 },
|
|
17562
|
+
{ minWidth: 992, cards: 3 },
|
|
17563
|
+
{ minWidth: 1200, cards: 4 },
|
|
17564
|
+
{ minWidth: 1400, cards: 5 },
|
|
17565
|
+
{ minWidth: 1920, cards: 6 }
|
|
17566
|
+
];
|
|
17567
|
+
var CsCardsInternal = class extends CsBaseElement {
|
|
17568
|
+
constructor() {
|
|
17569
|
+
super(...arguments);
|
|
17570
|
+
this.items = [];
|
|
17571
|
+
this.cardDefinition = {};
|
|
17572
|
+
this.selectedItems = [];
|
|
17573
|
+
this.selectionType = "none";
|
|
17574
|
+
this.loading = false;
|
|
17575
|
+
this.loadingText = "";
|
|
17576
|
+
this.variant = "container";
|
|
17577
|
+
this._columns = 1;
|
|
17578
|
+
this._hasHeader = false;
|
|
17579
|
+
this._onHeaderSlotChange = (e) => {
|
|
17580
|
+
const slot = e.target;
|
|
17581
|
+
this._hasHeader = slot.assignedNodes({ flatten: true }).length > 0;
|
|
17582
|
+
this.requestUpdate();
|
|
17583
|
+
};
|
|
17584
|
+
}
|
|
17585
|
+
static {
|
|
17586
|
+
this.styles = [sharedStyles, componentStyles46, hostStyles47];
|
|
17587
|
+
}
|
|
17588
|
+
connectedCallback() {
|
|
17589
|
+
super.connectedCallback();
|
|
17590
|
+
this._resizeObserver = new ResizeObserver(() => this._updateColumns());
|
|
17591
|
+
this._resizeObserver.observe(this);
|
|
17592
|
+
}
|
|
17593
|
+
disconnectedCallback() {
|
|
17594
|
+
super.disconnectedCallback();
|
|
17595
|
+
this._resizeObserver?.disconnect();
|
|
17596
|
+
}
|
|
17597
|
+
_updateColumns() {
|
|
17598
|
+
const width = this.clientWidth;
|
|
17599
|
+
const layouts = this.cardsPerRow ?? DEFAULT_CARDS_PER_ROW;
|
|
17600
|
+
let cols = 1;
|
|
17601
|
+
for (const layout of layouts) {
|
|
17602
|
+
if (!layout.minWidth || width >= layout.minWidth) {
|
|
17603
|
+
cols = layout.cards;
|
|
17604
|
+
}
|
|
17605
|
+
}
|
|
17606
|
+
this._columns = Math.min(Math.max(cols, 1), 20);
|
|
17607
|
+
}
|
|
17608
|
+
_getItemKey(item, index) {
|
|
17609
|
+
if (!this.trackBy) return String(index);
|
|
17610
|
+
if (typeof this.trackBy === "function") return this.trackBy(item);
|
|
17611
|
+
return String(item[this.trackBy]);
|
|
17612
|
+
}
|
|
17613
|
+
_isSelected(item) {
|
|
17614
|
+
if (!this.selectedItems.length) return false;
|
|
17615
|
+
const key = this._getItemKey(item, -1);
|
|
17616
|
+
return this.selectedItems.some((sel, i) => this._getItemKey(sel, i) === key);
|
|
17617
|
+
}
|
|
17618
|
+
_isDisabled(item) {
|
|
17619
|
+
return this.isItemDisabled ? this.isItemDisabled(item) : false;
|
|
17620
|
+
}
|
|
17621
|
+
_onSelectionChange(item) {
|
|
17622
|
+
if (this._isDisabled(item)) return;
|
|
17623
|
+
let newSelection;
|
|
17624
|
+
if (this.selectionType === "single") {
|
|
17625
|
+
newSelection = [item];
|
|
17626
|
+
} else {
|
|
17627
|
+
if (this._isSelected(item)) {
|
|
17628
|
+
const key = this._getItemKey(item, -1);
|
|
17629
|
+
newSelection = this.selectedItems.filter(
|
|
17630
|
+
(sel, i) => this._getItemKey(sel, i) !== key
|
|
17631
|
+
);
|
|
17632
|
+
} else {
|
|
17633
|
+
newSelection = [...this.selectedItems, item];
|
|
17634
|
+
}
|
|
17635
|
+
}
|
|
17636
|
+
const detail = {
|
|
17637
|
+
selectedItems: newSelection
|
|
17638
|
+
};
|
|
17639
|
+
fireNonCancelableEvent(this, "selectionChange", detail);
|
|
17640
|
+
}
|
|
17641
|
+
_renderCardSections(item) {
|
|
17642
|
+
const sections = this.cardDefinition.sections;
|
|
17643
|
+
if (!sections?.length) return nothing22;
|
|
17644
|
+
const visible = this.visibleSections;
|
|
17645
|
+
return html48`${sections.filter((section) => !visible || !section.id || visible.includes(section.id)).map((section) => {
|
|
17646
|
+
const width = section.width ?? 100;
|
|
17647
|
+
return html48`
|
|
17648
|
+
<div class="section" style="inline-size: ${width}%">
|
|
17649
|
+
${section.header ? html48`<div class="section-header">${section.header}</div>` : nothing22}
|
|
17650
|
+
${section.content ? html48`<div class="section-content">${section.content(item)}</div>` : nothing22}
|
|
17651
|
+
</div>
|
|
17652
|
+
`;
|
|
17653
|
+
})}`;
|
|
17654
|
+
}
|
|
17655
|
+
_renderCard(item, index) {
|
|
17656
|
+
const isSelectable = this.selectionType !== "none";
|
|
17657
|
+
const isSelected = isSelectable && this._isSelected(item);
|
|
17658
|
+
const isDisabled = isSelectable && this._isDisabled(item);
|
|
17659
|
+
const headerContent = this.cardDefinition.header?.(item);
|
|
17660
|
+
const cardClasses = {
|
|
17661
|
+
"card": true,
|
|
17662
|
+
"card-selected": isSelected
|
|
17663
|
+
};
|
|
17664
|
+
const cardHeaderClasses = {
|
|
17665
|
+
"card-header": true,
|
|
17666
|
+
"card-header-inner-selectable": isSelectable
|
|
17667
|
+
};
|
|
17668
|
+
const selectionLabel = this.ariaLabels?.itemSelectionLabel ? this.ariaLabels.itemSelectionLabel({ selectedItems: [...this.selectedItems] }, item) : void 0;
|
|
17669
|
+
return html48`
|
|
17670
|
+
<li class=${classMap41(cardClasses)} data-item-index=${index}>
|
|
17671
|
+
<cs-container variant="default">
|
|
17672
|
+
<div slot="header" style="position: relative;">
|
|
17673
|
+
<div class=${classMap41(cardHeaderClasses)}>
|
|
17674
|
+
${headerContent ?? nothing22}
|
|
17675
|
+
</div>
|
|
17676
|
+
${isSelectable ? html48`
|
|
17677
|
+
<div class="selection-control">
|
|
17678
|
+
<cs-checkbox
|
|
17679
|
+
.checked=${isSelected}
|
|
17680
|
+
?disabled=${isDisabled}
|
|
17681
|
+
aria-label=${selectionLabel ?? `Select item ${index + 1}`}
|
|
17682
|
+
@change=${() => this._onSelectionChange(item)}
|
|
17683
|
+
></cs-checkbox>
|
|
17684
|
+
</div>
|
|
17685
|
+
` : nothing22}
|
|
17686
|
+
</div>
|
|
17687
|
+
${this._renderCardSections(item)}
|
|
17688
|
+
</cs-container>
|
|
17689
|
+
</li>
|
|
17690
|
+
`;
|
|
17691
|
+
}
|
|
17692
|
+
render() {
|
|
17693
|
+
const hasItems = this.items.length > 0;
|
|
17694
|
+
const showLoading = this.loading;
|
|
17695
|
+
const showEmpty = !showLoading && !hasItems;
|
|
17696
|
+
const listClasses = {
|
|
17697
|
+
"list": true,
|
|
17698
|
+
[`list-grid-${this._columns}`]: true
|
|
17699
|
+
};
|
|
17700
|
+
const bodyClasses = {
|
|
17701
|
+
"has-header": this._hasHeader
|
|
17702
|
+
};
|
|
17703
|
+
const groupLabel = this.ariaLabels?.selectionGroupLabel ?? "Items";
|
|
17704
|
+
return html48`
|
|
17705
|
+
<div class="root">
|
|
17706
|
+
<div class="header">
|
|
17707
|
+
<slot name="header" @slotchange=${this._onHeaderSlotChange}></slot>
|
|
17708
|
+
</div>
|
|
17709
|
+
<slot name="filter"></slot>
|
|
17710
|
+
<slot name="pagination"></slot>
|
|
17711
|
+
<div class=${classMap41(bodyClasses)}>
|
|
17712
|
+
${showLoading ? html48`
|
|
17713
|
+
<div class="loading" role="status">
|
|
17714
|
+
<cs-spinner size="large"></cs-spinner>
|
|
17715
|
+
${this.loadingText ? html48`<span>${this.loadingText}</span>` : nothing22}
|
|
17716
|
+
</div>
|
|
17717
|
+
` : showEmpty ? html48`
|
|
17718
|
+
<div class="empty">
|
|
17719
|
+
<slot name="empty"></slot>
|
|
17720
|
+
</div>
|
|
17721
|
+
` : html48`
|
|
17722
|
+
<ol class=${classMap41(listClasses)} aria-label=${groupLabel}>
|
|
17723
|
+
${this.items.map((item, i) => this._renderCard(item, i))}
|
|
17724
|
+
</ol>
|
|
17725
|
+
`}
|
|
17726
|
+
</div>
|
|
17727
|
+
</div>
|
|
17728
|
+
`;
|
|
17729
|
+
}
|
|
17730
|
+
};
|
|
17731
|
+
__decorateClass([
|
|
17732
|
+
property47({ attribute: false })
|
|
17733
|
+
], CsCardsInternal.prototype, "items", 2);
|
|
17734
|
+
__decorateClass([
|
|
17735
|
+
property47({ attribute: false })
|
|
17736
|
+
], CsCardsInternal.prototype, "cardDefinition", 2);
|
|
17737
|
+
__decorateClass([
|
|
17738
|
+
property47({ attribute: false })
|
|
17739
|
+
], CsCardsInternal.prototype, "selectedItems", 2);
|
|
17740
|
+
__decorateClass([
|
|
17741
|
+
property47({ type: String, reflect: true })
|
|
17742
|
+
], CsCardsInternal.prototype, "selectionType", 2);
|
|
17743
|
+
__decorateClass([
|
|
17744
|
+
property47({ attribute: false })
|
|
17745
|
+
], CsCardsInternal.prototype, "trackBy", 2);
|
|
17746
|
+
__decorateClass([
|
|
17747
|
+
property47({ type: Boolean, reflect: true })
|
|
17748
|
+
], CsCardsInternal.prototype, "loading", 2);
|
|
17749
|
+
__decorateClass([
|
|
17750
|
+
property47({ type: String })
|
|
17751
|
+
], CsCardsInternal.prototype, "loadingText", 2);
|
|
17752
|
+
__decorateClass([
|
|
17753
|
+
property47({ attribute: false })
|
|
17754
|
+
], CsCardsInternal.prototype, "cardsPerRow", 2);
|
|
17755
|
+
__decorateClass([
|
|
17756
|
+
property47({ type: String, reflect: true })
|
|
17757
|
+
], CsCardsInternal.prototype, "variant", 2);
|
|
17758
|
+
__decorateClass([
|
|
17759
|
+
property47({ attribute: false })
|
|
17760
|
+
], CsCardsInternal.prototype, "visibleSections", 2);
|
|
17761
|
+
__decorateClass([
|
|
17762
|
+
property47({ attribute: false })
|
|
17763
|
+
], CsCardsInternal.prototype, "ariaLabels", 2);
|
|
17764
|
+
__decorateClass([
|
|
17765
|
+
property47({ attribute: false })
|
|
17766
|
+
], CsCardsInternal.prototype, "isItemDisabled", 2);
|
|
17767
|
+
__decorateClass([
|
|
17768
|
+
state15()
|
|
17769
|
+
], CsCardsInternal.prototype, "_columns", 2);
|
|
17770
|
+
|
|
17771
|
+
// src/cards/index.ts
|
|
17772
|
+
var CsCards = class extends CsCardsInternal {
|
|
17773
|
+
};
|
|
17774
|
+
customElements.define("cs-cards", CsCards);
|
|
17775
|
+
|
|
17776
|
+
// src/collection-preferences/internal.ts
|
|
17777
|
+
import { css as css108, html as html49, nothing as nothing23 } from "lit";
|
|
17778
|
+
import { property as property48, state as state16 } from "lit/decorators.js";
|
|
17779
|
+
|
|
17780
|
+
// src/collection-preferences/styles.ts
|
|
17781
|
+
import { css as css107 } from "lit";
|
|
17782
|
+
var componentStyles47 = css107`
|
|
17783
|
+
.visible-content,
|
|
17784
|
+
.visible-content-toggle,
|
|
17785
|
+
.visible-content-groups,
|
|
17786
|
+
.visible-content-group {
|
|
17787
|
+
|
|
17788
|
+
.content-display-option-content {
|
|
17789
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
17790
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
17791
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
17792
|
+
font-weight: 400;
|
|
17793
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
17794
|
+
-webkit-font-smoothing: auto;
|
|
17795
|
+
-moz-osx-font-smoothing: auto;
|
|
17796
|
+
display: flex;
|
|
17797
|
+
align-items: flex-start;
|
|
17798
|
+
padding-block: var(--space-scaled-xs-xwoogq, 8px);
|
|
17799
|
+
padding-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
17800
|
+
border-start-start-radius: var(--border-radius-item-iwaia5, 8px);
|
|
17801
|
+
border-start-end-radius: var(--border-radius-item-iwaia5, 8px);
|
|
17802
|
+
border-end-start-radius: var(--border-radius-item-iwaia5, 8px);
|
|
17803
|
+
border-end-end-radius: var(--border-radius-item-iwaia5, 8px);
|
|
17804
|
+
}
|
|
17805
|
+
|
|
17806
|
+
.content-display-option-label {
|
|
17807
|
+
flex-grow: 1;
|
|
17808
|
+
min-inline-size: 0;
|
|
17809
|
+
word-break: break-word;
|
|
17810
|
+
padding-inline-end: var(--space-l-2ud1p3, 20px);
|
|
17811
|
+
}
|
|
17812
|
+
|
|
17813
|
+
.content-display-title {
|
|
17814
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
17815
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
17816
|
+
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
17817
|
+
color: var(--color-text-form-label-6sbm75, #0f141a);
|
|
17818
|
+
margin-block: 0;
|
|
17819
|
+
margin-inline: 0;
|
|
17820
|
+
}
|
|
17821
|
+
|
|
17822
|
+
.content-display-description {
|
|
17823
|
+
color: var(--color-text-form-secondary-1nm780, #656871);
|
|
17824
|
+
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
17825
|
+
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
17826
|
+
letter-spacing: var(--letter-spacing-body-s-gq78ok, 0.005em);
|
|
17827
|
+
margin-block-start: var(--space-scaled-xxxs-oo06c7, 2px);
|
|
17828
|
+
}
|
|
17829
|
+
|
|
17830
|
+
.content-display-option-list {
|
|
17831
|
+
position: relative;
|
|
17832
|
+
list-style: none;
|
|
17833
|
+
padding-block: 0;
|
|
17834
|
+
padding-inline: 0;
|
|
17835
|
+
}
|
|
17836
|
+
|
|
17837
|
+
.second-column-small {
|
|
17838
|
+
padding-block-start: calc(2 * var(--space-scaled-l-sej05l, 20px));
|
|
17839
|
+
}
|
|
17840
|
+
`;
|
|
17841
|
+
|
|
17842
|
+
// src/collection-preferences/internal.ts
|
|
17843
|
+
var hostStyles48 = css108`:host { display: inline-block; }`;
|
|
17844
|
+
var panelStyles = css108`
|
|
17845
|
+
.panel {
|
|
17846
|
+
position: absolute;
|
|
17847
|
+
z-index: 1000;
|
|
17848
|
+
inset-inline-end: 0;
|
|
17849
|
+
inset-block-start: 100%;
|
|
17850
|
+
margin-block-start: 4px;
|
|
17851
|
+
background: var(--color-background-container-content-ylugqs, #ffffff);
|
|
17852
|
+
border: 1px solid var(--color-border-container-top-tdnwla, #e9ebed);
|
|
17853
|
+
border-radius: var(--border-radius-container-5jaqo3, 16px);
|
|
17854
|
+
box-shadow: var(--shadow-panel-fheubh, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
|
|
17855
|
+
padding: var(--space-scaled-l-sej05l, 20px);
|
|
17856
|
+
min-inline-size: 280px;
|
|
17857
|
+
max-inline-size: 400px;
|
|
17858
|
+
}
|
|
17859
|
+
.panel-title {
|
|
17860
|
+
font-size: var(--font-size-heading-m-170yiy, 18px);
|
|
17861
|
+
font-weight: var(--font-weight-heading-m-zf82dr, 700);
|
|
17862
|
+
line-height: var(--line-height-heading-m-uoaqdh, 22px);
|
|
17863
|
+
margin-block-end: var(--space-scaled-l-sej05l, 20px);
|
|
17864
|
+
}
|
|
17865
|
+
.panel-section {
|
|
17866
|
+
margin-block-end: var(--space-scaled-s-8ozaad, 12px);
|
|
17867
|
+
}
|
|
17868
|
+
.panel-section-title {
|
|
17869
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
17870
|
+
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
17871
|
+
margin-block-end: var(--space-scaled-xxs-v1m6s9, 4px);
|
|
17872
|
+
}
|
|
17873
|
+
.panel-footer {
|
|
17874
|
+
display: flex;
|
|
17875
|
+
justify-content: flex-end;
|
|
17876
|
+
gap: var(--space-xs-ymlm0b, 8px);
|
|
17877
|
+
margin-block-start: var(--space-scaled-l-sej05l, 20px);
|
|
17878
|
+
padding-block-start: var(--space-scaled-s-8ozaad, 12px);
|
|
17879
|
+
border-block-start: 1px solid var(--color-border-divider-default-djbamr, #e9ebed);
|
|
17880
|
+
}
|
|
17881
|
+
.page-size-options {
|
|
17882
|
+
display: flex;
|
|
17883
|
+
flex-direction: column;
|
|
17884
|
+
gap: var(--space-scaled-xxs-v1m6s9, 4px);
|
|
17885
|
+
}
|
|
17886
|
+
.page-size-option {
|
|
17887
|
+
display: flex;
|
|
17888
|
+
align-items: center;
|
|
17889
|
+
gap: var(--space-xs-ymlm0b, 8px);
|
|
17890
|
+
cursor: pointer;
|
|
17891
|
+
}
|
|
17892
|
+
.page-size-option input {
|
|
17893
|
+
margin: 0;
|
|
17894
|
+
}
|
|
17895
|
+
.visible-content-option {
|
|
17896
|
+
padding-block: var(--space-scaled-xxs-v1m6s9, 4px);
|
|
17897
|
+
}
|
|
17898
|
+
.visible-content-group-label {
|
|
17899
|
+
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
17900
|
+
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
17901
|
+
color: var(--color-text-form-secondary-1nm780, #656871);
|
|
17902
|
+
padding-block-end: var(--space-scaled-xxs-v1m6s9, 4px);
|
|
17903
|
+
}
|
|
17904
|
+
`;
|
|
17905
|
+
var CsCollectionPreferencesInternal = class extends CsBaseElement {
|
|
17906
|
+
constructor() {
|
|
17907
|
+
super(...arguments);
|
|
17908
|
+
this.title = "Preferences";
|
|
17909
|
+
this.confirmLabel = "Confirm";
|
|
17910
|
+
this.cancelLabel = "Cancel";
|
|
17911
|
+
this.disabled = false;
|
|
17912
|
+
this._open = false;
|
|
17913
|
+
this._draft = {};
|
|
17914
|
+
this._cleanupOutsideClick = null;
|
|
17915
|
+
this._onKeyDown = (e) => {
|
|
17916
|
+
if (e.key === "Escape" && this._open) {
|
|
17917
|
+
e.stopPropagation();
|
|
17918
|
+
this._cancel();
|
|
17919
|
+
}
|
|
17920
|
+
};
|
|
17921
|
+
this._onTriggerClick = (e) => {
|
|
17922
|
+
if (e instanceof CustomEvent) return;
|
|
17923
|
+
if (this.disabled) return;
|
|
17924
|
+
this._draft = { ...this.preferences };
|
|
17925
|
+
this._open = !this._open;
|
|
17926
|
+
if (this._open) {
|
|
17927
|
+
this._addOutsideClickListener();
|
|
17928
|
+
}
|
|
17929
|
+
};
|
|
17930
|
+
this._confirm = () => {
|
|
17931
|
+
fireNonCancelableEvent(this, "confirm", { ...this._draft });
|
|
17932
|
+
this._open = false;
|
|
17933
|
+
this._removeOutsideClickListener();
|
|
17934
|
+
};
|
|
17935
|
+
this._cancel = () => {
|
|
17936
|
+
fireNonCancelableEvent(this, "cancel", {});
|
|
17937
|
+
this._open = false;
|
|
17938
|
+
this._removeOutsideClickListener();
|
|
17939
|
+
};
|
|
17940
|
+
}
|
|
17941
|
+
static {
|
|
17942
|
+
this.styles = [sharedStyles, componentStyles47, panelStyles, hostStyles48];
|
|
17943
|
+
}
|
|
17944
|
+
connectedCallback() {
|
|
17945
|
+
super.connectedCallback();
|
|
17946
|
+
this.addEventListener("keydown", this._onKeyDown);
|
|
17947
|
+
}
|
|
17948
|
+
disconnectedCallback() {
|
|
17949
|
+
super.disconnectedCallback();
|
|
17950
|
+
this.removeEventListener("keydown", this._onKeyDown);
|
|
17951
|
+
this._removeOutsideClickListener();
|
|
17952
|
+
}
|
|
17953
|
+
_addOutsideClickListener() {
|
|
17954
|
+
this._removeOutsideClickListener();
|
|
17955
|
+
const handler = (e) => {
|
|
17956
|
+
const path = e.composedPath();
|
|
17957
|
+
if (!path.includes(this)) {
|
|
17958
|
+
this._cancel();
|
|
17959
|
+
}
|
|
17960
|
+
};
|
|
17961
|
+
requestAnimationFrame(() => {
|
|
17962
|
+
document.addEventListener("click", handler, true);
|
|
17963
|
+
this._cleanupOutsideClick = () => {
|
|
17964
|
+
document.removeEventListener("click", handler, true);
|
|
17965
|
+
};
|
|
17966
|
+
});
|
|
17967
|
+
}
|
|
17968
|
+
_removeOutsideClickListener() {
|
|
17969
|
+
this._cleanupOutsideClick?.();
|
|
17970
|
+
this._cleanupOutsideClick = null;
|
|
17971
|
+
}
|
|
17972
|
+
_onPageSizeChange(value) {
|
|
17973
|
+
this._draft = { ...this._draft, pageSize: value };
|
|
17974
|
+
}
|
|
17975
|
+
_onWrapLinesChange(checked) {
|
|
17976
|
+
this._draft = { ...this._draft, wrapLines: checked };
|
|
17977
|
+
}
|
|
17978
|
+
_onStripedRowsChange(checked) {
|
|
17979
|
+
this._draft = { ...this._draft, stripedRows: checked };
|
|
17980
|
+
}
|
|
17981
|
+
_onContentDensityChange(checked) {
|
|
17982
|
+
this._draft = { ...this._draft, contentDensity: checked ? "compact" : "comfortable" };
|
|
17983
|
+
}
|
|
17984
|
+
_onVisibleContentChange(id, checked) {
|
|
17985
|
+
const current = [...this._draft.visibleContent ?? []];
|
|
17986
|
+
if (checked && !current.includes(id)) {
|
|
17987
|
+
current.push(id);
|
|
17988
|
+
} else if (!checked) {
|
|
17989
|
+
const idx = current.indexOf(id);
|
|
17990
|
+
if (idx >= 0) current.splice(idx, 1);
|
|
17991
|
+
}
|
|
17992
|
+
this._draft = { ...this._draft, visibleContent: current };
|
|
17993
|
+
}
|
|
17994
|
+
_renderPageSizePreference() {
|
|
17995
|
+
if (!this.pageSizePreference) return nothing23;
|
|
17996
|
+
const pref = this.pageSizePreference;
|
|
17997
|
+
return html49`
|
|
17998
|
+
<div class="panel-section">
|
|
17999
|
+
${pref.title ? html49`<div class="panel-section-title">${pref.title}</div>` : nothing23}
|
|
18000
|
+
<div class="page-size-options" role="radiogroup" aria-label=${pref.title ?? "Page size"}>
|
|
18001
|
+
${pref.options.map((opt) => html49`
|
|
18002
|
+
<label class="page-size-option">
|
|
18003
|
+
<input type="radio" name="page-size"
|
|
18004
|
+
.checked=${this._draft.pageSize === opt.value}
|
|
18005
|
+
@change=${() => this._onPageSizeChange(opt.value)} />
|
|
18006
|
+
${opt.label ?? `${opt.value} items`}
|
|
18007
|
+
</label>
|
|
18008
|
+
`)}
|
|
18009
|
+
</div>
|
|
18010
|
+
</div>
|
|
18011
|
+
`;
|
|
18012
|
+
}
|
|
18013
|
+
_renderWrapLinesPreference() {
|
|
18014
|
+
if (!this.wrapLinesPreference) return nothing23;
|
|
18015
|
+
const pref = this.wrapLinesPreference;
|
|
18016
|
+
return html49`
|
|
18017
|
+
<div class="panel-section">
|
|
18018
|
+
<cs-checkbox
|
|
18019
|
+
.checked=${this._draft.wrapLines ?? false}
|
|
18020
|
+
@change=${(e) => this._onWrapLinesChange(e.detail.checked)}
|
|
18021
|
+
>${pref.label ?? "Wrap lines"}</cs-checkbox>
|
|
18022
|
+
${pref.description ? html49`<div class="content-display-description">${pref.description}</div>` : nothing23}
|
|
18023
|
+
</div>
|
|
18024
|
+
`;
|
|
18025
|
+
}
|
|
18026
|
+
_renderStripedRowsPreference() {
|
|
18027
|
+
if (!this.stripedRowsPreference) return nothing23;
|
|
18028
|
+
const pref = this.stripedRowsPreference;
|
|
18029
|
+
return html49`
|
|
18030
|
+
<div class="panel-section">
|
|
18031
|
+
<cs-checkbox
|
|
18032
|
+
.checked=${this._draft.stripedRows ?? false}
|
|
18033
|
+
@change=${(e) => this._onStripedRowsChange(e.detail.checked)}
|
|
18034
|
+
>${pref.label ?? "Striped rows"}</cs-checkbox>
|
|
18035
|
+
${pref.description ? html49`<div class="content-display-description">${pref.description}</div>` : nothing23}
|
|
18036
|
+
</div>
|
|
18037
|
+
`;
|
|
18038
|
+
}
|
|
18039
|
+
_renderContentDensityPreference() {
|
|
18040
|
+
if (!this.contentDensityPreference) return nothing23;
|
|
18041
|
+
const pref = this.contentDensityPreference;
|
|
18042
|
+
return html49`
|
|
18043
|
+
<div class="panel-section">
|
|
18044
|
+
<cs-checkbox
|
|
18045
|
+
.checked=${this._draft.contentDensity === "compact"}
|
|
18046
|
+
@change=${(e) => this._onContentDensityChange(e.detail.checked)}
|
|
18047
|
+
>${pref.label ?? "Compact mode"}</cs-checkbox>
|
|
18048
|
+
${pref.description ? html49`<div class="content-display-description">${pref.description}</div>` : nothing23}
|
|
18049
|
+
</div>
|
|
18050
|
+
`;
|
|
18051
|
+
}
|
|
18052
|
+
_renderVisibleContentPreference() {
|
|
18053
|
+
if (!this.visibleContentPreference) return nothing23;
|
|
18054
|
+
const pref = this.visibleContentPreference;
|
|
18055
|
+
const visibleIds = this._draft.visibleContent ?? [];
|
|
18056
|
+
return html49`
|
|
18057
|
+
<div class="panel-section">
|
|
18058
|
+
${pref.title ? html49`<div class="panel-section-title">${pref.title}</div>` : nothing23}
|
|
18059
|
+
${pref.options.map((group) => html49`
|
|
18060
|
+
<div class="visible-content-group">
|
|
18061
|
+
<div class="visible-content-group-label">${group.label}</div>
|
|
18062
|
+
${group.options.map((opt) => {
|
|
18063
|
+
const isEditable = opt.editable !== false;
|
|
18064
|
+
return html49`
|
|
18065
|
+
<div class="visible-content-option">
|
|
18066
|
+
<cs-checkbox
|
|
18067
|
+
.checked=${visibleIds.includes(opt.id)}
|
|
18068
|
+
?disabled=${!isEditable}
|
|
18069
|
+
@change=${(e) => this._onVisibleContentChange(opt.id, e.detail.checked)}
|
|
18070
|
+
>${opt.label}</cs-checkbox>
|
|
18071
|
+
</div>
|
|
18072
|
+
`;
|
|
18073
|
+
})}
|
|
18074
|
+
</div>
|
|
18075
|
+
`)}
|
|
18076
|
+
</div>
|
|
18077
|
+
`;
|
|
18078
|
+
}
|
|
18079
|
+
render() {
|
|
18080
|
+
return html49`
|
|
18081
|
+
<div class="root" style="position: relative; display: inline-block;">
|
|
18082
|
+
<cs-button
|
|
18083
|
+
variant="icon"
|
|
18084
|
+
icon-name="settings"
|
|
18085
|
+
aria-label=${this.title}
|
|
18086
|
+
?disabled=${this.disabled}
|
|
18087
|
+
@click=${this._onTriggerClick}
|
|
18088
|
+
></cs-button>
|
|
18089
|
+
${this._open ? html49`
|
|
18090
|
+
<div class="panel" role="dialog" aria-label=${this.title}>
|
|
18091
|
+
<div class="panel-title">${this.title}</div>
|
|
18092
|
+
${this._renderPageSizePreference()}
|
|
18093
|
+
${this._renderWrapLinesPreference()}
|
|
18094
|
+
${this._renderStripedRowsPreference()}
|
|
18095
|
+
${this._renderContentDensityPreference()}
|
|
18096
|
+
${this._renderVisibleContentPreference()}
|
|
18097
|
+
<div class="panel-footer">
|
|
18098
|
+
<cs-button variant="link" @click=${this._cancel}>${this.cancelLabel}</cs-button>
|
|
18099
|
+
<cs-button variant="primary" @click=${this._confirm}>${this.confirmLabel}</cs-button>
|
|
18100
|
+
</div>
|
|
18101
|
+
</div>
|
|
18102
|
+
` : nothing23}
|
|
18103
|
+
</div>
|
|
18104
|
+
`;
|
|
18105
|
+
}
|
|
18106
|
+
};
|
|
18107
|
+
__decorateClass([
|
|
18108
|
+
property48({ type: String })
|
|
18109
|
+
], CsCollectionPreferencesInternal.prototype, "title", 2);
|
|
18110
|
+
__decorateClass([
|
|
18111
|
+
property48({ type: String })
|
|
18112
|
+
], CsCollectionPreferencesInternal.prototype, "confirmLabel", 2);
|
|
18113
|
+
__decorateClass([
|
|
18114
|
+
property48({ type: String })
|
|
18115
|
+
], CsCollectionPreferencesInternal.prototype, "cancelLabel", 2);
|
|
18116
|
+
__decorateClass([
|
|
18117
|
+
property48({ type: Boolean, reflect: true })
|
|
18118
|
+
], CsCollectionPreferencesInternal.prototype, "disabled", 2);
|
|
18119
|
+
__decorateClass([
|
|
18120
|
+
property48({ attribute: false })
|
|
18121
|
+
], CsCollectionPreferencesInternal.prototype, "preferences", 2);
|
|
18122
|
+
__decorateClass([
|
|
18123
|
+
property48({ attribute: false })
|
|
18124
|
+
], CsCollectionPreferencesInternal.prototype, "pageSizePreference", 2);
|
|
18125
|
+
__decorateClass([
|
|
18126
|
+
property48({ attribute: false })
|
|
18127
|
+
], CsCollectionPreferencesInternal.prototype, "wrapLinesPreference", 2);
|
|
18128
|
+
__decorateClass([
|
|
18129
|
+
property48({ attribute: false })
|
|
18130
|
+
], CsCollectionPreferencesInternal.prototype, "stripedRowsPreference", 2);
|
|
18131
|
+
__decorateClass([
|
|
18132
|
+
property48({ attribute: false })
|
|
18133
|
+
], CsCollectionPreferencesInternal.prototype, "contentDensityPreference", 2);
|
|
18134
|
+
__decorateClass([
|
|
18135
|
+
property48({ attribute: false })
|
|
18136
|
+
], CsCollectionPreferencesInternal.prototype, "visibleContentPreference", 2);
|
|
18137
|
+
__decorateClass([
|
|
18138
|
+
state16()
|
|
18139
|
+
], CsCollectionPreferencesInternal.prototype, "_open", 2);
|
|
18140
|
+
__decorateClass([
|
|
18141
|
+
state16()
|
|
18142
|
+
], CsCollectionPreferencesInternal.prototype, "_draft", 2);
|
|
18143
|
+
|
|
18144
|
+
// src/collection-preferences/index.ts
|
|
18145
|
+
var CsCollectionPreferences = class extends CsCollectionPreferencesInternal {
|
|
18146
|
+
};
|
|
18147
|
+
customElements.define("cs-collection-preferences", CsCollectionPreferences);
|
|
18148
|
+
|
|
18149
|
+
// src/progress-bar/internal.ts
|
|
18150
|
+
import { css as css110, html as html50, nothing as nothing24 } from "lit";
|
|
18151
|
+
import { property as property49 } from "lit/decorators.js";
|
|
18152
|
+
import { classMap as classMap42 } from "lit/directives/class-map.js";
|
|
18153
|
+
|
|
18154
|
+
// src/progress-bar/styles.ts
|
|
18155
|
+
import { css as css109 } from "lit";
|
|
18156
|
+
var componentStyles48 = css109`
|
|
18157
|
+
.progress::-webkit-progress-value {
|
|
18158
|
+
-webkit-transition: width var(--motion-duration-moderate-c9utmg, 135ms) linear;
|
|
18159
|
+
transition: width var(--motion-duration-moderate-c9utmg, 135ms) linear;
|
|
18160
|
+
}
|
|
18161
|
+
@media (prefers-reduced-motion: reduce) {
|
|
18162
|
+
.progress::-webkit-progress-value {
|
|
18163
|
+
animation: none;
|
|
18164
|
+
-webkit-transition: none;
|
|
18165
|
+
transition: none;
|
|
18166
|
+
}
|
|
18167
|
+
}
|
|
18168
|
+
.awsui-motion-disabled .progress::-webkit-progress-value, .awsui-mode-entering .progress::-webkit-progress-value {
|
|
18169
|
+
animation: none;
|
|
18170
|
+
-webkit-transition: none;
|
|
18171
|
+
transition: none;
|
|
18172
|
+
}
|
|
18173
|
+
|
|
18174
|
+
.result-state {
|
|
18175
|
+
animation: awsui_awsui-motion-fade-in_11huc_1uqsz_1 var(--motion-duration-transition-show-paced-t8d1os, 180ms) var(--motion-easing-transition-show-paced-x2k7uh, ease-out);
|
|
18176
|
+
}
|
|
18177
|
+
@keyframes awsui_awsui-motion-fade-in_11huc_1uqsz_1 {
|
|
18178
|
+
from {
|
|
18179
|
+
opacity: 0.2;
|
|
18180
|
+
}
|
|
18181
|
+
to {
|
|
18182
|
+
opacity: 1;
|
|
18183
|
+
}
|
|
18184
|
+
}
|
|
18185
|
+
@media (prefers-reduced-motion: reduce) {
|
|
18186
|
+
.result-state {
|
|
18187
|
+
animation: none;
|
|
18188
|
+
transition: none;
|
|
18189
|
+
}
|
|
18190
|
+
}
|
|
18191
|
+
.awsui-motion-disabled .result-state, .awsui-mode-entering .result-state {
|
|
18192
|
+
animation: none;
|
|
18193
|
+
transition: none;
|
|
18194
|
+
}
|
|
18195
|
+
|
|
18196
|
+
.root {
|
|
18197
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18198
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18199
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18200
|
+
font-weight: 400;
|
|
18201
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18202
|
+
-webkit-font-smoothing: auto;
|
|
18203
|
+
-moz-osx-font-smoothing: auto;
|
|
18204
|
+
}
|
|
18205
|
+
|
|
18206
|
+
.with-result-button {
|
|
18207
|
+
padding-inline-end: var(--space-m-dsumyt, 16px);
|
|
18208
|
+
}
|
|
18209
|
+
|
|
18210
|
+
.result-button {
|
|
18211
|
+
display: inline-block;
|
|
18212
|
+
margin-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
18213
|
+
margin-inline: 0;
|
|
18214
|
+
}
|
|
18215
|
+
|
|
18216
|
+
.word-wrap {
|
|
18217
|
+
min-inline-size: 0;
|
|
18218
|
+
word-break: break-word;
|
|
18219
|
+
}
|
|
18220
|
+
|
|
18221
|
+
.label-flash {
|
|
18222
|
+
color: inherit;
|
|
18223
|
+
font-weight: 700;
|
|
18224
|
+
}
|
|
18225
|
+
.label-key-value {
|
|
18226
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18227
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18228
|
+
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
18229
|
+
color: var(--color-text-label-28gfmc, #0f141a);
|
|
18230
|
+
margin-block-end: var(--space-scaled-xxxs-oo06c7, 2px);
|
|
18231
|
+
}
|
|
18232
|
+
|
|
18233
|
+
.flash {
|
|
18234
|
+
color: inherit;
|
|
18235
|
+
}
|
|
18236
|
+
|
|
18237
|
+
.progress-container {
|
|
18238
|
+
display: flex;
|
|
18239
|
+
align-items: center;
|
|
18240
|
+
max-inline-size: 800px;
|
|
18241
|
+
block-size: var(--line-height-body-m-2mh3ke, 20px);
|
|
18242
|
+
}
|
|
18243
|
+
|
|
18244
|
+
.percentage-container {
|
|
18245
|
+
inline-size: 33px;
|
|
18246
|
+
flex-shrink: 0;
|
|
18247
|
+
white-space: nowrap;
|
|
18248
|
+
text-align: end;
|
|
18249
|
+
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
18250
|
+
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
18251
|
+
letter-spacing: var(--letter-spacing-body-s-gq78ok, 0.005em);
|
|
18252
|
+
}
|
|
18253
|
+
|
|
18254
|
+
.progress {
|
|
18255
|
+
inline-size: 100%;
|
|
18256
|
+
margin-inline-end: var(--space-s-tvghoh, 12px);
|
|
18257
|
+
min-inline-size: 0;
|
|
18258
|
+
block-size: var(--awsui-progress-bar-height-6b9ypa, 4px);
|
|
18259
|
+
border-block: 0;
|
|
18260
|
+
border-inline: none;
|
|
18261
|
+
box-sizing: border-box;
|
|
18262
|
+
border-start-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18263
|
+
border-start-end-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18264
|
+
border-end-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18265
|
+
border-end-end-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18266
|
+
background-color: var(--awsui-progress-bar-background-color-6b9ypa, var(--color-background-progress-bar-default-j8kyxd, #ebebf0));
|
|
18267
|
+
}
|
|
18268
|
+
.progress::-webkit-progress-bar {
|
|
18269
|
+
block-size: var(--awsui-progress-bar-height-6b9ypa, 4px);
|
|
18270
|
+
border-block: 0;
|
|
18271
|
+
border-inline: none;
|
|
18272
|
+
box-sizing: border-box;
|
|
18273
|
+
border-start-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18274
|
+
border-start-end-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18275
|
+
border-end-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18276
|
+
border-end-end-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18277
|
+
background-color: var(--awsui-progress-bar-background-color-6b9ypa, var(--color-background-progress-bar-default-j8kyxd, #ebebf0));
|
|
18278
|
+
}
|
|
18279
|
+
.progress::-webkit-progress-value {
|
|
18280
|
+
border-start-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18281
|
+
border-start-end-radius: 0;
|
|
18282
|
+
border-end-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18283
|
+
border-end-end-radius: 0;
|
|
18284
|
+
background-color: var(--awsui-progress-value-background-color-6b9ypa, var(--color-background-progress-bar-value-default-69ydqg, #006ce0));
|
|
18285
|
+
}
|
|
18286
|
+
.progress.complete::-webkit-progress-value {
|
|
18287
|
+
border-start-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18288
|
+
border-start-end-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18289
|
+
border-end-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18290
|
+
border-end-end-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18291
|
+
}
|
|
18292
|
+
.progress::-moz-progress-bar {
|
|
18293
|
+
border-start-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18294
|
+
border-start-end-radius: 0;
|
|
18295
|
+
border-end-start-radius: var(--awsui-progress-bar-border-radius-6b9ypa, 10px);
|
|
18296
|
+
border-end-end-radius: 0;
|
|
18297
|
+
background-color: var(--awsui-progress-value-background-color-6b9ypa, var(--color-background-progress-bar-value-default-69ydqg, #006ce0));
|
|
18298
|
+
}
|
|
18299
|
+
`;
|
|
18300
|
+
|
|
18301
|
+
// src/progress-bar/internal.ts
|
|
18302
|
+
var hostStyles49 = css110`:host { display: block; }`;
|
|
18303
|
+
var CsProgressBarInternal = class extends CsBaseElement {
|
|
18304
|
+
constructor() {
|
|
18305
|
+
super(...arguments);
|
|
18306
|
+
this.value = 0;
|
|
18307
|
+
this.status = "in-progress";
|
|
18308
|
+
this.variant = "standalone";
|
|
18309
|
+
this.ariaLabel = null;
|
|
18310
|
+
}
|
|
18311
|
+
static {
|
|
18312
|
+
this.styles = [sharedStyles, componentStyles48, hostStyles49];
|
|
18313
|
+
}
|
|
18314
|
+
get _clampedValue() {
|
|
18315
|
+
return Math.round(Math.min(100, Math.max(0, this.value ?? 0)));
|
|
18316
|
+
}
|
|
18317
|
+
_onResultButtonClick() {
|
|
18318
|
+
fireNonCancelableEvent(this, "resultButtonClick", null);
|
|
18319
|
+
}
|
|
18320
|
+
render() {
|
|
18321
|
+
const isInProgress = this.status === "in-progress";
|
|
18322
|
+
const clamped = this._clampedValue;
|
|
18323
|
+
const rootClasses = {
|
|
18324
|
+
"root": true,
|
|
18325
|
+
[`variant-${this.variant}`]: true
|
|
18326
|
+
};
|
|
18327
|
+
const progressClasses = {
|
|
18328
|
+
"progress": true,
|
|
18329
|
+
"complete": clamped >= 100
|
|
18330
|
+
};
|
|
18331
|
+
const statusType = this.status === "success" ? "success" : "error";
|
|
18332
|
+
return html50`
|
|
18333
|
+
<div class=${classMap42(rootClasses)}>
|
|
18334
|
+
<div class="label">
|
|
18335
|
+
<slot name="label"></slot>
|
|
18336
|
+
</div>
|
|
18337
|
+
<div class="description">
|
|
18338
|
+
<slot name="description"></slot>
|
|
18339
|
+
</div>
|
|
18340
|
+
|
|
18341
|
+
${isInProgress ? html50`
|
|
18342
|
+
<div class="progress-container">
|
|
18343
|
+
<progress
|
|
18344
|
+
class=${classMap42(progressClasses)}
|
|
18345
|
+
value=${clamped}
|
|
18346
|
+
max="100"
|
|
18347
|
+
aria-label=${this.ariaLabel || "Progress"}
|
|
18348
|
+
aria-valuenow=${clamped}
|
|
18349
|
+
aria-valuemin=${0}
|
|
18350
|
+
aria-valuemax=${100}
|
|
18351
|
+
></progress>
|
|
18352
|
+
<span class="percentage-container">${clamped}%</span>
|
|
18353
|
+
</div>
|
|
18354
|
+
` : html50`
|
|
18355
|
+
<div class="result-state ${this.resultButtonText ? "with-result-button" : ""}">
|
|
18356
|
+
<cs-status-indicator type=${statusType}>
|
|
18357
|
+
<slot name="resultText"></slot>
|
|
18358
|
+
</cs-status-indicator>
|
|
18359
|
+
${this.resultButtonText && this.variant !== "flash" ? html50`
|
|
18360
|
+
<span class="result-button">
|
|
18361
|
+
<button
|
|
18362
|
+
type="button"
|
|
18363
|
+
class="result-button-trigger"
|
|
18364
|
+
@click=${this._onResultButtonClick}
|
|
18365
|
+
>${this.resultButtonText}</button>
|
|
18366
|
+
</span>
|
|
18367
|
+
` : nothing24}
|
|
18368
|
+
</div>
|
|
18369
|
+
`}
|
|
18370
|
+
|
|
18371
|
+
<div class="additional-info word-wrap">
|
|
18372
|
+
<slot name="additionalInfo"></slot>
|
|
18373
|
+
</div>
|
|
18374
|
+
</div>
|
|
18375
|
+
`;
|
|
18376
|
+
}
|
|
18377
|
+
};
|
|
18378
|
+
__decorateClass([
|
|
18379
|
+
property49({ type: Number })
|
|
18380
|
+
], CsProgressBarInternal.prototype, "value", 2);
|
|
18381
|
+
__decorateClass([
|
|
18382
|
+
property49({ type: String, reflect: true })
|
|
18383
|
+
], CsProgressBarInternal.prototype, "status", 2);
|
|
18384
|
+
__decorateClass([
|
|
18385
|
+
property49({ type: String, reflect: true })
|
|
18386
|
+
], CsProgressBarInternal.prototype, "variant", 2);
|
|
18387
|
+
__decorateClass([
|
|
18388
|
+
property49({ type: String })
|
|
18389
|
+
], CsProgressBarInternal.prototype, "resultButtonText", 2);
|
|
18390
|
+
__decorateClass([
|
|
18391
|
+
property49({ type: String })
|
|
18392
|
+
], CsProgressBarInternal.prototype, "ariaLabel", 2);
|
|
18393
|
+
__decorateClass([
|
|
18394
|
+
property49({ type: String })
|
|
18395
|
+
], CsProgressBarInternal.prototype, "ariaLabelledby", 2);
|
|
18396
|
+
__decorateClass([
|
|
18397
|
+
property49({ type: String })
|
|
18398
|
+
], CsProgressBarInternal.prototype, "ariaDescribedby", 2);
|
|
18399
|
+
|
|
18400
|
+
// src/progress-bar/index.ts
|
|
18401
|
+
var CsProgressBar = class extends CsProgressBarInternal {
|
|
18402
|
+
};
|
|
18403
|
+
customElements.define("cs-progress-bar", CsProgressBar);
|
|
18404
|
+
|
|
18405
|
+
// src/steps/internal.ts
|
|
18406
|
+
import { css as css112, html as html51, nothing as nothing25 } from "lit";
|
|
18407
|
+
import { property as property50 } from "lit/decorators.js";
|
|
18408
|
+
import { classMap as classMap43 } from "lit/directives/class-map.js";
|
|
18409
|
+
|
|
18410
|
+
// src/steps/styles.ts
|
|
18411
|
+
import { css as css111 } from "lit";
|
|
18412
|
+
var componentStyles49 = css111`
|
|
18413
|
+
.root {
|
|
18414
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18415
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18416
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18417
|
+
font-weight: 400;
|
|
18418
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18419
|
+
-webkit-font-smoothing: auto;
|
|
18420
|
+
-moz-osx-font-smoothing: auto;
|
|
18421
|
+
min-inline-size: 0;
|
|
18422
|
+
word-break: break-word;
|
|
18423
|
+
}
|
|
18424
|
+
.root > .list {
|
|
18425
|
+
list-style: none;
|
|
18426
|
+
padding-inline-start: 0;
|
|
18427
|
+
margin-block: 0;
|
|
18428
|
+
}
|
|
18429
|
+
.root > .list > .container {
|
|
18430
|
+
display: grid;
|
|
18431
|
+
grid-template-columns: var(--space-static-l-n53k41, 20px) 1fr;
|
|
18432
|
+
grid-template-rows: minmax(var(--space-static-l-n53k41, 20px), auto);
|
|
18433
|
+
}
|
|
18434
|
+
.root > .list > .container > .header {
|
|
18435
|
+
display: flex;
|
|
18436
|
+
gap: var(--space-xxs-hwfkai, 4px);
|
|
18437
|
+
grid-row: 1;
|
|
18438
|
+
grid-column: 1/span 2;
|
|
18439
|
+
}
|
|
18440
|
+
.root > .list > .container > .details {
|
|
18441
|
+
align-items: center;
|
|
18442
|
+
grid-row: 2;
|
|
18443
|
+
grid-column: 2;
|
|
18444
|
+
margin-block-end: var(--space-static-xs-gnm0mz, 8px);
|
|
18445
|
+
}
|
|
18446
|
+
.root > .list > .container > .connector {
|
|
18447
|
+
grid-row: 2;
|
|
18448
|
+
grid-column: 1;
|
|
18449
|
+
background-color: var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
18450
|
+
margin-block: 0;
|
|
18451
|
+
border-block: 0;
|
|
18452
|
+
border-inline: 0;
|
|
18453
|
+
inline-size: var(--border-divider-list-width-tdfx1x, 1px);
|
|
18454
|
+
block-size: auto;
|
|
18455
|
+
min-block-size: var(--space-static-xs-gnm0mz, 8px);
|
|
18456
|
+
position: relative;
|
|
18457
|
+
inset-inline-end: var(--space-static-xxxs-yidks1, 2px);
|
|
18458
|
+
}
|
|
18459
|
+
.root > .list > :last-of-type > .connector {
|
|
18460
|
+
display: none;
|
|
18461
|
+
}
|
|
18462
|
+
.root > .list.custom > .details {
|
|
18463
|
+
margin-block-end: 0;
|
|
18464
|
+
}
|
|
18465
|
+
|
|
18466
|
+
.horizontal > .list {
|
|
18467
|
+
display: grid;
|
|
18468
|
+
align-items: flex-start;
|
|
18469
|
+
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
18470
|
+
grid-auto-flow: column;
|
|
18471
|
+
}
|
|
18472
|
+
.horizontal > .list > .container {
|
|
18473
|
+
display: grid;
|
|
18474
|
+
grid-template-columns: var(--space-static-l-n53k41, 20px) 1fr;
|
|
18475
|
+
grid-template-rows: minmax(var(--space-static-l-n53k41, 20px), auto);
|
|
18476
|
+
align-items: center;
|
|
18477
|
+
}
|
|
18478
|
+
.horizontal > .list > .container > .header {
|
|
18479
|
+
display: flex;
|
|
18480
|
+
grid-row: 1;
|
|
18481
|
+
grid-column: 1/span 2;
|
|
18482
|
+
align-items: center;
|
|
18483
|
+
}
|
|
18484
|
+
.horizontal > .list > .container > .header > .connector {
|
|
18485
|
+
display: block;
|
|
18486
|
+
flex: 1;
|
|
18487
|
+
background-color: var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
18488
|
+
margin-block: 0;
|
|
18489
|
+
border-block: 0;
|
|
18490
|
+
border-inline: 0;
|
|
18491
|
+
min-block-size: 0;
|
|
18492
|
+
inset-inline-end: 0;
|
|
18493
|
+
block-size: var(--border-divider-list-width-tdfx1x, 1px);
|
|
18494
|
+
inline-size: auto;
|
|
18495
|
+
min-inline-size: var(--space-static-xs-gnm0mz, 8px);
|
|
18496
|
+
margin-inline-end: var(--space-static-xxs-ns94dp, 4px);
|
|
18497
|
+
}
|
|
18498
|
+
.horizontal > .list > .container > .horizontal-header {
|
|
18499
|
+
grid-row: 2;
|
|
18500
|
+
grid-column: 1/span 3;
|
|
18501
|
+
padding-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
18502
|
+
}
|
|
18503
|
+
.horizontal > .list > .container > .details {
|
|
18504
|
+
grid-row: 3;
|
|
18505
|
+
grid-column: 1/span 3;
|
|
18506
|
+
padding-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
18507
|
+
}
|
|
18508
|
+
.horizontal > .list > .container:last-child > .header > .connector {
|
|
18509
|
+
display: none;
|
|
18510
|
+
}
|
|
18511
|
+
`;
|
|
18512
|
+
|
|
18513
|
+
// src/steps/internal.ts
|
|
18514
|
+
var hostStyles50 = css112`:host { display: block; }`;
|
|
18515
|
+
var iconNameMap4 = {
|
|
18516
|
+
"success": "status-positive",
|
|
18517
|
+
"error": "status-negative",
|
|
18518
|
+
"warning": "status-warning",
|
|
18519
|
+
"info": "status-info",
|
|
18520
|
+
"stopped": "status-stopped",
|
|
18521
|
+
"pending": "status-pending",
|
|
18522
|
+
"in-progress": "status-in-progress"
|
|
18523
|
+
};
|
|
18524
|
+
var CsStepsInternal = class extends CsBaseElement {
|
|
18525
|
+
constructor() {
|
|
18526
|
+
super(...arguments);
|
|
18527
|
+
this.steps = [];
|
|
18528
|
+
this.orientation = "vertical";
|
|
18529
|
+
this.ariaLabel = null;
|
|
18530
|
+
}
|
|
18531
|
+
static {
|
|
18532
|
+
this.styles = [sharedStyles, componentStyles49, hostStyles50];
|
|
18533
|
+
}
|
|
18534
|
+
_renderIcon(step) {
|
|
18535
|
+
if (step.status === "loading") {
|
|
18536
|
+
return html51`<cs-spinner size="normal"></cs-spinner>`;
|
|
18537
|
+
}
|
|
18538
|
+
const iconName = iconNameMap4[step.status] || "status-info";
|
|
18539
|
+
return html51`<cs-icon name=${iconName} size="small"></cs-icon>`;
|
|
18540
|
+
}
|
|
18541
|
+
_renderVerticalStep(step, index, total) {
|
|
18542
|
+
const isLast = index === total - 1;
|
|
18543
|
+
return html51`
|
|
18544
|
+
<li class="container" role="listitem">
|
|
18545
|
+
<div class="header">
|
|
18546
|
+
<span
|
|
18547
|
+
class="icon"
|
|
18548
|
+
role="img"
|
|
18549
|
+
aria-label=${step.statusIconAriaLabel || step.status}
|
|
18550
|
+
>
|
|
18551
|
+
${this._renderIcon(step)}
|
|
18552
|
+
</span>
|
|
18553
|
+
<span class="title">${step.header}</span>
|
|
18554
|
+
</div>
|
|
18555
|
+
${!isLast ? html51`<hr class="connector" aria-hidden="true" />` : nothing25}
|
|
18556
|
+
${step.details ? html51`
|
|
18557
|
+
<div class="details">${step.details}</div>
|
|
18558
|
+
` : nothing25}
|
|
18559
|
+
</li>
|
|
18560
|
+
`;
|
|
18561
|
+
}
|
|
18562
|
+
_renderHorizontalStep(step, index, total) {
|
|
18563
|
+
const isLast = index === total - 1;
|
|
18564
|
+
return html51`
|
|
18565
|
+
<li class="container" role="listitem">
|
|
18566
|
+
<div class="header">
|
|
18567
|
+
<span
|
|
18568
|
+
class="icon"
|
|
18569
|
+
role="img"
|
|
18570
|
+
aria-label=${step.statusIconAriaLabel || step.status}
|
|
18571
|
+
>
|
|
18572
|
+
${this._renderIcon(step)}
|
|
18573
|
+
</span>
|
|
18574
|
+
${!isLast ? html51`<hr class="connector" aria-hidden="true" />` : nothing25}
|
|
18575
|
+
</div>
|
|
18576
|
+
<div class="horizontal-header">
|
|
18577
|
+
<span class="title">${step.header}</span>
|
|
18578
|
+
</div>
|
|
18579
|
+
${step.details ? html51`
|
|
18580
|
+
<div class="details">${step.details}</div>
|
|
18581
|
+
` : nothing25}
|
|
18582
|
+
</li>
|
|
18583
|
+
`;
|
|
18584
|
+
}
|
|
18585
|
+
render() {
|
|
18586
|
+
const isHorizontal = this.orientation === "horizontal";
|
|
18587
|
+
const rootClasses = {
|
|
18588
|
+
"root": true,
|
|
18589
|
+
"horizontal": isHorizontal
|
|
18590
|
+
};
|
|
18591
|
+
const total = this.steps.length;
|
|
18592
|
+
return html51`
|
|
18593
|
+
<div class=${classMap43(rootClasses)}>
|
|
18594
|
+
<ol
|
|
18595
|
+
class="list"
|
|
18596
|
+
role="list"
|
|
18597
|
+
aria-label=${this.ariaLabel || "Steps"}
|
|
18598
|
+
>
|
|
18599
|
+
${this.steps.map(
|
|
18600
|
+
(step, i) => isHorizontal ? this._renderHorizontalStep(step, i, total) : this._renderVerticalStep(step, i, total)
|
|
18601
|
+
)}
|
|
18602
|
+
</ol>
|
|
18603
|
+
</div>
|
|
18604
|
+
`;
|
|
18605
|
+
}
|
|
18606
|
+
};
|
|
18607
|
+
__decorateClass([
|
|
18608
|
+
property50({ attribute: false })
|
|
18609
|
+
], CsStepsInternal.prototype, "steps", 2);
|
|
18610
|
+
__decorateClass([
|
|
18611
|
+
property50({ type: String, reflect: true })
|
|
18612
|
+
], CsStepsInternal.prototype, "orientation", 2);
|
|
18613
|
+
__decorateClass([
|
|
18614
|
+
property50({ type: String })
|
|
18615
|
+
], CsStepsInternal.prototype, "ariaLabel", 2);
|
|
18616
|
+
__decorateClass([
|
|
18617
|
+
property50({ type: String })
|
|
18618
|
+
], CsStepsInternal.prototype, "ariaLabelledby", 2);
|
|
18619
|
+
__decorateClass([
|
|
18620
|
+
property50({ type: String })
|
|
18621
|
+
], CsStepsInternal.prototype, "ariaDescribedby", 2);
|
|
18622
|
+
|
|
18623
|
+
// src/steps/index.ts
|
|
18624
|
+
var CsSteps = class extends CsStepsInternal {
|
|
18625
|
+
};
|
|
18626
|
+
customElements.define("cs-steps", CsSteps);
|
|
18627
|
+
|
|
18628
|
+
// src/key-value-pairs/internal.ts
|
|
18629
|
+
import { css as css114, html as html52, nothing as nothing26 } from "lit";
|
|
18630
|
+
import { property as property51 } from "lit/decorators.js";
|
|
18631
|
+
|
|
18632
|
+
// src/key-value-pairs/styles.ts
|
|
18633
|
+
import { css as css113 } from "lit";
|
|
18634
|
+
var componentStyles50 = css113`
|
|
18635
|
+
.key-value-pairs {
|
|
18636
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18637
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18638
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18639
|
+
font-weight: 400;
|
|
18640
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18641
|
+
-webkit-font-smoothing: auto;
|
|
18642
|
+
-moz-osx-font-smoothing: auto;
|
|
18643
|
+
}
|
|
18644
|
+
|
|
18645
|
+
.group-title {
|
|
18646
|
+
padding-block-end: var(--space-scaled-m-m892r9, 16px);
|
|
18647
|
+
}
|
|
18648
|
+
|
|
18649
|
+
.group-list {
|
|
18650
|
+
margin-block-start: 0;
|
|
18651
|
+
margin-block-end: 0;
|
|
18652
|
+
margin-inline-start: 0;
|
|
18653
|
+
margin-inline-end: 0;
|
|
18654
|
+
display: flex;
|
|
18655
|
+
flex-direction: column;
|
|
18656
|
+
row-gap: var(--space-scaled-m-m892r9, 16px);
|
|
18657
|
+
}
|
|
18658
|
+
|
|
18659
|
+
.term {
|
|
18660
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18661
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18662
|
+
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
18663
|
+
color: var(--color-text-label-28gfmc, #0f141a);
|
|
18664
|
+
margin-block-end: var(--space-key-value-gap-9glmqc, 0px);
|
|
18665
|
+
}
|
|
18666
|
+
|
|
18667
|
+
.key-label {
|
|
18668
|
+
display: inline-flex;
|
|
18669
|
+
margin-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
18670
|
+
}
|
|
18671
|
+
.key-label:only-child {
|
|
18672
|
+
margin-block: 0;
|
|
18673
|
+
margin-inline: 0;
|
|
18674
|
+
}
|
|
18675
|
+
|
|
18676
|
+
.detail {
|
|
18677
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18678
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18679
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18680
|
+
font-weight: 400;
|
|
18681
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18682
|
+
-webkit-font-smoothing: auto;
|
|
18683
|
+
-moz-osx-font-smoothing: auto;
|
|
18684
|
+
margin-inline-start: 0;
|
|
18685
|
+
margin-block-start: 0;
|
|
18686
|
+
margin-block-end: 0;
|
|
18687
|
+
}
|
|
18688
|
+
|
|
18689
|
+
.info {
|
|
18690
|
+
display: inline-flex;
|
|
18691
|
+
padding-inline-start: var(--space-xs-ymlm0b, 8px);
|
|
18692
|
+
border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
18693
|
+
}
|
|
18694
|
+
`;
|
|
18695
|
+
|
|
18696
|
+
// src/key-value-pairs/internal.ts
|
|
18697
|
+
var hostStyles51 = css114`:host { display: block; }`;
|
|
18698
|
+
var layoutStyles = css114`
|
|
18699
|
+
.grid {
|
|
18700
|
+
display: grid;
|
|
18701
|
+
gap: var(--space-scaled-m-m892r9, 16px);
|
|
18702
|
+
}
|
|
18703
|
+
`;
|
|
18704
|
+
var CsKeyValuePairsInternal = class extends CsBaseElement {
|
|
18705
|
+
constructor() {
|
|
18706
|
+
super(...arguments);
|
|
18707
|
+
this.items = [];
|
|
18708
|
+
this.columns = 1;
|
|
18709
|
+
this.ariaLabel = null;
|
|
18710
|
+
}
|
|
18711
|
+
static {
|
|
18712
|
+
this.styles = [sharedStyles, componentStyles50, layoutStyles, hostStyles51];
|
|
18713
|
+
}
|
|
18714
|
+
_renderPair(pair) {
|
|
18715
|
+
return html52`
|
|
18716
|
+
<div class="pair">
|
|
18717
|
+
<dt class="term">
|
|
18718
|
+
<span class="key-label">${pair.label}</span>
|
|
18719
|
+
${pair.info ? html52`<span class="info">${pair.info}</span>` : nothing26}
|
|
18720
|
+
</dt>
|
|
18721
|
+
<dd class="detail">${pair.value}</dd>
|
|
18722
|
+
</div>
|
|
18723
|
+
`;
|
|
18724
|
+
}
|
|
18725
|
+
_renderGroup(group) {
|
|
18726
|
+
return html52`
|
|
18727
|
+
<div class="group">
|
|
18728
|
+
${group.title ? html52`<div class="group-title"><strong>${group.title}</strong></div>` : nothing26}
|
|
18729
|
+
<dl class="group-list">
|
|
18730
|
+
${group.items.map((pair) => this._renderPair(pair))}
|
|
18731
|
+
</dl>
|
|
18732
|
+
</div>
|
|
18733
|
+
`;
|
|
18734
|
+
}
|
|
18735
|
+
render() {
|
|
18736
|
+
const cols = Math.min(4, Math.max(1, this.columns));
|
|
18737
|
+
const minWidth = this.minColumnWidth ?? 150;
|
|
18738
|
+
const gridStyle = `grid-template-columns: repeat(${cols}, minmax(${minWidth}px, 1fr));`;
|
|
18739
|
+
return html52`
|
|
18740
|
+
<div
|
|
18741
|
+
class="key-value-pairs"
|
|
18742
|
+
role="group"
|
|
18743
|
+
aria-label=${this.ariaLabel || "Key-value pairs"}
|
|
18744
|
+
>
|
|
18745
|
+
<div class="grid" style=${gridStyle}>
|
|
18746
|
+
${this.items.map((item) => {
|
|
18747
|
+
if (item.type === "group") {
|
|
18748
|
+
return this._renderGroup(item);
|
|
18749
|
+
}
|
|
18750
|
+
const pair = item;
|
|
18751
|
+
return html52`
|
|
18752
|
+
<dl class="group-list">
|
|
18753
|
+
${this._renderPair(pair)}
|
|
18754
|
+
</dl>
|
|
18755
|
+
`;
|
|
18756
|
+
})}
|
|
18757
|
+
</div>
|
|
18758
|
+
</div>
|
|
18759
|
+
`;
|
|
18760
|
+
}
|
|
18761
|
+
};
|
|
18762
|
+
__decorateClass([
|
|
18763
|
+
property51({ attribute: false })
|
|
18764
|
+
], CsKeyValuePairsInternal.prototype, "items", 2);
|
|
18765
|
+
__decorateClass([
|
|
18766
|
+
property51({ type: Number })
|
|
18767
|
+
], CsKeyValuePairsInternal.prototype, "columns", 2);
|
|
18768
|
+
__decorateClass([
|
|
18769
|
+
property51({ type: String })
|
|
18770
|
+
], CsKeyValuePairsInternal.prototype, "ariaLabel", 2);
|
|
18771
|
+
__decorateClass([
|
|
18772
|
+
property51({ type: String })
|
|
18773
|
+
], CsKeyValuePairsInternal.prototype, "ariaLabelledby", 2);
|
|
18774
|
+
__decorateClass([
|
|
18775
|
+
property51({ type: Number })
|
|
18776
|
+
], CsKeyValuePairsInternal.prototype, "minColumnWidth", 2);
|
|
18777
|
+
|
|
18778
|
+
// src/key-value-pairs/index.ts
|
|
18779
|
+
var CsKeyValuePairs = class extends CsKeyValuePairsInternal {
|
|
18780
|
+
};
|
|
18781
|
+
customElements.define("cs-key-value-pairs", CsKeyValuePairs);
|
|
18782
|
+
|
|
18783
|
+
// src/property-filter/internal.ts
|
|
18784
|
+
import { css as css116, html as html53, nothing as nothing27 } from "lit";
|
|
18785
|
+
import { property as property52, state as state17, query as queryDecorator } from "lit/decorators.js";
|
|
18786
|
+
|
|
18787
|
+
// src/property-filter/styles.ts
|
|
18788
|
+
import { css as css115 } from "lit";
|
|
18789
|
+
var componentStyles51 = css115`
|
|
18790
|
+
.root {
|
|
18791
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18792
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18793
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18794
|
+
font-weight: 400;
|
|
18795
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18796
|
+
-webkit-font-smoothing: auto;
|
|
18797
|
+
-moz-osx-font-smoothing: auto;
|
|
18798
|
+
}
|
|
18799
|
+
|
|
18800
|
+
.search-field {
|
|
18801
|
+
display: flex;
|
|
18802
|
+
align-items: flex-end;
|
|
18803
|
+
flex-wrap: wrap;
|
|
18804
|
+
gap: var(--space-xs-ymlm0b, 8px) var(--space-s-tvghoh, 12px);
|
|
18805
|
+
}
|
|
18806
|
+
|
|
18807
|
+
.input-wrapper {
|
|
18808
|
+
flex-grow: 1;
|
|
18809
|
+
display: flex;
|
|
18810
|
+
align-items: flex-end;
|
|
18811
|
+
max-inline-size: calc(688px - 2 * var(--space-l-2ud1p3, 20px));
|
|
18812
|
+
}
|
|
18813
|
+
|
|
18814
|
+
.add-token {
|
|
18815
|
+
border-inline-start: 1px solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
18816
|
+
box-sizing: border-box;
|
|
18817
|
+
margin-inline-start: var(--space-m-dsumyt, 16px);
|
|
18818
|
+
padding-inline-start: var(--space-m-dsumyt, 16px);
|
|
18819
|
+
}
|
|
18820
|
+
|
|
18821
|
+
.tokens {
|
|
18822
|
+
margin-block: var(--space-xs-ymlm0b, 8px);
|
|
18823
|
+
margin-inline: 0;
|
|
18824
|
+
}
|
|
18825
|
+
|
|
18826
|
+
.token-operator {
|
|
18827
|
+
font-weight: bold;
|
|
18828
|
+
}
|
|
18829
|
+
|
|
18830
|
+
.property-editor {
|
|
18831
|
+
overflow-y: auto;
|
|
18832
|
+
}
|
|
18833
|
+
.property-editor-header {
|
|
18834
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18835
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18836
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18837
|
+
font-weight: 400;
|
|
18838
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18839
|
+
-webkit-font-smoothing: auto;
|
|
18840
|
+
-moz-osx-font-smoothing: auto;
|
|
18841
|
+
font-weight: bold;
|
|
18842
|
+
padding-block-start: var(--space-s-tvghoh, 12px);
|
|
18843
|
+
padding-block-end: var(--space-xxs-hwfkai, 4px);
|
|
18844
|
+
padding-inline: var(--space-s-tvghoh, 12px);
|
|
18845
|
+
}
|
|
18846
|
+
.property-editor-header-enum {
|
|
18847
|
+
display: flex;
|
|
18848
|
+
gap: var(--space-xs-ymlm0b, 8px);
|
|
18849
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18850
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18851
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18852
|
+
font-weight: 400;
|
|
18853
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18854
|
+
-webkit-font-smoothing: auto;
|
|
18855
|
+
-moz-osx-font-smoothing: auto;
|
|
18856
|
+
font-weight: bold;
|
|
18857
|
+
color: var(--color-text-dropdown-group-label-2tmyik, #424650);
|
|
18858
|
+
padding-block: calc(var(--space-xs-ymlm0b, 8px) + var(--border-item-width-miijiw, 2px) - var(--border-divider-list-width-tdfx1x, 1px));
|
|
18859
|
+
padding-inline: calc(var(--space-field-horizontal-0aq2ch, 12px) + var(--border-item-width-miijiw, 2px));
|
|
18860
|
+
}
|
|
18861
|
+
.property-editor-form {
|
|
18862
|
+
padding-block-start: var(--space-xxs-hwfkai, 4px);
|
|
18863
|
+
padding-block-end: var(--space-s-tvghoh, 12px);
|
|
18864
|
+
padding-inline: var(--space-s-tvghoh, 12px);
|
|
18865
|
+
}
|
|
18866
|
+
.property-editor-cancel {
|
|
18867
|
+
margin-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
18868
|
+
}
|
|
18869
|
+
.property-editor-actions {
|
|
18870
|
+
display: flex;
|
|
18871
|
+
justify-content: flex-end;
|
|
18872
|
+
border-block-start: var(--border-divider-list-width-tdfx1x, 1px) solid var(--color-border-dropdown-item-default-kape37, #c6c6cd);
|
|
18873
|
+
padding-inline: var(--space-l-2ud1p3, 20px);
|
|
18874
|
+
padding-block: var(--space-s-tvghoh, 12px);
|
|
18875
|
+
}
|
|
18876
|
+
|
|
18877
|
+
.property-editor-enum {
|
|
18878
|
+
display: flex;
|
|
18879
|
+
flex-direction: column;
|
|
18880
|
+
}
|
|
18881
|
+
|
|
18882
|
+
.token-editor {
|
|
18883
|
+
display: flex;
|
|
18884
|
+
flex-direction: column;
|
|
18885
|
+
gap: var(--space-s-tvghoh, 12px);
|
|
18886
|
+
margin-block: var(--space-xxs-hwfkai, 4px);
|
|
18887
|
+
margin-inline: var(--space-xxs-hwfkai, 4px);
|
|
18888
|
+
}
|
|
18889
|
+
.token-editor-field-property {
|
|
18890
|
+
flex-grow: 2;
|
|
18891
|
+
}
|
|
18892
|
+
.token-editor-field-operator {
|
|
18893
|
+
flex-grow: 1;
|
|
18894
|
+
}
|
|
18895
|
+
.token-editor-field-value {
|
|
18896
|
+
flex-grow: 2;
|
|
18897
|
+
}
|
|
18898
|
+
.token-editor-multiselect-wrapper {
|
|
18899
|
+
position: relative;
|
|
18900
|
+
block-size: var(--size-vertical-input-p1d7xx, 32px);
|
|
18901
|
+
min-inline-size: 200px;
|
|
18902
|
+
}
|
|
18903
|
+
.token-editor-multiselect-wrapper-inner {
|
|
18904
|
+
position: absolute;
|
|
18905
|
+
inline-size: 100%;
|
|
18906
|
+
}
|
|
18907
|
+
.token-editor-cancel {
|
|
18908
|
+
margin-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
18909
|
+
}
|
|
18910
|
+
.token-editor-actions {
|
|
18911
|
+
display: flex;
|
|
18912
|
+
justify-content: flex-end;
|
|
18913
|
+
padding-block-start: var(--space-s-tvghoh, 12px);
|
|
18914
|
+
border-block-start: 1px solid var(--color-border-dropdown-item-default-kape37, #c6c6cd);
|
|
18915
|
+
padding-inline-end: calc(var(--space-m-dsumyt, 16px) + var(--space-xxs-hwfkai, 4px));
|
|
18916
|
+
margin-inline: calc(-1 * var(--space-m-dsumyt, 16px) + -1 * var(--space-xxs-hwfkai, 4px));
|
|
18917
|
+
margin-block-start: var(--space-s-tvghoh, 12px);
|
|
18918
|
+
}
|
|
18919
|
+
.token-editor-grid {
|
|
18920
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
18921
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
18922
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
18923
|
+
font-weight: 400;
|
|
18924
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
18925
|
+
-webkit-font-smoothing: auto;
|
|
18926
|
+
-moz-osx-font-smoothing: auto;
|
|
18927
|
+
display: grid;
|
|
18928
|
+
gap: var(--space-s-tvghoh, 12px);
|
|
18929
|
+
grid-template-columns: minmax(min-content, 2fr) minmax(min-content, 120px) minmax(min-content, 3fr) min-content;
|
|
18930
|
+
}
|
|
18931
|
+
.token-editor-grid-group {
|
|
18932
|
+
display: contents;
|
|
18933
|
+
}
|
|
18934
|
+
.token-editor-grid.token-editor-narrow {
|
|
18935
|
+
grid-template-columns: minmax(100px, 1fr);
|
|
18936
|
+
gap: var(--space-m-dsumyt, 16px);
|
|
18937
|
+
}
|
|
18938
|
+
.token-editor-grid.token-editor-narrow > .token-editor-grid-group {
|
|
18939
|
+
display: flex;
|
|
18940
|
+
flex-direction: column;
|
|
18941
|
+
gap: var(--space-s-tvghoh, 12px);
|
|
18942
|
+
}
|
|
18943
|
+
.token-editor-grid.token-editor-narrow > .token-editor-grid-group.token-editor-supports-groups {
|
|
18944
|
+
padding-block-end: var(--space-m-dsumyt, 16px);
|
|
18945
|
+
border-block-end: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
18946
|
+
}
|
|
18947
|
+
.token-editor-grid-header {
|
|
18948
|
+
color: var(--color-text-column-header-e6urd1, #424650);
|
|
18949
|
+
font-weight: var(--font-weight-heading-s-lcx0ai, 700);
|
|
18950
|
+
padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
18951
|
+
text-align: start;
|
|
18952
|
+
}
|
|
18953
|
+
.token-editor-grid-cell:not(.token-editor-narrow) {
|
|
18954
|
+
display: flex;
|
|
18955
|
+
align-items: flex-end;
|
|
18956
|
+
justify-content: flex-end;
|
|
18957
|
+
}
|
|
18958
|
+
.token-editor-grid-cell.token-editor-narrow:nth-child(4) {
|
|
18959
|
+
display: flex;
|
|
18960
|
+
justify-content: flex-end;
|
|
18961
|
+
}
|
|
18962
|
+
.token-editor-add-token {
|
|
18963
|
+
margin-block-start: var(--space-s-tvghoh, 12px);
|
|
18964
|
+
}
|
|
18965
|
+
|
|
18966
|
+
.custom-content-wrapper {
|
|
18967
|
+
display: contents;
|
|
18968
|
+
}
|
|
18969
|
+
|
|
18970
|
+
.input {
|
|
18971
|
+
flex: 1;
|
|
18972
|
+
}
|
|
18973
|
+
|
|
18974
|
+
.results {
|
|
18975
|
+
padding-block: calc(var(--space-scaled-xxs-pfm1nx, 4px) + var(--border-width-field-2xc78x, 1px));
|
|
18976
|
+
padding-inline: 0;
|
|
18977
|
+
}
|
|
18978
|
+
|
|
18979
|
+
.token-trigger {
|
|
18980
|
+
min-inline-size: 0;
|
|
18981
|
+
word-break: break-word;
|
|
18982
|
+
}
|
|
18983
|
+
|
|
18984
|
+
.constraint {
|
|
18985
|
+
padding-block-start: var(--space-xxs-hwfkai, 4px);
|
|
18986
|
+
color: var(--color-text-form-secondary-1nm780, #656871);
|
|
18987
|
+
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
18988
|
+
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
18989
|
+
letter-spacing: var(--letter-spacing-body-s-gq78ok, 0.005em);
|
|
18990
|
+
}
|
|
18991
|
+
`;
|
|
18992
|
+
|
|
18993
|
+
// src/property-filter/internal.ts
|
|
18994
|
+
var hostStyles52 = css116`:host { display: block; }`;
|
|
18995
|
+
var filterInputStyles = css116`
|
|
18996
|
+
.filter-input {
|
|
18997
|
+
flex: 1;
|
|
18998
|
+
min-inline-size: 120px;
|
|
18999
|
+
padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
19000
|
+
padding-inline: var(--space-field-horizontal-0aq2ch, 12px);
|
|
19001
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
19002
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
19003
|
+
font-family: inherit;
|
|
19004
|
+
border: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-default-t4n2s0, #8c8c94);
|
|
19005
|
+
border-radius: var(--border-radius-input-0z3fnq, 8px);
|
|
19006
|
+
background: var(--color-background-input-default-m6twru, #ffffff);
|
|
19007
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
19008
|
+
outline: none;
|
|
19009
|
+
box-sizing: border-box;
|
|
19010
|
+
}
|
|
19011
|
+
.filter-input:focus {
|
|
19012
|
+
border-color: var(--color-border-input-focused-0mhils, #006ce0);
|
|
19013
|
+
box-shadow: 0 0 0 1px var(--color-border-input-focused-0mhils, #006ce0);
|
|
19014
|
+
}
|
|
19015
|
+
.filter-input:disabled {
|
|
19016
|
+
background: var(--color-background-input-disabled-kxocba, #ebebf0);
|
|
19017
|
+
border-color: var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
19018
|
+
color: var(--color-text-input-disabled-tvmsyk, #b4b4bb);
|
|
19019
|
+
cursor: default;
|
|
19020
|
+
}
|
|
19021
|
+
.token-list {
|
|
19022
|
+
display: flex;
|
|
19023
|
+
flex-wrap: wrap;
|
|
19024
|
+
gap: var(--space-xs-ymlm0b, 8px);
|
|
19025
|
+
list-style: none;
|
|
19026
|
+
margin: 0;
|
|
19027
|
+
padding: 0;
|
|
19028
|
+
}
|
|
19029
|
+
.token-item {
|
|
19030
|
+
display: inline-flex;
|
|
19031
|
+
max-inline-size: 100%;
|
|
19032
|
+
}
|
|
19033
|
+
.operation-label {
|
|
19034
|
+
display: inline-flex;
|
|
19035
|
+
align-items: center;
|
|
19036
|
+
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
19037
|
+
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
19038
|
+
color: var(--color-text-form-secondary-1nm780, #656871);
|
|
19039
|
+
font-weight: bold;
|
|
19040
|
+
text-transform: uppercase;
|
|
19041
|
+
padding-inline: var(--space-xxs-hwfkai, 4px);
|
|
19042
|
+
}
|
|
19043
|
+
`;
|
|
19044
|
+
var CsPropertyFilterInternal = class extends CsBaseElement {
|
|
19045
|
+
constructor() {
|
|
19046
|
+
super(...arguments);
|
|
19047
|
+
this.query = { tokens: [], operation: "and" };
|
|
19048
|
+
this.filteringProperties = [];
|
|
19049
|
+
this.filteringOptions = [];
|
|
19050
|
+
this.disabled = false;
|
|
19051
|
+
this.filteringPlaceholder = "Filter by text";
|
|
19052
|
+
this._inputValue = "";
|
|
19053
|
+
}
|
|
19054
|
+
static {
|
|
19055
|
+
this.styles = [sharedStyles, componentStyles51, componentStyles26, filterInputStyles, hostStyles52];
|
|
19056
|
+
}
|
|
19057
|
+
focus(options) {
|
|
19058
|
+
this._inputEl?.focus(options);
|
|
19059
|
+
}
|
|
19060
|
+
_onInput(e) {
|
|
19061
|
+
this._inputValue = e.target.value;
|
|
19062
|
+
}
|
|
19063
|
+
_onKeyDown(e) {
|
|
19064
|
+
if (e.key === "Enter" && this._inputValue.trim()) {
|
|
19065
|
+
e.preventDefault();
|
|
19066
|
+
const newToken = { value: this._inputValue.trim() };
|
|
19067
|
+
const newQuery = {
|
|
19068
|
+
tokens: [...this.query.tokens, newToken],
|
|
19069
|
+
operation: this.query.operation
|
|
19070
|
+
};
|
|
19071
|
+
this._inputValue = "";
|
|
19072
|
+
fireNonCancelableEvent(this, "change", { query: newQuery });
|
|
19073
|
+
}
|
|
19074
|
+
}
|
|
19075
|
+
_onDismiss(index) {
|
|
19076
|
+
const newTokens = this.query.tokens.filter((_, i) => i !== index);
|
|
19077
|
+
const newQuery = {
|
|
19078
|
+
tokens: newTokens,
|
|
19079
|
+
operation: this.query.operation
|
|
19080
|
+
};
|
|
19081
|
+
fireNonCancelableEvent(this, "change", { query: newQuery });
|
|
19082
|
+
}
|
|
19083
|
+
_renderToken(token, index) {
|
|
19084
|
+
const label = token.propertyKey ? `${token.propertyKey} ${token.operator || "="} ${token.value}` : token.value;
|
|
19085
|
+
return html53`
|
|
19086
|
+
<li class="token-item">
|
|
19087
|
+
<div class="token-box" role="group" aria-label=${label}>
|
|
19088
|
+
<span class="token-normal">
|
|
19089
|
+
<div class="token-trigger">${label}</div>
|
|
19090
|
+
</span>
|
|
19091
|
+
<button
|
|
19092
|
+
class="dismiss-button"
|
|
19093
|
+
type="button"
|
|
19094
|
+
aria-label="Remove filter ${label}"
|
|
19095
|
+
@click=${() => this._onDismiss(index)}
|
|
19096
|
+
>
|
|
19097
|
+
<cs-icon name="close" size="small"></cs-icon>
|
|
19098
|
+
</button>
|
|
19099
|
+
</div>
|
|
19100
|
+
</li>
|
|
19101
|
+
`;
|
|
19102
|
+
}
|
|
19103
|
+
render() {
|
|
19104
|
+
const hasTokens = this.query.tokens.length > 0;
|
|
19105
|
+
const operationLabel = this.query.operation === "and" ? "and" : "or";
|
|
19106
|
+
return html53`
|
|
19107
|
+
<div class="root">
|
|
19108
|
+
<div class="search-field">
|
|
19109
|
+
<div class="input-wrapper">
|
|
19110
|
+
<input
|
|
19111
|
+
class="filter-input"
|
|
19112
|
+
type="text"
|
|
19113
|
+
.value=${this._inputValue}
|
|
19114
|
+
placeholder=${this.filteringPlaceholder}
|
|
19115
|
+
?disabled=${this.disabled}
|
|
19116
|
+
aria-label=${this.filteringPlaceholder}
|
|
19117
|
+
@input=${this._onInput}
|
|
19118
|
+
@keydown=${this._onKeyDown}
|
|
19119
|
+
/>
|
|
19120
|
+
</div>
|
|
19121
|
+
</div>
|
|
19122
|
+
|
|
19123
|
+
${hasTokens ? html53`
|
|
19124
|
+
<div class="tokens">
|
|
19125
|
+
<ul class="token-list" role="list">
|
|
19126
|
+
${this.query.tokens.map((token, i) => html53`
|
|
19127
|
+
${i > 0 ? html53`<li class="operation-label" aria-hidden="true">${operationLabel}</li>` : nothing27}
|
|
19128
|
+
${this._renderToken(token, i)}
|
|
19129
|
+
`)}
|
|
19130
|
+
</ul>
|
|
19131
|
+
</div>
|
|
19132
|
+
` : nothing27}
|
|
19133
|
+
|
|
19134
|
+
${this.countText && hasTokens ? html53`
|
|
19135
|
+
<div class="results">${this.countText}</div>
|
|
19136
|
+
` : nothing27}
|
|
19137
|
+
</div>
|
|
19138
|
+
`;
|
|
19139
|
+
}
|
|
19140
|
+
};
|
|
19141
|
+
__decorateClass([
|
|
19142
|
+
property52({ attribute: false })
|
|
19143
|
+
], CsPropertyFilterInternal.prototype, "query", 2);
|
|
19144
|
+
__decorateClass([
|
|
19145
|
+
property52({ attribute: false })
|
|
19146
|
+
], CsPropertyFilterInternal.prototype, "filteringProperties", 2);
|
|
19147
|
+
__decorateClass([
|
|
19148
|
+
property52({ attribute: false })
|
|
19149
|
+
], CsPropertyFilterInternal.prototype, "filteringOptions", 2);
|
|
19150
|
+
__decorateClass([
|
|
19151
|
+
property52({ type: Boolean, reflect: true })
|
|
19152
|
+
], CsPropertyFilterInternal.prototype, "disabled", 2);
|
|
19153
|
+
__decorateClass([
|
|
19154
|
+
property52({ type: String })
|
|
19155
|
+
], CsPropertyFilterInternal.prototype, "filteringPlaceholder", 2);
|
|
19156
|
+
__decorateClass([
|
|
19157
|
+
property52({ type: String })
|
|
19158
|
+
], CsPropertyFilterInternal.prototype, "countText", 2);
|
|
19159
|
+
__decorateClass([
|
|
19160
|
+
state17()
|
|
19161
|
+
], CsPropertyFilterInternal.prototype, "_inputValue", 2);
|
|
19162
|
+
__decorateClass([
|
|
19163
|
+
queryDecorator(".filter-input")
|
|
19164
|
+
], CsPropertyFilterInternal.prototype, "_inputEl", 2);
|
|
19165
|
+
|
|
19166
|
+
// src/property-filter/index.ts
|
|
19167
|
+
var CsPropertyFilter = class extends CsPropertyFilterInternal {
|
|
19168
|
+
};
|
|
19169
|
+
customElements.define("cs-property-filter", CsPropertyFilter);
|
|
19170
|
+
|
|
19171
|
+
// src/table/internal.ts
|
|
19172
|
+
import { css as css118, html as html54, nothing as nothing28 } from "lit";
|
|
19173
|
+
import { property as property53 } from "lit/decorators.js";
|
|
19174
|
+
import { classMap as classMap44 } from "lit/directives/class-map.js";
|
|
19175
|
+
|
|
19176
|
+
// src/table/styles.ts
|
|
19177
|
+
import { css as css117 } from "lit";
|
|
19178
|
+
var componentStyles52 = css117`
|
|
19179
|
+
.root {
|
|
19180
|
+
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
19181
|
+
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
19182
|
+
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
19183
|
+
font-weight: 400;
|
|
19184
|
+
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
19185
|
+
-webkit-font-smoothing: auto;
|
|
19186
|
+
-moz-osx-font-smoothing: auto;
|
|
19187
|
+
inline-size: 100%;
|
|
19188
|
+
}
|
|
19189
|
+
|
|
19190
|
+
.tools {
|
|
19191
|
+
display: flex;
|
|
19192
|
+
align-items: flex-end;
|
|
19193
|
+
flex-wrap: wrap;
|
|
19194
|
+
gap: var(--space-scaled-xs-xwoogq, 8px) var(--space-l-2ud1p3, 20px);
|
|
19195
|
+
padding-block-start: var(--space-scaled-xs-xwoogq, 8px);
|
|
19196
|
+
padding-block-end: var(--space-table-header-tools-bottom-d9u5kf, 0px);
|
|
19197
|
+
padding-inline: 0;
|
|
19198
|
+
}
|
|
19199
|
+
.tools-filtering {
|
|
19200
|
+
max-inline-size: 100%;
|
|
19201
|
+
}
|
|
19202
|
+
@supports (flex-basis: fit-content) {
|
|
19203
|
+
.tools-filtering {
|
|
19204
|
+
flex: 1 1 fit-content;
|
|
19205
|
+
}
|
|
19206
|
+
}
|
|
19207
|
+
@supports not (flex-basis: fit-content) {
|
|
19208
|
+
.tools-filtering {
|
|
19209
|
+
flex: 1 1 auto;
|
|
19210
|
+
}
|
|
19211
|
+
}
|
|
19212
|
+
.tools-align-right {
|
|
19213
|
+
display: flex;
|
|
19214
|
+
margin-inline-start: auto;
|
|
19215
|
+
}
|
|
19216
|
+
.tools-pagination + .tools-preferences {
|
|
19217
|
+
border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
19218
|
+
box-sizing: border-box;
|
|
19219
|
+
margin-inline-start: var(--space-xs-ymlm0b, 8px);
|
|
19220
|
+
padding-inline-start: var(--space-xs-ymlm0b, 8px);
|
|
19221
|
+
}
|
|
19222
|
+
.tools-small > .tools-filtering {
|
|
19223
|
+
flex-basis: 100%;
|
|
19224
|
+
}
|
|
19225
|
+
|
|
19226
|
+
.table {
|
|
19227
|
+
inline-size: 100%;
|
|
19228
|
+
border-spacing: 0;
|
|
19229
|
+
position: relative;
|
|
19230
|
+
box-sizing: border-box;
|
|
19231
|
+
}
|
|
19232
|
+
.table-layout-fixed {
|
|
19233
|
+
table-layout: fixed;
|
|
19234
|
+
}
|
|
19235
|
+
|
|
19236
|
+
.wrapper {
|
|
19237
|
+
position: relative;
|
|
19238
|
+
box-sizing: border-box;
|
|
19239
|
+
inline-size: 100%;
|
|
19240
|
+
overflow-x: auto;
|
|
19241
|
+
scrollbar-width: none; /* Hide scrollbar in Firefox */
|
|
19242
|
+
}
|
|
19243
|
+
.wrapper.variant-stacked > .table, .wrapper.variant-stacked > .wrapper-content-measure, .wrapper.variant-container > .table, .wrapper.variant-container > .wrapper-content-measure {
|
|
19244
|
+
padding-inline: var(--space-table-horizontal-suurzj, 20px);
|
|
19245
|
+
}
|
|
19246
|
+
.wrapper.variant-stacked:not(.has-footer), .wrapper.variant-container:not(.has-footer) {
|
|
19247
|
+
padding-block-end: var(--space-table-content-bottom-tlfqmq, 4px);
|
|
19248
|
+
}
|
|
19249
|
+
.wrapper:not(.has-header) {
|
|
19250
|
+
border-start-end-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19251
|
+
border-start-start-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19252
|
+
}
|
|
19253
|
+
.wrapper::-webkit-scrollbar {
|
|
19254
|
+
display: none; /* Hide scrollbar in Safari and Chrome */
|
|
19255
|
+
}
|
|
19256
|
+
:host-context([data-awsui-focus-visible=true]) .wrapper:focus {
|
|
19257
|
+
outline: 2px dotted transparent;
|
|
19258
|
+
outline-offset: 2px;
|
|
19259
|
+
border-start-start-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19260
|
+
border-start-end-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19261
|
+
border-end-start-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19262
|
+
border-end-end-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19263
|
+
box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
|
|
19264
|
+
}
|
|
19265
|
+
|
|
19266
|
+
.cell-merged {
|
|
19267
|
+
text-align: center;
|
|
19268
|
+
padding-block: 0;
|
|
19269
|
+
padding-inline: 0;
|
|
19270
|
+
}
|
|
19271
|
+
.cell-merged.has-footer {
|
|
19272
|
+
/*
|
|
19273
|
+
Add a bottom border to the body cell of an empty table as a separator between the
|
|
19274
|
+
table and the footer
|
|
19275
|
+
*/
|
|
19276
|
+
border-block-end: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
19277
|
+
}
|
|
19278
|
+
.cell-merged-content {
|
|
19279
|
+
box-sizing: border-box;
|
|
19280
|
+
inline-size: 100%;
|
|
19281
|
+
padding-block-start: var(--space-scaled-m-m892r9, 16px);
|
|
19282
|
+
padding-block-end: var(--space-scaled-l-sej05l, 20px);
|
|
19283
|
+
padding-inline: var(--space-l-2ud1p3, 20px);
|
|
19284
|
+
}
|
|
19285
|
+
@supports (position: sticky) {
|
|
19286
|
+
.cell-merged-content {
|
|
19287
|
+
position: sticky;
|
|
19288
|
+
inset-inline-start: 0;
|
|
19289
|
+
margin-block: 0;
|
|
19290
|
+
margin-inline: calc(-2 * var(--space-table-horizontal-suurzj, 20px));
|
|
19291
|
+
}
|
|
19292
|
+
}
|
|
19293
|
+
|
|
19294
|
+
.empty {
|
|
19295
|
+
color: var(--color-text-empty-tlohug, #656871);
|
|
19296
|
+
}
|
|
19297
|
+
|
|
19298
|
+
/*
|
|
19299
|
+
The min/max/width token values in Visual Refresh should align
|
|
19300
|
+
the table header and body cells selection control with the table
|
|
19301
|
+
filter search icon.
|
|
19302
|
+
*/
|
|
19303
|
+
.selection-control {
|
|
19304
|
+
box-sizing: border-box;
|
|
19305
|
+
max-inline-size: var(--size-table-selection-horizontal-qqiajd, 40px);
|
|
19306
|
+
min-inline-size: var(--size-table-selection-horizontal-qqiajd, 40px);
|
|
19307
|
+
position: relative;
|
|
19308
|
+
inline-size: var(--size-table-selection-horizontal-qqiajd, 40px);
|
|
19309
|
+
}
|
|
19310
|
+
.selection-control.selection-control-header {
|
|
19311
|
+
padding-block: var(--space-scaled-xs-xwoogq, 8px);
|
|
19312
|
+
padding-inline: var(--space-scaled-l-sej05l, 20px);
|
|
19313
|
+
border-inline-start: var(--border-item-width-miijiw, 2px) solid transparent;
|
|
19314
|
+
}
|
|
19315
|
+
|
|
19316
|
+
.header-secondary {
|
|
19317
|
+
overflow: auto;
|
|
19318
|
+
scrollbar-width: none; /* Firefox */
|
|
19319
|
+
box-sizing: border-box;
|
|
19320
|
+
inline-size: 100%;
|
|
19321
|
+
border-start-start-radius: 0;
|
|
19322
|
+
border-start-end-radius: 0;
|
|
19323
|
+
border-end-start-radius: 0;
|
|
19324
|
+
border-end-end-radius: 0;
|
|
19325
|
+
background: var(--color-background-table-header-hdjxos, #ffffff);
|
|
19326
|
+
}
|
|
19327
|
+
.header-secondary.variant-full-page {
|
|
19328
|
+
background: var(--color-background-layout-main-5ilwcb, #ffffff);
|
|
19329
|
+
}
|
|
19330
|
+
.header-secondary.variant-stacked > .table, .header-secondary.variant-container > .table {
|
|
19331
|
+
padding-inline: var(--space-table-horizontal-suurzj, 20px);
|
|
19332
|
+
}
|
|
19333
|
+
.header-secondary.variant-stacked:not(.table-has-header), .header-secondary.variant-container:not(.table-has-header) {
|
|
19334
|
+
border-start-start-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19335
|
+
border-start-end-radius: var(--border-radius-container-nsfwmm, 16px);
|
|
19336
|
+
}
|
|
19337
|
+
.header-secondary::-webkit-scrollbar {
|
|
19338
|
+
display: none; /* Safari and Chrome */
|
|
19339
|
+
}
|
|
19340
|
+
.header-secondary.table-has-header {
|
|
19341
|
+
border-block-start: var(--border-divider-list-width-tdfx1x, 1px) solid var(--color-border-container-divider-9huz1a, transparent);
|
|
19342
|
+
}
|
|
19343
|
+
|
|
19344
|
+
.header-controls {
|
|
19345
|
+
padding-block: var(--space-container-header-top-am4vzw, 12px) var(--space-container-header-bottom-2taq8v, 8px);
|
|
19346
|
+
}
|
|
19347
|
+
.header-controls.variant-full-page {
|
|
19348
|
+
padding-block: 0 calc(var(--space-container-header-bottom-2taq8v, 8px) + var(--space-table-header-tools-full-page-bottom-9m47g6, 4px));
|
|
19349
|
+
}
|
|
19350
|
+
.header-controls.variant-stacked, .header-controls.variant-container {
|
|
19351
|
+
padding-inline: calc(var(--space-table-horizontal-suurzj, 20px) + var(--space-table-header-horizontal-kb5ww2, 0px));
|
|
19352
|
+
}
|
|
19353
|
+
.header-controls.variant-embedded, .header-controls.variant-borderless {
|
|
19354
|
+
padding-inline: var(--space-table-header-horizontal-kb5ww2, 0px);
|
|
19355
|
+
padding-block-start: var(--space-table-embedded-header-top-twu628, 0px);
|
|
19356
|
+
}
|
|
19357
|
+
|
|
19358
|
+
.footer-wrapper.variant-stacked, .footer-wrapper.variant-container {
|
|
19359
|
+
padding-inline: var(--space-table-horizontal-suurzj, 20px);
|
|
19360
|
+
}
|
|
19361
|
+
|
|
19362
|
+
.footer {
|
|
19363
|
+
padding-block: var(--space-scaled-s-8ozaad, 12px);
|
|
19364
|
+
padding-inline: var(--space-table-footer-horizontal-l5g495, 0px);
|
|
19365
|
+
}
|
|
19366
|
+
.footer-with-pagination {
|
|
19367
|
+
display: flex;
|
|
19368
|
+
flex-direction: row;
|
|
19369
|
+
justify-content: space-between;
|
|
19370
|
+
align-items: center;
|
|
19371
|
+
flex-wrap: wrap;
|
|
19372
|
+
gap: var(--space-scaled-s-8ozaad, 12px);
|
|
19373
|
+
}
|
|
19374
|
+
.footer-pagination {
|
|
19375
|
+
margin-inline-start: auto;
|
|
19376
|
+
}
|
|
19377
|
+
`;
|
|
19378
|
+
|
|
19379
|
+
// src/table/internal.ts
|
|
19380
|
+
var hostStyles53 = css118`:host { display: block; }`;
|
|
19381
|
+
var tableElementStyles = css118`
|
|
19382
|
+
.header-cell {
|
|
19383
|
+
padding-block: var(--space-scaled-xs-xwoogq, 8px);
|
|
19384
|
+
padding-inline: var(--space-l-2ud1p3, 20px);
|
|
19385
|
+
border-block-end: var(--border-divider-section-width-uwo8my, 1px) solid
|
|
19386
|
+
var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
19387
|
+
font-weight: 700;
|
|
19388
|
+
font-size: var(--font-size-body-s-3sui0u, 12px);
|
|
19389
|
+
line-height: var(--line-height-body-s-yzq0ol, 16px);
|
|
19390
|
+
color: var(--color-text-column-header-huer4g, #0f141a);
|
|
19391
|
+
text-align: start;
|
|
19392
|
+
white-space: nowrap;
|
|
19393
|
+
box-sizing: border-box;
|
|
19394
|
+
background: var(--color-background-table-header-hdjxos, #ffffff);
|
|
19395
|
+
vertical-align: middle;
|
|
19396
|
+
}
|
|
19397
|
+
.header-cell-sortable {
|
|
19398
|
+
cursor: pointer;
|
|
19399
|
+
user-select: none;
|
|
19400
|
+
}
|
|
19401
|
+
.header-cell-sortable:hover {
|
|
19402
|
+
color: var(--color-text-interactive-hover-awk0mg, #002b66);
|
|
19403
|
+
}
|
|
19404
|
+
.header-cell-sorted {
|
|
19405
|
+
color: var(--color-text-interactive-active-vol84d, #002b66);
|
|
19406
|
+
}
|
|
19407
|
+
|
|
19408
|
+
.sorting-icon {
|
|
19409
|
+
display: inline-block;
|
|
19410
|
+
margin-inline-start: var(--space-xxs-ysj0na, 4px);
|
|
19411
|
+
vertical-align: middle;
|
|
19412
|
+
transition: transform 0.135s ease-in-out;
|
|
19413
|
+
}
|
|
19414
|
+
.sorting-icon-ascending {
|
|
19415
|
+
transform: rotate(180deg);
|
|
19416
|
+
}
|
|
19417
|
+
|
|
19418
|
+
.body-cell {
|
|
19419
|
+
padding-block: var(--space-scaled-xs-xwoogq, 8px);
|
|
19420
|
+
padding-inline: var(--space-l-2ud1p3, 20px);
|
|
19421
|
+
border-block-end: var(--border-divider-list-width-tdfx1x, 1px) solid
|
|
19422
|
+
var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
19423
|
+
box-sizing: border-box;
|
|
19424
|
+
overflow: hidden;
|
|
19425
|
+
text-overflow: ellipsis;
|
|
19426
|
+
white-space: nowrap;
|
|
19427
|
+
vertical-align: middle;
|
|
19428
|
+
}
|
|
19429
|
+
.body-cell-wrap {
|
|
19430
|
+
white-space: normal;
|
|
19431
|
+
word-break: break-word;
|
|
19432
|
+
}
|
|
19433
|
+
|
|
19434
|
+
.row {
|
|
19435
|
+
background: var(--color-background-container-content-vp98t4, #ffffff);
|
|
19436
|
+
}
|
|
19437
|
+
.row:hover {
|
|
19438
|
+
background: var(--color-background-dropdown-item-hover-b9eaac, #f0f0f0);
|
|
19439
|
+
}
|
|
19440
|
+
.row-selected {
|
|
19441
|
+
background: var(--color-background-item-selected-y06wdv, #f0f4ff);
|
|
19442
|
+
}
|
|
19443
|
+
.row-selected:hover {
|
|
19444
|
+
background: var(--color-background-item-selected-y06wdv, #f0f4ff);
|
|
19445
|
+
}
|
|
19446
|
+
.row-striped:not(.row-selected) {
|
|
19447
|
+
background: var(--color-background-striped-rows-khb4zg, #fafafa);
|
|
19448
|
+
}
|
|
19449
|
+
|
|
19450
|
+
.selection-cell {
|
|
19451
|
+
box-sizing: border-box;
|
|
19452
|
+
inline-size: var(--size-table-selection-horizontal-qqiajd, 40px);
|
|
19453
|
+
min-inline-size: var(--size-table-selection-horizontal-qqiajd, 40px);
|
|
19454
|
+
max-inline-size: var(--size-table-selection-horizontal-qqiajd, 40px);
|
|
19455
|
+
padding-block: var(--space-scaled-xs-xwoogq, 8px);
|
|
19456
|
+
padding-inline-start: var(--space-scaled-l-sej05l, 20px);
|
|
19457
|
+
padding-inline-end: var(--space-xs-ymlm0b, 8px);
|
|
19458
|
+
vertical-align: middle;
|
|
19459
|
+
}
|
|
19460
|
+
|
|
19461
|
+
.table-loading {
|
|
19462
|
+
display: flex;
|
|
19463
|
+
align-items: center;
|
|
19464
|
+
justify-content: center;
|
|
19465
|
+
gap: var(--space-xs-ymlm0b, 8px);
|
|
19466
|
+
padding-block: var(--space-scaled-l-sej05l, 20px);
|
|
19467
|
+
padding-inline: var(--space-l-2ud1p3, 20px);
|
|
19468
|
+
color: var(--color-text-body-secondary-vxiqkp, #656871);
|
|
19469
|
+
}
|
|
19470
|
+
|
|
19471
|
+
.table-empty {
|
|
19472
|
+
padding-block-start: var(--space-scaled-m-m892r9, 16px);
|
|
19473
|
+
padding-block-end: var(--space-scaled-l-sej05l, 20px);
|
|
19474
|
+
padding-inline: var(--space-l-2ud1p3, 20px);
|
|
19475
|
+
text-align: center;
|
|
19476
|
+
}
|
|
19477
|
+
|
|
19478
|
+
.content-density-compact .header-cell {
|
|
19479
|
+
padding-block: var(--space-scaled-xxs-95dhkm, 4px);
|
|
19480
|
+
}
|
|
19481
|
+
.content-density-compact .body-cell {
|
|
19482
|
+
padding-block: var(--space-scaled-xxs-95dhkm, 4px);
|
|
19483
|
+
}
|
|
19484
|
+
|
|
19485
|
+
input[type="radio"] {
|
|
19486
|
+
cursor: pointer;
|
|
19487
|
+
margin: 0;
|
|
19488
|
+
inline-size: 16px;
|
|
19489
|
+
block-size: 16px;
|
|
19490
|
+
accent-color: var(--color-border-control-checked-hzwbsk, #006ce0);
|
|
19491
|
+
}
|
|
19492
|
+
|
|
19493
|
+
.screenreader-only {
|
|
19494
|
+
position: absolute;
|
|
19495
|
+
inline-size: 1px;
|
|
19496
|
+
block-size: 1px;
|
|
19497
|
+
padding: 0;
|
|
19498
|
+
margin: -1px;
|
|
19499
|
+
overflow: hidden;
|
|
19500
|
+
clip: rect(0, 0, 0, 0);
|
|
19501
|
+
white-space: nowrap;
|
|
19502
|
+
border: 0;
|
|
19503
|
+
}
|
|
19504
|
+
`;
|
|
19505
|
+
var CsTableInternal = class extends CsBaseElement {
|
|
19506
|
+
constructor() {
|
|
19507
|
+
super(...arguments);
|
|
19508
|
+
this.items = [];
|
|
19509
|
+
this.columnDefinitions = [];
|
|
19510
|
+
this.sortingDescending = false;
|
|
19511
|
+
this.sortingDisabled = false;
|
|
19512
|
+
this.selectedItems = [];
|
|
19513
|
+
this.loading = false;
|
|
19514
|
+
this.loadingText = "";
|
|
19515
|
+
this.variant = "container";
|
|
19516
|
+
this.stripedRows = false;
|
|
19517
|
+
this.wrapLines = false;
|
|
19518
|
+
this.stickyHeader = false;
|
|
19519
|
+
this.contentDensity = "comfortable";
|
|
19520
|
+
this._hasHeader = false;
|
|
19521
|
+
this._hasFilter = false;
|
|
19522
|
+
this._hasPagination = false;
|
|
19523
|
+
this._onHeaderSlotChange = (e) => {
|
|
19524
|
+
const slot = e.target;
|
|
19525
|
+
this._hasHeader = slot.assignedNodes({ flatten: true }).length > 0;
|
|
19526
|
+
this.requestUpdate();
|
|
19527
|
+
};
|
|
19528
|
+
this._onFilterSlotChange = (e) => {
|
|
19529
|
+
const slot = e.target;
|
|
19530
|
+
this._hasFilter = slot.assignedNodes({ flatten: true }).length > 0;
|
|
19531
|
+
this.requestUpdate();
|
|
19532
|
+
};
|
|
19533
|
+
this._onPaginationSlotChange = (e) => {
|
|
19534
|
+
const slot = e.target;
|
|
19535
|
+
this._hasPagination = slot.assignedNodes({ flatten: true }).length > 0;
|
|
19536
|
+
this.requestUpdate();
|
|
19537
|
+
};
|
|
19538
|
+
/** Stops selection-cell clicks from triggering the row click handler. */
|
|
19539
|
+
this._onSelectionCellClick = (e) => {
|
|
19540
|
+
e.stopPropagation();
|
|
19541
|
+
};
|
|
19542
|
+
}
|
|
19543
|
+
static {
|
|
19544
|
+
this.styles = [sharedStyles, componentStyles52, hostStyles53, tableElementStyles];
|
|
19545
|
+
}
|
|
19546
|
+
get _hasSelection() {
|
|
19547
|
+
return this.selectionType === "single" || this.selectionType === "multi";
|
|
19548
|
+
}
|
|
19549
|
+
get _hasTools() {
|
|
19550
|
+
return this._hasFilter || this._hasPagination;
|
|
19551
|
+
}
|
|
19552
|
+
get _allSelected() {
|
|
19553
|
+
if (!this.items.length) return false;
|
|
19554
|
+
return this.items.every((item) => this._isSelected(item));
|
|
19555
|
+
}
|
|
19556
|
+
get _someSelected() {
|
|
19557
|
+
if (!this.items.length) return false;
|
|
19558
|
+
const count = this.items.filter((item) => this._isSelected(item)).length;
|
|
19559
|
+
return count > 0 && count < this.items.length;
|
|
19560
|
+
}
|
|
19561
|
+
_getItemKey(item) {
|
|
19562
|
+
if (!this.trackBy) return "";
|
|
19563
|
+
if (typeof this.trackBy === "function") return this.trackBy(item);
|
|
19564
|
+
return String(item[this.trackBy]);
|
|
19565
|
+
}
|
|
19566
|
+
_isSelected(item) {
|
|
19567
|
+
if (!this.selectedItems?.length) return false;
|
|
19568
|
+
if (this.trackBy) {
|
|
19569
|
+
const key = this._getItemKey(item);
|
|
19570
|
+
return this.selectedItems.some((s) => this._getItemKey(s) === key);
|
|
19571
|
+
}
|
|
19572
|
+
return this.selectedItems.includes(item);
|
|
19573
|
+
}
|
|
19574
|
+
_isSameColumn(a, b) {
|
|
19575
|
+
if (a.sortingComparator && b.sortingComparator) {
|
|
19576
|
+
return a.sortingComparator === b.sortingComparator;
|
|
19577
|
+
}
|
|
19578
|
+
return !!a.sortingField && a.sortingField === b.sortingField;
|
|
19579
|
+
}
|
|
19580
|
+
_getAriaSort(col) {
|
|
19581
|
+
const isSortable = !!(col.sortingField || col.sortingComparator);
|
|
19582
|
+
if (!isSortable) return nothing28;
|
|
19583
|
+
if (!this.sortingColumn) return "none";
|
|
19584
|
+
if (!this._isSameColumn(col, this.sortingColumn)) return "none";
|
|
19585
|
+
return this.sortingDescending ? "descending" : "ascending";
|
|
19586
|
+
}
|
|
19587
|
+
_onSort(col) {
|
|
19588
|
+
if (!col.sortingField && !col.sortingComparator) return;
|
|
19589
|
+
if (this.sortingDisabled) return;
|
|
19590
|
+
const isSame = this.sortingColumn && this._isSameColumn(col, this.sortingColumn);
|
|
19591
|
+
const isDescending = isSame ? !this.sortingDescending : false;
|
|
19592
|
+
fireNonCancelableEvent(this, "sortingChange", {
|
|
19593
|
+
sortingColumn: { sortingField: col.sortingField, sortingComparator: col.sortingComparator },
|
|
19594
|
+
isDescending
|
|
19595
|
+
});
|
|
19596
|
+
}
|
|
19597
|
+
_toggleSelection(item) {
|
|
19598
|
+
const selected = this.selectedItems ? [...this.selectedItems] : [];
|
|
19599
|
+
const idx = this.trackBy ? selected.findIndex((s) => this._getItemKey(s) === this._getItemKey(item)) : selected.indexOf(item);
|
|
19600
|
+
if (idx >= 0) {
|
|
19601
|
+
selected.splice(idx, 1);
|
|
19602
|
+
} else {
|
|
19603
|
+
selected.push(item);
|
|
19604
|
+
}
|
|
19605
|
+
fireNonCancelableEvent(this, "selectionChange", { selectedItems: selected });
|
|
19606
|
+
}
|
|
19607
|
+
_selectSingle(item) {
|
|
19608
|
+
fireNonCancelableEvent(this, "selectionChange", { selectedItems: [item] });
|
|
19609
|
+
}
|
|
19610
|
+
_toggleAll() {
|
|
19611
|
+
const selectedItems = this._allSelected ? [] : [...this.items];
|
|
19612
|
+
fireNonCancelableEvent(this, "selectionChange", { selectedItems });
|
|
19613
|
+
}
|
|
19614
|
+
_onRowClick(item, rowIndex) {
|
|
19615
|
+
fireNonCancelableEvent(this, "rowClick", { item, rowIndex });
|
|
19616
|
+
}
|
|
19617
|
+
render() {
|
|
19618
|
+
const rootClasses = {
|
|
19619
|
+
"root": true,
|
|
19620
|
+
[`content-density-${this.contentDensity}`]: true
|
|
19621
|
+
};
|
|
19622
|
+
const headerSecondaryClasses = {
|
|
19623
|
+
"header-secondary": true,
|
|
19624
|
+
[`variant-${this.variant}`]: true,
|
|
19625
|
+
"table-has-header": this._hasHeader
|
|
19626
|
+
};
|
|
19627
|
+
const headerControlsClasses = {
|
|
19628
|
+
"header-controls": true,
|
|
19629
|
+
[`variant-${this.variant}`]: true
|
|
19630
|
+
};
|
|
19631
|
+
return html54`
|
|
19632
|
+
<div class=${classMap44(rootClasses)}>
|
|
19633
|
+
<div class=${classMap44(headerSecondaryClasses)} style=${this._hasHeader || this._hasTools ? nothing28 : "display:none"}>
|
|
19634
|
+
<div class=${classMap44(headerControlsClasses)}>
|
|
19635
|
+
<slot name="header" @slotchange=${this._onHeaderSlotChange}></slot>
|
|
19636
|
+
${this._hasTools ? html54`
|
|
19637
|
+
<div class="tools">
|
|
19638
|
+
<div class="tools-filtering">
|
|
19639
|
+
<slot name="filter" @slotchange=${this._onFilterSlotChange}></slot>
|
|
19640
|
+
</div>
|
|
19641
|
+
<div class="tools-align-right">
|
|
19642
|
+
<div class="tools-pagination">
|
|
19643
|
+
<slot name="pagination" @slotchange=${this._onPaginationSlotChange}></slot>
|
|
19644
|
+
</div>
|
|
19645
|
+
</div>
|
|
19646
|
+
</div>
|
|
19647
|
+
` : html54`
|
|
19648
|
+
<slot name="filter" @slotchange=${this._onFilterSlotChange} style="display:none"></slot>
|
|
19649
|
+
<slot name="pagination" @slotchange=${this._onPaginationSlotChange} style="display:none"></slot>
|
|
19650
|
+
`}
|
|
19651
|
+
</div>
|
|
19652
|
+
</div>
|
|
19653
|
+
${this.loading ? this._renderLoading() : this.items.length === 0 ? this._renderEmpty() : this._renderTable()}
|
|
19654
|
+
</div>
|
|
19655
|
+
`;
|
|
19656
|
+
}
|
|
19657
|
+
_renderLoading() {
|
|
19658
|
+
return html54`
|
|
19659
|
+
<div class="table-loading" role="status">
|
|
19660
|
+
<cs-spinner size="normal"></cs-spinner>
|
|
19661
|
+
${this.loadingText ? html54`<span>${this.loadingText}</span>` : nothing28}
|
|
19662
|
+
</div>
|
|
19663
|
+
`;
|
|
19664
|
+
}
|
|
19665
|
+
_renderEmpty() {
|
|
19666
|
+
return html54`
|
|
19667
|
+
<div class="table-empty empty">
|
|
19668
|
+
<slot name="empty"></slot>
|
|
19669
|
+
</div>
|
|
19670
|
+
`;
|
|
19671
|
+
}
|
|
19672
|
+
_renderTable() {
|
|
19673
|
+
const wrapperClasses = {
|
|
19674
|
+
"wrapper": true,
|
|
19675
|
+
[`variant-${this.variant}`]: true
|
|
19676
|
+
};
|
|
19677
|
+
return html54`
|
|
19678
|
+
<div class=${classMap44(wrapperClasses)}>
|
|
19679
|
+
<table class="table" role="table">
|
|
19680
|
+
<thead>
|
|
19681
|
+
<tr>
|
|
19682
|
+
${this._hasSelection ? this._renderSelectionHeader() : nothing28}
|
|
19683
|
+
${this.columnDefinitions.map((col) => this._renderHeaderCell(col))}
|
|
19684
|
+
</tr>
|
|
19685
|
+
</thead>
|
|
19686
|
+
<tbody>
|
|
19687
|
+
${this.items.map((item, i) => this._renderRow(item, i))}
|
|
19688
|
+
</tbody>
|
|
19689
|
+
</table>
|
|
19690
|
+
</div>
|
|
19691
|
+
`;
|
|
19692
|
+
}
|
|
19693
|
+
_renderSelectionHeader() {
|
|
19694
|
+
const label = this.ariaLabels?.selectionGroupLabel || "Selection";
|
|
19695
|
+
return html54`
|
|
19696
|
+
<th class="header-cell selection-cell" aria-label=${label} @click=${this._onSelectionCellClick}>
|
|
19697
|
+
${this.selectionType === "multi" ? html54`
|
|
19698
|
+
<cs-checkbox
|
|
19699
|
+
.checked=${this._allSelected}
|
|
19700
|
+
.indeterminate=${this._someSelected}
|
|
19701
|
+
@change=${(e) => {
|
|
19702
|
+
e.stopPropagation();
|
|
19703
|
+
this._toggleAll();
|
|
19704
|
+
}}
|
|
19705
|
+
aria-label=${label}
|
|
19706
|
+
></cs-checkbox>` : html54`<span class="screenreader-only">${label}</span>`}
|
|
19707
|
+
</th>
|
|
19708
|
+
`;
|
|
19709
|
+
}
|
|
19710
|
+
_renderHeaderCell(col) {
|
|
19711
|
+
const isSortable = !!(col.sortingField || col.sortingComparator);
|
|
19712
|
+
const isSorted = isSortable && this.sortingColumn && this._isSameColumn(col, this.sortingColumn);
|
|
19713
|
+
const ariaSort = this._getAriaSort(col);
|
|
19714
|
+
const cellClasses = {
|
|
19715
|
+
"header-cell": true,
|
|
19716
|
+
"header-cell-sortable": isSortable,
|
|
19717
|
+
"header-cell-sorted": !!isSorted
|
|
19718
|
+
};
|
|
19719
|
+
const iconClasses = {
|
|
19720
|
+
"sorting-icon": true,
|
|
19721
|
+
"sorting-icon-ascending": !!isSorted && !this.sortingDescending
|
|
19722
|
+
};
|
|
19723
|
+
const widthStyle = col.width ? `width: ${typeof col.width === "number" ? `${col.width}px` : col.width}` : void 0;
|
|
19724
|
+
return html54`
|
|
19725
|
+
<th
|
|
19726
|
+
class=${classMap44(cellClasses)}
|
|
19727
|
+
aria-sort=${ariaSort}
|
|
19728
|
+
style=${widthStyle ?? nothing28}
|
|
19729
|
+
@click=${() => this._onSort(col)}
|
|
19730
|
+
>
|
|
19731
|
+
<span class="header-cell-text">${col.header}</span>
|
|
19732
|
+
${isSortable ? html54`<span class=${classMap44(iconClasses)}><cs-icon name="caret-down-filled" size="small"></cs-icon></span>` : nothing28}
|
|
19733
|
+
</th>
|
|
19734
|
+
`;
|
|
19735
|
+
}
|
|
19736
|
+
_renderRow(item, index) {
|
|
19737
|
+
const selected = this._isSelected(item);
|
|
19738
|
+
const rowClasses = {
|
|
19739
|
+
"row": true,
|
|
19740
|
+
"row-selected": selected,
|
|
19741
|
+
"row-striped": this.stripedRows && index % 2 === 1
|
|
19742
|
+
};
|
|
19743
|
+
return html54`
|
|
19744
|
+
<tr class=${classMap44(rowClasses)} @click=${() => this._onRowClick(item, index)}>
|
|
19745
|
+
${this._hasSelection ? this._renderSelectionCell(item) : nothing28}
|
|
19746
|
+
${this.columnDefinitions.map((col) => this._renderBodyCell(item, col))}
|
|
19747
|
+
</tr>
|
|
19748
|
+
`;
|
|
19749
|
+
}
|
|
19750
|
+
_renderSelectionCell(item) {
|
|
19751
|
+
const selected = this._isSelected(item);
|
|
19752
|
+
return html54`
|
|
19753
|
+
<td class="body-cell selection-cell" @click=${this._onSelectionCellClick}>
|
|
19754
|
+
${this.selectionType === "multi" ? html54`
|
|
19755
|
+
<cs-checkbox
|
|
19756
|
+
.checked=${selected}
|
|
19757
|
+
@change=${(e) => {
|
|
19758
|
+
e.stopPropagation();
|
|
19759
|
+
this._toggleSelection(item);
|
|
19760
|
+
}}
|
|
19761
|
+
aria-label="Select row"
|
|
19762
|
+
></cs-checkbox>` : html54`
|
|
19763
|
+
<input
|
|
19764
|
+
type="radio"
|
|
19765
|
+
name="table-selection"
|
|
19766
|
+
.checked=${selected}
|
|
19767
|
+
@change=${() => this._selectSingle(item)}
|
|
19768
|
+
aria-label="Select row"
|
|
19769
|
+
/>`}
|
|
19770
|
+
</td>
|
|
19771
|
+
`;
|
|
19772
|
+
}
|
|
19773
|
+
_renderBodyCell(item, col) {
|
|
19774
|
+
const cellClasses = {
|
|
19775
|
+
"body-cell": true,
|
|
19776
|
+
"body-cell-wrap": this.wrapLines
|
|
19777
|
+
};
|
|
19778
|
+
const widthStyle = col.width ? `width: ${typeof col.width === "number" ? `${col.width}px` : col.width}` : void 0;
|
|
19779
|
+
return html54`
|
|
19780
|
+
<td class=${classMap44(cellClasses)} style=${widthStyle ?? nothing28}>
|
|
19781
|
+
${col.cell(item)}
|
|
19782
|
+
</td>
|
|
19783
|
+
`;
|
|
19784
|
+
}
|
|
19785
|
+
};
|
|
19786
|
+
__decorateClass([
|
|
19787
|
+
property53({ attribute: false })
|
|
19788
|
+
], CsTableInternal.prototype, "items", 2);
|
|
19789
|
+
__decorateClass([
|
|
19790
|
+
property53({ attribute: false })
|
|
19791
|
+
], CsTableInternal.prototype, "columnDefinitions", 2);
|
|
19792
|
+
__decorateClass([
|
|
19793
|
+
property53({ attribute: false })
|
|
19794
|
+
], CsTableInternal.prototype, "sortingColumn", 2);
|
|
19795
|
+
__decorateClass([
|
|
19796
|
+
property53({ type: Boolean })
|
|
19797
|
+
], CsTableInternal.prototype, "sortingDescending", 2);
|
|
19798
|
+
__decorateClass([
|
|
19799
|
+
property53({ type: Boolean })
|
|
19800
|
+
], CsTableInternal.prototype, "sortingDisabled", 2);
|
|
19801
|
+
__decorateClass([
|
|
19802
|
+
property53({ attribute: false })
|
|
19803
|
+
], CsTableInternal.prototype, "selectedItems", 2);
|
|
19804
|
+
__decorateClass([
|
|
19805
|
+
property53({ type: String })
|
|
19806
|
+
], CsTableInternal.prototype, "selectionType", 2);
|
|
19807
|
+
__decorateClass([
|
|
19808
|
+
property53({ attribute: false })
|
|
19809
|
+
], CsTableInternal.prototype, "trackBy", 2);
|
|
19810
|
+
__decorateClass([
|
|
19811
|
+
property53({ type: Boolean, reflect: true })
|
|
19812
|
+
], CsTableInternal.prototype, "loading", 2);
|
|
19813
|
+
__decorateClass([
|
|
19814
|
+
property53({ type: String })
|
|
19815
|
+
], CsTableInternal.prototype, "loadingText", 2);
|
|
19816
|
+
__decorateClass([
|
|
19817
|
+
property53({ type: String, reflect: true })
|
|
19818
|
+
], CsTableInternal.prototype, "variant", 2);
|
|
19819
|
+
__decorateClass([
|
|
19820
|
+
property53({ type: Boolean })
|
|
19821
|
+
], CsTableInternal.prototype, "stripedRows", 2);
|
|
19822
|
+
__decorateClass([
|
|
19823
|
+
property53({ type: Boolean })
|
|
19824
|
+
], CsTableInternal.prototype, "wrapLines", 2);
|
|
19825
|
+
__decorateClass([
|
|
19826
|
+
property53({ type: Boolean })
|
|
19827
|
+
], CsTableInternal.prototype, "stickyHeader", 2);
|
|
19828
|
+
__decorateClass([
|
|
19829
|
+
property53({ type: String })
|
|
19830
|
+
], CsTableInternal.prototype, "contentDensity", 2);
|
|
19831
|
+
__decorateClass([
|
|
19832
|
+
property53({ attribute: false })
|
|
19833
|
+
], CsTableInternal.prototype, "ariaLabels", 2);
|
|
19834
|
+
|
|
19835
|
+
// src/table/index.ts
|
|
19836
|
+
var CsTable = class extends CsTableInternal {
|
|
19837
|
+
};
|
|
19838
|
+
customElements.define("cs-table", CsTable);
|
|
17379
19839
|
export {
|
|
17380
19840
|
CsAlert,
|
|
17381
19841
|
CsAnchorNavigation,
|
|
@@ -17386,7 +19846,9 @@ export {
|
|
|
17386
19846
|
CsButton,
|
|
17387
19847
|
CsButtonDropdown,
|
|
17388
19848
|
CsButtonGroup,
|
|
19849
|
+
CsCards,
|
|
17389
19850
|
CsCheckbox,
|
|
19851
|
+
CsCollectionPreferences,
|
|
17390
19852
|
CsColumnLayout,
|
|
17391
19853
|
CsContainer,
|
|
17392
19854
|
CsContentLayout,
|
|
@@ -17401,13 +19863,16 @@ export {
|
|
|
17401
19863
|
CsHeader,
|
|
17402
19864
|
CsIcon,
|
|
17403
19865
|
CsIconProvider,
|
|
19866
|
+
CsKeyValuePairs,
|
|
17404
19867
|
CsLink,
|
|
17405
19868
|
CsList,
|
|
17406
19869
|
CsLiveRegion,
|
|
17407
19870
|
CsMultiselect,
|
|
17408
19871
|
CsPagination,
|
|
17409
19872
|
CsPopover,
|
|
19873
|
+
CsProgressBar,
|
|
17410
19874
|
CsPromptInput,
|
|
19875
|
+
CsPropertyFilter,
|
|
17411
19876
|
CsRadioGroup,
|
|
17412
19877
|
CsSegmentedControl,
|
|
17413
19878
|
CsSelect,
|
|
@@ -17415,6 +19880,8 @@ export {
|
|
|
17415
19880
|
CsSpaceBetween,
|
|
17416
19881
|
CsSpinner,
|
|
17417
19882
|
CsStatusIndicator,
|
|
19883
|
+
CsSteps,
|
|
19884
|
+
CsTable,
|
|
17418
19885
|
CsTabs,
|
|
17419
19886
|
CsTextContent,
|
|
17420
19887
|
CsTiles,
|