@aquera/nile-elements 0.1.35-beta-1.8 → 0.1.35-beta-2.0
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 +12 -0
- package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +38 -15
- package/dist/nile-filter-chip/nile-filter-chip.esm.js +15 -6
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +12 -12
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js +38 -15
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +3 -2
- package/dist/src/nile-filter-chip/nile-filter-chip.js +21 -8
- package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +7 -7
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-filter-chip/nile-filter-chip.css.ts +38 -15
- package/src/nile-filter-chip/nile-filter-chip.test.ts +7 -7
- package/src/nile-filter-chip/nile-filter-chip.ts +18 -7
- package/vscode-html-custom-data.json +10 -5
package/README.md
CHANGED
@@ -79,6 +79,18 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
79
79
|
|
80
80
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
81
81
|
|
82
|
+
#### Version 0.1.35-beta-2.0
|
83
|
+
- Nile Badge: UIF-697 code revert
|
84
|
+
|
85
|
+
#### Version 0.1.35-beta-1.11
|
86
|
+
- Nile Badge: UIF-697 nile badge content slot not working
|
87
|
+
|
88
|
+
#### Version 0.1.35-beta-1.10
|
89
|
+
- Nile Filter-Chip: UIF-516 filterchipdefectfix
|
90
|
+
|
91
|
+
#### Version 0.1.35-beta-1.9
|
92
|
+
- Nile Badge: UIF-697 nile badge content slot not working
|
93
|
+
|
82
94
|
#### Version 0.1.35-beta-1.8
|
83
95
|
- Nile Icon : Icon Cleanup
|
84
96
|
- Dependency Nile version 0.3.62-beta-1.6
|
@@ -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","../internal/nile-element.cjs.js","./nile-filter-chip.css.cjs.js"],function(_export,_context){"use strict";var t,e,s,i,l,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_o,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 _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){e=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;i=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_nileFilterChipCssCjsJs){n=_nileFilterChipCssCjsJs.s;}],execute:function execute(){_export("N",a=_o=/*#__PURE__*/function(_l){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.label="",_this.text="",_this.
|
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","../internal/nile-element.cjs.js","./nile-filter-chip.css.cjs.js"],function(_export,_context){"use strict";var t,e,s,i,l,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_o,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 _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){e=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;i=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_nileFilterChipCssCjsJs){n=_nileFilterChipCssCjsJs.s;}],execute:function execute(){_export("N",a=_o=/*#__PURE__*/function(_l){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.label="",_this.text="",_this.viewMoreCount=0,_this.editable=!1,_this.closable=!1,_this.icon="",_this.removeIcon="",_this.active=!1;return _this;}_inherits(o,_l);return _createClass(o,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(o,"connectedCallback",this,3)([]),this.registerChip();}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(o,"disconnectedCallback",this,3)([]),this.unregisterChip();}},{key:"registerChip",value:function registerChip(){_o.activeChips.push(this);}},{key:"unregisterChip",value:function unregisterChip(){var _this2=this;_o.activeChips=_o.activeChips.filter(function(t){return t!==_this2;});}},{key:"handleClose",value:function handleClose(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{text:this.text,viewMoreCount:this.viewMoreCount}})),this.remove();}},{key:"handleClick",value:function handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{text:this.text,viewMoreCount:this.viewMoreCount}}));}},{key:"getLabelSlot",value:function getLabelSlot(){return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <span class=\"label-wrapper\">\n <slot name=\"label\">\n <span class=\"label\">",":</span>\n </slot>\n </span>\n\n "])),this.label);}},{key:"getValueSlot",value:function getValueSlot(){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <span class=\"value-wrapper\">\n <slot name=\"value\">\n <span class=\"value\">","</span>\n </slot>\n </span>\n\n "])),this.text);}},{key:"getviewMoreCountSlot",value:function getviewMoreCountSlot(){return e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <slot name=\"suffix\">\n ","\n </slot>\n "])),this.viewMoreCount?e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <span class=\"badge-wrapper\">\n <nile-badge variant=\"primary\" pilltype=\"pill-color\">\n +","\n </nile-badge>\n </span>\n\n "])),this.viewMoreCount):e(_templateObject5||(_templateObject5=_taggedTemplateLiteral([""]))));}},{key:"getCloseIconSlot",value:function getCloseIconSlot(){return e(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n ","\n "])),this.closable?e(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <span class=\"close-icon\" @click=\"","\">\n <nile-icon name=\"","\" size=\"12\"></nile-icon>\n </span>\n "])),this.handleClose,this.removeIcon||"close"):e(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""]))));}},{key:"render",value:function render(){return e(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div class=\"chip\" @click=\"","\">\n <slot name=\"icon\">\n ","\n </slot>\n ","\n <slot name=\"content\"></slot>\n ","\n ","\n ","\n </div>\n "])),this.handleClick,this.icon?e(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<span class=\"icon\">","</span>"])),this.icon):e(_templateObject11||(_templateObject11=_taggedTemplateLiteral([""]))),this.getLabelSlot(),this.getValueSlot(),this.getviewMoreCountSlot(),this.getCloseIconSlot());}}],[{key:"styles",get:function get(){return[n];}}]);}(l));a.activeChips=[],t([s({type:String})],a.prototype,"label",void 0),t([s({type:String})],a.prototype,"text",void 0),t([s({type:Number})],a.prototype,"viewMoreCount",void 0),t([s({type:Boolean})],a.prototype,"editable",void 0),t([s({type:Boolean})],a.prototype,"closable",void 0),t([s({type:String})],a.prototype,"icon",void 0),t([s({type:String})],a.prototype,"removeIcon",void 0),t([s({type:Boolean,reflect:!0})],a.prototype,"active",void 0),_export("N",a=_o=t([i("nile-filter-chip")],a));}};});
|
2
2
|
//# sourceMappingURL=nile-filter-chip.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-filter-chip.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.ts"],"sourcesContent":["import { LitElement, html, css, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport { styles } from './nile-filter-chip.css';\n\n/**\n * Nile filter-chip component.\n *\n * @tag nile-filter-chip\n */\n@customElement('nile-filter-chip')\nexport class NileFilterChip extends NileElement {\n @property({ type: String }) label = '';\n @property({ type: String }) text = '';\n @property({ type: Number })
|
1
|
+
{"version":3,"file":"nile-filter-chip.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.ts"],"sourcesContent":["import { LitElement, html, css, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport { styles } from './nile-filter-chip.css';\n\n/**\n * Nile filter-chip component.\n *\n * @tag nile-filter-chip\n */\n@customElement('nile-filter-chip')\nexport class NileFilterChip extends NileElement {\n @property({ type: String }) label = '';\n @property({ type: String }) text = '';\n @property({ type: Number }) viewMoreCount: number = 0;\n @property({ type: Boolean }) editable = false;\n @property({ type: Boolean }) closable = false;\n @property({ type: String }) icon = '';\n @property({ type: String }) removeIcon = '';\n @property({ type: Boolean, reflect: true }) active = false;\n\n\n private static activeChips: NileFilterChip[] = [];\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.registerChip();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.unregisterChip();\n }\n\n private registerChip() {\n NileFilterChip.activeChips.push(this);\n }\n\n private unregisterChip() {\n NileFilterChip.activeChips = NileFilterChip.activeChips.filter(\n (chip) => chip !== this\n );\n }\n\n private handleClose(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(\n new CustomEvent('nile-close', { detail: { text: this.text, viewMoreCount: this.viewMoreCount } })\n );\n this.remove();\n }\n\n private handleClick() {\n this.dispatchEvent(\n new CustomEvent('nile-click', { detail: { text: this.text, viewMoreCount: this.viewMoreCount } })\n );\n }\n\n private getLabelSlot(): TemplateResult {\n return html`\n <span class=\"label-wrapper\">\n <slot name=\"label\">\n <span class=\"label\">${this.label}:</span>\n </slot>\n </span>\n\n `;\n }\n\n private getValueSlot(): TemplateResult {\n return html`\n <span class=\"value-wrapper\">\n <slot name=\"value\">\n <span class=\"value\">${this.text}</span>\n </slot>\n </span>\n\n `;\n }\n\n private getviewMoreCountSlot(): TemplateResult {\n return html`\n <slot name=\"suffix\">\n ${this.viewMoreCount\n ? html`\n <span class=\"badge-wrapper\">\n <nile-badge variant=\"primary\" pilltype=\"pill-color\">\n +${this.viewMoreCount}\n </nile-badge>\n </span>\n\n `\n : html``}\n </slot>\n `;\n }\n\n private getCloseIconSlot(): TemplateResult {\n return html`\n ${this.closable\n ? html`\n <span class=\"close-icon\" @click=\"${this.handleClose}\">\n <nile-icon name=\"${this.removeIcon || 'close'}\" size=\"12\"></nile-icon>\n </span>\n `\n : html``}\n `;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"chip\" @click=\"${this.handleClick}\">\n <slot name=\"icon\">\n ${this.icon ? html`<span class=\"icon\">${this.icon}</span>` : html``}\n </slot>\n ${this.getLabelSlot()}\n <slot name=\"content\"></slot>\n ${this.getValueSlot()}\n ${this.getviewMoreCountSlot()}\n ${this.getCloseIconSlot()}\n </div>\n `;\n }\n}\n\nexport default NileFilterChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-filter-chip': NileFilterChip;\n }\n}\n"],"names":["NileFilterChip","NileFilterChip_1","_l","o","this","label","text","viewMoreCount","editable","closable","icon","removeIcon","active","_this","_inherits","_createClass","key","value","connectedCallback","super","registerChip","disconnectedCallback","unregisterChip","activeChips","push","filter","chip","handleClose","event","stopPropagation","dispatchEvent","CustomEvent","detail","remove","handleClick","getLabelSlot","html","_templateObject","_taggedTemplateLiteral","getValueSlot","_templateObject2","getviewMoreCountSlot","_templateObject3","_templateObject4","_templateObject5","getCloseIconSlot","_templateObject6","_templateObject7","_templateObject8","render","_templateObject9","_templateObject10","_templateObject11","get","styles","NileElement","__decorate","property","type","String","prototype","Number","Boolean","reflect","customElement"],"mappings":"o0HAWaA,CAAAA,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AA3BC,CAAS,CAAA,CAAEC,KAAMG,MAAoC7D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4D,UAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CACzBJ,EAAA,CAA5BC,CAAAA,CAAS,CAAEC,IAAMI,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAA4B9D,EAAA4D,SAAA,CAAA,UAAA,CAAA,IAAA,IACjBJ,CAAA,CAAA,CAA5BC,EAAS,CAAEC,IAAAA,CAAMI,WAA4B9D,CAAA4D,CAAAA,SAAAA,CAAA,eAAA,EAClBJ,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAS,CAAA,CAAEC,KAAMC,MAAoB3D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4D,UAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CACVJ,EAAA,CAA3BC,CAAAA,CAAS,CAAEC,IAAMC,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAA0B3D,EAAA4D,SAAA,CAAA,YAAA,CAAA,IAAA,IACAJ,CAAA,CAAA,CAA3CC,EAAS,CAAEC,IAAAA,CAAMI,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB/D,EAAA4D,SAAA,CAAA,QAAA,CAAA,IAAA,gBARhD5D,CAAcC,CAAAA,EAAAA,CAAAuD,EAAA,CAD1BQ,CAAAA,CAAc,qBACFhE"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,i;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",i=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n padding:
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,i;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",i=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default);\n color: var(--nile-filter-chip-text-default);\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background);\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background);\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background);\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default);\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default);\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default);\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default);\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background);\n color: var(--nile-filter-chip-close-icon-hover-color);\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-filter-chip.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-filter-chip.css.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.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 * FilterChip CSS\n */\n\nexport const styles = css`\n\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n padding:
|
1
|
+
{"version":3,"file":"nile-filter-chip.css.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.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 * FilterChip CSS\n */\n\nexport const styles = css`\n\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default);\n color: var(--nile-filter-chip-text-default);\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background);\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background);\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background);\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default);\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default);\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default);\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default);\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background);\n color: var(--nile-filter-chip-close-icon-hover-color);\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n`;\n\nexport default [styles];\n\n "],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAaaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -10,7 +10,8 @@ import{css as e}from"lit";const i=e`
|
|
10
10
|
.chip {
|
11
11
|
display: inline-flex;
|
12
12
|
align-items: center;
|
13
|
-
|
13
|
+
height: 30px;
|
14
|
+
padding: 8px;
|
14
15
|
border: 1px solid var(--nile-filter-chip-chip-border-color-stroke);
|
15
16
|
border-radius: 4px;
|
16
17
|
font-size: 14px;
|
@@ -18,18 +19,21 @@ import{css as e}from"lit";const i=e`
|
|
18
19
|
color: var(--nile-filter-chip-text-default);
|
19
20
|
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
|
20
21
|
cursor: pointer;
|
21
|
-
|
22
|
-
margin-right: 6px;
|
22
|
+
box-sizing: border-box;
|
23
23
|
}
|
24
24
|
|
25
25
|
.chip:hover {
|
26
26
|
background-color: var(--nile-filter-chip-hover-background);
|
27
27
|
}
|
28
|
+
.chip:active {
|
29
|
+
background-color: var(--nile-filter-chip-active-background);
|
30
|
+
border-color: var(--nile-filter-chip-active-border-color-stroke);
|
31
|
+
}
|
32
|
+
:host([active]) .chip {
|
33
|
+
background-color: var(--nile-filter-chip-active-background);
|
34
|
+
border-color: var(--nile-filter-chip-active-border-color-stroke);
|
35
|
+
}
|
28
36
|
|
29
|
-
.chip:active {
|
30
|
-
background-color: var(--nile-filter-chip-active-background);
|
31
|
-
border-color: var(--nile-filter-chip-active-border-color-stroke);
|
32
|
-
}
|
33
37
|
|
34
38
|
.icon {
|
35
39
|
color: var(--nile-filter-chip-icon-color-default);
|
@@ -73,20 +77,22 @@ import{css as e}from"lit";const i=e`
|
|
73
77
|
}
|
74
78
|
|
75
79
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
.value {
|
81
|
+
color: var(--nile-filter-chip-values-color-default);
|
82
|
+
display: inline-block;
|
83
|
+
overflow: hidden;
|
84
|
+
text-overflow: ellipsis;
|
85
|
+
white-space: nowrap;
|
86
|
+
max-width: 140px;
|
87
|
+
vertical-align: bottom;
|
88
|
+
}
|
89
|
+
|
83
90
|
|
84
91
|
.close-icon {
|
85
92
|
color: var(--nile-filter-chip-close-icon-color-default);
|
86
93
|
cursor: pointer;
|
87
94
|
display: flex;
|
88
95
|
align-items: center;
|
89
|
-
padding: 2px;
|
90
96
|
border-radius: 50%;
|
91
97
|
transition: background-color 0.2s;
|
92
98
|
}
|
@@ -95,4 +101,21 @@ import{css as e}from"lit";const i=e`
|
|
95
101
|
background-color: var(--nile-filter-chip-close-icon-hover-background);
|
96
102
|
color: var(--nile-filter-chip-close-icon-hover-color);
|
97
103
|
}
|
104
|
+
|
105
|
+
.label-wrapper {
|
106
|
+
margin-right: 4px;
|
107
|
+
}
|
108
|
+
|
109
|
+
::slotted([slot="icon"]) {
|
110
|
+
margin-right: 6px;
|
111
|
+
}
|
112
|
+
|
113
|
+
.value-wrapper {
|
114
|
+
margin-right: 4px;
|
115
|
+
}
|
116
|
+
|
117
|
+
.badge-wrapper {
|
118
|
+
margin-right: 12px;
|
119
|
+
}
|
120
|
+
|
98
121
|
`;export{i as s};
|
@@ -1,17 +1,26 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as s,customElement as i}from"lit/decorators.js";import{N as l}from"../internal/nile-element.esm.js";import{s as n}from"./nile-filter-chip.css.esm.js";var o;let a=o=class extends l{constructor(){super(...arguments),this.label="",this.text="",this.
|
1
|
+
import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as s,customElement as i}from"lit/decorators.js";import{N as l}from"../internal/nile-element.esm.js";import{s as n}from"./nile-filter-chip.css.esm.js";var o;let a=o=class extends l{constructor(){super(...arguments),this.label="",this.text="",this.viewMoreCount=0,this.editable=!1,this.closable=!1,this.icon="",this.removeIcon="",this.active=!1}static get styles(){return[n]}connectedCallback(){super.connectedCallback(),this.registerChip()}disconnectedCallback(){super.disconnectedCallback(),this.unregisterChip()}registerChip(){o.activeChips.push(this)}unregisterChip(){o.activeChips=o.activeChips.filter((t=>t!==this))}handleClose(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{text:this.text,viewMoreCount:this.viewMoreCount}})),this.remove()}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{text:this.text,viewMoreCount:this.viewMoreCount}}))}getLabelSlot(){return e`
|
2
|
+
<span class="label-wrapper">
|
2
3
|
<slot name="label">
|
3
4
|
<span class="label">${this.label}:</span>
|
4
5
|
</slot>
|
6
|
+
</span>
|
7
|
+
|
5
8
|
`}getValueSlot(){return e`
|
9
|
+
<span class="value-wrapper">
|
6
10
|
<slot name="value">
|
7
11
|
<span class="value">${this.text}</span>
|
8
12
|
</slot>
|
9
|
-
|
13
|
+
</span>
|
14
|
+
|
15
|
+
`}getviewMoreCountSlot(){return e`
|
10
16
|
<slot name="suffix">
|
11
|
-
${this.
|
17
|
+
${this.viewMoreCount?e`
|
18
|
+
<span class="badge-wrapper">
|
12
19
|
<nile-badge variant="primary" pilltype="pill-color">
|
13
|
-
+${this.
|
20
|
+
+${this.viewMoreCount}
|
14
21
|
</nile-badge>
|
22
|
+
</span>
|
23
|
+
|
15
24
|
`:e``}
|
16
25
|
</slot>
|
17
26
|
`}getCloseIconSlot(){return e`
|
@@ -28,7 +37,7 @@ import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as
|
|
28
37
|
${this.getLabelSlot()}
|
29
38
|
<slot name="content"></slot>
|
30
39
|
${this.getValueSlot()}
|
31
|
-
${this.
|
40
|
+
${this.getviewMoreCountSlot()}
|
32
41
|
${this.getCloseIconSlot()}
|
33
42
|
</div>
|
34
|
-
`}};a.activeChips=[],t([s({type:String})],a.prototype,"label",void 0),t([s({type:String})],a.prototype,"text",void 0),t([s({type:Number})],a.prototype,"
|
43
|
+
`}};a.activeChips=[],t([s({type:String})],a.prototype,"label",void 0),t([s({type:String})],a.prototype,"text",void 0),t([s({type:Number})],a.prototype,"viewMoreCount",void 0),t([s({type:Boolean})],a.prototype,"editable",void 0),t([s({type:Boolean})],a.prototype,"closable",void 0),t([s({type:String})],a.prototype,"icon",void 0),t([s({type:String})],a.prototype,"removeIcon",void 0),t([s({type:Boolean,reflect:!0})],a.prototype,"active",void 0),a=o=t([i("nile-filter-chip")],a);export{a as N};
|
@@ -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(["../fixture-d5b55278.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-filter-chip.cjs.js","tslib","lit/decorators.js","../internal/nile-element.cjs.js","./nile-filter-chip.css.cjs.js"],function(_export,_context){"use strict";var e,t,i,l,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture001CjsJs){e=_fixture001CjsJs.f;t=_fixture001CjsJs.a;i=_fixture001CjsJs.o;},function(_litStaticHtmlJs){l=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileFilterChipCjsJs){a=_nileFilterChipCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_nileFilterChipCssCjsJs){}],execute:function execute(){describe("<nile-filter-chip>",function(){afterEach(function(){a.activeChips=[];}),it("registers and unregisters itself in activeChips",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(l(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:i=_context2.sent;t(a.activeChips).to.include(i);i.remove();_context2.next=7;return i.updateComplete;case 7:t(a.activeChips).to.not.include(i);case 8:case"end":return _context2.stop();}},_callee);}))),it("renders fallback label and text",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i,a,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(l(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-filter-chip label=\"MyLabel\" text=\"MyText\"></nile-filter-chip>\n "]))));case 2:i=_context3.sent;a=i.shadowRoot.querySelector(".label");n=i.shadowRoot.querySelector(".value");t(a.textContent).to.equal("MyLabel:"),t(n.textContent.trim()).to.equal("MyText");case 6:case"end":return _context3.stop();}},_callee2);}))),it("renders slotted label and value over fallback",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var i,a,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(l(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-filter-chip>\n <span slot=\"label\">SLOT-LBL</span>\n <span slot=\"value\">SLOT-VAL</span>\n </nile-filter-chip>\n "]))));case 2:i=_context4.sent;a=i.querySelector('[slot="label"]');n=i.querySelector('[slot="value"]');t(a.textContent).to.equal("SLOT-LBL"),t(n.textContent).to.equal("SLOT-VAL");case 6:case"end":return _context4.stop();}},_callee3);}))),it("renders an icon when the `icon` property is set",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var i;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(l(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-filter-chip icon=\"\u2605\" label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:i=_context5.sent.shadowRoot.querySelector(".icon");t(i).to.exist,t(i.textContent).to.equal("★");case 4:case"end":return _context5.stop();}},_callee4);}))),it("does not render a badge when extraCount is zero",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(l(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-filter-chip extraCount=\"0\" label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:i=_context6.sent;t(i.shadowRoot.querySelector("nile-badge")).to.be["null"];case 4:case"end":return _context6.stop();}},_callee5);}))),it("renders a +badge when extraCount > 0",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var i;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(l(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-filter-chip extraCount=\"5\" label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:i=_context7.sent.shadowRoot.querySelector("nile-badge");t(i).to.exist,t(i.textContent).to.contain("+5");case 4:case"end":return _context7.stop();}},_callee6);}))),it("dispatches `nile-click` on chip click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var a,n,s;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(l(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:a=_context8.sent;n=a.shadowRoot.querySelector(".chip");setTimeout(function(){return n.click();});_context8.next=7;return i(a,"nile-click");case 7:s=_context8.sent;t(s.detail).to.deep.equal({text:"T",extraCount:0});case 9:case"end":return _context8.stop();}},_callee7);}))),it("dispatches `nile-close` on close icon click and removes itself",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var a,n,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(l(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-filter-chip closable extraCount=\"2\" text=\"TT\"></nile-filter-chip>\n "]))));case 2:a=_context9.sent;n=a.shadowRoot.querySelector(".close-icon");setTimeout(function(){return n.click();});_context9.next=7;return i(a,"nile-close");case 7:s=_context9.sent;t(s.detail).to.deep.equal({text:"TT",extraCount:2}),t(document.body.contains(a)).to.be["false"];case 9:case"end":return _context9.stop();}},_callee8);})));});}};});
|
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(["../fixture-d5b55278.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-filter-chip.cjs.js","tslib","lit/decorators.js","../internal/nile-element.cjs.js","./nile-filter-chip.css.cjs.js"],function(_export,_context){"use strict";var e,i,t,l,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture001CjsJs){e=_fixture001CjsJs.f;i=_fixture001CjsJs.a;t=_fixture001CjsJs.o;},function(_litStaticHtmlJs){l=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileFilterChipCjsJs){n=_nileFilterChipCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_nileFilterChipCssCjsJs){}],execute:function execute(){describe("<nile-filter-chip>",function(){afterEach(function(){n.activeChips=[];}),it("registers and unregisters itself in activeChips",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var t;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(l(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:t=_context2.sent;i(n.activeChips).to.include(t);t.remove();_context2.next=7;return t.updateComplete;case 7:i(n.activeChips).to.not.include(t);case 8:case"end":return _context2.stop();}},_callee);}))),it("renders fallback label and text",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var t,n,a;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(l(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-filter-chip label=\"MyLabel\" text=\"MyText\"></nile-filter-chip>\n "]))));case 2:t=_context3.sent;n=t.shadowRoot.querySelector(".label");a=t.shadowRoot.querySelector(".value");i(n.textContent).to.equal("MyLabel:"),i(a.textContent.trim()).to.equal("MyText");case 6:case"end":return _context3.stop();}},_callee2);}))),it("renders slotted label and value over fallback",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var t,n,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(l(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-filter-chip>\n <span slot=\"label\">SLOT-LBL</span>\n <span slot=\"value\">SLOT-VAL</span>\n </nile-filter-chip>\n "]))));case 2:t=_context4.sent;n=t.querySelector('[slot="label"]');a=t.querySelector('[slot="value"]');i(n.textContent).to.equal("SLOT-LBL"),i(a.textContent).to.equal("SLOT-VAL");case 6:case"end":return _context4.stop();}},_callee3);}))),it("renders an icon when the `icon` property is set",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var t;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(l(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-filter-chip icon=\"\u2605\" label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:t=_context5.sent.shadowRoot.querySelector(".icon");i(t).to.exist,i(t.textContent).to.equal("★");case 4:case"end":return _context5.stop();}},_callee4);}))),it("does not render a badge when viewMoreCount is zero",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var t;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(l(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-filter-chip viewMoreCount=\"0\" label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:t=_context6.sent;i(t.shadowRoot.querySelector("nile-badge")).to.be["null"];case 4:case"end":return _context6.stop();}},_callee5);}))),it("renders a +badge when viewMoreCount > 0",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var t;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(l(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-filter-chip viewMoreCount=\"5\" label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:t=_context7.sent.shadowRoot.querySelector("nile-badge");i(t).to.exist,i(t.textContent).to.contain("+5");case 4:case"end":return _context7.stop();}},_callee6);}))),it("dispatches `nile-click` on chip click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var n,a,s;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(l(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n "]))));case 2:n=_context8.sent;a=n.shadowRoot.querySelector(".chip");setTimeout(function(){return a.click();});_context8.next=7;return t(n,"nile-click");case 7:s=_context8.sent;i(s.detail).to.deep.equal({text:"T",viewMoreCount:0});case 9:case"end":return _context8.stop();}},_callee7);}))),it("dispatches `nile-close` on close icon click and removes itself",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var n,a,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(l(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-filter-chip closable viewMoreCount=\"2\" text=\"TT\"></nile-filter-chip>\n "]))));case 2:n=_context9.sent;a=n.shadowRoot.querySelector(".close-icon");setTimeout(function(){return a.click();});_context9.next=7;return t(n,"nile-close");case 7:s=_context9.sent;i(s.detail).to.deep.equal({text:"TT",viewMoreCount:2}),i(document.body.contains(n)).to.be["false"];case 9:case"end":return _context9.stop();}},_callee8);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-filter-chip.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-filter-chip.test.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.test.ts"],"sourcesContent":["import { fixture, expect, html, oneEvent } from '@open-wc/testing';\nimport './nile-filter-chip';\nimport { NileFilterChip } from './nile-filter-chip';\n\ndescribe('<nile-filter-chip>', () => {\n afterEach(() => {\n (NileFilterChip as any).activeChips = [];\n });\n\n it('registers and unregisters itself in activeChips', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n expect((NileFilterChip as any).activeChips).to.include(el);\n el.remove();\n await el.updateComplete;\n expect((NileFilterChip as any).activeChips).to.not.include(el);\n });\n\n it('renders fallback label and text', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip label=\"MyLabel\" text=\"MyText\"></nile-filter-chip>\n `);\n const label = el.shadowRoot!.querySelector('.label')! as HTMLElement;\n const value = el.shadowRoot!.querySelector('.value')! as HTMLElement;\n expect(label.textContent).to.equal('MyLabel:');\n expect(value.textContent!.trim()).to.equal('MyText');\n });\n\n it('renders slotted label and value over fallback', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip>\n <span slot=\"label\">SLOT-LBL</span>\n <span slot=\"value\">SLOT-VAL</span>\n </nile-filter-chip>\n `);\n const slottedLabel = el.querySelector('[slot=\"label\"]')! as HTMLElement;\n const slottedValue = el.querySelector('[slot=\"value\"]')! as HTMLElement;\n expect(slottedLabel.textContent).to.equal('SLOT-LBL');\n expect(slottedValue.textContent).to.equal('SLOT-VAL');\n });\n\n it('renders an icon when the `icon` property is set', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip icon=\"★\" label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n const iconSpan = el.shadowRoot!.querySelector('.icon')! as HTMLElement;\n expect(iconSpan).to.exist;\n expect(iconSpan.textContent).to.equal('★');\n });\n\n it('does not render a badge when
|
1
|
+
{"version":3,"file":"nile-filter-chip.test.cjs.js","sources":["../../../src/nile-filter-chip/nile-filter-chip.test.ts"],"sourcesContent":["import { fixture, expect, html, oneEvent } from '@open-wc/testing';\nimport './nile-filter-chip';\nimport { NileFilterChip } from './nile-filter-chip';\n\ndescribe('<nile-filter-chip>', () => {\n afterEach(() => {\n (NileFilterChip as any).activeChips = [];\n });\n\n it('registers and unregisters itself in activeChips', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n expect((NileFilterChip as any).activeChips).to.include(el);\n el.remove();\n await el.updateComplete;\n expect((NileFilterChip as any).activeChips).to.not.include(el);\n });\n\n it('renders fallback label and text', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip label=\"MyLabel\" text=\"MyText\"></nile-filter-chip>\n `);\n const label = el.shadowRoot!.querySelector('.label')! as HTMLElement;\n const value = el.shadowRoot!.querySelector('.value')! as HTMLElement;\n expect(label.textContent).to.equal('MyLabel:');\n expect(value.textContent!.trim()).to.equal('MyText');\n });\n\n it('renders slotted label and value over fallback', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip>\n <span slot=\"label\">SLOT-LBL</span>\n <span slot=\"value\">SLOT-VAL</span>\n </nile-filter-chip>\n `);\n const slottedLabel = el.querySelector('[slot=\"label\"]')! as HTMLElement;\n const slottedValue = el.querySelector('[slot=\"value\"]')! as HTMLElement;\n expect(slottedLabel.textContent).to.equal('SLOT-LBL');\n expect(slottedValue.textContent).to.equal('SLOT-VAL');\n });\n\n it('renders an icon when the `icon` property is set', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip icon=\"★\" label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n const iconSpan = el.shadowRoot!.querySelector('.icon')! as HTMLElement;\n expect(iconSpan).to.exist;\n expect(iconSpan.textContent).to.equal('★');\n });\n\n it('does not render a badge when viewMoreCount is zero', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip viewMoreCount=\"0\" label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n expect(el.shadowRoot!.querySelector('nile-badge')).to.be.null;\n });\n\n it('renders a +badge when viewMoreCount > 0', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip viewMoreCount=\"5\" label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n const badge = el.shadowRoot!.querySelector('nile-badge')! as HTMLElement;\n expect(badge).to.exist;\n expect(badge.textContent).to.contain('+5');\n });\n\n\n\n it('dispatches `nile-click` on chip click', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip label=\"L\" text=\"T\"></nile-filter-chip>\n `);\n const chip = el.shadowRoot!.querySelector('.chip')! as HTMLElement;\n setTimeout(() => chip.click());\n const ev = await oneEvent(el, 'nile-click');\n expect(ev.detail).to.deep.equal({ text: 'T', viewMoreCount: 0 });\n });\n\n it('dispatches `nile-close` on close icon click and removes itself', async () => {\n const el = await fixture<NileFilterChip>(html`\n <nile-filter-chip closable viewMoreCount=\"2\" text=\"TT\"></nile-filter-chip>\n `);\n const closeIcon = el.shadowRoot!.querySelector('.close-icon')! as HTMLElement;\n setTimeout(() => closeIcon.click());\n const ev = await oneEvent(el, 'nile-close');\n expect(ev.detail).to.deep.equal({ text: 'TT', viewMoreCount: 2 });\n expect(document.body.contains(el)).to.be.false;\n });\n\n \n});\n"],"names":["describe","afterEach","NileFilterChip","activeChips","it","async","fixture","html","_templateObject","_taggedTemplateLiteral","el","expect","to","include","remove","updateComplete","not","_context2","stop","_callee","_templateObject2","label","shadowRoot","querySelector","value","textContent","equal","trim","_context3","_callee2","_templateObject3","slottedLabel","slottedValue","_context4","_callee3","_asyncToGenerator","_regeneratorRuntime","mark","_templateObject4","iconSpan","exist","_context5","_callee4","_templateObject5","be","null","_context6","_callee5","_templateObject6","badge","contain","_context7","_callee6","_templateObject7","chip","setTimeout","click","_context8","next","oneEvent","ev","detail","deep","text","viewMoreCount","_callee7","_templateObject8","closeIcon","_context9","document","body","contains","_callee8"],"mappings":"s0SAIAA,QAAS,CAAA,oBAAA,CAAsB,UAC7BC,CAAAA,SAAAA,CAAU,UACPC,CAAAA,CAAAA,CAAuBC,WAAc,CAAA,EAAE,EAG1CC,CAAAA,CAAAA,EAAAA,CAAG,iDAAmDC,cAAAA,iBAAAA,cAAAA,mBAAAA,GAAAA,IAAAA,CAAAA,SAAAA,QAAAA,MAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,SAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SACnCC,CAAAA,EAAwBC,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,2FAAvCC,CAAAA,CA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AA,SAAAA,CAAAA,IAAAA,SAClDC,CAAAA,EAAwBC,CAAI,CAAA2D,gBAAA,GAAAA,gBAAA,CAAAzD,sBAAA,oGAGvC0D,CAAAA,QAHAzD,CAAAA,CAAAA,SAAAA,CAAAA,IAAAA,CAGAyD,CAAAA,CAAYzD,CAAGY,CAAAA,UAAAA,CAAYC,aAAc,CAAA,aAAA,CAAA,CAC/CgC,WAAW,iBAAMY,CAAAA,CAAAA,CAAUX,KAC3B,CAAA,CAAA,EAAA,CAAA,CAAAY,SAAA,CAAAV,IAAA,SAAiBC,CAAAA,CAAAA,CAASjD,CAAI,CAAA,YAAA,CAAA,QAAxBkD,CAAWD,CAAAA,SAAAA,CAAAA,IAAAA,CACjBhD,EAAOiD,CAAGC,CAAAA,MAAAA,CAAAA,CAAQjD,EAAGkD,CAAAA,IAAAA,CAAKpC,KAAM,CAAA,CAAEqC,IAAM,CAAA,IAAA,CAAMC,cAAe,CAC7DrD,CAAAA,CAAAA,CAAAA,CAAAA,CAAO0D,QAASC,CAAAA,IAAAA,CAAKC,QAAS7D,CAAAA,CAAAA,CAAAA,CAAAA,CAAKE,EAAGgC,CAAAA,EAAAA,SAAQ,yBAAAwB,SAAA,CAAAlD,IAAA,MAAAsD,QAAA,GAC9C,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import{f as e,a as
|
1
|
+
import{f as e,a as i,o as t}from"../fixture-df8b52d7.esm.js";import{html as l}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as n}from"./nile-filter-chip.esm.js";import"tslib";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"./nile-filter-chip.css.esm.js";describe("<nile-filter-chip>",(()=>{afterEach((()=>{n.activeChips=[]})),it("registers and unregisters itself in activeChips",(async()=>{const t=await e(l`
|
2
2
|
<nile-filter-chip label="L" text="T"></nile-filter-chip>
|
3
|
-
`);
|
3
|
+
`);i(n.activeChips).to.include(t),t.remove(),await t.updateComplete,i(n.activeChips).to.not.include(t)})),it("renders fallback label and text",(async()=>{const t=await e(l`
|
4
4
|
<nile-filter-chip label="MyLabel" text="MyText"></nile-filter-chip>
|
5
|
-
`),
|
5
|
+
`),n=t.shadowRoot.querySelector(".label"),a=t.shadowRoot.querySelector(".value");i(n.textContent).to.equal("MyLabel:"),i(a.textContent.trim()).to.equal("MyText")})),it("renders slotted label and value over fallback",(async()=>{const t=await e(l`
|
6
6
|
<nile-filter-chip>
|
7
7
|
<span slot="label">SLOT-LBL</span>
|
8
8
|
<span slot="value">SLOT-VAL</span>
|
9
9
|
</nile-filter-chip>
|
10
|
-
`),
|
10
|
+
`),n=t.querySelector('[slot="label"]'),a=t.querySelector('[slot="value"]');i(n.textContent).to.equal("SLOT-LBL"),i(a.textContent).to.equal("SLOT-VAL")})),it("renders an icon when the `icon` property is set",(async()=>{const t=(await e(l`
|
11
11
|
<nile-filter-chip icon="★" label="L" text="T"></nile-filter-chip>
|
12
|
-
`)).shadowRoot.querySelector(".icon");t
|
13
|
-
<nile-filter-chip
|
14
|
-
`);t
|
15
|
-
<nile-filter-chip
|
16
|
-
`)).shadowRoot.querySelector("nile-badge");t
|
12
|
+
`)).shadowRoot.querySelector(".icon");i(t).to.exist,i(t.textContent).to.equal("★")})),it("does not render a badge when viewMoreCount is zero",(async()=>{const t=await e(l`
|
13
|
+
<nile-filter-chip viewMoreCount="0" label="L" text="T"></nile-filter-chip>
|
14
|
+
`);i(t.shadowRoot.querySelector("nile-badge")).to.be.null})),it("renders a +badge when viewMoreCount > 0",(async()=>{const t=(await e(l`
|
15
|
+
<nile-filter-chip viewMoreCount="5" label="L" text="T"></nile-filter-chip>
|
16
|
+
`)).shadowRoot.querySelector("nile-badge");i(t).to.exist,i(t.textContent).to.contain("+5")})),it("dispatches `nile-click` on chip click",(async()=>{const n=await e(l`
|
17
17
|
<nile-filter-chip label="L" text="T"></nile-filter-chip>
|
18
|
-
`),n
|
19
|
-
<nile-filter-chip closable
|
20
|
-
`),n
|
18
|
+
`),a=n.shadowRoot.querySelector(".chip");setTimeout((()=>a.click()));const s=await t(n,"nile-click");i(s.detail).to.deep.equal({text:"T",viewMoreCount:0})})),it("dispatches `nile-close` on close icon click and removes itself",(async()=>{const n=await e(l`
|
19
|
+
<nile-filter-chip closable viewMoreCount="2" text="TT"></nile-filter-chip>
|
20
|
+
`),a=n.shadowRoot.querySelector(".close-icon");setTimeout((()=>a.click()));const s=await t(n,"nile-close");i(s.detail).to.deep.equal({text:"TT",viewMoreCount:2}),i(document.body.contains(n)).to.be.false}))}));
|
@@ -20,7 +20,8 @@ export const styles = css `
|
|
20
20
|
.chip {
|
21
21
|
display: inline-flex;
|
22
22
|
align-items: center;
|
23
|
-
|
23
|
+
height: 30px;
|
24
|
+
padding: 8px;
|
24
25
|
border: 1px solid var(--nile-filter-chip-chip-border-color-stroke);
|
25
26
|
border-radius: 4px;
|
26
27
|
font-size: 14px;
|
@@ -28,18 +29,21 @@ export const styles = css `
|
|
28
29
|
color: var(--nile-filter-chip-text-default);
|
29
30
|
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
|
30
31
|
cursor: pointer;
|
31
|
-
|
32
|
-
margin-right: 6px;
|
32
|
+
box-sizing: border-box;
|
33
33
|
}
|
34
34
|
|
35
35
|
.chip:hover {
|
36
36
|
background-color: var(--nile-filter-chip-hover-background);
|
37
37
|
}
|
38
|
+
.chip:active {
|
39
|
+
background-color: var(--nile-filter-chip-active-background);
|
40
|
+
border-color: var(--nile-filter-chip-active-border-color-stroke);
|
41
|
+
}
|
42
|
+
:host([active]) .chip {
|
43
|
+
background-color: var(--nile-filter-chip-active-background);
|
44
|
+
border-color: var(--nile-filter-chip-active-border-color-stroke);
|
45
|
+
}
|
38
46
|
|
39
|
-
.chip:active {
|
40
|
-
background-color: var(--nile-filter-chip-active-background);
|
41
|
-
border-color: var(--nile-filter-chip-active-border-color-stroke);
|
42
|
-
}
|
43
47
|
|
44
48
|
.icon {
|
45
49
|
color: var(--nile-filter-chip-icon-color-default);
|
@@ -83,20 +87,22 @@ export const styles = css `
|
|
83
87
|
}
|
84
88
|
|
85
89
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
.value {
|
91
|
+
color: var(--nile-filter-chip-values-color-default);
|
92
|
+
display: inline-block;
|
93
|
+
overflow: hidden;
|
94
|
+
text-overflow: ellipsis;
|
95
|
+
white-space: nowrap;
|
96
|
+
max-width: 140px;
|
97
|
+
vertical-align: bottom;
|
98
|
+
}
|
99
|
+
|
93
100
|
|
94
101
|
.close-icon {
|
95
102
|
color: var(--nile-filter-chip-close-icon-color-default);
|
96
103
|
cursor: pointer;
|
97
104
|
display: flex;
|
98
105
|
align-items: center;
|
99
|
-
padding: 2px;
|
100
106
|
border-radius: 50%;
|
101
107
|
transition: background-color 0.2s;
|
102
108
|
}
|
@@ -105,6 +111,23 @@ export const styles = css `
|
|
105
111
|
background-color: var(--nile-filter-chip-close-icon-hover-background);
|
106
112
|
color: var(--nile-filter-chip-close-icon-hover-color);
|
107
113
|
}
|
114
|
+
|
115
|
+
.label-wrapper {
|
116
|
+
margin-right: 4px;
|
117
|
+
}
|
118
|
+
|
119
|
+
::slotted([slot="icon"]) {
|
120
|
+
margin-right: 6px;
|
121
|
+
}
|
122
|
+
|
123
|
+
.value-wrapper {
|
124
|
+
margin-right: 4px;
|
125
|
+
}
|
126
|
+
|
127
|
+
.badge-wrapper {
|
128
|
+
margin-right: 12px;
|
129
|
+
}
|
130
|
+
|
108
131
|
`;
|
109
132
|
export default [styles];
|
110
133
|
//# sourceMappingURL=nile-filter-chip.css.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-filter-chip.css.js","sourceRoot":"","sources":["../../../src/nile-filter-chip/nile-filter-chip.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-filter-chip.css.js","sourceRoot":"","sources":["../../../src/nile-filter-chip/nile-filter-chip.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHxB,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 * FilterChip CSS\n */\n\nexport const styles = css`\n\n\n .filter-chips {\n display: flex;\n align-items: center;\n }\n\n\n .chip {\n display: inline-flex;\n align-items: center;\n height: 30px;\n padding: 8px;\n border: 1px solid var(--nile-filter-chip-chip-border-color-stroke);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--nile-filter-chip-background-default);\n color: var(--nile-filter-chip-text-default);\n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n box-sizing: border-box;\n }\n\n .chip:hover {\n background-color: var(--nile-filter-chip-hover-background);\n }\n .chip:active {\n background-color: var(--nile-filter-chip-active-background);\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n:host([active]) .chip {\n background-color: var(--nile-filter-chip-active-background);\n border-color: var(--nile-filter-chip-active-border-color-stroke);\n}\n\n\n .icon {\n color: var(--nile-filter-chip-icon-color-default);\n display: flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n position: relative;\n top: 12px;\n }\n\n .label {\n font-weight: 500;\n color: var(--nile-filter-chip-label-color-default);\n }\n\n nile-badge::part(base) {\n width: auto;\n height: 14px;\n border-radius: 100px;\n padding: 6px;\n gap: 10px;\n font-size: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n }\n\n .chip-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .clear-all-container {\n margin-left: 18px;\n white-space: nowrap;\n cursor: pointer;\n }\n\n\n .value {\n color: var(--nile-filter-chip-values-color-default);\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 140px;\n vertical-align: bottom;\n}\n\n\n .close-icon {\n color: var(--nile-filter-chip-close-icon-color-default);\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 50%;\n transition: background-color 0.2s;\n }\n\n .close-icon:hover {\n background-color: var(--nile-filter-chip-close-icon-hover-background);\n color: var(--nile-filter-chip-close-icon-hover-color);\n }\n\n.label-wrapper {\n margin-right: 4px;\n}\n\n::slotted([slot=\"icon\"]) {\n margin-right: 6px;\n}\n\n.value-wrapper {\n margin-right: 4px; \n}\n\n.badge-wrapper {\n margin-right: 12px; \n}\n\n`;\n\nexport default [styles];\n\n "]}
|
@@ -8,11 +8,12 @@ import NileElement from '../internal/nile-element';
|
|
8
8
|
export declare class NileFilterChip extends NileElement {
|
9
9
|
label: string;
|
10
10
|
text: string;
|
11
|
-
|
11
|
+
viewMoreCount: number;
|
12
12
|
editable: boolean;
|
13
13
|
closable: boolean;
|
14
14
|
icon: string;
|
15
15
|
removeIcon: string;
|
16
|
+
active: boolean;
|
16
17
|
private static activeChips;
|
17
18
|
static get styles(): CSSResultArray;
|
18
19
|
connectedCallback(): void;
|
@@ -23,7 +24,7 @@ export declare class NileFilterChip extends NileElement {
|
|
23
24
|
private handleClick;
|
24
25
|
private getLabelSlot;
|
25
26
|
private getValueSlot;
|
26
|
-
private
|
27
|
+
private getviewMoreCountSlot;
|
27
28
|
private getCloseIconSlot;
|
28
29
|
render(): TemplateResult;
|
29
30
|
}
|