@aquera/nile-elements 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/demo/index.html +4 -72
- package/demo/variables.css +19 -58
- package/demo/variables_v2.css +0 -2
- package/dist/nile-button/nile-button.css.cjs.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.esm.js +77 -83
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.esm.js +11 -18
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +2 -2
- package/dist/nile-form-group/nile-form-group.css.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.css.cjs.js.map +1 -1
- package/dist/nile-form-group/nile-form-group.css.esm.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.esm.js +0 -1
- package/dist/nile-toast/nile-toast.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.esm.js +3 -3
- package/dist/src/nile-button/nile-button.css.js +77 -83
- package/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.js +5 -12
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +5 -17
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-form-group/nile-form-group.css.js +1 -1
- package/dist/src/nile-form-group/nile-form-group.css.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js +0 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js.map +1 -1
- package/dist/src/nile-toast/nile-toast.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.js +5 -1
- package/dist/src/nile-toast/nile-toast.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-button/nile-button.css.ts +77 -83
- package/src/nile-checkbox/nile-checkbox.test.ts +6 -21
- package/src/nile-checkbox/nile-checkbox.ts +5 -12
- package/src/nile-form-group/nile-form-group.css.ts +1 -1
- package/src/nile-stepper-item/nile-stepper-item.css.ts +0 -1
- package/src/nile-toast/nile-toast.ts +3 -1
- package/vscode-html-custom-data.json +5 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-a0ed956d.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-checkbox.cjs.js","tslib","lit/decorators.js","./nile-checkbox.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var e,t,i,c,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}return{setters:[function(_fixture003CjsJs){e=_fixture003CjsJs.f;t=_fixture003CjsJs.a;i=_fixture003CjsJs.o;},function(_litStaticHtmlJs){c=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileCheckboxCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileCheckboxCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalDefaultValueCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesLiveJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileCheckbox",function(){it("renders correctly with default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(c(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context2.sent;t(i).shadowDom.to.equalSnapshot();case 4:case"end":return _context2.stop();}},_callee);}))),it("toggles checked state on click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i,s;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(c(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context3.sent;s=i.shadowRoot.querySelector('input[type="checkbox"]');s.click(),t(i.checked).to.be["true"],s.click(),t(i.checked).to.be["false"];case 5:case"end":return _context3.stop();}},_callee2);}))),it("emits nile-change event on click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var s,o,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(c(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:s=_context4.sent;o=s.shadowRoot.querySelector('input[type="checkbox"]');setTimeout(function(){return o.click();});_context4.next=7;return i(s,"valueChange");case 7:n=_context4.sent;t(n.detail.checked).to.be["true"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("handles focus and blur events",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var s,o,n,a;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(c(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:s=_context5.sent;o=s.shadowRoot.querySelector('input[type="checkbox"]');setTimeout(function(){return o.focus();});_context5.next=7;return i(s,"focus");case 7:n=_context5.sent;t(n).to.exist,setTimeout(function(){return o.blur();});_context5.next=11;return i(s,"blur");case 11:a=_context5.sent;t(a).to.exist;case 13:case"end":return _context5.stop();}},_callee4);}))),it("handles indeterminate state",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i,s;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(c(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox indeterminate></nile-checkbox>"]))));case 2:i=_context6.sent;s=i.shadowRoot.querySelector('input[type="checkbox"]');t(s.indeterminate).to.be["true"];i.checked=!0;i.indeterminate=!1;_context6.next=9;return i.updateComplete;case 9:t(s.indeterminate).to.be["false"];t(s.checked).to.be["true"];case 11:case"end":return _context6.stop();}},_callee5);}))),it("reflects properties to attributes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var i;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(c(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-checkbox\n name=\"test-name\"\n title=\"test-title\"\n disabled\n required\n label=\"test-label\"\n sub-label=\"test-sublabel\"\n help-text=\"test-help\"\n error-message=\"test-error\"\n ></nile-checkbox>\n "]))));case 2:i=_context7.sent;t(i.getAttribute("name")).to.equal("test-name"),t(i.getAttribute("title")).to.equal("test-title"),t(i.getAttribute("disabled")).to.equal(""),t(i.getAttribute("required")).to.equal(""),t(i.getAttribute("label")).to.equal("test-label"),t(i.getAttribute("sub-label")).to.equal("test-sublabel"),t(i.getAttribute("help-text")).to.equal("test-help"),t(i.getAttribute("error-message")).to.equal("test-error");case 4:case"end":return _context7.stop();}},_callee6);}))),it("displays help text when showHelpText is true",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var i,s;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(c(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-checkbox help-text=\"test-help\"></nile-checkbox>"]))));case 2:i=_context8.sent;i.showHelpText=!0;_context8.next=6;return i.updateComplete;case 6:s=i.shadowRoot.querySelector(".checkbox__helptext-icon");t(s).to.exist;case 8:case"end":return _context8.stop();}},_callee7);}))),it("updates host class based on helpText",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var i;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(c(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context9.sent;i.helpText="test-help";_context9.next=6;return i.updateComplete;case 6:t(i.classList.contains("full-width")).to.be["true"];i.helpText="";_context9.next=10;return i.updateComplete;case 10:t(i.classList.contains("full-width")).to.be["false"];case 11:case"end":return _context9.stop();}},_callee8);}))),it("emits custom events on connected and disconnected",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var e,c,s,o,n;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:e=document.createElement("nile-checkbox"),c=i(e,"nile-init");document.body.appendChild(e);_context10.next=4;return c;case 4:s=_context10.sent;t(s).to.exist;o=i(e,"nile-destroy");document.body.removeChild(e);_context10.next=10;return o;case 10:n=_context10.sent;t(n).to.exist;case 12:case"end":return _context10.stop();}},_callee9);}))),it("handles required attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var i;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(c(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-checkbox required></nile-checkbox>"]))));case 2:i=_context11.sent.shadowRoot.querySelector('input[type="checkbox"]');t(i.required).to.be["true"];case 4:case"end":return _context11.stop();}},_callee10);}))),it("simulates click using click method",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var i;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return e(c(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context12.sent;i.click(),t(i.checked).to.be["true"];case 4:case"end":return _context12.stop();}},_callee11);}))),it("sets and removes focus using focus and blur methods",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var s,o,n;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return e(c(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:s=_context13.sent;setTimeout(function(){return s.focus();});_context13.next=6;return i(s,"focus");case 6:o=_context13.sent;t(o).to.exist,setTimeout(function(){return s.blur();});_context13.next=10;return i(s,"blur");case 10:n=_context13.sent;t(n).to.exist;case 12:case"end":return _context13.stop();}},_callee12);}))),it("reflects checked attribute to property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(){var i;return _regeneratorRuntime().wrap(function _callee13$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.next=2;return e(c(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<nile-checkbox checked></nile-checkbox>"]))));case 2:i=_context14.sent;t(i.checked).to.be["true"];case 4:case"end":return _context14.stop();}},_callee13);}))),it("reflects indeterminate attribute to property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(){var i;return _regeneratorRuntime().wrap(function _callee14$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:_context15.next=2;return e(c(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["<nile-checkbox indeterminate></nile-checkbox>"]))));case 2:i=_context15.sent;t(i.indeterminate).to.be["true"];case 4:case"end":return _context15.stop();}},_callee14);}))),it("associates form using form attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(){var i;return _regeneratorRuntime().wrap(function _callee15$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return e(c(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <div>\n <form id=\"test-form\"></form>\n <nile-checkbox form=\"test-form\"></nile-checkbox>\n </div>\n "]))));case 2:i=_context16.sent.querySelector("nile-checkbox");t(i).to.not.be["null"],t(i.getAttribute("form")).to.equal("test-form");case 4:case"end":return _context16.stop();}},_callee15);}))),it("displays and hides help text correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(){var i,s;return _regeneratorRuntime().wrap(function _callee16$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:_context17.next=2;return e(c(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<nile-checkbox help-text=\"test-help\"></nile-checkbox>"]))));case 2:i=_context17.sent;t(i.showHelpText).to.be["false"];i.showHelpText=!0;_context17.next=7;return i.updateComplete;case 7:s=i.shadowRoot.querySelector(".checkbox__helptext-icon");t(s).to.exist;i.showHelpText=!1;_context17.next=12;return i.updateComplete;case 12:s=i.shadowRoot.querySelector(".checkbox__helptext-icon");t(s).to.be.exist;case 14:case"end":return _context17.stop();}},_callee16);})));});}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-a0ed956d.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-checkbox.cjs.js","tslib","lit/decorators.js","./nile-checkbox.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var e,t,i,c,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}return{setters:[function(_fixture003CjsJs){e=_fixture003CjsJs.f;t=_fixture003CjsJs.a;i=_fixture003CjsJs.o;},function(_litStaticHtmlJs){c=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileCheckboxCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileCheckboxCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalDefaultValueCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesLiveJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileCheckbox",function(){it("renders correctly with default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(c(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context2.sent;t(i).shadowDom.to.equalSnapshot();case 4:case"end":return _context2.stop();}},_callee);}))),it("toggles checked state on click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i,s;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(c(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context3.sent;s=i.shadowRoot.querySelector('input[type="checkbox"]');s.click(),t(i.checked).to.be["true"],s.click(),t(i.checked).to.be["false"];case 5:case"end":return _context3.stop();}},_callee2);}))),it("emits nile-change event on click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var s,o,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(c(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:s=_context4.sent;o=s.shadowRoot.querySelector('input[type="checkbox"]');setTimeout(function(){return o.click();});_context4.next=7;return i(s,"valueChange");case 7:n=_context4.sent;t(n.detail.checked).to.be["true"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("handles focus and blur events",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var s,o,n,a;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(c(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:s=_context5.sent;o=s.shadowRoot.querySelector('input[type="checkbox"]');setTimeout(function(){return o.focus();});_context5.next=7;return i(s,"focus");case 7:n=_context5.sent;t(n).to.exist,setTimeout(function(){return o.blur();});_context5.next=11;return i(s,"blur");case 11:a=_context5.sent;t(a).to.exist;case 13:case"end":return _context5.stop();}},_callee4);}))),it("handles indeterminate state",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i,s;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(c(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox indeterminate></nile-checkbox>"]))));case 2:i=_context6.sent;s=i.shadowRoot.querySelector('input[type="checkbox"]');t(s.indeterminate).to.be["true"];i.checked=!0;i.indeterminate=!1;_context6.next=9;return i.updateComplete;case 9:t(s.indeterminate).to.be["false"];t(s.checked).to.be["true"];case 11:case"end":return _context6.stop();}},_callee5);}))),it("reflects properties to attributes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var i;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(c(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-checkbox\n name=\"test-name\"\n title=\"test-title\"\n disabled\n required\n label=\"test-label\"\n sub-label=\"test-sublabel\"\n help-text=\"test-help\"\n error-message=\"test-error\"\n ></nile-checkbox>\n "]))));case 2:i=_context7.sent;t(i.getAttribute("name")).to.equal("test-name"),t(i.getAttribute("title")).to.equal("test-title"),t(i.getAttribute("disabled")).to.equal(""),t(i.getAttribute("required")).to.equal(""),t(i.getAttribute("label")).to.equal("test-label"),t(i.getAttribute("sub-label")).to.equal("test-sublabel"),t(i.getAttribute("help-text")).to.equal("test-help"),t(i.getAttribute("error-message")).to.equal("test-error");case 4:case"end":return _context7.stop();}},_callee6);}))),it("displays help text when showHelpText is true",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _i$shadowRoot;var i,s;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(c(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-checkbox help-text=\"test-help\"></nile-checkbox>"]))));case 2:i=_context8.sent;i.showHelpText=!0;_context8.next=6;return i.updateComplete;case 6:s=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0||(_i$shadowRoot=_i$shadowRoot.querySelector("nile-form-help-text"))===null||_i$shadowRoot===void 0||(_i$shadowRoot=_i$shadowRoot.textContent)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.trim();t(s).to.equal("test-help");case 8:case"end":return _context8.stop();}},_callee7);}))),it("updates host class based on helpText",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var i;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(c(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context9.sent;i.helpText="test-help";_context9.next=6;return i.updateComplete;case 6:t(i.classList.contains("full-width")).to.be["true"];i.helpText="";_context9.next=10;return i.updateComplete;case 10:t(i.classList.contains("full-width")).to.be["false"];case 11:case"end":return _context9.stop();}},_callee8);}))),it("emits custom events on connected and disconnected",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var e,c,s,o,n;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:e=document.createElement("nile-checkbox"),c=i(e,"nile-init");document.body.appendChild(e);_context10.next=4;return c;case 4:s=_context10.sent;t(s).to.exist;o=i(e,"nile-destroy");document.body.removeChild(e);_context10.next=10;return o;case 10:n=_context10.sent;t(n).to.exist;case 12:case"end":return _context10.stop();}},_callee9);}))),it("handles required attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var i;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(c(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-checkbox required></nile-checkbox>"]))));case 2:i=_context11.sent.shadowRoot.querySelector('input[type="checkbox"]');t(i.required).to.be["true"];case 4:case"end":return _context11.stop();}},_callee10);}))),it("simulates click using click method",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var i;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return e(c(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:i=_context12.sent;i.click(),t(i.checked).to.be["true"];case 4:case"end":return _context12.stop();}},_callee11);}))),it("sets and removes focus using focus and blur methods",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var s,o,n;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return e(c(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-checkbox></nile-checkbox>"]))));case 2:s=_context13.sent;setTimeout(function(){return s.focus();});_context13.next=6;return i(s,"focus");case 6:o=_context13.sent;t(o).to.exist,setTimeout(function(){return s.blur();});_context13.next=10;return i(s,"blur");case 10:n=_context13.sent;t(n).to.exist;case 12:case"end":return _context13.stop();}},_callee12);}))),it("reflects checked attribute to property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(){var i;return _regeneratorRuntime().wrap(function _callee13$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.next=2;return e(c(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<nile-checkbox checked></nile-checkbox>"]))));case 2:i=_context14.sent;t(i.checked).to.be["true"];case 4:case"end":return _context14.stop();}},_callee13);}))),it("reflects indeterminate attribute to property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(){var i;return _regeneratorRuntime().wrap(function _callee14$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:_context15.next=2;return e(c(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["<nile-checkbox indeterminate></nile-checkbox>"]))));case 2:i=_context15.sent;t(i.indeterminate).to.be["true"];case 4:case"end":return _context15.stop();}},_callee14);}))),it("associates form using form attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(){var i;return _regeneratorRuntime().wrap(function _callee15$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return e(c(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <div>\n <form id=\"test-form\"></form>\n <nile-checkbox form=\"test-form\"></nile-checkbox>\n </div>\n "]))));case 2:i=_context16.sent.querySelector("nile-checkbox");t(i).to.not.be["null"],t(i.getAttribute("form")).to.equal("test-form");case 4:case"end":return _context16.stop();}},_callee15);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-checkbox.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-checkbox.test.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.test.ts"],"sourcesContent":["import { fixture, html, expect, oneEvent } from '@open-wc/testing';\nimport './nile-checkbox';\nimport { NileCheckbox } from './nile-checkbox';\n\ndescribe('NileCheckbox', () => {\n it('renders correctly with default properties', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n expect(el).shadowDom.to.equalSnapshot();\n });\n\n it('toggles checked state on click', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n input.click();\n expect(el.checked).to.be.true;\n input.click();\n expect(el.checked).to.be.false;\n });\n\n it('emits nile-change event on click', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n setTimeout(() => input.click());\n const event = await oneEvent(el, 'valueChange');\n expect(event.detail.checked).to.be.true;\n });\n\n it('handles focus and blur events', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n // Focus the input and wait for the focus event\n setTimeout(() => input.focus());\n const focusEvent = await oneEvent(el, 'focus');\n expect(focusEvent).to.exist;\n\n // Blur the input and wait for the blur event\n setTimeout(() => input.blur());\n const blurEvent = await oneEvent(el, 'blur');\n expect(blurEvent).to.exist;\n });\n\n it('handles indeterminate state', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n expect(input.indeterminate).to.be.true;\n\n el.checked = true;\n el.indeterminate = false;\n await el.updateComplete;\n expect(input.indeterminate).to.be.false;\n expect(input.checked).to.be.true;\n });\n\n it('reflects properties to attributes', async () => {\n const el = await fixture<NileCheckbox>(html`\n <nile-checkbox\n name=\"test-name\"\n title=\"test-title\"\n disabled\n required\n label=\"test-label\"\n sub-label=\"test-sublabel\"\n help-text=\"test-help\"\n error-message=\"test-error\"\n ></nile-checkbox>\n `);\n\n expect(el.getAttribute('name')).to.equal('test-name');\n expect(el.getAttribute('title')).to.equal('test-title');\n expect(el.getAttribute('disabled')).to.equal('');\n expect(el.getAttribute('required')).to.equal('');\n expect(el.getAttribute('label')).to.equal('test-label');\n expect(el.getAttribute('sub-label')).to.equal('test-sublabel');\n expect(el.getAttribute('help-text')).to.equal('test-help');\n expect(el.getAttribute('error-message')).to.equal('test-error');\n });\n\n it('displays help text when showHelpText is true', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text=\"test-help\"></nile-checkbox>`);\n el.showHelpText = true;\n await el.updateComplete;\n\n const helpTextIcon = el.shadowRoot!.querySelector('.checkbox__helptext-icon');\n expect(helpTextIcon).to.exist;\n });\n\n it('updates host class based on helpText', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n el.helpText = 'test-help';\n await el.updateComplete;\n\n expect(el.classList.contains('full-width')).to.be.true;\n\n el.helpText = '';\n await el.updateComplete;\n\n expect(el.classList.contains('full-width')).to.be.false;\n });\n\n it('emits custom events on connected and disconnected', async () => {\n const el = document.createElement('nile-checkbox');\n\n // Wait for the connected event\n const initEventPromise = oneEvent(el, 'nile-init');\n document.body.appendChild(el);\n const initEvent = await initEventPromise;\n expect(initEvent).to.exist;\n\n // Wait for the disconnected event\n const destroyEventPromise = oneEvent(el, 'nile-destroy');\n document.body.removeChild(el);\n const destroyEvent = await destroyEventPromise;\n expect(destroyEvent).to.exist;\n });\n\n it('handles required attribute', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox required></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n expect(input.required).to.be.true;\n });\n\n it('simulates click using click method', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n el.click();\n expect(el.checked).to.be.true;\n });\n\n it('sets and removes focus using focus and blur methods', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n\n // Call the focus method and wait for the focus event\n setTimeout(() => el.focus());\n const focusEvent = await oneEvent(el, 'focus');\n expect(focusEvent).to.exist;\n\n // Call the blur method and wait for the blur event\n setTimeout(() => el.blur());\n const blurEvent = await oneEvent(el, 'blur');\n expect(blurEvent).to.exist;\n });\n\n it('reflects checked attribute to property', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);\n expect(el.checked).to.be.true;\n });\n\n it('reflects indeterminate attribute to property', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);\n expect(el.indeterminate).to.be.true;\n });\n\n it('associates form using form attribute', async () => {\n const el = await fixture(html`\n <div>\n <form id=\"test-form\"></form>\n <nile-checkbox form=\"test-form\"></nile-checkbox>\n </div>\n `);\n const checkbox = el.querySelector('nile-checkbox') as NileCheckbox;\n expect(checkbox).to.not.be.null;\n expect(checkbox.getAttribute('form')).to.equal('test-form');\n });\n\n it('displays and hides help text correctly', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text=\"test-help\"></nile-checkbox>`);\n\n // Initially, help text should not be shown\n expect(el.showHelpText).to.be.false;\n\n // Show the help text\n el.showHelpText = true;\n await el.updateComplete;\n let helpTextIcon = el.shadowRoot!.querySelector('.checkbox__helptext-icon');\n expect(helpTextIcon).to.exist;\n\n // Hide the help text\n el.showHelpText = false;\n await el.updateComplete;\n helpTextIcon = el.shadowRoot!.querySelector('.checkbox__helptext-icon');\n expect(helpTextIcon).to.be.exist;\n });\n});\n\n"],"names":["describe","it","async","fixture","html","_templateObject","_taggedTemplateLiteral","el","expect","shadowDom","to","equalSnapshot","_context2","stop","_callee","_asyncToGenerator","_regeneratorRuntime","mark","_templateObject2","input","shadowRoot","querySelector","click","checked","be","_context3","_callee2","_templateObject3","setTimeout","_context4","next","oneEvent","event","detail","_callee3","_templateObject4","focus","_context5","focusEvent","exist","blur","blurEvent","_callee4","_templateObject5","indeterminate","updateComplete","false","true","_context6","_callee5","_templateObject6","getAttribute","equal","_context7","_callee6","_templateObject7","showHelpText","helpTextIcon","_context8","_callee7","_templateObject8","helpText","classList","contains","_context9","_callee8","document","createElement","initEventPromise","body","appendChild","_context10","initEvent","destroyEventPromise","removeChild","destroyEvent","_callee9","_templateObject9","required","_context11","_callee10","_templateObject10","_context12","_callee11","_templateObject11","_context13","_callee12","_templateObject12","_context14","_callee13","_templateObject13","_context15","_callee14","_templateObject14","checkbox","not","null","_context16","_callee15","_templateObject15","_context17","_callee16"],"mappings":"i6TAIAA,QAAS,CAAA,cAAA,CAAgB,UACvBC,CAAAA,EAAAA,CAAG,mHAA6CC,SAAAA,QAAAA,MAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,SAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SAC7BC,CAAAA,CAAsBC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,gDAArCC,iBACNC,CAAOD,CAAAA,CAAAA,CAAAA,CAAIE,UAAUC,EAAGC,CAAAA,aAAAA,CAAAA,CAAe,yBAAAC,SAAA,CAAAC,IAAA,MAAAC,OAAA,OAGzCb,EAAG,CAAA,gCAAA,cAAAc,iBAAA,cAAAC,mBAAA,GAAAC,IAAA,CAAkCf,SAAAA,SAAAA,MAAAA,CAAAA,CAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,UAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SAClBC,CAAAA,EAAsBC,CAAI,CAAAc,gBAAA,GAAAA,gBAAA,CAAAZ,sBAAA,uCAAA,CAAA,QAArCC,CAAAA,CAAAA,SAAAA,CAAAA,IAAAA,CACAY,CAAQZ,CAAAA,CAAAA,CAAGa,WAAYC,aAAc,CAAA,wBAAA,CAAA,CAE3CF,EAAMG,KACNd,CAAAA,CAAAA,CAAAA,CAAAA,CAAOD,EAAGgB,OAASb,CAAAA,CAAAA,EAAAA,CAAGc,UACtBL,CAAAA,CAAAA,CAAMG,QACNd,CAAOD,CAAAA,CAAAA,CAAGgB,SAASb,EAAGc,CAAAA,EAAAA,SAAQ,yBAAAC,SAAA,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A,CAG9BvC,CAAGiD,CAAAA,YAAAA,CAAAA,CAAe,CACZjD,CAAAA,UAAAA,CAAAA,IAAAA,SAAAA,CAAAA,CAAAA,CAAGsC,cACT,QAAIY,CAAelD,CAAAA,CAAAA,CAAGa,UAAYC,CAAAA,aAAAA,CAAc,0BAChDb,CAAAA,CAAAA,CAAAA,CAAOiD,CAAc/C,CAAAA,CAAAA,EAAAA,CAAG6B,KAGxBhC,CAAAA,CAAAA,CAAGiD,YAAe,CAAA,CAAA,CAAA,CAAA4C,UAAA,CAAAtE,IAAA,UACZvB,CAAAA,CAAGsC,CAAAA,cAAAA,SACTY,CAAelD,CAAAA,CAAAA,CAAGa,UAAYC,CAAAA,aAAAA,CAAc,0BAC5Cb,CAAAA,CAAAA,CAAAA,CAAOiD,CAAc/C,CAAAA,CAAAA,EAAAA,CAAGc,EAAGe,CAAAA,KAAK,0BAAA6D,UAAA,CAAAvF,IAAA,MAAAwF,SAAA,GAChC,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
1
|
+
{"version":3,"file":"nile-checkbox.test.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.test.ts"],"sourcesContent":["import { fixture, html, expect, oneEvent } from '@open-wc/testing';\nimport './nile-checkbox';\nimport { NileCheckbox } from './nile-checkbox';\n\nfunction wait(ms:number=50000) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\ndescribe('NileCheckbox', () => {\n it('renders correctly with default properties', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n expect(el).shadowDom.to.equalSnapshot();\n });\n\n it('toggles checked state on click', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n input.click();\n expect(el.checked).to.be.true;\n input.click();\n expect(el.checked).to.be.false;\n });\n\n it('emits nile-change event on click', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n setTimeout(() => input.click());\n const event = await oneEvent(el, 'valueChange');\n expect(event.detail.checked).to.be.true;\n });\n\n it('handles focus and blur events', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n // Focus the input and wait for the focus event\n setTimeout(() => input.focus());\n const focusEvent = await oneEvent(el, 'focus');\n expect(focusEvent).to.exist;\n\n // Blur the input and wait for the blur event\n setTimeout(() => input.blur());\n const blurEvent = await oneEvent(el, 'blur');\n expect(blurEvent).to.exist;\n });\n\n it('handles indeterminate state', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n expect(input.indeterminate).to.be.true;\n\n el.checked = true;\n el.indeterminate = false;\n await el.updateComplete;\n expect(input.indeterminate).to.be.false;\n expect(input.checked).to.be.true;\n });\n\n it('reflects properties to attributes', async () => {\n const el = await fixture<NileCheckbox>(html`\n <nile-checkbox\n name=\"test-name\"\n title=\"test-title\"\n disabled\n required\n label=\"test-label\"\n sub-label=\"test-sublabel\"\n help-text=\"test-help\"\n error-message=\"test-error\"\n ></nile-checkbox>\n `);\n\n expect(el.getAttribute('name')).to.equal('test-name');\n expect(el.getAttribute('title')).to.equal('test-title');\n expect(el.getAttribute('disabled')).to.equal('');\n expect(el.getAttribute('required')).to.equal('');\n expect(el.getAttribute('label')).to.equal('test-label');\n expect(el.getAttribute('sub-label')).to.equal('test-sublabel');\n expect(el.getAttribute('help-text')).to.equal('test-help');\n expect(el.getAttribute('error-message')).to.equal('test-error');\n });\n\n it('displays help text when showHelpText is true', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text=\"test-help\"></nile-checkbox>`);\n el.showHelpText = true;\n await el.updateComplete;\n const helpText=el.shadowRoot?.querySelector(\"nile-form-help-text\")?.textContent?.trim()\n expect(helpText).to.equal('test-help')\n });\n\n it('updates host class based on helpText', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n el.helpText = 'test-help';\n await el.updateComplete;\n\n expect(el.classList.contains('full-width')).to.be.true;\n\n el.helpText = '';\n await el.updateComplete;\n\n expect(el.classList.contains('full-width')).to.be.false;\n });\n\n it('emits custom events on connected and disconnected', async () => {\n const el = document.createElement('nile-checkbox');\n\n // Wait for the connected event\n const initEventPromise = oneEvent(el, 'nile-init');\n document.body.appendChild(el);\n const initEvent = await initEventPromise;\n expect(initEvent).to.exist;\n\n // Wait for the disconnected event\n const destroyEventPromise = oneEvent(el, 'nile-destroy');\n document.body.removeChild(el);\n const destroyEvent = await destroyEventPromise;\n expect(destroyEvent).to.exist;\n });\n\n it('handles required attribute', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox required></nile-checkbox>`);\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')! as HTMLInputElement;\n\n expect(input.required).to.be.true;\n });\n\n it('simulates click using click method', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n el.click();\n expect(el.checked).to.be.true;\n });\n\n it('sets and removes focus using focus and blur methods', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);\n\n // Call the focus method and wait for the focus event\n setTimeout(() => el.focus());\n const focusEvent = await oneEvent(el, 'focus');\n expect(focusEvent).to.exist;\n\n // Call the blur method and wait for the blur event\n setTimeout(() => el.blur());\n const blurEvent = await oneEvent(el, 'blur');\n expect(blurEvent).to.exist;\n });\n\n it('reflects checked attribute to property', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);\n expect(el.checked).to.be.true;\n });\n\n it('reflects indeterminate attribute to property', async () => {\n const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);\n expect(el.indeterminate).to.be.true;\n });\n\n it('associates form using form attribute', async () => {\n const el = await fixture(html`\n <div>\n <form id=\"test-form\"></form>\n <nile-checkbox form=\"test-form\"></nile-checkbox>\n </div>\n `);\n const checkbox = el.querySelector('nile-checkbox') as NileCheckbox;\n expect(checkbox).to.not.be.null;\n expect(checkbox.getAttribute('form')).to.equal('test-form');\n });\n\n});\n\n"],"names":["describe","it","async","fixture","html","_templateObject","_taggedTemplateLiteral","el","expect","shadowDom","to","equalSnapshot","_context2","stop","_callee","_asyncToGenerator","_regeneratorRuntime","mark","_templateObject2","input","shadowRoot","querySelector","click","checked","be","_context3","_callee2","_templateObject3","setTimeout","_context4","next","oneEvent","event","detail","_callee3","_templateObject4","focus","_context5","focusEvent","exist","blur","blurEvent","_callee4","_templateObject5","indeterminate","updateComplete","false","true","_context6","_callee5","_templateObject6","getAttribute","equal","_context7","_callee6","_templateObject7","showHelpText","_context8","helpText","_i$shadowRoot","textContent","trim","_callee7","_templateObject8","classList","contains","_context9","_callee8","document","createElement","initEventPromise","body","appendChild","_context10","initEvent","destroyEventPromise","removeChild","destroyEvent","_callee9","_templateObject9","required","_context11","_callee10","_templateObject10","_context12","_callee11","_templateObject11","_context13","_callee12","_templateObject12","_context14","_callee13","_templateObject13","_context15","_callee14","_templateObject14","checkbox","not","null","_context16","_callee15"],"mappings":"+4TAQAA,QAAS,CAAA,cAAA,CAAgB,UACvBC,CAAAA,EAAAA,CAAG,mHAA6CC,SAAAA,QAAAA,MAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,SAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SAC7BC,CAAAA,CAAsBC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,gDAArCC,iBACNC,CAAOD,CAAAA,CAAAA,CAAAA,CAAIE,UAAUC,EAAGC,CAAAA,aAAAA,CAAAA,CA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EAAQC,CAAI,CAAA2F,iBAAA,GAAAA,iBAAA,CAAAzF,sBAAA,6IAMTe,CAAAA,QAAd2E,CAAAA,CAAAA,UAAAA,CAAAA,IAAAA,CAAc3E,aAAAA,CAAc,eAClCb,EAAAA,CAAAA,CAAOwF,CAAUtF,CAAAA,CAAAA,EAAAA,CAAGuF,IAAIzE,EAAG0E,QAAAA,CAC3B1F,CAAOwF,CAAAA,CAAAA,CAAS7C,YAAa,CAAA,MAAA,CAAA,CAAA,CAASzC,EAAG0C,CAAAA,KAAAA,CAAM,YAAY,yBAAA+C,UAAA,CAAAtF,IAAA,MAAAuF,SAAA,GAC3D,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
@@ -9,9 +9,9 @@ import{f as e,a as t,o as i}from"../fixture-8aa86bc9.esm.js";import{html as c}fr
|
|
9
9
|
help-text="test-help"
|
10
10
|
error-message="test-error"
|
11
11
|
></nile-checkbox>
|
12
|
-
`);t(i.getAttribute("name")).to.equal("test-name"),t(i.getAttribute("title")).to.equal("test-title"),t(i.getAttribute("disabled")).to.equal(""),t(i.getAttribute("required")).to.equal(""),t(i.getAttribute("label")).to.equal("test-label"),t(i.getAttribute("sub-label")).to.equal("test-sublabel"),t(i.getAttribute("help-text")).to.equal("test-help"),t(i.getAttribute("error-message")).to.equal("test-error")})),it("displays help text when showHelpText is true",(async()=>{const i=await e(c`<nile-checkbox help-text="test-help"></nile-checkbox>`);i.showHelpText=!0,await i.updateComplete;const s=i.shadowRoot
|
12
|
+
`);t(i.getAttribute("name")).to.equal("test-name"),t(i.getAttribute("title")).to.equal("test-title"),t(i.getAttribute("disabled")).to.equal(""),t(i.getAttribute("required")).to.equal(""),t(i.getAttribute("label")).to.equal("test-label"),t(i.getAttribute("sub-label")).to.equal("test-sublabel"),t(i.getAttribute("help-text")).to.equal("test-help"),t(i.getAttribute("error-message")).to.equal("test-error")})),it("displays help text when showHelpText is true",(async()=>{const i=await e(c`<nile-checkbox help-text="test-help"></nile-checkbox>`);i.showHelpText=!0,await i.updateComplete;const s=i.shadowRoot?.querySelector("nile-form-help-text")?.textContent?.trim();t(s).to.equal("test-help")})),it("updates host class based on helpText",(async()=>{const i=await e(c`<nile-checkbox></nile-checkbox>`);i.helpText="test-help",await i.updateComplete,t(i.classList.contains("full-width")).to.be.true,i.helpText="",await i.updateComplete,t(i.classList.contains("full-width")).to.be.false})),it("emits custom events on connected and disconnected",(async()=>{const e=document.createElement("nile-checkbox"),c=i(e,"nile-init");document.body.appendChild(e);const s=await c;t(s).to.exist;const o=i(e,"nile-destroy");document.body.removeChild(e);const n=await o;t(n).to.exist})),it("handles required attribute",(async()=>{const i=(await e(c`<nile-checkbox required></nile-checkbox>`)).shadowRoot.querySelector('input[type="checkbox"]');t(i.required).to.be.true})),it("simulates click using click method",(async()=>{const i=await e(c`<nile-checkbox></nile-checkbox>`);i.click(),t(i.checked).to.be.true})),it("sets and removes focus using focus and blur methods",(async()=>{const s=await e(c`<nile-checkbox></nile-checkbox>`);setTimeout((()=>s.focus()));const o=await i(s,"focus");t(o).to.exist,setTimeout((()=>s.blur()));const n=await i(s,"blur");t(n).to.exist})),it("reflects checked attribute to property",(async()=>{const i=await e(c`<nile-checkbox checked></nile-checkbox>`);t(i.checked).to.be.true})),it("reflects indeterminate attribute to property",(async()=>{const i=await e(c`<nile-checkbox indeterminate></nile-checkbox>`);t(i.indeterminate).to.be.true})),it("associates form using form attribute",(async()=>{const i=(await e(c`
|
13
13
|
<div>
|
14
14
|
<form id="test-form"></form>
|
15
15
|
<nile-checkbox form="test-form"></nile-checkbox>
|
16
16
|
</div>
|
17
|
-
`)).querySelector("nile-checkbox");t(i).to.not.be.null,t(i.getAttribute("form")).to.equal("test-form")}))
|
17
|
+
`)).querySelector("nile-checkbox");t(i).to.not.be.null,t(i.getAttribute("form")).to.equal("test-form")}))}));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,i;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",i=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --min-width: 288px;\n }\n\n .form__base {\n display: flex;\n flex-direction: column;\n min-width: var(--min-width);\n width: max-content;\n box-shadow: 0px 2px 4px 0px rgba(119, 125, 130, 0.15);\n border-radius: var(--nile-radius-base-standard);\n border: 1px solid var(--nile-colors-
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,i;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",i=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --min-width: 288px;\n }\n\n .form__base {\n display: flex;\n flex-direction: column;\n min-width: var(--min-width);\n width: max-content;\n box-shadow: 0px 2px 4px 0px rgba(119, 125, 130, 0.15);\n border-radius: var(--nile-radius-base-standard);\n border: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-colors-white-base);\n font-family: var(--nile-font-family-serif);\n }\n\n .form__header {\n width: 100%;\n height: 82px;\n box-sizing: border-box;\n padding: var(--nile-spacing-3-x);\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--nile-spacing-1-x);\n border-radius: var(--nile-radius-base-standard)\n var(--nile-radius-base-standard) 0 0;\n background: var(--nile-colors-neutral-100);\n }\n\n .form__title-content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--nile-spacing-1-x);\n justify-content:centre;\n }\n\n\n\n .form__title {\n display: block;\n color: var(--nile-colors-dark-900);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-4);\n font-style: normal;\n font-weight: 500;\n line-height: var(--nile-type-scale-4);\n letter-spacing: 0.2px;\n }\n\n .form__subtitle {\n display: block;\n color: var(--nile-colors-dark-500);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n line-height: var(--nile-type-scale-2);\n letter-spacing: 0.2px;\n }\n\n .form__body {\n width: 100%;\n box-sizing: border-box;\n padding: var(--nile-spacing-3-x);\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-3-x);\n }\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-form-group.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-form-group.css.cjs.js","sources":["../../../src/nile-form-group/nile-form-group.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * FormGroup CSS\n */\nexport const styles = css`\n :host {\n --min-width: 288px;\n }\n\n .form__base {\n display: flex;\n flex-direction: column;\n min-width: var(--min-width);\n width: max-content;\n box-shadow: 0px 2px 4px 0px rgba(119, 125, 130, 0.15);\n border-radius: var(--nile-radius-base-standard);\n border: 1px solid var(--nile-colors-
|
1
|
+
{"version":3,"file":"nile-form-group.css.cjs.js","sources":["../../../src/nile-form-group/nile-form-group.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * FormGroup CSS\n */\nexport const styles = css`\n :host {\n --min-width: 288px;\n }\n\n .form__base {\n display: flex;\n flex-direction: column;\n min-width: var(--min-width);\n width: max-content;\n box-shadow: 0px 2px 4px 0px rgba(119, 125, 130, 0.15);\n border-radius: var(--nile-radius-base-standard);\n border: 1px solid var(--nile-colors-neutral-400);\n background: var(--nile-colors-white-base);\n font-family: var(--nile-font-family-serif);\n }\n\n .form__header {\n width: 100%;\n height: 82px;\n box-sizing: border-box;\n padding: var(--nile-spacing-3-x);\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--nile-spacing-1-x);\n border-radius: var(--nile-radius-base-standard)\n var(--nile-radius-base-standard) 0 0;\n background: var(--nile-colors-neutral-100);\n }\n\n .form__title-content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--nile-spacing-1-x);\n justify-content:centre;\n }\n\n\n\n .form__title {\n display: block;\n color: var(--nile-colors-dark-900);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-4);\n font-style: normal;\n font-weight: 500;\n line-height: var(--nile-type-scale-4);\n letter-spacing: 0.2px;\n }\n\n .form__subtitle {\n display: block;\n color: var(--nile-colors-dark-500);\n font-feature-settings: 'clig' off, 'liga' off;\n font-size: var(--nile-type-scale-2);\n font-style: normal;\n font-weight: var(--nile-font-weight-regular);\n line-height: var(--nile-type-scale-2);\n letter-spacing: 0.2px;\n }\n\n .form__body {\n width: 100%;\n box-sizing: border-box;\n padding: var(--nile-spacing-3-x);\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-3-x);\n }\n`;\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"iVAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -10,7 +10,7 @@ import{css as e}from"lit";const i=e`
|
|
10
10
|
width: max-content;
|
11
11
|
box-shadow: 0px 2px 4px 0px rgba(119, 125, 130, 0.15);
|
12
12
|
border-radius: var(--nile-radius-base-standard);
|
13
|
-
border: 1px solid var(--nile-colors-
|
13
|
+
border: 1px solid var(--nile-colors-neutral-400);
|
14
14
|
background: var(--nile-colors-white-base);
|
15
15
|
font-family: var(--nile-font-family-serif);
|
16
16
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\t--stepper-flex-val:1;\n\t\t--bulletin--dot--seperation:30%;\n\t\t\n\t\tdisplay:inline-block;\n\t\tflex-grow:var(--stepper-flex-val);\n\t\
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\t--stepper-flex-val:1;\n\t\t--bulletin--dot--seperation:30%;\n\t\t\n\t\tdisplay:inline-block;\n\t\tflex-grow:var(--stepper-flex-val);\n\t\tmin-width:var(--nile-stepper-min-width);\n\t}\n\t\n\t.stepper__item {\n\t\tmargin: 0 -1px;\n\t}\n\n\t.stepper__item--sm {\n\t\t--item-spacing: var(--nile-spacing-spacing-lg,12px);\n\t\t--stepper-item-title-size:14px;\n\t\t--stepper-item-subtitle-size:14px;\n\t\t--stepper-item-text-line-height:20px;\n\t\t--circle-height:16px;\n\t}\n\n\t.stepper__item--md {\n\t\t--item-spacing: var(--nile-spacing-spacing-xl, 16px);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:16px;\n\t\t--stepper-item-text-line-heightt:24px;\n\t\t--circle-height:20px;\n\t}\n\n\t.stepper__item--lg {\n\t\t--item-spacing: var(--nile-spacing-spacing-xl, 16px);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:16px;\n\t\t--stepper-item-text-line-height:24px;\n\t\t--circle-height:28px;\n\t}\n\n\t.stepper__line__content {\n\t\tdisplay:flex;\n\t\twidth:100%;\n\t\talign-items:center;\n\t}\n\n\t.stepper__line__container {\n\t\tflex-grow:1;\n\t\tpadding:0 1px;\n\t}\n\n\t.stepper__line--hastitle {\n\t\tdisplay:flex;\n\t\talign-items:center;\n\t}\n\n\t.stepper__line {\n\t\tdisplay: block;\n\t\tborder: 0;\n\t\tborder-top: 2px solid var(--nile-colors-gray-light-mode-200, #eaecf0);\n\t}\n\n\t.stepper__line--active {\n\t\tborder-top: 2px solid var(--nile-colors-primary-600,#005EA6);\n\t}\n\n\t.stepper__item__content--below {\n\t\tmargin-top: var(--item-spacing);\n\t\tdisplay:flex;\n\t\tflex-direction:column;\n\t\talign-items:center;\n\t}\n\t\n\t.stepper__item__bulletin {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\tmargin:0 -1px;\n\t}\n\n\t.stepper__content__title {\n\t\tcolor:var(--nile-colors-gray-light-mode-700, #344054);\n\t\tfont-size: var(--stepper-item-title-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-medium);\n\t\tfont-weight: 600;\n\t}\n\n\t.stepper__content__title--inline{\n\t\tpadding: 0 8px;\n\t\tcolor:var(--nile-colors-gray-light-mode-500, #667085);\n\t}\n\n\t.stepper__content__title--active{\n\t\tcolor:var(--nile-colors-primary-700, #005291);\n\t}\n\n\t.stepper__content__subtitle {\n\t\tcolor:var(--nile-colors-gray-light-mode-600, #475467);\n\t\tfont-size: var(--stepper-item-subtitle-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-sans-serif);\n\t\tfont-weight: 400;\n\t}\n\n\t.stepper__content__subtitle--active{\n\t\tcolor:var(--nile-colors-primary-600, #005EA6);\n\t}\n\n\t.stepper__bulletin--dot {\n\t\twidth: var(--circle-height);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(var(--nile-colors-gray-light-mode-300, #d0d5dd) var(--bulletin--dot--seperation), var(--nile-colors-gray-neutral-50, #f9fafb) var(--bulletin--dot--seperation));\n\t\tborder: 2px solid var(--nile-colors-gray-light-mode-200, #eaecf0);\n\t}\n\n\t.stepper__bulletin__dot--active{\n\t\tbackground: radial-gradient(#fff var(--bulletin--dot--seperation), var(--nile-colors-primary-600, #005EA6) var(--bulletin--dot--seperation));\n\t\tborder: 2px solid #85AAD18A;\n\t}\n\n\t.stepper__bulletin--icon {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\twidth: var(--circle-height);\n\t\tborder: 2px solid var(--nile-colors-primary-600, #005EA6);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground-color:var(--nile-colors-primary-600, #005EA6);\n\t\toverflow:hidden;\n\t}\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-stepper-item.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-stepper-item.css.cjs.js","sources":["../../../src/nile-stepper-item/nile-stepper-item.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport { css } from 'lit';\n\n/**\n * StepperItem CSS\n */\nexport const styles = css`\n\t:host {\n\t\t--stepper-flex-val:1;\n\t\t--bulletin--dot--seperation:30%;\n\t\t\n\t\tdisplay:inline-block;\n\t\tflex-grow:var(--stepper-flex-val);\n\t\
|
1
|
+
{"version":3,"file":"nile-stepper-item.css.cjs.js","sources":["../../../src/nile-stepper-item/nile-stepper-item.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport { css } from 'lit';\n\n/**\n * StepperItem CSS\n */\nexport const styles = css`\n\t:host {\n\t\t--stepper-flex-val:1;\n\t\t--bulletin--dot--seperation:30%;\n\t\t\n\t\tdisplay:inline-block;\n\t\tflex-grow:var(--stepper-flex-val);\n\t\tmin-width:var(--nile-stepper-min-width);\n\t}\n\t\n\t.stepper__item {\n\t\tmargin: 0 -1px;\n\t}\n\n\t.stepper__item--sm {\n\t\t--item-spacing: var(--nile-spacing-spacing-lg,12px);\n\t\t--stepper-item-title-size:14px;\n\t\t--stepper-item-subtitle-size:14px;\n\t\t--stepper-item-text-line-height:20px;\n\t\t--circle-height:16px;\n\t}\n\n\t.stepper__item--md {\n\t\t--item-spacing: var(--nile-spacing-spacing-xl, 16px);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:16px;\n\t\t--stepper-item-text-line-heightt:24px;\n\t\t--circle-height:20px;\n\t}\n\n\t.stepper__item--lg {\n\t\t--item-spacing: var(--nile-spacing-spacing-xl, 16px);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:16px;\n\t\t--stepper-item-text-line-height:24px;\n\t\t--circle-height:28px;\n\t}\n\n\t.stepper__line__content {\n\t\tdisplay:flex;\n\t\twidth:100%;\n\t\talign-items:center;\n\t}\n\n\t.stepper__line__container {\n\t\tflex-grow:1;\n\t\tpadding:0 1px;\n\t}\n\n\t.stepper__line--hastitle {\n\t\tdisplay:flex;\n\t\talign-items:center;\n\t}\n\n\t.stepper__line {\n\t\tdisplay: block;\n\t\tborder: 0;\n\t\tborder-top: 2px solid var(--nile-colors-gray-light-mode-200, #eaecf0);\n\t}\n\n\t.stepper__line--active {\n\t\tborder-top: 2px solid var(--nile-colors-primary-600,#005EA6);\n\t}\n\n\t.stepper__item__content--below {\n\t\tmargin-top: var(--item-spacing);\n\t\tdisplay:flex;\n\t\tflex-direction:column;\n\t\talign-items:center;\n\t}\n\t\n\t.stepper__item__bulletin {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\tmargin:0 -1px;\n\t}\n\n\t.stepper__content__title {\n\t\tcolor:var(--nile-colors-gray-light-mode-700, #344054);\n\t\tfont-size: var(--stepper-item-title-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-medium);\n\t\tfont-weight: 600;\n\t}\n\n\t.stepper__content__title--inline{\n\t\tpadding: 0 8px;\n\t\tcolor:var(--nile-colors-gray-light-mode-500, #667085);\n\t}\n\n\t.stepper__content__title--active{\n\t\tcolor:var(--nile-colors-primary-700, #005291);\n\t}\n\n\t.stepper__content__subtitle {\n\t\tcolor:var(--nile-colors-gray-light-mode-600, #475467);\n\t\tfont-size: var(--stepper-item-subtitle-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-sans-serif);\n\t\tfont-weight: 400;\n\t}\n\n\t.stepper__content__subtitle--active{\n\t\tcolor:var(--nile-colors-primary-600, #005EA6);\n\t}\n\n\t.stepper__bulletin--dot {\n\t\twidth: var(--circle-height);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(var(--nile-colors-gray-light-mode-300, #d0d5dd) var(--bulletin--dot--seperation), var(--nile-colors-gray-neutral-50, #f9fafb) var(--bulletin--dot--seperation));\n\t\tborder: 2px solid var(--nile-colors-gray-light-mode-200, #eaecf0);\n\t}\n\n\t.stepper__bulletin__dot--active{\n\t\tbackground: radial-gradient(#fff var(--bulletin--dot--seperation), var(--nile-colors-primary-600, #005EA6) var(--bulletin--dot--seperation));\n\t\tborder: 2px solid #85AAD18A;\n\t}\n\n\t.stepper__bulletin--icon {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\twidth: var(--circle-height);\n\t\tborder: 2px solid var(--nile-colors-primary-600, #005EA6);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground-color:var(--nile-colors-primary-600, #005EA6);\n\t\toverflow:hidden;\n\t}\n`;\nexport default [styles];"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"iVAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|