@nanoporetech-digital/components 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/cjs/{local-my-account-a3362993.js → local-my-account-d79ed0a2.js} +1 -1
- package/dist/cjs/{local-my-account-a3362993.js.map → local-my-account-d79ed0a2.js.map} +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-demo.cjs.entry.js +48 -47
- package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav.cjs.entry.js +4 -3
- package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-overflow-nav.cjs.entry.js +2 -0
- package/dist/cjs/nano-overflow-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-737365b7.js → nano-table-d5eb9221.js} +2 -2
- package/dist/cjs/nano-table-d5eb9221.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-c3b11144.js → table.worker-37f25c78.js} +2 -2
- package/dist/cjs/table.worker-37f25c78.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox.css +18 -12
- package/dist/collection/components/demo/demo.js +48 -47
- package/dist/collection/components/demo/demo.js.map +1 -1
- package/dist/collection/components/global-nav/assets/local-my-account.json +341 -0
- package/dist/collection/components/global-nav/global-nav-user-profile.js +1 -1
- package/dist/collection/components/global-nav/global-nav-user-profile.js.map +1 -1
- package/dist/collection/components/global-nav/global-nav.js +3 -2
- package/dist/collection/components/global-nav/global-nav.js.map +1 -1
- package/dist/collection/components/global-nav/style/global-nav.css +7 -4
- package/dist/collection/components/icon/utils.js +1 -1
- package/dist/collection/components/icon/utils.js.map +1 -1
- package/dist/collection/components/overflow-nav/overflow-nav.js +2 -0
- package/dist/collection/components/overflow-nav/overflow-nav.js.map +1 -1
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.js +8 -4
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/components/global-nav-user-profile.js +1 -1
- package/dist/components/global-nav-user-profile.js.map +1 -1
- package/dist/components/icon.js +1 -1
- package/dist/components/icon.js.map +1 -1
- package/dist/components/nano-checkbox.js +1 -1
- package/dist/components/nano-checkbox.js.map +1 -1
- package/dist/components/nano-demo.js +48 -47
- package/dist/components/nano-demo.js.map +1 -1
- package/dist/components/nano-global-nav.js +3 -2
- package/dist/components/nano-global-nav.js.map +1 -1
- package/dist/components/nano-overflow-nav.js +2 -0
- package/dist/components/nano-overflow-nav.js.map +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/esm/{local-my-account-964c8ad7.js → local-my-account-6662da72.js} +1 -1
- package/dist/esm/{local-my-account-964c8ad7.js.map → local-my-account-6662da72.js.map} +1 -1
- package/dist/esm/nano-checkbox.entry.js +1 -1
- package/dist/esm/nano-checkbox.entry.js.map +1 -1
- package/dist/esm/nano-demo.entry.js +48 -47
- package/dist/esm/nano-demo.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-global-nav.entry.js +4 -3
- package/dist/esm/nano-global-nav.entry.js.map +1 -1
- package/dist/esm/nano-icon.entry.js +1 -1
- package/dist/esm/nano-icon.entry.js.map +1 -1
- package/dist/esm/nano-overflow-nav.entry.js +2 -0
- package/dist/esm/nano-overflow-nav.entry.js.map +1 -1
- package/dist/esm/{nano-table-75d755ae.js → nano-table-81cc50c7.js} +2 -2
- package/dist/esm/nano-table-81cc50c7.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{table.worker-d60d6df4.js → table.worker-86754436.js} +2 -2
- package/dist/esm/table.worker-86754436.js.map +1 -0
- package/dist/nano-assets/hash.txt +1 -1
- package/dist/nano-assets/local-my-account.json +341 -0
- package/dist/nano-components/assets/local-my-account.json +341 -0
- package/dist/nano-components/assets/ont-logo.svg +89 -0
- package/dist/nano-components/assets/ont-wheel-light.svg +31 -0
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/{p-42e7f253.js → p-099a573a.js} +2 -2
- package/dist/nano-components/{p-42e7f253.js.map → p-099a573a.js.map} +1 -1
- package/dist/nano-components/p-0c077605.entry.js +5 -0
- package/dist/nano-components/p-0c077605.entry.js.map +1 -0
- package/dist/nano-components/{p-1b7bad31.entry.js → p-1525c97b.entry.js} +2 -2
- package/dist/nano-components/p-173cc842.entry.js +5 -0
- package/dist/nano-components/p-173cc842.entry.js.map +1 -0
- package/dist/nano-components/{p-c53b232e.js → p-2155fc2c.js} +1 -1
- package/dist/nano-components/p-6c47fdc2.js +5 -0
- package/dist/nano-components/p-7730ce8e.entry.js +5 -0
- package/dist/nano-components/{p-d0e15e46.entry.js.map → p-7730ce8e.entry.js.map} +1 -1
- package/dist/nano-components/{p-f93bd976.entry.js → p-b38cabe2.entry.js} +2 -2
- package/dist/nano-components/p-b38cabe2.entry.js.map +1 -0
- package/dist/nano-components/p-dc8fd62d.entry.js +5 -0
- package/dist/nano-components/p-dc8fd62d.entry.js.map +1 -0
- package/dist/nano-components/p-fa658659.entry.js +5 -0
- package/dist/nano-components/p-fa658659.entry.js.map +1 -0
- package/dist/types/components/demo/demo.d.ts +1 -0
- package/dist/types/components/table/table-interface.d.ts +5 -2
- package/dist/types/components/table/table.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/docs-json.json +18 -8
- package/hydrate/index.js +55 -51
- package/package.json +2 -2
- package/dist/cjs/nano-table-737365b7.js.map +0 -1
- package/dist/cjs/table.worker-c3b11144.js.map +0 -1
- package/dist/esm/nano-table-75d755ae.js.map +0 -1
- package/dist/esm/table.worker-d60d6df4.js.map +0 -1
- package/dist/nano-components/p-583d8d70.entry.js +0 -5
- package/dist/nano-components/p-583d8d70.entry.js.map +0 -1
- package/dist/nano-components/p-b2655717.entry.js +0 -5
- package/dist/nano-components/p-b2655717.entry.js.map +0 -1
- package/dist/nano-components/p-d0e15e46.entry.js +0 -5
- package/dist/nano-components/p-d4cebdef.entry.js +0 -5
- package/dist/nano-components/p-d4cebdef.entry.js.map +0 -1
- package/dist/nano-components/p-d98c6a62.js +0 -5
- package/dist/nano-components/p-f471a392.entry.js +0 -5
- package/dist/nano-components/p-f471a392.entry.js.map +0 -1
- package/dist/nano-components/p-f93bd976.entry.js.map +0 -1
- /package/dist/nano-components/{p-1b7bad31.entry.js.map → p-1525c97b.entry.js.map} +0 -0
- /package/dist/nano-components/{p-c53b232e.js.map → p-2155fc2c.js.map} +0 -0
- /package/dist/nano-components/{p-d98c6a62.js.map → p-6c47fdc2.js.map} +0 -0
@@ -232,9 +232,9 @@
|
|
232
232
|
}
|
233
233
|
.main-bar .nav-links--main {
|
234
234
|
justify-content: flex-start;
|
235
|
-
letter-spacing:
|
236
|
-
font-weight:
|
237
|
-
font-stretch:
|
235
|
+
letter-spacing: 1.5px;
|
236
|
+
font-weight: 600;
|
237
|
+
font-stretch: condensed;
|
238
238
|
text-transform: uppercase;
|
239
239
|
font-size: 1.065em;
|
240
240
|
-webkit-margin-end: auto;
|
@@ -662,7 +662,9 @@ nano-select.search-input {
|
|
662
662
|
--nano-input-border-color: rgb(103 138 154);
|
663
663
|
--padding-end: var(--bar-item-spacing);
|
664
664
|
--nano-input-border-color--focus: black;
|
665
|
-
font-stretch:
|
665
|
+
font-stretch: condensed;
|
666
|
+
font-weight: 600;
|
667
|
+
letter-spacing: 1.5px;
|
666
668
|
font-size: 1.2em;
|
667
669
|
flex: 0 1 auto;
|
668
670
|
width: auto;
|
@@ -783,6 +785,7 @@ nano-input.search-input .search-icon nano-icon {
|
|
783
785
|
-webkit-padding-end: 0;
|
784
786
|
padding-inline-end: 0;
|
785
787
|
font-weight: 500;
|
788
|
+
padding: 7px;
|
786
789
|
}
|
787
790
|
.user-links .icon-btn nano-icon {
|
788
791
|
-webkit-margin-start: 5px;
|
@@ -37,7 +37,7 @@ const getNamedUrl = (iconName) => {
|
|
37
37
|
if (url) {
|
38
38
|
return url;
|
39
39
|
}
|
40
|
-
return getAssetPath(
|
40
|
+
return getAssetPath(`../nano-assets/fontawesome-pro/svgs/${iconName}.svg`);
|
41
41
|
};
|
42
42
|
export const getName = (iconName, icon) => {
|
43
43
|
if (!iconName && icon && !isSrc(icon)) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/icon/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,IAAI,UAA+B,CAAC;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAwB,EAAE;EAClD,IAAI,CAAC,UAAU,EAAE;IACf,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;IACpC,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC;GACjE;EACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAiC,EAAE,EAAE;EAC5D,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;EACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;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string, string> => {\n if (!CACHED_MAP) {\n const win = window as any;\n win.Nanoicons = win.Nanoicons || {};\n CACHED_MAP = win.Nanoicons.map = win.Nanoicons.map || new Map();\n }\n return CACHED_MAP;\n};\n\nexport const addIcons = (icons: { [name: string]: string }) => {\n const map = getIconMap();\n Object.keys(icons).forEach((name) => map.set(name, icons[name]));\n};\n\nexport const getUrl = (i: Icon) => {\n let url = getSrc(i.src);\n if (url) {\n return url;\n }\n\n url = getName(i.name, i.icon);\n if (url) {\n return getNamedUrl(url);\n }\n\n if (i.icon) {\n url = getSrc(i.icon);\n if (url) {\n return url;\n }\n }\n return null;\n};\n\nconst getNamedUrl = (iconName: string) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n return getAssetPath(`../nano-assets/fontawesome-pro/svgs/${iconName}.svg`);\n};\n\nexport const getName = (\n iconName: string | undefined,\n icon: string | undefined\n) => {\n if (!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n\n // only allow alpha characters and dash\n const invalidChars = iconName.replace(/[a-z]|-|\\/|\\d/gi, '');\n if (invalidChars !== '') {\n console.warn('invalid characters in icon name ' + iconName);\n return null;\n }\n return iconName;\n};\n\nexport const getSrc = (src: string | undefined) => {\n if (isStr(src)) {\n src = src.trim();\n if (isSrc(src)) {\n return src;\n }\n }\n return null;\n};\n\nexport const isSrc = (str: string) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val: any): val is string => typeof val === 'string';\nexport const toLower = (val: string) => val.toLowerCase();\n"]}
|
@@ -25,6 +25,8 @@ export class OverflowNav {
|
|
25
25
|
// private state
|
26
26
|
constructor() {
|
27
27
|
this.updateScrollControls = () => {
|
28
|
+
if (!this.nav)
|
29
|
+
return;
|
28
30
|
this.hasScrollControls =
|
29
31
|
this.nav[this.scrollProp] > this.nav[this.clientDimProp] &&
|
30
32
|
this.nav[this.scrollProp] > this.itemContainer[this.clientDimProp];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"overflow-nav.js","sourceRoot":"","sources":["../../../src/components/overflow-nav/overflow-nav.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AAOH,MAAM,OAAO,WAAW;EA+BtB,gBAAgB;EAEhB;IA8JQ,yBAAoB,GAAG,GAAG,EAAE;MAClC,IAAI,CAAC,iBAAiB;QACpB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC;UACxD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;MACrE,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC;IAEM,iBAAY,GAAG,GAAG,EAAE;MAC1B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAC3B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QACnD,OAAO;OACR;MACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK;QAC1B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QACnC,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC;UAC1B,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,I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AC,EACtC,KAAK,EAAC,aAAa;cAEnB,WACE,IAAI,EAAC,WAAW,EAChB,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC,EACxC,KAAK,EAAC,wBAAwB,GAC9B;cACF,YAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,GAAI,CAC1C,CACF;UAEL,IAAI,CAAC,cAAc,IAAI,CACtB,wBACE,IAAI,EAAC,kCAAkC,EACvC,KAAK,EAAE;cACL,qBAAqB,EAAE,IAAI;cAC3B,0BAA0B,EAAE,IAAI;aACjC,EACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EACxC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EACN,IAAI,CAAC,WAAW,KAAK,YAAY;cAC/B,CAAC,CAAC,qBAAqB;cACvB,CAAC,CAAC,oBAAoB,GAE1B,CACH,CACG,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n ComponentInterface,\n Host,\n h,\n Element,\n Prop,\n Watch,\n State,\n} from '@stencil/core';\nimport { getDirectChildren, getOffset } from '../../utils/dom';\nimport { debounce } from '../../utils/throttle';\n\n/**\n * Primarily used to display navigational items that may not fit on smaller screens.\n *\n * - Accepts any collection of elements\n * - Gives visual cues of 'more' with auto display fade effect and scroll buttons\n * - Auto scrolls to the active item onload\n *\n * @slot - Default slot to place items.\n *\n * @part base - root, wrapper element\n * @part scroller - the scrolling element\n * @part items - the item wrapper element\n * @part indicator - the animated, indicator element\n * @part scroll-button - The buttons shown at either side of the scrolling area\n * @part scroll-button-prev - The button shown at the start of the scrolling area\n * @part scroll-button-next - The button shown at the end of the scrolling area\n */\n\n@Component({\n tag: 'nano-overflow-nav',\n styleUrl: 'overflow-nav.scss',\n shadow: true,\n})\nexport class OverflowNav implements ComponentInterface {\n // public surface\n\n /** Disables the scroll arrow buttons that appear when content overflows */\n @Prop() scrollControls = true;\n\n /** The flex direction of the element */\n @Prop({ reflect: true }) orientation: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * A function called when an item becomes 'active' (via click or keyboard)\n * @param item\n * @returns void */\n @Prop() activeHandler = (item: HTMLElement) => item.classList.add('active');\n\n /**\n * A function called when an item becomes 'inactive'\n * (because another item was made active)\n * @param item\n * @returns void */\n @Prop() inActiveHandler = (item: HTMLElement) =>\n item.classList.remove('active');\n\n /**\n * A function called to assess an initial, active item\n * @param item\n * @returns void */\n @Prop() isActiveHandler = (item: HTMLElement) =>\n item.classList.contains('active');\n\n // private state\n\n constructor() {\n this.recalculatePositions = debounce(this.recalculatePositions, 50);\n }\n\n private ro?: ResizeObserver;\n private nav?: HTMLElement;\n private itemContainer?: HTMLElement;\n private isRtl?: boolean;\n private endBtn: HTMLNanoIconButtonElement;\n private startBtn: HTMLNanoIconButtonElement;\n private activeIndicator: HTMLElement;\n\n get scrollProp() {\n return this.orientation === 'horizontal' ? 'scrollWidth' : 'scrollHeight';\n }\n\n get clientDimProp() {\n return this.orientation === 'horizontal' ? 'clientWidth' : 'clientHeight';\n }\n\n get scrollOffset() {\n return this.orientation === 'horizontal' ? 'scrollLeft' : 'scrollTop';\n }\n\n @Element() host: HTMLNanoOverflowNavElement;\n\n @State() hasScrollControls = false;\n\n @Watch('hasScrollControls')\n watchScrollControls() {\n if (this.hasScrollControls) this.handleScroll();\n else this.hideControlStart = this.hideControlEnd = true;\n }\n\n @State() hideControlEnd = true;\n\n @Watch('hideControlEnd')\n hideEndBtn() {\n if (!this.endBtn) return;\n this.activateBtn(this.endBtn, !this.hideControlEnd);\n }\n\n @State() hideControlStart = true;\n\n @Watch('hideControlStart')\n hideStartBtn() {\n if (!this.startBtn) return;\n this.activateBtn(this.startBtn, !this.hideControlStart);\n }\n\n // private logic\n\n private activateBtn(btn: HTMLNanoIconButtonElement, activate = true) {\n if (!activate) {\n btn.tabIndex = -1;\n btn.disabled = true;\n btn.classList.remove('is-shown');\n return;\n }\n btn.tabIndex = 0;\n btn.disabled = false;\n btn.classList.add('is-shown');\n }\n\n get allActiveItems() {\n return this.allItems.filter(\n (el: any) => !el.disabled || el.classList.contains('disabled')\n );\n }\n\n get allItems() {\n return getDirectChildren<HTMLElement>(this.host, '*', true);\n }\n\n get activeItem() {\n if (this._activeItem) return this._activeItem;\n return this.allActiveItems.find((el) => this.isActiveHandler(el));\n }\n\n set activeItem(item: HTMLElement) {\n if (\n !item ||\n item === this.activeItem ||\n (item as any).disabled ||\n !this.allActiveItems.includes(item)\n ) {\n return;\n }\n\n this._activeItem = item;\n this.allActiveItems.forEach((el) => {\n if (el === this._activeItem) this.activeHandler(el);\n else this.inActiveHandler(el);\n });\n this.syncActiveItemIndicator();\n this.scrollToActiveItem();\n }\n private _activeItem: HTMLElement;\n\n get navDim() {\n if (!this.nav) return 0;\n\n const computedStyle = getComputedStyle(this.nav);\n let clientDim = this.nav[this.clientDimProp];\n\n if (this.orientation === 'horizontal') {\n return (clientDim -=\n parseFloat(computedStyle.paddingLeft) +\n parseFloat(computedStyle.paddingRight));\n } else {\n return (clientDim -=\n parseFloat(computedStyle.paddingTop) +\n parseFloat(computedStyle.paddingBottom));\n }\n }\n\n private scrollToActiveItem(instant?: boolean) {\n if (!this.nav || !this.activeItem) return;\n requestAnimationFrame(() => {\n this.activeItem.scrollIntoView({\n behavior: instant ? 'auto' : 'smooth',\n block: 'center',\n inline: 'center',\n });\n });\n }\n\n private syncActiveItemIndicator(instant?: boolean) {\n if (!this.activeItem) return;\n\n const item = this.activeItem;\n const width = item.clientWidth || 0;\n const height = item.clientHeight + 2 || 0;\n const offset = getOffset(item, this.itemContainer);\n\n if (!this.activeIndicator) return;\n\n const offsetTop = offset.top;\n const offsetLeft = offset.left;\n\n if (instant) this.activeIndicator.style.transition = 'none';\n\n switch (this.orientation) {\n case 'horizontal':\n this.activeIndicator.style.width = `${width}px`;\n this.activeIndicator.style.height = null;\n this.activeIndicator.style.transform = `translateX(${offsetLeft}px)`;\n break;\n\n case 'vertical':\n this.activeIndicator.style.width = null;\n this.activeIndicator.style.height = `${height}px`;\n this.activeIndicator.style.transform = `translateY(${offsetTop}px)`;\n break;\n }\n setTimeout(() => (this.activeIndicator.style.transition = null), 400);\n }\n\n private updateScrollControls = () => {\n this.hasScrollControls =\n this.nav[this.scrollProp] > this.nav[this.clientDimProp] &&\n this.nav[this.scrollProp] > this.itemContainer[this.clientDimProp];\n this.handleScroll();\n };\n\n private handleScroll = () => {\n if (!this.hasScrollControls) {\n this.hideControlStart = this.hideControlEnd = true;\n return;\n }\n const finishEnd = this.isRtl\n ? this.nav[this.scrollOffset] === 0\n : Math.abs(\n this.nav[this.clientDimProp] -\n (this.nav[this.scrollProp] - this.nav[this.scrollOffset])\n ) < 2;\n\n const finishStart = this.isRtl\n ? Math.abs(\n this.nav[this.scrollProp] +\n this.nav[this.scrollOffset] -\n this.nav[this.clientDimProp]\n ) < 2\n : this.nav[this.scrollOffset] === 0;\n\n if (finishStart) {\n this.hideControlStart = true;\n this.hideControlEnd = false;\n } else if (finishEnd) {\n this.hideControlStart = false;\n this.hideControlEnd = true;\n } else {\n this.hideControlEnd = false;\n this.hideControlStart = false;\n }\n };\n\n private handleBtnClick = (goEnd: boolean = false) => {\n const navDim = this.navDim;\n let scrollAmt;\n if (goEnd) scrollAmt = this.nav[this.scrollOffset] + navDim - 20;\n else scrollAmt = this.nav[this.scrollOffset] - navDim + 20;\n\n try {\n this.nav.scroll({\n left: this.orientation === 'horizontal' ? scrollAmt : 0,\n top: this.orientation === 'vertical' ? scrollAmt : 0,\n behavior: 'smooth',\n });\n } catch (e) {\n this.nav[this.scrollOffset] = scrollAmt;\n }\n };\n\n private slotChangeHandler = () => {\n if (this.allActiveItems.length < 2) return;\n const item = this.allActiveItems.find((el) => this.isActiveHandler(el));\n if (item) this.activeItem = item;\n this.recalculatePositions();\n };\n\n private handleClick = (event: MouseEvent) => {\n if (this.allActiveItems.length < 2) return;\n const foundItem = event\n .composedPath()\n .find((e) => this.allActiveItems.includes(e as any)) as HTMLElement;\n if (foundItem) this.activeItem = foundItem;\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Activate a tab\n if (['Enter', ' '].includes(event.key)) {\n const foundItem = event\n .composedPath()\n .find((e) => this.allActiveItems.includes(e as any)) as HTMLElement;\n if (foundItem) this.activeItem = foundItem;\n }\n };\n\n private recalculatePositions = (init?: any) => {\n this.updateScrollControls();\n this.syncActiveItemIndicator(init);\n setTimeout(() => this.scrollToActiveItem(init), 300);\n };\n\n // lifecycle\n\n connectedCallback(): void {\n this.isRtl =\n this.orientation === 'horizontal' && !!this.host.closest('[dir=\"rtl\"]');\n\n if (!window['ResizeObserver']) return;\n\n if (this.ro) {\n this.ro.disconnect();\n this.ro = undefined;\n }\n const mo = (this.ro = new ResizeObserver(this.recalculatePositions));\n mo.observe(this.host);\n }\n\n componentDidLoad(): void {\n this.recalculatePositions(true);\n }\n\n disconnectedCallback(): void {\n if (this.ro) {\n this.ro.disconnect();\n this.ro = undefined;\n }\n }\n\n render() {\n return (\n <Host dir={this.isRtl ? 'rtl' : null}>\n <div\n part=\"base\"\n class={{\n onav: true,\n [`onav--${this.orientation}`]: true,\n 'onav--has-scroll-controls': this.hasScrollControls,\n 'onav--has-scroll-controls-start': !this.hideControlStart,\n 'onav--has-scroll-controls-end': !this.hideControlEnd,\n }}\n onClick={this.handleClick}\n onKeyDown={this.handleKeyDown}\n >\n <div class=\"onav__nav\">\n {this.scrollControls && (\n <nano-icon-button\n part=\"scroll-button scroll-button-prev\"\n class={{\n 'onav__scroll-button': true,\n 'onav__scroll-button--start': true,\n }}\n ref={(btn) => (this.startBtn = btn)}\n onClick={() => this.handleBtnClick(false)}\n label=\"Click to scroll\"\n iconName={\n this.orientation === 'horizontal'\n ? 'light/chevron-left'\n : 'light/chevron-up'\n }\n />\n )}\n\n <div\n part=\"scroller\"\n ref={(el) => (this.nav = el)}\n class=\"onav__scroller\"\n onScroll={this.handleScroll}\n >\n <div\n part=\"items\"\n ref={(el) => (this.itemContainer = el)}\n class=\"onav__items\"\n >\n <div\n part=\"indicator\"\n ref={(el) => (this.activeIndicator = el)}\n class=\"onav__active-indicator\"\n />\n <slot onSlotchange={this.slotChangeHandler} />\n </div>\n </div>\n\n {this.scrollControls && (\n <nano-icon-button\n part=\"scroll-button scroll-button-next\"\n class={{\n 'onav__scroll-button': true,\n 'onav__scroll-button--end': true,\n }}\n ref={(btn) => (this.endBtn = btn)}\n onClick={() => this.handleBtnClick(true)}\n label=\"Click to scroll\"\n iconName={\n this.orientation === 'horizontal'\n ? 'light/chevron-right'\n : 'light/chevron-down'\n }\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"overflow-nav.js","sourceRoot":"","sources":["../../../src/components/overflow-nav/overflow-nav.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AAOH,MAAM,OAAO,WAAW;EA+BtB,gBAAgB;EAEhB;IA8JQ,yBAAoB,GAAG,GAAG,EAAE;MAClC,IAAI,CAAC,IAAI,CAAC,GAAG;QAAE,OAAO;MAEtB,IAAI,CAAC,iBAAiB;QACpB,IAA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c,CAAC,IAAI,CAAC,EACxC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EACN,IAAI,CAAC,WAAW,KAAK,YAAY;cAC/B,CAAC,CAAC,qBAAqB;cACvB,CAAC,CAAC,oBAAoB,GAE1B,CACH,CACG,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n ComponentInterface,\n Host,\n h,\n Element,\n Prop,\n Watch,\n State,\n} from '@stencil/core';\nimport { getDirectChildren, getOffset } from '../../utils/dom';\nimport { debounce } from '../../utils/throttle';\n\n/**\n * Primarily used to display navigational items that may not fit on smaller screens.\n *\n * - Accepts any collection of elements\n * - Gives visual cues of 'more' with auto display fade effect and scroll buttons\n * - Auto scrolls to the active item onload\n *\n * @slot - Default slot to place items.\n *\n * @part base - root, wrapper element\n * @part scroller - the scrolling element\n * @part items - the item wrapper element\n * @part indicator - the animated, indicator element\n * @part scroll-button - The buttons shown at either side of the scrolling area\n * @part scroll-button-prev - The button shown at the start of the scrolling area\n * @part scroll-button-next - The button shown at the end of the scrolling area\n */\n\n@Component({\n tag: 'nano-overflow-nav',\n styleUrl: 'overflow-nav.scss',\n shadow: true,\n})\nexport class OverflowNav implements ComponentInterface {\n // public surface\n\n /** Disables the scroll arrow buttons that appear when content overflows */\n @Prop() scrollControls = true;\n\n /** The flex direction of the element */\n @Prop({ reflect: true }) orientation: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * A function called when an item becomes 'active' (via click or keyboard)\n * @param item\n * @returns void */\n @Prop() activeHandler = (item: HTMLElement) => item.classList.add('active');\n\n /**\n * A function called when an item becomes 'inactive'\n * (because another item was made active)\n * @param item\n * @returns void */\n @Prop() inActiveHandler = (item: HTMLElement) =>\n item.classList.remove('active');\n\n /**\n * A function called to assess an initial, active item\n * @param item\n * @returns void */\n @Prop() isActiveHandler = (item: HTMLElement) =>\n item.classList.contains('active');\n\n // private state\n\n constructor() {\n this.recalculatePositions = debounce(this.recalculatePositions, 50);\n }\n\n private ro?: ResizeObserver;\n private nav?: HTMLElement;\n private itemContainer?: HTMLElement;\n private isRtl?: boolean;\n private endBtn: HTMLNanoIconButtonElement;\n private startBtn: HTMLNanoIconButtonElement;\n private activeIndicator: HTMLElement;\n\n get scrollProp() {\n return this.orientation === 'horizontal' ? 'scrollWidth' : 'scrollHeight';\n }\n\n get clientDimProp() {\n return this.orientation === 'horizontal' ? 'clientWidth' : 'clientHeight';\n }\n\n get scrollOffset() {\n return this.orientation === 'horizontal' ? 'scrollLeft' : 'scrollTop';\n }\n\n @Element() host: HTMLNanoOverflowNavElement;\n\n @State() hasScrollControls = false;\n\n @Watch('hasScrollControls')\n watchScrollControls() {\n if (this.hasScrollControls) this.handleScroll();\n else this.hideControlStart = this.hideControlEnd = true;\n }\n\n @State() hideControlEnd = true;\n\n @Watch('hideControlEnd')\n hideEndBtn() {\n if (!this.endBtn) return;\n this.activateBtn(this.endBtn, !this.hideControlEnd);\n }\n\n @State() hideControlStart = true;\n\n @Watch('hideControlStart')\n hideStartBtn() {\n if (!this.startBtn) return;\n this.activateBtn(this.startBtn, !this.hideControlStart);\n }\n\n // private logic\n\n private activateBtn(btn: HTMLNanoIconButtonElement, activate = true) {\n if (!activate) {\n btn.tabIndex = -1;\n btn.disabled = true;\n btn.classList.remove('is-shown');\n return;\n }\n btn.tabIndex = 0;\n btn.disabled = false;\n btn.classList.add('is-shown');\n }\n\n get allActiveItems() {\n return this.allItems.filter(\n (el: any) => !el.disabled || el.classList.contains('disabled')\n );\n }\n\n get allItems() {\n return getDirectChildren<HTMLElement>(this.host, '*', true);\n }\n\n get activeItem() {\n if (this._activeItem) return this._activeItem;\n return this.allActiveItems.find((el) => this.isActiveHandler(el));\n }\n\n set activeItem(item: HTMLElement) {\n if (\n !item ||\n item === this.activeItem ||\n (item as any).disabled ||\n !this.allActiveItems.includes(item)\n ) {\n return;\n }\n\n this._activeItem = item;\n this.allActiveItems.forEach((el) => {\n if (el === this._activeItem) this.activeHandler(el);\n else this.inActiveHandler(el);\n });\n this.syncActiveItemIndicator();\n this.scrollToActiveItem();\n }\n private _activeItem: HTMLElement;\n\n get navDim() {\n if (!this.nav) return 0;\n\n const computedStyle = getComputedStyle(this.nav);\n let clientDim = this.nav[this.clientDimProp];\n\n if (this.orientation === 'horizontal') {\n return (clientDim -=\n parseFloat(computedStyle.paddingLeft) +\n parseFloat(computedStyle.paddingRight));\n } else {\n return (clientDim -=\n parseFloat(computedStyle.paddingTop) +\n parseFloat(computedStyle.paddingBottom));\n }\n }\n\n private scrollToActiveItem(instant?: boolean) {\n if (!this.nav || !this.activeItem) return;\n requestAnimationFrame(() => {\n this.activeItem.scrollIntoView({\n behavior: instant ? 'auto' : 'smooth',\n block: 'center',\n inline: 'center',\n });\n });\n }\n\n private syncActiveItemIndicator(instant?: boolean) {\n if (!this.activeItem) return;\n\n const item = this.activeItem;\n const width = item.clientWidth || 0;\n const height = item.clientHeight + 2 || 0;\n const offset = getOffset(item, this.itemContainer);\n\n if (!this.activeIndicator) return;\n\n const offsetTop = offset.top;\n const offsetLeft = offset.left;\n\n if (instant) this.activeIndicator.style.transition = 'none';\n\n switch (this.orientation) {\n case 'horizontal':\n this.activeIndicator.style.width = `${width}px`;\n this.activeIndicator.style.height = null;\n this.activeIndicator.style.transform = `translateX(${offsetLeft}px)`;\n break;\n\n case 'vertical':\n this.activeIndicator.style.width = null;\n this.activeIndicator.style.height = `${height}px`;\n this.activeIndicator.style.transform = `translateY(${offsetTop}px)`;\n break;\n }\n setTimeout(() => (this.activeIndicator.style.transition = null), 400);\n }\n\n private updateScrollControls = () => {\n if (!this.nav) return;\n\n this.hasScrollControls =\n this.nav[this.scrollProp] > this.nav[this.clientDimProp] &&\n this.nav[this.scrollProp] > this.itemContainer[this.clientDimProp];\n this.handleScroll();\n };\n\n private handleScroll = () => {\n if (!this.hasScrollControls) {\n this.hideControlStart = this.hideControlEnd = true;\n return;\n }\n const finishEnd = this.isRtl\n ? this.nav[this.scrollOffset] === 0\n : Math.abs(\n this.nav[this.clientDimProp] -\n (this.nav[this.scrollProp] - this.nav[this.scrollOffset])\n ) < 2;\n\n const finishStart = this.isRtl\n ? Math.abs(\n this.nav[this.scrollProp] +\n this.nav[this.scrollOffset] -\n this.nav[this.clientDimProp]\n ) < 2\n : this.nav[this.scrollOffset] === 0;\n\n if (finishStart) {\n this.hideControlStart = true;\n this.hideControlEnd = false;\n } else if (finishEnd) {\n this.hideControlStart = false;\n this.hideControlEnd = true;\n } else {\n this.hideControlEnd = false;\n this.hideControlStart = false;\n }\n };\n\n private handleBtnClick = (goEnd: boolean = false) => {\n const navDim = this.navDim;\n let scrollAmt;\n if (goEnd) scrollAmt = this.nav[this.scrollOffset] + navDim - 20;\n else scrollAmt = this.nav[this.scrollOffset] - navDim + 20;\n\n try {\n this.nav.scroll({\n left: this.orientation === 'horizontal' ? scrollAmt : 0,\n top: this.orientation === 'vertical' ? scrollAmt : 0,\n behavior: 'smooth',\n });\n } catch (e) {\n this.nav[this.scrollOffset] = scrollAmt;\n }\n };\n\n private slotChangeHandler = () => {\n if (this.allActiveItems.length < 2) return;\n const item = this.allActiveItems.find((el) => this.isActiveHandler(el));\n if (item) this.activeItem = item;\n this.recalculatePositions();\n };\n\n private handleClick = (event: MouseEvent) => {\n if (this.allActiveItems.length < 2) return;\n const foundItem = event\n .composedPath()\n .find((e) => this.allActiveItems.includes(e as any)) as HTMLElement;\n if (foundItem) this.activeItem = foundItem;\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Activate a tab\n if (['Enter', ' '].includes(event.key)) {\n const foundItem = event\n .composedPath()\n .find((e) => this.allActiveItems.includes(e as any)) as HTMLElement;\n if (foundItem) this.activeItem = foundItem;\n }\n };\n\n private recalculatePositions = (init?: any) => {\n this.updateScrollControls();\n this.syncActiveItemIndicator(init);\n setTimeout(() => this.scrollToActiveItem(init), 300);\n };\n\n // lifecycle\n\n connectedCallback(): void {\n this.isRtl =\n this.orientation === 'horizontal' && !!this.host.closest('[dir=\"rtl\"]');\n\n if (!window['ResizeObserver']) return;\n\n if (this.ro) {\n this.ro.disconnect();\n this.ro = undefined;\n }\n const mo = (this.ro = new ResizeObserver(this.recalculatePositions));\n mo.observe(this.host);\n }\n\n componentDidLoad(): void {\n this.recalculatePositions(true);\n }\n\n disconnectedCallback(): void {\n if (this.ro) {\n this.ro.disconnect();\n this.ro = undefined;\n }\n }\n\n render() {\n return (\n <Host dir={this.isRtl ? 'rtl' : null}>\n <div\n part=\"base\"\n class={{\n onav: true,\n [`onav--${this.orientation}`]: true,\n 'onav--has-scroll-controls': this.hasScrollControls,\n 'onav--has-scroll-controls-start': !this.hideControlStart,\n 'onav--has-scroll-controls-end': !this.hideControlEnd,\n }}\n onClick={this.handleClick}\n onKeyDown={this.handleKeyDown}\n >\n <div class=\"onav__nav\">\n {this.scrollControls && (\n <nano-icon-button\n part=\"scroll-button scroll-button-prev\"\n class={{\n 'onav__scroll-button': true,\n 'onav__scroll-button--start': true,\n }}\n ref={(btn) => (this.startBtn = btn)}\n onClick={() => this.handleBtnClick(false)}\n label=\"Click to scroll\"\n iconName={\n this.orientation === 'horizontal'\n ? 'light/chevron-left'\n : 'light/chevron-up'\n }\n />\n )}\n\n <div\n part=\"scroller\"\n ref={(el) => (this.nav = el)}\n class=\"onav__scroller\"\n onScroll={this.handleScroll}\n >\n <div\n part=\"items\"\n ref={(el) => (this.itemContainer = el)}\n class=\"onav__items\"\n >\n <div\n part=\"indicator\"\n ref={(el) => (this.activeIndicator = el)}\n class=\"onav__active-indicator\"\n />\n <slot onSlotchange={this.slotChangeHandler} />\n </div>\n </div>\n\n {this.scrollControls && (\n <nano-icon-button\n part=\"scroll-button scroll-button-next\"\n class={{\n 'onav__scroll-button': true,\n 'onav__scroll-button--end': true,\n }}\n ref={(btn) => (this.endBtn = btn)}\n onClick={() => this.handleBtnClick(true)}\n label=\"Click to scroll\"\n iconName={\n this.orientation === 'horizontal'\n ? 'light/chevron-right'\n : 'light/chevron-down'\n }\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-interface.js","sourceRoot":"","sources":["../../../src/components/table/table-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\nimport type { VNode, FunctionalComponent } from '@stencil/core';\n\nexport declare namespace TableTypes {\n /** The column property */\n type ColumnProp = string | number;\n\n /** Possible positions. Horizontally means l/r. Vertically means top/bottom */\n type Position = 'start' | 'end' | 'top' | 'bottom';\n\n /** A function to assess whether a rendered row will be pinned to the top or bottom */\n type PinFunc = (props?: RowDataSchemaModel) => Position;\n\n /** Function called, via intersection observer, when an element's pinned status changes */\n type PinnedCb = (positions: { [key in Position]?: boolean }) => void;\n\n /** Potential column ordering options */\n type Order = 'asc' | 'desc' | undefined;\n\n /** Column filtering */\n interface Filter {\n prop: TableTypes.Prop;\n filter: string;\n }\n\n /** Column sorting */\n interface Sort {\n prop: TableTypes.Prop;\n order: TableTypes.Order;\n }\n\n /** Potential html properties which can be passed to a cell or column */\n type CellProps = JSXBase.ThHTMLAttributes<HTMLTableCellElement>;\n\n /** Potential html properties which can be passed to a row */\n type RowProps = JSXBase.HTMLAttributes<HTMLTableRowElement>;\n\n /** data model passed to cell rendering functions */\n interface RenderModel<T = RowGeneric> {\n /** The column property being iterated over */\n prop: keyof T;\n /** The data for this cell */\n cellModel: any;\n /** The column config object */\n column: ColumnConfig<T>;\n /** The row index currently being iterated over */\n rowIndex: number;\n /** The row model currently being iterated over */\n rowModel: RowData<T>;\n }\n\n /** data model passed to row rendering functions */\n interface RowDataSchemaModel<T = RowGeneric> {\n /** the current data row model being iterated over */\n rowModel?: RowData<T>;\n /** the current data row index */\n rowIndex?: number;\n /** The row being rendered. You *must* nest this in your render function otherwise it will not be shown */\n renderedRow?: VNode;\n }\n\n /** A JSX `createElement` function passed to rendering functions.\n * You can use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n interface HFunc<T> {\n (tag: any): T;\n }\n interface HFunc<T> {\n (tag: any, data: any): T;\n }\n interface HFunc<T> {\n (tag: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: T): T;\n }\n\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n type RowTemplateFunc<T, P> = (\n /** use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n createElement: HFunc<T>,\n /** data passed to each template */\n props: RowDataSchemaModel<P>,\n /** a helper template to minimise boilerplate.\n * A shortcut for `<td><div class=\"nano-tbl__cell-content\"></div></td>` */\n TableCell: FunctionalComponent<{ header?: boolean }>\n ) => T | undefined;\n\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n type CellTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n props: RenderModel<P>\n ) => T | string | undefined;\n\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n type ColumnTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n col: ColumnConfig<P>\n ) => T | string | undefined;\n\n /** A function used to assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n */\n type ColSortComparator = (\n prop: keyof RowData,\n order: Order\n ) => (a: RowData, b: RowData) => number;\n\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n type PropertiesFunc = (props: RenderModel) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n type ColPropertiesFunc<T> = (\n props: ColumnConfig<T>\n ) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n type RowPropertiesFunc<T> = (\n props: RowDataSchemaModel<T>\n ) => RowProps | void | undefined;\n\n type RowGeneric = { [key: string | number]: any };\n\n /** An individual table cell's data */\n type RowData<T = RowGeneric> = T & {\n __uuid?: string | number;\n __index?: number;\n };\n\n /** A data property */\n type Prop = keyof RowData;\n\n /** Valid column data types */\n type ColumnType = 'text' | 'string' | 'number' | 'date' | 'unknown';\n\n /**\n * A table column's configuration\n */\n interface ColumnConfig<T = RowData> {\n /** The title of the column. Displayed in the table header `th` */\n title: string;\n /** The row's data property to retrieve per cell render */\n prop: keyof T;\n /** The type of data. Will affect how it is sorted and the available\n * filter operations ('text' uses browser locale to compare).\n * If none supplied, it will be derived by default using the first row of data retrieved. */\n type?: ColumnType;\n /** Whether this column is horizontally pinned to viewport */\n pinned?: Position;\n /** By default cell content too wide for the cell will not wrap,\n * but rather be trimmed with '...'.\n * *Note* 'wrap' is mutually-exclusive from `autoTooltip` */\n wrap?: boolean;\n /** Setting this to true, will automatically watch content that\n * doesn't fit and duplicate it to show in a tooltip.\n * *Note* 'autoTooltip' is mutually-exclusive from `wrap` */\n autoTooltip?: boolean;\n /** Whether this column is a row header; the cell will render a `th` not a `td` */\n rowHeader?: boolean;\n /** Whether this column can be sorted. Defaults to true */\n sortable?: boolean;\n /** Current order of this column */\n order?: Order;\n /** Whether to include this column when doing a general search. Defaults to true */\n searchable?: boolean;\n /** Current filters applied to this column */\n filter?: string;\n /** Whether this column can be dragged to change column order */\n draggable?: boolean;\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n cellTemplate?: CellTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n cellProperties?: PropertiesFunc;\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n columnTemplate?: ColumnTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n columnProperties?: ColPropertiesFunc<T>;\n /** A custom sorting comparator function - assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort */\n sortCompareFn?: ColSortComparator | string;\n }\n\n /**\n * Row renderer property. Called during the rendering of any table row\n * controlling it's visual state.\n */\n interface RowRenderer<T = RowData> {\n /** Function to decide whether the row is vertically pinned. */\n pinned?: PinFunc;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: RowPropertiesFunc<T>;\n }\n\n /**\n * Row renderer property. Called during the rendering of a tables head and foot\n * controlling their visual state.\n */\n interface HeadFootRenderer {\n /** Function to decide whether the row is vertically pinned. Defaults to `start` for the header and `end` the footer */\n pinned: Position;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row.\n * If used, and you want to see the rendered row, you *must* nest it within your\n * jsx function e.g. `(h, props) => { return [props.renderedRow, <tr><td>Custom thing</td></tr>]}`\n **/\n template?: RowTemplateFunc<VNode | VNode[],
|
1
|
+
{"version":3,"file":"table-interface.js","sourceRoot":"","sources":["../../../src/components/table/table-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\nimport type { VNode, FunctionalComponent } from '@stencil/core';\n\nexport declare namespace TableTypes {\n /** The column property */\n type ColumnProp = string | number;\n\n /** Possible positions. Horizontally means l/r. Vertically means top/bottom */\n type Position = 'start' | 'end' | 'top' | 'bottom';\n\n /** A function to assess whether a rendered row will be pinned to the top or bottom */\n type PinFunc = (props?: RowDataSchemaModel) => Position;\n\n /** Function called, via intersection observer, when an element's pinned status changes */\n type PinnedCb = (positions: { [key in Position]?: boolean }) => void;\n\n /** Potential column ordering options */\n type Order = 'asc' | 'desc' | undefined;\n\n /** Column filtering */\n interface Filter {\n prop: TableTypes.Prop;\n filter: string;\n }\n\n /** Column sorting */\n interface Sort {\n prop: TableTypes.Prop;\n order: TableTypes.Order;\n }\n\n /** Potential html properties which can be passed to a cell or column */\n type CellProps = JSXBase.ThHTMLAttributes<HTMLTableCellElement>;\n\n /** Potential html properties which can be passed to a row */\n type RowProps = JSXBase.HTMLAttributes<HTMLTableRowElement>;\n\n /** data model passed to cell rendering functions */\n interface RenderModel<T = RowGeneric> {\n /** The column property being iterated over */\n prop: keyof T;\n /** The data for this cell */\n cellModel: any;\n /** The column config object */\n column: ColumnConfig<T>;\n /** The row index currently being iterated over */\n rowIndex: number;\n /** The row model currently being iterated over */\n rowModel: RowData<T>;\n }\n\n /** data model passed to row rendering functions */\n interface RowDataSchemaModel<T = RowGeneric> {\n /** the current data row model being iterated over */\n rowModel?: RowData<T>;\n /** the current data row index */\n rowIndex?: number;\n /** The row being rendered. You *must* nest this in your render function otherwise it will not be shown */\n renderedRow?: VNode;\n }\n\n /** A JSX `createElement` function passed to rendering functions.\n * You can use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n interface HFunc<T> {\n (tag: any): T;\n }\n interface HFunc<T> {\n (tag: any, data: any): T;\n }\n interface HFunc<T> {\n (tag: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: T): T;\n }\n\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n type RowTemplateFunc<T, P> = (\n /** use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n createElement: HFunc<T>,\n /** data passed to each template */\n props: RowDataSchemaModel<P>,\n /** a helper template to minimise boilerplate.\n * A shortcut for `<td><div class=\"nano-tbl__cell-content\"></div></td>` */\n TableCell: FunctionalComponent<{ header?: boolean }>\n ) => T | undefined;\n\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n type CellTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n props: RenderModel<P>\n ) => T | string | undefined;\n\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n type ColumnTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n col: ColumnConfig<P>\n ) => T | string | undefined;\n\n /** A function used to assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n */\n type ColSortComparator = (\n prop: keyof RowData,\n order: Order\n ) => (a: RowData, b: RowData) => number;\n\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n type PropertiesFunc = (props: RenderModel) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n type ColPropertiesFunc<T> = (\n props: ColumnConfig<T>\n ) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n type RowPropertiesFunc<T> = (\n props: RowDataSchemaModel<T>\n ) => RowProps | void | undefined;\n\n type RowGeneric = { [key: string | number]: any };\n\n /** An individual table cell's data */\n type RowData<T = RowGeneric> = T & {\n __uuid?: string | number;\n __index?: number;\n };\n\n /** A data property */\n type Prop = keyof RowData;\n\n /** Valid column data types */\n type ColumnType = 'text' | 'string' | 'number' | 'date' | 'unknown';\n\n /**\n * A table column's configuration\n */\n interface ColumnConfig<T = RowData> {\n /** The title of the column. Displayed in the table header `th` */\n title: string;\n /** The row's data property to retrieve per cell render */\n prop: keyof T;\n /** The type of data. Will affect how it is sorted and the available\n * filter operations ('text' uses browser locale to compare).\n * If none supplied, it will be derived by default using the first row of data retrieved. */\n type?: ColumnType;\n /** Whether this column is horizontally pinned to viewport */\n pinned?: Position;\n /** By default cell content too wide for the cell will not wrap,\n * but rather be trimmed with '...'.\n * *Note* 'wrap' is mutually-exclusive from `autoTooltip` */\n wrap?: boolean;\n /** Setting this to true, will automatically watch content that\n * doesn't fit and duplicate it to show in a tooltip.\n * *Note* 'autoTooltip' is mutually-exclusive from `wrap` */\n autoTooltip?: boolean;\n /** Whether this column is a row header; the cell will render a `th` not a `td` */\n rowHeader?: boolean;\n /** Whether this column can be sorted. Defaults to true */\n sortable?: boolean;\n /** Current order of this column */\n order?: Order;\n /** Whether to include this column when doing a general search. Defaults to true */\n searchable?: boolean;\n /** Current filters applied to this column */\n filter?: string;\n /** Whether this column can be dragged to change column order */\n draggable?: boolean;\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n cellTemplate?: CellTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n cellProperties?: PropertiesFunc;\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n columnTemplate?: ColumnTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n columnProperties?: ColPropertiesFunc<T>;\n /** A custom sorting comparator function - assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort */\n sortCompareFn?: ColSortComparator | string;\n }\n\n /**\n * Row renderer property. Called during the rendering of any table row\n * controlling it's visual state.\n */\n interface RowRenderer<T = RowData> {\n /** Function to decide whether the row is vertically pinned. */\n pinned?: PinFunc;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: RowPropertiesFunc<T>;\n }\n\n /**\n * Row renderer property. Called during the rendering of a tables head and foot\n * controlling their visual state.\n */\n interface HeadFootRenderer<T = RowData> {\n /** Function to decide whether the row is vertically pinned. Defaults to `start` for the header and `end` the footer */\n pinned: Position;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row.\n * If used, and you want to see the rendered row, you *must* nest it within your\n * jsx function e.g. `(h, props) => { return [props.renderedRow, <tr><td>Custom thing</td></tr>]}`\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: () => RowProps | void | undefined;\n }\n\n type TBody = {\n rows: TableTypes.NanoTable['rows'];\n __uuid: string | number;\n };\n\n class NanoTable<T = RowGeneric> {\n rows: T[];\n columns: ColumnConfig<T>[];\n rowRender: RowRenderer<T>;\n headRender: HeadFootRenderer<T>;\n footRender: HeadFootRenderer<T>;\n }\n\n type Falsy = false | 0 | '' | null | undefined;\n}\n"]}
|
@@ -811,8 +811,8 @@ export class Table {
|
|
811
811
|
"type": "unknown",
|
812
812
|
"mutable": true,
|
813
813
|
"complexType": {
|
814
|
-
"original": "TableTypes.NanoTable['columns']",
|
815
|
-
"resolved": "ColumnConfig<
|
814
|
+
"original": "TableTypes.NanoTable<any>['columns']",
|
815
|
+
"resolved": "ColumnConfig<any>[]",
|
816
816
|
"references": {
|
817
817
|
"TableTypes": {
|
818
818
|
"location": "import",
|
@@ -835,7 +835,7 @@ export class Table {
|
|
835
835
|
"mutable": false,
|
836
836
|
"complexType": {
|
837
837
|
"original": "TableTypes.HeadFootRenderer",
|
838
|
-
"resolved": "HeadFootRenderer",
|
838
|
+
"resolved": "HeadFootRenderer<RowData<RowGeneric>>",
|
839
839
|
"references": {
|
840
840
|
"TableTypes": {
|
841
841
|
"location": "import",
|
@@ -880,7 +880,7 @@ export class Table {
|
|
880
880
|
"mutable": false,
|
881
881
|
"complexType": {
|
882
882
|
"original": "TableTypes.HeadFootRenderer",
|
883
|
-
"resolved": "HeadFootRenderer",
|
883
|
+
"resolved": "HeadFootRenderer<RowData<RowGeneric>>",
|
884
884
|
"references": {
|
885
885
|
"TableTypes": {
|
886
886
|
"location": "import",
|
@@ -1302,6 +1302,10 @@ export class Table {
|
|
1302
1302
|
"references": {
|
1303
1303
|
"Promise": {
|
1304
1304
|
"location": "global"
|
1305
|
+
},
|
1306
|
+
"TableTypes": {
|
1307
|
+
"location": "import",
|
1308
|
+
"path": "../../interface"
|
1305
1309
|
}
|
1306
1310
|
},
|
1307
1311
|
"return": "Promise<void>"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EAED,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EAEL,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAGL,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,GAEZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAExE,SAAS,OAAO,CAAC,IAAY,EAAE,MAAe,KAAK;EACjD,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,WAAW;IAAE,OAAO;EAC5D,IAAI,GAAG,EAAE;IACP,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IA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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 { arrMove, findScrollParent, isInViewport } from './table.utils';\n\nfunction perMark(name: string, end: boolean = false) {\n if (!Build.isDev || Build.isTesting || !performance) 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 *- Drag-&-Drop columns to re-order\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 /** 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) 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['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 /**\n * The default draggable option for all columns.\n * `true` will enable column drag-to-reorder unless you set `draggable: false` on a column\n * `false` will disable column drag-to-reorder unless you set `draggable: true` on a column\n */\n @Prop() defaultColDraggable = false;\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 when a column has started dragging */\n @Event() nanoTblColDrag: EventEmitter<{\n column: TableTypes.Prop;\n }>;\n\n /** Fired when a column has been dropped (after dragging)\n * `event.preventDefault()` to stop column re-order. */\n @Event() nanoTblColDrop: EventEmitter<{\n fromCol: TableTypes.Prop;\n toCol: TableTypes.Prop;\n fromIndex: number;\n toIndex: number;\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.find((c) => !!c.order);\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.find((c) => c.prop === column);\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\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 // 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 private unitHeight = 0;\n private get scrollParent() {\n return this._scrollParent;\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 private _scrollParent: HTMLElement;\n\n // used to fire `nanoTblBlockRendered` on block render change\n private get primaryBlockIndex() {\n return this._primaryBlockIndex;\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 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 * Fired when a column is dragged\n * @param column\n */\n private colDrag = (column: TableTypes.Prop) => {\n this.nanoTblColDrag.emit({ column });\n };\n\n /**\n * Fired when a column is dropped after being dragged\n * @param fromCol\n * @param toCol\n */\n private colDrop = (fromCol: TableTypes.Prop, toCol: TableTypes.Prop) => {\n const cols = this.store.config.state.columns;\n const toIndex = cols.findIndex((col) => col.prop === toCol);\n const fromIndex = cols.findIndex((col) => col.prop === fromCol);\n\n const dropEvent = this.nanoTblColDrop.emit({\n fromCol,\n toCol,\n fromIndex,\n toIndex,\n });\n if (dropEvent.defaultPrevented) return;\n\n this.columns = arrMove(fromIndex, toIndex, cols);\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 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() {\n readTask(() => {\n this.measureEle = this.blockElements.find(\n (b) => !b?.classList?.contains(`${CSSNAMESPACE}__inactive`)\n );\n });\n }\n\n /**\n * Sets the initial height on tbody elements that are not active\n * These elements have no natural height - on account of all their rows being hidden\n * So we just estimate for now\n */\n private setInitialBlockDimension() {\n if (!this.blockElements?.length) return;\n perMark('blockDims');\n\n const finishResizing: Promise<void> = new Promise((resolve) => {\n readTask(() => {\n this.setMeasureElement();\n\n // find the first active block\n if (!this.measureEle && !this.unitHeight) resolve();\n\n this.blockElements.forEach((el, i) => {\n if (!el || !el.classList?.contains(`${CSSNAMESPACE}__inactive`)) {\n if (i === this.blockElements.length - 1) resolve();\n return;\n }\n if (i === this.blockElements.length - 1) resolve();\n });\n });\n });\n\n // we're all finished.\n finishResizing.then(() => {\n perMark('blockDims', true);\n perMark('init', true);\n\n requestAnimationFrame(() => {\n this.isReady = true;\n });\n });\n }\n\n /** Apply initial columns settings */\n private async columnInit() {\n this.filters = this.columns\n .filter((c) => !!c.filter)\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.find((c) => !!c.order);\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 this.blockHeights = [];\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 const height = el.getBoundingClientRect().height;\n // cache height to our block heights array\n // for subsequent renders\n const fBhI = this.blockHeights.findIndex(\n (bh) => bh.blockIndex === blockIndex\n );\n if (fBhI > 0) {\n this.blockHeights[fBhI] = { height, blockIndex };\n } else this.blockHeights.push({ height, blockIndex });\n });\n });\n }\n\n private scrollHandler = () => {\n this.cacheScrollPosition = this.scrollParent.scrollTop || window.scrollY;\n\n requestAnimationFrame(() => {\n let cumulativeHeight = 0;\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 // Component lifecycle\n\n async componentWillLoad() {\n perMark('init');\n this.scrollParent = findScrollParent(this.host);\n this.store = await generateStore(\n this.host,\n this.columns,\n this.scrollParent\n );\n await this.handleRowsChange();\n this.processSlots();\n this.store.data.onChange('rows', () => this.setBlocks());\n this.setBlocks();\n }\n\n connectedCallback(): void {\n this.scrollParent = findScrollParent(this.host);\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)\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 render() {\n this.blockElements = [];\n\n return (\n <Host>\n <div\n class={`${CSSNAMESPACE}__top-anchor`}\n ref={(a) => (this.topAnchorEle = a)}\n >\n \n </div>\n\n <nano-resize-observe\n aria-labelledby={'table-caption-' + this.renderId}\n tabindex={this.type === 'grid' ? '0' : undefined}\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 >\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-readonly={this.type === 'table' ? 'true' : 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 onColumnDrag={this.colDrag}\n onColumnDrop={this.colDrop}\n defaults={{\n sortable: this.defaultSort,\n draggable: this.defaultColDraggable,\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 {!this._loading && !this.blocks.length && (\n <tr>\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\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 draggable: this.defaultColDraggable,\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/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EAED,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EAEL,MAAM,EACN,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAGL,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,GAEZ,MAAM,eAA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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 { arrMove, findScrollParent, isInViewport } from './table.utils';\n\nfunction perMark(name: string, end: boolean = false) {\n if (!Build.isDev || Build.isTesting || !performance) 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 *- Drag-&-Drop columns to re-order\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 /** 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) 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 /**\n * The default draggable option for all columns.\n * `true` will enable column drag-to-reorder unless you set `draggable: false` on a column\n * `false` will disable column drag-to-reorder unless you set `draggable: true` on a column\n */\n @Prop() defaultColDraggable = false;\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 when a column has started dragging */\n @Event() nanoTblColDrag: EventEmitter<{\n column: TableTypes.Prop;\n }>;\n\n /** Fired when a column has been dropped (after dragging)\n * `event.preventDefault()` to stop column re-order. */\n @Event() nanoTblColDrop: EventEmitter<{\n fromCol: TableTypes.Prop;\n toCol: TableTypes.Prop;\n fromIndex: number;\n toIndex: number;\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\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 // 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 private unitHeight = 0;\n private get scrollParent() {\n return this._scrollParent;\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 private _scrollParent: HTMLElement;\n\n // used to fire `nanoTblBlockRendered` on block render change\n private get primaryBlockIndex() {\n return this._primaryBlockIndex;\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 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 * Fired when a column is dragged\n * @param column\n */\n private colDrag = (column: TableTypes.Prop) => {\n this.nanoTblColDrag.emit({ column });\n };\n\n /**\n * Fired when a column is dropped after being dragged\n * @param fromCol\n * @param toCol\n */\n private colDrop = (fromCol: TableTypes.Prop, toCol: TableTypes.Prop) => {\n const cols = this.store.config.state.columns;\n const toIndex = cols.findIndex((col) => col.prop === toCol);\n const fromIndex = cols.findIndex((col) => col.prop === fromCol);\n\n const dropEvent = this.nanoTblColDrop.emit({\n fromCol,\n toCol,\n fromIndex,\n toIndex,\n });\n if (dropEvent.defaultPrevented) return;\n\n this.columns = arrMove(fromIndex, toIndex, cols);\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 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() {\n readTask(() => {\n this.measureEle = this.blockElements.find(\n (b) => !b?.classList?.contains(`${CSSNAMESPACE}__inactive`)\n );\n });\n }\n\n /**\n * Sets the initial height on tbody elements that are not active\n * These elements have no natural height - on account of all their rows being hidden\n * So we just estimate for now\n */\n private setInitialBlockDimension() {\n if (!this.blockElements?.length) return;\n perMark('blockDims');\n\n const finishResizing: Promise<void> = new Promise((resolve) => {\n readTask(() => {\n this.setMeasureElement();\n\n // find the first active block\n if (!this.measureEle && !this.unitHeight) resolve();\n\n this.blockElements.forEach((el, i) => {\n if (!el || !el.classList?.contains(`${CSSNAMESPACE}__inactive`)) {\n if (i === this.blockElements.length - 1) resolve();\n return;\n }\n if (i === this.blockElements.length - 1) resolve();\n });\n });\n });\n\n // we're all finished.\n finishResizing.then(() => {\n perMark('blockDims', true);\n perMark('init', true);\n\n requestAnimationFrame(() => {\n this.isReady = true;\n });\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)\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 this.blockHeights = [];\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 const height = el.getBoundingClientRect().height;\n // cache height to our block heights array\n // for subsequent renders\n const fBhI = this.blockHeights.findIndex(\n (bh) => bh.blockIndex === blockIndex\n );\n if (fBhI > 0) {\n this.blockHeights[fBhI] = { height, blockIndex };\n } else this.blockHeights.push({ height, blockIndex });\n });\n });\n }\n\n private scrollHandler = () => {\n this.cacheScrollPosition = this.scrollParent.scrollTop || window.scrollY;\n\n requestAnimationFrame(() => {\n let cumulativeHeight = 0;\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 // Component lifecycle\n\n async componentWillLoad() {\n perMark('init');\n this.scrollParent = findScrollParent(this.host);\n this.store = await generateStore(\n this.host,\n this.columns,\n this.scrollParent\n );\n await this.handleRowsChange();\n this.processSlots();\n this.store.data.onChange('rows', () => this.setBlocks());\n this.setBlocks();\n }\n\n connectedCallback(): void {\n this.scrollParent = findScrollParent(this.host);\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)\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 render() {\n this.blockElements = [];\n\n return (\n <Host>\n <div\n class={`${CSSNAMESPACE}__top-anchor`}\n ref={(a) => (this.topAnchorEle = a)}\n >\n \n </div>\n\n <nano-resize-observe\n aria-labelledby={'table-caption-' + this.renderId}\n tabindex={this.type === 'grid' ? '0' : undefined}\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 >\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-readonly={this.type === 'table' ? 'true' : 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 onColumnDrag={this.colDrag}\n onColumnDrop={this.colDrop}\n defaults={{\n sortable: this.defaultSort,\n draggable: this.defaultColDraggable,\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 {!this._loading && !this.blocks.length && (\n <tr>\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\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 draggable: this.defaultColDraggable,\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"]}
|
@@ -14,7 +14,7 @@ const GlobalNavUserProfile = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
14
14
|
// Render output
|
15
15
|
render() {
|
16
16
|
var _a;
|
17
|
-
return (!!this.myAccountUser && (h("a", { href: this.userProfileUrl, class: "user-profile" }, h("div", { class: "left" }, h("div", { class: "avatar-container" }, h("img", { class: "avatar", src: (_a = this.myAccountUser) === null || _a === void 0 ? void 0 : _a.small_avatar_url, alt: "User Avatar", height: 75, width: 75 }), this.myAccountUser.is_nanopore_user && (h("img", { class: "logo-small", src: getAssetPath(
|
17
|
+
return (!!this.myAccountUser && (h("a", { href: this.userProfileUrl, class: "user-profile" }, h("div", { class: "left" }, h("div", { class: "avatar-container" }, h("img", { class: "avatar", src: (_a = this.myAccountUser) === null || _a === void 0 ? void 0 : _a.small_avatar_url, alt: "User Avatar", height: 75, width: 75 }), this.myAccountUser.is_nanopore_user && (h("img", { class: "logo-small", src: getAssetPath(`../nano-assets/ont-wheel-light.svg`), alt: "Nanopore Logo" }))), h("div", { class: "user-details" }, h("span", { class: "name" }, this.myAccountUser.name), h("span", { class: "bio" }, this.myAccountUser.job_title, " at ", this.myAccountUser.company))), h("div", { class: "right" }, h("div", { class: "chevron-right" }, h("nano-icon", { slot: "icon-end", name: "light/chevron-right", "aria-label": "navigate to ..." }))))));
|
18
18
|
}
|
19
19
|
}, [0, "nano-global-nav-user-profile", {
|
20
20
|
"myAccountUser": [16],
|