@ni/nimble-components 22.0.0 → 22.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/all-components-bundle.js +114 -45
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2324 -2291
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/anchor/styles.js +4 -0
  6. package/dist/esm/anchor/styles.js.map +1 -1
  7. package/dist/esm/anchor-button/styles.js +12 -0
  8. package/dist/esm/anchor-button/styles.js.map +1 -1
  9. package/dist/esm/anchor-menu-item/styles.js +5 -0
  10. package/dist/esm/anchor-menu-item/styles.js.map +1 -1
  11. package/dist/esm/anchor-tab/styles.js +1 -0
  12. package/dist/esm/anchor-tab/styles.js.map +1 -1
  13. package/dist/esm/anchor-tree-item/styles.js +5 -0
  14. package/dist/esm/anchor-tree-item/styles.js.map +1 -1
  15. package/dist/esm/breadcrumb-item/styles.js +4 -0
  16. package/dist/esm/breadcrumb-item/styles.js.map +1 -1
  17. package/dist/esm/label-provider/table/index.d.ts +6 -0
  18. package/dist/esm/label-provider/table/index.js +10 -2
  19. package/dist/esm/label-provider/table/index.js.map +1 -1
  20. package/dist/esm/label-provider/table/label-token-defaults.js +3 -1
  21. package/dist/esm/label-provider/table/label-token-defaults.js.map +1 -1
  22. package/dist/esm/label-provider/table/label-tokens.d.ts +2 -0
  23. package/dist/esm/label-provider/table/label-tokens.js +8 -0
  24. package/dist/esm/label-provider/table/label-tokens.js.map +1 -1
  25. package/dist/esm/table-column/date-text/group-header-view/index.d.ts +1 -3
  26. package/dist/esm/table-column/date-text/group-header-view/index.js +0 -6
  27. package/dist/esm/table-column/date-text/group-header-view/index.js.map +1 -1
  28. package/dist/esm/table-column/duration-text/group-header-view/index.d.ts +1 -3
  29. package/dist/esm/table-column/duration-text/group-header-view/index.js +0 -6
  30. package/dist/esm/table-column/duration-text/group-header-view/index.js.map +1 -1
  31. package/dist/esm/table-column/enum-text/group-header-view/index.d.ts +1 -3
  32. package/dist/esm/table-column/enum-text/group-header-view/index.js +1 -12
  33. package/dist/esm/table-column/enum-text/group-header-view/index.js.map +1 -1
  34. package/dist/esm/table-column/icon/group-header-view/index.d.ts +1 -3
  35. package/dist/esm/table-column/icon/group-header-view/index.js +2 -10
  36. package/dist/esm/table-column/icon/group-header-view/index.js.map +1 -1
  37. package/dist/esm/table-column/icon/group-header-view/template.js +6 -0
  38. package/dist/esm/table-column/icon/group-header-view/template.js.map +1 -1
  39. package/dist/esm/table-column/number-text/group-header-view/index.d.ts +1 -3
  40. package/dist/esm/table-column/number-text/group-header-view/index.js +0 -6
  41. package/dist/esm/table-column/number-text/group-header-view/index.js.map +1 -1
  42. package/dist/esm/table-column/text/group-header-view/index.d.ts +1 -1
  43. package/dist/esm/table-column/text/group-header-view/index.js +1 -1
  44. package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
  45. package/dist/esm/table-column/text-base/group-header-view/index.d.ts +16 -0
  46. package/dist/esm/table-column/text-base/group-header-view/index.js +53 -1
  47. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  48. package/package.json +1 -1
@@ -6,12 +6,6 @@ import { styles } from '../../text-base/group-header-view/styles';
6
6
  * The group header view for displaying number fields as text.
7
7
  */
8
8
  export class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
9
- columnConfigChanged() {
10
- this.updateText();
11
- }
12
- groupHeaderValueChanged() {
13
- this.updateText();
14
- }
15
9
  updateText() {
16
10
  this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';
17
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,kCAGzD;IACW,mBAAmB;QACvB,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAEO,uBAAuB;QAC3B,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAClF,CAAC;CACJ;AAED,MAAM,oCAAoC,GAAG,oCAAoC,CAAC,OAAO,CAAC;IACtF,QAAQ,EAAE,4CAA4C;IACtD,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,oCAAoC,EAAE,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,mCAAmC,GAAG,mDAAmD,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableNumberFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnNumberTextColumnConfig } from '..';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-number-text-group-header': TableColumnNumberTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying number fields as text.\n */\nexport class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableNumberFieldValue,\nTableColumnNumberTextColumnConfig\n> {\n private columnConfigChanged(): void {\n this.updateText();\n }\n\n private groupHeaderValueChanged(): void {\n this.updateText();\n }\n\n private updateText(): void {\n this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';\n }\n}\n\nconst tableColumnNumberTextGroupHeaderView = TableColumnNumberTextGroupHeaderView.compose({\n baseName: 'table-column-number-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnNumberTextGroupHeaderView());\nexport const tableColumnNumberTextGroupHeaderTag = 'nimble-table-column-number-text-group-header-view';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,kCAGzD;IACa,UAAU;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAClF,CAAC;CACJ;AAED,MAAM,oCAAoC,GAAG,oCAAoC,CAAC,OAAO,CAAC;IACtF,QAAQ,EAAE,4CAA4C;IACtD,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,oCAAoC,EAAE,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,mCAAmC,GAAG,mDAAmD,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableNumberFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnNumberTextColumnConfig } from '..';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-number-text-group-header': TableColumnNumberTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying number fields as text.\n */\nexport class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableNumberFieldValue,\nTableColumnNumberTextColumnConfig\n> {\n protected updateText(): void {\n this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';\n }\n}\n\nconst tableColumnNumberTextGroupHeaderView = TableColumnNumberTextGroupHeaderView.compose({\n baseName: 'table-column-number-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnNumberTextGroupHeaderView());\nexport const tableColumnNumberTextGroupHeaderTag = 'nimble-table-column-number-text-group-header-view';\n"]}
@@ -10,6 +10,6 @@ declare global {
10
10
  * The group header view for displaying string fields as text.
11
11
  */
12
12
  export declare class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableStringFieldValue, TableColumnTextColumnConfig> {
13
- private groupHeaderValueChanged;
13
+ protected updateText(): void;
14
14
  }
15
15
  export declare const tableColumnTextGroupHeaderViewTag = "nimble-table-column-text-group-header-view";
@@ -6,7 +6,7 @@ import { styles } from '../../text-base/group-header-view/styles';
6
6
  * The group header view for displaying string fields as text.
7
7
  */
8
8
  export class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
9
- groupHeaderValueChanged() {
9
+ updateText() {
10
10
  this.text = typeof this.groupHeaderValue === 'string'
11
11
  ? this.groupHeaderValue
12
12
  : '';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kCAGnD;IACW,uBAAuB;QAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ;YACjD,CAAC,CAAC,IAAI,CAAC,gBAAgB;YACvB,CAAC,CAAC,EAAE,CAAC;IACb,CAAC;CACJ;AAED,MAAM,8BAA8B,GAAG,8BAA8B,CAAC,OAAO,CAAC;IAC1E,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,8BAA8B,EAAE,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,iCAAiC,GAAG,4CAA4C,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableStringFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnTextColumnConfig } from '..';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-text-group-header': TableColumnTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying string fields as text.\n */\nexport class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableStringFieldValue,\nTableColumnTextColumnConfig\n> {\n private groupHeaderValueChanged(): void {\n this.text = typeof this.groupHeaderValue === 'string'\n ? this.groupHeaderValue\n : '';\n }\n}\n\nconst tableColumnTextGroupHeaderView = TableColumnTextGroupHeaderView.compose({\n baseName: 'table-column-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnTextGroupHeaderView());\nexport const tableColumnTextGroupHeaderViewTag = 'nimble-table-column-text-group-header-view';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kCAGnD;IACa,UAAU;QAChB,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ;YACjD,CAAC,CAAC,IAAI,CAAC,gBAAgB;YACvB,CAAC,CAAC,EAAE,CAAC;IACb,CAAC;CACJ;AAED,MAAM,8BAA8B,GAAG,8BAA8B,CAAC,OAAO,CAAC;IAC1E,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,8BAA8B,EAAE,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,iCAAiC,GAAG,4CAA4C,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableStringFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnTextColumnConfig } from '..';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-text-group-header': TableColumnTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying string fields as text.\n */\nexport class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableStringFieldValue,\nTableColumnTextColumnConfig\n> {\n protected updateText(): void {\n this.text = typeof this.groupHeaderValue === 'string'\n ? this.groupHeaderValue\n : '';\n }\n}\n\nconst tableColumnTextGroupHeaderView = TableColumnTextGroupHeaderView.compose({\n baseName: 'table-column-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnTextGroupHeaderView());\nexport const tableColumnTextGroupHeaderViewTag = 'nimble-table-column-text-group-header-view';\n"]}
@@ -8,6 +8,22 @@ export declare abstract class TableColumnTextGroupHeaderViewBase<TGroupValue = T
8
8
  hasOverflow: boolean;
9
9
  /**
10
10
  * Text to render in the cell.
11
+ *
12
+ * The value is initialized to `tableGroupRowPlaceholderNoValue` because if the group
13
+ * row never has a value defined on it, the change handlers may never get called but
14
+ * the text needs to be correct.
11
15
  */
12
16
  text: string;
17
+ private readonly noValuePlaceholderLabelSubscriber;
18
+ private readonly emptyPlaceholderLabelSubscriber;
19
+ connectedCallback(): void;
20
+ disconnectedCallback(): void;
21
+ protected abstract updateText(): void;
22
+ private columnConfigChanged;
23
+ private groupHeaderValueChanged;
24
+ /**
25
+ * Sets `this.text` to the appropriate placeholder if `groupHeaderValue` warrants it.
26
+ * @returns `true` if `this.text` was set to a placeholder, `false` otherwise.
27
+ */
28
+ private applyPlaceholderTextIfNeeded;
13
29
  }
@@ -1,6 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { observable } from '@microsoft/fast-element';
3
3
  import { TableGroupHeaderView } from '../../base/group-header-view';
4
+ import { tableGroupRowPlaceholderEmptyLabel, tableGroupRowPlaceholderNoValueLabel } from '../../../label-provider/table/label-tokens';
4
5
  /**
5
6
  * The group header view base class for displaying fields of any type as text.
6
7
  */
@@ -11,8 +12,59 @@ export class TableColumnTextGroupHeaderViewBase extends TableGroupHeaderView {
11
12
  this.hasOverflow = false;
12
13
  /**
13
14
  * Text to render in the cell.
15
+ *
16
+ * The value is initialized to `tableGroupRowPlaceholderNoValue` because if the group
17
+ * row never has a value defined on it, the change handlers may never get called but
18
+ * the text needs to be correct.
14
19
  */
15
- this.text = '';
20
+ this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);
21
+ this.noValuePlaceholderLabelSubscriber = {
22
+ handleChange: () => {
23
+ this.applyPlaceholderTextIfNeeded();
24
+ }
25
+ };
26
+ this.emptyPlaceholderLabelSubscriber = {
27
+ handleChange: () => {
28
+ this.applyPlaceholderTextIfNeeded();
29
+ }
30
+ };
31
+ }
32
+ connectedCallback() {
33
+ super.connectedCallback();
34
+ tableGroupRowPlaceholderNoValueLabel.subscribe(this.noValuePlaceholderLabelSubscriber, this);
35
+ tableGroupRowPlaceholderEmptyLabel.subscribe(this.emptyPlaceholderLabelSubscriber, this);
36
+ this.applyPlaceholderTextIfNeeded();
37
+ }
38
+ disconnectedCallback() {
39
+ super.disconnectedCallback();
40
+ tableGroupRowPlaceholderNoValueLabel.unsubscribe(this.noValuePlaceholderLabelSubscriber);
41
+ tableGroupRowPlaceholderEmptyLabel.unsubscribe(this.emptyPlaceholderLabelSubscriber);
42
+ }
43
+ columnConfigChanged() {
44
+ if (!this.applyPlaceholderTextIfNeeded()) {
45
+ this.updateText();
46
+ }
47
+ }
48
+ groupHeaderValueChanged() {
49
+ if (!this.applyPlaceholderTextIfNeeded()) {
50
+ this.updateText();
51
+ }
52
+ }
53
+ /**
54
+ * Sets `this.text` to the appropriate placeholder if `groupHeaderValue` warrants it.
55
+ * @returns `true` if `this.text` was set to a placeholder, `false` otherwise.
56
+ */
57
+ applyPlaceholderTextIfNeeded() {
58
+ if (this.groupHeaderValue === null
59
+ || this.groupHeaderValue === undefined) {
60
+ this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);
61
+ return true;
62
+ }
63
+ if (this.groupHeaderValue === '') {
64
+ this.text = tableGroupRowPlaceholderEmptyLabel.getValueFor(this);
65
+ return true;
66
+ }
67
+ return false;
16
68
  }
17
69
  }
18
70
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;GAEG;AACH,MAAM,OAAgB,kCAGpB,SAAQ,oBAAgD;IAH1D;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;QAE3B;;WAEG;QAEI,SAAI,GAAG,EAAE,CAAC;IACrB,CAAC;CAAA;AAPG;IADC,UAAU;uEACgB;AAM3B;IADC,UAAU;gEACM","sourcesContent":["import { observable } from '@microsoft/fast-element';\nimport { TableGroupHeaderView } from '../../base/group-header-view';\nimport type { TableFieldValue } from '../../../table/types';\n\n/**\n * The group header view base class for displaying fields of any type as text.\n */\nexport abstract class TableColumnTextGroupHeaderViewBase<\n TGroupValue = TableFieldValue,\n TColumnConfig = unknown\n> extends TableGroupHeaderView<TGroupValue, TColumnConfig> {\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /**\n * Text to render in the cell.\n */\n @observable\n public text = '';\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,EACH,kCAAkC,EAClC,oCAAoC,EACvC,MAAM,4CAA4C,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAgB,kCAGpB,SAAQ,oBAAgD;IAH1D;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;QAE3B;;;;;;WAMG;QAEI,SAAI,GAAG,oCAAoC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEpD,sCAAiC,GAE9C;YACI,YAAY,EAAE,GAAG,EAAE;gBACf,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACxC,CAAC;SACJ,CAAC;QAEW,oCAA+B,GAE5C;YACI,YAAY,EAAE,GAAG,EAAE;gBACf,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACxC,CAAC;SACJ,CAAC;IAyDV,CAAC;IAvDmB,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,oCAAoC,CAAC,SAAS,CAC1C,IAAI,CAAC,iCAAiC,EACtC,IAAI,CACP,CAAC;QACF,kCAAkC,CAAC,SAAS,CACxC,IAAI,CAAC,+BAA+B,EACpC,IAAI,CACP,CAAC;QACF,IAAI,CAAC,4BAA4B,EAAE,CAAC;IACxC,CAAC;IAEe,oBAAoB;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,oCAAoC,CAAC,WAAW,CAC5C,IAAI,CAAC,iCAAiC,CACzC,CAAC;QACF,kCAAkC,CAAC,WAAW,CAC1C,IAAI,CAAC,+BAA+B,CACvC,CAAC;IACN,CAAC;IAIO,mBAAmB;QACvB,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE;YACtC,IAAI,CAAC,UAAU,EAAE,CAAC;SACrB;IACL,CAAC;IAEO,uBAAuB;QAC3B,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE;YACtC,IAAI,CAAC,UAAU,EAAE,CAAC;SACrB;IACL,CAAC;IAED;;;OAGG;IACK,4BAA4B;QAChC,IACI,IAAI,CAAC,gBAAgB,KAAK,IAAI;eAC3B,IAAI,CAAC,gBAAgB,KAAK,SAAS,EACxC;YACE,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;SACf;QACD,IAAI,IAAI,CAAC,gBAAgB,KAAK,EAAE,EAAE;YAC9B,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAnFG;IADC,UAAU;uEACgB;AAU3B;IADC,UAAU;gEAC0D","sourcesContent":["import type { DesignTokenSubscriber } from '@microsoft/fast-foundation';\nimport { observable } from '@microsoft/fast-element';\nimport { TableGroupHeaderView } from '../../base/group-header-view';\nimport type { TableFieldValue } from '../../../table/types';\nimport {\n tableGroupRowPlaceholderEmptyLabel,\n tableGroupRowPlaceholderNoValueLabel\n} from '../../../label-provider/table/label-tokens';\n\n/**\n * The group header view base class for displaying fields of any type as text.\n */\nexport abstract class TableColumnTextGroupHeaderViewBase<\n TGroupValue = TableFieldValue,\n TColumnConfig = unknown\n> extends TableGroupHeaderView<TGroupValue, TColumnConfig> {\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /**\n * Text to render in the cell.\n *\n * The value is initialized to `tableGroupRowPlaceholderNoValue` because if the group\n * row never has a value defined on it, the change handlers may never get called but\n * the text needs to be correct.\n */\n @observable\n public text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);\n\n private readonly noValuePlaceholderLabelSubscriber: DesignTokenSubscriber<\n typeof tableGroupRowPlaceholderNoValueLabel\n > = {\n handleChange: () => {\n this.applyPlaceholderTextIfNeeded();\n }\n };\n\n private readonly emptyPlaceholderLabelSubscriber: DesignTokenSubscriber<\n typeof tableGroupRowPlaceholderEmptyLabel\n > = {\n handleChange: () => {\n this.applyPlaceholderTextIfNeeded();\n }\n };\n\n public override connectedCallback(): void {\n super.connectedCallback();\n tableGroupRowPlaceholderNoValueLabel.subscribe(\n this.noValuePlaceholderLabelSubscriber,\n this\n );\n tableGroupRowPlaceholderEmptyLabel.subscribe(\n this.emptyPlaceholderLabelSubscriber,\n this\n );\n this.applyPlaceholderTextIfNeeded();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n tableGroupRowPlaceholderNoValueLabel.unsubscribe(\n this.noValuePlaceholderLabelSubscriber\n );\n tableGroupRowPlaceholderEmptyLabel.unsubscribe(\n this.emptyPlaceholderLabelSubscriber\n );\n }\n\n protected abstract updateText(): void;\n\n private columnConfigChanged(): void {\n if (!this.applyPlaceholderTextIfNeeded()) {\n this.updateText();\n }\n }\n\n private groupHeaderValueChanged(): void {\n if (!this.applyPlaceholderTextIfNeeded()) {\n this.updateText();\n }\n }\n\n /**\n * Sets `this.text` to the appropriate placeholder if `groupHeaderValue` warrants it.\n * @returns `true` if `this.text` was set to a placeholder, `false` otherwise.\n */\n private applyPlaceholderTextIfNeeded(): boolean {\n if (\n this.groupHeaderValue === null\n || this.groupHeaderValue === undefined\n ) {\n this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);\n return true;\n }\n if (this.groupHeaderValue === '') {\n this.text = tableGroupRowPlaceholderEmptyLabel.getValueFor(this);\n return true;\n }\n return false;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/nimble-components",
3
- "version": "22.0.0",
3
+ "version": "22.1.0",
4
4
  "description": "Styled web components for the NI Nimble Design System",
5
5
  "scripts": {
6
6
  "build": "npm run generate-icons && npm run generate-workers && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook",