@aquera/nile-elements 0.0.6-11 → 0.0.6-12
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/nile-button-toggle/nile-button-toggle.css.js +4 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.d.ts +4 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.js +12 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +6 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +30 -7
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/demo/index.html +1 -1
- package/dist/index.iife.js +6 -4
- package/dist/nile-button-toggle/index.cjs.js +1 -1
- package/dist/nile-button-toggle/index.esm.js +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.cjs.js +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +4 -0
- package/dist/nile-button-toggle/nile-button-toggle.esm.js +3 -3
- package/dist/nile-button-toggle-group/index.cjs.js +1 -1
- package/dist/nile-button-toggle-group/index.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +1 -3
- package/dist/src/nile-button-toggle/nile-button-toggle.css.js +4 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
- package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +4 -2
- package/dist/src/nile-button-toggle/nile-button-toggle.js +12 -2
- package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +6 -2
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +30 -7
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-button-toggle/nile-button-toggle.css.ts +4 -0
- package/src/nile-button-toggle/nile-button-toggle.ts +9 -2
- package/src/nile-button-toggle-group/nile-button-toggle-group.ts +51 -26
package/demo/index.html
CHANGED
@@ -189,7 +189,7 @@
|
|
189
189
|
const w = new Worker('fetchTextFromFileWorker.js');
|
190
190
|
const getMessage = (msg)=>{
|
191
191
|
const icons = splitStringBy(msg.data, ',');
|
192
|
-
renderNewIcons(icons)
|
192
|
+
// renderNewIcons(icons)
|
193
193
|
}
|
194
194
|
function splitStringBy(str, seperator){
|
195
195
|
return str.split(seperator)
|
package/dist/index.iife.js
CHANGED
@@ -4363,14 +4363,16 @@ const bM=Symbol.for(""),ZM=M=>{if((null==M?void 0:M.r)===bM)return null==M?void
|
|
4363
4363
|
.nile-button-toggle__active {
|
4364
4364
|
background-color: #c7ced4;
|
4365
4365
|
}
|
4366
|
-
|
4366
|
+
|
4367
|
+
.nile-button-toggle__disabled {
|
4368
|
+
cursor: not-allowed;
|
4369
|
+
}
|
4370
|
+
`;M.NileButtonToggle=class extends BM{constructor(){super(...arguments),this.active=!1,this.initial=!1,this.middle=!1,this.end=!1,this.disabled=!1,this.value=""}static get styles(){return[WD]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.toggle)}disconnectedCallback(){this.removeEventListener("click",this.toggle),super.disconnectedCallback()}toggle(){if(this.disabled)return;this.active=!0;const M={active:this.active,value:this.value};this.dispatchEvent(new CustomEvent("nile-toggle-changed",{detail:M,bubbles:!0}))}render(){let M=["nile-button-toggle"];this.active&&M.push("nile-button-toggle__active"),this.initial&&M.push("nile-button-toggle__initial"),this.middle&&M.push("nile-button-toggle__middle"),this.end&&M.push("nile-button-toggle__end"),this.disabled&&M.push("nile-button-toggle__disabled");const N=M.join(" ");return V`
|
4367
4371
|
<div class="${N}">
|
4368
4372
|
<slot name="prefix"></slot>
|
4369
4373
|
<slot> </slot>
|
4370
4374
|
</div>
|
4371
|
-
`}},N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"active",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"initial",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"middle",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"end",void 0),N([zM({type:String})],M.NileButtonToggle.prototype,"value",void 0),M.NileButtonToggle=N([uM("nile-button-toggle")],M.NileButtonToggle);var VD=M.NileButtonToggle;M.NileButtonToggleGroup=class extends
|
4372
|
-
<slot> </slot>
|
4373
|
-
`}},N([function(M){return tM({descriptor:N=>({get(){var N,D;return null!==(D=null===(N=this.renderRoot)||void 0===N?void 0:N.querySelectorAll(M))&&void 0!==D?D:[]},enumerable:!0,configurable:!0})})}("nile-button-toggle")],M.NileButtonToggleGroup.prototype,"toggles",void 0),N([yM("slot:not([name])")],M.NileButtonToggleGroup.prototype,"defaultSlot",void 0),M.NileButtonToggleGroup=N([uM("nile-button-toggle-group")],M.NileButtonToggleGroup);const vD=u`
|
4375
|
+
`}},N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"active",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"initial",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"middle",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"end",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggle.prototype,"disabled",void 0),N([zM({type:String})],M.NileButtonToggle.prototype,"value",void 0),M.NileButtonToggle=N([uM("nile-button-toggle")],M.NileButtonToggle);var VD=M.NileButtonToggle;M.NileButtonToggleGroup=class extends BM{constructor(){super(...arguments),this.disabled=!1}static get styles(){return[pD]}connectedCallback(){super.connectedCallback()}firstUpdated(){this.defaultSlot.addEventListener("slotchange",(()=>this.updateTogglePositions())),this.addEventListener("nile-toggle-changed",this.handleToggle),this.updateTogglePositions()}updated(M){super.updated(M),M.has("disabled")&&this.updateDisabledState()}updateDisabledState(){this.defaultSlot.assignedNodes({flatten:!0}).filter((M=>M instanceof VD)).forEach((M=>{M.disabled||(M.disabled=this.disabled)}))}updateTogglePositions(){const M=this.defaultSlot.assignedNodes({flatten:!0}).filter((M=>M instanceof VD));M.forEach(((N,D)=>{N.initial=0===D,N.middle=D>0&&D<M.length-1,N.end=D===M.length-1}))}handleToggle(M){if(this.disabled)return;const N=this.querySelectorAll("nile-button-toggle");N&&M.detail.active&&(N.forEach((N=>{N!==M.target&&(N.active=!1)})),this.emit("nile-change",{value:M.detail.value}))}render(){return V` <slot> </slot> `}},N([function(M){return tM({descriptor:N=>({get(){var N,D;return null!==(D=null===(N=this.renderRoot)||void 0===N?void 0:N.querySelectorAll(M))&&void 0!==D?D:[]},enumerable:!0,configurable:!0})})}("nile-button-toggle")],M.NileButtonToggleGroup.prototype,"toggles",void 0),N([yM("slot:not([name])")],M.NileButtonToggleGroup.prototype,"defaultSlot",void 0),N([zM({type:Boolean,reflect:!0})],M.NileButtonToggleGroup.prototype,"disabled",void 0),M.NileButtonToggleGroup=N([uM("nile-button-toggle-group")],M.NileButtonToggleGroup);const vD=u`
|
4374
4376
|
:host {
|
4375
4377
|
display: inline-block;
|
4376
4378
|
width: 100%;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["./nile-button-toggle.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle.css.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileButtonToggleCjsJs){_export("NileButtonToggle",_nileButtonToggleCjsJs.a);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileButtonToggleCssCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
|
1
|
+
System.register(["./nile-button-toggle.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle.css.cjs.js","../internal/nile-element.cjs.js","lit","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileButtonToggleCjsJs){_export("NileButtonToggle",_nileButtonToggleCjsJs.a);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileButtonToggleCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
export{a as NileButtonToggle}from"./nile-button-toggle.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-button-toggle.css.esm.js";import"../property-09139d3c.esm.js";
|
1
|
+
export{a as NileButtonToggle}from"./nile-button-toggle.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-button-toggle.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../property-09139d3c.esm.js";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle.css.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";var t,e,i,o,s,l,_templateObject,n,r;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){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.
|
1
|
+
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle.css.cjs.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,o,s,l,_templateObject,n,r;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){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.customElement;},function(_nileButtonToggleCssCjsJs){o=_nileButtonToggleCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("a",n=/*#__PURE__*/function(_s){_inherits(n,_s);var _super=_createSuper(n);function n(){var _this;_classCallCheck(this,n);_this=_super.apply(this,arguments),_this.active=!1,_this.initial=!1,_this.middle=!1,_this.end=!1,_this.disabled=!1,_this.value="";return _this;}_createClass(n,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(n.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this.toggle);}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.removeEventListener("click",this.toggle),_get(_getPrototypeOf(n.prototype),"disconnectedCallback",this).call(this);}},{key:"toggle",value:function toggle(){if(this.disabled)return;this.active=!0;var t={active:this.active,value:this.value};this.dispatchEvent(new CustomEvent("nile-toggle-changed",{detail:t,bubbles:!0}));}},{key:"render",value:function render(){var t=["nile-button-toggle"];this.active&&t.push("nile-button-toggle__active"),this.initial&&t.push("nile-button-toggle__initial"),this.middle&&t.push("nile-button-toggle__middle"),this.end&&t.push("nile-button-toggle__end"),this.disabled&&t.push("nile-button-toggle__disabled");var i=t.join(" ");return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"","\">\n <slot name=\"prefix\"></slot>\n <slot> </slot>\n </div>\n "])),i);}}],[{key:"styles",get:function get(){return[o];}}]);return n;}(s));t([l({type:Boolean,reflect:!0})],n.prototype,"active",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"initial",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"middle",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"end",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),t([l({type:String})],n.prototype,"value",void 0),_export("a",n=t([i("nile-button-toggle")],n));_export("N",r=n);}};});
|
2
2
|
//# sourceMappingURL=nile-button-toggle.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button-toggle.cjs.js","sources":["../../../src/nile-button-toggle/nile-button-toggle.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 } from 'lit/decorators.js';\nimport {styles} from './nile-button-toggle.css';\n\n/**\n * Nile icon component.\n *\n * @tag nile-button-toggle\n *\n */\n@customElement('nile-button-toggle')\nexport class NileButtonToggle extends
|
1
|
+
{"version":3,"file":"nile-button-toggle.cjs.js","sources":["../../../src/nile-button-toggle/nile-button-toggle.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 } from 'lit/decorators.js';\nimport {styles} from './nile-button-toggle.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile icon component.\n *\n * @tag nile-button-toggle\n *\n */\n@customElement('nile-button-toggle')\nexport class NileButtonToggle extends NileElement {\n\n\t/**\n\t * The styles for ButtonToggle\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 @property({ type: Boolean, reflect: true })\n active = false;\n\n @property({ type: Boolean, reflect: true })\n initial = false;\n\n @property({ type: Boolean, reflect: true })\n middle = false;\n\n @property({ type: Boolean, reflect: true })\n end = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: String })\n value = '';\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.toggle);\n }\n\n disconnectedCallback() {\n this.removeEventListener('click', this.toggle);\n super.disconnectedCallback();\n }\n\n toggle() {\n if (this.disabled) return;\n this.active = true;\n const eventData = { active: this.active, value: this.value };\n this.dispatchEvent(new CustomEvent('nile-toggle-changed', { detail: eventData, bubbles: true }));\n }\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n public render(): TemplateResult {\n let classes = ['nile-button-toggle'];\n if (this.active) {\n classes.push('nile-button-toggle__active');\n }\n if (this.initial) {\n classes.push('nile-button-toggle__initial');\n }\n if (this.middle) {\n classes.push('nile-button-toggle__middle');\n }\n if (this.end) {\n classes.push('nile-button-toggle__end');\n }\n if (this.disabled) {\n classes.push('nile-button-toggle__disabled');\n }\n\n const classString = classes.join(' ');\n\n return html`\n <div class=\"${classString}\">\n <slot name=\"prefix\"></slot>\n <slot> </slot>\n </div>\n `;\n }\n\n\t/* #endregion */\n}\n\nexport default NileButtonToggle;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button-toggle': NileButtonToggle;\n }\n}\n"],"names":["NileButtonToggle","n","constructor","this","active","initial","middle","end","disabled","value","_this","_createClass","key","connectedCallback","super","addEventListener","toggle","disconnectedCallback","removeEventListener","eventData","dispatchEvent","CustomEvent","detail","bubbles","render","classes","push","classString","join","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","property","type","Boolean","reflect","prototype","String","_export","customElement","NileButtonToggle$1"],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AAA,CAAAA,CAAAA,CAAA,CADCC,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,SAAS,CACrBvC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwC,UAAA,QAAA,CAAA,IAAA,EAAA,CAAA,CAGfL,EAAA,CADCC,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACxBvC,CAAAwC,CAAAA,SAAAA,CAAA,UAAA,EAGZL,CAAAA,CAAAA,CAAAA,CAAA,CADCC,CAAAA,CAAS,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,SAAS,CACnBvC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwC,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAGjBL,CAAA,CAAA,CADCC,EAAS,CAAEC,IAAAA,CAAMI,MACPzC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwC,UAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAAAE,OAAA,KA1BA1C,CAAgBmC,CAAAA,CAAAA,CAAA,CAD5BQ,CAAc,CAAA,oBAAA,CAAA,CAAA,CACF3C,IAgFb0C,OAAA,KAAAE,CAAAA,CAAe5C"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,o;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",o=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .nile-button-toggle {\n display: flex;\n padding: 12px;\n border: 1px solid #ccc;\n cursor: pointer;\n border-radius: 4px;\n color: #000;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n line-height: 14px;\n letter-spacing: 0.2px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n }\n\n .nile-button-toggle__initial {\n border-radius: 4px 0 0 4px;\n }\n\n .nile-button-toggle__end {\n border-radius: 0 4px 4px 0;\n }\n\n .nile-button-toggle__middle {\n border-width: 1px 0px;\n border-style: solid;\n border-color: #ccc;\n border-radius: 0;\n }\n\n .nile-button-toggle__active {\n background-color: #c7ced4;\n }\n"]))));}};});
|
1
|
+
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,o;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",o=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .nile-button-toggle {\n display: flex;\n padding: 12px;\n border: 1px solid #ccc;\n cursor: pointer;\n border-radius: 4px;\n color: #000;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n line-height: 14px;\n letter-spacing: 0.2px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n }\n\n .nile-button-toggle__initial {\n border-radius: 4px 0 0 4px;\n }\n\n .nile-button-toggle__end {\n border-radius: 0 4px 4px 0;\n }\n\n .nile-button-toggle__middle {\n border-width: 1px 0px;\n border-style: solid;\n border-color: #ccc;\n border-radius: 0;\n }\n\n .nile-button-toggle__active {\n background-color: #c7ced4;\n }\n\n .nile-button-toggle__disabled {\n cursor: not-allowed;\n }\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-button-toggle.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button-toggle.css.cjs.js","sources":["../../../src/nile-button-toggle/nile-button-toggle.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 * ButtonToggle CSS\n */\nexport const styles = css`\n :host {\n }\n\n .nile-button-toggle {\n display: flex;\n padding: 12px;\n border: 1px solid #ccc;\n cursor: pointer;\n border-radius: 4px;\n color: #000;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n line-height: 14px;\n letter-spacing: 0.2px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n }\n\n .nile-button-toggle__initial {\n border-radius: 4px 0 0 4px;\n }\n\n .nile-button-toggle__end {\n border-radius: 0 4px 4px 0;\n }\n\n .nile-button-toggle__middle {\n border-width: 1px 0px;\n border-style: solid;\n border-color: #ccc;\n border-radius: 0;\n }\n\n .nile-button-toggle__active {\n background-color: #c7ced4;\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-button-toggle.css.cjs.js","sources":["../../../src/nile-button-toggle/nile-button-toggle.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 * ButtonToggle CSS\n */\nexport const styles = css`\n :host {\n }\n\n .nile-button-toggle {\n display: flex;\n padding: 12px;\n border: 1px solid #ccc;\n cursor: pointer;\n border-radius: 4px;\n color: #000;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n line-height: 14px;\n letter-spacing: 0.2px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n }\n\n .nile-button-toggle__initial {\n border-radius: 4px 0 0 4px;\n }\n\n .nile-button-toggle__end {\n border-radius: 0 4px 4px 0;\n }\n\n .nile-button-toggle__middle {\n border-width: 1px 0px;\n border-style: solid;\n border-color: #ccc;\n border-radius: 0;\n }\n\n .nile-button-toggle__active {\n background-color: #c7ced4;\n }\n\n .nile-button-toggle__disabled {\n cursor: not-allowed;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
2
|
-
<div class="${
|
1
|
+
import{__decorate as t}from"tslib";import{x as e}from"../index-cd2f9c12.esm.js";import{customElement as i}from"lit/decorators.js";import{s as o}from"./nile-button-toggle.css.esm.js";import{N as s}from"../internal/nile-element.esm.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";let n=class extends s{constructor(){super(...arguments),this.active=!1,this.initial=!1,this.middle=!1,this.end=!1,this.disabled=!1,this.value=""}static get styles(){return[o]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.toggle)}disconnectedCallback(){this.removeEventListener("click",this.toggle),super.disconnectedCallback()}toggle(){if(this.disabled)return;this.active=!0;const t={active:this.active,value:this.value};this.dispatchEvent(new CustomEvent("nile-toggle-changed",{detail:t,bubbles:!0}))}render(){let t=["nile-button-toggle"];this.active&&t.push("nile-button-toggle__active"),this.initial&&t.push("nile-button-toggle__initial"),this.middle&&t.push("nile-button-toggle__middle"),this.end&&t.push("nile-button-toggle__end"),this.disabled&&t.push("nile-button-toggle__disabled");const i=t.join(" ");return e`
|
2
|
+
<div class="${i}">
|
3
3
|
<slot name="prefix"></slot>
|
4
4
|
<slot> </slot>
|
5
5
|
</div>
|
6
|
-
`}};t([l({type:Boolean,reflect:!0})],n.prototype,"active",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"initial",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"middle",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"end",void 0),t([l({type:String})],n.prototype,"value",void 0),n=t([
|
6
|
+
`}};t([l({type:Boolean,reflect:!0})],n.prototype,"active",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"initial",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"middle",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"end",void 0),t([l({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),t([l({type:String})],n.prototype,"value",void 0),n=t([i("nile-button-toggle")],n);var r=n;export{r as N,n as a};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["./nile-button-toggle-group.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle-group.css.cjs.js","../nile-button-toggle/nile-button-toggle.cjs.js","../nile-button-toggle/nile-button-toggle.css.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileButtonToggleGroupCjsJs){_export("NileButtonToggleGroup",_nileButtonToggleGroupCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileButtonToggleGroupCssCjsJs){},function(_nileButtonToggleNileButtonToggleCjsJs){},function(_nileButtonToggleNileButtonToggleCssCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
|
1
|
+
System.register(["./nile-button-toggle-group.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle-group.css.cjs.js","../nile-button-toggle/nile-button-toggle.cjs.js","../nile-button-toggle/nile-button-toggle.css.cjs.js","../internal/nile-element.cjs.js","lit","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileButtonToggleGroupCjsJs){_export("NileButtonToggleGroup",_nileButtonToggleGroupCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileButtonToggleGroupCssCjsJs){},function(_nileButtonToggleNileButtonToggleCjsJs){},function(_nileButtonToggleNileButtonToggleCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
export{N as NileButtonToggleGroup}from"./nile-button-toggle-group.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-button-toggle-group.css.esm.js";import"../nile-button-toggle/nile-button-toggle.esm.js";import"../nile-button-toggle/nile-button-toggle.css.esm.js";import"../property-09139d3c.esm.js";
|
1
|
+
export{N as NileButtonToggleGroup}from"./nile-button-toggle-group.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-button-toggle-group.css.esm.js";import"../nile-button-toggle/nile-button-toggle.esm.js";import"../nile-button-toggle/nile-button-toggle.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../property-09139d3c.esm.js";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle-group.css.cjs.js","../nile-button-toggle/nile-button-toggle.cjs.js","../nile-button-toggle/nile-button-toggle.css.cjs.js","
|
1
|
+
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-button-toggle-group.css.cjs.js","../nile-button-toggle/nile-button-toggle.cjs.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","../nile-button-toggle/nile-button-toggle.css.cjs.js","lit"],function(_export,_context){"use strict";var t,e,o,s,i,l,n,r,a,_templateObject,g;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){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.x;},function(_litDecoratorsJs){o=_litDecoratorsJs.queryAll;s=_litDecoratorsJs.query;i=_litDecoratorsJs.customElement;},function(_nileButtonToggleGroupCssCjsJs){l=_nileButtonToggleGroupCssCjsJs.s;},function(_nileButtonToggleNileButtonToggleCjsJs){n=_nileButtonToggleNileButtonToggleCjsJs.N;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_property002CjsJs){a=_property002CjsJs.n;},function(_nileButtonToggleNileButtonToggleCssCjsJs){},function(_lit){}],execute:function(){_export("N",g=/*#__PURE__*/function(_r){_inherits(g,_r);var _super=_createSuper(g);function g(){var _this;_classCallCheck(this,g);_this=_super.apply(this,arguments),_this.disabled=!1;return _this;}_createClass(g,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(g.prototype),"connectedCallback",this).call(this);}},{key:"firstUpdated",value:function firstUpdated(){var _this2=this;this.defaultSlot.addEventListener("slotchange",function(){return _this2.updateTogglePositions();}),this.addEventListener("nile-toggle-changed",this.handleToggle),this.updateTogglePositions();}},{key:"updated",value:function updated(t){_get(_getPrototypeOf(g.prototype),"updated",this).call(this,t),t.has("disabled")&&this.updateDisabledState();}},{key:"updateDisabledState",value:function updateDisabledState(){var _this3=this;this.defaultSlot.assignedNodes({flatten:!0}).filter(function(t){return t instanceof n;}).forEach(function(t){t.disabled||(t.disabled=_this3.disabled);});}},{key:"updateTogglePositions",value:function updateTogglePositions(){var t=this.defaultSlot.assignedNodes({flatten:!0}).filter(function(t){return t instanceof n;});t.forEach(function(e,o){e.initial=0===o,e.middle=o>0&&o<t.length-1,e.end=o===t.length-1;});}},{key:"handleToggle",value:function handleToggle(t){if(this.disabled)return;var e=this.querySelectorAll("nile-button-toggle");e&&t.detail.active&&(e.forEach(function(e){e!==t.target&&(e.active=!1);}),this.emit("nile-change",{value:t.detail.value}));}},{key:"render",value:function render(){return e(_templateObject||(_templateObject=_taggedTemplateLiteral([" <slot> </slot> "])));}}],[{key:"styles",get:function get(){return[l];}}]);return g;}(r));t([o("nile-button-toggle")],g.prototype,"toggles",void 0),t([s("slot:not([name])")],g.prototype,"defaultSlot",void 0),t([a({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),_export("N",g=t([i("nile-button-toggle-group")],g));}};});
|
2
2
|
//# sourceMappingURL=nile-button-toggle-group.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button-toggle-group.cjs.js","sources":["../../../src/nile-button-toggle-group/nile-button-toggle-group.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, query, queryAll } from 'lit/decorators.js';\nimport {styles} from './nile-button-toggle-group.css';\nimport NileButtonToggle from '../nile-button-toggle/nile-button-toggle';\n/**\n * Nile icon component.\n *\n * @tag nile-button-toggle-group\n *\n */\n@customElement('nile-button-toggle-group')\nexport class NileButtonToggleGroup extends
|
1
|
+
{"version":3,"file":"nile-button-toggle-group.cjs.js","sources":["../../../src/nile-button-toggle-group/nile-button-toggle-group.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, query, queryAll } from 'lit/decorators.js';\nimport {styles} from './nile-button-toggle-group.css';\nimport NileButtonToggle from '../nile-button-toggle/nile-button-toggle';\nimport NileElement from '../internal/nile-element';\n/**\n * Nile icon component.\n *\n * @tag nile-button-toggle-group\n *\n */\n@customElement('nile-button-toggle-group')\nexport class NileButtonToggleGroup extends NileElement {\n /**\n * The styles for ButtonToggleGroup\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 @queryAll('nile-button-toggle')\n private toggles!: NodeListOf<NileButtonToggle>;\n\n @query('slot:not([name])')\n private defaultSlot!: HTMLSlotElement;\n\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n firstUpdated() {\n this.defaultSlot.addEventListener('slotchange', () =>\n this.updateTogglePositions()\n );\n this.addEventListener('nile-toggle-changed', this.handleToggle);\n this.updateTogglePositions();\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('disabled')) {\n this.updateDisabledState();\n }\n }\n\n private updateDisabledState() {\n const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });\n const toggles = assignedNodes.filter(\n node => node instanceof NileButtonToggle\n ) as NileButtonToggle[];\n\n toggles.forEach(toggle => {\n if (!toggle.disabled) {\n toggle.disabled = this.disabled;\n }\n });\n }\n\n updateTogglePositions() {\n const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });\n const toggles = assignedNodes.filter(\n node => node instanceof NileButtonToggle\n ) as NileButtonToggle[];\n\n toggles.forEach((toggle, index) => {\n toggle.initial = index === 0;\n toggle.middle = index > 0 && index < toggles.length - 1;\n toggle.end = index === toggles.length - 1;\n });\n }\n\n handleToggle(event: CustomEvent) {\n if (this.disabled) return;\n const toggles = this.querySelectorAll('nile-button-toggle');\n\n if (toggles && event.detail.active) {\n toggles.forEach((toggle: any) => {\n if (toggle !== event.target) {\n toggle.active = false;\n }\n });\n\n this.emit('nile-change', { value: event.detail.value });\n }\n }\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html` <slot> </slot> `;\n }\n\n /* #endregion */\n}\n\nexport default NileButtonToggleGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button-toggle-group': NileButtonToggleGroup;\n }\n}\n"],"names":["NileButtonToggleGroup","_r","_inherits","g","_super","_createSuper","this","disabled","_this","_createClass","key","value","connectedCallback","super","firstUpdated","defaultSlot","addEventListener","updateTogglePositions","handleToggle","updated","changedProperties","has","updateDisabledState","assignedNodes","flatten","filter","node","NileButtonToggle","forEach","toggle","toggles","index","initial","middle","length","end","event","querySelectorAll","detail","active","target","emit","render","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","queryAll","prototype","query","property","type","Boolean","reflect","_export","customElement"],"mappings":"4oJAmBaA,CAAN,uBAAAC,EAAA,EAAAC,SAAA,CAAAC,CAAA,CAAAF,EAAA,MAAAG,MAAA,CAAAC,YAAA,CAAAF,CAAA,EAAA,SAAAA,EAAA,uEAgBEG,KAAAA,CAAQC,QAAAA,CAAAA,CAAY,CAuE5B,QAAAC,KAAA,EAlFQC,YAAA,CAAAN,CAAA,GAAAO,GAAA,qBAAAC,KAAA,CAaP,SAAAC,kBAAA,CAAAA,CACEC,IAAAA,CAAAA,eAAAA,CAAAA,CAAAA,CAAAA,SAAAA,4BAAAA,IAAAA,OACD,CAED,GAAAH,GAAA,gBAAAC,KAAA,UAAAG,aAAA,CACER,KAAAA,MAAAA,MAAAA,IAAAA,CAAKS,YAAYC,gBAAiB,CAAA,YAAA,CAAc,iBAC9CV,CAAAA,MAAAA,CAAKW,qBAEPX,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,IAAAA,CAAKU,iBAAiB,qBAAuBV,CAAAA,IAAAA,CAAKY,cAClDZ,IAAKW,CAAAA,qBAAAA,CAAAA,CACN,EAED,GAAAP,GAAA,WAAAC,KAAA,UAAAQ,QAAQC,CACNP,CAAAA,CAAAA,IAAAA,CAAAA,eAAAA,CAAAA,CAAAA,CAAAA,SAAAA,kBAAAA,IAAAA,MAAcO,CAAAA,EAC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AA,CACXA,CAAAA,CAAAA,CAAAA,GAAWO,CAAMI,CAAAA,MAAAA,GACnBX,CAAOU,CAAAA,MAAAA,CAAAA,CAAS,EACjB,EAGHjC,CAAAA,CAAAA,IAAAA,CAAKmC,KAAK,aAAe,CAAA,CAAE9B,MAAOyB,CAAME,CAAAA,MAAAA,CAAO3B,KAElD,CAAA,CAAA,CAAA,EAMM,GAAAD,GAAA,UAAAC,KAAA,UAAA+B,OAAA,CAAAA,CACL,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,yBACZ,uBA/EM,SAAAC,IAAA,EACL,MAAO,CAACC,CACT,CAAA,EAWD,WAAA5C,CAAA,GAlByC6C,CAApC,GAULC,CAAA,CAAA,CADCC,EAAS,oBACqClD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmD,SAAA,CAAA,SAAA,CAAA,IAAA,EAG/CF,CAAAA,CAAAA,CAAAA,CAAA,CADCG,CAAM,CAAA,kBAAA,CAAA,CAAA,CAC+BpD,EAAAmD,SAAA,CAAA,aAAA,CAAA,IAAA,IAGtCF,CAAA,CAAA,CADCI,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,SAAS,CACHxD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmD,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAAAM,OAAA,KAhBtBzD,EAAqBiD,CAAA,CAAA,CADjCS,CAAc,CAAA,0BAAA,CAAA,CAAA,CACF1D"}
|
@@ -1,3 +1 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
2
|
-
<slot> </slot>
|
3
|
-
`}};t([s("nile-button-toggle")],r.prototype,"toggles",void 0),t([l("slot:not([name])")],r.prototype,"defaultSlot",void 0),r=t([n("nile-button-toggle-group")],r);export{r as N};
|
1
|
+
import{__decorate as t}from"tslib";import{x as e}from"../index-cd2f9c12.esm.js";import{queryAll as o,query as s,customElement as i}from"lit/decorators.js";import{s as l}from"./nile-button-toggle-group.css.esm.js";import{N as n}from"../nile-button-toggle/nile-button-toggle.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{n as a}from"../property-09139d3c.esm.js";import"../nile-button-toggle/nile-button-toggle.css.esm.js";import"lit";let g=class extends r{constructor(){super(...arguments),this.disabled=!1}static get styles(){return[l]}connectedCallback(){super.connectedCallback()}firstUpdated(){this.defaultSlot.addEventListener("slotchange",(()=>this.updateTogglePositions())),this.addEventListener("nile-toggle-changed",this.handleToggle),this.updateTogglePositions()}updated(t){super.updated(t),t.has("disabled")&&this.updateDisabledState()}updateDisabledState(){this.defaultSlot.assignedNodes({flatten:!0}).filter((t=>t instanceof n)).forEach((t=>{t.disabled||(t.disabled=this.disabled)}))}updateTogglePositions(){const t=this.defaultSlot.assignedNodes({flatten:!0}).filter((t=>t instanceof n));t.forEach(((e,o)=>{e.initial=0===o,e.middle=o>0&&o<t.length-1,e.end=o===t.length-1}))}handleToggle(t){if(this.disabled)return;const e=this.querySelectorAll("nile-button-toggle");e&&t.detail.active&&(e.forEach((e=>{e!==t.target&&(e.active=!1)})),this.emit("nile-change",{value:t.detail.value}))}render(){return e` <slot> </slot> `}};t([o("nile-button-toggle")],g.prototype,"toggles",void 0),t([s("slot:not([name])")],g.prototype,"defaultSlot",void 0),t([a({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),g=t([i("nile-button-toggle-group")],g);export{g as N};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button-toggle.css.js","sourceRoot":"","sources":["../../../src/nile-button-toggle/nile-button-toggle.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-button-toggle.css.js","sourceRoot":"","sources":["../../../src/nile-button-toggle/nile-button-toggle.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CxB,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 * ButtonToggle CSS\n */\nexport const styles = css`\n :host {\n }\n\n .nile-button-toggle {\n display: flex;\n padding: 12px;\n border: 1px solid #ccc;\n cursor: pointer;\n border-radius: 4px;\n color: #000;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n line-height: 14px;\n letter-spacing: 0.2px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n }\n\n .nile-button-toggle__initial {\n border-radius: 4px 0 0 4px;\n }\n\n .nile-button-toggle__end {\n border-radius: 0 4px 4px 0;\n }\n\n .nile-button-toggle__middle {\n border-width: 1px 0px;\n border-style: solid;\n border-color: #ccc;\n border-radius: 0;\n }\n\n .nile-button-toggle__active {\n background-color: #c7ced4;\n }\n\n .nile-button-toggle__disabled {\n cursor: not-allowed;\n }\n`;\n\nexport default [styles];\n"]}
|
@@ -4,14 +4,15 @@
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
import {
|
7
|
+
import { CSSResultArray, TemplateResult } from 'lit-element';
|
8
|
+
import NileElement from '../internal/nile-element';
|
8
9
|
/**
|
9
10
|
* Nile icon component.
|
10
11
|
*
|
11
12
|
* @tag nile-button-toggle
|
12
13
|
*
|
13
14
|
*/
|
14
|
-
export declare class NileButtonToggle extends
|
15
|
+
export declare class NileButtonToggle extends NileElement {
|
15
16
|
/**
|
16
17
|
* The styles for ButtonToggle
|
17
18
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
@@ -21,6 +22,7 @@ export declare class NileButtonToggle extends LitElement {
|
|
21
22
|
initial: boolean;
|
22
23
|
middle: boolean;
|
23
24
|
end: boolean;
|
25
|
+
disabled: boolean;
|
24
26
|
value: string;
|
25
27
|
connectedCallback(): void;
|
26
28
|
disconnectedCallback(): void;
|
@@ -5,22 +5,24 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import { __decorate } from "tslib";
|
8
|
-
import {
|
8
|
+
import { html, property } from 'lit-element';
|
9
9
|
import { customElement } from 'lit/decorators.js';
|
10
10
|
import { styles } from './nile-button-toggle.css';
|
11
|
+
import NileElement from '../internal/nile-element';
|
11
12
|
/**
|
12
13
|
* Nile icon component.
|
13
14
|
*
|
14
15
|
* @tag nile-button-toggle
|
15
16
|
*
|
16
17
|
*/
|
17
|
-
let NileButtonToggle = class NileButtonToggle extends
|
18
|
+
let NileButtonToggle = class NileButtonToggle extends NileElement {
|
18
19
|
constructor() {
|
19
20
|
super(...arguments);
|
20
21
|
this.active = false;
|
21
22
|
this.initial = false;
|
22
23
|
this.middle = false;
|
23
24
|
this.end = false;
|
25
|
+
this.disabled = false;
|
24
26
|
this.value = '';
|
25
27
|
/* #endregion */
|
26
28
|
}
|
@@ -40,6 +42,8 @@ let NileButtonToggle = class NileButtonToggle extends LitElement {
|
|
40
42
|
super.disconnectedCallback();
|
41
43
|
}
|
42
44
|
toggle() {
|
45
|
+
if (this.disabled)
|
46
|
+
return;
|
43
47
|
this.active = true;
|
44
48
|
const eventData = { active: this.active, value: this.value };
|
45
49
|
this.dispatchEvent(new CustomEvent('nile-toggle-changed', { detail: eventData, bubbles: true }));
|
@@ -62,6 +66,9 @@ let NileButtonToggle = class NileButtonToggle extends LitElement {
|
|
62
66
|
if (this.end) {
|
63
67
|
classes.push('nile-button-toggle__end');
|
64
68
|
}
|
69
|
+
if (this.disabled) {
|
70
|
+
classes.push('nile-button-toggle__disabled');
|
71
|
+
}
|
65
72
|
const classString = classes.join(' ');
|
66
73
|
return html `
|
67
74
|
<div class="${classString}">
|
@@ -83,6 +90,9 @@ __decorate([
|
|
83
90
|
__decorate([
|
84
91
|
property({ type: Boolean, reflect: true })
|
85
92
|
], NileButtonToggle.prototype, "end", void 0);
|
93
|
+
__decorate([
|
94
|
+
property({ type: Boolean, reflect: true })
|
95
|
+
], NileButtonToggle.prototype, "disabled", void 0);
|
86
96
|
__decorate([
|
87
97
|
property({ type: String })
|
88
98
|
], NileButtonToggle.prototype, "value", void 0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button-toggle.js","sourceRoot":"","sources":["../../../src/nile-button-toggle/nile-button-toggle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"nile-button-toggle.js","sourceRoot":"","sources":["../../../src/nile-button-toggle/nile-button-toggle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;GAKG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,WAAW;IAA1C;;QAWL,WAAM,GAAG,KAAK,CAAC;QAGf,YAAO,GAAG,KAAK,CAAC;QAGhB,WAAM,GAAG,KAAK,CAAC;QAGf,QAAG,GAAG,KAAK,CAAC;QAGZ,aAAQ,GAAG,KAAK,CAAC;QAGjB,UAAK,GAAG,EAAE,CAAC;QAmDZ,gBAAgB;IACjB,CAAC;IA5EA;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAoBA,iBAAiB;QACf,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AAI,CAAA;oBACK,WAAW;;;;KAI1B,CAAC;IACJ,CAAC;CAGF,CAAA;AAnEC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAC5B;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAC5B;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC/B;AAGZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAChB;AA1BA,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA8E5B;SA9EY,gBAAgB;AAgF7B,eAAe,gBAAgB,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 } from 'lit/decorators.js';\nimport {styles} from './nile-button-toggle.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile icon component.\n *\n * @tag nile-button-toggle\n *\n */\n@customElement('nile-button-toggle')\nexport class NileButtonToggle extends NileElement {\n\n\t/**\n\t * The styles for ButtonToggle\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 @property({ type: Boolean, reflect: true })\n active = false;\n\n @property({ type: Boolean, reflect: true })\n initial = false;\n\n @property({ type: Boolean, reflect: true })\n middle = false;\n\n @property({ type: Boolean, reflect: true })\n end = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: String })\n value = '';\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.toggle);\n }\n\n disconnectedCallback() {\n this.removeEventListener('click', this.toggle);\n super.disconnectedCallback();\n }\n\n toggle() {\n if (this.disabled) return;\n this.active = true;\n const eventData = { active: this.active, value: this.value };\n this.dispatchEvent(new CustomEvent('nile-toggle-changed', { detail: eventData, bubbles: true }));\n }\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n public render(): TemplateResult {\n let classes = ['nile-button-toggle'];\n if (this.active) {\n classes.push('nile-button-toggle__active');\n }\n if (this.initial) {\n classes.push('nile-button-toggle__initial');\n }\n if (this.middle) {\n classes.push('nile-button-toggle__middle');\n }\n if (this.end) {\n classes.push('nile-button-toggle__end');\n }\n if (this.disabled) {\n classes.push('nile-button-toggle__disabled');\n }\n\n const classString = classes.join(' ');\n\n return html`\n <div class=\"${classString}\">\n <slot name=\"prefix\"></slot>\n <slot> </slot>\n </div>\n `;\n }\n\n\t/* #endregion */\n}\n\nexport default NileButtonToggle;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button-toggle': NileButtonToggle;\n }\n}\n"]}
|
@@ -4,14 +4,15 @@
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
import {
|
7
|
+
import { CSSResultArray, TemplateResult } from 'lit-element';
|
8
|
+
import NileElement from '../internal/nile-element';
|
8
9
|
/**
|
9
10
|
* Nile icon component.
|
10
11
|
*
|
11
12
|
* @tag nile-button-toggle-group
|
12
13
|
*
|
13
14
|
*/
|
14
|
-
export declare class NileButtonToggleGroup extends
|
15
|
+
export declare class NileButtonToggleGroup extends NileElement {
|
15
16
|
/**
|
16
17
|
* The styles for ButtonToggleGroup
|
17
18
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
@@ -19,8 +20,11 @@ export declare class NileButtonToggleGroup extends LitElement {
|
|
19
20
|
static get styles(): CSSResultArray;
|
20
21
|
private toggles;
|
21
22
|
private defaultSlot;
|
23
|
+
disabled: boolean;
|
22
24
|
connectedCallback(): void;
|
23
25
|
firstUpdated(): void;
|
26
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
27
|
+
private updateDisabledState;
|
24
28
|
updateTogglePositions(): void;
|
25
29
|
handleToggle(event: CustomEvent): void;
|
26
30
|
/**
|
@@ -5,17 +5,23 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import { __decorate } from "tslib";
|
8
|
-
import {
|
8
|
+
import { html, property } from 'lit-element';
|
9
9
|
import { customElement, query, queryAll } from 'lit/decorators.js';
|
10
10
|
import { styles } from './nile-button-toggle-group.css';
|
11
11
|
import NileButtonToggle from '../nile-button-toggle/nile-button-toggle';
|
12
|
+
import NileElement from '../internal/nile-element';
|
12
13
|
/**
|
13
14
|
* Nile icon component.
|
14
15
|
*
|
15
16
|
* @tag nile-button-toggle-group
|
16
17
|
*
|
17
18
|
*/
|
18
|
-
let NileButtonToggleGroup = class NileButtonToggleGroup extends
|
19
|
+
let NileButtonToggleGroup = class NileButtonToggleGroup extends NileElement {
|
20
|
+
constructor() {
|
21
|
+
super(...arguments);
|
22
|
+
this.disabled = false;
|
23
|
+
/* #endregion */
|
24
|
+
}
|
19
25
|
/**
|
20
26
|
* The styles for ButtonToggleGroup
|
21
27
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
@@ -31,6 +37,21 @@ let NileButtonToggleGroup = class NileButtonToggleGroup extends LitElement {
|
|
31
37
|
this.addEventListener('nile-toggle-changed', this.handleToggle);
|
32
38
|
this.updateTogglePositions();
|
33
39
|
}
|
40
|
+
updated(changedProperties) {
|
41
|
+
super.updated(changedProperties);
|
42
|
+
if (changedProperties.has('disabled')) {
|
43
|
+
this.updateDisabledState();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
updateDisabledState() {
|
47
|
+
const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });
|
48
|
+
const toggles = assignedNodes.filter(node => node instanceof NileButtonToggle);
|
49
|
+
toggles.forEach(toggle => {
|
50
|
+
if (!toggle.disabled) {
|
51
|
+
toggle.disabled = this.disabled;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
}
|
34
55
|
updateTogglePositions() {
|
35
56
|
const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });
|
36
57
|
const toggles = assignedNodes.filter(node => node instanceof NileButtonToggle);
|
@@ -41,6 +62,8 @@ let NileButtonToggleGroup = class NileButtonToggleGroup extends LitElement {
|
|
41
62
|
});
|
42
63
|
}
|
43
64
|
handleToggle(event) {
|
65
|
+
if (this.disabled)
|
66
|
+
return;
|
44
67
|
const toggles = this.querySelectorAll('nile-button-toggle');
|
45
68
|
if (toggles && event.detail.active) {
|
46
69
|
toggles.forEach((toggle) => {
|
@@ -48,18 +71,15 @@ let NileButtonToggleGroup = class NileButtonToggleGroup extends LitElement {
|
|
48
71
|
toggle.active = false;
|
49
72
|
}
|
50
73
|
});
|
51
|
-
this.
|
74
|
+
this.emit('nile-change', { value: event.detail.value });
|
52
75
|
}
|
53
76
|
}
|
54
|
-
;
|
55
77
|
/**
|
56
78
|
* Render method
|
57
79
|
* @slot This is a slot test
|
58
80
|
*/
|
59
81
|
render() {
|
60
|
-
return html `
|
61
|
-
<slot> </slot>
|
62
|
-
`;
|
82
|
+
return html ` <slot> </slot> `;
|
63
83
|
}
|
64
84
|
};
|
65
85
|
__decorate([
|
@@ -68,6 +88,9 @@ __decorate([
|
|
68
88
|
__decorate([
|
69
89
|
query('slot:not([name])')
|
70
90
|
], NileButtonToggleGroup.prototype, "defaultSlot", void 0);
|
91
|
+
__decorate([
|
92
|
+
property({ type: Boolean, reflect: true })
|
93
|
+
], NileButtonToggleGroup.prototype, "disabled", void 0);
|
71
94
|
NileButtonToggleGroup = __decorate([
|
72
95
|
customElement('nile-button-toggle-group')
|
73
96
|
], NileButtonToggleGroup);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-button-toggle-group.js","sourceRoot":"","sources":["../../../src/nile-button-toggle-group/nile-button-toggle-group.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"nile-button-toggle-group.js","sourceRoot":"","sources":["../../../src/nile-button-toggle-group/nile-button-toggle-group.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAC;AACtD,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD;;;;;GAKG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,WAAW;IAA/C;;QAgBE,aAAQ,GAAY,KAAK,CAAC;QAsEjC,gBAAgB;IAClB,CAAC;IAtFC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAWD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC5B,CAAC;IAED,YAAY;QACV,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,YAAY,EAAE,GAAG,EAAE,CACnD,IAAI,CAAC,qBAAqB,EAAE,CAC7B,CAAC;QACF,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAChE,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,CAAC,iBAAyD;QAC/D,KA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AAgB,CAAC,oBAAoB,CAAC,CAAC;QAE5D,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;YAClC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAW,EAAE,EAAE;gBAC9B,IAAI,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE;oBAC3B,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;iBACvB;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;SACzD;IACH,CAAC;IAED;;;OAGG;IACI,MAAM;QACX,OAAO,IAAI,CAAA,kBAAkB,CAAC;IAChC,CAAC;CAGF,CAAA;AA7EC;IADC,QAAQ,CAAC,oBAAoB,CAAC;sDACgB;AAG/C;IADC,KAAK,CAAC,kBAAkB,CAAC;0DACY;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACV;AAhBtB,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CAuFjC;SAvFY,qBAAqB;AAyFlC,eAAe,qBAAqB,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, query, queryAll } from 'lit/decorators.js';\nimport {styles} from './nile-button-toggle-group.css';\nimport NileButtonToggle from '../nile-button-toggle/nile-button-toggle';\nimport NileElement from '../internal/nile-element';\n/**\n * Nile icon component.\n *\n * @tag nile-button-toggle-group\n *\n */\n@customElement('nile-button-toggle-group')\nexport class NileButtonToggleGroup extends NileElement {\n /**\n * The styles for ButtonToggleGroup\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 @queryAll('nile-button-toggle')\n private toggles!: NodeListOf<NileButtonToggle>;\n\n @query('slot:not([name])')\n private defaultSlot!: HTMLSlotElement;\n\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n firstUpdated() {\n this.defaultSlot.addEventListener('slotchange', () =>\n this.updateTogglePositions()\n );\n this.addEventListener('nile-toggle-changed', this.handleToggle);\n this.updateTogglePositions();\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('disabled')) {\n this.updateDisabledState();\n }\n }\n\n private updateDisabledState() {\n const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });\n const toggles = assignedNodes.filter(\n node => node instanceof NileButtonToggle\n ) as NileButtonToggle[];\n\n toggles.forEach(toggle => {\n if (!toggle.disabled) {\n toggle.disabled = this.disabled;\n }\n });\n }\n\n updateTogglePositions() {\n const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });\n const toggles = assignedNodes.filter(\n node => node instanceof NileButtonToggle\n ) as NileButtonToggle[];\n\n toggles.forEach((toggle, index) => {\n toggle.initial = index === 0;\n toggle.middle = index > 0 && index < toggles.length - 1;\n toggle.end = index === toggles.length - 1;\n });\n }\n\n handleToggle(event: CustomEvent) {\n if (this.disabled) return;\n const toggles = this.querySelectorAll('nile-button-toggle');\n\n if (toggles && event.detail.active) {\n toggles.forEach((toggle: any) => {\n if (toggle !== event.target) {\n toggle.active = false;\n }\n });\n\n this.emit('nile-change', { value: event.detail.value });\n }\n }\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html` <slot> </slot> `;\n }\n\n /* #endregion */\n}\n\nexport default NileButtonToggleGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-button-toggle-group': NileButtonToggleGroup;\n }\n}\n"]}
|