From ac855c3dff2986d441f6795c501db573b8aca0b4 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 15:00:23 +0800 Subject: [PATCH 01/58] =?UTF-8?q?feat:=20=E5=8E=BB=E9=99=A4=E7=82=B9?= =?UTF-8?q?=E5=87=BBXRFrame=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packageXRFrame/pages/index/index.js | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/miniprogram/packageXRFrame/pages/index/index.js b/miniprogram/packageXRFrame/pages/index/index.js index 04be2fe9..0c2fb188 100644 --- a/miniprogram/packageXRFrame/pages/index/index.js +++ b/miniprogram/packageXRFrame/pages/index/index.js @@ -67,48 +67,48 @@ Page({ } }, async handleLastRecord() { - if (lastOpened) { - return - } - - lastCount += 1 - // if (Math.random() >= (0.34 + lastCount * 0.1)) { - // return; + // if (lastOpened) { + // return // } - const root = this.data.root - lastOpened = true + // lastCount += 1 + // // if (Math.random() >= (0.34 + lastCount * 0.1)) { + // // return; + // // } + + // const root = this.data.root + // lastOpened = true - wx.request({ - url: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-gate.txt', - success(res) { - wx.showModal({ - title: '一把钥匙', - content: res.data, - confirmText: '探寻真实', - cancelText: '放下钥匙', - success(res) { - if (res.cancel) { - wx.onAppShow((result) => { - lastOpened = false - }) - return - } + // wx.request({ + // url: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-gate.txt', + // success(res) { + // wx.showModal({ + // title: '一把钥匙', + // content: res.data, + // confirmText: '探寻真实', + // cancelText: '放下钥匙', + // success(res) { + // if (res.cancel) { + // wx.onAppShow((result) => { + // lastOpened = false + // }) + // return + // } - wx.navigateTo({ - url: root + '/pages/scene-last-record/index', - success: () => { - wx.onAppShow((result) => { - lastOpened = false - }) - } - }) - } - }) - }, - fail(err) { - lastOpened = false - } - }) + // wx.navigateTo({ + // url: root + '/pages/scene-last-record/index', + // success: () => { + // wx.onAppShow((result) => { + // lastOpened = false + // }) + // } + // }) + // } + // }) + // }, + // fail(err) { + // lastOpened = false + // } + // }) } }) From 6edabcfea4fa644205fee800c31bde6e7d95c272 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 15:50:21 +0800 Subject: [PATCH 02/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 6 ++---- build/ci.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f1f81b..2337d611 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,7 @@ name: WeChat MiniProgram Demo CI/CD on: push: branches: - - master - pull_request: - branches: - - master + - feat-ce jobs: upload: runs-on: ubuntu-latest @@ -15,5 +12,6 @@ jobs: env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | + mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key node ./build/ci.js diff --git a/build/ci.js b/build/ci.js index 9b78edc9..6625b924 100644 --- a/build/ci.js +++ b/build/ci.js @@ -8,11 +8,11 @@ if (!privateKeyContent) { throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') } -const privateKeyPath = path.resolve(__dirname, './private.key') +const privateKeyPath = path.resolve(__dirname, './key') fs.writeFileSync(privateKeyPath, privateKeyContent) const project = new ci.Project({ - appid: 'wxe5f52902cf4de896', + appid: 'wx622bee4f78fa4f5a', type: 'miniProgram', projectPath: path.resolve(__dirname, '../'), privateKeyPath: path.resolve(__dirname, './key'), From 8e94f87ed1a9e33c27a0bb657ddc610a3494c879 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 15:58:49 +0800 Subject: [PATCH 03/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- build/ci.js | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2337d611..6f3db7a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,4 +14,4 @@ jobs: run: | mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key - node ./build/ci.js + node ./build/ci.js --skip-key-write diff --git a/build/ci.js b/build/ci.js index 6625b924..6f874ffb 100644 --- a/build/ci.js +++ b/build/ci.js @@ -3,13 +3,17 @@ const ci = require('miniprogram-ci') const fs = require('fs') const packageJson = require('../package.json') -const privateKeyContent = process.env.WX_PRIVATE_KEY -if (!privateKeyContent) { - throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') -} - const privateKeyPath = path.resolve(__dirname, './key') -fs.writeFileSync(privateKeyPath, privateKeyContent) + +// 检查私钥文件是否已存在 +if (!fs.existsSync(privateKeyPath)) { + const privateKeyContent = process.env.WX_PRIVATE_KEY + if (!privateKeyContent) { + throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') + } + console.log('>>>>写入私钥文件:', privateKeyPath); + fs.writeFileSync(privateKeyPath, privateKeyContent) +} const project = new ci.Project({ appid: 'wx622bee4f78fa4f5a', From 77a1b14e1ac91238f13c6c04d40dbbe53cb92895 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:00:32 +0800 Subject: [PATCH 04/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f3db7a8..a405093f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,5 @@ jobs: env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | - mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key node ./build/ci.js --skip-key-write From 124a950edce57ae0b0676b7a3a75ccfd55073b15 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:08:51 +0800 Subject: [PATCH 05/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a405093f..0e3ba5a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,5 +12,5 @@ jobs: env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | + mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key - node ./build/ci.js --skip-key-write From 31cfd08b662259908a216386e5671cf1371f1145 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:12:32 +0800 Subject: [PATCH 06/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e3ba5a4..6f3db7a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,3 +14,4 @@ jobs: run: | mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key + node ./build/ci.js --skip-key-write From d7f93d30e8e2937e7f9a9cfa248fa99f7197c939 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:16:06 +0800 Subject: [PATCH 07/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f3db7a8..152a3263 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,24 @@ jobs: upload: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Verify file existence + run: | + echo "当前工作目录:" + pwd + echo "目录内容:" + ls -la + echo "build目录内容:" + ls -la ./build/ + - name: Upload MiniProgram env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key + chmod +x ./build/ci.js node ./build/ci.js --skip-key-write From 84ce4ba3637534ddfffef378b1f073a5e2abaff9 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:20:04 +0800 Subject: [PATCH 08/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 152a3263..3aae031f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,9 @@ jobs: echo "build目录内容:" ls -la ./build/ + - name: Install dependencies + run: npm install + - name: Upload MiniProgram env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} From 4f95eb419b7674d8442d2ead193e9f281f30b248 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:28:56 +0800 Subject: [PATCH 09/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3aae031f..d9717e22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,12 @@ jobs: ls -la echo "build目录内容:" ls -la ./build/ - + - name: Install dependencies run: npm install + + - name: Run package script + run: npm run init - name: Upload MiniProgram env: From 0c160169f4ef190b767cb227ea5d17bc6269f866 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:38:28 +0800 Subject: [PATCH 10/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++++ .gitmodules | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9717e22..00f90241 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: 'recursive' + token: ${{ secrets.GITHUB_TOKEN }} - name: Verify file existence run: | @@ -20,6 +22,8 @@ jobs: ls -la echo "build目录内容:" ls -la ./build/ + echo "子模块状态:" + git submodule status - name: Install dependencies run: npm install diff --git a/.gitmodules b/.gitmodules index 2f398a69..6ccb8b5f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "miniprogram/packageSkylineExamples"] path = miniprogram/packageSkylineExamples - url = git@github.com:wechat-miniprogram/awesome-skyline.git + url = https://github.com/wechat-miniprogram/awesome-skyline.git From 0e7738652f4fc080bfc5978cd5a3e408df583d8f Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:49:25 +0800 Subject: [PATCH 11/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00f90241..0a3281a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: - name: Install dependencies run: npm install + npm i --save miniprogram-recycle-view - name: Run package script run: npm run init From b553e83d29417bc7706d1bcf212898e34ccbeedf Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 16:56:03 +0800 Subject: [PATCH 12/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 - build/ci.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a3281a9..00f90241 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,6 @@ jobs: - name: Install dependencies run: npm install - npm i --save miniprogram-recycle-view - name: Run package script run: npm run init diff --git a/build/ci.js b/build/ci.js index 6f874ffb..fbd00f53 100644 --- a/build/ci.js +++ b/build/ci.js @@ -37,6 +37,7 @@ const params = { autoPrefixWXSS: true }, } +await ci.packNpm(project, {}) ci.upload({ project, ...params From 8887782501afff8456ab0d728a191481e0b44c61 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 17:00:08 +0800 Subject: [PATCH 13/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/ci.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/ci.js b/build/ci.js index fbd00f53..2759ac88 100644 --- a/build/ci.js +++ b/build/ci.js @@ -1,3 +1,4 @@ +'use strict'; const path = require('path') const ci = require('miniprogram-ci') const fs = require('fs') From 3a1c471775d0bc8c28bba269227d149aac94a830 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 17:04:28 +0800 Subject: [PATCH 14/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/ci.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/ci.js b/build/ci.js index 2759ac88..877c5d78 100644 --- a/build/ci.js +++ b/build/ci.js @@ -1,8 +1,7 @@ -'use strict'; -const path = require('path') -const ci = require('miniprogram-ci') -const fs = require('fs') -const packageJson = require('../package.json') +import path from 'path' +import fs from 'fs' +import ci from 'miniprogram-ci' +import packageJson from '../package.json' const privateKeyPath = path.resolve(__dirname, './key') From d6842d74670b4f41dac69d0ddfdacaab2cbff41f Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 17:10:28 +0800 Subject: [PATCH 15/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 3330ab8e..5268c025 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "miniprogram-demo", "version": "1.0.0", "description": "WeChat miniprogram demo", + "type": "module", "scripts": { "init": "npm run sync && cd cloudfunctions/ && npm i --production && cd ../miniprogram/ && npm i --production", "lint": "eslint .", From f92c7f29986e80cde680281f468075798cf768ad Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 17:13:11 +0800 Subject: [PATCH 16/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/ci.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ci.js b/build/ci.js index 877c5d78..cf1da033 100644 --- a/build/ci.js +++ b/build/ci.js @@ -1,7 +1,7 @@ import path from 'path' import fs from 'fs' import ci from 'miniprogram-ci' -import packageJson from '../package.json' +import packageJson from '../package.json' assert { type: 'json' } const privateKeyPath = path.resolve(__dirname, './key') From 3ecb5a612312a896ab222aee8f99ac5bf2db5fdd Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 17:21:44 +0800 Subject: [PATCH 17/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/ci.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/ci.js b/build/ci.js index cf1da033..73ae6cfe 100644 --- a/build/ci.js +++ b/build/ci.js @@ -1,8 +1,10 @@ import path from 'path' +import { fileURLToPath } from 'url' import fs from 'fs' import ci from 'miniprogram-ci' -import packageJson from '../package.json' assert { type: 'json' } - +import packageJson from '../package.json' with { type: 'json' } +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) const privateKeyPath = path.resolve(__dirname, './key') // 检查私钥文件是否已存在 From 288c8b03aec6baefb9e20a3beb0db0109863e068 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 13 May 2025 17:31:21 +0800 Subject: [PATCH 18/58] =?UTF-8?q?feat:=20=E6=B5=8B=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tdesign-miniprogram/image/README.en-US.md | 46 ---- .../tdesign-miniprogram/image/README.md | 91 ------- .../tdesign-miniprogram/image/image-info.json | 75 ------ .../tdesign-miniprogram/image/image.d.ts | 26 -- .../tdesign-miniprogram/image/image.js | 97 ------- .../tdesign-miniprogram/image/image.json | 8 - .../tdesign-miniprogram/image/image.wxml | 56 ---- .../tdesign-miniprogram/image/image.wxss | 71 ----- .../tdesign-miniprogram/image/index.d.ts | 4 - .../tdesign-miniprogram/image/index.js | 2 - .../tdesign-miniprogram/image/props.d.ts | 3 - .../tdesign-miniprogram/image/props.js | 45 ---- .../tdesign-miniprogram/image/type.d.ts | 46 ---- .../tdesign-miniprogram/image/type.js | 1 - .../loading/README.en-US.md | 39 --- .../tdesign-miniprogram/loading/README.md | 95 ------- .../tdesign-miniprogram/loading/index.d.ts | 3 - .../tdesign-miniprogram/loading/index.js | 3 - .../tdesign-miniprogram/loading/loading.d.ts | 77 ------ .../tdesign-miniprogram/loading/loading.js | 61 ----- .../tdesign-miniprogram/loading/loading.json | 5 - .../tdesign-miniprogram/loading/loading.wxml | 45 ---- .../tdesign-miniprogram/loading/loading.wxss | 219 ---------------- .../tdesign-miniprogram/loading/props.d.ts | 3 - .../tdesign-miniprogram/loading/props.js | 51 ---- .../tdesign-miniprogram/loading/type.d.ts | 54 ---- .../tdesign-miniprogram/loading/type.js | 1 - .../navbar/README.en-US.md | 56 ---- .../tdesign-miniprogram/navbar/README.md | 105 -------- .../tdesign-miniprogram/navbar/navbar.d.ts | 27 -- .../tdesign-miniprogram/navbar/navbar.js | 163 ------------ .../tdesign-miniprogram/navbar/navbar.json | 7 - .../tdesign-miniprogram/navbar/navbar.wxml | 22 -- .../tdesign-miniprogram/navbar/navbar.wxss | 134 ---------- .../tdesign-miniprogram/navbar/props.d.ts | 3 - .../tdesign-miniprogram/navbar/props.js | 29 --- .../tdesign-miniprogram/navbar/type.d.ts | 30 --- .../tdesign-miniprogram/navbar/type.js | 1 - .../search/README.en-US.md | 73 ------ .../tdesign-miniprogram/search/README.md | 122 --------- .../tdesign-miniprogram/search/props.d.ts | 3 - .../tdesign-miniprogram/search/props.js | 103 -------- .../tdesign-miniprogram/search/search.d.ts | 24 -- .../tdesign-miniprogram/search/search.js | 104 -------- .../tdesign-miniprogram/search/search.json | 8 - .../tdesign-miniprogram/search/search.wxml | 77 ------ .../tdesign-miniprogram/search/search.wxs | 6 - .../tdesign-miniprogram/search/search.wxss | 108 -------- .../tdesign-miniprogram/search/type.d.ts | 104 -------- .../tdesign-miniprogram/search/type.js | 1 - .../tdesign-miniprogram/tag/README.en-US.md | 100 ------- .../tdesign-miniprogram/tag/README.md | 148 ----------- .../tdesign-miniprogram/tag/props.d.ts | 3 - .../tdesign-miniprogram/tag/props.js | 36 --- .../tdesign-miniprogram/tag/tag.d.ts | 28 -- .../components/tdesign-miniprogram/tag/tag.js | 93 ------- .../tdesign-miniprogram/tag/tag.json | 7 - .../tdesign-miniprogram/tag/tag.wxml | 23 -- .../tdesign-miniprogram/tag/tag.wxss | 244 ------------------ .../tdesign-miniprogram/tag/type.d.ts | 38 --- .../tdesign-miniprogram/tag/type.js | 1 - .../tdesign-miniprogram/toast/README.en-US.md | 44 ---- .../tdesign-miniprogram/toast/README.md | 81 ------ .../tdesign-miniprogram/toast/index.d.ts | 22 -- .../tdesign-miniprogram/toast/index.js | 31 --- .../tdesign-miniprogram/toast/props.d.ts | 3 - .../tdesign-miniprogram/toast/props.js | 39 --- .../tdesign-miniprogram/toast/toast.d.ts | 31 --- .../tdesign-miniprogram/toast/toast.js | 91 ------- .../tdesign-miniprogram/toast/toast.json | 9 - .../tdesign-miniprogram/toast/toast.wxml | 38 --- .../tdesign-miniprogram/toast/toast.wxss | 98 ------- .../tdesign-miniprogram/toast/type.d.ts | 43 --- .../tdesign-miniprogram/toast/type.js | 1 - .../extend/recycle-view/recycle-view.json | 2 +- 75 files changed, 1 insertion(+), 3790 deletions(-) delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxss delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.en-US.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.md delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.js delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.json delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxml delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxss delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.d.ts delete mode 100644 miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.js diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md deleted file mode 100644 index 46e7da93..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md +++ /dev/null @@ -1,46 +0,0 @@ -:: BASE_DOC :: - -## API - -### Image Props - -name | type | default | description | required --- | -- | -- | -- | -- -style | Object | - | CSS(Cascading Style Sheets) | N -custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -error | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -height | String / Number | - | \- | N -lazy | Boolean | false | \- | N -loading | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -mode | String | scaleToFill | options: scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N -shape | String | square | options: circle/round/square | N -show-menu-by-longpress | Boolean | false | \- | N -src | String | - | src attribute of ``. image File can also be loaded | N -t-id | String | - | `1.2.10`。image tag id | N -webp | Boolean | false | \- | N -width | String / Number | - | \- | N - -### Image Events - -name | params | description --- | -- | -- -error | - | trigger on image load failed -load | - | trigger on image loaded -### Image External Classes - -className | Description --- | -- -t-class | \- -t-class-load | \- -t-class-image | \- -t-class-error | \- - -### CSS Variables - -The component provides the following CSS variables, which can be used to customize styles. -Name | Default Value | Description --- | -- | -- ---td-image-color | @font-gray-3 | - ---td-image-loading-bg-color | @bg-color-secondarycontainer | - ---td-image-loading-color | @font-gray-3 | - ---td-image-round-radius | @radius-default | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md deleted file mode 100644 index 55be345c..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Image 图片 -description: 用于展示效果,主要为上下左右居中裁切、拉伸、平铺等方式。 -spline: base -isComponent: true ---- - - - -## 引入 - -全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 - -```json -"usingComponents": { - "t-image": "tdesign-miniprogram/image/image" -} -``` - -## 代码演示 - - 在开发者工具中预览效果 - -
-

Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"

-
- -### 裁切样式 - -{{ base }} - -### 加载状态 - -{{ status }} - -## 常见问题 - -
- - 本地图片无法正确引用? - 👇 - -

- 建议使用绝对路径,而不是相对路径。绝对路径以 app.json 所在位置为基准。 -

-
- -## API - -### Image Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -style | Object | - | 样式 | N -custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -error | String / Slot | 'default' | 加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -height | String / Number | - | 高度,默认单位为`px` | N -lazy | Boolean | false | 是否开启图片懒加载 | N -loading | String / Slot | 'default' | 加载态内容。值为 `default` 则表示使用默认加载中风格;值为其他则表示普通文本内容,如“加载中”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -mode | String | scaleToFill | 图片裁剪、缩放的模式;[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)。可选项:scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N -shape | String | square | 图片圆角类型。可选项:circle/round/square | N -show-menu-by-longpress | Boolean | false | 长按图片显示发送给朋友、收藏、保存图片、搜一搜、打开名片/前往群聊/打开小程序(若图片中包含对应二维码或小程序码)的菜单。 | N -src | String | - | 图片链接 | N -t-id | String | - | `1.2.10`。图片标签id | N -webp | Boolean | false | 默认不解析 webP 格式,只支持网络资源 | N -width | String / Number | - | 宽度,默认单位为`px` | N - -### Image Events - -名称 | 参数 | 描述 --- | -- | -- -error | - | 图片加载失败时触发 -load | - | 图片加载完成时触发 -### Image External Classes - -类名 | 描述 --- | -- -t-class | 根节点样式类 -t-class-load | 加载样式类 -t-class-image | 图片样式类 -t-class-error | 加载失败样式类 - -### CSS Variables - -组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 --- | -- | -- ---td-image-color | @font-gray-3 | - ---td-image-loading-bg-color | @bg-color-secondarycontainer | - ---td-image-loading-color | @font-gray-3 | - ---td-image-round-radius | @radius-default | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json deleted file mode 100644 index 7157c4c7..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "key": "Image", - "label": "图片", - "icon": "", - "properties": [ - { - "key": "error", - "type": ["String", "TNode"], - "defaultValue": "'default'", - "desc": "加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”", - "label": "" - }, - { - "key": "externalClasses", - "type": ["Array"], - "defaultValue": "", - "desc": "组件类名,分别用于设置加载组件外层元素,中间内容等元素类名", - "label": "" - }, - { - "key": "lazy", - "type": ["Boolean"], - "defaultValue": "false", - "desc": "是否开启图片懒加载", - "label": "" - }, - { - "key": "loading", - "type": ["String", "TNode"], - "defaultValue": "'default'", - "desc": "加载态内容。值为 `default` 则表示使用默认加载中风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `loading`;值为其他则表示普通文本内容,如“加载中”", - "label": "" - }, - { - "key": "MP_EXCLUDE_PROPS", - "type": ["String"], - "defaultValue": "", - "desc": "为避免重复或冲突,需要过滤掉的小程序原生属性", - "label": "" - }, - { - "key": "MP_PROPS", - "type": ["String"], - "defaultValue": "", - "desc": "[小程序原生属性](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)", - "label": "" - }, - { - "key": "shape", - "type": ["String"], - "defaultValue": "square", - "desc": "图片圆角类型", - "label": "" - }, - { - "key": "src", - "type": ["String"], - "defaultValue": "", - "desc": "图片链接", - "label": "" - } - ], - "events": [ - { - "key": "error", - "desc": "图片加载失败时触发", - "label": "" - }, - { - "key": "load", - "desc": "图片加载完成时触发", - "label": "" - } - ] -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts deleted file mode 100644 index 80f4bf2a..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { SuperComponent } from '../common/src/index'; -export default class Image extends SuperComponent { - externalClasses: string[]; - options: { - multipleSlots: boolean; - }; - properties: import("./type").TdImageProps; - data: { - prefix: string; - isLoading: boolean; - isFailed: boolean; - innerStyle: string; - classPrefix: string; - }; - preSrc: string; - observers: { - src(): void; - 'width, height'(width: any, height: any): void; - }; - methods: { - onLoaded(e: any): void; - onLoadError(e: any): void; - calcSize(width: any, height: any): void; - update(): void; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js deleted file mode 100644 index 0cc93cac..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js +++ /dev/null @@ -1,97 +0,0 @@ -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 ImageProps from './props'; -import config from '../common/config'; -import { addUnit, getRect, appBaseInfo } from '../common/utils'; -import { compareVersion } from '../common/version'; -const { prefix } = config; -const name = `${prefix}-image`; -let Image = class Image extends SuperComponent { - constructor() { - super(...arguments); - this.externalClasses = [`${prefix}-class`, `${prefix}-class-load`, `${prefix}-class-image`, `${prefix}-class-error`]; - this.options = { - multipleSlots: true, - }; - this.properties = ImageProps; - this.data = { - prefix, - isLoading: true, - isFailed: false, - innerStyle: '', - classPrefix: name, - }; - this.preSrc = ''; - this.observers = { - src() { - if (this.preSrc === this.properties.src) - return; - this.update(); - }, - 'width, height'(width, height) { - this.calcSize(width, height); - }, - }; - this.methods = { - onLoaded(e) { - const sdkVersion = appBaseInfo.SDKVersion; - const { mode, tId } = this.properties; - const isInCompatible = compareVersion(sdkVersion, '2.10.3') < 0; - if (mode === 'heightFix' && isInCompatible) { - const { height: picHeight, width: picWidth } = e.detail; - getRect(this, `#${tId || 'image'}`).then((rect) => { - const { height } = rect; - const resultWidth = ((height / picHeight) * picWidth).toFixed(2); - this.setData({ innerStyle: `height: ${addUnit(height)}; width: ${resultWidth}px;` }); - }); - } - this.setData({ - isLoading: false, - isFailed: false, - }); - this.triggerEvent('load', e.detail); - }, - onLoadError(e) { - this.setData({ - isLoading: false, - isFailed: true, - }); - this.triggerEvent('error', e.detail); - }, - calcSize(width, height) { - let innerStyle = ''; - if (width) { - innerStyle += `width: ${addUnit(width)};`; - } - if (height) { - innerStyle += `height: ${addUnit(height)};`; - } - this.setData({ - innerStyle, - }); - }, - update() { - const { src } = this.properties; - this.preSrc = src; - if (!src) { - this.onLoadError({ errMsg: '图片链接为空' }); - } - else { - this.setData({ - isLoading: true, - isFailed: false, - }); - } - }, - }; - } -}; -Image = __decorate([ - wxComponent() -], Image); -export default Image; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json deleted file mode 100644 index 1c9137b6..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "styleIsolation": "apply-shared", - "usingComponents": { - "t-loading": "../loading/loading", - "t-icon": "../icon/icon" - } -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml deleted file mode 100644 index be3b8506..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - {{loading}} - - - - - - - - - - {{error}} - - - - - - diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss deleted file mode 100644 index 7d550a0f..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss +++ /dev/null @@ -1,71 +0,0 @@ -.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-image { - position: relative; - display: inline-block; -} -.t-image__mask, -.t-image__img { - color: var(--td-image-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); - vertical-align: top; - width: inherit; - height: inherit; -} -.t-image__mask { - display: flex; - align-items: center; - justify-content: center; - background-color: var(--td-image-loading-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3))); - color: var(--td-image-loading-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); -} -.t-image--loading-text { - width: 0; - height: 0; -} -.t-image__common { - width: 100%; - height: 100%; -} -.t-image--lazy { - position: absolute; - top: 0; - left: 0; - z-index: -1; -} -.t-image--shape-circle { - border-radius: 50%; - overflow: hidden; -} -.t-image--shape-round { - border-radius: var(--td-image-round-radius, var(--td-radius-default, 12rpx)); - overflow: hidden; -} -.t-image--shape-square { - border-radius: 0; - overflow: hidden; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts deleted file mode 100644 index 0f85c43d..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { TdImageProps } from './type'; -export declare type ImageProps = TdImageProps; -export * from './props'; -export * from './image'; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js deleted file mode 100644 index 4fd39538..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './props'; -export * from './image'; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts deleted file mode 100644 index 0ab571bb..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TdImageProps } from './type'; -declare const props: TdImageProps; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js deleted file mode 100644 index b2a17dac..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js +++ /dev/null @@ -1,45 +0,0 @@ -const props = { - error: { - type: String, - value: 'default', - }, - height: { - type: null, - }, - lazy: { - type: Boolean, - value: false, - }, - loading: { - type: String, - value: 'default', - }, - mode: { - type: String, - value: 'scaleToFill', - }, - shape: { - type: String, - value: 'square', - }, - showMenuByLongpress: { - type: Boolean, - value: false, - }, - src: { - type: String, - value: '', - }, - tId: { - type: String, - value: '', - }, - webp: { - type: Boolean, - value: false, - }, - width: { - type: null, - }, -}; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts deleted file mode 100644 index 4279319d..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -export interface TdImageProps { - error?: { - type: StringConstructor; - value?: string; - }; - height?: { - type: null; - value?: string | number; - }; - lazy?: { - type: BooleanConstructor; - value?: boolean; - }; - loading?: { - type: StringConstructor; - value?: string; - }; - mode?: { - type: StringConstructor; - value?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right'; - }; - shape?: { - type: StringConstructor; - value?: 'circle' | 'round' | 'square'; - }; - showMenuByLongpress?: { - type: BooleanConstructor; - value?: boolean; - }; - src?: { - type: StringConstructor; - value?: string; - }; - tId?: { - type: StringConstructor; - value?: string; - }; - webp?: { - type: BooleanConstructor; - value?: boolean; - }; - width?: { - type: null; - value?: string | number; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js deleted file mode 100644 index cb0ff5c3..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md deleted file mode 100644 index ac1e999f..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md +++ /dev/null @@ -1,39 +0,0 @@ -:: BASE_DOC :: - -## API - -### Loading Props - -name | type | default | description | required --- | -- | -- | -- | -- -style | Object | - | CSS(Cascading Style Sheets) | N -custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -delay | Number | 0 | \- | N -duration | Number | 800 | \- | N -indicator | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -inherit-color | Boolean | false | \- | N -layout | String | horizontal | options: horizontal/vertical | N -loading | Boolean | true | \- | N -pause | Boolean | false | \- | N -progress | Number | - | \- | N -reverse | Boolean | - | \- | N -size | String | '40rpx' | \- | N -text | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -theme | String | circular | options: circular/spinner/dots | N -### Loading External Classes - -className | Description --- | -- -t-class | \- -t-class-indicator | \- -t-class-text | \- - -### CSS Variables - -The component provides the following CSS variables, which can be used to customize styles. -Name | Default Value | Description --- | -- | -- ---td-loading-color | @brand-color | - ---td-loading-text-color | inherit | - ---td-loading-text-font-size | 24rpx | - ---td-loading-text-line-height | 40rpx | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md deleted file mode 100644 index 50dad476..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Loading 加载 -description: 用于表示页面或操作的加载状态,给予用户反馈的同时减缓等待的焦虑感,由一个或一组反馈动效组成。 -spline: message -isComponent: true ---- - - -## 引入 - -全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 - -```json -"usingComponents": { - "t-loading": "tdesign-miniprogram/loading/loading" -} -``` - -## 代码演示 - - 在开发者工具中预览效果 - -
-

Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"

-
- -### 纯icon - -{{ base }} - -### icon加文字横向 - -{{ horizontal }} - -### icon加文字竖向 - -{{ vertical }} - -### 纯文字 - -{{ text }} - -### 加载失败 - -{{ error }} - -### 状态 - -{{ status }} - -### 加载速度 - -{{ duration }} - -### 规格 - -{{ size }} - -## API - -### Loading Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -style | Object | - | 样式 | N -custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -delay | Number | 0 | 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 | N -duration | Number | 800 | 加载动画执行完成一次的时间,单位:毫秒 | N -indicator | Boolean / Slot | true | 加载指示符,值为 true 显示默认指示符,值为 false 则不显示,也可以自定义指示符。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -inherit-color | Boolean | false | 是否继承父元素颜色 | N -layout | String | horizontal | 对齐方式。可选项:horizontal/vertical | N -loading | Boolean | true | 是否处于加载状态 | N -pause | Boolean | false | 是否暂停动画 | N -progress | Number | - | 加载进度 | N -reverse | Boolean | - | 加载动画是否反向 | N -size | String | '40rpx' | 尺寸,示例:40rpx/20px | N -text | String / Slot | - | 加载提示文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -theme | String | circular | 加载组件类型。可选项:circular/spinner/dots,skyline 模式下暂不支持枚举值 circular | N -### Loading External Classes - -类名 | 描述 --- | -- -t-class | 根节点样式类 -t-class-indicator | 指示符样式类 -t-class-text | 文本样式类 - -### CSS Variables - -组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 --- | -- | -- ---td-loading-color | @brand-color | - ---td-loading-text-color | inherit | - ---td-loading-text-font-size | 24rpx | - ---td-loading-text-line-height | 40rpx | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts deleted file mode 100644 index 2806bd66..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './props'; -export * from './type'; -export * from './loading'; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js deleted file mode 100644 index 2806bd66..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from './props'; -export * from './type'; -export * from './loading'; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts deleted file mode 100644 index 55dd01b7..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { SuperComponent } from '../common/src/index'; -import type { TdLoadingProps } from './type'; -export interface LoadingProps extends TdLoadingProps { -} -export default class Loading extends SuperComponent { - externalClasses: string[]; - data: { - prefix: string; - classPrefix: string; - show: boolean; - }; - options: { - multipleSlots: boolean; - }; - properties: { - delay?: { - type: NumberConstructor; - value?: number; - }; - duration?: { - type: NumberConstructor; - value?: number; - }; - externalClasses?: { - type: ArrayConstructor; - value?: ["t-class", "t-class-text", "t-class-indicator"]; - }; - indicator?: { - type: BooleanConstructor; - value?: boolean; - }; - inheritColor?: { - type: BooleanConstructor; - value?: boolean; - }; - layout?: { - type: StringConstructor; - value?: "horizontal" | "vertical"; - }; - loading?: { - type: BooleanConstructor; - value?: boolean; - }; - pause?: { - type: BooleanConstructor; - value?: boolean; - }; - progress?: { - type: NumberConstructor; - value?: number; - }; - reverse?: { - type: BooleanConstructor; - value?: boolean; - }; - size?: { - type: StringConstructor; - value?: string; - }; - text?: { - type: StringConstructor; - value?: string; - }; - theme?: { - type: StringConstructor; - value?: "circular" | "spinner" | "dots"; - }; - }; - timer: any; - observers: { - loading(this: any, cur: any): void; - }; - lifetimes: { - detached(): void; - }; - refreshPage(): void; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js deleted file mode 100644 index f59a423d..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js +++ /dev/null @@ -1,61 +0,0 @@ -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}-loading`; -let Loading = class Loading extends SuperComponent { - constructor() { - super(...arguments); - this.externalClasses = [`${prefix}-class`, `${prefix}-class-text`, `${prefix}-class-indicator`]; - this.data = { - prefix, - classPrefix: name, - show: true, - }; - this.options = { - multipleSlots: true, - }; - this.properties = Object.assign({}, props); - this.timer = null; - this.observers = { - loading(cur) { - const { delay } = this.properties; - if (this.timer) { - clearTimeout(this.timer); - } - if (cur) { - if (delay) { - this.timer = setTimeout(() => { - this.setData({ show: cur }); - this.timer = null; - }, delay); - } - else { - this.setData({ show: cur }); - } - } - else { - this.setData({ show: cur }); - } - }, - }; - this.lifetimes = { - detached() { - clearTimeout(this.timer); - }, - }; - } - refreshPage() { - this.triggerEvent('reload'); - } -}; -Loading = __decorate([ - wxComponent() -], Loading); -export default Loading; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json deleted file mode 100644 index 4f0a3f08..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "component": true, - "styleIsolation": "apply-shared", - "usingComponents": {} -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml deleted file mode 100644 index 094ebf1a..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - {{text}} - - - - diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss deleted file mode 100644 index c1a40bc0..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss +++ /dev/null @@ -1,219 +0,0 @@ -.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-loading { - display: inline-flex; - align-items: center; - justify-content: center; - font-size: 24rpx; -} -.t-loading__spinner { - position: relative; - box-sizing: border-box; - width: 100%; - height: 100%; - max-width: 100%; - max-height: 100%; - animation: rotate 0.8s linear infinite; - color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); -} -.t-loading__spinner.reverse { - animation-name: rotateReverse; -} -.t-loading__spinner--spinner { - animation-timing-function: steps(12); - color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))); -} -.t-loading__spinner--spinner .t-loading__dot { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.t-loading__spinner--spinner .t-loading__dot::before { - display: block; - width: 5rpx; - height: 25%; - margin: 0 auto; - background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); - border-radius: 40%; - content: ' '; -} -.t-loading__spinner--circular .t-loading__circular { - border-radius: 100%; - width: 100%; - height: 100%; - background: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0) 60deg, currentColor 330deg, rgba(255, 255, 255, 0) 360deg); - mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%); - /* stylelint-disable-next-line */ - -webkit-mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%); -} -.t-loading__spinner--dots { - display: flex; - justify-content: space-between; - align-items: center; - animation: none; -} -.t-loading__spinner--dots .t-loading__dot { - width: 20%; - height: 20%; - border-radius: 50%; - background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); - animation-duration: 1.8s; - animation-name: dotting; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-fill-mode: both; -} -.t-loading__text { - color: var(--td-loading-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - font-size: var(--td-loading-text-font-size, 24rpx); - line-height: var(--td-loading-text-line-height, 40rpx); -} -.t-loading__text--vertical:not(:first-child):not(:empty) { - margin-top: 12rpx; -} -.t-loading__text--horizontal:not(:first-child):not(:empty) { - margin-left: 16rpx; -} -.t-loading--vertical { - flex-direction: column; -} -.t-loading--horizontal { - flex-direction: row; - vertical-align: top; -} -@keyframes t-bar { - 0% { - width: 0; - } - 50% { - width: 70%; - } - 100% { - width: 80%; - } -} -@keyframes t-bar-loaded { - 0% { - height: 6rpx; - opacity: 1; - width: 90%; - } - 50% { - height: 6rpx; - opacity: 1; - width: 100%; - } - 100% { - height: 0; - opacity: 0; - width: 100%; - } -} -.t-loading__dot-1 { - transform: rotate(30deg); - opacity: 0; -} -.t-loading__dot-2 { - transform: rotate(60deg); - opacity: 0.08333333; -} -.t-loading__dot-3 { - transform: rotate(90deg); - opacity: 0.16666667; -} -.t-loading__dot-4 { - transform: rotate(120deg); - opacity: 0.25; -} -.t-loading__dot-5 { - transform: rotate(150deg); - opacity: 0.33333333; -} -.t-loading__dot-6 { - transform: rotate(180deg); - opacity: 0.41666667; -} -.t-loading__dot-7 { - transform: rotate(210deg); - opacity: 0.5; -} -.t-loading__dot-8 { - transform: rotate(240deg); - opacity: 0.58333333; -} -.t-loading__dot-9 { - transform: rotate(270deg); - opacity: 0.66666667; -} -.t-loading__dot-10 { - transform: rotate(300deg); - opacity: 0.75; -} -.t-loading__dot-11 { - transform: rotate(330deg); - opacity: 0.83333333; -} -.t-loading__dot-12 { - transform: rotate(360deg); - opacity: 0.91666667; -} -@keyframes rotate { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} -@keyframes rotateReverse { - from { - transform: rotate(360deg); - } - to { - transform: rotate(0deg); - } -} -@keyframes dotting { - 0% { - opacity: 0.15; - } - 1% { - opacity: 0.8; - } - 33% { - opacity: 0.8; - } - 34% { - opacity: 0.15; - } - 100% { - opacity: 0.15; - } -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts deleted file mode 100644 index a05a6598..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TdLoadingProps } from './type'; -declare const props: TdLoadingProps; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js deleted file mode 100644 index d86ae7a4..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js +++ /dev/null @@ -1,51 +0,0 @@ -const props = { - delay: { - type: Number, - value: 0, - }, - duration: { - type: Number, - value: 800, - }, - externalClasses: { - type: Array, - }, - indicator: { - type: Boolean, - value: true, - }, - inheritColor: { - type: Boolean, - value: false, - }, - layout: { - type: String, - value: 'horizontal', - }, - loading: { - type: Boolean, - value: true, - }, - pause: { - type: Boolean, - value: false, - }, - progress: { - type: Number, - }, - reverse: { - type: Boolean, - }, - size: { - type: String, - value: '40rpx', - }, - text: { - type: String, - }, - theme: { - type: String, - value: 'circular', - }, -}; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts deleted file mode 100644 index 3e319a42..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export interface TdLoadingProps { - delay?: { - type: NumberConstructor; - value?: number; - }; - duration?: { - type: NumberConstructor; - value?: number; - }; - externalClasses?: { - type: ArrayConstructor; - value?: ['t-class', 't-class-text', 't-class-indicator']; - }; - indicator?: { - type: BooleanConstructor; - value?: boolean; - }; - inheritColor?: { - type: BooleanConstructor; - value?: boolean; - }; - layout?: { - type: StringConstructor; - value?: 'horizontal' | 'vertical'; - }; - loading?: { - type: BooleanConstructor; - value?: boolean; - }; - pause?: { - type: BooleanConstructor; - value?: boolean; - }; - progress?: { - type: NumberConstructor; - value?: number; - }; - reverse?: { - type: BooleanConstructor; - value?: boolean; - }; - size?: { - type: StringConstructor; - value?: string; - }; - text?: { - type: StringConstructor; - value?: string; - }; - theme?: { - type: StringConstructor; - value?: 'circular' | 'spinner' | 'dots'; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js deleted file mode 100644 index cb0ff5c3..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md deleted file mode 100644 index 500cdbbb..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md +++ /dev/null @@ -1,56 +0,0 @@ -:: BASE_DOC :: - -## API - -### Navbar Props - -name | type | default | description | required --- | -- | -- | -- | -- -style | Object | - | CSS(Cascading Style Sheets) | N -custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -animation | Boolean | true | \- | N -capsule | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -delta | Number | 1 | \- | N -fixed | Boolean | true | \- | N -left | Slot | - | `0.26.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -left-arrow | Boolean | false | `0.26.0` | N -title | String / Slot | - | page title。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -title-max-length | Number | - | \- | N -visible | Boolean | true | \- | N - -### Navbar Events - -name | params | description --- | -- | -- -complete | \- | \- -fail | \- | \- -go-back | \- | \- -success | \- | \- -### Navbar External Classes - -className | Description --- | -- -t-class | \- -t-class-capsule | \- -t-class-center | \- -t-class-home-icon | \- -t-class-left | \- -t-class-left-icon | \- -t-class-nav-btn | \- -t-class-title | \- - -### CSS Variables - -The component provides the following CSS variables, which can be used to customize styles. -Name | Default Value | Description --- | -- | -- ---td-navbar-bg-color | @bg-color-container | - ---td-navbar-capsule-border-color | #e3e6ea | - ---td-navbar-capsule-border-radius | 32rpx | - ---td-navbar-capsule-height | 64rpx | - ---td-navbar-capsule-width | 176rpx | - ---td-navbar-color | @font-gray-1 | - ---td-navbar-height | 96rpx | - ---td-navbar-left-arrow-size | 48rpx | - ---td-navbar-title-font-size | 36rpx | - ---td-navbar-title-font-weight | 600 | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md deleted file mode 100644 index ccfad352..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Navbar 导航栏 -description: 用于不同页面之间切换或者跳转,位于内容区的上方,系统状态栏的下方。 -spline: navigation -isComponent: true ---- - - -## 引入 - -全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 - -```json -"usingComponents": { - "t-navbar": "tdesign-miniprogram/navbar/navbar", -} -``` - -## 代码演示 - - 在开发者工具中预览效果 - -
-

Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"

-
- - -### 基础导航栏 - -{{ base }} - -### 胶囊样式导航栏 - -{{ back-home }} - -### 带搜索导航栏 - -{{ search }} - -### 带图片导航栏 - -{{ img }} - -### 组件样式 - -{{ left-title }} - -### 自定义颜色 - -{{ custom-color }} - -## API - -### Navbar Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -style | Object | - | 样式 | N -custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -animation | Boolean | true | 是否添加动画效果 | N -capsule | Slot | - | 左侧胶囊区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -delta | Number | 1 | 后退按钮后退层数,含义参考 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html),特殊的,传入 0 不会发生执行 wx.navigateBack | N -fixed | Boolean | true | 是否固定在顶部 | N -left | Slot | - | `0.26.0`。左侧内容区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -left-arrow | Boolean | false | `0.26.0`。是否展示左侧箭头 | N -title | String / Slot | - | 页面标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -title-max-length | Number | - | 标题文字最大长度,超出的范围使用 `...` 表示 | N -visible | Boolean | true | 是否显示 | N - -### Navbar Events - -名称 | 参数 | 描述 --- | -- | -- -complete | \- | navigateBack 执行完成后触发(失败或成功均会触发) -fail | \- | navigateBack 执行失败后触发 -go-back | \- | 点击左侧箭头时触发 -success | \- | navigateBack 执行成功后触发 -### Navbar External Classes - -类名 | 描述 --- | -- -t-class | 根节点样式类 -t-class-capsule | 左侧胶囊区域样式类 -t-class-center | 中间内容样式类 -t-class-home-icon | 首页图标样式类 -t-class-left | 左侧内容样式类 -t-class-left-icon | 左侧图标样式类 -t-class-nav-btn | 导航按钮样式类 -t-class-title | 标题样式类 - -### CSS Variables - -组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 --- | -- | -- ---td-navbar-bg-color | @bg-color-container | - ---td-navbar-capsule-border-color | #e3e6ea | - ---td-navbar-capsule-border-radius | 32rpx | - ---td-navbar-capsule-height | 64rpx | - ---td-navbar-capsule-width | 176rpx | - ---td-navbar-color | @font-gray-1 | - ---td-navbar-height | 96rpx | - ---td-navbar-left-arrow-size | 48rpx | - ---td-navbar-title-font-size | 36rpx | - ---td-navbar-title-font-weight | 600 | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts deleted file mode 100644 index 45e2d20c..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { SuperComponent } from '../common/src/index'; -export default class Navbar extends SuperComponent { - externalClasses: string[]; - timer: any; - options: { - multipleSlots: boolean; - }; - properties: import("./type").TdNavbarProps; - observers: { - visible(this: Navbar, visible: any): void; - 'title,titleMaxLength'(this: any): void; - }; - data: { - prefix: string; - classPrefix: string; - boxStyle: string; - showTitle: string; - hideLeft: boolean; - hideCenter: boolean; - }; - attached(): Promise; - detached(): void; - methods: { - queryElements(capsuleRect: any): void; - goBack(): void; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js deleted file mode 100644 index 32a7cd80..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js +++ /dev/null @@ -1,163 +0,0 @@ -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; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -import { SuperComponent, wxComponent } from '../common/src/index'; -import { getRect, systemInfo } from '../common/utils'; -import config from '../common/config'; -import props from './props'; -const { prefix } = config; -const name = `${prefix}-navbar`; -let Navbar = class Navbar extends SuperComponent { - constructor() { - super(...arguments); - this.externalClasses = [ - `${prefix}-class`, - `${prefix}-class-placeholder`, - `${prefix}-class-content`, - `${prefix}-class-title`, - `${prefix}-class-left`, - `${prefix}-class-center`, - `${prefix}-class-left-icon`, - `${prefix}-class-home-icon`, - `${prefix}-class-capsule`, - `${prefix}-class-nav-btn`, - ]; - this.timer = null; - this.options = { - multipleSlots: true, - }; - this.properties = props; - this.observers = { - visible(visible) { - const { animation } = this.properties; - const visibleClass = `${name}${visible ? '--visible' : '--hide'}`; - this.setData({ - visibleClass: `${visibleClass}${animation ? '-animation' : ''}`, - }); - if (this.timer) { - clearTimeout(this.timer); - } - if (animation) { - this.timer = setTimeout(() => { - this.setData({ - visibleClass, - }); - }, 300); - } - }, - 'title,titleMaxLength'() { - const { title } = this.properties; - const titleMaxLength = this.properties.titleMaxLength || Number.MAX_SAFE_INTEGER; - let temp = title.slice(0, titleMaxLength); - if (titleMaxLength < title.length) - temp += '...'; - this.setData({ - showTitle: temp, - }); - }, - }; - this.data = { - prefix, - classPrefix: name, - boxStyle: '', - showTitle: '', - hideLeft: false, - hideCenter: false, - }; - this.methods = { - queryElements(capsuleRect) { - Promise.all([ - getRect(this, `.${this.data.classPrefix}__left`), - getRect(this, `.${this.data.classPrefix}__center`), - ]).then(([leftRect, centerRect]) => { - if (leftRect.right > capsuleRect.left) { - this.setData({ - hideLeft: true, - hideCenter: true, - }); - } - else if (centerRect.right > capsuleRect.left) { - this.setData({ - hideLeft: false, - hideCenter: true, - }); - } - else { - this.setData({ - hideLeft: false, - hideCenter: false, - }); - } - }); - }, - goBack() { - const { delta } = this.data; - const that = this; - this.triggerEvent('go-back'); - if (delta > 0) { - wx.navigateBack({ - delta, - fail(e) { - that.triggerEvent('fail', e); - }, - complete(e) { - that.triggerEvent('complete', e); - }, - success(e) { - that.triggerEvent('success', e); - }, - }); - } - }, - }; - } - attached() { - return __awaiter(this, void 0, void 0, function* () { - let rect = null; - if (wx.getMenuButtonBoundingClientRect) { - rect = wx.getMenuButtonBoundingClientRect(); - } - if (!rect || !systemInfo) - return; - const { right } = yield getRect(this, `.${name}__left`); - const boxStyleList = []; - boxStyleList.push(`--td-navbar-padding-top: ${systemInfo.statusBarHeight}px`); - if (rect && (systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.windowWidth)) { - const maxSpacing = Math.max(right, systemInfo.windowWidth - rect.left); - boxStyleList.push(`--td-navbar-center-left: ${maxSpacing}px`); - boxStyleList.push(`--td-navbar-center-width: ${rect.left - maxSpacing}px`); - boxStyleList.push(`--td-navbar-right: ${systemInfo.windowWidth - rect.left}px`); - } - boxStyleList.push(`--td-navbar-capsule-height: ${rect.height}px`); - boxStyleList.push(`--td-navbar-capsule-width: ${rect.width}px`); - boxStyleList.push(`--td-navbar-height: ${(rect.top - systemInfo.statusBarHeight) * 2 + rect.height}px`); - this.setData({ - boxStyle: `${boxStyleList.join('; ')}`, - }); - if (wx.onMenuButtonBoundingClientRectWeightChange) { - wx.onMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res)); - } - }); - } - detached() { - if (wx.offMenuButtonBoundingClientRectWeightChange) { - wx.offMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res)); - } - } -}; -Navbar = __decorate([ - wxComponent() -], Navbar); -export default Navbar; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json deleted file mode 100644 index f783dae7..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "styleIsolation": "apply-shared", - "usingComponents": { - "t-icon": "../icon/icon" - } -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml deleted file mode 100644 index 3ed1f16c..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - {{showTitle}} - - - diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss deleted file mode 100644 index 556e75f7..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss +++ /dev/null @@ -1,134 +0,0 @@ -.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-navbar--fixed .t-navbar__content { - position: fixed; - top: 0; - left: 0; - z-index: 5001; -} -.t-navbar--visible { - display: ''; -} -.t-navbar--visible-animation { - opacity: 1; - transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); -} -.t-navbar--hide-animation { - opacity: 0; - transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); -} -.t-navbar--hide { - display: none; -} -.t-navbar__placeholder { - height: var(--td-navbar-height, 48px); - padding-top: var(--td-navbar-padding-top, 20px); - position: relative; - visibility: hidden; - box-sizing: content-box; -} -.t-navbar__content { - position: relative; - z-index: 1; - height: var(--td-navbar-height, 48px); - width: calc(100% - var(--td-navbar-right, 95px)); - padding-right: var(--td-navbar-right, 95px); - padding-top: var(--td-navbar-padding-top, 20px); - color: var(--td-navbar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - background-color: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); - display: flex; - align-items: center; - box-sizing: content-box; -} -.t-navbar__left { - position: relative; - box-sizing: border-box; - display: flex; - align-items: center; - margin-left: var(--td-spacer-1, 24rpx); - transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); -} -.t-navbar__left-arrow { - font-size: var(--td-navbar-left-arrow-size, 24px); -} -.t-navbar__left--hide { - opacity: 0; -} -.t-navbar__capsule { - box-sizing: border-box; - width: var(--td-navbar-capsule-width, 88px); - height: var(--td-navbar-capsule-height, 32px); - display: flex; - align-items: center; -} -.t-navbar__capsule::before { - content: ''; - position: absolute; - z-index: -1; - top: 0; - left: 0; - width: 200%; - height: 200%; - transform: scale(0.5); - transform-origin: 0 0; - box-sizing: border-box; - border-radius: calc(var(--td-navbar-capsule-border-radius, 16px) * 2); - border: 2rpx solid var(--td-navbar-capsule-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7))); -} -.t-navbar__capsule:empty { - display: none; -} -.t-navbar__center { - font-size: 18px; - text-align: center; - position: absolute; - bottom: 0; - left: var(--td-navbar-center-left, var(--td-navbar-right, 95px)); - width: var(--td-navbar-center-width); - height: var(--td-navbar-height, 48px); - line-height: var(--td-navbar-height, 48px); - flex: 1; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; - transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); -} -.t-navbar__center:empty { - display: none; -} -.t-navbar__center-title { - font-size: var(--td-navbar-title-font-size, 18px); - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - font-weight: var(--td-navbar-title-font-weight, 600); -} -.t-navbar__center--hide { - opacity: 0; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts deleted file mode 100644 index 168bee24..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TdNavbarProps } from './type'; -declare const props: TdNavbarProps; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js deleted file mode 100644 index 3906316e..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js +++ /dev/null @@ -1,29 +0,0 @@ -const props = { - animation: { - type: Boolean, - value: true, - }, - delta: { - type: Number, - value: 1, - }, - fixed: { - type: Boolean, - value: true, - }, - leftArrow: { - type: Boolean, - value: false, - }, - title: { - type: String, - }, - titleMaxLength: { - type: Number, - }, - visible: { - type: Boolean, - value: true, - }, -}; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts deleted file mode 100644 index 11a4e772..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export interface TdNavbarProps { - animation?: { - type: BooleanConstructor; - value?: boolean; - }; - delta?: { - type: NumberConstructor; - value?: number; - }; - fixed?: { - type: BooleanConstructor; - value?: boolean; - }; - leftArrow?: { - type: BooleanConstructor; - value?: boolean; - }; - title?: { - type: StringConstructor; - value?: string; - }; - titleMaxLength?: { - type: NumberConstructor; - value?: number; - }; - visible?: { - type: BooleanConstructor; - value?: boolean; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js deleted file mode 100644 index cb0ff5c3..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md deleted file mode 100644 index 26d0ba14..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md +++ /dev/null @@ -1,73 +0,0 @@ - -## API - -### Search Props - -name | type | default | description | required --- | -- | -- | -- | -- -style | Object | - | CSS(Cascading Style Sheets) | N -custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -action | String / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -adjust-position | Boolean | true | \- | N -always-embed | Boolean | false | \- | N -center | Boolean | false | \- | N -clearable | Boolean | true | \- | N -confirm-hold | Boolean | false | \- | N -confirm-type | String | search | options: send/search/next/go/done | N -cursor | Number | - | required | Y -cursor-spacing | Number | 0 | \- | N -disabled | Boolean | false | \- | N -focus | Boolean | false | \- | N -hold-keyboard | Boolean | false | \- | N -label | String | '' | `deprecated` | N -left-icon | String / Slot | 'search' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -maxcharacter | Number | - | \- | N -maxlength | Number | -1 | \- | N -placeholder | String | '' | \- | N -placeholder-class | String | input-placeholder | \- | N -placeholder-style | String | - | required | Y -result-list | Array | [] | Typescript:`Array` | N -right-icon | String / Slot | 'close-circle-filled' | `deprecated`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -selection-end | Number | -1 | \- | N -selection-start | Number | -1 | \- | N -shape | String | 'square' | options: square/round | N -type | String | 'text' | options: text/number/idcard/digit/nickname | N -value | String | '' | \- | N - -### Search Events - -name | params | description --- | -- | -- -action-click | `({})` | \- -blur | `({ value: string })` | \- -change | `({ value: string })` | \- -clear | `({ value: string })` | \- -focus | `({ value: string })` | \- -submit | `({ value: string })` | \- -### Search External Classes - -className | Description --- | -- -t-class | \- -t-class-action | \- -t-class-clear | \- -t-class-input | \- -t-class-input-container | \- -t-class-left | \- - -### CSS Variables - -The component provides the following CSS variables, which can be used to customize styles. -Name | Default Value | Description --- | -- | -- ---td-search-action-color | @brand-color | - ---td-search-bg-color | @bg-color-secondarycontainer | - ---td-search-clear-icon-color | @font-gray-3 | - ---td-search-font-size | @font-size-m | - ---td-search-height | 80rpx | - ---td-search-icon-color | @font-gray-3 | - ---td-search-label-color | @font-gray-1 | - ---td-search-padding | 16rpx 24rpx | - ---td-search-placeholder-color | @font-gray-3 | - ---td-search-square-radius | @radius-default | - ---td-search-text-color | @font-gray-1 | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md deleted file mode 100644 index 13a8a12a..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Search 搜索框 -description: 用于用户输入搜索信息,并进行页面内容搜索。 -spline: form -isComponent: true ---- - - - -## 引入 - -全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 - -```json -"usingComponents": { - "t-search": "tdesign-miniprogram/search/search" -} -``` - -## 代码演示 - - 在开发者工具中预览效果 - -
-

Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"

-
- -### 01 组件类型 - -基础搜索框 - -{{ base }} - -获取焦点后显示取消按钮 - -{{ action }} - -### 02 组件样式 - -搜索框形状 - -{{ shape }} - -### 03 组件状态 - -默认状态其他对齐方式 - -{{ other }} - -## API - -### Search Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -style | Object | - | 样式 | N -custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -action | String / Slot | '' | 自定义右侧操作按钮文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N -always-embed | Boolean | false | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) | N -center | Boolean | false | 是否居中 | N -clearable | Boolean | true | 是否启用清除控件 | N -confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N -confirm-type | String | search | 设置键盘右下角按钮的文字,仅在type='text'时生效。
具体释义:
`send` 右下角按钮为“发送”;
`search` 右下角按钮为“搜索”;
`next` 右下角按钮为“下一个”;
`go` 右下角按钮为“前往”;
`done` 右下角按钮为“完成”。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)。可选项:send/search/next/go/done | N -cursor | Number | - | 必需。指定 focus 时的光标位置 | Y -cursor-spacing | Number | 0 | 搜索框聚焦时底部与键盘的距离 | N -disabled | Boolean | false | 是否禁用 | N -focus | Boolean | false | 是否聚焦 | N -hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N -label | String | '' | 已废弃。左侧文本 | N -left-icon | String / Slot | 'search' | 左侧图标。如果需要使用 `Slot` 进行自定义,必须将该值设置为假值。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N -maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N -placeholder | String | '' | 占位符 | N -placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 | N -placeholder-style | String | - | 必需。指定 placeholder 的样式 | Y -result-list | Array | [] | 预览结果列表。TS 类型:`Array` | N -right-icon | String / Slot | 'close-circle-filled' | 已废弃。右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N -selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N -shape | String | 'square' | 搜索框形状。可选项:square/round | N -type | String | 'text' | 拉起键盘的类型。可选项:text/number/idcard/digit/nickname | N -value | String | '' | 值 | N - -### Search Events - -名称 | 参数 | 描述 --- | -- | -- -action-click | `({})` | 点击右侧操作按钮文字时触发 -blur | `({ value: string })` | 失去焦点时触发 -change | `({ value: string })` | 值发生变化时触发 -clear | `({ value: string })` | 点击清除时触发 -focus | `({ value: string })` | 聚焦时触发 -submit | `({ value: string })` | 提交时触发 -### Search External Classes - -类名 | 描述 --- | -- -t-class | 根节点样式类 -t-class-action | 操作按钮样式类 -t-class-clear | 右侧图标样式类 -t-class-input | 输入框样式类 -t-class-input-container | 输入框容器样式类 -t-class-left | 左侧图标样式类 - -### CSS Variables - -组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 --- | -- | -- ---td-search-action-color | @brand-color | - ---td-search-bg-color | @bg-color-secondarycontainer | - ---td-search-clear-icon-color | @font-gray-3 | - ---td-search-font-size | @font-size-m | - ---td-search-height | 80rpx | - ---td-search-icon-color | @font-gray-3 | - ---td-search-label-color | @font-gray-1 | - ---td-search-padding | 16rpx 24rpx | - ---td-search-placeholder-color | @font-gray-3 | - ---td-search-result-high-light-color | @brand-color | - ---td-search-square-radius | @radius-default | - ---td-search-text-color | @font-gray-1 | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts deleted file mode 100644 index 81c5bff1..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TdSearchProps } from './type'; -declare const props: TdSearchProps; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js deleted file mode 100644 index 61b3da8d..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js +++ /dev/null @@ -1,103 +0,0 @@ -const props = { - action: { - type: String, - value: '', - }, - adjustPosition: { - type: Boolean, - value: true, - }, - alwaysEmbed: { - type: Boolean, - value: false, - }, - center: { - type: Boolean, - value: false, - }, - clearable: { - type: Boolean, - value: true, - }, - confirmHold: { - type: Boolean, - value: false, - }, - confirmType: { - type: String, - value: 'search', - }, - cursor: { - type: Number, - required: true, - }, - cursorSpacing: { - type: Number, - value: 0, - }, - disabled: { - type: Boolean, - value: false, - }, - focus: { - type: Boolean, - value: false, - }, - holdKeyboard: { - type: Boolean, - value: false, - }, - leftIcon: { - type: String, - value: 'search', - }, - maxcharacter: { - type: Number, - }, - maxlength: { - type: Number, - value: -1, - }, - placeholder: { - type: String, - value: '', - }, - placeholderClass: { - type: String, - value: 'input-placeholder', - }, - placeholderStyle: { - type: String, - value: '', - required: true, - }, - resultList: { - type: Array, - value: [], - }, - selectionEnd: { - type: Number, - value: -1, - }, - selectionStart: { - type: Number, - value: -1, - }, - shape: { - type: String, - value: 'square', - }, - style: { - type: String, - value: '', - }, - type: { - type: String, - value: 'text', - }, - value: { - type: String, - value: '', - }, -}; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts deleted file mode 100644 index 76ab9cb6..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { SuperComponent } from '../common/src/index'; -export default class Search extends SuperComponent { - externalClasses: string[]; - options: { - multipleSlots: boolean; - }; - properties: import("./type").TdSearchProps; - observers: { - resultList(val: any): void; - }; - data: { - classPrefix: string; - prefix: string; - isShowResultList: boolean; - isSelected: boolean; - }; - onInput(e: any): void; - onFocus(e: any): void; - onBlur(e: any): void; - handleClear(): void; - onConfirm(e: any): void; - onActionClick(): void; - onSelectResultItem(e: any): void; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js deleted file mode 100644 index bc6e9f67..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js +++ /dev/null @@ -1,104 +0,0 @@ -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'; -import { getCharacterLength } from '../common/utils'; -const { prefix } = config; -const name = `${prefix}-search`; -let Search = class Search extends SuperComponent { - constructor() { - super(...arguments); - this.externalClasses = [ - `${prefix}-class`, - `${prefix}-class-input-container`, - `${prefix}-class-input`, - `${prefix}-class-action`, - `${prefix}-class-left`, - `${prefix}-class-clear`, - ]; - this.options = { - multipleSlots: true, - }; - this.properties = props; - this.observers = { - resultList(val) { - const { isSelected } = this.data; - if (val.length) { - if (isSelected) { - this.setData({ - isShowResultList: false, - isSelected: false, - }); - } - else { - this.setData({ - isShowResultList: true, - }); - } - } - else { - this.setData({ - isShowResultList: false, - }); - } - }, - }; - this.data = { - classPrefix: name, - prefix, - isShowResultList: false, - isSelected: false, - }; - } - onInput(e) { - let { value } = e.detail; - const { maxcharacter } = this.properties; - if (maxcharacter && typeof maxcharacter === 'number' && maxcharacter > 0) { - const { characters } = getCharacterLength('maxcharacter', value, maxcharacter); - value = characters; - } - this.setData({ - value, - }); - this.triggerEvent('change', { value }); - } - onFocus(e) { - const { value } = e.detail; - this.triggerEvent('focus', { value }); - } - onBlur(e) { - const { value } = e.detail; - this.triggerEvent('blur', { value }); - } - handleClear() { - this.setData({ value: '' }); - this.triggerEvent('clear', { value: '' }); - this.triggerEvent('change', { value: '' }); - } - onConfirm(e) { - const { value } = e.detail; - this.triggerEvent('submit', { value }); - } - onActionClick() { - this.triggerEvent('action-click'); - } - onSelectResultItem(e) { - const { index } = e.currentTarget.dataset; - const item = this.properties.resultList[index]; - this.setData({ - value: item, - isSelected: true, - }); - this.triggerEvent('change', { value: item }); - this.triggerEvent('selectresult', { index, item }); - } -}; -Search = __decorate([ - wxComponent() -], Search); -export default Search; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json deleted file mode 100644 index ed5b2b62..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "styleIsolation": "apply-shared", - "usingComponents": { - "t-icon": "../icon/icon", - "t-cell": "../cell/cell" - } -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml deleted file mode 100644 index aab4903b..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - {{action}} - - - - - - - - - diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs deleted file mode 100644 index ac86989c..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs +++ /dev/null @@ -1,6 +0,0 @@ -var highLight = function (label, keyword) { - return label.replace(keyword, '' + keyword + ''); -}; -module.exports = { - highLight: highLight, -}; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss deleted file mode 100644 index 31f29f60..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss +++ /dev/null @@ -1,108 +0,0 @@ -.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-search { - display: flex; - justify-content: space-between; - align-items: center; -} -.t-search__label { - padding: 8rpx; - color: var(--td-search-label-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); -} -.t-search__input-box { - flex: 1; - box-sizing: border-box; - display: flex; - height: var(--td-search-height, 80rpx); - align-items: center; - border: 2rpx solid var(--td-search-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3))); - background: var(--td-search-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3))); - padding: var(--td-search-padding, 16rpx 24rpx); -} -.t-search__input-box.t-is-focused { - border-color: var(--td-search-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3))); -} -.t-search__input-box--round { - border-radius: calc(var(--td-search-height, 80rpx) / 2); -} -.t-search__input-box--square { - border-radius: var(--td-search-square-radius, var(--td-radius-default, 12rpx)); -} -.t-search__input-box--center { - text-align: center; -} -.t-search__input-box .t-input__keyword { - display: inline-block; - flex: 1; - color: var(--td-search-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - font-size: var(--td-search-font-size, var(--td-font-size-m, 32rpx)); - padding-left: 10rpx; - min-height: 48rpx; - line-height: 48rpx; -} -.t-search__input-box .t-icon { - color: var(--td-search-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); -} -.t-search__clear { - position: relative; - margin-left: 10px; - color: var(--td-search-clear-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); -} -.t-search__clear.relative { - position: relative; -} -.t-search__clear::after { - content: ''; - display: block; - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - transform: scale(1.5); -} -.t-search__search-action { - margin-left: 30rpx; - font-size: var(--td-search-font-size, var(--td-font-size-m, 32rpx)); - color: var(--td-search-action-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); -} -.t-search__placeholder { - color: var(--td-search-placeholder-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); -} -.t-search__placeholder--center { - text-align: center; -} -.t-search__result-item--highLight { - color: var(--td-search-result-high-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); -} -.t-search__result-list .t-search__result-item { - padding-left: 0; -} -.t-search__result-list .t-search__result-item::after { - left: 0; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts deleted file mode 100644 index 8b73ffad..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -export interface TdSearchProps { - action?: { - type: StringConstructor; - value?: string; - }; - adjustPosition?: { - type: BooleanConstructor; - value?: boolean; - }; - alwaysEmbed?: { - type: BooleanConstructor; - value?: boolean; - }; - center?: { - type: BooleanConstructor; - value?: boolean; - }; - clearable?: { - type: BooleanConstructor; - value?: boolean; - }; - confirmHold?: { - type: BooleanConstructor; - value?: boolean; - }; - confirmType?: { - type: StringConstructor; - value?: 'send' | 'search' | 'next' | 'go' | 'done'; - }; - cursor: { - type: NumberConstructor; - value?: number; - required?: boolean; - }; - cursorSpacing?: { - type: NumberConstructor; - value?: number; - }; - disabled?: { - type: BooleanConstructor; - value?: boolean; - }; - focus?: { - type: BooleanConstructor; - value?: boolean; - }; - holdKeyboard?: { - type: BooleanConstructor; - value?: boolean; - }; - leftIcon?: { - type: StringConstructor; - value?: string; - }; - maxcharacter?: { - type: NumberConstructor; - value?: number; - }; - maxlength?: { - type: NumberConstructor; - value?: number; - }; - placeholder?: { - type: StringConstructor; - value?: string; - }; - placeholderClass?: { - type: StringConstructor; - value?: string; - }; - placeholderStyle: { - type: StringConstructor; - value?: string; - required?: boolean; - }; - resultList?: { - type: ArrayConstructor; - value?: Array; - }; - selectionEnd?: { - type: NumberConstructor; - value?: number; - }; - selectionStart?: { - type: NumberConstructor; - value?: number; - }; - shape?: { - type: StringConstructor; - value?: 'square' | 'round'; - }; - style?: { - type: StringConstructor; - value?: string; - }; - type?: { - type: StringConstructor; - value?: 'text' | 'number' | 'idcard' | 'digit' | 'nickname'; - }; - value?: { - type: StringConstructor; - value?: string; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js deleted file mode 100644 index cb0ff5c3..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md deleted file mode 100644 index 27af848b..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md +++ /dev/null @@ -1,100 +0,0 @@ -:: BASE_DOC :: - -## API - -### Tag Props - -name | type | default | description | required --- | -- | -- | -- | -- -style | Object | - | CSS(Cascading Style Sheets) | N -custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -closable | Boolean / Object / Slot | false | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -disabled | Boolean | false | \- | N -icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -max-width | String / Number | - | \- | N -shape | String | square | options: square/round/mark | N -size | String | medium | options: small/medium/large/extra-large | N -theme | String | default | options: default/primary/warning/danger/success | N -variant | String | dark | options: dark/light/outline/light-outline | N - -### Tag Events - -name | params | description --- | -- | -- -click | - | \- -close | - | \- -### Tag External Classes - -className | Description --- | -- -t-class | \- - - -### CheckTag Props - -name | type | default | description | required --- | -- | -- | -- | -- -style | Object | - | CSS(Cascading Style Sheets) | N -custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -checked | Boolean | undefined | \- | N -default-checked | Boolean | undefined | uncontrolled property | N -closable | Boolean | false | \- | N -content | String / Number / Array / Slot | - | Typescript:`string \| number \| string[]` | N -disabled | Boolean | false | \- | N -icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -shape | String | square | options: square/round/mark | N -size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -variant | String | dark | `0.26.0`。options: dark/light/outline/light-outline | N - -### CheckTag Events - -name | params | description --- | -- | -- -change | `(checked: boolean)` | \- -click | - | \- -close | \- | \- -### CheckTag External Classes - -className | Description --- | -- -t-class | \- - -### CSS Variables - -The component provides the following CSS variables, which can be used to customize styles. -Name | Default Value | Description --- | -- | -- ---td-tag-close-icon-color | @font-gray-3 | - ---td-tag-danger-color | @error-color | - ---td-tag-danger-light-color | @error-color-1 | - ---td-tag-default-color | @bg-color-component | - ---td-tag-default-font-color | @font-gray-1 | - ---td-tag-default-light-color | @bg-color-secondarycontainer | - ---td-tag-disabled-background-color | @bg-color-component-disabled | - ---td-tag-disabled-border-color | @component-border | - ---td-tag-disabled-color | @font-gray-4 | - ---td-tag-extra-large-font-size | @font-size-base | - ---td-tag-extra-large-height | 80rpx | - ---td-tag-extra-large-icon-size | 32rpx | - ---td-tag-extra-large-padding | 32rpx - 1px | - ---td-tag-large-font-size | @font-size-base | - ---td-tag-large-height | 56rpx | - ---td-tag-large-icon-size | 32rpx | - ---td-tag-large-padding | 16rpx - 1px | - ---td-tag-mark-border-radius | @tag-round-border-radius | - ---td-tag-medium-font-size | @font-size-s | - ---td-tag-medium-height | 48rpx | - ---td-tag-medium-icon-size | 28rpx | - ---td-tag-medium-padding | 16rpx - 1px | - ---td-tag-outline-bg-color | @bg-color-container | - ---td-tag-primary-color | @brand-color | - ---td-tag-primary-light-color | @brand-color-light | - ---td-tag-round-border-radius | 999px | - ---td-tag-small-font-size | @font-size | - ---td-tag-small-height | 40rpx | - ---td-tag-small-icon-size | 24rpx | - ---td-tag-small-padding | 12rpx - 1px | - ---td-tag-square-border-radius | 8rpx | - ---td-tag-success-color | @success-color | - ---td-tag-success-light-color | @success-color-1 | - ---td-tag-warning-color | @warning-color | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md deleted file mode 100644 index 2f21c3de..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: Tag 标签 -description: 用于表明主体的类目,属性或状态。 -spline: data -isComponent: true ---- - - -## 引入 - -全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 - -```json -"usingComponents": { - "t-tag": "tdesign-miniprogram/tag/tag", - "t-check-tag": "tdesign-miniprogram/check-tag/check-tag" -} -``` - -## 代码演示 - - 在开发者工具中预览效果 - -
-

Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"

-
- -### 组件类型 - -{{ type }} - -可关闭的标签 - -{{ closable }} - -可点击的标签 - -{{ checkable }} - -### 组件状态 - -展示型标签 - -{{ theme }} - -### 组件尺寸 - -{{ size }} - - -## API - -### Tag Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -style | Object | - | 样式 | N -custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -closable | Boolean / Object / Slot | false | 标签是否可关闭。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N -icon | String / Object / Slot | - | 标签中的图标,可自定义图标呈现。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -max-width | String / Number | - | 标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80 | N -shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N -size | String | medium | 标签尺寸。可选项:small/medium/large/extra-large | N -theme | String | default | 组件风格,用于描述组件不同的应用场景。可选项:default/primary/warning/danger/success | N -variant | String | dark | 标签风格变体。可选项:dark/light/outline/light-outline | N - -### Tag Events - -名称 | 参数 | 描述 --- | -- | -- -click | - | 点击时触发 -close | - | 如果关闭按钮存在,点击关闭按钮时触发 -### Tag External Classes - -类名 | 描述 --- | -- -t-class | 根节点样式类 - - -### CheckTag Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -style | Object | - | 样式 | N -custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态 | N -default-checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态。非受控属性 | N -closable | Boolean | false | 标签是否可关闭 | N -content | String / Number / Array / Slot | - | 组件子元素;传入数组时:[选中内容,非选中内容]。TS 类型:`string \| number \| string[]` | N -disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N -icon | String / Object / Slot | - | 标签图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N -size | String | medium | 标签尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -variant | String | dark | `0.26.0`。标签风格变体。可选项:dark/light/outline/light-outline | N - -### CheckTag Events - -名称 | 参数 | 描述 --- | -- | -- -change | `(checked: boolean)` | 状态切换时触发 -click | - | 点击标签时触发 -close | \- | 如果关闭按钮存在,点击关闭按钮时触发 -### CheckTag External Classes - -类名 | 描述 --- | -- -t-class | 根节点样式类 - -### CSS Variables - -组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 --- | -- | -- ---td-tag-close-icon-color | @font-gray-3 | - ---td-tag-danger-color | @error-color | - ---td-tag-danger-light-color | @error-color-1 | - ---td-tag-default-color | @bg-color-component | - ---td-tag-default-font-color | @font-gray-1 | - ---td-tag-default-light-color | @bg-color-secondarycontainer | - ---td-tag-disabled-background-color | @bg-color-component-disabled | - ---td-tag-disabled-border-color | @component-border | - ---td-tag-disabled-color | @font-gray-4 | - ---td-tag-extra-large-font-size | @font-size-base | - ---td-tag-extra-large-height | 80rpx | - ---td-tag-extra-large-icon-size | 32rpx | - ---td-tag-extra-large-padding | 32rpx - 1px | - ---td-tag-large-font-size | @font-size-base | - ---td-tag-large-height | 56rpx | - ---td-tag-large-icon-size | 32rpx | - ---td-tag-large-padding | 16rpx - 1px | - ---td-tag-mark-border-radius | @tag-round-border-radius | - ---td-tag-medium-font-size | @font-size-s | - ---td-tag-medium-height | 48rpx | - ---td-tag-medium-icon-size | 28rpx | - ---td-tag-medium-padding | 16rpx - 1px | - ---td-tag-outline-bg-color | @bg-color-container | - ---td-tag-primary-color | @brand-color | - ---td-tag-primary-light-color | @brand-color-light | - ---td-tag-round-border-radius | 999px | - ---td-tag-small-font-size | @font-size | - ---td-tag-small-height | 40rpx | - ---td-tag-small-icon-size | 24rpx | - ---td-tag-small-padding | 12rpx - 1px | - ---td-tag-square-border-radius | 8rpx | - ---td-tag-success-color | @success-color | - ---td-tag-success-light-color | @success-color-1 | - ---td-tag-warning-color | @warning-color | - \ No newline at end of file diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts deleted file mode 100644 index 8074655d..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TdTagProps } from './type'; -declare const props: TdTagProps; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js deleted file mode 100644 index 37b936b6..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js +++ /dev/null @@ -1,36 +0,0 @@ -const props = { - closable: { - type: null, - value: false, - }, - disabled: { - type: Boolean, - value: false, - }, - externalClasses: { - type: Array, - }, - icon: { - type: null, - }, - maxWidth: { - type: null, - }, - shape: { - type: String, - value: 'square', - }, - size: { - type: String, - value: 'medium', - }, - theme: { - type: String, - value: 'default', - }, - variant: { - type: String, - value: 'dark', - }, -}; -export default props; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts deleted file mode 100644 index 2c86ef09..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// -import { SuperComponent } from '../common/src/index'; -export default class Tag extends SuperComponent { - data: { - prefix: string; - classPrefix: string; - className: string; - tagStyle: string; - }; - properties: import("./type").TdTagProps; - externalClasses: string[]; - options: WechatMiniprogram.Component.ComponentOptions; - lifetimes: { - attached(): void; - }; - observers: { - 'size, shape, theme, variant, closable, disabled'(): void; - maxWidth(): void; - icon(v: any): void; - closable(v: any): void; - }; - methods: { - setClass(): void; - setTagStyle(): string; - handleClick(e: WechatMiniprogram.BaseEvent): void; - handleClose(e: WechatMiniprogram.BaseEvent): void; - }; -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js deleted file mode 100644 index da271cdd..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js +++ /dev/null @@ -1,93 +0,0 @@ -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 { wxComponent, SuperComponent } from '../common/src/index'; -import config from '../common/config'; -import props from './props'; -import { classNames, isNumber, calcIcon } from '../common/utils'; -const { prefix } = config; -const name = `${prefix}-tag`; -let Tag = class Tag extends SuperComponent { - constructor() { - super(...arguments); - this.data = { - prefix, - classPrefix: name, - className: '', - tagStyle: '', - }; - this.properties = props; - this.externalClasses = [`${prefix}-class`]; - this.options = { - multipleSlots: true, - }; - this.lifetimes = { - attached() { - this.setClass(); - this.setTagStyle(); - }, - }; - this.observers = { - 'size, shape, theme, variant, closable, disabled'() { - this.setClass(); - }, - maxWidth() { - this.setTagStyle(); - }, - icon(v) { - this.setData({ - _icon: calcIcon(v), - }); - }, - closable(v) { - this.setData({ - _closable: calcIcon(v, 'close'), - }); - }, - }; - this.methods = { - setClass() { - const { prefix, classPrefix } = this.data; - const { size, shape, theme, variant, closable, disabled } = this.properties; - const tagClass = [ - classPrefix, - `${classPrefix}--${theme || 'default'}`, - `${classPrefix}--${variant}`, - closable ? `${classPrefix}--closable ${prefix}-is-closable` : '', - disabled ? `${classPrefix}--disabled ${prefix}-is-disabled` : '', - `${classPrefix}--${size}`, - `${classPrefix}--${shape}`, - ]; - const className = classNames(tagClass); - this.setData({ - className, - }); - }, - setTagStyle() { - const { maxWidth } = this.properties; - if (!maxWidth) { - return ''; - } - const width = isNumber(maxWidth) ? `${maxWidth}px` : maxWidth; - this.setData({ tagStyle: `max-width:${width};` }); - }, - handleClick(e) { - if (this.data.disabled) - return; - this.triggerEvent('click', e); - }, - handleClose(e) { - if (this.data.disabled) - return; - this.triggerEvent('close', e); - }, - }; - } -}; -Tag = __decorate([ - wxComponent() -], Tag); -export default Tag; diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json deleted file mode 100644 index 6f15f575..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "styleIsolation": "apply-shared", - "usingComponents": { - "t-icon": ".././icon/icon" - } -} diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml deleted file mode 100644 index ac356cc2..00000000 --- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -