first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../common/props.js"),o={...e.baseProps,title:String,value:e.makeNumericProp(""),icon:String,iconSize:e.numericProp,label:String,isLink:e.makeBooleanProp(!1),to:String,replace:e.makeBooleanProp(!1),clickable:e.makeBooleanProp(!1),size:String,border:e.makeBooleanProp(void 0),titleWidth:String,center:e.makeBooleanProp(!1),required:e.makeBooleanProp(!1),vertical:e.makeBooleanProp(!1),prop:String,rules:e.makeArrayProp(),customIconClass:e.makeStringProp(""),customLabelClass:e.makeStringProp(""),customValueClass:e.makeStringProp(""),customTitleClass:e.makeStringProp(""),valueAlign:e.makeStringProp("right"),ellipsis:e.makeBooleanProp(!1),useTitleSlot:e.makeBooleanProp(!0),markerSide:e.makeStringProp("before")};exports.cellProps=o;

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js"),l=require("../composables/useCell.js"),s=require("../composables/useParent.js"),t=require("../wd-form/types.js"),r=require("./types.js"),i=require("../common/util.js");Math||o();const o=()=>"../wd-icon/wd-icon.js",a=e.defineComponent({name:"wd-cell",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"},props:r.cellProps,emits:["click"],setup(r,{emit:o}){const a=r,c=o,n=e.useSlots(),u=l.useCell(),d=e.computed((()=>Boolean(i.isDef(a.border)?a.border:u.border.value))),{parent:p}=s.useParent(t.FORM_KEY),m=e.computed((()=>p&&a.prop&&p.errorMessages&&p.errorMessages[a.prop]?p.errorMessages[a.prop]:"")),v=e.computed((()=>{let e=!1;if(p&&p.props.rules){const l=p.props.rules;for(const s in l)Object.prototype.hasOwnProperty.call(l,s)&&s===a.prop&&Array.isArray(l[s])&&(e=l[s].some((e=>e.required)))}return a.required||a.rules.some((e=>e.required))||e})),b=e.computed((()=>{const e=n.icon||a.icon,l=n.title&&a.useTitleSlot||a.title,s=n.label||a.label;return e||l||s}));function w(){const l=a.to;(a.clickable||a.isLink)&&c("click"),l&&a.isLink&&(a.replace?e.index.redirectTo({url:l}):e.index.navigateTo({url:l}))}return(l,s)=>e.e({a:b.value},b.value?e.e({b:v.value&&"before"===l.markerSide},(v.value&&l.markerSide,{}),{c:l.icon},l.icon?{d:e.p({name:l.icon,size:l.iconSize,"custom-class":`wd-cell__icon ${l.customIconClass}`})}:{},{e:l.useTitleSlot&&l.$slots.title},l.useTitleSlot&&l.$slots.title?{}:l.title?{g:e.t(l.title),h:e.n(l.customTitleClass)}:{},{f:l.title,i:l.label},l.label?{j:e.t(l.label),k:e.n(`wd-cell__label ${l.customLabelClass}`)}:{},{l:v.value&&"after"===l.markerSide},(v.value&&l.markerSide,{}),{m:e.s(l.titleWidth?"min-width:"+l.titleWidth+";max-width:"+l.titleWidth+";":"")}):{},{n:e.t(l.value),o:e.n(`wd-cell__value ${l.customValueClass} wd-cell__value--${l.valueAlign} ${l.ellipsis?"wd-cell__value--ellipsis":""}`),p:l.isLink},l.isLink?{q:e.p({"custom-class":"wd-cell__arrow-right",name:"arrow-right"})}:{},{r:m.value},m.value?{s:e.t(m.value)}:{},{t:e.n(l.vertical?"is-vertical":""),v:e.n(d.value?"is-border":""),w:e.n(l.size?"is-"+l.size:""),x:e.n(l.center?"is-center":""),y:e.n(l.customClass),z:e.s(l.customStyle),A:l.isLink||l.clickable?"is-hover":"none",B:e.o(w)})}}),c=e._export_sfc(a,[["__scopeId","data-v-7aeca375"]]);wx.createComponent(c);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"wd-icon": "../wd-icon/wd-icon"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-7aeca375', 'wd-cell', v, w, x, y]}}" style="{{z}}" hover-class="{{A}}" hover-stay-time="{{70}}" bindtap="{{B}}"><view class="{{['data-v-7aeca375', 'wd-cell__wrapper', t]}}"><view wx:if="{{a}}" class="wd-cell__left data-v-7aeca375" style="{{m}}"><text wx:if="{{b}}" class="wd-cell__required wd-cell__required--left data-v-7aeca375">*</text><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><wd-icon wx:if="{{c}}" class="data-v-7aeca375" u-i="7aeca375-0" bind:__l="__l" u-p="{{d}}"></wd-icon></block><view class="wd-cell__title data-v-7aeca375"><slot wx:if="{{e}}" name="title"></slot><text wx:elif="{{f}}" class="{{['data-v-7aeca375', h]}}">{{g}}</text><block wx:if="{{$slots.label}}"><slot name="label"></slot></block><block wx:else><view wx:if="{{i}}" class="{{['data-v-7aeca375', k]}}">{{j}}</view></block></view><text wx:if="{{l}}" class="wd-cell__required data-v-7aeca375">*</text></view><view class="wd-cell__right data-v-7aeca375"><view class="wd-cell__body data-v-7aeca375"><view class="{{['data-v-7aeca375', o]}}"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else>{{n}}</block></view><wd-icon wx:if="{{p}}" class="data-v-7aeca375" u-i="7aeca375-1" bind:__l="__l" u-p="{{q}}"/><slot wx:else name="right-icon"/></view><view wx:if="{{r}}" class="wd-cell__error-message data-v-7aeca375">{{s}}</view></view></view></view>

File diff suppressed because one or more lines are too long