From c619fa5788dcdbe062761bfebc892da249df96ea Mon Sep 17 00:00:00 2001 From: HerrHase Date: Fri, 7 Oct 2022 14:14:57 +0200 Subject: [PATCH] init --- example/example.js | 2 +- webpack.mix.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/example.js b/example/example.js index 7f49d4f..b84c4ae 100644 --- a/example/example.js +++ b/example/example.js @@ -43,4 +43,4 @@ function(t,e,n,r){const o=n||Pt(t);return l.has(o)||$(`The component named "${o} * @license http://opensource.org/licenses/MIT The MIT License * @link https://gitea.node001.net/tiny-components/confirm * - */const Gt=n.n(qt)()({confirm:function(t){this.off("confirm"),this.on("confirm",(function(){t()}))},cancel:function(t){this.off("cancel"),this.on("cancel",(function(){t()}))}}),Rt={css:null,exports:{state:{hasConfirmed:!1,hasCanceled:!1},handleOpen(){Gt.trigger("open",{title:"Question",content:"Are you sure?"}),Gt.confirm((()=>{this.state.hasConfirmed=!0,this.update(),setTimeout((()=>{this.state.hasConfirmed=!1,this.update()}),5e3)})),Gt.cancel((()=>{this.state.hasCanceled=!0,this.update(),setTimeout((()=>{this.state.hasCanceled=!1,this.update()}),5e3)}))}},template:(t,e,n,r)=>t('
',[{redundantAttribute:"expr5",selector:"[expr5]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>()=>{t.handleOpen()}}]},{type:n.IF,evaluate:t=>t.state.hasConfirmed,redundantAttribute:"expr6",selector:"[expr6]",template:t("\n Ok!\n ",[])},{type:n.IF,evaluate:t=>t.state.hasCanceled,redundantAttribute:"expr7",selector:"[expr7]",template:t("\n Ok! But why?!\n ",[])}]),name:"tiny-confirm"};Kt("tiny-confirm",{css:null,exports:{state:{isOpen:!1,transitionClass:!1,content:null},onMounted(){Gt.on("open",(t=>{this.open(t)})),this.root.addEventListener("transitionend",(t=>{this.state.transitionClass=!1,this.update()}))},open(t){this.state.transitionClass="modal-wrap--transition-open",this.state.isOpen=!0,t.title&&(this.state.title=t.title),t.content&&(this.state.content=t.content),this.update()},close(){this.state.transitionClass="modal-wrap--transition-close",this.state.isOpen=!1,this.state.content=null,this.update()},handleCancel(){Gt.trigger("cancel"),this.close()},handleConfirm(){Gt.trigger("confirm"),this.close()},getModalClasses(){const t=["tiny-modal modal"];return this.state.isOpen&&t.push("modal--open"),this.state.transitionClass&&t.push(this.state.transitionClass),t.join(" ")}},template:(t,e,n,r)=>t('
',[{redundantAttribute:"expr0",selector:"[expr0]",expressions:[{type:e.ATTRIBUTE,name:"class",evaluate:t=>t.getModalClasses()}]},{type:n.IF,evaluate:t=>t.state.title,redundantAttribute:"expr1",selector:"[expr1]",template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:t=>[t.state.title].join("")}]}])},{type:n.IF,evaluate:t=>t.state.content,redundantAttribute:"expr2",selector:"[expr2]",template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:t=>[t.state.content].join("")}]}])},{redundantAttribute:"expr3",selector:"[expr3]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>()=>{t.handleCancel()}}]},{redundantAttribute:"expr4",selector:"[expr4]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>()=>{t.handleConfirm()}}]}]),name:"tiny-confirm"}),Kt("example-confirm",Rt),Xt("tiny-confirm"),Xt("example-confirm")},37:()=>{},155:t=>{var e,n,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var a,u=[],c=!1,l=-1;function h(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!c){var t=i(h);c=!0;for(var e=u.length;e;){for(a=u,u=[];++l1)for(var n=1;n{if(!n){var i=1/0;for(l=0;l=s)&&Object.keys(r.O).every((t=>r.O[t](n[u])))?n.splice(u--,1):(a=!1,s0&&t[l-1][2]>s;l--)t[l]=t[l-1];t[l]=[n,o,s]},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={268:0,908:0};r.O.j=e=>0===t[e];var e=(e,n)=>{var o,s,[i,a,u]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(u)var l=u(r)}for(e&&e(n);cr(107)));var o=r.O(void 0,[908],(()=>r(37)));o=r.O(o)})(); \ No newline at end of file + */const Gt=n.n(qt)()({confirm:function(t){this.off("confirm"),this.on("confirm",(function(){t()}))},cancel:function(t){this.off("cancel"),this.on("cancel",(function(){t()}))}}),Rt={css:null,exports:{state:{hasConfirmed:!1,hasCanceled:!1},handleOpen(){Gt.trigger("open",{title:"Question",content:"Are you sure?"}),Gt.confirm((()=>{this.state.hasConfirmed=!0,this.update(),setTimeout((()=>{this.state.hasConfirmed=!1,this.update()}),5e3)})),Gt.cancel((()=>{this.state.hasCanceled=!0,this.update(),setTimeout((()=>{this.state.hasCanceled=!1,this.update()}),5e3)}))}},template:(t,e,n,r)=>t('
',[{redundantAttribute:"expr0",selector:"[expr0]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>()=>{t.handleOpen()}}]},{type:n.IF,evaluate:t=>t.state.hasConfirmed,redundantAttribute:"expr1",selector:"[expr1]",template:t("\n Ok!\n ",[])},{type:n.IF,evaluate:t=>t.state.hasCanceled,redundantAttribute:"expr2",selector:"[expr2]",template:t("\n Ok! But why?!\n ",[])}]),name:"tiny-confirm"};Kt("tiny-confirm",{css:null,exports:{state:{isOpen:!1,transitionClass:!1,content:null},onMounted(){Gt.on("open",(t=>{this.open(t)})),this.root.addEventListener("transitionend",(t=>{this.state.transitionClass=!1,this.update()}))},open(t){this.state.transitionClass="modal-wrap--transition-open",this.state.isOpen=!0,t.title&&(this.state.title=t.title),t.content&&(this.state.content=t.content),this.update()},close(){this.state.transitionClass="modal-wrap--transition-close",this.state.isOpen=!1,this.state.content=null,this.update()},handleCancel(){Gt.trigger("cancel"),this.close()},handleConfirm(){Gt.trigger("confirm"),this.close()},getModalClasses(){const t=["tiny-modal modal"];return this.state.isOpen&&t.push("modal--open"),this.state.transitionClass&&t.push(this.state.transitionClass),t.join(" ")}},template:(t,e,n,r)=>t('
',[{redundantAttribute:"expr3",selector:"[expr3]",expressions:[{type:e.ATTRIBUTE,name:"class",evaluate:t=>t.getModalClasses()}]},{type:n.IF,evaluate:t=>t.state.title,redundantAttribute:"expr4",selector:"[expr4]",template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:t=>[t.state.title].join("")}]}])},{type:n.IF,evaluate:t=>t.state.content,redundantAttribute:"expr5",selector:"[expr5]",template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:t=>[t.state.content].join("")}]}])},{redundantAttribute:"expr6",selector:"[expr6]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>()=>{t.handleCancel()}}]},{redundantAttribute:"expr7",selector:"[expr7]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>()=>{t.handleConfirm()}}]}]),name:"tiny-confirm"}),Kt("example-confirm",Rt),Xt("tiny-confirm"),Xt("example-confirm")},37:()=>{},155:t=>{var e,n,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var a,u=[],c=!1,l=-1;function h(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!c){var t=i(h);c=!0;for(var e=u.length;e;){for(a=u,u=[];++l1)for(var n=1;n{if(!n){var i=1/0;for(l=0;l=s)&&Object.keys(r.O).every((t=>r.O[t](n[u])))?n.splice(u--,1):(a=!1,s0&&t[l-1][2]>s;l--)t[l]=t[l-1];t[l]=[n,o,s]},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={268:0,908:0};r.O.j=e=>0===t[e];var e=(e,n)=>{var o,s,[i,a,u]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(u)var l=u(r)}for(e&&e(n);cr(107)));var o=r.O(void 0,[908],(()=>r(37)));o=r.O(o)})(); \ No newline at end of file diff --git a/webpack.mix.js b/webpack.mix.js index 010e601..8a65fb4 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -31,7 +31,9 @@ mix.webpackConfig({ } ]}, plugins: [ - new SvgSpritemapPlugin('node_modules/@tiny-components/plain-ui/src/icons/mono-icons/svg/*.svg', { + new SvgSpritemapPlugin([ + 'node_modules/@tiny-components/plain-ui/src/icons/mono-icons/svg/*.svg' + ], { output: { filename: 'symbol-defs.svg', chunk: {