@ni/nimble-components 32.12.0 → 32.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +1123 -1113
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +390 -386
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/menu/menu.foundation.js +1 -2
- package/dist/esm/menu/menu.foundation.js.map +1 -1
- package/dist/esm/rich-text/viewer/index.d.ts +2 -0
- package/dist/esm/rich-text/viewer/index.js +4 -2
- package/dist/esm/rich-text/viewer/index.js.map +1 -1
- package/dist/esm/spinner/styles.js +4 -2
- package/dist/esm/spinner/styles.js.map +1 -1
- package/dist/esm/table/testing/table.pageobject.js.map +1 -1
- package/dist/esm/table-column/menu-button/types.d.ts +1 -1
- package/dist/esm/table-column/menu-button/types.js.map +1 -1
- package/dist/esm/wafer-map/modules/computations.js.map +1 -1
- package/package.json +1 -1
|
@@ -60,8 +60,7 @@ export class Menu extends FoundationElement {
|
|
|
60
60
|
this.handleExpandedChanged = (e) => {
|
|
61
61
|
if (e.defaultPrevented
|
|
62
62
|
|| e.target === null
|
|
63
|
-
|| this.menuItems
|
|
64
|
-
|| !this.menuItems.includes(e.target)) {
|
|
63
|
+
|| !this.menuItems?.includes(e.target)) {
|
|
65
64
|
return;
|
|
66
65
|
}
|
|
67
66
|
e.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.foundation.js","sourceRoot":"","sources":["../../../src/menu/menu.foundation.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACH,aAAa,EACb,YAAY,EACZ,UAAU,EACV,MAAM,EACN,OAAO,EACV,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,iBAAiB,EACjB,QAAQ,EAER,YAAY,EACZ,eAAe,EAClB,MAAM,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ApXuB,0BAAqB,GAA8B,eAAe,AAA7C,CAA8C;AAMpF;IADN,UAAU;mCACoB;AAMxB;IADN,UAAU;uCACkB","sourcesContent":["/**\n * Based on implementation in FAST repo: https://github.com/microsoft/fast/blob/9c6dbb66615e6d229fc0ebf8065a67f109139f26/packages/web-components/fast-foundation/src/menu/menu.ts\n */\nimport { DOM, observable } from '@microsoft/fast-element';\nimport {\n isHTMLElement,\n keyArrowDown,\n keyArrowUp,\n keyEnd,\n keyHome\n} from '@microsoft/fast-web-utilities';\nimport {\n FoundationElement,\n MenuItem,\n type MenuItemColumnCount,\n MenuItemRole,\n roleForMenuItem\n} from '@microsoft/fast-foundation';\n\n/**\n * A Menu Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.\n *\n * @slot - The default slot for the menu items\n *\n * @public\n */\nexport class Menu extends FoundationElement {\n private static readonly focusableElementRoles: { [key: string]: string } = roleForMenuItem;\n\n /**\n * @internal\n */\n @observable\n public items!: HTMLSlotElement;\n\n /**\n * @internal\n */\n @observable\n public itemIcons?: Element[];\n\n private menuItems: Element[] | undefined;\n\n private expandedItem: MenuItem | null = null;\n\n /**\n * The index of the focusable element in the items array\n * defaults to -1\n */\n private focusIndex = -1;\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n DOM.queueUpdate(() => {\n // wait until children have had a chance to\n // connect before setting/checking their props/attributes\n this.setItems();\n });\n\n this.addEventListener('change', this.changeHandler);\n }\n\n /**\n * @internal\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeItemListeners();\n this.menuItems = undefined;\n this.removeEventListener('change', this.changeHandler);\n }\n\n /**\n * @internal\n */\n public readonly isNestedMenu = (): boolean => {\n return (\n this.parentElement !== null\n && isHTMLElement(this.parentElement)\n && this.parentElement.getAttribute('role') === 'menuitem'\n );\n };\n\n /**\n * Focuses the first item in the menu.\n *\n * @public\n */\n public override focus(): void {\n this.setFocus(0, 1);\n }\n\n /**\n * Collapses any expanded menu items.\n *\n * @public\n */\n public collapseExpandedItem(): void {\n if (this.expandedItem !== null) {\n this.expandedItem.expanded = false;\n this.expandedItem = null;\n }\n }\n\n /**\n * @internal\n */\n public handleMenuKeyDown(e: KeyboardEvent): boolean {\n if (e.defaultPrevented || this.menuItems === undefined) {\n return false;\n }\n switch (e.key) {\n case keyArrowDown:\n // go forward one index\n this.setFocus(this.focusIndex + 1, 1);\n return false;\n case keyArrowUp:\n // go back one index\n this.setFocus(this.focusIndex - 1, -1);\n return false;\n case keyEnd:\n // set focus on last item\n this.setFocus(this.menuItems.length - 1, -1);\n return false;\n case keyHome:\n // set focus on first item\n this.setFocus(0, 1);\n return false;\n\n default:\n // if we are not handling the event, do not prevent default\n return true;\n }\n }\n\n /**\n * if focus is moving out of the menu, reset to a stable initial state\n * @internal\n */\n public handleFocusOut = (e: FocusEvent): void => {\n if (\n !this.contains(e.relatedTarget as Element)\n && this.menuItems !== undefined\n ) {\n this.collapseExpandedItem();\n // find our first focusable element\n const focusIndex: number = this.menuItems.findIndex(\n this.isFocusableElement\n );\n // set the current focus index's tabindex to -1\n this.menuItems[this.focusIndex]?.setAttribute('tabindex', '-1');\n // set the first focusable element tabindex to 0\n this.menuItems[focusIndex]?.setAttribute('tabindex', '0');\n // set the focus index\n this.focusIndex = focusIndex;\n }\n };\n\n private readonly handleItemFocus = (e: Event): void => {\n const targetItem: HTMLElement = e.target as HTMLElement;\n\n if (\n this.menuItems !== undefined\n && targetItem !== this.menuItems[this.focusIndex]\n ) {\n this.menuItems[this.focusIndex]?.setAttribute('tabindex', '-1');\n this.focusIndex = this.menuItems.indexOf(targetItem);\n targetItem.setAttribute('tabindex', '0');\n }\n };\n\n private readonly handleExpandedChanged = (e: Event): void => {\n if (\n e.defaultPrevented\n || e.target === null\n || this.menuItems === undefined\n || !this.menuItems.includes(e.target as Element)\n ) {\n return;\n }\n\n e.preventDefault();\n const changedItem: MenuItem = e.target as MenuItem;\n\n // closing an expanded item without opening another\n if (\n this.expandedItem !== null\n && changedItem === this.expandedItem\n && changedItem.expanded === false\n ) {\n this.expandedItem = null;\n return;\n }\n\n if (changedItem.expanded) {\n if (\n this.expandedItem !== null\n && this.expandedItem !== changedItem\n ) {\n this.expandedItem.expanded = false;\n }\n this.menuItems[this.focusIndex]?.setAttribute('tabindex', '-1');\n this.expandedItem = changedItem;\n this.focusIndex = this.menuItems.indexOf(changedItem);\n changedItem.setAttribute('tabindex', '0');\n }\n };\n\n private readonly removeItemListeners = (): void => {\n if (this.menuItems !== undefined) {\n this.menuItems.forEach((item: Element) => {\n item.removeEventListener(\n 'expanded-change',\n this.handleExpandedChanged\n );\n item.removeEventListener('focus', this.handleItemFocus);\n });\n }\n };\n\n private itemsChanged(): void {\n // only update children after the component is connected and\n // the setItems has run on connectedCallback\n // (menuItems is undefined until then)\n if (this.$fastController.isConnected && this.menuItems !== undefined) {\n this.setItems();\n }\n }\n\n private itemIconsChanged(oldIcons: Element[], newIcons: Element[]): void {\n // must check if set of icon elements is actually different\n if (\n this.$fastController.isConnected\n && this.menuItems !== undefined\n && (oldIcons.length !== newIcons.length\n || new Set(oldIcons.concat(newIcons)).size !== oldIcons.length)\n ) {\n this.setItems();\n }\n }\n\n private readonly setItems = (): void => {\n const newItems: Element[] = this.domChildren();\n\n this.removeItemListeners();\n this.menuItems = newItems;\n\n const menuItems = this.menuItems.filter(this.isMenuItemElement);\n\n // if our focus index is not -1 we have items\n if (menuItems.length) {\n this.focusIndex = 0;\n }\n\n function elementIndent(el: HTMLElement): MenuItemColumnCount {\n const role = el.getAttribute('role');\n const startSlot = el.querySelector('[slot=start]');\n\n if (role !== MenuItemRole.menuitem && startSlot === null) {\n return 1;\n }\n if (role === MenuItemRole.menuitem && startSlot !== null) {\n return 1;\n }\n if (role !== MenuItemRole.menuitem && startSlot !== null) {\n return 2;\n }\n return 0;\n }\n\n const indent: MenuItemColumnCount = menuItems.reduce<MenuItemColumnCount>((accum, current) => {\n const elementValue = elementIndent(current);\n\n return accum > elementValue ? accum : elementValue;\n }, 0);\n\n menuItems.forEach((item: HTMLElement, index: number) => {\n item.setAttribute('tabindex', index === 0 ? '0' : '-1');\n item.addEventListener(\n 'expanded-change',\n this.handleExpandedChanged\n );\n item.addEventListener('focus', this.handleItemFocus);\n\n if (item instanceof MenuItem || 'startColumnCount' in item) {\n (item as unknown as MenuItem).startColumnCount = indent;\n }\n });\n };\n\n /**\n * handle change from child element\n */\n private readonly changeHandler = (e: Event): void => {\n if (this.menuItems === undefined) {\n return;\n }\n const changedMenuItem: MenuItem = e.target as MenuItem;\n const changeItemIndex: number = this.menuItems.indexOf(changedMenuItem);\n\n if (changeItemIndex === -1) {\n return;\n }\n\n if (\n changedMenuItem.role === 'menuitemradio'\n && changedMenuItem.checked === true\n ) {\n for (let i = changeItemIndex - 1; i >= 0; --i) {\n const item: Element = this.menuItems[i]!;\n const role: string | null = item.getAttribute('role');\n if (role === MenuItemRole.menuitemradio) {\n (item as MenuItem).checked = false;\n }\n if (role === 'separator') {\n break;\n }\n }\n const maxIndex: number = this.menuItems.length - 1;\n for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {\n const item: Element = this.menuItems[i]!;\n const role: string | null = item.getAttribute('role');\n if (role === MenuItemRole.menuitemradio) {\n (item as MenuItem).checked = false;\n }\n if (role === 'separator') {\n break;\n }\n }\n }\n };\n\n /**\n * get an array of valid DOM children\n */\n private domChildren(): Element[] {\n return Array.from(this.children).filter(\n child => !child.hasAttribute('hidden')\n );\n }\n\n /**\n * check if the item is a menu item\n */\n private readonly isMenuItemElement = (el: Element): el is HTMLElement => {\n return (\n isHTMLElement(el)\n && Object.prototype.hasOwnProperty.call(\n Menu.focusableElementRoles,\n el.getAttribute('role')!\n )\n );\n };\n\n /**\n * check if the item is focusable\n */\n private readonly isFocusableElement = (el: Element): el is HTMLElement => {\n return this.isMenuItemElement(el);\n };\n\n private setFocus(focusIndex: number, adjustment: number): void {\n if (this.menuItems === undefined) {\n return;\n }\n\n let updatedIndex = focusIndex;\n while (updatedIndex >= 0 && updatedIndex < this.menuItems.length) {\n const child: Element = this.menuItems[updatedIndex]!;\n\n if (this.isFocusableElement(child)) {\n // change the previous index to -1\n if (\n this.focusIndex > -1\n && this.menuItems.length >= this.focusIndex - 1\n ) {\n this.menuItems[this.focusIndex]?.setAttribute(\n 'tabindex',\n '-1'\n );\n }\n\n // update the focus index\n this.focusIndex = updatedIndex;\n\n // update the tabindex of next focusable element\n child.setAttribute('tabindex', '0');\n\n // focus the element\n child.focus();\n\n break;\n }\n\n updatedIndex += adjustment;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menu.foundation.js","sourceRoot":"","sources":["../../../src/menu/menu.foundation.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACH,aAAa,EACb,YAAY,EACZ,UAAU,EACV,MAAM,EACN,OAAO,EACV,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,iBAAiB,EACjB,QAAQ,EAER,YAAY,EACZ,eAAe,EAClB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,OAAO,IAAK,SAAQ,iBAAiB;IAA3C;;QAiBY,iBAAY,GAAoB,IAAI,CAAC;QAE7C;;;WAGG;QACK,eAAU,GAAG,CAAC,CAAC,CAAC;QA0BxB;;WAEG;QACa,iBAAY,GAAG,GAAY,EAAE;YACzC,OAAO,CACH,IAAI,CAAC,aAAa,KAAK,IAAI;mBACxB,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;mBACjC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,UAAU,CAC5D,CAAC;QACN,CAAC,CAAC;QAsDF;;;WAGG;QACI,mBAAc,GAAG,CAAC,CAAa,EAAQ,EAAE;YAC5C,IACI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAwB,CAAC;mBACvC,IAAI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,MAAM,KAAK,GAAY,IAAI,CAAC,SAAS,CAAC,YAAY,CAAE,CAAC;YAErD,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjC,kCAAkC;gBAClC,IACI,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;uBACjB,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,EACjD,CAAC;oBACC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,YAAY,CACzC,UAAU,EACV,IAAI,CACP,CAAC;gBACN,CAAC;gBAED,yBAAyB;gBACzB,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC;gBAE/B,gDAAgD;gBAChD,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;gBAEpC,oBAAoB;gBACpB,KAAK,CAAC,KAAK,EAAE,CAAC;gBAEd,MAAM;YACV,CAAC;YAED,YAAY,IAAI,UAAU,CAAC;QAC/B,CAAC;IACL,CAAC;;AAnXuB,0BAAqB,GAA8B,eAAe,AAA7C,CAA8C;AAMpF;IADN,UAAU;mCACoB;AAMxB;IADN,UAAU;uCACkB","sourcesContent":["/**\n * Based on implementation in FAST repo: https://github.com/microsoft/fast/blob/9c6dbb66615e6d229fc0ebf8065a67f109139f26/packages/web-components/fast-foundation/src/menu/menu.ts\n */\nimport { DOM, observable } from '@microsoft/fast-element';\nimport {\n isHTMLElement,\n keyArrowDown,\n keyArrowUp,\n keyEnd,\n keyHome\n} from '@microsoft/fast-web-utilities';\nimport {\n FoundationElement,\n MenuItem,\n type MenuItemColumnCount,\n MenuItemRole,\n roleForMenuItem\n} from '@microsoft/fast-foundation';\n\n/**\n * A Menu Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.\n *\n * @slot - The default slot for the menu items\n *\n * @public\n */\nexport class Menu extends FoundationElement {\n private static readonly focusableElementRoles: { [key: string]: string } = roleForMenuItem;\n\n /**\n * @internal\n */\n @observable\n public items!: HTMLSlotElement;\n\n /**\n * @internal\n */\n @observable\n public itemIcons?: Element[];\n\n private menuItems: Element[] | undefined;\n\n private expandedItem: MenuItem | null = null;\n\n /**\n * The index of the focusable element in the items array\n * defaults to -1\n */\n private focusIndex = -1;\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n DOM.queueUpdate(() => {\n // wait until children have had a chance to\n // connect before setting/checking their props/attributes\n this.setItems();\n });\n\n this.addEventListener('change', this.changeHandler);\n }\n\n /**\n * @internal\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeItemListeners();\n this.menuItems = undefined;\n this.removeEventListener('change', this.changeHandler);\n }\n\n /**\n * @internal\n */\n public readonly isNestedMenu = (): boolean => {\n return (\n this.parentElement !== null\n && isHTMLElement(this.parentElement)\n && this.parentElement.getAttribute('role') === 'menuitem'\n );\n };\n\n /**\n * Focuses the first item in the menu.\n *\n * @public\n */\n public override focus(): void {\n this.setFocus(0, 1);\n }\n\n /**\n * Collapses any expanded menu items.\n *\n * @public\n */\n public collapseExpandedItem(): void {\n if (this.expandedItem !== null) {\n this.expandedItem.expanded = false;\n this.expandedItem = null;\n }\n }\n\n /**\n * @internal\n */\n public handleMenuKeyDown(e: KeyboardEvent): boolean {\n if (e.defaultPrevented || this.menuItems === undefined) {\n return false;\n }\n switch (e.key) {\n case keyArrowDown:\n // go forward one index\n this.setFocus(this.focusIndex + 1, 1);\n return false;\n case keyArrowUp:\n // go back one index\n this.setFocus(this.focusIndex - 1, -1);\n return false;\n case keyEnd:\n // set focus on last item\n this.setFocus(this.menuItems.length - 1, -1);\n return false;\n case keyHome:\n // set focus on first item\n this.setFocus(0, 1);\n return false;\n\n default:\n // if we are not handling the event, do not prevent default\n return true;\n }\n }\n\n /**\n * if focus is moving out of the menu, reset to a stable initial state\n * @internal\n */\n public handleFocusOut = (e: FocusEvent): void => {\n if (\n !this.contains(e.relatedTarget as Element)\n && this.menuItems !== undefined\n ) {\n this.collapseExpandedItem();\n // find our first focusable element\n const focusIndex: number = this.menuItems.findIndex(\n this.isFocusableElement\n );\n // set the current focus index's tabindex to -1\n this.menuItems[this.focusIndex]?.setAttribute('tabindex', '-1');\n // set the first focusable element tabindex to 0\n this.menuItems[focusIndex]?.setAttribute('tabindex', '0');\n // set the focus index\n this.focusIndex = focusIndex;\n }\n };\n\n private readonly handleItemFocus = (e: Event): void => {\n const targetItem: HTMLElement = e.target as HTMLElement;\n\n if (\n this.menuItems !== undefined\n && targetItem !== this.menuItems[this.focusIndex]\n ) {\n this.menuItems[this.focusIndex]?.setAttribute('tabindex', '-1');\n this.focusIndex = this.menuItems.indexOf(targetItem);\n targetItem.setAttribute('tabindex', '0');\n }\n };\n\n private readonly handleExpandedChanged = (e: Event): void => {\n if (\n e.defaultPrevented\n || e.target === null\n || !this.menuItems?.includes(e.target as Element)\n ) {\n return;\n }\n\n e.preventDefault();\n const changedItem: MenuItem = e.target as MenuItem;\n\n // closing an expanded item without opening another\n if (\n this.expandedItem !== null\n && changedItem === this.expandedItem\n && changedItem.expanded === false\n ) {\n this.expandedItem = null;\n return;\n }\n\n if (changedItem.expanded) {\n if (\n this.expandedItem !== null\n && this.expandedItem !== changedItem\n ) {\n this.expandedItem.expanded = false;\n }\n this.menuItems[this.focusIndex]?.setAttribute('tabindex', '-1');\n this.expandedItem = changedItem;\n this.focusIndex = this.menuItems.indexOf(changedItem);\n changedItem.setAttribute('tabindex', '0');\n }\n };\n\n private readonly removeItemListeners = (): void => {\n if (this.menuItems !== undefined) {\n this.menuItems.forEach((item: Element) => {\n item.removeEventListener(\n 'expanded-change',\n this.handleExpandedChanged\n );\n item.removeEventListener('focus', this.handleItemFocus);\n });\n }\n };\n\n private itemsChanged(): void {\n // only update children after the component is connected and\n // the setItems has run on connectedCallback\n // (menuItems is undefined until then)\n if (this.$fastController.isConnected && this.menuItems !== undefined) {\n this.setItems();\n }\n }\n\n private itemIconsChanged(oldIcons: Element[], newIcons: Element[]): void {\n // must check if set of icon elements is actually different\n if (\n this.$fastController.isConnected\n && this.menuItems !== undefined\n && (oldIcons.length !== newIcons.length\n || new Set(oldIcons.concat(newIcons)).size !== oldIcons.length)\n ) {\n this.setItems();\n }\n }\n\n private readonly setItems = (): void => {\n const newItems: Element[] = this.domChildren();\n\n this.removeItemListeners();\n this.menuItems = newItems;\n\n const menuItems = this.menuItems.filter(this.isMenuItemElement);\n\n // if our focus index is not -1 we have items\n if (menuItems.length) {\n this.focusIndex = 0;\n }\n\n function elementIndent(el: HTMLElement): MenuItemColumnCount {\n const role = el.getAttribute('role');\n const startSlot = el.querySelector('[slot=start]');\n\n if (role !== MenuItemRole.menuitem && startSlot === null) {\n return 1;\n }\n if (role === MenuItemRole.menuitem && startSlot !== null) {\n return 1;\n }\n if (role !== MenuItemRole.menuitem && startSlot !== null) {\n return 2;\n }\n return 0;\n }\n\n const indent: MenuItemColumnCount = menuItems.reduce<MenuItemColumnCount>((accum, current) => {\n const elementValue = elementIndent(current);\n\n return accum > elementValue ? accum : elementValue;\n }, 0);\n\n menuItems.forEach((item: HTMLElement, index: number) => {\n item.setAttribute('tabindex', index === 0 ? '0' : '-1');\n item.addEventListener(\n 'expanded-change',\n this.handleExpandedChanged\n );\n item.addEventListener('focus', this.handleItemFocus);\n\n if (item instanceof MenuItem || 'startColumnCount' in item) {\n (item as unknown as MenuItem).startColumnCount = indent;\n }\n });\n };\n\n /**\n * handle change from child element\n */\n private readonly changeHandler = (e: Event): void => {\n if (this.menuItems === undefined) {\n return;\n }\n const changedMenuItem: MenuItem = e.target as MenuItem;\n const changeItemIndex: number = this.menuItems.indexOf(changedMenuItem);\n\n if (changeItemIndex === -1) {\n return;\n }\n\n if (\n changedMenuItem.role === 'menuitemradio'\n && changedMenuItem.checked === true\n ) {\n for (let i = changeItemIndex - 1; i >= 0; --i) {\n const item: Element = this.menuItems[i]!;\n const role: string | null = item.getAttribute('role');\n if (role === MenuItemRole.menuitemradio) {\n (item as MenuItem).checked = false;\n }\n if (role === 'separator') {\n break;\n }\n }\n const maxIndex: number = this.menuItems.length - 1;\n for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {\n const item: Element = this.menuItems[i]!;\n const role: string | null = item.getAttribute('role');\n if (role === MenuItemRole.menuitemradio) {\n (item as MenuItem).checked = false;\n }\n if (role === 'separator') {\n break;\n }\n }\n }\n };\n\n /**\n * get an array of valid DOM children\n */\n private domChildren(): Element[] {\n return Array.from(this.children).filter(\n child => !child.hasAttribute('hidden')\n );\n }\n\n /**\n * check if the item is a menu item\n */\n private readonly isMenuItemElement = (el: Element): el is HTMLElement => {\n return (\n isHTMLElement(el)\n && Object.prototype.hasOwnProperty.call(\n Menu.focusableElementRoles,\n el.getAttribute('role')!\n )\n );\n };\n\n /**\n * check if the item is focusable\n */\n private readonly isFocusableElement = (el: Element): el is HTMLElement => {\n return this.isMenuItemElement(el);\n };\n\n private setFocus(focusIndex: number, adjustment: number): void {\n if (this.menuItems === undefined) {\n return;\n }\n\n let updatedIndex = focusIndex;\n while (updatedIndex >= 0 && updatedIndex < this.menuItems.length) {\n const child: Element = this.menuItems[updatedIndex]!;\n\n if (this.isFocusableElement(child)) {\n // change the previous index to -1\n if (\n this.focusIndex > -1\n && this.menuItems.length >= this.focusIndex - 1\n ) {\n this.menuItems[this.focusIndex]?.setAttribute(\n 'tabindex',\n '-1'\n );\n }\n\n // update the focus index\n this.focusIndex = updatedIndex;\n\n // update the tabindex of next focusable element\n child.setAttribute('tabindex', '0');\n\n // focus the element\n child.focus();\n\n break;\n }\n\n updatedIndex += adjustment;\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
3
|
-
import {
|
|
3
|
+
import { attr } from '@microsoft/fast-element';
|
|
4
4
|
import { template } from './template';
|
|
5
5
|
import { styles } from './styles';
|
|
6
6
|
import { RichTextMarkdownParser } from '../models/markdown-parser';
|
|
@@ -15,6 +15,8 @@ export class RichTextViewer extends RichText {
|
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
* Markdown string to render its corresponding rich text content in the component.
|
|
18
|
+
* @remarks
|
|
19
|
+
* HTML Attribute: markdown
|
|
18
20
|
*/
|
|
19
21
|
this.markdown = '';
|
|
20
22
|
this.mentionedHrefs = [];
|
|
@@ -57,7 +59,7 @@ export class RichTextViewer extends RichText {
|
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
__decorate([
|
|
60
|
-
|
|
62
|
+
attr({ mode: 'fromView' })
|
|
61
63
|
], RichTextViewer.prototype, "markdown", void 0);
|
|
62
64
|
const nimbleRichTextViewer = RichTextViewer.compose({
|
|
63
65
|
baseName: 'rich-text-viewer',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rich-text/viewer/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rich-text/viewer/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQnC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAA5C;;QACI;;;;;;WAMG;QAEI,aAAQ,GAAG,EAAE,CAAC;QAOb,mBAAc,GAAa,EAAE,CAAC;IA4C1C,CAAC;IA1CG;;OAEG;IACa,iBA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ignSystem } from '@microsoft/fast-foundation';\nimport { attr } from '@microsoft/fast-element';\nimport { template } from './template';\nimport { styles } from './styles';\nimport { RichTextMarkdownParser } from '../models/markdown-parser';\nimport { RichText } from '../base';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-rich-text-viewer': RichTextViewer;\n }\n}\n\n/**\n * A nimble styled rich text viewer\n */\nexport class RichTextViewer extends RichText {\n /**\n *\n * @public\n * Markdown string to render its corresponding rich text content in the component.\n * @remarks\n * HTML Attribute: markdown\n */\n @attr({ mode: 'fromView' })\n public markdown = '';\n\n /**\n * @internal\n */\n public viewer!: HTMLDivElement;\n\n private mentionedHrefs: string[] = [];\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateView();\n }\n\n /**\n * @internal\n */\n public markdownChanged(): void {\n this.updateView();\n }\n\n /**\n * @internal\n */\n public configurationChanged(): void {\n this.updateView();\n }\n\n public getMentionedHrefs(): string[] {\n return Array.from(this.mentionedHrefs);\n }\n\n private updateView(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n if (this.markdown) {\n const parseResult = RichTextMarkdownParser.parseMarkdownToDOM(\n this.markdown,\n this.configuration?.parserMentionConfig\n );\n this.viewer.replaceChildren(parseResult.fragment);\n this.mentionedHrefs = parseResult.mentionedHrefs;\n } else {\n this.viewer.innerHTML = '';\n this.mentionedHrefs = [];\n }\n }\n}\n\nconst nimbleRichTextViewer = RichTextViewer.compose({\n baseName: 'rich-text-viewer',\n template,\n styles\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleRichTextViewer());\nexport const richTextViewerTag = 'nimble-rich-text-viewer';\n"]}
|
|
@@ -69,12 +69,14 @@ export const styles = css `
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
div.bit1 {
|
|
72
|
-
animation-name:
|
|
72
|
+
animation-name:
|
|
73
|
+
ni-private-spinner-no-motion-opacity-keyframes,
|
|
73
74
|
ni-private-spinner-no-motion-transform-keyframes-1;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
div.bit2 {
|
|
77
|
-
animation-name:
|
|
78
|
+
animation-name:
|
|
79
|
+
ni-private-spinner-no-motion-opacity-keyframes,
|
|
78
80
|
ni-private-spinner-no-motion-transform-keyframes-2;
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/spinner/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACH,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;kBAGV,kBAAkB;;;;;mBAKjB,YAAY,CAAC,OAAO;;;;;;;;UAQ7B;AACE;;;;;;GAMG;AACH,EACJ
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/spinner/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACH,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;kBAGV,kBAAkB;;;;;mBAKjB,YAAY,CAAC,OAAO;;;;;;;;UAQ7B;AACE;;;;;;GAMG;AACH,EACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0HP,CAAC,aAAa,CACX,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;8DAEmD,OAAO;;;8DAGP,iBAAiB;;SAEtE,CACJ,EACD,aAAa,CACT,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;8DAEmD,OAAO;;;8DAGP,UAAU;;SAE/D,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;8DAEmD,KAAK;;;8DAGL,UAAU;;SAE/D,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport {\n Black15,\n Black91,\n DigitalGreenLight,\n PowerGreen,\n White\n} from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { display } from '../utilities/style/display';\nimport { spinnerSmallHeight } from '../theme-provider/design-tokens';\nimport { Theme } from '../theme-provider/types';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { ZIndexLevels } from '../utilities/style/types';\n\nexport const styles = css`\n ${display('inline-grid')}\n\n :host {\n height: ${spinnerSmallHeight};\n aspect-ratio: 1 / 1;\n }\n\n div.overlay {\n z-index: ${ZIndexLevels.zIndex1};\n margin: max(2px, 6.25%);\n grid-area: 1/1;\n }\n\n div.container {\n margin: max(2px, 6.25%);\n grid-area: 1/1;\n ${\n /**\n * At some spinner sizes / browser zoom levels, the spinner bits/squares appear to slightly overlap visually.\n * If we set a color with transparency on each bit, it'll look wrong in the overlapping region (since the opacity\n * combines and affects the color at the overlapping spot).\n * Currently all 3 themes use a color with opacity = 0.6, so that's applied here on the parent element instead,\n * which avoids that issue.\n */\n ''\n }\n opacity: 0.6;\n }\n\n :host([appearance='accent']) div.container {\n opacity: 1;\n }\n\n div.bit1,\n div.bit2 {\n background: var(--ni-private-spinner-bits-background-color);\n width: 50%;\n height: 50%;\n margin: auto;\n animation-duration: 1600ms;\n animation-iteration-count: infinite;\n animation-play-state: var(\n --ni-private-spinner-animation-play-state,\n running\n );\n animation-timing-function: cubic-bezier(0.65, 0, 0.35, 0);\n }\n\n div.bit1 {\n animation-name: ni-private-spinner-keyframes-1;\n }\n\n div.bit2 {\n animation-name: ni-private-spinner-keyframes-2;\n }\n\n @media (prefers-reduced-motion) {\n div.bit1,\n div.bit2 {\n animation-timing-function: ease-in-out, steps(1);\n animation-duration: 3200ms;\n }\n\n div.bit1 {\n animation-name:\n ni-private-spinner-no-motion-opacity-keyframes,\n ni-private-spinner-no-motion-transform-keyframes-1;\n }\n\n div.bit2 {\n animation-name:\n ni-private-spinner-no-motion-opacity-keyframes,\n ni-private-spinner-no-motion-transform-keyframes-2;\n }\n }\n\n @keyframes ni-private-spinner-keyframes-1 {\n 0%,\n 100% {\n transform: translate(-50%, 0);\n }\n\n 25% {\n transform: translate(50%, 0);\n }\n\n 50% {\n transform: translate(50%, 100%);\n }\n\n 75% {\n transform: translate(-50%, 100%);\n }\n }\n\n @keyframes ni-private-spinner-keyframes-2 {\n 0%,\n 100% {\n transform: translate(50%, 0);\n }\n\n 25% {\n transform: translate(-50%, 0);\n }\n\n 50% {\n transform: translate(-50%, -100%);\n }\n\n 75% {\n transform: translate(50%, -100%);\n }\n }\n\n @keyframes ni-private-spinner-no-motion-opacity-keyframes {\n 0%,\n 50%,\n 100% {\n opacity: 0;\n }\n\n 25%,\n 75% {\n opacity: 1;\n }\n }\n\n @keyframes ni-private-spinner-no-motion-transform-keyframes-1 {\n 0%,\n 100% {\n transform: translate(-50%, 0);\n }\n 50% {\n transform: translate(50%, 0);\n }\n }\n\n @keyframes ni-private-spinner-no-motion-transform-keyframes-2 {\n 0%,\n 100% {\n transform: translate(50%, 0);\n }\n\n 50% {\n transform: translate(-50%, 0);\n }\n }\n`.withBehaviors(\n themeBehavior(\n Theme.light,\n css`\n :host {\n --ni-private-spinner-bits-background-color: ${Black91};\n }\n :host([appearance='accent']) {\n --ni-private-spinner-bits-background-color: ${DigitalGreenLight};\n }\n `\n ),\n themeBehavior(\n Theme.dark,\n css`\n :host {\n --ni-private-spinner-bits-background-color: ${Black15};\n }\n :host([appearance='accent']) {\n --ni-private-spinner-bits-background-color: ${PowerGreen};\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n :host {\n --ni-private-spinner-bits-background-color: ${White};\n }\n :host([appearance='accent']) {\n --ni-private-spinner-bits-background-color: ${PowerGreen};\n }\n `\n )\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.pageobject.js","sourceRoot":"","sources":["../../../../src/table/testing/table.pageobject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAoB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACH,wBAAwB,EAExB,sBAAsB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAmB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,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,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC;SACpD,CAAC,CAAC;QACH,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAExC,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,oBAAoB,CAAC,OAAoB;QAC7C,OAAO,CAAC,aAAa,CAAC,IAAI,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;IACzD,CAAC;IAEO,uBAAuB,CAC3B,WAAmB,EACnB,WAAoB,EACpB,MAAyB;QAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAChE,IAAI,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACvD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACzB,eAAe,IAAI,KAAK,CAAC;YACzB,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAAC,aAAa,EAAE;gBACrD,OAAO,EAAE,eAAe;aAC3B,CAAC,CAAC;YACH,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CAOJ","sourcesContent":["import type { Checkbox } from '@microsoft/fast-foundation';\nimport { parseColor } from '@microsoft/fast-colors';\nimport type { Table } from '..';\nimport { tableHeaderTag, type TableHeader } from '../components/header';\nimport {\n TableColumnSortDirection,\n type TableRecord,\n TableRowSelectionState\n} from '../types';\nimport { waitForUpdatesAsync } from '../../testing/async-helpers';\nimport { menuButtonTag, type MenuButton } from '../../menu-button';\nimport { tableCellTag, type TableCell } from '../components/cell';\nimport type { TableGroupHeaderView } from '../../table-column/base/group-header-view';\nimport { TableCellView } from '../../table-column/base/cell-view';\nimport { tableRowTag, type TableRow } from '../components/row';\nimport { Anchor, anchorTag } from '../../anchor';\nimport { tableGroupRowTag, type TableGroupRow } from '../components/group-row';\nimport type { Button } from '../../button';\nimport { Icon } from '../../icon-base';\nimport type { IconSeverity } from '../../icon-base/types';\nimport { Spinner, spinnerTag } from '../../spinner';\nimport { borderHoverColor } from '../../theme-provider/design-tokens';\n\n/**\n * Summary information about a column that is sorted in the table for use in the `TablePageObject`.\n */\nexport interface SortedColumn {\n columnId?: string;\n sortDirection: TableColumnSortDirection;\n}\n\n/**\n * Page object for the `nimble-table` component to provide consistent ways\n * of querying and interacting with the component during tests.\n */\nexport class TablePageObject<T extends TableRecord> {\n public constructor(private readonly tableElement: Table<T>) {}\n\n public getRenderedHeaderCount(): number {\n const headers = this.tableElement.shadowRoot!.querySelectorAll(tableHeaderTag)!;\n return headers.length;\n }\n\n public getRenderedCellCountForRow(rowIndex: number): number {\n const row = this.getRow(rowIndex);\n const cells = row.shadowRoot!.querySelectorAll(tableCellTag);\n return cells.length;\n }\n\n public getHeaderContent(columnIndex: number): Node | undefined {\n const headers = this.tableElement.shadowRoot!.querySelectorAll<TableHeader>(\n tableHeaderTag\n )!;\n if (columnIndex >= headers.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return this.getHeaderContentElement(headers.item(columnIndex));\n }\n\n public getHeaderElement(columnIndex: number): TableHeader {\n const headers = this.tableElement.shadowRoot!.querySelectorAll<TableHeader>(\n tableHeaderTag\n )!;\n if (columnIndex >= headers.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return headers.item(columnIndex);\n }\n\n public getHeaderTitle(columnIndex: number): string {\n const column = this.tableElement.columns[columnIndex];\n return (\n column?.shadowRoot!.firstElementChild?.getAttribute('title') ?? ''\n );\n }\n\n public getHeaderTextContent(columnIndex: number): string {\n return (\n this.getHeaderContent(\n columnIndex\n )?.firstChild?.textContent?.trim() ?? ''\n );\n }\n\n public dispatchEventToHeader(\n columnIndex: number,\n event: Event\n ): boolean | undefined {\n const column = this.tableElement.columns[columnIndex];\n return column?.shadowRoot!.firstElementChild?.dispatchEvent(event);\n }\n\n public getHeaderRenderedWidth(columnIndex: number): number {\n const headers = this.tableElement.shadowRoot!.querySelectorAll<TableHeader>(\n tableHeaderTag\n )!;\n if (columnIndex >= headers.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return headers[columnIndex]!.getBoundingClientRect().width;\n }\n\n public async clickColumnHeader(\n columnIndex: number,\n shiftKeyDown = false\n ): Promise<void> {\n const clickEvent = new MouseEvent('click', {\n shiftKey: shiftKeyDown,\n bubbles: true\n } as MouseEventInit);\n this.getHeaderElement(columnIndex).dispatchEvent(clickEvent);\n await waitForUpdatesAsync();\n }\n\n public getRenderedRowCount(): number {\n return this.tableElement.shadowRoot!.querySelectorAll(tableRowTag)\n .length;\n }\n\n public getRenderedGroupRowCount(): number {\n return this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag)\n .length;\n }\n\n public getAllGroupRowsExpandedState(): boolean[] {\n const groupRows = this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag);\n return Array.from(groupRows).map(row => row.expanded);\n }\n\n public getAllDataRowsExpandedState(): boolean[] {\n const rows = this.tableElement.shadowRoot!.querySelectorAll(tableRowTag);\n return Array.from(rows).map(row => row.expanded);\n }\n\n public getRenderedCellView(\n rowIndex: number,\n columnIndex: number\n ): TableCellView {\n const cell = this.getCell(rowIndex, columnIndex);\n const cellView = cell.cellViewContainer.firstElementChild;\n if (!(cellView instanceof TableCellView)) {\n throw new Error(\n 'Cell view not found in cell - ensure cellViewTag is set for column'\n );\n }\n return cellView as TableCellView;\n }\n\n public getRenderedCellViewById(\n recordId: string,\n columnId: string\n ): TableCellView {\n const cell = this.getCellById(recordId, columnId);\n const cellView = cell.cellViewContainer.firstElementChild;\n if (!(cellView instanceof TableCellView)) {\n throw new Error(\n 'Cell view not found in cell - ensure cellViewTag is set for column'\n );\n }\n return cellView as TableCellView;\n }\n\n public getRenderedCellTextContent(\n rowIndex: number,\n columnIndex: number\n ): string {\n return (\n this.getRenderedCellView(\n rowIndex,\n columnIndex\n ).shadowRoot!.textContent?.trim() ?? ''\n );\n }\n\n public getRenderedCellAnchor(\n rowIndex: number,\n columnIndex: number\n ): Anchor {\n const anchor = this.getRenderedCellView(\n rowIndex,\n columnIndex\n ).shadowRoot!.querySelector(anchorTag);\n if (!anchor) {\n throw new Error(\n `Anchor not found at cell ${rowIndex},${columnIndex}`\n );\n }\n return anchor;\n }\n\n public getRenderedMappingColumnCellIconTagName(\n rowIndex: number,\n columnIndex: number\n ): string {\n const iconOrSpinner = this.getRenderedMappingColumnIconOrSpinner(\n this.getRenderedCellView(rowIndex, columnIndex)\n );\n return iconOrSpinner.tagName.toLocaleLowerCase();\n }\n\n public getRenderedMappingColumnCellIconSeverity(\n rowIndex: number,\n columnIndex: number\n ): IconSeverity {\n const iconOrSpinner = this.getRenderedMappingColumnIconOrSpinner(\n this.getRenderedCellView(rowIndex, columnIndex)\n );\n if (iconOrSpinner instanceof Icon) {\n return iconOrSpinner.severity;\n }\n throw new Error('Cell does not contain an icon');\n }\n\n public getRenderedGroupHeaderTextContent(groupRowIndex: number): string {\n return (\n this.getGroupRowHeaderView(\n groupRowIndex\n ).shadowRoot!.textContent?.trim() ?? ''\n );\n }\n\n public getAllRenderedGroupHeaderTextContent(): string[] {\n const groupRows = this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag);\n return Array.from(groupRows).map((_, i) => {\n return this.getRenderedGroupHeaderTextContent(i);\n });\n }\n\n public getCellTitle(rowIndex: number, columnIndex: number): string {\n const cellView = this.getRenderedCellView(rowIndex, columnIndex);\n return (\n cellView.shadowRoot!.firstElementChild?.getAttribute('title') ?? ''\n );\n }\n\n public dispatchEventToCell(\n rowIndex: number,\n columnIndex: number,\n event: Event\n ): boolean | undefined {\n const cellView = this.getRenderedCellView(rowIndex, columnIndex);\n return cellView.shadowRoot!.firstElementChild?.dispatchEvent(event);\n }\n\n public getGroupHeaderTitle(groupRowIndex: number): string {\n const groupHeader = this.getGroupRowHeaderView(groupRowIndex);\n return (\n groupHeader\n .shadowRoot!.querySelector('span')\n ?.getAttribute('title') ?? ''\n );\n }\n\n public dispatchEventToGroupHeader(\n groupRowIndex: number,\n event: Event\n ): boolean | undefined {\n const groupHeader = this.getGroupRowHeaderView(groupRowIndex);\n return groupHeader\n .shadowRoot!.querySelector('span')\n ?.dispatchEvent(event);\n }\n\n public getRecordId(rowIndex: number): string | undefined {\n return this.getRow(rowIndex).recordId;\n }\n\n public getRowWidth(): number {\n const tableRowContainer = this.tableElement.shadowRoot!.querySelector(\n '.table-row-container'\n );\n return tableRowContainer!.scrollWidth;\n }\n\n public async sizeTableToGivenRowWidth(\n rowWidth: number,\n table: Table<T>\n ): Promise<void> {\n if (!table.$fastController.isConnected) {\n throw Error(\n 'The element must be connected before calling this method'\n );\n }\n\n table.style.width = `${\n rowWidth\n + table.headerRowActionContainer.getBoundingClientRect().width\n + table.virtualizer.headerContainerMarginRight\n }px`;\n await waitForUpdatesAsync();\n }\n\n public getCellRenderedWidth(rowIndex: number, columnIndex: number): number {\n const cell = this.getCell(rowIndex, columnIndex);\n const actualWidth = cell.getBoundingClientRect().width;\n // Round to one decimal place. This is to work around a bug in Chrome related to\n // fractional widths (e.g. '1fr') in grid layouts that results in some numerical\n // precision issues. See: https://bugs.chromium.org/p/chromium/issues/detail?id=1515685\n return Math.round(actualWidth * 10) / 10;\n }\n\n public getTotalCellRenderedWidth(): number {\n const row = this.getRow(0);\n const cells = row?.shadowRoot?.querySelectorAll(tableCellTag);\n return Array.from(cells!).reduce((p, c) => {\n return p + c.getBoundingClientRect().width;\n }, 0);\n }\n\n public async scrollToFirstRowAsync(): Promise<void> {\n const scrollElement = this.tableElement.viewport;\n scrollElement.scroll({ top: 0 });\n await waitForUpdatesAsync();\n }\n\n public async scrollToLastRowAsync(): Promise<void> {\n const scrollElement = this.tableElement.viewport;\n scrollElement.scroll({ top: scrollElement.scrollHeight });\n await waitForUpdatesAsync();\n }\n\n public getCellActionMenu(\n rowIndex: number,\n columnIndex: number\n ): MenuButton | null {\n return this.getCell(rowIndex, columnIndex).shadowRoot!.querySelector(\n menuButtonTag\n );\n }\n\n public async clickCellActionMenu(\n rowIndex: number,\n columnIndex: number\n ): Promise<void> {\n this.setRowHoverState(rowIndex, true);\n await waitForUpdatesAsync();\n\n const menuButton = this.getCellActionMenu(rowIndex, columnIndex);\n if (!menuButton) {\n throw new Error('Cannot click on a non-visible action menu');\n }\n\n menuButton.toggleButton!.control.click();\n }\n\n public isCellActionMenuVisible(\n rowIndex: number,\n columnIndex: number\n ): boolean {\n const actionMenu = this.getCellActionMenu(rowIndex, columnIndex);\n if (!actionMenu) {\n return false;\n }\n\n return window.getComputedStyle(actionMenu).display !== 'none';\n }\n\n public setRowHoverState(rowIndex: number, hover: boolean): void {\n const row = this.getRow(rowIndex);\n const cells = row.shadowRoot!.querySelectorAll(tableCellTag);\n if (hover) {\n cells.forEach(cell => cell.style.setProperty(\n '--ni-private-table-cell-action-menu-display',\n 'block'\n ));\n } else {\n cells.forEach(cell => cell.style.removeProperty(\n '--ni-private-table-cell-action-menu-display'\n ));\n }\n }\n\n public async clickGroupRow(groupRowIndex: number): Promise<void> {\n const groupRow = this.getGroupRow(groupRowIndex);\n groupRow.click();\n await waitForUpdatesAsync();\n }\n\n public async clickRow(\n rowIndex: number,\n modifiers: { shiftKey?: boolean, ctrlKey?: boolean } = {}\n ): Promise<void> {\n const row = this.getRow(rowIndex);\n const event = new MouseEvent('click', modifiers);\n row.dispatchEvent(event);\n await waitForUpdatesAsync();\n }\n\n public getIsRowSelectable(rowIndex: number): boolean {\n const row = this.getRow(rowIndex);\n return row.selectable;\n }\n\n public getIsRowSelected(rowIndex: number): boolean {\n const row = this.getRow(rowIndex);\n return row.selected;\n }\n\n public toggleGroupRowExpandedState(groupRowIndex: number): void {\n this.getGroupRow(groupRowIndex).click();\n }\n\n public clickCollapseAllButton(): void {\n this.getCollapseAllButton()?.click();\n }\n\n public clickDataRowExpandCollapseButton(rowIndex: number): void {\n const expandCollapseButton = this.getExpandCollapseButtonForRow(rowIndex);\n if (!expandCollapseButton) {\n throw new Error(\n 'The provided row index has no visible expand collapse button associated with it.'\n );\n }\n\n expandCollapseButton.click();\n }\n\n public isCollapseAllButtonVisible(): boolean {\n const collapseButton = this.getCollapseAllButton();\n if (collapseButton) {\n return (\n window.getComputedStyle(collapseButton).visibility === 'visible'\n );\n }\n return false;\n }\n\n public isCollapseAllButtonSpaceReserved(): boolean {\n const collapseButton = this.getCollapseAllButton();\n if (collapseButton) {\n return window.getComputedStyle(collapseButton).display !== 'none';\n }\n return true;\n }\n\n public isDataRowExpandCollapseButtonVisible(rowIndex: number): boolean {\n const expandCollapseButton = this.getExpandCollapseButtonForRow(rowIndex);\n return expandCollapseButton !== null;\n }\n\n public isDataRowLoadingSpinnerVisible(rowIndex: number): boolean {\n const row = this.getRow(rowIndex);\n const spinner = row.shadowRoot!.querySelector(spinnerTag);\n return spinner !== null;\n }\n\n public isTableSelectionCheckboxVisible(): boolean {\n const checkbox = this.getSelectionCheckboxForTable();\n return this.isCheckboxVisible(checkbox);\n }\n\n public getTableSelectionState(): TableRowSelectionState {\n const checkbox = this.getSelectionCheckboxForTable();\n return this.getSelectionStateOfCheckbox(checkbox);\n }\n\n public clickTableSelectionCheckbox(): void {\n const checkbox = this.getSelectionCheckboxForTable();\n checkbox!.click();\n }\n\n public isRowSelectionCheckboxVisible(rowIndex: number): boolean {\n const checkbox = this.getSelectionCheckboxForRow(rowIndex);\n return this.isCheckboxVisible(checkbox);\n }\n\n public getRowSelectionState(rowIndex: number): TableRowSelectionState {\n const checkbox = this.getSelectionCheckboxForRow(rowIndex);\n return this.getSelectionStateOfCheckbox(checkbox);\n }\n\n public clickRowSelectionCheckbox(rowIndex: number, shiftKey = false): void {\n if (shiftKey) {\n const shiftKeyDownEvent = new KeyboardEvent('keydown', {\n key: 'Shift',\n shiftKey: true,\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyDownEvent);\n }\n\n const checkbox = this.getSelectionCheckboxForRow(rowIndex);\n checkbox!.click();\n\n if (shiftKey) {\n const shiftKeyUpEvent = new KeyboardEvent('keyup', {\n key: 'Shift',\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyUpEvent);\n }\n }\n\n public getGroupRowSelectionState(\n groupRowIndex: number\n ): TableRowSelectionState {\n const checkbox = this.getSelectionCheckboxForGroupRow(groupRowIndex);\n return this.getSelectionStateOfCheckbox(checkbox);\n }\n\n public clickGroupRowSelectionCheckbox(\n groupRowIndex: number,\n shiftKey = false\n ): void {\n if (shiftKey) {\n const shiftKeyDownEvent = new KeyboardEvent('keydown', {\n key: 'Shift',\n shiftKey: true,\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyDownEvent);\n }\n\n const checkbox = this.getSelectionCheckboxForGroupRow(groupRowIndex);\n checkbox!.click();\n\n if (shiftKey) {\n const shiftKeyUpEvent = new KeyboardEvent('keyup', {\n key: 'Shift',\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyUpEvent);\n }\n }\n\n /**\n * @param columnIndex The index of the column to the left of the divider to press.\n */\n public pressRightColumnDivider(columnIndex: number): void {\n this.pressColumnDivider(this.getColumnDivider(columnIndex, false));\n }\n\n /**\n * @param columnIndex The index of the column to the left of the divider to release.\n */\n public releaseRightColumnDivider(columnIndex: number): void {\n this.releaseColumnDivider(this.getColumnDivider(columnIndex, false));\n }\n\n /**\n * @param columnIndex The index of the column to the left of a divider being dragged. Thus, this\n * cannot be given a value representing the last visible column index.\n * @param deltas The series of mouse movements in the x-direction while sizing a column.\n */\n public dragSizeColumnByRightDivider(\n columnIndex: number,\n deltas: readonly number[]\n ): void {\n this.dragSizeColumnByDivider(columnIndex, false, deltas);\n }\n\n /**\n * @param columnIndex The index of the column to the right of a divider being dragged. Thus, this\n * value must be greater than 0 and less than the total number of visible columns.\n * @param deltas The series of mouse movements in the x-direction while sizing a column.\n */\n public dragSizeColumnByLeftDivider(\n columnIndex: number,\n deltas: readonly number[]\n ): void {\n this.dragSizeColumnByDivider(columnIndex, true, deltas);\n }\n\n /**\n * @param columnIndex The index of the column whose right divider we're checking.\n */\n public columnRightDividerHasActiveStyling(columnIndex: number): boolean {\n const divider = this.getColumnDivider(columnIndex, false);\n const currentColor = parseColor(\n window.getComputedStyle(divider).borderLeftColor\n );\n const hoverColor = parseColor(borderHoverColor.getValueFor(divider))!;\n return currentColor!.equalValue(hoverColor);\n }\n\n public isVerticalScrollbarVisible(): boolean {\n return (\n this.tableElement.viewport.clientHeight\n < this.tableElement.viewport.scrollHeight\n );\n }\n\n public isHorizontalScrollbarVisible(): boolean {\n return (\n this.tableElement.viewport.clientWidth\n < this.tableElement.viewport.scrollWidth\n );\n }\n\n public getSortedColumns(): SortedColumn[] {\n return this.tableElement.columns\n .filter(\n x => !x.columnInternals.sortingDisabled\n && typeof x.columnInternals.currentSortIndex === 'number'\n && x.columnInternals.currentSortDirection\n !== TableColumnSortDirection.none\n )\n .sort(\n (a, b) => a.columnInternals.currentSortIndex!\n - b.columnInternals.currentSortIndex!\n )\n .map(x => {\n return {\n columnId: x.columnId,\n sortDirection: x.columnInternals.currentSortDirection\n };\n });\n }\n\n public getGroupedColumns(): string[] {\n return this.tableElement.columns\n .filter(\n x => !x.columnInternals.groupingDisabled\n && typeof x.columnInternals.groupIndex === 'number'\n )\n .sort(\n (a, b) => a.columnInternals.groupIndex!\n - b.columnInternals.groupIndex!\n )\n .map(x => x.columnId ?? '');\n }\n\n public getChildRowCountForGroup(groupRowIndex: number): number {\n const groupRow = this.getGroupRow(groupRowIndex);\n const countDisplayString = groupRow\n .shadowRoot!.querySelector('.group-row-child-count')!\n .textContent!.trim();\n // Remove the parenthesis to get just the number as a string\n const countString = countDisplayString.substring(\n 1,\n countDisplayString.length - 1\n );\n return Number(countString);\n }\n\n /** @internal */\n public isRowHoverStylingEnabled(): boolean {\n const rows: NodeListOf<TableRow | TableGroupRow> = this.tableElement.shadowRoot!.querySelectorAll(\n `${tableRowTag}, ${tableGroupRowTag}`\n );\n const firstRowAllowsHover = rows[0]!.allowHover;\n if (Array.from(rows).some(x => x.allowHover !== firstRowAllowsHover)) {\n throw new Error('Rows inconsistently allow hover styling');\n }\n return firstRowAllowsHover;\n }\n\n /** @internal */\n public getGroupRowHeaderView(groupRowIndex: number): TableGroupHeaderView {\n const groupRow = this.getGroupRow(groupRowIndex);\n return groupRow.shadowRoot!.querySelector('.group-header-view')!;\n }\n\n /** @internal */\n public getRow(rowIndex: number): TableRow {\n const rows = this.tableElement.shadowRoot!.querySelectorAll(tableRowTag);\n if (rowIndex >= rows.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered rows'\n );\n }\n\n return rows.item(rowIndex);\n }\n\n /** @internal */\n public getCell(rowIndex: number, columnIndex: number): TableCell {\n const row = this.getRow(rowIndex);\n const cells = row.shadowRoot!.querySelectorAll(tableCellTag);\n if (columnIndex >= cells.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return cells.item(columnIndex);\n }\n\n private getRowById(recordId: string): TableRow {\n const row: TableRow | null = this.tableElement.shadowRoot!.querySelector(\n `nimble-table-row[record-id=\"${CSS.escape(recordId)}\"]`\n );\n if (!row) {\n throw new Error(\n 'Row with given id was not found. It may not be scrolled into view.'\n );\n }\n\n return row;\n }\n\n private getCellById(recordId: string, columnId: string): TableCell {\n const row = this.getRowById(recordId);\n const cell: TableCell | null = row.shadowRoot!.querySelector(\n `nimble-table-cell[column-id=\"${CSS.escape(columnId)}\"]`\n );\n\n if (!cell) {\n throw new Error('Cell with given columnId was not found in row');\n }\n\n return cell;\n }\n\n private getCollapseAllButton(): Button | null {\n return this.tableElement.shadowRoot!.querySelector<Button>(\n '.collapse-all-button'\n );\n }\n\n private getExpandCollapseButtonForRow(rowIndex: number): Button | null {\n const row = this.getRow(rowIndex);\n const rowExpandCollapseButton = row.shadowRoot!.querySelector<Button>(\n '.expand-collapse-button'\n );\n if (!rowExpandCollapseButton) {\n const firstCell = this.getCell(rowIndex, 0);\n return firstCell?.shadowRoot!.querySelector<Button>(\n '.expand-collapse-button'\n );\n }\n\n return rowExpandCollapseButton;\n }\n\n private getSelectionCheckboxForRow(rowIndex: number): Checkbox | null {\n const row = this.getRow(rowIndex);\n return row.shadowRoot!.querySelector('.selection-checkbox');\n }\n\n private getSelectionCheckboxForGroupRow(\n groupRowIndex: number\n ): Checkbox | null {\n const groupRow = this.getGroupRow(groupRowIndex);\n return groupRow.shadowRoot!.querySelector('.selection-checkbox');\n }\n\n private getSelectionCheckboxForTable(): Checkbox | null {\n return this.tableElement.shadowRoot!.querySelector<Checkbox>(\n '.header-row .selection-checkbox'\n );\n }\n\n private isCheckboxVisible(checkbox: Checkbox | null): boolean {\n return !!checkbox && !checkbox.hidden;\n }\n\n private getSelectionStateOfCheckbox(\n checkbox: Checkbox | null\n ): TableRowSelectionState {\n if (!checkbox) {\n throw new Error('Cannot get selection state from null checkbox');\n }\n\n if (checkbox.indeterminate) {\n return TableRowSelectionState.partiallySelected;\n }\n if (checkbox.checked) {\n return TableRowSelectionState.selected;\n }\n return TableRowSelectionState.notSelected;\n }\n\n private getGroupRow(groupRowIndex: number): TableGroupRow {\n const groupRows = this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag);\n if (groupRowIndex >= groupRows.length) {\n throw new Error(\n 'Attempting to index past the total number of group rows'\n );\n }\n\n return groupRows.item(groupRowIndex);\n }\n\n private getHeaderContentElement(\n element: HTMLElement | HTMLSlotElement\n ): Node | undefined {\n const nodeChildren = this.isSlotElement(element)\n ? element.assignedNodes()\n : element.shadowRoot?.childNodes;\n if (!nodeChildren) {\n return undefined;\n }\n\n const slotElement = Array.from(nodeChildren)?.find<HTMLSlotElement>(\n this.isSlotElement\n );\n if (slotElement) {\n return this.getHeaderContentElement(slotElement);\n }\n\n return nodeChildren[0]; // header content should be first item in final slot element\n }\n\n private getRenderedMappingColumnIconOrSpinner(\n view: TableCellView | TableGroupHeaderView\n ): Icon | Spinner {\n const viewShadowRoot = view.shadowRoot!;\n const spinnerOrIcon = viewShadowRoot.querySelector(\n '.reserve-icon-size'\n )?.firstElementChild;\n if (\n !(spinnerOrIcon instanceof Icon || spinnerOrIcon instanceof Spinner)\n ) {\n throw new Error('Icon or Spinner not found');\n }\n\n return spinnerOrIcon;\n }\n\n private getColumnDivider(\n columnIndex: number,\n leftDivider: boolean\n ): HTMLElement {\n const headerContainers = this.tableElement.shadowRoot!.querySelectorAll('.header-container');\n if (columnIndex < 0 || columnIndex >= headerContainers.length) {\n throw new Error(\n 'Invalid column index. Index must be greater than or equal to 0 and less than the number of visible columns.'\n );\n }\n const side = leftDivider ? 'left' : 'right';\n const divider = headerContainers[columnIndex]!.querySelector(\n `.column-divider.${side}`\n );\n if (!divider) {\n throw new Error(\n `The provided column index has no ${side} divider associated with it.`\n );\n }\n\n return divider as HTMLElement;\n }\n\n private pressColumnDivider(divider: HTMLElement): number {\n const dividerRect = divider.getBoundingClientRect();\n const clickX = (dividerRect.x + dividerRect.width) / 2;\n const pointerDownEvent = new PointerEvent('pointerdown', {\n // -1 is a value reserved for synthetic events: https://w3c.github.io/pointerevents/#dom-pointerevent-pointerid\n pointerId: -1,\n clientX: clickX,\n clientY: (dividerRect.y + dividerRect.height) / 2\n });\n divider.dispatchEvent(pointerDownEvent);\n\n return clickX;\n }\n\n private releaseColumnDivider(divider: HTMLElement): void {\n divider.dispatchEvent(new PointerEvent('pointerup'));\n }\n\n private dragSizeColumnByDivider(\n columnIndex: number,\n leftDivider: boolean,\n deltas: readonly number[]\n ): void {\n const divider = this.getColumnDivider(columnIndex, leftDivider);\n let currentPointerX = this.pressColumnDivider(divider);\n for (const delta of deltas) {\n currentPointerX += delta;\n const pointerMoveEvent = new PointerEvent('pointermove', {\n clientX: currentPointerX\n });\n divider.dispatchEvent(pointerMoveEvent);\n }\n this.releaseColumnDivider(divider);\n }\n\n private readonly isSlotElement = (\n element: Node | undefined\n ): element is HTMLSlotElement => {\n return element?.nodeName === 'SLOT';\n };\n}\n"]}
|
|
1
|
+
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AC,CAAC;QAC5C,CAAC;QACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CAOJ","sourcesContent":["import type { Checkbox } from '@microsoft/fast-foundation';\nimport { parseColor } from '@microsoft/fast-colors';\nimport type { Table } from '..';\nimport { tableHeaderTag, type TableHeader } from '../components/header';\nimport {\n TableColumnSortDirection,\n type TableRecord,\n TableRowSelectionState\n} from '../types';\nimport { waitForUpdatesAsync } from '../../testing/async-helpers';\nimport { menuButtonTag, type MenuButton } from '../../menu-button';\nimport { tableCellTag, type TableCell } from '../components/cell';\nimport type { TableGroupHeaderView } from '../../table-column/base/group-header-view';\nimport { TableCellView } from '../../table-column/base/cell-view';\nimport { tableRowTag, type TableRow } from '../components/row';\nimport { Anchor, anchorTag } from '../../anchor';\nimport { tableGroupRowTag, type TableGroupRow } from '../components/group-row';\nimport type { Button } from '../../button';\nimport { Icon } from '../../icon-base';\nimport type { IconSeverity } from '../../icon-base/types';\nimport { Spinner, spinnerTag } from '../../spinner';\nimport { borderHoverColor } from '../../theme-provider/design-tokens';\n\n/**\n * Summary information about a column that is sorted in the table for use in the `TablePageObject`.\n */\nexport interface SortedColumn {\n columnId?: string;\n sortDirection: TableColumnSortDirection;\n}\n\n/**\n * Page object for the `nimble-table` component to provide consistent ways\n * of querying and interacting with the component during tests.\n */\nexport class TablePageObject<T extends TableRecord> {\n public constructor(private readonly tableElement: Table<T>) {}\n\n public getRenderedHeaderCount(): number {\n const headers = this.tableElement.shadowRoot!.querySelectorAll(tableHeaderTag);\n return headers.length;\n }\n\n public getRenderedCellCountForRow(rowIndex: number): number {\n const row = this.getRow(rowIndex);\n const cells = row.shadowRoot!.querySelectorAll(tableCellTag);\n return cells.length;\n }\n\n public getHeaderContent(columnIndex: number): Node | undefined {\n const headers = this.tableElement.shadowRoot!.querySelectorAll<TableHeader>(\n tableHeaderTag\n );\n if (columnIndex >= headers.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return this.getHeaderContentElement(headers.item(columnIndex));\n }\n\n public getHeaderElement(columnIndex: number): TableHeader {\n const headers = this.tableElement.shadowRoot!.querySelectorAll<TableHeader>(\n tableHeaderTag\n );\n if (columnIndex >= headers.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return headers.item(columnIndex);\n }\n\n public getHeaderTitle(columnIndex: number): string {\n const column = this.tableElement.columns[columnIndex];\n return (\n column?.shadowRoot!.firstElementChild?.getAttribute('title') ?? ''\n );\n }\n\n public getHeaderTextContent(columnIndex: number): string {\n return (\n this.getHeaderContent(\n columnIndex\n )?.firstChild?.textContent?.trim() ?? ''\n );\n }\n\n public dispatchEventToHeader(\n columnIndex: number,\n event: Event\n ): boolean | undefined {\n const column = this.tableElement.columns[columnIndex];\n return column?.shadowRoot!.firstElementChild?.dispatchEvent(event);\n }\n\n public getHeaderRenderedWidth(columnIndex: number): number {\n const headers = this.tableElement.shadowRoot!.querySelectorAll<TableHeader>(\n tableHeaderTag\n );\n if (columnIndex >= headers.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return headers[columnIndex]!.getBoundingClientRect().width;\n }\n\n public async clickColumnHeader(\n columnIndex: number,\n shiftKeyDown = false\n ): Promise<void> {\n const clickEvent = new MouseEvent('click', {\n shiftKey: shiftKeyDown,\n bubbles: true\n } as MouseEventInit);\n this.getHeaderElement(columnIndex).dispatchEvent(clickEvent);\n await waitForUpdatesAsync();\n }\n\n public getRenderedRowCount(): number {\n return this.tableElement.shadowRoot!.querySelectorAll(tableRowTag)\n .length;\n }\n\n public getRenderedGroupRowCount(): number {\n return this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag)\n .length;\n }\n\n public getAllGroupRowsExpandedState(): boolean[] {\n const groupRows = this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag);\n return Array.from(groupRows).map(row => row.expanded);\n }\n\n public getAllDataRowsExpandedState(): boolean[] {\n const rows = this.tableElement.shadowRoot!.querySelectorAll(tableRowTag);\n return Array.from(rows).map(row => row.expanded);\n }\n\n public getRenderedCellView(\n rowIndex: number,\n columnIndex: number\n ): TableCellView {\n const cell = this.getCell(rowIndex, columnIndex);\n const cellView = cell.cellViewContainer.firstElementChild;\n if (!(cellView instanceof TableCellView)) {\n throw new Error(\n 'Cell view not found in cell - ensure cellViewTag is set for column'\n );\n }\n return cellView as TableCellView;\n }\n\n public getRenderedCellViewById(\n recordId: string,\n columnId: string\n ): TableCellView {\n const cell = this.getCellById(recordId, columnId);\n const cellView = cell.cellViewContainer.firstElementChild;\n if (!(cellView instanceof TableCellView)) {\n throw new Error(\n 'Cell view not found in cell - ensure cellViewTag is set for column'\n );\n }\n return cellView as TableCellView;\n }\n\n public getRenderedCellTextContent(\n rowIndex: number,\n columnIndex: number\n ): string {\n return (\n this.getRenderedCellView(\n rowIndex,\n columnIndex\n ).shadowRoot!.textContent?.trim() ?? ''\n );\n }\n\n public getRenderedCellAnchor(\n rowIndex: number,\n columnIndex: number\n ): Anchor {\n const anchor = this.getRenderedCellView(\n rowIndex,\n columnIndex\n ).shadowRoot!.querySelector(anchorTag);\n if (!anchor) {\n throw new Error(\n `Anchor not found at cell ${rowIndex},${columnIndex}`\n );\n }\n return anchor;\n }\n\n public getRenderedMappingColumnCellIconTagName(\n rowIndex: number,\n columnIndex: number\n ): string {\n const iconOrSpinner = this.getRenderedMappingColumnIconOrSpinner(\n this.getRenderedCellView(rowIndex, columnIndex)\n );\n return iconOrSpinner.tagName.toLocaleLowerCase();\n }\n\n public getRenderedMappingColumnCellIconSeverity(\n rowIndex: number,\n columnIndex: number\n ): IconSeverity {\n const iconOrSpinner = this.getRenderedMappingColumnIconOrSpinner(\n this.getRenderedCellView(rowIndex, columnIndex)\n );\n if (iconOrSpinner instanceof Icon) {\n return iconOrSpinner.severity;\n }\n throw new Error('Cell does not contain an icon');\n }\n\n public getRenderedGroupHeaderTextContent(groupRowIndex: number): string {\n return (\n this.getGroupRowHeaderView(\n groupRowIndex\n ).shadowRoot!.textContent?.trim() ?? ''\n );\n }\n\n public getAllRenderedGroupHeaderTextContent(): string[] {\n const groupRows = this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag);\n return Array.from(groupRows).map((_, i) => {\n return this.getRenderedGroupHeaderTextContent(i);\n });\n }\n\n public getCellTitle(rowIndex: number, columnIndex: number): string {\n const cellView = this.getRenderedCellView(rowIndex, columnIndex);\n return (\n cellView.shadowRoot!.firstElementChild?.getAttribute('title') ?? ''\n );\n }\n\n public dispatchEventToCell(\n rowIndex: number,\n columnIndex: number,\n event: Event\n ): boolean | undefined {\n const cellView = this.getRenderedCellView(rowIndex, columnIndex);\n return cellView.shadowRoot!.firstElementChild?.dispatchEvent(event);\n }\n\n public getGroupHeaderTitle(groupRowIndex: number): string {\n const groupHeader = this.getGroupRowHeaderView(groupRowIndex);\n return (\n groupHeader\n .shadowRoot!.querySelector('span')\n ?.getAttribute('title') ?? ''\n );\n }\n\n public dispatchEventToGroupHeader(\n groupRowIndex: number,\n event: Event\n ): boolean | undefined {\n const groupHeader = this.getGroupRowHeaderView(groupRowIndex);\n return groupHeader\n .shadowRoot!.querySelector('span')\n ?.dispatchEvent(event);\n }\n\n public getRecordId(rowIndex: number): string | undefined {\n return this.getRow(rowIndex).recordId;\n }\n\n public getRowWidth(): number {\n const tableRowContainer = this.tableElement.shadowRoot!.querySelector(\n '.table-row-container'\n );\n return tableRowContainer!.scrollWidth;\n }\n\n public async sizeTableToGivenRowWidth(\n rowWidth: number,\n table: Table<T>\n ): Promise<void> {\n if (!table.$fastController.isConnected) {\n throw Error(\n 'The element must be connected before calling this method'\n );\n }\n\n table.style.width = `${\n rowWidth\n + table.headerRowActionContainer.getBoundingClientRect().width\n + table.virtualizer.headerContainerMarginRight\n }px`;\n await waitForUpdatesAsync();\n }\n\n public getCellRenderedWidth(rowIndex: number, columnIndex: number): number {\n const cell = this.getCell(rowIndex, columnIndex);\n const actualWidth = cell.getBoundingClientRect().width;\n // Round to one decimal place. This is to work around a bug in Chrome related to\n // fractional widths (e.g. '1fr') in grid layouts that results in some numerical\n // precision issues. See: https://bugs.chromium.org/p/chromium/issues/detail?id=1515685\n return Math.round(actualWidth * 10) / 10;\n }\n\n public getTotalCellRenderedWidth(): number {\n const row = this.getRow(0);\n const cells = row?.shadowRoot?.querySelectorAll(tableCellTag);\n return Array.from(cells!).reduce((p, c) => {\n return p + c.getBoundingClientRect().width;\n }, 0);\n }\n\n public async scrollToFirstRowAsync(): Promise<void> {\n const scrollElement = this.tableElement.viewport;\n scrollElement.scroll({ top: 0 });\n await waitForUpdatesAsync();\n }\n\n public async scrollToLastRowAsync(): Promise<void> {\n const scrollElement = this.tableElement.viewport;\n scrollElement.scroll({ top: scrollElement.scrollHeight });\n await waitForUpdatesAsync();\n }\n\n public getCellActionMenu(\n rowIndex: number,\n columnIndex: number\n ): MenuButton | null {\n return this.getCell(rowIndex, columnIndex).shadowRoot!.querySelector(\n menuButtonTag\n );\n }\n\n public async clickCellActionMenu(\n rowIndex: number,\n columnIndex: number\n ): Promise<void> {\n this.setRowHoverState(rowIndex, true);\n await waitForUpdatesAsync();\n\n const menuButton = this.getCellActionMenu(rowIndex, columnIndex);\n if (!menuButton) {\n throw new Error('Cannot click on a non-visible action menu');\n }\n\n menuButton.toggleButton!.control.click();\n }\n\n public isCellActionMenuVisible(\n rowIndex: number,\n columnIndex: number\n ): boolean {\n const actionMenu = this.getCellActionMenu(rowIndex, columnIndex);\n if (!actionMenu) {\n return false;\n }\n\n return window.getComputedStyle(actionMenu).display !== 'none';\n }\n\n public setRowHoverState(rowIndex: number, hover: boolean): void {\n const row = this.getRow(rowIndex);\n const cells = row.shadowRoot!.querySelectorAll(tableCellTag);\n if (hover) {\n cells.forEach(cell => cell.style.setProperty(\n '--ni-private-table-cell-action-menu-display',\n 'block'\n ));\n } else {\n cells.forEach(cell => cell.style.removeProperty(\n '--ni-private-table-cell-action-menu-display'\n ));\n }\n }\n\n public async clickGroupRow(groupRowIndex: number): Promise<void> {\n const groupRow = this.getGroupRow(groupRowIndex);\n groupRow.click();\n await waitForUpdatesAsync();\n }\n\n public async clickRow(\n rowIndex: number,\n modifiers: { shiftKey?: boolean, ctrlKey?: boolean } = {}\n ): Promise<void> {\n const row = this.getRow(rowIndex);\n const event = new MouseEvent('click', modifiers);\n row.dispatchEvent(event);\n await waitForUpdatesAsync();\n }\n\n public getIsRowSelectable(rowIndex: number): boolean {\n const row = this.getRow(rowIndex);\n return row.selectable;\n }\n\n public getIsRowSelected(rowIndex: number): boolean {\n const row = this.getRow(rowIndex);\n return row.selected;\n }\n\n public toggleGroupRowExpandedState(groupRowIndex: number): void {\n this.getGroupRow(groupRowIndex).click();\n }\n\n public clickCollapseAllButton(): void {\n this.getCollapseAllButton()?.click();\n }\n\n public clickDataRowExpandCollapseButton(rowIndex: number): void {\n const expandCollapseButton = this.getExpandCollapseButtonForRow(rowIndex);\n if (!expandCollapseButton) {\n throw new Error(\n 'The provided row index has no visible expand collapse button associated with it.'\n );\n }\n\n expandCollapseButton.click();\n }\n\n public isCollapseAllButtonVisible(): boolean {\n const collapseButton = this.getCollapseAllButton();\n if (collapseButton) {\n return (\n window.getComputedStyle(collapseButton).visibility === 'visible'\n );\n }\n return false;\n }\n\n public isCollapseAllButtonSpaceReserved(): boolean {\n const collapseButton = this.getCollapseAllButton();\n if (collapseButton) {\n return window.getComputedStyle(collapseButton).display !== 'none';\n }\n return true;\n }\n\n public isDataRowExpandCollapseButtonVisible(rowIndex: number): boolean {\n const expandCollapseButton = this.getExpandCollapseButtonForRow(rowIndex);\n return expandCollapseButton !== null;\n }\n\n public isDataRowLoadingSpinnerVisible(rowIndex: number): boolean {\n const row = this.getRow(rowIndex);\n const spinner = row.shadowRoot!.querySelector(spinnerTag);\n return spinner !== null;\n }\n\n public isTableSelectionCheckboxVisible(): boolean {\n const checkbox = this.getSelectionCheckboxForTable();\n return this.isCheckboxVisible(checkbox);\n }\n\n public getTableSelectionState(): TableRowSelectionState {\n const checkbox = this.getSelectionCheckboxForTable();\n return this.getSelectionStateOfCheckbox(checkbox);\n }\n\n public clickTableSelectionCheckbox(): void {\n const checkbox = this.getSelectionCheckboxForTable();\n checkbox!.click();\n }\n\n public isRowSelectionCheckboxVisible(rowIndex: number): boolean {\n const checkbox = this.getSelectionCheckboxForRow(rowIndex);\n return this.isCheckboxVisible(checkbox);\n }\n\n public getRowSelectionState(rowIndex: number): TableRowSelectionState {\n const checkbox = this.getSelectionCheckboxForRow(rowIndex);\n return this.getSelectionStateOfCheckbox(checkbox);\n }\n\n public clickRowSelectionCheckbox(rowIndex: number, shiftKey = false): void {\n if (shiftKey) {\n const shiftKeyDownEvent = new KeyboardEvent('keydown', {\n key: 'Shift',\n shiftKey: true,\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyDownEvent);\n }\n\n const checkbox = this.getSelectionCheckboxForRow(rowIndex);\n checkbox!.click();\n\n if (shiftKey) {\n const shiftKeyUpEvent = new KeyboardEvent('keyup', {\n key: 'Shift',\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyUpEvent);\n }\n }\n\n public getGroupRowSelectionState(\n groupRowIndex: number\n ): TableRowSelectionState {\n const checkbox = this.getSelectionCheckboxForGroupRow(groupRowIndex);\n return this.getSelectionStateOfCheckbox(checkbox);\n }\n\n public clickGroupRowSelectionCheckbox(\n groupRowIndex: number,\n shiftKey = false\n ): void {\n if (shiftKey) {\n const shiftKeyDownEvent = new KeyboardEvent('keydown', {\n key: 'Shift',\n shiftKey: true,\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyDownEvent);\n }\n\n const checkbox = this.getSelectionCheckboxForGroupRow(groupRowIndex);\n checkbox!.click();\n\n if (shiftKey) {\n const shiftKeyUpEvent = new KeyboardEvent('keyup', {\n key: 'Shift',\n bubbles: true\n } as KeyboardEventInit);\n document.dispatchEvent(shiftKeyUpEvent);\n }\n }\n\n /**\n * @param columnIndex The index of the column to the left of the divider to press.\n */\n public pressRightColumnDivider(columnIndex: number): void {\n this.pressColumnDivider(this.getColumnDivider(columnIndex, false));\n }\n\n /**\n * @param columnIndex The index of the column to the left of the divider to release.\n */\n public releaseRightColumnDivider(columnIndex: number): void {\n this.releaseColumnDivider(this.getColumnDivider(columnIndex, false));\n }\n\n /**\n * @param columnIndex The index of the column to the left of a divider being dragged. Thus, this\n * cannot be given a value representing the last visible column index.\n * @param deltas The series of mouse movements in the x-direction while sizing a column.\n */\n public dragSizeColumnByRightDivider(\n columnIndex: number,\n deltas: readonly number[]\n ): void {\n this.dragSizeColumnByDivider(columnIndex, false, deltas);\n }\n\n /**\n * @param columnIndex The index of the column to the right of a divider being dragged. Thus, this\n * value must be greater than 0 and less than the total number of visible columns.\n * @param deltas The series of mouse movements in the x-direction while sizing a column.\n */\n public dragSizeColumnByLeftDivider(\n columnIndex: number,\n deltas: readonly number[]\n ): void {\n this.dragSizeColumnByDivider(columnIndex, true, deltas);\n }\n\n /**\n * @param columnIndex The index of the column whose right divider we're checking.\n */\n public columnRightDividerHasActiveStyling(columnIndex: number): boolean {\n const divider = this.getColumnDivider(columnIndex, false);\n const currentColor = parseColor(\n window.getComputedStyle(divider).borderLeftColor\n );\n const hoverColor = parseColor(borderHoverColor.getValueFor(divider))!;\n return currentColor!.equalValue(hoverColor);\n }\n\n public isVerticalScrollbarVisible(): boolean {\n return (\n this.tableElement.viewport.clientHeight\n < this.tableElement.viewport.scrollHeight\n );\n }\n\n public isHorizontalScrollbarVisible(): boolean {\n return (\n this.tableElement.viewport.clientWidth\n < this.tableElement.viewport.scrollWidth\n );\n }\n\n public getSortedColumns(): SortedColumn[] {\n return this.tableElement.columns\n .filter(\n x => !x.columnInternals.sortingDisabled\n && typeof x.columnInternals.currentSortIndex === 'number'\n && x.columnInternals.currentSortDirection\n !== TableColumnSortDirection.none\n )\n .sort(\n (a, b) => a.columnInternals.currentSortIndex!\n - b.columnInternals.currentSortIndex!\n )\n .map(x => {\n return {\n columnId: x.columnId,\n sortDirection: x.columnInternals.currentSortDirection\n };\n });\n }\n\n public getGroupedColumns(): string[] {\n return this.tableElement.columns\n .filter(\n x => !x.columnInternals.groupingDisabled\n && typeof x.columnInternals.groupIndex === 'number'\n )\n .sort(\n (a, b) => a.columnInternals.groupIndex!\n - b.columnInternals.groupIndex!\n )\n .map(x => x.columnId ?? '');\n }\n\n public getChildRowCountForGroup(groupRowIndex: number): number {\n const groupRow = this.getGroupRow(groupRowIndex);\n const countDisplayString = groupRow\n .shadowRoot!.querySelector('.group-row-child-count')!\n .textContent!.trim();\n // Remove the parenthesis to get just the number as a string\n const countString = countDisplayString.substring(\n 1,\n countDisplayString.length - 1\n );\n return Number(countString);\n }\n\n /** @internal */\n public isRowHoverStylingEnabled(): boolean {\n const rows: NodeListOf<TableRow | TableGroupRow> = this.tableElement.shadowRoot!.querySelectorAll(\n `${tableRowTag}, ${tableGroupRowTag}`\n );\n const firstRowAllowsHover = rows[0]!.allowHover;\n if (Array.from(rows).some(x => x.allowHover !== firstRowAllowsHover)) {\n throw new Error('Rows inconsistently allow hover styling');\n }\n return firstRowAllowsHover;\n }\n\n /** @internal */\n public getGroupRowHeaderView(groupRowIndex: number): TableGroupHeaderView {\n const groupRow = this.getGroupRow(groupRowIndex);\n return groupRow.shadowRoot!.querySelector('.group-header-view')!;\n }\n\n /** @internal */\n public getRow(rowIndex: number): TableRow {\n const rows = this.tableElement.shadowRoot!.querySelectorAll(tableRowTag);\n if (rowIndex >= rows.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered rows'\n );\n }\n\n return rows.item(rowIndex);\n }\n\n /** @internal */\n public getCell(rowIndex: number, columnIndex: number): TableCell {\n const row = this.getRow(rowIndex);\n const cells = row.shadowRoot!.querySelectorAll(tableCellTag);\n if (columnIndex >= cells.length) {\n throw new Error(\n 'Attempting to index past the total number of rendered columns'\n );\n }\n\n return cells.item(columnIndex);\n }\n\n private getRowById(recordId: string): TableRow {\n const row: TableRow | null = this.tableElement.shadowRoot!.querySelector(\n `nimble-table-row[record-id=\"${CSS.escape(recordId)}\"]`\n );\n if (!row) {\n throw new Error(\n 'Row with given id was not found. It may not be scrolled into view.'\n );\n }\n\n return row;\n }\n\n private getCellById(recordId: string, columnId: string): TableCell {\n const row = this.getRowById(recordId);\n const cell: TableCell | null = row.shadowRoot!.querySelector(\n `nimble-table-cell[column-id=\"${CSS.escape(columnId)}\"]`\n );\n\n if (!cell) {\n throw new Error('Cell with given columnId was not found in row');\n }\n\n return cell;\n }\n\n private getCollapseAllButton(): Button | null {\n return this.tableElement.shadowRoot!.querySelector<Button>(\n '.collapse-all-button'\n );\n }\n\n private getExpandCollapseButtonForRow(rowIndex: number): Button | null {\n const row = this.getRow(rowIndex);\n const rowExpandCollapseButton = row.shadowRoot!.querySelector<Button>(\n '.expand-collapse-button'\n );\n if (!rowExpandCollapseButton) {\n const firstCell = this.getCell(rowIndex, 0);\n return firstCell?.shadowRoot!.querySelector<Button>(\n '.expand-collapse-button'\n );\n }\n\n return rowExpandCollapseButton;\n }\n\n private getSelectionCheckboxForRow(rowIndex: number): Checkbox | null {\n const row = this.getRow(rowIndex);\n return row.shadowRoot!.querySelector('.selection-checkbox');\n }\n\n private getSelectionCheckboxForGroupRow(\n groupRowIndex: number\n ): Checkbox | null {\n const groupRow = this.getGroupRow(groupRowIndex);\n return groupRow.shadowRoot!.querySelector('.selection-checkbox');\n }\n\n private getSelectionCheckboxForTable(): Checkbox | null {\n return this.tableElement.shadowRoot!.querySelector<Checkbox>(\n '.header-row .selection-checkbox'\n );\n }\n\n private isCheckboxVisible(checkbox: Checkbox | null): boolean {\n return !!checkbox && !checkbox.hidden;\n }\n\n private getSelectionStateOfCheckbox(\n checkbox: Checkbox | null\n ): TableRowSelectionState {\n if (!checkbox) {\n throw new Error('Cannot get selection state from null checkbox');\n }\n\n if (checkbox.indeterminate) {\n return TableRowSelectionState.partiallySelected;\n }\n if (checkbox.checked) {\n return TableRowSelectionState.selected;\n }\n return TableRowSelectionState.notSelected;\n }\n\n private getGroupRow(groupRowIndex: number): TableGroupRow {\n const groupRows = this.tableElement.shadowRoot!.querySelectorAll(tableGroupRowTag);\n if (groupRowIndex >= groupRows.length) {\n throw new Error(\n 'Attempting to index past the total number of group rows'\n );\n }\n\n return groupRows.item(groupRowIndex);\n }\n\n private getHeaderContentElement(\n element: HTMLElement | HTMLSlotElement\n ): Node | undefined {\n const nodeChildren = this.isSlotElement(element)\n ? element.assignedNodes()\n : element.shadowRoot?.childNodes;\n if (!nodeChildren) {\n return undefined;\n }\n\n const slotElement = Array.from(nodeChildren)?.find<HTMLSlotElement>(\n this.isSlotElement\n );\n if (slotElement) {\n return this.getHeaderContentElement(slotElement);\n }\n\n return nodeChildren[0]; // header content should be first item in final slot element\n }\n\n private getRenderedMappingColumnIconOrSpinner(\n view: TableCellView | TableGroupHeaderView\n ): Icon | Spinner {\n const viewShadowRoot = view.shadowRoot!;\n const spinnerOrIcon = viewShadowRoot.querySelector(\n '.reserve-icon-size'\n )?.firstElementChild;\n if (\n !(spinnerOrIcon instanceof Icon || spinnerOrIcon instanceof Spinner)\n ) {\n throw new Error('Icon or Spinner not found');\n }\n\n return spinnerOrIcon;\n }\n\n private getColumnDivider(\n columnIndex: number,\n leftDivider: boolean\n ): HTMLElement {\n const headerContainers = this.tableElement.shadowRoot!.querySelectorAll('.header-container');\n if (columnIndex < 0 || columnIndex >= headerContainers.length) {\n throw new Error(\n 'Invalid column index. Index must be greater than or equal to 0 and less than the number of visible columns.'\n );\n }\n const side = leftDivider ? 'left' : 'right';\n const divider = headerContainers[columnIndex]!.querySelector(\n `.column-divider.${side}`\n );\n if (!divider) {\n throw new Error(\n `The provided column index has no ${side} divider associated with it.`\n );\n }\n\n return divider as HTMLElement;\n }\n\n private pressColumnDivider(divider: HTMLElement): number {\n const dividerRect = divider.getBoundingClientRect();\n const clickX = (dividerRect.x + dividerRect.width) / 2;\n const pointerDownEvent = new PointerEvent('pointerdown', {\n // -1 is a value reserved for synthetic events: https://w3c.github.io/pointerevents/#dom-pointerevent-pointerid\n pointerId: -1,\n clientX: clickX,\n clientY: (dividerRect.y + dividerRect.height) / 2\n });\n divider.dispatchEvent(pointerDownEvent);\n\n return clickX;\n }\n\n private releaseColumnDivider(divider: HTMLElement): void {\n divider.dispatchEvent(new PointerEvent('pointerup'));\n }\n\n private dragSizeColumnByDivider(\n columnIndex: number,\n leftDivider: boolean,\n deltas: readonly number[]\n ): void {\n const divider = this.getColumnDivider(columnIndex, leftDivider);\n let currentPointerX = this.pressColumnDivider(divider);\n for (const delta of deltas) {\n currentPointerX += delta;\n const pointerMoveEvent = new PointerEvent('pointermove', {\n clientX: currentPointerX\n });\n divider.dispatchEvent(pointerMoveEvent);\n }\n this.releaseColumnDivider(divider);\n }\n\n private readonly isSlotElement = (\n element: Node | undefined\n ): element is HTMLSlotElement => {\n return element?.nodeName === 'SLOT';\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MenuButtonToggleEventDetail } from '../../menu-button/types';
|
|
2
2
|
/** @internal */
|
|
3
|
-
export declare const cellViewMenuSlotName
|
|
3
|
+
export declare const cellViewMenuSlotName = "menu-button-menu";
|
|
4
4
|
/**
|
|
5
5
|
* The type of the detail associated with the `menu-button-column-beforetoggle` and `menu-button-column-toggle`
|
|
6
6
|
* events on the menu button column.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/menu-button/types.ts"],"names":[],"mappings":"AAEA,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/menu-button/types.ts"],"names":[],"mappings":"AAEA,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC","sourcesContent":["import type { MenuButtonToggleEventDetail } from '../../menu-button/types';\n\n/** @internal */\nexport const cellViewMenuSlotName = 'menu-button-menu';\n\n/**\n * The type of the detail associated with the `menu-button-column-beforetoggle` and `menu-button-column-toggle`\n * events on the menu button column.\n */\nexport interface MenuButtonColumnToggleEventDetail\n extends MenuButtonToggleEventDetail {\n recordId: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computations.js","sourceRoot":"","sources":["../../../../src/wafer-map/modules/computations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAEH,SAAS,EACT,aAAa,EAEhB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAYlD;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAW,uBAAuB;QAC9B,OAAO,IAAI,CAAC,wBAAwB,CAAC;IACzC,CAAC;IAED,IAAW,qBAAqB;QAC5B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;IAaD,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAHrC,mBAAc,GAAG,CAAC,CAAC;QACnB,yBAAoB,GAAG,IAAI,CAAC;IAEY,CAAC;IAEnD,yBAAyB;QAC5B,MAAM,gBAAgB,GAAG;YACrB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW;YAChC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY;S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C,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAC5D,CAAC;QACN,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC;IAEO,uBAAuB,CAC3B,UAAkB,EAClB,WAAmB;QAEnB,OAAO;YACH,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;YACrC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK;YAC3C,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;YAC9C,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;SAC3C,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { range } from 'd3-array';\nimport {\n type ScaleBand,\n scaleBand,\n scaleQuantile,\n type ScaleQuantile\n} from 'd3-scale';\nimport type { WaferMap } from '..';\nimport type { WaferMapDie } from '../types';\nimport { WaferMapOriginLocation } from '../types';\nimport type { Dimensions, Margin } from '../workers/types';\n\ninterface GridDimensions {\n origin: {\n x: number,\n y: number\n };\n rows: number;\n cols: number;\n}\n\n/**\n * Computations calculates and stores different measures which are used in the Wafermap\n */\nexport class Computations {\n public get containerDimensions(): Dimensions {\n return this._containerDimensions;\n }\n\n public get dieDimensions(): Dimensions {\n return this._dieDimensions;\n }\n\n public get radius(): number {\n return this._radius;\n }\n\n public get margin(): Margin {\n return this._margin;\n }\n\n public get horizontalScale(): ScaleBand<number> {\n return this._horizontalScale;\n }\n\n public get verticalScale(): ScaleBand<number> {\n return this._verticalScale;\n }\n\n public get invertedHorizontalScale(): ScaleQuantile<number, number> {\n return this._invertedHorizontalScale;\n }\n\n public get invertedVerticalScale(): ScaleQuantile<number, number> {\n return this._invertedVerticalScale;\n }\n\n private _containerDimensions!: Dimensions;\n private _dieDimensions!: Dimensions;\n private _radius!: number;\n private _margin!: Margin;\n private _horizontalScale!: ScaleBand<number>;\n private _verticalScale!: ScaleBand<number>;\n private _invertedHorizontalScale!: ScaleQuantile<number, number>;\n private _invertedVerticalScale!: ScaleQuantile<number, number>;\n private readonly defaultPadding = 0;\n private readonly baseMarginPercentage = 0.04;\n\n public constructor(private readonly wafermap: WaferMap) {}\n\n public updateContainerDimensions(): void {\n const canvasDimensions = {\n width: this.wafermap.canvasWidth,\n height: this.wafermap.canvasHeight\n };\n const canvasDiameter = Math.min(\n canvasDimensions.width,\n canvasDimensions.height\n );\n const canvasMargin = {\n top: (canvasDimensions.height - canvasDiameter) / 2,\n right: (canvasDimensions.width - canvasDiameter) / 2,\n bottom: (canvasDimensions.height - canvasDiameter) / 2,\n left: (canvasDimensions.width - canvasDiameter) / 2\n };\n const baseMargin = {\n top: canvasDiameter * this.baseMarginPercentage,\n right: canvasDiameter * this.baseMarginPercentage,\n bottom: canvasDiameter * this.baseMarginPercentage,\n left: canvasDiameter * this.baseMarginPercentage\n };\n this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);\n this._containerDimensions = this.calculateContainerDimensions(\n canvasDimensions,\n this._margin\n );\n const containerDiameter = Math.min(\n this._containerDimensions.width,\n this._containerDimensions.height\n );\n this._radius = containerDiameter / 2;\n this.updateScales();\n }\n\n public updateScales(): void {\n const containerDiameter = Math.min(\n this._containerDimensions.width,\n this._containerDimensions.height\n );\n const gridDimensions = this.gridDimensionsValidAndDefined()\n ? this.calculateGridDimensionsFromBoundingBox()\n : this.calculateGridDimensionsFromDies(this.wafermap.dies);\n // this scale is used for positioning the dies on the canvas\n const originLocation = this.wafermap.originLocation;\n this._horizontalScale = this.createHorizontalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n this._invertedHorizontalScale = this.createInvertedHorizontalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n // this scale is used for positioning the dies on the canvas\n this._verticalScale = this.createVerticalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n this._invertedVerticalScale = this.createInvertedVerticalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n const dieWidth = this.horizontalScale.bandwidth();\n const dieHeight = this.verticalScale.bandwidth();\n this._dieDimensions = {\n width: isNaN(dieWidth) ? 0 : dieWidth,\n height: isNaN(dieHeight) ? 0 : dieHeight\n };\n }\n\n private gridDimensionsValidAndDefined(): boolean {\n return (\n !this.wafermap.validity.invalidGridDimensions\n && typeof this.wafermap.gridMinX === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n );\n }\n\n private calculateGridDimensionsFromBoundingBox(): GridDimensions {\n const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n if (\n typeof this.wafermap.gridMaxY === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n ) {\n gridDimensions.origin.x = this.wafermap.gridMinX;\n gridDimensions.origin.y = this.wafermap.gridMinY;\n gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;\n gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;\n }\n return gridDimensions;\n }\n\n private calculateGridDimensionsFromDies(\n dies: Readonly<Readonly<WaferMapDie>[]>\n ): GridDimensions {\n if (dies.length === 0 || dies[0] === undefined) {\n return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n }\n\n const minPoint = { x: dies[0].x, y: dies[0].y };\n const maxPoint = { x: dies[0].x, y: dies[0].y };\n\n for (const die of dies) {\n if (die.x < minPoint.x) {\n minPoint.x = die.x;\n }\n if (die.y < minPoint.y) {\n minPoint.y = die.y;\n }\n if (die.x > maxPoint.x) {\n maxPoint.x = die.x;\n }\n if (die.y > maxPoint.y) {\n maxPoint.y = die.y;\n }\n }\n\n return {\n origin: minPoint,\n rows: maxPoint.y - minPoint.y + 1,\n cols: maxPoint.x - minPoint.x + 1\n };\n }\n\n private calculateContainerDimensions(\n canvasDimensions: Dimensions,\n margin: Margin\n ): Dimensions {\n return {\n width: canvasDimensions.width - margin.left - margin.right,\n height: canvasDimensions.height - margin.top - margin.bottom\n };\n }\n\n private createHorizontalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerWidth: number\n ): ScaleBand<number> {\n const scale = scaleBand<number>()\n .domain(range(grid.origin.x, grid.origin.x + grid.cols))\n .paddingInner(0)\n .paddingOuter(0)\n .align(0)\n .round(false);\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ) {\n return scale.range([0, containerWidth]);\n }\n return scale.range([containerWidth, 0]);\n }\n\n private createInvertedHorizontalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerWidth: number\n ): ScaleQuantile<number, number> {\n const scale = scaleQuantile().domain([0, containerWidth]);\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ) {\n return scale.range(range(grid.origin.x, grid.origin.x + grid.cols));\n }\n return scale.range(\n range(grid.origin.x, grid.origin.x + grid.cols).reverse()\n );\n }\n\n private createVerticalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerHeight: number\n ): ScaleBand<number> {\n const scale = scaleBand<number>()\n .domain(range(grid.origin.y, grid.origin.y + grid.rows))\n .paddingInner(this.defaultPadding)\n .paddingOuter(0)\n .align(0)\n .round(false);\n // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid\n // we need to flip the vertical scale\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ) {\n return scale.range([containerHeight, 0]);\n }\n return scale.range([0, containerHeight]);\n }\n\n private createInvertedVerticalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerHeight: number\n ): ScaleQuantile<number, number> {\n const scale = scaleQuantile().domain([0, containerHeight]);\n // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid\n // we need to flip the inverted vertical scale\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ) {\n return scale.range(\n range(grid.origin.y, grid.origin.y + grid.rows).reverse()\n );\n }\n return scale.range(range(grid.origin.y, grid.origin.y + grid.rows));\n }\n\n private calculateMarginAddition(\n baseMargin: Margin,\n addedMargin: Margin\n ): Margin {\n return {\n top: baseMargin.top + addedMargin.top,\n right: baseMargin.right + addedMargin.right,\n bottom: baseMargin.bottom + addedMargin.bottom,\n left: baseMargin.left + addedMargin.left\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"computations.js","sourceRoot":"","sources":["../../../../src/wafer-map/modules/computations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAEH,SAAS,EACT,aAAa,EAEhB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAYlD;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CA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AAC,KAAK,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;IAC7C,CAAC;IAEO,2BAA2B,CAC/B,cAAsC,EACtC,IAAoB,EACpB,eAAuB;QAEvB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;QAC3D,+HAA+H;QAC/H,8CAA8C;QAC9C,IACI,cAAc,KAAK,sBAAsB,CAAC,UAAU;eACjD,cAAc,KAAK,sBAAsB,CAAC,WAAW,EAC1D,CAAC;YACC,OAAO,KAAK,CAAC,KAAK,CACd,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAC5D,CAAC;QACN,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC;IAEO,uBAAuB,CAC3B,UAAkB,EAClB,WAAmB;QAEnB,OAAO;YACH,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;YACrC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK;YAC3C,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;YAC9C,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;SAC3C,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { range } from 'd3-array';\nimport {\n type ScaleBand,\n scaleBand,\n scaleQuantile,\n type ScaleQuantile\n} from 'd3-scale';\nimport type { WaferMap } from '..';\nimport type { WaferMapDie } from '../types';\nimport { WaferMapOriginLocation } from '../types';\nimport type { Dimensions, Margin } from '../workers/types';\n\ninterface GridDimensions {\n origin: {\n x: number,\n y: number\n };\n rows: number;\n cols: number;\n}\n\n/**\n * Computations calculates and stores different measures which are used in the Wafermap\n */\nexport class Computations {\n public get containerDimensions(): Dimensions {\n return this._containerDimensions;\n }\n\n public get dieDimensions(): Dimensions {\n return this._dieDimensions;\n }\n\n public get radius(): number {\n return this._radius;\n }\n\n public get margin(): Margin {\n return this._margin;\n }\n\n public get horizontalScale(): ScaleBand<number> {\n return this._horizontalScale;\n }\n\n public get verticalScale(): ScaleBand<number> {\n return this._verticalScale;\n }\n\n public get invertedHorizontalScale(): ScaleQuantile<number, number> {\n return this._invertedHorizontalScale;\n }\n\n public get invertedVerticalScale(): ScaleQuantile<number, number> {\n return this._invertedVerticalScale;\n }\n\n private _containerDimensions!: Dimensions;\n private _dieDimensions!: Dimensions;\n private _radius!: number;\n private _margin!: Margin;\n private _horizontalScale!: ScaleBand<number>;\n private _verticalScale!: ScaleBand<number>;\n private _invertedHorizontalScale!: ScaleQuantile<number, number>;\n private _invertedVerticalScale!: ScaleQuantile<number, number>;\n private readonly defaultPadding = 0;\n private readonly baseMarginPercentage = 0.04;\n\n public constructor(private readonly wafermap: WaferMap) {}\n\n public updateContainerDimensions(): void {\n const canvasDimensions = {\n width: this.wafermap.canvasWidth,\n height: this.wafermap.canvasHeight\n };\n const canvasDiameter = Math.min(\n canvasDimensions.width,\n canvasDimensions.height\n );\n const canvasMargin = {\n top: (canvasDimensions.height - canvasDiameter) / 2,\n right: (canvasDimensions.width - canvasDiameter) / 2,\n bottom: (canvasDimensions.height - canvasDiameter) / 2,\n left: (canvasDimensions.width - canvasDiameter) / 2\n };\n const baseMargin = {\n top: canvasDiameter * this.baseMarginPercentage,\n right: canvasDiameter * this.baseMarginPercentage,\n bottom: canvasDiameter * this.baseMarginPercentage,\n left: canvasDiameter * this.baseMarginPercentage\n };\n this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);\n this._containerDimensions = this.calculateContainerDimensions(\n canvasDimensions,\n this._margin\n );\n const containerDiameter = Math.min(\n this._containerDimensions.width,\n this._containerDimensions.height\n );\n this._radius = containerDiameter / 2;\n this.updateScales();\n }\n\n public updateScales(): void {\n const containerDiameter = Math.min(\n this._containerDimensions.width,\n this._containerDimensions.height\n );\n const gridDimensions = this.gridDimensionsValidAndDefined()\n ? this.calculateGridDimensionsFromBoundingBox()\n : this.calculateGridDimensionsFromDies(this.wafermap.dies);\n // this scale is used for positioning the dies on the canvas\n const originLocation = this.wafermap.originLocation;\n this._horizontalScale = this.createHorizontalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n this._invertedHorizontalScale = this.createInvertedHorizontalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n // this scale is used for positioning the dies on the canvas\n this._verticalScale = this.createVerticalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n this._invertedVerticalScale = this.createInvertedVerticalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n const dieWidth = this.horizontalScale.bandwidth();\n const dieHeight = this.verticalScale.bandwidth();\n this._dieDimensions = {\n width: isNaN(dieWidth) ? 0 : dieWidth,\n height: isNaN(dieHeight) ? 0 : dieHeight\n };\n }\n\n private gridDimensionsValidAndDefined(): boolean {\n return (\n !this.wafermap.validity.invalidGridDimensions\n && typeof this.wafermap.gridMinX === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n );\n }\n\n private calculateGridDimensionsFromBoundingBox(): GridDimensions {\n const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n if (\n typeof this.wafermap.gridMaxY === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n ) {\n gridDimensions.origin.x = this.wafermap.gridMinX;\n gridDimensions.origin.y = this.wafermap.gridMinY;\n gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;\n gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;\n }\n return gridDimensions;\n }\n\n private calculateGridDimensionsFromDies(\n dies: readonly Readonly<WaferMapDie>[]\n ): GridDimensions {\n if (dies.length === 0 || dies[0] === undefined) {\n return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n }\n\n const minPoint = { x: dies[0].x, y: dies[0].y };\n const maxPoint = { x: dies[0].x, y: dies[0].y };\n\n for (const die of dies) {\n if (die.x < minPoint.x) {\n minPoint.x = die.x;\n }\n if (die.y < minPoint.y) {\n minPoint.y = die.y;\n }\n if (die.x > maxPoint.x) {\n maxPoint.x = die.x;\n }\n if (die.y > maxPoint.y) {\n maxPoint.y = die.y;\n }\n }\n\n return {\n origin: minPoint,\n rows: maxPoint.y - minPoint.y + 1,\n cols: maxPoint.x - minPoint.x + 1\n };\n }\n\n private calculateContainerDimensions(\n canvasDimensions: Dimensions,\n margin: Margin\n ): Dimensions {\n return {\n width: canvasDimensions.width - margin.left - margin.right,\n height: canvasDimensions.height - margin.top - margin.bottom\n };\n }\n\n private createHorizontalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerWidth: number\n ): ScaleBand<number> {\n const scale = scaleBand<number>()\n .domain(range(grid.origin.x, grid.origin.x + grid.cols))\n .paddingInner(0)\n .paddingOuter(0)\n .align(0)\n .round(false);\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ) {\n return scale.range([0, containerWidth]);\n }\n return scale.range([containerWidth, 0]);\n }\n\n private createInvertedHorizontalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerWidth: number\n ): ScaleQuantile<number, number> {\n const scale = scaleQuantile().domain([0, containerWidth]);\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ) {\n return scale.range(range(grid.origin.x, grid.origin.x + grid.cols));\n }\n return scale.range(\n range(grid.origin.x, grid.origin.x + grid.cols).reverse()\n );\n }\n\n private createVerticalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerHeight: number\n ): ScaleBand<number> {\n const scale = scaleBand<number>()\n .domain(range(grid.origin.y, grid.origin.y + grid.rows))\n .paddingInner(this.defaultPadding)\n .paddingOuter(0)\n .align(0)\n .round(false);\n // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid\n // we need to flip the vertical scale\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ) {\n return scale.range([containerHeight, 0]);\n }\n return scale.range([0, containerHeight]);\n }\n\n private createInvertedVerticalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerHeight: number\n ): ScaleQuantile<number, number> {\n const scale = scaleQuantile().domain([0, containerHeight]);\n // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid\n // we need to flip the inverted vertical scale\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ) {\n return scale.range(\n range(grid.origin.y, grid.origin.y + grid.rows).reverse()\n );\n }\n return scale.range(range(grid.origin.y, grid.origin.y + grid.rows));\n }\n\n private calculateMarginAddition(\n baseMargin: Margin,\n addedMargin: Margin\n ): Margin {\n return {\n top: baseMargin.top + addedMargin.top,\n right: baseMargin.right + addedMargin.right,\n bottom: baseMargin.bottom + addedMargin.bottom,\n left: baseMargin.left + addedMargin.left\n };\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.13.0",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run generate-icons && npm run generate-workers && npm run build-components && npm run bundle-components && npm run generate-scss",
|