@ni/nimble-components 30.0.0 → 30.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +29 -73
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +16 -29
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/row/index.d.ts +0 -1
- package/dist/esm/table/components/row/index.js +1 -9
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/index.d.ts +4 -9
- package/dist/esm/table/index.js +23 -39
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/keyboard-navigation-manager.d.ts +0 -1
- package/dist/esm/table/models/keyboard-navigation-manager.js +4 -8
- package/dist/esm/table/models/keyboard-navigation-manager.js.map +1 -1
- package/dist/esm/table/models/virtualizer.js +0 -1
- package/dist/esm/table/models/virtualizer.js.map +1 -1
- package/dist/esm/table/template.js +1 -9
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table/types.d.ts +1 -1
- package/dist/esm/table/types.js.map +1 -1
- package/dist/esm/table-column/anchor/cell-view/index.d.ts +0 -1
- package/dist/esm/table-column/anchor/cell-view/index.js +0 -3
- package/dist/esm/table-column/anchor/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/base/cell-view/index.d.ts +0 -6
- package/dist/esm/table-column/base/cell-view/index.js +0 -6
- package/dist/esm/table-column/base/cell-view/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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"]}
|
|
@@ -19,7 +19,6 @@ export declare class TableColumnAnchorCellView extends TableCellView<TableColumn
|
|
|
19
19
|
get text(): string;
|
|
20
20
|
/** @internal */
|
|
21
21
|
get showAnchor(): boolean;
|
|
22
|
-
focusedRecycleCallback(): void;
|
|
23
22
|
get tabbableChildren(): HTMLElement[];
|
|
24
23
|
}
|
|
25
24
|
export declare const tableColumnAnchorCellViewTag = "nimble-table-column-anchor-cell-view";
|
|
@@ -35,9 +35,6 @@ export class TableColumnAnchorCellView extends TableCellView {
|
|
|
35
35
|
get showAnchor() {
|
|
36
36
|
return typeof this.cellRecord?.href === 'string';
|
|
37
37
|
}
|
|
38
|
-
focusedRecycleCallback() {
|
|
39
|
-
this.anchor?.blur();
|
|
40
|
-
}
|
|
41
38
|
get tabbableChildren() {
|
|
42
39
|
if (this.showAnchor) {
|
|
43
40
|
return [this.anchor];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/anchor/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAG9C;IAHD;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;QAE3B,gBAAgB;QAET,kBAAa,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/anchor/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,U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AC,IAAI,CAAC,MAAO,CAAC,CAAC;SACzB;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ;AA1CU;IADN,UAAU;8DACgB;AAIpB;IADN,UAAU;gEACkB;AAM7B;IADC,QAAQ;qDAmBR;AAID;IADC,QAAQ;2DAGR;AAUL,MAAM,cAAc,GAAG,yBAAyB,CAAC,OAAO,CAAC;IACrD,QAAQ,EAAE,+BAA+B;IACzC,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAG,sCAAsC,CAAC","sourcesContent":["import { observable, volatile } from '@microsoft/fast-element';\nimport { DesignSystem } from '@microsoft/fast-foundation';\nimport type {\n TableColumnAnchorCellRecord,\n TableColumnAnchorColumnConfig\n} from '..';\nimport type { Anchor } from '../../../anchor';\nimport { TableCellView } from '../../base/cell-view';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-anchor-cell-view': TableColumnAnchorCellView;\n }\n}\n\n/**\n * A cell view for displaying links\n */\nexport class TableColumnAnchorCellView extends TableCellView<\nTableColumnAnchorCellRecord,\nTableColumnAnchorColumnConfig\n> {\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /** @internal */\n @observable\n public isPlaceholder = false;\n\n /** @internal */\n public anchor?: Anchor;\n\n @volatile\n public get text(): string {\n const displayedText = this.cellRecord?.label ?? this.cellRecord?.href;\n if (\n (displayedText === undefined || displayedText === null)\n && this.columnConfig?.placeholder\n ) {\n this.isPlaceholder = true;\n return this.columnConfig.placeholder;\n }\n\n this.isPlaceholder = false;\n if (typeof this.cellRecord?.label === 'string') {\n return this.cellRecord.label;\n }\n if (typeof this.cellRecord?.href === 'string') {\n return this.cellRecord.href;\n }\n return '';\n }\n\n /** @internal */\n @volatile\n public get showAnchor(): boolean {\n return typeof this.cellRecord?.href === 'string';\n }\n\n public override get tabbableChildren(): HTMLElement[] {\n if (this.showAnchor) {\n return [this.anchor!];\n }\n return [];\n }\n}\n\nconst anchorCellView = TableColumnAnchorCellView.compose({\n baseName: 'table-column-anchor-cell-view',\n template,\n styles\n});\nDesignSystem.getOrCreate().withPrefix('nimble').register(anchorCellView());\nexport const tableColumnAnchorCellViewTag = 'nimble-table-column-anchor-cell-view';\n"]}
|
|
@@ -16,12 +16,6 @@ export declare abstract class TableCellView<TCellRecord extends TableCellRecord
|
|
|
16
16
|
*/
|
|
17
17
|
get tabbableChildren(): HTMLElement[];
|
|
18
18
|
private delegatedEvents;
|
|
19
|
-
/**
|
|
20
|
-
* Called if an element inside this cell view has focus, and this row/cell is being recycled.
|
|
21
|
-
* Expected implementation is to commit changes as needed, and blur the focusable element (or close
|
|
22
|
-
* the menu/popup/etc).
|
|
23
|
-
*/
|
|
24
|
-
focusedRecycleCallback(): void;
|
|
25
19
|
columnChanged(): void;
|
|
26
20
|
private delegatedEventHandler;
|
|
27
21
|
}
|
|
@@ -18,12 +18,6 @@ export class TableCellView extends FoundationElement {
|
|
|
18
18
|
get tabbableChildren() {
|
|
19
19
|
return [];
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Called if an element inside this cell view has focus, and this row/cell is being recycled.
|
|
23
|
-
* Expected implementation is to commit changes as needed, and blur the focusable element (or close
|
|
24
|
-
* the menu/popup/etc).
|
|
25
|
-
*/
|
|
26
|
-
focusedRecycleCallback() { }
|
|
27
21
|
columnChanged() {
|
|
28
22
|
for (const eventName of this.delegatedEvents) {
|
|
29
23
|
this.removeEventListener(eventName, this.delegatedEventHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/base/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAA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ACJ,CAAC;aACL;QACL,CAAC,CAAC;QAEF,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,eAAe,EAAE;YAC/C,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;SACrE;IACL,CAAC;CAGJ;AAtDU;IADN,UAAU;iDACqB;AAGzB;IADN,UAAU;mDACyB;AAG7B;IADN,UAAU;6CACgC;AAGpC;IADN,UAAU;+CACc","sourcesContent":["import { observable } from '@microsoft/fast-element';\nimport { FoundationElement } from '@microsoft/fast-foundation';\nimport type { TableColumn } from '..';\nimport type {\n DelegatedEventEventDetails,\n TableCellRecord,\n TableCellState\n} from '../types';\n\n/**\n * Base class for table cell views, which are used within the nimble-table-cell.\n * Each TableColumn type has a corresponding TableCellView type (linked via TableColumn.cellViewTag).\n */\nexport abstract class TableCellView<\n TCellRecord extends TableCellRecord = TableCellRecord,\n TColumnConfig = unknown\n>\n extends FoundationElement\n implements TableCellState<TCellRecord, TColumnConfig> {\n @observable\n public cellRecord?: TCellRecord;\n\n @observable\n public columnConfig?: TColumnConfig;\n\n @observable\n public column?: TableColumn<TColumnConfig>;\n\n @observable\n public recordId?: string;\n\n /**\n * Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,\n * if any.\n */\n public get tabbableChildren(): HTMLElement[] {\n return [];\n }\n\n private delegatedEvents: readonly string[] = [];\n\n public columnChanged(): void {\n for (const eventName of this.delegatedEvents) {\n this.removeEventListener(eventName, this.delegatedEventHandler);\n }\n this.delegatedEvents = [];\n this.delegatedEventHandler = () => {};\n\n if (!this.column) {\n return;\n }\n this.delegatedEvents = this.column.columnInternals.delegatedEvents;\n this.delegatedEventHandler = (event: Event) => {\n if (this.recordId) {\n this.column?.dispatchEvent(\n new CustomEvent<DelegatedEventEventDetails>(\n 'delegated-event',\n {\n detail: {\n originalEvent: event,\n recordId: this.recordId\n }\n }\n )\n );\n }\n };\n\n for (const delegatedEvent of this.delegatedEvents) {\n this.addEventListener(delegatedEvent, this.delegatedEventHandler);\n }\n }\n\n private delegatedEventHandler: (event: Event) => void = () => {};\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.2",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run generate-icons && npm run generate-workers && npm run build-components && npm run bundle-components && npm run generate-scss",
|