Anvil/assets/Created.stories-314c5ab2.js
André Jaenisch dff41f66d3
Updates
2024-02-17 23:52:33 +01:00

9 lines
2.6 KiB
JavaScript

import{a as C,n as m}from"./utils-3fb61e8d.js";import{x as f,i as T,d as c,j as _,q as E,H as A,l as p,a as u,r as F,y as H,b as y,f as h}from"./lifecycle-de4a075a.js";import{S as P,i as q}from"./index-464a621b.js";function g(o){let a,e,t,r;return{c(){a=_("span"),e=E("created "),t=_("date"),r=new A(!1),this.h()},l(n){a=p(n,"SPAN",{});var s=u(a);e=F(s,"created "),t=p(s,"DATE",{datetime:!0});var l=u(t);r=H(l,!1),l.forEach(c),s.forEach(c),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&&c(a)}}}function x(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&&c(a),e&&e.d(t)}}}function I(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 P{constructor(a){super(),q(this,a,I,x,C,{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 V={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)}()}},d={};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;d.parameters={...d.parameters,docs:{...(D=d.parameters)==null?void 0:D.docs,source:{originalSource:"{}",...(S=(v=d.parameters)==null?void 0:v.docs)==null?void 0:S.source}}};const L=["Plain","Missing"];export{d as Missing,i as Plain,L as __namedExportsOrder,V as default};