@lrnwebcomponents/tab-list
Version:
Automated conversion of tab-list/
2 lines (1 loc) • 4.58 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lit"),require("@lrnwebcomponents/a11y-tabs/a11y-tabs.js"),require("@lrnwebcomponents/a11y-tabs/lib/a11y-tab.js")):"function"==typeof define&&define.amd?define(["exports","lit","@lrnwebcomponents/a11y-tabs/a11y-tabs.js","@lrnwebcomponents/a11y-tabs/lib/a11y-tab.js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TabList={},t.lit)}(this,(function(t,e){"use strict";function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(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 function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}}function s(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var c,l,u,f=function(t){!function(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}}),e&&o(t,e)}(p,t);var r,i,f,b=a(p);function p(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),(t=b.call(this)).tabs=[],t}return r=p,f=[{key:"styles",get:function(){return[e.css(u||(u=s(["\n :host {\n display: block;\n margin: 0 auto;\n list-style: none;\n display: block;\n padding: 16px;\n border-bottom: 1px solid black;\n }\n a11y-tabs {\n align-items: center;\n justify-items: center;\n }\n a11y-tab a {\n text-decoration: none;\n flex: unset;\n height: unset;\n width: 100%;\n text-align: center;\n }\n button {\n text-transform: unset;\n width: 100%;\n display: block;\n min-width: unset;\n margin: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n @media screen and (max-width: 600px) {\n a11y-tab {\n display: block;\n }\n }\n "])))]}},{key:"tag",get:function(){return"tab-list"}},{key:"properties",get:function(){return{tabs:{type:Array}}}},{key:"haxProperties",get:function(){return{canScale:!1,canPosition:!1,canEditSource:!0,gizmo:{title:"Tabs",description:"A list of links as tabs.",icon:"icons:tab",color:"grey",groups:["Presentation","Links"],handles:[],meta:{author:"ELMS:LN"}},settings:{configure:[{property:"tabs",title:"Tabs",description:"Listing of tabs",inputMethod:"array",itemLabel:"label",properties:[{property:"link",title:"Link",description:"link to go to",inputMethod:"textfield",required:!0},{property:"label",title:"Label",description:"text to place on the tab",inputMethod:"textfield",required:!0}]}],advanced:[]}}}}],(i=[{key:"render",value:function(){return e.html(c||(c=s(["\n <a11y-tabs>\n ","\n </a11y-tabs>\n "])),this.tabs.map((function(t){return e.html(l||(l=s(['\n <a11y-tab label="','">\n <a\n target="_blank"\n href="','"\n tabindex="-1"\n rel="noopener noreferrer"\n >\n <button raised>',"</button>\n </a>\n </a11y-tab>\n "])),t.label,t.link,t.label)})))}},{key:"updated",value:function(t){var e=this;t.forEach((function(t,n){"tabs"==n&&e.dispatchEvent(new CustomEvent("tabs-changed",{bubbles:!0,cancelable:!0,composed:!0,detail:e[n]}))}))}}])&&n(r.prototype,i),f&&n(r,f),p}(e.LitElement);window.customElements.define(f.tag,f),t.TabList=f,Object.defineProperty(t,"__esModule",{value:!0})}));