@ni/nimble-components 18.10.3 → 18.10.5
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/all-components-bundle.js +996 -192
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +3280 -3087
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/cell/index.d.ts +1 -0
- package/dist/esm/table/components/cell/index.js +4 -0
- package/dist/esm/table/components/cell/index.js.map +1 -1
- package/dist/esm/table/components/cell/styles.js +8 -0
- package/dist/esm/table/components/cell/styles.js.map +1 -1
- package/dist/esm/table/components/cell/template.js +1 -1
- package/dist/esm/table/components/cell/template.js.map +1 -1
- package/dist/esm/table/components/group-row/index.d.ts +29 -0
- package/dist/esm/table/components/group-row/index.js +61 -0
- package/dist/esm/table/components/group-row/index.js.map +1 -0
- package/dist/esm/table/components/group-row/styles.d.ts +1 -0
- package/dist/esm/table/components/group-row/styles.js +64 -0
- package/dist/esm/table/components/group-row/styles.js.map +1 -0
- package/dist/esm/table/components/group-row/template.d.ts +2 -0
- package/dist/esm/table/components/group-row/template.js +23 -0
- package/dist/esm/table/components/group-row/template.js.map +1 -0
- package/dist/esm/table/components/row/index.d.ts +5 -0
- package/dist/esm/table/components/row/index.js +30 -5
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/components/row/styles.js +4 -0
- package/dist/esm/table/components/row/styles.js.map +1 -1
- package/dist/esm/table/components/row/template.js +2 -1
- package/dist/esm/table/components/row/template.js.map +1 -1
- package/dist/esm/table/index.d.ts +31 -3
- package/dist/esm/table/index.js +223 -22
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/table-validator.d.ts +9 -1
- package/dist/esm/table/models/table-validator.js +37 -12
- package/dist/esm/table/models/table-validator.js.map +1 -1
- package/dist/esm/table/models/update-tracker.d.ts +4 -0
- package/dist/esm/table/models/update-tracker.js +23 -2
- package/dist/esm/table/models/update-tracker.js.map +1 -1
- package/dist/esm/table/models/virtualizer.d.ts +3 -1
- package/dist/esm/table/models/virtualizer.js +3 -2
- package/dist/esm/table/models/virtualizer.js.map +1 -1
- package/dist/esm/table/styles.js +19 -3
- package/dist/esm/table/styles.js.map +1 -1
- package/dist/esm/table/template.js +38 -19
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table/types.d.ts +26 -0
- package/dist/esm/table/types.js +16 -0
- package/dist/esm/table/types.js.map +1 -1
- package/dist/esm/table-column/base/group-header-view/index.d.ts +14 -0
- package/dist/esm/table-column/base/group-header-view/index.js +17 -0
- package/dist/esm/table-column/base/group-header-view/index.js.map +1 -0
- package/dist/esm/table-column/base/group-header-view/template.d.ts +3 -0
- package/dist/esm/table-column/base/group-header-view/template.js +10 -0
- package/dist/esm/table-column/base/group-header-view/template.js.map +1 -0
- package/dist/esm/table-column/base/index.d.ts +25 -0
- package/dist/esm/table-column/base/index.js +23 -0
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/table-column/mixins/groupable-column.d.ts +12 -0
- package/dist/esm/table-column/mixins/groupable-column.js +35 -0
- package/dist/esm/table-column/mixins/groupable-column.js.map +1 -0
- package/dist/esm/table-column/text/group-header-view/index.d.ts +22 -0
- package/dist/esm/table-column/text/group-header-view/index.js +47 -0
- package/dist/esm/table-column/text/group-header-view/index.js.map +1 -0
- package/dist/esm/table-column/text/group-header-view/styles.d.ts +1 -0
- package/dist/esm/table-column/text/group-header-view/styles.js +16 -0
- package/dist/esm/table-column/text/group-header-view/styles.js.map +1 -0
- package/dist/esm/table-column/text/group-header-view/template.d.ts +2 -0
- package/dist/esm/table-column/text/group-header-view/template.js +15 -0
- package/dist/esm/table-column/text/group-header-view/template.js.map +1 -0
- package/dist/esm/table-column/text/index.d.ts +9 -1
- package/dist/esm/table-column/text/index.js +7 -1
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/dist/esm/tree-item/styles.js +2 -2
- package/dist/esm/tree-item/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -16744,9 +16744,9 @@
|
|
|
16744
16744
|
return `${prefix}${uniqueIdCounter++}`;
|
|
16745
16745
|
}
|
|
16746
16746
|
|
|
16747
|
-
const template$
|
|
16747
|
+
const template$q = html `<slot></slot>`;
|
|
16748
16748
|
|
|
16749
|
-
const styles$
|
|
16749
|
+
const styles$O = css `
|
|
16750
16750
|
:host {
|
|
16751
16751
|
display: contents;
|
|
16752
16752
|
}
|
|
@@ -16802,8 +16802,8 @@
|
|
|
16802
16802
|
], ThemeProvider.prototype, "theme", void 0);
|
|
16803
16803
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
16804
16804
|
baseName: 'theme-provider',
|
|
16805
|
-
styles: styles$
|
|
16806
|
-
template: template$
|
|
16805
|
+
styles: styles$O,
|
|
16806
|
+
template: template$q
|
|
16807
16807
|
});
|
|
16808
16808
|
DesignSystem.getOrCreate()
|
|
16809
16809
|
.withPrefix('nimble')
|
|
@@ -16895,7 +16895,7 @@
|
|
|
16895
16895
|
const groupHeaderTextTransform = DesignToken.create(styleNameFromTokenName(tokenNames.groupHeaderTextTransform)).withDefault('uppercase');
|
|
16896
16896
|
// Animation Tokens
|
|
16897
16897
|
const smallDelay = DesignToken.create(styleNameFromTokenName(tokenNames.smallDelay)).withDefault(SmallDelay);
|
|
16898
|
-
DesignToken.create(styleNameFromTokenName(tokenNames.mediumDelay)).withDefault(MediumDelay);
|
|
16898
|
+
const mediumDelay = DesignToken.create(styleNameFromTokenName(tokenNames.mediumDelay)).withDefault(MediumDelay);
|
|
16899
16899
|
const largeDelay = DesignToken.create(styleNameFromTokenName(tokenNames.largeDelay)).withDefault(LargeDelay);
|
|
16900
16900
|
// Private helpers functions
|
|
16901
16901
|
function hexToRgbPartial(hexValue) {
|
|
@@ -16987,7 +16987,7 @@
|
|
|
16987
16987
|
}
|
|
16988
16988
|
}
|
|
16989
16989
|
|
|
16990
|
-
const styles$
|
|
16990
|
+
const styles$N = css `
|
|
16991
16991
|
${display('inline')}
|
|
16992
16992
|
|
|
16993
16993
|
:host {
|
|
@@ -17070,7 +17070,7 @@
|
|
|
17070
17070
|
`;
|
|
17071
17071
|
|
|
17072
17072
|
// prettier-ignore
|
|
17073
|
-
const template$
|
|
17073
|
+
const template$p = (context, definition) => html `
|
|
17074
17074
|
<a
|
|
17075
17075
|
class="control"
|
|
17076
17076
|
part="control"
|
|
@@ -17144,8 +17144,8 @@
|
|
|
17144
17144
|
const nimbleAnchor = Anchor.compose({
|
|
17145
17145
|
baseName: 'anchor',
|
|
17146
17146
|
baseClass: Anchor$1,
|
|
17147
|
-
template: template$
|
|
17148
|
-
styles: styles$
|
|
17147
|
+
template: template$p,
|
|
17148
|
+
styles: styles$N,
|
|
17149
17149
|
shadowOptions: {
|
|
17150
17150
|
delegatesFocus: true
|
|
17151
17151
|
}
|
|
@@ -17231,7 +17231,7 @@
|
|
|
17231
17231
|
return new MultivaluePropertyStyleSheetBehavior('appearance', value, styles);
|
|
17232
17232
|
}
|
|
17233
17233
|
|
|
17234
|
-
const styles$
|
|
17234
|
+
const styles$M = css `
|
|
17235
17235
|
${display('inline-flex')}
|
|
17236
17236
|
|
|
17237
17237
|
:host {
|
|
@@ -17512,8 +17512,8 @@
|
|
|
17512
17512
|
}
|
|
17513
17513
|
`));
|
|
17514
17514
|
|
|
17515
|
-
const styles$
|
|
17516
|
-
${styles$
|
|
17515
|
+
const styles$L = css `
|
|
17516
|
+
${styles$M}
|
|
17517
17517
|
${buttonAppearanceVariantStyles}
|
|
17518
17518
|
|
|
17519
17519
|
.control {
|
|
@@ -17521,7 +17521,7 @@
|
|
|
17521
17521
|
}
|
|
17522
17522
|
`;
|
|
17523
17523
|
|
|
17524
|
-
const template$
|
|
17524
|
+
const template$o = (context, definition) => html `
|
|
17525
17525
|
<a
|
|
17526
17526
|
class="control"
|
|
17527
17527
|
part="control"
|
|
@@ -17603,8 +17603,8 @@
|
|
|
17603
17603
|
], AnchorButton.prototype, "disabled", void 0);
|
|
17604
17604
|
const nimbleAnchorButton = AnchorButton.compose({
|
|
17605
17605
|
baseName: 'anchor-button',
|
|
17606
|
-
template: template$
|
|
17607
|
-
styles: styles$
|
|
17606
|
+
template: template$o,
|
|
17607
|
+
styles: styles$L,
|
|
17608
17608
|
shadowOptions: {
|
|
17609
17609
|
delegatesFocus: true
|
|
17610
17610
|
}
|
|
@@ -17612,7 +17612,7 @@
|
|
|
17612
17612
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorButton());
|
|
17613
17613
|
DesignSystem.tagFor(AnchorButton);
|
|
17614
17614
|
|
|
17615
|
-
const styles$
|
|
17615
|
+
const styles$K = css `
|
|
17616
17616
|
${display('grid')}
|
|
17617
17617
|
|
|
17618
17618
|
:host {
|
|
@@ -17689,7 +17689,7 @@
|
|
|
17689
17689
|
}
|
|
17690
17690
|
`;
|
|
17691
17691
|
|
|
17692
|
-
const template$
|
|
17692
|
+
const template$n = (context, definition) => html `
|
|
17693
17693
|
<template
|
|
17694
17694
|
role="menuitem"
|
|
17695
17695
|
class="${x => (typeof x.startColumnCount === 'number'
|
|
@@ -17795,8 +17795,8 @@
|
|
|
17795
17795
|
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
17796
17796
|
const nimbleAnchorMenuItem = AnchorMenuItem.compose({
|
|
17797
17797
|
baseName: 'anchor-menu-item',
|
|
17798
|
-
template: template$
|
|
17799
|
-
styles: styles$
|
|
17798
|
+
template: template$n,
|
|
17799
|
+
styles: styles$K,
|
|
17800
17800
|
shadowOptions: {
|
|
17801
17801
|
delegatesFocus: true
|
|
17802
17802
|
}
|
|
@@ -17820,7 +17820,7 @@
|
|
|
17820
17820
|
}
|
|
17821
17821
|
});
|
|
17822
17822
|
|
|
17823
|
-
const styles$
|
|
17823
|
+
const styles$J = css `
|
|
17824
17824
|
${display('inline-flex')}
|
|
17825
17825
|
|
|
17826
17826
|
:host {
|
|
@@ -17926,8 +17926,8 @@
|
|
|
17926
17926
|
}
|
|
17927
17927
|
`;
|
|
17928
17928
|
|
|
17929
|
-
const styles$
|
|
17930
|
-
${styles$
|
|
17929
|
+
const styles$I = css `
|
|
17930
|
+
${styles$J}
|
|
17931
17931
|
|
|
17932
17932
|
a {
|
|
17933
17933
|
text-decoration: none;
|
|
@@ -17945,7 +17945,7 @@
|
|
|
17945
17945
|
}
|
|
17946
17946
|
`;
|
|
17947
17947
|
|
|
17948
|
-
const template$
|
|
17948
|
+
const template$m = (context, definition) => html `
|
|
17949
17949
|
<template slot="anchortab" role="tab" aria-disabled="${x => x.disabled}">
|
|
17950
17950
|
<a
|
|
17951
17951
|
download="${x => x.download}"
|
|
@@ -17998,13 +17998,13 @@
|
|
|
17998
17998
|
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
17999
17999
|
const nimbleAnchorTab = AnchorTab.compose({
|
|
18000
18000
|
baseName: 'anchor-tab',
|
|
18001
|
-
template: template$
|
|
18002
|
-
styles: styles$
|
|
18001
|
+
template: template$m,
|
|
18002
|
+
styles: styles$I
|
|
18003
18003
|
});
|
|
18004
18004
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
|
|
18005
18005
|
DesignSystem.tagFor(AnchorTab);
|
|
18006
18006
|
|
|
18007
|
-
const styles$
|
|
18007
|
+
const styles$H = css `
|
|
18008
18008
|
${display('grid')}
|
|
18009
18009
|
|
|
18010
18010
|
:host {
|
|
@@ -18022,7 +18022,7 @@
|
|
|
18022
18022
|
}
|
|
18023
18023
|
`;
|
|
18024
18024
|
|
|
18025
|
-
const template$
|
|
18025
|
+
const template$l = (context, definition) => html `
|
|
18026
18026
|
${startSlotTemplate(context, definition)}
|
|
18027
18027
|
<div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
|
|
18028
18028
|
<slot name="anchortab" ${slotted('tabs')}></slot>
|
|
@@ -18219,8 +18219,8 @@
|
|
|
18219
18219
|
applyMixins(AnchorTabs, StartEnd);
|
|
18220
18220
|
const nimbleAnchorTabs = AnchorTabs.compose({
|
|
18221
18221
|
baseName: 'anchor-tabs',
|
|
18222
|
-
template: template$
|
|
18223
|
-
styles: styles$
|
|
18222
|
+
template: template$l,
|
|
18223
|
+
styles: styles$H,
|
|
18224
18224
|
shadowOptions: {
|
|
18225
18225
|
delegatesFocus: false
|
|
18226
18226
|
}
|
|
@@ -18228,7 +18228,7 @@
|
|
|
18228
18228
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTabs());
|
|
18229
18229
|
DesignSystem.tagFor(AnchorTabs);
|
|
18230
18230
|
|
|
18231
|
-
const styles$
|
|
18231
|
+
const styles$G = css `
|
|
18232
18232
|
${display('block')}
|
|
18233
18233
|
|
|
18234
18234
|
:host {
|
|
@@ -18332,7 +18332,7 @@
|
|
|
18332
18332
|
}
|
|
18333
18333
|
`;
|
|
18334
18334
|
|
|
18335
|
-
const template$
|
|
18335
|
+
const template$k = (context, definition) => html `
|
|
18336
18336
|
<template
|
|
18337
18337
|
role="treeitem"
|
|
18338
18338
|
slot="${x => (x.isNestedItem() ? 'item' : null)}"
|
|
@@ -18469,8 +18469,8 @@
|
|
|
18469
18469
|
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
18470
18470
|
const nimbleAnchorTreeItem = AnchorTreeItem.compose({
|
|
18471
18471
|
baseName: 'anchor-tree-item',
|
|
18472
|
-
template: template$
|
|
18473
|
-
styles: styles$
|
|
18472
|
+
template: template$k,
|
|
18473
|
+
styles: styles$G,
|
|
18474
18474
|
shadowOptions: {
|
|
18475
18475
|
delegatesFocus: true
|
|
18476
18476
|
}
|
|
@@ -18480,7 +18480,7 @@
|
|
|
18480
18480
|
.register(nimbleAnchorTreeItem());
|
|
18481
18481
|
DesignSystem.tagFor(AnchorTreeItem);
|
|
18482
18482
|
|
|
18483
|
-
const styles$
|
|
18483
|
+
const styles$F = css `
|
|
18484
18484
|
:host {
|
|
18485
18485
|
contain: layout;
|
|
18486
18486
|
display: block;
|
|
@@ -18504,7 +18504,7 @@
|
|
|
18504
18504
|
baseName: 'anchored-region',
|
|
18505
18505
|
baseClass: AnchoredRegion$1,
|
|
18506
18506
|
template: anchoredRegionTemplate,
|
|
18507
|
-
styles: styles$
|
|
18507
|
+
styles: styles$F
|
|
18508
18508
|
});
|
|
18509
18509
|
DesignSystem.getOrCreate()
|
|
18510
18510
|
.withPrefix('nimble')
|
|
@@ -18584,7 +18584,7 @@
|
|
|
18584
18584
|
*/
|
|
18585
18585
|
const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
|
|
18586
18586
|
|
|
18587
|
-
const styles$
|
|
18587
|
+
const styles$E = css `
|
|
18588
18588
|
${display('flex')}
|
|
18589
18589
|
|
|
18590
18590
|
:host {
|
|
@@ -18742,8 +18742,8 @@
|
|
|
18742
18742
|
}
|
|
18743
18743
|
`));
|
|
18744
18744
|
|
|
18745
|
-
const styles$
|
|
18746
|
-
${styles$
|
|
18745
|
+
const styles$D = css `
|
|
18746
|
+
${styles$M}
|
|
18747
18747
|
${buttonAppearanceVariantStyles}
|
|
18748
18748
|
`;
|
|
18749
18749
|
|
|
@@ -18789,7 +18789,7 @@
|
|
|
18789
18789
|
baseName: 'button',
|
|
18790
18790
|
baseClass: Button$1,
|
|
18791
18791
|
template: buttonTemplate,
|
|
18792
|
-
styles: styles$
|
|
18792
|
+
styles: styles$D,
|
|
18793
18793
|
shadowOptions: {
|
|
18794
18794
|
delegatesFocus: true
|
|
18795
18795
|
}
|
|
@@ -19411,13 +19411,13 @@
|
|
|
19411
19411
|
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M8.033 14.026 4.9 10.866 6.277 9.53l1.744 1.81 4.562-4.507 1.307 1.363Zm1.155-10.68-1.321-1.32-2.312 2.311-2.311-2.311-1.321 1.32 2.311 2.312L1.923 7.97l1.32 1.32 2.312-2.31 2.312 2.31 1.32-1.32-2.31-2.312Z"/></svg>`
|
|
19412
19412
|
};
|
|
19413
19413
|
|
|
19414
|
-
const template$
|
|
19414
|
+
const template$j = html `
|
|
19415
19415
|
<template>
|
|
19416
19416
|
<div class="icon" :innerHTML=${x => x.icon.data}></div>
|
|
19417
19417
|
</template
|
|
19418
19418
|
`;
|
|
19419
19419
|
|
|
19420
|
-
const styles$
|
|
19420
|
+
const styles$C = css `
|
|
19421
19421
|
${display('inline-flex')}
|
|
19422
19422
|
|
|
19423
19423
|
:host {
|
|
@@ -19470,8 +19470,8 @@
|
|
|
19470
19470
|
const registerIcon = (baseName, iconClass) => {
|
|
19471
19471
|
const composedIcon = iconClass.compose({
|
|
19472
19472
|
baseName,
|
|
19473
|
-
template: template$
|
|
19474
|
-
styles: styles$
|
|
19473
|
+
template: template$j,
|
|
19474
|
+
styles: styles$C,
|
|
19475
19475
|
baseClass: iconClass
|
|
19476
19476
|
});
|
|
19477
19477
|
DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
|
|
@@ -19537,7 +19537,7 @@
|
|
|
19537
19537
|
};
|
|
19538
19538
|
|
|
19539
19539
|
// prettier-ignore
|
|
19540
|
-
const template$
|
|
19540
|
+
const template$i = html `
|
|
19541
19541
|
<div class="container"
|
|
19542
19542
|
role="status"
|
|
19543
19543
|
aria-atomic="${x => x.ariaAtomic}"
|
|
@@ -19656,13 +19656,13 @@
|
|
|
19656
19656
|
applyMixins(Banner, ARIAGlobalStatesAndProperties);
|
|
19657
19657
|
const nimbleBanner = Banner.compose({
|
|
19658
19658
|
baseName: 'banner',
|
|
19659
|
-
template: template$
|
|
19660
|
-
styles: styles$
|
|
19659
|
+
template: template$i,
|
|
19660
|
+
styles: styles$E
|
|
19661
19661
|
});
|
|
19662
19662
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
|
|
19663
19663
|
DesignSystem.tagFor(Banner);
|
|
19664
19664
|
|
|
19665
|
-
const styles$
|
|
19665
|
+
const styles$B = css `
|
|
19666
19666
|
${display('inline-block')}
|
|
19667
19667
|
|
|
19668
19668
|
:host {
|
|
@@ -19703,12 +19703,12 @@
|
|
|
19703
19703
|
baseName: 'breadcrumb',
|
|
19704
19704
|
baseClass: Breadcrumb$1,
|
|
19705
19705
|
template: breadcrumbTemplate,
|
|
19706
|
-
styles: styles$
|
|
19706
|
+
styles: styles$B
|
|
19707
19707
|
});
|
|
19708
19708
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBreadcrumb());
|
|
19709
19709
|
DesignSystem.tagFor(Breadcrumb);
|
|
19710
19710
|
|
|
19711
|
-
const styles$
|
|
19711
|
+
const styles$A = css `
|
|
19712
19712
|
${display('inline-flex')}
|
|
19713
19713
|
|
|
19714
19714
|
:host {
|
|
@@ -19784,7 +19784,7 @@
|
|
|
19784
19784
|
baseName: 'breadcrumb-item',
|
|
19785
19785
|
baseClass: BreadcrumbItem$1,
|
|
19786
19786
|
template: breadcrumbItemTemplate,
|
|
19787
|
-
styles: styles$
|
|
19787
|
+
styles: styles$A,
|
|
19788
19788
|
separator: forwardSlash16X16.data
|
|
19789
19789
|
});
|
|
19790
19790
|
DesignSystem.getOrCreate()
|
|
@@ -19792,7 +19792,7 @@
|
|
|
19792
19792
|
.register(nimbleBreadcrumbItem());
|
|
19793
19793
|
DesignSystem.tagFor(BreadcrumbItem);
|
|
19794
19794
|
|
|
19795
|
-
const styles$
|
|
19795
|
+
const styles$z = css `
|
|
19796
19796
|
${display('inline-flex')}
|
|
19797
19797
|
|
|
19798
19798
|
:host {
|
|
@@ -19951,7 +19951,7 @@
|
|
|
19951
19951
|
const nimbleCardButton = CardButton.compose({
|
|
19952
19952
|
baseName: 'card-button',
|
|
19953
19953
|
template: buttonTemplate,
|
|
19954
|
-
styles: styles$
|
|
19954
|
+
styles: styles$z,
|
|
19955
19955
|
shadowOptions: {
|
|
19956
19956
|
delegatesFocus: true
|
|
19957
19957
|
}
|
|
@@ -19959,7 +19959,7 @@
|
|
|
19959
19959
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCardButton());
|
|
19960
19960
|
DesignSystem.tagFor(CardButton);
|
|
19961
19961
|
|
|
19962
|
-
const styles$
|
|
19962
|
+
const styles$y = css `
|
|
19963
19963
|
${display('inline-flex')}
|
|
19964
19964
|
|
|
19965
19965
|
:host {
|
|
@@ -20077,15 +20077,15 @@
|
|
|
20077
20077
|
baseName: 'checkbox',
|
|
20078
20078
|
baseClass: Checkbox$1,
|
|
20079
20079
|
template: checkboxTemplate,
|
|
20080
|
-
styles: styles$
|
|
20080
|
+
styles: styles$y,
|
|
20081
20081
|
checkedIndicator: check16X16.data,
|
|
20082
20082
|
indeterminateIndicator: minus16X16.data
|
|
20083
20083
|
});
|
|
20084
20084
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
|
|
20085
20085
|
DesignSystem.tagFor(Checkbox);
|
|
20086
20086
|
|
|
20087
|
-
const styles$
|
|
20088
|
-
${styles$
|
|
20087
|
+
const styles$x = css `
|
|
20088
|
+
${styles$M}
|
|
20089
20089
|
|
|
20090
20090
|
.control[aria-pressed='true'] {
|
|
20091
20091
|
background-color: ${fillSelectedColor};
|
|
@@ -20111,7 +20111,7 @@
|
|
|
20111
20111
|
}
|
|
20112
20112
|
`;
|
|
20113
20113
|
|
|
20114
|
-
const template$
|
|
20114
|
+
const template$h = (context, definition) => html `
|
|
20115
20115
|
<div
|
|
20116
20116
|
role="button"
|
|
20117
20117
|
part="control"
|
|
@@ -20186,8 +20186,8 @@
|
|
|
20186
20186
|
applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
|
|
20187
20187
|
const nimbleToggleButton = ToggleButton.compose({
|
|
20188
20188
|
baseName: 'toggle-button',
|
|
20189
|
-
template: template$
|
|
20190
|
-
styles: styles$
|
|
20189
|
+
template: template$h,
|
|
20190
|
+
styles: styles$x,
|
|
20191
20191
|
shadowOptions: {
|
|
20192
20192
|
delegatesFocus: true
|
|
20193
20193
|
}
|
|
@@ -20219,7 +20219,7 @@
|
|
|
20219
20219
|
block: 'block'
|
|
20220
20220
|
};
|
|
20221
20221
|
|
|
20222
|
-
const styles$
|
|
20222
|
+
const styles$w = css `
|
|
20223
20223
|
${display('inline-flex')}
|
|
20224
20224
|
|
|
20225
20225
|
:host {
|
|
@@ -20455,7 +20455,7 @@
|
|
|
20455
20455
|
}
|
|
20456
20456
|
`));
|
|
20457
20457
|
|
|
20458
|
-
const styles$
|
|
20458
|
+
const styles$v = css `
|
|
20459
20459
|
.error-icon {
|
|
20460
20460
|
display: none;
|
|
20461
20461
|
}
|
|
@@ -20489,9 +20489,9 @@
|
|
|
20489
20489
|
}
|
|
20490
20490
|
`;
|
|
20491
20491
|
|
|
20492
|
-
const styles$
|
|
20493
|
-
${styles$
|
|
20494
|
-
${styles$
|
|
20492
|
+
const styles$u = css `
|
|
20493
|
+
${styles$w}
|
|
20494
|
+
${styles$v}
|
|
20495
20495
|
|
|
20496
20496
|
:host {
|
|
20497
20497
|
--ni-private-hover-bottom-border-width: 2px;
|
|
@@ -20727,7 +20727,7 @@
|
|
|
20727
20727
|
baseName: 'combobox',
|
|
20728
20728
|
baseClass: Combobox$1,
|
|
20729
20729
|
template: comboboxTemplate,
|
|
20730
|
-
styles: styles$
|
|
20730
|
+
styles: styles$u,
|
|
20731
20731
|
shadowOptions: {
|
|
20732
20732
|
delegatesFocus: true
|
|
20733
20733
|
},
|
|
@@ -20772,7 +20772,7 @@
|
|
|
20772
20772
|
*/
|
|
20773
20773
|
const UserDismissed = Symbol('user dismissed');
|
|
20774
20774
|
|
|
20775
|
-
const styles$
|
|
20775
|
+
const styles$t = css `
|
|
20776
20776
|
${display('grid')}
|
|
20777
20777
|
|
|
20778
20778
|
dialog {
|
|
@@ -20888,7 +20888,7 @@
|
|
|
20888
20888
|
}
|
|
20889
20889
|
`));
|
|
20890
20890
|
|
|
20891
|
-
const template$
|
|
20891
|
+
const template$g = html `
|
|
20892
20892
|
<template>
|
|
20893
20893
|
<dialog
|
|
20894
20894
|
${ref('dialogElement')}
|
|
@@ -21014,14 +21014,14 @@
|
|
|
21014
21014
|
applyMixins(Dialog, ARIAGlobalStatesAndProperties);
|
|
21015
21015
|
const nimbleDialog = Dialog.compose({
|
|
21016
21016
|
baseName: 'dialog',
|
|
21017
|
-
template: template$
|
|
21018
|
-
styles: styles$
|
|
21017
|
+
template: template$g,
|
|
21018
|
+
styles: styles$t,
|
|
21019
21019
|
baseClass: Dialog
|
|
21020
21020
|
});
|
|
21021
21021
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDialog());
|
|
21022
21022
|
DesignSystem.tagFor(Dialog);
|
|
21023
21023
|
|
|
21024
|
-
const styles$
|
|
21024
|
+
const styles$s = css `
|
|
21025
21025
|
${display('block')}
|
|
21026
21026
|
|
|
21027
21027
|
:host {
|
|
@@ -21174,7 +21174,7 @@
|
|
|
21174
21174
|
}
|
|
21175
21175
|
`));
|
|
21176
21176
|
|
|
21177
|
-
const template$
|
|
21177
|
+
const template$f = html `
|
|
21178
21178
|
<dialog
|
|
21179
21179
|
${ref('dialog')}
|
|
21180
21180
|
aria-label="${x => x.ariaLabel}"
|
|
@@ -21288,8 +21288,8 @@
|
|
|
21288
21288
|
applyMixins(Drawer, ARIAGlobalStatesAndProperties);
|
|
21289
21289
|
const nimbleDrawer = Drawer.compose({
|
|
21290
21290
|
baseName: 'drawer',
|
|
21291
|
-
template: template$
|
|
21292
|
-
styles: styles$
|
|
21291
|
+
template: template$f,
|
|
21292
|
+
styles: styles$s
|
|
21293
21293
|
});
|
|
21294
21294
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
|
|
21295
21295
|
DesignSystem.tagFor(Drawer);
|
|
@@ -21352,7 +21352,7 @@
|
|
|
21352
21352
|
}
|
|
21353
21353
|
}
|
|
21354
21354
|
registerIcon('icon-arrow-expander-right', IconArrowExpanderRight);
|
|
21355
|
-
DesignSystem.tagFor(IconArrowExpanderRight);
|
|
21355
|
+
const iconArrowExpanderRightTag = DesignSystem.tagFor(IconArrowExpanderRight);
|
|
21356
21356
|
|
|
21357
21357
|
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
21358
21358
|
/**
|
|
@@ -23070,7 +23070,7 @@
|
|
|
23070
23070
|
registerIcon('icon-xmark-check', IconXmarkCheck);
|
|
23071
23071
|
DesignSystem.tagFor(IconXmarkCheck);
|
|
23072
23072
|
|
|
23073
|
-
const styles$
|
|
23073
|
+
const styles$r = css `
|
|
23074
23074
|
${display('flex')}
|
|
23075
23075
|
|
|
23076
23076
|
:host {
|
|
@@ -23150,12 +23150,12 @@
|
|
|
23150
23150
|
baseName: 'list-option',
|
|
23151
23151
|
baseClass: ListboxOption,
|
|
23152
23152
|
template: listboxOptionTemplate,
|
|
23153
|
-
styles: styles$
|
|
23153
|
+
styles: styles$r
|
|
23154
23154
|
});
|
|
23155
23155
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListOption());
|
|
23156
23156
|
DesignSystem.tagFor(ListOption);
|
|
23157
23157
|
|
|
23158
|
-
const styles$
|
|
23158
|
+
const styles$q = css `
|
|
23159
23159
|
${display('grid')}
|
|
23160
23160
|
|
|
23161
23161
|
:host {
|
|
@@ -23222,12 +23222,12 @@
|
|
|
23222
23222
|
baseName: 'menu',
|
|
23223
23223
|
baseClass: Menu$1,
|
|
23224
23224
|
template: menuTemplate,
|
|
23225
|
-
styles: styles$
|
|
23225
|
+
styles: styles$q
|
|
23226
23226
|
});
|
|
23227
23227
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenu());
|
|
23228
23228
|
DesignSystem.tagFor(Menu);
|
|
23229
23229
|
|
|
23230
|
-
const styles$
|
|
23230
|
+
const styles$p = css `
|
|
23231
23231
|
${display('inline-block')}
|
|
23232
23232
|
|
|
23233
23233
|
:host {
|
|
@@ -23246,7 +23246,7 @@
|
|
|
23246
23246
|
`;
|
|
23247
23247
|
|
|
23248
23248
|
// prettier-ignore
|
|
23249
|
-
const template$
|
|
23249
|
+
const template$e = html `
|
|
23250
23250
|
<template
|
|
23251
23251
|
?open="${x => x.open}"
|
|
23252
23252
|
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
@@ -23501,8 +23501,8 @@
|
|
|
23501
23501
|
], MenuButton.prototype, "slottedMenus", void 0);
|
|
23502
23502
|
const nimbleMenuButton = MenuButton.compose({
|
|
23503
23503
|
baseName: 'menu-button',
|
|
23504
|
-
template: template$
|
|
23505
|
-
styles: styles$
|
|
23504
|
+
template: template$e,
|
|
23505
|
+
styles: styles$p,
|
|
23506
23506
|
shadowOptions: {
|
|
23507
23507
|
delegatesFocus: true
|
|
23508
23508
|
}
|
|
@@ -23510,7 +23510,7 @@
|
|
|
23510
23510
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuButton());
|
|
23511
23511
|
const menuButtonTag = DesignSystem.tagFor(MenuButton);
|
|
23512
23512
|
|
|
23513
|
-
const styles$
|
|
23513
|
+
const styles$o = css `
|
|
23514
23514
|
${display('grid')}
|
|
23515
23515
|
|
|
23516
23516
|
:host {
|
|
@@ -23608,7 +23608,7 @@
|
|
|
23608
23608
|
baseName: 'menu-item',
|
|
23609
23609
|
baseClass: MenuItem$1,
|
|
23610
23610
|
template: menuItemTemplate,
|
|
23611
|
-
styles: styles$
|
|
23611
|
+
styles: styles$o,
|
|
23612
23612
|
expandCollapseGlyph: arrowExpanderRight16X16.data
|
|
23613
23613
|
});
|
|
23614
23614
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuItem());
|
|
@@ -23623,9 +23623,9 @@
|
|
|
23623
23623
|
block: 'block'
|
|
23624
23624
|
};
|
|
23625
23625
|
|
|
23626
|
-
const styles$
|
|
23626
|
+
const styles$n = css `
|
|
23627
23627
|
${display('inline-block')}
|
|
23628
|
-
${styles$
|
|
23628
|
+
${styles$v}
|
|
23629
23629
|
|
|
23630
23630
|
:host {
|
|
23631
23631
|
font: ${bodyFont};
|
|
@@ -23839,7 +23839,7 @@
|
|
|
23839
23839
|
baseName: 'number-field',
|
|
23840
23840
|
baseClass: NumberField$1,
|
|
23841
23841
|
template: numberFieldTemplate,
|
|
23842
|
-
styles: styles$
|
|
23842
|
+
styles: styles$n,
|
|
23843
23843
|
shadowOptions: {
|
|
23844
23844
|
delegatesFocus: true
|
|
23845
23845
|
},
|
|
@@ -23881,7 +23881,7 @@
|
|
|
23881
23881
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleNumberField());
|
|
23882
23882
|
DesignSystem.tagFor(NumberField);
|
|
23883
23883
|
|
|
23884
|
-
const styles$
|
|
23884
|
+
const styles$m = css `
|
|
23885
23885
|
${display('inline-flex')}
|
|
23886
23886
|
|
|
23887
23887
|
:host {
|
|
@@ -23982,13 +23982,13 @@
|
|
|
23982
23982
|
baseName: 'radio',
|
|
23983
23983
|
baseClass: Radio$1,
|
|
23984
23984
|
template: radioTemplate,
|
|
23985
|
-
styles: styles$
|
|
23985
|
+
styles: styles$m,
|
|
23986
23986
|
checkedIndicator: circleFilled16X16.data
|
|
23987
23987
|
});
|
|
23988
23988
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadio());
|
|
23989
23989
|
DesignSystem.tagFor(Radio);
|
|
23990
23990
|
|
|
23991
|
-
const styles$
|
|
23991
|
+
const styles$l = css `
|
|
23992
23992
|
${display('inline-block')}
|
|
23993
23993
|
|
|
23994
23994
|
.positioning-region {
|
|
@@ -24023,7 +24023,7 @@
|
|
|
24023
24023
|
baseName: 'radio-group',
|
|
24024
24024
|
baseClass: RadioGroup$1,
|
|
24025
24025
|
template: radioGroupTemplate,
|
|
24026
|
-
styles: styles$
|
|
24026
|
+
styles: styles$l,
|
|
24027
24027
|
shadowOptions: {
|
|
24028
24028
|
delegatesFocus: true
|
|
24029
24029
|
}
|
|
@@ -24031,9 +24031,9 @@
|
|
|
24031
24031
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadioGroup());
|
|
24032
24032
|
DesignSystem.tagFor(RadioGroup);
|
|
24033
24033
|
|
|
24034
|
-
const styles$
|
|
24035
|
-
${styles$
|
|
24036
|
-
${styles$
|
|
24034
|
+
const styles$k = css `
|
|
24035
|
+
${styles$w}
|
|
24036
|
+
${styles$v}
|
|
24037
24037
|
|
|
24038
24038
|
${
|
|
24039
24039
|
/* We are using flex `order` to define the visual ordering of the selected value,
|
|
@@ -24109,7 +24109,7 @@
|
|
|
24109
24109
|
baseName: 'select',
|
|
24110
24110
|
baseClass: Select$1,
|
|
24111
24111
|
template: selectTemplate,
|
|
24112
|
-
styles: styles$
|
|
24112
|
+
styles: styles$k,
|
|
24113
24113
|
indicator: arrowExpanderDown16X16.data,
|
|
24114
24114
|
end: html `
|
|
24115
24115
|
<${iconExclamationMarkTag}
|
|
@@ -24122,7 +24122,7 @@
|
|
|
24122
24122
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());
|
|
24123
24123
|
DesignSystem.tagFor(Select);
|
|
24124
24124
|
|
|
24125
|
-
const styles$
|
|
24125
|
+
const styles$j = css `
|
|
24126
24126
|
${display('inline-flex')}
|
|
24127
24127
|
|
|
24128
24128
|
:host {
|
|
@@ -24266,7 +24266,7 @@
|
|
|
24266
24266
|
}
|
|
24267
24267
|
`));
|
|
24268
24268
|
|
|
24269
|
-
const template$
|
|
24269
|
+
const template$d = html `
|
|
24270
24270
|
<template role="progressbar">
|
|
24271
24271
|
<div class="container">
|
|
24272
24272
|
<div class="bit1"></div>
|
|
@@ -24283,13 +24283,13 @@
|
|
|
24283
24283
|
}
|
|
24284
24284
|
const nimbleSpinner = Spinner.compose({
|
|
24285
24285
|
baseName: 'spinner',
|
|
24286
|
-
template: template$
|
|
24287
|
-
styles: styles$
|
|
24286
|
+
template: template$d,
|
|
24287
|
+
styles: styles$j
|
|
24288
24288
|
});
|
|
24289
24289
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
|
|
24290
24290
|
DesignSystem.tagFor(Spinner);
|
|
24291
24291
|
|
|
24292
|
-
const styles$
|
|
24292
|
+
const styles$i = css `
|
|
24293
24293
|
${display('inline-flex')}
|
|
24294
24294
|
|
|
24295
24295
|
:host {
|
|
@@ -24452,7 +24452,7 @@
|
|
|
24452
24452
|
`));
|
|
24453
24453
|
|
|
24454
24454
|
// prettier-ignore
|
|
24455
|
-
const template$
|
|
24455
|
+
const template$c = html `
|
|
24456
24456
|
<template
|
|
24457
24457
|
role="switch"
|
|
24458
24458
|
aria-checked="${x => x.checked}"
|
|
@@ -24496,8 +24496,8 @@
|
|
|
24496
24496
|
const nimbleSwitch = Switch.compose({
|
|
24497
24497
|
baseClass: Switch$1,
|
|
24498
24498
|
baseName: 'switch',
|
|
24499
|
-
template: template$
|
|
24500
|
-
styles: styles$
|
|
24499
|
+
template: template$c,
|
|
24500
|
+
styles: styles$i
|
|
24501
24501
|
});
|
|
24502
24502
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSwitch());
|
|
24503
24503
|
DesignSystem.tagFor(Switch);
|
|
@@ -24511,12 +24511,12 @@
|
|
|
24511
24511
|
baseName: 'tab',
|
|
24512
24512
|
baseClass: Tab$1,
|
|
24513
24513
|
template: tabTemplate,
|
|
24514
|
-
styles: styles$
|
|
24514
|
+
styles: styles$J
|
|
24515
24515
|
});
|
|
24516
24516
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTab());
|
|
24517
24517
|
DesignSystem.tagFor(Tab);
|
|
24518
24518
|
|
|
24519
|
-
const styles$
|
|
24519
|
+
const styles$h = css `
|
|
24520
24520
|
${display('block')}
|
|
24521
24521
|
|
|
24522
24522
|
:host {
|
|
@@ -24536,7 +24536,7 @@
|
|
|
24536
24536
|
baseName: 'tab-panel',
|
|
24537
24537
|
baseClass: TabPanel$1,
|
|
24538
24538
|
template: tabPanelTemplate,
|
|
24539
|
-
styles: styles$
|
|
24539
|
+
styles: styles$h
|
|
24540
24540
|
});
|
|
24541
24541
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabPanel());
|
|
24542
24542
|
DesignSystem.tagFor(TabPanel);
|
|
@@ -27570,9 +27570,195 @@
|
|
|
27570
27570
|
});
|
|
27571
27571
|
}
|
|
27572
27572
|
|
|
27573
|
+
function getGroupedRowModel() {
|
|
27574
|
+
return table => memo$1(() => [table.getState().grouping, table.getPreGroupedRowModel()], (grouping, rowModel) => {
|
|
27575
|
+
if (!rowModel.rows.length || !grouping.length) {
|
|
27576
|
+
return rowModel;
|
|
27577
|
+
}
|
|
27578
|
+
|
|
27579
|
+
// Filter the grouping list down to columns that exist
|
|
27580
|
+
const existingGrouping = grouping.filter(columnId => table.getColumn(columnId));
|
|
27581
|
+
const groupedFlatRows = [];
|
|
27582
|
+
const groupedRowsById = {};
|
|
27583
|
+
// const onlyGroupedFlatRows: Row[] = [];
|
|
27584
|
+
// const onlyGroupedRowsById: Record<RowId, Row> = {};
|
|
27585
|
+
// const nonGroupedFlatRows: Row[] = [];
|
|
27586
|
+
// const nonGroupedRowsById: Record<RowId, Row> = {};
|
|
27587
|
+
|
|
27588
|
+
// Recursively group the data
|
|
27589
|
+
const groupUpRecursively = function (rows, depth, parentId) {
|
|
27590
|
+
if (depth === void 0) {
|
|
27591
|
+
depth = 0;
|
|
27592
|
+
}
|
|
27593
|
+
// Grouping depth has been been met
|
|
27594
|
+
// Stop grouping and simply rewrite thd depth and row relationships
|
|
27595
|
+
if (depth >= existingGrouping.length) {
|
|
27596
|
+
return rows.map(row => {
|
|
27597
|
+
row.depth = depth;
|
|
27598
|
+
groupedFlatRows.push(row);
|
|
27599
|
+
groupedRowsById[row.id] = row;
|
|
27600
|
+
if (row.subRows) {
|
|
27601
|
+
row.subRows = groupUpRecursively(row.subRows, depth + 1);
|
|
27602
|
+
}
|
|
27603
|
+
return row;
|
|
27604
|
+
});
|
|
27605
|
+
}
|
|
27606
|
+
const columnId = existingGrouping[depth];
|
|
27607
|
+
|
|
27608
|
+
// Group the rows together for this level
|
|
27609
|
+
const rowGroupsMap = groupBy(rows, columnId);
|
|
27610
|
+
|
|
27611
|
+
// Peform aggregations for each group
|
|
27612
|
+
const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map((_ref, index) => {
|
|
27613
|
+
let [groupingValue, groupedRows] = _ref;
|
|
27614
|
+
let id = `${columnId}:${groupingValue}`;
|
|
27615
|
+
id = parentId ? `${parentId}>${id}` : id;
|
|
27616
|
+
|
|
27617
|
+
// First, Recurse to group sub rows before aggregation
|
|
27618
|
+
const subRows = groupUpRecursively(groupedRows, depth + 1, id);
|
|
27619
|
+
|
|
27620
|
+
// Flatten the leaf rows of the rows in this group
|
|
27621
|
+
const leafRows = depth ? flattenBy(groupedRows, row => row.subRows) : groupedRows;
|
|
27622
|
+
const row = createRow(table, id, leafRows[0].original, index, depth);
|
|
27623
|
+
Object.assign(row, {
|
|
27624
|
+
groupingColumnId: columnId,
|
|
27625
|
+
groupingValue,
|
|
27626
|
+
subRows,
|
|
27627
|
+
leafRows,
|
|
27628
|
+
getValue: columnId => {
|
|
27629
|
+
// Don't aggregate columns that are in the grouping
|
|
27630
|
+
if (existingGrouping.includes(columnId)) {
|
|
27631
|
+
if (row._valuesCache.hasOwnProperty(columnId)) {
|
|
27632
|
+
return row._valuesCache[columnId];
|
|
27633
|
+
}
|
|
27634
|
+
if (groupedRows[0]) {
|
|
27635
|
+
var _groupedRows$0$getVal;
|
|
27636
|
+
row._valuesCache[columnId] = (_groupedRows$0$getVal = groupedRows[0].getValue(columnId)) != null ? _groupedRows$0$getVal : undefined;
|
|
27637
|
+
}
|
|
27638
|
+
return row._valuesCache[columnId];
|
|
27639
|
+
}
|
|
27640
|
+
if (row._groupingValuesCache.hasOwnProperty(columnId)) {
|
|
27641
|
+
return row._groupingValuesCache[columnId];
|
|
27642
|
+
}
|
|
27643
|
+
|
|
27644
|
+
// Aggregate the values
|
|
27645
|
+
const column = table.getColumn(columnId);
|
|
27646
|
+
const aggregateFn = column == null ? void 0 : column.getAggregationFn();
|
|
27647
|
+
if (aggregateFn) {
|
|
27648
|
+
row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
|
|
27649
|
+
return row._groupingValuesCache[columnId];
|
|
27650
|
+
}
|
|
27651
|
+
}
|
|
27652
|
+
});
|
|
27653
|
+
subRows.forEach(subRow => {
|
|
27654
|
+
groupedFlatRows.push(subRow);
|
|
27655
|
+
groupedRowsById[subRow.id] = subRow;
|
|
27656
|
+
// if (subRow.getIsGrouped?.()) {
|
|
27657
|
+
// onlyGroupedFlatRows.push(subRow);
|
|
27658
|
+
// onlyGroupedRowsById[subRow.id] = subRow;
|
|
27659
|
+
// } else {
|
|
27660
|
+
// nonGroupedFlatRows.push(subRow);
|
|
27661
|
+
// nonGroupedRowsById[subRow.id] = subRow;
|
|
27662
|
+
// }
|
|
27663
|
+
});
|
|
27664
|
+
|
|
27665
|
+
return row;
|
|
27666
|
+
});
|
|
27667
|
+
return aggregatedGroupedRows;
|
|
27668
|
+
};
|
|
27669
|
+
const groupedRows = groupUpRecursively(rowModel.rows, 0, '');
|
|
27670
|
+
groupedRows.forEach(subRow => {
|
|
27671
|
+
groupedFlatRows.push(subRow);
|
|
27672
|
+
groupedRowsById[subRow.id] = subRow;
|
|
27673
|
+
// if (subRow.getIsGrouped?.()) {
|
|
27674
|
+
// onlyGroupedFlatRows.push(subRow);
|
|
27675
|
+
// onlyGroupedRowsById[subRow.id] = subRow;
|
|
27676
|
+
// } else {
|
|
27677
|
+
// nonGroupedFlatRows.push(subRow);
|
|
27678
|
+
// nonGroupedRowsById[subRow.id] = subRow;
|
|
27679
|
+
// }
|
|
27680
|
+
});
|
|
27681
|
+
|
|
27682
|
+
return {
|
|
27683
|
+
rows: groupedRows,
|
|
27684
|
+
flatRows: groupedFlatRows,
|
|
27685
|
+
rowsById: groupedRowsById
|
|
27686
|
+
};
|
|
27687
|
+
}, {
|
|
27688
|
+
key: 'getGroupedRowModel',
|
|
27689
|
+
debug: () => {
|
|
27690
|
+
var _table$options$debugA;
|
|
27691
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
27692
|
+
},
|
|
27693
|
+
onChange: () => {
|
|
27694
|
+
table._queue(() => {
|
|
27695
|
+
table._autoResetExpanded();
|
|
27696
|
+
table._autoResetPageIndex();
|
|
27697
|
+
});
|
|
27698
|
+
}
|
|
27699
|
+
});
|
|
27700
|
+
}
|
|
27701
|
+
function groupBy(rows, columnId) {
|
|
27702
|
+
const groupMap = new Map();
|
|
27703
|
+
return rows.reduce((map, row) => {
|
|
27704
|
+
const resKey = `${row.getValue(columnId)}`;
|
|
27705
|
+
const previous = map.get(resKey);
|
|
27706
|
+
if (!previous) {
|
|
27707
|
+
map.set(resKey, [row]);
|
|
27708
|
+
} else {
|
|
27709
|
+
previous.push(row);
|
|
27710
|
+
}
|
|
27711
|
+
return map;
|
|
27712
|
+
}, groupMap);
|
|
27713
|
+
}
|
|
27714
|
+
|
|
27715
|
+
function getExpandedRowModel() {
|
|
27716
|
+
return table => memo$1(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
|
|
27717
|
+
if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
|
|
27718
|
+
return rowModel;
|
|
27719
|
+
}
|
|
27720
|
+
if (!paginateExpandedRows) {
|
|
27721
|
+
// Only expand rows at this point if they are being paginated
|
|
27722
|
+
return rowModel;
|
|
27723
|
+
}
|
|
27724
|
+
return expandRows(rowModel);
|
|
27725
|
+
}, {
|
|
27726
|
+
key: 'getExpandedRowModel',
|
|
27727
|
+
debug: () => {
|
|
27728
|
+
var _table$options$debugA;
|
|
27729
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
27730
|
+
}
|
|
27731
|
+
});
|
|
27732
|
+
}
|
|
27733
|
+
function expandRows(rowModel) {
|
|
27734
|
+
const expandedRows = [];
|
|
27735
|
+
const handleRow = row => {
|
|
27736
|
+
var _row$subRows;
|
|
27737
|
+
expandedRows.push(row);
|
|
27738
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {
|
|
27739
|
+
row.subRows.forEach(handleRow);
|
|
27740
|
+
}
|
|
27741
|
+
};
|
|
27742
|
+
rowModel.rows.forEach(handleRow);
|
|
27743
|
+
return {
|
|
27744
|
+
rows: expandedRows,
|
|
27745
|
+
flatRows: rowModel.flatRows,
|
|
27746
|
+
rowsById: rowModel.rowsById
|
|
27747
|
+
};
|
|
27748
|
+
}
|
|
27749
|
+
|
|
27750
|
+
const createGroupHeaderViewTemplate = (groupHeaderViewTag) => html `
|
|
27751
|
+
<${groupHeaderViewTag}
|
|
27752
|
+
:groupHeaderValue="${x => x.groupRowValue}"
|
|
27753
|
+
:columnConfig="${x => x.groupColumn?.columnConfig}"
|
|
27754
|
+
class="group-header-value"
|
|
27755
|
+
>
|
|
27756
|
+
</${groupHeaderViewTag}>
|
|
27757
|
+
`;
|
|
27758
|
+
|
|
27573
27759
|
// prettier-ignore
|
|
27574
|
-
const template$
|
|
27575
|
-
<template role="cell">
|
|
27760
|
+
const template$b = html `
|
|
27761
|
+
<template role="cell" style="--ni-private-table-cell-nesting-level: ${x => x.nestingLevel}">
|
|
27576
27762
|
${x => x.cellViewTemplate}
|
|
27577
27763
|
${when(x => x.hasActionMenu, html `
|
|
27578
27764
|
<${menuButtonTag} ${ref('actionMenuButton')}
|
|
@@ -27603,6 +27789,22 @@
|
|
|
27603
27789
|
ascending: 'ascending',
|
|
27604
27790
|
descending: 'descending'
|
|
27605
27791
|
};
|
|
27792
|
+
/**
|
|
27793
|
+
* The selection modes of rows in the table.
|
|
27794
|
+
*/
|
|
27795
|
+
const TableRowSelectionMode = {
|
|
27796
|
+
none: undefined,
|
|
27797
|
+
single: 'single'
|
|
27798
|
+
};
|
|
27799
|
+
/**
|
|
27800
|
+
* @internal
|
|
27801
|
+
*
|
|
27802
|
+
* The possible selection states that the table or a table row can be in.
|
|
27803
|
+
*/
|
|
27804
|
+
const TableRowSelectionState = {
|
|
27805
|
+
notSelected: 'notSelected',
|
|
27806
|
+
selected: 'selected'
|
|
27807
|
+
};
|
|
27606
27808
|
|
|
27607
27809
|
/**
|
|
27608
27810
|
* The possible operations to use when sorting a table column.
|
|
@@ -27646,6 +27848,11 @@
|
|
|
27646
27848
|
* The minimum size in pixels according to the design doc
|
|
27647
27849
|
*/
|
|
27648
27850
|
this.internalMinPixelWidth = defaultMinPixelWidth;
|
|
27851
|
+
/**
|
|
27852
|
+
* @internal
|
|
27853
|
+
* Whether or not this column can be used to group rows by
|
|
27854
|
+
*/
|
|
27855
|
+
this.internalGroupingDisabled = false;
|
|
27649
27856
|
/**
|
|
27650
27857
|
* @internal
|
|
27651
27858
|
*
|
|
@@ -27679,6 +27886,11 @@
|
|
|
27679
27886
|
internalPixelWidthChanged() {
|
|
27680
27887
|
this.currentPixelWidth = this.internalPixelWidth;
|
|
27681
27888
|
}
|
|
27889
|
+
groupHeaderViewTagChanged() {
|
|
27890
|
+
this.internalGroupHeaderViewTemplate = this.groupHeaderViewTag
|
|
27891
|
+
? createGroupHeaderViewTemplate(this.groupHeaderViewTag)
|
|
27892
|
+
: undefined;
|
|
27893
|
+
}
|
|
27682
27894
|
}
|
|
27683
27895
|
__decorate$1([
|
|
27684
27896
|
attr({ attribute: 'column-id' })
|
|
@@ -27713,6 +27925,18 @@
|
|
|
27713
27925
|
__decorate$1([
|
|
27714
27926
|
observable
|
|
27715
27927
|
], TableColumn.prototype, "internalMinPixelWidth", void 0);
|
|
27928
|
+
__decorate$1([
|
|
27929
|
+
observable
|
|
27930
|
+
], TableColumn.prototype, "internalGroupingDisabled", void 0);
|
|
27931
|
+
__decorate$1([
|
|
27932
|
+
observable
|
|
27933
|
+
], TableColumn.prototype, "internalGroupIndex", void 0);
|
|
27934
|
+
__decorate$1([
|
|
27935
|
+
observable
|
|
27936
|
+
], TableColumn.prototype, "groupHeaderViewTag", void 0);
|
|
27937
|
+
__decorate$1([
|
|
27938
|
+
observable
|
|
27939
|
+
], TableColumn.prototype, "internalGroupHeaderViewTemplate", void 0);
|
|
27716
27940
|
__decorate$1([
|
|
27717
27941
|
observable
|
|
27718
27942
|
], TableColumn.prototype, "cellViewTag", void 0);
|
|
@@ -27744,6 +27968,9 @@
|
|
|
27744
27968
|
this.duplicateColumnId = false;
|
|
27745
27969
|
this.missingColumnId = false;
|
|
27746
27970
|
this.duplicateSortIndex = false;
|
|
27971
|
+
this.duplicateGroupIndex = false;
|
|
27972
|
+
this.idFieldNameNotConfigured = false;
|
|
27973
|
+
this.recordIds = new Set();
|
|
27747
27974
|
}
|
|
27748
27975
|
getValidity() {
|
|
27749
27976
|
return {
|
|
@@ -27752,21 +27979,38 @@
|
|
|
27752
27979
|
invalidRecordId: this.invalidRecordId,
|
|
27753
27980
|
duplicateColumnId: this.duplicateColumnId,
|
|
27754
27981
|
missingColumnId: this.missingColumnId,
|
|
27755
|
-
duplicateSortIndex: this.duplicateSortIndex
|
|
27982
|
+
duplicateSortIndex: this.duplicateSortIndex,
|
|
27983
|
+
duplicateGroupIndex: this.duplicateGroupIndex,
|
|
27984
|
+
idFieldNameNotConfigured: this.idFieldNameNotConfigured
|
|
27756
27985
|
};
|
|
27757
27986
|
}
|
|
27758
27987
|
isValid() {
|
|
27759
27988
|
return Object.values(this.getValidity()).every(x => x === false);
|
|
27760
27989
|
}
|
|
27990
|
+
areRecordIdsValid() {
|
|
27991
|
+
const validity = this.getValidity();
|
|
27992
|
+
return (!validity.duplicateRecordId
|
|
27993
|
+
&& !validity.missingRecordId
|
|
27994
|
+
&& !validity.invalidRecordId);
|
|
27995
|
+
}
|
|
27996
|
+
validateSelectionMode(selectionMode, idFieldName) {
|
|
27997
|
+
if (selectionMode === TableRowSelectionMode.none) {
|
|
27998
|
+
this.idFieldNameNotConfigured = false;
|
|
27999
|
+
}
|
|
28000
|
+
else {
|
|
28001
|
+
this.idFieldNameNotConfigured = typeof idFieldName !== 'string';
|
|
28002
|
+
}
|
|
28003
|
+
return !this.idFieldNameNotConfigured;
|
|
28004
|
+
}
|
|
27761
28005
|
validateRecordIds(data, idFieldName) {
|
|
27762
28006
|
// Start off by assuming all IDs are valid.
|
|
27763
28007
|
this.duplicateRecordId = false;
|
|
27764
28008
|
this.missingRecordId = false;
|
|
27765
28009
|
this.invalidRecordId = false;
|
|
28010
|
+
this.recordIds.clear();
|
|
27766
28011
|
if (typeof idFieldName !== 'string') {
|
|
27767
28012
|
return true;
|
|
27768
28013
|
}
|
|
27769
|
-
const ids = new Set();
|
|
27770
28014
|
for (const record of data) {
|
|
27771
28015
|
if (!Object.prototype.hasOwnProperty.call(record, idFieldName)) {
|
|
27772
28016
|
this.missingRecordId = true;
|
|
@@ -27777,10 +28021,10 @@
|
|
|
27777
28021
|
this.invalidRecordId = true;
|
|
27778
28022
|
continue;
|
|
27779
28023
|
}
|
|
27780
|
-
if (
|
|
28024
|
+
if (this.recordIds.has(id)) {
|
|
27781
28025
|
this.duplicateRecordId = true;
|
|
27782
28026
|
}
|
|
27783
|
-
|
|
28027
|
+
this.recordIds.add(id);
|
|
27784
28028
|
}
|
|
27785
28029
|
return (!this.missingRecordId
|
|
27786
28030
|
&& !this.invalidRecordId
|
|
@@ -27807,19 +28051,23 @@
|
|
|
27807
28051
|
return !this.missingColumnId && !this.duplicateColumnId;
|
|
27808
28052
|
}
|
|
27809
28053
|
validateColumnSortIndices(sortIndices) {
|
|
27810
|
-
this.duplicateSortIndex =
|
|
27811
|
-
const sortIndexSet = new Set();
|
|
27812
|
-
for (const sortIndex of sortIndices) {
|
|
27813
|
-
if (sortIndexSet.has(sortIndex)) {
|
|
27814
|
-
this.duplicateSortIndex = true;
|
|
27815
|
-
}
|
|
27816
|
-
sortIndexSet.add(sortIndex);
|
|
27817
|
-
}
|
|
28054
|
+
this.duplicateSortIndex = !this.validateIndicesAreUnique(sortIndices);
|
|
27818
28055
|
return !this.duplicateSortIndex;
|
|
27819
28056
|
}
|
|
28057
|
+
validateColumnGroupIndices(groupIndices) {
|
|
28058
|
+
this.duplicateGroupIndex = !this.validateIndicesAreUnique(groupIndices);
|
|
28059
|
+
return !this.duplicateGroupIndex;
|
|
28060
|
+
}
|
|
28061
|
+
getPresentRecordIds(requestedRecordIds) {
|
|
28062
|
+
return requestedRecordIds.filter(id => this.recordIds.has(id));
|
|
28063
|
+
}
|
|
28064
|
+
validateIndicesAreUnique(indices) {
|
|
28065
|
+
const numberSet = new Set(indices);
|
|
28066
|
+
return numberSet.size === indices.length;
|
|
28067
|
+
}
|
|
27820
28068
|
}
|
|
27821
28069
|
|
|
27822
|
-
const styles$
|
|
28070
|
+
const styles$g = css `
|
|
27823
28071
|
${display('flex')}
|
|
27824
28072
|
|
|
27825
28073
|
:host {
|
|
@@ -27893,9 +28141,17 @@
|
|
|
27893
28141
|
pointer-events: none;
|
|
27894
28142
|
}
|
|
27895
28143
|
|
|
27896
|
-
.row:hover::before {
|
|
28144
|
+
:host([selection-mode='single']) .row:hover::before {
|
|
27897
28145
|
background: ${fillHoverColor};
|
|
27898
28146
|
}
|
|
28147
|
+
|
|
28148
|
+
:host([selection-mode='single']) .row[selected]::before {
|
|
28149
|
+
background: ${fillSelectedColor};
|
|
28150
|
+
}
|
|
28151
|
+
|
|
28152
|
+
:host([selection-mode='single']) .row[selected]:hover::before {
|
|
28153
|
+
background: ${fillHoverSelectedColor};
|
|
28154
|
+
}
|
|
27899
28155
|
`.withBehaviors(themeBehavior(Theme.color, css `
|
|
27900
28156
|
.header-row::before {
|
|
27901
28157
|
content: '';
|
|
@@ -27910,12 +28166,20 @@
|
|
|
27910
28166
|
background: ${fillHoverColor};
|
|
27911
28167
|
}
|
|
27912
28168
|
|
|
27913
|
-
.row:hover::before {
|
|
28169
|
+
:host([selection-mode='single']) .row:hover::before {
|
|
27914
28170
|
background: ${hexToRgbaCssColor(White, 0.15)};
|
|
27915
28171
|
}
|
|
28172
|
+
|
|
28173
|
+
:host([selection-mode='single']) .row[selected]::before {
|
|
28174
|
+
background: ${hexToRgbaCssColor(White, 0.25)};
|
|
28175
|
+
}
|
|
28176
|
+
|
|
28177
|
+
:host([selection-mode='single']) .row[selected]:hover::before {
|
|
28178
|
+
background: ${hexToRgbaCssColor(White, 0.2)};
|
|
28179
|
+
}
|
|
27916
28180
|
`));
|
|
27917
28181
|
|
|
27918
|
-
const styles$
|
|
28182
|
+
const styles$f = css `
|
|
27919
28183
|
${display('flex')}
|
|
27920
28184
|
|
|
27921
28185
|
:host {
|
|
@@ -27934,7 +28198,7 @@
|
|
|
27934
28198
|
`;
|
|
27935
28199
|
|
|
27936
28200
|
// prettier-ignore
|
|
27937
|
-
const template$
|
|
28201
|
+
const template$a = html `
|
|
27938
28202
|
<template role="columnheader" aria-sort="${x => x.ariaSort}">
|
|
27939
28203
|
<slot></slot>
|
|
27940
28204
|
|
|
@@ -27984,13 +28248,13 @@
|
|
|
27984
28248
|
], TableHeader.prototype, "firstSortedColumn", void 0);
|
|
27985
28249
|
const nimbleTableHeader = TableHeader.compose({
|
|
27986
28250
|
baseName: 'table-header',
|
|
27987
|
-
template: template$
|
|
27988
|
-
styles: styles$
|
|
28251
|
+
template: template$a,
|
|
28252
|
+
styles: styles$f
|
|
27989
28253
|
});
|
|
27990
28254
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableHeader());
|
|
27991
28255
|
const tableHeaderTag = DesignSystem.tagFor(TableHeader);
|
|
27992
28256
|
|
|
27993
|
-
const styles$
|
|
28257
|
+
const styles$e = css `
|
|
27994
28258
|
${display('grid')}
|
|
27995
28259
|
|
|
27996
28260
|
:host {
|
|
@@ -28014,13 +28278,25 @@
|
|
|
28014
28278
|
:host(:hover) nimble-table-cell {
|
|
28015
28279
|
--ni-private-table-cell-action-menu-display: block;
|
|
28016
28280
|
}
|
|
28281
|
+
|
|
28282
|
+
:host([selected]) nimble-table-cell {
|
|
28283
|
+
--ni-private-table-cell-action-menu-display: block;
|
|
28284
|
+
}
|
|
28017
28285
|
`;
|
|
28018
28286
|
|
|
28019
|
-
const styles$
|
|
28287
|
+
const styles$d = css `
|
|
28020
28288
|
${display('grid')}
|
|
28021
28289
|
|
|
28022
28290
|
:host {
|
|
28291
|
+
--ni-private-table-cell-nesting-level: 0;
|
|
28023
28292
|
padding: 0px calc(${standardPadding} / 2);
|
|
28293
|
+
padding-left: calc(
|
|
28294
|
+
${standardPadding} / 2 +
|
|
28295
|
+
(
|
|
28296
|
+
var(--ni-private-table-cell-nesting-level) *
|
|
28297
|
+
${standardPadding} * 2
|
|
28298
|
+
)
|
|
28299
|
+
);
|
|
28024
28300
|
align-self: center;
|
|
28025
28301
|
height: 100%;
|
|
28026
28302
|
grid-template-columns: 1fr auto;
|
|
@@ -28048,6 +28324,7 @@
|
|
|
28048
28324
|
super(...arguments);
|
|
28049
28325
|
this.hasActionMenu = false;
|
|
28050
28326
|
this.menuOpen = false;
|
|
28327
|
+
this.nestingLevel = 0;
|
|
28051
28328
|
}
|
|
28052
28329
|
onActionMenuBeforeToggle(event) {
|
|
28053
28330
|
this.$emit('cell-action-menu-beforetoggle', event.detail);
|
|
@@ -28072,17 +28349,20 @@
|
|
|
28072
28349
|
__decorate$1([
|
|
28073
28350
|
observable
|
|
28074
28351
|
], TableCell.prototype, "cellViewTemplate", void 0);
|
|
28352
|
+
__decorate$1([
|
|
28353
|
+
observable
|
|
28354
|
+
], TableCell.prototype, "nestingLevel", void 0);
|
|
28075
28355
|
const nimbleTableCell = TableCell.compose({
|
|
28076
28356
|
baseName: 'table-cell',
|
|
28077
|
-
template: template$
|
|
28078
|
-
styles: styles$
|
|
28357
|
+
template: template$b,
|
|
28358
|
+
styles: styles$d
|
|
28079
28359
|
});
|
|
28080
28360
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableCell());
|
|
28081
28361
|
const tableCellTag = DesignSystem.tagFor(TableCell);
|
|
28082
28362
|
|
|
28083
28363
|
// prettier-ignore
|
|
28084
|
-
const template$
|
|
28085
|
-
<template role="row">
|
|
28364
|
+
const template$9 = html `
|
|
28365
|
+
<template role="row" aria-selected=${x => x.ariaSelected}>
|
|
28086
28366
|
${repeat(x => x.columnStates, html `
|
|
28087
28367
|
${when(x => !x.column.columnHidden, html `
|
|
28088
28368
|
<${tableCellTag}
|
|
@@ -28093,6 +28373,7 @@
|
|
|
28093
28373
|
action-menu-label="${x => x.column.actionMenuLabel}"
|
|
28094
28374
|
@cell-action-menu-beforetoggle="${(x, c) => c.parent.onCellActionMenuBeforeToggle(c.event, x.column)}"
|
|
28095
28375
|
@cell-action-menu-toggle="${(x, c) => c.parent.onCellActionMenuToggle(c.event, x.column)}"
|
|
28376
|
+
:nestingLevel="${x => x.cellIndentLevel};"
|
|
28096
28377
|
>
|
|
28097
28378
|
|
|
28098
28379
|
${when((x, c) => (c.parent.currentActionMenuColumn === x.column) && x.column.actionMenuSlot, html `
|
|
@@ -28114,18 +28395,21 @@
|
|
|
28114
28395
|
class TableRow extends FoundationElement {
|
|
28115
28396
|
constructor() {
|
|
28116
28397
|
super(...arguments);
|
|
28398
|
+
this.selectable = false;
|
|
28399
|
+
this.selected = false;
|
|
28117
28400
|
this.columns = [];
|
|
28401
|
+
this.nestingLevel = 0;
|
|
28118
28402
|
this.menuOpen = false;
|
|
28119
28403
|
}
|
|
28120
28404
|
get columnStates() {
|
|
28121
|
-
return this.columns.map(column => {
|
|
28405
|
+
return this.columns.map((column, i) => {
|
|
28122
28406
|
const fieldNames = column.dataRecordFieldNames;
|
|
28123
28407
|
let cellState;
|
|
28124
28408
|
if (this.hasValidFieldNames(fieldNames) && this.dataRecord) {
|
|
28125
28409
|
const cellDataValues = fieldNames.map(field => this.dataRecord[field]);
|
|
28126
|
-
const cellRecord = Object.fromEntries(column.cellRecordFieldNames.map((k,
|
|
28410
|
+
const cellRecord = Object.fromEntries(column.cellRecordFieldNames.map((k, j) => [
|
|
28127
28411
|
k,
|
|
28128
|
-
cellDataValues[
|
|
28412
|
+
cellDataValues[j]
|
|
28129
28413
|
]));
|
|
28130
28414
|
const columnConfig = column.columnConfig ?? {};
|
|
28131
28415
|
cellState = {
|
|
@@ -28134,11 +28418,21 @@
|
|
|
28134
28418
|
};
|
|
28135
28419
|
}
|
|
28136
28420
|
else {
|
|
28137
|
-
cellState = {
|
|
28421
|
+
cellState = {
|
|
28422
|
+
cellRecord: {},
|
|
28423
|
+
columnConfig: {}
|
|
28424
|
+
};
|
|
28138
28425
|
}
|
|
28139
|
-
|
|
28426
|
+
const cellIndentLevel = i === 0 ? this.nestingLevel : 0;
|
|
28427
|
+
return { column, cellState, cellIndentLevel };
|
|
28140
28428
|
});
|
|
28141
28429
|
}
|
|
28430
|
+
get ariaSelected() {
|
|
28431
|
+
if (this.selectable) {
|
|
28432
|
+
return this.selected ? 'true' : 'false';
|
|
28433
|
+
}
|
|
28434
|
+
return null;
|
|
28435
|
+
}
|
|
28142
28436
|
onCellActionMenuBeforeToggle(event, column) {
|
|
28143
28437
|
this.currentActionMenuColumn = column;
|
|
28144
28438
|
this.emitToggleEvent('row-action-menu-beforetoggle', event.detail, column);
|
|
@@ -28171,6 +28465,12 @@
|
|
|
28171
28465
|
__decorate$1([
|
|
28172
28466
|
attr({ attribute: 'record-id' })
|
|
28173
28467
|
], TableRow.prototype, "recordId", void 0);
|
|
28468
|
+
__decorate$1([
|
|
28469
|
+
attr({ mode: 'boolean' })
|
|
28470
|
+
], TableRow.prototype, "selectable", void 0);
|
|
28471
|
+
__decorate$1([
|
|
28472
|
+
attr({ mode: 'boolean' })
|
|
28473
|
+
], TableRow.prototype, "selected", void 0);
|
|
28174
28474
|
__decorate$1([
|
|
28175
28475
|
observable
|
|
28176
28476
|
], TableRow.prototype, "dataRecord", void 0);
|
|
@@ -28180,23 +28480,165 @@
|
|
|
28180
28480
|
__decorate$1([
|
|
28181
28481
|
observable
|
|
28182
28482
|
], TableRow.prototype, "currentActionMenuColumn", void 0);
|
|
28483
|
+
__decorate$1([
|
|
28484
|
+
observable
|
|
28485
|
+
], TableRow.prototype, "nestingLevel", void 0);
|
|
28183
28486
|
__decorate$1([
|
|
28184
28487
|
attr({ attribute: 'menu-open', mode: 'boolean' })
|
|
28185
28488
|
], TableRow.prototype, "menuOpen", void 0);
|
|
28186
28489
|
__decorate$1([
|
|
28187
28490
|
volatile
|
|
28188
28491
|
], TableRow.prototype, "columnStates", null);
|
|
28492
|
+
__decorate$1([
|
|
28493
|
+
volatile
|
|
28494
|
+
], TableRow.prototype, "ariaSelected", null);
|
|
28189
28495
|
const nimbleTableRow = TableRow.compose({
|
|
28190
28496
|
baseName: 'table-row',
|
|
28191
|
-
template: template$
|
|
28192
|
-
styles: styles$
|
|
28497
|
+
template: template$9,
|
|
28498
|
+
styles: styles$e
|
|
28193
28499
|
});
|
|
28194
28500
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableRow());
|
|
28195
28501
|
const tableRowTag = DesignSystem.tagFor(TableRow);
|
|
28196
28502
|
|
|
28503
|
+
const styles$c = css `
|
|
28504
|
+
${display('flex')}
|
|
28505
|
+
|
|
28506
|
+
:host {
|
|
28507
|
+
align-items: center;
|
|
28508
|
+
height: calc(${controlHeight} + 2 * ${borderWidth});
|
|
28509
|
+
border-top: calc(2 * ${borderWidth}) solid ${tableRowBorderColor};
|
|
28510
|
+
padding-left: calc(
|
|
28511
|
+
${smallPadding} * 2 + ${standardPadding} * 2 *
|
|
28512
|
+
var(--ni-private-table-group-row-indent-level)
|
|
28513
|
+
);
|
|
28514
|
+
}
|
|
28515
|
+
|
|
28516
|
+
:host(:hover) {
|
|
28517
|
+
background: ${fillHoverColor};
|
|
28518
|
+
}
|
|
28519
|
+
|
|
28520
|
+
:host([expanded]) .animating,
|
|
28521
|
+
:host .animating {
|
|
28522
|
+
transition: ${mediumDelay} ease-in-out;
|
|
28523
|
+
}
|
|
28524
|
+
|
|
28525
|
+
.expand-collapse-button {
|
|
28526
|
+
width: ${controlSlimHeight};
|
|
28527
|
+
height: ${controlSlimHeight};
|
|
28528
|
+
}
|
|
28529
|
+
|
|
28530
|
+
:host([expanded]) .expander-icon {
|
|
28531
|
+
transform: rotate(90deg);
|
|
28532
|
+
}
|
|
28533
|
+
|
|
28534
|
+
.expander-icon {
|
|
28535
|
+
transform: rotate(0deg);
|
|
28536
|
+
}
|
|
28537
|
+
|
|
28538
|
+
.group-row-header-content {
|
|
28539
|
+
display: flex;
|
|
28540
|
+
overflow: hidden;
|
|
28541
|
+
}
|
|
28542
|
+
|
|
28543
|
+
.group-header-value {
|
|
28544
|
+
padding-left: calc(${standardPadding} / 2);
|
|
28545
|
+
user-select: none;
|
|
28546
|
+
overflow: hidden;
|
|
28547
|
+
display: flex;
|
|
28548
|
+
}
|
|
28549
|
+
|
|
28550
|
+
.group-row-child-count {
|
|
28551
|
+
padding-left: 2px;
|
|
28552
|
+
pointer-events: none;
|
|
28553
|
+
user-select: none;
|
|
28554
|
+
}
|
|
28555
|
+
|
|
28556
|
+
@media (prefers-reduced-motion) {
|
|
28557
|
+
:host .animating,
|
|
28558
|
+
:host([expanded]) .animating {
|
|
28559
|
+
transition-duration: 0s;
|
|
28560
|
+
}
|
|
28561
|
+
}
|
|
28562
|
+
`;
|
|
28563
|
+
|
|
28564
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
28197
28565
|
// prettier-ignore
|
|
28198
|
-
const template$
|
|
28199
|
-
<template
|
|
28566
|
+
const template$8 = html `
|
|
28567
|
+
<template @click=${x => x.onGroupExpandToggle()} style="--ni-private-table-group-row-indent-level: ${x => x.nestingLevel};">
|
|
28568
|
+
<${buttonTag}
|
|
28569
|
+
appearance="${ButtonAppearance.ghost}"
|
|
28570
|
+
content-hidden
|
|
28571
|
+
class="expand-collapse-button"
|
|
28572
|
+
tabindex="-1"
|
|
28573
|
+
>
|
|
28574
|
+
<${iconArrowExpanderRightTag} ${ref('expandIcon')} slot="start" class="expander-icon ${x => x.animationClass}"></${iconArrowExpanderRightTag}>
|
|
28575
|
+
</${buttonTag}>
|
|
28576
|
+
<div class="group-row-header-content">
|
|
28577
|
+
${x => x.groupColumn?.internalGroupHeaderViewTemplate}
|
|
28578
|
+
<div class="group-row-child-count">(${x => x.leafItemCount})</span>
|
|
28579
|
+
</div>
|
|
28580
|
+
</template>
|
|
28581
|
+
`;
|
|
28582
|
+
|
|
28583
|
+
/**
|
|
28584
|
+
* A styled cell that is used within the nimble-table-row.
|
|
28585
|
+
* @internal
|
|
28586
|
+
*/
|
|
28587
|
+
class TableGroupRow extends FoundationElement {
|
|
28588
|
+
constructor() {
|
|
28589
|
+
super(...arguments);
|
|
28590
|
+
this.nestingLevel = 0;
|
|
28591
|
+
this.expanded = false;
|
|
28592
|
+
/**
|
|
28593
|
+
* @internal
|
|
28594
|
+
*/
|
|
28595
|
+
this.animationClass = '';
|
|
28596
|
+
this.removeAnimatingClass = () => {
|
|
28597
|
+
this.animationClass = '';
|
|
28598
|
+
this.expandIcon.removeEventListener('transitionend', this.removeAnimatingClass);
|
|
28599
|
+
};
|
|
28600
|
+
}
|
|
28601
|
+
onGroupExpandToggle() {
|
|
28602
|
+
this.$emit('group-expand-toggle');
|
|
28603
|
+
// To avoid a visual glitch with improper expand/collapse icons performing an
|
|
28604
|
+
// animation, we apply a class to the appropriate group row such that we can have
|
|
28605
|
+
// a more targeted CSS animation. We use the 'transitionend' event to remove the
|
|
28606
|
+
// temporary class and register a function reference as the handler to avoid issues
|
|
28607
|
+
// that may result from the 'transitionend' event not firing, as it will never result
|
|
28608
|
+
// in multiple event listeners being registered.
|
|
28609
|
+
this.animationClass = 'animating';
|
|
28610
|
+
this.expandIcon.addEventListener('transitionend', this.removeAnimatingClass);
|
|
28611
|
+
}
|
|
28612
|
+
}
|
|
28613
|
+
__decorate$1([
|
|
28614
|
+
observable
|
|
28615
|
+
], TableGroupRow.prototype, "groupRowValue", void 0);
|
|
28616
|
+
__decorate$1([
|
|
28617
|
+
observable
|
|
28618
|
+
], TableGroupRow.prototype, "nestingLevel", void 0);
|
|
28619
|
+
__decorate$1([
|
|
28620
|
+
observable
|
|
28621
|
+
], TableGroupRow.prototype, "leafItemCount", void 0);
|
|
28622
|
+
__decorate$1([
|
|
28623
|
+
observable
|
|
28624
|
+
], TableGroupRow.prototype, "groupColumn", void 0);
|
|
28625
|
+
__decorate$1([
|
|
28626
|
+
attr({ mode: 'boolean' })
|
|
28627
|
+
], TableGroupRow.prototype, "expanded", void 0);
|
|
28628
|
+
__decorate$1([
|
|
28629
|
+
observable
|
|
28630
|
+
], TableGroupRow.prototype, "animationClass", void 0);
|
|
28631
|
+
const nimbleTableGroupRow = TableGroupRow.compose({
|
|
28632
|
+
baseName: 'table-group-row',
|
|
28633
|
+
template: template$8,
|
|
28634
|
+
styles: styles$c
|
|
28635
|
+
});
|
|
28636
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableGroupRow());
|
|
28637
|
+
const tableGroupRowTag = DesignSystem.tagFor(TableGroupRow);
|
|
28638
|
+
|
|
28639
|
+
// prettier-ignore
|
|
28640
|
+
const template$7 = html `
|
|
28641
|
+
<template role="grid" ${children$1({ property: 'childItems', filter: elements() })}>
|
|
28200
28642
|
<div class="table-container" style="
|
|
28201
28643
|
--ni-private-table-scroll-x: -${x => x.scrollX}px;
|
|
28202
28644
|
--ni-private-table-header-scrollbar-spacer-width: ${x => x.virtualizer.headerContainerMarginRight}px;
|
|
@@ -28226,23 +28668,41 @@
|
|
|
28226
28668
|
role="rowgroup">
|
|
28227
28669
|
${when(x => x.columns.length > 0 && x.canRenderRows, html `
|
|
28228
28670
|
${repeat(x => x.virtualizer.visibleItems, html `
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28671
|
+
${when((x, c) => c.parent.tableData[x.index]?.isGrouped, html `
|
|
28672
|
+
<${tableGroupRowTag}
|
|
28673
|
+
class="group-row"
|
|
28674
|
+
:groupRowValue="${(x, c) => c.parent.tableData[x.index]?.groupRowValue}"
|
|
28675
|
+
?expanded="${(x, c) => c.parent.tableData[x.index]?.isExpanded}"
|
|
28676
|
+
:nestingLevel="${(x, c) => c.parent.tableData[x.index]?.nestingLevel}"
|
|
28677
|
+
:leafItemCount="${(x, c) => c.parent.tableData[x.index]?.leafItemCount}"
|
|
28678
|
+
:groupColumn="${(x, c) => c.parent.tableData[x.index]?.groupColumn}"
|
|
28679
|
+
@group-expand-toggle="${(x, c) => c.parent.handleGroupRowExpanded(x.index, c.event)}"
|
|
28680
|
+
>
|
|
28681
|
+
</${tableGroupRowTag}>
|
|
28682
|
+
`)}
|
|
28683
|
+
${when((x, c) => !c.parent.tableData[x.index]?.isGrouped, html `
|
|
28684
|
+
<${tableRowTag}
|
|
28685
|
+
class="row"
|
|
28686
|
+
record-id="${(x, c) => c.parent.tableData[x.index]?.id}"
|
|
28687
|
+
?selectable="${(_, c) => c.parent.selectionMode !== TableRowSelectionMode.none}"
|
|
28688
|
+
?selected="${(x, c) => c.parent.tableData[x.index]?.selectionState === TableRowSelectionState.selected}"
|
|
28689
|
+
:dataRecord="${(x, c) => c.parent.tableData[x.index]?.record}"
|
|
28690
|
+
:columns="${(_, c) => c.parent.columns}"
|
|
28691
|
+
:nestingLevel="${(x, c) => c.parent.tableData[x.index]?.nestingLevel}"
|
|
28692
|
+
@click="${async (x, c) => c.parent.onRowClick(x.index)}"
|
|
28693
|
+
@row-action-menu-beforetoggle="${(_, c) => c.parent.onRowActionMenuBeforeToggle(c.event)}"
|
|
28694
|
+
@row-action-menu-toggle="${(_, c) => c.parent.onRowActionMenuToggle(c.event)}"
|
|
28695
|
+
>
|
|
28696
|
+
${when((x, c) => c.parent.openActionMenuRecordId === c.parent.tableData[x.index]?.id, html `
|
|
28697
|
+
${repeat((_, c) => c.parent.actionMenuSlots, html `
|
|
28698
|
+
<slot
|
|
28699
|
+
name="${x => x}"
|
|
28700
|
+
slot="${x => `row-action-menu-${x}`}">
|
|
28701
|
+
</slot>
|
|
28702
|
+
`)}
|
|
28703
|
+
`)}
|
|
28704
|
+
</${tableRowTag}>
|
|
28705
|
+
`)}
|
|
28246
28706
|
`)}
|
|
28247
28707
|
`)}
|
|
28248
28708
|
</div>
|
|
@@ -28901,12 +29361,13 @@
|
|
|
28901
29361
|
* @internal
|
|
28902
29362
|
*/
|
|
28903
29363
|
class Virtualizer {
|
|
28904
|
-
constructor(table) {
|
|
29364
|
+
constructor(table, tanStackTable) {
|
|
28905
29365
|
this.visibleItems = [];
|
|
28906
29366
|
this.allRowsHeight = 0;
|
|
28907
29367
|
this.headerContainerMarginRight = 0;
|
|
28908
29368
|
this.rowContainerYOffset = 0;
|
|
28909
29369
|
this.table = table;
|
|
29370
|
+
this.tanStackTable = tanStackTable;
|
|
28910
29371
|
this.viewportResizeObserver = new ResizeObserver(entries => {
|
|
28911
29372
|
const borderBoxSize = entries[0]?.borderBoxSize[0];
|
|
28912
29373
|
if (borderBoxSize) {
|
|
@@ -28944,7 +29405,7 @@
|
|
|
28944
29405
|
const rowHeight = parseFloat(controlHeight.getValueFor(this.table))
|
|
28945
29406
|
+ 2 * parseFloat(borderWidth.getValueFor(this.table));
|
|
28946
29407
|
return {
|
|
28947
|
-
count: this.
|
|
29408
|
+
count: this.tanStackTable.getRowModel().rows.length,
|
|
28948
29409
|
getScrollElement: () => {
|
|
28949
29410
|
return this.table.viewport;
|
|
28950
29411
|
},
|
|
@@ -29057,11 +29518,13 @@
|
|
|
29057
29518
|
constructor(table) {
|
|
29058
29519
|
this.requiredUpdates = {
|
|
29059
29520
|
rowIds: false,
|
|
29521
|
+
groupRows: false,
|
|
29060
29522
|
columnIds: false,
|
|
29061
29523
|
columnSort: false,
|
|
29062
29524
|
columnWidths: false,
|
|
29063
29525
|
columnDefinition: false,
|
|
29064
|
-
actionMenuSlots: false
|
|
29526
|
+
actionMenuSlots: false,
|
|
29527
|
+
selectionMode: false
|
|
29065
29528
|
};
|
|
29066
29529
|
this.updateQueued = false;
|
|
29067
29530
|
this.table = table;
|
|
@@ -29069,6 +29532,9 @@
|
|
|
29069
29532
|
get updateRowIds() {
|
|
29070
29533
|
return this.requiredUpdates.rowIds;
|
|
29071
29534
|
}
|
|
29535
|
+
get updateGroupRows() {
|
|
29536
|
+
return this.requiredUpdates.groupRows;
|
|
29537
|
+
}
|
|
29072
29538
|
get updateColumnIds() {
|
|
29073
29539
|
return this.requiredUpdates.columnIds;
|
|
29074
29540
|
}
|
|
@@ -29084,10 +29550,15 @@
|
|
|
29084
29550
|
get updateActionMenuSlots() {
|
|
29085
29551
|
return this.requiredUpdates.actionMenuSlots;
|
|
29086
29552
|
}
|
|
29553
|
+
get updateSelectionMode() {
|
|
29554
|
+
return this.requiredUpdates.selectionMode;
|
|
29555
|
+
}
|
|
29087
29556
|
get requiresTanStackUpdate() {
|
|
29088
29557
|
return (this.requiredUpdates.rowIds
|
|
29089
29558
|
|| this.requiredUpdates.columnSort
|
|
29090
|
-
|| this.requiredUpdates.columnDefinition
|
|
29559
|
+
|| this.requiredUpdates.columnDefinition
|
|
29560
|
+
|| this.requiredUpdates.groupRows
|
|
29561
|
+
|| this.requiredUpdates.selectionMode);
|
|
29091
29562
|
}
|
|
29092
29563
|
get requiresTanStackDataReset() {
|
|
29093
29564
|
return (this.requiredUpdates.rowIds || this.requiredUpdates.columnDefinition);
|
|
@@ -29096,6 +29567,9 @@
|
|
|
29096
29567
|
this.setAllKeys(true);
|
|
29097
29568
|
this.queueUpdate();
|
|
29098
29569
|
}
|
|
29570
|
+
get hasPendingUpdates() {
|
|
29571
|
+
return this.updateQueued;
|
|
29572
|
+
}
|
|
29099
29573
|
trackColumnPropertyChanged(changedColumnProperty) {
|
|
29100
29574
|
if (isColumnProperty(changedColumnProperty, 'columnId')) {
|
|
29101
29575
|
this.requiredUpdates.columnIds = true;
|
|
@@ -29112,6 +29586,9 @@
|
|
|
29112
29586
|
else if (isColumnProperty(changedColumnProperty, 'actionMenuSlot')) {
|
|
29113
29587
|
this.requiredUpdates.actionMenuSlots = true;
|
|
29114
29588
|
}
|
|
29589
|
+
else if (isColumnProperty(changedColumnProperty, 'internalGroupIndex', 'internalGroupingDisabled')) {
|
|
29590
|
+
this.requiredUpdates.groupRows = true;
|
|
29591
|
+
}
|
|
29115
29592
|
this.queueUpdate();
|
|
29116
29593
|
}
|
|
29117
29594
|
trackColumnInstancesChanged() {
|
|
@@ -29120,12 +29597,17 @@
|
|
|
29120
29597
|
this.requiredUpdates.columnSort = true;
|
|
29121
29598
|
this.requiredUpdates.columnWidths = true;
|
|
29122
29599
|
this.requiredUpdates.actionMenuSlots = true;
|
|
29600
|
+
this.requiredUpdates.groupRows = true;
|
|
29123
29601
|
this.queueUpdate();
|
|
29124
29602
|
}
|
|
29125
29603
|
trackIdFieldNameChanged() {
|
|
29126
29604
|
this.requiredUpdates.rowIds = true;
|
|
29127
29605
|
this.queueUpdate();
|
|
29128
29606
|
}
|
|
29607
|
+
trackSelectionModeChanged() {
|
|
29608
|
+
this.requiredUpdates.selectionMode = true;
|
|
29609
|
+
this.queueUpdate();
|
|
29610
|
+
}
|
|
29129
29611
|
setAllKeys(value) {
|
|
29130
29612
|
Object.keys(this.requiredUpdates).forEach(key => {
|
|
29131
29613
|
this.requiredUpdates[key] = value;
|
|
@@ -29176,6 +29658,7 @@
|
|
|
29176
29658
|
class Table extends FoundationElement {
|
|
29177
29659
|
constructor() {
|
|
29178
29660
|
super();
|
|
29661
|
+
this.selectionMode = TableRowSelectionMode.none;
|
|
29179
29662
|
/**
|
|
29180
29663
|
* @internal
|
|
29181
29664
|
*/
|
|
@@ -29207,34 +29690,120 @@
|
|
|
29207
29690
|
this.tableValidator = new TableValidator();
|
|
29208
29691
|
this.updateTracker = new UpdateTracker(this);
|
|
29209
29692
|
this.columnNotifiers = [];
|
|
29693
|
+
this.isInitialized = false;
|
|
29694
|
+
this.collapsedRows = new Set();
|
|
29210
29695
|
this.onViewPortScroll = (event) => {
|
|
29211
29696
|
this.scrollX = event.target.scrollLeft;
|
|
29212
29697
|
};
|
|
29698
|
+
this.getIsRowExpanded = (row) => {
|
|
29699
|
+
if (!row.getIsGrouped()) {
|
|
29700
|
+
return false;
|
|
29701
|
+
}
|
|
29702
|
+
const expandedState = this.table.options.state.expanded;
|
|
29703
|
+
if (expandedState === true) {
|
|
29704
|
+
return true;
|
|
29705
|
+
}
|
|
29706
|
+
if (Object.keys(expandedState ?? {}).includes(row.id)) {
|
|
29707
|
+
return expandedState[row.id];
|
|
29708
|
+
}
|
|
29709
|
+
return !this.collapsedRows.has(row.id);
|
|
29710
|
+
};
|
|
29711
|
+
this.handleRowSelectionChange = (updaterOrValue) => {
|
|
29712
|
+
const rowSelectionState = updaterOrValue instanceof Function
|
|
29713
|
+
? updaterOrValue(this.table.getState().rowSelection)
|
|
29714
|
+
: updaterOrValue;
|
|
29715
|
+
this.updateTableOptions({
|
|
29716
|
+
state: {
|
|
29717
|
+
rowSelection: rowSelectionState
|
|
29718
|
+
}
|
|
29719
|
+
});
|
|
29720
|
+
};
|
|
29721
|
+
this.handleExpandedChange = (updaterOrValue) => {
|
|
29722
|
+
const expandedState = updaterOrValue instanceof Function
|
|
29723
|
+
? updaterOrValue(this.table.getState().expanded)
|
|
29724
|
+
: updaterOrValue;
|
|
29725
|
+
this.updateTableOptions({
|
|
29726
|
+
state: {
|
|
29727
|
+
expanded: expandedState
|
|
29728
|
+
}
|
|
29729
|
+
});
|
|
29730
|
+
};
|
|
29213
29731
|
this.options = {
|
|
29214
29732
|
data: [],
|
|
29215
29733
|
onStateChange: (_) => { },
|
|
29734
|
+
onRowSelectionChange: this.handleRowSelectionChange,
|
|
29735
|
+
onExpandedChange: this.handleExpandedChange,
|
|
29216
29736
|
getCoreRowModel: getCoreRowModel(),
|
|
29217
29737
|
getSortedRowModel: getSortedRowModel(),
|
|
29738
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
29739
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
29740
|
+
getIsRowExpanded: this.getIsRowExpanded,
|
|
29218
29741
|
columns: [],
|
|
29219
|
-
state: {
|
|
29742
|
+
state: {
|
|
29743
|
+
rowSelection: {},
|
|
29744
|
+
grouping: [],
|
|
29745
|
+
expanded: true // Workaround until we can apply a fix to TanStack regarding leveraging our getIsRowExpanded implementation
|
|
29746
|
+
},
|
|
29747
|
+
enableRowSelection: false,
|
|
29220
29748
|
enableSorting: true,
|
|
29749
|
+
enableGrouping: true,
|
|
29221
29750
|
renderFallbackValue: null,
|
|
29222
29751
|
autoResetAll: false
|
|
29223
29752
|
};
|
|
29224
29753
|
this.table = createTable(this.options);
|
|
29225
|
-
this.virtualizer = new Virtualizer(this);
|
|
29754
|
+
this.virtualizer = new Virtualizer(this, this.table);
|
|
29226
29755
|
}
|
|
29227
29756
|
get validity() {
|
|
29228
29757
|
return this.tableValidator.getValidity();
|
|
29229
29758
|
}
|
|
29230
|
-
setData(newData) {
|
|
29231
|
-
this.
|
|
29759
|
+
async setData(newData) {
|
|
29760
|
+
await this.processPendingUpdates();
|
|
29761
|
+
const data = newData.map(record => {
|
|
29762
|
+
return { ...record };
|
|
29763
|
+
});
|
|
29764
|
+
const tanStackUpdates = {
|
|
29765
|
+
data
|
|
29766
|
+
};
|
|
29767
|
+
this.validateWithData(data);
|
|
29768
|
+
if (this.tableValidator.areRecordIdsValid()) {
|
|
29769
|
+
// Update the selection state to remove previously selected records that no longer exist in the
|
|
29770
|
+
// data set while maintaining the selection state of records that still exist in the data set.
|
|
29771
|
+
const previousSelection = await this.getSelectedRecordIds();
|
|
29772
|
+
tanStackUpdates.state = {
|
|
29773
|
+
rowSelection: this.calculateTanStackSelectionState(previousSelection)
|
|
29774
|
+
};
|
|
29775
|
+
}
|
|
29776
|
+
this.updateTableOptions(tanStackUpdates);
|
|
29777
|
+
}
|
|
29778
|
+
async getSelectedRecordIds() {
|
|
29779
|
+
await this.processPendingUpdates();
|
|
29780
|
+
const tanStackSelectionState = this.options.state.rowSelection;
|
|
29781
|
+
if (!tanStackSelectionState) {
|
|
29782
|
+
return [];
|
|
29783
|
+
}
|
|
29784
|
+
const selectedRecordIds = [];
|
|
29785
|
+
Object.entries(tanStackSelectionState).forEach(([recordId, isSelected]) => {
|
|
29786
|
+
if (isSelected) {
|
|
29787
|
+
selectedRecordIds.push(recordId);
|
|
29788
|
+
}
|
|
29789
|
+
});
|
|
29790
|
+
return selectedRecordIds;
|
|
29791
|
+
}
|
|
29792
|
+
async setSelectedRecordIds(recordIds) {
|
|
29793
|
+
await this.processPendingUpdates();
|
|
29794
|
+
if (this.selectionMode === TableRowSelectionMode.none) {
|
|
29795
|
+
return;
|
|
29796
|
+
}
|
|
29797
|
+
this.updateTableOptions({
|
|
29798
|
+
state: {
|
|
29799
|
+
rowSelection: this.calculateTanStackSelectionState(recordIds)
|
|
29800
|
+
}
|
|
29801
|
+
});
|
|
29232
29802
|
}
|
|
29233
29803
|
connectedCallback() {
|
|
29234
29804
|
super.connectedCallback();
|
|
29805
|
+
this.initialize();
|
|
29235
29806
|
this.virtualizer.connectedCallback();
|
|
29236
|
-
this.updateTracker.trackAllStateChanged();
|
|
29237
|
-
this.observeColumns();
|
|
29238
29807
|
this.viewport.addEventListener('scroll', this.onViewPortScroll, {
|
|
29239
29808
|
passive: true
|
|
29240
29809
|
});
|
|
@@ -29242,7 +29811,6 @@
|
|
|
29242
29811
|
disconnectedCallback() {
|
|
29243
29812
|
super.disconnectedCallback();
|
|
29244
29813
|
this.virtualizer.disconnectedCallback();
|
|
29245
|
-
this.removeColumnObservers();
|
|
29246
29814
|
this.viewport.removeEventListener('scroll', this.onViewPortScroll);
|
|
29247
29815
|
}
|
|
29248
29816
|
checkValidity() {
|
|
@@ -29260,16 +29828,42 @@
|
|
|
29260
29828
|
this.updateTracker.trackColumnPropertyChanged(args);
|
|
29261
29829
|
}
|
|
29262
29830
|
}
|
|
29831
|
+
/** @internal */
|
|
29832
|
+
async onRowClick(rowIndex) {
|
|
29833
|
+
if (this.selectionMode === TableRowSelectionMode.none) {
|
|
29834
|
+
return;
|
|
29835
|
+
}
|
|
29836
|
+
const row = this.table.getRowModel().rows[rowIndex];
|
|
29837
|
+
if (!row) {
|
|
29838
|
+
return;
|
|
29839
|
+
}
|
|
29840
|
+
const currentSelection = await this.getSelectedRecordIds();
|
|
29841
|
+
if (currentSelection.length === 1 && currentSelection[0] === row.id) {
|
|
29842
|
+
// The clicked row is already the only selected row. Do nothing.
|
|
29843
|
+
return;
|
|
29844
|
+
}
|
|
29845
|
+
this.table.toggleAllRowsSelected(false);
|
|
29846
|
+
row.toggleSelected(true);
|
|
29847
|
+
await this.emitSelectionChangeEvent();
|
|
29848
|
+
}
|
|
29849
|
+
/** @internal */
|
|
29263
29850
|
onRowActionMenuBeforeToggle(event) {
|
|
29851
|
+
event.stopImmediatePropagation();
|
|
29264
29852
|
this.openActionMenuRecordId = event.detail.recordIds[0];
|
|
29265
29853
|
this.$emit('action-menu-beforetoggle', event.detail);
|
|
29266
29854
|
}
|
|
29855
|
+
/** @internal */
|
|
29267
29856
|
onRowActionMenuToggle(event) {
|
|
29857
|
+
event.stopImmediatePropagation();
|
|
29268
29858
|
this.$emit('action-menu-toggle', event.detail);
|
|
29269
29859
|
if (!event.detail.newState) {
|
|
29270
29860
|
this.openActionMenuRecordId = undefined;
|
|
29271
29861
|
}
|
|
29272
29862
|
}
|
|
29863
|
+
handleGroupRowExpanded(rowIndex, event) {
|
|
29864
|
+
this.toggleGroupExpanded(rowIndex);
|
|
29865
|
+
event.stopPropagation();
|
|
29866
|
+
}
|
|
29273
29867
|
/**
|
|
29274
29868
|
* @internal
|
|
29275
29869
|
*/
|
|
@@ -29285,6 +29879,12 @@
|
|
|
29285
29879
|
this.updateRowGridColumns();
|
|
29286
29880
|
}
|
|
29287
29881
|
}
|
|
29882
|
+
selectionModeChanged(_prev, _next) {
|
|
29883
|
+
if (!this.$fastController.isConnected) {
|
|
29884
|
+
return;
|
|
29885
|
+
}
|
|
29886
|
+
this.updateTracker.trackSelectionModeChanged();
|
|
29887
|
+
}
|
|
29288
29888
|
idFieldNameChanged(_prev, _next) {
|
|
29289
29889
|
if (!this.$fastController.isConnected) {
|
|
29290
29890
|
return;
|
|
@@ -29304,6 +29904,24 @@
|
|
|
29304
29904
|
});
|
|
29305
29905
|
this.columnNotifiers = [];
|
|
29306
29906
|
}
|
|
29907
|
+
initialize() {
|
|
29908
|
+
if (this.isInitialized) {
|
|
29909
|
+
// The table is already initialized. There is nothing more to do.
|
|
29910
|
+
return;
|
|
29911
|
+
}
|
|
29912
|
+
this.isInitialized = true;
|
|
29913
|
+
// Initialize the controller to ensure that FAST functionality such as Observables work as expected.
|
|
29914
|
+
this.$fastController.onConnectedCallback();
|
|
29915
|
+
this.updateTracker.trackAllStateChanged();
|
|
29916
|
+
this.observeColumns();
|
|
29917
|
+
}
|
|
29918
|
+
async processPendingUpdates() {
|
|
29919
|
+
this.initialize();
|
|
29920
|
+
await DOM.nextUpdate();
|
|
29921
|
+
if (this.updateTracker.hasPendingUpdates) {
|
|
29922
|
+
throw new Error('Expected pending updates to be resolved');
|
|
29923
|
+
}
|
|
29924
|
+
}
|
|
29307
29925
|
observeColumns() {
|
|
29308
29926
|
this.removeColumnObservers();
|
|
29309
29927
|
for (const column of this.columns) {
|
|
@@ -29316,6 +29934,10 @@
|
|
|
29316
29934
|
return this.columns.filter(x => x.sortDirection !== TableColumnSortDirection.none
|
|
29317
29935
|
&& typeof x.sortIndex === 'number');
|
|
29318
29936
|
}
|
|
29937
|
+
getColumnsParticipatingInGrouping() {
|
|
29938
|
+
return this.columns.filter(x => !x.internalGroupingDisabled
|
|
29939
|
+
&& typeof x.internalGroupIndex === 'number');
|
|
29940
|
+
}
|
|
29319
29941
|
childItemsChanged() {
|
|
29320
29942
|
void this.updateColumnsFromChildItems();
|
|
29321
29943
|
}
|
|
@@ -29327,9 +29949,8 @@
|
|
|
29327
29949
|
this.columns = this.childItems.filter((x) => x instanceof TableColumn);
|
|
29328
29950
|
}
|
|
29329
29951
|
updateTanStack() {
|
|
29330
|
-
const updatedOptions = {
|
|
29331
|
-
|
|
29332
|
-
};
|
|
29952
|
+
const updatedOptions = {};
|
|
29953
|
+
updatedOptions.state = {};
|
|
29333
29954
|
if (this.updateTracker.updateColumnSort) {
|
|
29334
29955
|
updatedOptions.state.sorting = this.calculateTanStackSortState();
|
|
29335
29956
|
}
|
|
@@ -29338,11 +29959,21 @@
|
|
|
29338
29959
|
}
|
|
29339
29960
|
if (this.updateTracker.updateRowIds) {
|
|
29340
29961
|
updatedOptions.getRowId = this.calculateTanStackRowIdFunction();
|
|
29962
|
+
updatedOptions.state.rowSelection = {};
|
|
29963
|
+
}
|
|
29964
|
+
if (this.updateTracker.updateSelectionMode) {
|
|
29965
|
+
updatedOptions.enableRowSelection = this.selectionMode !== TableRowSelectionMode.none;
|
|
29966
|
+
updatedOptions.state.rowSelection = {};
|
|
29341
29967
|
}
|
|
29342
29968
|
if (this.updateTracker.requiresTanStackDataReset) {
|
|
29343
29969
|
// Perform a shallow copy of the data to trigger tanstack to regenerate the row models and columns.
|
|
29344
29970
|
updatedOptions.data = [...this.table.options.data];
|
|
29345
29971
|
}
|
|
29972
|
+
if (this.updateTracker.updateGroupRows) {
|
|
29973
|
+
updatedOptions.state.grouping = this.calculateTanStackGroupingState();
|
|
29974
|
+
updatedOptions.state.expanded = true;
|
|
29975
|
+
this.collapsedRows.clear();
|
|
29976
|
+
}
|
|
29346
29977
|
this.updateTableOptions(updatedOptions);
|
|
29347
29978
|
}
|
|
29348
29979
|
updateActionMenuSlots() {
|
|
@@ -29358,34 +29989,54 @@
|
|
|
29358
29989
|
this.rowGridColumns = TableLayoutHelper.getGridTemplateColumns(this.columns);
|
|
29359
29990
|
}
|
|
29360
29991
|
validate() {
|
|
29992
|
+
this.tableValidator.validateSelectionMode(this.selectionMode, this.idFieldName);
|
|
29361
29993
|
this.tableValidator.validateColumnIds(this.columns.map(x => x.columnId));
|
|
29362
29994
|
this.tableValidator.validateColumnSortIndices(this.getColumnsParticipatingInSorting().map(x => x.sortIndex));
|
|
29995
|
+
this.tableValidator.validateColumnGroupIndices(this.getColumnsParticipatingInGrouping().map(x => x.internalGroupIndex));
|
|
29363
29996
|
this.validateWithData(this.table.options.data);
|
|
29364
29997
|
}
|
|
29365
29998
|
validateWithData(data) {
|
|
29366
29999
|
this.tableValidator.validateRecordIds(data, this.idFieldName);
|
|
29367
30000
|
this.canRenderRows = this.checkValidity();
|
|
29368
30001
|
}
|
|
29369
|
-
|
|
29370
|
-
const
|
|
29371
|
-
|
|
29372
|
-
}
|
|
29373
|
-
this
|
|
29374
|
-
this.updateTableOptions({
|
|
29375
|
-
data
|
|
29376
|
-
});
|
|
30002
|
+
async emitSelectionChangeEvent() {
|
|
30003
|
+
const detail = {
|
|
30004
|
+
selectedRecordIds: await this.getSelectedRecordIds()
|
|
30005
|
+
};
|
|
30006
|
+
this.$emit('selection-change', detail);
|
|
29377
30007
|
}
|
|
29378
30008
|
refreshRows() {
|
|
29379
30009
|
const rows = this.table.getRowModel().rows;
|
|
29380
30010
|
this.tableData = rows.map(row => {
|
|
29381
30011
|
const rowState = {
|
|
29382
30012
|
record: row.original,
|
|
29383
|
-
id: row.id
|
|
30013
|
+
id: row.id,
|
|
30014
|
+
selectionState: row.getIsSelected()
|
|
30015
|
+
? TableRowSelectionState.selected
|
|
30016
|
+
: TableRowSelectionState.notSelected,
|
|
30017
|
+
isGrouped: row.getIsGrouped(),
|
|
30018
|
+
isExpanded: row.getIsExpanded(),
|
|
30019
|
+
groupRowValue: row.getIsGrouped()
|
|
30020
|
+
? row.getValue(row.groupingColumnId)
|
|
30021
|
+
: undefined,
|
|
30022
|
+
nestingLevel: row.depth,
|
|
30023
|
+
leafItemCount: row
|
|
30024
|
+
.getLeafRows()
|
|
30025
|
+
.filter(leafRow => leafRow.getLeafRows().length === 0)
|
|
30026
|
+
.length,
|
|
30027
|
+
groupColumn: this.getGroupRowColumn(row)
|
|
29384
30028
|
};
|
|
29385
30029
|
return rowState;
|
|
29386
30030
|
});
|
|
29387
30031
|
this.virtualizer.dataChanged();
|
|
29388
30032
|
}
|
|
30033
|
+
getGroupRowColumn(row) {
|
|
30034
|
+
const groupedId = row.groupingColumnId;
|
|
30035
|
+
if (groupedId !== undefined) {
|
|
30036
|
+
return this.columns.find(c => c.internalUniqueId === groupedId);
|
|
30037
|
+
}
|
|
30038
|
+
return undefined;
|
|
30039
|
+
}
|
|
29389
30040
|
updateTableOptions(updatedOptions) {
|
|
29390
30041
|
this.options = {
|
|
29391
30042
|
...this.options,
|
|
@@ -29395,6 +30046,18 @@
|
|
|
29395
30046
|
this.table.setOptions(this.options);
|
|
29396
30047
|
this.refreshRows();
|
|
29397
30048
|
}
|
|
30049
|
+
toggleGroupExpanded(rowIndex) {
|
|
30050
|
+
const row = this.table.getRowModel().rows[rowIndex];
|
|
30051
|
+
const wasExpanded = row.getIsExpanded();
|
|
30052
|
+
// must update the collapsedRows before toggling expanded state
|
|
30053
|
+
if (wasExpanded) {
|
|
30054
|
+
this.collapsedRows.add(row.id);
|
|
30055
|
+
}
|
|
30056
|
+
else {
|
|
30057
|
+
this.collapsedRows.delete(row.id);
|
|
30058
|
+
}
|
|
30059
|
+
row.toggleExpanded();
|
|
30060
|
+
}
|
|
29398
30061
|
calculateTanStackSortState() {
|
|
29399
30062
|
const sortedColumns = this.getColumnsParticipatingInSorting().sort((x, y) => x.sortIndex - y.sortIndex);
|
|
29400
30063
|
this.firstSortedColumn = sortedColumns.length
|
|
@@ -29407,6 +30070,10 @@
|
|
|
29407
30070
|
};
|
|
29408
30071
|
});
|
|
29409
30072
|
}
|
|
30073
|
+
calculateTanStackGroupingState() {
|
|
30074
|
+
const groupedColumns = this.getColumnsParticipatingInGrouping().sort((x, y) => x.internalGroupIndex - y.internalGroupIndex);
|
|
30075
|
+
return groupedColumns.map(column => column.internalUniqueId);
|
|
30076
|
+
}
|
|
29410
30077
|
calculateTanStackRowIdFunction() {
|
|
29411
30078
|
return this.idFieldName === null || this.idFieldName === undefined
|
|
29412
30079
|
? undefined
|
|
@@ -29427,10 +30094,26 @@
|
|
|
29427
30094
|
};
|
|
29428
30095
|
});
|
|
29429
30096
|
}
|
|
30097
|
+
calculateTanStackSelectionState(recordIdsToSelect) {
|
|
30098
|
+
if (this.selectionMode === TableRowSelectionMode.none) {
|
|
30099
|
+
return {};
|
|
30100
|
+
}
|
|
30101
|
+
const tanstackSelectionState = {};
|
|
30102
|
+
const selectableRecordIds = this.tableValidator.getPresentRecordIds(recordIdsToSelect);
|
|
30103
|
+
if (selectableRecordIds.length) {
|
|
30104
|
+
// In single selection mode, only select the first record ID that is requested
|
|
30105
|
+
const firstSelectableRecordId = selectableRecordIds[0];
|
|
30106
|
+
tanstackSelectionState[firstSelectableRecordId] = true;
|
|
30107
|
+
}
|
|
30108
|
+
return tanstackSelectionState;
|
|
30109
|
+
}
|
|
29430
30110
|
}
|
|
29431
30111
|
__decorate$1([
|
|
29432
30112
|
attr({ attribute: 'id-field-name' })
|
|
29433
30113
|
], Table.prototype, "idFieldName", void 0);
|
|
30114
|
+
__decorate$1([
|
|
30115
|
+
attr({ attribute: 'selection-mode' })
|
|
30116
|
+
], Table.prototype, "selectionMode", void 0);
|
|
29434
30117
|
__decorate$1([
|
|
29435
30118
|
observable
|
|
29436
30119
|
], Table.prototype, "tableData", void 0);
|
|
@@ -29463,13 +30146,13 @@
|
|
|
29463
30146
|
], Table.prototype, "firstSortedColumn", void 0);
|
|
29464
30147
|
const nimbleTable = Table.compose({
|
|
29465
30148
|
baseName: 'table',
|
|
29466
|
-
template: template$
|
|
29467
|
-
styles: styles$
|
|
30149
|
+
template: template$7,
|
|
30150
|
+
styles: styles$g
|
|
29468
30151
|
});
|
|
29469
30152
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTable());
|
|
29470
30153
|
DesignSystem.tagFor(Table);
|
|
29471
30154
|
|
|
29472
|
-
const styles$
|
|
30155
|
+
const styles$b = css `
|
|
29473
30156
|
:host {
|
|
29474
30157
|
display: contents;
|
|
29475
30158
|
}
|
|
@@ -29481,7 +30164,7 @@
|
|
|
29481
30164
|
}
|
|
29482
30165
|
`;
|
|
29483
30166
|
|
|
29484
|
-
const template$
|
|
30167
|
+
const template$6 = html `
|
|
29485
30168
|
<template>
|
|
29486
30169
|
<span class="header-content">
|
|
29487
30170
|
<slot></slot>
|
|
@@ -29528,6 +30211,123 @@
|
|
|
29528
30211
|
return FractionalWidthColumn;
|
|
29529
30212
|
}
|
|
29530
30213
|
|
|
30214
|
+
// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
|
|
30215
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
|
|
30216
|
+
function mixinGroupableColumnAPI(base) {
|
|
30217
|
+
/**
|
|
30218
|
+
* The Mixin that provides a concrete column with the API to allow grouping
|
|
30219
|
+
* by the values in that column.
|
|
30220
|
+
*/
|
|
30221
|
+
class GroupableColumn extends base {
|
|
30222
|
+
constructor() {
|
|
30223
|
+
super(...arguments);
|
|
30224
|
+
this.groupingDisabled = false;
|
|
30225
|
+
this.groupIndex = null;
|
|
30226
|
+
}
|
|
30227
|
+
groupingDisabledChanged() {
|
|
30228
|
+
this.internalGroupingDisabled = this.groupingDisabled;
|
|
30229
|
+
}
|
|
30230
|
+
groupIndexChanged() {
|
|
30231
|
+
if (typeof this.groupIndex === 'number') {
|
|
30232
|
+
this.internalGroupIndex = this.groupIndex;
|
|
30233
|
+
}
|
|
30234
|
+
else {
|
|
30235
|
+
this.internalGroupIndex = undefined;
|
|
30236
|
+
}
|
|
30237
|
+
}
|
|
30238
|
+
}
|
|
30239
|
+
attr({ attribute: 'grouping-disabled', mode: 'boolean' })(
|
|
30240
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
30241
|
+
GroupableColumn.prototype, 'groupingDisabled');
|
|
30242
|
+
attr({ attribute: 'group-index', converter: nullableNumberConverter })(
|
|
30243
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
30244
|
+
GroupableColumn.prototype, 'groupIndex');
|
|
30245
|
+
return GroupableColumn;
|
|
30246
|
+
}
|
|
30247
|
+
|
|
30248
|
+
/**
|
|
30249
|
+
* The base class for group header views, which are displayed in a TableGroupRow.
|
|
30250
|
+
* A TableColumn that uses the GroupableColumn mixin must provide a TableGroupHeaderView
|
|
30251
|
+
* type (linked via TableColumn.groupHeaderViewTag).
|
|
30252
|
+
*/
|
|
30253
|
+
class TableGroupHeaderView extends FoundationElement {
|
|
30254
|
+
}
|
|
30255
|
+
__decorate$1([
|
|
30256
|
+
observable
|
|
30257
|
+
], TableGroupHeaderView.prototype, "groupHeaderValue", void 0);
|
|
30258
|
+
__decorate$1([
|
|
30259
|
+
observable
|
|
30260
|
+
], TableGroupHeaderView.prototype, "columnConfig", void 0);
|
|
30261
|
+
|
|
30262
|
+
const template$5 = html `
|
|
30263
|
+
<span
|
|
30264
|
+
${ref('textSpan')}
|
|
30265
|
+
class="${x => (typeof x.groupHeaderValue === 'string' ? '' : 'placeholder')}"
|
|
30266
|
+
@mouseover="${x => x.updateTitleOverflow()}"
|
|
30267
|
+
@mouseout="${x => x.clearTitleOverflow()}"
|
|
30268
|
+
title="${x => (x.isValidContentAndHasOverflow && x.content
|
|
30269
|
+
? x.content
|
|
30270
|
+
: undefined)}"
|
|
30271
|
+
>
|
|
30272
|
+
${x => x.content}
|
|
30273
|
+
</span>
|
|
30274
|
+
`;
|
|
30275
|
+
|
|
30276
|
+
const styles$a = css `
|
|
30277
|
+
span {
|
|
30278
|
+
font: ${bodyFont};
|
|
30279
|
+
color: ${bodyFontColor};
|
|
30280
|
+
white-space: nowrap;
|
|
30281
|
+
overflow: hidden;
|
|
30282
|
+
text-overflow: ellipsis;
|
|
30283
|
+
}
|
|
30284
|
+
|
|
30285
|
+
.placeholder {
|
|
30286
|
+
color: ${controlLabelFontColor};
|
|
30287
|
+
}
|
|
30288
|
+
`;
|
|
30289
|
+
|
|
30290
|
+
/**
|
|
30291
|
+
* The custom element used to render a group row header for a group representing rows
|
|
30292
|
+
* grouped by a TableColumnText column.
|
|
30293
|
+
*/
|
|
30294
|
+
class TableColumnTextGroupHeaderView extends TableGroupHeaderView {
|
|
30295
|
+
constructor() {
|
|
30296
|
+
super(...arguments);
|
|
30297
|
+
/** @internal */
|
|
30298
|
+
this.isValidContentAndHasOverflow = false;
|
|
30299
|
+
}
|
|
30300
|
+
get content() {
|
|
30301
|
+
return typeof this.groupHeaderValue === 'string'
|
|
30302
|
+
? this.groupHeaderValue
|
|
30303
|
+
: this.columnConfig?.placeholder ?? '';
|
|
30304
|
+
}
|
|
30305
|
+
updateTitleOverflow() {
|
|
30306
|
+
this.isValidContentAndHasOverflow = this.textSpan.offsetWidth < this.textSpan.scrollWidth;
|
|
30307
|
+
}
|
|
30308
|
+
clearTitleOverflow() {
|
|
30309
|
+
this.isValidContentAndHasOverflow = false;
|
|
30310
|
+
}
|
|
30311
|
+
}
|
|
30312
|
+
__decorate$1([
|
|
30313
|
+
observable
|
|
30314
|
+
], TableColumnTextGroupHeaderView.prototype, "columnConfig", void 0);
|
|
30315
|
+
__decorate$1([
|
|
30316
|
+
observable
|
|
30317
|
+
], TableColumnTextGroupHeaderView.prototype, "isValidContentAndHasOverflow", void 0);
|
|
30318
|
+
__decorate$1([
|
|
30319
|
+
volatile
|
|
30320
|
+
], TableColumnTextGroupHeaderView.prototype, "content", null);
|
|
30321
|
+
const tableColumnTextGroupHeaderView = TableColumnTextGroupHeaderView.compose({
|
|
30322
|
+
baseName: 'table-column-text-group-header',
|
|
30323
|
+
template: template$5,
|
|
30324
|
+
styles: styles$a
|
|
30325
|
+
});
|
|
30326
|
+
DesignSystem.getOrCreate()
|
|
30327
|
+
.withPrefix('nimble')
|
|
30328
|
+
.register(tableColumnTextGroupHeaderView());
|
|
30329
|
+
const tableColumnTextGroupHeaderTag = DesignSystem.tagFor(TableColumnTextGroupHeaderView);
|
|
30330
|
+
|
|
29531
30331
|
const styles$9 = css `
|
|
29532
30332
|
span {
|
|
29533
30333
|
font: ${bodyFont};
|
|
@@ -29614,12 +30414,16 @@
|
|
|
29614
30414
|
/**
|
|
29615
30415
|
* The table column for displaying strings.
|
|
29616
30416
|
*/
|
|
29617
|
-
class TableColumnText extends mixinFractionalWidthColumnAPI(TableColumnTextBase) {
|
|
30417
|
+
class TableColumnText extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(TableColumnTextBase)) {
|
|
30418
|
+
constructor() {
|
|
30419
|
+
super(...arguments);
|
|
30420
|
+
this.groupHeaderViewTag = tableColumnTextGroupHeaderTag;
|
|
30421
|
+
}
|
|
29618
30422
|
}
|
|
29619
30423
|
const nimbleTableColumnText = TableColumnText.compose({
|
|
29620
30424
|
baseName: 'table-column-text',
|
|
29621
|
-
template: template$
|
|
29622
|
-
styles: styles$
|
|
30425
|
+
template: template$6,
|
|
30426
|
+
styles: styles$b
|
|
29623
30427
|
});
|
|
29624
30428
|
DesignSystem.getOrCreate()
|
|
29625
30429
|
.withPrefix('nimble')
|
|
@@ -29717,7 +30521,7 @@
|
|
|
29717
30521
|
|
|
29718
30522
|
const styles$6 = css `
|
|
29719
30523
|
${display('inline-flex')}
|
|
29720
|
-
${styles$
|
|
30524
|
+
${styles$v}
|
|
29721
30525
|
|
|
29722
30526
|
:host {
|
|
29723
30527
|
font: ${bodyFont};
|
|
@@ -30063,7 +30867,7 @@
|
|
|
30063
30867
|
|
|
30064
30868
|
const styles$5 = css `
|
|
30065
30869
|
${display('inline-block')}
|
|
30066
|
-
${styles$
|
|
30870
|
+
${styles$v}
|
|
30067
30871
|
|
|
30068
30872
|
:host {
|
|
30069
30873
|
font: ${bodyFont};
|
|
@@ -30719,7 +31523,7 @@
|
|
|
30719
31523
|
.expand-collapse-button svg {
|
|
30720
31524
|
width: ${iconSize};
|
|
30721
31525
|
height: ${iconSize};
|
|
30722
|
-
transition: transform
|
|
31526
|
+
transition: transform ${mediumDelay} ease-in;
|
|
30723
31527
|
pointer-events: none;
|
|
30724
31528
|
fill: currentcolor;
|
|
30725
31529
|
}
|