@aquera/nile-elements 0.1.58-beta-1.0 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/demo/index.html +25 -9
- package/demo/index.js +0 -83
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +256 -101
- package/dist/nile-slider/index.cjs.js +2 -0
- package/dist/nile-slider/index.cjs.js.map +1 -0
- package/dist/nile-slider/index.esm.js +1 -0
- package/dist/nile-slider/nile-slider.cjs.js +2 -0
- package/dist/nile-slider/nile-slider.cjs.js.map +1 -0
- package/dist/nile-slider/nile-slider.css.cjs.js +2 -0
- package/dist/nile-slider/nile-slider.css.cjs.js.map +1 -0
- package/dist/nile-slider/nile-slider.css.esm.js +106 -0
- package/dist/nile-slider/nile-slider.esm.js +27 -0
- package/dist/nile-slider/nile-slider.template.cjs.js +2 -0
- package/dist/nile-slider/nile-slider.template.cjs.js.map +1 -0
- package/dist/nile-slider/nile-slider.template.esm.js +59 -0
- package/dist/nile-slider/types/nile-slider.enums.cjs.js +2 -0
- package/dist/nile-slider/types/nile-slider.enums.cjs.js.map +1 -0
- package/dist/nile-slider/types/nile-slider.enums.esm.js +1 -0
- package/dist/nile-slider/types/nile-slider.types.cjs.js +2 -0
- package/dist/nile-slider/types/nile-slider.types.cjs.js.map +1 -0
- package/dist/nile-slider/types/nile-slider.types.esm.js +1 -0
- package/dist/nile-slider/utils/nile-slider.utils.cjs.js +2 -0
- package/dist/nile-slider/utils/nile-slider.utils.cjs.js.map +1 -0
- package/dist/nile-slider/utils/nile-slider.utils.esm.js +1 -0
- package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.css.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.css.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.css.esm.js +0 -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 +0 -1
- 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 +0 -1
- package/dist/nile-table-header-item/nile-table-header-item.esm.js +33 -64
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-slider/index.d.ts +1 -0
- package/dist/src/nile-slider/index.js +2 -0
- package/dist/src/nile-slider/index.js.map +1 -0
- package/dist/src/nile-slider/nile-slider.css.d.ts +6 -0
- package/dist/src/nile-slider/nile-slider.css.js +118 -0
- package/dist/src/nile-slider/nile-slider.css.js.map +1 -0
- package/dist/src/nile-slider/nile-slider.d.ts +48 -0
- package/dist/src/nile-slider/nile-slider.js +217 -0
- package/dist/src/nile-slider/nile-slider.js.map +1 -0
- package/dist/src/nile-slider/nile-slider.template.d.ts +5 -0
- package/dist/src/nile-slider/nile-slider.template.js +73 -0
- package/dist/src/nile-slider/nile-slider.template.js.map +1 -0
- package/dist/src/nile-slider/types/nile-slider.enums.d.ts +10 -0
- package/dist/src/nile-slider/types/nile-slider.enums.js +2 -0
- package/dist/src/nile-slider/types/nile-slider.enums.js.map +1 -0
- package/dist/src/nile-slider/types/nile-slider.types.d.ts +1 -0
- package/dist/src/nile-slider/types/nile-slider.types.js +2 -0
- package/dist/src/nile-slider/types/nile-slider.types.js.map +1 -0
- package/dist/src/nile-slider/utils/nile-slider.utils.d.ts +11 -0
- package/dist/src/nile-slider/utils/nile-slider.utils.js +99 -0
- package/dist/src/nile-slider/utils/nile-slider.utils.js.map +1 -0
- package/dist/src/nile-table-body/nile-table-body.css.js +0 -1
- package/dist/src/nile-table-body/nile-table-body.css.js.map +1 -1
- package/dist/src/nile-table-body/nile-table-body.js +0 -1
- package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +0 -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 +0 -1
- 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 +45 -89
- package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -1
- package/src/nile-slider/index.ts +1 -0
- package/src/nile-slider/nile-slider.css.ts +119 -0
- package/src/nile-slider/nile-slider.template.ts +77 -0
- package/src/nile-slider/nile-slider.ts +215 -0
- package/src/nile-slider/types/nile-slider.enums.ts +10 -0
- package/src/nile-slider/types/nile-slider.types.ts +13 -0
- package/src/nile-slider/utils/nile-slider.utils.ts +136 -0
- package/src/nile-table-body/nile-table-body.css.ts +0 -1
- package/src/nile-table-body/nile-table-body.ts +0 -1
- package/src/nile-table-cell-item/nile-table-cell-item.css.ts +0 -1
- package/src/nile-table-header-item/nile-table-header-item.css.ts +0 -1
- package/src/nile-table-header-item/nile-table-header-item.ts +45 -88
- package/vscode-html-custom-data.json +134 -44
@@ -0,0 +1,2 @@
|
|
1
|
+
System.register(["./nile-slider.cjs.js","tslib","./nile-slider.css.cjs.js","lit","../internal/nile-element.cjs.js","lit/directives/class-map.js","lit/decorators.js","./nile-slider.template.cjs.js","./utils/nile-slider.utils.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSliderCjsJs){_export("NileSlider",_nileSliderCjsJs.N);},function(_tslib){},function(_nileSliderCssCjsJs){},function(_lit){},function(_internalNileElementCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_nileSliderTemplateCjsJs){},function(_utilsNileSliderUtilsCjsJs){}],execute:function execute(){}};});
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
export{N as NileSlider}from"./nile-slider.esm.js";import"tslib";import"./nile-slider.css.esm.js";import"lit";import"../internal/nile-element.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"./nile-slider.template.esm.js";import"./utils/nile-slider.utils.esm.js";
|
@@ -0,0 +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","./nile-slider.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","lit","lit/decorators.js","./nile-slider.template.cjs.js","./utils/nile-slider.utils.cjs.js"],function(_export,_context){"use strict";var t,s,i,e,h,a,l,n,o,r,c,d,p,m,u,v,b,g,_templateObject,_templateObject2,f;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(_nileSliderCssCjsJs){s=_nileSliderCssCjsJs.s;},function(_internalNileElementCjsJs){i=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_lit){h=_lit.html;},function(_litDecoratorsJs){a=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileSliderTemplateCjsJs){n=_nileSliderTemplateCjsJs.l;o=_nileSliderTemplateCjsJs.r;r=_nileSliderTemplateCjsJs.s;},function(_utilsNileSliderUtilsCjsJs){c=_utilsNileSliderUtilsCjsJs.h;d=_utilsNileSliderUtilsCjsJs.a;p=_utilsNileSliderUtilsCjsJs.b;m=_utilsNileSliderUtilsCjsJs.v;u=_utilsNileSliderUtilsCjsJs.r;v=_utilsNileSliderUtilsCjsJs.c;b=_utilsNileSliderUtilsCjsJs.d;g=_utilsNileSliderUtilsCjsJs.g;}],execute:function execute(){_export("N",f=/*#__PURE__*/function(_i){function f(){var _this;_classCallCheck(this,f);_this=_callSuper(this,f,arguments),_this.minValue=0,_this.value=_this.minValue,_this.maxValue=100,_this.rangeOneValue=_this.minValue,_this.rangeTwoValue=_this.maxValue,_this.showLabel=!1,_this.labelStart="",_this.labelEnd="",_this.rangeSlider=!1,_this.labelPosition="top",_this.tooltipPosition="top",_this.activeThumb=null,_this.onMouseMove=function(t){var s=_this.range.getBoundingClientRect();if(_this.rangeSlider){"one"===_this.activeThumb?d(t,s,_assertThisInitialized(_this)):"two"===_this.activeThumb&&p(t,s,_assertThisInitialized(_this));var _i2=m(_this.rangeOneValue,_assertThisInitialized(_this)),_e=m(_this.rangeTwoValue,_assertThisInitialized(_this)),_h=Math.min(_i2,_e),_a=Math.abs(_e-_i2);_this.rangeTwoValue>=_this.rangeOneValue&&(_this.completed.style.left="".concat(_h,"%"),_this.completed.style.width="".concat(_a,"%"));}else c(t,s,_assertThisInitialized(_this));},_this.onMouseUp=function(){_this.rangeSlider?(_this.emit("nile-button-first-change-end",{value:_this.rangeOneValue}),_this.emit("nile-button-last-change-end",{value:_this.rangeTwoValue})):_this.emit("nile-change-end",{value:_this.value}),_this.activeThumb=null,u(_assertThisInitialized(_this));},_this.onMouseDown=function(t){var s=_this.range.getBoundingClientRect(),i=(t.clientX-s.left)/s.width*100,e=_this.minValue+i/100*(_this.maxValue-_this.minValue);if(_this.rangeSlider){b(e,_assertThisInitialized(_this));var _t=Math.abs(e-_this.rangeOneValue),_s=Math.abs(e-_this.rangeTwoValue);_this.activeThumb=_t<=_s?"one":"two",v(_assertThisInitialized(_this));}else c(t,s,_assertThisInitialized(_this)),_this.activeThumb="one",v(_assertThisInitialized(_this));};return _this;}_inherits(f,_i);return _createClass(f,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(f,"connectedCallback",this,3)([]),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity();}},{key:"firstUpdated",value:function firstUpdated(t){if(g(this),!this.rangeSlider&&t.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);var _t2=m(this.value,this);this.buttonOne.style.left="".concat(_t2,"%"),this.completed.style.width="".concat(_t2,"%");}else if(this.rangeSlider){var _t3=m(this.rangeOneValue,this),_s2=m(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left="".concat(_t3,"%")),this.buttonTwo&&(this.buttonTwo.style.left="".concat(_s2,"%"));var _i3=Math.min(_t3,_s2),_e2=Math.abs(_s2-_t3);this.completed.style.left="".concat(_i3,"%"),this.completed.style.width="".concat(_e2,"%");}}},{key:"checkValueValidity",value:function checkValueValidity(t,s,i){return i-s<=1?Math.max(s,Math.min(t,i)):Math.floor(Math.max(s,Math.min(t,i)));}},{key:"checkRangeValidity",value:function checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue);}},{key:"render",value:function render(){var t=this.showLabel,s=t?"label-start label-end":void 0;return h(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n >\n <slot class=\"span\" name=\"prefix\"></slot>\n \n <div\n part=\"range-container\"\n class=","\n >\n ","\n \n <div\n class=\"range\"\n part=\"range\"\n role=\"group\"\n aria-labelledby=","\n >\n <span class=\"range-completed\" part=\"range-completed\"></span>\n ","\n </div>\n </div>\n \n <slot class=\"span\" name=\"suffix\"></slot>\n </div>\n "])),e({container:!0,"align-item-center":!t}),e({"range-container":!0,"column-reverse":"bottom"===this.labelPosition}),t?n(this):h(_templateObject2||(_templateObject2=_taggedTemplateLiteral([""]))),s,this.rangeSlider?o(this):r(this));}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(f,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}}],[{key:"styles",get:function get(){return[s];}}]);}(i));t([a({type:Number})],f.prototype,"minValue",void 0),t([a({type:Number})],f.prototype,"value",void 0),t([a({type:Number})],f.prototype,"maxValue",void 0),t([a({type:Number})],f.prototype,"rangeOneValue",void 0),t([a({type:Number})],f.prototype,"rangeTwoValue",void 0),t([a({type:Boolean})],f.prototype,"showLabel",void 0),t([a({type:String})],f.prototype,"labelStart",void 0),t([a({type:String})],f.prototype,"labelEnd",void 0),t([a({type:Boolean})],f.prototype,"rangeSlider",void 0),t([a({type:String})],f.prototype,"labelPosition",void 0),t([a({type:String})],f.prototype,"tooltipPosition",void 0),_export("N",f=t([l("nile-slider")],f));}};});
|
2
|
+
//# sourceMappingURL=nile-slider.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-slider.cjs.js","sources":["../../../src/nile-slider/nile-slider.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { styles } from './nile-slider.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TooltipPosition } from './types/nile-slider.types';\nimport { NileSliderEvents } from './types/nile-slider.enums';\nimport { rangeSlider, singleSlider, lableContaier } from './nile-slider.template';\nimport { \n handleSingleSlider, \n handleRangeOne, \n handleRangeTwo, \n getHtmlElements, \n removeMoveListeners,\n valueToPercent,\n handleTwoThumbClick,\n addMoveListeners\n} from './utils/nile-slider.utils'\n\n/** \n * Nile slider component.\n *\n * @tag nile-slider\n */\n@customElement('nile-slider')\nexport class NileSlider extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Number }) minValue: number = 0;\n @property({ type: Number }) value: number = this.minValue;\n @property({ type: Number }) maxValue: number = 100;\n @property({ type: Number }) rangeOneValue: number = this.minValue;\n @property({ type: Number }) rangeTwoValue: number = this.maxValue;\n @property({ type: Boolean}) showLabel: boolean = false;\n @property({ type: String }) labelStart: string = \"\";\n @property({ type: String }) labelEnd: string = \"\";\n @property({ type: Boolean}) rangeSlider: boolean = false;\n @property({ type: String }) labelPosition: string = \"top\";\n @property({ type: String }) tooltipPosition: TooltipPosition = \"top\";\n\n public buttonOne!: HTMLElement;\n public buttonTwo!: HTMLElement;\n public range!: HTMLElement;\n public completed!: HTMLElement;\n public activeThumb: 'one' | 'two' | null = null;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit(NileSliderEvents.NILE_INIT); \n\n if(this.rangeSlider) {\n this.checkRangeValidity();\n }\n }\n\n firstUpdated(changedProps: Map<string, any>): void {\n getHtmlElements(this);\n\n if (!this.rangeSlider && changedProps.has('value')) {\n this.value = this.checkValueValidity(this.value, this.minValue, this.maxValue);\n const percent = valueToPercent(this.value, this);\n \n this.buttonOne.style.left = `${percent}%`;\n this.completed.style.width = `${percent}%`;\n } else if (this.rangeSlider) {\n \n const percentOne = valueToPercent(this.rangeOneValue, this);\n const percentTwo = valueToPercent(this.rangeTwoValue, this);\n \n if (this.buttonOne) this.buttonOne.style.left = `${percentOne}%`;\n if (this.buttonTwo) this.buttonTwo.style.left = `${percentTwo}%`;\n \n const left = Math.min(percentOne, percentTwo);\n const width = Math.abs(percentTwo - percentOne);\n \n this.completed.style.left = `${left}%`;\n this.completed.style.width = `${width}%`;\n }\n }\n\n checkValueValidity(value: number, min: number, max: number): number {\n if(max - min <= 1) { \n return Math.max(min, Math.min(value, max));\n }\n return Math.floor(Math.max(min, Math.min(value, max)));\n }\n\n checkRangeValidity(): void {\n if(this.rangeTwoValue > this.maxValue) {\n this.rangeTwoValue = this.maxValue;\n } else if(this.rangeTwoValue < this.rangeOneValue) {\n this.rangeTwoValue = this.rangeOneValue;\n }\n\n if(this.rangeOneValue < this.minValue) {\n this.rangeOneValue = this.minValue;\n } else if(this.rangeOneValue > this.rangeTwoValue) {\n this.rangeOneValue = this.rangeTwoValue;\n }\n } \n\n public onMouseMove = (e: MouseEvent): void => {\n const rect = this.range.getBoundingClientRect();\n\n if (!this.rangeSlider) {\n handleSingleSlider(e, rect, this);\n } else {\n if (this.activeThumb === 'one') {\n handleRangeOne(e, rect, this);\n } else if (this.activeThumb === 'two') {\n handleRangeTwo(e, rect, this);\n }\n\n const start = valueToPercent(this.rangeOneValue, this);\n const end = valueToPercent(this.rangeTwoValue, this);\n const left = Math.min(start, end);\n const width = Math.abs(end - start);\n\n if(this.rangeTwoValue >= this.rangeOneValue) {\n this.completed.style.left = `${left}%`;\n this.completed.style.width = `${width}%`;\n }\n }\n };\n\n public onMouseUp = (): void => {\n if(!this.rangeSlider) this.emit(NileSliderEvents.NILE_CHANGE_END, { value: this.value });\n else {\n this.emit(NileSliderEvents.NILE_BUTTON_FIRST_CHANGE_END, { value: this.rangeOneValue });\n this.emit(NileSliderEvents.NILE_BUTTON_LAST_CHANGE_END, { value: this.rangeTwoValue });\n }\n this.activeThumb = null;\n removeMoveListeners(this);\n };\n\n public onMouseDown = (e: MouseEvent): void => {\n const rect = this.range.getBoundingClientRect();\n const clickX = e.clientX - rect.left;\n const percent = (clickX / rect.width) * 100;\n const value = this.minValue + (percent / 100) * (this.maxValue - this.minValue);\n \n if (!this.rangeSlider) {\n handleSingleSlider(e, rect, this);\n this.activeThumb = 'one';\n addMoveListeners(this);\n } else {\n handleTwoThumbClick(value, this);\n const distToOne = Math.abs(value - this.rangeOneValue);\n const distToTwo = Math.abs(value - this.rangeTwoValue);\n this.activeThumb = distToOne <= distToTwo ? 'one' : 'two';\n addMoveListeners(this);\n }\n };\n\n public render(): TemplateResult {\n const hasLabels = this.showLabel;\n const ariaLabelledby = hasLabels ? 'label-start label-end' : undefined;\n \n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'container': true,\n 'align-item-center': !hasLabels\n })}\n >\n <slot class=\"span\" name=\"prefix\"></slot>\n \n <div\n part=\"range-container\"\n class=${classMap({\n 'range-container': true,\n 'column-reverse': this.labelPosition === 'bottom'\n })}\n >\n ${hasLabels ? lableContaier(this) : html``}\n \n <div\n class=\"range\"\n part=\"range\"\n role=\"group\"\n aria-labelledby=${ariaLabelledby}\n >\n <span class=\"range-completed\" part=\"range-completed\"></span>\n ${this.rangeSlider ? rangeSlider(this) : singleSlider(this)}\n </div>\n </div>\n \n <slot class=\"span\" name=\"suffix\"></slot>\n </div>\n `;\n } \n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.emit(NileSliderEvents.NILE_DESTROY);\n }\n}\n\nexport default NileSlider;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-slider': NileSlider;\n }\n}\n"],"names":["NileSlider","f","this","minValue","value","maxValue","rangeOneValue","rangeTwoValue","showLabel","labelStart","labelEnd","rangeSlider","labelPosition","tooltipPosition","activeThumb","onMouseMove","e","rect","range","getBoundingClientRect","handleRangeOne","handleRangeTwo","start","valueToPercent","end","left","Math","min","width","abs","completed","style","concat","handleSingleSlider","onMouseUp","emit","removeMoveListeners","onMouseDown","percent","clientX","handleTwoThumbClick","distToOne","distToTwo","addMoveListeners","_this","_inherits","_i","_createClass","key","connectedCallback","super","checkRangeValidity","firstUpdated","changedProps","getHtmlElements","has","checkValueValidity","buttonOne","percentOne","percentTwo","buttonTwo","max","floor","render","hasLabels","ariaLabelledby","undefined","html","_templateObject","_taggedTemplateLiteral","classMap","container","lableContaier","_templateObject2","singleSlider","disconnectedCallback","__decorate","get","styles","NileElement","property","type","Number","prototype","Boolean","String","customElement"],"mappings":"svIAgCaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEAKuBC,KAAAA,CAAQC,QAAAA,CAAW,CACnBD,CAAAA,KAAAA,CAAAE,MAAgBF,KAAAA,CAAKC,QAAAA,CACrBD,KAAAA,CAAQG,QAAAA,CAAW,GACnBH,CAAAA,KAAAA,CAAAI,cAAwBJ,KAAAA,CAAKC,QAAAA,CAC7BD,KAAAA,CAAAK,aAAAA,CAAwBL,KAAAA,CAAKG,QAAAA,CAC7BH,KAAAA,CAASM,SAAY,CAAA,CAAA,CAAA,CACrBN,KAAAA,CAAUO,UAAW,CAAA,EAAA,CACrBP,KAAAA,CAAQQ,QAAW,CAAA,EAAA,CACnBR,KAAAA,CAAWS,WAAAA,CAAAA,CAAY,CACvBT,CAAAA,KAAAA,CAAaU,cAAW,KACxBV,CAAAA,KAAAA,CAAeW,eAAoB,CAAA,KAAA,CAMxDX,KAAAA,CAAWY,WAAAA,CAAyB,KAyDpCZ,KAAAA,CAAAa,WAAAA,CAAeC,SAAAA,CACpB,CAAA,CAAA,GAAMC,CAAAA,CAAOf,CAAAA,KAAAA,CAAKgB,MAAMC,qBAExB,CAAA,CAAA,CAAA,GAAKjB,KAAAA,CAAKS,WAEH,CAAA,CACoB,QAArBT,KAAAA,CAAKY,WAAAA,CACPM,CAAeJ,CAAAA,CAAAA,CAAGC,CAAMf,CAAAA,sBAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CACM,QAArBA,KAAAA,CAAKY,WAAAA,EACdO,CAAeL,CAAAA,CAAAA,CAAGC,CAAMf,CAAA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A,eAAA,CAAA,IAAA,EAC9BP,CAAAA,CAAAA,CAAAA,CAAA,CAA3BI,CAAAA,CAAS,CAAEC,IAAAA,CAAMI,MAAmDrF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmF,SAAA,CAAA,iBAAA,CAAA,IAAA,EAf1DnF,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAU4E,CAAA,CAAA,CADtBU,CAAc,CAAA,aAAA,CAAA,CAAA,CACFtF"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",a=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n }\n\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n height: 100px;\n }\n\n .align-item-center {\n align-items: center;\n }\n\n slot.span {\n font-size: var(--nile-font-size-micro);\n margin-top: 14px;\n }\n\n .range-container {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm);\n }\n\n .column-reverse {\n flex-direction: column-reverse;\n }\n\n .label-container {\n display: flex;\n justify-content: space-between;\n }\n\n .label-container span {\n margin: var(--nile-spacing-none);\n padding: var(--nile-spacing-none);\n font-size: var(--nile-font-size-micro);\n }\n\n .range {\n position: relative;\n width: 228px;\n height: 4px;\n background-color: var(--nile-colors-neutral-400);\n user-select: none;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range:hover {\n cursor: pointer;\n }\n\n .range-completed {\n position: absolute;\n height: 100%;\n width: 0%;\n background-color: var(--nile-colors-primary-600);\n top: 0px;\n left: 0px;\n z-index: 98;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range-button {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 0;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n\n .range-button:hover, .range-button-two:hover {\n cursor: pointer;\n background-color: var(--nile-colors-primary-700);\n }\n\n .range-button:active, .range-button-two:active {\n transition: box-shadow var(--nile-transition-duration-default) ease;\n background-color: var(--nile-colors-primary-700);\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;\n }\n\n .range-button-two {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 100%;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n"]))));}};});
|
2
|
+
//# sourceMappingURL=nile-slider.css.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-slider.css.cjs.js","sources":["../../../src/nile-slider/nile-slider.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2025\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\nimport { css } from 'lit';\n\n/**\n* Slider CSS\n*/\nexport const styles = css`\n :host {\n display: block;\n }\n\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n height: 100px;\n }\n\n .align-item-center {\n align-items: center;\n }\n\n slot.span {\n font-size: var(--nile-font-size-micro);\n margin-top: 14px;\n }\n\n .range-container {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm);\n }\n\n .column-reverse {\n flex-direction: column-reverse;\n }\n\n .label-container {\n display: flex;\n justify-content: space-between;\n }\n\n .label-container span {\n margin: var(--nile-spacing-none);\n padding: var(--nile-spacing-none);\n font-size: var(--nile-font-size-micro);\n }\n\n .range {\n position: relative;\n width: 228px;\n height: 4px;\n background-color: var(--nile-colors-neutral-400);\n user-select: none;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range:hover {\n cursor: pointer;\n }\n\n .range-completed {\n position: absolute;\n height: 100%;\n width: 0%;\n background-color: var(--nile-colors-primary-600);\n top: 0px;\n left: 0px;\n z-index: 98;\n border-radius: var(--nile-radius-radius-3xl);\n }\n\n .range-button {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 0;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n\n .range-button:hover, .range-button-two:hover {\n cursor: pointer;\n background-color: var(--nile-colors-primary-700);\n }\n\n .range-button:active, .range-button-two:active {\n transition: box-shadow var(--nile-transition-duration-default) ease;\n background-color: var(--nile-colors-primary-700);\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;\n }\n\n .range-button-two {\n height: 12px;\n width: 12px;\n background-color: var(--nile-colors-primary-600);\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n border-radius: var(--nile-radius-radius-3xl);\n left: 100%;\n z-index: 100;\n box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;\n transition: box-shadow var(--nile-transition-duration-default) ease;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAWaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
import{css as r}from"lit";const a=r`
|
2
|
+
:host {
|
3
|
+
display: block;
|
4
|
+
}
|
5
|
+
|
6
|
+
.container {
|
7
|
+
display: flex;
|
8
|
+
justify-content: center;
|
9
|
+
align-items: center;
|
10
|
+
gap: 10px;
|
11
|
+
height: 100px;
|
12
|
+
}
|
13
|
+
|
14
|
+
.align-item-center {
|
15
|
+
align-items: center;
|
16
|
+
}
|
17
|
+
|
18
|
+
slot.span {
|
19
|
+
font-size: var(--nile-font-size-micro);
|
20
|
+
margin-top: 14px;
|
21
|
+
}
|
22
|
+
|
23
|
+
.range-container {
|
24
|
+
display: flex;
|
25
|
+
flex-direction: column;
|
26
|
+
gap: var(--nile-spacing-sm);
|
27
|
+
}
|
28
|
+
|
29
|
+
.column-reverse {
|
30
|
+
flex-direction: column-reverse;
|
31
|
+
}
|
32
|
+
|
33
|
+
.label-container {
|
34
|
+
display: flex;
|
35
|
+
justify-content: space-between;
|
36
|
+
}
|
37
|
+
|
38
|
+
.label-container span {
|
39
|
+
margin: var(--nile-spacing-none);
|
40
|
+
padding: var(--nile-spacing-none);
|
41
|
+
font-size: var(--nile-font-size-micro);
|
42
|
+
}
|
43
|
+
|
44
|
+
.range {
|
45
|
+
position: relative;
|
46
|
+
width: 228px;
|
47
|
+
height: 4px;
|
48
|
+
background-color: var(--nile-colors-neutral-400);
|
49
|
+
user-select: none;
|
50
|
+
border-radius: var(--nile-radius-radius-3xl);
|
51
|
+
}
|
52
|
+
|
53
|
+
.range:hover {
|
54
|
+
cursor: pointer;
|
55
|
+
}
|
56
|
+
|
57
|
+
.range-completed {
|
58
|
+
position: absolute;
|
59
|
+
height: 100%;
|
60
|
+
width: 0%;
|
61
|
+
background-color: var(--nile-colors-primary-600);
|
62
|
+
top: 0px;
|
63
|
+
left: 0px;
|
64
|
+
z-index: 98;
|
65
|
+
border-radius: var(--nile-radius-radius-3xl);
|
66
|
+
}
|
67
|
+
|
68
|
+
.range-button {
|
69
|
+
height: 12px;
|
70
|
+
width: 12px;
|
71
|
+
background-color: var(--nile-colors-primary-600);
|
72
|
+
position: absolute;
|
73
|
+
top: 50%;
|
74
|
+
transform: translate(-50%, -50%);
|
75
|
+
border-radius: var(--nile-radius-radius-3xl);
|
76
|
+
left: 0;
|
77
|
+
z-index: 100;
|
78
|
+
box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
|
79
|
+
transition: box-shadow var(--nile-transition-duration-default) ease;
|
80
|
+
}
|
81
|
+
|
82
|
+
.range-button:hover, .range-button-two:hover {
|
83
|
+
cursor: pointer;
|
84
|
+
background-color: var(--nile-colors-primary-700);
|
85
|
+
}
|
86
|
+
|
87
|
+
.range-button:active, .range-button-two:active {
|
88
|
+
transition: box-shadow var(--nile-transition-duration-default) ease;
|
89
|
+
background-color: var(--nile-colors-primary-700);
|
90
|
+
box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;
|
91
|
+
}
|
92
|
+
|
93
|
+
.range-button-two {
|
94
|
+
height: 12px;
|
95
|
+
width: 12px;
|
96
|
+
background-color: var(--nile-colors-primary-600);
|
97
|
+
position: absolute;
|
98
|
+
top: 50%;
|
99
|
+
transform: translate(-50%, -50%);
|
100
|
+
border-radius: var(--nile-radius-radius-3xl);
|
101
|
+
left: 100%;
|
102
|
+
z-index: 100;
|
103
|
+
box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
|
104
|
+
transition: box-shadow var(--nile-transition-duration-default) ease;
|
105
|
+
}
|
106
|
+
`;export{a as s};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import{__decorate as t}from"tslib";import{s}from"./nile-slider.css.esm.js";import{N as i}from"../internal/nile-element.esm.js";import{classMap as e}from"lit/directives/class-map.js";import{html as h}from"lit";import{property as a,customElement as l}from"lit/decorators.js";import{l as n,r as o,s as r}from"./nile-slider.template.esm.js";import{h as d,a as c,b as p,v as m,r as u,c as v,d as b,g}from"./utils/nile-slider.utils.esm.js";let f=class extends i{constructor(){super(...arguments),this.minValue=0,this.value=this.minValue,this.maxValue=100,this.rangeOneValue=this.minValue,this.rangeTwoValue=this.maxValue,this.showLabel=!1,this.labelStart="",this.labelEnd="",this.rangeSlider=!1,this.labelPosition="top",this.tooltipPosition="top",this.activeThumb=null,this.onMouseMove=t=>{const s=this.range.getBoundingClientRect();if(this.rangeSlider){"one"===this.activeThumb?c(t,s,this):"two"===this.activeThumb&&p(t,s,this);const i=m(this.rangeOneValue,this),e=m(this.rangeTwoValue,this),h=Math.min(i,e),a=Math.abs(e-i);this.rangeTwoValue>=this.rangeOneValue&&(this.completed.style.left=`${h}%`,this.completed.style.width=`${a}%`)}else d(t,s,this)},this.onMouseUp=()=>{this.rangeSlider?(this.emit("nile-button-first-change-end",{value:this.rangeOneValue}),this.emit("nile-button-last-change-end",{value:this.rangeTwoValue})):this.emit("nile-change-end",{value:this.value}),this.activeThumb=null,u(this)},this.onMouseDown=t=>{const s=this.range.getBoundingClientRect(),i=(t.clientX-s.left)/s.width*100,e=this.minValue+i/100*(this.maxValue-this.minValue);if(this.rangeSlider){b(e,this);const t=Math.abs(e-this.rangeOneValue),s=Math.abs(e-this.rangeTwoValue);this.activeThumb=t<=s?"one":"two",v(this)}else d(t,s,this),this.activeThumb="one",v(this)}}static get styles(){return[s]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity()}firstUpdated(t){if(g(this),!this.rangeSlider&&t.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);const t=m(this.value,this);this.buttonOne.style.left=`${t}%`,this.completed.style.width=`${t}%`}else if(this.rangeSlider){const t=m(this.rangeOneValue,this),s=m(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left=`${t}%`),this.buttonTwo&&(this.buttonTwo.style.left=`${s}%`);const i=Math.min(t,s),e=Math.abs(s-t);this.completed.style.left=`${i}%`,this.completed.style.width=`${e}%`}}checkValueValidity(t,s,i){return i-s<=1?Math.max(s,Math.min(t,i)):Math.floor(Math.max(s,Math.min(t,i)))}checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue)}render(){const t=this.showLabel,s=t?"label-start label-end":void 0;return h`
|
2
|
+
<div
|
3
|
+
part="base"
|
4
|
+
class=${e({container:!0,"align-item-center":!t})}
|
5
|
+
>
|
6
|
+
<slot class="span" name="prefix"></slot>
|
7
|
+
|
8
|
+
<div
|
9
|
+
part="range-container"
|
10
|
+
class=${e({"range-container":!0,"column-reverse":"bottom"===this.labelPosition})}
|
11
|
+
>
|
12
|
+
${t?n(this):h``}
|
13
|
+
|
14
|
+
<div
|
15
|
+
class="range"
|
16
|
+
part="range"
|
17
|
+
role="group"
|
18
|
+
aria-labelledby=${s}
|
19
|
+
>
|
20
|
+
<span class="range-completed" part="range-completed"></span>
|
21
|
+
${this.rangeSlider?o(this):r(this)}
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<slot class="span" name="suffix"></slot>
|
26
|
+
</div>
|
27
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};t([a({type:Number})],f.prototype,"minValue",void 0),t([a({type:Number})],f.prototype,"value",void 0),t([a({type:Number})],f.prototype,"maxValue",void 0),t([a({type:Number})],f.prototype,"rangeOneValue",void 0),t([a({type:Number})],f.prototype,"rangeTwoValue",void 0),t([a({type:Boolean})],f.prototype,"showLabel",void 0),t([a({type:String})],f.prototype,"labelStart",void 0),t([a({type:String})],f.prototype,"labelEnd",void 0),t([a({type:Boolean})],f.prototype,"rangeSlider",void 0),t([a({type:String})],f.prototype,"labelPosition",void 0),t([a({type:String})],f.prototype,"tooltipPosition",void 0),f=t([l("nile-slider")],f);export{f as N};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
System.register(["lit","lit/directives/class-map.js"],function(_export,_context){"use strict";var a,e,_templateObject,_templateObject2,_templateObject3,i,t,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){a=_lit.html;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;}],execute:function execute(){_export("r",i=function i(e){return a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div>\n <nile-tooltip\n content=","\n placement=","\n >\n <div \n id=\"range-one\" \n class=\"range-button\"\n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=\"Minimum value\"\n ></div>\n </nile-tooltip>\n <nile-tooltip\n content=","\n placement=","\n >\n <div\n id=\"range-two\"\n class=\"range-button-two\"\n part=\"range-button-two\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=\"Maximum value\"\n ></div>\n </nile-tooltip>\n </div>\n "])),e.rangeOneValue,e.tooltipPosition,e.minValue,e.maxValue,e.rangeOneValue,e.rangeTwoValue,e.tooltipPosition,e.minValue,e.maxValue,e.rangeTwoValue);}),_export("s",t=function t(i){return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div>\n <nile-tooltip\n content=","\n placement=","\n >\n <div \n class="," \n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=","\n aria-valuemax=","\n aria-valuenow=","\n aria-label=","\n ></div>\n </nile-tooltip>\n </div>\n "])),i.value,i.tooltipPosition,e({"range-button":!0,"range-button-active":"one"===i.activeThumb}),i.minValue,i.maxValue,i.value,i.ariaLabel||"Slider value");}),_export("l",l=function l(e){return a(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <div part=\"label-container\" class=\"label-container\">\n <span id=\"label-start\">","</span>\n <span id=\"label-end\">","</span>\n </div>\n "])),e.labelStart,e.labelEnd);});}};});
|
2
|
+
//# sourceMappingURL=nile-slider.template.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-slider.template.cjs.js","sources":["../../../src/nile-slider/nile-slider.template.ts"],"sourcesContent":["import { TemplateResult, html } from 'lit';\nimport NileSlider from './nile-slider';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport const rangeSlider = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div>\n <nile-tooltip\n content=${nileSlider.rangeOneValue}\n placement=${nileSlider.tooltipPosition}\n >\n <div \n id=\"range-one\" \n class=\"range-button\"\n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.rangeOneValue}\n aria-label=\"Minimum value\"\n ></div>\n </nile-tooltip>\n <nile-tooltip\n content=${nileSlider.rangeTwoValue}\n placement=${nileSlider.tooltipPosition}\n >\n <div\n id=\"range-two\"\n class=\"range-button-two\"\n part=\"range-button-two\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.rangeTwoValue}\n aria-label=\"Maximum value\"\n ></div>\n </nile-tooltip>\n </div>\n `;\n};\n\nexport const singleSlider = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div>\n <nile-tooltip\n content=${nileSlider.value}\n placement=${nileSlider.tooltipPosition}\n >\n <div \n class=${classMap({\n 'range-button': true,\n 'range-button-active': nileSlider.activeThumb === 'one',\n })} \n part=\"range-button\"\n role=\"slider\"\n tabindex=\"0\"\n aria-valuemin=${nileSlider.minValue}\n aria-valuemax=${nileSlider.maxValue}\n aria-valuenow=${nileSlider.value}\n aria-label=${nileSlider.ariaLabel || \"Slider value\"}\n ></div>\n </nile-tooltip>\n </div>\n `;\n};\n\n\nexport const lableContaier = (nileSlider: NileSlider): TemplateResult => {\n return html`\n <div part=\"label-container\" class=\"label-container\">\n <span id=\"label-start\">${nileSlider.labelStart}</span>\n <span id=\"label-end\">${nileSlider.labelEnd}</span>\n </div>\n `;\n};"],"names":["rangeSlider","nileSlider","html","_templateObject","_taggedTemplateLiteral","rangeOneValue","tooltipPosition","minValue","maxValue","rangeTwoValue","singleSlider","_templateObject2","value","classMap","activeThumb","ariaLabel","lableContaier","_templateObject3","labelStart","labelEnd"],"mappings":"ocAIaA,CAAAA,CAAeC,QAAfD,CAAAA,CAAAA,CAAeC,SACnBC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,m1BAGKH,CAAWI,CAAAA,aAAAA,CACTJ,CAAWK,CAAAA,eAAAA,CAQLL,CAAWM,CAAAA,QAAAA,CACXN,CAAWO,CAAAA,QAAAA,CACXP,CAAWI,CAAAA,aAAAA,CAKnBJ,CAAWQ,CAAAA,aAAAA,CACTR,CAAWK,CAAAA,eAAAA,CAQLL,CAAWM,CAAAA,QAAAA,CACXN,CAAWO,CAAAA,QAAAA,CACXP,CAAWQ,CAAAA,aAAAA,GAQxBC,EAAAA,OAAAA,KAAAA,CAAAA,CAAgBT,QAAhBS,CAAAA,CAAAA,CAAgBT,SACpBC,CAAAA,CAAI,CAAAS,gBAAA,GAAAA,gBAAA,CAAAP,sBAAA,iYAGKH,CAAWW,CAAAA,KAAAA,CACTX,CAAWK,CAAAA,eAAAA,CAGbO,CAAAA,CAAS,CACf,cAAA,CAAA,CAAgB,CAChB,CAAA,qBAAA,CAAkD,QAA3BZ,CAAWa,CAAAA,WAAAA,CAAAA,CAAAA,CAKpBb,CAAWM,CAAAA,QAAAA,CACXN,CAAWO,CAAAA,QAAAA,CACXP,CAAWW,CAAAA,KAAAA,CACdX,CAAAA,CAAWc,SAAa,EAAA,cAAA,GAQlCC,EAAAA,OAAAA,KAAAA,CAAAA,CAAiBf,QAAjBe,CAAAA,CAAAA,CAAiBf,SACrBC,CAAAA,CAAI,CAAAe,gBAAA,GAAAA,gBAAA,CAAAb,sBAAA,0KAEkBH,CAAWiB,CAAAA,UAAAA,CACbjB,CAAWkB,CAAAA,QAAAA"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import{html as a}from"lit";import{classMap as e}from"lit/directives/class-map.js";const i=e=>a`
|
2
|
+
<div>
|
3
|
+
<nile-tooltip
|
4
|
+
content=${e.rangeOneValue}
|
5
|
+
placement=${e.tooltipPosition}
|
6
|
+
>
|
7
|
+
<div
|
8
|
+
id="range-one"
|
9
|
+
class="range-button"
|
10
|
+
part="range-button"
|
11
|
+
role="slider"
|
12
|
+
tabindex="0"
|
13
|
+
aria-valuemin=${e.minValue}
|
14
|
+
aria-valuemax=${e.maxValue}
|
15
|
+
aria-valuenow=${e.rangeOneValue}
|
16
|
+
aria-label="Minimum value"
|
17
|
+
></div>
|
18
|
+
</nile-tooltip>
|
19
|
+
<nile-tooltip
|
20
|
+
content=${e.rangeTwoValue}
|
21
|
+
placement=${e.tooltipPosition}
|
22
|
+
>
|
23
|
+
<div
|
24
|
+
id="range-two"
|
25
|
+
class="range-button-two"
|
26
|
+
part="range-button-two"
|
27
|
+
role="slider"
|
28
|
+
tabindex="0"
|
29
|
+
aria-valuemin=${e.minValue}
|
30
|
+
aria-valuemax=${e.maxValue}
|
31
|
+
aria-valuenow=${e.rangeTwoValue}
|
32
|
+
aria-label="Maximum value"
|
33
|
+
></div>
|
34
|
+
</nile-tooltip>
|
35
|
+
</div>
|
36
|
+
`,t=i=>a`
|
37
|
+
<div>
|
38
|
+
<nile-tooltip
|
39
|
+
content=${i.value}
|
40
|
+
placement=${i.tooltipPosition}
|
41
|
+
>
|
42
|
+
<div
|
43
|
+
class=${e({"range-button":!0,"range-button-active":"one"===i.activeThumb})}
|
44
|
+
part="range-button"
|
45
|
+
role="slider"
|
46
|
+
tabindex="0"
|
47
|
+
aria-valuemin=${i.minValue}
|
48
|
+
aria-valuemax=${i.maxValue}
|
49
|
+
aria-valuenow=${i.value}
|
50
|
+
aria-label=${i.ariaLabel||"Slider value"}
|
51
|
+
></div>
|
52
|
+
</nile-tooltip>
|
53
|
+
</div>
|
54
|
+
`,l=e=>a`
|
55
|
+
<div part="label-container" class="label-container">
|
56
|
+
<span id="label-start">${e.labelStart}</span>
|
57
|
+
<span id="label-end">${e.labelEnd}</span>
|
58
|
+
</div>
|
59
|
+
`;export{l,i as r,t as s};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-slider.enums.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-slider.types.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,2 @@
|
|
1
|
+
System.register([],function(_export,_context){"use strict";var t,a,n,o,e,s,u,h,c,l;return{setters:[],execute:function execute(){t=function t(_t,a){return Math.max(0,Math.min(a,_t.width))/_t.width*100;},a=function a(t,_a){var n=_a.minValue+t/100*(_a.maxValue-_a.minValue);return _a.maxValue-_a.minValue<1?parseFloat(n.toFixed(2)):Math.floor(n);},_export("v",n=function n(t,a){return(t-a.minValue)/(a.maxValue-a.minValue)*100;}),_export("h",o=function o(n,_o,e){var s=n.clientX-_o.left,u=t(_o,s);e.value=a(u,e),e.emit("nile-change",{value:e.value}),e.buttonOne.style.left="".concat(u,"%"),e.completed.style.width="".concat(u,"%");}),_export("a",e=function e(n,o,_e){var s=n.clientX-o.left,u=t(o,s);_e.rangeOneValue=a(u,_e),_e.rangeOneValue=Math.min(_e.rangeOneValue,_e.rangeTwoValue),_e.emit("nile-button-first-change",{value:_e.rangeOneValue}),_e.rangeTwoValue>_e.rangeOneValue&&(_e.buttonOne.style.left="".concat(u,"%"));}),_export("b",s=function s(n,o,e){var s=n.clientX-o.left,u=t(o,s);e.rangeTwoValue=a(u,e),e.rangeTwoValue=Math.max(e.rangeTwoValue,e.rangeOneValue),e.emit("nile-button-last-change",{value:e.rangeTwoValue}),e.rangeTwoValue>e.rangeOneValue&&(e.buttonTwo.style.left="".concat(u,"%"));}),_export("g",u=function u(t){var _t$buttonOne,_t$buttonTwo;t.range=t.renderRoot.querySelector(".range"),t.buttonOne=t.renderRoot.querySelector(".range-button"),t.buttonTwo=t.renderRoot.querySelector(".range-button-two"),t.completed=t.renderRoot.querySelector(".range-completed"),t.range.addEventListener("mousedown",t.onMouseDown),(_t$buttonOne=t.buttonOne)!==null&&_t$buttonOne!==void 0&&_t$buttonOne.addEventListener("mousedown",function(){t.activeThumb="one",h(t);}),(_t$buttonTwo=t.buttonTwo)===null||_t$buttonTwo===void 0?void 0:_t$buttonTwo.addEventListener("mousedown",function(){t.activeThumb="two",h(t);});}),_export("c",h=function h(t){window.addEventListener("mousemove",t.onMouseMove),window.addEventListener("mouseup",t.onMouseUp);}),_export("r",c=function c(t){window.removeEventListener("mousemove",t.onMouseMove),window.removeEventListener("mouseup",t.onMouseUp);}),_export("d",l=function l(t,a){if(Math.abs(t-a.rangeOneValue)<=Math.abs(t-a.rangeTwoValue)){var _n=Math.min(t,a.rangeTwoValue);a.rangeOneValue=a.checkValueValidity(_n,a.minValue,a.maxValue);}else{var _n2=Math.max(t,a.rangeOneValue);a.rangeTwoValue=a.checkValueValidity(_n2,a.minValue,a.maxValue);}var o=n(a.rangeOneValue,a),e=n(a.rangeTwoValue,a);a.buttonOne.style.left="".concat(o,"%"),a.buttonTwo.style.left="".concat(e,"%");var s=Math.min(o,e),u=Math.abs(e-o);a.completed.style.left="".concat(s,"%"),a.completed.style.width="".concat(u,"%"),a.emit("nile-button-first-change",{value:a.rangeOneValue}),a.emit("nile-button-last-change",{value:a.rangeTwoValue});});}};});
|
2
|
+
//# sourceMappingURL=nile-slider.utils.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-slider.utils.cjs.js","sources":["../../../../src/nile-slider/utils/nile-slider.utils.ts"],"sourcesContent":["import NileSlider from '../nile-slider';\nimport { NileSliderEvents } from '../types/nile-slider.enums';\n\nexport const getClampedPercent = (\n rect: DOMRect,\n x: number,\n): number => {\n const clampedX = Math.max(0, Math.min(x, rect.width)); \n const percent = (clampedX / rect.width) * 100;\n return percent;\n};\n\nexport const percentToValue = (percent: number, nileSlider: NileSlider): number => {\n const value = nileSlider.minValue + (percent / 100) * (nileSlider.maxValue - nileSlider.minValue);\n if(nileSlider.maxValue - nileSlider.minValue < 1) {\n return parseFloat(value.toFixed(2));\n } else {\n return Math.floor(value);\n }\n};\n\nexport const valueToPercent = (value: number, nileSlider: NileSlider): number => {\n return ((value - nileSlider.minValue) / (nileSlider.maxValue - nileSlider.minValue)) * 100;\n};\n\nexport const handleSingleSlider = (\n e: MouseEvent,\n rect: DOMRect,\n nileSlider: NileSlider\n): void => {\n const x = e.clientX - rect.left;\n const percent = getClampedPercent(rect, x);\n nileSlider.value = percentToValue(percent, nileSlider);\n nileSlider.emit(NileSliderEvents.NILE_CHANGE, { value: nileSlider.value });\n nileSlider.buttonOne.style.left = `${percent}%`;\n nileSlider.completed.style.width = `${percent}%`;\n};\n\nexport const handleRangeOne = (\n e: MouseEvent,\n rect: DOMRect,\n nileSlider: NileSlider\n): void => {\n const x = e.clientX - rect.left;\n const percent = getClampedPercent(rect, x);\n nileSlider.rangeOneValue = percentToValue(percent, nileSlider);\n nileSlider.rangeOneValue = Math.min(nileSlider.rangeOneValue, nileSlider.rangeTwoValue);\n nileSlider.emit(NileSliderEvents.NILE_BUTTON_FIRST_CHANGE, {\n value: nileSlider.rangeOneValue,\n });\n if (nileSlider.rangeTwoValue > nileSlider.rangeOneValue) {\n nileSlider.buttonOne.style.left = `${percent}%`;\n }\n};\n\nexport const handleRangeTwo = (\n e: MouseEvent,\n rect: DOMRect,\n nileSlider: NileSlider\n): void => {\n const x = e.clientX - rect.left;\n const percent = getClampedPercent(rect, x);\n nileSlider.rangeTwoValue = percentToValue(percent, nileSlider);\n nileSlider.rangeTwoValue = Math.max(nileSlider.rangeTwoValue, nileSlider.rangeOneValue);\n nileSlider.emit(NileSliderEvents.NILE_BUTTON_LAST_CHANGE, {\n value: nileSlider.rangeTwoValue,\n });\n\n if (nileSlider.rangeTwoValue > nileSlider.rangeOneValue) {\n nileSlider.buttonTwo.style.left = `${percent}%`;\n }\n};\n\nexport const getHtmlElements = (nileSlider: NileSlider) => {\n nileSlider.range = nileSlider.renderRoot.querySelector('.range') as HTMLElement;\n nileSlider.buttonOne = nileSlider.renderRoot.querySelector('.range-button') as HTMLElement;\n nileSlider.buttonTwo = nileSlider.renderRoot.querySelector('.range-button-two') as HTMLElement;\n nileSlider.completed = nileSlider.renderRoot.querySelector('.range-completed') as HTMLElement;\n\n nileSlider.range.addEventListener('mousedown', nileSlider.onMouseDown);\n\n nileSlider.buttonOne?.addEventListener('mousedown', () => {\n nileSlider.activeThumb = 'one';\n addMoveListeners(nileSlider);\n });\n\n nileSlider.buttonTwo?.addEventListener('mousedown', () => {\n nileSlider.activeThumb = 'two';\n addMoveListeners(nileSlider);\n });\n};\n\nexport const addMoveListeners = (nileSlider: NileSlider): void => {\n window.addEventListener('mousemove', nileSlider.onMouseMove);\n window.addEventListener('mouseup', nileSlider.onMouseUp);\n};\n\nexport const removeMoveListeners = (nileSlider: NileSlider): void => {\n window.removeEventListener('mousemove', nileSlider.onMouseMove);\n window.removeEventListener('mouseup', nileSlider.onMouseUp);\n};\n\nexport const handleTwoThumbClick = (\n value: number,\n nileSlider: NileSlider\n): void => {\n const distToOne = Math.abs(value - nileSlider.rangeOneValue);\n const distToTwo = Math.abs(value - nileSlider.rangeTwoValue);\n\n if (distToOne <= distToTwo) {\n const clamped = Math.min(value, nileSlider.rangeTwoValue);\n nileSlider.rangeOneValue = nileSlider.checkValueValidity(clamped, nileSlider.minValue, nileSlider.maxValue);\n } else {\n const clamped = Math.max(value, nileSlider.rangeOneValue);\n nileSlider.rangeTwoValue = nileSlider.checkValueValidity(clamped, nileSlider.minValue, nileSlider.maxValue);\n } \n\n const percentOne = valueToPercent(nileSlider.rangeOneValue, nileSlider);\n const percentTwo = valueToPercent(nileSlider.rangeTwoValue, nileSlider);\n\n nileSlider.buttonOne.style.left = `${percentOne}%`;\n nileSlider.buttonTwo.style.left = `${percentTwo}%`;\n\n const left = Math.min(percentOne, percentTwo);\n const width = Math.abs(percentTwo - percentOne);\n\n nileSlider.completed.style.left = `${left}%`;\n nileSlider.completed.style.width = `${width}%`;\n\n nileSlider.emit(NileSliderEvents.NILE_BUTTON_FIRST_CHANGE, {\n value: nileSlider.rangeOneValue,\n });\n nileSlider.emit(NileSliderEvents.NILE_BUTTON_LAST_CHANGE, {\n value: nileSlider.rangeTwoValue,\n });\n};\n"],"names":["getClampedPercent","rect","x","Math","max","min","width","percentToValue","percent","nileSlider","value","minValue","maxValue","parseFloat","toFixed","floor","_export","valueToPercent","handleSingleSlider","e","clientX","left","emit","buttonOne","style","completed","concat","handleRangeOne","rangeOneValue","rangeTwoValue","handleRangeTwo","buttonTwo","getHtmlElements","range","renderRoot","querySelector","addEventListener","onMouseDown","activeThumb","addMoveListeners","window","onMouseMove","onMouseUp","removeMoveListeners","removeEventListener","handleTwoThumbClick","abs","clamped","checkValueValidity","percentOne","percentTwo"],"mappings":"gIAGaA,CAAAA,CAAoB,QAApBA,CAAAA,CAAAA,CACXC,EACAC,CAAAA,CAAAA,QAEiBC,CAAAA,KAAKC,GAAI,CAAA,CAAA,CAAGD,KAAKE,GAAIH,CAAAA,CAAAA,CAAGD,GAAKK,KAClBL,CAAAA,CAAAA,CAAAA,EAAAA,CAAKK,MAAS,GAI/BC,GAAAA,CAAAA,CAAiB,QAAjBA,CAAAA,CAAAA,CAAkBC,CAAiBC,CAAAA,EAAAA,CAAAA,CAC9C,GAAMC,CAAAA,CAAQD,CAAAA,E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pBnB,EAAWa,IAA+C,CAAA,yBAAA,CAAA,CACxDZ,KAAOD,CAAAA,CAAAA,CAAWoB,eAClB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
const t=(t,a)=>Math.max(0,Math.min(a,t.width))/t.width*100,a=(t,a)=>{const n=a.minValue+t/100*(a.maxValue-a.minValue);return a.maxValue-a.minValue<1?parseFloat(n.toFixed(2)):Math.floor(n)},n=(t,a)=>(t-a.minValue)/(a.maxValue-a.minValue)*100,o=(n,o,e)=>{const s=n.clientX-o.left,u=t(o,s);e.value=a(u,e),e.emit("nile-change",{value:e.value}),e.buttonOne.style.left=`${u}%`,e.completed.style.width=`${u}%`},e=(n,o,e)=>{const s=n.clientX-o.left,u=t(o,s);e.rangeOneValue=a(u,e),e.rangeOneValue=Math.min(e.rangeOneValue,e.rangeTwoValue),e.emit("nile-button-first-change",{value:e.rangeOneValue}),e.rangeTwoValue>e.rangeOneValue&&(e.buttonOne.style.left=`${u}%`)},s=(n,o,e)=>{const s=n.clientX-o.left,u=t(o,s);e.rangeTwoValue=a(u,e),e.rangeTwoValue=Math.max(e.rangeTwoValue,e.rangeOneValue),e.emit("nile-button-last-change",{value:e.rangeTwoValue}),e.rangeTwoValue>e.rangeOneValue&&(e.buttonTwo.style.left=`${u}%`)},u=t=>{t.range=t.renderRoot.querySelector(".range"),t.buttonOne=t.renderRoot.querySelector(".range-button"),t.buttonTwo=t.renderRoot.querySelector(".range-button-two"),t.completed=t.renderRoot.querySelector(".range-completed"),t.range.addEventListener("mousedown",t.onMouseDown),t.buttonOne?.addEventListener("mousedown",(()=>{t.activeThumb="one",h(t)})),t.buttonTwo?.addEventListener("mousedown",(()=>{t.activeThumb="two",h(t)}))},h=t=>{window.addEventListener("mousemove",t.onMouseMove),window.addEventListener("mouseup",t.onMouseUp)},c=t=>{window.removeEventListener("mousemove",t.onMouseMove),window.removeEventListener("mouseup",t.onMouseUp)},l=(t,a)=>{if(Math.abs(t-a.rangeOneValue)<=Math.abs(t-a.rangeTwoValue)){const n=Math.min(t,a.rangeTwoValue);a.rangeOneValue=a.checkValueValidity(n,a.minValue,a.maxValue)}else{const n=Math.max(t,a.rangeOneValue);a.rangeTwoValue=a.checkValueValidity(n,a.minValue,a.maxValue)}const o=n(a.rangeOneValue,a),e=n(a.rangeTwoValue,a);a.buttonOne.style.left=`${o}%`,a.buttonTwo.style.left=`${e}%`;const s=Math.min(o,e),u=Math.abs(e-o);a.completed.style.left=`${s}%`,a.completed.style.width=`${u}%`,a.emit("nile-button-first-change",{value:a.rangeOneValue}),a.emit("nile-button-last-change",{value:a.rangeTwoValue})};export{e as a,s as b,h as c,l as d,u as g,o as h,c as r,n as v};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table-body.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport {\n customElement,\n query,\n state,\n queryAll,\n queryAssignedElements,\n queryAssignedNodes,\n property\n} from 'lit/decorators.js';\nimport { styles } from './nile-table-body.css';\nimport NileElement from '../internal/nile-element';\nimport { getInnerHTML } from '../slot';\nimport { hasResizableColumns } from '../internal/resizable-table-helper';\n\n/**\n * nile-table-body component.\n *\n * @tag nile-table-body\n *\n */\n@customElement('nile-table-body')\nexport class NileTableBody extends NileElement {\n /**\n * The styles for TableBody\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n @query('slot') defaultSlot: HTMLSlotElement;\n @queryAssignedNodes({ flatten: true }) _childNodes!: Array<HTMLElement>;\n @property() type: 'primary' | 'secondary' = 'primary';\n\n @state() private rows_data: any[] = [];\n @state() private header_rows_data: any[] = [];\n @state() private sort__index: number;\n @state() private search__index: number;\n @state() private hasResizableColumns = false;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n this.emit('nile-body-load', { value: this.type, comp:this },true,false)\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n private getChildren(child: any, tagname: string) {\n return child.querySelectorAll(tagname);\n }\n\n private getIndexValue(index__value: string): number {\n return this.header_rows_data.indexOf(index__value);\n }\n\n private checkForResizableColumns() {\n this.hasResizableColumns = hasResizableColumns(this);\n }\n\n handleSlotchange(e: any) {\n let row_data: any = [];\n this._childNodes.forEach((child: any) => {\n if (child.tagName && child?.tagName?.toLowerCase() === 'nile-table-row') {\n let nilerows = this.getChildren(child, 'nile-table-cell-item');\n if (nilerows.length > 0) {\n nilerows.forEach((element: { innerHTML: any }) => {\n row_data.push(element.innerHTML);\n });\n this.rows_data.push(row_data);\n } else {\n let nileheaders = this.getChildren(child, 'nile-table-header-item');\n if (nileheaders.length > 0) {\n nileheaders.forEach((header: HTMLSlotElement, index: number) => {\n this.header_rows_data.push(header.innerHTML);\n });\n }\n }\n row_data = [];\n }\n });\n \n
|
1
|
+
{"version":3,"file":"nile-table-body.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport {\n customElement,\n query,\n state,\n queryAll,\n queryAssignedElements,\n queryAssignedNodes,\n property\n} from 'lit/decorators.js';\nimport { styles } from './nile-table-body.css';\nimport NileElement from '../internal/nile-element';\nimport { getInnerHTML } from '../slot';\nimport { hasResizableColumns } from '../internal/resizable-table-helper';\n\n/**\n * nile-table-body component.\n *\n * @tag nile-table-body\n *\n */\n@customElement('nile-table-body')\nexport class NileTableBody extends NileElement {\n /**\n * The styles for TableBody\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n @query('slot') defaultSlot: HTMLSlotElement;\n @queryAssignedNodes({ flatten: true }) _childNodes!: Array<HTMLElement>;\n @property() type: 'primary' | 'secondary' = 'primary';\n\n @state() private rows_data: any[] = [];\n @state() private header_rows_data: any[] = [];\n @state() private sort__index: number;\n @state() private search__index: number;\n @state() private hasResizableColumns = false;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n this.emit('nile-body-load', { value: this.type, comp:this },true,false)\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n private getChildren(child: any, tagname: string) {\n return child.querySelectorAll(tagname);\n }\n\n private getIndexValue(index__value: string): number {\n return this.header_rows_data.indexOf(index__value);\n }\n\n private checkForResizableColumns() {\n this.hasResizableColumns = hasResizableColumns(this);\n }\n\n handleSlotchange(e: any) {\n let row_data: any = [];\n this._childNodes.forEach((child: any) => {\n if (child.tagName && child?.tagName?.toLowerCase() === 'nile-table-row') {\n let nilerows = this.getChildren(child, 'nile-table-cell-item');\n if (nilerows.length > 0) {\n nilerows.forEach((element: { innerHTML: any }) => {\n row_data.push(element.innerHTML);\n });\n this.rows_data.push(row_data);\n } else {\n let nileheaders = this.getChildren(child, 'nile-table-header-item');\n if (nileheaders.length > 0) {\n nileheaders.forEach((header: HTMLSlotElement, index: number) => {\n this.header_rows_data.push(header.innerHTML);\n });\n }\n }\n row_data = [];\n }\n });\n \n this.checkForResizableColumns();\n }\n\n private handleSort(e: any) {\n const { curr_sort_string, order } = e.detail.value;\n const header_index = this.getIndexValue(curr_sort_string);\n this.emit('nile-sort', {\n value: { header_index, curr_sort_string, order },\n });\n }\n\n private handleSearch(e: any) {\n const searchText = e.detail.value;\n this.search__index = this.getIndexValue(e.target.textContent);\n this.emit('nile-table-search', {\n index: this.search__index,\n value: searchText,\n });\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"base\" part=\"base\">\n <slot name=\"table__header\" class=\"table__header\"></slot>\n <slot\n @slotchange=${this.handleSlotchange}\n @nile-click-sort=${this.handleSort}\n class=\"nile__table__body\"\n ?resizable=${this.hasResizableColumns}\n @nile-search=${this.handleSearch}\n ></slot>\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileTableBody;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-table-body': NileTableBody;\n }\n}\n"],"names":["NileTableBody","d","constructor","this","type","rows_data","header_rows_data","hasResizableColumns","_this","_inherits","_h","_createClass","key","value","firstUpdated","_changedProperties","emit","comp","getChildren","child","tagname","querySelectorAll","getIndexValue","index__value","indexOf","checkForResizableColumns","handleSlotchange","e","_this2","row_data","_childNodes","forEach","tagName","toLowerCase","nilerows","length","element","push","innerHTML","nileheaders","header","index","handleSort","_e$detail$value","detail","header_index","curr_sort_string","order","s","handleSearch","searchText","search__index","target","textContent","render","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","query","prototype","queryAssignedNodes","flatten","property","state","_export","customElement"],"mappings":"k8GAmCaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAQOC,KAAAA,CAAIC,IAA4B,CAAA,SAAA,CAE3BD,KAAAA,CAASE,SAAU,CAAA,EAAA,CACnBF,KAAAA,CAAgBG,gBAAU,CAAA,EAAA,CAG1BH,KAAAA,CAAmBI,mBAAAA,CAAAA,CAAG,CAoFxC,QAAAC,KAAA,EAlFQC,SAAA,CAAAR,CAAA,CAAAS,EAAA,SAAAC,YAAA,CAAAV,CAAA,GAAAW,GAAA,gBAAAC,KAAA,CAIG,SAAAC,YAAAA,CAAaC,CAAAA,CAAAA,CACrBZ,IAAKa,CAAAA,IAAAA,CAAK,gBAAkB,CAAA,CAAEH,MAAOV,IAAKC,CAAAA,IAAAA,CAAMa,KAAKd,IAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAClE,EAMO,GAAAS,GAAA,eAAAC,KAAA,UAAAK,WAAAA,CAAYC,CAAAA,CAAYC,CAC9B,CAAA,CAAA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AA,CAAdC,CAAM,CAAA,MAAA,CAAA,CAAA,CAAqC9D,CAAA+D,CAAAA,SAAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,CACLF,CAAA,CAAA,CAAtCG,CAAmB,CAAA,CAAEC,SAAS,CAAyCjE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+D,SAAA,CAAA,aAAA,CAAA,IAAA,EAC5DF,CAAAA,CAAAA,CAAAA,CAAA,CAAXK,CAAAA,CAAAA,CAAAA,CAAAA,CAAqDlE,CAAA+D,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAErCF,CAAA,CAAA,CAAhBM,CAAsCnE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+D,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CACtBF,CAAA,CAAA,CAAhBM,CAA6CnE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+D,SAAA,CAAA,kBAAA,CAAA,IAAA,EAC7BF,CAAAA,CAAAA,CAAAA,CAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAAoCnE,CAAA+D,CAAAA,SAAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,CACpBF,EAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAAsCnE,CAAA+D,CAAAA,SAAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CACtBF,CAAA,CAAA,CAAhBM,KAA4CnE,CAAA+D,CAAAA,SAAAA,CAAA,qBAAA,CAAA,IAAA,EAAA,CAAA,CAAAK,OAAA,KAdlCpE,CAAa6D,CAAAA,CAAAA,CAAA,CADzBQ,CAAAA,CAAc,oBACFrE"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,
|
1
|
+
System.register(["lit","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var o,e,_templateObject,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;},function(_internalResizableTableStylesCjsJs){e=_internalResizableTableStylesCjsJs.t;}],execute:function execute(){_export("s",l=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n\n ","\n"])),e));}};});
|
2
2
|
//# sourceMappingURL=nile-table-body.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table-body.css.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { tableLayoutStyles } from '../internal/resizable-table-styles';\n\n/**\n * TableBody CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n\n
|
1
|
+
{"version":3,"file":"nile-table-body.css.cjs.js","sources":["../../../src/nile-table-body/nile-table-body.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { tableLayoutStyles } from '../internal/resizable-table-styles';\n\n/**\n * TableBody CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n --nile-table-background--odd: var(--nile-colors-base-white);\n --nile-table-background--even: var(--nile-colors-base-white);\n }\n\n .base {\n background-color: var(--nile-colors-white-base);\n border: 1px solid var(--nile-table-row-border-color);\n border-radius: var(--nile-radius-radius-xl);\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1),0px 1px 2px 0px rgba(16, 24, 40, 0.06);\n overflow: hidden;\n }\n\n .table__header {\n display: flex;\n box-sizing: border-box;\n }\n\n .nile__table__body {\n display: table;\n border-collapse: collapse;\n width: 100%;\n }\n\n slot::slotted(nile-table-row:nth-child(odd)) {\n border-bottom: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-table-background--odd);\n }\n\n slot::slotted(nile-table-row:nth-child(even)) {\n background: var(--nile-table-background--even);\n }\n\n slot::slotted(nile-table-row:last-child) {\n border-bottom: 0px;\n }\n\n ${tableLayoutStyles}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral","tableLayoutStyles"],"mappings":"wbAaaA,EAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,0gCAuCrBC,CAAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,
|
1
|
+
System.register(["lit","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var i,e,l,t,_templateObject,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){i=_lit.css;},function(_internalResizableTableStylesCjsJs){e=_internalResizableTableStylesCjsJs.r;l=_internalResizableTableStylesCjsJs.a;t=_internalResizableTableStylesCjsJs.b;}],execute:function execute(){_export("s",a=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n padding: 16px 24px;\n max-width: var(--max--cell-width); \n min-height: var(--min--height);\n }\n\n .cell__wrapper {\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n ","\n ","\n ","\n"])),e,l,t));}};});
|
2
2
|
//# sourceMappingURL=nile-table-cell-item.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-table-cell-item.css.cjs.js","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { resizableHostStyles, resizerStyles, resizableSlotStyles } from '../internal/resizable-table-styles';\n\n/**\n * TableCellItem CSS\n */\nexport const styles = css`\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n padding: 16px 24px;\n max-width: var(--max--cell-width); \n min-height: var(--min--height);\n }\n\n .cell__wrapper {\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n
|
1
|
+
{"version":3,"file":"nile-table-cell-item.css.cjs.js","sources":["../../../src/nile-table-cell-item/nile-table-cell-item.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { resizableHostStyles, resizerStyles, resizableSlotStyles } from '../internal/resizable-table-styles';\n\n/**\n * TableCellItem CSS\n */\nexport const styles = css`\n :host {\n --min-cell-width:auto;\n --cell-width:auto;\n --min--height: 52px;\n --max--cell-width: auto;\n box-sizing: border-box;\n display: table-cell;\n vertical-align: middle;\n padding: 16px 24px;\n max-width: var(--max--cell-width); \n min-height: var(--min--height);\n }\n\n .cell__wrapper {\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n }\n\n .column {\n min-width:var(--min-cell-width);\n width:var(--cell-width);\n height: 100%;\n color: var(--nile-colors-gray-light-mode-600);\n font-family: var(--nile-font-family-serif);\n font-size: var(--nile-type-scale-3);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n /* line-height: var(--nile-type-scale-6); */\n line-height: normal;\n letter-spacing: 0.2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n\n ${resizableHostStyles}\n ${resizerStyles}\n ${resizableSlotStyles}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral","resizableHostStyles","resizerStyles","resizableSlotStyles"],"mappings":"0gBAaaA,EAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,ygCAyCrBC,CAAAA,CACAC,CAAAA,CACAC,CAAAA"}
|
@@ -1,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","../internal/resizable-table-helper.cjs.js","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,i,t,l,
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-table-header-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../internal/resizable-table-helper.cjs.js","../internal/resizable-table-styles.cjs.js"],function(_export,_context){"use strict";var e,i,t,s,l,r,n,o,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;s=_litDecoratorsJs.state;l=_litDecoratorsJs.customElement;},function(_nileTableHeaderItemCssCjsJs){r=_nileTableHeaderItemCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){o=_internalSlotCjsJs.H;},function(_internalResizableTableHelperCjsJs){a=_internalResizableTableHelperCjsJs.c;},function(_internalResizableTableStylesCjsJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_n){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new o(_assertThisInitialized(_this),"[default]"),_this.havesort=!1,_this.havefilter=!1,_this.iconName="",_this.resizable=!1,_this.sorting_ct=0,_this.handleResizeStart=a(_assertThisInitialized(_this),50);return _this;}_inherits(c,_n);return _createClass(c,[{key:"handleSort",value:function handleSort(e){this.sorting_ct++;var i=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:i,order:["normal","asc","des"][this.sorting_ct%3]}});}},{key:"handleSearch",value:function handleSearch(e){this.emit("nile-search",{value:e.detail.value});}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"header__item__wrapper\" part=\"nile__table-header-cell\">\n <div class=\"headers\">\n <slot> </slot>\n ","\n ","\n ","\n ","\n ","\n </div>\n ","\n </div>"])),this.havesort&&this.sorting_ct%3==0?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=","\n class=\"hover__arrow\"\n ></nile-icon>"])),this.handleSort):null,this.havesort&&this.sorting_ct%3==1?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-icon\n name=\"sortdown\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.havesort&&this.sorting_ct%3==2?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-icon\n name=\"sortup\"\n size=\"16\"\n @click=","\n ></nile-icon>"])),this.handleSort):null,this.iconName?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral([" <nile-icon name=\"","\" size=\"16\"></nile-icon>"])),this.iconName):i(_templateObject6||(_templateObject6=_taggedTemplateLiteral([""]))),this.havefilter?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral([" <nile-popover title=\"Filter\" placement=\"bottom\">\n <nile-icon name=\"filter\" size=\"16\" slot=\"anchor\"></nile-icon>\n <nile-input\n placeholder=\"Search\"\n @nile-input=","\n part=\"filter__search\"\n ></nile-input>\n <slot name=\"filter__content\" part=\"filter__content\"></slot>\n </nile-popover>"])),this.handleSearch):i(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""]))),this.resizable?i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<div class=\"resizer\" @mousedown=","></div>"])),this.handleResizeStart):null);}}],[{key:"styles",get:function get(){return[r];}}]);}(n));e([t({type:Boolean,reflect:!0})],c.prototype,"havesort",void 0),e([t({type:Boolean,reflect:!0})],c.prototype,"havefilter",void 0),e([t({type:String,reflect:!0,attribute:"icon-name"})],c.prototype,"iconName",void 0),e([t({type:Boolean,reflect:!0})],c.prototype,"resizable",void 0),e([s()],c.prototype,"sorting_ct",void 0),_export("N",c=e([l("nile-table-header-item")],c));}};});
|
2
2
|
//# sourceMappingURL=nile-table-header-item.cjs.js.map
|