@aquera/nile-elements 0.0.5-2 → 0.0.5-4

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.
@@ -4396,7 +4396,7 @@ font-weight: 500;
4396
4396
  gap: 8px;
4397
4397
  height: 38px;
4398
4398
  box-sizing: border-box;
4399
- cursor: pointer
4399
+ cursor: pointer;
4400
4400
  }
4401
4401
 
4402
4402
  .link__label {
@@ -4414,7 +4414,11 @@ font-weight: 500;
4414
4414
  color: rgba(0, 94, 166, 0.5);
4415
4415
  cursor: not-allowed;
4416
4416
  opacity: 0.6;
4417
- pointer-events:none;
4417
+ pointer-events: none;
4418
+ }
4419
+
4420
+ :host(.link--disabled) {
4421
+ pointer-events: none;
4418
4422
  }
4419
4423
 
4420
4424
  .link:not(.link--disabled):not(.link__button):hover {
@@ -4438,7 +4442,11 @@ font-weight: 500;
4438
4442
  border-radius: 4px;
4439
4443
  background: rgba(0, 94, 166, 0.1);
4440
4444
  }
4441
- `;class bD{constructor(M,...N){this.slotNames=[],(this.host=M).addController(this),this.slotNames=N,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((M=>{if(M.nodeType===M.TEXT_NODE&&""!==M.textContent.trim())return!0;if(M.nodeType===M.ELEMENT_NODE){const N=M;if("nile-visually-hidden"===N.tagName.toLowerCase())return!1;if(!N.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(M){return null!==this.host.querySelector(`:scope > [slot="${M}"]`)}test(M){return"[default]"===M?this.hasDefaultSlot():this.hasNamedSlot(M)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(M){const N=M.target;(this.slotNames.includes("[default]")&&!N.name||N.name&&this.slotNames.includes(N.name))&&this.host.requestUpdate()}}M.NileLink=class extends GM{constructor(){super(...arguments),this.hasSlotController=new bD(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.disabled=!1,this.button=!1}static get styles(){return[YD]}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}render(){return V`
4445
+
4446
+ :host([disabled]) {
4447
+ pointer-events: none;
4448
+ }
4449
+ `;class bD{constructor(M,...N){this.slotNames=[],(this.host=M).addController(this),this.slotNames=N,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((M=>{if(M.nodeType===M.TEXT_NODE&&""!==M.textContent.trim())return!0;if(M.nodeType===M.ELEMENT_NODE){const N=M;if("nile-visually-hidden"===N.tagName.toLowerCase())return!1;if(!N.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(M){return null!==this.host.querySelector(`:scope > [slot="${M}"]`)}test(M){return"[default]"===M?this.hasDefaultSlot():this.hasNamedSlot(M)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(M){const N=M.target;(this.slotNames.includes("[default]")&&!N.name||N.name&&this.slotNames.includes(N.name))&&this.host.requestUpdate()}}M.NileLink=class extends GM{constructor(){super(...arguments),this.hasSlotController=new bD(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.disabled=!1,this.button=!1}static get styles(){return[YD]}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick)}handleHostClick(M){this.disabled&&(M.preventDefault(),M.stopImmediatePropagation(),M.stopPropagation())}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}render(){return V`
4442
4450
  <div
4443
4451
  part="base"
4444
4452
  class=${aM({link:!0,"link--disabled":this.disabled,link__button:this.button})}
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-link.css.cjs.js","../slot.cjs.js","lit/directives/if-defined.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var s,i,t,e,l,r,o,a,n,f,_templateObject,d;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){s=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.state;e=_litDecoratorsJs.customElement;},function(_nileLinkCssCjsJs){l=_nileLinkCssCjsJs.s;},function(_slotCjsJs){r=_slotCjsJs.H;},function(_litDirectivesIfDefinedJs){o=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesClassMapJs){a=_litDirectivesClassMapJs.classMap;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_property002CjsJs){f=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",d=/*#__PURE__*/function(_n){_inherits(d,_n);var _super=_createSuper(d);function d(){var _this;_classCallCheck(this,d);_this=_super.apply(this,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"[default]","prefix","suffix"),_this.hasFocus=!1,_this.disabled=!1,_this.button=!1;return _this;}_createClass(d,[{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n ?disabled=","\n title=","\n aria-disabled=","\n tabindex=","\n @blur=","\n @focus=","\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n "])),a({link:!0,"link--disabled":this.disabled,link__button:this.button}),o(this.disabled),this.title,this.disabled?"true":"false",this.disabled?"-1":"0",this.handleBlur,this.handleFocus);}}],[{key:"styles",get:function get(){return[l];}}]);return d;}(n));s([t()],d.prototype,"hasFocus",void 0),s([f({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),s([f({type:Boolean})],d.prototype,"button",void 0),_export("N",d=s([e("nile-link")],d));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-link.css.cjs.js","../slot.cjs.js","lit/directives/if-defined.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var s,i,t,e,l,r,o,a,n,c,_templateObject,d;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){s=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.state;e=_litDecoratorsJs.customElement;},function(_nileLinkCssCjsJs){l=_nileLinkCssCjsJs.s;},function(_slotCjsJs){r=_slotCjsJs.H;},function(_litDirectivesIfDefinedJs){o=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesClassMapJs){a=_litDirectivesClassMapJs.classMap;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_property002CjsJs){c=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",d=/*#__PURE__*/function(_n){_inherits(d,_n);var _super=_createSuper(d);function d(){var _this;_classCallCheck(this,d);_this=_super.apply(this,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"[default]","prefix","suffix"),_this.hasFocus=!1,_this.disabled=!1,_this.button=!1;return _this;}_createClass(d,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(d.prototype),"connectedCallback",this).call(this),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(d.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this.handleHostClick);}},{key:"handleHostClick",value:function handleHostClick(s){this.disabled&&(s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation());}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n ?disabled=","\n title=","\n aria-disabled=","\n tabindex=","\n @blur=","\n @focus=","\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n "])),a({link:!0,"link--disabled":this.disabled,link__button:this.button}),o(this.disabled),this.title,this.disabled?"true":"false",this.disabled?"-1":"0",this.handleBlur,this.handleFocus);}}],[{key:"styles",get:function get(){return[l];}}]);return d;}(n));s([t()],d.prototype,"hasFocus",void 0),s([c({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),s([c({type:Boolean})],d.prototype,"button",void 0),_export("N",d=s([e("nile-link")],d));}};});
2
2
  //# sourceMappingURL=nile-link.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-link.cjs.js","sources":["../../../src/nile-link/nile-link.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport {styles} from './nile-link.css';\nimport { HasSlotController } from '../slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-link\n *\n */\n@customElement('nile-link')\nexport class NileLink extends NileElement {\n\n\t/**\n\t * The styles for Link\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @state() private hasFocus = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) button = false;\n\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n link: true,\n 'link--disabled': this.disabled,\n 'link__button': this.button\n })}\n ?disabled=${ifDefined(this.disabled)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n `;\n }\n\n\n\t/* #endregion */\n}\n\nexport default NileLink;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-link': NileLink;\n }\n }\n"],"names":["NileLink","d","this","hasSlotController","HasSlotController","hasFocus","disabled","button","_this","_createClass","key","value","handleBlur","emit","handleFocus","render","html","_templateObject","_taggedTemplateLiteral","classMap","link","link__button","ifDefined","title","get","styles","NileElement","__decorate","state","prototype","property","type","Boolean","reflect","customElement"],"mappings":"gjIAuBaA,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,EAAN,SAAAC,EAAA,qEAUYC,EAAAA,KAAAA,CAAAC,kBAAoB,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAAA,CAAa,SAAU,QAEvEF,CAAAA,CAAAA,KAAAA,CAAQG,QAAG,CAAA,CAAA,CAAA,CAGgBH,KAAAA,CAAQI,QAAAA,CAAAA,CAAG,CAE1BJ,CAAAA,KAAAA,CAAMK,QAAG,CA0CvC,QAAAC,KAAA,EArDOC,YAAA,CAAAR,CAAA,GAAAS,GAAA,cAAA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A,CAAAA,CAAAA,CAAAA,CAAAA,CAAA6B,SAAA,CAAA,QAAA,CAAA,IAAA,gBAjBjC7B,CAAQ2B,CAAAA,CAAAA,CAAA,CADpBO,CAAAA,CAAc,cACFlC"}
1
+ {"version":3,"file":"nile-link.cjs.js","sources":["../../../src/nile-link/nile-link.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport {styles} from './nile-link.css';\nimport { HasSlotController } from '../slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-link\n *\n */\n@customElement('nile-link')\nexport class NileLink extends NileElement {\n /**\n * The styles for Link\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n '[default]',\n 'prefix',\n 'suffix'\n );\n\n @state() private hasFocus = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) button = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n }\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n link: true,\n 'link--disabled': this.disabled,\n link__button: this.button,\n })}\n ?disabled=${ifDefined(this.disabled)}\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileLink;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-link': NileLink;\n }\n }\n"],"names":["NileLink","_n","_inherits","d","_super","_createSuper","this","hasSlotController","HasSlotController","hasFocus","disabled","button","_this","_createClass","key","value","connectedCallback","super","handleHostClick","bind","addEventListener","disconnectedCallback","removeEventListener","event","preventDefault","stopImmediatePropagation","stopPropagation","handleBlur","emit","handleFocus","render","html","_templateObject","_taggedTemplateLiteral","classMap","link","link__button","ifDefined","title","get","styles","NileElement","__decorate","state","prototype","property","type","Boolean","reflect","customElement"],"mappings":"slJAuBaA,CAAN,uBAAAC,EAAA,EAAAC,SAAA,CAAAC,CAAA,CAAAF,EAAA,MAAAG,MAAA,CAAAC,YAAA,CAAAF,CAAA,EAAA,SAAAA,EAAA,uEASYG,KAAAA,CAAAC,iBAAAA,CAAoB,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAEvC,WAAA,CACA,SACA,QAGeF,CAAAA,CAAAA,KAAAA,CAAQG,QAAG,CAAA,CAAA,CAAA,CAGgBH,KAAAA,CAAQI,QAAAA,CAAAA,CAAG,EAE1BJ,KAAAA,CAAMK,MAAAA,CAAAA,CAAG,CA+DvC,QAAAC,KAAA,EA/EQC,YAAA,CAAAV,CAAA,GA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CAAAA,CAAAA,CAET0B,CAAAA,CAAU/B,IAAKI,CAAAA,QAAAA,CAAAA,CAEzBJ,IACGgC,CAAAA,KAAAA,CAEWhC,IAAAA,CAAKI,SAAW,MAAS,CAAA,OAAA,CAC9BJ,IAAAA,CAAKI,SAAW,IAAO,CAAA,GAAA,CAC1BJ,IAAKqB,CAAAA,UAAAA,CACJrB,IAAKuB,CAAAA,WAAAA,EAOnB,CAAA,KAAAf,GAAA,UAAAyB,GAAA,CA5EM,SAAAA,IAAA,CAAWC,CAChB,MAAO,CAACA,CACT,CAAA,EAgBD,WAAArC,CAAA,GAvB4BsC,CAAvB,GAgBIC,CAAA,CAAA,CAARC,CAAiC3C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4C,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAGUF,CAAA,CAAA,CAA3CG,EAAS,CAAEC,IAAAA,CAAMC,OAASC,CAAAA,OAAAA,CAAAA,CAAS,KAAyBhD,CAAA4C,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEhCF,CAAA,CAAA,CAA5BG,CAAS,CAAA,CAAEC,KAAMC,OAA0B/C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4C,SAAA,CAAA,QAAA,CAAA,IAAA,gBArBjC5C,CAAQ0C,CAAAA,CAAAA,CAAA,CADpBO,CAAAA,CAAc,cACFjD"}
@@ -1,2 +1,2 @@
1
- System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var n,_templateObject,e;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){n=_index001CjsJs.i;}],execute:function(){_export("s",e=n(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n height: 38px;\n box-sizing: border-box;\n cursor: pointer\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events:none;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n"]))));}};});
1
+ System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,n;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",n=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n height: 38px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n }\n\n :host(.link--disabled) {\n pointer-events: none;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n\n :host([disabled]) {\n pointer-events: none;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-link.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-link.css.cjs.js","sources":["../../../src/nile-link/nile-link.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-element';\n\n/**\n * Link CSS\n */\nexport const styles = css`\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n height: 38px;\n box-sizing: border-box;\n cursor: pointer\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events:none;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-link.css.cjs.js","sources":["../../../src/nile-link/nile-link.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-element';\n\n/**\n * Link CSS\n */\nexport const styles = css`\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n height: 38px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n }\n\n :host(.link--disabled) {\n pointer-events: none;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n\n :host([disabled]) {\n pointer-events: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -13,7 +13,7 @@ import{i as e}from"../index-cd2f9c12.esm.js";const n=e`
13
13
  gap: 8px;
14
14
  height: 38px;
15
15
  box-sizing: border-box;
16
- cursor: pointer
16
+ cursor: pointer;
17
17
  }
18
18
 
19
19
  .link__label {
@@ -31,7 +31,11 @@ import{i as e}from"../index-cd2f9c12.esm.js";const n=e`
31
31
  color: rgba(0, 94, 166, 0.5);
32
32
  cursor: not-allowed;
33
33
  opacity: 0.6;
34
- pointer-events:none;
34
+ pointer-events: none;
35
+ }
36
+
37
+ :host(.link--disabled) {
38
+ pointer-events: none;
35
39
  }
36
40
 
37
41
  .link:not(.link--disabled):not(.link__button):hover {
@@ -55,4 +59,8 @@ import{i as e}from"../index-cd2f9c12.esm.js";const n=e`
55
59
  border-radius: 4px;
56
60
  background: rgba(0, 94, 166, 0.1);
57
61
  }
62
+
63
+ :host([disabled]) {
64
+ pointer-events: none;
65
+ }
58
66
  `;export{n as s};
@@ -1,4 +1,4 @@
1
- import{__decorate as s}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{state as t,customElement as e}from"lit/decorators.js";import{s as l}from"./nile-link.css.esm.js";import{H as r}from"../slot.esm.js";import{ifDefined as o}from"lit/directives/if-defined.js";import{classMap as a}from"lit/directives/class-map.js";import{N as n}from"../internal/nile-element.esm.js";import{n as f}from"../property-09139d3c.esm.js";import"lit";let m=class extends n{constructor(){super(...arguments),this.hasSlotController=new r(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.disabled=!1,this.button=!1}static get styles(){return[l]}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}render(){return i`
1
+ import{__decorate as s}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{state as t,customElement as e}from"lit/decorators.js";import{s as l}from"./nile-link.css.esm.js";import{H as r}from"../slot.esm.js";import{ifDefined as o}from"lit/directives/if-defined.js";import{classMap as a}from"lit/directives/class-map.js";import{N as n}from"../internal/nile-element.esm.js";import{n as c}from"../property-09139d3c.esm.js";import"lit";let d=class extends n{constructor(){super(...arguments),this.hasSlotController=new r(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.disabled=!1,this.button=!1}static get styles(){return[l]}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick)}handleHostClick(s){this.disabled&&(s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation())}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}render(){return i`
2
2
  <div
3
3
  part="base"
4
4
  class=${a({link:!0,"link--disabled":this.disabled,link__button:this.button})}
@@ -13,4 +13,4 @@ import{__decorate as s}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
13
13
  <slot part="label" class="link__label"></slot>
14
14
  <slot name="suffix" part="suffix" class="link__suffix"></slot>
15
15
  </div>
16
- `}};s([t()],m.prototype,"hasFocus",void 0),s([f({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),s([f({type:Boolean})],m.prototype,"button",void 0),m=s([e("nile-link")],m);export{m as N};
16
+ `}};s([t()],d.prototype,"hasFocus",void 0),s([c({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),s([c({type:Boolean})],d.prototype,"button",void 0),d=s([e("nile-link")],d);export{d as N};
@@ -23,7 +23,7 @@ export const styles = css `
23
23
  gap: 8px;
24
24
  height: 38px;
25
25
  box-sizing: border-box;
26
- cursor: pointer
26
+ cursor: pointer;
27
27
  }
28
28
 
29
29
  .link__label {
@@ -41,7 +41,11 @@ export const styles = css `
41
41
  color: rgba(0, 94, 166, 0.5);
42
42
  cursor: not-allowed;
43
43
  opacity: 0.6;
44
- pointer-events:none;
44
+ pointer-events: none;
45
+ }
46
+
47
+ :host(.link--disabled) {
48
+ pointer-events: none;
45
49
  }
46
50
 
47
51
  .link:not(.link--disabled):not(.link__button):hover {
@@ -65,6 +69,10 @@ export const styles = css `
65
69
  border-radius: 4px;
66
70
  background: rgba(0, 94, 166, 0.1);
67
71
  }
72
+
73
+ :host([disabled]) {
74
+ pointer-events: none;
75
+ }
68
76
  `;
69
77
  export default [styles];
70
78
  //# sourceMappingURL=nile-link.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-link.css.js","sourceRoot":"","sources":["../../../src/nile-link/nile-link.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Link CSS\n */\nexport const styles = css`\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n height: 38px;\n box-sizing: border-box;\n cursor: pointer\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events:none;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-link.css.js","sourceRoot":"","sources":["../../../src/nile-link/nile-link.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiExB,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-element';\n\n/**\n * Link CSS\n */\nexport const styles = css`\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n height: 38px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n }\n\n :host(.link--disabled) {\n pointer-events: none;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n\n :host([disabled]) {\n pointer-events: none;\n }\n`;\n\nexport default [styles];\n"]}
@@ -23,6 +23,9 @@ export declare class NileLink extends NileElement {
23
23
  /** Disables the button. */
24
24
  disabled: boolean;
25
25
  button: boolean;
26
+ connectedCallback(): void;
27
+ disconnectedCallback(): void;
28
+ private handleHostClick;
26
29
  private handleBlur;
27
30
  private handleFocus;
28
31
  /**
@@ -35,6 +35,23 @@ let NileLink = class NileLink extends NileElement {
35
35
  static get styles() {
36
36
  return [styles];
37
37
  }
38
+ connectedCallback() {
39
+ super.connectedCallback();
40
+ this.handleHostClick = this.handleHostClick.bind(this);
41
+ this.addEventListener('click', this.handleHostClick);
42
+ }
43
+ disconnectedCallback() {
44
+ super.disconnectedCallback();
45
+ this.removeEventListener('click', this.handleHostClick);
46
+ }
47
+ handleHostClick(event) {
48
+ // Prevent the click event from being emitted when the button is disabled
49
+ if (this.disabled) {
50
+ event.preventDefault();
51
+ event.stopImmediatePropagation();
52
+ event.stopPropagation();
53
+ }
54
+ }
38
55
  handleBlur() {
39
56
  this.hasFocus = false;
40
57
  this.emit('nile-blur');
@@ -54,10 +71,11 @@ let NileLink = class NileLink extends NileElement {
54
71
  class=${classMap({
55
72
  link: true,
56
73
  'link--disabled': this.disabled,
57
- 'link__button': this.button
74
+ link__button: this.button,
58
75
  })}
59
76
  ?disabled=${ifDefined(this.disabled)}
60
- title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}
77
+ title=${this
78
+ .title /* An empty title prevents browser validation tooltips from appearing on hover */}
61
79
  aria-disabled=${this.disabled ? 'true' : 'false'}
62
80
  tabindex=${this.disabled ? '-1' : '0'}
63
81
  @blur=${this.handleBlur}
@@ -1 +1 @@
1
- {"version":3,"file":"nile-link.js","sourceRoot":"","sources":["../../../src/nile-link/nile-link.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;GAKG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,WAAW;IAAlC;;QAUY,sBAAiB,GAAG,IAA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C;wCAAgB;AAjBjC,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA2DpB;SA3DY,QAAQ;AA6DrB,eAAe,QAAQ,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport {styles} from './nile-link.css';\nimport { HasSlotController } from '../slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-link\n *\n */\n@customElement('nile-link')\nexport class NileLink extends NileElement {\n\n\t/**\n\t * The styles for Link\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @state() private hasFocus = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) button = false;\n\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n link: true,\n 'link--disabled': this.disabled,\n 'link__button': this.button\n })}\n ?disabled=${ifDefined(this.disabled)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n `;\n }\n\n\n\t/* #endregion */\n}\n\nexport default NileLink;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-link': NileLink;\n }\n }\n"]}
1
+ {"version":3,"file":"nile-link.js","sourceRoot":"","sources":["../../../src/nile-link/nile-link.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;GAKG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,WAAW;IAAlC;;QASY,sBAAiB,GAAG,IAAI,iBAAiB,CACxD,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAQ,CACT,CAAC;QAEe,aAAQ,GAAG,KAAK,CAAC;QAElC,2BAA2B;QACiB,aAAQ,GAAG,KAAK,CAAC;QAEhC,WAAM,GAAG,KAAK,CAAC;QA8D5C,gBAAgB;IAClB,CAAC;IAnFC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAgBD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IA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E,CAAC;0CAAkB;AAEhC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAgB;AArBjC,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAoFpB;SApFY,QAAQ;AAsFrB,eAAe,QAAQ,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport {styles} from './nile-link.css';\nimport { HasSlotController } from '../slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-link\n *\n */\n@customElement('nile-link')\nexport class NileLink extends NileElement {\n /**\n * The styles for Link\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n '[default]',\n 'prefix',\n 'suffix'\n );\n\n @state() private hasFocus = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) button = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n }\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n link: true,\n 'link--disabled': this.disabled,\n link__button: this.button,\n })}\n ?disabled=${ifDefined(this.disabled)}\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileLink;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-link': NileLink;\n }\n }\n"]}