@aquera/nile-elements 0.1.32-beta-1.0 → 0.1.32-beta-1.2

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 (35) hide show
  1. package/README.md +7 -0
  2. package/dist/nile-table/nile-table.cjs.js +1 -1
  3. package/dist/nile-table/nile-table.cjs.js.map +1 -1
  4. package/dist/nile-table/nile-table.css.cjs.js +1 -1
  5. package/dist/nile-table/nile-table.css.cjs.js.map +1 -1
  6. package/dist/nile-table/nile-table.css.esm.js +2 -1
  7. package/dist/nile-table/nile-table.esm.js +2 -2
  8. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
  9. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
  10. package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +5 -3
  11. package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
  12. package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
  13. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
  14. package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
  15. package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +5 -2
  16. package/dist/nile-table-header-item/nile-table-header-item.esm.js +9 -9
  17. package/dist/src/nile-table/nile-table.css.js +2 -1
  18. package/dist/src/nile-table/nile-table.css.js.map +1 -1
  19. package/dist/src/nile-table/nile-table.d.ts +4 -0
  20. package/dist/src/nile-table/nile-table.js +24 -3
  21. package/dist/src/nile-table/nile-table.js.map +1 -1
  22. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +3 -1
  23. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
  24. package/dist/src/nile-table-header-item/nile-table-header-item.css.js +5 -2
  25. package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
  26. package/dist/src/nile-table-header-item/nile-table-header-item.js +1 -1
  27. package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +1 -1
  30. package/src/nile-table/nile-table.css.ts +2 -1
  31. package/src/nile-table/nile-table.ts +26 -2
  32. package/src/nile-table-cell-item/nile-table-cell-item.css.ts +3 -1
  33. package/src/nile-table-header-item/nile-table-header-item.css.ts +5 -2
  34. package/src/nile-table-header-item/nile-table-header-item.ts +1 -1
  35. package/vscode-html-custom-data.json +1 -1
package/README.md CHANGED
@@ -79,6 +79,13 @@ 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.2
84
+ - Nile Table: Table header update
85
+
86
+ ### Version 0.1.32-beta-1.1
87
+ - Nile Table: Resizing issue fixed
88
+
82
89
  ### Version 0.1.32-beta-1.0
83
90
  - Nile Table: Workaround Styling update
84
91
 
@@ -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,e,r,l,_templateObject,a;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){i=_litDecoratorsJs.query;e=_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.handleBodyCssUpdate();});}},{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;var t=this.rows;if(!t.length)return;var 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,i){if(i>0&&i<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 i=(_t$shadowRoot=t[t.length-1].shadowRoot)===null||_t$shadowRoot===void 0?void 0:_t$shadowRoot.querySelector("div.base");i&&(i.style.borderTopRightRadius="0px",i.style.borderTopLeftRadius="0px",i.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",i.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;var t=this.getPrimaryColumnWidths();this.rows.filter(function(t){return"primary"!=t.type;}).forEach(function(s){var i=_this3.getTableCellFetchQuery(s);i===null||i===void 0||i.forEach(function(s,i){s.style.setProperty("--cell-width",t.at(i)+"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:"styles",get:function get(){return[r];}}]);}(l));t([i("slot")],a.prototype,"defaultSlot",void 0),_export("N",a=t([e("nile-table")],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.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.debounceTimeout&&clearTimeout(_this4.debounceTimeout),_this4.debounceTimeout=setTimeout(function(){_this4.realignStructure(),_this4.debounceTimeout=null;},500);}}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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AAA,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\tprivate debounceTimeout:any\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\tif(this.debounceTimeout){\n\t\t\t\t\tclearTimeout(this.debounceTimeout);\n\t\t\t\t}\n\t\t\t\tthis.debounceTimeout=setTimeout(() => {\n\t\t\t\t\tthis.realignStructure();\n\t\t\t\t\tthis.debounceTimeout=null;\n\t\t\t\t}, 500);\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","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","assignedElements","_t$shadowRoot2","resizeObserver","ResizeObserver","entries","_iterator","_createForOfIteratorHelper","s","_step","n","done","entry","debounceTimeout","clearTimeout","setTimeout","err","f","observe","disconnectedCallback","disconnect","get","styles","NileElement","__decorate","query","prototype","_export","customElement"],"mappings":"+yKAuBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAEEC,EAAAA,KAAAA,CAAIC,IAAsB,CAAA,EAAA,CAC1BD,KAAAA,CAAgBE,gBAAAA,CAAe,EA8HvC,QAAAC,KAAA,EArHOC,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,oBAAsB,CAAA,CAAA,EAAA,CAE5B,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,GAAA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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,5 +1,6 @@
1
1
  import{css as o}from"lit";const t=o`
2
2
  :host {
3
-
3
+ display:block;
4
+ width:100%;
4
5
  }
5
6
  `;export{t as s};
@@ -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.handleBodyCssUpdate()}))}render(){return s`
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(){const t=this.rows;if(!t.length)return;const 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(){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()}};t([e("slot")],a.prototype,"defaultSlot",void 0),a=t([i("nile-table")],a);export{a as N};
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.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout((()=>{this.realignStructure(),this.debounceTimeout=null}),500)})),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,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var i,_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){i=_lit.css;}],execute:function execute(){_export("s",e=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\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(--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"],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"]))));}};});
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 --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(--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';\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,5 +1,6 @@
1
- import{css as i}from"lit";const e=i`
1
+ import{css as i}from"lit";const l=i`
2
2
  :host {
3
+ --min-cell-width:auto;
3
4
  --cell-width:auto;
4
5
  --min--height: 52px;
5
6
  --max--cell-width: auto;
@@ -12,7 +13,8 @@ import{css as i}from"lit";const e=i`
12
13
  }
13
14
 
14
15
  .column {
15
- min-width:var(--cell-width);
16
+ min-width:var(--min-cell-width);
17
+ width:var(--cell-width);
16
18
  height: 100%;
17
19
  color: var(--nile-colors-gray-light-mode-600);
18
20
  font-family: var(--nile-font-family-serif);
@@ -23,4 +25,4 @@ import{css as i}from"lit";const e=i`
23
25
  line-height: normal;
24
26
  letter-spacing: 0.2px;
25
27
  }
26
- `;export{e as s};
28
+ `;export{l as s};
@@ -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,i,t,s,l,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){i=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;s=_litDecoratorsJs.state;l=_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 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([" ",""])),this.hasSlotController.test("[default]")?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"header__item__wrapper\">\n <div class=\"headers\">\n <slot> </slot>\n ","\n ","\n ","\n ","\n ","\n </div>\n </div>"])),this.havesort&&this.sorting_ct%3==0?i(_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?i(_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?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-icon\n name=\"sortup\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.iconName?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral([" <nile-icon name=\"","\" size=\"16\"></nile-icon>"])),this.iconName):i(_templateObject7||(_templateObject7=_taggedTemplateLiteral([""]))),this.havefilter?i(_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):i(_templateObject9||(_templateObject9=_taggedTemplateLiteral([""])))):null);}}],[{key:"styles",get:function get(){return[n];}}]);}(r));e([t({type:Boolean,reflect:!0})],a.prototype,"havesort",void 0),e([t({type:Boolean,reflect:!0})],a.prototype,"havefilter",void 0),e([t({type:String,reflect:!0,attribute:"icon-name"})],a.prototype,"iconName",void 0),e([s()],a.prototype,"sorting_ct",void 0),_export("N",a=e([l("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"],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));}};});
2
2
  //# sourceMappingURL=nile-table-header-item.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-header-item.cjs.js","sources":["../../../src/nile-table-header-item/nile-table-header-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, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-table-header-item.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * Nile icon component.\n *\n * @tag nile-table-header-item\n *\n */\n@customElement('nile-table-header-item')\nexport class NileTableHeaderItem extends NileElement {\n private readonly hasSlotController = new HasSlotController(this, '[default]');\n /**\n * The styles for TableHeaderItem\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 sort functionality. */\n @property({ type: Boolean, reflect: true }) havesort = false;\n\n /** Enables the sort functionality. */\n @property({ type: Boolean, reflect: true }) havefilter = false;\n\n /** Places the icon . */\n @property({ type: String, reflect: true, attribute: 'icon-name' }) iconName =\n '';\n\n @state() sorting_ct = 0;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n private handleSort(e: any) {\n this.sorting_ct++;\n let curr_sort_string = this.hasSlotController.host.innerHTML;\n const order = ['normal', 'asc', 'des'];\n this.emit('nile-click-sort', {\n value: { curr_sort_string, order: order[this.sorting_ct % 3] },\n });\n }\n\n private handleSearch(e: any) {\n this.emit('nile-search', { value: e.detail.value });\n }\n\n public render(): TemplateResult {\n return html` ${this.hasSlotController.test('[default]')\n ? html`\n <div class=\"header__item__wrapper\">\n <div class=\"headers\">\n <slot> </slot>\n ${this.havesort && this.sorting_ct % 3 === 0\n ? html`<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=${this.handleSort}\n class=\"hover__arrow\"\n ></nile-icon>`\n : null}\n ${this.havesort && this.sorting_ct % 3 === 1\n ? html`<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=${this.handleSort}\n ></nile-icon>`\n : null}\n ${this.havesort && this.sorting_ct % 3 === 2\n ? html`<nile-icon\n name=\"sortup\"\n size=\"16\"\n @click=${this.handleSort}\n ></nile-icon>`\n : null}\n ${this.iconName\n ? html` <nile-icon name=\"${this.iconName}\" size=\"16\"></nile-icon>`\n : html``}\n ${this.havefilter\n ? html` <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=${this.handleSearch}\n part=\"filter__search\"\n ></nile-input>\n <slot name=\"filter__content\" part=\"filter__content\"></slot>\n </nile-popover>`\n : html``}\n </div>\n </div>`\n : null}`;\n }\n /* #endregion */\n}\n\nexport default NileTableHeaderItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-header-item': NileTableHeaderItem;\n }\n}\n"],"names":["NileTableHeaderItem","_r","a","constructor","this","hasSlotController","HasSlotController","havesort","havefilter","iconName","sorting_ct","_this","_inherits","_createClass","key","value","handleSort","e","curr_sort_string","host","innerHTML","emit","order","handleSearch","detail","render","html","_templateObject","_taggedTemplateLiteral","test","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","get","styles","NileElement","__decorate","property","type","Boolean","reflect","prototype","String","attribute","state","_export","customElement"],"mappings":"64GAyBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCACYC,EAAAA,KAAAA,CAAiBC,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAUrBF,CAAAA,CAAAA,KAAAA,CAAQG,UAAG,CAGXH,CAAAA,KAAAA,CAAUI,YAAG,CAGUJ,CAAAA,KAAAA,CAAQK,SACzE,EAEOL,CAAAA,KAAAA,CAAUM,WAAG,CAsEvB,QAAAC,KAAA,EApFQC,SAAA,CAAAV,CAAA,CAAAD,EAAA,SAAAY,YAAA,CAAAX,CAAA,GAAAY,GAAA,cAAAC,KAAA,CAwBC,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Ac,CAAA,wBAAA,CAAA,CAAA,CACFnD"}
1
+ {"version":3,"file":"nile-table-header-item.cjs.js","sources":["../../../src/nile-table-header-item/nile-table-header-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, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-table-header-item.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * Nile icon component.\n *\n * @tag nile-table-header-item\n *\n */\n@customElement('nile-table-header-item')\nexport class NileTableHeaderItem extends NileElement {\n private readonly hasSlotController = new HasSlotController(this, '[default]');\n /**\n * The styles for TableHeaderItem\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 sort functionality. */\n @property({ type: Boolean, reflect: true }) havesort = false;\n\n /** Enables the sort functionality. */\n @property({ type: Boolean, reflect: true }) havefilter = false;\n\n /** Places the icon . */\n @property({ type: String, reflect: true, attribute: 'icon-name' }) iconName =\n '';\n\n @state() sorting_ct = 0;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n private handleSort(e: any) {\n this.sorting_ct++;\n let curr_sort_string = this.hasSlotController.host.innerHTML;\n const order = ['normal', 'asc', 'des'];\n this.emit('nile-click-sort', {\n value: { curr_sort_string, order: order[this.sorting_ct % 3] },\n });\n }\n\n private handleSearch(e: any) {\n this.emit('nile-search', { value: e.detail.value });\n }\n\n public render(): TemplateResult {\n return html` ${this.hasSlotController.test('[default]')\n ? html`\n <div class=\"header__item__wrapper\" part=\"nile__table-header-cell\">\n <div class=\"headers\">\n <slot> </slot>\n ${this.havesort && this.sorting_ct % 3 === 0\n ? html`<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=${this.handleSort}\n class=\"hover__arrow\"\n ></nile-icon>`\n : null}\n ${this.havesort && this.sorting_ct % 3 === 1\n ? html`<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=${this.handleSort}\n ></nile-icon>`\n : null}\n ${this.havesort && this.sorting_ct % 3 === 2\n ? html`<nile-icon\n name=\"sortup\"\n size=\"16\"\n @click=${this.handleSort}\n ></nile-icon>`\n : null}\n ${this.iconName\n ? html` <nile-icon name=\"${this.iconName}\" size=\"16\"></nile-icon>`\n : html``}\n ${this.havefilter\n ? html` <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=${this.handleSearch}\n part=\"filter__search\"\n ></nile-input>\n <slot name=\"filter__content\" part=\"filter__content\"></slot>\n </nile-popover>`\n : html``}\n </div>\n </div>`\n : null}`;\n }\n /* #endregion */\n}\n\nexport default NileTableHeaderItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-header-item': NileTableHeaderItem;\n }\n}\n"],"names":["NileTableHeaderItem","_r","a","constructor","this","hasSlotController","HasSlotController","havesort","havefilter","iconName","sorting_ct","_this","_inherits","_createClass","key","value","handleSort","e","curr_sort_string","host","innerHTML","emit","order","handleSearch","detail","render","html","_templateObject","_taggedTemplateLiteral","test","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","get","styles","NileElement","__decorate","property","type","Boolean","reflect","prototype","String","attribute","state","_export","customElement"],"mappings":"64GAyBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCACYC,EAAAA,KAAAA,CAAiBC,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAUrBF,CAAAA,CAAAA,KAAAA,CAAQG,UAAG,CAGXH,C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AAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEIL,EAAA,CAARQ,CAAAA,CAAAA,CAAAA,CAAAA,CAAuBjD,CAAA8C,CAAAA,SAAAA,CAAA,YAAA,CAAA,IAAA,EAAA,CAAA,CAAAI,OAAA,KApBblD,EAAmByC,CAAA,CAAA,CAD/BU,CAAc,CAAA,wBAAA,CAAA,CAAA,CACFnD"}
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var i,_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){i=_lit.css;}],execute:function execute(){_export("s",e=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --cell-width:auto;\n display: table-cell;\n box-sizing: border-box;\n }\n \n .header__item__wrapper{\n min-width:var(--cell-width);\n display:flex;\n align-items:center;\n box-sizing: border-box;\n padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-3xl);\n min-height: 44px;\n height: 44px;\n }\n\n .headers {\n display: flex;\n align-items: center;\n height: auto;\n width: 100%;\n gap: 8px;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-weight: 500;\n font-style: normal;\n /* line-height: var(--nile-type-scale-5); */\n line-height: normal;\n }\n\n nile-icon {\n cursor: pointer;\n }\n\n .sorting__icons {\n display: flex;\n flex-direction: column;\n align-items: centre;\n }\n\n .sorting__icons nile-icon:hover {\n opacity: 0.4;\n }\n\n .hover__arrow {\n opacity: 0;\n }\n\n .headers:hover .hover__arrow {\n opacity: 0.3;\n }\n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var i,_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){i=_lit.css;}],execute:function execute(){_export("s",e=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --cell-min-width: auto;\n --cell-width: auto;\n display: table-cell;\n box-sizing: border-box;\n }\n \n .header__item__wrapper{\n min-width:var(--cell-min-width);\n width:var(--cell-width);\n display:flex;\n align-items:center;\n box-sizing: border-box;\n padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-3xl);\n min-height: 44px;\n height: 44px;\n }\n\n .headers {\n overflow:hidden;\n display: flex;\n align-items: center;\n height: auto;\n width: 100%;\n gap: 8px;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-weight: 500;\n font-style: normal;\n /* line-height: var(--nile-type-scale-5); */\n line-height: normal;\n }\n\n nile-icon {\n cursor: pointer;\n }\n\n .sorting__icons {\n display: flex;\n flex-direction: column;\n align-items: centre;\n }\n\n .sorting__icons nile-icon:hover {\n opacity: 0.4;\n }\n\n .hover__arrow {\n opacity: 0;\n }\n\n .headers:hover .hover__arrow {\n opacity: 0.3;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-table-header-item.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-header-item.css.cjs.js","sources":["../../../src/nile-table-header-item/nile-table-header-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 * TableHeaderItem CSS\n */\nexport const styles = css`\n :host {\n --cell-width:auto;\n display: table-cell;\n box-sizing: border-box;\n }\n \n .header__item__wrapper{\n min-width:var(--cell-width);\n display:flex;\n align-items:center;\n box-sizing: border-box;\n padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-3xl);\n min-height: 44px;\n height: 44px;\n }\n\n .headers {\n display: flex;\n align-items: center;\n height: auto;\n width: 100%;\n gap: 8px;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-weight: 500;\n font-style: normal;\n /* line-height: var(--nile-type-scale-5); */\n line-height: normal;\n }\n\n nile-icon {\n cursor: pointer;\n }\n\n .sorting__icons {\n display: flex;\n flex-direction: column;\n align-items: centre;\n }\n\n .sorting__icons nile-icon:hover {\n opacity: 0.4;\n }\n\n .hover__arrow {\n opacity: 0;\n }\n\n .headers:hover .hover__arrow {\n opacity: 0.3;\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-header-item.css.cjs.js","sources":["../../../src/nile-table-header-item/nile-table-header-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 * TableHeaderItem CSS\n */\nexport const styles = css`\n :host {\n --cell-min-width: auto;\n --cell-width: auto;\n display: table-cell;\n box-sizing: border-box;\n }\n \n .header__item__wrapper{\n min-width:var(--cell-min-width);\n width:var(--cell-width);\n display:flex;\n align-items:center;\n box-sizing: border-box;\n padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-3xl);\n min-height: 44px;\n height: 44px;\n }\n\n .headers {\n overflow:hidden;\n display: flex;\n align-items: center;\n height: auto;\n width: 100%;\n gap: 8px;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-weight: 500;\n font-style: normal;\n /* line-height: var(--nile-type-scale-5); */\n line-height: normal;\n }\n\n nile-icon {\n cursor: pointer;\n }\n\n .sorting__icons {\n display: flex;\n flex-direction: column;\n align-items: centre;\n }\n\n .sorting__icons nile-icon:hover {\n opacity: 0.4;\n }\n\n .hover__arrow {\n opacity: 0;\n }\n\n .headers:hover .hover__arrow {\n opacity: 0.3;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,12 +1,14 @@
1
1
  import{css as i}from"lit";const e=i`
2
2
  :host {
3
- --cell-width:auto;
3
+ --cell-min-width: auto;
4
+ --cell-width: auto;
4
5
  display: table-cell;
5
6
  box-sizing: border-box;
6
7
  }
7
8
 
8
9
  .header__item__wrapper{
9
- min-width:var(--cell-width);
10
+ min-width:var(--cell-min-width);
11
+ width:var(--cell-width);
10
12
  display:flex;
11
13
  align-items:center;
12
14
  box-sizing: border-box;
@@ -16,6 +18,7 @@ import{css as i}from"lit";const e=i`
16
18
  }
17
19
 
18
20
  .headers {
21
+ overflow:hidden;
19
22
  display: flex;
20
23
  align-items: center;
21
24
  height: auto;
@@ -1,25 +1,25 @@
1
- import{__decorate as e}from"tslib";import{html as i}from"lit";import{property as t,state as s,customElement as l}from"lit/decorators.js";import{s as n}from"./nile-table-header-item.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as o}from"../internal/slot.esm.js";let a=class extends r{constructor(){super(...arguments),this.hasSlotController=new o(this,"[default]"),this.havesort=!1,this.havefilter=!1,this.iconName="",this.sorting_ct=0}static get styles(){return[n]}handleSort(e){this.sorting_ct++;let i=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:i,order:["normal","asc","des"][this.sorting_ct%3]}})}handleSearch(e){this.emit("nile-search",{value:e.detail.value})}render(){return i` ${this.hasSlotController.test("[default]")?i`
2
- <div class="header__item__wrapper">
1
+ import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as i,state as l,customElement as s}from"lit/decorators.js";import{s as n}from"./nile-table-header-item.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as o}from"../internal/slot.esm.js";let a=class extends r{constructor(){super(...arguments),this.hasSlotController=new o(this,"[default]"),this.havesort=!1,this.havefilter=!1,this.iconName="",this.sorting_ct=0}static get styles(){return[n]}handleSort(e){this.sorting_ct++;let t=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:t,order:["normal","asc","des"][this.sorting_ct%3]}})}handleSearch(e){this.emit("nile-search",{value:e.detail.value})}render(){return t` ${this.hasSlotController.test("[default]")?t`
2
+ <div class="header__item__wrapper" part="nile__table-header-cell">
3
3
  <div class="headers">
4
4
  <slot> </slot>
5
- ${this.havesort&&this.sorting_ct%3==0?i`<nile-icon
5
+ ${this.havesort&&this.sorting_ct%3==0?t`<nile-icon
6
6
  name="sortdown"
7
7
  size="16"
8
8
  @click=${this.handleSort}
9
9
  class="hover__arrow"
10
10
  ></nile-icon>`:null}
11
- ${this.havesort&&this.sorting_ct%3==1?i`<nile-icon
11
+ ${this.havesort&&this.sorting_ct%3==1?t`<nile-icon
12
12
  name="sortdown"
13
13
  size="16"
14
14
  @click=${this.handleSort}
15
15
  ></nile-icon>`:null}
16
- ${this.havesort&&this.sorting_ct%3==2?i`<nile-icon
16
+ ${this.havesort&&this.sorting_ct%3==2?t`<nile-icon
17
17
  name="sortup"
18
18
  size="16"
19
19
  @click=${this.handleSort}
20
20
  ></nile-icon>`:null}
21
- ${this.iconName?i` <nile-icon name="${this.iconName}" size="16"></nile-icon>`:i``}
22
- ${this.havefilter?i` <nile-popover title="Filter" placement="bottom">
21
+ ${this.iconName?t` <nile-icon name="${this.iconName}" size="16"></nile-icon>`:t``}
22
+ ${this.havefilter?t` <nile-popover title="Filter" placement="bottom">
23
23
  <nile-icon name="filter" size="16" slot="anchor"></nile-icon>
24
24
  <nile-input
25
25
  placeholder="Search"
@@ -27,6 +27,6 @@ import{__decorate as e}from"tslib";import{html as i}from"lit";import{property as
27
27
  part="filter__search"
28
28
  ></nile-input>
29
29
  <slot name="filter__content" part="filter__content"></slot>
30
- </nile-popover>`:i``}
30
+ </nile-popover>`:t``}
31
31
  </div>
32
- </div>`:null}`}};e([t({type:Boolean,reflect:!0})],a.prototype,"havesort",void 0),e([t({type:Boolean,reflect:!0})],a.prototype,"havefilter",void 0),e([t({type:String,reflect:!0,attribute:"icon-name"})],a.prototype,"iconName",void 0),e([s()],a.prototype,"sorting_ct",void 0),a=e([l("nile-table-header-item")],a);export{a as N};
32
+ </div>`:null}`}};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),a=e([s("nile-table-header-item")],a);export{a as N};
@@ -10,7 +10,8 @@ import { css } from 'lit';
10
10
  */
11
11
  export const styles = css `
12
12
  :host {
13
-
13
+ display:block;
14
+ width:100%;
14
15
  }
15
16
  `;
16
17
  export default [styles];
@@ -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;;;;CAIxB,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\n\t}\n`;\n\nexport default [styles];"]}
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,8 @@ export declare class NileTable extends NileElement {
17
17
  defaultSlot: HTMLSlotElement;
18
18
  private rows;
19
19
  private primaryRowWidths;
20
+ private resizeObserver;
21
+ private debounceTimeout;
20
22
  /**
21
23
  * The styles for nile-table
22
24
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
@@ -35,6 +37,8 @@ export declare class NileTable extends NileElement {
35
37
  getPrimaryColumnWidths(): number[];
36
38
  realignStructure(): void;
37
39
  getTableCellFetchQuery(row: NileTableBody): Array<Element>;
40
+ handleResizeObserver(): void;
41
+ disconnectedCallback(): void;
38
42
  }
39
43
  export default NileTable;
40
44
  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.handleBodyCssUpdate();
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
- const tableBodies = this.rows;
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,25 @@ 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
+ if (this.debounceTimeout) {
119
+ clearTimeout(this.debounceTimeout);
120
+ }
121
+ this.debounceTimeout = setTimeout(() => {
122
+ this.realignStructure();
123
+ this.debounceTimeout = null;
124
+ }, 500);
125
+ }
126
+ };
127
+ this.resizeObserver = new ResizeObserver(onResize);
128
+ this.resizeObserver.observe(this);
129
+ }
130
+ disconnectedCallback() {
131
+ this.resizeObserver.disconnect();
132
+ super.disconnectedCallback();
133
+ }
113
134
  };
114
135
  __decorate([
115
136
  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,WAAW,MAAM,0BAA0B,CAAC;AAMnD;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAEE,SAAI,GAAsB,EAAE,CAAC;QAC7B,qBAAgB,GAAe,EAAE,CAAA;QAqGzC,gBAAgB;IACjB,CAAC;IAnGA;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,C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AAE,CAAA,CAAC,CAAC,WAAW,CAAkB,CAAA;QAC3G,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,gBAAgB;QACf,MAAM,gBAAgB,GAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACrD,MAAM,aAAa,GAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAA,EAAE,CAAA,EAAE,CAAC,IAAI,IAAE,SAAS,CAAC,CAAC;QAC7D,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,EAAC,EAAE;YAC5B,IAAI,QAAQ,GAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;YAC7C,QAAQ,EAAE,OAAO,CAAC,CAAC,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;CAED,CAAA;AAxGgB;IAAd,KAAK,CAAC,MAAM,CAAC;8CAA8B;AADjC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAyGrB;;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\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}"]}
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,WAAW,MAAM,0BAA0B,CAAC;AAMnD;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAEE,SAAI,GAAsB,EAAE,CAAC;QAC7B,qBAAgB,GAAe,EAAE,CAAA;QA6HzC,gBAAgB;IACjB,CAAC;IAzHA;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IACD,iBAAiB;QAChB,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACxD,CAAC;IAES,YAAY,CAAC,kBAAkC;QACxD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAE,EAAE;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAA;IACH,CAAC;IAGD,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;wBACW,IAAI,CAAC,YAAY;IACrC,CAAC;IACJ,CAAC;IAED,YAAY;QACX,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC5B,CAAC;IAED,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","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\tprivate debounceTimeout:any\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\tif(this.debounceTimeout){\n\t\t\t\t\tclearTimeout(this.debounceTimeout);\n\t\t\t\t}\n\t\t\t\tthis.debounceTimeout=setTimeout(() => {\n\t\t\t\t\tthis.realignStructure();\n\t\t\t\t\tthis.debounceTimeout=null;\n\t\t\t\t}, 500);\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}"]}
@@ -10,6 +10,7 @@ import { css } from 'lit';
10
10
  */
11
11
  export const styles = css `
12
12
  :host {
13
+ --min-cell-width:auto;
13
14
  --cell-width:auto;
14
15
  --min--height: 52px;
15
16
  --max--cell-width: auto;
@@ -22,7 +23,8 @@ export const styles = css `
22
23
  }
23
24
 
24
25
  .column {
25
- min-width:var(--cell-width);
26
+ min-width:var(--min-cell-width);
27
+ width:var(--cell-width);
26
28
  height: 100%;
27
29
  color: var(--nile-colors-gray-light-mode-600);
28
30
  font-family: var(--nile-font-family-serif);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-cell-item.css.js","sourceRoot":"","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBxB,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 * TableCellItem CSS\n */\nexport const styles = css`\n :host {\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(--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"]}
1
+ {"version":3,"file":"nile-table-cell-item.css.js","sourceRoot":"","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,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 * 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"]}
@@ -10,13 +10,15 @@ import { css } from 'lit';
10
10
  */
11
11
  export const styles = css `
12
12
  :host {
13
- --cell-width:auto;
13
+ --cell-min-width: auto;
14
+ --cell-width: auto;
14
15
  display: table-cell;
15
16
  box-sizing: border-box;
16
17
  }
17
18
 
18
19
  .header__item__wrapper{
19
- min-width:var(--cell-width);
20
+ min-width:var(--cell-min-width);
21
+ width:var(--cell-width);
20
22
  display:flex;
21
23
  align-items:center;
22
24
  box-sizing: border-box;
@@ -26,6 +28,7 @@ export const styles = css `
26
28
  }
27
29
 
28
30
  .headers {
31
+ overflow:hidden;
29
32
  display: flex;
30
33
  align-items: center;
31
34
  height: auto;
@@ -1 +1 @@
1
- {"version":3,"file":"nile-table-header-item.css.js","sourceRoot":"","sources":["../../../src/nile-table-header-item/nile-table-header-item.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDxB,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 * TableHeaderItem CSS\n */\nexport const styles = css`\n :host {\n --cell-width:auto;\n display: table-cell;\n box-sizing: border-box;\n }\n \n .header__item__wrapper{\n min-width:var(--cell-width);\n display:flex;\n align-items:center;\n box-sizing: border-box;\n padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-3xl);\n min-height: 44px;\n height: 44px;\n }\n\n .headers {\n display: flex;\n align-items: center;\n height: auto;\n width: 100%;\n gap: 8px;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-weight: 500;\n font-style: normal;\n /* line-height: var(--nile-type-scale-5); */\n line-height: normal;\n }\n\n nile-icon {\n cursor: pointer;\n }\n\n .sorting__icons {\n display: flex;\n flex-direction: column;\n align-items: centre;\n }\n\n .sorting__icons nile-icon:hover {\n opacity: 0.4;\n }\n\n .hover__arrow {\n opacity: 0;\n }\n\n .headers:hover .hover__arrow {\n opacity: 0.3;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-table-header-item.css.js","sourceRoot":"","sources":["../../../src/nile-table-header-item/nile-table-header-item.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDxB,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 * TableHeaderItem CSS\n */\nexport const styles = css`\n :host {\n --cell-min-width: auto;\n --cell-width: auto;\n display: table-cell;\n box-sizing: border-box;\n }\n \n .header__item__wrapper{\n min-width:var(--cell-min-width);\n width:var(--cell-width);\n display:flex;\n align-items:center;\n box-sizing: border-box;\n padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-3xl);\n min-height: 44px;\n height: 44px;\n }\n\n .headers {\n overflow:hidden;\n display: flex;\n align-items: center;\n height: auto;\n width: 100%;\n gap: 8px;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-weight: 500;\n font-style: normal;\n /* line-height: var(--nile-type-scale-5); */\n line-height: normal;\n }\n\n nile-icon {\n cursor: pointer;\n }\n\n .sorting__icons {\n display: flex;\n flex-direction: column;\n align-items: centre;\n }\n\n .sorting__icons nile-icon:hover {\n opacity: 0.4;\n }\n\n .hover__arrow {\n opacity: 0;\n }\n\n .headers:hover .hover__arrow {\n opacity: 0.3;\n }\n`;\n\nexport default [styles];\n"]}
@@ -56,7 +56,7 @@ let NileTableHeaderItem = class NileTableHeaderItem extends NileElement {
56
56
  render() {
57
57
  return html ` ${this.hasSlotController.test('[default]')
58
58
  ? html `
59
- <div class="header__item__wrapper">
59
+ <div class="header__item__wrapper" part="nile__table-header-cell">
60
60
  <div class="headers">
61
61
  <slot> </slot>
62
62
  ${this.havesort && this.sorting_ct % 3 === 0