bug fix and performance improvements

This commit is contained in:
quantulr
2023-08-18 17:32:18 +08:00
parent 3c6ab550cf
commit e750b9be9c
923 changed files with 46650 additions and 9 deletions

View File

@ -0,0 +1,16 @@
import { SuperComponent, RelationsOptions } from '../common/src/index';
export default class CellGroup extends SuperComponent {
externalClasses: string[];
relations: RelationsOptions;
options: {
addGlobalClass: boolean;
};
properties: import("./type").TdCellGroupProps;
data: {
prefix: string;
classPrefix: string;
};
methods: {
updateLastChid(): void;
};
}

View File

@ -0,0 +1,43 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
const { prefix } = config;
const name = `${prefix}-cell-group`;
let CellGroup = class CellGroup extends SuperComponent {
constructor() {
super(...arguments);
this.externalClasses = [`${prefix}-class`, `${prefix}-class-title`];
this.relations = {
'../cell/cell': {
type: 'child',
linked() {
this.updateLastChid();
},
},
};
this.options = {
addGlobalClass: true,
};
this.properties = props;
this.data = {
prefix,
classPrefix: name,
};
this.methods = {
updateLastChid() {
const items = this.$children;
items.forEach((child, index) => child.setData({ isLastChild: index === items.length - 1 }));
},
};
}
};
CellGroup = __decorate([
wxComponent()
], CellGroup);
export default CellGroup;

View File

@ -0,0 +1,3 @@
{
"component": true
}

View File

@ -0,0 +1,9 @@
<wxs src="../common/utils.wxs" module="_" />
<view wx:if="{{ title }}" class="class {{ classPrefix }}__title {{prefix}}-class-title"> {{ title }} </view>
<view
style="{{_._style([style, customStyle])}}"
class="{{_.cls(classPrefix, [['bordered', bordered], theme])}} class {{prefix}}-class"
>
<slot />
</view>

View File

@ -0,0 +1,68 @@
.t-float-left {
float: left;
}
.t-float-right {
float: right;
}
@keyframes tdesign-fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.hotspot-expanded.relative {
position: relative;
}
.hotspot-expanded::after {
content: '';
display: block;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
transform: scale(1.5);
}
.t-cell-group {
position: relative;
}
.t-cell-group__title {
font-family: PingFangSC-Regular;
font-size: var(--td-cell-group-title-font-size, 28rpx);
color: var(--td-cell-group-title-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
text-align: left;
line-height: var(--td-cell-group-title-line-height, 90rpx);
background-color: var(--td-cell-group-title-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
padding-left: var(--td-cell-group-title-padding-left, 32rpx);
}
.t-cell-group--bordered::before {
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0;
left: 0;
top: 0;
border-top: 1px solid var(--td-cell-group-border-color, var(--td-border-color, var(--td-gray-color-3, #e7e7e7)));
transform: scaleY(0.5);
z-index: 1;
}
.t-cell-group--bordered::after {
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0;
left: 0;
bottom: 0;
border-bottom: 1px solid var(--td-cell-group-border-color, var(--td-border-color, var(--td-gray-color-3, #e7e7e7)));
transform: scaleY(0.5);
z-index: 1;
}
.t-cell-group--card {
margin: 0 32rpx;
border-radius: var(--td-radius-large, 18rpx);
overflow: hidden;
}

View File

@ -0,0 +1,3 @@
import { TdCellGroupProps } from './type';
declare const props: TdCellGroupProps;
export default props;

View File

@ -0,0 +1,17 @@
const props = {
bordered: {
type: Boolean,
},
externalClasses: {
type: Array,
},
theme: {
type: String,
value: 'default',
},
title: {
type: String,
value: '',
},
};
export default props;

View File

@ -0,0 +1,22 @@
export interface TdCellGroupProps {
bordered?: {
type: BooleanConstructor;
value?: boolean;
};
style?: {
type: StringConstructor;
value?: string;
};
externalClasses?: {
type: ArrayConstructor;
value?: ['t-class'];
};
theme?: {
type: StringConstructor;
value?: 'default' | 'card';
};
title?: {
type: StringConstructor;
value?: string;
};
}

View File

@ -0,0 +1 @@
export {};