@ni/nimble-components 18.5.6 → 18.5.8
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 +329 -55
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1579 -1539
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/cell/index.d.ts +1 -1
- package/dist/esm/table/components/cell/index.js.map +1 -1
- package/dist/esm/table/components/cell/template.d.ts +1 -1
- package/dist/esm/table/components/header/index.d.ts +6 -0
- package/dist/esm/table/components/header/index.js +32 -0
- package/dist/esm/table/components/header/index.js.map +1 -1
- package/dist/esm/table/components/header/styles.js +5 -0
- package/dist/esm/table/components/header/styles.js.map +1 -1
- package/dist/esm/table/components/header/template.js +15 -2
- package/dist/esm/table/components/header/template.js.map +1 -1
- package/dist/esm/table/components/row/index.d.ts +5 -1
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/components/row/template.d.ts +1 -1
- package/dist/esm/table/index.d.ts +13 -2
- package/dist/esm/table/index.js +62 -30
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/sort-operations.d.ts +7 -0
- package/dist/esm/table/models/sort-operations.js +36 -0
- package/dist/esm/table/models/sort-operations.js.map +1 -0
- package/dist/esm/table/models/table-validator.d.ts +2 -0
- package/dist/esm/table/models/table-validator.js +14 -1
- package/dist/esm/table/models/table-validator.js.map +1 -1
- package/dist/esm/table/template.js +6 -1
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table/types.d.ts +10 -17
- package/dist/esm/table/types.js +8 -1
- package/dist/esm/table/types.js.map +1 -1
- package/dist/esm/table-column/base/index.d.ts +23 -1
- package/dist/esm/table-column/base/index.js +25 -3
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/table-column/base/types.d.ts +26 -0
- package/dist/esm/table-column/base/types.js +15 -0
- package/dist/esm/table-column/base/types.js.map +1 -0
- package/dist/esm/table-column/text/index.d.ts +7 -1
- package/dist/esm/table-column/text/index.js +4 -1
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/dist/esm/table-column/text/template.d.ts +1 -1
- package/dist/esm/theme-provider/design-tokens.js +39 -20
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/table/models/table-validator.spec.d.ts +0 -1
- package/dist/esm/table/models/table-validator.spec.js +0 -276
- package/dist/esm/table/models/table-validator.spec.js.map +0 -1
|
@@ -16872,6 +16872,25 @@
|
|
|
16872
16872
|
.withPrefix('nimble')
|
|
16873
16873
|
.register(nimbleDesignSystemProvider());
|
|
16874
16874
|
|
|
16875
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
16876
|
+
const Headline1FallbackFontFamily = 'Noto Serif Fallback';
|
|
16877
|
+
const Headline2FallbackFontFamily = 'Noto Serif Fallback';
|
|
16878
|
+
const Title1FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16879
|
+
const Title2FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16880
|
+
const Title3FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16881
|
+
const Subtitle1FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16882
|
+
const Subtitle2FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16883
|
+
const LinkFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16884
|
+
const PlaceholderFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16885
|
+
const BodyFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16886
|
+
const BodyEmphasizedFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16887
|
+
const GroupLabel1FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16888
|
+
const ControlLabel1FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16889
|
+
const ButtonLabel1FallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16890
|
+
const TooltipCaptionFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16891
|
+
const ErrorLightUiFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16892
|
+
const GridHeaderFallbackFontFamily = 'Source Sans Pro Fallback';
|
|
16893
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
16875
16894
|
// Color Tokens
|
|
16876
16895
|
const actionRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.actionRgbPartialColor)).withDefault((element) => hexToRgbPartial(getColorForTheme(element, Black91, Black15, White)));
|
|
16877
16896
|
const applicationBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.applicationBackgroundColor)).withDefault((element) => getColorForTheme(element, White, Black85, ForestGreen));
|
|
@@ -16914,26 +16933,26 @@
|
|
|
16914
16933
|
const elevation2BoxShadow = DesignToken.create(styleNameFromTokenName(tokenNames.elevation2BoxShadow)).withDefault((element) => `0px 2px 4px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.16)}`);
|
|
16915
16934
|
const elevation3BoxShadow = DesignToken.create(styleNameFromTokenName(tokenNames.elevation3BoxShadow)).withDefault((element) => `0px 4px 8px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.3)}`);
|
|
16916
16935
|
// Font Tokens
|
|
16917
|
-
createFontTokens(tokenNames.headlineFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline1Family, Headline1Weight, Headline1Size, Headline1LineHeight,
|
|
16918
|
-
createFontTokens(tokenNames.headlinePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline2Family, Headline2Weight, Headline2Size, Headline2LineHeight,
|
|
16919
|
-
createFontTokens(tokenNames.titlePlus2Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title3Family, Title3Weight, Title3Size, Title3LineHeight,
|
|
16920
|
-
const [titlePlus1Font, titlePlus1FontColor, titlePlus1DisabledFontColor, titlePlus1FontFamily, titlePlus1FontWeight, titlePlus1FontSize, titlePlus1FontLineHeight, titlePlus1FallbackFontFamily] = createFontTokens(tokenNames.titlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title2Family, Title2Weight, Title2Size, Title2LineHeight,
|
|
16921
|
-
createFontTokens(tokenNames.titleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title1Family, Title1Weight, Title1Size, Title1LineHeight,
|
|
16922
|
-
createFontTokens(tokenNames.subtitlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle2Family, Subtitle2Weight, Subtitle2Size, Subtitle2LineHeight,
|
|
16923
|
-
const [subtitleFont, subtitleFontColor, subtitleDisabledFontColor, subtitleFontFamily, subtitleFontWeight, subtitleFontSize, subtitleFontLineHeight, subtitleFallbackFontFamily] = createFontTokens(tokenNames.subtitleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle1Family, Subtitle1Weight, Subtitle1Size, Subtitle1LineHeight,
|
|
16924
|
-
const [linkFont, linkFontColor, linkDisabledFontColor, linkFontFamily, linkFontWeight, linkFontSize, linkFontLineHeight, linkFallbackFontFamily] = createFontTokens(tokenNames.linkFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight,
|
|
16925
|
-
const [linkActiveFont, linkActiveFontColor, linkActiveDisabledFontColor, linkActiveFontFamily, linkActiveFontWeight, linkActiveFontSize, linkActiveFontLineHeight, linkActiveFallbackFontFamily] = createFontTokens(tokenNames.linkActiveFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, hexToRgbaCssColor(White, 0.6)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight,
|
|
16926
|
-
const [linkProminentFont, linkProminentFontColor, linkProminentDisabledFontColor, linkProminentFontFamily, linkProminentFontWeight, linkProminentFontSize, linkProminentFontLineHeight, linkProminentFallbackFontFamily] = createFontTokens(tokenNames.linkProminentFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight,
|
|
16927
|
-
const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight, linkActiveProminentFallbackFontFamily] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight,
|
|
16928
|
-
const [placeholderFont, placeholderFontColor, placeholderDisabledFontColor, placeholderFontFamily, placeholderFontWeight, placeholderFontSize, placeholderFontLineHeight, placeholderFallbackFontFamily] = createFontTokens(tokenNames.placeholderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), PlaceholderFamily, PlaceholderWeight, PlaceholderSize, PlaceholderLineHeight,
|
|
16929
|
-
const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight, bodyEmphasizedFontSize, bodyEmphasizedFontLineHeight, bodyEmphasizedFallbackFontFamily] = createFontTokens(tokenNames.bodyEmphasizedFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasizedSize, BodyEmphasizedLineHeight,
|
|
16930
|
-
const [bodyFont, bodyFontColor, bodyDisabledFontColor, bodyFontFamily, bodyFontWeight, bodyFontSize, bodyFontLineHeight, bodyFallbackFontFamily] = createFontTokens(tokenNames.bodyFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyFamily, BodyWeight, BodySize, BodyLineHeight,
|
|
16931
|
-
const [groupHeaderFont, groupHeaderFontColor, groupHeaderDisabledFontColor, groupHeaderFontFamily, groupHeaderFontWeight, groupHeaderFontSize, groupHeaderFontLineHeight, groupHeaderFallbackFontFamily] = createFontTokens(tokenNames.groupHeaderFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), GroupLabel1Family, GroupLabel1Weight, GroupLabel1Size, GroupLabel1LineHeight,
|
|
16932
|
-
const [controlLabelFont, controlLabelFontColor, controlLabelDisabledFontColor, controlLabelFontFamily, controlLabelFontWeight, controlLabelFontSize, controlLabelFontLineHeight, controlLabelFallbackFontFamily] = createFontTokens(tokenNames.controlLabelFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), ControlLabel1Family, ControlLabel1Weight, ControlLabel1Size, ControlLabel1LineHeight,
|
|
16933
|
-
const [buttonLabelFont, buttonLabelFontColor, buttonLabelDisabledFontColor, buttonLabelFontFamily, buttonLabelFontWeight, buttonLabelFontSize, buttonLabelFontLineHeight, buttonLabelFallbackFontFamily] = createFontTokens(tokenNames.buttonLabelFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), ButtonLabel1Family, ButtonLabel1Weight, ButtonLabel1Size, ButtonLabel1LineHeight,
|
|
16934
|
-
const [tooltipCaptionFont, tooltipCaptionFontColor, tooltipCaptionDisabledFontColor, tooltipCaptionFontFamily, tooltipCaptionFontWeight, tooltipCaptionFontSize, tooltipCaptionFontLineHeight, tooltipCaptionFallbackFontFamily] = createFontTokens(tokenNames.tooltipCaptionFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), TooltipCaptionFamily, TooltipCaptionWeight, TooltipCaptionSize, TooltipCaptionLineHeight,
|
|
16935
|
-
const [errorTextFont, errorTextFontColor, errorTextDisabledFontColor, errorTextFontFamily, errorTextFontWeight, errorTextFontSize, errorTextFontLineHeight, errorTextFallbackFontFamily] = createFontTokens(tokenNames.errorTextFont, (element) => getFailColorForTheme(element), (element) => hexToRgbaCssColor(getFailColorForTheme(element), 0.3), ErrorLightUiFamily, ErrorLightUiWeight, ErrorLightUiSize, TooltipCaptionLineHeight,
|
|
16936
|
-
const [tableHeaderFont, tableHeaderFontColor, tableHeaderDisabledFontColor, tableHeaderFontFamily, tableHeaderFontWeight, tableHeaderFontSize, tableHeaderFontLineHeight, tableHeaderFallbackFontFamily] = createFontTokens(tokenNames.tableHeaderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), GridHeaderFamily, GridHeaderWeight, GridHeaderSize, TooltipCaptionLineHeight,
|
|
16936
|
+
createFontTokens(tokenNames.headlineFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline1Family, Headline1Weight, Headline1Size, Headline1LineHeight, Headline1FallbackFontFamily);
|
|
16937
|
+
createFontTokens(tokenNames.headlinePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline2Family, Headline2Weight, Headline2Size, Headline2LineHeight, Headline2FallbackFontFamily);
|
|
16938
|
+
createFontTokens(tokenNames.titlePlus2Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title3Family, Title3Weight, Title3Size, Title3LineHeight, Title3FallbackFontFamily);
|
|
16939
|
+
const [titlePlus1Font, titlePlus1FontColor, titlePlus1DisabledFontColor, titlePlus1FontFamily, titlePlus1FontWeight, titlePlus1FontSize, titlePlus1FontLineHeight, titlePlus1FallbackFontFamily] = createFontTokens(tokenNames.titlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title2Family, Title2Weight, Title2Size, Title2LineHeight, Title2FallbackFontFamily);
|
|
16940
|
+
createFontTokens(tokenNames.titleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title1Family, Title1Weight, Title1Size, Title1LineHeight, Title1FallbackFontFamily);
|
|
16941
|
+
createFontTokens(tokenNames.subtitlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle2Family, Subtitle2Weight, Subtitle2Size, Subtitle2LineHeight, Subtitle2FallbackFontFamily);
|
|
16942
|
+
const [subtitleFont, subtitleFontColor, subtitleDisabledFontColor, subtitleFontFamily, subtitleFontWeight, subtitleFontSize, subtitleFontLineHeight, subtitleFallbackFontFamily] = createFontTokens(tokenNames.subtitleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle1Family, Subtitle1Weight, Subtitle1Size, Subtitle1LineHeight, Subtitle1FallbackFontFamily);
|
|
16943
|
+
const [linkFont, linkFontColor, linkDisabledFontColor, linkFontFamily, linkFontWeight, linkFontSize, linkFontLineHeight, linkFallbackFontFamily] = createFontTokens(tokenNames.linkFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
|
|
16944
|
+
const [linkActiveFont, linkActiveFontColor, linkActiveDisabledFontColor, linkActiveFontFamily, linkActiveFontWeight, linkActiveFontSize, linkActiveFontLineHeight, linkActiveFallbackFontFamily] = createFontTokens(tokenNames.linkActiveFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, hexToRgbaCssColor(White, 0.6)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
|
|
16945
|
+
const [linkProminentFont, linkProminentFontColor, linkProminentDisabledFontColor, linkProminentFontFamily, linkProminentFontWeight, linkProminentFontSize, linkProminentFontLineHeight, linkProminentFallbackFontFamily] = createFontTokens(tokenNames.linkProminentFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
|
|
16946
|
+
const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight, linkActiveProminentFallbackFontFamily] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
|
|
16947
|
+
const [placeholderFont, placeholderFontColor, placeholderDisabledFontColor, placeholderFontFamily, placeholderFontWeight, placeholderFontSize, placeholderFontLineHeight, placeholderFallbackFontFamily] = createFontTokens(tokenNames.placeholderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), PlaceholderFamily, PlaceholderWeight, PlaceholderSize, PlaceholderLineHeight, PlaceholderFallbackFontFamily);
|
|
16948
|
+
const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight, bodyEmphasizedFontSize, bodyEmphasizedFontLineHeight, bodyEmphasizedFallbackFontFamily] = createFontTokens(tokenNames.bodyEmphasizedFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasizedSize, BodyEmphasizedLineHeight, BodyEmphasizedFallbackFontFamily);
|
|
16949
|
+
const [bodyFont, bodyFontColor, bodyDisabledFontColor, bodyFontFamily, bodyFontWeight, bodyFontSize, bodyFontLineHeight, bodyFallbackFontFamily] = createFontTokens(tokenNames.bodyFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyFamily, BodyWeight, BodySize, BodyLineHeight, BodyFallbackFontFamily);
|
|
16950
|
+
const [groupHeaderFont, groupHeaderFontColor, groupHeaderDisabledFontColor, groupHeaderFontFamily, groupHeaderFontWeight, groupHeaderFontSize, groupHeaderFontLineHeight, groupHeaderFallbackFontFamily] = createFontTokens(tokenNames.groupHeaderFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), GroupLabel1Family, GroupLabel1Weight, GroupLabel1Size, GroupLabel1LineHeight, GroupLabel1FallbackFontFamily);
|
|
16951
|
+
const [controlLabelFont, controlLabelFontColor, controlLabelDisabledFontColor, controlLabelFontFamily, controlLabelFontWeight, controlLabelFontSize, controlLabelFontLineHeight, controlLabelFallbackFontFamily] = createFontTokens(tokenNames.controlLabelFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), ControlLabel1Family, ControlLabel1Weight, ControlLabel1Size, ControlLabel1LineHeight, ControlLabel1FallbackFontFamily);
|
|
16952
|
+
const [buttonLabelFont, buttonLabelFontColor, buttonLabelDisabledFontColor, buttonLabelFontFamily, buttonLabelFontWeight, buttonLabelFontSize, buttonLabelFontLineHeight, buttonLabelFallbackFontFamily] = createFontTokens(tokenNames.buttonLabelFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), ButtonLabel1Family, ButtonLabel1Weight, ButtonLabel1Size, ButtonLabel1LineHeight, ButtonLabel1FallbackFontFamily);
|
|
16953
|
+
const [tooltipCaptionFont, tooltipCaptionFontColor, tooltipCaptionDisabledFontColor, tooltipCaptionFontFamily, tooltipCaptionFontWeight, tooltipCaptionFontSize, tooltipCaptionFontLineHeight, tooltipCaptionFallbackFontFamily] = createFontTokens(tokenNames.tooltipCaptionFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), TooltipCaptionFamily, TooltipCaptionWeight, TooltipCaptionSize, TooltipCaptionLineHeight, TooltipCaptionFallbackFontFamily);
|
|
16954
|
+
const [errorTextFont, errorTextFontColor, errorTextDisabledFontColor, errorTextFontFamily, errorTextFontWeight, errorTextFontSize, errorTextFontLineHeight, errorTextFallbackFontFamily] = createFontTokens(tokenNames.errorTextFont, (element) => getFailColorForTheme(element), (element) => hexToRgbaCssColor(getFailColorForTheme(element), 0.3), ErrorLightUiFamily, ErrorLightUiWeight, ErrorLightUiSize, TooltipCaptionLineHeight, ErrorLightUiFallbackFontFamily);
|
|
16955
|
+
const [tableHeaderFont, tableHeaderFontColor, tableHeaderDisabledFontColor, tableHeaderFontFamily, tableHeaderFontWeight, tableHeaderFontSize, tableHeaderFontLineHeight, tableHeaderFallbackFontFamily] = createFontTokens(tokenNames.tableHeaderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), GridHeaderFamily, GridHeaderWeight, GridHeaderSize, TooltipCaptionLineHeight, GridHeaderFallbackFontFamily);
|
|
16937
16956
|
// Font Transform Tokens
|
|
16938
16957
|
const groupHeaderTextTransform = DesignToken.create(styleNameFromTokenName(tokenNames.groupHeaderTextTransform)).withDefault('uppercase');
|
|
16939
16958
|
// Animation Tokens
|
|
@@ -26867,13 +26886,123 @@
|
|
|
26867
26886
|
});
|
|
26868
26887
|
}
|
|
26869
26888
|
|
|
26889
|
+
function getSortedRowModel() {
|
|
26890
|
+
return table => memo$1(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
|
|
26891
|
+
if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
|
|
26892
|
+
return rowModel;
|
|
26893
|
+
}
|
|
26894
|
+
const sortingState = table.getState().sorting;
|
|
26895
|
+
const sortedFlatRows = [];
|
|
26896
|
+
|
|
26897
|
+
// Filter out sortings that correspond to non existing columns
|
|
26898
|
+
const availableSorting = sortingState.filter(sort => {
|
|
26899
|
+
var _table$getColumn;
|
|
26900
|
+
return (_table$getColumn = table.getColumn(sort.id)) == null ? void 0 : _table$getColumn.getCanSort();
|
|
26901
|
+
});
|
|
26902
|
+
const columnInfoById = {};
|
|
26903
|
+
availableSorting.forEach(sortEntry => {
|
|
26904
|
+
const column = table.getColumn(sortEntry.id);
|
|
26905
|
+
if (!column) return;
|
|
26906
|
+
columnInfoById[sortEntry.id] = {
|
|
26907
|
+
sortUndefined: column.columnDef.sortUndefined,
|
|
26908
|
+
invertSorting: column.columnDef.invertSorting,
|
|
26909
|
+
sortingFn: column.getSortingFn()
|
|
26910
|
+
};
|
|
26911
|
+
});
|
|
26912
|
+
const sortData = rows => {
|
|
26913
|
+
// This will also perform a stable sorting using the row index
|
|
26914
|
+
// if needed.
|
|
26915
|
+
const sortedData = [...rows];
|
|
26916
|
+
sortedData.sort((rowA, rowB) => {
|
|
26917
|
+
for (let i = 0; i < availableSorting.length; i += 1) {
|
|
26918
|
+
var _sortEntry$desc;
|
|
26919
|
+
const sortEntry = availableSorting[i];
|
|
26920
|
+
const columnInfo = columnInfoById[sortEntry.id];
|
|
26921
|
+
const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
|
|
26922
|
+
if (columnInfo.sortUndefined) {
|
|
26923
|
+
const aValue = rowA.getValue(sortEntry.id);
|
|
26924
|
+
const bValue = rowB.getValue(sortEntry.id);
|
|
26925
|
+
const aUndefined = typeof aValue === 'undefined';
|
|
26926
|
+
const bUndefined = typeof bValue === 'undefined';
|
|
26927
|
+
if (aUndefined || bUndefined) {
|
|
26928
|
+
return aUndefined && bUndefined ? 0 : aUndefined ? columnInfo.sortUndefined : -columnInfo.sortUndefined;
|
|
26929
|
+
}
|
|
26930
|
+
}
|
|
26931
|
+
|
|
26932
|
+
// This function should always return in ascending order
|
|
26933
|
+
let sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
|
|
26934
|
+
if (sortInt !== 0) {
|
|
26935
|
+
if (isDesc) {
|
|
26936
|
+
sortInt *= -1;
|
|
26937
|
+
}
|
|
26938
|
+
if (columnInfo.invertSorting) {
|
|
26939
|
+
sortInt *= -1;
|
|
26940
|
+
}
|
|
26941
|
+
return sortInt;
|
|
26942
|
+
}
|
|
26943
|
+
}
|
|
26944
|
+
return rowA.index - rowB.index;
|
|
26945
|
+
});
|
|
26946
|
+
|
|
26947
|
+
// If there are sub-rows, sort them
|
|
26948
|
+
sortedData.forEach(row => {
|
|
26949
|
+
var _row$subRows;
|
|
26950
|
+
sortedFlatRows.push(row);
|
|
26951
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
|
|
26952
|
+
row.subRows = sortData(row.subRows);
|
|
26953
|
+
}
|
|
26954
|
+
});
|
|
26955
|
+
return sortedData;
|
|
26956
|
+
};
|
|
26957
|
+
return {
|
|
26958
|
+
rows: sortData(rowModel.rows),
|
|
26959
|
+
flatRows: sortedFlatRows,
|
|
26960
|
+
rowsById: rowModel.rowsById
|
|
26961
|
+
};
|
|
26962
|
+
}, {
|
|
26963
|
+
key: 'getSortedRowModel',
|
|
26964
|
+
debug: () => {
|
|
26965
|
+
var _table$options$debugA;
|
|
26966
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
26967
|
+
},
|
|
26968
|
+
onChange: () => {
|
|
26969
|
+
table._autoResetPageIndex();
|
|
26970
|
+
}
|
|
26971
|
+
});
|
|
26972
|
+
}
|
|
26973
|
+
|
|
26974
|
+
/**
|
|
26975
|
+
* The possible directions a table column can be sorted in.
|
|
26976
|
+
*/
|
|
26977
|
+
const TableColumnSortDirection = {
|
|
26978
|
+
none: undefined,
|
|
26979
|
+
ascending: 'ascending',
|
|
26980
|
+
descending: 'descending'
|
|
26981
|
+
};
|
|
26982
|
+
|
|
26983
|
+
/**
|
|
26984
|
+
* The possible operations to use when sorting a table column.
|
|
26985
|
+
*/
|
|
26986
|
+
const TableColumnSortOperation = {
|
|
26987
|
+
/**
|
|
26988
|
+
* Performs a sort using `===`, `<`, and `>` operators
|
|
26989
|
+
*/
|
|
26990
|
+
basic: 'basic',
|
|
26991
|
+
/**
|
|
26992
|
+
* Performs a locale-aware case-sensitive string sort on the columns.
|
|
26993
|
+
* Only use this sort operation if the field is of type `string | undefined | null`.
|
|
26994
|
+
*/
|
|
26995
|
+
localeAwareCaseSensitive: 'localeAwareCaseSensitive'
|
|
26996
|
+
};
|
|
26997
|
+
|
|
26870
26998
|
/**
|
|
26871
26999
|
* The base class for table columns
|
|
26872
27000
|
*/
|
|
26873
27001
|
class TableColumn extends FoundationElement {
|
|
26874
27002
|
constructor() {
|
|
26875
|
-
super(
|
|
27003
|
+
super();
|
|
26876
27004
|
this.columnHidden = false;
|
|
27005
|
+
this.sortDirection = TableColumnSortDirection.none;
|
|
26877
27006
|
/**
|
|
26878
27007
|
* @internal
|
|
26879
27008
|
*
|
|
@@ -26881,13 +27010,20 @@
|
|
|
26881
27010
|
* This array is parallel with the field names specified by `cellRecordFieldNames`.
|
|
26882
27011
|
*/
|
|
26883
27012
|
this.dataRecordFieldNames = [];
|
|
27013
|
+
/**
|
|
27014
|
+
* @internal
|
|
27015
|
+
*
|
|
27016
|
+
* The operation to use when sorting the table by this column.
|
|
27017
|
+
*/
|
|
27018
|
+
this.sortOperation = TableColumnSortOperation.basic;
|
|
27019
|
+
this.internalUniqueId = uniqueId('table-column-slot');
|
|
26884
27020
|
}
|
|
26885
27021
|
/**
|
|
26886
27022
|
* @internal
|
|
26887
27023
|
*/
|
|
26888
27024
|
connectedCallback() {
|
|
26889
27025
|
super.connectedCallback();
|
|
26890
|
-
this.setAttribute('slot',
|
|
27026
|
+
this.setAttribute('slot', this.internalUniqueId);
|
|
26891
27027
|
}
|
|
26892
27028
|
}
|
|
26893
27029
|
__decorate$1([
|
|
@@ -26902,12 +27038,24 @@
|
|
|
26902
27038
|
__decorate$1([
|
|
26903
27039
|
attr({ attribute: 'column-hidden', mode: 'boolean' })
|
|
26904
27040
|
], TableColumn.prototype, "columnHidden", void 0);
|
|
27041
|
+
__decorate$1([
|
|
27042
|
+
attr({ attribute: 'sort-index', converter: nullableNumberConverter })
|
|
27043
|
+
], TableColumn.prototype, "sortIndex", void 0);
|
|
27044
|
+
__decorate$1([
|
|
27045
|
+
attr({ attribute: 'sort-direction' })
|
|
27046
|
+
], TableColumn.prototype, "sortDirection", void 0);
|
|
26905
27047
|
__decorate$1([
|
|
26906
27048
|
observable
|
|
26907
27049
|
], TableColumn.prototype, "dataRecordFieldNames", void 0);
|
|
26908
27050
|
__decorate$1([
|
|
26909
27051
|
observable
|
|
26910
27052
|
], TableColumn.prototype, "columnConfig", void 0);
|
|
27053
|
+
__decorate$1([
|
|
27054
|
+
observable
|
|
27055
|
+
], TableColumn.prototype, "operandDataRecordFieldName", void 0);
|
|
27056
|
+
__decorate$1([
|
|
27057
|
+
observable
|
|
27058
|
+
], TableColumn.prototype, "sortOperation", void 0);
|
|
26911
27059
|
|
|
26912
27060
|
/**
|
|
26913
27061
|
* Helper class for the nimble-table to validate that the table's configuration
|
|
@@ -26920,6 +27068,7 @@
|
|
|
26920
27068
|
this.invalidRecordId = false;
|
|
26921
27069
|
this.duplicateColumnId = false;
|
|
26922
27070
|
this.missingColumnId = false;
|
|
27071
|
+
this.duplicateSortIndex = false;
|
|
26923
27072
|
}
|
|
26924
27073
|
getValidity() {
|
|
26925
27074
|
return {
|
|
@@ -26927,7 +27076,8 @@
|
|
|
26927
27076
|
missingRecordId: this.missingRecordId,
|
|
26928
27077
|
invalidRecordId: this.invalidRecordId,
|
|
26929
27078
|
duplicateColumnId: this.duplicateColumnId,
|
|
26930
|
-
missingColumnId: this.missingColumnId
|
|
27079
|
+
missingColumnId: this.missingColumnId,
|
|
27080
|
+
duplicateSortIndex: this.duplicateSortIndex
|
|
26931
27081
|
};
|
|
26932
27082
|
}
|
|
26933
27083
|
isValid() {
|
|
@@ -26981,6 +27131,17 @@
|
|
|
26981
27131
|
}
|
|
26982
27132
|
return !this.missingColumnId && !this.duplicateColumnId;
|
|
26983
27133
|
}
|
|
27134
|
+
validateColumnSortIndices(sortIndices) {
|
|
27135
|
+
this.duplicateSortIndex = false;
|
|
27136
|
+
const sortIndexSet = new Set();
|
|
27137
|
+
for (const sortIndex of sortIndices) {
|
|
27138
|
+
if (sortIndexSet.has(sortIndex)) {
|
|
27139
|
+
this.duplicateSortIndex = true;
|
|
27140
|
+
}
|
|
27141
|
+
sortIndexSet.add(sortIndex);
|
|
27142
|
+
}
|
|
27143
|
+
return !this.duplicateSortIndex;
|
|
27144
|
+
}
|
|
26984
27145
|
}
|
|
26985
27146
|
|
|
26986
27147
|
const styles$d = css `
|
|
@@ -27081,12 +27242,26 @@
|
|
|
27081
27242
|
${iconColor.cssCustomProperty}: ${tableHeaderFontColor};
|
|
27082
27243
|
text-transform: uppercase;
|
|
27083
27244
|
}
|
|
27245
|
+
|
|
27246
|
+
.sort-indicator {
|
|
27247
|
+
padding: 0px calc(${standardPadding} / 2);
|
|
27248
|
+
width: ${standardPadding};
|
|
27249
|
+
}
|
|
27084
27250
|
`;
|
|
27085
27251
|
|
|
27086
27252
|
// prettier-ignore
|
|
27087
27253
|
const template$7 = html `
|
|
27088
|
-
<template role="columnheader">
|
|
27254
|
+
<template role="columnheader" aria-sort="${x => x.ariaSort}">
|
|
27089
27255
|
<slot></slot>
|
|
27256
|
+
|
|
27257
|
+
<span class="sort-indicator" aria-hidden="true">
|
|
27258
|
+
${when(x => x.sortDirection === TableColumnSortDirection.ascending, html `
|
|
27259
|
+
<${DesignSystem.tagFor(IconArrowUp)}></${DesignSystem.tagFor(IconArrowUp)}>
|
|
27260
|
+
`)}
|
|
27261
|
+
${when(x => x.sortDirection === TableColumnSortDirection.descending, html `
|
|
27262
|
+
<${DesignSystem.tagFor(IconArrowDown)}></${DesignSystem.tagFor(IconArrowDown)}>
|
|
27263
|
+
`)}
|
|
27264
|
+
</span>
|
|
27090
27265
|
</template>
|
|
27091
27266
|
`;
|
|
27092
27267
|
|
|
@@ -27095,7 +27270,36 @@
|
|
|
27095
27270
|
* @internal
|
|
27096
27271
|
*/
|
|
27097
27272
|
class TableHeader extends FoundationElement {
|
|
27273
|
+
constructor() {
|
|
27274
|
+
super(...arguments);
|
|
27275
|
+
this.sortDirection = TableColumnSortDirection.none;
|
|
27276
|
+
this.firstSortedColumn = false;
|
|
27277
|
+
}
|
|
27278
|
+
sortDirectionChanged(_prev, _next) {
|
|
27279
|
+
this.updateAriaSort();
|
|
27280
|
+
}
|
|
27281
|
+
firstSortedColumnChanged(_prev, _next) {
|
|
27282
|
+
this.updateAriaSort();
|
|
27283
|
+
}
|
|
27284
|
+
updateAriaSort() {
|
|
27285
|
+
if (!this.firstSortedColumn
|
|
27286
|
+
|| this.sortDirection === TableColumnSortDirection.none) {
|
|
27287
|
+
this.ariaSort = null;
|
|
27288
|
+
}
|
|
27289
|
+
else if (this.sortDirection === TableColumnSortDirection.ascending) {
|
|
27290
|
+
this.ariaSort = 'ascending';
|
|
27291
|
+
}
|
|
27292
|
+
else {
|
|
27293
|
+
this.ariaSort = 'descending';
|
|
27294
|
+
}
|
|
27295
|
+
}
|
|
27098
27296
|
}
|
|
27297
|
+
__decorate$1([
|
|
27298
|
+
attr({ attribute: 'sort-direction' })
|
|
27299
|
+
], TableHeader.prototype, "sortDirection", void 0);
|
|
27300
|
+
__decorate$1([
|
|
27301
|
+
attr({ attribute: 'first-sorted-column', mode: 'boolean' })
|
|
27302
|
+
], TableHeader.prototype, "firstSortedColumn", void 0);
|
|
27099
27303
|
const nimbleTableHeader = TableHeader.compose({
|
|
27100
27304
|
baseName: 'table-header',
|
|
27101
27305
|
template: template$7,
|
|
@@ -27355,7 +27559,11 @@
|
|
|
27355
27559
|
<div class="header-row" role="row">
|
|
27356
27560
|
${repeat(x => x.columns, html `
|
|
27357
27561
|
${when(x => !x.columnHidden, html `
|
|
27358
|
-
<${DesignSystem.tagFor(TableHeader)}
|
|
27562
|
+
<${DesignSystem.tagFor(TableHeader)}
|
|
27563
|
+
class="header"
|
|
27564
|
+
sort-direction="${x => (typeof x.sortIndex === 'number' ? x.sortDirection : TableColumnSortDirection.none)}"
|
|
27565
|
+
?first-sorted-column="${(x, c) => x === c.parent.firstSortedColumn}"
|
|
27566
|
+
>
|
|
27359
27567
|
<slot name="${x => x.slot}"></slot>
|
|
27360
27568
|
</${DesignSystem.tagFor(TableHeader)}>
|
|
27361
27569
|
`)}
|
|
@@ -28111,6 +28319,40 @@
|
|
|
28111
28319
|
observable
|
|
28112
28320
|
], Virtualizer.prototype, "rowContainerYOffset", void 0);
|
|
28113
28321
|
|
|
28322
|
+
/**
|
|
28323
|
+
* Returns the sorting function for TanStack to use based on the specified
|
|
28324
|
+
* TableColumnSortOperation
|
|
28325
|
+
*/
|
|
28326
|
+
function getTanStackSortingFunction(sortOperation) {
|
|
28327
|
+
switch (sortOperation) {
|
|
28328
|
+
case TableColumnSortOperation.basic:
|
|
28329
|
+
return sortingFns.basic;
|
|
28330
|
+
case TableColumnSortOperation.localeAwareCaseSensitive:
|
|
28331
|
+
return localeAwareCaseSensitiveSortFunction;
|
|
28332
|
+
default:
|
|
28333
|
+
return sortingFns.basic;
|
|
28334
|
+
}
|
|
28335
|
+
}
|
|
28336
|
+
/**
|
|
28337
|
+
* A function to perform locale-aware and case-senstitive sorting of two rows from
|
|
28338
|
+
* TanStack for a given column. The function sorts `undefined` followed by `null`
|
|
28339
|
+
* before all defined strings.
|
|
28340
|
+
*/
|
|
28341
|
+
function localeAwareCaseSensitiveSortFunction(rowA, rowB, columnId) {
|
|
28342
|
+
const valueA = rowA.getValue(columnId);
|
|
28343
|
+
const valueB = rowB.getValue(columnId);
|
|
28344
|
+
if (typeof valueA === 'string' && typeof valueB === 'string') {
|
|
28345
|
+
return valueA.localeCompare(valueB);
|
|
28346
|
+
}
|
|
28347
|
+
if (valueA === valueB) {
|
|
28348
|
+
return 0;
|
|
28349
|
+
}
|
|
28350
|
+
if (valueA === undefined || (valueA === null && valueB !== undefined)) {
|
|
28351
|
+
return -1;
|
|
28352
|
+
}
|
|
28353
|
+
return 1;
|
|
28354
|
+
}
|
|
28355
|
+
|
|
28114
28356
|
/**
|
|
28115
28357
|
* A nimble-styled table.
|
|
28116
28358
|
*/
|
|
@@ -28139,25 +28381,14 @@
|
|
|
28139
28381
|
this.canRenderRows = true;
|
|
28140
28382
|
this.tableValidator = new TableValidator();
|
|
28141
28383
|
this.columnNotifiers = [];
|
|
28142
|
-
this.update = (state) => {
|
|
28143
|
-
this.table.setOptions(prev => ({
|
|
28144
|
-
...prev,
|
|
28145
|
-
...this.options,
|
|
28146
|
-
state,
|
|
28147
|
-
onStateChange: (updater) => {
|
|
28148
|
-
const updatedState = typeof updater === 'function'
|
|
28149
|
-
? updater(state)
|
|
28150
|
-
: updater;
|
|
28151
|
-
this.update(updatedState);
|
|
28152
|
-
}
|
|
28153
|
-
}));
|
|
28154
|
-
};
|
|
28155
28384
|
this.options = {
|
|
28156
28385
|
data: [],
|
|
28157
28386
|
onStateChange: (_) => { },
|
|
28158
28387
|
getCoreRowModel: getCoreRowModel(),
|
|
28388
|
+
getSortedRowModel: getSortedRowModel(),
|
|
28159
28389
|
columns: [],
|
|
28160
28390
|
state: {},
|
|
28391
|
+
enableSorting: true,
|
|
28161
28392
|
renderFallbackValue: null,
|
|
28162
28393
|
autoResetAll: false
|
|
28163
28394
|
};
|
|
@@ -28168,7 +28399,6 @@
|
|
|
28168
28399
|
return this.tableValidator.getValidity();
|
|
28169
28400
|
}
|
|
28170
28401
|
setData(newData) {
|
|
28171
|
-
this.generateTanStackColumns(newData);
|
|
28172
28402
|
this.setTableData(newData);
|
|
28173
28403
|
}
|
|
28174
28404
|
connectedCallback() {
|
|
@@ -28196,6 +28426,14 @@
|
|
|
28196
28426
|
if (args === 'columnId') {
|
|
28197
28427
|
this.validateColumnIds();
|
|
28198
28428
|
}
|
|
28429
|
+
else if (args === 'operandDataRecordFieldName'
|
|
28430
|
+
|| args === 'sortOperation') {
|
|
28431
|
+
this.generateTanStackColumns();
|
|
28432
|
+
}
|
|
28433
|
+
else if (args === 'sortIndex' || args === 'sortDirection') {
|
|
28434
|
+
this.validateColumnSortIndices();
|
|
28435
|
+
this.setSortState();
|
|
28436
|
+
}
|
|
28199
28437
|
}
|
|
28200
28438
|
}
|
|
28201
28439
|
onRowActionMenuBeforeToggle(event) {
|
|
@@ -28218,6 +28456,8 @@
|
|
|
28218
28456
|
return;
|
|
28219
28457
|
}
|
|
28220
28458
|
this.validateAndObserveColumns();
|
|
28459
|
+
this.generateTanStackColumns();
|
|
28460
|
+
this.setSortState();
|
|
28221
28461
|
const slots = new Set();
|
|
28222
28462
|
for (const column of this.columns) {
|
|
28223
28463
|
if (column.actionMenuSlot) {
|
|
@@ -28240,11 +28480,20 @@
|
|
|
28240
28480
|
this.columnNotifiers.push(notifier);
|
|
28241
28481
|
}
|
|
28242
28482
|
this.validateColumnIds();
|
|
28483
|
+
this.validateColumnSortIndices();
|
|
28243
28484
|
}
|
|
28244
28485
|
validateColumnIds() {
|
|
28245
28486
|
this.tableValidator.validateColumnIds(this.columns.map(x => x.columnId));
|
|
28246
28487
|
this.canRenderRows = this.checkValidity();
|
|
28247
28488
|
}
|
|
28489
|
+
validateColumnSortIndices() {
|
|
28490
|
+
this.tableValidator.validateColumnSortIndices(this.getColumnsParticipatingInSorting().map(x => x.sortIndex));
|
|
28491
|
+
this.canRenderRows = this.checkValidity();
|
|
28492
|
+
}
|
|
28493
|
+
getColumnsParticipatingInSorting() {
|
|
28494
|
+
return this.columns.filter(x => x.sortDirection !== TableColumnSortDirection.none
|
|
28495
|
+
&& typeof x.sortIndex === 'number');
|
|
28496
|
+
}
|
|
28248
28497
|
async updateColumnsFromChildItems() {
|
|
28249
28498
|
const definedElements = this.childItems.map(async (item) => (item.matches(':not(:defined)')
|
|
28250
28499
|
? customElements.whenDefined(item.localName)
|
|
@@ -28278,27 +28527,47 @@
|
|
|
28278
28527
|
this.virtualizer.dataChanged();
|
|
28279
28528
|
}
|
|
28280
28529
|
updateTableOptions(updatedOptions) {
|
|
28281
|
-
this.options = {
|
|
28282
|
-
|
|
28530
|
+
this.options = {
|
|
28531
|
+
...this.options,
|
|
28532
|
+
...updatedOptions,
|
|
28533
|
+
state: { ...this.options.state, ...updatedOptions.state }
|
|
28534
|
+
};
|
|
28535
|
+
this.table.setOptions(this.options);
|
|
28283
28536
|
this.refreshRows();
|
|
28284
28537
|
}
|
|
28285
|
-
|
|
28286
|
-
|
|
28287
|
-
|
|
28288
|
-
|
|
28289
|
-
|
|
28290
|
-
|
|
28291
|
-
|
|
28292
|
-
|
|
28293
|
-
|
|
28538
|
+
setSortState() {
|
|
28539
|
+
const sortedColumns = this.getColumnsParticipatingInSorting().sort((x, y) => x.sortIndex - y.sortIndex);
|
|
28540
|
+
this.firstSortedColumn = sortedColumns.length
|
|
28541
|
+
? sortedColumns[0]
|
|
28542
|
+
: undefined;
|
|
28543
|
+
const tanStackSortingState = sortedColumns.map(column => {
|
|
28544
|
+
return {
|
|
28545
|
+
id: column.internalUniqueId,
|
|
28546
|
+
desc: column.sortDirection
|
|
28547
|
+
=== TableColumnSortDirection.descending
|
|
28548
|
+
};
|
|
28549
|
+
});
|
|
28550
|
+
this.updateTableOptions({
|
|
28551
|
+
state: {
|
|
28552
|
+
sorting: tanStackSortingState
|
|
28553
|
+
}
|
|
28554
|
+
});
|
|
28555
|
+
}
|
|
28556
|
+
generateTanStackColumns() {
|
|
28557
|
+
const generatedColumns = this.columns.map(column => {
|
|
28294
28558
|
const columnDef = {
|
|
28295
|
-
id:
|
|
28296
|
-
accessorKey:
|
|
28297
|
-
|
|
28559
|
+
id: column.internalUniqueId,
|
|
28560
|
+
accessorKey: column.operandDataRecordFieldName,
|
|
28561
|
+
sortingFn: getTanStackSortingFunction(column.sortOperation)
|
|
28298
28562
|
};
|
|
28299
28563
|
return columnDef;
|
|
28300
28564
|
});
|
|
28301
|
-
this.updateTableOptions({
|
|
28565
|
+
this.updateTableOptions({
|
|
28566
|
+
// Force TanStack to detect a data update because a columns's accessor is
|
|
28567
|
+
// referenced when creating a new row model.
|
|
28568
|
+
data: [...this.table.options.data],
|
|
28569
|
+
columns: generatedColumns
|
|
28570
|
+
});
|
|
28302
28571
|
}
|
|
28303
28572
|
}
|
|
28304
28573
|
__decorate$1([
|
|
@@ -28322,6 +28591,9 @@
|
|
|
28322
28591
|
__decorate$1([
|
|
28323
28592
|
observable
|
|
28324
28593
|
], Table.prototype, "canRenderRows", void 0);
|
|
28594
|
+
__decorate$1([
|
|
28595
|
+
observable
|
|
28596
|
+
], Table.prototype, "firstSortedColumn", void 0);
|
|
28325
28597
|
const nimbleTable = Table.compose({
|
|
28326
28598
|
baseName: 'table',
|
|
28327
28599
|
template: template$4,
|
|
@@ -28370,13 +28642,15 @@
|
|
|
28370
28642
|
*/
|
|
28371
28643
|
class TableColumnText extends TableColumn {
|
|
28372
28644
|
constructor() {
|
|
28373
|
-
super(
|
|
28645
|
+
super();
|
|
28374
28646
|
this.cellRecordFieldNames = ['value'];
|
|
28375
28647
|
this.cellStyles = cellStyles;
|
|
28376
28648
|
this.cellTemplate = cellTemplate;
|
|
28649
|
+
this.sortOperation = TableColumnSortOperation.localeAwareCaseSensitive;
|
|
28377
28650
|
}
|
|
28378
28651
|
fieldNameChanged() {
|
|
28379
28652
|
this.dataRecordFieldNames = [this.fieldName];
|
|
28653
|
+
this.operandDataRecordFieldName = this.fieldName;
|
|
28380
28654
|
}
|
|
28381
28655
|
placeholderChanged() {
|
|
28382
28656
|
this.columnConfig = { placeholder: this.placeholder ?? '' };
|