@aquera/nile-elements 0.1.67-beta-1.9 → 0.1.67-beta-2.1
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 +1 -23
- package/demo/index.html +61 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +5640 -7857
- package/dist/internal/form.cjs.js +1 -1
- package/dist/internal/form.cjs.js.map +1 -1
- package/dist/internal/form.esm.js +1 -1
- package/dist/internal/resizable-table-styles.cjs.js +1 -1
- package/dist/internal/resizable-table-styles.cjs.js.map +1 -1
- package/dist/internal/resizable-table-styles.esm.js +3 -15
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +17 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +29 -8
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-card/nile-card.test.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.esm.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js +5 -5
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js.map +1 -1
- package/dist/nile-code-editor/theme.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +3 -3
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +11 -3
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +13 -7
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +3 -3
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +9 -9
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.test.esm.js +2 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +6 -2
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +4 -2
- package/dist/nile-table-row/nile-table-row.cjs.js +1 -1
- package/dist/nile-table-row/nile-table-row.cjs.js.map +1 -1
- package/dist/nile-table-row/nile-table-row.css.cjs.js +1 -1
- package/dist/nile-table-row/nile-table-row.css.cjs.js.map +1 -1
- package/dist/nile-table-row/nile-table-row.css.esm.js +51 -0
- package/dist/nile-table-row/nile-table-row.esm.js +26 -6
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/form.js +3 -3
- package/dist/src/internal/form.js.map +1 -1
- package/dist/src/internal/resizable-table-styles.js +0 -12
- package/dist/src/internal/resizable-table-styles.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.js +1 -10
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +0 -3
- package/dist/src/nile-code-editor/nile-code-editor.js +3 -23
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +0 -6
- package/dist/src/nile-code-editor/theme.js +2 -8
- package/dist/src/nile-code-editor/theme.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +1 -4
- package/dist/src/nile-option/nile-option.js +15 -27
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +3 -20
- package/dist/src/nile-select/nile-select.js +22 -123
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +4 -0
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js +2 -0
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
- package/dist/src/nile-table-row/nile-table-row-expandable.d.ts +37 -0
- package/dist/src/nile-table-row/nile-table-row-expandable.js +105 -0
- package/dist/src/nile-table-row/nile-table-row-expandable.js.map +1 -0
- package/dist/src/nile-table-row/nile-table-row.css.js +51 -0
- package/dist/src/nile-table-row/nile-table-row.css.js.map +1 -1
- package/dist/src/nile-table-row/nile-table-row.d.ts +4 -0
- package/dist/src/nile-table-row/nile-table-row.js +58 -11
- package/dist/src/nile-table-row/nile-table-row.js.map +1 -1
- package/dist/src/nile-table-row-expandable/index.d.ts +1 -0
- package/dist/src/nile-table-row-expandable/index.js +2 -0
- package/dist/src/nile-table-row-expandable/index.js.map +1 -0
- package/dist/src/nile-table-row-expandable/nile-table-row-expandable.css.d.ts +12 -0
- package/dist/src/nile-table-row-expandable/nile-table-row-expandable.css.js +17 -0
- package/dist/src/nile-table-row-expandable/nile-table-row-expandable.css.js.map +1 -0
- package/dist/src/nile-table-row-expandable/nile-table-row-expandable.d.ts +37 -0
- package/dist/src/nile-table-row-expandable/nile-table-row-expandable.js +103 -0
- package/dist/src/nile-table-row-expandable/nile-table-row-expandable.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/src/index.ts +1 -5
- package/src/internal/form.ts +3 -3
- package/src/internal/resizable-table-styles.ts +0 -12
- package/src/nile-chip/nile-chip.ts +1 -9
- package/src/nile-code-editor/nile-code-editor.ts +4 -25
- package/src/nile-code-editor/theme.ts +2 -8
- package/src/nile-option/nile-option.ts +12 -22
- package/src/nile-select/nile-select.ts +15 -139
- package/src/nile-table-cell-item/nile-table-cell-item.css.ts +4 -0
- package/src/nile-table-header-item/nile-table-header-item.css.ts +2 -0
- package/src/nile-table-row/nile-table-row.css.ts +51 -0
- package/src/nile-table-row/nile-table-row.ts +50 -7
- package/vscode-html-custom-data.json +23 -400
- package/src/nile-file-preview/index.ts +0 -1
- package/src/nile-file-preview/nile-file-preview.css.ts +0 -589
- package/src/nile-file-preview/nile-file-preview.template.ts +0 -259
- package/src/nile-file-preview/nile-file-preview.test.ts +0 -38
- package/src/nile-file-preview/nile-file-preview.ts +0 -205
- package/src/nile-file-preview/types/index.ts +0 -2
- package/src/nile-file-preview/types/nile-file-preview.enums.ts +0 -32
- package/src/nile-file-preview/types/nile-file-preview.interface.ts +0 -4
- package/src/nile-file-preview/utils/index.ts +0 -1
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +0 -72
- package/src/nile-file-upload/index.ts +0 -1
- package/src/nile-file-upload/nile-file-upload.css.ts +0 -624
- package/src/nile-file-upload/nile-file-upload.template.ts +0 -217
- package/src/nile-file-upload/nile-file-upload.test.ts +0 -38
- package/src/nile-file-upload/nile-file-upload.ts +0 -161
- package/src/nile-file-upload/types/file-upload.enums.ts +0 -46
- package/src/nile-file-upload/types/file-upload.type.ts +0 -5
- package/src/nile-file-upload/types/index.ts +0 -2
- package/src/nile-file-upload/utils/drag-drop.util.ts +0 -106
- package/src/nile-file-upload/utils/file-validation.util.ts +0 -216
- package/src/nile-option-group/index.ts +0 -1
- package/src/nile-option-group/nile-option-group.css.ts +0 -60
- package/src/nile-option-group/nile-option-group.interface.ts +0 -24
- package/src/nile-option-group/nile-option-group.ts +0 -84
- package/src/nile-select/nile-select.interface.ts +0 -5
- package/src/nile-select/virtual-scroll-helper.ts +0 -56
- package/src/nile-virtual-select/index.ts +0 -1
- package/src/nile-virtual-select/nile-virtual-select.css.ts +0 -491
- package/src/nile-virtual-select/nile-virtual-select.test.ts +0 -774
- package/src/nile-virtual-select/nile-virtual-select.ts +0 -1314
- package/src/nile-virtual-select/renderer.ts +0 -102
- package/src/nile-virtual-select/search-manager.ts +0 -50
- package/src/nile-virtual-select/selection-manager.ts +0 -75
- package/src/nile-virtual-select/types.ts +0 -54
@@ -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-28d63bc4.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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_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);})));});}};});
|
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-324a7ef9.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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture001CjsJs){e=_fixture001CjsJs.f;t=_fixture001CjsJs.a;i=_fixture001CjsJs.o;},function(_litStaticHtmlJs){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,4 +1,4 @@
|
|
1
|
-
import{f as e,a as t,o as i}from"../fixture-
|
1
|
+
import{f as e,a as t,o as i}from"../fixture-ba65eb22.esm.js";import{html as c}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-checkbox.esm.js";import"tslib";import"lit/decorators.js";import"./nile-checkbox.css.esm.js";import"lit/directives/class-map.js";import"../internal/default-value.esm.js";import"lit/directives/if-defined.js";import"lit/directives/live.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";describe("NileCheckbox",(()=>{it("renders correctly with default properties",(async()=>{const i=await e(c`<nile-checkbox></nile-checkbox>`);t(i).shadowDom.to.equalSnapshot()})),it("toggles checked state on click",(async()=>{const i=await e(c`<nile-checkbox></nile-checkbox>`),s=i.shadowRoot.querySelector('input[type="checkbox"]');s.click(),t(i.checked).to.be.true,s.click(),t(i.checked).to.be.false})),it("emits nile-change event on click",(async()=>{const s=await e(c`<nile-checkbox></nile-checkbox>`),o=s.shadowRoot.querySelector('input[type="checkbox"]');setTimeout((()=>o.click()));const n=await i(s,"valueChange");t(n.detail.checked).to.be.true})),it("handles focus and blur events",(async()=>{const s=await e(c`<nile-checkbox></nile-checkbox>`),o=s.shadowRoot.querySelector('input[type="checkbox"]');setTimeout((()=>o.focus()));const n=await i(s,"focus");t(n).to.exist,setTimeout((()=>o.blur()));const a=await i(s,"blur");t(a).to.exist})),it("handles indeterminate state",(async()=>{const i=await e(c`<nile-checkbox indeterminate></nile-checkbox>`),s=i.shadowRoot.querySelector('input[type="checkbox"]');t(s.indeterminate).to.be.true,i.checked=!0,i.indeterminate=!1,await i.updateComplete,t(s.indeterminate).to.be.false,t(s.checked).to.be.true})),it("reflects properties to attributes",(async()=>{const i=await e(c`
|
2
2
|
<nile-checkbox
|
3
3
|
name="test-name"
|
4
4
|
title="test-title"
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,o,l,h,r,n,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,p;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){h=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){r=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_a){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.enableVirtualScroll=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.loading=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="",_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;};return _this;}_inherits(p,_a);return _createClass(p,[{key:"updated",value:function updated(t){var _this2=this;if(_superPropGet(p,"updated",this,3)([t]),t.has("autoCompleteOptions")){var _t=this.autoCompleteOptions;if("string"==typeof _t)try{_t=JSON.parse(_t);}catch(i){_t=[];}this.filteredAutoCompleteOptions=Array.isArray(_t)?_toConsumableArray(_t):[],this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}t.has("value")&&(this.tags=_toConsumableArray(this.value),this.onTagsChanged()),t.has("tags")&&this.onTagsChanged();}},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;_superPropGet(p,"connectedCallback",this,3)([]),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(p,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}},{key:"render",value:function render(){var _this4=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var e=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n part='base' \n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .enableVirtualScroll=","\n .allMenuItems=","\n .filterFunction=","\n .renderItemFunction=","\n .loading=\"","\"\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n exportparts=\"options__wrapper\"\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n </div>\n ","\n\n ","\n </div>\n "])),r({"form-control":!0,"form-control--medium":!0,"form-control--has-label":e,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),e?"false":"true",this.label,r({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap}),this.tags.map(function(t,e){return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n pill\n >\n ","\n </nile-tag>\n "])),r({"nile-chip__tags":!0}),_this4.errorIndexes.includes(e)?"error":"normal",function(){return _this4.handleRemove(t);},t);}),this.enableVirtualScroll,this.filteredAutoCompleteOptions,this.filterFunction,this.renderItemFunction,this.loading,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,s?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(i){return i!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Tab"===t.key&&t.preventDefault(),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(t.preventDefault(),this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||!this.noDuplicates&&!this.tags.includes(this.inputValue)||this.emit("nile-duplicates-blocked"));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"onTagsChanged",value:function onTagsChanged(){var _this5=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this5.tags.includes(t);}));}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}}],[{key:"styles",get:function get(){return[h];}}]);}(a));t([e()],p.prototype,"tags",void 0),t([e()],p.prototype,"inputValue",void 0),t([e()],p.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],p.prototype,"autoComplete",void 0),t([o({type:Boolean})],p.prototype,"warning",void 0),t([o({type:Boolean})],p.prototype,"error",void 0),t([o({type:Boolean})],p.prototype,"success",void 0),t([o({type:Boolean})],p.prototype,"noDuplicates",void 0),t([o()],p.prototype,"label",void 0),t([o({type:Boolean})],p.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],p.prototype,"clearable",void 0),t([o()],p.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([o({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],p.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"value",void 0),t([o({type:Boolean})],p.prototype,"noWrap",void 0),t([o({type:Boolean})],p.prototype,"loading",void 0),t([o({type:Array})],p.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],p.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],p.prototype,"errorMessage",void 0),t([o({attribute:!1})],p.prototype,"filterFunction",void 0),t([o({attribute:!1})],p.prototype,"renderItemFunction",void 0),_export("N",p=t([l("nile-chip")],p));}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,o,l,h,r,n,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,p;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){h=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){r=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_a){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.enableVirtualScroll=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.loading=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="",_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;};return _this;}_inherits(p,_a);return _createClass(p,[{key:"updated",value:function updated(t){var _this2=this;_superPropGet(p,"updated",this,3)([t]),t.has("autoCompleteOptions")&&(this.filteredAutoCompleteOptions=_toConsumableArray(this.autoCompleteOptions),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}))),t.has("value")&&(this.tags=_toConsumableArray(this.value),this.onTagsChanged()),t.has("tags")&&this.onTagsChanged();}},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;_superPropGet(p,"connectedCallback",this,3)([]),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(p,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}},{key:"render",value:function render(){var _this4=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var e=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n part='base' \n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .enableVirtualScroll=","\n .allMenuItems=","\n .filterFunction=","\n .renderItemFunction=","\n .loading=\"","\"\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n exportparts=\"options__wrapper\"\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n </div>\n ","\n\n ","\n </div>\n "])),r({"form-control":!0,"form-control--medium":!0,"form-control--has-label":e,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),e?"false":"true",this.label,r({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap}),this.tags.map(function(t,e){return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n pill\n >\n ","\n </nile-tag>\n "])),r({"nile-chip__tags":!0}),_this4.errorIndexes.includes(e)?"error":"normal",function(){return _this4.handleRemove(t);},t);}),this.enableVirtualScroll,this.filteredAutoCompleteOptions,this.filterFunction,this.renderItemFunction,this.loading,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,s?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(i){return i!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Tab"===t.key&&t.preventDefault(),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(t.preventDefault(),this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||!this.noDuplicates&&!this.tags.includes(this.inputValue)||this.emit("nile-duplicates-blocked"));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"onTagsChanged",value:function onTagsChanged(){var _this5=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this5.tags.includes(t);}));}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}}],[{key:"styles",get:function get(){return[h];}}]);}(a));t([e()],p.prototype,"tags",void 0),t([e()],p.prototype,"inputValue",void 0),t([e()],p.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],p.prototype,"autoComplete",void 0),t([o({type:Boolean})],p.prototype,"warning",void 0),t([o({type:Boolean})],p.prototype,"error",void 0),t([o({type:Boolean})],p.prototype,"success",void 0),t([o({type:Boolean})],p.prototype,"noDuplicates",void 0),t([o()],p.prototype,"label",void 0),t([o({type:Boolean})],p.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],p.prototype,"clearable",void 0),t([o()],p.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([o({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],p.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"value",void 0),t([o({type:Boolean})],p.prototype,"noWrap",void 0),t([o({type:Boolean})],p.prototype,"loading",void 0),t([o({type:Array})],p.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],p.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],p.prototype,"errorMessage",void 0),t([o({attribute:!1})],p.prototype,"filterFunction",void 0),t([o({attribute:!1})],p.prototype,"renderItemFunction",void 0),_export("N",p=t([l("nile-chip")],p));}};});
|
2
2
|
//# sourceMappingURL=nile-chip.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.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 {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // AUTO-COMPLETE-OPTIONS\n\n /** Virtual scroll in dropdown options. */\n @property({ type: Boolean }) enableVirtualScroll = false;\n\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean = (item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('autoCompleteOptions')) {\n let options = this.autoCompleteOptions;\n if (typeof options === 'string') {\n try {\n options = JSON.parse(options);\n } catch (e) {\n options = [];\n }\n }\n this.filteredAutoCompleteOptions = Array.isArray(options) ? [...options] : [];\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n if (changedProperties.has('value')){\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n if (changedProperties.has('tags')){\n this.onTagsChanged();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n part='base' \n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n pill\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .enableVirtualScroll=${this.enableVirtualScroll}\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .filterFunction=${this.filterFunction}\n .renderItemFunction=${this.renderItemFunction}\n .loading=\"${this.loading}\"\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n exportparts=\"options__wrapper\"\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n </div>\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if(event.key === 'Tab'){\n event.preventDefault()\n }\n \n if (\n (event.key === 'Enter' || event.key === 'Tab' ) \n && this.inputValue \n && (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n event.preventDefault()\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n if(\n (event.key === 'Enter'|| event.key === 'Tab' ) \n && this.inputValue \n && (this.noDuplicates || this.tags.includes(this.inputValue))\n ){\n this.emit('nile-duplicates-blocked');\n }\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n onTagsChanged() {\n if (this.noDuplicates)\n this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));\n }\n\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","p","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","error","success","noDuplicates","label","acceptUserInput","clearable","placeholder","readonly","disabled","enableVirtualScroll","autoCompleteOptions","filteredAutoCompleteOptions","value","noWrap","loading","errorIndexes","helpText","errorMessage","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","_this","_inherits","_a","_createClass","key","updated","changedProperties","super","has","options","JSON","parse","e","Array","isArray","_toConsumableArray","filter","option","onTagsChanged","connectedCallback","emit","disconnectedCallback","render","_this4","hasLabelSlot","test","hasLabel","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","classMap","map","tag","index","_templateObject2","handleRemove","handleInputChange","handleInputKeydown","handleFocus","handleSelect","_templateObject3","_templateObject4","event","detail","concat","resetInput","preventDefault","autoComplete","get","styles","NileElement","__decorate","state","prototype","query","property","type","Boolean","reflect","attribute","_export","customElement"],"mappings":"63JAyBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAKYC,KAAAA,CAAiBC,iBAAAA,CAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAEvC,WACA,CAAA,OAAA,CAAA,CAGOF,KAAAA,CAAIG,IAAAA,CAAa,EAEjBH,CAAAA,KAAAA,CAAUI,UAAW,CAAA,EAAA,CAErBJ,KAAAA,CAAcK,cAAAA,CAAAA,CAAY,CAKNL,CAAAA,KAAAA,CAAOM,OAAG,CAAA,CAAA,CAAA,CAGVN,KAAAA,CAAKO,KAAG,CAAA,CAAA,CAAA,CAGRP,KAAAA,CAAOQ,OAAAA,CAAAA,CAAG,CAGVR,CAAAA,KAAAA,CAAYS,YAAG,CAAA,CAAA,CAAA,CAGhCT,KAAAA,CAAKU,KAAAA,CAAG,EAGSV,CAAAA,KAAAA,CAAeW,eAAG,CAAA,CAAA,CAAA,CAGlBX,KAAAA,CAASY,SAAG,CAAA,CAAA,CAAA,CAG7BZ,KAAAA,CAAWa,WAAAA,CAAG,cAGkBb,CAAAA,KAAAA,CAAQc,QAAG,CAAA,CAAA,CAAA,CAGXd,KAAAA,CAAQe,QAAAA,CAAAA,CAAG,CAK1Bf,CAAAA,KAAAA,CAAmBgB,mBAAG,CAAA,CAAA,CAAA,CAExBhB,KAAAA,CAAmBiB,mBAAU,CAAA,EAAA,CAE7BjB,KAAAA,CAA2BkB,2BAAAA,CAAU,EAErClB,CAAAA,KAAAA,CAAKmB,KAAU,CAAA,EAAA,CAEbnB,KAAAA,CAAMoB,MAAAA,CAAAA,CAAY,CAElBpB,CAAAA,KAAAA,CAAOqB,OAAY,CAAA,CAAA,CAAA,CAErBrB,KAAAA,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AAA,EAAA,CAAA,CAE7CF,EAAA,CAA7BI,CAAAA,CAAS,CAAEI,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmK/F,EAAAyF,SAAA,CAAA,gBAAA,CAAA,IAAA,EAE3JF,CAAAA,CAAAA,CAAAA,CAAA,CAA7BI,CAAAA,CAAS,CAAEI,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkE/F,CAAAyF,CAAAA,SAAAA,CAAA,oBAAA,CAAA,IAAA,EAAA,CAAA,CAAAO,OAAA,KAxE7EhG,EAAQuF,CAAA,CAAA,CADpBU,CAAc,CAAA,WAAA,CAAA,CAAA,CACFjG"}
|
1
|
+
{"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.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 {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // AUTO-COMPLETE-OPTIONS\n\n /** Virtual scroll in dropdown options. */\n @property({ type: Boolean }) enableVirtualScroll = false;\n\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean = (item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('autoCompleteOptions')) {\n this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n if (changedProperties.has('value')){\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n if (changedProperties.has('tags')){\n this.onTagsChanged();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n part='base' \n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n pill\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .enableVirtualScroll=${this.enableVirtualScroll}\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .filterFunction=${this.filterFunction}\n .renderItemFunction=${this.renderItemFunction}\n .loading=\"${this.loading}\"\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n exportparts=\"options__wrapper\"\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n </div>\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if(event.key === 'Tab'){\n event.preventDefault()\n }\n \n if (\n (event.key === 'Enter' || event.key === 'Tab' ) \n && this.inputValue \n && (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n event.preventDefault()\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n if(\n (event.key === 'Enter'|| event.key === 'Tab' ) \n && this.inputValue \n && (this.noDuplicates || this.tags.includes(this.inputValue))\n ){\n this.emit('nile-duplicates-blocked');\n }\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n onTagsChanged() {\n if (this.noDuplicates)\n this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));\n }\n\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","p","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","error","success","noDuplicates","label","acceptUserInput","clearable","placeholder","readonly","disabled","enableVirtualScroll","autoCompleteOptions","filteredAutoCompleteOptions","value","noWrap","loading","errorIndexes","helpText","errorMessage","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","_this","_inherits","_a","_createClass","key","updated","changedProperties","super","has","filter","option","onTagsChanged","connectedCallback","emit","disconnectedCallback","render","hasLabelSlot","test","hasLabel","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","classMap","map","tag","index","_templateObject2","handleRemove","handleInputChange","handleInputKeydown","handleFocus","handleSelect","_templateObject3","_templateObject4","event","detail","concat","_toConsumableArray","resetInput","preventDefault","autoComplete","get","styles","NileElement","__decorate","state","prototype","query","property","type","Boolean","reflect","Array","attribute","_export","customElement"],"mappings":"63JAyBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAKYC,EAAAA,KAAAA,CAAiBC,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAEvC,WACA,CAAA,OAAA,CAAA,CAGOF,KAAAA,CAAIG,IAAa,CAAA,EAAA,CAEjBH,KAAAA,CAAUI,UAAAA,CAAW,EAErBJ,CAAAA,KAAAA,CAAcK,gBAAY,CAKNL,CAAAA,KAAAA,CAAOM,OAAG,CAAA,CAAA,CAAA,CAGVN,KAAAA,CAAKO,KAAAA,CAAAA,CAAG,EAGRP,KAAAA,CAAOQ,OAAAA,CAAAA,CAAG,CAGVR,CAAAA,KAAAA,CAAYS,YAAG,CAAA,CAAA,CAAA,CAGhCT,KAAAA,CAAKU,KAAG,CAAA,EAAA,CAGSV,KAAAA,CAAeW,eAAG,CAAA,CAAA,CAAA,CAGlBX,KAAAA,CAASY,SAAG,CAAA,CAAA,CAAA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BtF,CAAAiF,CAAAA,SAAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAE7CF,EAAA,CAA7BI,CAAAA,CAAS,CAAEK,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmKxF,EAAAiF,SAAA,CAAA,gBAAA,CAAA,IAAA,EAE3JF,CAAAA,CAAAA,CAAAA,CAAA,CAA7BI,CAAAA,CAAS,CAAEK,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkExF,CAAAiF,CAAAA,SAAAA,CAAA,oBAAA,CAAA,IAAA,EAAA,CAAA,CAAAQ,OAAA,KAxE7EzF,EAAQ+E,CAAA,CAAA,CADpBW,CAAc,CAAA,WAAA,CAAA,CAAA,CACF1F"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{html as i}from"lit";import{state as e,query as s,property as o,customElement as l}from"lit/decorators.js";import{s as h}from"./nile-chip.css.esm.js";import{classMap as r}from"lit/directives/class-map.js";import{H as n}from"../internal/slot.esm.js";import{N as a}from"../internal/nile-element.esm.js";let p=class extends a{constructor(){super(...arguments),this.hasSlotController=new n(this,"help-text","label"),this.tags=[],this.inputValue="",this.isDropdownOpen=!1,this.warning=!1,this.error=!1,this.success=!1,this.noDuplicates=!1,this.label="",this.acceptUserInput=!1,this.clearable=!1,this.placeholder="type here...",this.readonly=!1,this.disabled=!1,this.enableVirtualScroll=!1,this.autoCompleteOptions=[],this.filteredAutoCompleteOptions=[],this.value=[],this.noWrap=!1,this.loading=!1,this.errorIndexes=[],this.helpText="",this.errorMessage="",this.filterFunction=(t,i)=>t.toLowerCase().includes(i.toLowerCase()),this.renderItemFunction=t=>t}static get styles(){return[h]}updated(t){
|
1
|
+
import{__decorate as t}from"tslib";import{html as i}from"lit";import{state as e,query as s,property as o,customElement as l}from"lit/decorators.js";import{s as h}from"./nile-chip.css.esm.js";import{classMap as r}from"lit/directives/class-map.js";import{H as n}from"../internal/slot.esm.js";import{N as a}from"../internal/nile-element.esm.js";let p=class extends a{constructor(){super(...arguments),this.hasSlotController=new n(this,"help-text","label"),this.tags=[],this.inputValue="",this.isDropdownOpen=!1,this.warning=!1,this.error=!1,this.success=!1,this.noDuplicates=!1,this.label="",this.acceptUserInput=!1,this.clearable=!1,this.placeholder="type here...",this.readonly=!1,this.disabled=!1,this.enableVirtualScroll=!1,this.autoCompleteOptions=[],this.filteredAutoCompleteOptions=[],this.value=[],this.noWrap=!1,this.loading=!1,this.errorIndexes=[],this.helpText="",this.errorMessage="",this.filterFunction=(t,i)=>t.toLowerCase().includes(i.toLowerCase()),this.renderItemFunction=t=>t}static get styles(){return[h]}updated(t){super.updated(t),t.has("autoCompleteOptions")&&(this.filteredAutoCompleteOptions=[...this.autoCompleteOptions],this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter((t=>!this.value.includes(t))))),t.has("value")&&(this.tags=[...this.value],this.onTagsChanged()),t.has("tags")&&this.onTagsChanged()}connectedCallback(){super.connectedCallback(),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter((t=>!this.value.includes(t)))),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}render(){const t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");const e=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return i`
|
2
2
|
<div
|
3
3
|
part="form-control"
|
4
4
|
class=${r({"form-control":!0,"form-control--medium":!0,"form-control--has-label":e,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled})}
|