@aquera/nile-elements 0.1.57 → 0.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +3 -0
  2. package/demo/index.html +1 -1
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.js +240 -90
  6. package/dist/internal/resizable-table-helper.cjs.js +2 -0
  7. package/dist/internal/resizable-table-helper.cjs.js.map +1 -0
  8. package/dist/internal/resizable-table-helper.esm.js +1 -0
  9. package/dist/internal/resizable-table-styles.cjs.js +2 -0
  10. package/dist/internal/resizable-table-styles.cjs.js.map +1 -0
  11. package/dist/internal/resizable-table-styles.esm.js +120 -0
  12. package/dist/nile-table-body/index.cjs.js +1 -1
  13. package/dist/nile-table-body/index.esm.js +1 -1
  14. package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
  15. package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
  16. package/dist/nile-table-body/nile-table-body.css.cjs.js +1 -1
  17. package/dist/nile-table-body/nile-table-body.css.cjs.js.map +1 -1
  18. package/dist/nile-table-body/nile-table-body.css.esm.js +4 -2
  19. package/dist/nile-table-body/nile-table-body.esm.js +3 -2
  20. package/dist/nile-table-cell-item/index.cjs.js +1 -1
  21. package/dist/nile-table-cell-item/index.esm.js +1 -1
  22. package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js +1 -1
  23. package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js.map +1 -1
  24. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
  25. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
  26. package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +20 -3
  27. package/dist/nile-table-cell-item/nile-table-cell-item.esm.js +8 -3
  28. package/dist/nile-table-header-item/index.cjs.js +1 -1
  29. package/dist/nile-table-header-item/index.esm.js +1 -1
  30. package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
  31. package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
  32. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
  33. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
  34. package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +7 -2
  35. package/dist/nile-table-header-item/nile-table-header-item.esm.js +9 -8
  36. package/dist/src/internal/resizable-table-helper.d.ts +59 -0
  37. package/dist/src/internal/resizable-table-helper.js +111 -0
  38. package/dist/src/internal/resizable-table-helper.js.map +1 -0
  39. package/dist/src/internal/resizable-table-styles.d.ts +16 -0
  40. package/dist/src/internal/resizable-table-styles.js +137 -0
  41. package/dist/src/internal/resizable-table-styles.js.map +1 -0
  42. package/dist/src/nile-table-body/nile-table-body.css.js +3 -0
  43. package/dist/src/nile-table-body/nile-table-body.css.js.map +1 -1
  44. package/dist/src/nile-table-body/nile-table-body.d.ts +2 -0
  45. package/dist/src/nile-table-body/nile-table-body.js +10 -0
  46. package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
  47. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +19 -1
  48. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
  49. package/dist/src/nile-table-cell-item/nile-table-cell-item.d.ts +3 -0
  50. package/dist/src/nile-table-cell-item/nile-table-cell-item.js +27 -8
  51. package/dist/src/nile-table-cell-item/nile-table-cell-item.js.map +1 -1
  52. package/dist/src/nile-table-header-item/nile-table-header-item.css.js +6 -0
  53. package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
  54. package/dist/src/nile-table-header-item/nile-table-header-item.d.ts +3 -0
  55. package/dist/src/nile-table-header-item/nile-table-header-item.js +22 -15
  56. package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
  57. package/dist/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +2 -2
  59. package/src/internal/resizable-table-helper.ts +151 -0
  60. package/src/internal/resizable-table-styles.ts +144 -0
  61. package/src/nile-table-body/nile-table-body.css.ts +3 -0
  62. package/src/nile-table-body/nile-table-body.ts +9 -0
  63. package/src/nile-table-cell-item/nile-table-cell-item.css.ts +19 -1
  64. package/src/nile-table-cell-item/nile-table-cell-item.ts +22 -5
  65. package/src/nile-table-header-item/nile-table-header-item.css.ts +6 -0
  66. package/src/nile-table-header-item/nile-table-header-item.ts +11 -5
  67. package/vscode-html-custom-data.json +15 -4
@@ -0,0 +1,2 @@
1
+ System.register([],function(_export,_context){"use strict";function e(e,t){e.preventDefault(),e.stopPropagation();var _t$minWidth=t.minWidth,n=_t$minWidth===void 0?50:_t$minWidth,i=t.startX,o=t.startWidth,r=t.element,u=e.target;u.classList.add("resizing");var l=function l(e){e.preventDefault(),e.stopPropagation();var t=e.pageX-i,u=Math.max(n,o+t);r.style.width=u+"px",function(e,t){var n=e.closest("nile-table-body");if(!n)return;var i="nile-table-header-item"===e.tagName.toLowerCase(),o="nile-table-cell-item",r=function(e,t){var n=e.closest("nile-table-row");if(n){var _i=n.querySelectorAll(t);return Array.from(_i).indexOf(e);}return 0;}(e,i?"nile-table-header-item":"nile-table-cell-item");n.querySelectorAll("nile-table-row").forEach(function(e){var n=e.querySelectorAll(o);n[r]&&(n[r].style.width=t+"px");});}(r,u);},_c=function c(){u.classList.remove("resizing"),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",_c);};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",_c),function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",_c);};}function t(e){return e.hasAttribute("resizable");}function n(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:50;return function(i){e(i,{minWidth:n,startX:i.pageX,startWidth:t.offsetWidth,element:t});};}function i(e){var n=e.querySelectorAll("nile-table-header-item"),i=e.querySelectorAll("nile-table-cell-item"),o=Array.from(n).some(function(e){return t(e);}),r=Array.from(i).some(function(e){return t(e);});return o||r;}_export({c:n,h:i});return{setters:[],execute:function execute(){}};});
2
+ //# sourceMappingURL=resizable-table-helper.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable-table-helper.cjs.js","sources":["../../../src/internal/resizable-table-helper.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Resizable Helper Utility\n * Provides common functionality for resizable table columns\n */\n\nexport interface ResizeOptions {\n minWidth?: number;\n startX: number;\n startWidth: number;\n element: HTMLElement;\n}\n\nexport interface ColumnResizeData {\n columnIndex: number;\n newWidth: number;\n}\n\n/**\n * Handles the start of a resize operation\n * @param e Mouse event\n * @param options Resize configuration options\n * @returns Cleanup function to remove event listeners\n */\nexport function handleResizeStart(e: MouseEvent, options: ResizeOptions): () => void {\n e.preventDefault();\n e.stopPropagation();\n \n const { minWidth = 50, startX, startWidth, element } = options;\n const resizer = e.target as HTMLElement;\n \n resizer.classList.add('resizing');\n\n const onMouseMove = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n \n const delta = e.pageX - startX;\n const newWidth = Math.max(minWidth, startWidth + delta);\n\n element.style.width = newWidth + 'px';\n\n synchronizeColumnWidth(element, newWidth);\n };\n\n const onMouseUp = () => {\n resizer.classList.remove('resizing');\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n\n return () => {\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n}\n\n/**\n * Gets the column index of an element within its table row\n * @param element The table cell or header element\n * @param selector The CSS selector for the column elements\n * @returns Column index (0-based)\n */\nexport function getColumnIndex(element: HTMLElement, selector: string): number {\n const tableRow = element.closest('nile-table-row');\n if (tableRow) {\n const columns = tableRow.querySelectorAll(selector);\n return Array.from(columns).indexOf(element);\n }\n return 0;\n}\n\n/**\n * Synchronizes the width of all cells in the same column\n * @param sourceElement The element that was resized\n * @param newWidth The new width to apply\n */\nexport function synchronizeColumnWidth(sourceElement: HTMLElement, newWidth: number): void {\n const tableBody = sourceElement.closest('nile-table-body');\n if (!tableBody) return;\n\n const isHeader = sourceElement.tagName.toLowerCase() === 'nile-table-header-item';\n const selector = isHeader ? 'nile-table-header-item' : 'nile-table-cell-item';\n const targetSelector = isHeader ? 'nile-table-cell-item' : 'nile-table-cell-item';\n \n const columnIndex = getColumnIndex(sourceElement, selector);\n const rows = tableBody.querySelectorAll('nile-table-row');\n \n rows.forEach(row => {\n const cells = row.querySelectorAll(targetSelector);\n if (cells[columnIndex]) {\n cells[columnIndex].style.width = newWidth + 'px';\n }\n });\n}\n\n/**\n * Checks if an element has the resizable attribute\n * @param element The element to check\n * @returns True if the element is resizable\n */\nexport function isResizable(element: HTMLElement): boolean {\n return element.hasAttribute('resizable');\n}\n\n/**\n * Creates a resize handler function for use in component event listeners\n * @param element The element to make resizable\n * @param minWidth Minimum width constraint\n * @returns Event handler function\n */\nexport function createResizeHandler(element: HTMLElement, minWidth: number = 50): (e: MouseEvent) => void {\n return (e: MouseEvent) => {\n const options: ResizeOptions = {\n minWidth,\n startX: e.pageX,\n startWidth: element.offsetWidth,\n element\n };\n \n handleResizeStart(e, options);\n };\n}\n\n/**\n * Detects if any columns in a table are resizable\n * @param tableBody The table body element\n * @returns True if any columns have resizable attribute\n */\nexport function hasResizableColumns(tableBody: HTMLElement): boolean {\n const headerItems = tableBody.querySelectorAll('nile-table-header-item');\n const cellItems = tableBody.querySelectorAll('nile-table-cell-item');\n \n const hasResizableHeaders = Array.from(headerItems).some(item => \n isResizable(item)\n );\n const hasResizableCells = Array.from(cellItems).some(item => \n isResizable(item)\n );\n \n return hasResizableHeaders || hasResizableCells;\n} \n"],"names":["handleResizeStart","e","options","preventDefault","stopPropagation","_t$minWidth","minWidth","startX","startWidth","element","resizer","target","classList","add","onMouseMove","delta","pageX","newWidth","Math","max","style","width","sourceElement","tableBody","closest","isHeader","tagName","toLowerCase","targetSelector","columnIndex","selector","tableRow","columns","querySelectorAll","Array","from","indexOf","getColumnIndex","forEach","row","cells","synchronizeColumnWidth","onMouseUp","c","remove","document","removeEventListener","addEventListener","isResizable","hasAttribute","createResizeHandler","arguments","length","undefined","offsetWidth","t","hasResizableColumns","headerItems","cellItems","hasResizableHeaders","some","item","hasResizableCells","_export"],"mappings":"2DA8BgB,QAAAA,CAAAA,CAAAA,CAAkBC,EAAeC,CAC/CD,CAAAA,CAAAA,CAAAA,CAAEE,iBACFF,CAAEG,CAAAA,eAAAA,CAAAA,CAAAA,CAEF,IAAAC,WAAA,CAAuDH,CAAAA,CAAjDI,QAAAA,CAAEA,CAAW,CAAAD,WAAA,UAAA,EAAA,CAAAA,WAAA,CAAIE,CAAMC,CAA0BN,CAAAA,CAAlCK,OAAUC,CAAUC,CAAcP,CAAAA,CAA1BM,UAAAA,CAAcC,CAAYP,CAAAA,CAAAA,CAAdO,OAAAA,CACnCC,EAAUT,CAAEU,CAAAA,MAAAA,CAElBD,CAAQE,CAAAA,SAAAA,CAAUC,GAAI,CAAA,UAAA,CAAA,CAEtB,GAAMC,CAAAA,CAAeb,CAAAA,QAAfa,CAAAA,CAAeb,CAAAA,CAAAA,CAAAA,CACnBA,CAAEE,CAAAA,cAAAA,CAAAA,CAAAA,CACFF,CAAEG,CAAAA,eAAAA,CAAAA,CAAAA,CAEF,GAAMW,CAAAA,CAAQd,CAAAA,CAAAA,CAAEe,KAAQT,CAAAA,CAAAA,CAClBU,CAAWC,CAAAA,IAAAA,CAAKC,IAAIb,CAAUE,CAAAA,CAAAA,CAAaO,CAEjDN,CAAAA,CAAAA,CAAAA,CAAQW,KAAMC,CAAAA,KAAAA,CAAQJ,EAAW,IAwCrB,CAAA,SAAuBK,CAA4BL,CAAAA,CAAAA,CAAAA,CACjE,GAAMM,CAAAA,CAAAA,CAAYD,EAAcE,OAAQ,CAAA,iBAAA,CAAA,CACxC,GAAKD,CAAAA,CAAAA,CAAW,OA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Width:o,element:r}=t,u=e.target;u.classList.add("resizing");const l=e=>{e.preventDefault(),e.stopPropagation();const t=e.pageX-i,u=Math.max(n,o+t);r.style.width=u+"px",function(e,t){const n=e.closest("nile-table-body");if(!n)return;const i="nile-table-header-item"===e.tagName.toLowerCase(),o="nile-table-cell-item",r=function(e,t){const n=e.closest("nile-table-row");if(n){const i=n.querySelectorAll(t);return Array.from(i).indexOf(e)}return 0}(e,i?"nile-table-header-item":"nile-table-cell-item");n.querySelectorAll("nile-table-row").forEach((e=>{const n=e.querySelectorAll(o);n[r]&&(n[r].style.width=t+"px")}))}(r,u)},c=()=>{u.classList.remove("resizing"),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)}}function t(e){return e.hasAttribute("resizable")}function n(t,n=50){return i=>{e(i,{minWidth:n,startX:i.pageX,startWidth:t.offsetWidth,element:t})}}function i(e){const n=e.querySelectorAll("nile-table-header-item"),i=e.querySelectorAll("nile-table-cell-item"),o=Array.from(n).some((e=>t(e))),r=Array.from(i).some((e=>t(e)));return o||r}export{n as c,i as h};
@@ -0,0 +1,2 @@
1
+ System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,o,r,t,i,s,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("r",o=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host([resizable]) {\n position: relative;\n overflow: hidden;\n table-layout: fixed;\n }\n"])))),_export("c",r=e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n :host([resizable]) {\n position: relative;\n }\n\n :host([resizable]) .header__item__wrapper {\n border-right: 1px solid var(--nile-colors-neutral-400);\n position: relative;\n }\n"])))),_export("a",t=e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n .resizer {\n position: absolute;\n right: 0;\n top: -1000px;\n bottom: -1000px;\n width: 8px;\n cursor: col-resize;\n user-select: none;\n background-color: var(--nile-colors-neutral-100);\n transition: background-color 0.2s;\n z-index: 10;\n opacity: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n }\n\n :host([resizable]):hover .resizer {\n opacity: 1;\n pointer-events: auto;\n }\n\n .resizer::before {\n content: '';\n position: absolute;\n right: 3px;\n top: 0;\n width: 2px;\n height: 100%;\n background-color: var(--nile-colors-neutral-500);\n opacity: 0.8;\n }\n\n .resizer:hover {\n background-color: var(--nile-colors-neutral-400);\n }\n\n .resizer:hover::before {\n background-color: var(--nile-colors-neutral-700);\n opacity: 1;\n }\n\n .resizer.resizing {\n background-color: var(--nile-colors-neutral-400);\n opacity: 1;\n pointer-events: auto;\n }\n\n .resizer.resizing::before {\n background-color: var(--nile-colors-neutral-700);\n opacity: 1;\n width: 3px;\n }\n"])))),_export("h",i=e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n .resizer {\n position: absolute;\n right: -2px;\n top: -1000px;\n bottom: -1000px;\n width: 8px;\n cursor: ew-resize;\n user-select: none;\n transition: background-color 0.2s;\n z-index: 10;\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n :host([resizable]):hover .resizer {\n opacity: 1;\n }\n\n .resizer::before {\n content: '';\n position: absolute;\n height: 100%;\n opacity: 0.8;\n }\n\n .resizer.resizing {\n border-right: 4px double var(--nile-colors-neutral-400);\n background-color: transparent;\n opacity: 1;\n }\n"])))),_export("b",s=e(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n :host([resizable]) ::slotted(*) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n :host([resizable]) ::slotted(span),\n :host([resizable]) ::slotted(div),\n :host([resizable]) ::slotted(p) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n"])))),_export("t",a=e(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n .nile__table__body[resizable] {\n table-layout: fixed;\n }\n"]))));}};});
2
+ //# sourceMappingURL=resizable-table-styles.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable-table-styles.cjs.js","sources":["../../../src/internal/resizable-table-styles.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Resizable Styles Utility\n * Centralized styles for resizable table functionality\n */\n\nexport const resizableHostStyles = css`\n :host([resizable]) {\n position: relative;\n overflow: hidden;\n table-layout: fixed;\n }\n`;\n\nexport const resizableHeaderStyles = css`\n :host([resizable]) {\n position: relative;\n }\n\n :host([resizable]) .header__item__wrapper {\n border-right: 1px solid var(--nile-colors-neutral-400);\n position: relative;\n }\n`;\n\nexport const resizerStyles = css`\n .resizer {\n position: absolute;\n right: 0;\n top: -1000px;\n bottom: -1000px;\n width: 8px;\n cursor: col-resize;\n user-select: none;\n background-color: var(--nile-colors-neutral-100);\n transition: background-color 0.2s;\n z-index: 10;\n opacity: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n }\n\n :host([resizable]):hover .resizer {\n opacity: 1;\n pointer-events: auto;\n }\n\n .resizer::before {\n content: '';\n position: absolute;\n right: 3px;\n top: 0;\n width: 2px;\n height: 100%;\n background-color: var(--nile-colors-neutral-500);\n opacity: 0.8;\n }\n\n .resizer:hover {\n background-color: var(--nile-colors-neutral-400);\n }\n\n .resizer:hover::before {\n background-color: var(--nile-colors-neutral-700);\n opacity: 1;\n }\n\n .resizer.resizing {\n background-color: var(--nile-colors-neutral-400);\n opacity: 1;\n pointer-events: auto;\n }\n\n .resizer.resizing::before {\n background-color: var(--nile-colors-neutral-700);\n opacity: 1;\n width: 3px;\n }\n`;\n\nexport const headerResizerStyles = css`\n .resizer {\n position: absolute;\n right: -2px;\n top: -1000px;\n bottom: -1000px;\n width: 8px;\n cursor: ew-resize;\n user-select: none;\n transition: background-color 0.2s;\n z-index: 10;\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n :host([resizable]):hover .resizer {\n opacity: 1;\n }\n\n .resizer::before {\n content: '';\n position: absolute;\n height: 100%;\n opacity: 0.8;\n }\n\n .resizer.resizing {\n border-right: 4px double var(--nile-colors-neutral-400);\n background-color: transparent;\n opacity: 1;\n }\n`;\n\nexport const resizableSlotStyles = css`\n :host([resizable]) ::slotted(*) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n :host([resizable]) ::slotted(span),\n :host([resizable]) ::slotted(div),\n :host([resizable]) ::slotted(p) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n`;\n\nexport const tableLayoutStyles = css`\n .nile__table__body[resizable] {\n table-layout: fixed;\n }\n`; \n"],"names":["resizableHostStyles","css","_templateObject","_taggedTemplateLiteral","_export","resizableHeaderStyles","_templateObject2","resizerStyles","_templateObject3","headerResizerStyles","_templateObject4","resizableSlotStyles","_templateObject5","tableLayoutStyles","_templateObject6"],"mappings":"mZAcaA,CAAAA,CAAsBC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,mHAAAC,OAAA,KAQzBC,CAAAA,CAAwBJ,CAAG,CAAAK,gBAAA,GAAAA,gBAAA,CAAAH,sBAAA,8MAAAC,OAAA,KAW3BG,CAAAA,CAAgBN,CAAG,CAAAO,gBAAA,GAAAA,gBAAA,CAAAL,sBAAA,8lCAAAC,OAAA,KAuDnBK,CAAAA,CAAsBR,CAAG,CAAAS,gBAAA,GAAAA,gBAAA,CAAAP,sBAAA,imBAAAC,OAAA,KAiCzBO,CAAAA,CAAsBV,CAAG,CAAAW,gBAAA,GAAAA,gBAAA,CAAAT,sBAAA,uXAAAC,OAAA,KAkBzBS,CAAAA,CAAoBZ,CAAG,CAAAa,gBAAA,GAAAA,gBAAA,CAAAX,sBAAA"}
@@ -0,0 +1,120 @@
1
+ import{css as e}from"lit";const o=e`
2
+ :host([resizable]) {
3
+ position: relative;
4
+ overflow: hidden;
5
+ table-layout: fixed;
6
+ }
7
+ `,r=e`
8
+ :host([resizable]) {
9
+ position: relative;
10
+ }
11
+
12
+ :host([resizable]) .header__item__wrapper {
13
+ border-right: 1px solid var(--nile-colors-neutral-400);
14
+ position: relative;
15
+ }
16
+ `,t=e`
17
+ .resizer {
18
+ position: absolute;
19
+ right: 0;
20
+ top: -1000px;
21
+ bottom: -1000px;
22
+ width: 8px;
23
+ cursor: col-resize;
24
+ user-select: none;
25
+ background-color: var(--nile-colors-neutral-100);
26
+ transition: background-color 0.2s;
27
+ z-index: 10;
28
+ opacity: 0;
29
+ transition: opacity 0.2s ease;
30
+ pointer-events: none;
31
+ }
32
+
33
+ :host([resizable]):hover .resizer {
34
+ opacity: 1;
35
+ pointer-events: auto;
36
+ }
37
+
38
+ .resizer::before {
39
+ content: '';
40
+ position: absolute;
41
+ right: 3px;
42
+ top: 0;
43
+ width: 2px;
44
+ height: 100%;
45
+ background-color: var(--nile-colors-neutral-500);
46
+ opacity: 0.8;
47
+ }
48
+
49
+ .resizer:hover {
50
+ background-color: var(--nile-colors-neutral-400);
51
+ }
52
+
53
+ .resizer:hover::before {
54
+ background-color: var(--nile-colors-neutral-700);
55
+ opacity: 1;
56
+ }
57
+
58
+ .resizer.resizing {
59
+ background-color: var(--nile-colors-neutral-400);
60
+ opacity: 1;
61
+ pointer-events: auto;
62
+ }
63
+
64
+ .resizer.resizing::before {
65
+ background-color: var(--nile-colors-neutral-700);
66
+ opacity: 1;
67
+ width: 3px;
68
+ }
69
+ `,i=e`
70
+ .resizer {
71
+ position: absolute;
72
+ right: -2px;
73
+ top: -1000px;
74
+ bottom: -1000px;
75
+ width: 8px;
76
+ cursor: ew-resize;
77
+ user-select: none;
78
+ transition: background-color 0.2s;
79
+ z-index: 10;
80
+ opacity: 0;
81
+ transition: opacity 0.2s ease;
82
+ }
83
+
84
+ :host([resizable]):hover .resizer {
85
+ opacity: 1;
86
+ }
87
+
88
+ .resizer::before {
89
+ content: '';
90
+ position: absolute;
91
+ height: 100%;
92
+ opacity: 0.8;
93
+ }
94
+
95
+ .resizer.resizing {
96
+ border-right: 4px double var(--nile-colors-neutral-400);
97
+ background-color: transparent;
98
+ opacity: 1;
99
+ }
100
+ `,s=e`
101
+ :host([resizable]) ::slotted(*) {
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ white-space: nowrap;
105
+ display: block;
106
+ }
107
+
108
+ :host([resizable]) ::slotted(span),
109
+ :host([resizable]) ::slotted(div),
110
+ :host([resizable]) ::slotted(p) {
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
113
+ white-space: nowrap;
114
+ display: block;
115
+ }
116
+ `,a=e`
117
+ .nile__table__body[resizable] {
118
+ table-layout: fixed;
119
+ }
120
+ `;export{t as a,s as b,r as c,i as h,o as r,a as t};
@@ -1,2 +1,2 @@
1
- System.register(["./nile-table-body.cjs.js","tslib","lit","lit/decorators.js","./nile-table-body.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTableBodyCjsJs){_export("NileTableBody",_nileTableBodyCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileTableBodyCssCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-table-body.cjs.js","tslib","lit","lit/decorators.js","./nile-table-body.css.cjs.js","../internal/resizable-table-styles.cjs.js","../internal/nile-element.cjs.js","../internal/resizable-table-helper.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTableBodyCjsJs){_export("NileTableBody",_nileTableBodyCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileTableBodyCssCjsJs){},function(_internalResizableTableStylesCjsJs){},function(_internalNileElementCjsJs){},function(_internalResizableTableHelperCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- export{N as NileTableBody}from"./nile-table-body.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-table-body.css.esm.js";import"../internal/nile-element.esm.js";
1
+ export{N as NileTableBody}from"./nile-table-body.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-table-body.css.esm.js";import"../internal/resizable-table-styles.esm.js";import"../internal/nile-element.esm.js";import"../internal/resizable-table-helper.esm.js";
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-body.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var e,t,s,i,r,l,a,o,d,_templateObject,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;i=_litDecoratorsJs.queryAssignedNodes;r=_litDecoratorsJs.property;l=_litDecoratorsJs.state;a=_litDecoratorsJs.customElement;},function(_nileTableBodyCssCjsJs){o=_nileTableBodyCssCjsJs.s;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",n=/*#__PURE__*/function(_d){function n(){var _this;_classCallCheck(this,n);_this=_callSuper(this,n,arguments),_this.type="primary",_this.rows_data=[],_this.header_rows_data=[];return _this;}_inherits(n,_d);return _createClass(n,[{key:"firstUpdated",value:function firstUpdated(e){this.emit("nile-body-load",{value:this.type,comp:this},!0,!1);}},{key:"getChildren",value:function getChildren(e,t){return e.querySelectorAll(t);}},{key:"getIndexValue",value:function getIndexValue(e){return this.header_rows_data.indexOf(e);}},{key:"handleSlotchange",value:function handleSlotchange(e){var _this2=this;var t=[];this._childNodes.forEach(function(e){var _e$tagName;if(e.tagName&&"nile-table-row"===(e===null||e===void 0||(_e$tagName=e.tagName)===null||_e$tagName===void 0?void 0:_e$tagName.toLowerCase())){var _s=_this2.getChildren(e,"nile-table-cell-item");if(_s.length>0)_s.forEach(function(e){t.push(e.innerHTML);}),_this2.rows_data.push(t);else{var _t=_this2.getChildren(e,"nile-table-header-item");_t.length>0&&_t.forEach(function(e,t){_this2.header_rows_data.push(e.innerHTML);});}t=[];}});}},{key:"handleSort",value:function handleSort(e){var _e$detail$value=e.detail.value,t=_e$detail$value.curr_sort_string,s=_e$detail$value.order,i=this.getIndexValue(t);this.emit("nile-sort",{value:{header_index:i,curr_sort_string:t,order:s}});}},{key:"handleSearch",value:function handleSearch(e){var t=e.detail.value;this.search__index=this.getIndexValue(e.target.textContent),this.emit("nile-table-search",{index:this.search__index,value:t});}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"base\" part=\"base\">\n <slot name=\"table__header\" class=\"table__header\"></slot>\n <slot\n @slotchange=","\n @nile-click-sort=","\n class=\"nile__table__body\"\n @nile-search=","\n ></slot>\n </div>\n "])),this.handleSlotchange,this.handleSort,this.handleSearch);}}],[{key:"styles",get:function get(){return[o];}}]);}(d));e([s("slot")],n.prototype,"defaultSlot",void 0),e([i({flatten:!0})],n.prototype,"_childNodes",void 0),e([r()],n.prototype,"type",void 0),e([l()],n.prototype,"rows_data",void 0),e([l()],n.prototype,"header_rows_data",void 0),e([l()],n.prototype,"sort__index",void 0),e([l()],n.prototype,"search__index",void 0),_export("N",n=e([a("nile-table-body")],n));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-body.css.cjs.js","../internal/nile-element.cjs.js","../internal/resizable-table-helper.cjs.js","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,t,s,i,l,r,a,o,h,n,_templateObject,d;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;i=_litDecoratorsJs.queryAssignedNodes;l=_litDecoratorsJs.property;r=_litDecoratorsJs.state;a=_litDecoratorsJs.customElement;},function(_nileTableBodyCssCjsJs){o=_nileTableBodyCssCjsJs.s;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_internalResizableTableHelperCjsJs){n=_internalResizableTableHelperCjsJs.h;},function(_internalResizableTableStylesCjsJs){}],execute:function execute(){_export("N",d=/*#__PURE__*/function(_h){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.type="primary",_this.rows_data=[],_this.header_rows_data=[],_this.hasResizableColumns=!1;return _this;}_inherits(d,_h);return _createClass(d,[{key:"firstUpdated",value:function firstUpdated(e){this.emit("nile-body-load",{value:this.type,comp:this},!0,!1);}},{key:"getChildren",value:function getChildren(e,t){return e.querySelectorAll(t);}},{key:"getIndexValue",value:function getIndexValue(e){return this.header_rows_data.indexOf(e);}},{key:"checkForResizableColumns",value:function checkForResizableColumns(){this.hasResizableColumns=n(this);}},{key:"handleSlotchange",value:function handleSlotchange(e){var _this2=this;var t=[];this._childNodes.forEach(function(e){var _e$tagName;if(e.tagName&&"nile-table-row"===(e===null||e===void 0||(_e$tagName=e.tagName)===null||_e$tagName===void 0?void 0:_e$tagName.toLowerCase())){var _s=_this2.getChildren(e,"nile-table-cell-item");if(_s.length>0)_s.forEach(function(e){t.push(e.innerHTML);}),_this2.rows_data.push(t);else{var _t=_this2.getChildren(e,"nile-table-header-item");_t.length>0&&_t.forEach(function(e,t){_this2.header_rows_data.push(e.innerHTML);});}t=[];}}),this.checkForResizableColumns();}},{key:"handleSort",value:function handleSort(e){var _e$detail$value=e.detail.value,t=_e$detail$value.curr_sort_string,s=_e$detail$value.order,i=this.getIndexValue(t);this.emit("nile-sort",{value:{header_index:i,curr_sort_string:t,order:s}});}},{key:"handleSearch",value:function handleSearch(e){var t=e.detail.value;this.search__index=this.getIndexValue(e.target.textContent),this.emit("nile-table-search",{index:this.search__index,value:t});}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"base\" part=\"base\">\n <slot name=\"table__header\" class=\"table__header\"></slot>\n <slot\n @slotchange=","\n @nile-click-sort=","\n class=\"nile__table__body\"\n ?resizable=","\n @nile-search=","\n ></slot>\n </div>\n "])),this.handleSlotchange,this.handleSort,this.hasResizableColumns,this.handleSearch);}}],[{key:"styles",get:function get(){return[o];}}]);}(h));e([s("slot")],d.prototype,"defaultSlot",void 0),e([i({flatten:!0})],d.prototype,"_childNodes",void 0),e([l()],d.prototype,"type",void 0),e([r()],d.prototype,"rows_data",void 0),e([r()],d.prototype,"header_rows_data",void 0),e([r()],d.prototype,"sort__index",void 0),e([r()],d.prototype,"search__index",void 0),e([r()],d.prototype,"hasResizableColumns",void 0),_export("N",d=e([a("nile-table-body")],d));}};});
2
2
  //# sourceMappingURL=nile-table-body.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-body.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport {\n customElement,\n query,\n state,\n queryAll,\n queryAssignedElements,\n queryAssignedNodes,\n property\n} from 'lit/decorators.js';\nimport { styles } from './nile-table-body.css';\nimport NileElement from '../internal/nile-element';\nimport { getInnerHTML } from '../slot';\n\n/**\n * nile-table-body component.\n *\n * @tag nile-table-body\n *\n */\n@customElement('nile-table-body')\nexport class NileTableBody extends NileElement {\n /**\n * The styles for TableBody\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n @query('slot') defaultSlot: HTMLSlotElement;\n @queryAssignedNodes({ flatten: true }) _childNodes!: Array<HTMLElement>;\n @property() type: 'primary' | 'secondary' = 'primary';\n\n @state() private rows_data: any[] = [];\n @state() private header_rows_data: any[] = [];\n @state() private sort__index: number;\n @state() private search__index: number;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n this.emit('nile-body-load', { value: this.type, comp:this },true,false)\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n private getChildren(child: any, tagname: string) {\n return child.querySelectorAll(tagname);\n }\n\n private getIndexValue(index__value: string): number {\n return this.header_rows_data.indexOf(index__value);\n }\n\n handleSlotchange(e: any) {\n let row_data: any = [];\n this._childNodes.forEach((child: any) => {\n if (child.tagName && child?.tagName?.toLowerCase() === 'nile-table-row') {\n let nilerows = this.getChildren(child, 'nile-table-cell-item');\n if (nilerows.length > 0) {\n nilerows.forEach((element: { innerHTML: any }) => {\n row_data.push(element.innerHTML);\n });\n this.rows_data.push(row_data);\n } else {\n let nileheaders = this.getChildren(child, 'nile-table-header-item');\n if (nileheaders.length > 0) {\n nileheaders.forEach((header: HTMLSlotElement, index: number) => {\n this.header_rows_data.push(header.innerHTML);\n });\n }\n }\n row_data = [];\n }\n });\n }\n\n private handleSort(e: any) {\n const { curr_sort_string, order } = e.detail.value;\n const header_index = this.getIndexValue(curr_sort_string);\n this.emit('nile-sort', {\n value: { header_index, curr_sort_string, order },\n });\n }\n\n private handleSearch(e: any) {\n const searchText = e.detail.value;\n this.search__index = this.getIndexValue(e.target.textContent);\n this.emit('nile-table-search', {\n index: this.search__index,\n value: searchText,\n });\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"base\" part=\"base\">\n <slot name=\"table__header\" class=\"table__header\"></slot>\n <slot\n @slotchange=${this.handleSlotchange}\n @nile-click-sort=${this.handleSort}\n class=\"nile__table__body\"\n @nile-search=${this.handleSearch}\n ></slot>\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileTableBody;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-body': NileTableBody;\n }\n}\n"],"names":["NileTableBody","_d","n","constructor","this","type","rows_data","header_rows_data","_this","_inherits","_createClass","key","value","firstUpdated","_changedProperties","emit","comp","getChildren","child","tagname","querySelectorAll","getIndexValue","index__value","indexOf","handleSlotchange","e","row_data","_childNodes","forEach","tagName","toLowerCase","nilerows","length","element","push","innerHTML","nileheaders","header","index","handleSort","_e$detail$value","detail","header_index","curr_sort_string","order","handleSearch","searchText","search__index","target","textContent","render","html","_templateObject","_taggedTemplateLiteral","__decorate","get","styles","NileElement","query","prototype","queryAssignedNodes","flatten","property","state","customElement"],"mappings":"muGAkCaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAQOC,EAAAA,KAAAA,CAAIC,KAA4B,SAE3BD,CAAAA,KAAAA,CAASE,UAAU,EACnBF,CAAAA,KAAAA,CAAgBG,iBAAU,EA+E5C,QAAAC,KAAA,EA3EQC,SAAA,CAAAP,CAAA,CAAAD,EAAA,SAAAS,YAAA,CAAAR,CAAA,GAAAS,GAAA,gBAAAC,KAAA,CAIG,SAAAC,YAAAA,CAAaC,CAAAA,CAAAA,CACrBV,KAAKW,IAAK,CAAA,gBAAA,CAAkB,CAAEH,KAAOR,CAAAA,IAAAA,CAAKC,KAAMW,IAAKZ,CAAAA,IAAAA,CAAAA,CAAAA,CAAO,GAAK,CAClE,CAAA,EAMO,GAAAO,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A,CAAAA,CAAAA,CAAAA,CAAA2D,SAAA,CAAA,aAAA,CAAA,IAAA,EAC5DL,CAAAA,CAAAA,CAAAA,CAAA,CAAXQ,CAAAA,CAAAA,CAAAA,CAAAA,CAAqD9D,CAAA2D,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAErCL,CAAA,CAAA,CAAhBS,CAAsC/D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CACtBL,CAAA,CAAA,CAAhBS,CAA6C/D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,SAAA,CAAA,kBAAA,CAAA,IAAA,EAC7BL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBS,CAAAA,CAAAA,CAAAA,CAAAA,CAAoC/D,CAAA2D,CAAAA,SAAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,CACpBL,CAAA,CAAA,CAAhBS,CAAsC/D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2D,SAAA,CAAA,eAAA,CAAA,IAAA,EAb5B3D,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAasD,CAAA,CAAA,CADzBU,CAAc,CAAA,iBAAA,CAAA,CAAA,CACFhE"}
1
+ {"version":3,"file":"nile-table-body.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport {\n customElement,\n query,\n state,\n queryAll,\n queryAssignedElements,\n queryAssignedNodes,\n property\n} from 'lit/decorators.js';\nimport { styles } from './nile-table-body.css';\nimport NileElement from '../internal/nile-element';\nimport { getInnerHTML } from '../slot';\nimport { hasResizableColumns } from '../internal/resizable-table-helper';\n\n/**\n * nile-table-body component.\n *\n * @tag nile-table-body\n *\n */\n@customElement('nile-table-body')\nexport class NileTableBody extends NileElement {\n /**\n * The styles for TableBody\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n @query('slot') defaultSlot: HTMLSlotElement;\n @queryAssignedNodes({ flatten: true }) _childNodes!: Array<HTMLElement>;\n @property() type: 'primary' | 'secondary' = 'primary';\n\n @state() private rows_data: any[] = [];\n @state() private header_rows_data: any[] = [];\n @state() private sort__index: number;\n @state() private search__index: number;\n @state() private hasResizableColumns = false;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n this.emit('nile-body-load', { value: this.type, comp:this },true,false)\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n private getChildren(child: any, tagname: string) {\n return child.querySelectorAll(tagname);\n }\n\n private getIndexValue(index__value: string): number {\n return this.header_rows_data.indexOf(index__value);\n }\n\n private checkForResizableColumns() {\n this.hasResizableColumns = hasResizableColumns(this);\n }\n\n handleSlotchange(e: any) {\n let row_data: any = [];\n this._childNodes.forEach((child: any) => {\n if (child.tagName && child?.tagName?.toLowerCase() === 'nile-table-row') {\n let nilerows = this.getChildren(child, 'nile-table-cell-item');\n if (nilerows.length > 0) {\n nilerows.forEach((element: { innerHTML: any }) => {\n row_data.push(element.innerHTML);\n });\n this.rows_data.push(row_data);\n } else {\n let nileheaders = this.getChildren(child, 'nile-table-header-item');\n if (nileheaders.length > 0) {\n nileheaders.forEach((header: HTMLSlotElement, index: number) => {\n this.header_rows_data.push(header.innerHTML);\n });\n }\n }\n row_data = [];\n }\n });\n \n this.checkForResizableColumns();\n }\n\n private handleSort(e: any) {\n const { curr_sort_string, order } = e.detail.value;\n const header_index = this.getIndexValue(curr_sort_string);\n this.emit('nile-sort', {\n value: { header_index, curr_sort_string, order },\n });\n }\n\n private handleSearch(e: any) {\n const searchText = e.detail.value;\n this.search__index = this.getIndexValue(e.target.textContent);\n this.emit('nile-table-search', {\n index: this.search__index,\n value: searchText,\n });\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"base\" part=\"base\">\n <slot name=\"table__header\" class=\"table__header\"></slot>\n <slot\n @slotchange=${this.handleSlotchange}\n @nile-click-sort=${this.handleSort}\n class=\"nile__table__body\"\n ?resizable=${this.hasResizableColumns}\n @nile-search=${this.handleSearch}\n ></slot>\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileTableBody;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-body': NileTableBody;\n }\n}\n"],"names":["NileTableBody","d","constructor","this","type","rows_data","header_rows_data","hasResizableColumns","_this","_inherits","_h","_createClass","key","value","firstUpdated","_changedProperties","emit","comp","getChildren","child","tagname","querySelectorAll","getIndexValue","index__value","indexOf","checkForResizableColumns","handleSlotchange","e","_this2","row_data","_childNodes","forEach","tagName","toLowerCase","nilerows","length","element","push","innerHTML","nileheaders","header","index","handleSort","_e$detail$value","detail","header_index","curr_sort_string","order","s","handleSearch","searchText","search__index","target","textContent","render","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","query","prototype","queryAssignedNodes","flatten","property","state","_export","customElement"],"mappings":"k8GAmCaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAQOC,KAAAA,CAAIC,IAA4B,CAAA,SAAA,CAE3BD,KAAAA,CAASE,SAAU,CAAA,EAAA,CACnBF,KAAAA,CAAgBG,gBAAU,CAAA,EAAA,CAG1BH,KAAAA,CAAmBI,mBAAAA,CAAAA,CAAG,CAoFxC,QAAAC,KAAA,EAlFQC,SAAA,CAAAR,CAAA,CAAAS,EAAA,SAAAC,YAAA,CAAAV,CAAA,GAAAW,GAAA,gBAAAC,KAAA,CAIG,SAAAC,YAAAA,CAAaC,CAAAA,CAAAA,CACrBZ,IAAKa,CAAAA,IAAAA,CAAK,gBAAkB,CAAA,CAAEH,MAAOV,IAAKC,CAAAA,IAAAA,CA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.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,e;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",e=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n"]))));}};});
1
+ System.register(["lit","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var o,e,_templateObject,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;},function(_internalResizableTableStylesCjsJs){e=_internalResizableTableStylesCjsJs.t;}],execute:function execute(){_export("s",l=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n\n ","\n"])),e));}};});
2
2
  //# sourceMappingURL=nile-table-body.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-body.css.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * TableBody CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-table-body.css.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { tableLayoutStyles } from '../internal/resizable-table-styles';\n\n/**\n * TableBody CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n\n ${tableLayoutStyles}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral","tableLayoutStyles"],"mappings":"wbAaaA,EAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,0gCAuCrBC,CAAAA"}
@@ -1,4 +1,4 @@
1
- import{css as o}from"lit";const e=o`
1
+ import{css as e}from"lit";import{t as o}from"../internal/resizable-table-styles.esm.js";const l=e`
2
2
  :host {
3
3
  box-sizing: border-box;
4
4
  --nile-table-background--odd: var(--nile-colors-base-white);
@@ -36,4 +36,6 @@ import{css as o}from"lit";const e=o`
36
36
  slot::slotted(nile-table-row:last-child) {
37
37
  border-bottom: 0px;
38
38
  }
39
- `;export{e as s};
39
+
40
+ ${o}
41
+ `;export{l as s};
@@ -1,11 +1,12 @@
1
- import{__decorate as e}from"tslib";import{html as t}from"lit";import{query as s,queryAssignedNodes as i,property as r,state as l,customElement as a}from"lit/decorators.js";import{s as o}from"./nile-table-body.css.esm.js";import{N as d}from"../internal/nile-element.esm.js";let n=class extends d{constructor(){super(...arguments),this.type="primary",this.rows_data=[],this.header_rows_data=[]}static get styles(){return[o]}firstUpdated(e){this.emit("nile-body-load",{value:this.type,comp:this},!0,!1)}getChildren(e,t){return e.querySelectorAll(t)}getIndexValue(e){return this.header_rows_data.indexOf(e)}handleSlotchange(e){let t=[];this._childNodes.forEach((e=>{if(e.tagName&&"nile-table-row"===e?.tagName?.toLowerCase()){let s=this.getChildren(e,"nile-table-cell-item");if(s.length>0)s.forEach((e=>{t.push(e.innerHTML)})),this.rows_data.push(t);else{let t=this.getChildren(e,"nile-table-header-item");t.length>0&&t.forEach(((e,t)=>{this.header_rows_data.push(e.innerHTML)}))}t=[]}}))}handleSort(e){const{curr_sort_string:t,order:s}=e.detail.value,i=this.getIndexValue(t);this.emit("nile-sort",{value:{header_index:i,curr_sort_string:t,order:s}})}handleSearch(e){const t=e.detail.value;this.search__index=this.getIndexValue(e.target.textContent),this.emit("nile-table-search",{index:this.search__index,value:t})}render(){return t`
1
+ import{__decorate as e}from"tslib";import{html as t}from"lit";import{query as s,queryAssignedNodes as i,property as l,state as r,customElement as a}from"lit/decorators.js";import{s as o}from"./nile-table-body.css.esm.js";import{N as h}from"../internal/nile-element.esm.js";import{h as n}from"../internal/resizable-table-helper.esm.js";import"../internal/resizable-table-styles.esm.js";let d=class extends h{constructor(){super(...arguments),this.type="primary",this.rows_data=[],this.header_rows_data=[],this.hasResizableColumns=!1}static get styles(){return[o]}firstUpdated(e){this.emit("nile-body-load",{value:this.type,comp:this},!0,!1)}getChildren(e,t){return e.querySelectorAll(t)}getIndexValue(e){return this.header_rows_data.indexOf(e)}checkForResizableColumns(){this.hasResizableColumns=n(this)}handleSlotchange(e){let t=[];this._childNodes.forEach((e=>{if(e.tagName&&"nile-table-row"===e?.tagName?.toLowerCase()){let s=this.getChildren(e,"nile-table-cell-item");if(s.length>0)s.forEach((e=>{t.push(e.innerHTML)})),this.rows_data.push(t);else{let t=this.getChildren(e,"nile-table-header-item");t.length>0&&t.forEach(((e,t)=>{this.header_rows_data.push(e.innerHTML)}))}t=[]}})),this.checkForResizableColumns()}handleSort(e){const{curr_sort_string:t,order:s}=e.detail.value,i=this.getIndexValue(t);this.emit("nile-sort",{value:{header_index:i,curr_sort_string:t,order:s}})}handleSearch(e){const t=e.detail.value;this.search__index=this.getIndexValue(e.target.textContent),this.emit("nile-table-search",{index:this.search__index,value:t})}render(){return t`
2
2
  <div class="base" part="base">
3
3
  <slot name="table__header" class="table__header"></slot>
4
4
  <slot
5
5
  @slotchange=${this.handleSlotchange}
6
6
  @nile-click-sort=${this.handleSort}
7
7
  class="nile__table__body"
8
+ ?resizable=${this.hasResizableColumns}
8
9
  @nile-search=${this.handleSearch}
9
10
  ></slot>
10
11
  </div>
11
- `}};e([s("slot")],n.prototype,"defaultSlot",void 0),e([i({flatten:!0})],n.prototype,"_childNodes",void 0),e([r()],n.prototype,"type",void 0),e([l()],n.prototype,"rows_data",void 0),e([l()],n.prototype,"header_rows_data",void 0),e([l()],n.prototype,"sort__index",void 0),e([l()],n.prototype,"search__index",void 0),n=e([a("nile-table-body")],n);export{n as N};
12
+ `}};e([s("slot")],d.prototype,"defaultSlot",void 0),e([i({flatten:!0})],d.prototype,"_childNodes",void 0),e([l()],d.prototype,"type",void 0),e([r()],d.prototype,"rows_data",void 0),e([r()],d.prototype,"header_rows_data",void 0),e([r()],d.prototype,"sort__index",void 0),e([r()],d.prototype,"search__index",void 0),e([r()],d.prototype,"hasResizableColumns",void 0),d=e([a("nile-table-body")],d);export{d as N};
@@ -1,2 +1,2 @@
1
- System.register(["./nile-table-cell-item.cjs.js","tslib","lit","lit/decorators.js","./nile-table-cell-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTableCellItemCjsJs){_export("NileTableCellItem",_nileTableCellItemCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileTableCellItemCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalSlotCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-table-cell-item.cjs.js","tslib","lit","lit/decorators.js","./nile-table-cell-item.css.cjs.js","../internal/resizable-table-styles.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../internal/resizable-table-helper.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTableCellItemCjsJs){_export("NileTableCellItem",_nileTableCellItemCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileTableCellItemCssCjsJs){},function(_internalResizableTableStylesCjsJs){},function(_internalNileElementCjsJs){},function(_internalSlotCjsJs){},function(_internalResizableTableHelperCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- export{N as NileTableCellItem}from"./nile-table-cell-item.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-table-cell-item.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/slot.esm.js";
1
+ export{N as NileTableCellItem}from"./nile-table-cell-item.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-table-cell-item.css.esm.js";import"../internal/resizable-table-styles.esm.js";import"../internal/nile-element.esm.js";import"../internal/slot.esm.js";import"../internal/resizable-table-helper.esm.js";
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-cell-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js"],function(_export,_context){"use strict";var t,e,s,l,r,i,_templateObject,_templateObject2,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.customElement;},function(_nileTableCellItemCssCjsJs){l=_nileTableCellItemCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){i=_internalSlotCjsJs.H;}],execute:function execute(){_export("N",o=/*#__PURE__*/function(_r){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.hasSlotController=new i(_assertThisInitialized(_this),"[default]");return _this;}_inherits(o,_r);return _createClass(o,[{key:"render",value:function render(){return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n ","\n "])),this.hasSlotController.test("[default]")?e(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <slot class=\"column\" part=\"nile__table-cell\"> </slot>"]))):"");}}],[{key:"styles",get:function get(){return[l];}}]);}(r));_export("N",o=t([s("nile-table-cell-item")],o));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-cell-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../internal/resizable-table-helper.cjs.js","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,t,s,l,i,r,a,o,_templateObject,_templateObject2,_templateObject3,_templateObject4,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileTableCellItemCssCjsJs){i=_nileTableCellItemCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){a=_internalSlotCjsJs.H;},function(_internalResizableTableHelperCjsJs){o=_internalResizableTableHelperCjsJs.c;},function(_internalResizableTableStylesCjsJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_r){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new a(_assertThisInitialized(_this),"[default]"),_this.resizable=!1,_this.handleResizeStart=o(_assertThisInitialized(_this),50);return _this;}_inherits(c,_r);return _createClass(c,[{key:"render",value:function render(){return this.resizable?t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"cell__wrapper\" part=\"nile__table-cell\">\n ","\n <div class=\"resizer\" @mousedown=","></div>\n </div>\n "])),this.hasSlotController.test("[default]")?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <div class=\"column\" part=\"nile__table-cell\"><slot></slot></div>"]))):"",this.handleResizeStart):t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n ","\n "])),this.hasSlotController.test("[default]")?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" <slot class=\"column\" part=\"nile__table-cell\"> </slot>"]))):"");}}],[{key:"styles",get:function get(){return[i];}}]);}(r));e([s({type:Boolean,reflect:!0})],c.prototype,"resizable",void 0),_export("N",c=e([l("nile-table-cell-item")],c));}};});
2
2
  //# sourceMappingURL=nile-table-cell-item.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-cell-item.cjs.js","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-table-cell-item.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * Nile table Cell Item component.\n *\n * @tag nile-table-cell-item\n *\n */\n@customElement('nile-table-cell-item')\nexport class NileTableCellItem extends NileElement {\n private readonly hasSlotController = new HasSlotController(this, '[default]');\n /**\n * The styles for TableCellItem\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html`\n ${this.hasSlotController.test('[default]')\n ? html` <slot class=\"column\" part=\"nile__table-cell\"> </slot>`\n : ''}\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileTableCellItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-cell-item': NileTableCellItem;\n }\n}\n"],"names":["NileTableCellItem","_r","o","constructor","this","hasSlotController","HasSlotController","_this","_inherits","_createClass","key","value","render","html","_templateObject","_taggedTemplateLiteral","test","_templateObject2","get","styles","NileElement","__decorate","customElement"],"mappings":"utGAyBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCACYC,KAAAA,CAAiBC,iBAAG,CAAA,GAAIC,CAAAA,CAAkBF,CAAAA,sBAAAA,CAAAA,KAAAA,EAAM,YA0BlE,QAAAG,KAAA,EArBQC,SAAA,CAAAN,CAAA,CAAAD,EAAA,SAAAQ,YAAA,CAAAP,CAAA,GAAAQ,GAAA,UAAAC,KAAA,CAYA,SAAAC,MAAAA,CAAAA,CAAAA,CACL,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,yBACPX,IAAAA,CAAKC,iBAAkBW,CAAAA,IAAAA,CAAK,WAC1BH,CAAAA,CAAAA,CAAI,CAAAI,gBAAA,GAAAA,gBAAA,CAAAF,sBAAA,mEACJ,EAAA,EAEP,CAAA,KAAAL,GAAA,UAAAQ,GAAA,CAlBM,SAAAA,IAAA,CACL,CAAA,MAAO,CAACC,CACT,CAAA,EAUM,MAlB8BC,IAA1BpB,OAAAA,KAAAA,CAAiBqB,CAAAA,CAAAA,CAAA,CAD7BC,CAAAA,CAAc,yBACFtB"}
1
+ {"version":3,"file":"nile-table-cell-item.cjs.js","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-table-cell-item.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../internal/slot';\nimport { createResizeHandler } from '../internal/resizable-table-helper';\n\n/**\n * Nile table Cell Item component.\n *\n * @tag nile-table-cell-item\n *\n */\n@customElement('nile-table-cell-item')\nexport class NileTableCellItem extends NileElement {\n private readonly hasSlotController = new HasSlotController(this, '[default]');\n /**\n * The styles for TableCellItem\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /** Enables the resize functionality. */\n @property({ type: Boolean, reflect: true }) resizable = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n private handleResizeStart = createResizeHandler(this, 50);\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n if (this.resizable) {\n return html`\n <div class=\"cell__wrapper\" part=\"nile__table-cell\">\n ${this.hasSlotController.test('[default]')\n ? html` <div class=\"column\" part=\"nile__table-cell\"><slot></slot></div>`\n : ''}\n <div class=\"resizer\" @mousedown=${this.handleResizeStart}></div>\n </div>\n `;\n } else {\n return html`\n ${this.hasSlotController.test('[default]')\n ? html` <slot class=\"column\" part=\"nile__table-cell\"> </slot>`\n : ''}\n `;\n }\n }\n\n /* #endregion */\n}\n\nexport default NileTableCellItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-cell-item': NileTableCellItem;\n }\n}\n"],"names":["NileTableCellItem","c","this","hasSlotController","HasSlotController","resizable","handleResizeStart","createResizeHandler","_this","_inherits","_r","_createClass","key","value","render","html","_templateObject","_taggedTemplateLiteral","test","_templateObject2","_templateObject3","_templateObject4","get","styles","NileElement","__decorate","property","type","Boolean","reflect","prototype","customElement"],"mappings":"s/GA0BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEACYC,EAAAA,KAAAA,CAAiBC,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAUrBF,CAAAA,CAAAA,KAAAA,CAASG,WAAG,CAMhDH,CAAAA,KAAAA,CAAAI,iBAAoBC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAA0B,EAAA,CA0BvD,QAAAC,KAAA,EArCQC,SAAA,CAAAR,CAAA,CAAAS,EAAA,SAAAC,YAAA,CAAAV,CAAA,GAAAW,GAAA,UAAAC,KAAA,CAiBA,SAAAC,MAAAA,CAAAA,CACL,CAAA,MAAIZ,KAAKG,CAAAA,SAAAA,CACAU,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,wKAELf,IAAAA,CAAKC,iBAAkBe,CAAAA,IAAAA,CAAK,WAC1BH,CAAAA,CAAAA,CAAI,CAAAI,gBAAA,GAAAA,gBAAA,CAAAF,sBAAA,6EACJ,EAAA,CAC8Bf,IAAKI,CAAAA,iBAAAA,EAIpCS,CAAI,CAAAK,gBAAA,GAAAA,gBAAA,CAAAH,sBAAA,6BACPf,IAAAA,CAAKC,iBAAkBe,CAAAA,IAAAA,CAAK,WAC1BH,CAAAA,CAAAA,CAAI,CAAAM,gBAAA,GAAAA,gBAAA,CAAAJ,sBAAA,mEACJ,EAAA,CAGT,EAAA,KAAAL,GAAA,UAAAU,GAAA,CAlCM,SAAAA,IAAA,CAAWC,CAChB,MAAO,CAACA,CACT,CAAA,EAeM,MAvB8BC,CAAhC,GAWuCC,EAAA,CAA3CC,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA0B7B,CAAA8B,CAAAA,SAAAA,CAAA,gBAAA,EAXnD9B,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAiByB,EAAA,CAD7BM,CAAAA,CAAc,yBACF/B"}
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var i,_templateObject,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){i=_lit.css;}],execute:function execute(){_export("s",l=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n max-width: var(--max--cell-width);\n padding: 16px 24px;\n min-height: var(--min--height);\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n }\n"]))));}};});
1
+ System.register(["lit","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var i,e,l,t,_templateObject,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){i=_lit.css;},function(_internalResizableTableStylesCjsJs){e=_internalResizableTableStylesCjsJs.r;l=_internalResizableTableStylesCjsJs.a;t=_internalResizableTableStylesCjsJs.b;}],execute:function execute(){_export("s",a=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n padding: 16px 24px;\n max-width: var(--max--cell-width); \n min-height: var(--min--height);\n }\n\n .cell__wrapper {\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n ","\n ","\n ","\n"])),e,l,t));}};});
2
2
  //# sourceMappingURL=nile-table-cell-item.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-cell-item.css.cjs.js","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * TableCellItem CSS\n */\nexport const styles = css`\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n max-width: var(--max--cell-width);\n padding: 16px 24px;\n min-height: var(--min--height);\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-table-cell-item.css.cjs.js","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { resizableHostStyles, resizerStyles, resizableSlotStyles } from '../internal/resizable-table-styles';\n\n/**\n * TableCellItem CSS\n */\nexport const styles = css`\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n padding: 16px 24px;\n max-width: var(--max--cell-width); \n min-height: var(--min--height);\n }\n\n .cell__wrapper {\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n ${resizableHostStyles}\n ${resizerStyles}\n ${resizableSlotStyles}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral","resizableHostStyles","resizerStyles","resizableSlotStyles"],"mappings":"0gBAaaA,EAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,ygCAyCrBC,CAAAA,CACAC,CAAAA,CACAC,CAAAA"}
@@ -1,4 +1,4 @@
1
- import{css as i}from"lit";const l=i`
1
+ import{css as e}from"lit";import{r as i,a as l,b as t}from"../internal/resizable-table-styles.esm.js";const a=e`
2
2
  :host {
3
3
  --min-cell-width:auto;
4
4
  --cell-width:auto;
@@ -7,11 +7,20 @@ import{css as i}from"lit";const l=i`
7
7
  box-sizing: border-box;
8
8
  display: table-cell;
9
9
  vertical-align: middle;
10
- max-width: var(--max--cell-width);
11
10
  padding: 16px 24px;
11
+ max-width: var(--max--cell-width);
12
12
  min-height: var(--min--height);
13
13
  }
14
14
 
15
+ .cell__wrapper {
16
+ height: 100%;
17
+ position: relative;
18
+ display: flex;
19
+ align-items: center;
20
+ overflow: hidden;
21
+ width: 100%;
22
+ }
23
+
15
24
  .column {
16
25
  min-width:var(--min-cell-width);
17
26
  width:var(--cell-width);
@@ -24,5 +33,13 @@ import{css as i}from"lit";const l=i`
24
33
  /* line-height: var(--nile-type-scale-6); */
25
34
  line-height: normal;
26
35
  letter-spacing: 0.2px;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ display: block;
27
40
  }
28
- `;export{l as s};
41
+
42
+ ${i}
43
+ ${l}
44
+ ${t}
45
+ `;export{a as s};
@@ -1,3 +1,8 @@
1
- import{__decorate as t}from"tslib";import{html as e}from"lit";import{customElement as s}from"lit/decorators.js";import{s as l}from"./nile-table-cell-item.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as i}from"../internal/slot.esm.js";let o=class extends r{constructor(){super(...arguments),this.hasSlotController=new i(this,"[default]")}static get styles(){return[l]}render(){return e`
2
- ${this.hasSlotController.test("[default]")?e` <slot class="column" part="nile__table-cell"> </slot>`:""}
3
- `}};o=t([s("nile-table-cell-item")],o);export{o as N};
1
+ import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as s,customElement as l}from"lit/decorators.js";import{s as i}from"./nile-table-cell-item.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as a}from"../internal/slot.esm.js";import{c as o}from"../internal/resizable-table-helper.esm.js";import"../internal/resizable-table-styles.esm.js";let m=class extends r{constructor(){super(...arguments),this.hasSlotController=new a(this,"[default]"),this.resizable=!1,this.handleResizeStart=o(this,50)}static get styles(){return[i]}render(){return this.resizable?t`
2
+ <div class="cell__wrapper" part="nile__table-cell">
3
+ ${this.hasSlotController.test("[default]")?t` <div class="column" part="nile__table-cell"><slot></slot></div>`:""}
4
+ <div class="resizer" @mousedown=${this.handleResizeStart}></div>
5
+ </div>
6
+ `:t`
7
+ ${this.hasSlotController.test("[default]")?t` <slot class="column" part="nile__table-cell"> </slot>`:""}
8
+ `}};e([s({type:Boolean,reflect:!0})],m.prototype,"resizable",void 0),m=e([l("nile-table-cell-item")],m);export{m as N};
@@ -1,2 +1,2 @@
1
- System.register(["./nile-table-header-item.cjs.js","tslib","lit","lit/decorators.js","./nile-table-header-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTableHeaderItemCjsJs){_export("NileTableHeaderItem",_nileTableHeaderItemCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileTableHeaderItemCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalSlotCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-table-header-item.cjs.js","tslib","lit","lit/decorators.js","./nile-table-header-item.css.cjs.js","../internal/resizable-table-styles.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../internal/resizable-table-helper.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTableHeaderItemCjsJs){_export("NileTableHeaderItem",_nileTableHeaderItemCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileTableHeaderItemCssCjsJs){},function(_internalResizableTableStylesCjsJs){},function(_internalNileElementCjsJs){},function(_internalSlotCjsJs){},function(_internalResizableTableHelperCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- export{N as NileTableHeaderItem}from"./nile-table-header-item.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-table-header-item.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/slot.esm.js";
1
+ export{N as NileTableHeaderItem}from"./nile-table-header-item.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-table-header-item.css.esm.js";import"../internal/resizable-table-styles.esm.js";import"../internal/nile-element.esm.js";import"../internal/slot.esm.js";import"../internal/resizable-table-helper.esm.js";
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-header-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js"],function(_export,_context){"use strict";var e,t,i,l,s,n,r,o,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;l=_litDecoratorsJs.state;s=_litDecoratorsJs.customElement;},function(_nileTableHeaderItemCssCjsJs){n=_nileTableHeaderItemCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){o=_internalSlotCjsJs.H;}],execute:function execute(){_export("N",a=/*#__PURE__*/function(_r){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.hasSlotController=new o(_assertThisInitialized(_this),"[default]"),_this.havesort=!1,_this.havefilter=!1,_this.iconName="",_this.sorting_ct=0;return _this;}_inherits(a,_r);return _createClass(a,[{key:"handleSort",value:function handleSort(e){this.sorting_ct++;var t=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:t,order:["normal","asc","des"][this.sorting_ct%3]}});}},{key:"handleSearch",value:function handleSearch(e){this.emit("nile-search",{value:e.detail.value});}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral([" ",""])),this.hasSlotController.test("[default]")?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"header__item__wrapper\" part=\"nile__table-header-cell\">\n <div class=\"headers\">\n <slot> </slot>\n ","\n ","\n ","\n ","\n ","\n </div>\n </div>"])),this.havesort&&this.sorting_ct%3==0?t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=","\n class=\"hover__arrow\"\n ></nile-icon>"])),this.handleSort):null,this.havesort&&this.sorting_ct%3==1?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.havesort&&this.sorting_ct%3==2?t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-icon\n name=\"sortup\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.iconName?t(_templateObject6||(_templateObject6=_taggedTemplateLiteral([" <nile-icon name=\"","\" size=\"16\"></nile-icon>"])),this.iconName):t(_templateObject7||(_templateObject7=_taggedTemplateLiteral([""]))),this.havefilter?t(_templateObject8||(_templateObject8=_taggedTemplateLiteral([" <nile-popover title=\"Filter\" placement=\"bottom\">\n <nile-icon name=\"filter\" size=\"16\" slot=\"anchor\"></nile-icon>\n <nile-input\n placeholder=\"Search\"\n @nile-input=","\n part=\"filter__search\"\n ></nile-input>\n <slot name=\"filter__content\" part=\"filter__content\"></slot>\n </nile-popover>"])),this.handleSearch):t(_templateObject9||(_templateObject9=_taggedTemplateLiteral([""])))):null);}}],[{key:"styles",get:function get(){return[n];}}]);}(r));e([i({type:Boolean,reflect:!0})],a.prototype,"havesort",void 0),e([i({type:Boolean,reflect:!0})],a.prototype,"havefilter",void 0),e([i({type:String,reflect:!0,attribute:"icon-name"})],a.prototype,"iconName",void 0),e([l()],a.prototype,"sorting_ct",void 0),_export("N",a=e([s("nile-table-header-item")],a));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-header-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../internal/resizable-table-helper.cjs.js","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,i,t,s,l,r,n,o,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;s=_litDecoratorsJs.state;l=_litDecoratorsJs.customElement;},function(_nileTableHeaderItemCssCjsJs){r=_nileTableHeaderItemCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){o=_internalSlotCjsJs.H;},function(_internalResizableTableHelperCjsJs){a=_internalResizableTableHelperCjsJs.c;},function(_internalResizableTableStylesCjsJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_n){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new o(_assertThisInitialized(_this),"[default]"),_this.havesort=!1,_this.havefilter=!1,_this.iconName="",_this.resizable=!1,_this.sorting_ct=0,_this.handleResizeStart=a(_assertThisInitialized(_this),50);return _this;}_inherits(c,_n);return _createClass(c,[{key:"handleSort",value:function handleSort(e){this.sorting_ct++;var i=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:i,order:["normal","asc","des"][this.sorting_ct%3]}});}},{key:"handleSearch",value:function handleSearch(e){this.emit("nile-search",{value:e.detail.value});}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"header__item__wrapper\" part=\"nile__table-header-cell\">\n <div class=\"headers\">\n <slot> </slot>\n ","\n ","\n ","\n ","\n ","\n </div>\n ","\n </div>"])),this.havesort&&this.sorting_ct%3==0?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=","\n class=\"hover__arrow\"\n ></nile-icon>"])),this.handleSort):null,this.havesort&&this.sorting_ct%3==1?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.havesort&&this.sorting_ct%3==2?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-icon\n name=\"sortup\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.iconName?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral([" <nile-icon name=\"","\" size=\"16\"></nile-icon>"])),this.iconName):i(_templateObject6||(_templateObject6=_taggedTemplateLiteral([""]))),this.havefilter?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral([" <nile-popover title=\"Filter\" placement=\"bottom\">\n <nile-icon name=\"filter\" size=\"16\" slot=\"anchor\"></nile-icon>\n <nile-input\n placeholder=\"Search\"\n @nile-input=","\n part=\"filter__search\"\n ></nile-input>\n <slot name=\"filter__content\" part=\"filter__content\"></slot>\n </nile-popover>"])),this.handleSearch):i(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""]))),this.resizable?i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<div class=\"resizer\" @mousedown=","></div>"])),this.handleResizeStart):null);}}],[{key:"styles",get:function get(){return[r];}}]);}(n));e([t({type:Boolean,reflect:!0})],c.prototype,"havesort",void 0),e([t({type:Boolean,reflect:!0})],c.prototype,"havefilter",void 0),e([t({type:String,reflect:!0,attribute:"icon-name"})],c.prototype,"iconName",void 0),e([t({type:Boolean,reflect:!0})],c.prototype,"resizable",void 0),e([s()],c.prototype,"sorting_ct",void 0),_export("N",c=e([l("nile-table-header-item")],c));}};});
2
2
  //# sourceMappingURL=nile-table-header-item.cjs.js.map