project init & fix ui

This commit is contained in:
2023-01-06 14:24:11 +08:00
parent abc4f65a8e
commit ac9b479805
866 changed files with 39916 additions and 53 deletions

View File

@@ -0,0 +1,10 @@
:: BASE_DOC ::
## API
### IndexesAnchor Props
name | type | default | description | required
-- | -- | -- | -- | --
custom-style | String | - | \- | N
external-classes | Array | - | `['t-class']` | N
index | String / Number | - | \- | N

View File

@@ -0,0 +1,10 @@
:: BASE_DOC ::
## API
### IndexesAnchor Props
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
custom-style | String | - | 自定义组件样式 | N
external-classes | Array | - | 组件类名,用于设置组件外层元素类名。`['t-class']` | N
index | String / Number | - | 索引字符 | N

View File

@@ -0,0 +1,13 @@
import { RelationsOptions, SuperComponent } from '../common/src/index';
export default class IndexesAnchor extends SuperComponent {
externalClasses: string[];
properties: import("./type").TdIndexesAnchorProps;
data: {
prefix: string;
classPrefix: string;
anchorStyle: string;
sticky: boolean;
active: boolean;
};
relations: RelationsOptions;
}

View File

@@ -0,0 +1,34 @@
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}-indexes-anchor`;
let IndexesAnchor = class IndexesAnchor extends SuperComponent {
constructor() {
super(...arguments);
this.externalClasses = [`${prefix}-class`];
this.properties = props;
this.data = {
prefix,
classPrefix: name,
anchorStyle: '',
sticky: false,
active: false,
};
this.relations = {
'../indexes/indexes': {
type: 'parent',
},
};
}
};
IndexesAnchor = __decorate([
wxComponent()
], IndexesAnchor);
export default IndexesAnchor;

View File

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

View File

@@ -0,0 +1,10 @@
<wxs src="../common/utils.wxs" module="_" />
<view class="{{classPrefix}} {{prefix}}-class" style="{{customStyle}}">
<view class="{{_.cls(classPrefix + '__wrapper', [['sticky', sticky], ['active', active]])}}" style="{{anchorStyle}}">
<view class="{{classPrefix}}__slot">
<slot />
</view>
<view class="{{classPrefix}}__header"> {{index}} </view>
</view>
</view>

View File

@@ -0,0 +1,57 @@
.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-indexes-anchor {
color: var(--td-indexes-anchor-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
font-size: var(--td-indexes-anchor-font-size, 28rpx);
line-height: var(--td-indexes-anchor-line-height, 44rpx);
}
.t-indexes-anchor__header {
display: none;
}
.t-indexes-anchor__slot {
overflow: hidden;
}
.t-indexes-anchor__slot:empty + .t-indexes-anchor__header {
display: block;
padding: 8rpx 32rpx;
background-color: var(--td-indexes-anchor-bg-color, var(--td-gray-color-1, #f3f3f3));
}
.t-indexes-anchor__wrapper {
will-change: transform;
}
.t-indexes-anchor__wrapper--sticky {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1;
}
.t-indexes-anchor__wrapper--active {
color: var(--td-indexes-anchor-active-color, var(--td-primary-color, #0052d9));
font-weight: var(--td-indexes-anchor-active-font-weight, 600);
}

View File

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

View File

@@ -0,0 +1,13 @@
const props = {
customStyle: {
type: String,
value: '',
},
externalClasses: {
type: Array,
},
index: {
type: null,
},
};
export default props;

View File

@@ -0,0 +1,14 @@
export interface TdIndexesAnchorProps {
customStyle?: {
type: StringConstructor;
value?: string;
};
externalClasses?: {
type: ArrayConstructor;
value?: ['t-class'];
};
index?: {
type: null;
value?: string | number;
};
}

View File

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