@aquera/nile-elements 0.1.32-beta-1.1 → 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.
- package/README.md +3 -0
- package/dist/nile-table/nile-table.cjs.js +1 -1
- package/dist/nile-table/nile-table.cjs.js.map +1 -1
- package/dist/nile-table/nile-table.esm.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +5 -3
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +5 -2
- package/dist/nile-table-header-item/nile-table-header-item.esm.js +9 -9
- package/dist/src/nile-table/nile-table.d.ts +1 -0
- package/dist/src/nile-table/nile-table.js +7 -1
- package/dist/src/nile-table/nile-table.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +3 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js +5 -2
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.js +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-table/nile-table.ts +8 -1
- package/src/nile-table-cell-item/nile-table-cell-item.css.ts +3 -1
- package/src/nile-table-header-item/nile-table-header-item.css.ts +5 -2
- package/src/nile-table-header-item/nile-table-header-item.ts +1 -1
- package/vscode-html-custom-data.json +1 -1
package/README.md
CHANGED
@@ -80,6 +80,9 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
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
82
|
|
83
|
+
### Version 0.1.32-beta-1.2
|
84
|
+
- Nile Table: Table header update
|
85
|
+
|
83
86
|
### Version 0.1.32-beta-1.1
|
84
87
|
- Nile Table: Resizing issue fixed
|
85
88
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,s,e,i,r,l,_templateObject,a;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){s=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.query;i=_litDecoratorsJs.customElement;},function(_nileTableCssCjsJs){r=_nileTableCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",a=/*#__PURE__*/function(_l){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.rows=[],_this.primaryRowWidths=[];return _this;}_inherits(a,_l);return _createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(a,"connectedCallback",this,3)([]),this.addEventListener("nile-body-load",this.handleRows);}},{key:"firstUpdated",value:function firstUpdated(t){var _this2=this;this.updateComplete.then(function(){_this2.handleResizeObserver();});}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t\t<slot @slotchange=\"","\"></slot>\n\t\t\t"])),this.repaintTable);}},{key:"repaintTable",value:function repaintTable(){this.realignStructure(),this.handleBodyCssUpdate();}},{key:"handleRows",value:function handleRows(t){this.rows=[].concat(_toConsumableArray(this.rows),[t.detail.comp]);}},{key:"handleBodyCssUpdate",value:function handleBodyCssUpdate(){var _t$0$shadowRoot,_t$shadowRoot;if(this.rows.length<2)return;var t=this.rows,s=(_t$0$shadowRoot=t[0].shadowRoot)===null||_t$0$shadowRoot===void 0?void 0:_t$0$shadowRoot.querySelector("div.base");s&&(s.style.borderTopRightRadius="var(--nile-radius-radius-xl)",s.style.borderTopLeftRadius="var(--nile-radius-radius-xl)",s.style.borderBottomRightRadius="0px",s.style.borderBottomLeftRadius="0px",s.style.borderBottom="none"),t.forEach(function(s,e){if(e>0&&e<t.length-1){var _s$shadowRoot;var _t=(_s$shadowRoot=s.shadowRoot)===null||_s$shadowRoot===void 0?void 0:_s$shadowRoot.querySelector("div.base");_t&&(_t.style.borderTopRightRadius="0px",_t.style.borderTopLeftRadius="0px",_t.style.borderBottomRightRadius="0px",_t.style.borderBottomLeftRadius="0px",_t.style.borderBottom="none");}});var e=(_t$shadowRoot=t[t.length-1].shadowRoot)===null||_t$shadowRoot===void 0?void 0:_t$shadowRoot.querySelector("div.base");e&&(e.style.borderTopRightRadius="0px",e.style.borderTopLeftRadius="0px",e.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",e.style.borderBottomLeftRadius="var(--nile-radius-radius-xl)");}},{key:"getPrimaryColumnWidths",value:function getPrimaryColumnWidths(){var t=this.rows.find(function(t){return"primary"==t.type;});return this.getTableCellFetchQuery(t).map(function(t){return t.clientWidth;});}},{key:"realignStructure",value:function realignStructure(){var _this3=this;if(this.rows.length<2)return;var t=this.getPrimaryColumnWidths();this.rows.filter(function(t){return"primary"!=t.type;}).forEach(function(s){var e=_this3.getTableCellFetchQuery(s);e===null||e===void 0||e.forEach(function(s,e){s.style.setProperty("--cell-width",t.at(e)+"px");});});}},{key:"getTableCellFetchQuery",value:function getTableCellFetchQuery(t){var _t$shadowRoot2;return t===null||t===void 0||(_t$shadowRoot2=t.shadowRoot)===null||_t$shadowRoot2===void 0||(_t$shadowRoot2=_t$shadowRoot2.querySelector("slot:not([name])"))===null||_t$shadowRoot2===void 0||(_t$shadowRoot2=_t$shadowRoot2.assignedElements()[0].shadowRoot)===null||_t$shadowRoot2===void 0||(_t$shadowRoot2=_t$shadowRoot2.querySelector("slot"))===null||_t$shadowRoot2===void 0?void 0:_t$shadowRoot2.assignedElements();}},{key:"handleResizeObserver",value:function handleResizeObserver(){var _this4=this;this.resizeObserver=new ResizeObserver(function(t){var _iterator=_createForOfIteratorHelper(t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _s=_step.value;_this4.realignStructure();}}catch(err){_iterator.e(err);}finally{_iterator.f();}}),this.resizeObserver.observe(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.resizeObserver.disconnect(),_superPropGet(a,"disconnectedCallback",this,3)([]);}}],[{key:"styles",get:function get(){return[r];}}]);}(l));t([e("slot")],a.prototype,"defaultSlot",void 0),_export("N",a=t([i("nile-table")],a));}};});
|
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\tprivate resizeObserver:ResizeObserver ;\n\n\n\t/**\n\t * The styles for nile-table\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.addEventListener('nile-body-load',this.handleRows)\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValues): void {\n\t\tthis.updateComplete.then(()=>{\n\t\t\tthis.handleResizeObserver();\n\t\t})\n\t}\n\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<slot @slotchange=\"${this.repaintTable}\"></slot>\n\t\t\t`;\n\t}\n\n\trepaintTable(){\n\t\tthis.realignStructure();\n\t\tthis.handleBodyCssUpdate();\n\t}\n\n\thandleRows(e:CustomEvent){\n\t\tthis.rows=[...this.rows,e.detail.comp]\n\t}\n\n\thandleBodyCssUpdate(){\n if (this.rows.length<2) return;\n const tableBodies = this.rows;\n\t\tconst firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(firstEl) {\n\t\t\tfirstEl.style.borderTopRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tfirstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t\tfirstEl.style.borderBottomRightRadius=\"0px\";\n\t\t\tfirstEl.style.borderBottomLeftRadius = '0px';\n\t\t\tfirstEl.style.borderBottom = 'none';\n\t\t}\n\t\ttableBodies.forEach((tb,i)=>{\n\t\t\tif(i>0 && i<tableBodies.length-1){\n\t\t\t\tconst el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\t\t\tif(el) {\n\t\t\t\t\tel.style.borderTopRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderTopLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottomRightRadius=\"0px\";\n\t\t\t\t\tel.style.borderBottomLeftRadius = \"0px\";\n\t\t\t\t\tel.style.borderBottom = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tconst lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')\n\t\tif(lastEl){\n\t\t\tlastEl.style.borderTopRightRadius=\"0px\";\n\t\t\tlastEl.style.borderTopLeftRadius = '0px';\n\t\t\tlastEl.style.borderBottomRightRadius=\"var(--nile-radius-radius-xl)\";\n\t\t\tlastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';\n\t\t}\n\t}\n\n\tgetPrimaryColumnWidths(){\n\t\tconst primaryTb=this.rows.find(tb=>tb.type=='primary')!;\n\t\tconst widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>\n\t\treturn widthArray;\n\t}\n\t\n\trealignStructure(){\n if (this.rows.length<2) return;\n\t\tconst primaryRowWidths=this.getPrimaryColumnWidths();\n\t\tconst secondaryRows=this.rows.filter(tb=>tb.type!='primary');\n\t\tsecondaryRows.forEach((row)=>{\n\t\t\tlet elements=this.getTableCellFetchQuery(row)\n\t\t\telements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{\n\t\t\t\tel.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')\n\t\t\t})\n\t\t})\n\t}\n\n\tgetTableCellFetchQuery(row:NileTableBody):Array<Element>{\n\t\treturn row?.shadowRoot?.\n\t\t\tquerySelector<HTMLSlotElement>('slot:not([name])')?.\n\t\t\tassignedElements()[0]\n\t\t\t.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.\n\t\t\tassignedElements()!\n\t}\n\n\thandleResizeObserver(){\n\t\tconst onResize = (entries:ResizeObserverEntry[]): void=> {\n\t\t\tfor (let entry of entries) {\n\t\t\t\tthis.realignStructure();\n\t\t\t}\n\t\t};\n\t\tthis.resizeObserver=new ResizeObserver(onResize)\n\t\tthis.resizeObserver.observe(this);\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.resizeObserver.disconnect()\n\t\tsuper.disconnectedCallback()\n\t}\n\t/* #endregion */\n}\n\nexport default NileTable;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table': NileTable;\n }\n}"],"names":["NileTable","a","this","rows","primaryRowWidths","_this","_inherits","_l","_createClass","key","value","connectedCallback","super","addEventListener","handleRows","firstUpdated","_changedProperties","updateComplete","then","handleResizeObserver","render","html","_templateObject","_taggedTemplateLiteral","repaintTable","realignStructure","handleBodyCssUpdate","e","concat","_toConsumableArray","detail","comp","_t$0$shadowRoot","_t$shadowRoot","length","tableBodies","firstEl","shadowRoot","querySelector","style","borderTopRightRadius","borderTopLeftRadius","borderBottomRightRadius","borderBottomLeftRadius","borderBottom","forEach","tb","i","_s$shadowRoot","el","lastEl","getPrimaryColumnWidths","primaryTb","find","type","getTableCellFetchQuery","map","clientWidth","filter","row","elements","ind","setProperty","at","_t$shadowRoot2","assignedElements","resizeObserver","ResizeObserver","entries","_iterator","s","_step","n","done","entry","err","f","observe","disconnectedCallback","disconnect","__decorate","get","styles","NileElement","query","prototype","customElement"],"mappings":"+yKAuBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAEEC,EAAAA,KAAAA,CAAIC,IAAsB,CAAA,EAAA,CAC1BD,KAAAA,CAAgBE,gBAAAA,CAAe,EAuHvC,QAAAC,KAAA,EA/GOC,SAAA,CAAAL,CAAA,CAAAM,EAAA,SAAAC,YAAA,CAAAP,CAAA,GAAAQ,GAAA,qBAAAC,KAAA,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,GAAAf,GAAA,gBAAAC,KAAA,UAAAc,YAAAA,CAAAA,CACCtB,CAA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AAA,SAAAA,CAAAA,CAAAA,KAAAA,SAAAA,CAAAA,0BAAAA,CACCA,CAAAA,EAAAA,KAAAA,KAAlB,IAAAC,SAAA,CAAAC,CAAA,KAAAC,KAAA,CAAAF,SAAA,CAAAG,CAAA,IAAAC,IAAA,EACCvE,IADQwE,CAAAA,EAASN,CAAAA,KAAAA,CAAAA,KAAAA,CACjBlE,OAAKuB,gBACL,CAAA,CAAA,CAAA,CAAA,OAAAkD,GAAA,EAAAN,SAAA,CAAA1C,CAAA,CAAAgD,GAAA,WAAAN,SAAA,CAAAO,CAAA,KAAA,CAAA,CAGF1E,IAAKgE,CAAAA,cAAAA,CAAeW,OAAQ3E,CAAAA,IAAAA,CAC5B,EAED,GAAAO,GAAA,wBAAAC,KAAA,UAAAoE,oBAAAA,CAAAA,CACC5E,CAAAA,IAAAA,CAAKgE,cAAea,CAAAA,UAAAA,CAAAA,CAAAA,CAAAA,aAAAA,CAAAA,CAAAA,mCAEpB,EAvHeC,KAAAA,GAAAA,UAAAA,GAAAA,CAUT,SAAAC,IAAA,CAAWC,CACjB,MAAO,CAACA,CAAAA,CACR,EACD,MAd8BC,CAAxB,GACUH,CAAAA,CAAA,CAAdI,CAAAA,CAAM,MAAqCpF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqF,SAAA,CAAA,aAAA,CAAA,IAAA,EADjCrF,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAASgF,CAAA,CAAA,CADrBM,CAAc,CAAA,YAAA,CAAA,CAAA,CACFtF"}
|
1
|
+
{"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,E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CAAAA,MAAAA,CAAKwE,eAAgB,CAAA,IAAI,EACvB,CAAA,GAAA,CACH,CADG,CACH,OAAAG,GAAA,EAAAV,SAAA,CAAAxC,CAAA,CAAAkD,GAAA,WAAAV,SAAA,CAAAW,CAAA,KAGF5E,CAAAA,CAAAA,IAAAA,CAAK8D,cAAee,CAAAA,OAAAA,CAAQ7E,IAC5B,CAAA,EAED,GAAAO,GAAA,wBAAAC,KAAA,UAAAsE,oBAAAA,CAAAA,CAAAA,CACC9E,IAAK8D,CAAAA,cAAAA,CAAeiB,UACpBrE,CAAAA,CAAAA,CAAAA,aAAAA,CAAAA,CAAAA,mCACA,EAAA,KAAAH,GAAA,UAAAyE,GAAA,CAnHM,SAAAA,IAAA,CAAWC,CACjB,MAAO,CAACA,CAAAA,CACR,EACD,MAf8BC,CAAxB,GACUC,CAAA,CAAA,CAAdC,CAAM,CAAA,MAAA,CAAA,CAAA,CAAqCtF,CAAAuF,CAAAA,SAAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,CAAAC,OAAA,KADjCxF,CAASqF,CAAAA,CAAAA,CAAA,CADrBI,CAAAA,CAAc,eACFzF"}
|
@@ -1,3 +1,3 @@
|
|
1
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(){if(this.rows.length<2)return;const t=this.rows,s=t[0].shadowRoot?.querySelector("div.base");s&&(s.style.borderTopRightRadius="var(--nile-radius-radius-xl)",s.style.borderTopLeftRadius="var(--nile-radius-radius-xl)",s.style.borderBottomRightRadius="0px",s.style.borderBottomLeftRadius="0px",s.style.borderBottom="none"),t.forEach(((s,e)=>{if(e>0&&e<t.length-1){const t=s.shadowRoot?.querySelector("div.base");t&&(t.style.borderTopRightRadius="0px",t.style.borderTopLeftRadius="0px",t.style.borderBottomRightRadius="0px",t.style.borderBottomLeftRadius="0px",t.style.borderBottom="none")}}));const e=t[t.length-1].shadowRoot?.querySelector("div.base");e&&(e.style.borderTopRightRadius="0px",e.style.borderTopLeftRadius="0px",e.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",e.style.borderBottomLeftRadius="var(--nile-radius-radius-xl)")}getPrimaryColumnWidths(){const t=this.rows.find((t=>"primary"==t.type));return this.getTableCellFetchQuery(t).map((t=>t.clientWidth))}realignStructure(){if(this.rows.length<2)return;const t=this.getPrimaryColumnWidths();this.rows.filter((t=>"primary"!=t.type)).forEach((s=>{let e=this.getTableCellFetchQuery(s);e?.forEach(((s,e)=>{s.style.setProperty("--cell-width",t.at(e)+"px")}))}))}getTableCellFetchQuery(t){return t?.shadowRoot?.querySelector("slot:not([name])")?.assignedElements()[0].shadowRoot?.querySelector("slot")?.assignedElements()}handleResizeObserver(){this.resizeObserver=new ResizeObserver((t=>{for(let s of t)this.realignStructure()})),this.resizeObserver.observe(this)}disconnectedCallback(){this.resizeObserver.disconnect(),super.disconnectedCallback()}};t([e("slot")],a.prototype,"defaultSlot",void 0),a=t([i("nile-table")],a);export{a as N};
|
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,
|
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
|
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{
|
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,
|
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,E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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,CAAAA,KAAAA,CAAUI,YAAG,CAGUJ,CAAAA,KAAAA,CAAQK,SACzE,EAEOL,CAAAA,KAAAA,CAAUM,W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AAAA,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
|
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?
|
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?
|
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?
|
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?
|
22
|
-
${this.havefilter?
|
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>`:
|
30
|
+
</nile-popover>`:t``}
|
31
31
|
</div>
|
32
|
-
</div>`:null}`}};e([
|
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};
|
@@ -18,6 +18,7 @@ export declare class NileTable extends NileElement {
|
|
18
18
|
private rows;
|
19
19
|
private primaryRowWidths;
|
20
20
|
private resizeObserver;
|
21
|
+
private debounceTimeout;
|
21
22
|
/**
|
22
23
|
* The styles for nile-table
|
23
24
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
@@ -115,7 +115,13 @@ let NileTable = class NileTable extends NileElement {
|
|
115
115
|
handleResizeObserver() {
|
116
116
|
const onResize = (entries) => {
|
117
117
|
for (let entry of entries) {
|
118
|
-
this.
|
118
|
+
if (this.debounceTimeout) {
|
119
|
+
clearTimeout(this.debounceTimeout);
|
120
|
+
}
|
121
|
+
this.debounceTimeout = setTimeout(() => {
|
122
|
+
this.realignStructure();
|
123
|
+
this.debounceTimeout = null;
|
124
|
+
}, 500);
|
119
125
|
}
|
120
126
|
};
|
121
127
|
this.resizeObserver = new ResizeObserver(onResize);
|
@@ -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;
|
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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D,gBAAgB,EAAE,CAAC,CAAC,CAAC;aACpB,UAAU,EAAE,aAAa,CAAkB,MAAM,CAAC,EAAE;YACrD,gBAAgB,EAAG,CAAA;IACrB,CAAC;IAED,oBAAoB;QACnB,MAAM,QAAQ,GAAG,CAAC,OAA6B,EAAO,EAAE;YACvD,KAAK,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC3B,IAAG,IAAI,CAAC,eAAe,EAAC,CAAC;oBACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBACpC,CAAC;gBACD,IAAI,CAAC,eAAe,GAAC,UAAU,CAAC,GAAG,EAAE;oBACpC,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACxB,IAAI,CAAC,eAAe,GAAC,IAAI,CAAC;gBAC3B,CAAC,EAAE,GAAG,CAAC,CAAC;YACT,CAAC;QACF,CAAC,CAAC;QACF,IAAI,CAAC,cAAc,GAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAA;QAChD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAA;IAC7B,CAAC;CAED,CAAA;AAhIgB;IAAd,KAAK,CAAC,MAAM,CAAC;8CAA8B;AADjC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiIrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property, query, state} from 'lit/decorators.js';\nimport {styles} from './nile-table.css';\nimport NileElement from '../internal/nile-element';\nimport { NileTableBody } from '../nile-table-body';\nimport { NileTableCellItem } from '../nile-table-cell-item';\nimport { NileTableHeaderItem } from '../nile-table-header-item';\n\n\n/**\n * Nile table component.\n *\n * @tag nile-table\n *\n */\n@customElement('nile-table')\nexport class NileTable extends NileElement {\n @query('slot') defaultSlot: HTMLSlotElement;\n\tprivate rows:Array<NileTableBody>=[];\n\tprivate primaryRowWidths:Array<number>=[]\n\tprivate resizeObserver:ResizeObserver ;\n\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
|
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
|
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
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table-header-item.js","sourceRoot":"","sources":["../../../src/nile-table-header-item/nile-table-header-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAGL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,WAAW;IAA7C;;QACY,sBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAS9E,sCAAsC;QACM,aAAQ,GAAG,KAAK,CAAC;QAE7D,sCAAsC;QACM,eAAU,GAAG,KAAK,CAAC;QAE/D,wBAAwB;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QAAQ,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,KAAK,CAAC;gBAC1C,CAAC,CAAC,IAAI,CAAA;;;yBAGO,IAAI,CAAC,UAAU;4BACZ;gBAChB,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,QAAQ;gBACb,CAAC,CAAC,IAAI,CAAA,qBAAqB,IAAI,CAAC,QAAQ,0BAA0B;gBAClE,CAAC,CAAC,IAAI,CAAA,EAAE;YACR,IAAI,CAAC,UAAU;gBACf,CAAC,CAAC,IAAI,CAAA;;;;gCAIc,IAAI,CAAC,YAAY;;;;8BAInB;gBAClB,CAAC,CAAC,IAAI,CAAA,EAAE;;aAEP;YACP,CAAC,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;CAEF,CAAA;AA/E6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDAAkB;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAoB;AAGI;IAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;qDAC7D;AAEI;IAAR,KAAK,EAAE;uDAAgB;AApBb,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA0F/B;;AAED,eAAe,mBAAmB,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 {\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"]}
|
1
|
+
{"version":3,"file":"nile-table-header-item.js","sourceRoot":"","sources":["../../../src/nile-table-header-item/nile-table-header-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAGL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,WAAW;IAA7C;;QACY,sBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAS9E,sCAAsC;QACM,aAAQ,GAAG,KAAK,CAAC;QAE7D,sCAAsC;QACM,eAAU,GAAG,KAAK,CAAC;QAE/D,wBAAwB;QAC2C,aAAQ,GACzE,EAAE,CAAC;QAEI,eAAU,GAAG,CAAC,CAAC;QAqExB,gBAAgB;IAClB,CAAC;IAxFC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAcD,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACK,UAAU,CAAC,CAAM;QACvB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;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;;;8BAInB;gBAClB,CAAC,CAAC,IAAI,CAAA,EAAE;;aAEP;YACP,CAAC,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;CAEF,CAAA;AA/E6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDAAkB;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAoB;AAGI;IAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;qDAC7D;AAEI;IAAR,KAAK,EAAE;uDAAgB;AApBb,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA0F/B;;AAED,eAAe,mBAAmB,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 {\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"]}
|