@ni/nimble-components 34.8.2 → 34.8.4

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 (76) hide show
  1. package/dist/all-components-bundle.js +92 -47
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2395 -2388
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/anchor/types.js.map +1 -1
  6. package/dist/esm/banner/index.js.map +1 -1
  7. package/dist/esm/banner/types.js.map +1 -1
  8. package/dist/esm/breadcrumb/breadcrumb.foundation.spec.js.map +1 -1
  9. package/dist/esm/breadcrumb/types.js.map +1 -1
  10. package/dist/esm/chip/index.js.map +1 -1
  11. package/dist/esm/chip/types.js.map +1 -1
  12. package/dist/esm/combobox/models/combobox-form-associated.js.map +1 -1
  13. package/dist/esm/dialog/index.js +0 -1
  14. package/dist/esm/dialog/index.js.map +1 -1
  15. package/dist/esm/drawer/index.js +0 -1
  16. package/dist/esm/drawer/index.js.map +1 -1
  17. package/dist/esm/drawer/types.js.map +1 -1
  18. package/dist/esm/mapping/icon/index.js +1 -1
  19. package/dist/esm/mapping/icon/index.js.map +1 -1
  20. package/dist/esm/menu-button/types.js.map +1 -1
  21. package/dist/esm/number-field/types.js.map +1 -1
  22. package/dist/esm/patterns/button/types.js.map +1 -1
  23. package/dist/esm/patterns/dropdown/types.js.map +1 -1
  24. package/dist/esm/rich-text/editor/index.js.map +1 -1
  25. package/dist/esm/rich-text/editor/testing/types.js.map +1 -1
  26. package/dist/esm/rich-text/editor/types.js.map +1 -1
  27. package/dist/esm/rich-text-mention/base/models/mention-validator.js +2 -2
  28. package/dist/esm/rich-text-mention/base/models/mention-validator.js.map +1 -1
  29. package/dist/esm/select/models/select-form-associated.js.map +1 -1
  30. package/dist/esm/spinner/types.js.map +1 -1
  31. package/dist/esm/table/components/row/index.js.map +1 -1
  32. package/dist/esm/table/index.js.map +1 -1
  33. package/dist/esm/table/models/expansion-manager.js +1 -1
  34. package/dist/esm/table/models/expansion-manager.js.map +1 -1
  35. package/dist/esm/table/types.js.map +1 -1
  36. package/dist/esm/table-column/base/cell-view/template.js +1 -1
  37. package/dist/esm/table-column/base/cell-view/template.js.map +1 -1
  38. package/dist/esm/table-column/base/group-header-view/template.js +1 -1
  39. package/dist/esm/table-column/base/group-header-view/template.js.map +1 -1
  40. package/dist/esm/table-column/base/types.js.map +1 -1
  41. package/dist/esm/table-column/date-text/index.js +1 -1
  42. package/dist/esm/table-column/date-text/index.js.map +1 -1
  43. package/dist/esm/table-column/date-text/models/format-helper.js +1 -1
  44. package/dist/esm/table-column/date-text/models/format-helper.js.map +1 -1
  45. package/dist/esm/table-column/date-text/types.js.map +1 -1
  46. package/dist/esm/table-column/enum-base/index.js.map +1 -1
  47. package/dist/esm/table-column/enum-base/types.js.map +1 -1
  48. package/dist/esm/table-column/mapping/types.js.map +1 -1
  49. package/dist/esm/table-column/mixins/custom-sort-order.js +1 -3
  50. package/dist/esm/table-column/mixins/custom-sort-order.js.map +1 -1
  51. package/dist/esm/table-column/mixins/fractional-width-column.js +2 -6
  52. package/dist/esm/table-column/mixins/fractional-width-column.js.map +1 -1
  53. package/dist/esm/table-column/mixins/groupable-column.js +2 -6
  54. package/dist/esm/table-column/mixins/groupable-column.js.map +1 -1
  55. package/dist/esm/table-column/mixins/placeholder.js +1 -3
  56. package/dist/esm/table-column/mixins/placeholder.js.map +1 -1
  57. package/dist/esm/table-column/mixins/sortable-column.js +3 -9
  58. package/dist/esm/table-column/mixins/sortable-column.js.map +1 -1
  59. package/dist/esm/table-column/number-text/models/number-text-unit-format.js.map +1 -1
  60. package/dist/esm/table-column/number-text/types.js.map +1 -1
  61. package/dist/esm/table-column/text/index.js.map +1 -1
  62. package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
  63. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  64. package/dist/esm/table-column/text-base/index.js +1 -1
  65. package/dist/esm/table-column/text-base/index.js.map +1 -1
  66. package/dist/esm/text-area/types.js.map +1 -1
  67. package/dist/esm/text-field/types.js.map +1 -1
  68. package/dist/esm/theme-provider/design-token-values.js.map +1 -1
  69. package/dist/esm/theme-provider/design-tokens.js.map +1 -1
  70. package/dist/esm/theme-provider/index.js +1 -1
  71. package/dist/esm/theme-provider/index.js.map +1 -1
  72. package/dist/esm/tooltip/types.js.map +1 -1
  73. package/dist/esm/tree-view/types.js.map +1 -1
  74. package/dist/esm/utilities/unit-format/default-unit-format.js.map +1 -1
  75. package/dist/esm/wafer-map/types.js.map +1 -1
  76. package/package.json +5 -11
@@ -1 +1 @@
1
- {"version":3,"file":"expansion-manager.js","sourceRoot":"","sources":["../../../../src/table/models/expansion-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAKH,gCAAgC,EACnC,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAgB;IAMzB,YACqB,aAA8C;QAA9C,kBAAa,GAAb,aAAa,CAAiC;QAN3D,4BAAuB,GAAG,IAAI,GAAG,EAAmB,CAAC;QACrD,qBAAgB,GAAG,IAAI,GAAG,EAAuC,CAAC;QAClE,uBAAkB,GAAG,KAAK,CAAC;QAC3B,2BAAsB,GAAG,IAAI,GAAG,EAAU,CAAC;IAIhD,CAAC;IAEG,aAAa,CAAC,GAAkC;QACnD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChE,OAAO,cAAc,IAAI,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC;IAEM,kBAAkB,CAAC,GAAkC;QACxD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO;QACX,CAAC;QAED,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,CAAC,EAAE,CAAC,EAAE,qBAAqB,CAAC;QACnF,OAAO,qBAAqB,KAAK,gCAAgC,CAAC,IAAI,CAAC;IAC3E,CAAC;IAEO,wBAAwB,CAC5B,GAAkC;QAElC,0EAA0E;QAC1E,0EAA0E;QAC1E,wBAAwB;QACxB,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ","sourcesContent":["import type {\n Row as TanStackRow,\n Table as TanStackTable\n} from '@tanstack/table-core';\nimport {\n type TableNode,\n type TableRecord,\n type TableSetRecordHierarchyOptions,\n type TableRecordHierarchyOptions,\n TableRecordDelayedHierarchyState\n} from '../types';\n\n/**\n * Manages the expanded/collapsed state of rows in the table.\n *\n * We must track the expansion state separately from TanStack because:\n * 1. TanStack does not support having a different initial expansion state per row unless explicitly\n * specified for each row by ID. This causes problems in the nimble-table because we could have\n * a different initial expansion state for group rows, parent rows, and parent rows with delay-loaded\n * children.\n * 2. TanStack does not remove entries from its expanded state when those rows are no longer present\n * in the data. This is not ideal because the object maintaining the expansion state can grow unbounded.\n */\nexport class ExpansionManager<TData extends TableRecord> {\n private explicitExpansionStates = new Map<string, boolean>();\n private hierarchyOptions = new Map<string, TableRecordHierarchyOptions>();\n private isHierarchyEnabled = false;\n private parentRowsWithChildren = new Set<string>();\n\n public constructor(\n private readonly tanStackTable: TanStackTable<TableNode<TData>>\n ) {}\n\n public isRowExpanded(row: TanStackRow<TableNode<TData>>): boolean {\n if (!this.isRowExpandable(row)) {\n return false;\n }\n\n const expansionState = this.explicitExpansionStates.get(row.id);\n return expansionState ?? this.getDefaultExpansionState(row);\n }\n\n public toggleRowExpansion(row: TanStackRow<TableNode<TData>>): void {\n if (!this.isRowExpandable(row)) {\n return;\n }\n\n const wasExpanded = this.isRowExpanded(row);\n this.explicitExpansionStates.set(row.id, !wasExpanded);\n\n row.toggleExpanded();\n }\n\n public collapseAll(): void {\n this.resetExpansionState();\n\n const rows = this.tanStackTable.getRowModel().flatRows;\n for (const row of rows) {\n if (this.isRowExpandable(row)) {\n this.explicitExpansionStates.set(row.id, false);\n }\n }\n this.tanStackTable.toggleAllRowsExpanded(false);\n }\n\n public resetExpansionState(): void {\n this.explicitExpansionStates.clear();\n }\n\n public resetHierarchyOptions(): void {\n this.hierarchyOptions.clear();\n }\n\n public processDataUpdate(rows: TanStackRow<TableNode<TData>>[]): void {\n if (\n this.explicitExpansionStates.size === 0\n && this.hierarchyOptions.size === 0\n ) {\n return;\n }\n\n const updatedExplicitExpansionStates = new Map<string, boolean>();\n const updatedHierarchyOptions = new Map<\n string,\n TableRecordHierarchyOptions\n >();\n const updatedParentRowsWithChildren = new Set<string>();\n for (const row of rows) {\n const rowId = row.id;\n const isGroupRow = row.getIsGrouped();\n const rowHierarchyOptions = this.hierarchyOptions.get(rowId);\n if (!isGroupRow && rowHierarchyOptions) {\n updatedHierarchyOptions.set(rowId, rowHierarchyOptions);\n }\n\n if (this.isRowExpandable(row)) {\n const expansionState = this.explicitExpansionStates.get(rowId);\n if (expansionState !== undefined) {\n updatedExplicitExpansionStates.set(rowId, expansionState);\n }\n\n if (!isGroupRow) {\n const hasChildRows = row.subRows.length !== 0;\n if (hasChildRows) {\n updatedParentRowsWithChildren.add(rowId);\n } else if (this.parentRowsWithChildren.has(rowId)) {\n // The row used to have children, but now it does not. Therefore,\n // collapse the row.\n updatedExplicitExpansionStates.set(rowId, false);\n }\n }\n }\n }\n\n this.explicitExpansionStates = updatedExplicitExpansionStates;\n this.hierarchyOptions = updatedHierarchyOptions;\n this.parentRowsWithChildren = updatedParentRowsWithChildren;\n }\n\n public setHierarchyOptions(\n hierarchyOptions: TableSetRecordHierarchyOptions[]\n ): void {\n const updatedHierarchyOptions = new Map<\n string,\n TableRecordHierarchyOptions\n >();\n for (const { recordId, options } of hierarchyOptions) {\n updatedHierarchyOptions.set(recordId, options);\n\n const oldState = this.hierarchyOptions.get(recordId)?.delayedHierarchyState;\n const newState = options.delayedHierarchyState;\n if (\n oldState === TableRecordDelayedHierarchyState.loadingChildren\n && newState === TableRecordDelayedHierarchyState.canLoadChildren\n && !this.parentRowsWithChildren.has(recordId)\n ) {\n // If a row without children transitions from loadingChildren to canLoadChildren,\n // put it back in its default state of collapsed.\n this.explicitExpansionStates.delete(recordId);\n }\n }\n this.hierarchyOptions = updatedHierarchyOptions;\n }\n\n public isRowExpandable(row: TanStackRow<TableNode<TData>>): boolean {\n return row.subRows.length > 0 || this.canLoadDelayedChildren(row.id);\n }\n\n public setHierarchyEnabled(isHierarchyEnabled: boolean): void {\n this.isHierarchyEnabled = isHierarchyEnabled;\n }\n\n public isLoadingChildren(id: string): boolean {\n if (!this.isHierarchyEnabled) {\n return false;\n }\n\n return (\n this.hierarchyOptions.get(id)?.delayedHierarchyState\n === TableRecordDelayedHierarchyState.loadingChildren ?? false\n );\n }\n\n private canLoadDelayedChildren(id: string): boolean {\n if (!this.isHierarchyEnabled) {\n return false;\n }\n\n const delayedHierarchyState = this.hierarchyOptions.get(id)?.delayedHierarchyState;\n return delayedHierarchyState !== TableRecordDelayedHierarchyState.none;\n }\n\n private getDefaultExpansionState(\n row: TanStackRow<TableNode<TData>>\n ): boolean {\n // Rows with children (group rows and parent rows with populated children)\n // default to expanded. Other rows (parent rows with lazy-loaded children)\n // default to collapsed.\n return row.subRows.length !== 0;\n }\n}\n"]}
1
+ {"version":3,"file":"expansion-manager.js","sourceRoot":"","sources":["../../../../src/table/models/expansion-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAKH,gCAAgC,EACnC,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAgB;IAMzB,YACqB,aAA8C;QAA9C,kBAAa,GAAb,aAAa,CAAiC;QAN3D,4BAAuB,GAAG,IAAI,GAAG,EAAmB,CAAC;QACrD,qBAAgB,GAAG,IAAI,GAAG,EAAuC,CAAC;QAClE,uBAAkB,GAAG,KAAK,CAAC;QAC3B,2BAAsB,GAAG,IAAI,GAAG,EAAU,CAA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D,CAAC;IAEM,iBAAiB,CAAC,EAAU;QAC/B,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,CACH,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,qBAAqB;gBAC5C,gCAAgC,CAAC,eAAe,CAC3D,CAAC;IACN,CAAC;IAEO,sBAAsB,CAAC,EAAU;QACrC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,qBAAqB,CAAC;QACnF,OAAO,qBAAqB,KAAK,gCAAgC,CAAC,IAAI,CAAC;IAC3E,CAAC;IAEO,wBAAwB,CAC5B,GAAkC;QAElC,0EAA0E;QAC1E,0EAA0E;QAC1E,wBAAwB;QACxB,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ","sourcesContent":["import type {\n Row as TanStackRow,\n Table as TanStackTable\n} from '@tanstack/table-core';\nimport {\n type TableNode,\n type TableRecord,\n type TableSetRecordHierarchyOptions,\n type TableRecordHierarchyOptions,\n TableRecordDelayedHierarchyState\n} from '../types';\n\n/**\n * Manages the expanded/collapsed state of rows in the table.\n *\n * We must track the expansion state separately from TanStack because:\n * 1. TanStack does not support having a different initial expansion state per row unless explicitly\n * specified for each row by ID. This causes problems in the nimble-table because we could have\n * a different initial expansion state for group rows, parent rows, and parent rows with delay-loaded\n * children.\n * 2. TanStack does not remove entries from its expanded state when those rows are no longer present\n * in the data. This is not ideal because the object maintaining the expansion state can grow unbounded.\n */\nexport class ExpansionManager<TData extends TableRecord> {\n private explicitExpansionStates = new Map<string, boolean>();\n private hierarchyOptions = new Map<string, TableRecordHierarchyOptions>();\n private isHierarchyEnabled = false;\n private parentRowsWithChildren = new Set<string>();\n\n public constructor(\n private readonly tanStackTable: TanStackTable<TableNode<TData>>\n ) {}\n\n public isRowExpanded(row: TanStackRow<TableNode<TData>>): boolean {\n if (!this.isRowExpandable(row)) {\n return false;\n }\n\n const expansionState = this.explicitExpansionStates.get(row.id);\n return expansionState ?? this.getDefaultExpansionState(row);\n }\n\n public toggleRowExpansion(row: TanStackRow<TableNode<TData>>): void {\n if (!this.isRowExpandable(row)) {\n return;\n }\n\n const wasExpanded = this.isRowExpanded(row);\n this.explicitExpansionStates.set(row.id, !wasExpanded);\n\n row.toggleExpanded();\n }\n\n public collapseAll(): void {\n this.resetExpansionState();\n\n const rows = this.tanStackTable.getRowModel().flatRows;\n for (const row of rows) {\n if (this.isRowExpandable(row)) {\n this.explicitExpansionStates.set(row.id, false);\n }\n }\n this.tanStackTable.toggleAllRowsExpanded(false);\n }\n\n public resetExpansionState(): void {\n this.explicitExpansionStates.clear();\n }\n\n public resetHierarchyOptions(): void {\n this.hierarchyOptions.clear();\n }\n\n public processDataUpdate(rows: TanStackRow<TableNode<TData>>[]): void {\n if (\n this.explicitExpansionStates.size === 0\n && this.hierarchyOptions.size === 0\n ) {\n return;\n }\n\n const updatedExplicitExpansionStates = new Map<string, boolean>();\n const updatedHierarchyOptions = new Map<\n string,\n TableRecordHierarchyOptions\n >();\n const updatedParentRowsWithChildren = new Set<string>();\n for (const row of rows) {\n const rowId = row.id;\n const isGroupRow = row.getIsGrouped();\n const rowHierarchyOptions = this.hierarchyOptions.get(rowId);\n if (!isGroupRow && rowHierarchyOptions) {\n updatedHierarchyOptions.set(rowId, rowHierarchyOptions);\n }\n\n if (this.isRowExpandable(row)) {\n const expansionState = this.explicitExpansionStates.get(rowId);\n if (expansionState !== undefined) {\n updatedExplicitExpansionStates.set(rowId, expansionState);\n }\n\n if (!isGroupRow) {\n const hasChildRows = row.subRows.length !== 0;\n if (hasChildRows) {\n updatedParentRowsWithChildren.add(rowId);\n } else if (this.parentRowsWithChildren.has(rowId)) {\n // The row used to have children, but now it does not. Therefore,\n // collapse the row.\n updatedExplicitExpansionStates.set(rowId, false);\n }\n }\n }\n }\n\n this.explicitExpansionStates = updatedExplicitExpansionStates;\n this.hierarchyOptions = updatedHierarchyOptions;\n this.parentRowsWithChildren = updatedParentRowsWithChildren;\n }\n\n public setHierarchyOptions(\n hierarchyOptions: TableSetRecordHierarchyOptions[]\n ): void {\n const updatedHierarchyOptions = new Map<\n string,\n TableRecordHierarchyOptions\n >();\n for (const { recordId, options } of hierarchyOptions) {\n updatedHierarchyOptions.set(recordId, options);\n\n const oldState = this.hierarchyOptions.get(recordId)?.delayedHierarchyState;\n const newState = options.delayedHierarchyState;\n if (\n oldState === TableRecordDelayedHierarchyState.loadingChildren\n && newState === TableRecordDelayedHierarchyState.canLoadChildren\n && !this.parentRowsWithChildren.has(recordId)\n ) {\n // If a row without children transitions from loadingChildren to canLoadChildren,\n // put it back in its default state of collapsed.\n this.explicitExpansionStates.delete(recordId);\n }\n }\n this.hierarchyOptions = updatedHierarchyOptions;\n }\n\n public isRowExpandable(row: TanStackRow<TableNode<TData>>): boolean {\n return row.subRows.length > 0 || this.canLoadDelayedChildren(row.id);\n }\n\n public setHierarchyEnabled(isHierarchyEnabled: boolean): void {\n this.isHierarchyEnabled = isHierarchyEnabled;\n }\n\n public isLoadingChildren(id: string): boolean {\n if (!this.isHierarchyEnabled) {\n return false;\n }\n\n return (\n this.hierarchyOptions.get(id)?.delayedHierarchyState\n === TableRecordDelayedHierarchyState.loadingChildren\n );\n }\n\n private canLoadDelayedChildren(id: string): boolean {\n if (!this.isHierarchyEnabled) {\n return false;\n }\n\n const delayedHierarchyState = this.hierarchyOptions.get(id)?.delayedHierarchyState;\n return delayedHierarchyState !== TableRecordDelayedHierarchyState.none;\n }\n\n private getDefaultExpansionState(\n row: TanStackRow<TableNode<TData>>\n ): boolean {\n // Rows with children (group rows and parent rows with populated children)\n // default to expanded. Other rows (parent rows with lazy-loaded children)\n // default to collapsed.\n return row.subRows.length !== 0;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/table/types.ts"],"names":[],"mappings":"AAkGA,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC5C,IAAI,EAAE,SAAS;IACf,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,kBAAkB;CAC7B,CAAC;AAWX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;CAClB,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACd,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,UAAU;IACpB,iBAAiB,EAAE,oBAAoB;CACjC,CAAC;AA4EX;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,GAAG,EAAE,KAAK;IACV,oBAAoB,EAAE,sBAAsB;IAC5C,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;CACpB,CAAC","sourcesContent":["import type { Checkbox } from '../checkbox';\nimport type { MenuButton } from '../menu-button';\nimport type { TableColumn } from '../table-column/base';\nimport type { ValidityObject } from '../utilities/models/validator';\nimport type { TableCell } from './components/cell';\n\n/**\n * TableFieldName describes the type associated with keys within\n * a table's records.\n */\nexport type TableFieldName = string;\n\n/**\n * TableFieldValue describes the type associated with values within\n * a table's records.\n */\nexport type TableFieldValue = string | number | boolean | null | undefined;\n\n/**\n * TableStringFieldValue describes the type associated with values within\n * a table's string records.\n */\nexport type TableStringFieldValue = string | null | undefined;\n\n/**\n * TableBooleanFieldValue describes the type associated with values within\n * a table's boolean records.\n */\nexport type TableBooleanFieldValue = boolean | null | undefined;\n\n/**\n * TableNumberFieldValue describes the type associated with values within\n * a table's number records.\n */\nexport type TableNumberFieldValue = number | null | undefined;\n\n/**\n * TableRecord describes the data structure that backs a single row in a table.\n * It is made up of fields, which are key/value pairs that have a key of type\n * TableFieldName and a value of type TableFieldValue.\n */\nexport interface TableRecord {\n [key: TableFieldName]: TableFieldValue;\n}\n\n/**\n * @internal\n *\n * Describes a hierarchical data structure that is used for\n * the internal representation of the data, and allows us to represent data with\n * parent-child relationships within Tanstack.\n */\nexport interface TableNode<TRecord extends TableRecord = TableRecord> {\n subRows?: TableNode<TRecord>[];\n originalIndex: number;\n clientRecord: TRecord;\n}\n\nexport type TableStringField<FieldName extends TableFieldName> = {\n [name in FieldName]: TableStringFieldValue;\n};\n\nexport type TableBooleanField<FieldName extends TableFieldName> = {\n [name in FieldName]: TableBooleanFieldValue;\n};\n\nexport type TableNumberField<FieldName extends TableFieldName> = {\n [name in FieldName]: TableNumberFieldValue;\n};\n\nexport interface TableValidity extends ValidityObject {\n readonly duplicateRecordId: boolean;\n readonly missingRecordId: boolean;\n readonly invalidRecordId: boolean;\n readonly duplicateColumnId: boolean;\n readonly missingColumnId: boolean;\n readonly duplicateSortIndex: boolean;\n readonly duplicateGroupIndex: boolean;\n readonly idFieldNameNotConfigured: boolean;\n readonly invalidColumnConfiguration: boolean;\n readonly invalidParentIdConfiguration: boolean;\n}\n\n/**\n * The hierarachy options for a record in the table.\n */\nexport interface TableSetRecordHierarchyOptions {\n recordId: string;\n options: TableRecordHierarchyOptions;\n}\n\n/**\n * Describes the hierarchy options that can be configured for a record in the table.\n */\nexport interface TableRecordHierarchyOptions {\n delayedHierarchyState: TableRecordDelayedHierarchyState;\n}\n\nexport const TableRecordDelayedHierarchyState = {\n none: undefined,\n canLoadChildren: 'can-load-children',\n loadingChildren: 'loading-children'\n} as const;\nexport type TableRecordDelayedHierarchyState =\n (typeof TableRecordDelayedHierarchyState)[keyof typeof TableRecordDelayedHierarchyState];\n\nexport interface TableActionMenuToggleEventDetail {\n newState: boolean;\n oldState: boolean;\n recordIds: string[];\n columnId?: string;\n}\n\n/**\n * The possible directions a table column can be sorted in.\n */\nexport const TableColumnSortDirection = {\n none: undefined,\n ascending: 'ascending',\n descending: 'descending'\n} as const;\nexport type TableColumnSortDirection =\n (typeof TableColumnSortDirection)[keyof typeof TableColumnSortDirection];\n\n/**\n * The selection modes of rows in the table.\n */\nexport const TableRowSelectionMode = {\n none: undefined,\n single: 'single',\n multiple: 'multiple'\n} as const;\nexport type TableRowSelectionMode =\n (typeof TableRowSelectionMode)[keyof typeof TableRowSelectionMode];\n\n/**\n * @internal\n *\n * The possible selection states that the table or a table row can be in.\n */\nexport const TableRowSelectionState = {\n notSelected: 'not-selected',\n selected: 'selected',\n partiallySelected: 'partially-selected'\n} as const;\nexport type TableRowSelectionState =\n (typeof TableRowSelectionState)[keyof typeof TableRowSelectionState];\n\n/**\n * @internal\n *\n * Internal event detail type for a row's selection state changing\n */\nexport interface TableRowSelectionToggleEventDetail {\n oldState: boolean;\n newState: boolean;\n}\n\n/**\n * Event detail type for row selection events in the table.\n */\nexport interface TableRowSelectionEventDetail {\n selectedRecordIds: string[];\n}\n\n/**\n * Event detail type for row toggle events in the table.\n */\nexport interface TableRowExpansionToggleEventDetail {\n oldState: boolean;\n newState: boolean;\n recordId: string;\n}\n\n/**\n * Event detail type for interactive column configuration changes.\n *\n * The column-configuration-change event is emitted when a column's configuration\n * is modified programmatically, such as by clicking on the column's header to sort\n * the column. The items in the `columns` array are specified in the same order as\n * the columns are listed in the DOM.\n */\nexport interface TableColumnConfigurationChangeEventDetail {\n columns: TableColumnConfiguration[];\n}\n\n/**\n * A representation of the current configuration of a column within the table.\n */\nexport interface TableColumnConfiguration {\n columnId?: string;\n sortIndex?: number;\n sortDirection: TableColumnSortDirection;\n groupIndex?: number;\n hidden: boolean;\n fractionalWidth: number;\n pixelWidth?: number;\n}\n\n/**\n * @internal\n *\n * Internal representation of a row in the table\n */\nexport interface TableRowState<TData extends TableRecord = TableRecord> {\n record: TData;\n id: string;\n selectionState: TableRowSelectionState;\n isGroupRow: boolean;\n groupRowValue?: unknown;\n isExpanded: boolean;\n nestingLevel?: number;\n immediateChildCount?: number;\n groupColumn?: TableColumn;\n isParentRow: boolean;\n isLoadingChildren: boolean;\n requestedSlots: SlotMetadata[];\n resolvedRowIndex?: number;\n}\n\n/**\n * @internal\n *\n * Alignment of column content\n */\nexport const TableColumnAlignment = {\n left: 'left',\n right: 'right'\n} as const;\nexport type TableColumnAlignment =\n (typeof TableColumnAlignment)[keyof typeof TableColumnAlignment];\n\n/**\n * Table keyboard focus types\n */\nexport const TableFocusType = {\n none: 'none',\n columnHeader: 'columnHeader',\n headerActions: 'headerActions',\n row: 'row',\n rowSelectionCheckbox: 'rowSelectionCheckbox',\n cell: 'cell',\n cellActionMenu: 'cellActionMenu',\n cellContent: 'cellContent'\n} as const;\nexport type TableFocusType =\n (typeof TableFocusType)[keyof typeof TableFocusType];\n\n/**\n * @internal\n *\n * Focusable elements of a table row\n */\nexport interface TableRowFocusableElements {\n selectionCheckbox?: Checkbox;\n cells: {\n cell: TableCell,\n actionMenuButton?: MenuButton\n }[];\n}\n\n/**\n * Focusable elements of a table's header\n */\nexport interface TableHeaderFocusableElements {\n headerActions: HTMLElement[];\n columnHeaders: HTMLElement[];\n}\n\n/**\n * @internal\n */\nexport interface CellViewSlotRequestEventDetail {\n slots: SlotMetadata[];\n}\n\n/**\n * @internal\n */\nexport interface RowSlotRequestEventDetail {\n columnInternalId: string;\n recordId: string;\n slots: SlotMetadata[];\n}\n\n/**\n * @internal\n */\nexport interface SlotMetadata {\n slot: string;\n name: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/table/types.ts"],"names":[],"mappings":"AAkGA,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC5C,IAAI,EAAE,SAAS;IACf,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,kBAAkB;CAC7B,CAAC;AAUX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;CAClB,CAAC;AAGX;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACd,CAAC;AAGX;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,UAAU;IACpB,iBAAiB,EAAE,oBAAoB;CACjC,CAAC;AA2EX;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC;AAGX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,GAAG,EAAE,KAAK;IACV,oBAAoB,EAAE,sBAAsB;IAC5C,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;CACpB,CAAC","sourcesContent":["import type { Checkbox } from '../checkbox';\nimport type { MenuButton } from '../menu-button';\nimport type { TableColumn } from '../table-column/base';\nimport type { ValidityObject } from '../utilities/models/validator';\nimport type { TableCell } from './components/cell';\n\n/**\n * TableFieldName describes the type associated with keys within\n * a table's records.\n */\nexport type TableFieldName = string;\n\n/**\n * TableFieldValue describes the type associated with values within\n * a table's records.\n */\nexport type TableFieldValue = string | number | boolean | null | undefined;\n\n/**\n * TableStringFieldValue describes the type associated with values within\n * a table's string records.\n */\nexport type TableStringFieldValue = string | null | undefined;\n\n/**\n * TableBooleanFieldValue describes the type associated with values within\n * a table's boolean records.\n */\nexport type TableBooleanFieldValue = boolean | null | undefined;\n\n/**\n * TableNumberFieldValue describes the type associated with values within\n * a table's number records.\n */\nexport type TableNumberFieldValue = number | null | undefined;\n\n/**\n * TableRecord describes the data structure that backs a single row in a table.\n * It is made up of fields, which are key/value pairs that have a key of type\n * TableFieldName and a value of type TableFieldValue.\n */\nexport interface TableRecord {\n [key: TableFieldName]: TableFieldValue;\n}\n\n/**\n * @internal\n *\n * Describes a hierarchical data structure that is used for\n * the internal representation of the data, and allows us to represent data with\n * parent-child relationships within Tanstack.\n */\nexport interface TableNode<TRecord extends TableRecord = TableRecord> {\n subRows?: TableNode<TRecord>[];\n originalIndex: number;\n clientRecord: TRecord;\n}\n\nexport type TableStringField<FieldName extends TableFieldName> = {\n [name in FieldName]: TableStringFieldValue;\n};\n\nexport type TableBooleanField<FieldName extends TableFieldName> = {\n [name in FieldName]: TableBooleanFieldValue;\n};\n\nexport type TableNumberField<FieldName extends TableFieldName> = {\n [name in FieldName]: TableNumberFieldValue;\n};\n\nexport interface TableValidity extends ValidityObject {\n readonly duplicateRecordId: boolean;\n readonly missingRecordId: boolean;\n readonly invalidRecordId: boolean;\n readonly duplicateColumnId: boolean;\n readonly missingColumnId: boolean;\n readonly duplicateSortIndex: boolean;\n readonly duplicateGroupIndex: boolean;\n readonly idFieldNameNotConfigured: boolean;\n readonly invalidColumnConfiguration: boolean;\n readonly invalidParentIdConfiguration: boolean;\n}\n\n/**\n * The hierarachy options for a record in the table.\n */\nexport interface TableSetRecordHierarchyOptions {\n recordId: string;\n options: TableRecordHierarchyOptions;\n}\n\n/**\n * Describes the hierarchy options that can be configured for a record in the table.\n */\nexport interface TableRecordHierarchyOptions {\n delayedHierarchyState: TableRecordDelayedHierarchyState;\n}\n\nexport const TableRecordDelayedHierarchyState = {\n none: undefined,\n canLoadChildren: 'can-load-children',\n loadingChildren: 'loading-children'\n} as const;\nexport type TableRecordDelayedHierarchyState = (typeof TableRecordDelayedHierarchyState)[keyof typeof TableRecordDelayedHierarchyState];\n\nexport interface TableActionMenuToggleEventDetail {\n newState: boolean;\n oldState: boolean;\n recordIds: string[];\n columnId?: string;\n}\n\n/**\n * The possible directions a table column can be sorted in.\n */\nexport const TableColumnSortDirection = {\n none: undefined,\n ascending: 'ascending',\n descending: 'descending'\n} as const;\nexport type TableColumnSortDirection = (typeof TableColumnSortDirection)[keyof typeof TableColumnSortDirection];\n\n/**\n * The selection modes of rows in the table.\n */\nexport const TableRowSelectionMode = {\n none: undefined,\n single: 'single',\n multiple: 'multiple'\n} as const;\nexport type TableRowSelectionMode = (typeof TableRowSelectionMode)[keyof typeof TableRowSelectionMode];\n\n/**\n * @internal\n *\n * The possible selection states that the table or a table row can be in.\n */\nexport const TableRowSelectionState = {\n notSelected: 'not-selected',\n selected: 'selected',\n partiallySelected: 'partially-selected'\n} as const;\nexport type TableRowSelectionState = (typeof TableRowSelectionState)[keyof typeof TableRowSelectionState];\n\n/**\n * @internal\n *\n * Internal event detail type for a row's selection state changing\n */\nexport interface TableRowSelectionToggleEventDetail {\n oldState: boolean;\n newState: boolean;\n}\n\n/**\n * Event detail type for row selection events in the table.\n */\nexport interface TableRowSelectionEventDetail {\n selectedRecordIds: string[];\n}\n\n/**\n * Event detail type for row toggle events in the table.\n */\nexport interface TableRowExpansionToggleEventDetail {\n oldState: boolean;\n newState: boolean;\n recordId: string;\n}\n\n/**\n * Event detail type for interactive column configuration changes.\n *\n * The column-configuration-change event is emitted when a column's configuration\n * is modified programmatically, such as by clicking on the column's header to sort\n * the column. The items in the `columns` array are specified in the same order as\n * the columns are listed in the DOM.\n */\nexport interface TableColumnConfigurationChangeEventDetail {\n columns: TableColumnConfiguration[];\n}\n\n/**\n * A representation of the current configuration of a column within the table.\n */\nexport interface TableColumnConfiguration {\n columnId?: string;\n sortIndex?: number;\n sortDirection: TableColumnSortDirection;\n groupIndex?: number;\n hidden: boolean;\n fractionalWidth: number;\n pixelWidth?: number;\n}\n\n/**\n * @internal\n *\n * Internal representation of a row in the table\n */\nexport interface TableRowState<TData extends TableRecord = TableRecord> {\n record: TData;\n id: string;\n selectionState: TableRowSelectionState;\n isGroupRow: boolean;\n groupRowValue?: unknown;\n isExpanded: boolean;\n nestingLevel?: number;\n immediateChildCount?: number;\n groupColumn?: TableColumn;\n isParentRow: boolean;\n isLoadingChildren: boolean;\n requestedSlots: SlotMetadata[];\n resolvedRowIndex?: number;\n}\n\n/**\n * @internal\n *\n * Alignment of column content\n */\nexport const TableColumnAlignment = {\n left: 'left',\n right: 'right'\n} as const;\nexport type TableColumnAlignment = (typeof TableColumnAlignment)[keyof typeof TableColumnAlignment];\n\n/**\n * Table keyboard focus types\n */\nexport const TableFocusType = {\n none: 'none',\n columnHeader: 'columnHeader',\n headerActions: 'headerActions',\n row: 'row',\n rowSelectionCheckbox: 'rowSelectionCheckbox',\n cell: 'cell',\n cellActionMenu: 'cellActionMenu',\n cellContent: 'cellContent'\n} as const;\nexport type TableFocusType = (typeof TableFocusType)[keyof typeof TableFocusType];\n\n/**\n * @internal\n *\n * Focusable elements of a table row\n */\nexport interface TableRowFocusableElements {\n selectionCheckbox?: Checkbox;\n cells: {\n cell: TableCell,\n actionMenuButton?: MenuButton\n }[];\n}\n\n/**\n * Focusable elements of a table's header\n */\nexport interface TableHeaderFocusableElements {\n headerActions: HTMLElement[];\n columnHeaders: HTMLElement[];\n}\n\n/**\n * @internal\n */\nexport interface CellViewSlotRequestEventDetail {\n slots: SlotMetadata[];\n}\n\n/**\n * @internal\n */\nexport interface RowSlotRequestEventDetail {\n columnInternalId: string;\n recordId: string;\n slots: SlotMetadata[];\n}\n\n/**\n * @internal\n */\nexport interface SlotMetadata {\n slot: string;\n name: string;\n}\n"]}
@@ -6,7 +6,7 @@ const validateCellViewTemplate = (cellViewTag) => {
6
6
  try {
7
7
  instance = document.createElement(cellViewTag);
8
8
  }
9
- catch (ex) {
9
+ catch (_ex) {
10
10
  // Swallow construction error to report a better one
11
11
  }
12
12
  if (!(instance instanceof TableCellView)) {
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/base/cell-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,wBAAwB,GAAG,CAAC,WAAmB,EAAQ,EAAE;IAC3D,IAAI,QAAQ,CAAC;IACb,IAAI,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACV,oDAAoD;IACxD,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,YAAY,aAAa,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACX,uBAAuB,WAAW,uDAAuD,CAC5F,CAAC;IACN,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAClC,WAAmB,EACI,EAAE;IACzB,wBAAwB,CAAC,WAAW,CAAC,CAAC;IACtC,OAAO,IAAI,CAAW;WACf,WAAW;2BACK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU;6BAC1B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY;uBACpC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;yBACX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;;cAG1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,SAAS,IAAI,EAAE,EAAE,IAAI,CAAmB;;4BAEhE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAO,EAAE,CAAC,CAAC;4BACxD,CAAC,CAAC,EAAE,CAAC,CAAC;;aAErB,CAAC;YACF,WAAW;KAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { type ViewTemplate, html, repeat } from '@ni/fast-element';\nimport type { TableCell } from '../../../table/components/cell';\nimport { TableCellView } from '.';\nimport { uniquifySlotNameForColumn } from '../../../table/models/utilities';\n\nconst validateCellViewTemplate = (cellViewTag: string): void => {\n let instance;\n try {\n instance = document.createElement(cellViewTag);\n } catch (ex) {\n // Swallow construction error to report a better one\n }\n if (!(instance instanceof TableCellView)) {\n throw new Error(\n `Cell view tag name (${cellViewTag}) must evaluate to an element extending TableCellView`\n );\n }\n};\n\nexport const createCellViewTemplate = (\n cellViewTag: string\n): ViewTemplate<TableCell> => {\n validateCellViewTemplate(cellViewTag);\n return html<TableCell>`\n <${cellViewTag}\n :cellRecord=\"${y => y.cellState?.cellRecord}\"\n :columnConfig=\"${y => y.cellState?.columnConfig}\"\n :column=\"${y => y.column}\"\n :recordId=\"${y => y.recordId}\"\n class=\"cell-view\"\n >\n ${repeat(y => y.column?.columnInternals.slotNames || [], html<string, TableCell>`\n <slot\n name=\"${(x, c) => uniquifySlotNameForColumn(c.parent.column!, x)}\"\n slot=\"${x => x}\"\n ></slot>\n `)}\n </${cellViewTag}>\n `;\n};\n"]}
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/base/cell-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,wBAAwB,GAAG,CAAC,WAAmB,EAAQ,EAAE;IAC3D,IAAI,QAAQ,CAAC;IACb,IAAI,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,oDAAoD;IACxD,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,YAAY,aAAa,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACX,uBAAuB,WAAW,uDAAuD,CAC5F,CAAC;IACN,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAClC,WAAmB,EACI,EAAE;IACzB,wBAAwB,CAAC,WAAW,CAAC,CAAC;IACtC,OAAO,IAAI,CAAW;WACf,WAAW;2BACK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU;6BAC1B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY;uBACpC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;yBACX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;;cAG1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,SAAS,IAAI,EAAE,EAAE,IAAI,CAAmB;;4BAEhE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAO,EAAE,CAAC,CAAC;4BACxD,CAAC,CAAC,EAAE,CAAC,CAAC;;aAErB,CAAC;YACF,WAAW;KAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { type ViewTemplate, html, repeat } from '@ni/fast-element';\nimport type { TableCell } from '../../../table/components/cell';\nimport { TableCellView } from '.';\nimport { uniquifySlotNameForColumn } from '../../../table/models/utilities';\n\nconst validateCellViewTemplate = (cellViewTag: string): void => {\n let instance;\n try {\n instance = document.createElement(cellViewTag);\n } catch (_ex) {\n // Swallow construction error to report a better one\n }\n if (!(instance instanceof TableCellView)) {\n throw new Error(\n `Cell view tag name (${cellViewTag}) must evaluate to an element extending TableCellView`\n );\n }\n};\n\nexport const createCellViewTemplate = (\n cellViewTag: string\n): ViewTemplate<TableCell> => {\n validateCellViewTemplate(cellViewTag);\n return html<TableCell>`\n <${cellViewTag}\n :cellRecord=\"${y => y.cellState?.cellRecord}\"\n :columnConfig=\"${y => y.cellState?.columnConfig}\"\n :column=\"${y => y.column}\"\n :recordId=\"${y => y.recordId}\"\n class=\"cell-view\"\n >\n ${repeat(y => y.column?.columnInternals.slotNames || [], html<string, TableCell>`\n <slot\n name=\"${(x, c) => uniquifySlotNameForColumn(c.parent.column!, x)}\"\n slot=\"${x => x}\"\n ></slot>\n `)}\n </${cellViewTag}>\n `;\n};\n"]}
@@ -5,7 +5,7 @@ const validateGroupHeaderViewTemplate = (groupHeaderViewTag) => {
5
5
  try {
6
6
  instance = document.createElement(groupHeaderViewTag);
7
7
  }
8
- catch (ex) {
8
+ catch (_ex) {
9
9
  // Swallow construction error to report a better one
10
10
  }
11
11
  if (!(instance instanceof TableGroupHeaderView)) {
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/base/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAEzC,MAAM,+BAA+B,GAAG,CAAC,kBAA0B,EAAQ,EAAE;IACzE,IAAI,QAAQ,CAAC;IACb,IAAI,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACV,oDAAoD;IACxD,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,YAAY,oBAAoB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACX,+BAA+B,kBAAkB,8DAA8D,CAClH,CAAC;IACN,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CACzC,kBAA0B,EACC,EAAE;IAC7B,+BAA+B,CAAC,kBAAkB,CAAC,CAAC;IACpD,OAAO,IAAI,CAAe;WACnB,kBAAkB;iCACI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa;6BACxB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,YAAY;;;YAGjE,kBAAkB;KACzB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { html, ViewTemplate } from '@ni/fast-element';\nimport type { TableGroupRow } from '../../../table/components/group-row';\nimport { TableGroupHeaderView } from '.';\n\nconst validateGroupHeaderViewTemplate = (groupHeaderViewTag: string): void => {\n let instance;\n try {\n instance = document.createElement(groupHeaderViewTag);\n } catch (ex) {\n // Swallow construction error to report a better one\n }\n if (!(instance instanceof TableGroupHeaderView)) {\n throw new Error(\n `Group header view tag name (${groupHeaderViewTag}) must evaluate to an element extending TableGroupHeaderView`\n );\n }\n};\n\nexport const createGroupHeaderViewTemplate = (\n groupHeaderViewTag: string\n): ViewTemplate<TableGroupRow> => {\n validateGroupHeaderViewTemplate(groupHeaderViewTag);\n return html<TableGroupRow>`\n <${groupHeaderViewTag}\n :groupHeaderValue=\"${x => x.groupRowValue}\"\n :columnConfig=\"${x => x.groupColumn?.columnInternals.columnConfig}\"\n class=\"group-header-view\"\n >\n </${groupHeaderViewTag}>\n `;\n};\n"]}
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/base/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAEzC,MAAM,+BAA+B,GAAG,CAAC,kBAA0B,EAAQ,EAAE;IACzE,IAAI,QAAQ,CAAC;IACb,IAAI,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,oDAAoD;IACxD,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,YAAY,oBAAoB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACX,+BAA+B,kBAAkB,8DAA8D,CAClH,CAAC;IACN,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CACzC,kBAA0B,EACC,EAAE;IAC7B,+BAA+B,CAAC,kBAAkB,CAAC,CAAC;IACpD,OAAO,IAAI,CAAe;WACnB,kBAAkB;iCACI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa;6BACxB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,YAAY;;;YAGjE,kBAAkB;KACzB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { html, ViewTemplate } from '@ni/fast-element';\nimport type { TableGroupRow } from '../../../table/components/group-row';\nimport { TableGroupHeaderView } from '.';\n\nconst validateGroupHeaderViewTemplate = (groupHeaderViewTag: string): void => {\n let instance;\n try {\n instance = document.createElement(groupHeaderViewTag);\n } catch (_ex) {\n // Swallow construction error to report a better one\n }\n if (!(instance instanceof TableGroupHeaderView)) {\n throw new Error(\n `Group header view tag name (${groupHeaderViewTag}) must evaluate to an element extending TableGroupHeaderView`\n );\n }\n};\n\nexport const createGroupHeaderViewTemplate = (\n groupHeaderViewTag: string\n): ViewTemplate<TableGroupRow> => {\n validateGroupHeaderViewTemplate(groupHeaderViewTag);\n return html<TableGroupRow>`\n <${groupHeaderViewTag}\n :groupHeaderValue=\"${x => x.groupRowValue}\"\n :columnConfig=\"${x => x.groupColumn?.columnInternals.columnConfig}\"\n class=\"group-header-view\"\n >\n </${groupHeaderViewTag}>\n `;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/base/types.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;;OAGG;IACH,wBAAwB,EAAE,0BAA0B;CAC9C,CAAC;AAOX,MAAM,cAAc,GAAG,EAAE,CAAC,CAAC,mBAAmB;AAC9C,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC,wBAAwB;AACjD,MAAM,gBAAgB,GAAG,EAAE,CAAC,CAAC,4BAA4B;AACzD,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,oBAAoB;MAChE,uBAAuB;MACvB,aAAa;MACb,cAAc,CAAC,YAAY;MAC3B,aAAa;MACb,cAAc,CAAC,aAAa;MAC5B,aAAa;MACb,gBAAgB;MAChB,aAAa,CAAC,CAAC,qBAAqB;AAE1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,oBAAoB;MACjE,cAAc;MACd,aAAa,CAAC,CAAC,qBAAqB;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC","sourcesContent":["import type { TableRecord } from '../../table/types';\nimport type { ValidityObject } from '../../utilities/models/validator';\n\n/**\n * An object whose fields are defined by a particular TableColumn, which is used by the column's\n * cellTemplate implementation.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TableCellRecord extends TableRecord {}\n\nexport interface TableCellState<\n TCellRecord extends TableCellRecord = TableCellRecord,\n TColumnConfig = unknown\n> {\n cellRecord?: TCellRecord;\n columnConfig?: TColumnConfig;\n}\n\n/**\n * The event details for the 'delegated-event' CustomEvent\n */\nexport interface DelegatedEventEventDetails {\n originalEvent: Event;\n recordId: string;\n}\n\n/**\n * The possible operations to use when sorting a table column.\n */\nexport const TableColumnSortOperation = {\n /**\n * Performs a sort using `===`, `<`, and `>` operators\n */\n basic: 'basic',\n /**\n * Performs a locale-aware case-sensitive string sort on the columns.\n * Only use this sort operation if the field is of type `string | undefined | null`.\n */\n localeAwareCaseSensitive: 'localeAwareCaseSensitive'\n} as const;\nexport type TableColumnSortOperation =\n (typeof TableColumnSortOperation)[keyof typeof TableColumnSortOperation];\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TableColumnValidity extends ValidityObject {}\n\nconst columnIconSize = 16; // `iconSize` token\nconst columnSpacing = 8; // `mediumPadding` token\nconst menuDropdownSize = 24; // `controlSlimHeight` token\nconst oneCharPlusEllipsisSize = 21;\nexport const defaultMinPixelWidth = columnSpacing // left cell padding\n + oneCharPlusEllipsisSize\n + columnSpacing\n + columnIconSize // sort icon\n + columnSpacing\n + columnIconSize // group icon\n + columnSpacing\n + menuDropdownSize\n + columnSpacing; // right cell padding\n\nexport const singleIconColumnWidth = columnSpacing // left cell padding\n + columnIconSize\n + columnSpacing; // right cell padding\n\nexport const defaultFractionalWidth = 1;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/base/types.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;;OAGG;IACH,wBAAwB,EAAE,0BAA0B;CAC9C,CAAC;AAMX,MAAM,cAAc,GAAG,EAAE,CAAC,CAAC,mBAAmB;AAC9C,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC,wBAAwB;AACjD,MAAM,gBAAgB,GAAG,EAAE,CAAC,CAAC,4BAA4B;AACzD,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,oBAAoB;MAChE,uBAAuB;MACvB,aAAa;MACb,cAAc,CAAC,YAAY;MAC3B,aAAa;MACb,cAAc,CAAC,aAAa;MAC5B,aAAa;MACb,gBAAgB;MAChB,aAAa,CAAC,CAAC,qBAAqB;AAE1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,oBAAoB;MACjE,cAAc;MACd,aAAa,CAAC,CAAC,qBAAqB;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC","sourcesContent":["import type { TableRecord } from '../../table/types';\nimport type { ValidityObject } from '../../utilities/models/validator';\n\n/**\n * An object whose fields are defined by a particular TableColumn, which is used by the column's\n * cellTemplate implementation.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TableCellRecord extends TableRecord {}\n\nexport interface TableCellState<\n TCellRecord extends TableCellRecord = TableCellRecord,\n TColumnConfig = unknown\n> {\n cellRecord?: TCellRecord;\n columnConfig?: TColumnConfig;\n}\n\n/**\n * The event details for the 'delegated-event' CustomEvent\n */\nexport interface DelegatedEventEventDetails {\n originalEvent: Event;\n recordId: string;\n}\n\n/**\n * The possible operations to use when sorting a table column.\n */\nexport const TableColumnSortOperation = {\n /**\n * Performs a sort using `===`, `<`, and `>` operators\n */\n basic: 'basic',\n /**\n * Performs a locale-aware case-sensitive string sort on the columns.\n * Only use this sort operation if the field is of type `string | undefined | null`.\n */\n localeAwareCaseSensitive: 'localeAwareCaseSensitive'\n} as const;\nexport type TableColumnSortOperation = (typeof TableColumnSortOperation)[keyof typeof TableColumnSortOperation];\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TableColumnValidity extends ValidityObject {}\n\nconst columnIconSize = 16; // `iconSize` token\nconst columnSpacing = 8; // `mediumPadding` token\nconst menuDropdownSize = 24; // `controlSlimHeight` token\nconst oneCharPlusEllipsisSize = 21;\nexport const defaultMinPixelWidth = columnSpacing // left cell padding\n + oneCharPlusEllipsisSize\n + columnSpacing\n + columnIconSize // sort icon\n + columnSpacing\n + columnIconSize // group icon\n + columnSpacing\n + menuDropdownSize\n + columnSpacing; // right cell padding\n\nexport const singleIconColumnWidth = columnSpacing // left cell padding\n + columnIconSize\n + columnSpacing; // right cell padding\n\nexport const defaultFractionalWidth = 1;\n"]}
@@ -134,7 +134,7 @@ export class TableColumnDateText extends mixinTextBase((TableColumnTextBase)) {
134
134
  try {
135
135
  return new Intl.DateTimeFormat(lang.getValueFor(this), options);
136
136
  }
137
- catch (e) {
137
+ catch (_e) {
138
138
  return undefined;
139
139
  }
140
140
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/date-text/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkBzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAc5E;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,aAAa,CAClD,CAAA,mBAGC,CAAA,CACJ;IALD;;QAqEqB,mBAAc,GAAuC;YAClE,YAAY,EAAE,GAAG,EAAE;gBACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC9B,CAAC;SACJ,CAAC;IAwKN,CAAC;IAtKmB,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,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E,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACD;AAGjC;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC;kEACT;AAG/B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACP;AAG3B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACP;AAG3B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACD;AAgL5C,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC1D,QAAQ,EAAE,wBAAwB;IAClC,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,+BAA+B,CAAC","sourcesContent":["import { DesignSystem, type DesignTokenSubscriber } from '@ni/fast-foundation';\nimport { attr } from '@ni/fast-element';\nimport { styles } from '../base/styles';\nimport { template } from '../base/template';\nimport type { TableNumberField } from '../../table/types';\nimport { TableColumnTextBase, mixinTextBase } from '../text-base';\nimport { TableColumnSortOperation } from '../base/types';\nimport { tableColumnDateTextGroupHeaderViewTag } from './group-header-view';\nimport { tableColumnDateTextCellViewTag } from './cell-view';\nimport type { ColumnInternalsOptions } from '../base/models/column-internals';\nimport { DateTextFormat } from './types';\nimport type {\n LocaleMatcherAlgorithm,\n EraFormat,\n YearFormat,\n DayFormat,\n HourFormat,\n MinuteFormat,\n SecondFormat,\n TimeZoneNameFormat,\n FormatMatcherAlgorithm,\n DayPeriodFormat,\n DateStyle,\n TimeStyle,\n HourCycleFormat,\n MonthFormat,\n WeekdayFormat\n} from './types';\nimport { TableColumnDateTextValidator } from './models/table-column-date-text-validator';\nimport { lang } from '../../theme-provider';\nimport { optionalBooleanConverter } from '../../utilities/models/converter';\nimport type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';\n\nexport type TableColumnDateTextCellRecord = TableNumberField<'value'>;\nexport interface TableColumnDateTextColumnConfig extends TableColumnTextBaseColumnConfig {\n formatter: Intl.DateTimeFormat;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-date-text': TableColumnDateText;\n }\n}\n\n/**\n * The table column for displaying dates/times as text.\n */\nexport class TableColumnDateText extends mixinTextBase(\n TableColumnTextBase<\n TableColumnDateTextColumnConfig,\n TableColumnDateTextValidator\n >\n) {\n @attr\n public format: DateTextFormat;\n\n @attr({ attribute: 'custom-locale-matcher' })\n public customLocaleMatcher: LocaleMatcherAlgorithm;\n\n @attr({ attribute: 'custom-weekday' })\n public customWeekday: WeekdayFormat;\n\n @attr({ attribute: 'custom-era' })\n public customEra: EraFormat;\n\n @attr({ attribute: 'custom-year' })\n public customYear: YearFormat;\n\n @attr({ attribute: 'custom-month' })\n public customMonth: MonthFormat;\n\n @attr({ attribute: 'custom-day' })\n public customDay: DayFormat;\n\n @attr({ attribute: 'custom-hour' })\n public customHour: HourFormat;\n\n @attr({ attribute: 'custom-minute' })\n public customMinute: MinuteFormat;\n\n @attr({ attribute: 'custom-second' })\n public customSecond: SecondFormat;\n\n @attr({ attribute: 'custom-time-zone-name' })\n public customTimeZoneName: TimeZoneNameFormat;\n\n @attr({ attribute: 'custom-format-matcher' })\n public customFormatMatcher: FormatMatcherAlgorithm;\n\n // Later versions of FAST (than the legacy branch we're on) have a nullableBooleanConverter.\n // We should replace our converter with that one when it is available to us.\n // See issue related to adopting FastElement 2.0: https://github.com/ni/nimble/issues/572\n @attr({ attribute: 'custom-hour12', converter: optionalBooleanConverter })\n public customHour12?: boolean;\n\n @attr({ attribute: 'custom-time-zone' })\n public customTimeZone?: string;\n\n @attr({ attribute: 'custom-calendar' })\n public customCalendar?: string;\n\n @attr({ attribute: 'custom-day-period' })\n public customDayPeriod: DayPeriodFormat;\n\n @attr({ attribute: 'custom-numbering-system' })\n public customNumberingSystem?: string;\n\n @attr({ attribute: 'custom-date-style' })\n public customDateStyle: DateStyle;\n\n @attr({ attribute: 'custom-time-style' })\n public customTimeStyle: TimeStyle;\n\n @attr({ attribute: 'custom-hour-cycle' })\n public customHourCycle: HourCycleFormat;\n\n private readonly langSubscriber: DesignTokenSubscriber<typeof lang> = {\n handleChange: () => {\n this.updateColumnConfig();\n }\n };\n\n public override connectedCallback(): void {\n super.connectedCallback();\n lang.subscribe(this.langSubscriber, this);\n this.updateColumnConfig();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n lang.unsubscribe(this.langSubscriber, this);\n }\n\n public placeholderChanged(): void {\n this.updateColumnConfig();\n }\n\n protected override getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnDateTextValidator> {\n return {\n cellRecordFieldNames: ['value'],\n cellViewTag: tableColumnDateTextCellViewTag,\n groupHeaderViewTag: tableColumnDateTextGroupHeaderViewTag,\n delegatedEvents: [],\n sortOperation: TableColumnSortOperation.basic,\n validator: new TableColumnDateTextValidator()\n };\n }\n\n protected formatChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customLocaleMatcherChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customWeekdayChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customEraChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customYearChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customMonthChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customDayChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customHourChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customMinuteChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customSecondChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customTimeZoneNameChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customFormatMatcherChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customHour12Changed(): void {\n this.updateColumnConfig();\n }\n\n protected customTimeZoneChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customCalendarChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customDayPeriodChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customNumberingSystemChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customDateStyleChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customTimeStyleChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customHourCycleChanged(): void {\n this.updateColumnConfig();\n }\n\n private updateColumnConfig(): void {\n const formatter = this.createFormatter();\n\n if (formatter) {\n const columnConfig: TableColumnDateTextColumnConfig = {\n formatter,\n placeholder: this.placeholder\n };\n this.columnInternals.columnConfig = columnConfig;\n this.columnInternals.validator.setCustomOptionsValidity(true);\n } else {\n this.columnInternals.columnConfig = undefined;\n this.columnInternals.validator.setCustomOptionsValidity(false);\n }\n }\n\n private createFormatter(): Intl.DateTimeFormat | undefined {\n let options: Intl.DateTimeFormatOptions;\n if (this.format === DateTextFormat.default) {\n options = {\n dateStyle: 'medium',\n timeStyle: 'medium'\n };\n } else {\n options = this.getCustomFormattingOptions();\n }\n try {\n return new Intl.DateTimeFormat(lang.getValueFor(this), options);\n } catch (e) {\n return undefined;\n }\n }\n\n private getCustomFormattingOptions(): Intl.DateTimeFormatOptions {\n // There's a FAST bug (https://github.com/microsoft/fast/issues/6630) where removing\n // attributes sets their values to null instead of undefined. To work around this,\n // translate null values to undefined.\n const options: Intl.DateTimeFormatOptions = {\n localeMatcher: this.customLocaleMatcher ?? undefined,\n weekday: this.customWeekday ?? undefined,\n era: this.customEra ?? undefined,\n year: this.customYear ?? undefined,\n month: this.customMonth ?? undefined,\n day: this.customDay ?? undefined,\n hour: this.customHour ?? undefined,\n minute: this.customMinute ?? undefined,\n second: this.customSecond ?? undefined,\n timeZoneName: this.customTimeZoneName ?? undefined,\n formatMatcher: this.customFormatMatcher ?? undefined,\n hour12: this.customHour12 ?? undefined,\n timeZone: this.customTimeZone ?? undefined,\n calendar: this.customCalendar ?? undefined,\n dayPeriod: this.customDayPeriod ?? undefined,\n numberingSystem: this.customNumberingSystem ?? undefined,\n dateStyle: this.customDateStyle ?? undefined,\n timeStyle: this.customTimeStyle ?? undefined,\n hourCycle: this.customHourCycle ?? undefined\n };\n return options;\n }\n}\n\nconst nimbleTableColumnDateText = TableColumnDateText.compose({\n baseName: 'table-column-date-text',\n template,\n styles\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleTableColumnDateText());\nexport const tableColumnDateTextTag = 'nimble-table-column-date-text';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/date-text/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkBzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAc5E;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,aAAa,CAClD,CAAA,mBAGC,CAAA,CACJ;IALD;;QAqEqB,mBAAc,GAAuC;YAClE,YAAY,EAAE,GAAG,EAAE;gBACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC9B,CAAC;SACJ,CAAC;IAw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,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;2DACR;AAGxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACD;AAGjC;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC;kEACT;AAG/B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACP;AAG3B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACP;AAG3B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;4DACD;AAgL5C,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC1D,QAAQ,EAAE,wBAAwB;IAClC,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,+BAA+B,CAAC","sourcesContent":["import { DesignSystem, type DesignTokenSubscriber } from '@ni/fast-foundation';\nimport { attr } from '@ni/fast-element';\nimport { styles } from '../base/styles';\nimport { template } from '../base/template';\nimport type { TableNumberField } from '../../table/types';\nimport { TableColumnTextBase, mixinTextBase } from '../text-base';\nimport { TableColumnSortOperation } from '../base/types';\nimport { tableColumnDateTextGroupHeaderViewTag } from './group-header-view';\nimport { tableColumnDateTextCellViewTag } from './cell-view';\nimport type { ColumnInternalsOptions } from '../base/models/column-internals';\nimport { DateTextFormat } from './types';\nimport type {\n LocaleMatcherAlgorithm,\n EraFormat,\n YearFormat,\n DayFormat,\n HourFormat,\n MinuteFormat,\n SecondFormat,\n TimeZoneNameFormat,\n FormatMatcherAlgorithm,\n DayPeriodFormat,\n DateStyle,\n TimeStyle,\n HourCycleFormat,\n MonthFormat,\n WeekdayFormat\n} from './types';\nimport { TableColumnDateTextValidator } from './models/table-column-date-text-validator';\nimport { lang } from '../../theme-provider';\nimport { optionalBooleanConverter } from '../../utilities/models/converter';\nimport type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';\n\nexport type TableColumnDateTextCellRecord = TableNumberField<'value'>;\nexport interface TableColumnDateTextColumnConfig extends TableColumnTextBaseColumnConfig {\n formatter: Intl.DateTimeFormat;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-date-text': TableColumnDateText;\n }\n}\n\n/**\n * The table column for displaying dates/times as text.\n */\nexport class TableColumnDateText extends mixinTextBase(\n TableColumnTextBase<\n TableColumnDateTextColumnConfig,\n TableColumnDateTextValidator\n >\n) {\n @attr\n public format: DateTextFormat;\n\n @attr({ attribute: 'custom-locale-matcher' })\n public customLocaleMatcher: LocaleMatcherAlgorithm;\n\n @attr({ attribute: 'custom-weekday' })\n public customWeekday: WeekdayFormat;\n\n @attr({ attribute: 'custom-era' })\n public customEra: EraFormat;\n\n @attr({ attribute: 'custom-year' })\n public customYear: YearFormat;\n\n @attr({ attribute: 'custom-month' })\n public customMonth: MonthFormat;\n\n @attr({ attribute: 'custom-day' })\n public customDay: DayFormat;\n\n @attr({ attribute: 'custom-hour' })\n public customHour: HourFormat;\n\n @attr({ attribute: 'custom-minute' })\n public customMinute: MinuteFormat;\n\n @attr({ attribute: 'custom-second' })\n public customSecond: SecondFormat;\n\n @attr({ attribute: 'custom-time-zone-name' })\n public customTimeZoneName: TimeZoneNameFormat;\n\n @attr({ attribute: 'custom-format-matcher' })\n public customFormatMatcher: FormatMatcherAlgorithm;\n\n // Later versions of FAST (than the legacy branch we're on) have a nullableBooleanConverter.\n // We should replace our converter with that one when it is available to us.\n // See issue related to adopting FastElement 2.0: https://github.com/ni/nimble/issues/572\n @attr({ attribute: 'custom-hour12', converter: optionalBooleanConverter })\n public customHour12?: boolean;\n\n @attr({ attribute: 'custom-time-zone' })\n public customTimeZone?: string;\n\n @attr({ attribute: 'custom-calendar' })\n public customCalendar?: string;\n\n @attr({ attribute: 'custom-day-period' })\n public customDayPeriod: DayPeriodFormat;\n\n @attr({ attribute: 'custom-numbering-system' })\n public customNumberingSystem?: string;\n\n @attr({ attribute: 'custom-date-style' })\n public customDateStyle: DateStyle;\n\n @attr({ attribute: 'custom-time-style' })\n public customTimeStyle: TimeStyle;\n\n @attr({ attribute: 'custom-hour-cycle' })\n public customHourCycle: HourCycleFormat;\n\n private readonly langSubscriber: DesignTokenSubscriber<typeof lang> = {\n handleChange: () => {\n this.updateColumnConfig();\n }\n };\n\n public override connectedCallback(): void {\n super.connectedCallback();\n lang.subscribe(this.langSubscriber, this);\n this.updateColumnConfig();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n lang.unsubscribe(this.langSubscriber, this);\n }\n\n public placeholderChanged(): void {\n this.updateColumnConfig();\n }\n\n protected override getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnDateTextValidator> {\n return {\n cellRecordFieldNames: ['value'],\n cellViewTag: tableColumnDateTextCellViewTag,\n groupHeaderViewTag: tableColumnDateTextGroupHeaderViewTag,\n delegatedEvents: [],\n sortOperation: TableColumnSortOperation.basic,\n validator: new TableColumnDateTextValidator()\n };\n }\n\n protected formatChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customLocaleMatcherChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customWeekdayChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customEraChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customYearChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customMonthChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customDayChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customHourChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customMinuteChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customSecondChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customTimeZoneNameChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customFormatMatcherChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customHour12Changed(): void {\n this.updateColumnConfig();\n }\n\n protected customTimeZoneChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customCalendarChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customDayPeriodChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customNumberingSystemChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customDateStyleChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customTimeStyleChanged(): void {\n this.updateColumnConfig();\n }\n\n protected customHourCycleChanged(): void {\n this.updateColumnConfig();\n }\n\n private updateColumnConfig(): void {\n const formatter = this.createFormatter();\n\n if (formatter) {\n const columnConfig: TableColumnDateTextColumnConfig = {\n formatter,\n placeholder: this.placeholder\n };\n this.columnInternals.columnConfig = columnConfig;\n this.columnInternals.validator.setCustomOptionsValidity(true);\n } else {\n this.columnInternals.columnConfig = undefined;\n this.columnInternals.validator.setCustomOptionsValidity(false);\n }\n }\n\n private createFormatter(): Intl.DateTimeFormat | undefined {\n let options: Intl.DateTimeFormatOptions;\n if (this.format === DateTextFormat.default) {\n options = {\n dateStyle: 'medium',\n timeStyle: 'medium'\n };\n } else {\n options = this.getCustomFormattingOptions();\n }\n try {\n return new Intl.DateTimeFormat(lang.getValueFor(this), options);\n } catch (_e) {\n return undefined;\n }\n }\n\n private getCustomFormattingOptions(): Intl.DateTimeFormatOptions {\n // There's a FAST bug (https://github.com/microsoft/fast/issues/6630) where removing\n // attributes sets their values to null instead of undefined. To work around this,\n // translate null values to undefined.\n const options: Intl.DateTimeFormatOptions = {\n localeMatcher: this.customLocaleMatcher ?? undefined,\n weekday: this.customWeekday ?? undefined,\n era: this.customEra ?? undefined,\n year: this.customYear ?? undefined,\n month: this.customMonth ?? undefined,\n day: this.customDay ?? undefined,\n hour: this.customHour ?? undefined,\n minute: this.customMinute ?? undefined,\n second: this.customSecond ?? undefined,\n timeZoneName: this.customTimeZoneName ?? undefined,\n formatMatcher: this.customFormatMatcher ?? undefined,\n hour12: this.customHour12 ?? undefined,\n timeZone: this.customTimeZone ?? undefined,\n calendar: this.customCalendar ?? undefined,\n dayPeriod: this.customDayPeriod ?? undefined,\n numberingSystem: this.customNumberingSystem ?? undefined,\n dateStyle: this.customDateStyle ?? undefined,\n timeStyle: this.customTimeStyle ?? undefined,\n hourCycle: this.customHourCycle ?? undefined\n };\n return options;\n }\n}\n\nconst nimbleTableColumnDateText = TableColumnDateText.compose({\n baseName: 'table-column-date-text',\n template,\n styles\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleTableColumnDateText());\nexport const tableColumnDateTextTag = 'nimble-table-column-date-text';\n"]}
@@ -3,7 +3,7 @@ export function formatNumericDate(formatter, date) {
3
3
  try {
4
4
  return formatter.format(date);
5
5
  }
6
- catch (e) {
6
+ catch (_e) {
7
7
  return '';
8
8
  }
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"format-helper.js","sourceRoot":"","sources":["../../../../../src/table-column/date-text/models/format-helper.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAC7B,SAA8B,EAC9B,IAA2B;IAE3B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC;YACD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC","sourcesContent":["import type { TableNumberFieldValue } from '../../../table/types';\n\nexport function formatNumericDate(\n formatter: Intl.DateTimeFormat,\n date: TableNumberFieldValue\n): string {\n if (typeof date === 'number') {\n try {\n return formatter.format(date);\n } catch (e) {\n return '';\n }\n } else {\n return '';\n }\n}\n"]}
1
+ {"version":3,"file":"format-helper.js","sourceRoot":"","sources":["../../../../../src/table-column/date-text/models/format-helper.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAC7B,SAA8B,EAC9B,IAA2B;IAE3B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC;YACD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC","sourcesContent":["import type { TableNumberFieldValue } from '../../../table/types';\n\nexport function formatNumericDate(\n formatter: Intl.DateTimeFormat,\n date: TableNumberFieldValue\n): string {\n if (typeof date === 'number') {\n try {\n return formatter.format(date);\n } catch (_e) {\n return '';\n }\n } else {\n return '';\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/date-text/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAC","sourcesContent":["/**\n * Formatting scheme for the date-text table column\n */\nexport const DateTextFormat = {\n default: undefined,\n custom: 'custom'\n} as const;\nexport type DateTextFormat =\n (typeof DateTextFormat)[keyof typeof DateTextFormat];\n\nexport type LocaleMatcherAlgorithm =\n Intl.DateTimeFormatOptions['localeMatcher'];\nexport type WeekdayFormat = Intl.DateTimeFormatOptions['weekday'];\nexport type EraFormat = Intl.DateTimeFormatOptions['era'];\nexport type YearFormat = Intl.DateTimeFormatOptions['year'];\nexport type MonthFormat = Intl.DateTimeFormatOptions['month'];\nexport type DayFormat = Intl.DateTimeFormatOptions['day'];\nexport type HourFormat = Intl.DateTimeFormatOptions['hour'];\nexport type MinuteFormat = Intl.DateTimeFormatOptions['minute'];\nexport type SecondFormat = Intl.DateTimeFormatOptions['second'];\nexport type TimeZoneNameFormat = Intl.DateTimeFormatOptions['timeZoneName'];\nexport type FormatMatcherAlgorithm =\n Intl.DateTimeFormatOptions['formatMatcher'];\nexport type DayPeriodFormat = Intl.DateTimeFormatOptions['dayPeriod'];\nexport type DateStyle = Intl.DateTimeFormatOptions['dateStyle'];\nexport type TimeStyle = Intl.DateTimeFormatOptions['timeStyle'];\nexport type HourCycleFormat = Intl.DateTimeFormatOptions['hourCycle'];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/date-text/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAC","sourcesContent":["/**\n * Formatting scheme for the date-text table column\n */\nexport const DateTextFormat = {\n default: undefined,\n custom: 'custom'\n} as const;\nexport type DateTextFormat = (typeof DateTextFormat)[keyof typeof DateTextFormat];\n\nexport type LocaleMatcherAlgorithm = Intl.DateTimeFormatOptions['localeMatcher'];\nexport type WeekdayFormat = Intl.DateTimeFormatOptions['weekday'];\nexport type EraFormat = Intl.DateTimeFormatOptions['era'];\nexport type YearFormat = Intl.DateTimeFormatOptions['year'];\nexport type MonthFormat = Intl.DateTimeFormatOptions['month'];\nexport type DayFormat = Intl.DateTimeFormatOptions['day'];\nexport type HourFormat = Intl.DateTimeFormatOptions['hour'];\nexport type MinuteFormat = Intl.DateTimeFormatOptions['minute'];\nexport type SecondFormat = Intl.DateTimeFormatOptions['second'];\nexport type TimeZoneNameFormat = Intl.DateTimeFormatOptions['timeZoneName'];\nexport type FormatMatcherAlgorithm = Intl.DateTimeFormatOptions['formatMatcher'];\nexport type DayPeriodFormat = Intl.DateTimeFormatOptions['dayPeriod'];\nexport type DateStyle = Intl.DateTimeFormatOptions['dateStyle'];\nexport type TimeStyle = Intl.DateTimeFormatOptions['timeStyle'];\nexport type HourCycleFormat = Intl.DateTimeFormatOptions['hourCycle'];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRo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R;AAGnB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;oDACU","sourcesContent":["import {\n attr,\n type Notifier,\n Observable,\n observable,\n type Subscriber\n} from '@ni/fast-element';\nimport type {\n TableStringField,\n TableBooleanField,\n TableNumberField\n} from '../../table/types';\nimport { TableColumn } from '../base';\nimport { Mapping } from '../../mapping/base';\nimport type { MappingKeyType } from './types';\nimport type { MappingConfig } from './models/mapping-config';\nimport type { MappingKey } from '../../mapping/base/types';\nimport { resolveKeyWithType } from './models/mapping-key-resolver';\nimport type { TableColumnEnumBaseValidator } from './models/table-column-enum-base-validator';\nimport type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';\n\nexport type TableColumnEnumCellRecord =\n | TableStringField<'value'>\n | TableBooleanField<'value'>\n | TableNumberField<'value'>;\nexport type MappingConfigs = Map<MappingKey, MappingConfig>;\nexport interface TableColumnEnumColumnConfig extends TableColumnTextBaseColumnConfig {\n mappingConfigs: MappingConfigs;\n}\n\n/**\n * Base class for table columns that map values to content\n */\nexport abstract class TableColumnEnumBase<\n TColumnConfig extends TableColumnEnumColumnConfig,\n TEnumValidator extends TableColumnEnumBaseValidator<[]>\n>\n extends TableColumn<TColumnConfig, TEnumValidator>\n implements Subscriber {\n /** @internal */\n public mappingNotifiers: Notifier[] = [];\n\n /** @internal */\n @observable\n public mappings: Mapping<unknown>[] = [];\n\n @attr({ attribute: 'field-name' })\n public fieldName?: string;\n\n @attr({ attribute: 'key-type' })\n public keyType: MappingKeyType = 'string';\n\n /**\n * @internal\n *\n * Triggers a request to update the columnConfig when any observable property on\n * a mapping is updated.\n */\n public handleChange(source: unknown, args: unknown): void {\n if (source instanceof Mapping && typeof args === 'string') {\n this.updateColumnConfig();\n }\n }\n\n /**\n * Implementations should throw an error if an invalid Mapping is passed.\n */\n protected abstract createMappingConfig(\n mapping: Mapping<unknown>\n ): MappingConfig;\n\n protected abstract createColumnConfig(\n mappingConfigs: MappingConfigs\n ): TColumnConfig;\n\n /**\n * Called when any Mapping related state has changed.\n */\n private updateColumnConfig(): void {\n this.columnInternals.validator.validate(this.mappings, this.keyType);\n this.columnInternals.columnConfig = this.checkValidity()\n ? this.createColumnConfig(this.getMappingConfigs())\n : undefined;\n }\n\n private getMappingConfigs(): MappingConfigs {\n const mappingConfigs = new Map<MappingKey, MappingConfig>();\n this.mappings.forEach(mapping => {\n const key = resolveKeyWithType(mapping.key, this.keyType);\n if (key === undefined) {\n throw Error(\n 'Key was invalid for type. Validation should have prevented this.'\n );\n }\n const mappingConfig = this.createMappingConfig(mapping);\n mappingConfigs.set(key, mappingConfig);\n });\n return mappingConfigs;\n }\n\n private fieldNameChanged(): void {\n this.columnInternals.dataRecordFieldNames = [this.fieldName];\n this.columnInternals.operandDataRecordFieldName = this.fieldName;\n }\n\n private mappingsChanged(): void {\n this.updateColumnConfig();\n this.observeMappings();\n }\n\n private keyTypeChanged(): void {\n this.updateColumnConfig();\n }\n\n private removeMappingObservers(): void {\n this.mappingNotifiers.forEach(notifier => {\n notifier.unsubscribe(this);\n });\n this.mappingNotifiers = [];\n }\n\n private observeMappings(): void {\n this.removeMappingObservers();\n\n for (const mapping of this.mappings) {\n const notifier = Observable.getNotifier(mapping);\n notifier.subscribe(this);\n this.mappingNotifiers.push(notifier);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/enum-base/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EAEJ,UAAU,EACV,UAAU,EAEb,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAYnE;;GAEG;AACH,MAAM,OAAgB,mBAIlB,SAAQ,WAA0C;IAJtD;;QAMI,gBAAgB;QACT,qBAAgB,GAAe,EAAE,CAAC;QAEzC,gB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0BAA0B,GAAG,IAAI,CAAC,SAAS,CAAC;IACrE,CAAC;IAEO,eAAe;QACnB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAEO,cAAc;QAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAEO,sBAAsB;QAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC/B,CAAC;IAEO,eAAe;QACnB,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAE9B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACjD,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;CACJ;AAtFU;IADN,UAAU;qDAC8B;AAGlC;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;sDACR;AAGnB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;oDACU","sourcesContent":["import {\n attr,\n type Notifier,\n Observable,\n observable,\n type Subscriber\n} from '@ni/fast-element';\nimport type {\n TableStringField,\n TableBooleanField,\n TableNumberField\n} from '../../table/types';\nimport { TableColumn } from '../base';\nimport { Mapping } from '../../mapping/base';\nimport type { MappingKeyType } from './types';\nimport type { MappingConfig } from './models/mapping-config';\nimport type { MappingKey } from '../../mapping/base/types';\nimport { resolveKeyWithType } from './models/mapping-key-resolver';\nimport type { TableColumnEnumBaseValidator } from './models/table-column-enum-base-validator';\nimport type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';\n\nexport type TableColumnEnumCellRecord = TableStringField<'value'>\n | TableBooleanField<'value'>\n | TableNumberField<'value'>;\nexport type MappingConfigs = Map<MappingKey, MappingConfig>;\nexport interface TableColumnEnumColumnConfig extends TableColumnTextBaseColumnConfig {\n mappingConfigs: MappingConfigs;\n}\n\n/**\n * Base class for table columns that map values to content\n */\nexport abstract class TableColumnEnumBase<\n TColumnConfig extends TableColumnEnumColumnConfig,\n TEnumValidator extends TableColumnEnumBaseValidator<[]>\n>\n extends TableColumn<TColumnConfig, TEnumValidator>\n implements Subscriber {\n /** @internal */\n public mappingNotifiers: Notifier[] = [];\n\n /** @internal */\n @observable\n public mappings: Mapping<unknown>[] = [];\n\n @attr({ attribute: 'field-name' })\n public fieldName?: string;\n\n @attr({ attribute: 'key-type' })\n public keyType: MappingKeyType = 'string';\n\n /**\n * @internal\n *\n * Triggers a request to update the columnConfig when any observable property on\n * a mapping is updated.\n */\n public handleChange(source: unknown, args: unknown): void {\n if (source instanceof Mapping && typeof args === 'string') {\n this.updateColumnConfig();\n }\n }\n\n /**\n * Implementations should throw an error if an invalid Mapping is passed.\n */\n protected abstract createMappingConfig(\n mapping: Mapping<unknown>\n ): MappingConfig;\n\n protected abstract createColumnConfig(\n mappingConfigs: MappingConfigs\n ): TColumnConfig;\n\n /**\n * Called when any Mapping related state has changed.\n */\n private updateColumnConfig(): void {\n this.columnInternals.validator.validate(this.mappings, this.keyType);\n this.columnInternals.columnConfig = this.checkValidity()\n ? this.createColumnConfig(this.getMappingConfigs())\n : undefined;\n }\n\n private getMappingConfigs(): MappingConfigs {\n const mappingConfigs = new Map<MappingKey, MappingConfig>();\n this.mappings.forEach(mapping => {\n const key = resolveKeyWithType(mapping.key, this.keyType);\n if (key === undefined) {\n throw Error(\n 'Key was invalid for type. Validation should have prevented this.'\n );\n }\n const mappingConfig = this.createMappingConfig(mapping);\n mappingConfigs.set(key, mappingConfig);\n });\n return mappingConfigs;\n }\n\n private fieldNameChanged(): void {\n this.columnInternals.dataRecordFieldNames = [this.fieldName];\n this.columnInternals.operandDataRecordFieldName = this.fieldName;\n }\n\n private mappingsChanged(): void {\n this.updateColumnConfig();\n this.observeMappings();\n }\n\n private keyTypeChanged(): void {\n this.updateColumnConfig();\n }\n\n private removeMappingObservers(): void {\n this.mappingNotifiers.forEach(notifier => {\n notifier.unsubscribe(this);\n });\n this.mappingNotifiers = [];\n }\n\n private observeMappings(): void {\n this.removeMappingObservers();\n\n for (const mapping of this.mappings) {\n const notifier = Observable.getNotifier(mapping);\n notifier.subscribe(this);\n this.mappingNotifiers.push(notifier);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/enum-base/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAC","sourcesContent":["/**\n * Input data types for mapping-based columns\n * @public\n */\nexport const MappingKeyType = {\n string: 'string',\n number: 'number',\n boolean: 'boolean'\n} as const;\nexport type MappingKeyType =\n (typeof MappingKeyType)[keyof typeof MappingKeyType];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/enum-base/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAC","sourcesContent":["/**\n * Input data types for mapping-based columns\n * @public\n */\nexport const MappingKeyType = {\n string: 'string',\n number: 'number',\n boolean: 'boolean'\n} as const;\nexport type MappingKeyType = (typeof MappingKeyType)[keyof typeof MappingKeyType];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/mapping/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,WAAW;CACf,CAAC","sourcesContent":["/**\n * Width mode for the mapping column\n */\nexport const TableColumnMappingWidthMode = {\n default: undefined,\n iconSize: 'icon-size'\n} as const;\nexport type TableColumnMappingWidthMode =\n (typeof TableColumnMappingWidthMode)[keyof typeof TableColumnMappingWidthMode];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/mapping/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,WAAW;CACf,CAAC","sourcesContent":["/**\n * Width mode for the mapping column\n */\nexport const TableColumnMappingWidthMode = {\n default: undefined,\n iconSize: 'icon-size'\n} as const;\nexport type TableColumnMappingWidthMode = (typeof TableColumnMappingWidthMode)[keyof typeof TableColumnMappingWidthMode];\n"]}
@@ -58,9 +58,7 @@ export function mixinCustomSortOrderColumnAPI(base) {
58
58
  }
59
59
  }
60
60
  }
61
- attr({ attribute: 'sort-by-field-name' })(
62
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
63
- CustomSortOrderColumn.prototype, 'sortByFieldName');
61
+ attr({ attribute: 'sort-by-field-name' })(CustomSortOrderColumn.prototype, 'sortByFieldName');
64
62
  return CustomSortOrderColumn;
65
63
  }
66
64
  //# sourceMappingURL=custom-sort-order.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-sort-order.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/custom-sort-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAWzD,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CA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AgB;QACT,iCAAiC;YACpC,MAAM,sBAAsB,GAAG,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,CAAC;YACxE,MAAM,iBAAiB,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC;YACjE,MAAM,OAAO,GAAG,CAAC,iBAAiB,IAAI,CAAC,sBAAsB,CAAC;YAC9D,IAAI,OAAO,EAAE,CAAC;gBACV,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAClC,+BAA+B,CAClC,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,KAAK,CAChC,+BAA+B,CAClC,CAAC;YACN,CAAC;QACL,CAAC;KACJ;IAED,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;IACrC,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,iBAAiB,CACpB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AACjC,CAAC","sourcesContent":["import { type Notifier, Observable, attr } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\nimport { TableColumnSortOperation } from '../base/types';\nimport type { ColumnValidator } from '../base/models/column-validator';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype CustomSortOrderTableColumn<\n TColumnValidator extends ColumnValidator<['invalidCustomSortWithGrouping']>\n> = Pick<TableColumn<unknown, TColumnValidator>, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype CustomSortOrderTableColumnConstructor<TColumnValidator extends ColumnValidator<['invalidCustomSortWithGrouping']>> = abstract new (...args: any[]) => CustomSortOrderTableColumn<TColumnValidator>;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinCustomSortOrderColumnAPI<\n TBase extends CustomSortOrderTableColumnConstructor<TColumnValidator>,\n TColumnValidator extends ColumnValidator<['invalidCustomSortWithGrouping']>\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow sorting\n * by a field other than the default for that column.\n */\n abstract class CustomSortOrderColumn extends base {\n public sortByFieldName?: string;\n\n /** @internal */\n public customSortOrderColumnNotifier?: Notifier;\n\n /** @internal */\n public customSortOrderColumnChangeHandler = {\n handleChange: this.handleCustomSortOrderColumnChange.bind(this)\n };\n\n public getResolvedOperandDataRecordFieldName(\n initialOperandFieldName: string | undefined\n ): string | undefined {\n return typeof this.sortByFieldName === 'string'\n ? this.sortByFieldName\n : initialOperandFieldName;\n }\n\n public getResolvedSortOperation(\n initialSortOperation: TableColumnSortOperation\n ): TableColumnSortOperation {\n return typeof this.sortByFieldName === 'string'\n ? TableColumnSortOperation.basic\n : initialSortOperation;\n }\n\n /** @internal */\n public sortByFieldNameChanged(): void {\n this.handleSortConfigurationChange();\n this.updateCustomColumnSortingValidity();\n\n if (\n typeof this.sortByFieldName === 'string'\n && !this.customSortOrderColumnNotifier\n ) {\n this.customSortOrderColumnNotifier = Observable.getNotifier(\n this.columnInternals\n );\n this.customSortOrderColumnNotifier.subscribe(\n this.customSortOrderColumnChangeHandler\n );\n } else {\n this.customSortOrderColumnNotifier?.unsubscribe(\n this.customSortOrderColumnChangeHandler\n );\n this.customSortOrderColumnNotifier = undefined;\n }\n }\n\n public abstract handleSortConfigurationChange(): void;\n\n /** @internal */\n public handleCustomSortOrderColumnChange(\n _source: unknown,\n args: unknown\n ): void {\n if (args === 'groupingDisabled') {\n this.updateCustomColumnSortingValidity();\n }\n }\n\n /** @internal */\n public updateCustomColumnSortingValidity(): void {\n const hasCustomColumnSorting = typeof this.sortByFieldName === 'string';\n const isGroupingEnabled = !this.columnInternals.groupingDisabled;\n const isValid = !isGroupingEnabled || !hasCustomColumnSorting;\n if (isValid) {\n this.columnInternals.validator.untrack(\n 'invalidCustomSortWithGrouping'\n );\n } else {\n this.columnInternals.validator.track(\n 'invalidCustomSortWithGrouping'\n );\n }\n }\n }\n\n attr({ attribute: 'sort-by-field-name' })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n CustomSortOrderColumn.prototype,\n 'sortByFieldName'\n );\n\n return CustomSortOrderColumn;\n}\n"]}
1
+ {"version":3,"file":"custom-sort-order.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/custom-sort-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAWzD,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAG3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;QAAjD;;YAMI,gBAAgB;YACT,uCAAkC,GAAG;gBACxC,YAAY,EAAE,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC;aAClE,CAAC;QAoEN,CAAC;QAlEU,qCAAqC,CACxC,uBAA2C;YAE3C,OAAO,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ;gBAC3C,CAAC,CAAC,IAAI,CAAC,eAAe;gBACtB,CAAC,CAAC,uBAAuB,CAAC;QAClC,CAAC;QAEM,wBAAwB,CAC3B,oBAA8C;YAE9C,OAAO,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ;gBAC3C,CAAC,CAAC,wBAAwB,CAAC,KAAK;gBAChC,CAAC,CAAC,oBAAoB,CAAC;QAC/B,CAAC;QAED,gBAAgB;QACT,sBAAsB;YACzB,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACrC,IAAI,CAAC,iCAAiC,EAAE,CAAC;YAEzC,IACI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ;mBACrC,CAAC,IAAI,CAAC,6BAA6B,EACxC,CAAC;gBACC,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC,WAAW,CACvD,IAAI,CAAC,eAAe,CACvB,CAAC;gBACF,IAAI,CAAC,6BAA6B,CAAC,SAAS,CACxC,IAAI,CAAC,kCAAkC,CAC1C,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,6BAA6B,EAAE,WAAW,CAC3C,IAAI,CAAC,kCAAkC,CAC1C,CAAC;gBACF,IAAI,CAAC,6BAA6B,GAAG,SAAS,CAAC;YACnD,CAAC;QACL,CAAC;QAID,gBAAgB;QACT,iCAAiC,CACpC,OAAgB,EAChB,IAAa;YAEb,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;gBAC9B,IAAI,CAAC,iCAAiC,EAAE,CAAC;YAC7C,CAAC;QACL,CAAC;QAED,gBAAgB;QACT,iCAAiC;YACpC,MAAM,sBAAsB,GAAG,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,CAAC;YACxE,MAAM,iBAAiB,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC;YACjE,MAAM,OAAO,GAAG,CAAC,iBAAiB,IAAI,CAAC,sBAAsB,CAAC;YAC9D,IAAI,OAAO,EAAE,CAAC;gBACV,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAClC,+BAA+B,CAClC,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,KAAK,CAChC,+BAA+B,CAClC,CAAC;YACN,CAAC;QACL,CAAC;KACJ;IAED,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CACrC,qBAAqB,CAAC,SAAS,EAC/B,iBAAiB,CACpB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AACjC,CAAC","sourcesContent":["import { type Notifier, Observable, attr } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\nimport { TableColumnSortOperation } from '../base/types';\nimport type { ColumnValidator } from '../base/models/column-validator';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype CustomSortOrderTableColumn<\n TColumnValidator extends ColumnValidator<['invalidCustomSortWithGrouping']>\n> = Pick<TableColumn<unknown, TColumnValidator>, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype CustomSortOrderTableColumnConstructor<TColumnValidator extends ColumnValidator<['invalidCustomSortWithGrouping']>> = abstract new (...args: any[]) => CustomSortOrderTableColumn<TColumnValidator>;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinCustomSortOrderColumnAPI<\n TBase extends CustomSortOrderTableColumnConstructor<TColumnValidator>,\n TColumnValidator extends ColumnValidator<['invalidCustomSortWithGrouping']>\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow sorting\n * by a field other than the default for that column.\n */\n abstract class CustomSortOrderColumn extends base {\n public sortByFieldName?: string;\n\n /** @internal */\n public customSortOrderColumnNotifier?: Notifier;\n\n /** @internal */\n public customSortOrderColumnChangeHandler = {\n handleChange: this.handleCustomSortOrderColumnChange.bind(this)\n };\n\n public getResolvedOperandDataRecordFieldName(\n initialOperandFieldName: string | undefined\n ): string | undefined {\n return typeof this.sortByFieldName === 'string'\n ? this.sortByFieldName\n : initialOperandFieldName;\n }\n\n public getResolvedSortOperation(\n initialSortOperation: TableColumnSortOperation\n ): TableColumnSortOperation {\n return typeof this.sortByFieldName === 'string'\n ? TableColumnSortOperation.basic\n : initialSortOperation;\n }\n\n /** @internal */\n public sortByFieldNameChanged(): void {\n this.handleSortConfigurationChange();\n this.updateCustomColumnSortingValidity();\n\n if (\n typeof this.sortByFieldName === 'string'\n && !this.customSortOrderColumnNotifier\n ) {\n this.customSortOrderColumnNotifier = Observable.getNotifier(\n this.columnInternals\n );\n this.customSortOrderColumnNotifier.subscribe(\n this.customSortOrderColumnChangeHandler\n );\n } else {\n this.customSortOrderColumnNotifier?.unsubscribe(\n this.customSortOrderColumnChangeHandler\n );\n this.customSortOrderColumnNotifier = undefined;\n }\n }\n\n public abstract handleSortConfigurationChange(): void;\n\n /** @internal */\n public handleCustomSortOrderColumnChange(\n _source: unknown,\n args: unknown\n ): void {\n if (args === 'groupingDisabled') {\n this.updateCustomColumnSortingValidity();\n }\n }\n\n /** @internal */\n public updateCustomColumnSortingValidity(): void {\n const hasCustomColumnSorting = typeof this.sortByFieldName === 'string';\n const isGroupingEnabled = !this.columnInternals.groupingDisabled;\n const isValid = !isGroupingEnabled || !hasCustomColumnSorting;\n if (isValid) {\n this.columnInternals.validator.untrack(\n 'invalidCustomSortWithGrouping'\n );\n } else {\n this.columnInternals.validator.track(\n 'invalidCustomSortWithGrouping'\n );\n }\n }\n }\n\n attr({ attribute: 'sort-by-field-name' })(\n CustomSortOrderColumn.prototype,\n 'sortByFieldName'\n );\n\n return CustomSortOrderColumn;\n}\n"]}
@@ -15,12 +15,8 @@ export function mixinFractionalWidthColumnAPI(base) {
15
15
  this.columnInternals.minPixelWidth = this.minPixelWidth ?? defaultMinPixelWidth;
16
16
  }
17
17
  }
18
- attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(
19
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
20
- FractionalWidthColumn.prototype, 'fractionalWidth');
21
- attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(
22
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
23
- FractionalWidthColumn.prototype, 'minPixelWidth');
18
+ attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(FractionalWidthColumn.prototype, 'fractionalWidth');
19
+ attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(FractionalWidthColumn.prototype, 'minPixelWidth');
24
20
  return FractionalWidthColumn;
25
21
  }
26
22
  //# sourceMappingURL=fractional-width-column.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fractional-width-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/fractional-width-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAQ7E,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAE3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;QAKtC,sBAAsB;YACzB,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,sBAAsB,CAAC;QAC1F,CAAC;QAEM,oBAAoB;YACvB,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,oBAAoB,CAAC;QACpF,CAAC;KACJ;IAED,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACvE,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,iBAAiB,CACpB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACtE,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,eAAe,CAClB,CAAC;IACF,OAAO,qBAAqB,CAAC;AACjC,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\nimport { defaultMinPixelWidth, defaultFractionalWidth } from '../base/types';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype SizedTableColumn = Pick<TableColumn, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SizedTableColumnConstructor = abstract new (...args: any[]) => SizedTableColumn;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinFractionalWidthColumnAPI<\n TBase extends SizedTableColumnConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to support being resized\n * proportionally within a Table.\n */\n abstract class FractionalWidthColumn extends base {\n public fractionalWidth?: number | null;\n\n public minPixelWidth?: number | null;\n\n public fractionalWidthChanged(): void {\n this.columnInternals.fractionalWidth = this.fractionalWidth ?? defaultFractionalWidth;\n }\n\n public minPixelWidthChanged(): void {\n this.columnInternals.minPixelWidth = this.minPixelWidth ?? defaultMinPixelWidth;\n }\n }\n\n attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n FractionalWidthColumn.prototype,\n 'fractionalWidth'\n );\n attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n FractionalWidthColumn.prototype,\n 'minPixelWidth'\n );\n return FractionalWidthColumn;\n}\n"]}
1
+ {"version":3,"file":"fractional-width-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/fractional-width-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAQ7E,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAE3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;QAKtC,sBAAsB;YACzB,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,sBAAsB,CAAC;QAC1F,CAAC;QAEM,oBAAoB;YACvB,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,oBAAoB,CAAC;QACpF,CAAC;KACJ;IAED,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CACvE,qBAAqB,CAAC,SAAS,EAC/B,iBAAiB,CACpB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CACtE,qBAAqB,CAAC,SAAS,EAC/B,eAAe,CAClB,CAAC;IACF,OAAO,qBAAqB,CAAC;AACjC,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\nimport { defaultMinPixelWidth, defaultFractionalWidth } from '../base/types';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype SizedTableColumn = Pick<TableColumn, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SizedTableColumnConstructor = abstract new (...args: any[]) => SizedTableColumn;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinFractionalWidthColumnAPI<\n TBase extends SizedTableColumnConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to support being resized\n * proportionally within a Table.\n */\n abstract class FractionalWidthColumn extends base {\n public fractionalWidth?: number | null;\n\n public minPixelWidth?: number | null;\n\n public fractionalWidthChanged(): void {\n this.columnInternals.fractionalWidth = this.fractionalWidth ?? defaultFractionalWidth;\n }\n\n public minPixelWidthChanged(): void {\n this.columnInternals.minPixelWidth = this.minPixelWidth ?? defaultMinPixelWidth;\n }\n }\n\n attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(\n FractionalWidthColumn.prototype,\n 'fractionalWidth'\n );\n attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(\n FractionalWidthColumn.prototype,\n 'minPixelWidth'\n );\n return FractionalWidthColumn;\n}\n"]}
@@ -18,12 +18,8 @@ export function mixinGroupableColumnAPI(base) {
18
18
  this.columnInternals.groupIndex = this.groupIndex ?? undefined;
19
19
  }
20
20
  }
21
- attr({ attribute: 'grouping-disabled', mode: 'boolean' })(
22
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
23
- GroupableColumn.prototype, 'groupingDisabled');
24
- attr({ attribute: 'group-index', converter: nullableNumberConverter })(
25
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
26
- GroupableColumn.prototype, 'groupIndex');
21
+ attr({ attribute: 'grouping-disabled', mode: 'boolean' })(GroupableColumn.prototype, 'groupingDisabled');
22
+ attr({ attribute: 'group-index', converter: nullableNumberConverter })(GroupableColumn.prototype, 'groupIndex');
27
23
  return GroupableColumn;
28
24
  }
29
25
  //# sourceMappingURL=groupable-column.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"groupable-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/groupable-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AASjE,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,uBAAuB,CAErC,IAAW;IACT;;;OAGG;IACH,MAAe,eAAgB,SAAQ,IAAI;QAA3C;;YACW,qBAAgB,GAAG,KAAK,CAAC;QAWpC,CAAC;QAPU,uBAAuB;YAC1B,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClE,CAAC;QAEM,iBAAiB;YACpB,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,CAAC;QACnE,CAAC;KACJ;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACrD,iEAAiE;IACjE,eAAe,CAAC,SAAS,EACzB,kBAAkB,CACrB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IAClE,iEAAiE;IACjE,eAAe,CAAC,SAAS,EACzB,YAAY,CACf,CAAC;IAEF,OAAO,eAAe,CAAC;AAC3B,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype GroupableTableColumn = Pick<TableColumn, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype GroupableTableColumnConstructor = abstract new (...args: any[]) => GroupableTableColumn;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinGroupableColumnAPI<\n TBase extends GroupableTableColumnConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow grouping\n * by the values in that column.\n */\n abstract class GroupableColumn extends base {\n public groupingDisabled = false;\n\n public groupIndex?: number | null;\n\n public groupingDisabledChanged(): void {\n this.columnInternals.groupingDisabled = this.groupingDisabled;\n }\n\n public groupIndexChanged(): void {\n this.columnInternals.groupIndex = this.groupIndex ?? undefined;\n }\n }\n attr({ attribute: 'grouping-disabled', mode: 'boolean' })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n GroupableColumn.prototype,\n 'groupingDisabled'\n );\n attr({ attribute: 'group-index', converter: nullableNumberConverter })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n GroupableColumn.prototype,\n 'groupIndex'\n );\n\n return GroupableColumn;\n}\n"]}
1
+ {"version":3,"file":"groupable-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/groupable-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AASjE,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,uBAAuB,CAErC,IAAW;IACT;;;OAGG;IACH,MAAe,eAAgB,SAAQ,IAAI;QAA3C;;YACW,qBAAgB,GAAG,KAAK,CAAC;QAWpC,CAAC;QAPU,uBAAuB;YAC1B,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClE,CAAC;QAEM,iBAAiB;YACpB,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,CAAC;QACnE,CAAC;KACJ;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CACrD,eAAe,CAAC,SAAS,EACzB,kBAAkB,CACrB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAClE,eAAe,CAAC,SAAS,EACzB,YAAY,CACf,CAAC;IAEF,OAAO,eAAe,CAAC;AAC3B,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype GroupableTableColumn = Pick<TableColumn, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype GroupableTableColumnConstructor = abstract new (...args: any[]) => GroupableTableColumn;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinGroupableColumnAPI<\n TBase extends GroupableTableColumnConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow grouping\n * by the values in that column.\n */\n abstract class GroupableColumn extends base {\n public groupingDisabled = false;\n\n public groupIndex?: number | null;\n\n public groupingDisabledChanged(): void {\n this.columnInternals.groupingDisabled = this.groupingDisabled;\n }\n\n public groupIndexChanged(): void {\n this.columnInternals.groupIndex = this.groupIndex ?? undefined;\n }\n }\n attr({ attribute: 'grouping-disabled', mode: 'boolean' })(\n GroupableColumn.prototype,\n 'groupingDisabled'\n );\n attr({ attribute: 'group-index', converter: nullableNumberConverter })(\n GroupableColumn.prototype,\n 'groupIndex'\n );\n\n return GroupableColumn;\n}\n"]}
@@ -8,9 +8,7 @@ export function mixinColumnWithPlaceholderAPI(base) {
8
8
  */
9
9
  class ColumnWithPlaceholder extends base {
10
10
  }
11
- attr({ attribute: 'placeholder' })(
12
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
13
- ColumnWithPlaceholder.prototype, 'placeholder');
11
+ attr({ attribute: 'placeholder' })(ColumnWithPlaceholder.prototype, 'placeholder');
14
12
  return ColumnWithPlaceholder;
15
13
  }
16
14
  //# sourceMappingURL=placeholder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/placeholder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAUxC,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAE3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;KAKhD;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IAC9B,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,aAAa,CAChB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AACjC,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\n// Because the 'placeholder' mixin doesn't depend on any properties of the TableColumn, there are no properties to pick.\ntype TableColumnWithPlaceholder = Pick<TableColumn, never>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TableColumnWithPlaceholderConstructor = abstract new (...args: any[]) => TableColumnWithPlaceholder;\n\n// As the returned class is internal to the function, we can't write a signature that uses it directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinColumnWithPlaceholderAPI<\n TBase extends TableColumnWithPlaceholderConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow grouping\n * by the values in that column.\n */\n abstract class ColumnWithPlaceholder extends base {\n public placeholder?: string;\n\n /** @internal */\n public abstract placeholderChanged(): void;\n }\n attr({ attribute: 'placeholder' })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n ColumnWithPlaceholder.prototype,\n 'placeholder'\n );\n\n return ColumnWithPlaceholder;\n}\n"]}
1
+ {"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/placeholder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAUxC,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAE3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;KAKhD;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAC9B,qBAAqB,CAAC,SAAS,EAC/B,aAAa,CAChB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AACjC,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\n// Because the 'placeholder' mixin doesn't depend on any properties of the TableColumn, there are no properties to pick.\ntype TableColumnWithPlaceholder = Pick<TableColumn, never>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TableColumnWithPlaceholderConstructor = abstract new (...args: any[]) => TableColumnWithPlaceholder;\n\n// As the returned class is internal to the function, we can't write a signature that uses it directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinColumnWithPlaceholderAPI<\n TBase extends TableColumnWithPlaceholderConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow grouping\n * by the values in that column.\n */\n abstract class ColumnWithPlaceholder extends base {\n public placeholder?: string;\n\n /** @internal */\n public abstract placeholderChanged(): void;\n }\n attr({ attribute: 'placeholder' })(\n ColumnWithPlaceholder.prototype,\n 'placeholder'\n );\n\n return ColumnWithPlaceholder;\n}\n"]}
@@ -38,15 +38,9 @@ export function mixinSortableColumnAPI(base) {
38
38
  }
39
39
  }
40
40
  }
41
- attr({ attribute: 'sorting-disabled', mode: 'boolean' })(
42
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
43
- SortableColumn.prototype, 'sortingDisabled');
44
- attr({ attribute: 'sort-index', converter: nullableNumberConverter })(
45
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
46
- SortableColumn.prototype, 'sortIndex');
47
- attr({ attribute: 'sort-direction' })(
48
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
49
- SortableColumn.prototype, 'sortDirection');
41
+ attr({ attribute: 'sorting-disabled', mode: 'boolean' })(SortableColumn.prototype, 'sortingDisabled');
42
+ attr({ attribute: 'sort-index', converter: nullableNumberConverter })(SortableColumn.prototype, 'sortIndex');
43
+ attr({ attribute: 'sort-direction' })(SortableColumn.prototype, 'sortDirection');
50
44
  return SortableColumn;
51
45
  }
52
46
  //# sourceMappingURL=sortable-column.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sortable-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/sortable-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAQ7D,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,sBAAsB,CAEpC,IAAW;IACT;;;OAGG;IACH,MAAe,cAAe,SAAQ,IAAI;QAA1C;;YACW,oBAAe,GAAG,KAAK,CAAC;YAIxB,kBAAa,GAA6B,wBAAwB,CAAC,IAAI,CAAC;QA2BnF,CAAC;QAzBG,gBAAgB;QACT,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C1B,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\nimport { TableColumnSortDirection } from '../../table/types';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype SortableTableColumn = Pick<TableColumn, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SortableTableColumnConstructor = abstract new (...args: any[]) => SortableTableColumn;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinSortableColumnAPI<\n TBase extends SortableTableColumnConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow sorting\n * by the values in that column.\n */\n abstract class SortableColumn extends base {\n public sortingDisabled = false;\n\n public sortIndex?: number | null;\n\n public sortDirection: TableColumnSortDirection = TableColumnSortDirection.none;\n\n /** @internal */\n public sortingDisabledChanged(): void {\n this.columnInternals.sortingDisabled = this.sortingDisabled;\n if (this.sortingDisabled) {\n this.columnInternals.currentSortDirection = TableColumnSortDirection.none;\n this.columnInternals.currentSortIndex = undefined;\n } else {\n this.columnInternals.currentSortDirection = this.sortDirection;\n this.columnInternals.currentSortIndex = this.sortIndex ?? undefined;\n }\n }\n\n /** @internal */\n public sortDirectionChanged(): void {\n if (!this.sortingDisabled) {\n this.columnInternals.currentSortDirection = this.sortDirection;\n }\n }\n\n /** @internal */\n public sortIndexChanged(): void {\n if (!this.sortingDisabled) {\n this.columnInternals.currentSortIndex = this.sortIndex ?? undefined;\n }\n }\n }\n attr({ attribute: 'sorting-disabled', mode: 'boolean' })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n SortableColumn.prototype,\n 'sortingDisabled'\n );\n attr({ attribute: 'sort-index', converter: nullableNumberConverter })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n SortableColumn.prototype,\n 'sortIndex'\n );\n attr({ attribute: 'sort-direction' })(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n SortableColumn.prototype,\n 'sortDirection'\n );\n\n return SortableColumn;\n}\n"]}
1
+ {"version":3,"file":"sortable-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/sortable-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAQ7D,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,sBAAsB,CAEpC,IAAW;IACT;;;OAGG;IACH,MAAe,cAAe,SAAQ,IAAI;QAA1C;;YACW,oBAAe,GAAG,KAAK,CAAC;YAIxB,kBAAa,GAA6B,wBAAwB,CAAC,IAAI,CAAC;QA2BnF,CAAC;QAzBG,gBAAgB;QACT,sBAAsB;YACzB,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YAC5D,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBACvB,IAAI,CAAC,eAAe,CAAC,oBAAoB,GAAG,wBAAwB,CAAC,IAAI,CAAC;gBAC1E,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,SAAS,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,eAAe,CAAC,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC;gBAC/D,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;YACxE,CAAC;QACL,CAAC;QAED,gBAAgB;QACT,oBAAoB;YACvB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxB,IAAI,CAAC,eAAe,CAAC,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC;YACnE,CAAC;QACL,CAAC;QAED,gBAAgB;QACT,gBAAgB;YACnB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxB,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;YACxE,CAAC;QACL,CAAC;KACJ;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CACpD,cAAc,CAAC,SAAS,EACxB,iBAAiB,CACpB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CACjE,cAAc,CAAC,SAAS,EACxB,WAAW,CACd,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CACjC,cAAc,CAAC,SAAS,EACxB,eAAe,CAClB,CAAC;IAEF,OAAO,cAAc,CAAC;AAC1B,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@ni/fast-element';\nimport type { TableColumn } from '../base';\nimport { TableColumnSortDirection } from '../../table/types';\n\n// Pick just the relevant properties the mixin depends on (typescript complains if the mixin declares private / protected base exports)\ntype SortableTableColumn = Pick<TableColumn, 'columnInternals'>;\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SortableTableColumnConstructor = abstract new (...args: any[]) => SortableTableColumn;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinSortableColumnAPI<\n TBase extends SortableTableColumnConstructor\n>(base: TBase) {\n /**\n * The Mixin that provides a concrete column with the API to allow sorting\n * by the values in that column.\n */\n abstract class SortableColumn extends base {\n public sortingDisabled = false;\n\n public sortIndex?: number | null;\n\n public sortDirection: TableColumnSortDirection = TableColumnSortDirection.none;\n\n /** @internal */\n public sortingDisabledChanged(): void {\n this.columnInternals.sortingDisabled = this.sortingDisabled;\n if (this.sortingDisabled) {\n this.columnInternals.currentSortDirection = TableColumnSortDirection.none;\n this.columnInternals.currentSortIndex = undefined;\n } else {\n this.columnInternals.currentSortDirection = this.sortDirection;\n this.columnInternals.currentSortIndex = this.sortIndex ?? undefined;\n }\n }\n\n /** @internal */\n public sortDirectionChanged(): void {\n if (!this.sortingDisabled) {\n this.columnInternals.currentSortDirection = this.sortDirection;\n }\n }\n\n /** @internal */\n public sortIndexChanged(): void {\n if (!this.sortingDisabled) {\n this.columnInternals.currentSortIndex = this.sortIndex ?? undefined;\n }\n }\n }\n attr({ attribute: 'sorting-disabled', mode: 'boolean' })(\n SortableColumn.prototype,\n 'sortingDisabled'\n );\n attr({ attribute: 'sort-index', converter: nullableNumberConverter })(\n SortableColumn.prototype,\n 'sortIndex'\n );\n attr({ attribute: 'sort-direction' })(\n SortableColumn.prototype,\n 'sortDirection'\n );\n\n return SortableColumn;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"number-text-unit-format.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/models/number-text-unit-format.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAEb,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAUvF;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAKhD,YAAmB,MAAc,EAAE,OAAqC;QACpE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,CAC5C,MAAM,EACN,IAAI,CAAC,gBAAgB,CACxB,CAAC;IACN,CAAC;IAEe,eAAe;QAC3B,OAAO,EAAE,GAAG,IAAI,CA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,gBAAgB,CAAC,OAAO,EAAE,CAAC;YACpE,OAAO;gBACH,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;gBAC1C,aAAa,EAAE,SAAS;gBACxB,oBAAoB,EAAE,SAAS;gBAC/B,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,oBAAoB;aACxD,CAAC;QACN,CAAC;QACD,MAAM,gBAAgB,GAAG,OAAO,OAAO,CAAC,aAAa,KAAK,QAAQ,CAAC;QACnE,MAAM,uBAAuB,GAAG,OAAO,OAAO,CAAC,oBAAoB,KAAK,QAAQ,CAAC;QACjF,IAAI,gBAAgB,IAAI,uBAAuB,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CACX,qFAAqF,CACxF,CAAC;QACN,CAAC;QACD,IAAI,CAAC,gBAAgB,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAChD,OAAO;gBACH,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;gBAC1C,aAAa,EAAE,oBAAoB,CAAC,oBAAoB;gBACxD,oBAAoB,EAAE,SAAS;gBAC/B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,oBAAoB;aACvD,CAAC;QACN,CAAC;QACD,OAAO;YACH,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;YAC1C,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;YAClD,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,oBAAoB;SACvD,CAAC;IACN,CAAC;;AAhGuB,yCAAoB,GAAG,CAAC,CAAC","sourcesContent":["import {\n UnitFormat,\n type UnitFormatOptions\n} from '../../../utilities/unit-format/unit-format';\nimport { passthroughUnitScale } from '../../../utilities/unit-format/unit-scale/passthrough-unit-scale';\nimport { NumberTextFormat } from '../types';\nimport { DefaultUnitFormat } from '../../../utilities/unit-format/default-unit-format';\nimport { DecimalUnitFormat } from '../../../utilities/unit-format/decimal-unit-format';\n\nexport interface NumberTextUnitFormatOptions extends UnitFormatOptions {\n numberTextFormat?: NumberTextFormat;\n decimalDigits?: number;\n decimalMaximumDigits?: number;\n}\ntype ResolvedNumberTextUnitFormatOptions = NumberTextUnitFormatOptions &\n Required<UnitFormatOptions>;\n\n/**\n * Format for numbers (with optional units) in a number-text table column.\n */\nexport class NumberTextUnitFormat extends UnitFormat {\n private static readonly defaultDecimalDigits = 2;\n private readonly resolvedUnitFormat: DefaultUnitFormat | DecimalUnitFormat;\n private readonly _resolvedOptions: ResolvedNumberTextUnitFormatOptions;\n\n public constructor(locale: string, options?: NumberTextUnitFormatOptions) {\n super();\n this._resolvedOptions = this.resolveOptions(options);\n this.resolvedUnitFormat = this.resolveUnitFormat(\n locale,\n this._resolvedOptions\n );\n }\n\n public override resolvedOptions(): ResolvedNumberTextUnitFormatOptions {\n return { ...this._resolvedOptions };\n }\n\n public optionsMatch(targetOptions?: NumberTextUnitFormatOptions): boolean {\n const targetResolvedOptions = this.resolveOptions(targetOptions);\n return (\n this._resolvedOptions.decimalDigits\n === targetResolvedOptions.decimalDigits\n && this._resolvedOptions.decimalMaximumDigits\n === targetResolvedOptions.decimalMaximumDigits\n && this._resolvedOptions.numberTextFormat\n === targetResolvedOptions.numberTextFormat\n && this._resolvedOptions.unitScale === targetResolvedOptions.unitScale\n );\n }\n\n protected override tryFormat(number: number): string {\n return this.resolvedUnitFormat.format(number);\n }\n\n private resolveUnitFormat(\n locale: string,\n options: ResolvedNumberTextUnitFormatOptions\n ): DefaultUnitFormat | DecimalUnitFormat {\n const {\n numberTextFormat,\n decimalMaximumDigits,\n decimalDigits,\n unitScale\n } = options;\n\n if (numberTextFormat === NumberTextFormat.default) {\n return new DefaultUnitFormat(locale, {\n unitScale\n });\n }\n if (typeof decimalDigits === 'number') {\n return new DecimalUnitFormat(locale, {\n minimumFractionDigits: decimalDigits,\n maximumFractionDigits: decimalDigits,\n unitScale\n });\n }\n return new DecimalUnitFormat(locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: decimalMaximumDigits,\n unitScale\n });\n }\n\n private resolveOptions(\n options?: NumberTextUnitFormatOptions\n ): ResolvedNumberTextUnitFormatOptions {\n if (!options || options.numberTextFormat === NumberTextFormat.default) {\n return {\n numberTextFormat: NumberTextFormat.default,\n decimalDigits: undefined,\n decimalMaximumDigits: undefined,\n unitScale: options?.unitScale ?? passthroughUnitScale\n };\n }\n const hasDecimalDigits = typeof options.decimalDigits === 'number';\n const hasDecimalMaximumDigits = typeof options.decimalMaximumDigits === 'number';\n if (hasDecimalDigits && hasDecimalMaximumDigits) {\n throw new Error(\n 'decimalDigits and decimalMaximumDigits are mutually exclusive. Do not specify both.'\n );\n }\n if (!hasDecimalDigits && !hasDecimalMaximumDigits) {\n return {\n numberTextFormat: NumberTextFormat.decimal,\n decimalDigits: NumberTextUnitFormat.defaultDecimalDigits,\n decimalMaximumDigits: undefined,\n unitScale: options.unitScale ?? passthroughUnitScale\n };\n }\n return {\n numberTextFormat: NumberTextFormat.decimal,\n decimalDigits: options.decimalDigits,\n decimalMaximumDigits: options.decimalMaximumDigits,\n unitScale: options.unitScale ?? passthroughUnitScale\n };\n }\n}\n"]}
1
+ {"version":3,"file":"number-text-unit-format.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/models/number-text-unit-format.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAEb,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAUvF;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAKhD,YAAmB,MAAc,EAAE,OAAqC;QACpE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACr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AAC;YACxB,qBAAqB,EAAE,oBAAoB;YAC3C,SAAS;SACZ,CAAC,CAAC;IACP,CAAC;IAEO,cAAc,CAClB,OAAqC;QAErC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,gBAAgB,KAAK,gBAAgB,CAAC,OAAO,EAAE,CAAC;YACpE,OAAO;gBACH,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;gBAC1C,aAAa,EAAE,SAAS;gBACxB,oBAAoB,EAAE,SAAS;gBAC/B,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,oBAAoB;aACxD,CAAC;QACN,CAAC;QACD,MAAM,gBAAgB,GAAG,OAAO,OAAO,CAAC,aAAa,KAAK,QAAQ,CAAC;QACnE,MAAM,uBAAuB,GAAG,OAAO,OAAO,CAAC,oBAAoB,KAAK,QAAQ,CAAC;QACjF,IAAI,gBAAgB,IAAI,uBAAuB,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CACX,qFAAqF,CACxF,CAAC;QACN,CAAC;QACD,IAAI,CAAC,gBAAgB,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAChD,OAAO;gBACH,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;gBAC1C,aAAa,EAAE,oBAAoB,CAAC,oBAAoB;gBACxD,oBAAoB,EAAE,SAAS;gBAC/B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,oBAAoB;aACvD,CAAC;QACN,CAAC;QACD,OAAO;YACH,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;YAC1C,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;YAClD,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,oBAAoB;SACvD,CAAC;IACN,CAAC;;AAhGuB,yCAAoB,GAAG,CAAC,CAAC","sourcesContent":["import {\n UnitFormat,\n type UnitFormatOptions\n} from '../../../utilities/unit-format/unit-format';\nimport { passthroughUnitScale } from '../../../utilities/unit-format/unit-scale/passthrough-unit-scale';\nimport { NumberTextFormat } from '../types';\nimport { DefaultUnitFormat } from '../../../utilities/unit-format/default-unit-format';\nimport { DecimalUnitFormat } from '../../../utilities/unit-format/decimal-unit-format';\n\nexport interface NumberTextUnitFormatOptions extends UnitFormatOptions {\n numberTextFormat?: NumberTextFormat;\n decimalDigits?: number;\n decimalMaximumDigits?: number;\n}\ntype ResolvedNumberTextUnitFormatOptions = NumberTextUnitFormatOptions\n & Required<UnitFormatOptions>;\n\n/**\n * Format for numbers (with optional units) in a number-text table column.\n */\nexport class NumberTextUnitFormat extends UnitFormat {\n private static readonly defaultDecimalDigits = 2;\n private readonly resolvedUnitFormat: DefaultUnitFormat | DecimalUnitFormat;\n private readonly _resolvedOptions: ResolvedNumberTextUnitFormatOptions;\n\n public constructor(locale: string, options?: NumberTextUnitFormatOptions) {\n super();\n this._resolvedOptions = this.resolveOptions(options);\n this.resolvedUnitFormat = this.resolveUnitFormat(\n locale,\n this._resolvedOptions\n );\n }\n\n public override resolvedOptions(): ResolvedNumberTextUnitFormatOptions {\n return { ...this._resolvedOptions };\n }\n\n public optionsMatch(targetOptions?: NumberTextUnitFormatOptions): boolean {\n const targetResolvedOptions = this.resolveOptions(targetOptions);\n return (\n this._resolvedOptions.decimalDigits\n === targetResolvedOptions.decimalDigits\n && this._resolvedOptions.decimalMaximumDigits\n === targetResolvedOptions.decimalMaximumDigits\n && this._resolvedOptions.numberTextFormat\n === targetResolvedOptions.numberTextFormat\n && this._resolvedOptions.unitScale === targetResolvedOptions.unitScale\n );\n }\n\n protected override tryFormat(number: number): string {\n return this.resolvedUnitFormat.format(number);\n }\n\n private resolveUnitFormat(\n locale: string,\n options: ResolvedNumberTextUnitFormatOptions\n ): DefaultUnitFormat | DecimalUnitFormat {\n const {\n numberTextFormat,\n decimalMaximumDigits,\n decimalDigits,\n unitScale\n } = options;\n\n if (numberTextFormat === NumberTextFormat.default) {\n return new DefaultUnitFormat(locale, {\n unitScale\n });\n }\n if (typeof decimalDigits === 'number') {\n return new DecimalUnitFormat(locale, {\n minimumFractionDigits: decimalDigits,\n maximumFractionDigits: decimalDigits,\n unitScale\n });\n }\n return new DecimalUnitFormat(locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: decimalMaximumDigits,\n unitScale\n });\n }\n\n private resolveOptions(\n options?: NumberTextUnitFormatOptions\n ): ResolvedNumberTextUnitFormatOptions {\n if (!options || options.numberTextFormat === NumberTextFormat.default) {\n return {\n numberTextFormat: NumberTextFormat.default,\n decimalDigits: undefined,\n decimalMaximumDigits: undefined,\n unitScale: options?.unitScale ?? passthroughUnitScale\n };\n }\n const hasDecimalDigits = typeof options.decimalDigits === 'number';\n const hasDecimalMaximumDigits = typeof options.decimalMaximumDigits === 'number';\n if (hasDecimalDigits && hasDecimalMaximumDigits) {\n throw new Error(\n 'decimalDigits and decimalMaximumDigits are mutually exclusive. Do not specify both.'\n );\n }\n if (!hasDecimalDigits && !hasDecimalMaximumDigits) {\n return {\n numberTextFormat: NumberTextFormat.decimal,\n decimalDigits: NumberTextUnitFormat.defaultDecimalDigits,\n decimalMaximumDigits: undefined,\n unitScale: options.unitScale ?? passthroughUnitScale\n };\n }\n return {\n numberTextFormat: NumberTextFormat.decimal,\n decimalDigits: options.decimalDigits,\n decimalMaximumDigits: options.decimalMaximumDigits,\n unitScale: options.unitScale ?? passthroughUnitScale\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/number-text/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACZ,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["/**\n * Formatting scheme for the number-text table column\n */\nexport const NumberTextFormat = {\n default: undefined,\n decimal: 'decimal'\n} as const;\nexport type NumberTextFormat =\n (typeof NumberTextFormat)[keyof typeof NumberTextFormat];\n\n/**\n * The aligment of the value in the number-text table column.\n * The `default` alignment is determined by the column's `NumberTextFormat`.\n */\nexport const NumberTextAlignment = {\n default: undefined,\n left: 'left',\n right: 'right'\n} as const;\nexport type NumberTextAlignment =\n (typeof NumberTextAlignment)[keyof typeof NumberTextAlignment];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/number-text/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACZ,CAAC;AAGX;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["/**\n * Formatting scheme for the number-text table column\n */\nexport const NumberTextFormat = {\n default: undefined,\n decimal: 'decimal'\n} as const;\nexport type NumberTextFormat = (typeof NumberTextFormat)[keyof typeof NumberTextFormat];\n\n/**\n * The aligment of the value in the number-text table column.\n * The `default` alignment is determined by the column's `NumberTextFormat`.\n */\nexport const NumberTextAlignment = {\n default: undefined,\n left: 'left',\n right: 'right'\n} as const;\nexport type NumberTextAlignment = (typeof NumberTextAlignment)[keyof typeof NumberTextAlignment];\n"]}