@nanoporetech-digital/components 5.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/nano-checkbox-group.cjs.entry.js +4 -0
  3. package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
  4. package/dist/cjs/nano-datalist_3.cjs.entry.js +13 -4
  5. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  6. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +7 -4
  7. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  8. package/dist/cjs/nano-input.cjs.entry.js +2 -2
  9. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nano-sortable.cjs.entry.js +3 -1
  11. package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
  12. package/dist/cjs/{nano-table-0a720c5f.js → nano-table-5a7a4d53.js} +11 -8
  13. package/dist/cjs/nano-table-5a7a4d53.js.map +1 -0
  14. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  15. package/dist/cjs/{table.worker-347d4d31.js → table.worker-77e56070.js} +2 -2
  16. package/dist/cjs/table.worker-77e56070.js.map +1 -0
  17. package/dist/collection/components/checkbox/checkbox-group.js +4 -0
  18. package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
  19. package/dist/collection/components/datalist/datalist.js +13 -4
  20. package/dist/collection/components/datalist/datalist.js.map +1 -1
  21. package/dist/collection/components/input/input.css +1 -1
  22. package/dist/collection/components/input/input.js +1 -1
  23. package/dist/collection/components/input/input.js.map +1 -1
  24. package/dist/collection/components/nav-item/nav-item.js +6 -3
  25. package/dist/collection/components/nav-item/nav-item.js.map +1 -1
  26. package/dist/collection/components/select/select.css +1 -1
  27. package/dist/collection/components/sortable/sortable.js +3 -1
  28. package/dist/collection/components/sortable/sortable.js.map +1 -1
  29. package/dist/collection/components/table/table.js +9 -6
  30. package/dist/collection/components/table/table.js.map +1 -1
  31. package/dist/components/datalist.js +13 -4
  32. package/dist/components/datalist.js.map +1 -1
  33. package/dist/components/input.js +2 -2
  34. package/dist/components/input.js.map +1 -1
  35. package/dist/components/nano-checkbox-group.js +4 -0
  36. package/dist/components/nano-checkbox-group.js.map +1 -1
  37. package/dist/components/nano-sortable.js +3 -1
  38. package/dist/components/nano-sortable.js.map +1 -1
  39. package/dist/components/nav-item.js +6 -3
  40. package/dist/components/nav-item.js.map +1 -1
  41. package/dist/components/select.js +1 -1
  42. package/dist/components/table.js +9 -6
  43. package/dist/components/table.js.map +1 -1
  44. package/dist/esm/nano-checkbox-group.entry.js +4 -0
  45. package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
  46. package/dist/esm/nano-datalist_3.entry.js +13 -4
  47. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  48. package/dist/esm/nano-global-nav-user-profile_3.entry.js +7 -4
  49. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  50. package/dist/esm/nano-input.entry.js +2 -2
  51. package/dist/esm/nano-input.entry.js.map +1 -1
  52. package/dist/esm/nano-sortable.entry.js +3 -1
  53. package/dist/esm/nano-sortable.entry.js.map +1 -1
  54. package/dist/esm/{nano-table-9767860f.js → nano-table-026a0d30.js} +11 -8
  55. package/dist/esm/nano-table-026a0d30.js.map +1 -0
  56. package/dist/esm/nano-table.entry.js +1 -1
  57. package/dist/esm/{table.worker-d252307c.js → table.worker-c17a27ed.js} +2 -2
  58. package/dist/esm/table.worker-c17a27ed.js.map +1 -0
  59. package/dist/nano-components/nano-components.esm.js +1 -1
  60. package/dist/nano-components/{p-2d43a82b.entry.js → p-1a9d9956.entry.js} +2 -2
  61. package/dist/nano-components/p-1a9d9956.entry.js.map +1 -0
  62. package/dist/nano-components/p-2e63676f.js +5 -0
  63. package/dist/nano-components/{p-8a79a7ca.entry.js → p-30cc21c2.entry.js} +2 -2
  64. package/dist/nano-components/{p-75735a91.entry.js → p-34501eae.entry.js} +2 -2
  65. package/dist/nano-components/p-34501eae.entry.js.map +1 -0
  66. package/dist/nano-components/p-3b4b7f40.entry.js +5 -0
  67. package/dist/nano-components/p-3b4b7f40.entry.js.map +1 -0
  68. package/dist/nano-components/{p-633c778c.js → p-59eb9caa.js} +2 -2
  69. package/dist/nano-components/{p-633c778c.js.map → p-59eb9caa.js.map} +1 -1
  70. package/dist/nano-components/p-7759d185.entry.js +5 -0
  71. package/dist/nano-components/p-7759d185.entry.js.map +1 -0
  72. package/dist/nano-components/p-9c4efe14.entry.js +5 -0
  73. package/dist/nano-components/p-9c4efe14.entry.js.map +1 -0
  74. package/dist/types/components/datalist/datalist.d.ts +1 -0
  75. package/dist/types/components/nav-item/nav-item.d.ts +1 -1
  76. package/docs-json.json +1 -1
  77. package/hydrate/index.js +38 -17
  78. package/package.json +2 -2
  79. package/dist/cjs/nano-table-0a720c5f.js.map +0 -1
  80. package/dist/cjs/table.worker-347d4d31.js.map +0 -1
  81. package/dist/esm/nano-table-9767860f.js.map +0 -1
  82. package/dist/esm/table.worker-d252307c.js.map +0 -1
  83. package/dist/nano-components/p-2d43a82b.entry.js.map +0 -1
  84. package/dist/nano-components/p-66631f50.js +0 -5
  85. package/dist/nano-components/p-75735a91.entry.js.map +0 -1
  86. package/dist/nano-components/p-b0c60290.entry.js +0 -5
  87. package/dist/nano-components/p-b0c60290.entry.js.map +0 -1
  88. package/dist/nano-components/p-c8ccb57a.entry.js +0 -5
  89. package/dist/nano-components/p-c8ccb57a.entry.js.map +0 -1
  90. package/dist/nano-components/p-d1a5326f.entry.js +0 -5
  91. package/dist/nano-components/p-d1a5326f.entry.js.map +0 -1
  92. /package/dist/nano-components/{p-66631f50.js.map → p-2e63676f.js.map} +0 -0
  93. /package/dist/nano-components/{p-8a79a7ca.entry.js.map → p-30cc21c2.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components/table/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Host,\n Watch,\n State,\n readTask,\n Event,\n EventEmitter,\n Method,\n Build,\n} from '@stencil/core';\nimport { cyrb53 } from '../../utils/math';\nimport { debounce } from '../../utils/throttle';\nimport {\n NanoResizeObserveCustomEvent,\n ResizeStateChangeEventDetail,\n TableTypes,\n} from '../../interface';\nimport { TableColHead } from './table.header';\nimport { TableRow, TableHeadFootRow } from './table.row';\nimport { TableCell } from './table.cell';\nimport { CSSNAMESPACE } from './table.constants';\nimport {\n generateStore,\n storeSearch,\n storeSetConfig,\n storeSetData,\n storeSort,\n storeFilter,\n TableStores,\n} from './table.store';\nimport { findScrollParent, isInViewport } from './table.utils';\n\nconst measurePerf = false;\n\nfunction perMark(name: string, end: boolean = false) {\n if (!Build.isDev || Build.isTesting || !performance || !measurePerf) return;\n if (end) {\n performance?.mark('end' + name);\n performance?.measure(name, 'start' + name, 'end' + name);\n const entries = performance?.getEntriesByName(name);\n console.log(entries[entries.length ? entries.length - 1 : 0]);\n } else {\n performance?.mark('start' + name);\n }\n}\n\nlet id = 0;\n/**\n * A performant, accessible and semantic (uses real html `<table />`, `<tr />` etc) table and data-grid solution.\n *\n *- Built-in search\n *- Built-in column filter\n *- Built-in column sort\n *- Easily swap in API / async based search / filter & sort\n *- Pin headers, footers, rows, columns\n *- Add custom rendering at every level\n *- Add custom properties at every level\n *\n * @slot caption - The table's caption. You must either use this or the `caption` attribute.\n * @slot no-results - text to display when search or filtering yields no results\n */\n@Component({\n tag: 'nano-table',\n styleUrl: 'table.scss',\n})\nexport class Table implements ComponentInterface {\n constructor() {\n this.debounceSetLoading = debounce(this.debounceSetLoading.bind(this), 50);\n }\n // Public API\n\n // Props\n\n @Prop() jsxRenderer: TableTypes.HFunc<any>;\n\n /** The type of table. Grid type will make cells navigable by keyboard */\n @Prop() type: 'grid' | 'table' = 'table';\n\n /** A descriptive title of the table.\n * You must use this or the `slot=\"caption\"` for accessibility */\n @Prop() caption: string;\n\n /** Show the caption on-screen */\n @Prop() showCaption: boolean = false;\n\n /** Will show a loading state when set to true.\n * By default, will be shown automatically if `rows` is a promise waiting to resolve\n * or when performing custom filtering or sorting.\n * *Note* when set manually, will overwrite any internal loading state.\n * Set to 'undefined' to revert to default behaviour. */\n @Prop() loading: boolean = undefined;\n\n get _loading() {\n return this.loading !== undefined ? this.loading : this.internalLoading;\n }\n set _loading(l: boolean) {\n if (this.loading !== undefined) return;\n this.debounceSetLoading(l);\n }\n private debounceSetLoading(l: boolean) {\n this.internalLoading = l;\n }\n @State() internalLoading = false;\n\n /** When loading rows asynchronously, this will render this number of placeholder rows */\n @Prop() placeholderSize = 5;\n\n /** The data to place in the table */\n @Prop({ mutable: true }) rows:\n | TableTypes.NanoTable['rows']\n | Promise<TableTypes.NanoTable['rows']>;\n\n @Watch('rows')\n handleRowsChange() {\n if (!this.rows) {\n this._loading = true;\n return;\n }\n\n this._loading = true;\n Promise.resolve(this.rows).then(async (rows) => {\n await storeSetData(this.host, rows);\n\n // reset everything\n this.currentFilters = '';\n this.currentSort = '';\n await this.columnInit();\n\n if (!this.isReady)\n requestAnimationFrame(() => this.setInitialBlockDimension());\n this._loading = false;\n });\n }\n\n /** The column config used to present the rows of data */\n @Prop({ mutable: true }) columns: TableTypes.NanoTable<any>['columns'] = [];\n\n @Watch('columns')\n async handleColsChange() {\n await storeSetConfig(this.host, this.columns);\n if (this.isReady) this.columnInit();\n }\n\n /** Used for custom thead row rendering */\n @Prop() headRender: TableTypes.HeadFootRenderer = { pinned: 'top' };\n\n /** Used for custom row rendering */\n @Prop() rowRender: TableTypes.RowRenderer;\n\n /** Used for custom tfoot row rendering */\n @Prop() footRender: TableTypes.HeadFootRenderer = { pinned: 'bottom' };\n\n /** Whether to show a `<tfoot>` component */\n @Prop() showFooter = false;\n\n /** To improve performance, data is split into blocks\n * which are shown / hidden and rendered as they become visible.\n * Use this to control the number of hits within a block -\n * A block should fill a scrolling viewport.\n * The less perBlock the better for performance */\n @Prop() perBlock = 40;\n\n /** The number of total blocks currently rendered in the table. @readonly */\n @Prop()\n get blocksLength() {\n return this.blocks.length;\n }\n\n /** Term to search for in the data */\n @Prop() searchTerm: string;\n\n /** A custom filtering function. Should return a promise.\n * If the promise resolves as `true` the column UI will be updated.\n * If the promise resolves as falsey, the sort will be performed by the component.\n * A good use-case would be performing the filter on a server / via fetch.\n * Then on success, updating the table's data via the `rows` property */\n @Prop() customFilterFn?: (\n filters: TableTypes.Filter[]\n ) => Promise<true | TableTypes.Falsy>;\n\n /** A custom sorting function. Should return a promise.\n * If the promise resolves as `true` the column UI will be updated.\n * If the promise resolves as falsey, the sort will be performed by the component.\n * A good use-case would be performing the sort on a server / via fetch.\n * Then on success, updating the table's data via the `rows` property */\n @Prop() customSortFn?: (\n property: TableTypes.Prop,\n order: TableTypes.Order\n ) => Promise<true | TableTypes.Falsy>;\n\n /**\n * The default sortable option for all columns.\n * `true` will enable column sorting unless you set `sortable: false` on a column\n * `false` will disable column sorting unless you set `sortable: true` on a column\n */\n @Prop() defaultSort = true;\n\n @Watch('searchTerm')\n handleSearchTermChange() {\n this.searchStart();\n }\n\n /** Use this to render the table with roughly the correct dimensions.\n * a use-case might be; fetch a small initial dataset to minimise load-time,\n * render the table with the correct dimensions, the table becomes interactive,\n * load the rest of the data\n */\n @Prop() virtualTotalItems: number = 0;\n\n @Watch('virtualTotalItems')\n virtualTotalItemsChangeHandler() {\n this.setBlocks();\n }\n\n /** Fired when the table has done it's first complete render */\n @Event() nanoTblReady: EventEmitter;\n\n /** Fired whenever a block is activated by scrolling into view / becoming visible\n * This could be leveraged for infinite scrolling / to fetch more data.\n */\n @Event() nanoTblBlockRendered: EventEmitter<{\n block: number;\n totalBlocks: number;\n }>;\n\n /** Fired before a column is sorted.\n * `event.preventDefault()` to stop sorting. */\n @Event() nanoTblBeforeSort: EventEmitter<{\n column: TableTypes.Prop;\n order: TableTypes.Order;\n }>;\n\n /** Fired after a column is sorted */\n @Event() nanoTblAfterSort: EventEmitter<{\n column: TableTypes.Prop;\n order: TableTypes.Order;\n }>;\n\n /** Fired before a column is filtered.\n * `event.preventDefault()` to stop filtering. */\n @Event() nanoTblBeforeFilter: EventEmitter<{ filters: TableTypes.Filter[] }>;\n\n /** Fired after a column is sorted */\n @Event() nanoTblAfterFilter: EventEmitter<{ filters: TableTypes.Filter[] }>;\n\n /** Fired before a general search.\n * `event.preventDefault()` to stop searching. */\n @Event() nanoTblBeforeSearch: EventEmitter<{ term: string }>;\n\n /** Fired after a general / cross column search */\n @Event() nanoTblAfterSearch: EventEmitter<{ term: string }>;\n\n /** Fired before a general search.\n * `event.preventDefault()` to stop searching. */\n @Event() nanoTblBeforeEdit: EventEmitter<{ term: string }>;\n\n /** Remove any column sorts currently applied\n * @returns a promise which resolves when complete */\n @Method()\n async resetSorting() {\n const col = (this.columns as TableTypes.NanoTable['columns']).find(\n (c) => !!c.order\n );\n if (!col) return;\n return this.sortStart(null, col.prop);\n }\n\n /** Apply a sort on a column\n * @returns a promise which resolves when complete */\n @Method()\n async addSort(column: TableTypes.Prop, order: TableTypes.Order) {\n const col = (this.columns as TableTypes.NanoTable['columns']).find(\n (c) => c.prop === column\n );\n if (!col) throw 'Cannot find column with ' + column;\n return this.sortStart(order, col.prop);\n }\n\n /** Remove any column filters currently applied\n * @returns a promise which resolves when complete */\n @Method()\n async resetFilters() {\n this.filters = [];\n return this.filterStart();\n }\n\n /** Apply a filter on a column\n * @param filters - the filters to apply\n * @param additive - if true, will add the filters to any currently applied\n * @returns a promise which resolves when complete\n */\n @Method()\n async addFilters(filters: TableTypes.Filter[], additive: boolean = true) {\n if (!additive) this.filters = [];\n return this.filterStart(filters, additive);\n }\n\n /** Remove filters from a column\n * @param columnNames - the filters to apply\n * @returns a promise which resolves when complete\n */\n @Method()\n async removeFilters(columnNames: TableTypes.Prop[]) {\n this.filters = this.filters.filter((f) => !columnNames.includes(f.prop));\n return this.filterStart();\n }\n\n /** Updates a row model at a given index\n * @param row - the row to update.\n * *Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property\n * - rows are augmented with certain properties to aid with efficient rendering\n * @param rowIndex - the row index to insert this row\n */\n @Method()\n async updateRow(row: TableTypes.RowData, rowIndex: number) {\n (this.rows as TableTypes.NanoTable['rows']).splice(rowIndex, 1, row);\n this.handleRowsChange();\n }\n\n // TODO.\n // change this.rows to be a Map instead?\n // this will allow 'padding' < inserting row data at a non-adjacent index\n\n // /**\n // * During pagination or infinite scroll\n // * you may not always want to load data in serial order.\n // * This method allows you to insert a block of results at a particular index.\n // * Use in-conjunction with `virtualTotalItems`\n // * @param blockIndex - where to insert\n // * @param rows - what to insert\n // */\n // @Method()\n // async insertBlock(blockIndex: number, rows: TableTypes.NanoTable['rows']) {\n // this.pauseAutoBlockAssign = true;\n // const cRows = (this.rows as TableTypes.NanoTable['rows']);\n\n // if (cRows.length < (blockIndex * this.perBlock)) {\n // (this.rows as TableTypes.NanoTable['rows'])\n // }\n\n // (this.rows as TableTypes.NanoTable['rows']).splice((blockIndex * this.perBlock)-1, 0, ...rows);\n\n // console.log(this.rows)\n // debugger;\n\n // await this.handleRowsChange(this.rows);\n // this.blocks[blockIndex] = {rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join())};\n // this.blocks = this.blocks;\n // this.pauseAutoBlockAssign = true;\n\n // console.log(this.rows, this.blocks)\n // }\n\n // Private State\n\n @Element() host: HTMLNanoTableElement;\n private renderId = 'tbl-' + id++;\n private store: TableStores;\n private filters: TableTypes.Filter[] = [];\n private currentFilters = '[]';\n private currentSort = '';\n private tableEle: HTMLTableElement;\n private topAnchorEle: HTMLElement;\n private tableWrapperEle: HTMLElement;\n private cacheScrollPosition: number = 0;\n private activeWatcherIo: IntersectionObserver;\n\n // Block view management\n\n /** `tr` elements split into units - defined by `perBlock`\n These are show / hidden for perf */\n @State() blocks: TableTypes.TBody[] = [];\n @State() activeBlocks: number[] = [0, 1, 2];\n\n private measureHeight = 0;\n private blockElements: HTMLTableSectionElement[];\n private blockHeights: { blockIndex: number; height: number }[] = [];\n\n // uses the first 'tr' of an active block as our yard stick\n private set measureEle(el: HTMLTableSectionElement) {\n if (!el) return;\n const potentialHeight = el.getBoundingClientRect().height;\n this.measureHeight =\n Math.abs(this.measureHeight - potentialHeight) < 5\n ? this.measureHeight\n : potentialHeight;\n this.unitHeight =\n el.querySelector('tr')?.getBoundingClientRect().height || this.unitHeight;\n }\n\n private unitHeight = 0;\n\n private get scrollParent() {\n return this._scrollParent;\n }\n\n private set scrollParent(ele: HTMLElement) {\n if (ele === this._scrollParent) return;\n\n if (this._scrollParent) {\n (this._scrollParent === document.documentElement\n ? document\n : this._scrollParent\n ).removeEventListener('scroll', this.scrollHandler);\n }\n (ele === document.documentElement ? document : ele).addEventListener(\n 'scroll',\n this.scrollHandler\n );\n this._scrollParent = ele;\n }\n\n private _scrollParent: HTMLElement;\n\n // used to fire `nanoTblBlockRendered` on block render change\n private get primaryBlockIndex() {\n return this._primaryBlockIndex;\n }\n\n private set primaryBlockIndex(blockIndex) {\n if (this._primaryBlockIndex === blockIndex) return;\n\n this._primaryBlockIndex = blockIndex;\n\n // fire block change event\n this.nanoTblBlockRendered.emit({\n block: blockIndex,\n totalBlocks: this.blockElements.length,\n });\n }\n\n private _primaryBlockIndex;\n\n // Misc.\n\n private get isReady() {\n return this._isReady;\n }\n private set isReady(ready: boolean) {\n if (ready === this._isReady) return;\n this._isReady = ready;\n if (this.isReady) requestAnimationFrame(() => this.handleReady());\n }\n private _isReady = false;\n\n // Private Logic\n\n // Listeners\n\n private handleReady() {\n const hash = window.location.hash;\n if (hash.length > 1) {\n try {\n const idRow = document.querySelector(hash);\n if (idRow) idRow.scrollIntoView();\n } catch (e) {}\n }\n this.nanoTblReady.emit();\n }\n\n /**\n * Start a sort - can be cancelled by `preventDefault`\n * @param order - column order\n * @param column - column config object\n * @returns A promise\n */\n private sortStart = async (\n order: TableTypes.Order,\n column: TableTypes.Prop,\n element?: HTMLElement\n ) => {\n // did order change?\n if (this.currentSort === order + ':' + column) return;\n\n this._loading = true;\n const sortEvent = this.nanoTblBeforeSort.emit({ column: column, order });\n if (sortEvent.defaultPrevented) return;\n perMark('sort');\n this.currentSort = order + ':' + column;\n\n // doesn't make sense to leave user in place for a sort\n this.scrollToTop(element);\n\n if (this.customSortFn) {\n try {\n const res = await this.customSortFn(column, order);\n\n // if the response is 'true', the custom sort did it's thing\n // handover to finish and stop loading state.\n // if response is falsey, carry on to do a FE sort\n if (res === true) {\n this.sortComplete(order, column);\n this._loading = false;\n return;\n }\n } catch (e) {\n // if response errored, stop loading state\n // clear current sort cache\n console.warn('custom sort failed', e);\n this.currentSort = '';\n this._loading = false;\n return;\n }\n }\n\n try {\n await storeSort(this.host, column, order);\n this.sortComplete(order, column);\n } catch (e) {\n console.warn('sort failed', e);\n this.currentSort = '';\n } finally {\n if (this.blocks.length) this._loading = false;\n }\n };\n\n /**\n * Complete a sort. Reflects the order to ui.\n * @param order - column order\n * @param column - column config object\n */\n private sortComplete(order: TableTypes.Order, column: TableTypes.Prop) {\n this.columns = this.columns.map((c) => {\n if (c.prop === column) return { ...c, order };\n return { ...c, order: null };\n });\n this.nanoTblAfterSort.emit({ column: column, order });\n perMark('sort', true);\n }\n\n private async searchStart() {\n this._loading = true;\n const sortEvent = this.nanoTblBeforeSearch.emit({ term: this.searchTerm });\n if (sortEvent.defaultPrevented) return;\n perMark('search');\n\n // doesn't make sense to leave user in place for a search\n this.scrollToTop();\n\n try {\n await storeSearch(this.host, this.searchTerm);\n this.nanoTblAfterSearch.emit({ term: this.searchTerm });\n perMark('search', true);\n } catch (e) {\n console.warn('search failed', e);\n } finally {\n this._loading = false;\n }\n }\n\n private async filterStart(\n filters?: TableTypes.Filter[],\n additive: boolean = true\n ) {\n if (filters) {\n if (additive) {\n this.filters = [\n ...this.filters.filter(\n (f) => !filters.find((ff) => ff.prop === f.prop)\n ),\n ...filters,\n ];\n } else {\n this.filters = filters;\n }\n }\n\n if (this.currentFilters === JSON.stringify(this.filters)) return;\n\n this._loading = true;\n const sortEvent = this.nanoTblBeforeFilter.emit({ filters: this.filters });\n if (sortEvent.defaultPrevented) return;\n perMark('filter');\n this.currentFilters = JSON.stringify(this.filters);\n\n // doesn't make sense to leave user in place for a search\n this.scrollToTop();\n\n if (this.customFilterFn) {\n try {\n const res = await this.customFilterFn(this.filters);\n\n // if the response is 'true', the custom filter did it's thing\n // handover to finish and stop loading state.\n // if response is falsey, carry on to do a FE filter\n if (res === true) {\n this.filterComplete();\n this._loading = false;\n }\n } catch (e) {\n // if response errored, stop loading state\n // clear current sort cache\n console.warn('custom filter failed', e);\n this.currentFilters = '';\n this._loading = false;\n }\n return;\n }\n\n try {\n await storeFilter(this.host, this.filters);\n this.filterComplete();\n } catch (e) {\n console.warn('filter failed', e);\n } finally {\n this._loading = false;\n }\n }\n\n private filterComplete() {\n this.columns = this.columns.map((c) => {\n const cFilter = this.filters.find((f) => f.prop === c.prop);\n if (cFilter) c.filter = cFilter.filter;\n else if (c.filter !== null && c.filter !== undefined)\n c.filter = undefined;\n\n return c;\n });\n this.nanoTblAfterFilter.emit({ filters: this.filters });\n perMark('filter', true);\n }\n\n /** Scrolls to the top immediately - used whilst sorting / filtering */\n private scrollToTop(element?: HTMLElement) {\n const scrollBehaviour = this.scrollParent.style?.scrollBehavior;\n const scrollX = this.scrollParent.scrollLeft;\n this.scrollParent.style.scrollBehavior = 'auto';\n\n if (this.topAnchorEle && !isInViewport(this.topAnchorEle, 0.1)) {\n this.host.scrollIntoView();\n }\n if (element && !isInViewport(element, 1))\n setTimeout(() => element.scrollIntoView({ block: 'start' }), 500);\n\n if (scrollX) this.scrollParent.scrollLeft = scrollX;\n\n if (scrollBehaviour)\n this.scrollParent.style.scrollBehavior = scrollBehaviour;\n\n this.scrollHandler();\n }\n\n private setMeasureElement(): Promise<void> {\n return new Promise((resolve) => {\n readTask(() => {\n this.measureEle = this.blockElements.find(\n (b) => !b?.classList?.contains(`${CSSNAMESPACE}__inactive`)\n );\n resolve();\n });\n });\n }\n\n /**\n * Makes sure we have dimensions on at least one, active tbody element.\n * We'll use this is a yard stick for inactive tbody elements in future.\n * These elements have no natural height (on account of all their rows being hidden)\n */\n private setInitialBlockDimension() {\n if (!this.blockElements?.length) return;\n perMark('blockDims');\n\n const testForDimensions = async () => {\n await this.setMeasureElement();\n if (this.unitHeight) return true;\n return false;\n };\n\n const dimensionsReady: Promise<void> = new Promise(async (resolve) => {\n if (await testForDimensions()) resolve();\n else {\n // it's likely this table is hidden in the dom.\n // we need to wait until it's visible\n const observer = new IntersectionObserver(\n async () => {\n if (await testForDimensions()) {\n resolve();\n observer.disconnect();\n }\n },\n { root: this.scrollParent }\n );\n observer.observe(this.tableEle);\n }\n });\n\n // we're all finished.\n dimensionsReady.then(() => {\n perMark('blockDims', true);\n perMark('init', true);\n requestAnimationFrame(() => (this.isReady = true));\n });\n }\n\n /** Apply initial columns settings */\n private async columnInit() {\n this.filters = (this.columns as TableTypes.NanoTable['columns'])\n .filter((c) => c.filter !== undefined && c.filter !== null)\n .map((c) => {\n const { filter, prop } = c;\n return { filter, prop };\n });\n\n if (this.searchTerm) {\n await this.searchStart();\n }\n\n if (this.filters.length) {\n await this.filterStart();\n }\n // apply sort\n const col = (this.columns as TableTypes.NanoTable['columns']).find(\n (c) => !!c.order\n );\n if (!!col) {\n await this.sortStart(col.order, col.prop);\n }\n }\n\n /** Split up all incoming rows into 'blocks' split amongst tbody elements.\n * These can then be hidden / shown to improve performance.\n */\n private setBlocks() {\n const dRows = this.store.data.state.rows;\n if (!dRows.length) {\n this.blocks = [];\n return;\n }\n\n perMark('setBlocks');\n // this.ignoreIO = true;\n let i = 1;\n const l =\n this.virtualTotalItems > dRows.length\n ? this.virtualTotalItems\n : dRows.length;\n let rows: TableTypes.RowData[] = [];\n const blocks: TableTypes.TBody[] = [];\n\n // old skool loop for perf\n for (i; i <= l; i++) {\n rows.push(this.store.data.state.rows[i - 1] || { __uuid: '' });\n\n if (i % this.perBlock === 0) {\n // assign a UUID for the whole block\n // for block diffing\n blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });\n rows = [];\n }\n }\n\n // any leftover rows\n if (rows.length) {\n blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });\n }\n\n this.blocks = blocks;\n perMark('setBlocks', true);\n }\n\n /**\n * Returns a block render height.\n * If it's currently active - let auto do it's thing\n * If we've rendered it before - return that\n * If all else fails, let's guess it\n * @param blockIndex\n * @returns a height string (incl px)\n */\n private getBlockHeight(blockIndex: number): number {\n if (this.blockHeights.length) {\n const cachedBlockHeight = this.blockHeights.find(\n (bh) => bh.blockIndex === blockIndex\n );\n if (cachedBlockHeight) return cachedBlockHeight.height;\n }\n const blockLength = this.blocks[blockIndex].rows.length;\n if (blockLength === this.perBlock && this.measureHeight) {\n return this.measureHeight;\n }\n return this.unitHeight ? this.unitHeight * blockLength : undefined;\n }\n\n /** cache the height for all active blocks for later renders */\n private setBlockHeight() {\n this.activeBlocks.forEach((blockIndex) => {\n const el = this.blockElements[blockIndex];\n if (!el) return;\n readTask(() => {\n if (el.classList.contains(`${CSSNAMESPACE}__inactive`)) return;\n\n const height = el.getBoundingClientRect().height;\n // cache height to our block heights array\n // for subsequent renders\n const fBhIdx = this.blockHeights.findIndex(\n (bh) => bh.blockIndex === blockIndex\n );\n if (fBhIdx > -1) {\n this.blockHeights[fBhIdx] = { height, blockIndex };\n } else this.blockHeights.push({ height, blockIndex });\n });\n });\n }\n\n /**\n * On scroll, loop through all blocks' heights and cumulatively, add them together.\n * When we find that the scroll position is less than this cumulative block height -\n * stop loop - it's on the current active block.\n */\n private scrollHandler = () => {\n // don't listen if this table isn't in the viewport\n if (!this.store.general.state.isActive) return;\n\n readTask(() => {\n this.cacheScrollPosition = this.scrollParent.scrollTop || window.scrollY;\n let cumulativeHeight = this.host.offsetTop;\n let blockIndex = 0;\n const blockLen = this.blocks.length;\n\n while (\n blockIndex < blockLen &&\n this.cacheScrollPosition >= cumulativeHeight\n ) {\n cumulativeHeight += this.getBlockHeight(blockIndex);\n\n if (this.cacheScrollPosition < cumulativeHeight) {\n const potentialBlocks = [\n blockIndex,\n blockIndex + 1,\n Math.max(0, blockIndex - 1),\n ];\n if (potentialBlocks.toString() !== this.activeBlocks.toString()) {\n this.activeBlocks = potentialBlocks;\n this.setBlockHeight();\n }\n this.primaryBlockIndex = blockIndex;\n }\n blockIndex++;\n }\n });\n };\n\n /** Process slotted content */\n private processSlots() {\n // see if we have slot content\n if (!this.caption && !this.host.querySelector('[slot=\"caption\"]')) {\n console.error(\n 'For accessibility you must set a `caption` prop or use the `caption` slot'\n );\n }\n }\n\n private handleColumnPinned = (positions: {\n [key in TableTypes.Position]: boolean;\n }) => {\n Object.entries(positions).forEach(([key, applied]) => {\n this.tableEle.classList.toggle(\n `${CSSNAMESPACE}__pinned--${key}`,\n applied\n );\n });\n };\n\n private handleResizeChange = (\n e: NanoResizeObserveCustomEvent<ResizeStateChangeEventDetail>\n ) => {\n this.tableWrapperEle.className = '';\n\n let classes: string[] = [`${CSSNAMESPACE}__wrap`];\n if (e.target?.className)\n classes = [...e.target.className.split(' '), ...classes];\n\n this.tableWrapperEle.classList.add(...classes.filter((cl) => !!cl));\n };\n\n /** Adds an IO. Makes sure our scroll listener is only active when\n * the table is in viewport */\n private setupActiveWatcher() {\n if (!this.host || !this.scrollParent || !this.store) return;\n\n if (this.activeWatcherIo) {\n this.activeWatcherIo.disconnect();\n this.activeWatcherIo = undefined;\n }\n const io = (this.activeWatcherIo = new IntersectionObserver(\n async ([e]) => {\n if (e.isIntersecting) this.store.general.state.isActive = true;\n else this.store.general.state.isActive = false;\n },\n { root: this.scrollParent, threshold: 0 }\n ));\n io.observe(this.host);\n }\n\n // Component lifecycle\n\n async componentWillLoad() {\n perMark('init');\n // setup stores\n this.store = await generateStore(\n this.host,\n this.columns,\n this.scrollParent,\n this.isReady\n );\n await this.handleRowsChange();\n this.store.general.onChange('isActive', this.scrollHandler);\n this.store.data.onChange('rows', () => this.setBlocks());\n\n // setup dom and attach listeners\n this.processSlots();\n this.setBlocks();\n this.scrollParent = findScrollParent(this.host);\n this.setupActiveWatcher();\n }\n\n connectedCallback(): void {\n this.scrollParent = findScrollParent(this.host);\n this.setupActiveWatcher();\n }\n\n componentDidLoad(): void {\n this.setInitialBlockDimension();\n }\n\n componentShouldUpdate(_newVal, _oldVal, stateName: keyof Table) {\n // stop double rendering - we use the store for rendering internally\n // the public facing props are kept in-sync with the store\n // but we don't want it to cause renders\n if (['rows', 'columns'].includes(stateName)) return false;\n\n if (Build.isDev && !Build.isTesting && measurePerf)\n console.log(stateName, _newVal, _oldVal);\n }\n\n componentWillRender(): void | Promise<void> {\n perMark('render');\n }\n\n componentDidRender(): void {\n this.setMeasureElement();\n perMark('render', true);\n }\n\n disconnectedCallback(): void {\n if (!this.activeWatcherIo) return;\n this.activeWatcherIo.disconnect();\n this.activeWatcherIo = undefined;\n\n (this.scrollParent === document.documentElement\n ? document\n : this.scrollParent\n ).removeEventListener('scroll', this.scrollHandler);\n }\n\n render() {\n this.blockElements = [];\n\n return (\n <Host>\n <div\n class={`${CSSNAMESPACE}__top-anchor`}\n ref={(a) => (this.topAnchorEle = a)}\n >\n &nbsp;\n </div>\n\n <nano-resize-observe\n states=\"576w sm, 768w md\"\n class=\"sm md\"\n onNanoResizeStateChange={this.handleResizeChange}\n ></nano-resize-observe>\n\n <div\n class={`${CSSNAMESPACE}__wrap sm md`}\n ref={(div) => (this.tableWrapperEle = div)}\n aria-labelledby={'table-caption-' + this.renderId}\n tabindex={this.type === 'grid' ? '0' : undefined}\n >\n <nano-progress-bar\n indeterminate\n class={{\n [`${CSSNAMESPACE}__progress-bar`]: true,\n [`${CSSNAMESPACE}__progress-bar--show`]: this._loading,\n }}\n />\n <table\n role={this.type === 'grid' ? 'grid' : undefined}\n aria-rowcount={this.store.data.state.rows.length}\n aria-colcount={this.store.config.state.columns.length}\n class={`${CSSNAMESPACE}`}\n ref={(tbl) => (this.tableEle = tbl)}\n >\n <caption\n class={{\n [`${CSSNAMESPACE}__caption`]: true,\n [`${CSSNAMESPACE}__caption--hide`]: !this.showCaption,\n }}\n id={'table-caption-' + this.renderId}\n >\n <slot name=\"caption\">{this.caption}</slot>\n </caption>\n\n {/* Header */}\n <thead>\n <TableHeadFootRow\n rowRenderer={this.headRender}\n onColumnPinned={this.handleColumnPinned}\n >\n {this.store.config.state.columns.map((colModel) => [\n <TableColHead\n column={colModel}\n headRenderer={this.headRender}\n onColumnSortClick={this.sortStart}\n onColumnPinned={this.handleColumnPinned}\n defaults={{\n sortable: this.defaultSort,\n }}\n />,\n ])}\n </TableHeadFootRow>\n </thead>\n\n {this._loading && !this.blocks.length && (\n <tbody class={`${CSSNAMESPACE}__active`}>\n {[...Array(10).keys()].map((rowIndex) => (\n <tr>\n {this.store.config.state.columns.map(\n (_colModel, colIndex) => (\n <TableCell\n rowIndex={rowIndex}\n colIndex={colIndex}\n nestedContent={() => <nano-skeleton />}\n />\n )\n )}\n </tr>\n ))}\n </tbody>\n )}\n\n <tr hidden={!!this._loading || !!this.blocks.length}>\n <th\n class={`${CSSNAMESPACE}__th`}\n colSpan={this.store.config.state.columns.length}\n >\n <div class=\"nano-tbl__cell-content nano-tbl__cell-content--no-result\">\n <slot name=\"no-results\">No results found</slot>\n </div>\n </th>\n </tr>\n\n {/* Body */}\n {this.blocks.map((block, blockIndex) => (\n <tbody\n key={block.__uuid}\n id={`tbody-${this.renderId}-${blockIndex}`}\n ref={(tb) => {\n this.blockElements.push(tb);\n }}\n class={{\n [`${CSSNAMESPACE}__inactive`]:\n !this.activeBlocks.includes(blockIndex),\n [`${CSSNAMESPACE}__active`]:\n this.activeBlocks.includes(blockIndex),\n }}\n >\n {this.activeBlocks.includes(blockIndex) ? (\n block.rows.map((row, i) => {\n const rowIndex =\n blockIndex > 0 ? blockIndex * this.perBlock + i : i;\n return (\n <TableRow\n rowRenderer={this.rowRender}\n rowModel={row}\n rowIndex={rowIndex}\n >\n {this.store.config.state.columns.map(\n (_colModel, colIndex) => (\n <TableCell\n rowIndex={rowIndex}\n colIndex={colIndex}\n />\n )\n )}\n </TableRow>\n );\n })\n ) : (\n <tr>\n <td\n colSpan={this.store.config.state.columns.length}\n style={{\n height: this.getBlockHeight(blockIndex) + 'px',\n }}\n />\n </tr>\n )}\n </tbody>\n ))}\n\n {/* Footer */}\n {this.showFooter && (\n <tfoot>\n <TableHeadFootRow\n rowRenderer={this.footRender}\n onColumnPinned={this.handleColumnPinned}\n >\n {this.store.config.state.columns.map((colModel) => [\n <TableColHead\n column={colModel}\n headRenderer={this.footRender}\n onColumnPinned={this.handleColumnPinned}\n onColumnSortClick={this.sortStart}\n defaults={{\n sortable: this.defaultSort,\n }}\n />,\n ])}\n </TableHeadFootRow>\n </tfoot>\n )}\n </table>\n\n {!!this.blocks.length && (\n <nano-spinner\n type=\"circle\"\n class={{\n [`${CSSNAMESPACE}__spinner`]: true,\n [`${CSSNAMESPACE}__spinner--show`]: this._loading,\n }}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Host,\n Watch,\n State,\n readTask,\n Event,\n EventEmitter,\n Method,\n Build,\n} from '@stencil/core';\nimport { cyrb53 } from '../../utils/math';\nimport { debounce } from '../../utils/throttle';\nimport {\n NanoResizeObserveCustomEvent,\n ResizeStateChangeEventDetail,\n TableTypes,\n} from '../../interface';\nimport { TableColHead } from './table.header';\nimport { TableRow, TableHeadFootRow } from './table.row';\nimport { TableCell } from './table.cell';\nimport { CSSNAMESPACE } from './table.constants';\nimport {\n generateStore,\n storeSearch,\n storeSetConfig,\n storeSetData,\n storeSort,\n storeFilter,\n TableStores,\n} from './table.store';\nimport { findScrollParent, isInViewport } from './table.utils';\n\nconst measurePerf = false;\n\nfunction perMark(name: string, end: boolean = false) {\n if (!Build.isDev || Build.isTesting || !performance || !measurePerf) return;\n if (end) {\n performance?.mark('end' + name);\n performance?.measure(name, 'start' + name, 'end' + name);\n const entries = performance?.getEntriesByName(name);\n console.log(entries[entries.length ? entries.length - 1 : 0]);\n } else {\n performance?.mark('start' + name);\n }\n}\n\nlet id = 0;\n/**\n * A performant, accessible and semantic (uses real html `<table />`, `<tr />` etc) table and data-grid solution.\n *\n *- Built-in search\n *- Built-in column filter\n *- Built-in column sort\n *- Easily swap in API / async based search / filter & sort\n *- Pin headers, footers, rows, columns\n *- Add custom rendering at every level\n *- Add custom properties at every level\n *\n * @slot caption - The table's caption. You must either use this or the `caption` attribute.\n * @slot no-results - text to display when search or filtering yields no results\n */\n@Component({\n tag: 'nano-table',\n styleUrl: 'table.scss',\n})\nexport class Table implements ComponentInterface {\n constructor() {\n this.debounceSetLoading = debounce(this.debounceSetLoading.bind(this), 50);\n }\n // Public API\n\n // Props\n\n @Prop() jsxRenderer: TableTypes.HFunc<any>;\n\n /** The type of table. Grid type will make cells navigable by keyboard */\n @Prop() type: 'grid' | 'table' = 'table';\n\n /** A descriptive title of the table.\n * You must use this or the `slot=\"caption\"` for accessibility */\n @Prop() caption: string;\n\n /** Show the caption on-screen */\n @Prop() showCaption: boolean = false;\n\n /** Will show a loading state when set to true.\n * By default, will be shown automatically if `rows` is a promise waiting to resolve\n * or when performing custom filtering or sorting.\n * *Note* when set manually, will overwrite any internal loading state.\n * Set to 'undefined' to revert to default behaviour. */\n @Prop() loading: boolean = undefined;\n\n get _loading() {\n return this.loading !== undefined ? this.loading : this.internalLoading;\n }\n set _loading(l: boolean) {\n if (this.loading !== undefined) return;\n this.debounceSetLoading(l);\n }\n private debounceSetLoading(l: boolean) {\n this.internalLoading = l;\n }\n @State() internalLoading = false;\n\n /** When loading rows asynchronously, this will render this number of placeholder rows */\n @Prop() placeholderSize = 5;\n\n /** The data to place in the table */\n @Prop({ mutable: true }) rows:\n | TableTypes.NanoTable['rows']\n | Promise<TableTypes.NanoTable['rows']>;\n\n @Watch('rows')\n handleRowsChange() {\n if (!this.rows) {\n this._loading = true;\n return;\n }\n\n this._loading = true;\n Promise.resolve(this.rows).then(async (rows) => {\n await storeSetData(this.host, rows);\n\n // reset everything\n this.currentFilters = '';\n this.currentSort = '';\n await this.columnInit();\n\n if (!this.isReady)\n requestAnimationFrame(() => this.setInitialBlockDimension());\n this._loading = false;\n });\n }\n\n /** The column config used to present the rows of data */\n @Prop({ mutable: true }) columns: TableTypes.NanoTable<any>['columns'] = [];\n\n @Watch('columns')\n async handleColsChange() {\n await storeSetConfig(this.host, this.columns);\n if (this.isReady) this.columnInit();\n }\n\n /** Used for custom thead row rendering */\n @Prop() headRender: TableTypes.HeadFootRenderer = { pinned: 'top' };\n\n /** Used for custom row rendering */\n @Prop() rowRender: TableTypes.RowRenderer;\n\n /** Used for custom tfoot row rendering */\n @Prop() footRender: TableTypes.HeadFootRenderer = { pinned: 'bottom' };\n\n /** Whether to show a `<tfoot>` component */\n @Prop() showFooter = false;\n\n /** To improve performance, data is split into blocks\n * which are shown / hidden and rendered as they become visible.\n * Use this to control the number of hits within a block -\n * A block should fill a scrolling viewport.\n * The less perBlock the better for performance */\n @Prop() perBlock = 40;\n\n /** The number of total blocks currently rendered in the table. @readonly */\n @Prop()\n get blocksLength() {\n return this.blocks.length;\n }\n\n /** Term to search for in the data */\n @Prop() searchTerm: string;\n\n /** A custom filtering function. Should return a promise.\n * If the promise resolves as `true` the column UI will be updated.\n * If the promise resolves as falsey, the sort will be performed by the component.\n * A good use-case would be performing the filter on a server / via fetch.\n * Then on success, updating the table's data via the `rows` property */\n @Prop() customFilterFn?: (\n filters: TableTypes.Filter[]\n ) => Promise<true | TableTypes.Falsy>;\n\n /** A custom sorting function. Should return a promise.\n * If the promise resolves as `true` the column UI will be updated.\n * If the promise resolves as falsey, the sort will be performed by the component.\n * A good use-case would be performing the sort on a server / via fetch.\n * Then on success, updating the table's data via the `rows` property */\n @Prop() customSortFn?: (\n property: TableTypes.Prop,\n order: TableTypes.Order\n ) => Promise<true | TableTypes.Falsy>;\n\n /**\n * The default sortable option for all columns.\n * `true` will enable column sorting unless you set `sortable: false` on a column\n * `false` will disable column sorting unless you set `sortable: true` on a column\n */\n @Prop() defaultSort = true;\n\n @Watch('searchTerm')\n handleSearchTermChange() {\n this.searchStart();\n }\n\n /** Use this to render the table with roughly the correct dimensions.\n * a use-case might be; fetch a small initial dataset to minimise load-time,\n * render the table with the correct dimensions, the table becomes interactive,\n * load the rest of the data\n */\n @Prop() virtualTotalItems: number = 0;\n\n @Watch('virtualTotalItems')\n virtualTotalItemsChangeHandler() {\n this.setBlocks();\n }\n\n /** Fired when the table has done it's first complete render */\n @Event() nanoTblReady: EventEmitter;\n\n /** Fired whenever a block is activated by scrolling into view / becoming visible\n * This could be leveraged for infinite scrolling / to fetch more data.\n */\n @Event() nanoTblBlockRendered: EventEmitter<{\n block: number;\n totalBlocks: number;\n }>;\n\n /** Fired before a column is sorted.\n * `event.preventDefault()` to stop sorting. */\n @Event() nanoTblBeforeSort: EventEmitter<{\n column: TableTypes.Prop;\n order: TableTypes.Order;\n }>;\n\n /** Fired after a column is sorted */\n @Event() nanoTblAfterSort: EventEmitter<{\n column: TableTypes.Prop;\n order: TableTypes.Order;\n }>;\n\n /** Fired before a column is filtered.\n * `event.preventDefault()` to stop filtering. */\n @Event() nanoTblBeforeFilter: EventEmitter<{ filters: TableTypes.Filter[] }>;\n\n /** Fired after a column is sorted */\n @Event() nanoTblAfterFilter: EventEmitter<{ filters: TableTypes.Filter[] }>;\n\n /** Fired before a general search.\n * `event.preventDefault()` to stop searching. */\n @Event() nanoTblBeforeSearch: EventEmitter<{ term: string }>;\n\n /** Fired after a general / cross column search */\n @Event() nanoTblAfterSearch: EventEmitter<{ term: string }>;\n\n /** Fired before a general search.\n * `event.preventDefault()` to stop searching. */\n @Event() nanoTblBeforeEdit: EventEmitter<{ term: string }>;\n\n /** Remove any column sorts currently applied\n * @returns a promise which resolves when complete */\n @Method()\n async resetSorting() {\n const col = (this.columns as TableTypes.NanoTable['columns']).find(\n (c) => !!c.order\n );\n if (!col) return;\n return this.sortStart(null, col.prop);\n }\n\n /** Apply a sort on a column\n * @returns a promise which resolves when complete */\n @Method()\n async addSort(column: TableTypes.Prop, order: TableTypes.Order) {\n const col = (this.columns as TableTypes.NanoTable['columns']).find(\n (c) => c.prop === column\n );\n if (!col) throw 'Cannot find column with ' + column;\n return this.sortStart(order, col.prop);\n }\n\n /** Remove any column filters currently applied\n * @returns a promise which resolves when complete */\n @Method()\n async resetFilters() {\n this.filters = [];\n return this.filterStart();\n }\n\n /** Apply a filter on a column\n * @param filters - the filters to apply\n * @param additive - if true, will add the filters to any currently applied\n * @returns a promise which resolves when complete\n */\n @Method()\n async addFilters(filters: TableTypes.Filter[], additive: boolean = true) {\n if (!additive) this.filters = [];\n return this.filterStart(filters, additive);\n }\n\n /** Remove filters from a column\n * @param columnNames - the filters to apply\n * @returns a promise which resolves when complete\n */\n @Method()\n async removeFilters(columnNames: TableTypes.Prop[]) {\n this.filters = this.filters.filter((f) => !columnNames.includes(f.prop));\n return this.filterStart();\n }\n\n /** Updates a row model at a given index\n * @param row - the row to update.\n * *Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property\n * - rows are augmented with certain properties to aid with efficient rendering\n * @param rowIndex - the row index to insert this row\n */\n @Method()\n async updateRow(row: TableTypes.RowData, rowIndex: number) {\n (this.rows as TableTypes.NanoTable['rows']).splice(rowIndex, 1, row);\n this.handleRowsChange();\n }\n\n // TODO.\n // change this.rows to be a Map instead?\n // this will allow 'padding' < inserting row data at a non-adjacent index\n\n // /**\n // * During pagination or infinite scroll\n // * you may not always want to load data in serial order.\n // * This method allows you to insert a block of results at a particular index.\n // * Use in-conjunction with `virtualTotalItems`\n // * @param blockIndex - where to insert\n // * @param rows - what to insert\n // */\n // @Method()\n // async insertBlock(blockIndex: number, rows: TableTypes.NanoTable['rows']) {\n // this.pauseAutoBlockAssign = true;\n // const cRows = (this.rows as TableTypes.NanoTable['rows']);\n\n // if (cRows.length < (blockIndex * this.perBlock)) {\n // (this.rows as TableTypes.NanoTable['rows'])\n // }\n\n // (this.rows as TableTypes.NanoTable['rows']).splice((blockIndex * this.perBlock)-1, 0, ...rows);\n\n // console.log(this.rows)\n // debugger;\n\n // await this.handleRowsChange(this.rows);\n // this.blocks[blockIndex] = {rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join())};\n // this.blocks = this.blocks;\n // this.pauseAutoBlockAssign = true;\n\n // console.log(this.rows, this.blocks)\n // }\n\n // Private State\n\n @Element() host: HTMLNanoTableElement;\n private renderId = 'tbl-' + id++;\n private store: TableStores;\n private filters: TableTypes.Filter[] = [];\n private currentFilters = '[]';\n private currentSort = '';\n private tableEle: HTMLTableElement;\n private topAnchorEle: HTMLElement;\n private tableWrapperEle: HTMLElement;\n private cacheScrollPosition: number = 0;\n private activeWatcherIo: IntersectionObserver;\n\n // Block view management\n\n /** `tr` elements split into units - defined by `perBlock`\n These are show / hidden for perf */\n @State() blocks: TableTypes.TBody[] = [];\n @State() activeBlocks: number[] = [0, 1, 2];\n\n private measureHeight = 0;\n private blockElements: HTMLTableSectionElement[];\n private blockHeights: { blockIndex: number; height: number }[] = [];\n\n // uses the first 'tr' of an active block as our yard stick\n private set measureEle(el: HTMLTableSectionElement) {\n if (!el) return;\n const potentialHeight = el.getBoundingClientRect().height;\n this.measureHeight =\n Math.abs(this.measureHeight - potentialHeight) < 5\n ? this.measureHeight\n : potentialHeight;\n this.unitHeight =\n el.querySelector('tr')?.getBoundingClientRect().height || this.unitHeight;\n }\n\n private unitHeight = 0;\n\n private get scrollParent() {\n return this._scrollParent;\n }\n\n private set scrollParent(ele: HTMLElement) {\n if (ele === this._scrollParent) return;\n\n if (this._scrollParent) {\n (this._scrollParent === document.documentElement\n ? document\n : this._scrollParent\n ).removeEventListener('scroll', this.scrollHandler);\n }\n (ele === document.documentElement ? document : ele).addEventListener(\n 'scroll',\n this.scrollHandler\n );\n this._scrollParent = ele;\n }\n\n private _scrollParent: HTMLElement;\n\n // used to fire `nanoTblBlockRendered` on block render change\n private get primaryBlockIndex() {\n return this._primaryBlockIndex;\n }\n\n private set primaryBlockIndex(blockIndex) {\n if (this._primaryBlockIndex === blockIndex) return;\n\n this._primaryBlockIndex = blockIndex;\n\n // fire block change event\n this.nanoTblBlockRendered.emit({\n block: blockIndex,\n totalBlocks: this.blockElements.length,\n });\n }\n\n private _primaryBlockIndex;\n\n // Misc.\n\n private get isReady() {\n return this._isReady;\n }\n private set isReady(ready: boolean) {\n if (ready === this._isReady) return;\n this._isReady = ready;\n if (this.isReady) requestAnimationFrame(() => this.handleReady());\n }\n private _isReady = false;\n\n // Private Logic\n\n // Listeners\n\n private handleReady() {\n const hash = window.location.hash;\n if (hash.length > 1) {\n try {\n const idRow = document.querySelector(hash);\n if (idRow) idRow.scrollIntoView();\n } catch (e) {}\n }\n this.nanoTblReady.emit();\n }\n\n /**\n * Start a sort - can be cancelled by `preventDefault`\n * @param order - column order\n * @param column - column config object\n * @returns A promise\n */\n private sortStart = async (\n order: TableTypes.Order,\n column: TableTypes.Prop,\n element?: HTMLElement\n ) => {\n // did order change?\n if (this.currentSort === order + ':' + column) return;\n\n this._loading = true;\n const sortEvent = this.nanoTblBeforeSort.emit({ column: column, order });\n if (sortEvent.defaultPrevented) return;\n perMark('sort');\n this.currentSort = order + ':' + column;\n\n // doesn't make sense to leave user in place for a sort\n this.scrollToTop(element);\n\n if (this.customSortFn) {\n try {\n const res = await this.customSortFn(column, order);\n\n // if the response is 'true', the custom sort did it's thing\n // handover to finish and stop loading state.\n // if response is falsey, carry on to do a FE sort\n if (res === true) {\n this.sortComplete(order, column);\n this._loading = false;\n return;\n }\n } catch (e) {\n // if response errored, stop loading state\n // clear current sort cache\n console.warn('custom sort failed', e);\n this.currentSort = '';\n this._loading = false;\n return;\n }\n }\n\n try {\n await storeSort(this.host, column, order);\n this.sortComplete(order, column);\n } catch (e) {\n console.warn('sort failed', e);\n this.currentSort = '';\n } finally {\n if (this.blocks.length) this._loading = false;\n }\n };\n\n /**\n * Complete a sort. Reflects the order to ui.\n * @param order - column order\n * @param column - column config object\n */\n private sortComplete(order: TableTypes.Order, column: TableTypes.Prop) {\n this.columns = this.columns.map((c) => {\n if (c.prop === column) return { ...c, order };\n return { ...c, order: null };\n });\n this.nanoTblAfterSort.emit({ column: column, order });\n perMark('sort', true);\n }\n\n private async searchStart() {\n this._loading = true;\n const sortEvent = this.nanoTblBeforeSearch.emit({ term: this.searchTerm });\n if (sortEvent.defaultPrevented) return;\n perMark('search');\n\n // doesn't make sense to leave user in place for a search\n this.scrollToTop();\n\n try {\n await storeSearch(this.host, this.searchTerm);\n this.nanoTblAfterSearch.emit({ term: this.searchTerm });\n perMark('search', true);\n } catch (e) {\n console.warn('search failed', e);\n } finally {\n this._loading = false;\n }\n }\n\n private async filterStart(\n filters?: TableTypes.Filter[],\n additive: boolean = true\n ) {\n if (filters) {\n if (additive) {\n this.filters = [\n ...this.filters.filter(\n (f) => !filters.find((ff) => ff.prop === f.prop)\n ),\n ...filters,\n ];\n } else {\n this.filters = filters;\n }\n }\n\n if (this.currentFilters === JSON.stringify(this.filters)) return;\n\n this._loading = true;\n const sortEvent = this.nanoTblBeforeFilter.emit({ filters: this.filters });\n if (sortEvent.defaultPrevented) return;\n perMark('filter');\n this.currentFilters = JSON.stringify(this.filters);\n\n // doesn't make sense to leave user in place for a search\n this.scrollToTop();\n\n if (this.customFilterFn) {\n try {\n const res = await this.customFilterFn(this.filters);\n\n // if the response is 'true', the custom filter did it's thing\n // handover to finish and stop loading state.\n // if response is falsey, carry on to do a FE filter\n if (res === true) {\n this.filterComplete();\n this._loading = false;\n }\n } catch (e) {\n // if response errored, stop loading state\n // clear current sort cache\n console.warn('custom filter failed', e);\n this.currentFilters = '';\n this._loading = false;\n }\n return;\n }\n\n try {\n await storeFilter(this.host, this.filters);\n this.filterComplete();\n } catch (e) {\n console.warn('filter failed', e);\n } finally {\n this._loading = false;\n }\n }\n\n private filterComplete() {\n this.columns = this.columns.map((c) => {\n const cFilter = this.filters.find((f) => f.prop === c.prop);\n if (cFilter) c.filter = cFilter.filter;\n else if (c.filter !== null && c.filter !== undefined)\n c.filter = undefined;\n\n return c;\n });\n this.nanoTblAfterFilter.emit({ filters: this.filters });\n perMark('filter', true);\n }\n\n /** Scrolls to the top immediately - used whilst sorting / filtering */\n private scrollToTop(element?: HTMLElement) {\n const scrollBehaviour = this.scrollParent.style?.scrollBehavior;\n const scrollX = this.scrollParent.scrollLeft;\n this.scrollParent.style.scrollBehavior = 'auto';\n\n if (this.topAnchorEle && !isInViewport(this.topAnchorEle, 0.1)) {\n this.host.scrollIntoView();\n }\n if (element && !isInViewport(element, 1))\n setTimeout(() => element.scrollIntoView({ block: 'start' }), 500);\n\n if (scrollX) this.scrollParent.scrollLeft = scrollX;\n\n if (scrollBehaviour)\n this.scrollParent.style.scrollBehavior = scrollBehaviour;\n\n this.scrollHandler();\n }\n\n private setMeasureElement(): Promise<void> {\n return new Promise((resolve) => {\n readTask(() => {\n this.measureEle = this.blockElements.find(\n (b) => !b?.classList?.contains(`${CSSNAMESPACE}__inactive`)\n );\n resolve();\n });\n });\n }\n\n /**\n * Makes sure we have dimensions on at least one, active tbody element.\n * We'll use this is a yard stick for inactive tbody elements in future.\n * These elements have no natural height (on account of all their rows being hidden)\n */\n private setInitialBlockDimension() {\n if (!this.blockElements?.length) return;\n perMark('blockDims');\n\n const testForDimensions = async () => {\n await this.setMeasureElement();\n if (this.unitHeight) return true;\n return false;\n };\n\n const dimensionsReady: Promise<void> = new Promise(async (resolve) => {\n if (await testForDimensions()) resolve();\n else {\n // it's likely this table is hidden in the dom.\n // we need to wait until it's visible\n const observer = new IntersectionObserver(\n async () => {\n if (await testForDimensions()) {\n resolve();\n observer.disconnect();\n }\n },\n { root: this.scrollParent }\n );\n observer.observe(this.tableEle);\n }\n });\n\n // we're all finished.\n dimensionsReady.then(() => {\n perMark('blockDims', true);\n perMark('init', true);\n requestAnimationFrame(() => (this.isReady = true));\n });\n }\n\n /** Apply initial columns settings */\n private async columnInit() {\n this.filters = (this.columns as TableTypes.NanoTable['columns'])\n .filter((c) => c.filter !== undefined && c.filter !== null)\n .map((c) => {\n const { filter, prop } = c;\n return { filter, prop };\n });\n\n if (this.searchTerm) {\n await this.searchStart();\n }\n\n if (this.filters.length) {\n await this.filterStart();\n }\n // apply sort\n const col = (this.columns as TableTypes.NanoTable['columns']).find(\n (c) => !!c.order\n );\n if (!!col) {\n await this.sortStart(col.order, col.prop);\n }\n }\n\n /** Split up all incoming rows into 'blocks' split amongst tbody elements.\n * These can then be hidden / shown to improve performance.\n */\n private setBlocks() {\n const dRows = this.store.data.state.rows;\n if (!dRows.length) {\n this.blocks = [];\n return;\n }\n\n perMark('setBlocks');\n // this.ignoreIO = true;\n let i = 1;\n const l =\n this.virtualTotalItems > dRows.length\n ? this.virtualTotalItems\n : dRows.length;\n let rows: TableTypes.RowData[] = [];\n const blocks: TableTypes.TBody[] = [];\n\n // old skool loop for perf\n for (i; i <= l; i++) {\n rows.push(this.store.data.state.rows[i - 1] || { __uuid: '' });\n\n if (i % this.perBlock === 0) {\n // assign a UUID for the whole block\n // for block diffing\n blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });\n rows = [];\n }\n }\n\n // any leftover rows\n if (rows.length) {\n blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });\n }\n\n this.blocks = blocks;\n perMark('setBlocks', true);\n }\n\n /**\n * Returns a block render height.\n * If it's currently active - let auto do it's thing\n * If we've rendered it before - return that\n * If all else fails, let's guess it\n * @param blockIndex\n * @returns a height string (incl px)\n */\n private getBlockHeight(blockIndex: number): number {\n if (this.blockHeights.length) {\n const cachedBlockHeight = this.blockHeights.find(\n (bh) => bh.blockIndex === blockIndex\n );\n if (cachedBlockHeight && cachedBlockHeight.height)\n return cachedBlockHeight.height;\n }\n const blockLength = this.blocks[blockIndex].rows.length;\n if (blockLength === this.perBlock && this.measureHeight) {\n return this.measureHeight;\n }\n return this.unitHeight ? this.unitHeight * blockLength : 100;\n }\n\n /** cache the height for all active blocks for later renders */\n private setBlockHeight() {\n this.activeBlocks.forEach((blockIndex) => {\n const el = this.blockElements[blockIndex];\n if (!el) return;\n\n readTask(() => {\n if (el.classList.contains(`${CSSNAMESPACE}__inactive`)) return;\n\n const height = el.getBoundingClientRect().height;\n // cache height to our block heights array\n // for subsequent renders\n const fBhIdx = this.blockHeights.findIndex(\n (bh) => bh.blockIndex === blockIndex\n );\n if (fBhIdx > -1) {\n this.blockHeights[fBhIdx] = { height, blockIndex };\n } else this.blockHeights.push({ height, blockIndex });\n });\n });\n }\n\n /**\n * On scroll, loop through all blocks' heights and cumulatively, add them together.\n * When we find that the scroll position is less than this cumulative block height -\n * stop loop - it's on the current active block.\n */\n private scrollHandler = () => {\n // don't listen if this table isn't in the viewport\n if (!this.store.general.state.isActive || !this.rows) return;\n if (this.primaryBlockIndex === undefined) this.primaryBlockIndex = 0;\n\n readTask(() => {\n this.cacheScrollPosition = this.scrollParent.scrollTop || window.scrollY;\n let cumulativeHeight = this.host.offsetTop;\n let blockIndex = 0;\n const blockLen = this.blocks.length;\n\n while (\n blockIndex < blockLen &&\n this.cacheScrollPosition >= cumulativeHeight\n ) {\n cumulativeHeight += this.getBlockHeight(blockIndex);\n\n if (this.cacheScrollPosition < cumulativeHeight) {\n const potentialBlocks = [\n blockIndex,\n blockIndex + 1,\n Math.max(0, blockIndex - 1),\n ];\n if (potentialBlocks.toString() !== this.activeBlocks.toString()) {\n this.activeBlocks = potentialBlocks;\n }\n this.primaryBlockIndex = blockIndex;\n }\n blockIndex++;\n }\n });\n };\n\n /** Process slotted content */\n private processSlots() {\n // see if we have slot content\n if (!this.caption && !this.host.querySelector('[slot=\"caption\"]')) {\n console.error(\n 'For accessibility you must set a `caption` prop or use the `caption` slot'\n );\n }\n }\n\n private handleColumnPinned = (positions: {\n [key in TableTypes.Position]: boolean;\n }) => {\n Object.entries(positions).forEach(([key, applied]) => {\n this.tableEle.classList.toggle(\n `${CSSNAMESPACE}__pinned--${key}`,\n applied\n );\n });\n };\n\n private handleResizeChange = (\n e: NanoResizeObserveCustomEvent<ResizeStateChangeEventDetail>\n ) => {\n this.tableWrapperEle.className = '';\n\n let classes: string[] = [`${CSSNAMESPACE}__wrap`];\n if (e.target?.className)\n classes = [...e.target.className.split(' '), ...classes];\n\n this.tableWrapperEle.classList.add(...classes.filter((cl) => !!cl));\n };\n\n /** Adds an IO. Makes sure our scroll listener is only active when\n * the table is in viewport */\n private setupActiveWatcher() {\n if (!this.host || !this.scrollParent || !this.store) return;\n\n if (this.activeWatcherIo) {\n this.activeWatcherIo.disconnect();\n this.activeWatcherIo = undefined;\n }\n const io = (this.activeWatcherIo = new IntersectionObserver(\n async ([e]) => {\n if (e.isIntersecting) this.store.general.state.isActive = true;\n else this.store.general.state.isActive = false;\n },\n { root: this.scrollParent, threshold: 0 }\n ));\n io.observe(this.host);\n }\n\n // Component lifecycle\n\n async componentWillLoad() {\n perMark('init');\n // setup stores\n this.store = await generateStore(\n this.host,\n this.columns,\n this.scrollParent,\n this.isReady\n );\n await this.handleRowsChange();\n this.store.general.onChange('isActive', () => {\n this.scrollHandler();\n });\n this.store.data.onChange('rows', () => this.setBlocks());\n\n // setup dom and attach listeners\n this.processSlots();\n this.setBlocks();\n this.scrollParent = findScrollParent(this.host);\n this.setupActiveWatcher();\n }\n\n connectedCallback(): void {\n this.scrollParent = findScrollParent(this.host);\n this.setupActiveWatcher();\n }\n\n componentDidLoad(): void {\n this.setInitialBlockDimension();\n }\n\n componentShouldUpdate(_newVal, _oldVal, stateName: keyof Table) {\n // stop double rendering - we use the store for rendering internally\n // the public facing props are kept in-sync with the store\n // but we don't want it to cause renders\n if (['rows', 'columns'].includes(stateName)) return false;\n\n if (Build.isDev && !Build.isTesting && measurePerf)\n console.log(stateName, _newVal, _oldVal);\n }\n\n componentWillRender(): void | Promise<void> {\n perMark('render');\n }\n\n componentDidRender(): void {\n this.setMeasureElement().then(() => this.setBlockHeight());\n perMark('render', true);\n }\n\n disconnectedCallback(): void {\n if (!this.activeWatcherIo) return;\n this.activeWatcherIo.disconnect();\n this.activeWatcherIo = undefined;\n\n (this.scrollParent === document.documentElement\n ? document\n : this.scrollParent\n ).removeEventListener('scroll', this.scrollHandler);\n }\n\n render() {\n this.blockElements = [];\n\n return (\n <Host>\n <div\n class={`${CSSNAMESPACE}__top-anchor`}\n ref={(a) => (this.topAnchorEle = a)}\n >\n &nbsp;\n </div>\n\n <nano-resize-observe\n states=\"576w sm, 768w md\"\n class=\"sm md\"\n onNanoResizeStateChange={this.handleResizeChange}\n ></nano-resize-observe>\n\n <div\n class={`${CSSNAMESPACE}__wrap sm md`}\n ref={(div) => (this.tableWrapperEle = div)}\n aria-labelledby={'table-caption-' + this.renderId}\n tabindex={this.type === 'grid' ? '0' : undefined}\n >\n <nano-progress-bar\n indeterminate\n class={{\n [`${CSSNAMESPACE}__progress-bar`]: true,\n [`${CSSNAMESPACE}__progress-bar--show`]: this._loading,\n }}\n />\n <table\n role={this.type === 'grid' ? 'grid' : undefined}\n aria-rowcount={this.store.data.state.rows.length}\n aria-colcount={this.store.config.state.columns.length}\n class={`${CSSNAMESPACE}`}\n ref={(tbl) => (this.tableEle = tbl)}\n >\n <caption\n class={{\n [`${CSSNAMESPACE}__caption`]: true,\n [`${CSSNAMESPACE}__caption--hide`]: !this.showCaption,\n }}\n id={'table-caption-' + this.renderId}\n >\n <slot name=\"caption\">{this.caption}</slot>\n </caption>\n\n {/* Header */}\n <thead>\n <TableHeadFootRow\n rowRenderer={this.headRender}\n onColumnPinned={this.handleColumnPinned}\n >\n {this.store.config.state.columns.map((colModel) => [\n <TableColHead\n column={colModel}\n headRenderer={this.headRender}\n onColumnSortClick={this.sortStart}\n onColumnPinned={this.handleColumnPinned}\n defaults={{\n sortable: this.defaultSort,\n }}\n />,\n ])}\n </TableHeadFootRow>\n </thead>\n\n {this._loading && !this.blocks.length && (\n <tbody class={`${CSSNAMESPACE}__active`}>\n {[...Array(10).keys()].map((rowIndex) => (\n <tr>\n {this.store.config.state.columns.map(\n (_colModel, colIndex) => (\n <TableCell\n rowIndex={rowIndex}\n colIndex={colIndex}\n nestedContent={() => <nano-skeleton />}\n />\n )\n )}\n </tr>\n ))}\n </tbody>\n )}\n\n <tr hidden={!!this._loading || !!this.blocks.length}>\n <th\n class={`${CSSNAMESPACE}__th`}\n colSpan={this.store.config.state.columns.length}\n >\n <div class=\"nano-tbl__cell-content nano-tbl__cell-content--no-result\">\n <slot name=\"no-results\">No results found</slot>\n </div>\n </th>\n </tr>\n\n {/* Body */}\n {this.blocks.map((block, blockIndex) => (\n <tbody\n key={block.__uuid}\n id={`tbody-${this.renderId}-${blockIndex}`}\n ref={(tb) => {\n this.blockElements.push(tb);\n }}\n class={{\n [`${CSSNAMESPACE}__inactive`]:\n !this.activeBlocks.includes(blockIndex),\n [`${CSSNAMESPACE}__active`]:\n this.activeBlocks.includes(blockIndex),\n }}\n >\n {this.activeBlocks.includes(blockIndex) ? (\n block.rows.map((row, i) => {\n const rowIndex =\n blockIndex > 0 ? blockIndex * this.perBlock + i : i;\n return (\n <TableRow\n rowRenderer={this.rowRender}\n rowModel={row}\n rowIndex={rowIndex}\n >\n {this.store.config.state.columns.map(\n (_colModel, colIndex) => (\n <TableCell\n rowIndex={rowIndex}\n colIndex={colIndex}\n />\n )\n )}\n </TableRow>\n );\n })\n ) : (\n <tr>\n <td\n colSpan={this.store.config.state.columns.length}\n style={{\n height: this.getBlockHeight(blockIndex) + 'px',\n }}\n />\n </tr>\n )}\n </tbody>\n ))}\n\n {/* Footer */}\n {this.showFooter && (\n <tfoot>\n <TableHeadFootRow\n rowRenderer={this.footRender}\n onColumnPinned={this.handleColumnPinned}\n >\n {this.store.config.state.columns.map((colModel) => [\n <TableColHead\n column={colModel}\n headRenderer={this.footRender}\n onColumnPinned={this.handleColumnPinned}\n onColumnSortClick={this.sortStart}\n defaults={{\n sortable: this.defaultSort,\n }}\n />,\n ])}\n </TableHeadFootRow>\n </tfoot>\n )}\n </table>\n\n {!!this.blocks.length && (\n <nano-spinner\n type=\"circle\"\n class={{\n [`${CSSNAMESPACE}__spinner`]: true,\n [`${CSSNAMESPACE}__spinner--show`]: this._loading,\n }}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -287,10 +287,7 @@ const DataList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
287
287
  if (nanoInput) {
288
288
  nanoInput.removeEventListener('nanoChange', this.inputChange);
289
289
  }
290
- oldInput.removeEventListener('change', this.inputChange);
291
- oldInput.removeEventListener('click', this.inputClick);
292
- oldInput.removeEventListener('keydown', this.inputKeydown);
293
- oldInput.removeEventListener('input', this.inputChange);
290
+ this.removeEventListeners(oldInput);
294
291
  this.inputLabel = null;
295
292
  writeTask(() => {
296
293
  oldInput.removeAttribute('role');
@@ -421,6 +418,16 @@ const DataList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
421
418
  this.changeInputValue(foundEle);
422
419
  }
423
420
  // Event handlers
421
+ removeEventListeners(oldInput) {
422
+ const nanoInput = oldInput.closest('nano-input');
423
+ if (nanoInput) {
424
+ nanoInput.removeEventListener('nanoChange', this.inputChange);
425
+ }
426
+ oldInput.removeEventListener('change', this.inputChange);
427
+ oldInput.removeEventListener('click', this.inputClick);
428
+ oldInput.removeEventListener('keydown', this.inputKeydown);
429
+ oldInput.removeEventListener('input', this.inputChange);
430
+ }
424
431
  processSlottedContent() {
425
432
  requestAnimationFrame(() => {
426
433
  var _a;
@@ -488,6 +495,8 @@ const DataList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
488
495
  this.mo.disconnect();
489
496
  this.mo = undefined;
490
497
  }
498
+ if (this.connectedInput)
499
+ this.removeEventListeners(this.connectedInput);
491
500
  }
492
501
  render() {
493
502
  return (h(Host, { role: this.actvOptEles.length ? 'listbox' : undefined, "a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,CAAC,CAAC,EACZ,YAAY,EAAE,IAAI,CAAC,WAAW,EAC9B,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,EAChC,IAAI,EAAC,MAAM,IAEX,YAAM,IAAI,EAAC,UAAU,GAAG,EACvB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,eAAQ,EAChC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,YAAM,IAAI,EAAC,eAAe,GAAG,EACvD,YAAM,IAAI,EAAC,aAAa,GAAG,CACjB,EACZ,iBACE,IAAI,EAAC,SAAS,EACd,KAAK,EAAC,kBAAkB,EACxB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EACjC,KAAK,EAAE;QACL,WAAW,EAAE,IAAI;QACjB,mBAAmB,EAAE,IAAI,CAAC,aAAa;OACxC,IAED,YAAM,IAAI,EAAC,WAAW,GAAG,CACf,EACX,CAAC,CAAC,IAAI,CAAC,WAAW,KACjB,WAAK,KAAK,EAAC,eAAe,IACvB,IAAI,CAAC,WAAW,CAAC,MAAM,aACvB,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,gBACnC,CACP,CACa,CACX,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/datalist/datalist.scss?tag=nano-datalist&encapsulation=shadow","./src/components/datalist/datalist.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/layers';\n\n:host {\n /**\n * @prop --padding-top: for all nested `nano-option` elements. Defaults to #{$spacing-small};\n * @prop --padding-bottom: for all nested `nano-option` elements. Defaults to #{$spacing-small};\n * @prop --padding-start: for all nested `nano-option` elements. Defaults to #{$spacing-xlarge};\n * @prop --padding-end: for all nested `nano-option` elements. Defaults to #{$spacing-xlarge};\n * @prop --font-size: for all nested `nano-option` elements. Defaults to .8em;\n * @prop --color: default text color of content other than `nano-option`. Defaults to #{map.get($colors, palegrey)};\n */\n\n --padding-top: #{$spacing-small};\n --padding-bottom: #{$spacing-small};\n --padding-start: #{$spacing-xlarge};\n --padding-end: #{$spacing-xlarge};\n --font-size: 0.8em;\n --color: #{map.get($colors, palegrey)};\n\n color: var(--color);\n}\n\n.dlist {\n &--isfiltered {\n ::slotted(*:not(nano-option):not([slot='no-result']):not([slot='list-top']):not([slot='list-bottom'])) {\n display: none !important;\n }\n }\n\n &__dropdown {\n --min-width: 100%;\n --overflow: auto;\n }\n\n &__status {\n @include visually-hide();\n }\n\n &__menu {\n --padding-top: inherit;\n --padding-bottom: inherit;\n --padding-start: inherit;\n --padding-end: inherit;\n --font-size: inherit;\n }\n}\n","import {\n Component,\n ComponentInterface,\n h,\n Host,\n Element,\n State,\n Watch,\n Prop,\n Event,\n writeTask,\n Build,\n EventEmitter,\n} from '@stencil/core';\nimport { getActiveElement } from '../../utils/active-element';\nimport { debounce } from '../../utils/throttle';\nimport type { NanoMenuCustomEvent, OptionInterface } from '../../interface';\nimport type { Dropdown } from '../dropdown/dropdown';\n\nfunction findLabel(formCtrl: Element) {\n let foundLabel: HTMLLabelElement;\n\n if (formCtrl.id) {\n foundLabel = document.querySelector(`label[for='${formCtrl.id}']`);\n }\n if (!foundLabel) {\n foundLabel = formCtrl.closest('label');\n }\n return foundLabel;\n}\n\nlet listIds = 0;\n\n/**\n * `nano-datalist` a visually consistent and more flexible replacement for a native\n * [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist). Can be nested within a `nano-input`\n * or linked to any input control via the `input` prop. Is used internally within `nano-select`.\n * Options can be defined declaratively by nesting `<nano-option>` elements or imperatively using the `options` prop\n *\n * @slot - use `<nano-option>` elements for more complex html. Alternatively use the `options` prop\n * @slot list-top - shows at the top of the list when there are options present\n * @slot list-bottom - shows at the bottom of the list when there are options present\n * @slot no-result - shown when there are no results otherwise nothing will be shown\n */\n@Component({\n tag: 'nano-datalist',\n styleUrl: 'datalist.scss',\n shadow: true,\n})\nexport class DataList implements ComponentInterface {\n // Private State\n\n private isNanoInput = false;\n private typeToSelect = '';\n private typeToSelectTimeout: number;\n private nanoDropdown: HTMLNanoDropdownElement;\n private listBox: HTMLNanoMenuElement;\n private mo?: MutationObserver;\n private listId = `nano-datalist-${listIds++}`;\n private isFiltered = false;\n private shouldFocus = false;\n // all potential option eles. Set via slot or `options` prop.\n // Some may get hidden due to filtering\n private get allOptEles() {\n return this._allOptEles;\n }\n private set allOptEles(opts) {\n // when allOptEles are initially set (on slot change / options) -\n // add options to 'selected' and fire selected event *if*\n // value isn't set on the input\n this._allOptEles = opts;\n if (this.connectedInput?.value) return;\n\n opts.forEach((opt) => {\n if (opt.selected && !this.selected.includes(opt.value)) {\n this.changeInputValue(opt);\n }\n });\n }\n private _allOptEles: HTMLNanoOptionElement[] = [];\n\n @Element() host: HTMLNanoDatalistElement;\n\n // active option eles that are not hidden.\n @State() actvOptEles: HTMLNanoOptionElement[] = [];\n @State() connectedInput: HTMLInputElement | HTMLTextAreaElement;\n @State() inputLabel: HTMLLabelElement;\n @State() hasNoResult: boolean;\n @State() shouldOpen: boolean;\n @State() canOpen: boolean = true;\n @State() optionIds: string[] = [];\n\n constructor() {\n this.inputChange = debounce(this.inputChange.bind(this), 50);\n }\n\n // Public API\n\n /** By default, items in the list will appear 'selected' when the value in the linked input control matches.\n * However you can add other selected options via the the selected prop. */\n @Prop({ mutable: true }) selected: string[] = [];\n\n /** nano-dropdown config options you can pass to the nested dropdown component */\n @Prop()\n get dropDownConfig() {\n return this._dropDownConfig;\n }\n set dropDownConfig(ddc: Partial<Dropdown>) {\n this._dropDownConfig = { ...this._dropDownConfig, ...ddc };\n }\n private _dropDownConfig: Partial<Dropdown> = {\n skidding: -1,\n };\n\n /** Provide an option list.\n * Options can be defined declaratively by nesting `<nano-option>` elements or imperatively using this prop */\n @Prop() options?: OptionInterface[] = [];\n\n /** A selector to a HTMLInputElement */\n @Prop() input?: string | HTMLInputElement;\n\n /** Tweaks the datalist behaviour and linked control semantics and behaviour.\n * e.g. 'select' will make the linked input control `readonly`.\n */\n @Prop() type: 'select' | 'selctMulti' | 'input' = 'input';\n\n /** return all the active options currently within the datalist. Can be useful for validation */\n @Prop()\n get activeOptions() {\n return this.allOptEles;\n }\n\n /** Force datalist open */\n @Prop({ mutable: true }) open: boolean = false;\n\n @Watch('open')\n openWatcher() {\n writeTask(() => {\n this.nanoDropdown.open = this.open;\n if (this.connectedInput)\n this.connectedInput.setAttribute('aria-expanded', this.open.toString());\n });\n }\n\n /** Use this option to disable to default filtering. This is useful if filtering happens\n * externally via another method (e.g. via ajax)\n */\n @Prop() disableFilter = false;\n\n /** Activate / deactivate the datalist control */\n @Prop() disabled = false;\n\n // State change watchers\n\n @Watch('input')\n async watchInputChange() {\n let nanoInput;\n if ((nanoInput = this.host.closest('nano-input'))) {\n this.isNanoInput = true;\n this.connectedInput = await nanoInput.getInputElement();\n } else if (\n this.input &&\n typeof this.input === 'string' &&\n (nanoInput = document.querySelector(this.input))\n ) {\n this.isNanoInput = false;\n this.connectedInput = nanoInput;\n } else if (typeof this.input === 'object') {\n this.connectedInput = this.input;\n }\n }\n\n @Watch('options')\n manageSlotChangeListener() {\n if (!this.host) return;\n\n // we're not using `options` - setup new MO\n if ((!this.options || !this.options.length) && !this.mo) {\n if (Build.isBrowser) {\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.host, { childList: true, subtree: true });\n }\n this.processSlottedContent();\n return;\n }\n\n // we're using `options` - trash current MO\n if (this.options?.length) {\n if (!!this.mo) {\n this.mo.disconnect();\n this.mo = undefined;\n }\n\n const previousOptions = this.host.querySelectorAll(\n '[slot=\"internal-opts\"]'\n );\n\n // add imperative `options`\n writeTask(() => {\n // clear all previous\n if (previousOptions?.length)\n previousOptions.forEach((internalOpt) => internalOpt.remove());\n\n this.allOptEles = this.options.flatMap((option, i) => {\n if (option.value || option.label) {\n const opt = Object.assign(document.createElement('nano-option'), {\n label: option.label,\n value: option.value,\n ariaPosinset: i,\n ariaSetsize: this.options.length,\n selected: option.selected,\n id: this.listId + '-option-' + i,\n textContent: option.label ? option.label : option.value,\n slot: 'internal-opts',\n });\n this.host.append(opt);\n return opt;\n }\n });\n\n if (this.connectedInput?.value.length && this.type !== 'select') {\n this.inputChange();\n } else {\n this.actvOptEles = [...this.allOptEles];\n }\n });\n }\n // forceUpdate(this.host);\n }\n\n @Watch('type')\n @Watch('connectedInput')\n watchTypeChange() {\n if (!this.connectedInput) return;\n\n let dwConfig: Partial<Dropdown> = { closeOnSelect: false };\n let autocompleteType: 'list' | 'both' = 'both';\n let readonly = false;\n\n switch (this.type) {\n case 'input':\n dwConfig = { closeOnSelect: true };\n break;\n case 'select':\n autocompleteType = 'list';\n readonly = true;\n dwConfig = { closeOnSelect: true, placement: 'center' };\n break;\n }\n\n if (!this.isNanoInput) {\n dwConfig.tetherTo = this.connectedInput;\n }\n\n this.dropDownConfig = { ...this.dropDownConfig, ...dwConfig };\n this.connectedInput.setAttribute('aria-autocomplete', autocompleteType);\n this.connectedInput.readOnly = readonly;\n }\n\n @Watch('connectedInput')\n manageInputEvents(newInput?: HTMLInputElement, oldInput?: HTMLInputElement) {\n if (!!oldInput) {\n const nanoInput = oldInput.closest('nano-input');\n if (nanoInput) {\n nanoInput.removeEventListener('nanoChange', this.inputChange);\n }\n oldInput.removeEventListener('change', this.inputChange);\n oldInput.removeEventListener('click', this.inputClick);\n oldInput.removeEventListener('keydown', this.inputKeydown);\n oldInput.removeEventListener('input', this.inputChange);\n\n this.inputLabel = null;\n\n writeTask(() => {\n oldInput.removeAttribute('role');\n oldInput.removeAttribute('aria-expanded');\n oldInput.removeAttribute('aria-controls');\n oldInput.removeAttribute('aria-owns');\n oldInput.removeAttribute('aria-haspopup');\n oldInput.removeAttribute('aria-autocomplete');\n oldInput.removeAttribute('autocomplete');\n });\n }\n if (!!newInput) {\n const nanoInput = newInput.closest('nano-input');\n if (nanoInput) {\n nanoInput.addEventListener('nanoChange', this.inputChange);\n }\n newInput.addEventListener('change', this.inputChange);\n newInput.addEventListener('click', this.inputClick);\n newInput.addEventListener('keydown', this.inputKeydown);\n newInput.addEventListener('input', this.inputChange);\n this.listId = this.host.id || this.listId;\n\n this.inputLabel = newInput?.labels?.item(0) || findLabel(newInput);\n\n writeTask(() => {\n this.host.id = this.listId;\n newInput.setAttribute('role', 'combobox');\n newInput.setAttribute('aria-expanded', 'false');\n newInput.setAttribute('aria-controls', this.listId);\n newInput.setAttribute('aria-owns', this.listId);\n newInput.setAttribute('aria-haspopup', 'listbox');\n newInput.setAttribute('autocomplete', 'off');\n });\n }\n }\n\n @Watch('selected')\n @Watch('actvOptEles')\n watchActvOptChange() {\n let c = 0;\n const val = this.connectedInput?.value || '';\n const optIds = [];\n\n writeTask(() => {\n this.allOptEles.forEach((opt, i) => {\n if (this.actvOptEles.includes(opt)) {\n c++;\n opt.setAttribute('aria-posinset', c + '');\n opt.setAttribute('aria-setsize', this.actvOptEles.length + '');\n opt.hidden = false;\n this.isSelected(opt, val);\n } else {\n opt.removeAttribute('aria-posinset');\n opt.removeAttribute('aria-setsize');\n opt.hidden = true;\n opt.selected = false;\n }\n opt.id = this.listId + '-option-' + i;\n optIds.push(opt.id);\n });\n this.optionIds = optIds;\n });\n }\n\n @Watch('actvOptEles')\n @Watch('hasNoResult')\n manageCanOpen() {\n if (this.actvOptEles.length || this.hasNoResult) this.canOpen = true;\n else this.canOpen = false;\n }\n\n /**\n * Opens the dropdown if it can, it should and there are items to display.\n */\n @Watch('shouldOpen')\n @Watch('canOpen')\n manageDropdownDisplay() {\n if (this.shouldOpen && this.canOpen && !this.disabled) this.open = true;\n if (!this.shouldOpen || !this.canOpen) this.open = false;\n this.openWatcher();\n }\n\n @Watch('actvOptEles')\n fireActiveOptsEvent() {\n this.nanoOptionsUpdated.emit(this.actvOptEles);\n }\n\n // Events\n\n /** Fired when an item is selected. */\n @Event() nanoSelect: EventEmitter<HTMLNanoOptionElement>;\n\n /** Fired when a currently selected item is reselected. */\n @Event() nanoDeselect: EventEmitter<HTMLNanoOptionElement>;\n\n /** Fired when active options change */\n @Event() nanoOptionsUpdated: EventEmitter<HTMLNanoOptionElement[]>;\n\n // Private logic\n\n private isSelected(opt: HTMLNanoOptionElement, val: string) {\n if (val === opt.value || this.selected.includes(opt.value)) {\n opt.selected = true;\n } else opt.selected = false;\n }\n\n private get dropwdownOpen() {\n if (!this.nanoDropdown || !this.open) return false;\n return true;\n }\n\n private get exactMatch() {\n return this.allOptEles.find(\n (opt) => this.connectedInput.value === opt.value\n );\n }\n\n /** reflect value back to the connected input unless the event is cancelled */\n private changeInputValue(opt: HTMLNanoOptionElement) {\n let nanoSelected;\n\n if (this.selected.includes(opt.value)) {\n // deselect option\n this.selected = this.selected.filter((val) => val !== opt.value);\n nanoSelected = this.nanoDeselect.emit(opt);\n } else {\n // select new option\n this.selected = [...this.selected];\n nanoSelected = this.nanoSelect.emit(opt);\n }\n\n if (!nanoSelected.defaultPrevented) {\n if (this.connectedInput) this.connectedInput.value = opt.value;\n\n const event = new window.Event('change');\n this.connectedInput?.dispatchEvent(event);\n }\n }\n\n // a new option has been picked\n private optSelected = (e: NanoMenuCustomEvent<HTMLNanoOptionElement>) => {\n e.stopPropagation();\n this.changeInputValue(e.detail);\n requestAnimationFrame(() => this.inputChange());\n\n if (this.type !== 'selctMulti') this.shouldOpen = false;\n };\n\n // this is for type=\"select\" only.\n // Filter options that start with text - aggregates letters (as opposed to getting the value from input)\n private setOptStartsWith() {\n const attrFind = (toFind: string) =>\n toFind.toLowerCase().substring(0, this.typeToSelect.length) ===\n this.typeToSelect;\n\n const foundEle = this.allOptEles.find(\n (opt) =>\n opt.value.trim().length > 0 &&\n !opt.disabled &&\n (attrFind(opt.textContent) ||\n attrFind(opt.value) ||\n attrFind(opt.label) ||\n attrFind(opt.filterMeta))\n );\n if (foundEle) this.changeInputValue(foundEle);\n }\n\n // Event handlers\n\n private processSlottedContent() {\n requestAnimationFrame(() => {\n this.allOptEles = Array.from(this.host.querySelectorAll('nano-option'));\n this.hasNoResult = !!this.host.querySelector('[slot=\"no-result\"]');\n\n if (this.connectedInput?.value.length && this.type !== 'select') {\n this.inputChange();\n } else this.actvOptEles = this.allOptEles;\n });\n }\n\n // sets focus immediately on open when 'select' - mirroring native behaviour\n private handleShow = async () => {\n if (this.shouldFocus) {\n this.shouldFocus = false;\n this.listBox.setFocus();\n } else if (this.type === 'select') this.listBox.showActiveElement();\n };\n\n private handleHide = () => {\n this.open = false;\n const activeElement = getActiveElement();\n if (activeElement.closest(this.host.tagName.toLowerCase())) {\n this.connectedInput.select();\n }\n };\n\n // any changes to the connected input value will filter the list of active options\n private inputChange() {\n if (this.disableFilter) {\n this.actvOptEles = this.allOptEles;\n return;\n }\n\n const val = this.connectedInput.value;\n const valStr = val.trim().toLowerCase();\n\n let exactMatch = false;\n const activeEles = [];\n const attrFind = (toFind: string) =>\n toFind.toLowerCase().indexOf(valStr) > -1;\n\n this.allOptEles.forEach((opt) => {\n if (\n (val === opt.value || val === opt.label) &&\n this.type !== 'selctMulti'\n ) {\n opt.selected = true;\n exactMatch = true;\n } else this.isSelected(opt, val);\n });\n\n this.allOptEles.forEach((opt) => {\n if (!valStr.length || exactMatch) {\n activeEles.push(opt);\n } else if (\n opt.value.trim().length > 0 &&\n !opt.disabled &&\n (attrFind(opt.textContent) ||\n attrFind(opt.value) ||\n attrFind(opt.label) ||\n attrFind(opt.filterMeta))\n ) {\n activeEles.push(opt);\n }\n });\n\n this.isFiltered = valStr.length && !exactMatch;\n this.actvOptEles = activeEles;\n }\n\n private inputClick = () => {\n this.shouldOpen = true;\n // open dropdown if possible\n this.manageDropdownDisplay();\n };\n\n private inputKeydown = (e: KeyboardEvent) => {\n const ignoreKeys = [\n 'Shift',\n 'ArrowRight',\n 'ArrowLeft',\n 'Escape',\n 'Enter',\n 'Tab',\n ];\n if (ignoreKeys.includes(e.key)) {\n if (e.key === 'Tab') this.shouldOpen = false;\n return;\n }\n\n // When select, mirror native select behaviour. Search on closed list\n if (\n this.type === 'select' &&\n !['ArrowDown', 'ArrowUp'].includes(e.key) &&\n (e.key !== ' ' || this.typeToSelectTimeout)\n ) {\n if (e.key === ' ' || /^[a-z0-9]+$/i.test(e.key)) {\n clearTimeout(this.typeToSelectTimeout);\n this.typeToSelectTimeout = window.setTimeout(() => {\n this.typeToSelect = '';\n this.typeToSelectTimeout = 0;\n }, 750);\n this.typeToSelect += e.key;\n this.setOptStartsWith();\n }\n return;\n }\n\n this.shouldOpen = true;\n // open dropdown if possible\n this.manageDropdownDisplay();\n if (['ArrowDown', 'ArrowUp'].includes(e.key)) {\n e.preventDefault();\n this.shouldFocus = true;\n }\n };\n\n // handles key down on options. Either 'picks'\n // an option or passes event back to input for search / filter\n private optionKeyDown = (\n e: KeyboardEvent & { target: HTMLNanoOptionElement }\n ) => {\n const ignoreKeys = [\n 'Shift',\n 'ArrowUp',\n 'ArrowDown',\n 'Escape',\n 'Enter',\n 'Tab',\n 'Space',\n 'PageUp',\n 'PageDown',\n 'Home',\n 'End',\n ' ',\n ];\n if (ignoreKeys.includes(e.key)) {\n if (e.key === 'Escape') this.connectedInput.focus();\n return;\n }\n\n const deleteKeys = ['Delete', 'Backspace'];\n // this passes whatever's typed back to our input control\n if (\n this.type !== 'select' &&\n (!this.exactMatch || deleteKeys.includes(e.key))\n ) {\n this.connectedInput.focus();\n }\n };\n\n // Component lifecycle\n\n connectedCallback() {\n this.watchInputChange();\n }\n\n componentDidLoad() {\n this.manageSlotChangeListener();\n this.openWatcher();\n }\n\n componentDidRender(): void {\n setTimeout(() => {\n if (!this.connectedInput)\n console.warn(\n 'no `nano-input` found. `nano-datalist` should be nested within an `nano-input` or linked via `input` prop',\n this.host\n );\n }, 500);\n }\n\n disconnectedCallback(): void {\n if (!!this.mo) {\n this.mo.disconnect();\n this.mo = undefined;\n }\n }\n\n render() {\n return (\n <Host\n role={this.actvOptEles.length ? 'listbox' : undefined}\n aria-owns={this.optionIds.length ? this.optionIds.join(' ') : undefined}\n aria-label={\n this.optionIds.length\n ? 'Select options from the list below'\n : undefined\n }\n >\n <nano-dropdown\n {...this.dropDownConfig}\n ref={(el) => (this.nanoDropdown = el)}\n dialogTitle=\"Select options from the list below\"\n class={{\n dlist__dropdown: true,\n 'dlist--isfiltered': this.isFiltered,\n }}\n onNanoAfterShow={this.handleShow}\n onNanoAfterHide={this.handleHide}\n role=\"group\"\n >\n <nano-menu\n hidden={!this.actvOptEles.length}\n type=\"listbox\"\n label={this.inputLabel ? this.inputLabel.textContent : undefined}\n class={{\n dlist__menu: true,\n 'dlist__menu--open': this.dropwdownOpen,\n }}\n tabIndex={-1}\n onNanoSelect={this.optSelected}\n onKeyDown={this.optionKeyDown}\n ref={(el) => (this.listBox = el)}\n role=\"list\"\n >\n <slot name=\"list-top\" />\n {!this.options.length && <slot />}\n {!!this.options.length && <slot name=\"internal-opts\" />}\n <slot name=\"list-bottom\" />\n </nano-menu>\n <nano-menu\n type=\"listbox\"\n label=\"No results found\"\n hidden={!!this.actvOptEles.length}\n class={{\n dlist__menu: true,\n 'dlist__menu--open': this.dropwdownOpen,\n }}\n >\n <slot name=\"no-result\" />\n </nano-menu>\n {!!this.actvOptEles && (\n <div class=\"dlist__status\">\n {this.actvOptEles.length} result\n {this.actvOptEles.length > 1 ? 's' : ''} available.\n </div>\n )}\n </nano-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"datalist.js","mappings":";;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,o1BAAo1B;;ACmBx2B,SAAS,SAAS,CAAC,QAAiB;EAClC,IAAI,UAA4B,CAAC;EAEjC,IAAI,QAAQ,CAAC,EAAE,EAAE;IACf,UAAU,GAAG,QA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AK,EAAE;QACL,WAAW,EAAE,IAAI;QACjB,mBAAmB,EAAE,IAAI,CAAC,aAAa;OACxC,EACD,QAAQ,EAAE,CAAC,CAAC,EACZ,YAAY,EAAE,IAAI,CAAC,WAAW,EAC9B,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,EAChC,IAAI,EAAC,MAAM,IAEX,YAAM,IAAI,EAAC,UAAU,GAAG,EACvB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,eAAQ,EAChC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,YAAM,IAAI,EAAC,eAAe,GAAG,EACvD,YAAM,IAAI,EAAC,aAAa,GAAG,CACjB,EACZ,iBACE,IAAI,EAAC,SAAS,EACd,KAAK,EAAC,kBAAkB,EACxB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EACjC,KAAK,EAAE;QACL,WAAW,EAAE,IAAI;QACjB,mBAAmB,EAAE,IAAI,CAAC,aAAa;OACxC,IAED,YAAM,IAAI,EAAC,WAAW,GAAG,CACf,EACX,CAAC,CAAC,IAAI,CAAC,WAAW,KACjB,WAAK,KAAK,EAAC,eAAe,IACvB,IAAI,CAAC,WAAW,CAAC,MAAM,aACvB,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,gBACnC,CACP,CACa,CACX,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/datalist/datalist.scss?tag=nano-datalist&encapsulation=shadow","./src/components/datalist/datalist.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/layers';\n\n:host {\n /**\n * @prop --padding-top: for all nested `nano-option` elements. Defaults to #{$spacing-small};\n * @prop --padding-bottom: for all nested `nano-option` elements. Defaults to #{$spacing-small};\n * @prop --padding-start: for all nested `nano-option` elements. Defaults to #{$spacing-xlarge};\n * @prop --padding-end: for all nested `nano-option` elements. Defaults to #{$spacing-xlarge};\n * @prop --font-size: for all nested `nano-option` elements. Defaults to .8em;\n * @prop --color: default text color of content other than `nano-option`. Defaults to #{map.get($colors, palegrey)};\n */\n\n --padding-top: #{$spacing-small};\n --padding-bottom: #{$spacing-small};\n --padding-start: #{$spacing-xlarge};\n --padding-end: #{$spacing-xlarge};\n --font-size: 0.8em;\n --color: #{map.get($colors, palegrey)};\n\n color: var(--color);\n}\n\n.dlist {\n &--isfiltered {\n ::slotted(*:not(nano-option):not([slot='no-result']):not([slot='list-top']):not([slot='list-bottom'])) {\n display: none !important;\n }\n }\n\n &__dropdown {\n --min-width: 100%;\n --overflow: auto;\n }\n\n &__status {\n @include visually-hide();\n }\n\n &__menu {\n --padding-top: inherit;\n --padding-bottom: inherit;\n --padding-start: inherit;\n --padding-end: inherit;\n --font-size: inherit;\n }\n}\n","import {\n Component,\n ComponentInterface,\n h,\n Host,\n Element,\n State,\n Watch,\n Prop,\n Event,\n writeTask,\n Build,\n EventEmitter,\n} from '@stencil/core';\nimport { getActiveElement } from '../../utils/active-element';\nimport { debounce } from '../../utils/throttle';\nimport type { NanoMenuCustomEvent, OptionInterface } from '../../interface';\nimport type { Dropdown } from '../dropdown/dropdown';\n\nfunction findLabel(formCtrl: Element) {\n let foundLabel: HTMLLabelElement;\n\n if (formCtrl.id) {\n foundLabel = document.querySelector(`label[for='${formCtrl.id}']`);\n }\n if (!foundLabel) {\n foundLabel = formCtrl.closest('label');\n }\n return foundLabel;\n}\n\nlet listIds = 0;\n\n/**\n * `nano-datalist` a visually consistent and more flexible replacement for a native\n * [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist). Can be nested within a `nano-input`\n * or linked to any input control via the `input` prop. Is used internally within `nano-select`.\n * Options can be defined declaratively by nesting `<nano-option>` elements or imperatively using the `options` prop\n *\n * @slot - use `<nano-option>` elements for more complex html. Alternatively use the `options` prop\n * @slot list-top - shows at the top of the list when there are options present\n * @slot list-bottom - shows at the bottom of the list when there are options present\n * @slot no-result - shown when there are no results otherwise nothing will be shown\n */\n@Component({\n tag: 'nano-datalist',\n styleUrl: 'datalist.scss',\n shadow: true,\n})\nexport class DataList implements ComponentInterface {\n // Private State\n\n private isNanoInput = false;\n private typeToSelect = '';\n private typeToSelectTimeout: number;\n private nanoDropdown: HTMLNanoDropdownElement;\n private listBox: HTMLNanoMenuElement;\n private mo?: MutationObserver;\n private listId = `nano-datalist-${listIds++}`;\n private isFiltered = false;\n private shouldFocus = false;\n // all potential option eles. Set via slot or `options` prop.\n // Some may get hidden due to filtering\n private get allOptEles() {\n return this._allOptEles;\n }\n private set allOptEles(opts) {\n // when allOptEles are initially set (on slot change / options) -\n // add options to 'selected' and fire selected event *if*\n // value isn't set on the input\n this._allOptEles = opts;\n if (this.connectedInput?.value) return;\n\n opts.forEach((opt) => {\n if (opt.selected && !this.selected.includes(opt.value)) {\n this.changeInputValue(opt);\n }\n });\n }\n private _allOptEles: HTMLNanoOptionElement[] = [];\n\n @Element() host: HTMLNanoDatalistElement;\n\n // active option eles that are not hidden.\n @State() actvOptEles: HTMLNanoOptionElement[] = [];\n @State() connectedInput: HTMLInputElement | HTMLTextAreaElement;\n @State() inputLabel: HTMLLabelElement;\n @State() hasNoResult: boolean;\n @State() shouldOpen: boolean;\n @State() canOpen: boolean = true;\n @State() optionIds: string[] = [];\n\n constructor() {\n this.inputChange = debounce(this.inputChange.bind(this), 50);\n }\n\n // Public API\n\n /** By default, items in the list will appear 'selected' when the value in the linked input control matches.\n * However you can add other selected options via the the selected prop. */\n @Prop({ mutable: true }) selected: string[] = [];\n\n /** nano-dropdown config options you can pass to the nested dropdown component */\n @Prop()\n get dropDownConfig() {\n return this._dropDownConfig;\n }\n set dropDownConfig(ddc: Partial<Dropdown>) {\n this._dropDownConfig = { ...this._dropDownConfig, ...ddc };\n }\n private _dropDownConfig: Partial<Dropdown> = {\n skidding: -1,\n };\n\n /** Provide an option list.\n * Options can be defined declaratively by nesting `<nano-option>` elements or imperatively using this prop */\n @Prop() options?: OptionInterface[] = [];\n\n /** A selector to a HTMLInputElement */\n @Prop() input?: string | HTMLInputElement;\n\n /** Tweaks the datalist behaviour and linked control semantics and behaviour.\n * e.g. 'select' will make the linked input control `readonly`.\n */\n @Prop() type: 'select' | 'selctMulti' | 'input' = 'input';\n\n /** return all the active options currently within the datalist. Can be useful for validation */\n @Prop()\n get activeOptions() {\n return this.allOptEles;\n }\n\n /** Force datalist open */\n @Prop({ mutable: true }) open: boolean = false;\n\n @Watch('open')\n openWatcher() {\n writeTask(() => {\n this.nanoDropdown.open = this.open;\n if (this.connectedInput)\n this.connectedInput.setAttribute('aria-expanded', this.open.toString());\n });\n }\n\n /** Use this option to disable to default filtering. This is useful if filtering happens\n * externally via another method (e.g. via ajax)\n */\n @Prop() disableFilter = false;\n\n /** Activate / deactivate the datalist control */\n @Prop() disabled = false;\n\n // State change watchers\n\n @Watch('input')\n async watchInputChange() {\n let nanoInput;\n if ((nanoInput = this.host.closest('nano-input'))) {\n this.isNanoInput = true;\n this.connectedInput = await nanoInput.getInputElement();\n } else if (\n this.input &&\n typeof this.input === 'string' &&\n (nanoInput = document.querySelector(this.input))\n ) {\n this.isNanoInput = false;\n this.connectedInput = nanoInput;\n } else if (typeof this.input === 'object') {\n this.connectedInput = this.input;\n }\n }\n\n @Watch('options')\n manageSlotChangeListener() {\n if (!this.host) return;\n\n // we're not using `options` - setup new MO\n if ((!this.options || !this.options.length) && !this.mo) {\n if (Build.isBrowser) {\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.host, { childList: true, subtree: true });\n }\n this.processSlottedContent();\n return;\n }\n\n // we're using `options` - trash current MO\n if (this.options?.length) {\n if (!!this.mo) {\n this.mo.disconnect();\n this.mo = undefined;\n }\n\n const previousOptions = this.host.querySelectorAll(\n '[slot=\"internal-opts\"]'\n );\n\n // add imperative `options`\n writeTask(() => {\n // clear all previous\n if (previousOptions?.length)\n previousOptions.forEach((internalOpt) => internalOpt.remove());\n\n this.allOptEles = this.options.flatMap((option, i) => {\n if (option.value || option.label) {\n const opt = Object.assign(document.createElement('nano-option'), {\n label: option.label,\n value: option.value,\n ariaPosinset: i,\n ariaSetsize: this.options.length,\n selected: option.selected,\n id: this.listId + '-option-' + i,\n textContent: option.label ? option.label : option.value,\n slot: 'internal-opts',\n });\n this.host.append(opt);\n return opt;\n }\n });\n\n if (this.connectedInput?.value.length && this.type !== 'select') {\n this.inputChange();\n } else {\n this.actvOptEles = [...this.allOptEles];\n }\n });\n }\n // forceUpdate(this.host);\n }\n\n @Watch('type')\n @Watch('connectedInput')\n watchTypeChange() {\n if (!this.connectedInput) return;\n\n let dwConfig: Partial<Dropdown> = { closeOnSelect: false };\n let autocompleteType: 'list' | 'both' = 'both';\n let readonly = false;\n\n switch (this.type) {\n case 'input':\n dwConfig = { closeOnSelect: true };\n break;\n case 'select':\n autocompleteType = 'list';\n readonly = true;\n dwConfig = { closeOnSelect: true, placement: 'center' };\n break;\n }\n\n if (!this.isNanoInput) {\n dwConfig.tetherTo = this.connectedInput;\n }\n\n this.dropDownConfig = { ...this.dropDownConfig, ...dwConfig };\n this.connectedInput.setAttribute('aria-autocomplete', autocompleteType);\n this.connectedInput.readOnly = readonly;\n }\n\n @Watch('connectedInput')\n manageInputEvents(newInput?: HTMLInputElement, oldInput?: HTMLInputElement) {\n if (!!oldInput) {\n const nanoInput = oldInput.closest('nano-input');\n if (nanoInput) {\n nanoInput.removeEventListener('nanoChange', this.inputChange);\n }\n this.removeEventListeners(oldInput);\n\n this.inputLabel = null;\n\n writeTask(() => {\n oldInput.removeAttribute('role');\n oldInput.removeAttribute('aria-expanded');\n oldInput.removeAttribute('aria-controls');\n oldInput.removeAttribute('aria-owns');\n oldInput.removeAttribute('aria-haspopup');\n oldInput.removeAttribute('aria-autocomplete');\n oldInput.removeAttribute('autocomplete');\n });\n }\n if (!!newInput) {\n const nanoInput = newInput.closest('nano-input');\n if (nanoInput) {\n nanoInput.addEventListener('nanoChange', this.inputChange);\n }\n newInput.addEventListener('change', this.inputChange);\n newInput.addEventListener('click', this.inputClick);\n newInput.addEventListener('keydown', this.inputKeydown);\n newInput.addEventListener('input', this.inputChange);\n this.listId = this.host.id || this.listId;\n\n this.inputLabel = newInput?.labels?.item(0) || findLabel(newInput);\n\n writeTask(() => {\n this.host.id = this.listId;\n newInput.setAttribute('role', 'combobox');\n newInput.setAttribute('aria-expanded', 'false');\n newInput.setAttribute('aria-controls', this.listId);\n newInput.setAttribute('aria-owns', this.listId);\n newInput.setAttribute('aria-haspopup', 'listbox');\n newInput.setAttribute('autocomplete', 'off');\n });\n }\n }\n\n @Watch('selected')\n @Watch('actvOptEles')\n watchActvOptChange() {\n let c = 0;\n const val = this.connectedInput?.value || '';\n const optIds = [];\n\n writeTask(() => {\n this.allOptEles.forEach((opt, i) => {\n if (this.actvOptEles.includes(opt)) {\n c++;\n opt.setAttribute('aria-posinset', c + '');\n opt.setAttribute('aria-setsize', this.actvOptEles.length + '');\n opt.hidden = false;\n this.isSelected(opt, val);\n } else {\n opt.removeAttribute('aria-posinset');\n opt.removeAttribute('aria-setsize');\n opt.hidden = true;\n opt.selected = false;\n }\n opt.id = this.listId + '-option-' + i;\n optIds.push(opt.id);\n });\n this.optionIds = optIds;\n });\n }\n\n @Watch('actvOptEles')\n @Watch('hasNoResult')\n manageCanOpen() {\n if (this.actvOptEles.length || this.hasNoResult) this.canOpen = true;\n else this.canOpen = false;\n }\n\n /**\n * Opens the dropdown if it can, it should and there are items to display.\n */\n @Watch('shouldOpen')\n @Watch('canOpen')\n manageDropdownDisplay() {\n if (this.shouldOpen && this.canOpen && !this.disabled) this.open = true;\n if (!this.shouldOpen || !this.canOpen) this.open = false;\n this.openWatcher();\n }\n\n @Watch('actvOptEles')\n fireActiveOptsEvent() {\n this.nanoOptionsUpdated.emit(this.actvOptEles);\n }\n\n // Events\n\n /** Fired when an item is selected. */\n @Event() nanoSelect: EventEmitter<HTMLNanoOptionElement>;\n\n /** Fired when a currently selected item is reselected. */\n @Event() nanoDeselect: EventEmitter<HTMLNanoOptionElement>;\n\n /** Fired when active options change */\n @Event() nanoOptionsUpdated: EventEmitter<HTMLNanoOptionElement[]>;\n\n // Private logic\n\n private isSelected(opt: HTMLNanoOptionElement, val: string) {\n if (val === opt.value || this.selected.includes(opt.value)) {\n opt.selected = true;\n } else opt.selected = false;\n }\n\n private get dropwdownOpen() {\n if (!this.nanoDropdown || !this.open) return false;\n return true;\n }\n\n private get exactMatch() {\n return this.allOptEles.find(\n (opt) => this.connectedInput.value === opt.value\n );\n }\n\n /** reflect value back to the connected input unless the event is cancelled */\n private changeInputValue(opt: HTMLNanoOptionElement) {\n let nanoSelected;\n\n if (this.selected.includes(opt.value)) {\n // deselect option\n this.selected = this.selected.filter((val) => val !== opt.value);\n nanoSelected = this.nanoDeselect.emit(opt);\n } else {\n // select new option\n this.selected = [...this.selected];\n nanoSelected = this.nanoSelect.emit(opt);\n }\n\n if (!nanoSelected.defaultPrevented) {\n if (this.connectedInput) this.connectedInput.value = opt.value;\n\n const event = new window.Event('change');\n this.connectedInput?.dispatchEvent(event);\n }\n }\n\n // a new option has been picked\n private optSelected = (e: NanoMenuCustomEvent<HTMLNanoOptionElement>) => {\n e.stopPropagation();\n this.changeInputValue(e.detail);\n requestAnimationFrame(() => this.inputChange());\n\n if (this.type !== 'selctMulti') this.shouldOpen = false;\n };\n\n // this is for type=\"select\" only.\n // Filter options that start with text - aggregates letters (as opposed to getting the value from input)\n private setOptStartsWith() {\n const attrFind = (toFind: string) =>\n toFind.toLowerCase().substring(0, this.typeToSelect.length) ===\n this.typeToSelect;\n\n const foundEle = this.allOptEles.find(\n (opt) =>\n opt.value.trim().length > 0 &&\n !opt.disabled &&\n (attrFind(opt.textContent) ||\n attrFind(opt.value) ||\n attrFind(opt.label) ||\n attrFind(opt.filterMeta))\n );\n if (foundEle) this.changeInputValue(foundEle);\n }\n\n // Event handlers\n\n private removeEventListeners(\n oldInput: HTMLInputElement | HTMLTextAreaElement\n ) {\n const nanoInput = oldInput.closest('nano-input');\n if (nanoInput) {\n nanoInput.removeEventListener('nanoChange', this.inputChange);\n }\n oldInput.removeEventListener('change', this.inputChange);\n oldInput.removeEventListener('click', this.inputClick);\n oldInput.removeEventListener('keydown', this.inputKeydown);\n oldInput.removeEventListener('input', this.inputChange);\n }\n\n private processSlottedContent() {\n requestAnimationFrame(() => {\n this.allOptEles = Array.from(this.host.querySelectorAll('nano-option'));\n this.hasNoResult = !!this.host.querySelector('[slot=\"no-result\"]');\n\n if (this.connectedInput?.value.length && this.type !== 'select') {\n this.inputChange();\n } else this.actvOptEles = this.allOptEles;\n });\n }\n\n // sets focus immediately on open when 'select' - mirroring native behaviour\n private handleShow = async () => {\n if (this.shouldFocus) {\n this.shouldFocus = false;\n this.listBox.setFocus();\n } else if (this.type === 'select') this.listBox.showActiveElement();\n };\n\n private handleHide = () => {\n this.open = false;\n const activeElement = getActiveElement();\n if (activeElement.closest(this.host.tagName.toLowerCase())) {\n this.connectedInput.select();\n }\n };\n\n // any changes to the connected input value will filter the list of active options\n private inputChange() {\n if (this.disableFilter) {\n this.actvOptEles = this.allOptEles;\n return;\n }\n\n const val = this.connectedInput.value;\n const valStr = val.trim().toLowerCase();\n\n let exactMatch = false;\n const activeEles = [];\n const attrFind = (toFind: string) =>\n toFind.toLowerCase().indexOf(valStr) > -1;\n\n this.allOptEles.forEach((opt) => {\n if (\n (val === opt.value || val === opt.label) &&\n this.type !== 'selctMulti'\n ) {\n opt.selected = true;\n exactMatch = true;\n } else this.isSelected(opt, val);\n });\n\n this.allOptEles.forEach((opt) => {\n if (!valStr.length || exactMatch) {\n activeEles.push(opt);\n } else if (\n opt.value.trim().length > 0 &&\n !opt.disabled &&\n (attrFind(opt.textContent) ||\n attrFind(opt.value) ||\n attrFind(opt.label) ||\n attrFind(opt.filterMeta))\n ) {\n activeEles.push(opt);\n }\n });\n\n this.isFiltered = valStr.length && !exactMatch;\n this.actvOptEles = activeEles;\n }\n\n private inputClick = () => {\n this.shouldOpen = true;\n // open dropdown if possible\n this.manageDropdownDisplay();\n };\n\n private inputKeydown = (e: KeyboardEvent) => {\n const ignoreKeys = [\n 'Shift',\n 'ArrowRight',\n 'ArrowLeft',\n 'Escape',\n 'Enter',\n 'Tab',\n ];\n if (ignoreKeys.includes(e.key)) {\n if (e.key === 'Tab') this.shouldOpen = false;\n return;\n }\n\n // When select, mirror native select behaviour. Search on closed list\n if (\n this.type === 'select' &&\n !['ArrowDown', 'ArrowUp'].includes(e.key) &&\n (e.key !== ' ' || this.typeToSelectTimeout)\n ) {\n if (e.key === ' ' || /^[a-z0-9]+$/i.test(e.key)) {\n clearTimeout(this.typeToSelectTimeout);\n this.typeToSelectTimeout = window.setTimeout(() => {\n this.typeToSelect = '';\n this.typeToSelectTimeout = 0;\n }, 750);\n this.typeToSelect += e.key;\n this.setOptStartsWith();\n }\n return;\n }\n\n this.shouldOpen = true;\n // open dropdown if possible\n this.manageDropdownDisplay();\n if (['ArrowDown', 'ArrowUp'].includes(e.key)) {\n e.preventDefault();\n this.shouldFocus = true;\n }\n };\n\n // handles key down on options. Either 'picks'\n // an option or passes event back to input for search / filter\n private optionKeyDown = (\n e: KeyboardEvent & { target: HTMLNanoOptionElement }\n ) => {\n const ignoreKeys = [\n 'Shift',\n 'ArrowUp',\n 'ArrowDown',\n 'Escape',\n 'Enter',\n 'Tab',\n 'Space',\n 'PageUp',\n 'PageDown',\n 'Home',\n 'End',\n ' ',\n ];\n if (ignoreKeys.includes(e.key)) {\n if (e.key === 'Escape') this.connectedInput.focus();\n return;\n }\n\n const deleteKeys = ['Delete', 'Backspace'];\n // this passes whatever's typed back to our input control\n if (\n this.type !== 'select' &&\n (!this.exactMatch || deleteKeys.includes(e.key))\n ) {\n this.connectedInput.focus();\n }\n };\n\n // Component lifecycle\n\n connectedCallback() {\n this.watchInputChange();\n }\n\n componentDidLoad() {\n this.manageSlotChangeListener();\n this.openWatcher();\n }\n\n componentDidRender(): void {\n setTimeout(() => {\n if (!this.connectedInput)\n console.warn(\n 'no `nano-input` found. `nano-datalist` should be nested within an `nano-input` or linked via `input` prop',\n this.host\n );\n }, 500);\n }\n\n disconnectedCallback(): void {\n if (!!this.mo) {\n this.mo.disconnect();\n this.mo = undefined;\n }\n if (this.connectedInput) this.removeEventListeners(this.connectedInput);\n }\n\n render() {\n return (\n <Host\n role={this.actvOptEles.length ? 'listbox' : undefined}\n aria-owns={this.optionIds.length ? this.optionIds.join(' ') : undefined}\n aria-label={\n this.optionIds.length\n ? 'Select options from the list below'\n : undefined\n }\n >\n <nano-dropdown\n {...this.dropDownConfig}\n ref={(el) => (this.nanoDropdown = el)}\n dialogTitle=\"Select options from the list below\"\n class={{\n dlist__dropdown: true,\n 'dlist--isfiltered': this.isFiltered,\n }}\n onNanoAfterShow={this.handleShow}\n onNanoAfterHide={this.handleHide}\n role=\"group\"\n >\n <nano-menu\n hidden={!this.actvOptEles.length}\n type=\"listbox\"\n label={this.inputLabel ? this.inputLabel.textContent : undefined}\n class={{\n dlist__menu: true,\n 'dlist__menu--open': this.dropwdownOpen,\n }}\n tabIndex={-1}\n onNanoSelect={this.optSelected}\n onKeyDown={this.optionKeyDown}\n ref={(el) => (this.listBox = el)}\n role=\"list\"\n >\n <slot name=\"list-top\" />\n {!this.options.length && <slot />}\n {!!this.options.length && <slot name=\"internal-opts\" />}\n <slot name=\"list-bottom\" />\n </nano-menu>\n <nano-menu\n type=\"listbox\"\n label=\"No results found\"\n hidden={!!this.actvOptEles.length}\n class={{\n dlist__menu: true,\n 'dlist__menu--open': this.dropwdownOpen,\n }}\n >\n <slot name=\"no-result\" />\n </nano-menu>\n {!!this.actvOptEles && (\n <div class=\"dlist__status\">\n {this.actvOptEles.length} result\n {this.actvOptEles.length > 1 ? 's' : ''} available.\n </div>\n )}\n </nano-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}