supython 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- supython/__init__.py +24 -0
- supython/admin/__init__.py +3 -0
- supython/admin/api/__init__.py +24 -0
- supython/admin/api/auth.py +118 -0
- supython/admin/api/auth_templates.py +67 -0
- supython/admin/api/auth_users.py +225 -0
- supython/admin/api/db.py +174 -0
- supython/admin/api/functions.py +92 -0
- supython/admin/api/jobs.py +192 -0
- supython/admin/api/ops.py +224 -0
- supython/admin/api/realtime.py +281 -0
- supython/admin/api/service_auth.py +49 -0
- supython/admin/api/service_auth_templates.py +83 -0
- supython/admin/api/service_auth_users.py +346 -0
- supython/admin/api/service_db.py +214 -0
- supython/admin/api/service_functions.py +287 -0
- supython/admin/api/service_jobs.py +282 -0
- supython/admin/api/service_ops.py +213 -0
- supython/admin/api/service_realtime.py +30 -0
- supython/admin/api/service_storage.py +220 -0
- supython/admin/api/storage.py +117 -0
- supython/admin/api/system.py +37 -0
- supython/admin/audit.py +29 -0
- supython/admin/deps.py +22 -0
- supython/admin/errors.py +16 -0
- supython/admin/schemas.py +310 -0
- supython/admin/session.py +52 -0
- supython/admin/spa.py +38 -0
- supython/admin/static/assets/Alert-dluGVkos.js +49 -0
- supython/admin/static/assets/Audit-Njung3HI.js +2 -0
- supython/admin/static/assets/Backups-DzPlFgrm.js +2 -0
- supython/admin/static/assets/Buckets-ByacGkU1.js +2 -0
- supython/admin/static/assets/Channels-BoIuTtam.js +353 -0
- supython/admin/static/assets/ChevronRight-CtQH1EQ1.js +2 -0
- supython/admin/static/assets/CodeViewer-Bqy7-wvH.js +2 -0
- supython/admin/static/assets/Crons-B67vc39F.js +2 -0
- supython/admin/static/assets/DashboardView-CUTFVL6k.js +2 -0
- supython/admin/static/assets/DataTable-COAAWEft.js +747 -0
- supython/admin/static/assets/DescriptionsItem-P8JUDaBs.js +75 -0
- supython/admin/static/assets/DrawerContent-TpYTFgF1.js +139 -0
- supython/admin/static/assets/Empty-cr2r7e2u.js +25 -0
- supython/admin/static/assets/EmptyState-DeDck-OL.js +2 -0
- supython/admin/static/assets/Grid-hFkp9F4P.js +2 -0
- supython/admin/static/assets/Input-DppYTq9C.js +259 -0
- supython/admin/static/assets/Invoke-DW3Nveeh.js +2 -0
- supython/admin/static/assets/JsonField-DibyJgun.js +2 -0
- supython/admin/static/assets/LoginView-BjLyE3Ds.css +1 -0
- supython/admin/static/assets/LoginView-CoOjECT_.js +111 -0
- supython/admin/static/assets/Logs-D9WYrnIT.js +2 -0
- supython/admin/static/assets/Logs-DS1XPa0h.css +1 -0
- supython/admin/static/assets/Migrations-DOSC2ddQ.js +2 -0
- supython/admin/static/assets/ObjectBrowser-_5w8vOX8.js +2 -0
- supython/admin/static/assets/Queue-CywZs6vI.js +2 -0
- supython/admin/static/assets/RefreshTokens-Ccjr53jg.js +2 -0
- supython/admin/static/assets/RlsEditor-BSlH9vSc.js +2 -0
- supython/admin/static/assets/Routes-BiLXE49D.js +2 -0
- supython/admin/static/assets/Routes-C-ianIGD.css +1 -0
- supython/admin/static/assets/SchemaBrowser-DKy2_KQi.css +1 -0
- supython/admin/static/assets/SchemaBrowser-XFvFbtDB.js +2 -0
- supython/admin/static/assets/Select-DIzZyRZb.js +434 -0
- supython/admin/static/assets/Space-n5-XcguU.js +400 -0
- supython/admin/static/assets/SqlEditor-b8pTsILY.js +3 -0
- supython/admin/static/assets/SqlWorkspace-BUS7IntH.js +104 -0
- supython/admin/static/assets/TableData-CQIagLKn.js +2 -0
- supython/admin/static/assets/Tag-D1fOKpTH.js +72 -0
- supython/admin/static/assets/Templates-BS-ugkdq.js +2 -0
- supython/admin/static/assets/Thing-CEAniuMg.js +107 -0
- supython/admin/static/assets/Users-wzwajhlh.js +2 -0
- supython/admin/static/assets/_plugin-vue_export-helper-DGA9ry_j.js +1 -0
- supython/admin/static/assets/dist-VXIJLCYq.js +13 -0
- supython/admin/static/assets/format-length-CGCY1rMh.js +2 -0
- supython/admin/static/assets/get-Ca6unauB.js +2 -0
- supython/admin/static/assets/index-CeE6v959.js +951 -0
- supython/admin/static/assets/pinia-COXwfrOX.js +2 -0
- supython/admin/static/assets/resources-Bt6thQCD.js +44 -0
- supython/admin/static/assets/use-locale-mtgM0a3a.js +2 -0
- supython/admin/static/assets/use-merged-state-BvhkaHNX.js +2 -0
- supython/admin/static/assets/useConfirm-tMjvBFXR.js +2 -0
- supython/admin/static/assets/useResource-C_rJCY8C.js +2 -0
- supython/admin/static/assets/useTable-CnZc5zhi.js +363 -0
- supython/admin/static/assets/useTable-Dg0XlRlq.css +1 -0
- supython/admin/static/assets/useToast-DsZKx0IX.js +2 -0
- supython/admin/static/assets/utils-sbXoq7Ir.js +2 -0
- supython/admin/static/favicon.svg +1 -0
- supython/admin/static/icons.svg +24 -0
- supython/admin/static/index.html +24 -0
- supython/app.py +162 -0
- supython/auth/__init__.py +3 -0
- supython/auth/_email_job.py +11 -0
- supython/auth/providers/__init__.py +34 -0
- supython/auth/providers/github.py +22 -0
- supython/auth/providers/google.py +19 -0
- supython/auth/providers/oauth.py +56 -0
- supython/auth/providers/registry.py +16 -0
- supython/auth/ratelimit.py +39 -0
- supython/auth/router.py +282 -0
- supython/auth/schemas.py +79 -0
- supython/auth/service.py +587 -0
- supython/backups/__init__.py +24 -0
- supython/backups/_backup_job.py +170 -0
- supython/backups/schemas.py +18 -0
- supython/backups/service.py +217 -0
- supython/body_size.py +184 -0
- supython/cli.py +1663 -0
- supython/client/__init__.py +67 -0
- supython/client/_auth.py +249 -0
- supython/client/_client.py +145 -0
- supython/client/_config.py +92 -0
- supython/client/_functions.py +69 -0
- supython/client/_storage.py +255 -0
- supython/client/py.typed +0 -0
- supython/db.py +151 -0
- supython/db_admin.py +8 -0
- supython/extensions.py +36 -0
- supython/functions/__init__.py +19 -0
- supython/functions/context.py +262 -0
- supython/functions/loader.py +307 -0
- supython/functions/router.py +228 -0
- supython/functions/schemas.py +50 -0
- supython/gen/__init__.py +5 -0
- supython/gen/_introspect.py +137 -0
- supython/gen/types_py.py +270 -0
- supython/gen/types_ts.py +365 -0
- supython/health.py +229 -0
- supython/hooks.py +117 -0
- supython/jobs/__init__.py +31 -0
- supython/jobs/backends.py +97 -0
- supython/jobs/context.py +58 -0
- supython/jobs/cron.py +152 -0
- supython/jobs/cron_inproc.py +119 -0
- supython/jobs/decorators.py +76 -0
- supython/jobs/registry.py +79 -0
- supython/jobs/router.py +136 -0
- supython/jobs/schemas.py +92 -0
- supython/jobs/service.py +311 -0
- supython/jobs/worker.py +219 -0
- supython/jwks.py +257 -0
- supython/keyset.py +279 -0
- supython/logging_config.py +291 -0
- supython/mail.py +33 -0
- supython/mailer.py +65 -0
- supython/migrate.py +81 -0
- supython/migrations/0001_extensions_and_roles.sql +46 -0
- supython/migrations/0002_auth_schema.sql +66 -0
- supython/migrations/0003_demo_todos.sql +42 -0
- supython/migrations/0004_auth_v0_2.sql +47 -0
- supython/migrations/0005_storage_schema.sql +117 -0
- supython/migrations/0006_realtime_schema.sql +206 -0
- supython/migrations/0007_jobs_schema.sql +254 -0
- supython/migrations/0008_jobs_last_error.sql +56 -0
- supython/migrations/0009_auth_rate_limits.sql +33 -0
- supython/migrations/0010_worker_heartbeat.sql +14 -0
- supython/migrations/0011_admin_schema.sql +45 -0
- supython/migrations/0012_auth_banned_until.sql +10 -0
- supython/migrations/0013_email_templates.sql +19 -0
- supython/migrations/0014_realtime_payload_warning.sql +96 -0
- supython/migrations/0015_backups_schema.sql +14 -0
- supython/passwords.py +15 -0
- supython/realtime/__init__.py +6 -0
- supython/realtime/broker.py +814 -0
- supython/realtime/protocol.py +234 -0
- supython/realtime/router.py +184 -0
- supython/realtime/schemas.py +207 -0
- supython/realtime/service.py +261 -0
- supython/realtime/topics.py +175 -0
- supython/realtime/websocket.py +586 -0
- supython/scaffold/__init__.py +5 -0
- supython/scaffold/init_project.py +144 -0
- supython/scaffold/templates/Caddyfile.tmpl +4 -0
- supython/scaffold/templates/README.md.tmpl +22 -0
- supython/scaffold/templates/apps_hooks.py.tmpl +11 -0
- supython/scaffold/templates/apps_jobs.py.tmpl +8 -0
- supython/scaffold/templates/asgi.py.tmpl +14 -0
- supython/scaffold/templates/docker-compose.prod.yml.tmpl +84 -0
- supython/scaffold/templates/docker-compose.yml.tmpl +45 -0
- supython/scaffold/templates/docker_postgres_Dockerfile.tmpl +9 -0
- supython/scaffold/templates/docker_postgres_postgresql.conf.tmpl +3 -0
- supython/scaffold/templates/env.example.tmpl +168 -0
- supython/scaffold/templates/functions_README.md.tmpl +21 -0
- supython/scaffold/templates/gitignore.tmpl +14 -0
- supython/scaffold/templates/manage.py.tmpl +11 -0
- supython/scaffold/templates/migrations/.gitkeep +0 -0
- supython/scaffold/templates/package_init.py.tmpl +1 -0
- supython/scaffold/templates/settings.py.tmpl +31 -0
- supython/secretset.py +347 -0
- supython/security_headers.py +78 -0
- supython/settings.py +244 -0
- supython/settings_module.py +117 -0
- supython/storage/__init__.py +5 -0
- supython/storage/backends.py +392 -0
- supython/storage/router.py +341 -0
- supython/storage/schemas.py +50 -0
- supython/storage/service.py +445 -0
- supython/storage/signing.py +119 -0
- supython/tokens.py +85 -0
- supython-0.1.0.dist-info/METADATA +756 -0
- supython-0.1.0.dist-info/RECORD +200 -0
- supython-0.1.0.dist-info/WHEEL +4 -0
- supython-0.1.0.dist-info/entry_points.txt +2 -0
- supython-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import{$t as e,Gt as t,Jt as n,Kt as r,O as i,Qt as a,Sn as o,Xt as s,Yt as c,Zt as l,bt as u,lt as d,mn as f,ut as p,wn as m,yt as h}from"./Space-n5-XcguU.js";import{s as g}from"./Input-DppYTq9C.js";import{r as _}from"./Tag-D1fOKpTH.js";import{x as v}from"./index-CeE6v959.js";function y(e,t=`default`,n=[]){let{children:r}=e;if(typeof r==`object`&&r&&!Array.isArray(r)){let e=r[t];if(typeof e==`function`)return e()}return n}var b=t([r(`descriptions`,{fontSize:`var(--n-font-size)`},[r(`descriptions-separator`,`
|
|
2
|
+
display: inline-block;
|
|
3
|
+
margin: 0 8px 0 2px;
|
|
4
|
+
`),r(`descriptions-table-wrapper`,[r(`descriptions-table`,[r(`descriptions-table-row`,[r(`descriptions-table-header`,{padding:`var(--n-th-padding)`}),r(`descriptions-table-content`,{padding:`var(--n-td-padding)`})])])]),s(`bordered`,[r(`descriptions-table-wrapper`,[r(`descriptions-table`,[r(`descriptions-table-row`,[t(`&:last-child`,[r(`descriptions-table-content`,{paddingBottom:0})])])])])]),c(`left-label-placement`,[r(`descriptions-table-content`,[t(`> *`,{verticalAlign:`top`})])]),c(`left-label-align`,[t(`th`,{textAlign:`left`})]),c(`center-label-align`,[t(`th`,{textAlign:`center`})]),c(`right-label-align`,[t(`th`,{textAlign:`right`})]),c(`bordered`,[r(`descriptions-table-wrapper`,`
|
|
5
|
+
border-radius: var(--n-border-radius);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
background: var(--n-merged-td-color);
|
|
8
|
+
border: 1px solid var(--n-merged-border-color);
|
|
9
|
+
`,[r(`descriptions-table`,[r(`descriptions-table-row`,[t(`&:not(:last-child)`,[r(`descriptions-table-content`,{borderBottom:`1px solid var(--n-merged-border-color)`}),r(`descriptions-table-header`,{borderBottom:`1px solid var(--n-merged-border-color)`})]),r(`descriptions-table-header`,`
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
background-clip: padding-box;
|
|
12
|
+
background-color: var(--n-merged-th-color);
|
|
13
|
+
`,[t(`&:not(:last-child)`,{borderRight:`1px solid var(--n-merged-border-color)`})]),r(`descriptions-table-content`,[t(`&:not(:last-child)`,{borderRight:`1px solid var(--n-merged-border-color)`})])])])])]),r(`descriptions-header`,`
|
|
14
|
+
font-weight: var(--n-th-font-weight);
|
|
15
|
+
font-size: 18px;
|
|
16
|
+
transition: color .3s var(--n-bezier);
|
|
17
|
+
line-height: var(--n-line-height);
|
|
18
|
+
margin-bottom: 16px;
|
|
19
|
+
color: var(--n-title-text-color);
|
|
20
|
+
`),r(`descriptions-table-wrapper`,`
|
|
21
|
+
transition:
|
|
22
|
+
background-color .3s var(--n-bezier),
|
|
23
|
+
border-color .3s var(--n-bezier);
|
|
24
|
+
`,[r(`descriptions-table`,`
|
|
25
|
+
width: 100%;
|
|
26
|
+
border-collapse: separate;
|
|
27
|
+
border-spacing: 0;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
`,[r(`descriptions-table-row`,`
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
transition: border-color .3s var(--n-bezier);
|
|
32
|
+
`,[r(`descriptions-table-header`,`
|
|
33
|
+
font-weight: var(--n-th-font-weight);
|
|
34
|
+
line-height: var(--n-line-height);
|
|
35
|
+
display: table-cell;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
color: var(--n-th-text-color);
|
|
38
|
+
transition:
|
|
39
|
+
color .3s var(--n-bezier),
|
|
40
|
+
background-color .3s var(--n-bezier),
|
|
41
|
+
border-color .3s var(--n-bezier);
|
|
42
|
+
`),r(`descriptions-table-content`,`
|
|
43
|
+
vertical-align: top;
|
|
44
|
+
line-height: var(--n-line-height);
|
|
45
|
+
display: table-cell;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
color: var(--n-td-text-color);
|
|
48
|
+
transition:
|
|
49
|
+
color .3s var(--n-bezier),
|
|
50
|
+
background-color .3s var(--n-bezier),
|
|
51
|
+
border-color .3s var(--n-bezier);
|
|
52
|
+
`,[n(`content`,`
|
|
53
|
+
transition: color .3s var(--n-bezier);
|
|
54
|
+
display: inline-block;
|
|
55
|
+
color: var(--n-td-text-color);
|
|
56
|
+
`)]),n(`label`,`
|
|
57
|
+
font-weight: var(--n-th-font-weight);
|
|
58
|
+
transition: color .3s var(--n-bezier);
|
|
59
|
+
display: inline-block;
|
|
60
|
+
margin-right: 14px;
|
|
61
|
+
color: var(--n-th-text-color);
|
|
62
|
+
`)])])])]),r(`descriptions-table-wrapper`,`
|
|
63
|
+
--n-merged-th-color: var(--n-th-color);
|
|
64
|
+
--n-merged-td-color: var(--n-td-color);
|
|
65
|
+
--n-merged-border-color: var(--n-border-color);
|
|
66
|
+
`),a(r(`descriptions-table-wrapper`,`
|
|
67
|
+
--n-merged-th-color: var(--n-th-color-modal);
|
|
68
|
+
--n-merged-td-color: var(--n-td-color-modal);
|
|
69
|
+
--n-merged-border-color: var(--n-border-color-modal);
|
|
70
|
+
`)),e(r(`descriptions-table-wrapper`,`
|
|
71
|
+
--n-merged-th-color: var(--n-th-color-popover);
|
|
72
|
+
--n-merged-td-color: var(--n-td-color-popover);
|
|
73
|
+
--n-merged-border-color: var(--n-border-color-popover);
|
|
74
|
+
`))]),x=`DESCRIPTION_ITEM_FLAG`;function S(e){return typeof e==`object`&&e&&!Array.isArray(e)?e.type&&e.type.DESCRIPTION_ITEM_FLAG:!1}var C=o({name:`Descriptions`,props:Object.assign(Object.assign({},i.props),{title:String,column:{type:Number,default:3},columns:Number,labelPlacement:{type:String,default:`top`},labelAlign:{type:String,default:`left`},separator:{type:String,default:`:`},size:String,bordered:Boolean,labelClass:String,labelStyle:[Object,String],contentClass:String,contentStyle:[Object,String]}),slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=p(e),a=f(()=>e.size||r?.value?.Descriptions?.size||`medium`),o=i(`Descriptions`,`-descriptions`,b,v,e,t),s=f(()=>{let{bordered:t}=e,n=a.value,{common:{cubicBezierEaseInOut:r},self:{titleTextColor:i,thColor:s,thColorModal:c,thColorPopover:u,thTextColor:d,thFontWeight:f,tdTextColor:p,tdColor:m,tdColorModal:h,tdColorPopover:g,borderColor:_,borderColorModal:v,borderColorPopover:y,borderRadius:b,lineHeight:x,[l(`fontSize`,n)]:S,[l(t?`thPaddingBordered`:`thPadding`,n)]:C,[l(t?`tdPaddingBordered`:`tdPadding`,n)]:w}}=o.value;return{"--n-title-text-color":i,"--n-th-padding":C,"--n-td-padding":w,"--n-font-size":S,"--n-bezier":r,"--n-th-font-weight":f,"--n-line-height":x,"--n-th-text-color":d,"--n-td-text-color":p,"--n-th-color":s,"--n-th-color-modal":c,"--n-th-color-popover":u,"--n-td-color":m,"--n-td-color-modal":h,"--n-td-color-popover":g,"--n-border-radius":b,"--n-border-color":_,"--n-border-color-modal":v,"--n-border-color-popover":y}}),c=n?d(`descriptions`,f(()=>{let t=``,{bordered:n}=e;return n&&(t+=`a`),t+=a.value[0],t}),s,e):void 0;return{mergedClsPrefix:t,cssVars:n?void 0:s,themeClass:c?.themeClass,onRender:c?.onRender,compitableColumn:_(e,[`columns`,`column`]),inlineThemeDisabled:n,mergedSize:a}},render(){let e=this.$slots.default,t=e?u(e()):[];t.length;let{contentClass:n,labelClass:r,compitableColumn:i,labelPlacement:a,labelAlign:o,mergedSize:s,bordered:c,title:l,cssVars:d,mergedClsPrefix:f,separator:p,onRender:_}=this;_?.();let v=t.filter(e=>S(e)),b=v.reduce((e,t,o)=>{let s=t.props||{},l=v.length-1===o,u=[`label`in s?s.label:y(t,`label`)],d=[y(t)],h=s.span||1,g=e.span;e.span+=h;let _=s.labelStyle||s[`label-style`]||this.labelStyle,b=s.contentStyle||s[`content-style`]||this.contentStyle;if(a===`left`)c?e.row.push(m(`th`,{class:[`${f}-descriptions-table-header`,r],colspan:1,style:_},u),m(`td`,{class:[`${f}-descriptions-table-content`,n],colspan:l?(i-g)*2+1:h*2-1,style:b},d)):e.row.push(m(`td`,{class:`${f}-descriptions-table-content`,colspan:l?(i-g)*2:h*2},m(`span`,{class:[`${f}-descriptions-table-content__label`,r],style:_},[...u,p&&m(`span`,{class:`${f}-descriptions-separator`},p)]),m(`span`,{class:[`${f}-descriptions-table-content__content`,n],style:b},d)));else{let t=l?(i-g)*2:h*2;e.row.push(m(`th`,{class:[`${f}-descriptions-table-header`,r],colspan:t,style:_},u)),e.secondRow.push(m(`td`,{class:[`${f}-descriptions-table-content`,n],colspan:t,style:b},d))}return(e.span>=i||l)&&(e.span=0,e.row.length&&(e.rows.push(e.row),e.row=[]),a!==`left`&&e.secondRow.length&&(e.rows.push(e.secondRow),e.secondRow=[])),e},{span:0,row:[],secondRow:[],rows:[]}).rows.map(e=>m(`tr`,{class:`${f}-descriptions-table-row`},e));return m(`div`,{style:d,class:[`${f}-descriptions`,this.themeClass,`${f}-descriptions--${a}-label-placement`,`${f}-descriptions--${o}-label-align`,`${f}-descriptions--${s}-size`,c&&`${f}-descriptions--bordered`]},l||this.$slots.header?m(`div`,{class:`${f}-descriptions-header`},l||h(this,`header`)):null,m(`div`,{class:`${f}-descriptions-table-wrapper`},m(`table`,{class:`${f}-descriptions-table`},m(`tbody`,null,a===`top`&&m(`tr`,{class:`${f}-descriptions-table-row`,style:{visibility:`collapse`}},g(i*2,m(`td`,null))),b))))}}),w={label:String,span:{type:Number,default:1},labelClass:String,labelStyle:[Object,String],contentClass:String,contentStyle:[Object,String]},T=o({name:`DescriptionsItem`,[x]:!0,props:w,slots:Object,render(){return null}});export{C as n,T as t};
|
|
75
|
+
//# sourceMappingURL=DescriptionsItem-P8JUDaBs.js.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{A as e,En as t,Gt as n,Jt as r,Kn as i,Kt as a,Ln as o,Mn as s,O as c,On as l,S as u,Sn as d,St as f,Un as p,Wn as m,Yt as h,ar as g,j as _,jt as v,lt as y,mn as b,nn as x,on as S,p as C,tr as w,ut as T,v as E,wn as D,xt as O}from"./Space-n5-XcguU.js";import{B as k,I as A,L as j,M,O as N,S as P,V as F,j as I,w as L}from"./Select-DIzZyRZb.js";import{t as R}from"./use-merged-state-BvhkaHNX.js";import{t as z}from"./format-length-CGCY1rMh.js";import{B,V,v as H}from"./index-CeE6v959.js";var U=d({name:`NDrawerContent`,inheritAttrs:!1,props:{blockScroll:Boolean,show:{type:Boolean,default:void 0},displayDirective:{type:String,required:!0},placement:{type:String,required:!0},contentClass:String,contentStyle:[Object,String],nativeScrollbar:{type:Boolean,required:!0},scrollbarProps:Object,trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},showMask:{type:[Boolean,String],required:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,onClickoutside:Function,onAfterLeave:Function,onAfterEnter:Function,onEsc:Function},setup(e){let n=w(!!e.show),r=w(null),i=t(F),a=0,c=``,l=null,u=w(!1),d=w(!1),f=b(()=>e.placement===`top`||e.placement===`bottom`),{mergedClsPrefixRef:h,mergedRtlRef:g}=T(e),v=_(`Drawer`,g,h),y=L,x=e=>{d.value=!0,a=f.value?e.clientY:e.clientX,c=document.body.style.cursor,document.body.style.cursor=f.value?`ns-resize`:`ew-resize`,document.body.addEventListener(`mousemove`,I),document.body.addEventListener(`mouseleave`,y),document.body.addEventListener(`mouseup`,L)},C=()=>{l!==null&&(window.clearTimeout(l),l=null),d.value?u.value=!0:l=window.setTimeout(()=>{u.value=!0},300)},E=()=>{l!==null&&(window.clearTimeout(l),l=null),u.value=!1},{doUpdateHeight:D,doUpdateWidth:O}=i,N=t=>{let{maxWidth:n}=e;if(n&&t>n)return n;let{minWidth:r}=e;return r&&t<r?r:t},P=t=>{let{maxHeight:n}=e;if(n&&t>n)return n;let{minHeight:r}=e;return r&&t<r?r:t};function I(t){if(d.value)if(f.value){let n=r.value?.offsetHeight||0,i=a-t.clientY;n+=e.placement===`bottom`?i:-i,n=P(n),D(n),a=t.clientY}else{let n=r.value?.offsetWidth||0,i=a-t.clientX;n+=e.placement===`right`?i:-i,n=N(n),O(n),a=t.clientX}}function L(){d.value&&(a=0,d.value=!1,document.body.style.cursor=c,document.body.removeEventListener(`mousemove`,I),document.body.removeEventListener(`mouseup`,L),document.body.removeEventListener(`mouseleave`,y))}m(()=>{e.show&&(n.value=!0)}),p(()=>e.show,e=>{e||L()}),s(()=>{L()});let R=b(()=>{let{show:t}=e,n=[[S,t]];return e.showMask||n.push([M,e.onClickoutside,void 0,{capture:!0}]),n});function z(){var t;n.value=!1,(t=e.onAfterLeave)==null||t.call(e)}return B(b(()=>e.blockScroll&&n.value)),o(k,r),o(A,null),o(j,null),{bodyRef:r,rtlEnabled:v,mergedClsPrefix:i.mergedClsPrefixRef,isMounted:i.isMountedRef,mergedTheme:i.mergedThemeRef,displayed:n,transitionName:b(()=>({right:`slide-in-from-right-transition`,left:`slide-in-from-left-transition`,top:`slide-in-from-top-transition`,bottom:`slide-in-from-bottom-transition`})[e.placement]),handleAfterLeave:z,bodyDirectives:R,handleMousedownResizeTrigger:x,handleMouseenterResizeTrigger:C,handleMouseleaveResizeTrigger:E,isDragging:d,isHoverOnResizeTrigger:u}},render(){let{$slots:e,mergedClsPrefix:t}=this;return this.displayDirective===`show`||this.displayed||this.show?i(D(`div`,{role:`none`},D(L,{disabled:!this.showMask||!this.trapFocus,active:this.show,autoFocus:this.autoFocus,onEsc:this.onEsc},{default:()=>D(x,{name:this.transitionName,appear:this.isMounted,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>i(D(`div`,l(this.$attrs,{role:`dialog`,ref:`bodyRef`,"aria-modal":`true`,class:[`${t}-drawer`,this.rtlEnabled&&`${t}-drawer--rtl`,`${t}-drawer--${this.placement}-placement`,this.isDragging&&`${t}-drawer--unselectable`,this.nativeScrollbar&&`${t}-drawer--native-scrollbar`]}),[this.resizable?D(`div`,{class:[`${t}-drawer__resize-trigger`,(this.isDragging||this.isHoverOnResizeTrigger)&&`${t}-drawer__resize-trigger--hover`],onMouseenter:this.handleMouseenterResizeTrigger,onMouseleave:this.handleMouseleaveResizeTrigger,onMousedown:this.handleMousedownResizeTrigger}):null,this.nativeScrollbar?D(`div`,{class:[`${t}-drawer-content-wrapper`,this.contentClass],style:this.contentStyle,role:`none`},e):D(C,Object.assign({},this.scrollbarProps,{contentStyle:this.contentStyle,contentClass:[`${t}-drawer-content-wrapper`,this.contentClass],theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar}),e)]),this.bodyDirectives)})})),[[S,this.displayDirective===`if`||this.displayed||this.show]]):null}}),{cubicBezierEaseIn:W,cubicBezierEaseOut:G}=e;function K({duration:e=`0.3s`,leaveDuration:t=`0.2s`,name:r=`slide-in-from-bottom`}={}){return[n(`&.${r}-transition-leave-active`,{transition:`transform ${t} ${W}`}),n(`&.${r}-transition-enter-active`,{transition:`transform ${e} ${G}`}),n(`&.${r}-transition-enter-to`,{transform:`translateY(0)`}),n(`&.${r}-transition-enter-from`,{transform:`translateY(100%)`}),n(`&.${r}-transition-leave-from`,{transform:`translateY(0)`}),n(`&.${r}-transition-leave-to`,{transform:`translateY(100%)`})]}var{cubicBezierEaseIn:q,cubicBezierEaseOut:J}=e;function Y({duration:e=`0.3s`,leaveDuration:t=`0.2s`,name:r=`slide-in-from-left`}={}){return[n(`&.${r}-transition-leave-active`,{transition:`transform ${t} ${q}`}),n(`&.${r}-transition-enter-active`,{transition:`transform ${e} ${J}`}),n(`&.${r}-transition-enter-to`,{transform:`translateX(0)`}),n(`&.${r}-transition-enter-from`,{transform:`translateX(-100%)`}),n(`&.${r}-transition-leave-from`,{transform:`translateX(0)`}),n(`&.${r}-transition-leave-to`,{transform:`translateX(-100%)`})]}var{cubicBezierEaseIn:X,cubicBezierEaseOut:Z}=e;function Q({duration:e=`0.3s`,leaveDuration:t=`0.2s`,name:r=`slide-in-from-right`}={}){return[n(`&.${r}-transition-leave-active`,{transition:`transform ${t} ${X}`}),n(`&.${r}-transition-enter-active`,{transition:`transform ${e} ${Z}`}),n(`&.${r}-transition-enter-to`,{transform:`translateX(0)`}),n(`&.${r}-transition-enter-from`,{transform:`translateX(100%)`}),n(`&.${r}-transition-leave-from`,{transform:`translateX(0)`}),n(`&.${r}-transition-leave-to`,{transform:`translateX(100%)`})]}var{cubicBezierEaseIn:$,cubicBezierEaseOut:ee}=e;function te({duration:e=`0.3s`,leaveDuration:t=`0.2s`,name:r=`slide-in-from-top`}={}){return[n(`&.${r}-transition-leave-active`,{transition:`transform ${t} ${$}`}),n(`&.${r}-transition-enter-active`,{transition:`transform ${e} ${ee}`}),n(`&.${r}-transition-enter-to`,{transform:`translateY(0)`}),n(`&.${r}-transition-enter-from`,{transform:`translateY(-100%)`}),n(`&.${r}-transition-leave-from`,{transform:`translateY(0)`}),n(`&.${r}-transition-leave-to`,{transform:`translateY(-100%)`})]}var ne=n([a(`drawer`,`
|
|
2
|
+
word-break: break-word;
|
|
3
|
+
line-height: var(--n-line-height);
|
|
4
|
+
position: absolute;
|
|
5
|
+
pointer-events: all;
|
|
6
|
+
box-shadow: var(--n-box-shadow);
|
|
7
|
+
transition:
|
|
8
|
+
background-color .3s var(--n-bezier),
|
|
9
|
+
color .3s var(--n-bezier);
|
|
10
|
+
background-color: var(--n-color);
|
|
11
|
+
color: var(--n-text-color);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
`,[Q(),Y(),te(),K(),h(`unselectable`,`
|
|
14
|
+
user-select: none;
|
|
15
|
+
-webkit-user-select: none;
|
|
16
|
+
`),h(`native-scrollbar`,[a(`drawer-content-wrapper`,`
|
|
17
|
+
overflow: auto;
|
|
18
|
+
height: 100%;
|
|
19
|
+
`)]),r(`resize-trigger`,`
|
|
20
|
+
position: absolute;
|
|
21
|
+
background-color: #0000;
|
|
22
|
+
transition: background-color .3s var(--n-bezier);
|
|
23
|
+
`,[h(`hover`,`
|
|
24
|
+
background-color: var(--n-resize-trigger-color-hover);
|
|
25
|
+
`)]),a(`drawer-content-wrapper`,`
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
`),a(`drawer-content`,`
|
|
28
|
+
height: 100%;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
`,[h(`native-scrollbar`,[a(`drawer-body-content-wrapper`,`
|
|
32
|
+
height: 100%;
|
|
33
|
+
overflow: auto;
|
|
34
|
+
`)]),a(`drawer-body`,`
|
|
35
|
+
flex: 1 0 0;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
`),a(`drawer-body-content-wrapper`,`
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
padding: var(--n-body-padding);
|
|
40
|
+
`),a(`drawer-header`,`
|
|
41
|
+
font-weight: var(--n-title-font-weight);
|
|
42
|
+
line-height: 1;
|
|
43
|
+
font-size: var(--n-title-font-size);
|
|
44
|
+
color: var(--n-title-text-color);
|
|
45
|
+
padding: var(--n-header-padding);
|
|
46
|
+
transition: border .3s var(--n-bezier);
|
|
47
|
+
border-bottom: 1px solid var(--n-divider-color);
|
|
48
|
+
border-bottom: var(--n-header-border-bottom);
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: space-between;
|
|
51
|
+
align-items: center;
|
|
52
|
+
`,[r(`main`,`
|
|
53
|
+
flex: 1;
|
|
54
|
+
`),r(`close`,`
|
|
55
|
+
margin-left: 6px;
|
|
56
|
+
transition:
|
|
57
|
+
background-color .3s var(--n-bezier),
|
|
58
|
+
color .3s var(--n-bezier);
|
|
59
|
+
`)]),a(`drawer-footer`,`
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
border-top: var(--n-footer-border-top);
|
|
63
|
+
transition: border .3s var(--n-bezier);
|
|
64
|
+
padding: var(--n-footer-padding);
|
|
65
|
+
`)]),h(`right-placement`,`
|
|
66
|
+
top: 0;
|
|
67
|
+
bottom: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
border-top-left-radius: var(--n-border-radius);
|
|
70
|
+
border-bottom-left-radius: var(--n-border-radius);
|
|
71
|
+
`,[r(`resize-trigger`,`
|
|
72
|
+
width: 3px;
|
|
73
|
+
height: 100%;
|
|
74
|
+
top: 0;
|
|
75
|
+
left: 0;
|
|
76
|
+
transform: translateX(-1.5px);
|
|
77
|
+
cursor: ew-resize;
|
|
78
|
+
`)]),h(`left-placement`,`
|
|
79
|
+
top: 0;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
left: 0;
|
|
82
|
+
border-top-right-radius: var(--n-border-radius);
|
|
83
|
+
border-bottom-right-radius: var(--n-border-radius);
|
|
84
|
+
`,[r(`resize-trigger`,`
|
|
85
|
+
width: 3px;
|
|
86
|
+
height: 100%;
|
|
87
|
+
top: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
transform: translateX(1.5px);
|
|
90
|
+
cursor: ew-resize;
|
|
91
|
+
`)]),h(`top-placement`,`
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
right: 0;
|
|
95
|
+
border-bottom-left-radius: var(--n-border-radius);
|
|
96
|
+
border-bottom-right-radius: var(--n-border-radius);
|
|
97
|
+
`,[r(`resize-trigger`,`
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 3px;
|
|
100
|
+
bottom: 0;
|
|
101
|
+
left: 0;
|
|
102
|
+
transform: translateY(1.5px);
|
|
103
|
+
cursor: ns-resize;
|
|
104
|
+
`)]),h(`bottom-placement`,`
|
|
105
|
+
left: 0;
|
|
106
|
+
bottom: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
border-top-left-radius: var(--n-border-radius);
|
|
109
|
+
border-top-right-radius: var(--n-border-radius);
|
|
110
|
+
`,[r(`resize-trigger`,`
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 3px;
|
|
113
|
+
top: 0;
|
|
114
|
+
left: 0;
|
|
115
|
+
transform: translateY(-1.5px);
|
|
116
|
+
cursor: ns-resize;
|
|
117
|
+
`)])]),n(`body`,[n(`>`,[a(`drawer-container`,`
|
|
118
|
+
position: fixed;
|
|
119
|
+
`)])]),a(`drawer-container`,`
|
|
120
|
+
position: relative;
|
|
121
|
+
position: absolute;
|
|
122
|
+
left: 0;
|
|
123
|
+
right: 0;
|
|
124
|
+
top: 0;
|
|
125
|
+
bottom: 0;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
`,[n(`> *`,`
|
|
128
|
+
pointer-events: all;
|
|
129
|
+
`)]),a(`drawer-mask`,`
|
|
130
|
+
background-color: rgba(0, 0, 0, .3);
|
|
131
|
+
position: absolute;
|
|
132
|
+
left: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
top: 0;
|
|
135
|
+
bottom: 0;
|
|
136
|
+
`,[h(`invisible`,`
|
|
137
|
+
background-color: rgba(0, 0, 0, 0)
|
|
138
|
+
`),E({enterDuration:`0.2s`,leaveDuration:`0.2s`,enterCubicBezier:`var(--n-bezier-in)`,leaveCubicBezier:`var(--n-bezier-out)`})])]),re=d({name:`Drawer`,inheritAttrs:!1,props:Object.assign(Object.assign({},c.props),{show:Boolean,width:[Number,String],height:[Number,String],placement:{type:String,default:`right`},maskClosable:{type:Boolean,default:!0},showMask:{type:[Boolean,String],default:!0},to:[String,Object],displayDirective:{type:String,default:`if`},nativeScrollbar:{type:Boolean,default:!0},zIndex:Number,onMaskClick:Function,scrollbarProps:Object,contentClass:String,contentStyle:[Object,String],trapFocus:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,defaultWidth:{type:[Number,String],default:251},defaultHeight:{type:[Number,String],default:251},onUpdateWidth:[Function,Array],onUpdateHeight:[Function,Array],"onUpdate:width":[Function,Array],"onUpdate:height":[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,drawerStyle:[String,Object],drawerClass:String,target:null,onShow:Function,onHide:Function}),setup(e){let{mergedClsPrefixRef:t,namespaceRef:n,inlineThemeDisabled:r}=T(e),i=v(),a=c(`Drawer`,`-drawer`,ne,H,e,t),s=w(e.defaultWidth),l=w(e.defaultHeight),u=R(g(e,`width`),s),d=R(g(e,`height`),l),f=b(()=>{let{placement:t}=e;return t===`top`||t===`bottom`?``:z(u.value)}),p=b(()=>{let{placement:t}=e;return t===`left`||t===`right`?``:z(d.value)}),m=t=>{let{onUpdateWidth:n,"onUpdate:width":r}=e;n&&O(n,t),r&&O(r,t),s.value=t},h=t=>{let{onUpdateHeight:n,"onUpdate:width":r}=e;n&&O(n,t),r&&O(r,t),l.value=t},_=b(()=>[{width:f.value,height:p.value},e.drawerStyle||``]);function x(t){let{onMaskClick:n,maskClosable:r}=e;r&&D(!1),n&&n(t)}function S(e){x(e)}let C=V();function E(t){var n;(n=e.onEsc)==null||n.call(e),e.show&&e.closeOnEsc&&P(t)&&(C.value||D(!1))}function D(t){let{onHide:n,onUpdateShow:r,"onUpdate:show":i}=e;r&&O(r,t),i&&O(i,t),n&&!t&&O(n,t)}o(F,{isMountedRef:i,mergedThemeRef:a,mergedClsPrefixRef:t,doUpdateShow:D,doUpdateHeight:h,doUpdateWidth:m});let k=b(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{color:r,textColor:i,boxShadow:o,lineHeight:s,headerPadding:c,footerPadding:l,borderRadius:u,bodyPadding:d,titleFontSize:f,titleTextColor:p,titleFontWeight:m,headerBorderBottom:h,footerBorderTop:g,closeIconColor:_,closeIconColorHover:v,closeIconColorPressed:y,closeColorHover:b,closeColorPressed:x,closeIconSize:S,closeSize:C,closeBorderRadius:w,resizableTriggerColorHover:T}}=a.value;return{"--n-line-height":s,"--n-color":r,"--n-border-radius":u,"--n-text-color":i,"--n-box-shadow":o,"--n-bezier":e,"--n-bezier-out":n,"--n-bezier-in":t,"--n-header-padding":c,"--n-body-padding":d,"--n-footer-padding":l,"--n-title-text-color":p,"--n-title-font-size":f,"--n-title-font-weight":m,"--n-header-border-bottom":h,"--n-footer-border-top":g,"--n-close-icon-color":_,"--n-close-icon-color-hover":v,"--n-close-icon-color-pressed":y,"--n-close-size":C,"--n-close-color-hover":b,"--n-close-color-pressed":x,"--n-close-icon-size":S,"--n-close-border-radius":w,"--n-resize-trigger-color-hover":T}}),A=r?y(`drawer`,void 0,k,e):void 0;return{mergedClsPrefix:t,namespace:n,mergedBodyStyle:_,handleOutsideClick:S,handleMaskClick:x,handleEsc:E,mergedTheme:a,cssVars:r?void 0:k,themeClass:A?.themeClass,onRender:A?.onRender,isMounted:i}},render(){let{mergedClsPrefix:e}=this;return D(N,{to:this.to,show:this.show},{default:()=>{var t;return(t=this.onRender)==null||t.call(this),i(D(`div`,{class:[`${e}-drawer-container`,this.namespace,this.themeClass],style:this.cssVars,role:`none`},this.showMask?D(x,{name:`fade-in-transition`,appear:this.isMounted},{default:()=>this.show?D(`div`,{"aria-hidden":!0,class:[`${e}-drawer-mask`,this.showMask===`transparent`&&`${e}-drawer-mask--invisible`],onClick:this.handleMaskClick}):null}):null,D(U,Object.assign({},this.$attrs,{class:[this.drawerClass,this.$attrs.class],style:[this.mergedBodyStyle,this.$attrs.style],blockScroll:this.blockScroll,contentStyle:this.contentStyle,contentClass:this.contentClass,placement:this.placement,scrollbarProps:this.scrollbarProps,show:this.show,displayDirective:this.displayDirective,nativeScrollbar:this.nativeScrollbar,onAfterEnter:this.onAfterEnter,onAfterLeave:this.onAfterLeave,trapFocus:this.trapFocus,autoFocus:this.autoFocus,resizable:this.resizable,maxHeight:this.maxHeight,minHeight:this.minHeight,maxWidth:this.maxWidth,minWidth:this.minWidth,showMask:this.showMask,onEsc:this.handleEsc,onClickoutside:this.handleOutsideClick}),this.$slots)),[[I,{zIndex:this.zIndex,enabled:this.show}]])}})}}),ie=d({name:`DrawerContent`,props:{title:String,headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],bodyClass:String,bodyStyle:[Object,String],bodyContentClass:String,bodyContentStyle:[Object,String],nativeScrollbar:{type:Boolean,default:!0},scrollbarProps:Object,closable:Boolean},slots:Object,setup(){let e=t(F,null);e||f(`drawer-content`,"`n-drawer-content` must be placed inside `n-drawer`.");let{doUpdateShow:n}=e;function r(){n(!1)}return{handleCloseClick:r,mergedTheme:e.mergedThemeRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){let{title:e,mergedClsPrefix:t,nativeScrollbar:n,mergedTheme:r,bodyClass:i,bodyStyle:a,bodyContentClass:o,bodyContentStyle:s,headerClass:c,headerStyle:l,footerClass:d,footerStyle:f,scrollbarProps:p,closable:m,$slots:h}=this;return D(`div`,{role:`none`,class:[`${t}-drawer-content`,n&&`${t}-drawer-content--native-scrollbar`]},h.header||e||m?D(`div`,{class:[`${t}-drawer-header`,c],style:l,role:`none`},D(`div`,{class:`${t}-drawer-header__main`,role:`heading`,"aria-level":`1`},h.header===void 0?e:h.header()),m&&D(u,{onClick:this.handleCloseClick,clsPrefix:t,class:`${t}-drawer-header__close`,absolute:!0})):null,n?D(`div`,{class:[`${t}-drawer-body`,i],style:a,role:`none`},D(`div`,{class:[`${t}-drawer-body-content-wrapper`,o],style:s,role:`none`},h)):D(C,Object.assign({themeOverrides:r.peerOverrides.Scrollbar,theme:r.peers.Scrollbar},p,{class:`${t}-drawer-body`,contentClass:[`${t}-drawer-body-content-wrapper`,o],contentStyle:s}),h),h.footer?D(`div`,{class:[`${t}-drawer-footer`,d],style:f,role:`none`},h.footer()):null)}});export{re as n,ie as t};
|
|
139
|
+
//# sourceMappingURL=DrawerContent-TpYTFgF1.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{E as e,Gt as t,Jt as n,Kt as r,O as i,Sn as a,Zt as o,_ as s,lt as c,mn as l,ut as u,wn as d}from"./Space-n5-XcguU.js";import{t as f}from"./use-locale-mtgM0a3a.js";var p=a({name:`Empty`,render(){return d(`svg`,{viewBox:`0 0 28 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},d(`path`,{d:`M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z`,fill:`currentColor`}),d(`path`,{d:`M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z`,fill:`currentColor`}))}}),m={iconSizeTiny:`28px`,iconSizeSmall:`34px`,iconSizeMedium:`40px`,iconSizeLarge:`46px`,iconSizeHuge:`52px`};function h(e){let{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c}=e;return Object.assign(Object.assign({},m),{fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}var g={name:`Empty`,common:s,self:h},_=r(`empty`,`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
font-size: var(--n-font-size);
|
|
6
|
+
`,[n(`icon`,`
|
|
7
|
+
width: var(--n-icon-size);
|
|
8
|
+
height: var(--n-icon-size);
|
|
9
|
+
font-size: var(--n-icon-size);
|
|
10
|
+
line-height: var(--n-icon-size);
|
|
11
|
+
color: var(--n-icon-color);
|
|
12
|
+
transition:
|
|
13
|
+
color .3s var(--n-bezier);
|
|
14
|
+
`,[t(`+`,[n(`description`,`
|
|
15
|
+
margin-top: 8px;
|
|
16
|
+
`)])]),n(`description`,`
|
|
17
|
+
transition: color .3s var(--n-bezier);
|
|
18
|
+
color: var(--n-text-color);
|
|
19
|
+
`),n(`extra`,`
|
|
20
|
+
text-align: center;
|
|
21
|
+
transition: color .3s var(--n-bezier);
|
|
22
|
+
margin-top: 12px;
|
|
23
|
+
color: var(--n-extra-text-color);
|
|
24
|
+
`)]),v=a({name:`Empty`,props:Object.assign(Object.assign({},i.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:`medium`},renderIcon:Function}),slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=u(e),a=i(`Empty`,`-empty`,_,g,e,t),{localeRef:s}=f(`Empty`),m=l(()=>e.description??r?.value?.Empty?.description),h=l(()=>r?.value?.Empty?.renderIcon||(()=>d(p,null))),v=l(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{[o(`iconSize`,t)]:r,[o(`fontSize`,t)]:i,textColor:s,iconColor:c,extraTextColor:l}}=a.value;return{"--n-icon-size":r,"--n-font-size":i,"--n-bezier":n,"--n-text-color":s,"--n-icon-color":c,"--n-extra-text-color":l}}),y=n?c(`empty`,l(()=>{let t=``,{size:n}=e;return t+=n[0],t}),v,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:h,localizedDescription:l(()=>m.value||s.value.description),cssVars:n?void 0:v,themeClass:y?.themeClass,onRender:y?.onRender}},render(){let{$slots:t,mergedClsPrefix:n,onRender:r}=this;return r?.(),d(`div`,{class:[`${n}-empty`,this.themeClass],style:this.cssVars},this.showIcon?d(`div`,{class:`${n}-empty__icon`},t.icon?t.icon():d(e,{clsPrefix:n},{default:this.mergedRenderIcon})):null,this.showDescription?d(`div`,{class:`${n}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?d(`div`,{class:`${n}-empty__extra`},t.extra()):null)}});export{g as n,h as r,v as t};
|
|
25
|
+
//# sourceMappingURL=Empty-cr2r7e2u.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Gn as e,In as t,Sn as n,_n as r,bn as i,c as a,gn as o,sr as s,t as c,xn as l}from"./Space-n5-XcguU.js";import{t as u}from"./Empty-cr2r7e2u.js";import{t as d}from"./Alert-dluGVkos.js";var f=n({__name:`ErrorState`,props:{error:{},retry:{type:Function}},setup(n){return(u,f)=>n.error?(t(),o(s(d),{key:0,type:`error`,title:n.error.message},{default:e(()=>[l(s(c),null,{default:e(()=>[n.retry?(t(),o(s(a),{key:0,size:`small`,onClick:n.retry},{default:e(()=>[...f[0]||=[i(`Retry`,-1)]]),_:1},8,[`onClick`])):r(``,!0)]),_:1})]),_:1},8,[`title`])):r(``,!0)}}),p=n({__name:`EmptyState`,props:{description:{}},setup(e){let n=e;return(e,r)=>(t(),o(s(u),{description:n.description},null,8,[`description`]))}});export{f as n,p as t};
|
|
2
|
+
//# sourceMappingURL=EmptyState-DeDck-OL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{At as e,Cn as t,En as n,Ht as r,Ln as i,Mn as a,Mt as o,On as s,Pn as c,Sn as l,Tt as u,Vt as d,ar as f,bt as p,kt as m,mn as h,on as g,pn as _,tr as v,ut as y,vt as b,wn as x,yt as S}from"./Space-n5-XcguU.js";import{n as C,r as w}from"./utils-sbXoq7Ir.js";var T={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function E(e){return`(min-width: ${e}px)`}var D={};function O(e=T){if(!C||typeof window.matchMedia!=`function`)return h(()=>[]);let t=v({}),n=Object.keys(e),r=(e,n)=>{e.matches?t.value[n]=!0:t.value[n]=!1};return n.forEach(t=>{let n=e[t],i,a;D[n]===void 0?(i=window.matchMedia(E(n)),i.addEventListener?i.addEventListener(`change`,e=>{a.forEach(n=>{n(e,t)})}):i.addListener&&i.addListener(e=>{a.forEach(n=>{n(e,t)})}),a=new Set,D[n]={mql:i,cbs:a}):(i=D[n].mql,a=D[n].cbs),a.add(r),i.matches&&a.forEach(e=>{e(i,t)})}),a(()=>{n.forEach(t=>{let{cbs:n}=D[e[t]];n.has(r)&&n.delete(r)})}),h(()=>{let{value:e}=t;return n.filter(t=>e[t])})}function k(e){let t=e.dirs?.find(({dir:e})=>e===g);return!!(t&&t.value===!1)}var A=e(`n-grid`),j={span:{type:[Number,String],default:1},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}};b(j);var M=l({__GRID_ITEM__:!0,name:`GridItem`,alias:[`Gi`],props:j,setup(){let{isSsrRef:e,xGapRef:r,itemStyleRef:i,overflowRef:a,layoutShiftDisabledRef:o}=n(A),s=t();return{overflow:a,itemStyle:i,layoutShiftDisabled:o,mergedXGap:h(()=>d(r.value||0)),deriveStyle:()=>{e.value;let{privateSpan:t=1,privateShow:n=!0,privateColStart:i=void 0,privateOffset:a=0}=s.vnode.props,{value:o}=r,c=d(o||0);return{display:n?``:`none`,gridColumn:`${i??`span ${t}`} / span ${t}`,marginLeft:a?`calc((100% - (${t} - 1) * ${c}) / ${t} * ${a} + ${c} * ${a})`:``}}}},render(){var e;if(this.layoutShiftDisabled){let{span:e,offset:t,mergedXGap:n}=this;return x(`div`,{style:{gridColumn:`span ${e} / span ${e}`,marginLeft:t?`calc((100% - (${e} - 1) * ${n}) / ${e} * ${t} + ${n} * ${t})`:``}},this.$slots)}return x(`div`,{style:[this.itemStyle,this.deriveStyle()]},(e=this.$slots).default?.call(e,{overflow:this.overflow}))}}),N={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},P=24,F=`__ssr__`,I=l({name:`Grid`,inheritAttrs:!1,props:{layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:`self`},cols:{type:[Number,String],default:P},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},setup(e){let{mergedClsPrefixRef:t,mergedBreakpointsRef:n}=y(e),a=/^\d+$/,s=v(void 0),l=O(n?.value||N),u=o(()=>!!(e.itemResponsive||!a.test(e.cols.toString())||!a.test(e.xGap.toString())||!a.test(e.yGap.toString()))),p=h(()=>{if(u.value)return e.responsive===`self`?s.value:l.value}),g=o(()=>Number(r(e.cols.toString(),p.value))??P),_=o(()=>r(e.xGap.toString(),p.value)),b=o(()=>r(e.yGap.toString(),p.value)),x=e=>{s.value=e.contentRect.width},S=e=>{w(x,e)},C=v(!1),T=h(()=>{if(e.responsive===`self`)return S}),E=v(!1),D=v();return c(()=>{let{value:e}=D;e&&e.hasAttribute(F)&&(e.removeAttribute(F),E.value=!0)}),i(A,{layoutShiftDisabledRef:f(e,`layoutShiftDisabled`),isSsrRef:E,itemStyleRef:f(e,`itemStyle`),xGapRef:_,overflowRef:C}),{isSsr:!m,contentEl:D,mergedClsPrefix:t,style:h(()=>e.layoutShiftDisabled?{width:`100%`,display:`grid`,gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:d(e.xGap),rowGap:d(e.yGap)}:{width:`100%`,display:`grid`,gridTemplateColumns:`repeat(${g.value}, minmax(0, 1fr))`,columnGap:d(_.value),rowGap:d(b.value)}),isResponsive:u,responsiveQuery:p,responsiveCols:g,handleResize:T,overflow:C}},render(){if(this.layoutShiftDisabled)return x(`div`,s({ref:`contentEl`,class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);let e=()=>{this.overflow=!1;let e=p(S(this)),t=[],{collapsed:n,collapsedRows:i,responsiveCols:a,responsiveQuery:o}=this;e.forEach(e=>{if(e?.type?.__GRID_ITEM__!==!0)return;if(k(e)){let n=_(e);n.props?n.props.privateShow=!1:n.props={privateShow:!1},t.push({child:n,rawChildSpan:0});return}e.dirs=e.dirs?.filter(({dir:e})=>e!==g)||null,e.dirs?.length===0&&(e.dirs=null);let n=_(e),i=Number(r(n.props?.span,o)??1);i!==0&&t.push({child:n,rawChildSpan:i})});let c=0,l=t[t.length-1]?.child;if(l?.props){let e=l.props?.suffix;e!==void 0&&e!==!1&&(c=Number(r(l.props?.span,o)??1),l.props.privateSpan=c,l.props.privateColStart=a+1-c,l.props.privateShow=l.props.privateShow??!0)}let u=0,d=!1;for(let{child:e,rawChildSpan:s}of t){if(d&&(this.overflow=!0),!d){let t=Number(r(e.props?.offset,o)??0),l=Math.min(s+t,a);if(e.props?(e.props.privateSpan=l,e.props.privateOffset=t):e.props={privateSpan:l,privateOffset:t},n){let e=u%a;l+e>a&&(u+=a-e),l+u+c>i*a?d=!0:u+=l}}d&&(e.props?e.props.privateShow!==!0&&(e.props.privateShow=!1):e.props={privateShow:!1})}return x(`div`,s({ref:`contentEl`,class:`${this.mergedClsPrefix}-grid`,style:this.style,[F]:this.isSsr||void 0},this.$attrs),t.map(({child:e})=>e))};return this.isResponsive&&this.responsive===`self`?x(u,{onResize:this.handleResize},{default:e}):e()}});export{M as n,I as t};
|
|
2
|
+
//# sourceMappingURL=Grid-hFkp9F4P.js.map
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import{At as e,Bt as t,C as n,Cn as r,D as i,E as a,En as o,Ft as s,Gt as c,Jt as l,Kt as u,Ln as d,Mt as f,Nt as p,O as m,Pn as h,Pt as g,Sn as _,T as v,Tt as y,Un as b,Wn as x,Xt as S,Yt as C,Zt as w,_ as T,_t as E,ar as D,ct as ee,f as te,gt as O,h as k,ht as A,j as ne,k as j,kn as re,lt as ie,mn as M,p as N,tr as P,un as F,ut as ae,w as I,wn as L,xt as R,y as z}from"./Space-n5-XcguU.js";import{t as oe}from"./use-merged-state-BvhkaHNX.js";import{t as se}from"./use-locale-mtgM0a3a.js";function B(e=8){return Math.random().toString(16).slice(2,2+e)}function V(e,t){let n=[];for(let r=0;r<e;++r)n.push(t);return n}var H=_({name:`ChevronDown`,render(){return L(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L(`path`,{d:`M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z`,fill:`currentColor`}))}}),U=I(`clear`,()=>L(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},L(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},L(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},L(`path`,{d:`M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z`}))))),W=_({name:`Eye`,render(){return L(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},L(`path`,{d:`M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`}),L(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),ce=_({name:`EyeOff`,render(){return L(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},L(`path`,{d:`M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z`,fill:`currentColor`}),L(`path`,{d:`M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z`,fill:`currentColor`}),L(`path`,{d:`M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z`,fill:`currentColor`}),L(`path`,{d:`M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z`,fill:`currentColor`}),L(`path`,{d:`M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z`,fill:`currentColor`}))}}),le=u(`base-clear`,`
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
height: 1em;
|
|
4
|
+
width: 1em;
|
|
5
|
+
position: relative;
|
|
6
|
+
`,[c(`>`,[l(`clear`,`
|
|
7
|
+
font-size: var(--n-clear-size);
|
|
8
|
+
height: 1em;
|
|
9
|
+
width: 1em;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
color: var(--n-clear-color);
|
|
12
|
+
transition: color .3s var(--n-bezier);
|
|
13
|
+
display: flex;
|
|
14
|
+
`,[c(`&:hover`,`
|
|
15
|
+
color: var(--n-clear-color-hover)!important;
|
|
16
|
+
`),c(`&:active`,`
|
|
17
|
+
color: var(--n-clear-color-pressed)!important;
|
|
18
|
+
`)]),l(`placeholder`,`
|
|
19
|
+
display: flex;
|
|
20
|
+
`),l(`clear, placeholder`,`
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: 50%;
|
|
23
|
+
top: 50%;
|
|
24
|
+
transform: translateX(-50%) translateY(-50%);
|
|
25
|
+
`,[n({originalTransform:`translateX(-50%) translateY(-50%)`,left:`50%`,top:`50%`})])])]),G=_({name:`BaseClear`,props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return j(`-base-clear`,le,D(e,`clsPrefix`)),{handleMouseDown(e){e.preventDefault()}}},render(){let{clsPrefix:e}=this;return L(`div`,{class:`${e}-base-clear`},L(v,null,{default:()=>{var t;return this.show?L(`div`,{key:`dismiss`,class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},A(this.$slots.icon,()=>[L(a,{clsPrefix:e},{default:()=>L(U,null)})])):L(`div`,{key:`icon`,class:`${e}-base-clear__placeholder`},(t=this.$slots).placeholder?.call(t))}}))}}),ue=_({name:`InternalSelectionSuffix`,props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{let{clsPrefix:n}=e;return L(z,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?L(G,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>L(a,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>A(t.default,()=>[L(H,null)])})}):null})}}}),K={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`};function q(e){let{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:i,primaryColorHover:a,inputColor:o,inputColorDisabled:c,borderColor:l,warningColor:u,warningColorHover:d,errorColor:f,errorColorHover:p,borderRadius:m,lineHeight:h,fontSizeTiny:g,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:y,heightTiny:b,heightSmall:x,heightMedium:S,heightLarge:C,actionColor:w,clearColor:T,clearColorHover:E,clearColorPressed:D,placeholderColor:ee,placeholderColorDisabled:te,iconColor:O,iconColorDisabled:k,iconColorHover:A,iconColorPressed:ne,fontWeight:j}=e;return Object.assign(Object.assign({},K),{fontWeight:j,countTextColorDisabled:r,countTextColor:n,heightTiny:b,heightSmall:x,heightMedium:S,heightLarge:C,fontSizeTiny:g,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:y,lineHeight:h,lineHeightTextarea:h,borderRadius:m,iconSize:`16px`,groupLabelColor:w,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:ee,placeholderColorDisabled:te,color:o,colorDisabled:c,colorFocus:o,groupLabelBorder:`1px solid ${l}`,border:`1px solid ${l}`,borderHover:`1px solid ${a}`,borderDisabled:`1px solid ${l}`,borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 0 2px ${s(i,{alpha:.2})}`,loadingColor:i,loadingColorWarning:u,borderWarning:`1px solid ${u}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:o,borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 0 2px ${s(u,{alpha:.2})}`,caretColorWarning:u,loadingColorError:f,borderError:`1px solid ${f}`,borderHoverError:`1px solid ${p}`,colorFocusError:o,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${s(f,{alpha:.2})}`,caretColorError:f,clearColor:T,clearColorHover:E,clearColorPressed:D,iconColor:O,iconColorDisabled:k,iconColorHover:A,iconColorPressed:ne,suffixTextColor:t})}var de=i({name:`Input`,common:T,peers:{Scrollbar:k},self:q}),fe=e(`n-input`),pe=u(`input`,`
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
cursor: text;
|
|
28
|
+
line-height: 1.5;
|
|
29
|
+
z-index: auto;
|
|
30
|
+
outline: none;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
position: relative;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
border-radius: var(--n-border-radius);
|
|
35
|
+
background-color: var(--n-color);
|
|
36
|
+
transition: background-color .3s var(--n-bezier);
|
|
37
|
+
font-size: var(--n-font-size);
|
|
38
|
+
font-weight: var(--n-font-weight);
|
|
39
|
+
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
|
|
40
|
+
`,[l(`input, textarea`,`
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
flex-grow: 1;
|
|
43
|
+
position: relative;
|
|
44
|
+
`),l(`input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder`,`
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
font-size: inherit;
|
|
47
|
+
line-height: 1.5;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
border: none;
|
|
50
|
+
outline: none;
|
|
51
|
+
background-color: #0000;
|
|
52
|
+
text-align: inherit;
|
|
53
|
+
transition:
|
|
54
|
+
-webkit-text-fill-color .3s var(--n-bezier),
|
|
55
|
+
caret-color .3s var(--n-bezier),
|
|
56
|
+
color .3s var(--n-bezier),
|
|
57
|
+
text-decoration-color .3s var(--n-bezier);
|
|
58
|
+
`),l(`input-el, textarea-el`,`
|
|
59
|
+
-webkit-appearance: none;
|
|
60
|
+
scrollbar-width: none;
|
|
61
|
+
width: 100%;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
text-decoration-color: var(--n-text-decoration-color);
|
|
64
|
+
color: var(--n-text-color);
|
|
65
|
+
caret-color: var(--n-caret-color);
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
`,[c(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
68
|
+
width: 0;
|
|
69
|
+
height: 0;
|
|
70
|
+
display: none;
|
|
71
|
+
`),c(`&::placeholder`,`
|
|
72
|
+
color: #0000;
|
|
73
|
+
-webkit-text-fill-color: transparent !important;
|
|
74
|
+
`),c(`&:-webkit-autofill ~`,[l(`placeholder`,`display: none;`)])]),C(`round`,[S(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),l(`placeholder`,`
|
|
75
|
+
pointer-events: none;
|
|
76
|
+
position: absolute;
|
|
77
|
+
left: 0;
|
|
78
|
+
right: 0;
|
|
79
|
+
top: 0;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
color: var(--n-placeholder-color);
|
|
83
|
+
`,[c(`span`,`
|
|
84
|
+
width: 100%;
|
|
85
|
+
display: inline-block;
|
|
86
|
+
`)]),C(`textarea`,[l(`placeholder`,`overflow: visible;`)]),S(`autosize`,`width: 100%;`),C(`autosize`,[l(`textarea-el, input-el`,`
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
height: 100%;
|
|
91
|
+
`)]),u(`input-wrapper`,`
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
flex-grow: 1;
|
|
95
|
+
position: relative;
|
|
96
|
+
padding-left: var(--n-padding-left);
|
|
97
|
+
padding-right: var(--n-padding-right);
|
|
98
|
+
`),l(`input-mirror`,`
|
|
99
|
+
padding: 0;
|
|
100
|
+
height: var(--n-height);
|
|
101
|
+
line-height: var(--n-height);
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
visibility: hidden;
|
|
104
|
+
position: static;
|
|
105
|
+
white-space: pre;
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
`),l(`input-el`,`
|
|
108
|
+
padding: 0;
|
|
109
|
+
height: var(--n-height);
|
|
110
|
+
line-height: var(--n-height);
|
|
111
|
+
`,[c(`&[type=password]::-ms-reveal`,`display: none;`),c(`+`,[l(`placeholder`,`
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
`)])]),S(`textarea`,[l(`placeholder`,`white-space: nowrap;`)]),l(`eye`,`
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
transition: color .3s var(--n-bezier);
|
|
119
|
+
`),C(`textarea`,`width: 100%;`,[u(`input-word-count`,`
|
|
120
|
+
position: absolute;
|
|
121
|
+
right: var(--n-padding-right);
|
|
122
|
+
bottom: var(--n-padding-vertical);
|
|
123
|
+
`),C(`resizable`,[u(`input-wrapper`,`
|
|
124
|
+
resize: vertical;
|
|
125
|
+
min-height: var(--n-height);
|
|
126
|
+
`)]),l(`textarea-el, textarea-mirror, placeholder`,`
|
|
127
|
+
height: 100%;
|
|
128
|
+
padding-left: 0;
|
|
129
|
+
padding-right: 0;
|
|
130
|
+
padding-top: var(--n-padding-vertical);
|
|
131
|
+
padding-bottom: var(--n-padding-vertical);
|
|
132
|
+
word-break: break-word;
|
|
133
|
+
display: inline-block;
|
|
134
|
+
vertical-align: bottom;
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
line-height: var(--n-line-height-textarea);
|
|
137
|
+
margin: 0;
|
|
138
|
+
resize: none;
|
|
139
|
+
white-space: pre-wrap;
|
|
140
|
+
scroll-padding-block-end: var(--n-padding-vertical);
|
|
141
|
+
`),l(`textarea-mirror`,`
|
|
142
|
+
width: 100%;
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
visibility: hidden;
|
|
146
|
+
position: static;
|
|
147
|
+
white-space: pre-wrap;
|
|
148
|
+
overflow-wrap: break-word;
|
|
149
|
+
`)]),C(`pair`,[l(`input-el, placeholder`,`text-align: center;`),l(`separator`,`
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
transition: color .3s var(--n-bezier);
|
|
153
|
+
color: var(--n-text-color);
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
`,[u(`icon`,`
|
|
156
|
+
color: var(--n-icon-color);
|
|
157
|
+
`),u(`base-icon`,`
|
|
158
|
+
color: var(--n-icon-color);
|
|
159
|
+
`)])]),C(`disabled`,`
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
background-color: var(--n-color-disabled);
|
|
162
|
+
`,[l(`border`,`border: var(--n-border-disabled);`),l(`input-el, textarea-el`,`
|
|
163
|
+
cursor: not-allowed;
|
|
164
|
+
color: var(--n-text-color-disabled);
|
|
165
|
+
text-decoration-color: var(--n-text-color-disabled);
|
|
166
|
+
`),l(`placeholder`,`color: var(--n-placeholder-color-disabled);`),l(`separator`,`color: var(--n-text-color-disabled);`,[u(`icon`,`
|
|
167
|
+
color: var(--n-icon-color-disabled);
|
|
168
|
+
`),u(`base-icon`,`
|
|
169
|
+
color: var(--n-icon-color-disabled);
|
|
170
|
+
`)]),u(`input-word-count`,`
|
|
171
|
+
color: var(--n-count-text-color-disabled);
|
|
172
|
+
`),l(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[u(`icon`,`
|
|
173
|
+
color: var(--n-icon-color-disabled);
|
|
174
|
+
`),u(`internal-icon`,`
|
|
175
|
+
color: var(--n-icon-color-disabled);
|
|
176
|
+
`)])]),S(`disabled`,[l(`eye`,`
|
|
177
|
+
color: var(--n-icon-color);
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
`,[c(`&:hover`,`
|
|
180
|
+
color: var(--n-icon-color-hover);
|
|
181
|
+
`),c(`&:active`,`
|
|
182
|
+
color: var(--n-icon-color-pressed);
|
|
183
|
+
`)]),c(`&:hover`,[l(`state-border`,`border: var(--n-border-hover);`)]),C(`focus`,`background-color: var(--n-color-focus);`,[l(`state-border`,`
|
|
184
|
+
border: var(--n-border-focus);
|
|
185
|
+
box-shadow: var(--n-box-shadow-focus);
|
|
186
|
+
`)])]),l(`border, state-border`,`
|
|
187
|
+
box-sizing: border-box;
|
|
188
|
+
position: absolute;
|
|
189
|
+
left: 0;
|
|
190
|
+
right: 0;
|
|
191
|
+
top: 0;
|
|
192
|
+
bottom: 0;
|
|
193
|
+
pointer-events: none;
|
|
194
|
+
border-radius: inherit;
|
|
195
|
+
border: var(--n-border);
|
|
196
|
+
transition:
|
|
197
|
+
box-shadow .3s var(--n-bezier),
|
|
198
|
+
border-color .3s var(--n-bezier);
|
|
199
|
+
`),l(`state-border`,`
|
|
200
|
+
border-color: #0000;
|
|
201
|
+
z-index: 1;
|
|
202
|
+
`),l(`prefix`,`margin-right: 4px;`),l(`suffix`,`
|
|
203
|
+
margin-left: 4px;
|
|
204
|
+
`),l(`suffix, prefix`,`
|
|
205
|
+
transition: color .3s var(--n-bezier);
|
|
206
|
+
flex-wrap: nowrap;
|
|
207
|
+
flex-shrink: 0;
|
|
208
|
+
line-height: var(--n-height);
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: center;
|
|
213
|
+
color: var(--n-suffix-text-color);
|
|
214
|
+
`,[u(`base-loading`,`
|
|
215
|
+
font-size: var(--n-icon-size);
|
|
216
|
+
margin: 0 2px;
|
|
217
|
+
color: var(--n-loading-color);
|
|
218
|
+
`),u(`base-clear`,`
|
|
219
|
+
font-size: var(--n-icon-size);
|
|
220
|
+
`,[l(`placeholder`,[u(`base-icon`,`
|
|
221
|
+
transition: color .3s var(--n-bezier);
|
|
222
|
+
color: var(--n-icon-color);
|
|
223
|
+
font-size: var(--n-icon-size);
|
|
224
|
+
`)])]),c(`>`,[u(`icon`,`
|
|
225
|
+
transition: color .3s var(--n-bezier);
|
|
226
|
+
color: var(--n-icon-color);
|
|
227
|
+
font-size: var(--n-icon-size);
|
|
228
|
+
`)]),u(`base-icon`,`
|
|
229
|
+
font-size: var(--n-icon-size);
|
|
230
|
+
`)]),u(`input-word-count`,`
|
|
231
|
+
pointer-events: none;
|
|
232
|
+
line-height: 1.5;
|
|
233
|
+
font-size: .85em;
|
|
234
|
+
color: var(--n-count-text-color);
|
|
235
|
+
transition: color .3s var(--n-bezier);
|
|
236
|
+
margin-left: 4px;
|
|
237
|
+
font-variant: tabular-nums;
|
|
238
|
+
`),[`warning`,`error`].map(e=>C(`${e}-status`,[S(`disabled`,[u(`base-loading`,`
|
|
239
|
+
color: var(--n-loading-color-${e})
|
|
240
|
+
`),l(`input-el, textarea-el`,`
|
|
241
|
+
caret-color: var(--n-caret-color-${e});
|
|
242
|
+
`),l(`state-border`,`
|
|
243
|
+
border: var(--n-border-${e});
|
|
244
|
+
`),c(`&:hover`,[l(`state-border`,`
|
|
245
|
+
border: var(--n-border-hover-${e});
|
|
246
|
+
`)]),c(`&:focus`,`
|
|
247
|
+
background-color: var(--n-color-focus-${e});
|
|
248
|
+
`,[l(`state-border`,`
|
|
249
|
+
box-shadow: var(--n-box-shadow-focus-${e});
|
|
250
|
+
border: var(--n-border-focus-${e});
|
|
251
|
+
`)]),C(`focus`,`
|
|
252
|
+
background-color: var(--n-color-focus-${e});
|
|
253
|
+
`,[l(`state-border`,`
|
|
254
|
+
box-shadow: var(--n-box-shadow-focus-${e});
|
|
255
|
+
border: var(--n-border-focus-${e});
|
|
256
|
+
`)])])]))]),me=u(`input`,[C(`disabled`,[l(`input-el, textarea-el`,`
|
|
257
|
+
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|
258
|
+
`)])]);function he(e){let t=0;for(let n of e)t++;return t}function J(e){return e===``||e==null}function ge(e){let t=P(null);function n(){let{value:n}=e;if(!n?.focus){i();return}let{selectionStart:r,selectionEnd:a,value:o}=n;if(r==null||a==null){i();return}t.value={start:r,end:a,beforeText:o.slice(0,r),afterText:o.slice(a)}}function r(){var n;let{value:r}=t,{value:i}=e;if(!r||!i)return;let{value:a}=i,{start:o,beforeText:s,afterText:c}=r,l=a.length;if(a.endsWith(c))l=a.length-c.length;else if(a.startsWith(s))l=s.length;else{let e=s[o-1],t=a.indexOf(e,o-1);t!==-1&&(l=t+1)}(n=i.setSelectionRange)==null||n.call(i,l,l)}function i(){t.value=null}return b(e,i),{recordCursor:n,restoreCursor:r}}var Y=_({name:`InputWordCount`,setup(e,{slots:t}){let{mergedValueRef:n,maxlengthRef:r,mergedClsPrefixRef:i,countGraphemesRef:a}=o(fe),s=M(()=>{let{value:e}=n;return e===null||Array.isArray(e)?0:(a.value||he)(e)});return()=>{let{value:e}=r,{value:a}=n;return L(`span`,{class:`${i.value}-input-word-count`},O(t.default,{value:a===null||Array.isArray(a)?``:a},()=>[e===void 0?s.value:`${s.value} / ${e}`]))}}}),_e=_({name:`Input`,props:Object.assign(Object.assign({},m.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:`text`},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),slots:Object,setup(e){let{mergedClsPrefixRef:n,mergedBorderedRef:i,inlineThemeDisabled:a,mergedRtlRef:o,mergedComponentPropsRef:s}=ae(e),c=m(`Input`,`-input`,pe,de,e,n);te&&j(`-input-safari`,me,n);let l=P(null),u=P(null),_=P(null),v=P(null),y=P(null),S=P(null),C=P(null),T=ge(C),E=P(null),{localeRef:O}=se(`Input`),k=P(e.defaultValue),A=oe(D(e,`value`),k),N=ee(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:s?.value?.Input?.size||`medium`}}),{mergedSizeRef:F,mergedDisabledRef:I,mergedStatusRef:L}=N,z=P(!1),B=P(!1),V=P(!1),H=P(!1),U=null,W=M(()=>{let{placeholder:t,pair:n}=e;return n?Array.isArray(t)?t:t===void 0?[``,``]:[t,t]:t===void 0?[O.value.placeholder]:[t]}),ce=M(()=>{let{value:e}=V,{value:t}=A,{value:n}=W;return!e&&(J(t)||Array.isArray(t)&&J(t[0]))&&n[0]}),le=M(()=>{let{value:e}=V,{value:t}=A,{value:n}=W;return!e&&n[1]&&(J(t)||Array.isArray(t)&&J(t[1]))}),G=f(()=>e.internalForceFocus||z.value),ue=f(()=>{if(I.value||e.readonly||!e.clearable||!G.value&&!B.value)return!1;let{value:t}=A,{value:n}=G;return e.pair?!!(Array.isArray(t)&&(t[0]||t[1]))&&(B.value||n):!!t&&(B.value||n)}),K=M(()=>{let{showPasswordOn:t}=e;if(t)return t;if(e.showPasswordToggle)return`click`}),q=P(!1),he=M(()=>{let{textDecoration:t}=e;return t?Array.isArray(t)?t.map(e=>({textDecoration:e})):[{textDecoration:t}]:[``,``]}),Y=P(void 0),_e=()=>{if(e.type===`textarea`){let{autosize:t}=e;if(t&&(Y.value=E.value?.$el?.offsetWidth),!u.value||typeof t==`boolean`)return;let{paddingTop:n,paddingBottom:r,lineHeight:i}=window.getComputedStyle(u.value),a=Number(n.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:c}=_;if(!c)return;if(t.minRows){let e=Math.max(t.minRows,1),n=`${a+o+s*e}px`;c.style.minHeight=n}if(t.maxRows){let e=`${a+o+s*t.maxRows}px`;c.style.maxHeight=e}}},ve=M(()=>{let{maxlength:t}=e;return t===void 0?void 0:Number(t)});h(()=>{let{value:e}=A;Array.isArray(e)||nt(e)});let ye=r().proxy;function X(t,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=e,{nTriggerFormInput:o}=N;r&&R(r,t,n),i&&R(i,t,n),a&&R(a,t,n),k.value=t,o()}function Z(t,n){let{onChange:r}=e,{nTriggerFormChange:i}=N;r&&R(r,t,n),k.value=t,i()}function be(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=N;n&&R(n,t),r()}function xe(t){let{onFocus:n}=e,{nTriggerFormFocus:r}=N;n&&R(n,t),r()}function Se(t){let{onClear:n}=e;n&&R(n,t)}function Ce(t){let{onInputBlur:n}=e;n&&R(n,t)}function we(t){let{onInputFocus:n}=e;n&&R(n,t)}function Te(){let{onDeactivate:t}=e;t&&R(t)}function Ee(){let{onActivate:t}=e;t&&R(t)}function De(t){let{onClick:n}=e;n&&R(n,t)}function Oe(t){let{onWrapperFocus:n}=e;n&&R(n,t)}function ke(t){let{onWrapperBlur:n}=e;n&&R(n,t)}function Ae(){V.value=!0}function je(e){V.value=!1,e.target===S.value?Q(e,1):Q(e,0)}function Q(t,n=0,r=`input`){let i=t.target.value;if(nt(i),t instanceof InputEvent&&!t.isComposing&&(V.value=!1),e.type===`textarea`){let{value:e}=E;e&&e.syncUnifiedContainer()}if(U=i,V.value)return;T.recordCursor();let a=Me(i);if(a)if(!e.pair)r===`input`?X(i,{source:n}):Z(i,{source:n});else{let{value:e}=A;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[n]=i,r===`input`?X(e,{source:n}):Z(e,{source:n})}ye.$forceUpdate(),a||re(T.restoreCursor)}function Me(t){let{countGraphemes:n,maxlength:r,minlength:i}=e;if(n){let e;if(r!==void 0&&(e===void 0&&(e=n(t)),e>Number(r))||i!==void 0&&(e===void 0&&(e=n(t)),e<Number(r)))return!1}let{allowInput:a}=e;return typeof a==`function`?a(t):!0}function Ne(e){Ce(e),e.relatedTarget===l.value&&Te(),e.relatedTarget!==null&&(e.relatedTarget===y.value||e.relatedTarget===S.value||e.relatedTarget===u.value)||(H.value=!1),$(e,`blur`),C.value=null}function Pe(e,t){we(e),z.value=!0,H.value=!0,Ee(),$(e,`focus`),t===0?C.value=y.value:t===1?C.value=S.value:t===2&&(C.value=u.value)}function Fe(t){e.passivelyActivated&&(ke(t),$(t,`blur`))}function Ie(t){e.passivelyActivated&&(z.value=!0,Oe(t),$(t,`focus`))}function $(e,t){e.relatedTarget!==null&&(e.relatedTarget===y.value||e.relatedTarget===S.value||e.relatedTarget===u.value||e.relatedTarget===l.value)||(t===`focus`?(xe(e),z.value=!0):t===`blur`&&(be(e),z.value=!1))}function Le(e,t){Q(e,t,`change`)}function Re(e){De(e)}function ze(e){Se(e),Be()}function Be(){e.pair?(X([``,``],{source:`clear`}),Z([``,``],{source:`clear`})):(X(``,{source:`clear`}),Z(``,{source:`clear`}))}function Ve(t){let{onMousedown:n}=e;n&&n(t);let{tagName:r}=t.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(e.resizable){let{value:e}=l;if(e){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();if(n+i-14<t.clientX&&t.clientX<n+i&&r+a-14<t.clientY&&t.clientY<r+a)return}}t.preventDefault(),z.value||Xe()}}function He(){var t;B.value=!0,e.type===`textarea`&&((t=E.value)==null||t.handleMouseEnterWrapper())}function Ue(){var t;B.value=!1,e.type===`textarea`&&((t=E.value)==null||t.handleMouseLeaveWrapper())}function We(){I.value||K.value===`click`&&(q.value=!q.value)}function Ge(e){if(I.value)return;e.preventDefault();let t=e=>{e.preventDefault(),p(`mouseup`,document,t)};if(g(`mouseup`,document,t),K.value!==`mousedown`)return;q.value=!0;let n=()=>{q.value=!1,p(`mouseup`,document,n)};g(`mouseup`,document,n)}function Ke(t){e.onKeyup&&R(e.onKeyup,t)}function qe(t){switch(e.onKeydown&&R(e.onKeydown,t),t.key){case`Escape`:Ye();break;case`Enter`:Je(t);break}}function Je(t){var n,r;if(e.passivelyActivated){let{value:i}=H;if(i){e.internalDeactivateOnEnter&&Ye();return}t.preventDefault(),e.type===`textarea`?(n=u.value)==null||n.focus():(r=y.value)==null||r.focus()}}function Ye(){e.passivelyActivated&&(H.value=!1,re(()=>{var e;(e=l.value)==null||e.focus()}))}function Xe(){var t,n,r;I.value||(e.passivelyActivated?(t=l.value)==null||t.focus():((n=u.value)==null||n.focus(),(r=y.value)==null||r.focus()))}function Ze(){l.value?.contains(document.activeElement)&&document.activeElement.blur()}function Qe(){var e,t;(e=u.value)==null||e.select(),(t=y.value)==null||t.select()}function $e(){I.value||(u.value?u.value.focus():y.value&&y.value.focus())}function et(){let{value:e}=l;e?.contains(document.activeElement)&&e!==document.activeElement&&Ye()}function tt(t){if(e.type===`textarea`){let{value:e}=u;e?.scrollTo(t)}else{let{value:e}=y;e?.scrollTo(t)}}function nt(t){let{type:n,pair:r,autosize:i}=e;if(!r&&i)if(n===`textarea`){let{value:e}=_;e&&(e.textContent=`${t??``}\r\n`)}else{let{value:e}=v;e&&(t?e.textContent=t:e.innerHTML=` `)}}function rt(){_e()}let it=P({top:`0`});function at(e){var t;let{scrollTop:n}=e.target;it.value.top=`${-n}px`,(t=E.value)==null||t.syncUnifiedContainer()}let ot=null;x(()=>{let{autosize:t,type:n}=e;t&&n===`textarea`?ot=b(A,e=>{!Array.isArray(e)&&e!==U&&nt(e)}):ot?.()});let st=null;x(()=>{e.type===`textarea`?st=b(A,e=>{var t;!Array.isArray(e)&&e!==U&&((t=E.value)==null||t.syncUnifiedContainer())}):st?.()}),d(fe,{mergedValueRef:A,maxlengthRef:ve,mergedClsPrefixRef:n,countGraphemesRef:D(e,`countGraphemes`)});let ct={wrapperElRef:l,inputElRef:y,textareaElRef:u,isCompositing:V,clear:Be,focus:Xe,blur:Ze,select:Qe,deactivate:et,activate:$e,scrollTo:tt},lt=ne(`Input`,o,n),ut=M(()=>{let{value:e}=F,{common:{cubicBezierEaseInOut:n},self:{color:r,borderRadius:i,textColor:a,caretColor:o,caretColorError:s,caretColorWarning:l,textDecorationColor:u,border:d,borderDisabled:f,borderHover:p,borderFocus:m,placeholderColor:h,placeholderColorDisabled:g,lineHeightTextarea:_,colorDisabled:v,colorFocus:y,textColorDisabled:b,boxShadowFocus:x,iconSize:S,colorFocusWarning:C,boxShadowFocusWarning:T,borderWarning:E,borderFocusWarning:D,borderHoverWarning:ee,colorFocusError:te,boxShadowFocusError:O,borderError:k,borderFocusError:A,borderHoverError:ne,clearSize:j,clearColor:re,clearColorHover:ie,clearColorPressed:M,iconColor:N,iconColorDisabled:P,suffixTextColor:ae,countTextColor:I,countTextColorDisabled:L,iconColorHover:R,iconColorPressed:z,loadingColor:oe,loadingColorError:se,loadingColorWarning:B,fontWeight:V,[w(`padding`,e)]:H,[w(`fontSize`,e)]:U,[w(`height`,e)]:W}}=c.value,{left:ce,right:le}=t(H);return{"--n-bezier":n,"--n-count-text-color":I,"--n-count-text-color-disabled":L,"--n-color":r,"--n-font-size":U,"--n-font-weight":V,"--n-border-radius":i,"--n-height":W,"--n-padding-left":ce,"--n-padding-right":le,"--n-text-color":a,"--n-caret-color":o,"--n-text-decoration-color":u,"--n-border":d,"--n-border-disabled":f,"--n-border-hover":p,"--n-border-focus":m,"--n-placeholder-color":h,"--n-placeholder-color-disabled":g,"--n-icon-size":S,"--n-line-height-textarea":_,"--n-color-disabled":v,"--n-color-focus":y,"--n-text-color-disabled":b,"--n-box-shadow-focus":x,"--n-loading-color":oe,"--n-caret-color-warning":l,"--n-color-focus-warning":C,"--n-box-shadow-focus-warning":T,"--n-border-warning":E,"--n-border-focus-warning":D,"--n-border-hover-warning":ee,"--n-loading-color-warning":B,"--n-caret-color-error":s,"--n-color-focus-error":te,"--n-box-shadow-focus-error":O,"--n-border-error":k,"--n-border-focus-error":A,"--n-border-hover-error":ne,"--n-loading-color-error":se,"--n-clear-color":re,"--n-clear-size":j,"--n-clear-color-hover":ie,"--n-clear-color-pressed":M,"--n-icon-color":N,"--n-icon-color-hover":R,"--n-icon-color-pressed":z,"--n-icon-color-disabled":P,"--n-suffix-text-color":ae}}),dt=a?ie(`input`,M(()=>{let{value:e}=F;return e[0]}),ut,e):void 0;return Object.assign(Object.assign({},ct),{wrapperElRef:l,inputElRef:y,inputMirrorElRef:v,inputEl2Ref:S,textareaElRef:u,textareaMirrorElRef:_,textareaScrollbarInstRef:E,rtlEnabled:lt,uncontrolledValue:k,mergedValue:A,passwordVisible:q,mergedPlaceholder:W,showPlaceholder1:ce,showPlaceholder2:le,mergedFocus:G,isComposing:V,activated:H,showClearButton:ue,mergedSize:F,mergedDisabled:I,textDecorationStyle:he,mergedClsPrefix:n,mergedBordered:i,mergedShowPasswordOn:K,placeholderStyle:it,mergedStatus:L,textAreaScrollContainerWidth:Y,handleTextAreaScroll:at,handleCompositionStart:Ae,handleCompositionEnd:je,handleInput:Q,handleInputBlur:Ne,handleInputFocus:Pe,handleWrapperBlur:Fe,handleWrapperFocus:Ie,handleMouseEnter:He,handleMouseLeave:Ue,handleMouseDown:Ve,handleChange:Le,handleClick:Re,handleClear:ze,handlePasswordToggleClick:We,handlePasswordToggleMousedown:Ge,handleWrapperKeydown:qe,handleWrapperKeyup:Ke,handleTextAreaMirrorResize:rt,getTextareaScrollContainer:()=>u.value,mergedTheme:c,cssVars:a?void 0:ut,themeClass:dt?.themeClass,onRender:dt?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:r,countGraphemes:i,onRender:o}=this,s=this.$slots;return o?.(),L(`div`,{ref:`wrapperElRef`,class:[`${e}-input`,`${e}-input--${this.mergedSize}-size`,n,t&&`${e}-input--${t}-status`,{[`${e}-input--rtl`]:this.rtlEnabled,[`${e}-input--disabled`]:this.mergedDisabled,[`${e}-input--textarea`]:r===`textarea`,[`${e}-input--resizable`]:this.resizable&&!this.autosize,[`${e}-input--autosize`]:this.autosize,[`${e}-input--round`]:this.round&&r!==`textarea`,[`${e}-input--pair`]:this.pair,[`${e}-input--focus`]:this.mergedFocus,[`${e}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},L(`div`,{class:`${e}-input-wrapper`},E(s.prefix,t=>t&&L(`div`,{class:`${e}-input__prefix`},t)),r===`textarea`?L(N,{ref:`textareaScrollbarInstRef`,class:`${e}-input__textarea`,container:this.getTextareaScrollContainer,theme:this.theme?.peers?.Scrollbar,themeOverrides:this.themeOverrides?.peers?.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{let{textAreaScrollContainerWidth:t}=this,n={width:this.autosize&&t&&`${t}px`};return L(F,null,L(`textarea`,Object.assign({},this.inputProps,{ref:`textareaElRef`,class:[`${e}-input__textarea-el`,this.inputProps?.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],this.inputProps?.style,n],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?L(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?L(y,{onResize:this.handleTextAreaMirrorResize},{default:()=>L(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):L(`div`,{class:`${e}-input__input`},L(`input`,Object.assign({type:r===`password`&&this.mergedShowPasswordOn&&this.passwordVisible?`text`:r},this.inputProps,{ref:`inputElRef`,class:[`${e}-input__input-el`,this.inputProps?.class],style:[this.textDecorationStyle[0],this.inputProps?.style],tabindex:this.passivelyActivated&&!this.activated?-1:this.inputProps?.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?L(`div`,{class:`${e}-input__placeholder`},L(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?L(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&E(s.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?L(`div`,{class:`${e}-input__suffix`},[E(s[`clear-icon-placeholder`],t=>(this.clearable||t)&&L(G,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>{var e;return(e=this.$slots)[`clear-icon`]?.call(e)}})),this.internalLoadingBeforeSuffix?null:t,this.loading===void 0?null:L(ue,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?L(Y,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?L(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?A(s[`password-visible-icon`],()=>[L(a,{clsPrefix:e},{default:()=>L(W,null)})]):A(s[`password-invisible-icon`],()=>[L(a,{clsPrefix:e},{default:()=>L(ce,null)})])):null]):null)),this.pair?L(`span`,{class:`${e}-input__separator`},A(s.separator,()=>[this.separator])):null,this.pair?L(`div`,{class:`${e}-input-wrapper`},L(`div`,{class:`${e}-input__input`},L(`input`,{ref:`inputEl2Ref`,type:this.type,class:`${e}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?L(`div`,{class:`${e}-input__placeholder`},L(`span`,null,this.mergedPlaceholder[1])):null),E(s.suffix,t=>(this.clearable||t)&&L(`div`,{class:`${e}-input__suffix`},[this.clearable&&L(G,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>s[`clear-icon`]?.call(s),placeholder:()=>s[`clear-icon-placeholder`]?.call(s)}),t]))):null,this.mergedBordered?L(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?L(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&r===`textarea`?L(Y,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null)}});export{H as a,ue as i,de as n,B as o,K as r,V as s,_e as t};
|
|
259
|
+
//# sourceMappingURL=Input-DppYTq9C.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Gn as e,In as t,Sn as n,Un as r,_n as i,bn as a,c as o,gn as s,hn as c,mn as l,r as u,sr as d,t as f,tr as p,un as m,ur as h,vn as g,xn as _}from"./Space-n5-XcguU.js";import{t as v}from"./Select-DIzZyRZb.js";import{t as y}from"./Input-DppYTq9C.js";import{t as b}from"./Tag-D1fOKpTH.js";import{t as x}from"./Alert-dluGVkos.js";import{l as S,r as C}from"./resources-Bt6thQCD.js";import{c as w,o as T,y as E}from"./index-CeE6v959.js";import{t as D}from"./useResource-C_rJCY8C.js";import{n as O,t as k}from"./EmptyState-DeDck-OL.js";import{t as A}from"./CodeViewer-Bqy7-wvH.js";var j={style:{background:`var(--n-code-color)`,padding:`12px`,"border-radius":`4px`,"font-size":`12px`,"overflow-x":`auto`}},M={key:0,style:{background:`var(--n-code-color)`,padding:`12px`,"border-radius":`4px`,"font-size":`12px`,"overflow-x":`auto`}},N={key:1,style:{background:`var(--n-code-color)`,padding:`12px`,"border-radius":`4px`,"font-size":`12px`,"overflow-x":`auto`}},P=n({__name:`Invoke`,setup(n){let P=T(),F=l(()=>P.params.name),{data:I,error:L,loading:R}=D(()=>C.routes()),z=l(()=>I.value?.find(e=>e.name===F.value)??null),B=p(`POST`);r(z,e=>{e&&e.methods.length>0&&!e.methods.includes(B.value)&&(B.value=e.methods[0])});let V=l(()=>z.value?.methods.map(e=>({label:e,value:e}))??[]),H=p(`{}`),U=p(``),W=p(!1),G=p(null),K=p(null),q=l(()=>{if(!G.value)return`default`;let e=G.value.status;return e>=200&&e<300?`success`:e>=400?`error`:`warning`});async function J(){W.value=!0,G.value=null,K.value=null;let e={};try{H.value.trim()&&(e=JSON.parse(H.value))}catch{K.value=`Headers must be valid JSON`,W.value=!1;return}let t=null;if(U.value.trim())try{t=JSON.parse(U.value)}catch{t=U.value}try{G.value=await C.invoke(F.value,{method:B.value,headers:e,body:t})}catch(e){K.value=e.message??`Invoke failed`}finally{W.value=!1}}return(n,r)=>(t(),s(d(u),{title:`Invoke: ${F.value}`,size:`small`},{default:e(()=>[_(d(S),{show:d(R)},{default:e(()=>[_(O,{error:d(L),retry:()=>{}},null,8,[`error`]),z.value?(t(),s(d(f),{key:0,vertical:``,size:16},{default:e(()=>[z.value.auth===`authenticated`?(t(),s(d(x),{key:0,type:`warning`,"show-icon":!0},{default:e(()=>[...r[3]||=[a(` This function expects an end-user JWT. Admin invoke runs under `,-1),c(`code`,null,`service_role`,-1),a(`; RLS is bypassed. `,-1)]]),_:1})):i(``,!0),_(d(f),{align:`center`,size:12},{default:e(()=>[_(d(v),{value:B.value,"onUpdate:value":r[0]||=e=>B.value=e,options:V.value,style:{width:`120px`}},null,8,[`value`,`options`]),_(d(o),{type:`primary`,loading:W.value,onClick:J},{default:e(()=>[...r[4]||=[a(` Run `,-1)]]),_:1},8,[`loading`])]),_:1}),c(`div`,null,[_(d(w),{strong:``,style:{display:`block`,"margin-bottom":`6px`}},{default:e(()=>[...r[5]||=[a(` Headers (JSON) `,-1)]]),_:1}),_(d(y),{value:H.value,"onUpdate:value":r[1]||=e=>H.value=e,type:`textarea`,rows:3,placeholder:`{"Content-Type": "application/json"}`},null,8,[`value`])]),c(`div`,null,[_(d(w),{strong:``,style:{display:`block`,"margin-bottom":`6px`}},{default:e(()=>[...r[6]||=[a(` Body `,-1)]]),_:1}),_(A,{modelValue:U.value,"onUpdate:modelValue":r[2]||=e=>U.value=e,"read-only":!1,height:`200px`},null,8,[`modelValue`])]),_(d(E)),G.value?(t(),g(m,{key:1},[_(d(f),{align:`center`,size:12,style:{"margin-bottom":`8px`}},{default:e(()=>[_(d(b),{type:q.value},{default:e(()=>[a(h(G.value.status),1)]),_:1},8,[`type`]),_(d(w),{depth:`3`,style:{"font-size":`12px`}},{default:e(()=>[a(h(G.value.elapsed_ms.toFixed(2))+` ms `,1)]),_:1})]),_:1}),_(d(w),{strong:``,style:{display:`block`,"margin-bottom":`6px`}},{default:e(()=>[...r[7]||=[a(` Response headers `,-1)]]),_:1}),c(`pre`,j,h(JSON.stringify(G.value.headers,null,2)),1),_(d(w),{strong:``,style:{display:`block`,margin:`12px 0 6px`}},{default:e(()=>[...r[8]||=[a(` Response body `,-1)]]),_:1}),G.value.body===null?G.value.body_text?(t(),g(`pre`,N,h(G.value.body_text),1)):(t(),s(k,{key:2,description:`Empty response body.`})):(t(),g(`pre`,M,h(JSON.stringify(G.value.body,null,2)),1))],64)):i(``,!0),K.value?(t(),s(O,{key:2,error:{message:K.value},retry:J},null,8,[`error`])):i(``,!0),!G.value&&!K.value&&!W.value?(t(),s(k,{key:3,description:`Choose a method, edit headers/body, and press Run.`})):i(``,!0)]),_:1})):d(R)?i(``,!0):(t(),s(k,{key:1,description:`Function not found.`}))]),_:1},8,[`show`])]),_:1},8,[`title`]))}});export{P as default};
|
|
2
|
+
//# sourceMappingURL=Invoke-DW3Nveeh.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Gn as e,In as t,Sn as n,bn as r,c as i,gn as a,mn as o,sr as s,tr as c,un as l,ur as u,vn as d,xn as f}from"./Space-n5-XcguU.js";import{T as p,c as m}from"./index-CeE6v959.js";var h={key:0},g={key:0,style:{margin:`4px 0 0`,"font-size":`12px`,"white-space":`pre-wrap`}},_=n({__name:`JsonField`,props:{value:{}},setup(n){let _=n,v=c(!1),y=o(()=>_.value===null||_.value===void 0?``:typeof _.value==`string`?_.value:JSON.stringify(_.value,null,2)),b=o(()=>{if(_.value===null||_.value===void 0)return``;let e=typeof _.value==`string`?_.value:JSON.stringify(_.value);return e.length>80?e.slice(0,77)+`…`:e}),x=o(()=>_.value!==null&&typeof _.value==`object`);return(o,c)=>n.value===null||n.value===void 0?(t(),d(`span`,h,[f(s(m),{depth:`3`,style:{"font-style":`italic`}},{default:e(()=>[...c[1]||=[r(`null`,-1)]]),_:1})])):x.value?(t(),d(l,{key:2},[f(s(i),{text:``,size:`tiny`,type:`info`,onClick:c[0]||=e=>v.value=!v.value},{default:e(()=>[r(u(v.value?`▾`:`▸`),1)]),_:1}),v.value?(t(),d(`pre`,g,u(y.value),1)):(t(),a(s(p),{key:1},{trigger:e(()=>[f(s(m),{code:``,style:{"font-size":`12px`}},{default:e(()=>[r(u(b.value),1)]),_:1})]),default:e(()=>[r(` `+u(y.value),1)]),_:1}))],64)):(t(),d(l,{key:1},[r(u(y.value),1)],64))}});export{_ as t};
|
|
2
|
+
//# sourceMappingURL=JsonField-DibyJgun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.login-shell[data-v-b605643a]{background:var(--n-color);justify-content:center;align-items:center;min-height:100vh;padding:24px;display:flex}.login-card[data-v-b605643a]{width:100%;max-width:380px;box-shadow:0 4px 24px #0000001f}
|