@aquera/nile-elements 0.0.4-6 → 0.0.4-8
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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js +68 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.d.ts +39 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js +87 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +82 -12
- package/dist/nile-link/index.cjs.js +2 -0
- package/dist/nile-link/index.cjs.js.map +1 -0
- package/dist/nile-link/index.esm.js +1 -0
- package/dist/nile-link/nile-link.cjs.js +2 -0
- package/dist/nile-link/nile-link.cjs.js.map +1 -0
- package/dist/nile-link/nile-link.css.cjs.js +2 -0
- package/dist/nile-link/nile-link.css.cjs.js.map +1 -0
- package/dist/nile-link/nile-link.css.esm.js +56 -0
- package/dist/nile-link/nile-link.esm.js +16 -0
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.cjs.js.map +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-link/index.d.ts +1 -0
- package/dist/src/nile-link/index.js +2 -0
- package/dist/src/nile-link/index.js.map +1 -0
- package/dist/src/nile-link/nile-link.css.d.ts +12 -0
- package/dist/src/nile-link/nile-link.css.js +68 -0
- package/dist/src/nile-link/nile-link.css.js.map +1 -0
- package/dist/src/nile-link/nile-link.d.ts +39 -0
- package/dist/src/nile-link/nile-link.js +87 -0
- package/dist/src/nile-link/nile-link.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/nile-link/index.ts +1 -0
- package/src/nile-link/nile-link.css.ts +70 -0
- package/src/nile-link/nile-link.ts +91 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
System.register(["./nile-link.cjs.js","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","lit","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileLinkCjsJs){_export("NileLink",_nileLinkCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileLinkCssCjsJs){},function(_slotCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesClassMapJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function(){}};});
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
export{N as NileLink}from"./nile-link.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-link.css.esm.js";import"../slot.esm.js";import"lit/directives/if-defined.js";import"lit/directives/class-map.js";import"../internal/nile-element.esm.js";import"lit";import"../property-09139d3c.esm.js";
|
@@ -0,0 +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));}};});
|
2
|
+
//# sourceMappingURL=nile-link.cjs.js.map
|
@@ -0,0 +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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AAAJ,GAAA,UAAAc,GAAA,CAjDK,SAAAA,IAAA,CAAWC,CACjB,MAAO,CAACA,CAAAA,CACR,EAYQ,WAAAxB,CAAA,GApBoByB,CAAAA,GAYnBC,CAAA,CAAA,CAARC,CAAiC5B,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA6B,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAGUF,CAAA,CAAA,CAA3CG,EAAS,CAAEC,IAAAA,CAAMC,OAASC,CAAAA,OAAAA,CAAAA,CAAS,KAAyBjC,CAAA6B,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEhCF,CAAA,CAAA,CAA5BG,CAAS,CAAA,CAAEC,KAAMC,OAA0BhC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA6B,SAAA,CAAA,QAAA,CAAA,IAAA,gBAjBjC7B,CAAQ2B,CAAAA,CAAAA,CAAA,CADpBO,CAAAA,CAAc,cACFlC"}
|
@@ -0,0 +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 }\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 }\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"]))));}};});
|
2
|
+
//# sourceMappingURL=nile-link.css.cjs.js.map
|
@@ -0,0 +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 }\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 }\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"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import{i as e}from"../index-cd2f9c12.esm.js";const n=e`
|
2
|
+
:host {
|
3
|
+
}
|
4
|
+
|
5
|
+
.link {
|
6
|
+
display: inline-flex;
|
7
|
+
align-items: center;
|
8
|
+
justify-content: center;
|
9
|
+
text-align: center;
|
10
|
+
user-select: none;
|
11
|
+
white-space: nowrap;
|
12
|
+
padding: 12px;
|
13
|
+
gap: 8px;
|
14
|
+
height: 38px;
|
15
|
+
box-sizing: border-box;
|
16
|
+
}
|
17
|
+
|
18
|
+
.link__label {
|
19
|
+
color: #005ea6;
|
20
|
+
text-align: center;
|
21
|
+
font-family: Colfax-regular;
|
22
|
+
font-size: 14px;
|
23
|
+
font-style: normal;
|
24
|
+
font-weight: 400;
|
25
|
+
line-height: 14px;
|
26
|
+
letter-spacing: 0.2px;
|
27
|
+
}
|
28
|
+
|
29
|
+
.link--disabled {
|
30
|
+
color: rgba(0, 94, 166, 0.5);
|
31
|
+
cursor: not-allowed;
|
32
|
+
opacity: 0.6;
|
33
|
+
}
|
34
|
+
|
35
|
+
.link:not(.link--disabled):not(.link__button):hover {
|
36
|
+
color: #005291;
|
37
|
+
text-decoration-line: underline;
|
38
|
+
}
|
39
|
+
|
40
|
+
.link:not(.link--disabled):not(.link__button):active {
|
41
|
+
color: #002f53;
|
42
|
+
text-decoration-line: underline;
|
43
|
+
}
|
44
|
+
|
45
|
+
.link__button:hover {
|
46
|
+
color: #005291;
|
47
|
+
border-radius: 4px;
|
48
|
+
background: #f5f7f7;
|
49
|
+
}
|
50
|
+
|
51
|
+
.link__button:active {
|
52
|
+
color: #002f53;
|
53
|
+
border-radius: 4px;
|
54
|
+
background: rgba(0, 94, 166, 0.1);
|
55
|
+
}
|
56
|
+
`;export{n as s};
|
@@ -0,0 +1,16 @@
|
|
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`
|
2
|
+
<div
|
3
|
+
part="base"
|
4
|
+
class=${a({link:!0,"link--disabled":this.disabled,link__button:this.button})}
|
5
|
+
?disabled=${o(this.disabled)}
|
6
|
+
title=${this.title}
|
7
|
+
aria-disabled=${this.disabled?"true":"false"}
|
8
|
+
tabindex=${this.disabled?"-1":"0"}
|
9
|
+
@blur=${this.handleBlur}
|
10
|
+
@focus=${this.handleFocus}
|
11
|
+
>
|
12
|
+
<slot name="prefix" part="prefix" class="link__prefix"></slot>
|
13
|
+
<slot part="label" class="link__label"></slot>
|
14
|
+
<slot name="suffix" part="suffix" class="link__suffix"></slot>
|
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};
|
package/dist/slot.cjs.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";return{setters:[],execute:function(){}};});
|
1
|
+
System.register([],function(_export,_context){"use strict";var t;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);}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}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);}return{setters:[],execute:function(){_export("H",t=/*#__PURE__*/function(){function t(_t){_classCallCheck(this,t);for(var _len=arguments.length,s=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){s[_key-1]=arguments[_key];}this.slotNames=[],(this.host=_t).addController(this),this.slotNames=s,this.handleSlotChange=this.handleSlotChange.bind(this);}_createClass(t,[{key:"hasDefaultSlot",value:function hasDefaultSlot(){return _toConsumableArray(this.host.childNodes).some(function(_t2){if(_t2.nodeType===_t2.TEXT_NODE&&""!==_t2.textContent.trim())return!0;if(_t2.nodeType===_t2.ELEMENT_NODE){var s=_t2;if("nile-visually-hidden"===s.tagName.toLowerCase())return!1;if(!s.hasAttribute("slot"))return!0;}return!1;});}},{key:"hasNamedSlot",value:function hasNamedSlot(_t3){return null!==this.host.querySelector(":scope > [slot=\"".concat(_t3,"\"]"));}},{key:"test",value:function test(_t4){return"[default]"===_t4?this.hasDefaultSlot():this.hasNamedSlot(_t4);}},{key:"hostConnected",value:function hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange);}},{key:"hostDisconnected",value:function hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange);}},{key:"handleSlotChange",value:function handleSlotChange(_t5){var s=_t5.target;(this.slotNames.includes("[default]")&&!s.name||s.name&&this.slotNames.includes(s.name))&&this.host.requestUpdate();}}]);return t;}());}};});
|
2
2
|
//# sourceMappingURL=slot.cjs.js.map
|
package/dist/slot.cjs.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slot.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"slot.cjs.js","sources":["../../src/slot.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/** A reactive controller that determines when slots exist. */\nexport class HasSlotController implements ReactiveController {\n host: ReactiveControllerHost & Element;\n slotNames: string[] = [];\n\n constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]) {\n (this.host = host).addController(this);\n this.slotNames = slotNames;\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n private hasDefaultSlot() {\n return [...this.host.childNodes].some(node => {\n if (node.nodeType === node.TEXT_NODE && node.textContent!.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n const tagName = el.tagName.toLowerCase();\n\n // Ignore visually hidden elements since they aren't rendered\n if (tagName === 'nile-visually-hidden') {\n return false;\n }\n\n // If it doesn't have a slot attribute, it's part of the default slot\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n }\n\n private hasNamedSlot(name: string) {\n return this.host.querySelector(`:scope > [slot=\"${name}\"]`) !== null;\n }\n\n test(slotName: string) {\n return slotName === '[default]' ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);\n }\n\n hostConnected() {\n this.host.shadowRoot!.addEventListener('slotchange', this.handleSlotChange);\n }\n\n hostDisconnected() {\n this.host.shadowRoot!.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n handleSlotChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n\n if ((this.slotNames.includes('[default]') && !slot.name) || (slot.name && this.slotNames.includes(slot.name))) {\n this.host.requestUpdate();\n }\n }\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n * HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n */\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n * string. This is useful because we can't use slot.textContent as an alternative.\n */\nexport function getTextContent(slot: HTMLSlotElement | undefined | null): string {\n if (!slot) {\n return '';\n }\n const nodes = slot.assignedNodes({ flatten: true });\n let text = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n"],"names":["HasSlotController","t","host","this","slotNames","addController","handleSlotChange","bind","_createClass","key","value","hasDefaultSlot","_toConsumableArray","childNodes","some","node","nodeType","TEXT_NODE","textContent","trim","ELEMENT_NODE","el","tagName","toLowerCase","hasAttribute","hasNamedSlot","name","querySelector","test","slotName","hostConnected","shadowRoot","addEventListener","hostDisconnected","removeEventListener","event","slot","target","includes","requestUpdate"],"mappings":"4kFAGaA,CAIX,yBAAA,SAAAC,EAAYC,EAAAA,CAFZC,CAAAA,eAAAA,MAAAA,CAAAA,UAAAA,IAAAA,CAAAA,SAAAA,CAAAA,MAAAA,CAEuDC,CAFvDD,KAAAA,KAAAA,CAAAA,IAAAA,GAAAA,IAAAA,MAAAA,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA,IAAAA,IAEuDC,CAFvDD,CAAAA,IAAAA,IAAAA,SAAAA,CAAAA,IAAAA,GAAAA,IAAAA,CAASC,SAAa,CAAA,EAAA,CAAA,CAGnBD,IAAKD,CAAAA,IAAAA,CAAOA,EAAMG,EAAAA,aAAAA,CAAcF,MACjCA,IAAKC,CAAAA,SAAAA,CAAYA,CACjBD,CAAAA,IAAAA,CAAKG,gBAAmBH,CAAAA,IAAAA,CAAKG,gBAAiBC,CAAAA,IAAAA,CAAKJ,KACpD,EAEOK,YAAA,CAAAP,CAAA,GAAAQ,GAAA,kBAAAC,KAAA,UAAAC,eAAA,CACN,CAAA,MAAO,CAAAC,kBAAA,CAAIT,IAAAA,CAAKD,IAAKW,CAAAA,UAAAA,EAAYC,KAAKC,SAAAA,GACpC,CAAA,CAAA,GAAIA,GAAKC,CAAAA,QAAAA,GAAaD,GAAKE,CAAAA,SAAAA,EAA0C,EAA7BF,GAAAA,GAAAA,CAAKG,WAAaC,CAAAA,IAAAA,CAAAA,CAAAA,CACxD,MAAO,CAAA,CAAA,CAGT,GAAIJ,GAAAA,CAAKC,QAAaD,GAAAA,GAAAA,CAAKK,aAAc,CACvC,GAAMC,CAAAA,CAAKN,CAAAA,GAAAA,CAIX,GAAgB,sBAAA,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dist/slot.esm.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
class t{constructor(t,...s){this.slotNames=[],(this.host=t).addController(this),this.slotNames=s,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const s=t;if("nile-visually-hidden"===s.tagName.toLowerCase())return!1;if(!s.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const s=t.target;(this.slotNames.includes("[default]")&&!s.name||s.name&&this.slotNames.includes(s.name))&&this.host.requestUpdate()}}export{t as H};
|
package/dist/src/index.d.ts
CHANGED
@@ -29,3 +29,4 @@ export { NileErrorMessage } from './nile-error-message';
|
|
29
29
|
export { NileFormErrorMessage } from './nile-form-error-message';
|
30
30
|
export { NileFormHelpText } from './nile-form-help-text';
|
31
31
|
export { NileCalendar } from './nile-calendar';
|
32
|
+
export { NileLink } from './nile-link';
|
package/dist/src/index.js
CHANGED
@@ -29,4 +29,5 @@ export { NileErrorMessage } from './nile-error-message';
|
|
29
29
|
export { NileFormErrorMessage } from './nile-form-error-message';
|
30
30
|
export { NileFormHelpText } from './nile-form-help-text';
|
31
31
|
export { NileCalendar } from './nile-calendar';
|
32
|
+
export { NileLink } from './nile-link';
|
32
33
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAA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AAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { NileButton } from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;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,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC","sourcesContent":["export { NileButton } from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\nexport { NileLink} from './nile-link';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileLink } from './nile-link';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC","sourcesContent":["export { NileLink} from './nile-link';\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* Link CSS
|
9
|
+
*/
|
10
|
+
export declare const styles: import("lit-element").CSSResult;
|
11
|
+
declare const _default: import("lit-element").CSSResult[];
|
12
|
+
export default _default;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { css } from 'lit-element';
|
8
|
+
/**
|
9
|
+
* Link CSS
|
10
|
+
*/
|
11
|
+
export const styles = css `
|
12
|
+
:host {
|
13
|
+
}
|
14
|
+
|
15
|
+
.link {
|
16
|
+
display: inline-flex;
|
17
|
+
align-items: center;
|
18
|
+
justify-content: center;
|
19
|
+
text-align: center;
|
20
|
+
user-select: none;
|
21
|
+
white-space: nowrap;
|
22
|
+
padding: 12px;
|
23
|
+
gap: 8px;
|
24
|
+
height: 38px;
|
25
|
+
box-sizing: border-box;
|
26
|
+
}
|
27
|
+
|
28
|
+
.link__label {
|
29
|
+
color: #005ea6;
|
30
|
+
text-align: center;
|
31
|
+
font-family: Colfax-regular;
|
32
|
+
font-size: 14px;
|
33
|
+
font-style: normal;
|
34
|
+
font-weight: 400;
|
35
|
+
line-height: 14px;
|
36
|
+
letter-spacing: 0.2px;
|
37
|
+
}
|
38
|
+
|
39
|
+
.link--disabled {
|
40
|
+
color: rgba(0, 94, 166, 0.5);
|
41
|
+
cursor: not-allowed;
|
42
|
+
opacity: 0.6;
|
43
|
+
}
|
44
|
+
|
45
|
+
.link:not(.link--disabled):not(.link__button):hover {
|
46
|
+
color: #005291;
|
47
|
+
text-decoration-line: underline;
|
48
|
+
}
|
49
|
+
|
50
|
+
.link:not(.link--disabled):not(.link__button):active {
|
51
|
+
color: #002f53;
|
52
|
+
text-decoration-line: underline;
|
53
|
+
}
|
54
|
+
|
55
|
+
.link__button:hover {
|
56
|
+
color: #005291;
|
57
|
+
border-radius: 4px;
|
58
|
+
background: #f5f7f7;
|
59
|
+
}
|
60
|
+
|
61
|
+
.link__button:active {
|
62
|
+
color: #002f53;
|
63
|
+
border-radius: 4px;
|
64
|
+
background: rgba(0, 94, 166, 0.1);
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
export default [styles];
|
68
|
+
//# sourceMappingURL=nile-link.css.js.map
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDxB,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 }\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 }\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"]}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { CSSResultArray, TemplateResult } from 'lit-element';
|
8
|
+
import NileElement from '../internal/nile-element';
|
9
|
+
/**
|
10
|
+
* Nile icon component.
|
11
|
+
*
|
12
|
+
* @tag nile-link
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
export declare class NileLink extends NileElement {
|
16
|
+
/**
|
17
|
+
* The styles for Link
|
18
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
19
|
+
*/
|
20
|
+
static get styles(): CSSResultArray;
|
21
|
+
private readonly hasSlotController;
|
22
|
+
private hasFocus;
|
23
|
+
/** Disables the button. */
|
24
|
+
disabled: boolean;
|
25
|
+
button: boolean;
|
26
|
+
private handleBlur;
|
27
|
+
private handleFocus;
|
28
|
+
/**
|
29
|
+
* Render method
|
30
|
+
* @slot This is a slot test
|
31
|
+
*/
|
32
|
+
render(): TemplateResult;
|
33
|
+
}
|
34
|
+
export default NileLink;
|
35
|
+
declare global {
|
36
|
+
interface HTMLElementTagNameMap {
|
37
|
+
'nile-link': NileLink;
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { __decorate } from "tslib";
|
8
|
+
import { html, property } from 'lit-element';
|
9
|
+
import { customElement, state } from 'lit/decorators.js';
|
10
|
+
import { styles } from './nile-link.css';
|
11
|
+
import { HasSlotController } from '../slot';
|
12
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
13
|
+
import { classMap } from 'lit/directives/class-map.js';
|
14
|
+
import NileElement from '../internal/nile-element';
|
15
|
+
/**
|
16
|
+
* Nile icon component.
|
17
|
+
*
|
18
|
+
* @tag nile-link
|
19
|
+
*
|
20
|
+
*/
|
21
|
+
let NileLink = class NileLink extends NileElement {
|
22
|
+
constructor() {
|
23
|
+
super(...arguments);
|
24
|
+
this.hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');
|
25
|
+
this.hasFocus = false;
|
26
|
+
/** Disables the button. */
|
27
|
+
this.disabled = false;
|
28
|
+
this.button = false;
|
29
|
+
/* #endregion */
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* The styles for Link
|
33
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
34
|
+
*/
|
35
|
+
static get styles() {
|
36
|
+
return [styles];
|
37
|
+
}
|
38
|
+
handleBlur() {
|
39
|
+
this.hasFocus = false;
|
40
|
+
this.emit('nile-blur');
|
41
|
+
}
|
42
|
+
handleFocus() {
|
43
|
+
this.hasFocus = true;
|
44
|
+
this.emit('nile-focus');
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Render method
|
48
|
+
* @slot This is a slot test
|
49
|
+
*/
|
50
|
+
render() {
|
51
|
+
return html `
|
52
|
+
<div
|
53
|
+
part="base"
|
54
|
+
class=${classMap({
|
55
|
+
link: true,
|
56
|
+
'link--disabled': this.disabled,
|
57
|
+
'link__button': this.button
|
58
|
+
})}
|
59
|
+
?disabled=${ifDefined(this.disabled)}
|
60
|
+
title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}
|
61
|
+
aria-disabled=${this.disabled ? 'true' : 'false'}
|
62
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
63
|
+
@blur=${this.handleBlur}
|
64
|
+
@focus=${this.handleFocus}
|
65
|
+
>
|
66
|
+
<slot name="prefix" part="prefix" class="link__prefix"></slot>
|
67
|
+
<slot part="label" class="link__label"></slot>
|
68
|
+
<slot name="suffix" part="suffix" class="link__suffix"></slot>
|
69
|
+
</div>
|
70
|
+
`;
|
71
|
+
}
|
72
|
+
};
|
73
|
+
__decorate([
|
74
|
+
state()
|
75
|
+
], NileLink.prototype, "hasFocus", void 0);
|
76
|
+
__decorate([
|
77
|
+
property({ type: Boolean, reflect: true })
|
78
|
+
], NileLink.prototype, "disabled", void 0);
|
79
|
+
__decorate([
|
80
|
+
property({ type: Boolean })
|
81
|
+
], NileLink.prototype, "button", void 0);
|
82
|
+
NileLink = __decorate([
|
83
|
+
customElement('nile-link')
|
84
|
+
], NileLink);
|
85
|
+
export { NileLink };
|
86
|
+
export default NileLink;
|
87
|
+
//# sourceMappingURL=nile-link.js.map
|
@@ -0,0 +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;;;;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E,IAAI,EAAE,CAAC;0CAAkB;AAEhC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;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"]}
|