3 lines
15 KiB
JavaScript
3 lines
15 KiB
JavaScript
import{c as e,d as t,b as n,D as a,o as $,e as s,f as r,E as l,p as o,g as c,h as p,i,j as m,k as f,F as d,l as u,m as g,A as h,y as w,G as x,a as v,n as y,S as b,ab as F,ac as I}from"./chunk.82446879.js";import{C as j,B as E}from"./chunk.f5a3f321.js";import"./chunk.e8a2e241.js";import{a as R}from"./chunk.4b4ee497.js";import{a as D}from"./chunk.b01e898f.js";import{a as S}from"./chunk.fb378401.js";import{a as T}from"./chunk.94a6e723.js";function k(e){let t,n;const $=new j({props:{type:"text",placeholder:"Text input"}});return{c(){t=s("div"),a($.$$.fragment),this.h()},l(e){t=c(e,"DIV",{slot:!0});var n=p(t);l($.$$.fragment,n),n.forEach(m),this.h()},h(){f(t,"slot","preview")},m(e,a){u(e,t,a),d($,t,null),n=!0},p:v,i(e){n||(h($.$$.fragment,e),n=!0)},o(e){w($.$$.fragment,e),n=!1},d(e){e&&m(t),x($)}}}function z(e){let t,n,a=JSON.stringify(e[1],null,2)+"";return{c(){t=r("// Bound values\n"),n=r(a)},l(e){t=i(e,"// Bound values\n"),n=i(e,a)},m(e,a){u(e,t,a),u(e,n,a)},p(e,t){2&t&&a!==(a=JSON.stringify(e[1],null,2)+"")&&y(n,a)},d(e){e&&m(t),e&&m(n)}}}function B(e){let t,n;function $(t){e[2].call(null,t)}let s={type:"text",placeholder:"Text input"};void 0!==e[1].name&&(s.value=e[1].name);const r=new j({props:s});return b.push(()=>F(r,"value",$)),{c(){a(r.$$.fragment)},l(e){l(r.$$.fragment,e)},m(e,t){d(r,e,t),n=!0},p(e,n){const a={};!t&&2&n&&(t=!0,a.value=e[1].name,I(()=>t=!1)),r.$set(a)},i(e){n||(h(r.$$.fragment,e),n=!0)},o(e){w(r.$$.fragment,e),n=!1},d(e){x(r,e)}}}function N(e){let t,n;function $(t){e[3].call(null,t)}let s={type:"email",maxlength:"30"};void 0!==e[1].email&&(s.value=e[1].email);const r=new j({props:s});return b.push(()=>F(r,"value",$)),{c(){a(r.$$.fragment)},l(e){l(r.$$.fragment,e)},m(e,t){d(r,e,t),n=!0},p(e,n){const a={};!t&&2&n&&(t=!0,a.value=e[1].email,I(()=>t=!1)),r.$set(a)},i(e){n||(h(r.$$.fragment,e),n=!0)},o(e){w(r.$$.fragment,e),n=!1},d(e){x(r,e)}}}function P(e){let t,n;function $(t){e[4].call(null,t)}let s={type:"email"};void 0!==e[1].username&&(s.value=e[1].username);const r=new j({props:s});return b.push(()=>F(r,"value",$)),{c(){a(r.$$.fragment)},l(e){l(r.$$.fragment,e)},m(e,t){d(r,e,t),n=!0},p(e,n){const a={};!t&&2&n&&(t=!0,a.value=e[1].username,I(()=>t=!1)),r.$set(a)},i(e){n||(h(r.$$.fragment,e),n=!0)},o(e){w(r.$$.fragment,e),n=!1},d(e){x(r,e)}}}function L(e){let t,n;function $(t){e[5].call(null,t)}let s={type:"password",passwordReveal:!0};void 0!==e[1].password&&(s.value=e[1].password);const r=new j({props:s});return b.push(()=>F(r,"value",$)),{c(){a(r.$$.fragment)},l(e){l(r.$$.fragment,e)},m(e,t){d(r,e,t),n=!0},p(e,n){const a={};!t&&2&n&&(t=!0,a.value=e[1].password,I(()=>t=!1)),r.$set(a)},i(e){n||(h(r.$$.fragment,e),n=!0)},o(e){w(r.$$.fragment,e),n=!1},d(e){x(r,e)}}}function W(e){let t;const n=new j({props:{type:"textarea",maxlength:"200"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function O(e){let t,n,r,i,v,y,b,F,I;const j=new D({props:{lang:"js",showCopy:!1,$$slots:{default:[z]},$$scope:{ctx:e}}}),R=new E({props:{label:"Name",$$slots:{default:[B]},$$scope:{ctx:e}}}),S=new E({props:{label:"Email",type:"is-danger",message:"Invalid email",$$slots:{default:[N]},$$scope:{ctx:e}}}),T=new E({props:{label:"Username",type:"is-success",message:"Username available",$$slots:{default:[P]},$$scope:{ctx:e}}}),k=new E({props:{label:"Password",$$slots:{default:[L]},$$scope:{ctx:e}}}),O=new E({props:{label:"Textarea",$$slots:{default:[W]},$$scope:{ctx:e}}});return{c(){t=s("div"),a(j.$$.fragment),n=$(),r=s("br"),i=$(),a(R.$$.fragment),v=$(),a(S.$$.fragment),y=$(),a(T.$$.fragment),b=$(),a(k.$$.fragment),F=$(),a(O.$$.fragment),this.h()},l(e){t=c(e,"DIV",{slot:!0});var a=p(t);l(j.$$.fragment,a),n=o(a),r=c(a,"BR",{}),i=o(a),l(R.$$.fragment,a),v=o(a),l(S.$$.fragment,a),y=o(a),l(T.$$.fragment,a),b=o(a),l(k.$$.fragment,a),F=o(a),l(O.$$.fragment,a),a.forEach(m),this.h()},h(){f(t,"slot","preview")},m(e,a){u(e,t,a),d(j,t,null),g(t,n),g(t,r),g(t,i),d(R,t,null),g(t,v),d(S,t,null),g(t,y),d(T,t,null),g(t,b),d(k,t,null),g(t,F),d(O,t,null),I=!0},p(e,t){const n={};66&t&&(n.$$scope={dirty:t,ctx:e}),j.$set(n);const a={};66&t&&(a.$$scope={dirty:t,ctx:e}),R.$set(a);const $={};66&t&&($.$$scope={dirty:t,ctx:e}),S.$set($);const s={};66&t&&(s.$$scope={dirty:t,ctx:e}),T.$set(s);const r={};66&t&&(r.$$scope={dirty:t,ctx:e}),k.$set(r);const l={};64&t&&(l.$$scope={dirty:t,ctx:e}),O.$set(l)},i(e){I||(h(j.$$.fragment,e),h(R.$$.fragment,e),h(S.$$.fragment,e),h(T.$$.fragment,e),h(k.$$.fragment,e),h(O.$$.fragment,e),I=!0)},o(e){w(j.$$.fragment,e),w(R.$$.fragment,e),w(S.$$.fragment,e),w(T.$$.fragment,e),w(k.$$.fragment,e),w(O.$$.fragment,e),I=!1},d(e){e&&m(t),x(j),x(R),x(S),x(T),x(k),x(O)}}}function C(e){let t;const n=new j({props:{placeholder:"No label"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function H(e){let t;const n=new j({props:{class:"is-rounded",placeholder:"Rounded"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function M(e){let t;const n=new j({props:{placeholder:"Info"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function U(e){let t;const n=new j({props:{placeholder:"Warning"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function V(e){let t;const n=new j({props:{placeholder:"Disabled",disabled:!0}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function A(e){let t;const n=new j({props:{placeholder:"Loading",loading:!0}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function G(e){let t,n,r,i,v,y,b;const F=new E({props:{$$slots:{default:[C]},$$scope:{ctx:e}}}),I=new E({props:{label:"Rounded",$$slots:{default:[H]},$$scope:{ctx:e}}}),j=new E({props:{label:"Info",type:"is-info",$$slots:{default:[M]},$$scope:{ctx:e}}}),R=new E({props:{label:"Warning",type:"is-warning",$$slots:{default:[U]},$$scope:{ctx:e}}}),D=new E({props:{label:"Disabled",$$slots:{default:[V]},$$scope:{ctx:e}}}),S=new E({props:{label:"Loading",$$slots:{default:[A]},$$scope:{ctx:e}}});return{c(){t=s("div"),a(F.$$.fragment),n=$(),a(I.$$.fragment),r=$(),a(j.$$.fragment),i=$(),a(R.$$.fragment),v=$(),a(D.$$.fragment),y=$(),a(S.$$.fragment),this.h()},l(e){t=c(e,"DIV",{slot:!0});var a=p(t);l(F.$$.fragment,a),n=o(a),l(I.$$.fragment,a),r=o(a),l(j.$$.fragment,a),i=o(a),l(R.$$.fragment,a),v=o(a),l(D.$$.fragment,a),y=o(a),l(S.$$.fragment,a),a.forEach(m),this.h()},h(){f(t,"slot","preview")},m(e,a){u(e,t,a),d(F,t,null),g(t,n),d(I,t,null),g(t,r),d(j,t,null),g(t,i),d(R,t,null),g(t,v),d(D,t,null),g(t,y),d(S,t,null),b=!0},p(e,t){const n={};64&t&&(n.$$scope={dirty:t,ctx:e}),F.$set(n);const a={};64&t&&(a.$$scope={dirty:t,ctx:e}),I.$set(a);const $={};64&t&&($.$$scope={dirty:t,ctx:e}),j.$set($);const s={};64&t&&(s.$$scope={dirty:t,ctx:e}),R.$set(s);const r={};64&t&&(r.$$scope={dirty:t,ctx:e}),D.$set(r);const l={};64&t&&(l.$$scope={dirty:t,ctx:e}),S.$set(l)},i(e){b||(h(F.$$.fragment,e),h(I.$$.fragment,e),h(j.$$.fragment,e),h(R.$$.fragment,e),h(D.$$.fragment,e),h(S.$$.fragment,e),b=!0)},o(e){w(F.$$.fragment,e),w(I.$$.fragment,e),w(j.$$.fragment,e),w(R.$$.fragment,e),w(D.$$.fragment,e),w(S.$$.fragment,e),b=!1},d(e){e&&m(t),x(F),x(I),x(j),x(R),x(D),x(S)}}}function J(e){let t;const n=new j({props:{placeholder:"Small",size:"is-small"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function q(e){let t;const n=new j({props:{placeholder:"Default"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function K(e){let t;const n=new j({props:{placeholder:"Medium",size:"is-medium"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function Q(e){let t;const n=new j({props:{placeholder:"Large",size:"is-large"}});return{c(){a(n.$$.fragment)},l(e){l(n.$$.fragment,e)},m(e,a){d(n,e,a),t=!0},p:v,i(e){t||(h(n.$$.fragment,e),t=!0)},o(e){w(n.$$.fragment,e),t=!1},d(e){x(n,e)}}}function X(e){let t,n,r,i,v;const y=new E({props:{$$slots:{default:[J]},$$scope:{ctx:e}}}),b=new E({props:{$$slots:{default:[q]},$$scope:{ctx:e}}}),F=new E({props:{$$slots:{default:[K]},$$scope:{ctx:e}}}),I=new E({props:{$$slots:{default:[Q]},$$scope:{ctx:e}}});return{c(){t=s("div"),a(y.$$.fragment),n=$(),a(b.$$.fragment),r=$(),a(F.$$.fragment),i=$(),a(I.$$.fragment),this.h()},l(e){t=c(e,"DIV",{slot:!0});var a=p(t);l(y.$$.fragment,a),n=o(a),l(b.$$.fragment,a),r=o(a),l(F.$$.fragment,a),i=o(a),l(I.$$.fragment,a),a.forEach(m),this.h()},h(){f(t,"slot","preview")},m(e,a){u(e,t,a),d(y,t,null),g(t,n),d(b,t,null),g(t,r),d(F,t,null),g(t,i),d(I,t,null),v=!0},p(e,t){const n={};64&t&&(n.$$scope={dirty:t,ctx:e}),y.$set(n);const a={};64&t&&(a.$$scope={dirty:t,ctx:e}),b.$set(a);const $={};64&t&&($.$$scope={dirty:t,ctx:e}),F.$set($);const s={};64&t&&(s.$$scope={dirty:t,ctx:e}),I.$set(s)},i(e){v||(h(y.$$.fragment,e),h(b.$$.fragment,e),h(F.$$.fragment,e),h(I.$$.fragment,e),v=!0)},o(e){w(y.$$.fragment,e),w(b.$$.fragment,e),w(F.$$.fragment,e),w(I.$$.fragment,e),v=!1},d(e){e&&m(t),x(y),x(b),x(F),x(I)}}}function Y(e){let t,n,v,y,b,F,I,j,E,D,z,B,N,P,L,W,C,H,M,U,V,A,J,q,K,Q,Y,Z,_,ee,te,ne,ae,$e,se,re,le,oe,ce;const pe=new R({props:{title:"Input",subtitle:"用户输入控件"}}),ie=new S({props:{code:'<script>\n import { Input } from \'svelma-pro\'\n<\/script>\n\n<Input type="text" placeholder="Text input" />\n',$$slots:{preview:[k]},$$scope:{ctx:e}}}),me=new S({props:{code:'<script>\n import { Field, Input } from \'svelma-pro\'\n\n let bound = {\n name: \'Rich Harris\',\n email: \'rich@\',\n username: \'richie55\',\n password: \'secret123\',\n }\n<\/script>\n\n<Field label="Name">\n <Input type="text" bind:value={bound.name} placeholder="Text input" />\n</Field>\n\n<Field label="Email" type="is-danger" message="Invalid email"> \n <Input type="email" bind:value={bound.email} maxlength="30" />\n</Field>\n\n<Field label="Username" type="is-success" message="Username available"> \n <Input type="email" bind:value={bound.username} />\n</Field>\n\n<Field label="Password"> \n <Input type="password" bind:value={bound.password} passwordReveal={true} />\n</Field>\n\n<Field label="Textarea"> \n <Input type="textarea" maxlength="200" />\n</Field>\n',$$slots:{preview:[O]},$$scope:{ctx:e}}}),fe=new S({props:{code:'<script>\n import { Field, Input } from \'svelma-pro\'\n<\/script>\n\n<Field>\n <Input placeholder="No label" />\n</Field>\n\n<Field label="Rounded">\n <Input class="is-rounded" placeholder="Rounded" />\n</Field>\n\n<Field label="Info" type="is-info"> \n <Input placeholder="Info" />\n</Field>\n\n<Field label="Warning" type="is-warning"> \n <Input placeholder="Warning" />\n</Field>\n\n<Field label="Disabled"> \n <Input placeholder="Disabled" disabled />\n</Field>\n\n<Field label="Loading">\n <Input placeholder="Loading" loading />\n</Field>',$$slots:{preview:[G]},$$scope:{ctx:e}}}),de=new S({props:{code:'<script>\n import { Field, Input } from \'svelma-pro\'\n<\/script>\n\n<Field>\n <Input placeholder="Small" size="is-small" />\n</Field>\n\n<Field>\n <Input placeholder="Default" />\n</Field>\n\n<Field>\n <Input placeholder="Medium" size="is-medium" />\n</Field>\n\n<Field>\n <Input placeholder="Large" size="is-large" />\n</Field>',$$slots:{preview:[X]},$$scope:{ctx:e}}}),ue=new T({props:{jsdoc:e[0]}});return{c(){a(pe.$$.fragment),t=$(),n=s("p"),v=r("Mostly just wraps "),y=s("code"),b=r("<input>"),F=r(" and "),I=s("code"),j=r("<textarea>"),E=r(" so additional Bulma features can be bound easily."),D=$(),z=s("br"),B=$(),a(ie.$$.fragment),N=$(),P=s("br"),L=$(),W=s("p"),C=r("Types and colors"),H=$(),M=s("p"),U=r("Wrap with "),V=s("a"),A=s("strong"),J=r("Field"),q=r(" for additional features"),K=$(),a(me.$$.fragment),Q=$(),Y=s("hr"),Z=$(),_=s("p"),ee=r("States, plus more styles"),te=$(),a(fe.$$.fragment),ne=$(),ae=s("hr"),$e=$(),se=s("p"),re=r("Sizes"),le=$(),a(de.$$.fragment),oe=$(),a(ue.$$.fragment),this.h()},l(e){l(pe.$$.fragment,e),t=o(e),n=c(e,"P",{class:!0});var a=p(n);v=i(a,"Mostly just wraps "),y=c(a,"CODE",{});var $=p(y);b=i($,"<input>"),$.forEach(m),F=i(a," and "),I=c(a,"CODE",{});var s=p(I);j=i(s,"<textarea>"),s.forEach(m),E=i(a," so additional Bulma features can be bound easily."),a.forEach(m),D=o(e),z=c(e,"BR",{}),B=o(e),l(ie.$$.fragment,e),N=o(e),P=c(e,"BR",{}),L=o(e),W=c(e,"P",{class:!0});var r=p(W);C=i(r,"Types and colors"),r.forEach(m),H=o(e),M=c(e,"P",{class:!0});var f=p(M);U=i(f,"Wrap with "),V=c(f,"A",{href:!0});var d=p(V);A=c(d,"STRONG",{});var u=p(A);J=i(u,"Field"),u.forEach(m),d.forEach(m),q=i(f," for additional features"),f.forEach(m),K=o(e),l(me.$$.fragment,e),Q=o(e),Y=c(e,"HR",{class:!0}),Z=o(e),_=c(e,"P",{class:!0});var g=p(_);ee=i(g,"States, plus more styles"),g.forEach(m),te=o(e),l(fe.$$.fragment,e),ne=o(e),ae=c(e,"HR",{class:!0}),$e=o(e),se=c(e,"P",{class:!0});var h=p(se);re=i(h,"Sizes"),h.forEach(m),le=o(e),l(de.$$.fragment,e),oe=o(e),l(ue.$$.fragment,e),this.h()},h(){f(n,"class","content"),f(W,"class","title is-4"),f(V,"href","components/field"),f(M,"class","content"),f(Y,"class","is-medium"),f(_,"class","title is-4"),f(ae,"class","is-medium"),f(se,"class","title is-4")},m(e,a){d(pe,e,a),u(e,t,a),u(e,n,a),g(n,v),g(n,y),g(y,b),g(n,F),g(n,I),g(I,j),g(n,E),u(e,D,a),u(e,z,a),u(e,B,a),d(ie,e,a),u(e,N,a),u(e,P,a),u(e,L,a),u(e,W,a),g(W,C),u(e,H,a),u(e,M,a),g(M,U),g(M,V),g(V,A),g(A,J),g(M,q),u(e,K,a),d(me,e,a),u(e,Q,a),u(e,Y,a),u(e,Z,a),u(e,_,a),g(_,ee),u(e,te,a),d(fe,e,a),u(e,ne,a),u(e,ae,a),u(e,$e,a),u(e,se,a),g(se,re),u(e,le,a),d(de,e,a),u(e,oe,a),d(ue,e,a),ce=!0},p(e,[t]){const n={};64&t&&(n.$$scope={dirty:t,ctx:e}),ie.$set(n);const a={};66&t&&(a.$$scope={dirty:t,ctx:e}),me.$set(a);const $={};64&t&&($.$$scope={dirty:t,ctx:e}),fe.$set($);const s={};64&t&&(s.$$scope={dirty:t,ctx:e}),de.$set(s);const r={};1&t&&(r.jsdoc=e[0]),ue.$set(r)},i(e){ce||(h(pe.$$.fragment,e),h(ie.$$.fragment,e),h(me.$$.fragment,e),h(fe.$$.fragment,e),h(de.$$.fragment,e),h(ue.$$.fragment,e),ce=!0)},o(e){w(pe.$$.fragment,e),w(ie.$$.fragment,e),w(me.$$.fragment,e),w(fe.$$.fragment,e),w(de.$$.fragment,e),w(ue.$$.fragment,e),ce=!1},d(e){x(pe,e),e&&m(t),e&&m(n),e&&m(D),e&&m(z),e&&m(B),x(ie,e),e&&m(N),e&&m(P),e&&m(L),e&&m(W),e&&m(H),e&&m(M),e&&m(K),x(me,e),e&&m(Q),e&&m(Y),e&&m(Z),e&&m(_),e&&m(te),x(fe,e),e&&m(ne),e&&m(ae),e&&m($e),e&&m(se),e&&m(le),x(de,e),e&&m(oe),x(ue,e)}}}async function Z(){const e=await this.fetch("components/input.json");return{jsdoc:await e.json()}}function _(e,t,n){let{jsdoc:a}=t,$={name:"Rich Harris",email:"rich@",username:"richie55",password:"secret123"};return e.$set=(e=>{"jsdoc"in e&&n(0,a=e.jsdoc)}),[a,$,function(e){$.name=e,n(1,$)},function(e){$.email=e,n(1,$)},function(e){$.username=e,n(1,$)},function(e){$.password=e,n(1,$)}]}export default class extends e{constructor(e){super(),t(this,e,_,Y,n,{jsdoc:0})}}export{Z as preload};
|
|
//# sourceMappingURL=input.948fdcb3.js.map
|