@aquera/nile-elements 0.1.32-beta-1.0 → 0.1.32-beta-1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/nile-table/nile-table.cjs.js +1 -1
- package/dist/nile-table/nile-table.cjs.js.map +1 -1
- package/dist/nile-table/nile-table.css.cjs.js +1 -1
- package/dist/nile-table/nile-table.css.cjs.js.map +1 -1
- package/dist/nile-table/nile-table.css.esm.js +2 -1
- package/dist/nile-table/nile-table.esm.js +2 -2
- package/dist/src/nile-table/nile-table.css.js +2 -1
- package/dist/src/nile-table/nile-table.css.js.map +1 -1
- package/dist/src/nile-table/nile-table.d.ts +3 -0
- package/dist/src/nile-table/nile-table.js +18 -3
- package/dist/src/nile-table/nile-table.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-table/nile-table.css.ts +2 -1
- package/src/nile-table/nile-table.ts +19 -2
- package/vscode-html-custom-data.json +1 -1
package/README.md
CHANGED
@@ -79,6 +79,10 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
79
79
|
|
80
80
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
81
81
|
|
82
|
+
|
83
|
+
### Version 0.1.32-beta-1.1
|
84
|
+
- Nile Table: Resizing issue fixed
|
85
|
+
|
82
86
|
### Version 0.1.32-beta-1.0
|
83
87
|
- Nile Table: Workaround Styling update
|
84
88
|
|
@@ -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.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,s,i,
|
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.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,s,e,i,r,l,_templateObject,a;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return 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 _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););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){s=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.query;i=_litDecoratorsJs.customElement;},function(_nileTableCssCjsJs){r=_nileTableCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",a=/*#__PURE__*/function(_l){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.rows=[],_this.primaryRowWidths=[];return _this;}_inherits(a,_l);return _createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(a,"connectedCallback",this,3)([]),this.addEventListener("nile-body-load",this.handleRows);}},{key:"firstUpdated",value:function firstUpdated(t){var _this2=this;this.updateComplete.then(function(){_this2.handleResizeObserver();});}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t\t<slot @slotchange=\"","\"></slot>\n\t\t\t"])),this.repaintTable);}},{key:"repaintTable",value:function repaintTable(){this.realignStructure(),this.handleBodyCssUpdate();}},{key:"handleRows",value:function handleRows(t){this.rows=[].concat(_toConsumableArray(this.rows),[t.detail.comp]);}},{key:"handleBodyCssUpdate",value:function handleBodyCssUpdate(){var _t$0$shadowRoot,_t$shadowRoot;if(this.rows.length<2)return;var t=this.rows,s=(_t$0$shadowRoot=t[0].shadowRoot)===null||_t$0$shadowRoot===void 0?void 0:_t$0$shadowRoot.querySelector("div.base");s&&(s.style.borderTopRightRadius="var(--nile-radius-radius-xl)",s.style.borderTopLeftRadius="var(--nile-radius-radius-xl)",s.style.borderBottomRightRadius="0px",s.style.borderBottomLeftRadius="0px",s.style.borderBottom="none"),t.forEach(function(s,e){if(e>0&&e<t.length-1){var _s$shadowRoot;var _t=(_s$shadowRoot=s.shadowRoot)===null||_s$shadowRoot===void 0?void 0:_s$shadowRoot.querySelector("div.base");_t&&(_t.style.borderTopRightRadius="0px",_t.style.borderTopLeftRadius="0px",_t.style.borderBottomRightRadius="0px",_t.style.borderBottomLeftRadius="0px",_t.style.borderBottom="none");}});var e=(_t$shadowRoot=t[t.length-1].shadowRoot)===null||_t$shadowRoot===void 0?void 0:_t$shadowRoot.querySelector("div.base");e&&(e.style.borderTopRightRadius="0px",e.style.borderTopLeftRadius="0px",e.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",e.style.borderBottomLeftRadius="var(--nile-radius-radius-xl)");}},{key:"getPrimaryColumnWidths",value:function getPrimaryColumnWidths(){var t=this.rows.find(function(t){return"primary"==t.type;});return this.getTableCellFetchQuery(t).map(function(t){return t.clientWidth;});}},{key:"realignStructure",value:function realignStructure(){var _this3=this;if(this.rows.length<2)return;var t=this.getPrimaryColumnWidths();this.rows.filter(function(t){return"primary"!=t.type;}).forEach(function(s){var e=_this3.getTableCellFetchQuery(s);e===null||e===void 0||e.forEach(function(s,e){s.style.setProperty("--cell-width",t.at(e)+"px");});});}},{key:"getTableCellFetchQuery",value:function getTableCellFetchQuery(t){var _t$shadowRoot2;return t===null||t===void 0||(_t$shadowRoot2=t.shadowRoot)===null||_t$shadowRoot2===void 0||(_t$shadowRoot2=_t$shadowRoot2.querySelector("slot:not([name])"))===null||_t$shadowRoot2===void 0||(_t$shadowRoot2=_t$shadowRoot2.assignedElements()[0].shadowRoot)===null||_t$shadowRoot2===void 0||(_t$shadowRoot2=_t$shadowRoot2.querySelector("slot"))===null||_t$shadowRoot2===void 0?void 0:_t$shadowRoot2.assignedElements();}},{key:"handleResizeObserver",value:function handleResizeObserver(){var _this4=this;this.resizeObserver=new ResizeObserver(function(t){var _iterator=_createForOfIteratorHelper(t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _s=_step.value;_this4.realignStructure();}}catch(err){_iterator.e(err);}finally{_iterator.f();}}),this.resizeObserver.observe(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.resizeObserver.disconnect(),_superPropGet(a,"disconnectedCallback",this,3)([]);}}],[{key:"styles",get:function get(){return[r];}}]);}(l));t([e("slot")],a.prototype,"defaultSlot",void 0),_export("N",a=t([i("nile-table")],a));}};});
|
2
2
|
//# sourceMappingURL=nile-table.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table.cjs.js","sources":["../../../src/nile-table/nile-table.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 {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleBodyCssUpdate();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n const tableBodies = this.rows;\n if (!tableBodies.length) return;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"],"names":["NileTable","a","this","rows","primaryRowWidths","_this","_inherits","_l","_createClass","key","value","connectedCallback","super","addEventListener","handleRows","firstUpdated","_changedProperties","updateComplete","then","handleBodyCssUpdate","render","html","_templateObject","_taggedTemplateLiteral","repaintTable","realignStructure","e","detail","comp","_t$0$shadowRoot","_t$shadowRoot","tableBodies","length","firstEl","shadowRoot","querySelector","style","borderTopRightRadius","borderTopLeftRadius","borderBottomRightRadius","borderBottomLeftRadius","borderBottom","forEach","tb","i","_s$shadowRoot","el","lastEl","getPrimaryColumnWidths","primaryTb","find","type","getTableCellFetchQuery","map","clientWidth","_this3","filter","row","elements","ind","setProperty","at","assignedElements","__decorate","get","styles","NileElement","query","prototype","_export","customElement"],"mappings":"ylJAuBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAEEC,EAAAA,KAAAA,CAAIC,IAAsB,CAAA,EAAA,CAC1BD,KAAAA,CAAgBE,gBAAAA,CAAe,EAsGvC,QAAAC,KAAA,EA/FOC,SAAA,CAAAL,CAAA,CAAAM,EAAA,SAAAC,YAAA,CAAAP,CAAA,GAAAQ,GAAA,qBAAAC,KAAA,CAGP,SAAAC,iBAAAA,CAAAA,CACCC,CAAAA,aAAAA,CAAAA,CAAAA,iCACAV,IAAAA,CAAKW,gBAAiB,CAAA,gBAAA,CAAiBX,IAAKY,CAAAA,UAAAA,CAC5C,EAES,GAAAL,GAAA,gBAAAC,KAAA,UAAAK,YAAAA,CAAaC,CACtBd,CAAAA,KAAAA,MAAAA,MAAAA,IAAAA,CAAKe,cAAeC,CAAAA,IAAAA,CAAK,UACxBhB,CAAAA,MAAAA,CAAKiB,mBAAqB,CAAA,CAAA,EAAA,CAE3B,EAWM,GAAAV,GAAA,UAAAC,KAAA,UAAAU,MAAAA,CAAAA,CACN,CAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,yDACWrB,IAAKsB,CAAAA,YAAAA,EAE3B,CAED,GAAAf,GAAA,gBAAAC,KAAA,UAAAc,YAAAA,CAAAA,EACCtB,IAAKuB,CAAAA,gBAAAA,CAAAA,CAAAA,CACLvB,KAAKiB,mBACL,CAAA,CAAA,EAED,GAAAV,GAAA,cAAAC,KAAA,UAAAI,UAAAA,CAAWY,CACVxB,C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AAA,WAAAA,CAAY,cAAexD,CAAAA,CAAAA,CAAiByD,EAAGF,CAAAA,CAAAA,CAAAA,CAAK,KAAK,EACjE,CAAA,EAAA,CAEH,EAED,GAAAlD,GAAA,0BAAAC,KAAA,UAAA0C,sBAAAA,CAAuBK,CAAAA,CAAAA,KAAAA,cAAAA,CACtB,MAAOA,CAAAA,CAAKvB,SAALuB,CAAKvB,YAAAA,cAAAA,CAALuB,CAAKvB,CAAAA,UAAAA,UAAAA,cAAAA,YAAAA,cAAAA,CAALuB,cAAAA,CACNtB,cAA+B,kBAC/B2B,CAAAA,UAAAA,cAAAA,YAAAA,cAAAA,CAFML,cAAAA,CAENK,gBAAAA,CAAAA,CAAAA,CAAmB,GAClB5B,UAAYC,UAAAA,cAAAA,YAAAA,cAAAA,CAHPsB,cAAAA,CAGOtB,aAAAA,CAA+B,MAC5C2B,CAAAA,UAAAA,cAAAA,iBAJML,cAAAA,CAINK,gBAAAA,CAAAA,CACD,EAtGeC,KAAAA,GAAAA,UAAAA,GAAAA,CAST,SAAAC,IAAA,CAAWC,CACjB,MAAO,CAACA,CAAAA,CACR,EACD,MAb8BC,CAAxB,GACUH,CAAAA,CAAA,CAAdI,CAAM,CAAA,MAAA,CAAA,CAAA,CAAqCnE,CAAAoE,CAAAA,SAAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,CAAAC,OAAA,KADjCrE,EAAS+D,CAAA,CAAA,CADrBO,CAAc,CAAA,YAAA,CAAA,CAAA,CACFtE"}
|
1
|
+
{"version":3,"file":"nile-table.cjs.js","sources":["../../../src/nile-table/nile-table.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 {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tthis.realignStructure();\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"],"names":["NileTable","a","this","rows","primaryRowWidths","_this","_inherits","_l","_createClass","key","value","connectedCallback","super","addEventListener","handleRows","firstUpdated","_changedProperties","updateComplete","then","handleResizeObserver","render","html","_templateObject","_taggedTemplateLiteral","repaintTable","realignStructure","handleBodyCssUpdate","e","concat","_toConsumableArray","detail","comp","_t$0$shadowRoot","_t$shadowRoot","length","tableBodies","firstEl","shadowRoot","querySelector","style","borderTopRightRadius","borderTopLeftRadius","borderBottomRightRadius","borderBottomLeftRadius","borderBottom","forEach","tb","i","_s$shadowRoot","el","lastEl","getPrimaryColumnWidths","primaryTb","find","type","getTableCellFetchQuery","map","clientWidth","filter","row","elements","ind","setProperty","at","_t$shadowRoot2","assignedElements","resizeObserver","ResizeObserver","entries","_iterator","s","_step","n","done","entry","err","f","observe","disconnectedCallback","disconnect","__decorate","get","styles","NileElement","query","prototype","customElement"],"mappings":"+yKAuBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAEEC,EAAAA,KAAAA,CAAIC,IAAsB,CAAA,EAAA,CAC1BD,KAAAA,CAAgBE,gBAAAA,CAAe,EAuHvC,QAAAC,KAAA,EA/GOC,SAAA,CAAAL,CAAA,CAAAM,EAAA,SAAAC,YAAA,CAAAP,CAAA,GAAAQ,GAAA,qBAAAC,KAAA,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,CACjB,MAAO,CAACA,CAAAA,CACR,EACD,MAd8BC,CAAxB,GACUH,CAAAA,CAAA,CAAdI,CAAAA,CAAM,MAAqCpF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqF,SAAA,CAAA,aAAA,CAAA,IAAA,EADjCrF,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAASgF,CAAA,CAAA,CADrBM,CAAc,CAAA,YAAA,CAAA,CAAA,CACFtF"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,t;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",t=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\n\t}\n"]))));}};});
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,t;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",t=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\tdisplay:block;\n\t\twidth:100%;\n\t}\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-table.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table.css.cjs.js","sources":["../../../src/nile-table/nile-table.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 * Table CSS\n */\nexport const styles = css`\n\t:host {\n\n\t}\n`;\n\nexport default [styles];"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
1
|
+
{"version":3,"file":"nile-table.css.cjs.js","sources":["../../../src/nile-table/nile-table.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 * Table CSS\n */\nexport const styles = css`\n\t:host {\n\t\tdisplay:block;\n\t\twidth:100%;\n\t}\n`;\n\nexport default [styles];"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{html as s}from"lit";import{query as e,customElement as i}from"lit/decorators.js";import{s as r}from"./nile-table.css.esm.js";import{N as l}from"../internal/nile-element.esm.js";let a=class extends l{constructor(){super(...arguments),this.rows=[],this.primaryRowWidths=[]}static get styles(){return[r]}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-body-load",this.handleRows)}firstUpdated(t){this.updateComplete.then((()=>{this.
|
1
|
+
import{__decorate as t}from"tslib";import{html as s}from"lit";import{query as e,customElement as i}from"lit/decorators.js";import{s as r}from"./nile-table.css.esm.js";import{N as l}from"../internal/nile-element.esm.js";let a=class extends l{constructor(){super(...arguments),this.rows=[],this.primaryRowWidths=[]}static get styles(){return[r]}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-body-load",this.handleRows)}firstUpdated(t){this.updateComplete.then((()=>{this.handleResizeObserver()}))}render(){return s`
|
2
2
|
<slot @slotchange="${this.repaintTable}"></slot>
|
3
|
-
`}repaintTable(){this.realignStructure(),this.handleBodyCssUpdate()}handleRows(t){this.rows=[...this.rows,t.detail.comp]}handleBodyCssUpdate(){
|
3
|
+
`}repaintTable(){this.realignStructure(),this.handleBodyCssUpdate()}handleRows(t){this.rows=[...this.rows,t.detail.comp]}handleBodyCssUpdate(){if(this.rows.length<2)return;const t=this.rows,s=t[0].shadowRoot?.querySelector("div.base");s&&(s.style.borderTopRightRadius="var(--nile-radius-radius-xl)",s.style.borderTopLeftRadius="var(--nile-radius-radius-xl)",s.style.borderBottomRightRadius="0px",s.style.borderBottomLeftRadius="0px",s.style.borderBottom="none"),t.forEach(((s,e)=>{if(e>0&&e<t.length-1){const t=s.shadowRoot?.querySelector("div.base");t&&(t.style.borderTopRightRadius="0px",t.style.borderTopLeftRadius="0px",t.style.borderBottomRightRadius="0px",t.style.borderBottomLeftRadius="0px",t.style.borderBottom="none")}}));const e=t[t.length-1].shadowRoot?.querySelector("div.base");e&&(e.style.borderTopRightRadius="0px",e.style.borderTopLeftRadius="0px",e.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",e.style.borderBottomLeftRadius="var(--nile-radius-radius-xl)")}getPrimaryColumnWidths(){const t=this.rows.find((t=>"primary"==t.type));return this.getTableCellFetchQuery(t).map((t=>t.clientWidth))}realignStructure(){if(this.rows.length<2)return;const t=this.getPrimaryColumnWidths();this.rows.filter((t=>"primary"!=t.type)).forEach((s=>{let e=this.getTableCellFetchQuery(s);e?.forEach(((s,e)=>{s.style.setProperty("--cell-width",t.at(e)+"px")}))}))}getTableCellFetchQuery(t){return t?.shadowRoot?.querySelector("slot:not([name])")?.assignedElements()[0].shadowRoot?.querySelector("slot")?.assignedElements()}handleResizeObserver(){this.resizeObserver=new ResizeObserver((t=>{for(let s of t)this.realignStructure()})),this.resizeObserver.observe(this)}disconnectedCallback(){this.resizeObserver.disconnect(),super.disconnectedCallback()}};t([e("slot")],a.prototype,"defaultSlot",void 0),a=t([i("nile-table")],a);export{a as N};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table.css.js","sourceRoot":"","sources":["../../../src/nile-table/nile-table.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-table.css.js","sourceRoot":"","sources":["../../../src/nile-table/nile-table.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;CAKxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","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 * Table CSS\n */\nexport const styles = css`\n\t:host {\n\t\tdisplay:block;\n\t\twidth:100%;\n\t}\n`;\n\nexport default [styles];"]}
|
@@ -17,6 +17,7 @@ export declare class NileTable extends NileElement {
|
|
17
17
|
defaultSlot: HTMLSlotElement;
|
18
18
|
private rows;
|
19
19
|
private primaryRowWidths;
|
20
|
+
private resizeObserver;
|
20
21
|
/**
|
21
22
|
* The styles for nile-table
|
22
23
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
@@ -35,6 +36,8 @@ export declare class NileTable extends NileElement {
|
|
35
36
|
getPrimaryColumnWidths(): number[];
|
36
37
|
realignStructure(): void;
|
37
38
|
getTableCellFetchQuery(row: NileTableBody): Array<Element>;
|
39
|
+
handleResizeObserver(): void;
|
40
|
+
disconnectedCallback(): void;
|
38
41
|
}
|
39
42
|
export default NileTable;
|
40
43
|
declare global {
|
@@ -35,7 +35,7 @@ let NileTable = class NileTable extends NileElement {
|
|
35
35
|
}
|
36
36
|
firstUpdated(_changedProperties) {
|
37
37
|
this.updateComplete.then(() => {
|
38
|
-
this.
|
38
|
+
this.handleResizeObserver();
|
39
39
|
});
|
40
40
|
}
|
41
41
|
/* #endregion */
|
@@ -57,9 +57,9 @@ let NileTable = class NileTable extends NileElement {
|
|
57
57
|
this.rows = [...this.rows, e.detail.comp];
|
58
58
|
}
|
59
59
|
handleBodyCssUpdate() {
|
60
|
-
|
61
|
-
if (!tableBodies.length)
|
60
|
+
if (this.rows.length < 2)
|
62
61
|
return;
|
62
|
+
const tableBodies = this.rows;
|
63
63
|
const firstEl = tableBodies[0].shadowRoot?.querySelector('div.base');
|
64
64
|
if (firstEl) {
|
65
65
|
firstEl.style.borderTopRightRadius = "var(--nile-radius-radius-xl)";
|
@@ -94,6 +94,8 @@ let NileTable = class NileTable extends NileElement {
|
|
94
94
|
return widthArray;
|
95
95
|
}
|
96
96
|
realignStructure() {
|
97
|
+
if (this.rows.length < 2)
|
98
|
+
return;
|
97
99
|
const primaryRowWidths = this.getPrimaryColumnWidths();
|
98
100
|
const secondaryRows = this.rows.filter(tb => tb.type != 'primary');
|
99
101
|
secondaryRows.forEach((row) => {
|
@@ -110,6 +112,19 @@ let NileTable = class NileTable extends NileElement {
|
|
110
112
|
.shadowRoot?.querySelector('slot')?.
|
111
113
|
assignedElements();
|
112
114
|
}
|
115
|
+
handleResizeObserver() {
|
116
|
+
const onResize = (entries) => {
|
117
|
+
for (let entry of entries) {
|
118
|
+
this.realignStructure();
|
119
|
+
}
|
120
|
+
};
|
121
|
+
this.resizeObserver = new ResizeObserver(onResize);
|
122
|
+
this.resizeObserver.observe(this);
|
123
|
+
}
|
124
|
+
disconnectedCallback() {
|
125
|
+
this.resizeObserver.disconnect();
|
126
|
+
super.disconnectedCallback();
|
127
|
+
}
|
113
128
|
};
|
114
129
|
__decorate([
|
115
130
|
query('slot')
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table.js","sourceRoot":"","sources":["../../../src/nile-table/nile-table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAiD,MAAM,KAAK,CAAC;AACrF,OAAO,EAAE,aAAa,EAAY,KAAK,EAAQ,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,W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C,EAAwC,EAAC,GAAG,EAAC,EAAE;gBACjE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAC,IAAI,CAAC,CAAA;YACnE,CAAC,CAAC,CAAA;QACH,CAAC,CAAC,CAAA;IACH,CAAC;IAED,sBAAsB,CAAC,GAAiB;QACvC,OAAO,GAAG,EAAE,UAAU,EAAE;YACvB,aAAa,CAAkB,kBAAkB,CAAC,EAAE;YACpD,gBAAgB,EAAE,CAAC,CAAC,CAAC;aACpB,UAAU,EAAE,aAAa,CAAkB,MAAM,CAAC,EAAE;YACrD,gBAAgB,EAAG,CAAA;IACrB,CAAC;IAED,oBAAoB;QACnB,MAAM,QAAQ,GAAG,CAAC,OAA6B,EAAO,EAAE;YACvD,KAAK,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC3B,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzB,CAAC;QACF,CAAC,CAAC;QACF,IAAI,CAAC,cAAc,GAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAA;QAChD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAA;IAC7B,CAAC;CAED,CAAA;AAzHgB;IAAd,KAAK,CAAC,MAAM,CAAC;8CAA8B;AADjC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA0HrB;;AAED,eAAe,SAAS,CAAC","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 {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tthis.realignStructure();\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"]}
|