9 lines
2.6 KiB
JavaScript
9 lines
2.6 KiB
JavaScript
import{S as C,i as E,s as A,n as m}from"./index-788dbe18.js";import{r as f,j as T,h as d,e as _,t as F,H,c as p,b as u,m as P,u as I,i as y,k as h}from"./lifecycle-e76756ca.js";function g(o){let a,e,t,r;return{c(){a=_("span"),e=F("created "),t=_("date"),r=new H(!1),this.h()},l(n){a=p(n,"SPAN",{});var s=u(a);e=P(s,"created "),t=p(s,"DATE",{datetime:!0});var l=u(t);r=I(l,!1),l.forEach(d),s.forEach(d),this.h()},h(){r.a=null,y(t,"datetime",o[1])},m(n,s){T(n,a,s),h(a,e),h(a,t),r.m(o[0],t)},p(n,s){s&1&&r.p(n[0]),s&2&&y(t,"datetime",n[1])},d(n){n&&d(a)}}}function M(o){let a,e=o[1]&&o[0]&&g(o);return{c(){e&&e.c(),a=f()},l(t){e&&e.l(t),a=f()},m(t,r){e&&e.m(t,r),T(t,a,r)},p(t,[r]){t[1]&&t[0]?e?e.p(t,r):(e=g(t),e.c(),e.m(a.parentNode,a)):e&&(e.d(1),e=null)},i:m,o:m,d(t){t&&d(a),e&&e.d(t)}}}function N(o,a,e){let{created_at_formatted:t=""}=a,{created_at:r=null}=a;return o.$$set=n=>{"created_at_formatted"in n&&e(0,t=n.created_at_formatted),"created_at"in n&&e(1,r=n.created_at)},[t,r]}class j extends C{constructor(a){super(),E(this,a,N,M,A,{created_at_formatted:0,created_at:1})}}j.__docgen={version:3,name:"Created.svelte",data:[{keywords:[],visibility:"public",description:"Formatted datetime according to the locale.",name:"created_at_formatted",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[],visibility:"public",description:"Date object for created time.",name:"created_at",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const q={title:"Atoms/Created",component:j,tags:["autodocs"],argTypes:{created_at:{control:"date",description:"Date of creation"},created_at_formatted:{control:"text",description:"Localised version of created_at"}}},i={args:{created_at:new Date,created_at_formatted:function(){const o="en-US";return new Intl.DateTimeFormat(o).format(new Date)}()}},c={};var b,k,w;i.parameters={...i.parameters,docs:{...(b=i.parameters)==null?void 0:b.docs,source:{originalSource:`{
|
|
args: {
|
|
created_at: new Date(),
|
|
created_at_formatted: function () {
|
|
const locale = 'en-US';
|
|
return new Intl.DateTimeFormat(locale).format(new Date());
|
|
}()
|
|
}
|
|
}`,...(w=(k=i.parameters)==null?void 0:k.docs)==null?void 0:w.source}}};var D,v,S;c.parameters={...c.parameters,docs:{...(D=c.parameters)==null?void 0:D.docs,source:{originalSource:"{}",...(S=(v=c.parameters)==null?void 0:v.docs)==null?void 0:S.source}}};const x=["Plain","Missing"];export{c as Missing,i as Plain,x as __namedExportsOrder,q as default};
|