diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..0a82b23
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,3 @@
+**/*.wxs
+node_modules
+miniprogram_npm
\ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..c46df90
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,86 @@
+/*
+ * Eslint config file
+ * Documentation: https://eslint.org/docs/user-guide/configuring/
+ * Install the Eslint extension before using this feature.
+ */
+module.exports = {
+ env: {
+ es6: true,
+ browser: true,
+ node: true,
+ },
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ },
+ globals: {
+ wx: true,
+ App: true,
+ Page: true,
+ getCurrentPages: true,
+ getApp: true,
+ Component: true,
+ requirePlugin: true,
+ requireMiniProgram: true,
+ },
+ extends: ['eslint-config-airbnb-base', 'eslint-config-prettier'],
+ plugins: ['prettier', 'import'],
+ // extends: 'eslint:recommended',
+ rules: {
+ 'import/order': [
+ 'error',
+ {
+ groups: [
+ 'builtin', // Built-in types are first
+ 'external', // Then the index file
+ 'internal',
+ ],
+ },
+ ],
+ // 非开发模式禁用debugger
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
+ // 允许调用首字母大写的函数时没有 new 操作符
+ 'new-cap': 'off',
+ // 在工具库中允许变量以下划线开头
+ 'no-underscore-dangle': 'off',
+ // 在工具库中允许参数重新赋值
+ 'no-param-reassign': 'off',
+ 'number-leading-zero': 'off',
+ eqeqeq: [
+ 'error',
+ 'always',
+ {
+ null: 'ignore',
+ },
+ ],
+ 'import/no-unresolved': 0,
+ 'import/prefer-default-export': 0,
+ 'import/no-named-as-default': 0,
+ 'import/extensions': 0,
+ 'import/export': 0,
+ 'import/no-cycle': 0,
+ 'import/no-extraneous-dependencies': [
+ 'error',
+ {
+ devDependencies: true,
+ },
+ ],
+ 'import/no-dynamic-require': 0,
+ 'object-shorthand': 0,
+ 'no-shadow': 0,
+ 'no-unused-expressions': 0,
+ 'no-unused-vars': 0,
+ 'consistent-return': 0,
+ 'no-return-assign': 0,
+ 'func-names': 0,
+ 'class-methods-use-this': 0,
+ 'no-console': [
+ 2,
+ {
+ allow: ['warn', 'error'],
+ },
+ ],
+ 'no-undef': 0,
+ 'no-proto': 0,
+ },
+};
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..0a353ed
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+**/*.md
\ No newline at end of file
diff --git a/.prettierrc.yml b/.prettierrc.yml
new file mode 100644
index 0000000..a13251c
--- /dev/null
+++ b/.prettierrc.yml
@@ -0,0 +1,49 @@
+# 一行最多 100 字符
+printWidth: 120
+# 使用 2 个空格缩进
+tabWidth: 2
+# 不使用缩进符,而使用空格
+useTabs: false
+# 行尾需要分号
+semi: true
+# 使用单引号
+singleQuote: true
+# 对象的 key 仅在必要时用引号
+quoteProps: as-needed
+# jsx 不使用单引号,而使用双引号
+jsxSingleQuote: false
+# 末尾需要逗号
+trailingComma: all
+# 大括号内的首尾需要空格
+bracketSpacing: true
+# jsx 标签的反尖括号需要换行
+jsxBracketSameLine: false
+# 箭头函数,只有一个参数的时候,不需要括号
+arrowParens: always
+# 每个文件格式化的范围是文件的全部内容
+rangeStart: 0
+# 不需要写文件开头的 @prettier
+requirePragma: false
+# 不需要自动在文件开头插入 @prettier
+insertPragma: false
+# 使用默认的折行标准
+proseWrap: preserve
+# 根据显示样式决定 html 要不要折行
+htmlWhitespaceSensitivity: css
+# 换行符使用 lf
+endOfLine: lf
+# 后缀文件名特有规则
+overrides:
+ - files: '*.{wxss,less}'
+ options:
+ parser: less
+ - files: '*.json,.*rc'
+ options:
+ parser: json
+ - files: '*.{wxml,html}'
+ options:
+ parser: html
+ htmlWhitespaceSensitivity: strict
+ - files: '*.wxs'
+ options:
+ parser: babel
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..b3114d5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 leejimqiu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 1085642..b664e3c 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,70 @@
-# wxapp_escort_admin
+# TDesign 通用页面模板
+基于 TDesign 打造的通用页面模板,包含通用的登陆注册、个人中心、设置中心、信息流等等功能。
+
+## 模版功能预览
+
+### 首页
+
+
+

+

+
+
+### 信息发布
+
+
+
+### 搜索页
+
+
+
+### 个人中心
+
+
+
+### 设置中心
+
+
+
+### 消息中心
+
+
+
+
+## 开发预览
+### 目录结构(TODO: 生成目录结构树)
+
+
+### 在开发者工具中预览
+
+```bash
+# 安装项目依赖
+npm install
+
+```
+
+打开[微信开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html),导入整个项目,构建 npm 包,就可以预览示例了。
+
+### 基础库版本
+
+最低基础库版本`^2.6.5`
+
+
+## 贡献成员
+
+
+
+
+
+## 反馈
+
+有任何问题,建议通过 [Github issues](https://github.com/TDesignOteam/tdesign-miniprogram-starter/issues) 反馈。
+
+## 开源协议
+
+TDesign 遵循 [MIT 协议](https://github.com/TDesignOteam/tdesign-miniprogram-starter/blob/main/LICENSE)。
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..4b4347a
--- /dev/null
+++ b/app.js
@@ -0,0 +1,58 @@
+// app.js
+import config from './config';
+import createBus from './utils/eventBus';
+
+App({
+ onLaunch() {
+ const updateManager = wx.getUpdateManager();
+
+ updateManager.onCheckForUpdate((res) => {
+ // console.log(res.hasUpdate)
+ });
+
+ updateManager.onUpdateReady(() => {
+ wx.showModal({
+ title: '更新提示',
+ content: '新版本已经准备好,是否重启应用?',
+ success(res) {
+ if (res.confirm) {
+ updateManager.applyUpdate();
+ }
+ },
+ });
+ });
+
+ this.getUnreadNum();
+ this.connect();
+ },
+
+ /** 全局事件总线 */
+ eventBus: createBus(),
+
+ /** 初始化WebSocket */
+ connect() {
+ const socket = null //connectSocket();
+ /*socket.onMessage((data) => {
+ data = JSON.parse(data);
+ if (data.type === 'message' && !data.data.message.read) this.setUnreadNum(this.globalData.unreadNum + 1);
+ });*/
+ this.globalData.socket = socket;
+ },
+
+ /** 获取未读消息数量 */
+ getUnreadNum() {
+ },
+
+ /** 设置未读消息数量 */
+ setUnreadNum(unreadNum) {
+ this.globalData.unreadNum = unreadNum;
+ this.eventBus.emit('unread-num-change', unreadNum);
+ },
+
+
+ globalData: {
+ user: null,
+ unreadNum: 0, // 未读消息数量
+ socket: null, // SocketTask 对象
+ },
+});
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..1a9b481
--- /dev/null
+++ b/app.json
@@ -0,0 +1,62 @@
+{
+ "pages": [
+ "pages/home/index",
+ "pages/ai/index",
+ "pages/set/index",
+ "pages/order/index",
+ "pages/customer/index"
+ ],
+ "usingComponents": {
+ "t-toast": "tdesign-miniprogram/toast/toast"
+ },
+ "subpackages": [],
+ "window": {
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#1a1f3c",
+ "navigationBarTitleText": "Weixin",
+ "navigationBarTextStyle": "white",
+ "backgroundColor": "#0f1535"
+ },
+ "tabBar": {
+ "color": "#8a8a8a",
+ "selectedColor": "#1296db",
+ "backgroundColor": "#0f1535",
+ "borderStyle": "black",
+ "list": [
+ {
+ "pagePath": "pages/home/index",
+ "text": "首页",
+ "iconPath": "images/home.png",
+ "selectedIconPath": "images/home-blue.png"
+ },
+ {
+ "pagePath": "pages/order/index",
+ "text": "订单",
+ "iconPath": "images/order.png",
+ "selectedIconPath": "images/order-blue.png"
+ },
+ {
+ "pagePath": "pages/customer/index",
+ "text": "客户",
+ "iconPath": "images/customer.png",
+ "selectedIconPath": "images/customer-blue.png"
+ },
+ {
+ "pagePath": "pages/ai/index",
+ "text": "消息",
+ "iconPath": "images/chat.png",
+ "selectedIconPath": "images/chat-blue.png"
+ },
+ {
+ "pagePath": "pages/set/index",
+ "text": "设置",
+ "iconPath": "images/set.png",
+ "selectedIconPath": "images/set-blue.png"
+ }
+ ]
+ },
+ "resolveAlias": {
+ "~/*": "/*"
+ },
+ "sitemapLocation": "sitemap.json"
+}
\ No newline at end of file
diff --git a/app.wxss b/app.wxss
new file mode 100644
index 0000000..d5d4f06
--- /dev/null
+++ b/app.wxss
@@ -0,0 +1,9 @@
+/**app.wxss**/
+page {
+ background-color: #f3f3f3;
+}
+
+.page {
+ height: 100vh;
+ background-color: #fff;
+}
diff --git a/config.js b/config.js
new file mode 100644
index 0000000..e24d0e4
--- /dev/null
+++ b/config.js
@@ -0,0 +1,3 @@
+export default {
+ baseUrl: '',
+};
diff --git a/images/chat-blue.png b/images/chat-blue.png
new file mode 100644
index 0000000..1eb336c
Binary files /dev/null and b/images/chat-blue.png differ
diff --git a/images/chat.png b/images/chat.png
new file mode 100644
index 0000000..18249fc
Binary files /dev/null and b/images/chat.png differ
diff --git a/images/customer-blue.png b/images/customer-blue.png
new file mode 100644
index 0000000..b2c33eb
Binary files /dev/null and b/images/customer-blue.png differ
diff --git a/images/customer.png b/images/customer.png
new file mode 100644
index 0000000..f8ecfe3
Binary files /dev/null and b/images/customer.png differ
diff --git a/images/home-blue.png b/images/home-blue.png
new file mode 100644
index 0000000..e7d4828
Binary files /dev/null and b/images/home-blue.png differ
diff --git a/images/home.png b/images/home.png
new file mode 100644
index 0000000..066d20b
Binary files /dev/null and b/images/home.png differ
diff --git a/images/order-blue.png b/images/order-blue.png
new file mode 100644
index 0000000..068ebba
Binary files /dev/null and b/images/order-blue.png differ
diff --git a/images/order.png b/images/order.png
new file mode 100644
index 0000000..8773d27
Binary files /dev/null and b/images/order.png differ
diff --git a/images/set-blue.png b/images/set-blue.png
new file mode 100644
index 0000000..80dc736
Binary files /dev/null and b/images/set-blue.png differ
diff --git a/images/set.png b/images/set.png
new file mode 100644
index 0000000..7db68b9
Binary files /dev/null and b/images/set.png differ
diff --git a/miniprogram_npm/.DS_Store b/miniprogram_npm/.DS_Store
new file mode 100644
index 0000000..60c26ef
Binary files /dev/null and b/miniprogram_npm/.DS_Store differ
diff --git a/miniprogram_npm/dayjs/index.js b/miniprogram_npm/dayjs/index.js
new file mode 100644
index 0000000..681998b
--- /dev/null
+++ b/miniprogram_npm/dayjs/index.js
@@ -0,0 +1,13 @@
+module.exports = (function() {
+var __MODS__ = {};
+var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
+var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
+var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
+var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
+__DEFINE__(1740983753193, function(require, module, exports) {
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new b(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var b=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new b(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var b=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)",
+ "path": "./action-sheet/action-sheet"
+ },
+ "t-avatar-group": {
+ "key": "t-avatar-group",
+ "label": "头像组",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-avatar.png",
+ "properties": [
+ {
+ "key": "cascading",
+ "type": ["String"],
+ "desc": "图片之间的层叠关系,可选值:左侧图片在上和右侧图片在上",
+ "label": ""
+ },
+ {
+ "key": "collapseAvatar",
+ "type": ["String"],
+ "desc": "头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5`,`...`, `更多`",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "能够同时显示的最多头像数量",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "尺寸,示例值:small/medium/large/24px/38px 等。优先级低于 Avatar.size",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-image", "t-class-content"],
+ "tpl": "",
+ "require": {
+ "t-avatar": "./avatar/avatar"
+ },
+ "path": "./avatar/avatar-group"
+ },
+ "t-avatar": {
+ "key": "t-avatar",
+ "label": "头像",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-avatar.png",
+ "properties": [
+ {
+ "key": "alt",
+ "type": ["String"],
+ "desc": "头像替换文本,仅当图片加载失败时有效",
+ "label": ""
+ },
+ {
+ "key": "badgeProps",
+ "type": ["Object"],
+ "desc": "头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字",
+ "label": ""
+ },
+ {
+ "key": "hideOnLoadFailed",
+ "type": ["Boolean"],
+ "desc": "加载失败时隐藏图片",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "图片地址",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "形状",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "尺寸,示例值:small/medium/large/24px/38px 等,默认为 large",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:error",
+ "desc": "图片加载失败时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./avatar/avatar"
+ },
+ "t-back-top": {
+ "key": "t-back-top",
+ "label": "回到顶部",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-backtop.png",
+ "properties": [
+ {
+ "key": "fixed",
+ "type": ["Boolean"],
+ "desc": "是否绝对定位固定到屏幕右下方",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "文案",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "预设的样式类型",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon", "t-class-text"],
+ "events": [
+ {
+ "key": "bind:to-top",
+ "desc": "点击触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./back-top/back-top"
+ },
+ "t-badge": {
+ "key": "t-badge",
+ "label": "徽标数",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-badge.png",
+ "properties": [
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "颜色",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "徽标内容,示例:`content='自定义内容'`。也可以使用默认插槽定义",
+ "label": ""
+ },
+ {
+ "key": "count",
+ "type": ["String", "Number"],
+ "desc": "徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染",
+ "label": ""
+ },
+ {
+ "key": "dot",
+ "type": ["Boolean"],
+ "desc": "是否为红点",
+ "label": ""
+ },
+ {
+ "key": "maxCount",
+ "type": ["Number"],
+ "desc": "封顶的数字值",
+ "label": ""
+ },
+ {
+ "key": "offset",
+ "type": ["Array"],
+ "desc": "设置状态点的位置偏移,示例:[-10, 20] 或 ['10em', '8rem']",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "形状",
+ "label": ""
+ },
+ {
+ "key": "showZero",
+ "type": ["Boolean"],
+ "desc": "当数值为 0 时,是否展示徽标",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "尺寸",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-count"],
+ "tpl": "",
+ "path": "./badge/badge"
+ },
+ "t-button": {
+ "key": "t-button",
+ "label": "按钮",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-button.png",
+ "properties": [
+ {
+ "key": "block",
+ "type": ["Boolean"],
+ "desc": "是否为块级元素",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "按钮内容",
+ "label": ""
+ },
+ {
+ "key": "customDataset",
+ "type": ["Object"],
+ "desc": "自定义 dataset,可通过 event.currentTarget.dataset.custom 获取",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用按钮",
+ "label": ""
+ },
+ {
+ "key": "ghost",
+ "type": ["Boolean"],
+ "desc": "是否为幽灵按钮(镂空按钮)",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标名称",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "是否显示为加载状态",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "组件尺寸",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "组件风格,依次为品牌色、危险色",
+ "label": ""
+ },
+ {
+ "key": "type",
+ "type": ["String"],
+ "desc": "同小程序的 formType",
+ "label": ""
+ },
+ {
+ "key": "variant",
+ "type": ["String"],
+ "desc": "按钮形式,基础、线框、文字",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon"],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "点击时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./button/button"
+ },
+ "t-cell-group": {
+ "key": "t-cell-group",
+ "label": "单元格组",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-cell.png",
+ "properties": [
+ {
+ "key": "bordered",
+ "type": ["Boolean"],
+ "desc": "是否显示组边框",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "单元格组标题",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "tpl": "",
+ "require": {
+ "t-cell": "./cell/cell"
+ },
+ "path": "./cell-group/cell-group"
+ },
+ "t-cell": {
+ "key": "t-cell",
+ "label": "单元格",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-cell.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "内容的对齐方式,默认居中对齐",
+ "label": ""
+ },
+ {
+ "key": "arrow",
+ "type": ["Boolean"],
+ "desc": "是否显示右侧箭头",
+ "label": ""
+ },
+ {
+ "key": "bordered",
+ "type": ["Boolean"],
+ "desc": "是否显示下边框",
+ "label": ""
+ },
+ {
+ "key": "description",
+ "type": ["String"],
+ "desc": "下方内容描述",
+ "label": ""
+ },
+ {
+ "key": "hover",
+ "type": ["Boolean"],
+ "desc": "是否开启点击反馈",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "主图",
+ "label": ""
+ },
+ {
+ "key": "jumpType",
+ "type": ["String"],
+ "desc": "链接跳转类型",
+ "label": ""
+ },
+ {
+ "key": "leftIcon",
+ "type": ["String"],
+ "desc": "左侧图标,出现在单元格标题的左侧",
+ "label": ""
+ },
+ {
+ "key": "note",
+ "type": ["String"],
+ "desc": "和标题同行的说明文字",
+ "label": ""
+ },
+ {
+ "key": "required",
+ "type": ["Boolean"],
+ "desc": "是否显示表单必填星号",
+ "label": ""
+ },
+ {
+ "key": "rightIcon",
+ "type": ["String"],
+ "desc": "最右侧图标",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "标题",
+ "label": ""
+ },
+ {
+ "key": "url",
+ "type": ["String"],
+ "desc": "点击后跳转链接地址。如果值为空,则表示不需要跳转",
+ "label": ""
+ }
+ ],
+ "externalClasses": [
+ "t-class",
+ "t-class-title",
+ "t-class-note",
+ "t-class-description",
+ "t-class-thumb",
+ "t-class-hover",
+ "t-class-left",
+ "t-class-right"
+ ],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "右侧内容",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./cell/cell"
+ },
+ "t-check-tag": {
+ "key": "t-check-tag",
+ "label": "可选标签",
+ "icon": "",
+ "properties": [
+ {
+ "key": "checked",
+ "type": ["Boolean"],
+ "desc": "标签选中的状态,默认风格(theme=default)才有选中态",
+ "label": ""
+ },
+ {
+ "key": "closable",
+ "type": ["Boolean"],
+ "desc": "标签是否可关闭",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String", "Number"],
+ "desc": "组件子元素",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "标签中的图标,可自定义图标呈现",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "标签类型,有三种:方形、圆角方形、标记型",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "标签尺寸",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "组件子元素",
+ "label": ""
+ },
+ {
+ "key": "bind:click",
+ "desc": "点击标签时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "check tag",
+ "path": "./check-tag/check-tag"
+ },
+ "t-checkbox-group": {
+ "key": "t-checkbox-group",
+ "label": "多选框组",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-checkbox.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "支持最多选中的数量",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "统一设置内部复选框 HTML 属性",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Array"],
+ "desc": "选中值",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "值变化时触发。`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中,`context.option` 表示当前变化的数据项",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "require": {
+ "t-checkbox": "./checkbox/checkbox"
+ },
+ "path": "./checkbox-group/checkbox-group"
+ },
+ "t-checkbox": {
+ "key": "t-checkbox",
+ "label": "多选框",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-checkbox.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "多选框和内容相对位置",
+ "label": ""
+ },
+ {
+ "key": "checkAll",
+ "type": ["Boolean"],
+ "desc": "用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用",
+ "label": ""
+ },
+ {
+ "key": "checked",
+ "type": ["Boolean"],
+ "desc": "是否选中",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "多选框颜色",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "多选框内容",
+ "label": ""
+ },
+ {
+ "key": "contentDisabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件内容(content)触发选中",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["Array"],
+ "desc": "自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]",
+ "label": ""
+ },
+ {
+ "key": "indeterminate",
+ "type": ["Boolean"],
+ "desc": "是否为半选",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "主文案",
+ "label": ""
+ },
+ {
+ "key": "maxContentRow",
+ "type": ["Number"],
+ "desc": "内容最大行数限制",
+ "label": ""
+ },
+ {
+ "key": "maxLabelRow",
+ "type": ["Number"],
+ "desc": "主文案最大行数限制",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "HTML 元素原生属性",
+ "label": ""
+ },
+ {
+ "key": "readonly",
+ "type": ["Boolean"],
+ "desc": "只读状态",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "多选框的值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "值变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./checkbox/checkbox"
+ },
+ "t-collapse-panel": {
+ "key": "t-collapse-panel",
+ "label": "折叠面板",
+ "icon": "",
+ "properties": [
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "折叠面板内容",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "禁止当前面板展开,优先级大于 Collapse 的同名属性",
+ "label": ""
+ },
+ {
+ "key": "expandIcon",
+ "type": ["Boolean"],
+ "desc": "当前折叠面板展开图标,优先级大于 Collapse 的同名属性",
+ "label": ""
+ },
+ {
+ "key": "header",
+ "type": ["String"],
+ "desc": "面板头内容",
+ "label": ""
+ },
+ {
+ "key": "headerRightContent",
+ "type": ["String"],
+ "desc": "面板头的右侧区域,一般用于呈现面板操作",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "当前面板唯一标识,如果值为空则取当前面下标兜底作为唯一标识",
+ "label": ""
+ }
+ ],
+ "tpl": "此处可自定义内容",
+ "path": "./collapse/collapse-panel"
+ },
+ "t-collapse": {
+ "key": "t-collapse",
+ "label": "折叠",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-collapse.png",
+ "properties": [
+ {
+ "key": "defaultExpandAll",
+ "type": ["Boolean"],
+ "desc": "默认是否展开全部",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用面板展开/收起操作",
+ "label": ""
+ },
+ {
+ "key": "expandIcon",
+ "type": ["Boolean"],
+ "desc": "展开图标。值为 undefined 或 false 则不显示展开图标;值为 true 显示默认图标;值类型为函数,则表示完全自定义展开图标",
+ "label": ""
+ },
+ {
+ "key": "expandMutex",
+ "type": ["Boolean"],
+ "desc": "每个面板互斥展开,每次只展开一个面板",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Array"],
+ "desc": "展开的面板集合",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "切换面板时触发,返回变化的值",
+ "label": ""
+ }
+ ],
+ "tpl": "此处可自定义内容",
+ "require": {
+ "t-collapse-panel": "./collapse/collapse-panel"
+ },
+ "path": "./collapse/collapse"
+ },
+ "t-date-time-picker": {
+ "key": "t-date-time-picker",
+ "label": "日期时间选择器",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-datetimepicker.png",
+ "properties": [
+ {
+ "key": "cancelBtn",
+ "type": ["String"],
+ "desc": "取消按钮文字",
+ "label": ""
+ },
+ {
+ "key": "confirmBtn",
+ "type": ["String"],
+ "desc": "确定按钮文字",
+ "label": ""
+ },
+ {
+ "key": "end",
+ "type": ["String", "Number"],
+ "desc": "选择器的结束时间",
+ "label": ""
+ },
+ {
+ "key": "footer",
+ "type": ["String"],
+ "desc": "底部内容",
+ "label": ""
+ },
+ {
+ "key": "format",
+ "type": ["String"],
+ "desc": "用于格式化日期,[详细文档](https://day.js.org/docs/en/display/format)",
+ "label": ""
+ },
+ {
+ "key": "header",
+ "type": ["Boolean"],
+ "desc": "头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容",
+ "label": ""
+ },
+ {
+ "key": "mode",
+ "type": ["String", "Array"],
+ "desc": "选择器模式,用于表示可以选择到哪一个层级。【示例一】year 或者 ['year'] 表示纯日期选择器,只能选择到年份,只显示年份。【示例二】'hour' 或 ['hour'] 表示纯时间选择器,只能选择到小时维度。【示例三】['year', 'month', 'date', 'hour', 'minute'] 表示,日期和时间 混合选择器,可以选择到具体哪一分钟,显示全部时间:年/月/日/时/分",
+ "label": ""
+ },
+ {
+ "key": "showWeek",
+ "type": ["Boolean"],
+ "desc": "【开发中】是否在日期旁边显示周几(如周一,周二,周日等)",
+ "label": ""
+ },
+ {
+ "key": "start",
+ "type": ["String", "Number"],
+ "desc": "选择器的开始时间",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "标题",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "选中值",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "是否显示",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-confirm", "t-class-cancel", "t-class-title"],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "取消按钮点击时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "选中值发生变化时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:column-change",
+ "desc": "每一列选中数据变化时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:confirm",
+ "desc": "确认按钮点击时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./date-time-picker/date-time-picker"
+ },
+ "t-dialog": {
+ "key": "t-dialog",
+ "label": "对话框",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dialog.png",
+ "properties": [
+ {
+ "key": "actions",
+ "type": ["Array"],
+ "desc": "操作栏",
+ "label": ""
+ },
+ {
+ "key": "buttonLayout",
+ "type": ["String"],
+ "desc": "多按钮排列方式",
+ "label": ""
+ },
+ {
+ "key": "cancelBtn",
+ "type": ["String", "Object"],
+ "desc": "取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制取消事件",
+ "label": ""
+ },
+ {
+ "key": "closeOnOverlayClick",
+ "type": ["Boolean"],
+ "desc": "点击蒙层时是否触发关闭事件",
+ "label": ""
+ },
+ {
+ "key": "confirmBtn",
+ "type": ["String", "Object"],
+ "desc": "确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制确认事件",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "内容",
+ "label": ""
+ },
+ {
+ "key": "preventScrollThrough",
+ "type": ["Boolean"],
+ "desc": "防止滚动穿透",
+ "label": ""
+ },
+ {
+ "key": "showInAttachedElement",
+ "type": ["Boolean"],
+ "desc": "【开发中】仅在挂载元素中显示抽屉,默认在浏览器可视区域显示。父元素需要有定位属性,如:position: relative",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "是否显示遮罩层",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "标题",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "控制对话框是否显示",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "对话框层级,Web 侧样式默认为 2500,移动端和小程序样式默认为 1500",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-confirm", "t-class-cancel"],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件",
+ "label": ""
+ },
+ {
+ "key": "bind:close",
+ "desc": "关闭事件,点击 取消按钮 或 点击蒙层 时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:overlay-click",
+ "desc": "如果蒙层存在,点击蒙层时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./dialog/dialog"
+ },
+ "t-divider": {
+ "key": "t-divider",
+ "label": "分割线",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-divider.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "文本位置(仅在水平分割线有效)",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "子元素",
+ "label": ""
+ },
+ {
+ "key": "dashed",
+ "type": ["Boolean"],
+ "desc": "是否虚线(仅在水平分割线有效)",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "分隔线类型有两种:水平和垂直",
+ "label": ""
+ },
+ {
+ "key": "lineColor",
+ "type": ["String"],
+ "desc": "分隔线颜色",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-line", "t-class-content"],
+ "tpl": "",
+ "path": "./divider/divider"
+ },
+ "t-drawer": {
+ "key": "t-drawer",
+ "label": "模态抽屉",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-drawer.png",
+ "properties": [
+ {
+ "key": "closeOnOverlayClick",
+ "type": ["Boolean"],
+ "desc": "点击蒙层时是否触发抽屉关闭事件",
+ "label": ""
+ },
+ {
+ "key": "destroyOnClose",
+ "type": ["Boolean"],
+ "desc": "抽屉关闭时是否销毁节点",
+ "label": ""
+ },
+ {
+ "key": "items",
+ "type": ["Array"],
+ "desc": "抽屉里的列表项",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "抽屉方向",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "是否显示遮罩层",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "组件是否可见",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "抽屉层级,样式默认为 1500",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:close",
+ "desc": "关闭事件,取消按钮点击时、关闭按钮点击时、点击蒙层时均会触发",
+ "label": ""
+ },
+ {
+ "key": "bind:item-click",
+ "desc": "点击抽屉里的列表项",
+ "label": ""
+ },
+ {
+ "key": "bind:overlay-click",
+ "desc": "如果蒙层存在,点击蒙层时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./drawer/drawer"
+ },
+ "t-dropdown-item": {
+ "key": "t-dropdown-item",
+ "label": "下拉菜单子项",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dropdownmenu.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "标题",
+ "label": ""
+ },
+ {
+ "key": "multiple",
+ "type": ["Boolean"],
+ "desc": "是否多选",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "选项数据",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./dropdown-menu/dropdown-item"
+ },
+ "t-dropdown-menu": {
+ "key": "t-dropdown-menu",
+ "label": "下拉菜单",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dropdownmenu.png",
+ "properties": [
+ {
+ "key": "activeColor",
+ "type": ["String"],
+ "desc": "【讨论中】菜单标题和选项的选中态颜色",
+ "label": ""
+ },
+ {
+ "key": "closeOnClickOverlay",
+ "type": ["Boolean"],
+ "desc": "是否在点击遮罩层后关闭菜单",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["String", "Number"],
+ "desc": "动画时长",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "是否显示遮罩层",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "菜单栏 z-index 层级",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "require": {
+ "t-dropdown-item": "./dropdown-menu/dropdown-item"
+ },
+ "path": "./dropdown-menu/dropdown-menu"
+ },
+ "t-empty": {
+ "key": "t-empty",
+ "label": "空状态",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-empty.png",
+ "properties": [
+ {
+ "key": "action",
+ "type": ["String"],
+ "desc": "操作按钮",
+ "label": ""
+ },
+ {
+ "key": "description",
+ "type": ["String"],
+ "desc": "描述文字",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标名称",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "图片地址",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-description", "t-class-image", "t-class-actions"],
+ "tpl": "",
+ "path": "./empty/empty"
+ },
+ "t-fab": {
+ "key": "t-fab",
+ "label": "悬浮按钮",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-fab.png",
+ "properties": [
+ {
+ "key": "buttonProps",
+ "type": ["Object"],
+ "desc": "透传至 Button 组件",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标",
+ "label": ""
+ },
+ {
+ "key": "style",
+ "type": ["String"],
+ "desc": "悬浮按钮的样式,常用于调整位置",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "文本内容",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "悬浮按钮点击事件",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./fab/fab"
+ },
+ "t-footer": {
+ "key": "t-footer",
+ "label": "布局-底部内容",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-footer.png",
+ "properties": [
+ {
+ "key": "copyright",
+ "type": ["String"],
+ "desc": "版权信息,type 为`text`生效",
+ "label": ""
+ },
+ {
+ "key": "logo",
+ "type": ["Object"],
+ "desc": "图标配置,type 为`logo`生效。`logo.icon` 表示图标链接地址,`logo.title` 表示标题文本,`logo.url` 表示链接跳转地址",
+ "label": ""
+ },
+ {
+ "key": "textLinkList",
+ "type": ["Array"],
+ "desc": "链接列表,type 为`text`生效。name 表示链接名称, url 表示链接 page 路径,目前只支持小程序内部跳转,openType 表示跳转方式",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "页脚展示类型",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./footer/footer"
+ },
+ "t-grid-item": {
+ "key": "t-grid-item",
+ "label": "宫格子项",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-grid.png",
+ "properties": [
+ {
+ "key": "badgeProps",
+ "type": ["Object"],
+ "desc": "头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字",
+ "label": ""
+ },
+ {
+ "key": "description",
+ "type": ["String"],
+ "desc": "文本以外的更多描述,辅助信息。可以通过 Props 传入文本,也可以自定义标题节点",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "图片,可以是图片地址,也可以自定义图片节点",
+ "label": ""
+ },
+ {
+ "key": "jumpType",
+ "type": ["String"],
+ "desc": "链接跳转类型",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "内容布局方式",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "文本,可以通过 Props 传入文本,也可以自定义标题节点",
+ "label": ""
+ },
+ {
+ "key": "url",
+ "type": ["String"],
+ "desc": "点击后的跳转链接",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-image", "t-class-text", "t-class-description"],
+ "tpl": "",
+ "path": "./grid-item/grid-item"
+ },
+ "t-grid": {
+ "key": "t-grid",
+ "label": "栅格",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-grid.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "内容对齐方式",
+ "label": ""
+ },
+ {
+ "key": "border",
+ "type": ["Boolean", "Object"],
+ "desc": "边框,默认不显示。值为 true 则显示默认边框,值类型为 object 则表示自定义边框样式",
+ "label": ""
+ },
+ {
+ "key": "column",
+ "type": ["Number"],
+ "desc": "每一行的列数量",
+ "label": ""
+ },
+ {
+ "key": "gutter",
+ "type": ["Number"],
+ "desc": "间隔大小",
+ "label": ""
+ },
+ {
+ "key": "hover",
+ "type": ["Boolean"],
+ "desc": "是否开启点击反馈",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "tpl": "",
+ "require": {
+ "t-grid-item": "./grid-item/grid-item"
+ },
+ "path": "./grid/grid"
+ },
+ "t-icon": {
+ "key": "t-icon",
+ "label": "图标",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-icon.png",
+ "properties": [
+ {
+ "key": "classPrefix",
+ "type": ["String"],
+ "desc": "自定义icon前缀",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "图标颜色",
+ "label": ""
+ },
+ {
+ "key": "style",
+ "type": ["String"],
+ "desc": "自定义样式",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "图标名称",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String", "Number"],
+ "desc": "图标名称",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./icon/icon"
+ },
+ "t-image": {
+ "key": "t-image",
+ "label": "图片",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-image.png",
+ "properties": [
+ {
+ "key": "error",
+ "type": ["String"],
+ "desc": "加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”",
+ "label": ""
+ },
+ {
+ "key": "lazy",
+ "type": ["Boolean"],
+ "desc": "是否开启图片懒加载",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["String"],
+ "desc": "加载态内容。值为 `default` 则表示使用默认加载中风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `loading`;值为其他则表示普通文本内容,如“加载中”",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "图片圆角类型",
+ "label": ""
+ },
+ {
+ "key": "src",
+ "type": ["String"],
+ "desc": "图片链接",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-load"],
+ "events": [
+ {
+ "key": "bind:error",
+ "desc": "图片加载失败时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:load",
+ "desc": "图片加载完成时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./image/image"
+ },
+ "t-indexes": {
+ "key": "t-indexes",
+ "label": "索引",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-indexes.png",
+ "properties": [
+ {
+ "key": "height",
+ "type": ["Number"],
+ "desc": "列表高度,未设置默认占满设备高度",
+ "label": ""
+ },
+ {
+ "key": "list",
+ "type": ["Array"],
+ "desc": "索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。",
+ "label": ""
+ },
+ {
+ "key": "sticky",
+ "type": ["Boolean"],
+ "desc": "索引是否吸顶,默认为true",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:select",
+ "desc": "点击行元素时触发事件",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./indexes/indexes"
+ },
+ "t-input": {
+ "key": "t-input",
+ "label": "输入框",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-input.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "文本内容位置,居左/居中/居右",
+ "label": ""
+ },
+ {
+ "key": "borderless",
+ "type": ["Boolean"],
+ "desc": "【讨论中】是否开启无边框模式",
+ "label": ""
+ },
+ {
+ "key": "clearable",
+ "type": ["Boolean"],
+ "desc": "是否可清空",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用输入框",
+ "label": ""
+ },
+ {
+ "key": "errorMessage",
+ "type": ["String"],
+ "desc": "错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips)",
+ "label": ""
+ },
+ {
+ "key": "format",
+ "type": ["String"],
+ "desc": "【开发中】指定输入框展示值的格式",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "左侧文本",
+ "label": ""
+ },
+ {
+ "key": "maxcharacter",
+ "type": ["Number"],
+ "desc": "用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用",
+ "label": ""
+ },
+ {
+ "key": "maxlength",
+ "type": ["Number"],
+ "desc": "用户最多可以输入的文本长度,一个中文等于一个计数长度。值小于等于 0 的时候,则表示不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用",
+ "label": ""
+ },
+ {
+ "key": "placeholder",
+ "type": ["String"],
+ "desc": "占位符",
+ "label": ""
+ },
+ {
+ "key": "prefixIcon",
+ "type": ["String"],
+ "desc": "组件前置图标,值为字符串则表示图标名称",
+ "label": ""
+ },
+ {
+ "key": "readonly",
+ "type": ["Boolean"],
+ "desc": "只读状态",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "输入框尺寸",
+ "label": ""
+ },
+ {
+ "key": "status",
+ "type": ["String"],
+ "desc": "输入框状态",
+ "label": ""
+ },
+ {
+ "key": "suffix",
+ "type": ["String"],
+ "desc": "后置图标前的后置内容",
+ "label": ""
+ },
+ {
+ "key": "suffixIcon",
+ "type": ["String"],
+ "desc": "后置文本内容,值为字符串则表示图标名称",
+ "label": ""
+ },
+ {
+ "key": "tips",
+ "type": ["String"],
+ "desc": "输入框下方提示文本,会根据不同的 `status` 呈现不同的样式",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "输入框的值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-input", "t-class-placeholder", "t-class-error-msg"],
+ "events": [
+ {
+ "key": "bind:blur",
+ "desc": "失去焦点时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "输入框值发生变化时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:clear",
+ "desc": "清空按钮点击时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:enter",
+ "desc": "回车键按下时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:focus",
+ "desc": "获得焦点时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./input/input"
+ },
+ "t-loading": {
+ "key": "t-loading",
+ "label": "加载中",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-loading.png",
+ "properties": [
+ {
+ "key": "delay",
+ "type": ["Number"],
+ "desc": "延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "加载动画执行完成一次的时间,单位:毫秒",
+ "label": ""
+ },
+ {
+ "key": "indicator",
+ "type": ["Boolean"],
+ "desc": "是否显示加载指示符",
+ "label": ""
+ },
+ {
+ "key": "inheritColor",
+ "type": ["Boolean"],
+ "desc": "是否继承父元素颜色",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "对齐方式",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "是否处于加载状态",
+ "label": ""
+ },
+ {
+ "key": "pause",
+ "type": ["Boolean"],
+ "desc": "是否暂停动画",
+ "label": ""
+ },
+ {
+ "key": "progress",
+ "type": ["Number"],
+ "desc": "加载进度",
+ "label": ""
+ },
+ {
+ "key": "reverse",
+ "type": ["Boolean"],
+ "desc": "加载动画是否反向",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "尺寸,示例:40rpx/20px",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "加载提示文案",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "加载组件类型",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-text", "t-class-indicator"],
+ "tpl": "",
+ "path": "./loading/loading"
+ },
+ "t-message": {
+ "key": "t-message",
+ "label": "全局提醒",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-message.png",
+ "properties": [
+ {
+ "key": "action",
+ "type": ["String"],
+ "desc": "操作",
+ "label": ""
+ },
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "文本对齐方式",
+ "label": ""
+ },
+ {
+ "key": "closeBtn",
+ "type": ["String", "Boolean"],
+ "desc": "关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string 则直接显示值,如:“关闭”。也可以完全自定义按钮",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "用于自定义消息弹出内容",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "消息内置计时器,计时到达时会触发 duration-end 事件。单位:毫秒。值为 0 则表示没有计时器。",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String", "Boolean"],
+ "desc": "消息提醒前面的图标。值为 true 则根据 theme 显示对应的图标,值为 false 则不显示图标。值为 'info' 或 'bell' 则显示组件内置图标。也可以完全自定义图标节点",
+ "label": ""
+ },
+ {
+ "key": "marquee",
+ "type": ["Boolean", "Object"],
+ "desc": "跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放",
+ "label": ""
+ },
+ {
+ "key": "offset",
+ "type": ["Array"],
+ "desc": "相对于 placement 的偏移量,示例:[-10, 20] 或 ['10rpx', '8rpx']",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "消息组件风格",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "是否显示,隐藏时默认销毁组件",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "元素层级,样式默认为 5000",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-icon", "t-class-action", "t-class-close-btn"],
+ "events": [
+ {
+ "key": "bind:action-btn-click",
+ "desc": "当操作按钮存在时,用户点击操作按钮时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:close-btn-click",
+ "desc": "当关闭按钮存在时,用户点击关闭按钮触发",
+ "label": ""
+ },
+ {
+ "key": "bind:duration-end",
+ "desc": "计时结束后触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./message/message"
+ },
+ "t-navbar": {
+ "key": "t-navbar",
+ "label": "导航条",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-navbar.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["Boolean"],
+ "desc": "是否添加动画效果",
+ "label": ""
+ },
+ {
+ "key": "background",
+ "type": ["String"],
+ "desc": "背景",
+ "label": ""
+ },
+ {
+ "key": "delta",
+ "type": ["Number"],
+ "desc": "后退按钮后退层数,含义参考 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html),特殊的,传入 0 不会发生执行 wx.navigateBack,只会触发一个 goback 事件供自行处理。",
+ "label": ""
+ },
+ {
+ "key": "fixed",
+ "type": ["Boolean"],
+ "desc": "是否固定在顶部",
+ "label": ""
+ },
+ {
+ "key": "homeIcon",
+ "type": ["String"],
+ "desc": "首页图标地址。值为 '' 或者 undefiend 则表示不显示返回图标,值为 'circle' 表示显示默认图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
+ "label": ""
+ },
+ {
+ "key": "leftIcon",
+ "type": ["String"],
+ "desc": "左侧图标地址,值为 '' 或者 undefiend 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "页面标题",
+ "label": ""
+ },
+ {
+ "key": "titleMaxLength",
+ "type": ["Number"],
+ "desc": "标题文字最大长度,超出的范围使用 `...` 表示",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "是否显示",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-title", "t-class-left-icon", "t-class-home-icon", "t-class-capsule"],
+ "events": [
+ {
+ "key": "bind:complete",
+ "desc": "navigateBack 执行完成后触发(失败或成功均会触发)",
+ "label": ""
+ },
+ {
+ "key": "bind:fail",
+ "desc": "navigateBack 执行失败后触发",
+ "label": ""
+ },
+ {
+ "key": "bind:go-back",
+ "desc": "delta 值为 0 时,点击返回,触发该事件",
+ "label": ""
+ },
+ {
+ "key": "bind:go-home",
+ "desc": "点击 Home 触发",
+ "label": ""
+ },
+ {
+ "key": "bind:success",
+ "desc": "navigateBack 执行成功后触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./navbar/navbar"
+ },
+ "t-picker-item": {
+ "key": "t-picker-item",
+ "label": "选择器子项",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-picker.png",
+ "properties": [
+ {
+ "key": "format",
+ "type": ["String"],
+ "desc": "格式化标签",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "数据源",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./picker-item/picker-item"
+ },
+ "t-picker": {
+ "key": "t-picker",
+ "label": "选择器",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-picker.png",
+ "properties": [
+ {
+ "key": "cancelBtn",
+ "type": ["String", "Object"],
+ "desc": "取消按钮文字",
+ "label": ""
+ },
+ {
+ "key": "confirmBtn",
+ "type": ["String", "Object"],
+ "desc": "确定按钮文字",
+ "label": ""
+ },
+ {
+ "key": "footer",
+ "type": ["String"],
+ "desc": "底部内容",
+ "label": ""
+ },
+ {
+ "key": "header",
+ "type": ["Boolean"],
+ "desc": "头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "标题",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Array"],
+ "desc": "选中值",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "是否显示",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "点击取消按钮时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "选中变化时候触发",
+ "label": ""
+ },
+ {
+ "key": "bind:pick",
+ "desc": "任何一列选中都会触发,不同的列参数不同。`context.column` 表示第几列变化,`context.index` 表示变化那一列的选中项下标",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "require": {
+ "t-picker-item": "./picker-item/picker-item"
+ },
+ "path": "./picker/picker"
+ },
+ "t-popup": {
+ "key": "t-popup",
+ "label": "气泡框",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-popup.png",
+ "properties": [
+ {
+ "key": "closeBtn",
+ "type": ["Boolean"],
+ "desc": "关闭按钮,值类型为 Boolean 时表示是否显示关闭按钮。也可以自定义关闭按钮",
+ "label": ""
+ },
+ {
+ "key": "closeOnOverlayClick",
+ "type": ["Boolean"],
+ "desc": "点击遮罩层是否关闭",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "浮层里面的内容",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "浮层出现位置",
+ "label": ""
+ },
+ {
+ "key": "preventScrollThrough",
+ "type": ["Boolean"],
+ "desc": "防止滚动穿透",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "是否显示遮罩层",
+ "label": ""
+ },
+ {
+ "key": "transitionProps",
+ "type": ["Object"],
+ "desc": "动画效果定义",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "是否显示浮层",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "组件层级,Web 侧样式默认为 5500,移动端和小程序样式默认为 1500",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-overlay", "t-class-content"],
+ "events": [
+ {
+ "key": "bind:visible-change",
+ "desc": "当浮层隐藏或显示时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./popup/popup"
+ },
+ "t-progress": {
+ "key": "t-progress",
+ "label": "进度条",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-progress.png",
+ "properties": [
+ {
+ "key": "color",
+ "type": ["String", "Object", "Array"],
+ "desc": "进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String", "Boolean"],
+ "desc": "进度百分比,可自定义",
+ "label": ""
+ },
+ {
+ "key": "percentage",
+ "type": ["Number"],
+ "desc": "进度条百分比",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String", "Number"],
+ "desc": "进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160",
+ "label": ""
+ },
+ {
+ "key": "status",
+ "type": ["String"],
+ "desc": "进度条状态",
+ "label": ""
+ },
+ {
+ "key": "strokeWidth",
+ "type": ["String", "Number"],
+ "desc": "进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间",
+ "label": ""
+ },
+ {
+ "key": "trackColor",
+ "type": ["String"],
+ "desc": "进度条未完成部分颜色",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./progress/progress"
+ },
+ "t-pull-down-refresh": {
+ "key": "t-pull-down-refresh",
+ "label": "下拉刷新",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-pulldownrefresh.png",
+ "properties": [
+ {
+ "key": "loadingBarHeight",
+ "type": ["String", "Number"],
+ "desc": "加载中下拉高度,如果值为数字则单位是:'px'",
+ "label": ""
+ },
+ {
+ "key": "loadingProps",
+ "type": ["Object"],
+ "desc": "加载loading样式",
+ "label": ""
+ },
+ {
+ "key": "loadingTexts",
+ "type": ["Array"],
+ "desc": "提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']",
+ "label": ""
+ },
+ {
+ "key": "maxBarHeight",
+ "type": ["String", "Number"],
+ "desc": "最大下拉高度,如果值为数字则单位是:'px'",
+ "label": ""
+ },
+ {
+ "key": "refreshTimeout",
+ "type": ["Number"],
+ "desc": "刷新超时时间",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Boolean"],
+ "desc": "组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-loading", "t-class-text", "t-class-indicator"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态",
+ "label": ""
+ },
+ {
+ "key": "bind:refresh",
+ "desc": "结束下拉时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:timeout",
+ "desc": "刷新超时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "拖拽该区域演示 中间下拉刷新",
+ "path": "./pull-down-refresh/pull-down-refresh"
+ },
+ "t-radio-group": {
+ "key": "t-radio-group",
+ "label": "单选框组",
+ "icon": "",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用全部子单选框",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "HTML 元素原生属性",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Boolean"],
+ "desc": "选中的值",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "选中值发生变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "require": {
+ "t-radio": "./radio/radio"
+ },
+ "path": "./radio-group/radio-group"
+ },
+ "t-radio": {
+ "key": "t-radio",
+ "label": "单选框",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-radio.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "复选框和内容相对位置",
+ "label": ""
+ },
+ {
+ "key": "allowUncheck",
+ "type": ["Boolean"],
+ "desc": "是否允许取消选中",
+ "label": ""
+ },
+ {
+ "key": "checked",
+ "type": ["Boolean"],
+ "desc": "是否选中",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "单选按钮颜色",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "单选内容",
+ "label": ""
+ },
+ {
+ "key": "contentDisabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件内容(content)触发选中",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否为禁用态",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String", "Array"],
+ "desc": "自定义选中图标和非选中图标。示例:[选中态图标,非选中态图标]。值为 fill-circle 表示图标为填充型图标,值为 stroke-line 表示图标为描边型图标",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "主文案",
+ "label": ""
+ },
+ {
+ "key": "maxContentRow",
+ "type": ["Number"],
+ "desc": "内容最大行数限制",
+ "label": ""
+ },
+ {
+ "key": "maxLabelRow",
+ "type": ["Number"],
+ "desc": "主文案最大行数限制",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "HTML 元素原生属性",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Boolean"],
+ "desc": "单选按钮的值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "值变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./radio/radio"
+ },
+ "t-rate": {
+ "key": "t-rate",
+ "label": "评分",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-rate.png",
+ "properties": [
+ {
+ "key": "allowHalf",
+ "type": ["Boolean"],
+ "desc": "是否允许半选",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String", "Array"],
+ "desc": "评分图标的颜色,样式中默认为 #ED7B2F。一个值表示设置选中高亮的五角星颜色,示例:[选中颜色]。数组则表示分别设置 选中高亮的五角星颜色 和 未选中暗灰的五角星颜色,[选中颜色,未选中颜色]。示例:['#ED7B2F', '#E3E6EB']",
+ "label": ""
+ },
+ {
+ "key": "count",
+ "type": ["Number"],
+ "desc": "评分的数量",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用评分",
+ "label": ""
+ },
+ {
+ "key": "gap",
+ "type": ["Number"],
+ "desc": "评分图标的间距",
+ "label": ""
+ },
+ {
+ "key": "showText",
+ "type": ["Boolean"],
+ "desc": "是否显示对应的辅助文字",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "评分图标的大小,示例:`20`",
+ "label": ""
+ },
+ {
+ "key": "texts",
+ "type": ["Array"],
+ "desc": "评分等级对应的辅助文字。组件内置默认值为:['极差', '失望', '一般', '满意', '惊喜']。自定义值示例:['1分', '2分', '3分', '4分', '5分']",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Number"],
+ "desc": "选择评分的值",
+ "label": ""
+ },
+ {
+ "key": "variant",
+ "type": ["String"],
+ "desc": "形状类型,有描边类型和填充类型两种",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "评分数改变时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./rate/rate"
+ },
+ "t-search": {
+ "key": "t-search",
+ "label": "搜索",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-search.png",
+ "properties": [
+ {
+ "key": "action",
+ "type": ["String"],
+ "desc": "自定义右侧操作按钮文字",
+ "label": ""
+ },
+ {
+ "key": "center",
+ "type": ["Boolean"],
+ "desc": "是否居中",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用",
+ "label": ""
+ },
+ {
+ "key": "focus",
+ "type": ["Boolean"],
+ "desc": "是否聚焦",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "左侧文本",
+ "label": ""
+ },
+ {
+ "key": "leftIcon",
+ "type": ["String"],
+ "desc": "左侧图标",
+ "label": ""
+ },
+ {
+ "key": "placeholder",
+ "type": ["String"],
+ "desc": "占位符",
+ "label": ""
+ },
+ {
+ "key": "rightIcon",
+ "type": ["String"],
+ "desc": "右侧图标",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "搜索框形状",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String"],
+ "desc": "值",
+ "label": ""
+ }
+ ],
+ "externalClasses": [
+ "t-class",
+ "t-class-input",
+ "t-class-input-container",
+ "t-class-cancel",
+ "t-class-left",
+ "t-class-right"
+ ],
+ "events": [
+ {
+ "key": "bind:action-click",
+ "desc": "点击右侧操作按钮文字时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:blur",
+ "desc": "失去焦点时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "值发生变化时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:clear",
+ "desc": "点击清除时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:focus",
+ "desc": "聚焦时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:submit",
+ "desc": "提交时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./search/search"
+ },
+ "t-skeleton": {
+ "key": "t-skeleton",
+ "label": "骨架屏",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-skeleton.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["String"],
+ "desc": "动画效果,有「渐变加载动画」和「闪烁加载动画」两种。值为 'none' 则表示没有动画",
+ "label": ""
+ },
+ {
+ "key": "delay",
+ "type": ["Number"],
+ "desc": "【开发中】延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "是否为加载状态,如果是则显示骨架图,如果不是则显示加载完成的内容",
+ "label": ""
+ },
+ {
+ "key": "rowCol",
+ "type": ["Array"],
+ "desc": "用于设置行列数量、宽度高度、间距等。【示例一】,`[1, 1, 2]` 表示输出三行骨架图,第一行一列,第二行一列,第三行两列。【示例二】,`[1, 1, { width: '100px' }]` 表示自定义第三行的宽度为 `100px`。【示例三】,`[1, 2, [{ width, height }, { width, height, marginLeft }]]` 表示第三行有两列,且自定义宽度、高度和间距",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "骨架图风格,有基础、头像组合等两大类",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-avatar", "t-class-image", "t-class-text"],
+ "tpl": "",
+ "path": "./skeleton/skeleton"
+ },
+ "t-slider": {
+ "key": "t-slider",
+ "label": "滑块",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-slider.png",
+ "properties": [
+ {
+ "key": "colors",
+ "type": ["Array"],
+ "desc": "颜色,[已选择, 未选择]",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件",
+ "label": ""
+ },
+ {
+ "key": "disabledColor",
+ "type": ["Array"],
+ "desc": "禁用状态滑动条的颜色,[已选, 未选]",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String", "Boolean"],
+ "desc": "滑块当前值文本。
值为 true 显示默认文案;值为 false 不显示滑块当前值文本;
值为 `${value}%` 则表示组件会根据占位符渲染文案;
值类型为函数时,参数 `value` 标识滑块值,参数 `position=start` 表示范围滑块的起始值,参数 `position=end` 表示范围滑块的终点值",
+ "label": ""
+ },
+ {
+ "key": "marks",
+ "type": ["Object", "Array"],
+ "desc": "刻度标记,示例:`[0, 10, 40, 200]` 或者 `{ 5: '5¥', 10: '10%' }`",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "滑块范围最大值",
+ "label": ""
+ },
+ {
+ "key": "min",
+ "type": ["Number"],
+ "desc": "滑块范围最小值",
+ "label": ""
+ },
+ {
+ "key": "range",
+ "type": ["Boolean"],
+ "desc": "双游标滑块",
+ "label": ""
+ },
+ {
+ "key": "showExtremeValue",
+ "type": ["Boolean"],
+ "desc": "是否边界值",
+ "label": ""
+ },
+ {
+ "key": "step",
+ "type": ["Number"],
+ "desc": "步长",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Number", "Array"],
+ "desc": "滑块值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-bar", "t-class-bar-active", "t-class-bar-disabled", "t-class-cursor"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "滑块值变化时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:dragend",
+ "desc": "结束拖动时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:dragstart",
+ "desc": "开始拖动时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./slider/slider"
+ },
+ "t-step-item": {
+ "key": "t-step-item",
+ "label": "步骤",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-steps.png",
+ "properties": [
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "步骤描述",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标。传入 slot 代表使用插槽,其他字符串代表使用内置图标",
+ "label": ""
+ },
+ {
+ "key": "status",
+ "type": ["String"],
+ "desc": "当前步骤的状态",
+ "label": ""
+ },
+ {
+ "key": "subStepItems",
+ "type": ["Array"],
+ "desc": "子步骤条,仅支持 layout = 'vertical' 时",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "标题",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-title", "t-class-description", "t-class-extra"],
+ "tpl": "",
+ "path": "./step-item/step-item"
+ },
+ "t-stepper": {
+ "key": "t-stepper",
+ "label": "步进器",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-stepper.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "禁用全部操作",
+ "label": ""
+ },
+ {
+ "key": "disableInput",
+ "type": ["Boolean"],
+ "desc": "禁用输入框",
+ "label": ""
+ },
+ {
+ "key": "inputWidth",
+ "type": ["Number"],
+ "desc": "输入框宽度",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "最大值",
+ "label": ""
+ },
+ {
+ "key": "min",
+ "type": ["Number"],
+ "desc": "最小值",
+ "label": ""
+ },
+ {
+ "key": "step",
+ "type": ["Number"],
+ "desc": "步长",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "组件风格",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-input", "t-class-add", "t-class-minus"],
+ "events": [
+ {
+ "key": "bind:blur",
+ "desc": "输入框失去焦点时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "数值发生变更时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:overlimit",
+ "desc": "数值超出限制时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./stepper/stepper"
+ },
+ "t-steps": {
+ "key": "t-steps",
+ "label": "步骤条",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-steps.png",
+ "properties": [
+ {
+ "key": "current",
+ "type": ["String", "Number"],
+ "desc": "当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成",
+ "label": ""
+ },
+ {
+ "key": "currentStatus",
+ "type": ["String"],
+ "desc": "用于控制 current 指向的步骤条的状态",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "步骤条方向,有两种:横向和纵向",
+ "label": ""
+ },
+ {
+ "key": "readonly",
+ "type": ["Boolean"],
+ "desc": "只读状态",
+ "label": ""
+ },
+ {
+ "key": "separator",
+ "type": ["String"],
+ "desc": "步骤条分割符",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "步骤条风格",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "当前步骤发生变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "require": {
+ "t-step-item": "./step-item/step-item"
+ },
+ "path": "./steps/steps"
+ },
+ "t-sticky": {
+ "key": "t-sticky",
+ "label": "吸顶容器",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-sticky.png",
+ "properties": [
+ {
+ "key": "container",
+ "type": ["String"],
+ "desc": "函数返回容器对应的 NodesRef 节点,将对应节点指定为组件的外部容器,滚动时组件会始终保持在容器范围内,当组件即将超出容器底部时,会返回原位置。",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件",
+ "label": ""
+ },
+ {
+ "key": "offsetTop",
+ "type": ["String", "Number"],
+ "desc": "吸顶时与顶部的距离,单位`px`",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "吸顶时的 z-index",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:scroll",
+ "desc": "滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./sticky/sticky"
+ },
+ "t-swipe-cell": {
+ "key": "t-swipe-cell",
+ "label": "滑动操作",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-swipecell.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用滑动",
+ "label": ""
+ },
+ {
+ "key": "expanded",
+ "type": ["String"],
+ "desc": "操作项是否呈现为打开态",
+ "label": ""
+ },
+ {
+ "key": "left",
+ "type": ["Array"],
+ "desc": "左侧滑动操作项。所有行为同 `right`",
+ "label": ""
+ },
+ {
+ "key": "right",
+ "type": ["Array"],
+ "desc": "右侧滑动操作项。有两种定义方式,一种是使用数组,二种是使用插槽。`right.text` 表示操作文本,`right.className` 表示操作项类名,`right.style` 表示操作项样式,`right.onClick` 表示点击操作项后执行的回调函数。示例:`[{ text: '删除', style: 'background-color: red', onClick: () => {} }]`",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)",
+ "label": ""
+ }
+ ],
+ "tpl": "删除",
+ "require": {
+ "t-cell": "./cell/cell"
+ },
+ "path": "./swipe-cell/swipe-cell"
+ },
+ "t-swiper": {
+ "key": "t-swiper",
+ "label": "轮播",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-swiper.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["String"],
+ "desc": "轮播切换动画效果类型",
+ "label": ""
+ },
+ {
+ "key": "autoplay",
+ "type": ["Boolean"],
+ "desc": "是否自动播放",
+ "label": ""
+ },
+ {
+ "key": "current",
+ "type": ["Number"],
+ "desc": "当前轮播在哪一项(下标)",
+ "label": ""
+ },
+ {
+ "key": "direction",
+ "type": ["String"],
+ "desc": "轮播滑动方向,包括横向滑动和纵向滑动两个方向",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "滑动动画时长",
+ "label": ""
+ },
+ {
+ "key": "height",
+ "type": ["Number"],
+ "desc": "当使用垂直方向滚动时的高度",
+ "label": ""
+ },
+ {
+ "key": "interval",
+ "type": ["Number"],
+ "desc": "轮播间隔时间",
+ "label": ""
+ },
+ {
+ "key": "loop",
+ "type": ["Boolean"],
+ "desc": "是否循环播放",
+ "label": ""
+ },
+ {
+ "key": "navigation",
+ "type": ["Object"],
+ "desc": "导航器全部配置",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "轮播切换时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "require": {
+ "t-swiper-item": "./swiper/swiper-item"
+ },
+ "path": "./swiper/swiper"
+ },
+ "t-switch": {
+ "key": "t-switch",
+ "label": "开关",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-switch.png",
+ "properties": [
+ {
+ "key": "colors",
+ "type": ["Array"],
+ "desc": "自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray]",
+ "label": ""
+ },
+ {
+ "key": "customValue",
+ "type": ["Array"],
+ "desc": "开关内容,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用组件",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "开关的标签",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "是否处于加载中状态",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "开关尺寸",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Boolean"],
+ "desc": "开关值",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "数据发生变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./switch/switch"
+ },
+ "t-tab-bar-item": {
+ "key": "t-tab-bar-item",
+ "label": "标签栏选项",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabbar.png",
+ "properties": [
+ {
+ "key": "badgeProps",
+ "type": ["Object"],
+ "desc": "图标右上角提示信息",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "图标名称",
+ "label": ""
+ },
+ {
+ "key": "subTabBar",
+ "type": ["Array"],
+ "desc": "二级菜单",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "标识符",
+ "label": ""
+ }
+ ],
+ "tpl": "{{item.label}}",
+ "path": "./tab-bar-item/tab-bar-item"
+ },
+ "t-tab-bar": {
+ "key": "t-tab-bar",
+ "label": "标签栏",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabbar.png",
+ "properties": [
+ {
+ "key": "bordered",
+ "type": ["Boolean"],
+ "desc": "是否显示外边框",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["Array"],
+ "desc": "标签颜色设置。示例:[选中标签的颜色, 未选中的标签颜色]",
+ "label": ""
+ },
+ {
+ "key": "fixed",
+ "type": ["Boolean"],
+ "desc": "是否固定在底部",
+ "label": ""
+ },
+ {
+ "key": "safeAreaInsetBottom",
+ "type": ["Boolean"],
+ "desc": "是否为 iPhoneX 留出底部安全距离",
+ "label": ""
+ },
+ {
+ "key": "split",
+ "type": ["Boolean"],
+ "desc": "是否需要分割线",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Array"],
+ "desc": "当前选中标签的索引",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "选中标签切换时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "{{item.label}}",
+ "require": {
+ "t-tab-bar-item": "./tab-bar-item/tab-bar-item"
+ },
+ "path": "./tab-bar/tab-bar"
+ },
+ "t-tab-panel": {
+ "key": "t-tab-panel",
+ "label": "选项卡面板",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabs.png",
+ "properties": [
+ {
+ "key": "destroyOnHide",
+ "type": ["Boolean"],
+ "desc": "选项卡内容隐藏时是否销毁",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用当前选项卡",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "选项卡名称",
+ "label": ""
+ },
+ {
+ "key": "panel",
+ "type": ["String"],
+ "desc": "用于自定义选项卡面板内容",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "选项卡的值,唯一标识",
+ "label": ""
+ }
+ ],
+ "tpl": "标签一内容",
+ "path": "./tab-panel/tab-panel"
+ },
+ "t-tabs": {
+ "key": "t-tabs",
+ "label": "选项卡",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabs.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["Object"],
+ "desc": "动画效果设置。其中 duration 表示动画时长",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "选项卡位置",
+ "label": ""
+ },
+ {
+ "key": "showBottomLine",
+ "type": ["Boolean"],
+ "desc": "是否展示底部激活线条",
+ "label": ""
+ },
+ {
+ "key": "stickyProps",
+ "type": ["Object"],
+ "desc": "是否支持吸顶",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "激活的选项卡值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-item", "t-class-active", "t-class-track"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "激活的选项卡发生变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "标签一内容标签二内容",
+ "require": {
+ "t-tab-panel": "./tab-panel/tab-panel"
+ },
+ "path": "./tabs/tabs"
+ },
+ "t-tag": {
+ "key": "t-tag",
+ "label": "标签",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tag.png",
+ "properties": [
+ {
+ "key": "closable",
+ "type": ["Boolean"],
+ "desc": "标签是否可关闭",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "标签中的图标,可自定义图标呈现",
+ "label": ""
+ },
+ {
+ "key": "maxWidth",
+ "type": ["String", "Number"],
+ "desc": "标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "标签类型,有三种:方形、圆角方形、标记型",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "标签尺寸",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "组件风格,用于描述组件不同的应用场景",
+ "label": ""
+ },
+ {
+ "key": "variant",
+ "type": ["String"],
+ "desc": "标签风格变体",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "点击时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:close",
+ "desc": "如果关闭按钮存在,点击关闭按钮时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "重要",
+ "path": "./tag/tag"
+ },
+ "t-textarea": {
+ "key": "t-textarea",
+ "label": "文本输入框",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-textarea.png",
+ "properties": [
+ {
+ "key": "adjustPosition",
+ "type": ["Boolean"],
+ "desc": "键盘弹起时,是否自动上推页面",
+ "label": ""
+ },
+ {
+ "key": "autofocus",
+ "type": ["Boolean"],
+ "desc": "自动聚焦,拉起键盘",
+ "label": ""
+ },
+ {
+ "key": "autosize",
+ "type": ["Boolean"],
+ "desc": "是否自动增高,值为 autosize 时,style.height 不生效",
+ "label": ""
+ },
+ {
+ "key": "confirmHold",
+ "type": ["Boolean"],
+ "desc": "点击键盘右下角按钮时是否保持键盘不收起点",
+ "label": ""
+ },
+ {
+ "key": "confirmType",
+ "type": ["String"],
+ "desc": "设置键盘右下角按钮的文字,仅在 type='text'时生效",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "是否禁用文本框",
+ "label": ""
+ },
+ {
+ "key": "focus",
+ "type": ["Boolean"],
+ "desc": "自动聚焦",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "左侧文本",
+ "label": ""
+ },
+ {
+ "key": "maxcharacter",
+ "type": ["Number"],
+ "desc": "用户最多可以输入的字符个数,一个中文汉字表示两个字符长度",
+ "label": ""
+ },
+ {
+ "key": "maxlength",
+ "type": ["Number"],
+ "desc": "用户最多可以输入的字符个数",
+ "label": ""
+ },
+ {
+ "key": "placeholder",
+ "type": ["String"],
+ "desc": "占位符",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String"],
+ "desc": "文本框值",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-textarea", "t-class-placeholder", "t-class-name"],
+ "events": [
+ {
+ "key": "bind:blur",
+ "desc": "失去焦点时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "输入内容变化时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:enter",
+ "desc": "点击完成时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:focus",
+ "desc": "获得焦点时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:line-change",
+ "desc": "行高发生变化时触发",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./textarea/textarea"
+ },
+ "t-toast": {
+ "key": "t-toast",
+ "label": "轻提示",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-toast.png",
+ "properties": [
+ {
+ "key": "direction",
+ "type": ["String"],
+ "desc": "图标排列方式",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "弹窗显示毫秒数",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "自定义图标",
+ "label": ""
+ },
+ {
+ "key": "message",
+ "type": ["String"],
+ "desc": "弹窗显示文字",
+ "label": ""
+ },
+ {
+ "key": "overlayProps",
+ "type": ["Object"],
+ "desc": "遮罩层属性,透传至 Overlay",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "弹窗展示位置",
+ "label": ""
+ },
+ {
+ "key": "preventScrollThrough",
+ "type": ["Boolean"],
+ "desc": "防止滚动穿透,即不允许点击和滚动",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "是否显示遮罩层",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "提示类型",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "tpl": "",
+ "path": "./toast/toast"
+ },
+ "t-transition": {
+ "key": "t-transition",
+ "label": "动画",
+ "icon": "",
+ "properties": [
+ {
+ "key": "appear",
+ "type": ["Boolean"],
+ "desc": "首次出现是否展示动画",
+ "label": ""
+ },
+ {
+ "key": "customClass",
+ "type": ["String"],
+ "desc": "自定义容器类名",
+ "label": ""
+ },
+ {
+ "key": "destoryOnClose",
+ "type": ["Boolean"],
+ "desc": "隐藏时是否销毁内容",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "指定过渡时间",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "过渡类名",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "是否显示",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./transition/transition"
+ },
+ "t-upload": {
+ "key": "t-upload",
+ "label": "上传",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-upload.png",
+ "properties": [
+ {
+ "key": "addContent",
+ "type": ["String"],
+ "desc": "添加按钮内容。值为空,使用默认图标渲染;值为 slot 则表示使用插槽渲染;其他值无效。",
+ "label": ""
+ },
+ {
+ "key": "allowUploadDuplicateFile",
+ "type": ["Boolean"],
+ "desc": "是否允许重复上传相同文件名的文件",
+ "label": ""
+ },
+ {
+ "key": "config",
+ "type": ["Object"],
+ "desc": "图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)",
+ "label": ""
+ },
+ {
+ "key": "deleteBtn",
+ "type": ["String"],
+ "desc": "删除图标。值为空,使用默认图标渲染;值为 slot 则表示使用插槽渲染;其他值无效。",
+ "label": ""
+ },
+ {
+ "key": "fileListDisplay",
+ "type": ["String"],
+ "desc": "用于完全自定义文件列表内容",
+ "label": ""
+ },
+ {
+ "key": "files",
+ "type": ["Array"],
+ "desc": "已上传文件列表",
+ "label": ""
+ },
+ {
+ "key": "gridConfig",
+ "type": ["Object"],
+ "desc": "upload组件每行上传图片列数以及图片的宽度和高度",
+ "label": ""
+ },
+ {
+ "key": "gutter",
+ "type": ["Number"],
+ "desc": "预览窗格的 `gutter` 大小,单位 rpx",
+ "label": ""
+ },
+ {
+ "key": "imageProps",
+ "type": ["Object"],
+ "desc": "透传 Image 组件全部属性",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "用于控制文件上传数量,值为 0 则不限制",
+ "label": ""
+ },
+ {
+ "key": "mediaType",
+ "type": ["Array"],
+ "desc": "支持上传的文件类型,图片或视频",
+ "label": ""
+ },
+ {
+ "key": "requestMethod",
+ "type": ["String"],
+ "desc": "自定义上传方法",
+ "label": ""
+ },
+ {
+ "key": "sizeLimit",
+ "type": ["Number", "Object"],
+ "desc": "图片文件大小限制,单位 KB。可选单位有:`'B' | 'KB' | 'MB' | 'GB'`。示例一:`1000`。示例二:`{ size: 2, unit: 'MB', message: '图片大小不超过 {sizeLimit} MB' }`",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:add",
+ "desc": "上传成功后触发,仅包含本次选择的照片;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述",
+ "label": ""
+ },
+ {
+ "key": "bind:complete",
+ "desc": "上传成功或失败后触发",
+ "label": ""
+ },
+ {
+ "key": "bind:fail",
+ "desc": "上传失败后触发",
+ "label": ""
+ },
+ {
+ "key": "bind:remove",
+ "desc": "移除文件时触发",
+ "label": ""
+ },
+ {
+ "key": "bind:select-change",
+ "desc": "选择文件或图片之后,上传之前,触发该事件。
`files` 表示之前已经上传完成的文件列表。
`currentSelectedFiles` 表示本次上传选中的文件列表",
+ "label": ""
+ },
+ {
+ "key": "bind:success",
+ "desc": "上传成功后触发,包含所有上传的文件;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述",
+ "label": ""
+ }
+ ],
+ "tpl": "",
+ "path": "./upload/upload"
+ }
+ },
+ "common": {
+ "properties": {},
+ "events": {}
+ },
+ "menu": [
+ {
+ "key": "menu-basic",
+ "label": "基础",
+ "submenu": [
+ {
+ "key": "subMenu-button",
+ "label": "Button 按钮",
+ "components": ["t-button"]
+ },
+ {
+ "key": "subMenu-divider",
+ "label": "Divider 分割线",
+ "components": ["t-divider"]
+ },
+ {
+ "key": "subMenu-fab",
+ "label": "Fab 悬浮按钮",
+ "components": ["t-fab"]
+ },
+ {
+ "key": "subMenu-icon",
+ "label": "Icon 图标",
+ "components": ["t-icon"]
+ }
+ ]
+ },
+ {
+ "key": "menu-nav",
+ "label": "导航",
+ "submenu": [
+ {
+ "key": "subMenu-drawer",
+ "label": "Drawer 抽屉",
+ "components": ["t-drawer"]
+ },
+ {
+ "key": "subMenu-indexes",
+ "label": "Indexes 索引",
+ "components": ["t-indexes"]
+ },
+ {
+ "key": "subMenu-navbar",
+ "label": "Navbar 导航条",
+ "components": ["t-navbar"]
+ },
+ {
+ "key": "subMenu-steps",
+ "label": "Steps 步骤条",
+ "components": ["t-steps"]
+ },
+ {
+ "key": "subMenu-tabbar",
+ "label": "TabBar 标签栏",
+ "components": ["t-tab-bar"]
+ },
+ {
+ "key": "subMenu-tabs",
+ "label": "Tabs 选项卡",
+ "components": ["t-tabs"]
+ }
+ ]
+ },
+ {
+ "key": "menu-input",
+ "label": "输入",
+ "submenu": [
+ {
+ "key": "subMenu-checkbox",
+ "label": "CheckBox 复选框",
+ "components": ["t-checkbox"]
+ },
+ {
+ "key": "subMenu-dateTimePicker",
+ "label": "DateTimePicker 时间选择器",
+ "components": ["t-date-time-picker"]
+ },
+ {
+ "key": "subMenu-input",
+ "label": "Input 输入框",
+ "components": ["t-input"]
+ },
+ {
+ "key": "subMenu-picker",
+ "label": "Picker 选择器",
+ "components": ["t-picker"]
+ },
+ {
+ "key": "subMenu-radio",
+ "label": "Radio 单选框",
+ "components": ["t-radio"]
+ },
+ {
+ "key": "subMenu-rate",
+ "label": "Rate 评分",
+ "components": ["t-rate"]
+ },
+ {
+ "key": "subMenu-search",
+ "label": "Search 搜索框",
+ "components": ["t-search"]
+ },
+ {
+ "key": "subMenu-slider",
+ "label": "Slider 滑动选择器",
+ "components": ["t-slider"]
+ },
+ {
+ "key": "subMenu-stepper",
+ "label": "Stepper 步进器",
+ "components": ["t-stepper"]
+ },
+ {
+ "key": "subMenu-switch",
+ "label": "Switch 开关",
+ "components": ["t-switch"]
+ },
+ {
+ "key": "subMenu-textarea",
+ "label": "Textarea 多行文本框",
+ "components": ["t-textarea"]
+ },
+ {
+ "key": "subMenu-upload",
+ "label": "UpLoad 上传",
+ "components": ["t-upload"]
+ }
+ ]
+ },
+ {
+ "key": "menu-data",
+ "label": "数据展示",
+ "submenu": [
+ {
+ "key": "subMenu-avatar",
+ "label": "Avatar 头像",
+ "components": ["t-avatar"]
+ },
+ {
+ "key": "subMenu-badge",
+ "label": "Badge 徽标",
+ "components": ["t-badge"]
+ },
+ {
+ "key": "subMenu-cell",
+ "label": "Cell 单元格",
+ "components": ["t-cell"]
+ },
+ {
+ "key": "subMenu-collapse",
+ "label": "Collapse 折叠面板",
+ "components": ["t-collapse"]
+ },
+ {
+ "key": "subMenu-dropdown-menu",
+ "label": "DropdownMenu 下拉菜单",
+ "components": ["t-dropdown-menu"]
+ },
+ {
+ "key": "subMenu-empty",
+ "label": "Empty 空状态",
+ "components": ["t-empty"]
+ },
+ {
+ "key": "subMenu-footer",
+ "label": "Footer 页脚",
+ "components": ["t-footer"]
+ },
+ {
+ "key": "subMenu-grid",
+ "label": "Grid 宫格",
+ "components": ["t-grid"]
+ },
+ {
+ "key": "subMenu-image",
+ "label": "Image 图片",
+ "components": ["t-image"]
+ },
+ {
+ "key": "subMenu-skeleton",
+ "label": "Skeleton 骨架屏",
+ "components": ["t-skeleton"]
+ },
+ {
+ "key": "subMenu-sticky",
+ "label": "Sticky 吸顶容器",
+ "components": ["t-sticky"]
+ },
+ {
+ "key": "subMenu-swiper",
+ "label": "Swiper 轮播图",
+ "components": ["t-swiper"]
+ },
+ {
+ "key": "subMenu-tag",
+ "label": "Tag 标签",
+ "components": ["t-tag"]
+ }
+ ]
+ },
+ {
+ "key": "menu-info",
+ "label": "消息提醒",
+ "submenu": [
+ {
+ "key": "subMenu-actionsheet",
+ "label": "ActionSheet 动作面板",
+ "components": ["t-action-sheet"]
+ },
+ {
+ "key": "subMenu-back-top",
+ "label": "BackTop 返回顶部",
+ "components": ["t-back-top"]
+ },
+ {
+ "key": "subMenu-dialog",
+ "label": "Dialog 弹出框",
+ "components": ["t-dialog"]
+ },
+ {
+ "key": "subMenu-loading",
+ "label": "Loading 加载",
+ "components": ["t-loading"]
+ },
+ {
+ "key": "subMenu-message",
+ "label": "Message 消息通知",
+ "components": ["t-message"]
+ },
+ {
+ "key": "subMenu-popup",
+ "label": "Popup 弹出层",
+ "components": ["t-popup"]
+ },
+ {
+ "key": "subMenu-progress",
+ "label": "Progress 进度条",
+ "components": ["t-progress"]
+ },
+ {
+ "key": "subMenu-pullDownRefresh",
+ "label": "PullDownRefresh 下拉刷新",
+ "components": ["t-pull-down-refresh"]
+ },
+ {
+ "key": "subMenu-swipeCell",
+ "label": "SwipeCell 滑动操作",
+ "components": ["t-swipe-cell"]
+ },
+ {
+ "key": "subMenu-toast",
+ "label": "Toast 轻提示",
+ "components": ["t-toast"]
+ }
+ ]
+ }
+ ]
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/action-sheet/README.en-US.md
new file mode 100644
index 0000000..c2e750e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/README.en-US.md
@@ -0,0 +1,52 @@
+:: BASE_DOC ::
+
+## API
+
+### ActionSheet 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
+align | String | center | `0.29.0`。options: center/left | N
+cancel-text | String | - | \- | N
+count | Number | 8 | \- | N
+description | String | - | `0.29.0` | N
+items | Array | - | required。Typescript:`Array` `interface ActionSheetItem {label: string; color?: string; disabled?: boolean;icon?: string;suffixIcon?: string; }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/action-sheet/type.ts) | Y
+popup-props | Object | {} | Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/action-sheet/type.ts) | N
+show-cancel | Boolean | true | \- | N
+show-overlay | Boolean | true | \- | N
+theme | String | list | options: list/grid | N
+using-custom-navbar | Boolean | false | \- | N
+visible | Boolean | false | required | Y
+default-visible | Boolean | undefined | required。uncontrolled property | Y
+
+### ActionSheet Events
+
+name | params | description
+-- | -- | --
+cancel | \- | \-
+close | `(trigger: TriggerSource)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/action-sheet/type.ts)。
`type TriggerSource = 'overlay' \| 'command' \| 'select' `
+selected | `(selected: ActionSheetItem \| string, index: number)` | \-
+### ActionSheet External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-cancel | \-
+t-class-content | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-action-sheet-border-color | @gray-color-1 | -
+--td-action-sheet-border-radius | @radius-extra-large | -
+--td-action-sheet-cancel-color | @font-gray-1 | -
+--td-action-sheet-cancel-height | 96rpx | -
+--td-action-sheet-color | @font-gray-1 | -
+--td-action-sheet-description-color | @font-gray-3 | -
+--td-action-sheet-list-item-disabled-color | @font-gray-4 | -
+--td-action-sheet-list-item-height | 112rpx | -
+--td-action-sheet-text-align | center | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/README.md b/miniprogram_npm/tdesign-miniprogram/action-sheet/README.md
new file mode 100644
index 0000000..97d176a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/README.md
@@ -0,0 +1,140 @@
+---
+title: ActionSheet 动作面板
+description: 由用户操作后触发的一种特定的模态弹出框 ,呈现一组与当前情境相关的两个或多个选项。
+spline: data
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.9.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-action-sheet": "tdesign-miniprogram/action-sheet/action-sheet",
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+列表型动作面板
+
+{{ list }}
+
+宫格型动作面板
+
+{{ grid }}
+
+### 组件状态
+
+宫格型动作面板
+
+{{ status }}
+
+### 组件样式
+
+列表型对齐方式
+
+{{ align }}
+
+### 支持指令调用
+
+```javascript
+import ActionSheet, { ActionSheetTheme } from 'tdesign-miniprogram/action-sheet/index';
+
+// 指令调用不同于组件引用不需要传入visible
+const basicListOption: ActionSheetShowOption = {
+ theme: ActionSheetTheme.List,
+ selector: '#t-action-sheet',
+ items: [
+ {
+ label: '默认选项',
+ },
+ {
+ label: '失效选项',
+ disabled: true,
+ },
+ {
+ label: '警告选项',
+ color: '#e34d59',
+ },
+ ],
+};
+
+const handler = ActionSheet.show(basicListOption);
+```
+
+指令调用的关闭如下
+
+```javascript
+handler.close();
+```
+
+
+## API
+
+### ActionSheet Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+align | String | center | `0.29.0`。水平对齐方式。可选项:center/left | N
+cancel-text | String | - | 设置取消按钮的文本 | N
+count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
+description | String | - | `0.29.0`。动作面板描述文字 | N
+items | Array | - | 必需。菜单项。TS 类型:`Array` `interface ActionSheetItem {label: string; color?: string; disabled?: boolean;icon?: string;suffixIcon?: string; }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/action-sheet/type.ts) | Y
+popup-props | Object | {} | popupProps透传。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/action-sheet/type.ts) | N
+show-cancel | Boolean | true | 是否显示取消按钮 | N
+show-overlay | Boolean | true | 是否显示遮罩层 | N
+theme | String | list | 展示类型,列表和表格形式展示。可选项:list/grid | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+visible | Boolean | false | 必需。显示与隐藏 | Y
+default-visible | Boolean | undefined | 必需。显示与隐藏。非受控属性 | Y
+
+### ActionSheet Events
+
+名称 | 参数 | 描述
+-- | -- | --
+cancel | \- | 点击取消按钮时触发
+close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/action-sheet/type.ts)。
`type TriggerSource = 'overlay' \| 'command' \| 'select' `
+selected | `(selected: ActionSheetItem \| string, index: number)` | 选择菜单项时触发
+### ActionSheet External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-cancel | 取消样式类
+t-class-content | 内容样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-action-sheet-border-color | @gray-color-1 | -
+--td-action-sheet-border-radius | @radius-extra-large | -
+--td-action-sheet-cancel-color | @font-gray-1 | -
+--td-action-sheet-cancel-height | 96rpx | -
+--td-action-sheet-color | @font-gray-1 | -
+--td-action-sheet-description-color | @font-gray-3 | -
+--td-action-sheet-list-item-disabled-color | @font-gray-4 | -
+--td-action-sheet-list-item-height | 112rpx | -
+--td-action-sheet-text-align | center | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.d.ts b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.d.ts
new file mode 100644
index 0000000..853d815
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.d.ts
@@ -0,0 +1,87 @@
+import { SuperComponent } from '../common/src/index';
+export default class ActionSheet extends SuperComponent {
+ static show: (options: import("./show").ActionSheetShowOption) => WechatMiniprogram.Component.TrivialInstance;
+ behaviors: string[];
+ externalClasses: string[];
+ properties: {
+ align?: {
+ type: StringConstructor;
+ value?: "center" | "left";
+ };
+ cancelText?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ count?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ items: {
+ type: ArrayConstructor;
+ value?: (string | import("./type").ActionSheetItem)[];
+ required?: boolean;
+ };
+ popupProps?: {
+ type: ObjectConstructor;
+ value?: import("../popup").TdPopupProps;
+ };
+ showCancel?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: "list" | "grid";
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible: {
+ type: BooleanConstructor;
+ value?: boolean;
+ required?: boolean;
+ };
+ defaultVisible: {
+ type: BooleanConstructor;
+ value?: boolean;
+ required?: boolean;
+ };
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ gridThemeItems: any[];
+ currentSwiperIndex: number;
+ defaultPopUpProps: {};
+ defaultPopUpzIndex: number;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ 'visible, items'(visible: boolean): void;
+ };
+ methods: {
+ init(): void;
+ memoInitialData(): void;
+ splitGridThemeActions(): void;
+ show(options: any): void;
+ close(): void;
+ onPopupVisibleChange({ detail }: {
+ detail: any;
+ }): void;
+ onSwiperChange(e: WechatMiniprogram.TouchEvent): void;
+ onSelect(event: WechatMiniprogram.TouchEvent): void;
+ onCancel(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.js b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.js
new file mode 100644
index 0000000..157e6b0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.js
@@ -0,0 +1,111 @@
+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 { chunk } from '../common/utils';
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import { ActionSheetTheme, show } from './show';
+import props from './props';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-action-sheet`;
+let ActionSheet = class ActionSheet extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [useCustomNavbar];
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`, `${prefix}-class-cancel`];
+ this.properties = Object.assign({}, props);
+ this.data = {
+ prefix,
+ classPrefix: name,
+ gridThemeItems: [],
+ currentSwiperIndex: 0,
+ defaultPopUpProps: {},
+ defaultPopUpzIndex: 11500,
+ };
+ this.controlledProps = [
+ {
+ key: 'visible',
+ event: 'visible-change',
+ },
+ ];
+ this.observers = {
+ 'visible, items'(visible) {
+ if (!visible)
+ return;
+ this.init();
+ },
+ };
+ this.methods = {
+ init() {
+ this.memoInitialData();
+ this.splitGridThemeActions();
+ },
+ memoInitialData() {
+ this.initialData = Object.assign(Object.assign({}, this.properties), this.data);
+ },
+ splitGridThemeActions() {
+ if (this.data.theme !== ActionSheetTheme.Grid)
+ return;
+ this.setData({
+ gridThemeItems: chunk(this.data.items, this.data.count),
+ });
+ },
+ show(options) {
+ this.setData(Object.assign(Object.assign(Object.assign({}, this.initialData), options), { visible: true }));
+ this.splitGridThemeActions();
+ this.autoClose = true;
+ this._trigger('visible-change', { visible: true });
+ },
+ close() {
+ this.triggerEvent('close', { trigger: 'command' });
+ this._trigger('visible-change', { visible: false });
+ },
+ onPopupVisibleChange({ detail }) {
+ if (!detail.visible) {
+ this.triggerEvent('close', { trigger: 'overlay' });
+ this._trigger('visible-change', { visible: false });
+ }
+ if (this.autoClose) {
+ this.setData({ visible: false });
+ this.autoClose = false;
+ }
+ },
+ onSwiperChange(e) {
+ const { current } = e.detail;
+ this.setData({
+ currentSwiperIndex: current,
+ });
+ },
+ onSelect(event) {
+ const { currentSwiperIndex, items, gridThemeItems, count, theme } = this.data;
+ const { index } = event.currentTarget.dataset;
+ const isSwiperMode = theme === ActionSheetTheme.Grid;
+ const item = isSwiperMode ? gridThemeItems[currentSwiperIndex][index] : items[index];
+ const realIndex = isSwiperMode ? index + currentSwiperIndex * count : index;
+ if (item) {
+ this.triggerEvent('selected', { selected: item, index: realIndex });
+ if (!item.disabled) {
+ this.triggerEvent('close', { trigger: 'select' });
+ this._trigger('visible-change', { visible: false });
+ }
+ }
+ },
+ onCancel() {
+ this.triggerEvent('cancel');
+ if (this.autoClose) {
+ this.setData({ visible: false });
+ this.autoClose = false;
+ }
+ },
+ };
+ }
+};
+ActionSheet.show = show;
+ActionSheet = __decorate([
+ wxComponent()
+], ActionSheet);
+export default ActionSheet;
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.json b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.json
new file mode 100644
index 0000000..70f0a29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.json
@@ -0,0 +1,10 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-popup": "../popup/popup",
+ "t-grid": "../grid/grid",
+ "t-grid-item": "../grid-item/grid-item"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxml b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxml
new file mode 100644
index 0000000..4db9925
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+ {{description}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxs b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxs
new file mode 100644
index 0000000..af7a695
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxs
@@ -0,0 +1,19 @@
+var getListThemeItemClass = function (props) {
+ var classPrefix = props.classPrefix;
+ var item = props.item;
+ var prefix = props.prefix;
+ var classList = [classPrefix + '__list-item'];
+ if (item.disabled) {
+ classList.push(prefix + '-is-disabled');
+ }
+ return classList.join(' ');
+};
+
+var isImage = function (name) {
+ return name.indexOf('/') !== -1;
+};
+
+module.exports = {
+ getListThemeItemClass: getListThemeItemClass,
+ isImage: isImage,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxss b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxss
new file mode 100644
index 0000000..c647d5a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.wxss
@@ -0,0 +1,169 @@
+.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-action-sheet__content {
+ color: var(--td-action-sheet-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ border-top-left-radius: var(--td-action-sheet-border-radius, var(--td-radius-extra-large, 24rpx));
+ border-top-right-radius: var(--td-action-sheet-border-radius, var(--td-radius-extra-large, 24rpx));
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ overflow: hidden;
+}
+.t-action-sheet__content--grid {
+ padding-top: 16rpx;
+}
+.t-action-sheet__content:focus {
+ outline: 0;
+}
+.t-action-sheet__grid {
+ padding-bottom: 16rpx;
+}
+.t-action-sheet__grid--swiper {
+ padding-bottom: 48rpx;
+}
+.t-action-sheet__description {
+ color: var(--td-action-sheet-description-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ line-height: 44rpx;
+ font-size: 28rpx;
+ text-align: var(--td-action-sheet-text-align, center);
+ padding: 24rpx 32rpx;
+ position: relative;
+}
+.t-action-sheet__description:focus {
+ outline: 0;
+}
+.t-action-sheet__description::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-action-sheet-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-action-sheet__description::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-action-sheet__description--left {
+ text-align: left;
+}
+.t-action-sheet__description--left::after {
+ left: 32rpx;
+}
+.t-action-sheet__list-item {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ height: var(--td-action-sheet-list-item-height, 112rpx);
+ padding: 0 32rpx;
+}
+.t-action-sheet__list-item::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-action-sheet-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-action-sheet__list-item::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-action-sheet__list-item:focus {
+ outline: 0;
+}
+.t-action-sheet__list-item--left {
+ justify-content: start;
+}
+.t-action-sheet__list-item--left::after {
+ left: 32rpx;
+}
+.t-action-sheet__list-item--disabled {
+ color: var(--td-action-sheet-list-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-action-sheet__list-item-text {
+ font-size: var(--td-font-size-m, 32rpx);
+ word-wrap: normal;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.t-action-sheet__list-item-icon {
+ margin-right: 16rpx;
+}
+.t-action-sheet__list-item-icon--suffix {
+ margin-left: auto;
+}
+.t-action-sheet__swiper-wrap {
+ margin-top: 8rpx;
+ position: relative;
+}
+.t-action-sheet__footer {
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+}
+.t-action-sheet__gap-list {
+ height: 16rpx;
+ background-color: var(--td-action-sheet-gap-color, var(--td-bg-color-page, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-action-sheet__gap-grid {
+ height: 1rpx;
+ background-color: var(--td-action-sheet-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-action-sheet__cancel {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--td-action-sheet-cancel-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ height: var(--td-action-sheet-cancel-height, 96rpx);
+}
+.t-action-sheet__dots {
+ position: absolute;
+ left: 50%;
+ bottom: 32rpx;
+ transform: translateX(-50%);
+ display: flex;
+ flex-direction: row;
+}
+.t-action-sheet__dots-item {
+ width: 16rpx;
+ height: 16rpx;
+ background-color: #dcdcdc;
+ border-radius: 50%;
+ margin: 0 16rpx;
+ transition: all 0.4s ease-in;
+}
+.t-action-sheet__dots-item.t-is-active {
+ background-color: #0052d9;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/index.d.ts b/miniprogram_npm/tdesign-miniprogram/action-sheet/index.d.ts
new file mode 100644
index 0000000..5c41389
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/index.d.ts
@@ -0,0 +1,8 @@
+///
+import { ActionSheetItem, ActionSheetTheme, ActionSheetShowOption } from './show';
+export { ActionSheetItem, ActionSheetTheme, ActionSheetShowOption };
+declare const _default: {
+ show(options: ActionSheetShowOption): WechatMiniprogram.Component.TrivialInstance;
+ close(options: ActionSheetShowOption): void;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/index.js b/miniprogram_npm/tdesign-miniprogram/action-sheet/index.js
new file mode 100644
index 0000000..7fcdd3c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/index.js
@@ -0,0 +1,10 @@
+import { show, close, ActionSheetTheme } from './show';
+export { ActionSheetTheme };
+export default {
+ show(options) {
+ return show(options);
+ },
+ close(options) {
+ return close(options);
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/props.d.ts b/miniprogram_npm/tdesign-miniprogram/action-sheet/props.d.ts
new file mode 100644
index 0000000..0fff787
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/props.d.ts
@@ -0,0 +1,3 @@
+import { TdActionSheetProps } from './type';
+declare const props: TdActionSheetProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/props.js b/miniprogram_npm/tdesign-miniprogram/action-sheet/props.js
new file mode 100644
index 0000000..5a86e41
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/props.js
@@ -0,0 +1,53 @@
+const props = {
+ align: {
+ type: String,
+ value: 'center',
+ },
+ cancelText: {
+ type: String,
+ value: '',
+ },
+ count: {
+ type: Number,
+ value: 8,
+ },
+ description: {
+ type: String,
+ value: '',
+ },
+ items: {
+ type: Array,
+ required: true,
+ },
+ popupProps: {
+ type: Object,
+ value: {},
+ },
+ showCancel: {
+ type: Boolean,
+ value: true,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ theme: {
+ type: String,
+ value: 'list',
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ visible: {
+ type: Boolean,
+ value: null,
+ required: true,
+ },
+ defaultVisible: {
+ type: Boolean,
+ value: false,
+ required: true,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/show.d.ts b/miniprogram_npm/tdesign-miniprogram/action-sheet/show.d.ts
new file mode 100644
index 0000000..824502a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/show.d.ts
@@ -0,0 +1,31 @@
+///
+///
+export interface ActionSheetItem {
+ label: string;
+ color?: string;
+ disabled?: boolean;
+ icon?: string;
+}
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+export declare enum ActionSheetTheme {
+ List = "list",
+ Grid = "grid"
+}
+interface ActionSheetProps {
+ align: 'center' | 'left';
+ cancelText?: string;
+ count?: number;
+ description: string;
+ items: Array;
+ showCancel?: boolean;
+ theme?: ActionSheetTheme;
+ visible: boolean;
+ defaultVisible?: boolean;
+}
+export interface ActionSheetShowOption extends Omit {
+ context?: Context;
+ selector?: string;
+}
+export declare const show: (options: ActionSheetShowOption) => WechatMiniprogram.Component.TrivialInstance;
+export declare const close: (options: ActionSheetShowOption) => void;
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/show.js b/miniprogram_npm/tdesign-miniprogram/action-sheet/show.js
new file mode 100644
index 0000000..44b0365
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/show.js
@@ -0,0 +1,33 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import { getInstance } from '../common/utils';
+export var ActionSheetTheme;
+(function (ActionSheetTheme) {
+ ActionSheetTheme["List"] = "list";
+ ActionSheetTheme["Grid"] = "grid";
+})(ActionSheetTheme || (ActionSheetTheme = {}));
+export const show = function (options) {
+ const _a = Object.assign({}, options), { context, selector = '#t-action-sheet' } = _a, otherOptions = __rest(_a, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.show(Object.assign({}, otherOptions));
+ return instance;
+ }
+ console.error('未找到组件,请确认 selector && context 是否正确');
+};
+export const close = function (options) {
+ const { context, selector = '#t-action-sheet' } = Object.assign({}, options);
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.close();
+ }
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/template/grid.wxml b/miniprogram_npm/tdesign-miniprogram/action-sheet/template/grid.wxml
new file mode 100644
index 0000000..8f6f20d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/template/grid.wxml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/template/list.wxml b/miniprogram_npm/tdesign-miniprogram/action-sheet/template/list.wxml
new file mode 100644
index 0000000..04f2e34
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/template/list.wxml
@@ -0,0 +1,20 @@
+
+
+
+ {{item.label || item}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/type.d.ts b/miniprogram_npm/tdesign-miniprogram/action-sheet/type.d.ts
new file mode 100644
index 0000000..3fb8bdc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/type.d.ts
@@ -0,0 +1,61 @@
+import { PopupProps } from '../popup/index';
+export interface TdActionSheetProps {
+ align?: {
+ type: StringConstructor;
+ value?: 'center' | 'left';
+ };
+ cancelText?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ count?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ items: {
+ type: ArrayConstructor;
+ value?: Array;
+ required?: boolean;
+ };
+ popupProps?: {
+ type: ObjectConstructor;
+ value?: PopupProps;
+ };
+ showCancel?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'list' | 'grid';
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible: {
+ type: BooleanConstructor;
+ value?: boolean;
+ required?: boolean;
+ };
+ defaultVisible: {
+ type: BooleanConstructor;
+ value?: boolean;
+ required?: boolean;
+ };
+}
+export interface ActionSheetItem {
+ label: string;
+ color?: string;
+ disabled?: boolean;
+ icon?: string;
+ suffixIcon?: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/action-sheet/type.js b/miniprogram_npm/tdesign-miniprogram/action-sheet/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/action-sheet/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.d.ts b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.d.ts
new file mode 100644
index 0000000..e131442
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.d.ts
@@ -0,0 +1,28 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class AvatarGroup extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdAvatarGroupProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ hasChild: boolean;
+ length: number;
+ className: string;
+ };
+ options: {
+ multipleSlots: boolean;
+ };
+ relations: RelationsOptions;
+ lifetimes: {
+ attached(): void;
+ ready(): void;
+ };
+ observers: {
+ 'cascading, size'(): void;
+ };
+ methods: {
+ setClass(): void;
+ handleMax(): void;
+ onCollapsedItemClick(e: WechatMiniprogram.CustomEvent): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.js b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.js
new file mode 100644
index 0000000..f85c574
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.js
@@ -0,0 +1,81 @@
+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 avatarGroupProps from './props';
+const { prefix } = config;
+const name = `${prefix}-avatar-group`;
+let AvatarGroup = class AvatarGroup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`, `${prefix}-class-image`];
+ this.properties = avatarGroupProps;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ hasChild: true,
+ length: 0,
+ className: '',
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.relations = {
+ '../avatar/avatar': {
+ type: 'descendant',
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.setClass();
+ },
+ ready() {
+ this.setData({
+ length: this.$children.length,
+ });
+ this.handleMax();
+ },
+ };
+ this.observers = {
+ 'cascading, size'() {
+ this.setClass();
+ },
+ };
+ this.methods = {
+ setClass() {
+ const { cascading, size } = this.properties;
+ const direction = cascading.split('-')[0];
+ const classList = [
+ name,
+ `${prefix}-class`,
+ `${name}-offset-${direction}`,
+ `${name}-offset-${direction}-${size.indexOf('px') > -1 ? 'medium' : size || 'medium'}`,
+ ];
+ this.setData({
+ className: classList.join(' '),
+ });
+ },
+ handleMax() {
+ const { max } = this.data;
+ const len = this.$children.length;
+ if (!max || max > len)
+ return;
+ const restAvatars = this.$children.splice(max, len - max);
+ restAvatars.forEach((child) => {
+ child.hide();
+ });
+ },
+ onCollapsedItemClick(e) {
+ this.triggerEvent('collapsed-item-click', e.detail);
+ },
+ };
+ }
+};
+AvatarGroup = __decorate([
+ wxComponent()
+], AvatarGroup);
+export default AvatarGroup;
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.json b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.json
new file mode 100644
index 0000000..9b5763d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "shared",
+ "usingComponents": {
+ "t-avatar": "../avatar/avatar"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.wxml b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.wxml
new file mode 100644
index 0000000..1e2f6cd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+ {{collapseAvatar}}
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.wxss b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.wxss
new file mode 100644
index 0000000..8c0a287
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.wxss
@@ -0,0 +1,214 @@
+.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-avatar-group {
+ display: inline-flex;
+ flex-wrap: wrap;
+ align-items: center;
+}
+.t-avatar-group-offset-left .t-avatar__wrapper,
+.t-avatar-group-offset-right .t-avatar__wrapper {
+ padding: var(--td-avatar-group-line-spacing, 4rpx) 0;
+}
+.t-avatar-group-offset-left-small,
+.t-avatar-group-offset-right-small {
+ --td-avatar-margin-left: var(--td-avatar-group-margin-left-small, -16rpx);
+}
+.t-avatar-group-offset-left-medium,
+.t-avatar-group-offset-right-medium {
+ --td-avatar-margin-left: var(--td-avatar-group-margin-left-medium, -16rpx);
+}
+.t-avatar-group-offset-left-large,
+.t-avatar-group-offset-right-large {
+ --td-avatar-margin-left: var(--td-avatar-group-margin-left-large, -16rpx);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(1) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 1);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(2) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 2);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(3) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 3);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(4) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 4);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(5) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 5);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(6) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 6);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(7) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 7);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(8) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 8);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(9) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 9);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(10) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 10);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(11) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 11);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(12) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 12);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(13) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 13);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(14) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 14);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(15) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 15);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(16) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 16);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(17) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 17);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(18) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 18);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(19) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 19);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(20) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 20);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(21) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 21);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(22) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 22);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(23) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 23);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(24) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 24);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(25) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 25);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(26) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 26);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(27) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 27);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(28) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 28);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(29) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 29);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(30) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 30);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(31) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 31);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(32) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 32);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(33) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 33);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(34) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 34);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(35) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 35);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(36) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 36);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(37) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 37);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(38) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 38);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(39) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 39);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(40) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 40);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(41) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 41);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(42) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 42);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(43) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 43);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(44) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 44);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(45) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 45);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(46) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 46);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(47) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 47);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(48) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 48);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(49) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 49);
+}
+.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(50) {
+ z-index: calc(var(--td-avatar-group-init-z-index, 50) - 50);
+}
+.t-avatar-group__collapse--slot,
+.t-avatar-group__collapse--default {
+ z-index: 0;
+ font-weight: 600;
+}
+.t-avatar-group__collapse--slot {
+ float: left;
+}
+.t-avatar-group__collapse--slot:not(:empty) + .t-avatar-group__collapse--default {
+ display: none;
+ float: left;
+}
+.t-avatar-group__collapse--slot:empty + .t-avatar-group__collapse--default {
+ display: block;
+ float: left;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/props.d.ts b/miniprogram_npm/tdesign-miniprogram/avatar-group/props.d.ts
new file mode 100644
index 0000000..892b866
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/props.d.ts
@@ -0,0 +1,3 @@
+import { TdAvatarGroupProps } from './type';
+declare const props: TdAvatarGroupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/props.js b/miniprogram_npm/tdesign-miniprogram/avatar-group/props.js
new file mode 100644
index 0000000..22d65c2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/props.js
@@ -0,0 +1,20 @@
+const props = {
+ cascading: {
+ type: String,
+ value: 'left-up',
+ },
+ collapseAvatar: {
+ type: String,
+ },
+ max: {
+ type: Number,
+ },
+ shape: {
+ type: String,
+ },
+ size: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/type.d.ts b/miniprogram_npm/tdesign-miniprogram/avatar-group/type.d.ts
new file mode 100644
index 0000000..7f233f4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/type.d.ts
@@ -0,0 +1,24 @@
+import { ShapeEnum } from '../common/common';
+export interface TdAvatarGroupProps {
+ cascading?: {
+ type: StringConstructor;
+ value?: CascadingValue;
+ };
+ collapseAvatar?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: ShapeEnum;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
+export declare type CascadingValue = 'left-up' | 'right-up';
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar-group/type.js b/miniprogram_npm/tdesign-miniprogram/avatar-group/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar-group/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/avatar/README.en-US.md
new file mode 100644
index 0000000..63f4c90
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/README.en-US.md
@@ -0,0 +1,91 @@
+:: BASE_DOC ::
+
+## API
+
+### Avatar 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
+alt | String | - | show it when url is not valid | N
+badge-props | Object | - | Typescript:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/avatar/type.ts) | N
+bordered | Boolean | false | \- | N
+hide-on-load-failed | Boolean | false | hide image when loading image failed | N
+icon | String / Object | - | \- | N
+image | String | - | images url | N
+image-props | Object | - | Typescript:`ImageProps`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/avatar/type.ts) | N
+shape | String | - | shape。options: circle/round。Typescript:`ShapeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+size | String | - | size | N
+
+### Avatar Events
+
+name | params | description
+-- | -- | --
+error | - | trigger on image load failed
+
+### Avatar External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-alt | \-
+t-class-content | \-
+t-class-icon | \-
+t-class-image | \-
+
+
+### AvatarGroup 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
+cascading | String | 'left-up' | multiple images cascading。options: left-up/right-up。Typescript:`CascadingValue` `type CascadingValue = 'left-up' \| 'right-up'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/avatar-group/type.ts) | N
+collapse-avatar | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max | Number | - | \- | N
+shape | String | - | shape。options: circle/round。Typescript:`ShapeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+size | String | - | size | N
+
+### AvatarGroup Events
+
+name | params | description
+-- | -- | --
+collapsed-item-click | - | \-
+
+### AvatarGroup External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+t-class-image | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-avatar-group-init-z-index | @avatar-group-init-zIndex) - @i | -
+--td-avatar-group-line-spacing | 4rpx | -
+--td-avatar-group-margin-left-large | -16rpx | -
+--td-avatar-group-margin-left-medium | -16rpx | -
+--td-avatar-group-margin-left-small | -16rpx | -
+--td-avatar-bg-color | @brand-color-light-active | -
+--td-avatar-border-color | #fff | -
+--td-avatar-border-width-large | 6rpx | -
+--td-avatar-border-width-medium | 4rpx | -
+--td-avatar-border-width-small | 2rpx | -
+--td-avatar-circle-border-radius | @radius-circle | -
+--td-avatar-content-color | @brand-color | -
+--td-avatar-icon-large-font-size | 64rpx | -
+--td-avatar-icon-medium-font-size | 48rpx | -
+--td-avatar-icon-small-font-size | 40rpx | -
+--td-avatar-large-width | 128rpx | -
+--td-avatar-margin-left | 0 | -
+--td-avatar-medium-width | 96rpx | -
+--td-avatar-round-border-radius | @radius-default | -
+--td-avatar-small-width | 80rpx | -
+--td-avatar-text-large-font-size | @font-size-xl | -
+--td-avatar-text-medium-font-size | @font-size-m | -
+--td-avatar-text-small-font-size | @font-size-base | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/README.md b/miniprogram_npm/tdesign-miniprogram/avatar/README.md
new file mode 100644
index 0000000..f399a8d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/README.md
@@ -0,0 +1,151 @@
+---
+title: Avatar 头像
+description: 用于展示用户头像信息,除了纯展示也可点击进入个人详情等操作。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-avatar": "tdesign-miniprogram/avatar/avatar",
+ "t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 头像类型
+
+图片头像
+
+{{ image-avatar }}
+
+字符头像
+
+{{ character-avatar }}
+
+图标头像
+
+{{ icon-avatar }}
+
+徽标头像
+
+{{ badge-avatar }}
+
+
+### 组合头像
+
+纯展示
+
+{{ exhibition }}
+
+带操作
+
+{{ action }}
+
+### 头像尺寸
+
+头像 large/medium/small 尺寸
+
+{{ size }}
+
+## API
+
+### Avatar Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+alt | String | - | 头像替换文本,仅当图片加载失败时有效 | N
+badge-props | Object | - | 头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字。TS 类型:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/avatar/type.ts) | N
+bordered | Boolean | false | 已废弃。是否显示外边框 | N
+hide-on-load-failed | Boolean | false | 加载失败时隐藏图片 | N
+icon | String / Object | - | 图标。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。 | N
+image | String | - | 图片地址 | N
+image-props | Object | - | 透传至 Image 组件。TS 类型:`ImageProps`,[Image API Documents](./image?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/avatar/type.ts) | N
+shape | String | - | 形状。优先级高于 AvatarGroup.shape 。Avatar 单独存在时,默认值为 circle。如果父组件 AvatarGroup 存在,默认值便由 AvatarGroup.shape 决定。可选项:circle/round。TS 类型:`ShapeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+size | String | - | 尺寸,示例值:small/medium/large/24px/38px 等。优先级高于 AvatarGroup.size 。Avatar 单独存在时,默认值为 medium。如果父组件 AvatarGroup 存在,默认值便由 AvatarGroup.size 决定 | N
+
+### Avatar Events
+
+名称 | 参数 | 描述
+-- | -- | --
+error | - | 图片加载失败时触发
+
+### Avatar External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-alt | 替代文本样式类
+t-class-content | 内容样式类
+t-class-icon | 图标样式类
+t-class-image | 图片样式类
+
+
+### AvatarGroup Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+cascading | String | 'left-up' | 图片之间的层叠关系,可选值:左侧图片在上和右侧图片在上。可选项:left-up/right-up。TS 类型:`CascadingValue` `type CascadingValue = 'left-up' \| 'right-up'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/avatar-group/type.ts) | N
+collapse-avatar | String / Slot | - | 头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5`,`...`, `更多`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max | Number | - | 能够同时显示的最多头像数量 | N
+shape | String | - | 形状。优先级低于 Avatar.shape。可选项:circle/round。TS 类型:`ShapeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+size | String | - | 尺寸,示例值:small/medium/large/24px/38px 等。优先级低于 Avatar.size | N
+
+### AvatarGroup Events
+
+名称 | 参数 | 描述
+-- | -- | --
+collapsed-item-click | - | 点击头像折叠元素触发
+
+### AvatarGroup External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-image | 图片样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-avatar-group-init-z-index | @avatar-group-init-zIndex) - @i | -
+--td-avatar-group-line-spacing | 4rpx | -
+--td-avatar-group-margin-left-large | -16rpx | -
+--td-avatar-group-margin-left-medium | -16rpx | -
+--td-avatar-group-margin-left-small | -16rpx | -
+--td-avatar-bg-color | @brand-color-light-active | -
+--td-avatar-border-color | #fff | -
+--td-avatar-border-width-large | 6rpx | -
+--td-avatar-border-width-medium | 4rpx | -
+--td-avatar-border-width-small | 2rpx | -
+--td-avatar-circle-border-radius | @radius-circle | -
+--td-avatar-content-color | @brand-color | -
+--td-avatar-icon-large-font-size | 64rpx | -
+--td-avatar-icon-medium-font-size | 48rpx | -
+--td-avatar-icon-small-font-size | 40rpx | -
+--td-avatar-large-width | 128rpx | -
+--td-avatar-margin-left | 0 | -
+--td-avatar-medium-width | 96rpx | -
+--td-avatar-round-border-radius | @radius-default | -
+--td-avatar-small-width | 80rpx | -
+--td-avatar-text-large-font-size | @font-size-xl | -
+--td-avatar-text-medium-font-size | @font-size-m | -
+--td-avatar-text-small-font-size | @font-size-base | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/avatar.d.ts b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.d.ts
new file mode 100644
index 0000000..4ecd9f6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.d.ts
@@ -0,0 +1,22 @@
+///
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Avatar extends SuperComponent {
+ options: WechatMiniprogram.Component.ComponentOptions;
+ externalClasses: string[];
+ properties: import("./type").TdAvatarProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ isShow: boolean;
+ zIndex: number;
+ systemInfo: WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
+ };
+ relations: RelationsOptions;
+ observers: {
+ icon(icon: any): void;
+ };
+ methods: {
+ hide(): void;
+ onLoadError(e: WechatMiniprogram.CustomEvent): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/avatar.js b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.js
new file mode 100644
index 0000000..5deab7d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.js
@@ -0,0 +1,73 @@
+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 avatarProps from './props';
+import { setIcon, systemInfo } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-avatar`;
+let Avatar = class Avatar extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-image`,
+ `${prefix}-class-icon`,
+ `${prefix}-class-alt`,
+ `${prefix}-class-content`,
+ ];
+ this.properties = avatarProps;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ isShow: true,
+ zIndex: 0,
+ systemInfo,
+ };
+ this.relations = {
+ '../avatar-group/avatar-group': {
+ type: 'ancestor',
+ linked(parent) {
+ this.parent = parent;
+ this.setData({
+ shape: this.data.shape || parent.data.shape || 'circle',
+ size: this.data.size || parent.data.size,
+ bordered: true,
+ });
+ },
+ },
+ };
+ this.observers = {
+ icon(icon) {
+ const obj = setIcon('icon', icon, '');
+ this.setData(Object.assign({}, obj));
+ },
+ };
+ this.methods = {
+ hide() {
+ this.setData({
+ isShow: false,
+ });
+ },
+ onLoadError(e) {
+ if (this.properties.hideOnLoadFailed) {
+ this.setData({
+ isShow: false,
+ });
+ }
+ this.triggerEvent('error', e.detail);
+ },
+ };
+ }
+};
+Avatar = __decorate([
+ wxComponent()
+], Avatar);
+export default Avatar;
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/avatar.json b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.json
new file mode 100644
index 0000000..15361c2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-badge": "../badge/badge",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxml b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxml
new file mode 100644
index 0000000..8aaf5ff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxs b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxs
new file mode 100644
index 0000000..240a956
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxs
@@ -0,0 +1,30 @@
+module.exports = {
+ getClass: function (classPrefix, size, shape, bordered) {
+ var hasPx = (size || '').indexOf('px') > -1;
+ var borderSize = hasPx ? 'medium' : size;
+ var classNames = [
+ classPrefix,
+ classPrefix + (shape === 'round' ? '--round' : '--circle'),
+ bordered ? classPrefix + '--border' + ' ' + classPrefix + '--border-' + borderSize : '',
+ hasPx ? '' : classPrefix + '--' + size,
+ ];
+ return classNames.join(' ');
+ },
+
+ getSize: function (size = 'medium', systemInfo) {
+ var res = getRegExp('^([0-9]+)(px|rpx)$').exec(size);
+
+ if (res && res.length >= 3) {
+ var px = res[1];
+ if (res[2] === 'rpx') {
+ px = Math.floor((systemInfo.windowWidth * res[1]) / 750);
+ }
+
+ return 'width:' + size + ';height:' + size + ';font-size:' + ((px / 8) * 3 + 2) + 'px';
+ }
+ },
+
+ getStyles: function (isShow) {
+ return isShow ? '' : 'display: none;';
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxss b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxss
new file mode 100644
index 0000000..5d1b506
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/avatar.wxss
@@ -0,0 +1,104 @@
+.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-avatar {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ background-color: var(--td-avatar-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+ color: var(--td-avatar-content-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-avatar__wrapper {
+ display: inline-flex;
+ position: relative;
+ vertical-align: top;
+ margin-left: var(--td-avatar-margin-left, 0);
+}
+.t-avatar--large {
+ width: var(--td-avatar-large-width, 128rpx);
+ height: var(--td-avatar-large-width, 128rpx);
+ font-size: var(--td-avatar-text-large-font-size, var(--td-font-size-xl, 40rpx));
+}
+.t-avatar--large .t-avatar__icon {
+ font-size: var(--td-avatar-icon-large-font-size, 64rpx);
+}
+.t-avatar--medium {
+ width: var(--td-avatar-medium-width, 96rpx);
+ height: var(--td-avatar-medium-width, 96rpx);
+ font-size: var(--td-avatar-text-medium-font-size, var(--td-font-size-m, 32rpx));
+}
+.t-avatar--medium .t-avatar__icon {
+ font-size: var(--td-avatar-icon-medium-font-size, 48rpx);
+}
+.t-avatar--small {
+ width: var(--td-avatar-small-width, 80rpx);
+ height: var(--td-avatar-small-width, 80rpx);
+ font-size: var(--td-avatar-text-small-font-size, var(--td-font-size-base, 28rpx));
+}
+.t-avatar--small .t-avatar__icon {
+ font-size: var(--td-avatar-icon-small-font-size, 40rpx);
+}
+.t-avatar .t-image,
+.t-avatar__image {
+ width: 100%;
+ height: 100%;
+}
+.t-avatar--circle {
+ border-radius: var(--td-avatar-circle-border-radius, var(--td-radius-circle, 50%));
+ overflow: hidden;
+}
+.t-avatar--round {
+ border-radius: var(--td-avatar-round-border-radius, var(--td-radius-default, 12rpx));
+ overflow: hidden;
+}
+.t-avatar__text,
+.t-avatar__icon {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-avatar__text:empty,
+.t-avatar__icon:empty {
+ width: 0;
+ height: 0;
+}
+.t-avatar--border {
+ border-color: var(--td-avatar-border-color, #fff);
+ border-style: solid;
+}
+.t-avatar--border-small {
+ border-width: var(--td-avatar-border-width-small, 2rpx);
+}
+.t-avatar--border-medium {
+ border-width: var(--td-avatar-border-width-medium, 4rpx);
+}
+.t-avatar--border-large {
+ border-width: var(--td-avatar-border-width-large, 6rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/avatar/props.d.ts
new file mode 100644
index 0000000..f3e7907
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdAvatarProps } from './type';
+declare const props: TdAvatarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/props.js b/miniprogram_npm/tdesign-miniprogram/avatar/props.js
new file mode 100644
index 0000000..9aba4c5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/props.js
@@ -0,0 +1,35 @@
+const props = {
+ alt: {
+ type: String,
+ value: '',
+ },
+ badgeProps: {
+ type: Object,
+ },
+ bordered: {
+ type: Boolean,
+ value: false,
+ },
+ hideOnLoadFailed: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ image: {
+ type: String,
+ value: '',
+ },
+ imageProps: {
+ type: Object,
+ },
+ shape: {
+ type: String,
+ },
+ size: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/avatar/type.d.ts
new file mode 100644
index 0000000..79cac9d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/type.d.ts
@@ -0,0 +1,41 @@
+import { BadgeProps } from '../badge/index';
+import { ImageProps } from '../image/index';
+import { ShapeEnum } from '../common/common';
+export interface TdAvatarProps {
+ alt?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: BadgeProps;
+ };
+ bordered?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ hideOnLoadFailed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ imageProps?: {
+ type: ObjectConstructor;
+ value?: ImageProps;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: ShapeEnum;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/avatar/type.js b/miniprogram_npm/tdesign-miniprogram/avatar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/avatar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/back-top/README.en-US.md
new file mode 100644
index 0000000..558178c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/README.en-US.md
@@ -0,0 +1,41 @@
+:: BASE_DOC ::
+
+## API
+
+### BackTop 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
+fixed | Boolean | true | \- | N
+icon | String / Boolean / Object / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+scroll-top | Number | 0 | \- | N
+text | String | '' | \- | N
+theme | String | round | options: round/half-round/round-dark/half-round-dark | N
+visibility-height | Number | 200 | \- | N
+
+### BackTop Events
+
+name | params | description
+-- | -- | --
+to-top | \- | \-
+### BackTop External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-icon | \-
+t-class-text | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-back-top-round-bg-color | @font-white-1 | -
+--td-back-top-round-border-color | @component-border | -
+--td-back-top-round-border-radius | @radius-circle | -
+--td-back-top-round-color | @font-gray-1 | -
+--td-back-top-round-dark-bg-color | @gray-color-14 | -
+--td-back-top-round-dark-color | @font-white-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/README.md b/miniprogram_npm/tdesign-miniprogram/back-top/README.md
new file mode 100644
index 0000000..50b2c28
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/README.md
@@ -0,0 +1,72 @@
+---
+title: BackTop 返回顶部
+description: 用于当页面过长往下滑动时,帮助用户快速回到页面顶部。
+spline: navigation
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+"t-back-top": "tdesign-miniprogram/back-top/back-top",
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+
+
+### 基础返回顶部
+
+{{ base }}
+
+## API
+
+### BackTop Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+fixed | Boolean | true | 是否绝对定位固定到屏幕右下方 | N
+icon | String / Boolean / Object / Slot | true | 图标。值为 `false` 表示不显示图标。不传表示使用默认图标 `'backtop'`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+scroll-top | Number | 0 | 页面滚动距离 | N
+text | String | '' | 文案 | N
+theme | String | round | 预设的样式类型。可选项:round/half-round/round-dark/half-round-dark | N
+visibility-height | Number | 200 | 滚动高度达到此参数值才出现 | N
+
+### BackTop Events
+
+名称 | 参数 | 描述
+-- | -- | --
+to-top | \- | 点击触发
+### BackTop External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-icon | 图标样式类
+t-class-text | 文本样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-back-top-round-bg-color | @font-white-1 | -
+--td-back-top-round-border-color | @component-border | -
+--td-back-top-round-border-radius | @radius-circle | -
+--td-back-top-round-color | @font-gray-1 | -
+--td-back-top-round-dark-bg-color | @gray-color-14 | -
+--td-back-top-round-dark-color | @font-white-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/back-top.d.ts b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.d.ts
new file mode 100644
index 0000000..ced948c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.d.ts
@@ -0,0 +1,26 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class BackTop extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdBackTopProps;
+ relations: RelationsOptions;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ _icon: any;
+ hidden: boolean;
+ };
+ observers: {
+ icon(): void;
+ scrollTop(value: number): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ setIcon(v: any): void;
+ toTop(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/back-top.js b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.js
new file mode 100644
index 0000000..a14d94c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.js
@@ -0,0 +1,73 @@
+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 { calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-back-top`;
+let BackTop = class BackTop extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-icon`, `${prefix}-class-text`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.relations = {
+ '../pull-down-refresh/pull-down-refresh': {
+ type: 'ancestor',
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ _icon: null,
+ hidden: true,
+ };
+ this.observers = {
+ icon() {
+ this.setIcon();
+ },
+ scrollTop(value) {
+ const { visibilityHeight } = this.properties;
+ this.setData({ hidden: value < visibilityHeight });
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ const { icon } = this.properties;
+ this.setIcon(icon);
+ },
+ };
+ this.methods = {
+ setIcon(v) {
+ this.setData({
+ _icon: calcIcon(v, 'backtop'),
+ });
+ },
+ toTop() {
+ var _a;
+ this.triggerEvent('to-top');
+ if (this.$parent) {
+ (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.setScrollTop(0);
+ this.setData({ hidden: true });
+ }
+ else {
+ wx.pageScrollTo({
+ scrollTop: 0,
+ duration: 300,
+ });
+ }
+ },
+ };
+ }
+};
+BackTop = __decorate([
+ wxComponent()
+], BackTop);
+export default BackTop;
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/back-top.json b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/back-top.wxml b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.wxml
new file mode 100644
index 0000000..3d119aa
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.wxml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+ {{text}}
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/back-top.wxss b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.wxss
new file mode 100644
index 0000000..7907024
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/back-top.wxss
@@ -0,0 +1,91 @@
+.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-back-top {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ background-color: transparent;
+ overflow: hidden;
+ box-sizing: border-box;
+ transition: height 0.2s;
+ height: auto;
+}
+.t-back-top--fixed {
+ position: fixed;
+ right: var(--td-spacer, 16rpx);
+ bottom: calc(var(--td-spacer-2, 32rpx) + env(safe-area-inset-bottom));
+}
+.t-back-top--round,
+.t-back-top--round-dark {
+ width: 96rpx;
+ height: 96rpx;
+ border-radius: var(--td-back-top-round-border-radius, var(--td-radius-circle, 50%));
+}
+.t-back-top--round,
+.t-back-top--half-round {
+ color: var(--td-back-top-round-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ border: 1rpx solid var(--td-back-top-round-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ background-color: var(--td-back-top-round-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-back-top--round-dark,
+.t-back-top--half-round-dark {
+ color: var(--td-back-top-round-dark-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-back-top-round-dark-bg-color, var(--td-gray-color-13, #242424));
+}
+.t-back-top--half-round,
+.t-back-top--half-round-dark {
+ width: 120rpx;
+ height: 80rpx;
+ border-radius: 0;
+ border-top-left-radius: var(--td-back-top-half-round-border-radius, var(--td-radius-round, 999px));
+ border-bottom-left-radius: var(--td-back-top-half-round-border-radius, var(--td-radius-round, 999px));
+ flex-direction: row;
+ right: 0;
+}
+.t-back-top__text--round,
+.t-back-top__text--round-dark,
+.t-back-top__text--half-round,
+.t-back-top__text--half-round-dark {
+ font-size: var(--td-font-size, 20rpx);
+ line-height: 24rpx;
+}
+.t-back-top__text--half-round,
+.t-back-top__text--half-round-dark {
+ width: 48rpx;
+}
+.t-back-top__icon:not(:empty) + .t-back-top__text--half-round,
+.t-back-top__icon:not(:empty) + .t-back-top__text--half-round-dark {
+ margin-left: 8rpx;
+}
+.t-back-top__icon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 44rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/props.d.ts b/miniprogram_npm/tdesign-miniprogram/back-top/props.d.ts
new file mode 100644
index 0000000..5ac1e9f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/props.d.ts
@@ -0,0 +1,3 @@
+import { TdBackTopProps } from './type';
+declare const props: TdBackTopProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/props.js b/miniprogram_npm/tdesign-miniprogram/back-top/props.js
new file mode 100644
index 0000000..d6d8121
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/props.js
@@ -0,0 +1,31 @@
+const props = {
+ fixed: {
+ type: Boolean,
+ value: true,
+ },
+ icon: {
+ type: null,
+ value: true,
+ },
+ scrollTop: {
+ type: Number,
+ value: 0,
+ },
+ style: {
+ type: String,
+ value: '',
+ },
+ text: {
+ type: String,
+ value: '',
+ },
+ theme: {
+ type: String,
+ value: 'round',
+ },
+ visibilityHeight: {
+ type: Number,
+ value: 200,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/type.d.ts b/miniprogram_npm/tdesign-miniprogram/back-top/type.d.ts
new file mode 100644
index 0000000..9071651
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/type.d.ts
@@ -0,0 +1,30 @@
+export interface TdBackTopProps {
+ fixed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ scrollTop?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'round' | 'half-round' | 'round-dark' | 'half-round-dark';
+ };
+ visibilityHeight?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/back-top/type.js b/miniprogram_npm/tdesign-miniprogram/back-top/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/back-top/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md
new file mode 100644
index 0000000..05103dc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md
@@ -0,0 +1,45 @@
+:: BASE_DOC ::
+
+## API
+
+### Badge 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
+color | String | - | \- | N
+content | String | - | \- | N
+count | String / Number / Slot | 0 | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+dot | Boolean | false | \- | N
+max-count | Number | 99 | \- | N
+offset | Array | - | Typescript:`Array` | N
+shape | String | circle | options: circle/square/bubble/ribbon | N
+show-zero | Boolean | false | \- | N
+size | String | medium | options: medium/large | N
+### Badge External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+t-class-count | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-badge-basic-height | 32rpx | -
+--td-badge-basic-padding | 8rpx | -
+--td-badge-basic-width | 32rpx | -
+--td-badge-bg-color | @error-color | -
+--td-badge-border-radius | 4rpx | -
+--td-badge-bubble-border-radius | 20rpx 20rpx 20rpx 1px | -
+--td-badge-dot-size | 16rpx | -
+--td-badge-font-size | @font-size-xs | -
+--td-badge-font-weight | 600 | -
+--td-badge-large-font-size | @font-size-s | -
+--td-badge-large-height | 40rpx | -
+--td-badge-large-padding | 10rpx | -
+--td-badge-text-color | @font-white-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/README.md b/miniprogram_npm/tdesign-miniprogram/badge/README.md
new file mode 100644
index 0000000..a253b93
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/README.md
@@ -0,0 +1,86 @@
+---
+title: Badge 徽标
+description: 用于告知用户,该区域的状态变化或者待处理任务的数量。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-badge": "tdesign-miniprogram/badge/badge"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+{{ base }}
+
+### 组件样式
+
+{{ theme }}
+
+### 组件尺寸
+
+{{ size }}
+
+## FAQ
+
+### 如何处理由 ribbon 徽标溢出导致页面出现横向滚动?
+角标溢出问题建议从父容器组件处理。如 #3063 ,可以给父容器 `cell` 组件添加 `overflow: hidden`,处理溢出造成页面出现横向滚动的问题。
+
+## API
+
+### Badge Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+color | String | - | 颜色 | N
+content | String | - | 徽标内容,示例:`content='自定义内容'`。也可以使用默认插槽定义 | N
+count | String / Number / Slot | 0 | 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+dot | Boolean | false | 是否为红点 | N
+max-count | Number | 99 | 封顶的数字值 | N
+offset | Array | - | 设置状态点的位置偏移,示例:[-10, 20] 或 ['10em', '8rem']。TS 类型:`Array` | N
+shape | String | circle | 形状。可选项:circle/square/bubble/ribbon | N
+show-zero | Boolean | false | 当数值为 0 时,是否展示徽标 | N
+size | String | medium | 尺寸。可选项:medium/large | N
+### Badge External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-count | 计数样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-badge-basic-height | 32rpx | -
+--td-badge-basic-padding | 8rpx | -
+--td-badge-basic-width | 32rpx | -
+--td-badge-bg-color | @error-color | -
+--td-badge-border-radius | 4rpx | -
+--td-badge-bubble-border-radius | 20rpx 20rpx 20rpx 1px | -
+--td-badge-dot-size | 16rpx | -
+--td-badge-font-size | @font-size-xs | -
+--td-badge-font-weight | 600 | -
+--td-badge-large-font-size | @font-size-s | -
+--td-badge-large-height | 40rpx | -
+--td-badge-large-padding | 10rpx | -
+--td-badge-text-color | @font-white-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts
new file mode 100644
index 0000000..2680a17
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts
@@ -0,0 +1,21 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdBadgeProps } from './type';
+export interface BadgeProps extends TdBadgeProps {
+}
+export default class Badge extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ properties: TdBadgeProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ value: string;
+ labelID: string;
+ descriptionID: string;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.js b/miniprogram_npm/tdesign-miniprogram/badge/badge.js
new file mode 100644
index 0000000..370a57e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.js
@@ -0,0 +1,43 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { uniqueFactory } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-badge`;
+const getUniqueID = uniqueFactory('badge');
+let Badge = class Badge extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-count`, `${prefix}-class-content`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ value: '',
+ labelID: '',
+ descriptionID: '',
+ };
+ this.lifetimes = {
+ ready() {
+ const uniqueID = getUniqueID();
+ this.setData({
+ labelID: `${uniqueID}_label`,
+ descriptionID: `${uniqueID}_description`,
+ });
+ },
+ };
+ }
+};
+Badge = __decorate([
+ wxComponent()
+], Badge);
+export default Badge;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.json b/miniprogram_npm/tdesign-miniprogram/badge/badge.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.wxml b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxml
new file mode 100644
index 0000000..9c58b61
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+ {{content}}
+
+
+ {{ _this.getBadgeValue({dot, count, maxCount}) }}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.wxs b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxs
new file mode 100644
index 0000000..613263c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxs
@@ -0,0 +1,71 @@
+var getBadgeValue = function (props) {
+ if (props.dot) {
+ return '';
+ }
+ if (isNaN(props.count) || isNaN(props.maxCount)) {
+ return props.count;
+ }
+ return parseInt(props.count) > props.maxCount ? props.maxCount + '+' : props.count;
+};
+
+var hasUnit = function (unit) {
+ return (
+ unit.indexOf('px') > 0 ||
+ unit.indexOf('rpx') > 0 ||
+ unit.indexOf('em') > 0 ||
+ unit.indexOf('rem') > 0 ||
+ unit.indexOf('%') > 0 ||
+ unit.indexOf('vh') > 0 ||
+ unit.indexOf('vm') > 0
+ );
+};
+
+var getBadgeStyles = function (props) {
+ var styleStr = '';
+ if (props.color) {
+ styleStr += 'background:' + props.color + ';';
+ }
+ if (props.offset[0]) {
+ styleStr +=
+ 'left: calc(100% + ' + (hasUnit(props.offset[0].toString()) ? props.offset[0] : props.offset[0] + 'px') + ');';
+ }
+ if (props.offset[1]) {
+ styleStr += 'top:' + (hasUnit(props.offset[1].toString()) ? props.offset[1] : props.offset[1] + 'px') + ';';
+ }
+ return styleStr;
+};
+
+var getBadgeOuterClass = function (props) {
+ var baseClass = 't-badge';
+ var classNames = [baseClass, props.shape === 'ribbon' ? baseClass + '__ribbon-outer' : ''];
+ return classNames.join(' ');
+};
+
+var getBadgeInnerClass = function (props) {
+ var baseClass = 't-badge';
+ var classNames = [
+ baseClass + '--basic',
+ props.dot ? baseClass + '--dot' : '',
+ baseClass + '--' + props.size,
+ baseClass + '--' + props.shape,
+ !props.dot && props.count ? baseClass + '--count' : '',
+ ];
+ return classNames.join(' ');
+};
+
+var isShowBadge = function (props) {
+ if (props.dot) {
+ return true;
+ }
+ if (!props.showZero && !isNaN(props.count) && parseInt(props.count) === 0) {
+ return false;
+ }
+ if (props.count == null) return false;
+ return true;
+};
+
+module.exports.getBadgeValue = getBadgeValue;
+module.exports.getBadgeStyles = getBadgeStyles;
+module.exports.getBadgeOuterClass = getBadgeOuterClass;
+module.exports.getBadgeInnerClass = getBadgeInnerClass;
+module.exports.isShowBadge = isShowBadge;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.wxss b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxss
new file mode 100644
index 0000000..5398f03
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxss
@@ -0,0 +1,113 @@
+.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-badge {
+ position: relative;
+ display: inline-flex;
+ align-items: start;
+}
+.t-badge--basic {
+ z-index: 100;
+ padding: 0 var(--td-badge-basic-padding, 8rpx);
+ font-size: var(--td-badge-font-size, var(--td-font-size-xs, var(--td-font-size, 20rpx)));
+ color: var(--td-badge-text-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ text-align: center;
+ height: var(--td-badge-basic-height, 32rpx);
+ line-height: var(--td-badge-basic-height, 32rpx);
+ font-weight: var(--td-badge-font-weight, 600);
+ border-radius: var(--td-badge-border-radius, 4rpx);
+}
+.t-badge--dot {
+ height: var(--td-badge-dot-size, 16rpx);
+ border-radius: 50%;
+ min-width: var(--td-badge-dot-size, 16rpx);
+ padding: 0;
+}
+.t-badge--count {
+ min-width: var(--td-badge-basic-width, 32rpx);
+ white-space: nowrap;
+ box-sizing: border-box;
+}
+.t-badge--circle {
+ border-radius: calc(var(--td-badge-basic-height, 32rpx) / 2);
+}
+.t-badge__ribbon-outer {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+.t-badge--ribbon {
+ position: relative;
+ display: inline-block;
+ transform-origin: center center;
+ transform: translate(calc(50% - var(--td-badge-basic-height, 32rpx) + 1rpx), calc(-50% + var(--td-badge-basic-height, 32rpx) - 1rpx)) rotate(45deg);
+ border-radius: 0;
+}
+.t-badge--ribbon::before,
+.t-badge--ribbon::after {
+ content: '';
+ position: absolute;
+ width: 0;
+ height: 0;
+ bottom: 0;
+ border-bottom: var(--td-badge-basic-height, 32rpx) solid var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ font-size: 0;
+}
+.t-badge--ribbon::before {
+ left: calc(-1 * var(--td-badge-basic-height, 32rpx) + 1rpx);
+ border-left: var(--td-badge-basic-height, 32rpx) solid transparent;
+}
+.t-badge--ribbon::after {
+ right: calc(-1 * var(--td-badge-basic-height, 32rpx) + 1rpx);
+ border-right: var(--td-badge-basic-height, 32rpx) solid transparent;
+}
+.t-badge--bubble {
+ border-radius: var(--td-badge-bubble-border-radius, 20rpx 20rpx 20rpx 1px);
+}
+.t-badge--large {
+ font-size: var(--td-badge-large-font-size, var(--td-font-size-s, 24rpx));
+ height: var(--td-badge-large-height, 40rpx);
+ min-width: var(--td-badge-large-height, 40rpx);
+ line-height: var(--td-badge-large-height, 40rpx);
+ padding: 0 var(--td-badge-large-padding, 10rpx);
+}
+.t-badge--large.t-badge--circle {
+ border-radius: calc(var(--td-badge-large-height, 40rpx) / 2);
+}
+.t-badge__content:not(:empty) + .t-has-count {
+ transform-origin: center center;
+ transform: translate(-50%, -50%);
+ position: absolute;
+ left: 100%;
+ top: 0;
+}
+.t-badge__content-text {
+ display: block;
+ line-height: 48rpx;
+ color: var(--td-badge-content-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts
new file mode 100644
index 0000000..85b119a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './badge';
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/index.js b/miniprogram_npm/tdesign-miniprogram/badge/index.js
new file mode 100644
index 0000000..85b119a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/index.js
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './badge';
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts
new file mode 100644
index 0000000..e1702ff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts
@@ -0,0 +1,3 @@
+import { TdBadgeProps } from './type';
+declare const props: TdBadgeProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/props.js b/miniprogram_npm/tdesign-miniprogram/badge/props.js
new file mode 100644
index 0000000..095f798
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/props.js
@@ -0,0 +1,41 @@
+const props = {
+ color: {
+ type: String,
+ value: '',
+ },
+ content: {
+ type: String,
+ value: '',
+ },
+ count: {
+ type: null,
+ value: 0,
+ },
+ dot: {
+ type: Boolean,
+ value: false,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ maxCount: {
+ type: Number,
+ value: 99,
+ },
+ offset: {
+ type: Array,
+ },
+ shape: {
+ type: String,
+ value: 'circle',
+ },
+ showZero: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts
new file mode 100644
index 0000000..2029271
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts
@@ -0,0 +1,42 @@
+export interface TdBadgeProps {
+ color?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ count?: {
+ type: null;
+ value?: string | number;
+ };
+ dot?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-content', 't-class-count'];
+ };
+ maxCount?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ offset?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'circle' | 'square' | 'bubble' | 'ribbon';
+ };
+ showZero?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'medium' | 'large';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/type.js b/miniprogram_npm/tdesign-miniprogram/badge/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/button/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/button/README.en-US.md
new file mode 100644
index 0000000..7239ad9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/README.en-US.md
@@ -0,0 +1,232 @@
+---
+title: Button
+description: Buttons are used to open a closed-loop task, such as "delete" an object, "buy" an item, etc.
+spline: base
+isComponent: true
+---
+
+


+
+
+## Usage
+
+For global import, configure it in `app.json` in the root directory of the miniprogram. For local import, configure it in `index.json` of the page or component that needs to be imported.
+
+```json
+"usingComponents": {
+ "t-button": "tdesign-miniprogram/button/button"
+}
+```
+
+
+## Code Demo
+
+### 01 Component Type
+
+#### Basic Buttons
+
+{{ base }}
+
+#### Icon Button
+
+{{ icon-btn }}
+
+#### Ghost Button
+
+{{ ghost-btn }}
+
+#### Combination Button
+
+{{ group-btn }}
+
+#### Banner Button
+
+{{ block-btn }}
+
+### 02 Component State
+
+#### Buttons for different states
+
+{{ disabled }}
+
+### 03 Component Style
+
+#### Different sizes of buttons
+
+{{ size }}
+
+#### Different shaped buttons
+
+{{ shape }}
+
+#### Different color theme buttons
+
+{{ theme }}
+
+
+
+## API
+
+### Button 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
+app-parameter | String | - | \- | N
+block | Boolean | false | make button to be a block-level element | N
+content | String / Slot | - | button's children elements。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+custom-dataset | any | - | \- | N
+disabled | Boolean | undefined | disable the button, make it can not be clicked | N
+ghost | Boolean | false | make background-color to be transparent | N
+hover-class | String | - | \- | N
+hover-start-time | Number | 20 | \- | N
+hover-stay-time | Number | 70 | \- | N
+hover-stop-propagation | Boolean | false | \- | N
+icon | String / Object | - | icon name | N
+lang | String | - | message language。options: en/zh_CN/zh_TW | N
+loading | Boolean | false | set button to be loading state | N
+loading-props | Object | - | Typescript:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/button/type.ts) | N
+open-type | String | - | open type of button, [Miniprogram Button](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。options: contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
+phone-number-no-quota-toast | Boolean | true | \- | N
+send-message-img | String | 截图 | \- | N
+send-message-path | String | 当前分享路径 | \- | N
+send-message-title | String | 当前标题 | \- | N
+session-from | String | - | \- | N
+shape | String | rectangle | button shape。options: rectangle/square/round/circle | N
+show-message-card | Boolean | false | \- | N
+size | String | medium | a button has four size。options: extra-small/small/medium/large | N
+suffix | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+t-id | String | - | id | N
+theme | String | default | button theme。options: default/primary/danger/light | N
+type | String | - | type of button element, same as formType of Miniprogram。options: submit/reset | N
+variant | String | base | variant of button。options: base/outline/dashed/text | N
+
+### Button Events
+
+name | params | description
+-- | -- | --
+agreeprivacyauthorization | \- | \-
+chooseavatar | \- | \-
+contact | \- | \-
+createliveactivity | \- | \-
+error | \- | \-
+getphonenumber | \- | \-
+getrealtimephonenumber | \- | \-
+getuserinfo | \- | \-
+launchapp | \- | \-
+opensetting | \- | \-
+tap | `event` | \-
+
+### Button External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-icon | class name of icon
+t-class-loading | class name of loading
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-button-border-radius | @radius-default | -
+--td-button-border-width | 4rpx | -
+--td-button-danger-active-bg-color | @error-color-active | -
+--td-button-danger-active-border-color | @error-color-active | -
+--td-button-danger-bg-color | @error-color | -
+--td-button-danger-border-color | @error-color | -
+--td-button-danger-color | @text-color-anti | -
+--td-button-danger-dashed-border-color | @button-danger-dashed-color | -
+--td-button-danger-dashed-color | @error-color | -
+--td-button-danger-dashed-disabled-color | @button-danger-disabled-color | -
+--td-button-danger-disabled-bg | @error-color-3 | -
+--td-button-danger-disabled-border-color | @error-color-3 | -
+--td-button-danger-disabled-color | @font-white-1 | -
+--td-button-danger-outline-active-bg-color | @bg-color-container-active | -
+--td-button-danger-outline-active-border-color | @error-color-active | -
+--td-button-danger-outline-border-color | @button-danger-outline-color | -
+--td-button-danger-outline-color | @error-color | -
+--td-button-danger-outline-disabled-color | @error-color-3 | -
+--td-button-danger-text-active-bg-color | @bg-color-container-active | -
+--td-button-danger-text-color | @error-color | -
+--td-button-danger-text-disabled-color | @button-danger-disabled-color | -
+--td-button-default-active-bg-color | @bg-color-component-active | -
+--td-button-default-active-border-color | @bg-color-component-active | -
+--td-button-default-bg-color | @bg-color-component | -
+--td-button-default-border-color | @bg-color-component | -
+--td-button-default-color | @text-color-primary | -
+--td-button-default-disabled-bg | @bg-color-component-disabled | -
+--td-button-default-disabled-border-color | @bg-color-component-disabled | -
+--td-button-default-disabled-color | @text-color-disabled | -
+--td-button-default-outline-active-bg-color | @bg-color-container-active | -
+--td-button-default-outline-active-border-color | @component-border | -
+--td-button-default-outline-border-color | @component-border | -
+--td-button-default-outline-color | @text-color-primary | -
+--td-button-default-outline-disabled-color | @component-border | -
+--td-button-default-text-active-bg-color | @bg-color-container-active | -
+--td-button-extra-small-font-size | @font-size-base | -
+--td-button-extra-small-height | 56rpx | -
+--td-button-extra-small-icon-font-size | 36rpx | -
+--td-button-extra-small-padding-horizontal | 16rpx | -
+--td-button-font-weight | 600 | -
+--td-button-ghost-border-color | @button-ghost-color | -
+--td-button-ghost-color | @text-color-anti | -
+--td-button-ghost-danger-border-color | @error-color | -
+--td-button-ghost-danger-color | @error-color | -
+--td-button-ghost-danger-hover-color | @error-color-active | -
+--td-button-ghost-disabled-color | @font-white-4 | -
+--td-button-ghost-hover-color | @font-white-2 | -
+--td-button-ghost-primary-border-color | @brand-color | -
+--td-button-ghost-primary-color | @brand-color | -
+--td-button-ghost-primary-hover-color | @brand-color-active | -
+--td-button-icon-border-radius | 8rpx | -
+--td-button-icon-spacer | @spacer | -
+--td-button-large-font-size | @font-size-m | -
+--td-button-large-height | 96rpx | -
+--td-button-large-icon-font-size | 48rpx | -
+--td-button-large-padding-horizontal | 40rpx | -
+--td-button-light-active-bg-color | @brand-color-light-active | -
+--td-button-light-active-border-color | @brand-color-light-active | -
+--td-button-light-bg-color | @brand-color-light | -
+--td-button-light-border-color | @brand-color-light | -
+--td-button-light-color | @brand-color | -
+--td-button-light-disabled-bg | @brand-color-light | -
+--td-button-light-disabled-border-color | @brand-color-light | -
+--td-button-light-disabled-color | @brand-color-disabled | -
+--td-button-light-outline-active-bg-color | @brand-color-light-active | -
+--td-button-light-outline-active-border-color | @brand-color-active | -
+--td-button-light-outline-bg-color | @brand-color-light | -
+--td-button-light-outline-border-color | @button-light-outline-color | -
+--td-button-light-outline-color | @brand-color | -
+--td-button-light-outline-disabled-color | @brand-color-disabled | -
+--td-button-light-text-active-bg-color | @bg-color-container-active | -
+--td-button-light-text-color | @brand-color | -
+--td-button-medium-font-size | @font-size-m | -
+--td-button-medium-height | 80rpx | -
+--td-button-medium-icon-font-size | 40rpx | -
+--td-button-medium-padding-horizontal | 32rpx | -
+--td-button-primary-active-bg-color | @brand-color-active | -
+--td-button-primary-active-border-color | @brand-color-active | -
+--td-button-primary-bg-color | @brand-color | -
+--td-button-primary-border-color | @brand-color | -
+--td-button-primary-color | @text-color-anti | -
+--td-button-primary-dashed-border-color | @button-primary-dashed-color | -
+--td-button-primary-dashed-color | @brand-color | -
+--td-button-primary-dashed-disabled-color | @brand-color-disabled | -
+--td-button-primary-disabled-bg | @brand-color-disabled | -
+--td-button-primary-disabled-border-color | @brand-color-disabled | -
+--td-button-primary-disabled-color | @text-color-anti | -
+--td-button-primary-outline-active-bg-color | @bg-color-container-active | -
+--td-button-primary-outline-active-border-color | @brand-color-active | -
+--td-button-primary-outline-border-color | @button-primary-outline-color | -
+--td-button-primary-outline-color | @brand-color | -
+--td-button-primary-outline-disabled-color | @brand-color-disabled | -
+--td-button-primary-text-active-bg-color | @bg-color-container-active | -
+--td-button-primary-text-color | @brand-color | -
+--td-button-primary-text-disabled-color | @brand-color-disabled | -
+--td-button-small-font-size | @font-size-base | -
+--td-button-small-height | 64rpx | -
+--td-button-small-icon-font-size | 36rpx | -
+--td-button-small-padding-horizontal | 24rpx | -
diff --git a/miniprogram_npm/tdesign-miniprogram/button/README.md b/miniprogram_npm/tdesign-miniprogram/button/README.md
new file mode 100644
index 0000000..1916946
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/README.md
@@ -0,0 +1,234 @@
+---
+title: Button 按钮
+description: 用于开启一个闭环的操作任务,如“删除”对象、“购买”商品等。
+spline: base
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-button": "tdesign-miniprogram/button/button"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+### 01 组件类型
+
+#### 基础按钮
+
+{{ base }}
+
+#### 图标按钮
+
+{{ icon-btn }}
+
+#### 幽灵按钮
+
+{{ ghost-btn }}
+
+#### 组合按钮
+
+{{ group-btn }}
+
+#### 通栏按钮
+
+{{ block-btn }}
+
+### 02 组件状态
+
+#### 按钮禁用态
+
+{{ disabled }}
+
+### 03 组件样式
+
+#### 按钮尺寸
+
+{{ size }}
+
+#### 按钮形状
+
+{{ shape }}
+
+#### 按钮主题
+
+{{ theme }}
+
+## API
+
+### Button Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+app-parameter | String | - | 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | N
+block | Boolean | false | 是否为块级元素 | N
+content | String / Slot | - | 按钮内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+custom-dataset | any | - | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 | N
+disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
+ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
+hover-class | String | - | 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 | N
+hover-start-time | Number | 20 | 按住后多久出现点击态,单位毫秒 | N
+hover-stay-time | Number | 70 | 手指松开后点击态保留时间,单位毫秒 | N
+hover-stop-propagation | Boolean | false | 指定是否阻止本节点的祖先节点出现点击态 | N
+icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。 | N
+lang | String | - | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。。
具体释义:
`en` 英文;
`zh_CN` 简体中文;
`zh_TW` 繁体中文。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。。可选项:en/zh_CN/zh_TW | N
+loading | Boolean | false | 是否显示为加载状态 | N
+loading-props | Object | - | 透传 Loading 组件全部属性。TS 类型:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/button/type.ts) | N
+open-type | String | - | 微信开放能力。
具体释义:
`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,具体说明 (*小程序插件中不能使用*);
`share` 触发用户转发,使用前建议先阅读使用指引;
`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,具体说明 (*小程序插件中不能使用*);
`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);
`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数具体说明;
`openSetting` 打开授权设置页;
`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容;
`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;
`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《小程序隐私协议开发指南》。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。。可选项:contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
+phone-number-no-quota-toast | Boolean | true | 原生按钮属性,当手机号快速验证或手机号实时验证额度用尽时,是否对用户展示“申请获取你的手机号,但该功能使用次数已达当前小程序上限,暂时无法使用”的提示,默认展示,open-type="getPhoneNumber" 或 open-type="getRealtimePhoneNumber" 时有效 | N
+send-message-img | String | 截图 | 会话内消息卡片图片,open-type="contact"时有效 | N
+send-message-path | String | 当前分享路径 | 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 | N
+send-message-title | String | 当前标题 | 会话内消息卡片标题,open-type="contact"时有效 | N
+session-from | String | - | 会话来源,open-type="contact"时有效 | N
+shape | String | rectangle | 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形。可选项:rectangle/square/round/circle | N
+show-message-card | Boolean | false | 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效 | N
+size | String | medium | 组件尺寸。可选项:extra-small/small/medium/large | N
+suffix | Slot | - | 右侧内容,可用于定义右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+t-id | String | - | 按钮标签id | N
+theme | String | default | 组件风格,依次为品牌色、危险色。可选项:default/primary/danger/light | N
+type | String | - | 同小程序的 formType。可选项:submit/reset | N
+variant | String | base | 按钮形式,基础、线框、虚线、文字。可选项:base/outline/dashed/text | N
+
+### Button Events
+
+名称 | 参数 | 描述
+-- | -- | --
+agreeprivacyauthorization | \- | 原生按钮属性,用户同意隐私协议事件回调,open-type=agreePrivacyAuthorization时有效 (Tips: 如果使用 onNeedPrivacyAuthorization 接口,需要在 bindagreeprivacyauthorization 触发后再调用 resolve({ event: "agree", buttonId }))
+chooseavatar | \- | 原生按钮属性,获取用户头像回调,`open-type=chooseAvatar` 时有效。返回 `e.detail.avatarUrl` 为头像临时文件链接
+contact | \- | 原生按钮属性,客服消息回调,`open-type="contact"` 时有效
+createliveactivity | \- | 新的一次性订阅消息下发机制回调,`open-type=liveActivity` 时有效
+error | \- | 原生按钮属性,当使用开放能力时,发生错误的回调,`open-type=launchApp` 时有效
+getphonenumber | \- | 原生按钮属性,手机号快速验证回调,open-type=getPhoneNumber时有效。Tips:在触发 bindgetphonenumber 回调后应立即隐藏手机号按钮组件,或置为 disabled 状态,避免用户重复授权手机号产生额外费用
+getrealtimephonenumber | \- | 原生按钮属性,手机号实时验证回调,open-type=getRealtimePhoneNumber 时有效。Tips:在触发 bindgetrealtimephonenumber 回调后应立即隐藏手机号按钮组件,或置为 disabled 状态,避免用户重复授权手机号产生额外费用
+getuserinfo | \- | 原生按钮属性,用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与wx.getUserInfo返回的一致,open-type="getUserInfo"时有效
+launchapp | \- | 打开 APP 成功的回调,`open-type=launchApp` 时有效
+opensetting | \- | 原生按钮属性,在打开授权设置页后回调,open-type=openSetting时有效
+tap | `event` | 点击按钮,当按钮不为加载或禁用状态时触发
+
+### Button External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-icon | 图标样式类
+t-class-loading | 加载样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-button-border-radius | @radius-default | -
+--td-button-border-width | 4rpx | -
+--td-button-danger-active-bg-color | @error-color-active | -
+--td-button-danger-active-border-color | @error-color-active | -
+--td-button-danger-bg-color | @error-color | -
+--td-button-danger-border-color | @error-color | -
+--td-button-danger-color | @text-color-anti | -
+--td-button-danger-dashed-border-color | @button-danger-dashed-color | -
+--td-button-danger-dashed-color | @error-color | -
+--td-button-danger-dashed-disabled-color | @button-danger-disabled-color | -
+--td-button-danger-disabled-bg | @error-color-3 | -
+--td-button-danger-disabled-border-color | @error-color-3 | -
+--td-button-danger-disabled-color | @font-white-1 | -
+--td-button-danger-outline-active-bg-color | @bg-color-container-active | -
+--td-button-danger-outline-active-border-color | @error-color-active | -
+--td-button-danger-outline-border-color | @button-danger-outline-color | -
+--td-button-danger-outline-color | @error-color | -
+--td-button-danger-outline-disabled-color | @error-color-3 | -
+--td-button-danger-text-active-bg-color | @bg-color-container-active | -
+--td-button-danger-text-color | @error-color | -
+--td-button-danger-text-disabled-color | @button-danger-disabled-color | -
+--td-button-default-active-bg-color | @bg-color-component-active | -
+--td-button-default-active-border-color | @bg-color-component-active | -
+--td-button-default-bg-color | @bg-color-component | -
+--td-button-default-border-color | @bg-color-component | -
+--td-button-default-color | @text-color-primary | -
+--td-button-default-disabled-bg | @bg-color-component-disabled | -
+--td-button-default-disabled-border-color | @bg-color-component-disabled | -
+--td-button-default-disabled-color | @text-color-disabled | -
+--td-button-default-outline-active-bg-color | @bg-color-container-active | -
+--td-button-default-outline-active-border-color | @component-border | -
+--td-button-default-outline-border-color | @component-border | -
+--td-button-default-outline-color | @text-color-primary | -
+--td-button-default-outline-disabled-color | @component-border | -
+--td-button-default-text-active-bg-color | @bg-color-container-active | -
+--td-button-extra-small-font-size | @font-size-base | -
+--td-button-extra-small-height | 56rpx | -
+--td-button-extra-small-icon-font-size | 36rpx | -
+--td-button-extra-small-padding-horizontal | 16rpx | -
+--td-button-font-weight | 600 | -
+--td-button-ghost-border-color | @button-ghost-color | -
+--td-button-ghost-color | @text-color-anti | -
+--td-button-ghost-danger-border-color | @error-color | -
+--td-button-ghost-danger-color | @error-color | -
+--td-button-ghost-danger-hover-color | @error-color-active | -
+--td-button-ghost-disabled-color | @font-white-4 | -
+--td-button-ghost-hover-color | @font-white-2 | -
+--td-button-ghost-primary-border-color | @brand-color | -
+--td-button-ghost-primary-color | @brand-color | -
+--td-button-ghost-primary-hover-color | @brand-color-active | -
+--td-button-icon-border-radius | 8rpx | -
+--td-button-icon-spacer | @spacer | -
+--td-button-large-font-size | @font-size-m | -
+--td-button-large-height | 96rpx | -
+--td-button-large-icon-font-size | 48rpx | -
+--td-button-large-padding-horizontal | 40rpx | -
+--td-button-light-active-bg-color | @brand-color-light-active | -
+--td-button-light-active-border-color | @brand-color-light-active | -
+--td-button-light-bg-color | @brand-color-light | -
+--td-button-light-border-color | @brand-color-light | -
+--td-button-light-color | @brand-color | -
+--td-button-light-disabled-bg | @brand-color-light | -
+--td-button-light-disabled-border-color | @brand-color-light | -
+--td-button-light-disabled-color | @brand-color-disabled | -
+--td-button-light-outline-active-bg-color | @brand-color-light-active | -
+--td-button-light-outline-active-border-color | @brand-color-active | -
+--td-button-light-outline-bg-color | @brand-color-light | -
+--td-button-light-outline-border-color | @button-light-outline-color | -
+--td-button-light-outline-color | @brand-color | -
+--td-button-light-outline-disabled-color | @brand-color-disabled | -
+--td-button-light-text-active-bg-color | @bg-color-container-active | -
+--td-button-light-text-color | @brand-color | -
+--td-button-medium-font-size | @font-size-m | -
+--td-button-medium-height | 80rpx | -
+--td-button-medium-icon-font-size | 40rpx | -
+--td-button-medium-padding-horizontal | 32rpx | -
+--td-button-primary-active-bg-color | @brand-color-active | -
+--td-button-primary-active-border-color | @brand-color-active | -
+--td-button-primary-bg-color | @brand-color | -
+--td-button-primary-border-color | @brand-color | -
+--td-button-primary-color | @text-color-anti | -
+--td-button-primary-dashed-border-color | @button-primary-dashed-color | -
+--td-button-primary-dashed-color | @brand-color | -
+--td-button-primary-dashed-disabled-color | @brand-color-disabled | -
+--td-button-primary-disabled-bg | @brand-color-disabled | -
+--td-button-primary-disabled-border-color | @brand-color-disabled | -
+--td-button-primary-disabled-color | @text-color-anti | -
+--td-button-primary-outline-active-bg-color | @bg-color-container-active | -
+--td-button-primary-outline-active-border-color | @brand-color-active | -
+--td-button-primary-outline-border-color | @button-primary-outline-color | -
+--td-button-primary-outline-color | @brand-color | -
+--td-button-primary-outline-disabled-color | @brand-color-disabled | -
+--td-button-primary-text-active-bg-color | @bg-color-container-active | -
+--td-button-primary-text-color | @brand-color | -
+--td-button-primary-text-disabled-color | @brand-color-disabled | -
+--td-button-small-font-size | @font-size-base | -
+--td-button-small-height | 64rpx | -
+--td-button-small-icon-font-size | 36rpx | -
+--td-button-small-padding-horizontal | 24rpx | -
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.d.ts b/miniprogram_npm/tdesign-miniprogram/button/button.d.ts
new file mode 100644
index 0000000..4e88efd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.d.ts
@@ -0,0 +1,36 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdButtonProps } from './type';
+export interface ButtonProps extends TdButtonProps {
+}
+export default class Button extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ properties: TdButtonProps;
+ options: {
+ multipleSlots: boolean;
+ };
+ data: {
+ prefix: string;
+ className: string;
+ classPrefix: string;
+ };
+ observers: {
+ 'theme, size, plain, block, shape, disabled, loading, variant'(): void;
+ icon(icon: any): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ setClass(): void;
+ getuserinfo(e: any): void;
+ contact(e: any): void;
+ getphonenumber(e: any): void;
+ error(e: any): void;
+ opensetting(e: any): void;
+ launchapp(e: any): void;
+ chooseavatar(e: any): void;
+ agreeprivacyauthorization(e: any): void;
+ handleTap(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.js b/miniprogram_npm/tdesign-miniprogram/button/button.js
new file mode 100644
index 0000000..5449818
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.js
@@ -0,0 +1,101 @@
+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 { canIUseFormFieldButton } from '../common/version';
+import { calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-button`;
+let Button = class Button extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-icon`, `${prefix}-class-loading`];
+ this.behaviors = canIUseFormFieldButton() ? ['wx://form-field-button'] : [];
+ this.properties = props;
+ this.options = {
+ multipleSlots: true,
+ };
+ this.data = {
+ prefix,
+ className: '',
+ classPrefix: name,
+ };
+ this.observers = {
+ 'theme, size, plain, block, shape, disabled, loading, variant'() {
+ this.setClass();
+ },
+ icon(icon) {
+ this.setData({
+ _icon: calcIcon(icon, ''),
+ });
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.setClass();
+ },
+ };
+ this.methods = {
+ setClass() {
+ const classList = [
+ name,
+ `${prefix}-class`,
+ `${name}--${this.data.variant || 'base'}`,
+ `${name}--${this.data.theme || 'default'}`,
+ `${name}--${this.data.shape || 'rectangle'}`,
+ `${name}--size-${this.data.size || 'medium'}`,
+ ];
+ if (this.data.block) {
+ classList.push(`${name}--block`);
+ }
+ if (this.data.disabled) {
+ classList.push(`${name}--disabled`);
+ }
+ if (this.data.ghost) {
+ classList.push(`${name}--ghost`);
+ }
+ this.setData({
+ className: classList.join(' '),
+ });
+ },
+ getuserinfo(e) {
+ this.triggerEvent('getuserinfo', e.detail);
+ },
+ contact(e) {
+ this.triggerEvent('contact', e.detail);
+ },
+ getphonenumber(e) {
+ this.triggerEvent('getphonenumber', e.detail);
+ },
+ error(e) {
+ this.triggerEvent('error', e.detail);
+ },
+ opensetting(e) {
+ this.triggerEvent('opensetting', e.detail);
+ },
+ launchapp(e) {
+ this.triggerEvent('launchapp', e.detail);
+ },
+ chooseavatar(e) {
+ this.triggerEvent('chooseavatar', e.detail);
+ },
+ agreeprivacyauthorization(e) {
+ this.triggerEvent('agreeprivacyauthorization', e.detail);
+ },
+ handleTap(e) {
+ if (this.data.disabled || this.data.loading)
+ return;
+ this.triggerEvent('tap', e);
+ },
+ };
+ }
+};
+Button = __decorate([
+ wxComponent()
+], Button);
+export default Button;
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.json b/miniprogram_npm/tdesign-miniprogram/button/button.json
new file mode 100644
index 0000000..a32e8cd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-loading": "../loading/loading"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.wxml b/miniprogram_npm/tdesign-miniprogram/button/button.wxml
new file mode 100644
index 0000000..6b314ec
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.wxml
@@ -0,0 +1,61 @@
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.wxss b/miniprogram_npm/tdesign-miniprogram/button/button.wxss
new file mode 100644
index 0000000..2a207c2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.wxss
@@ -0,0 +1,541 @@
+.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-button--size-extra-small {
+ font-size: var(--td-button-extra-small-font-size, var(--td-font-size-base, 28rpx));
+ padding-left: var(--td-button-extra-small-padding-horizontal, 16rpx);
+ padding-right: var(--td-button-extra-small-padding-horizontal, 16rpx);
+ height: var(--td-button-extra-small-height, 56rpx);
+ line-height: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--size-extra-small .t-button__icon {
+ font-size: var(--td-button-extra-small-icon-font-size, 36rpx);
+}
+.t-button--size-small {
+ font-size: var(--td-button-small-font-size, var(--td-font-size-base, 28rpx));
+ padding-left: var(--td-button-small-padding-horizontal, 24rpx);
+ padding-right: var(--td-button-small-padding-horizontal, 24rpx);
+ height: var(--td-button-small-height, 64rpx);
+ line-height: var(--td-button-small-height, 64rpx);
+}
+.t-button--size-small .t-button__icon {
+ font-size: var(--td-button-small-icon-font-size, 36rpx);
+}
+.t-button--size-medium {
+ font-size: var(--td-button-medium-font-size, var(--td-font-size-m, 32rpx));
+ padding-left: var(--td-button-medium-padding-horizontal, 32rpx);
+ padding-right: var(--td-button-medium-padding-horizontal, 32rpx);
+ height: var(--td-button-medium-height, 80rpx);
+ line-height: var(--td-button-medium-height, 80rpx);
+}
+.t-button--size-medium .t-button__icon {
+ font-size: var(--td-button-medium-icon-font-size, 40rpx);
+}
+.t-button--size-large {
+ font-size: var(--td-button-large-font-size, var(--td-font-size-m, 32rpx));
+ padding-left: var(--td-button-large-padding-horizontal, 40rpx);
+ padding-right: var(--td-button-large-padding-horizontal, 40rpx);
+ height: var(--td-button-large-height, 96rpx);
+ line-height: var(--td-button-large-height, 96rpx);
+}
+.t-button--size-large .t-button__icon {
+ font-size: var(--td-button-large-icon-font-size, 48rpx);
+}
+.t-button--default {
+ color: var(--td-button-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ background-color: var(--td-button-default-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--default::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--default.t-button--hover {
+ z-index: 0;
+}
+.t-button--default.t-button--hover,
+.t-button--default.t-button--hover::after {
+ background-color: var(--td-button-default-active-bg-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
+ border-color: var(--td-button-default-active-border-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
+}
+.t-button--default.t-button--disabled {
+ color: var(--td-button-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ background-color: var(--td-button-default-disabled-bg, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-button--default.t-button--disabled,
+.t-button--default.t-button--disabled::after {
+ border-color: var(--td-button-default-disabled-border-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-button--primary {
+ color: var(--td-button-primary-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-button-primary-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--primary::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--primary.t-button--hover {
+ z-index: 0;
+}
+.t-button--primary.t-button--hover,
+.t-button--primary.t-button--hover::after {
+ background-color: var(--td-button-primary-active-bg-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+ border-color: var(--td-button-primary-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--primary.t-button--disabled {
+ color: var(--td-button-primary-disabled-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-button-primary-disabled-bg, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--primary.t-button--disabled,
+.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-primary-disabled-border-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--light {
+ color: var(--td-button-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-button-light-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+ border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--light::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--light.t-button--hover {
+ z-index: 0;
+}
+.t-button--light.t-button--hover,
+.t-button--light.t-button--hover::after {
+ background-color: var(--td-button-light-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+ border-color: var(--td-button-light-active-border-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+}
+.t-button--light.t-button--disabled {
+ color: var(--td-button-light-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+ background-color: var(--td-button-light-disabled-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--light.t-button--disabled,
+.t-button--light.t-button--disabled::after {
+ border-color: var(--td-button-light-disabled-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--danger {
+ color: var(--td-button-danger-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-button-danger-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--danger::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--danger.t-button--hover {
+ z-index: 0;
+}
+.t-button--danger.t-button--hover,
+.t-button--danger.t-button--hover::after {
+ background-color: var(--td-button-danger-active-bg-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+ border-color: var(--td-button-danger-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-button--danger.t-button--disabled {
+ color: var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff));
+ background-color: var(--td-button-danger-disabled-bg, var(--td-error-color-3, #ffb9b0));
+}
+.t-button--danger.t-button--disabled,
+.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-danger-disabled-border-color, var(--td-error-color-3, #ffb9b0));
+}
+.t-button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ white-space: nowrap;
+ text-align: center;
+ background-image: none;
+ transition: all 0.3s;
+ touch-action: manipulation;
+ border-radius: var(--td-button-border-radius, var(--td-radius-default, 12rpx));
+ outline: none;
+ font-family: PingFang SC, Microsoft YaHei, Arial Regular;
+ font-weight: var(--td-button-font-weight, 600);
+ vertical-align: top;
+ box-sizing: border-box;
+ cursor: pointer;
+ -webkit-tap-highlight-color: transparent;
+ -webkit-user-select: none;
+ user-select: none;
+ /* stylelint-disable-next-line */
+ -webkit-appearance: none;
+}
+.t-button::after {
+ border-radius: calc(var(--td-button-border-radius, var(--td-radius-default, 12rpx)) * 2);
+}
+.t-button--text {
+ color: var(--td-button-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ background-color: transparent;
+}
+.t-button--text,
+.t-button--text::after {
+ border: 0;
+}
+.t-button--text.t-button--hover,
+.t-button--text.t-button--hover::after {
+ background-color: var(--td-button-default-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--primary {
+ color: var(--td-button-primary-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: transparent;
+}
+.t-button--text.t-button--primary.t-button--hover,
+.t-button--text.t-button--primary.t-button--hover::after {
+ background-color: var(--td-button-primary-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--primary.t-button--disabled {
+ color: var(--td-button-primary-text-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+}
+.t-button--text.t-button--danger {
+ color: var(--td-button-danger-text-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: transparent;
+}
+.t-button--text.t-button--danger.t-button--hover,
+.t-button--text.t-button--danger.t-button--hover::after {
+ background-color: var(--td-button-danger-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--danger.t-button--disabled {
+ color: var(--td-button-danger-text-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+}
+.t-button--text.t-button--light {
+ color: var(--td-button-light-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: transparent;
+}
+.t-button--text.t-button--light.t-button--hover,
+.t-button--text.t-button--light.t-button--hover::after {
+ background-color: var(--td-button-light-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--disabled {
+ color: var(--td-button-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-button--outline {
+ color: var(--td-button-default-outline-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+}
+.t-button--outline,
+.t-button--outline::after {
+ border-color: var(--td-button-default-outline-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--hover,
+.t-button--outline.t-button--hover::after {
+ background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--disabled {
+ color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--disabled,
+.t-button--outline.t-button--disabled::after {
+ border-color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--primary {
+ color: var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--outline.t-button--primary,
+.t-button--outline.t-button--primary::after {
+ border-color: var(--td-button-primary-outline-border-color, var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-button--outline.t-button--primary.t-button--hover {
+ color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--primary.t-button--hover::after {
+ background-color: var(--td-button-primary-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--primary.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--outline.t-button--primary.t-button--disabled,
+.t-button--outline.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--outline.t-button--danger {
+ color: var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--outline.t-button--danger,
+.t-button--outline.t-button--danger::after {
+ border-color: var(--td-button-danger-outline-border-color, var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
+}
+.t-button--outline.t-button--danger.t-button--hover {
+ color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-button--outline.t-button--danger.t-button--hover::after {
+ background-color: var(--td-button-danger-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-button--outline.t-button--danger.t-button--disabled {
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
+}
+.t-button--outline.t-button--danger.t-button--disabled,
+.t-button--outline.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
+}
+.t-button--outline.t-button--light {
+ color: var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-button-light-outline-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--outline.t-button--light,
+.t-button--outline.t-button--light::after {
+ border-color: var(--td-button-light-outline-border-color, var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-button--outline.t-button--light.t-button--hover {
+ color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--light.t-button--hover,
+.t-button--outline.t-button--light.t-button--hover::after {
+ background-color: var(--td-button-light-outline-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+ border-color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--light.t-button--disabled {
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--outline.t-button--light.t-button--disabled,
+.t-button--outline.t-button--light.t-button--disabled::after {
+ border-color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--dashed {
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ border-style: dashed;
+ border-width: 2rpx;
+}
+.t-button--dashed::after {
+ border: 0;
+}
+.t-button--dashed.t-button--hover,
+.t-button--dashed.t-button--hover::after {
+ background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--dashed.t-button--primary {
+ color: var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--dashed.t-button--primary,
+.t-button--dashed.t-button--primary::after {
+ border-color: var(--td-button-primary-dashed-border-color, var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-button--dashed.t-button--primary.t-button--disabled {
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--dashed.t-button--primary.t-button--disabled,
+.t-button--dashed.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--dashed.t-button--danger {
+ color: var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--dashed.t-button--danger,
+.t-button--dashed.t-button--danger::after {
+ border-color: var(--td-button-danger-dashed-border-color, var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
+}
+.t-button--dashed.t-button--danger.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
+}
+.t-button--dashed.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
+}
+.t-button--ghost {
+ background-color: transparent;
+ color: var(--td-button-ghost-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-button--ghost,
+.t-button--ghost::after {
+ border-color: var(--td-button-ghost-border-color, var(--td-button-ghost-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff))));
+}
+.t-button--ghost.t-button--default.t-button--hover {
+ color: var(--td-button-ghost-hover-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
+}
+.t-button--ghost.t-button--default.t-button--hover,
+.t-button--ghost.t-button--default.t-button--hover::after {
+ background-color: transparent;
+ border-color: var(--td-button-ghost-hover-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
+}
+.t-button--ghost.t-button--primary {
+ color: var(--td-button-ghost-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--ghost.t-button--primary,
+.t-button--ghost.t-button--primary::after {
+ border-color: var(--td-button-ghost-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--ghost.t-button--primary.t-button--hover {
+ color: var(--td-button-ghost-primary-hover-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--ghost.t-button--primary.t-button--hover,
+.t-button--ghost.t-button--primary.t-button--hover::after {
+ background-color: transparent;
+ border-color: var(--td-button-ghost-primary-hover-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--ghost.t-button--primary.t-button--text.t-button--hover,
+.t-button--ghost.t-button--primary.t-button--text.t-button--hover::after {
+ background-color: var(--td-gray-color-10, #4b4b4b);
+}
+.t-button--ghost.t-button--primary.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
+}
+.t-button--ghost.t-button--primary.t-button--disabled,
+.t-button--ghost.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
+}
+.t-button--ghost.t-button--danger {
+ color: var(--td-button-ghost-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--ghost.t-button--danger,
+.t-button--ghost.t-button--danger::after {
+ border-color: var(--td-button-ghost-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--ghost.t-button--danger.t-button--hover {
+ color: var(--td-button-ghost-danger-hover-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-button--ghost.t-button--danger.t-button--hover,
+.t-button--ghost.t-button--danger.t-button--hover::after {
+ background-color: transparent;
+ border-color: var(--td-button-ghost-danger-hover-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-button--ghost.t-button--danger.t-button--text.t-button--hover,
+.t-button--ghost.t-button--danger.t-button--text.t-button--hover::after {
+ background-color: var(--td-gray-color-10, #4b4b4b);
+}
+.t-button--ghost.t-button--danger.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
+}
+.t-button--ghost.t-button--danger.t-button--disabled,
+.t-button--ghost.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
+}
+.t-button--ghost.t-button--default.t-button--text.t-button--hover,
+.t-button--ghost.t-button--default.t-button--text.t-button--hover::after {
+ background-color: var(--td-gray-color-10, #4b4b4b);
+}
+.t-button--ghost.t-button--default.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
+}
+.t-button--ghost.t-button--default.t-button--disabled,
+.t-button--ghost.t-button--default.t-button--disabled::after {
+ border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
+}
+.t-button__loading + .t-button__content:not(:empty),
+.t-button__icon + .t-button__content:not(:empty) {
+ margin-left: 8rpx;
+}
+.t-button__icon {
+ border-radius: var(--td-button-icon-border-radius, 8rpx);
+}
+.t-button--round.t-button--size-large {
+ border-radius: calc(var(--td-button-large-height, 96rpx) / 2);
+}
+.t-button--round.t-button--size-large::after {
+ border-radius: var(--td-button-large-height, 96rpx);
+}
+.t-button--round.t-button--size-medium {
+ border-radius: calc(var(--td-button-medium-height, 80rpx) / 2);
+}
+.t-button--round.t-button--size-medium::after {
+ border-radius: var(--td-button-medium-height, 80rpx);
+}
+.t-button--round.t-button--size-small {
+ border-radius: calc(var(--td-button-small-height, 64rpx) / 2);
+}
+.t-button--round.t-button--size-small::after {
+ border-radius: var(--td-button-small-height, 64rpx);
+}
+.t-button--round.t-button--size-extra-small {
+ border-radius: calc(var(--td-button-extra-small-height, 56rpx) / 2);
+}
+.t-button--round.t-button--size-extra-small::after {
+ border-radius: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--square {
+ padding: 0;
+}
+.t-button--square.t-button--size-large {
+ width: var(--td-button-large-height, 96rpx);
+}
+.t-button--square.t-button--size-medium {
+ width: var(--td-button-medium-height, 80rpx);
+}
+.t-button--square.t-button--size-small {
+ width: var(--td-button-small-height, 64rpx);
+}
+.t-button--square.t-button--size-extra-small {
+ width: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--circle {
+ padding: 0;
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-large {
+ width: var(--td-button-large-height, 96rpx);
+}
+.t-button--circle.t-button--size-large::after {
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-medium {
+ width: var(--td-button-medium-height, 80rpx);
+}
+.t-button--circle.t-button--size-medium::after {
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-small {
+ width: var(--td-button-small-height, 64rpx);
+}
+.t-button--circle.t-button--size-small::after {
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-extra-small {
+ width: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--circle.t-button--size-extra-small::after {
+ border-radius: 50%;
+}
+.t-button--block {
+ display: flex;
+ width: 100%;
+}
+.t-button--disabled {
+ cursor: not-allowed;
+}
+.t-button__loading--wrapper {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-button.t-button--hover::after {
+ z-index: -1;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/index.d.ts b/miniprogram_npm/tdesign-miniprogram/button/index.d.ts
new file mode 100644
index 0000000..beb0ad5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './button';
diff --git a/miniprogram_npm/tdesign-miniprogram/button/index.js b/miniprogram_npm/tdesign-miniprogram/button/index.js
new file mode 100644
index 0000000..beb0ad5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './button';
diff --git a/miniprogram_npm/tdesign-miniprogram/button/props.d.ts b/miniprogram_npm/tdesign-miniprogram/button/props.d.ts
new file mode 100644
index 0000000..00dc5fb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/props.d.ts
@@ -0,0 +1,3 @@
+import { TdButtonProps } from './type';
+declare const props: TdButtonProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/button/props.js b/miniprogram_npm/tdesign-miniprogram/button/props.js
new file mode 100644
index 0000000..b81e71b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/props.js
@@ -0,0 +1,108 @@
+const props = {
+ appParameter: {
+ type: String,
+ value: '',
+ },
+ block: {
+ type: Boolean,
+ value: false,
+ },
+ content: {
+ type: String,
+ },
+ customDataset: {
+ type: null,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ ghost: {
+ type: Boolean,
+ value: false,
+ },
+ hoverClass: {
+ type: String,
+ value: '',
+ },
+ hoverStartTime: {
+ type: Number,
+ value: 20,
+ },
+ hoverStayTime: {
+ type: Number,
+ value: 70,
+ },
+ hoverStopPropagation: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ lang: {
+ type: String,
+ },
+ loading: {
+ type: Boolean,
+ value: false,
+ },
+ loadingProps: {
+ type: Object,
+ },
+ openType: {
+ type: String,
+ },
+ phoneNumberNoQuotaToast: {
+ type: Boolean,
+ value: true,
+ },
+ sendMessageImg: {
+ type: String,
+ value: '截图',
+ },
+ sendMessagePath: {
+ type: String,
+ value: '当前分享路径',
+ },
+ sendMessageTitle: {
+ type: String,
+ value: '当前标题',
+ },
+ sessionFrom: {
+ type: String,
+ value: '',
+ },
+ shape: {
+ type: String,
+ value: 'rectangle',
+ },
+ showMessageCard: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ style: {
+ type: String,
+ value: '',
+ },
+ tId: {
+ type: String,
+ value: '',
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ type: {
+ type: String,
+ },
+ variant: {
+ type: String,
+ value: 'base',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/button/type.d.ts b/miniprogram_npm/tdesign-miniprogram/button/type.d.ts
new file mode 100644
index 0000000..5a07a2a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/type.d.ts
@@ -0,0 +1,115 @@
+import { LoadingProps } from '../loading/index';
+export interface TdButtonProps {
+ appParameter?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ customDataset?: {
+ type: null;
+ value?: null;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ ghost?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ hoverClass?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ hoverStartTime?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ hoverStayTime?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ hoverStopPropagation?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ lang?: {
+ type: StringConstructor;
+ value?: 'en' | 'zh_CN' | 'zh_TW';
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ loadingProps?: {
+ type: ObjectConstructor;
+ value?: LoadingProps;
+ };
+ openType?: {
+ type: StringConstructor;
+ value?: 'contact' | 'share' | 'getPhoneNumber' | 'getUserInfo' | 'launchApp' | 'openSetting' | 'feedback' | 'chooseAvatar' | 'agreePrivacyAuthorization';
+ };
+ phoneNumberNoQuotaToast?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ sendMessageImg?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ sendMessagePath?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ sendMessageTitle?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ sessionFrom?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'rectangle' | 'square' | 'round' | 'circle';
+ };
+ showMessageCard?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'extra-small' | 'small' | 'medium' | 'large';
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ tId?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'primary' | 'danger' | 'light';
+ };
+ type?: {
+ type: StringConstructor;
+ value?: 'submit' | 'reset';
+ };
+ variant?: {
+ type: StringConstructor;
+ value?: 'base' | 'outline' | 'dashed' | 'text';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/type.js b/miniprogram_npm/tdesign-miniprogram/button/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/calendar/README.en-US.md
new file mode 100644
index 0000000..84b8fe1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/README.en-US.md
@@ -0,0 +1,54 @@
+:: BASE_DOC ::
+
+## API
+
+### Calendar 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
+auto-close | Boolean | true | `0.34.0` | N
+confirm-btn | String / Object / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts) | N
+first-day-of-week | Number | 0 | \- | N
+format | Function | - | Typescript:`CalendarFormatType ` `type CalendarFormatType = (day: TDate) => TDate` `type TDateType = 'selected' \| 'disabled' \| 'start' \| 'centre' \| 'end' \| ''` `interface TDate { date: Date; day: number; type: TDateType; className?: string; prefix?: string; suffix?: string;}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts) | N
+locale-text | Object | - | Typescript:`CalendarLocaleText` `interface CalendarLocaleText {title?: string; weekdays?: string[]; monthTitle?: string; months?: string[]; confirm?: string;}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts) | N
+max-date | Number | - | \- | N
+min-date | Number | - | \- | N
+switch-mode | String | none | options: none/month/year-month | N
+title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+type | String | 'single' | options: single/multiple/range | N
+use-popup | Boolean | true | `0.32.0` | N
+using-custom-navbar | Boolean | false | \- | N
+value | Number / Array | - | Typescript:`number \| number[]` | N
+default-value | Number / Array | undefined | uncontrolled property。Typescript:`number \| number[]` | N
+visible | Boolean | false | \- | N
+
+### Calendar Events
+
+name | params | description
+-- | -- | --
+change | `(value: timestamp)` | `0.28.0`
+close | `(trigger: CalendarTrigger)` | `0.34.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts)。
`type CalendarTrigger = 'close-btn' \| 'confirm-btn' \| 'overlay'`
+confirm | `(value: timestamp)` | \-
+panel-change | `(year: number; month: number)` | `1.8.4`
+scroll | `({scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY})` | `1.4.6`。triggered when scrolling
+select | `(value: timestamp)` | `0.28.0`
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-calendar-active-color | @brand-color | -
+--td-calendar-bg-color | @bg-color-container | -
+--td-calendar-days-color | @text-color-secondary | -
+--td-calendar-item-centre-color | @brand-color-light | -
+--td-calendar-item-disabled-color | @text-color-disabled | -
+--td-calendar-item-suffix-color | @text-color-placeholder | -
+--td-calendar-radius | 24rpx | -
+--td-calendar-selected-color | @text-color-anti | -
+--td-calendar-switch-mode-icon-color | @brand-color | -
+--td-calendar-switch-mode-icon-disabled-color | @brand-color-disabled | -
+--td-calendar-title-color | @text-color-primary | -
+--td-calendar-title-font-size | 18px | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/README.md b/miniprogram_npm/tdesign-miniprogram/calendar/README.md
new file mode 100644
index 0000000..8f705b7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/README.md
@@ -0,0 +1,120 @@
+---
+title: Calendar 日历
+description: 按照日历形式展示数据或日期的容器。
+spline: form
+isComponent: true
+---
+


+
+
+
+ 该组件于 0.22.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-calendar": "tdesign-miniprogram/calendar/calendar"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+#### 单个选择日历
+
+{{ base }}
+
+#### 多个选择日历
+
+{{ multiple }}
+
+#### 带单行/双行描述的日历
+
+{{ custom-text }}
+
+#### 带翻页功能的日历
+
+{{ switch-mode }}
+
+#### 可选择区间日期的日历
+
+{{ range }}
+
+### 组件样式
+
+#### 国际化
+
+{{ local-text }}
+
+#### 含不可选的日历
+
+{{ custom-range }}
+
+#### 不使用 Popup
+
+{{ without-popup }}
+
+## API
+
+### Calendar Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+auto-close | Boolean | true | `0.34.0`。自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭,不需要手动设置 visible | N
+confirm-btn | String / Object / Slot | '' | 确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts) | N
+first-day-of-week | Number | 0 | 第一天从星期几开始,默认 0 = 周日 | N
+format | Function | - | 用于格式化日期的函数。TS 类型:`CalendarFormatType ` `type CalendarFormatType = (day: TDate) => TDate` `type TDateType = 'selected' \| 'disabled' \| 'start' \| 'centre' \| 'end' \| ''` `interface TDate { date: Date; day: number; type: TDateType; className?: string; prefix?: string; suffix?: string;}`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts) | N
+locale-text | Object | - | 国际化文案。TS 类型:`CalendarLocaleText` `interface CalendarLocaleText {title?: string; weekdays?: string[]; monthTitle?: string; months?: string[]; confirm?: string;}`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts) | N
+max-date | Number | - | 最大可选的日期,不传则默认半年后 | N
+min-date | Number | - | 最小可选的日期,不传则默认今天 | N
+switch-mode | String | none | 切换模式。 `none` 表示水平方向平铺展示所有月份; `month` 表示支持按月切换, `year-month` 表示既按年切换,也支持按月切换。可选项:none/month/year-month | N
+title | String / Slot | - | 标题,不传默认为“请选择日期”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+type | String | 'single' | 日历的选择类型,single = 单选;multiple = 多选; range = 区间选择。可选项:single/multiple/range | N
+use-popup | Boolean | true | `0.32.0`。是否使用弹出层包裹日历 | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+value | Number / Array | - | 当前选择的日期,不传则选用 minDate 属性值或今天,优先级:minDate > today。当 type = multiple 或 range 时传入数组。TS 类型:`number \| number[]` | N
+default-value | Number / Array | undefined | 当前选择的日期,不传则选用 minDate 属性值或今天,优先级:minDate > today。当 type = multiple 或 range 时传入数组。非受控属性。TS 类型:`number \| number[]` | N
+visible | Boolean | false | 是否显示日历;`usePopup` 为 true 时有效 | N
+
+### Calendar Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: timestamp)` | `0.28.0`。不显示 confirm-btn 时,完成选择时触发(暂不支持 type = multiple)
+close | `(trigger: CalendarTrigger)` | `0.34.0`。关闭按钮时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/calendar/type.ts)。
`type CalendarTrigger = 'close-btn' \| 'confirm-btn' \| 'overlay'`
+confirm | `(value: timestamp)` | 点击确认按钮时触发
+panel-change | `(year: number; month: number)` | `1.8.4`。切换月或年时触发(switch-mode 不为 none 时有效)
+scroll | `({scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY})` | `1.4.6`。滚动时触发
+select | `(value: timestamp)` | `0.28.0`。点击日期时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-calendar-active-color | @brand-color | 选中项背景色
+--td-calendar-bg-color | @bg-color-container | -
+--td-calendar-days-color | @text-color-secondary | -
+--td-calendar-item-centre-color | @brand-color-light | -
+--td-calendar-item-disabled-color | @text-color-disabled | -
+--td-calendar-item-suffix-color | @text-color-placeholder | -
+--td-calendar-radius | 24rpx | -
+--td-calendar-selected-color | @text-color-anti | -
+--td-calendar-switch-mode-icon-color | @brand-color | -
+--td-calendar-switch-mode-icon-disabled-color | @brand-color-disabled | -
+--td-calendar-title-color | @text-color-primary | -
+--td-calendar-title-font-size | 18px | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar-header.wxml b/miniprogram_npm/tdesign-miniprogram/calendar/calendar-header.wxml
new file mode 100644
index 0000000..8251b6a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar-header.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar.d.ts b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.d.ts
new file mode 100644
index 0000000..fc4f2ad
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.d.ts
@@ -0,0 +1,62 @@
+///
+import { SuperComponent } from '../common/src/index';
+import { TdCalendarProps } from './type';
+export interface CalendarProps extends TdCalendarProps {
+}
+export default class Calendar extends SuperComponent {
+ behaviors: string[];
+ externalClasses: string[];
+ options: WechatMiniprogram.Component.ComponentOptions;
+ properties: TdCalendarProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ months: any[];
+ scrollIntoView: string;
+ innerConfirmBtn: {};
+ realLocalText: {};
+ currentMonth: {};
+ actionButtons: {
+ preYearBtnDisable: boolean;
+ prevMonthBtnDisable: boolean;
+ nextMonthBtnDisable: boolean;
+ nextYearBtnDisable: boolean;
+ };
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ lifetimes: {
+ created(): void;
+ ready(): void;
+ };
+ observers: {
+ type(v: any): void;
+ confirmBtn(v: any): void;
+ 'firstDayOfWeek,minDate,maxDate'(firstDayOfWeek: any, minDate: any, maxDate: any): void;
+ value(v: any): void;
+ visible(v: any): void;
+ format(v: any): void;
+ };
+ methods: {
+ initialValue(): void;
+ scrollIntoView(): void;
+ getCurrentYearAndMonth(v: Date): {
+ year: number;
+ month: number;
+ };
+ updateActionButton(value: Date): void;
+ calcCurrentMonth(newValue?: any): void;
+ calcMonths(): void;
+ close(trigger: any): void;
+ onVisibleChange(): void;
+ handleClose(): void;
+ handleSelect(e: any): void;
+ onTplButtonTap(): void;
+ toTime(val: any): any;
+ onScroll(e: any): void;
+ getCurrentDate(): any;
+ handleSwitchModeChange(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar.js b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.js
new file mode 100644
index 0000000..33ef74c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.js
@@ -0,0 +1,261 @@
+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 TCalendar from '../common/shared/calendar/index';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+import { getPrevMonth, getPrevYear, getNextMonth, getNextYear } from './utils';
+const { prefix } = config;
+const name = `${prefix}-calendar`;
+const defaultLocaleText = {
+ title: '请选择日期',
+ weekdays: ['日', '一', '二', '三', '四', '五', '六'],
+ monthTitle: '{year} 年 {month}',
+ months: ['1 月', '2 月', '3 月', '4 月', '5 月', '6 月', '7 月', '8 月', '9 月', '10 月', '11 月', '12 月'],
+ confirm: '确认',
+};
+let Calendar = class Calendar extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [useCustomNavbar];
+ this.externalClasses = [`${prefix}-class`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ months: [],
+ scrollIntoView: '',
+ innerConfirmBtn: {},
+ realLocalText: {},
+ currentMonth: {},
+ actionButtons: {
+ preYearBtnDisable: false,
+ prevMonthBtnDisable: false,
+ nextMonthBtnDisable: false,
+ nextYearBtnDisable: false,
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'confirm',
+ },
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.lifetimes = {
+ created() {
+ this.base = new TCalendar(this.properties);
+ },
+ ready() {
+ const realLocalText = Object.assign(Object.assign({}, defaultLocaleText), this.properties.localeText);
+ this.initialValue();
+ this.setData({
+ days: this.base.getDays(realLocalText.weekdays),
+ realLocalText,
+ });
+ this.calcMonths();
+ if (this.data.switchMode !== 'none') {
+ this.calcCurrentMonth();
+ }
+ if (!this.data.usePopup) {
+ this.scrollIntoView();
+ }
+ },
+ };
+ this.observers = {
+ type(v) {
+ this.base.type = v;
+ },
+ confirmBtn(v) {
+ if (typeof v === 'string') {
+ this.setData({ innerConfirmBtn: v === 'slot' ? 'slot' : { content: v } });
+ }
+ else if (typeof v === 'object') {
+ this.setData({ innerConfirmBtn: v });
+ }
+ },
+ 'firstDayOfWeek,minDate,maxDate'(firstDayOfWeek, minDate, maxDate) {
+ firstDayOfWeek && (this.base.firstDayOfWeek = firstDayOfWeek);
+ minDate && (this.base.minDate = minDate);
+ maxDate && (this.base.maxDate = maxDate);
+ this.calcMonths();
+ },
+ value(v) {
+ this.base.value = v;
+ this.calcMonths();
+ },
+ visible(v) {
+ if (v) {
+ this.scrollIntoView();
+ this.base.value = this.data.value;
+ this.calcMonths();
+ }
+ },
+ format(v) {
+ const { usePopup, visible } = this.data;
+ this.base.format = v;
+ if (!usePopup || visible) {
+ this.calcMonths();
+ }
+ },
+ };
+ this.methods = {
+ initialValue() {
+ const { value, type, minDate } = this.data;
+ if (!value) {
+ const today = new Date();
+ const now = minDate || new Date(today.getFullYear(), today.getMonth(), today.getDate()).getTime();
+ const initialValue = type === 'single' ? now : [now];
+ if (type === 'range') {
+ initialValue[1] = now + 24 * 3600 * 1000;
+ }
+ this.setData({
+ value: initialValue,
+ });
+ this.base.value = initialValue;
+ }
+ },
+ scrollIntoView() {
+ const { value } = this.data;
+ if (!value)
+ return;
+ const date = new Date(Array.isArray(value) ? value[0] : value);
+ if (date) {
+ this.setData({
+ scrollIntoView: `year_${date.getFullYear()}_month_${date.getMonth()}`,
+ });
+ }
+ },
+ getCurrentYearAndMonth(v) {
+ const date = new Date(v);
+ return { year: date.getFullYear(), month: date.getMonth() };
+ },
+ updateActionButton(value) {
+ const _min = this.getCurrentYearAndMonth(this.base.minDate);
+ const _max = this.getCurrentYearAndMonth(this.base.maxDate);
+ const _minTimestamp = new Date(_min.year, _min.month, 1).getTime();
+ const _maxTimestamp = new Date(_max.year, _max.month, 1).getTime();
+ const _prevYearTimestamp = getPrevYear(value).getTime();
+ const _prevMonthTimestamp = getPrevMonth(value).getTime();
+ const _nextMonthTimestamp = getNextMonth(value).getTime();
+ const _nextYearTimestamp = getNextYear(value).getTime();
+ const preYearBtnDisable = _prevYearTimestamp < _minTimestamp || _prevMonthTimestamp < _minTimestamp;
+ const prevMonthBtnDisable = _prevMonthTimestamp < _minTimestamp;
+ const nextYearBtnDisable = _nextMonthTimestamp > _maxTimestamp || _nextYearTimestamp > _maxTimestamp;
+ const nextMonthBtnDisable = _nextMonthTimestamp > _maxTimestamp;
+ this.setData({
+ actionButtons: {
+ preYearBtnDisable,
+ prevMonthBtnDisable,
+ nextYearBtnDisable,
+ nextMonthBtnDisable,
+ },
+ });
+ },
+ calcCurrentMonth(newValue) {
+ const date = newValue || this.getCurrentDate();
+ const { year, month } = this.getCurrentYearAndMonth(date);
+ const currentMonth = this.data.months.filter((item) => item.year === year && item.month === month);
+ this.updateActionButton(date);
+ this.setData({
+ currentMonth: currentMonth.length > 0 ? currentMonth : [this.data.months[0]],
+ });
+ },
+ calcMonths() {
+ const months = this.base.getMonths();
+ this.setData({
+ months,
+ });
+ },
+ close(trigger) {
+ if (this.data.autoClose) {
+ this.setData({ visible: false });
+ }
+ this.triggerEvent('close', { trigger });
+ },
+ onVisibleChange() {
+ this.close('overlay');
+ },
+ handleClose() {
+ this.close('close-btn');
+ },
+ handleSelect(e) {
+ const { date, year, month } = e.currentTarget.dataset;
+ if (date.type === 'disabled')
+ return;
+ const rawValue = this.base.select({ cellType: date.type, year, month, date: date.day });
+ const value = this.toTime(rawValue);
+ this.calcMonths();
+ if (this.data.switchMode !== 'none') {
+ const date = this.getCurrentDate();
+ this.calcCurrentMonth(date);
+ }
+ if (this.data.confirmBtn == null) {
+ if (this.data.type === 'single' || rawValue.length === 2) {
+ this.setData({ visible: false });
+ this._trigger('change', { value });
+ }
+ }
+ this.triggerEvent('select', { value });
+ },
+ onTplButtonTap() {
+ const rawValue = this.base.getTrimValue();
+ const value = this.toTime(rawValue);
+ this.close('confirm-btn');
+ this._trigger('confirm', { value });
+ },
+ toTime(val) {
+ if (Array.isArray(val)) {
+ return val.map((item) => item.getTime());
+ }
+ return val.getTime();
+ },
+ onScroll(e) {
+ this.triggerEvent('scroll', e.detail);
+ },
+ getCurrentDate() {
+ var _a, _b;
+ let time = Array.isArray(this.base.value) ? this.base.value[0] : this.base.value;
+ if (this.data.currentMonth.length > 0) {
+ const year = (_a = this.data.currentMonth[0]) === null || _a === void 0 ? void 0 : _a.year;
+ const month = (_b = this.data.currentMonth[0]) === null || _b === void 0 ? void 0 : _b.month;
+ time = new Date(year, month, 1).getTime();
+ }
+ return time;
+ },
+ handleSwitchModeChange(e) {
+ const { type, disabled } = e.currentTarget.dataset;
+ if (disabled)
+ return;
+ const date = this.getCurrentDate();
+ const funcMap = {
+ 'pre-year': () => getPrevYear(date),
+ 'pre-month': () => getPrevMonth(date),
+ 'next-month': () => getNextMonth(date),
+ 'next-year': () => getNextYear(date),
+ };
+ const newValue = funcMap[type]();
+ if (!newValue)
+ return;
+ const { year, month } = this.getCurrentYearAndMonth(newValue);
+ this.triggerEvent('panel-change', { year, month: month + 1 });
+ this.calcCurrentMonth(newValue);
+ },
+ };
+ }
+};
+Calendar = __decorate([
+ wxComponent()
+], Calendar);
+export default Calendar;
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar.json b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.json
new file mode 100644
index 0000000..855232c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-popup": "../popup/popup",
+ "t-button": "../button/button",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxml b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxml
new file mode 100644
index 0000000..8a5410f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxs b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxs
new file mode 100644
index 0000000..ad5d507
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxs
@@ -0,0 +1,44 @@
+function getDateLabel(monthItem, dateItem) {
+ var weekdayText = ['日', '一', '二', '三', '四', '五', '六'];
+ var weekday = (monthItem.weekdayOfFirstDay + dateItem.day - 1) % 7;
+ var label = monthItem.month + 1 + '月' + dateItem.day + '日, 星期' + weekdayText[weekday];
+ if (dateItem.type === 'start') {
+ label = '开始日期:' + label;
+ }
+ if (dateItem.type === 'end') {
+ label = '结束日期:' + label;
+ }
+ if (isDateSelected(dateItem)) {
+ label = '已选中, ' + label;
+ }
+ if (dateItem.prefix) {
+ label += ', ' + dateItem.prefix;
+ }
+ if (dateItem.suffix) {
+ label += ', ' + dateItem.suffix;
+ }
+ return label;
+}
+
+function isDateSelected(dateItem) {
+ return ['start', 'end', 'selected', 'centre'].indexOf(dateItem.type) >= 0;
+}
+
+function getMonthTitle(year, month, pattern = '') {
+ // prettier-ignore
+ var REGEXP = getRegExp('\{year\}|\{month\}', 'g');
+
+ return pattern.replace(REGEXP, function (match) {
+ var replacements = {
+ '{year}': year,
+ '{month}': month < 10 ? '0' + month : month,
+ };
+ return replacements[match] || match;
+ });
+}
+
+module.exports = {
+ getDateLabel: getDateLabel,
+ isDateSelected: isDateSelected,
+ getMonthTitle: getMonthTitle,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxss b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxss
new file mode 100644
index 0000000..bbd3b1a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/calendar.wxss
@@ -0,0 +1,240 @@
+.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-calendar {
+ width: inherit;
+ position: relative;
+ z-index: 9999;
+ background: var(--td-calendar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ overflow-x: hidden;
+}
+.t-calendar--popup {
+ border-top-left-radius: var(--td-calendar-radius, 24rpx);
+ border-top-right-radius: var(--td-calendar-radius, 24rpx);
+}
+.t-calendar__title {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: var(--td-calendar-title-font-size, 18px);
+ font-weight: 600;
+ color: var(--td-calendar-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ height: 52rpx;
+ padding: 32rpx;
+}
+.t-calendar__title:focus {
+ outline: 0;
+}
+.t-calendar__close-btn {
+ position: absolute;
+ top: 32rpx;
+ right: 32rpx;
+ margin: -24rpx;
+ padding: 24rpx;
+ color: var(--td-calendar-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-calendar__days {
+ display: grid;
+ grid-template-columns: repeat(7, 1fr);
+ grid-column-gap: 8rpx;
+ padding: 0 32rpx;
+ text-align: center;
+ line-height: 92rpx;
+}
+.t-calendar__days-item {
+ height: 92rpx;
+ font-size: 28rpx;
+ color: var(--td-calendar-days-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+}
+.t-calendar__content {
+ min-height: 400rpx;
+ display: flex;
+ flex-direction: column;
+}
+.t-calendar__month {
+ font-size: 28rpx;
+ color: var(--td-calendar-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-weight: 600;
+ padding: 32rpx 0 0;
+}
+.t-calendar__months {
+ height: 712rpx;
+ padding: 0 32rpx 32rpx;
+ box-sizing: border-box;
+}
+.t-calendar__months::-webkit-scrollbar {
+ display: none;
+}
+.t-calendar__dates {
+ flex: 1;
+ display: grid;
+ grid-template-columns: repeat(7, 1fr);
+ grid-column-gap: 8rpx;
+}
+.t-calendar__dates-item {
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 32rpx;
+ border-radius: var(--td-calendar-selected-border-radius, var(--td-radius-default, 12rpx));
+ height: 120rpx;
+ line-height: 48rpx;
+ font-weight: 600;
+ margin-top: 16rpx;
+ color: var(--td-calendar-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ cursor: pointer;
+ -webkit-tap-highlight-color: transparent;
+ -webkit-user-select: none;
+ user-select: none;
+}
+.t-calendar__dates-item-prefix,
+.t-calendar__dates-item-suffix {
+ position: absolute;
+ font-size: 20rpx;
+ line-height: 32rpx;
+ width: 100%;
+ text-align: center;
+ font-weight: 400;
+}
+.t-calendar__dates-item-prefix {
+ top: 8rpx;
+}
+.t-calendar__dates-item-suffix {
+ bottom: 8rpx;
+ color: var(--td-calendar-item-suffix-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-calendar__dates-item-suffix--selected,
+.t-calendar__dates-item-suffix--start,
+.t-calendar__dates-item-suffix--end {
+ color: var(--td-calendar-selected-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-calendar__dates-item-suffix--disabled {
+ color: var(--td-calendar-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-calendar__dates-item--selected,
+.t-calendar__dates-item--start,
+.t-calendar__dates-item--end {
+ background: var(--td-calendar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ color: var(--td-calendar-selected-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ border-radius: var(--td-calendar-selected-border-radius, var(--td-radius-default, 12rpx));
+}
+.t-calendar__dates-item--start {
+ border-radius: var(--td-calendar-selected-border-radius, var(--td-radius-default, 12rpx)) 0 0 var(--td-calendar-selected-border-radius, var(--td-radius-default, 12rpx));
+}
+.t-calendar__dates-item--end {
+ border-radius: 0 var(--td-calendar-selected-border-radius, var(--td-radius-default, 12rpx)) var(--td-calendar-selected-border-radius, var(--td-radius-default, 12rpx)) 0;
+}
+.t-calendar__dates-item--start + .t-calendar__dates-item--end::before {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ width: 8rpx;
+ height: 100%;
+ background: var(--td-calendar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-calendar__dates-item--start + .t-calendar__dates-item--end:before {
+ left: -8rpx;
+}
+.t-calendar__dates-item--centre {
+ border-radius: 0;
+ background-color: var(--td-calendar-item-centre-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-calendar__dates-item--centre::before,
+.t-calendar__dates-item--centre::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ width: 8rpx;
+ height: 100%;
+ background-color: var(--td-calendar-item-centre-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-calendar__dates-item--centre:before {
+ left: -8rpx;
+}
+.t-calendar__dates-item--centre:after {
+ right: -8rpx;
+}
+.t-calendar__dates-item--disabled {
+ color: var(--td-calendar-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ cursor: default;
+}
+.t-calendar__footer {
+ padding: 32rpx;
+}
+.t-calendar-switch-mode--none > .t-calendar__months {
+ height: 60vh;
+}
+.t-calendar-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ line-height: 44rpx;
+}
+.t-calendar-header__with-action {
+ padding: 0rpx 32rpx 16rpx 32rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+.t-calendar-header__with-action::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-border-color, var(--td-gray-color-3, #e7e7e7));
+}
+.t-calendar-header__with-action::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-calendar-header__with-action .t-calendar-header__title {
+ flex: 1;
+ text-align: center;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+.t-calendar-header__action {
+ display: flex;
+ font-size: 40rpx;
+ color: var(--td-calendar-switch-mode-icon-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+}
+.t-calendar-header__icon {
+ padding: 16rpx;
+}
+.t-calendar-header__icon--disabled {
+ color: var(--td-calendar-switch-mode-icon-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-calendar-header__title {
+ text-align: left;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/index.d.ts b/miniprogram_npm/tdesign-miniprogram/calendar/index.d.ts
new file mode 100644
index 0000000..cf0e3b8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/index.d.ts
@@ -0,0 +1,2 @@
+export * from './type';
+export * from './calendar';
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/index.js b/miniprogram_npm/tdesign-miniprogram/calendar/index.js
new file mode 100644
index 0000000..cf0e3b8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/index.js
@@ -0,0 +1,2 @@
+export * from './type';
+export * from './calendar';
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/calendar/props.d.ts
new file mode 100644
index 0000000..a42879c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCalendarProps } from './type';
+declare const props: TdCalendarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/props.js b/miniprogram_npm/tdesign-miniprogram/calendar/props.js
new file mode 100644
index 0000000..aab6a95
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/props.js
@@ -0,0 +1,57 @@
+const props = {
+ autoClose: {
+ type: Boolean,
+ value: true,
+ },
+ confirmBtn: {
+ type: null,
+ value: '',
+ },
+ firstDayOfWeek: {
+ type: Number,
+ value: 0,
+ },
+ format: {
+ type: null,
+ },
+ localeText: {
+ type: Object,
+ },
+ maxDate: {
+ type: Number,
+ },
+ minDate: {
+ type: Number,
+ },
+ switchMode: {
+ type: String,
+ value: 'none',
+ },
+ title: {
+ type: String,
+ },
+ type: {
+ type: String,
+ value: 'single',
+ },
+ usePopup: {
+ type: Boolean,
+ value: true,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/template.wxml b/miniprogram_npm/tdesign-miniprogram/calendar/template.wxml
new file mode 100644
index 0000000..f824da2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/template.wxml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/calendar/type.d.ts
new file mode 100644
index 0000000..5df9dff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/type.d.ts
@@ -0,0 +1,80 @@
+import { ButtonProps } from '../button/index';
+export interface TdCalendarProps {
+ autoClose?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ confirmBtn?: {
+ type: null;
+ value?: string | ButtonProps | null;
+ };
+ firstDayOfWeek?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ format?: {
+ type: undefined;
+ value?: CalendarFormatType;
+ };
+ localeText?: {
+ type: ObjectConstructor;
+ value?: CalendarLocaleText;
+ };
+ maxDate?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ minDate?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ switchMode?: {
+ type: StringConstructor;
+ value?: 'none' | 'month' | 'year-month';
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ type?: {
+ type: StringConstructor;
+ value?: 'single' | 'multiple' | 'range';
+ };
+ usePopup?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: number | number[];
+ };
+ defaultValue?: {
+ type: null;
+ value?: number | number[];
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export declare type CalendarFormatType = (day: TDate) => TDate;
+export declare type TDateType = 'selected' | 'disabled' | 'start' | 'centre' | 'end' | '';
+export interface TDate {
+ date: Date;
+ day: number;
+ type: TDateType;
+ className?: string;
+ prefix?: string;
+ suffix?: string;
+}
+export interface CalendarLocaleText {
+ title?: string;
+ weekdays?: string[];
+ monthTitle?: string;
+ months?: string[];
+ confirm?: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/type.js b/miniprogram_npm/tdesign-miniprogram/calendar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/calendar/utils.d.ts
new file mode 100644
index 0000000..800daa0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/utils.d.ts
@@ -0,0 +1,6 @@
+export declare function getMonthByOffset(date: Date, offset: number): Date;
+export declare function getYearByOffset(date: Date, offset: number): Date;
+export declare const getPrevMonth: (date: Date) => Date;
+export declare const getNextMonth: (date: Date) => Date;
+export declare const getPrevYear: (date: Date) => Date;
+export declare const getNextYear: (date: Date) => Date;
diff --git a/miniprogram_npm/tdesign-miniprogram/calendar/utils.js b/miniprogram_npm/tdesign-miniprogram/calendar/utils.js
new file mode 100644
index 0000000..2cbe6d3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/calendar/utils.js
@@ -0,0 +1,16 @@
+export function getMonthByOffset(date, offset) {
+ const _date = new Date(date);
+ _date.setMonth(_date.getMonth() + offset);
+ _date.setDate(1);
+ return _date;
+}
+export function getYearByOffset(date, offset) {
+ const _date = new Date(date);
+ _date.setFullYear(_date.getFullYear() + offset);
+ _date.setDate(1);
+ return _date;
+}
+export const getPrevMonth = (date) => getMonthByOffset(date, -1);
+export const getNextMonth = (date) => getMonthByOffset(date, 1);
+export const getPrevYear = (date) => getYearByOffset(date, -1);
+export const getNextYear = (date) => getYearByOffset(date, 1);
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/cascader/README.en-US.md
new file mode 100644
index 0000000..c18f6d4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/README.en-US.md
@@ -0,0 +1,49 @@
+:: BASE_DOC ::
+
+## API
+
+### Cascader 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
+check-strictly | Boolean | false | \- | N
+close-btn | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+options | Array | [] | Typescript:`Array` | N
+placeholder | String | 选择选项 | \- | N
+sub-titles | Array | [] | Typescript:`Array` | N
+theme | String | step | options: step/tab | N
+title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+value | String / Number | null | \- | N
+default-value | String / Number | undefined | uncontrolled property | N
+visible | Boolean | false | \- | N
+
+### Cascader Events
+
+name | params | description
+-- | -- | --
+change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`
+close | `(trigger: CascaderTriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)。
`type CascaderTriggerSource = 'overlay' \| 'close-btn' \| 'finish'`
+pick | `(value: string \| number, label: string, index: number, level: number)` | `1.0.1`
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-cascader-active-color | @brand-color | -
+--td-cascader-bg-color | @bg-color-container | -
+--td-cascader-border-color | @component-stroke | -
+--td-cascader-content-height | 78vh | -
+--td-cascader-disabled-color | @text-color-disabled | -
+--td-cascader-options-height | calc(100% - @cascader-step-height) | -
+--td-cascader-options-title-color | @text-color-placeholder | -
+--td-cascader-step-arrow-color | @text-color-placeholder | -
+--td-cascader-step-dot-size | 16rpx | -
+--td-cascader-step-height | 88rpx | -
+--td-cascader-title-color | @text-color-primary | -
+--td-cascader-title-height | 26rpx | -
+--td-cascader-title-padding | @spacer-2 | -
+--td-cascder-title-font-size | 36rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/README.md b/miniprogram_npm/tdesign-miniprogram/cascader/README.md
new file mode 100644
index 0000000..a81ff13
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/README.md
@@ -0,0 +1,101 @@
+---
+title: Cascader 级联选择器
+description: 级联选择器适用于有清晰层级结构的数据集合,用户可以通过逐级查看并选择。
+spline: form
+isComponent: true
+---
+
+
+
+ 该组件于 0.23.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-cascader": "tdesign-miniprogram/cascader/cascader"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础用法
+
+{{ base }}
+
+### 选项卡风格
+
+{{ theme-tab }}
+
+### 进阶
+
+#### 带初始值
+
+{{ with-value }}
+
+#### 自定义 keys
+
+{{ keys }}
+
+#### 使用次级标题
+
+{{ with-title }}
+
+## API
+
+### Cascader Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+check-strictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
+close-btn | Boolean / Slot | true | 关闭按钮。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+options | Array | [] | 可选项数据源。TS 类型:`Array` | N
+placeholder | String | 选择选项 | 未选中时的提示文案 | N
+sub-titles | Array | [] | 每级展示的次标题。TS 类型:`Array` | N
+theme | String | step | 展示风格。可选项:step/tab | N
+title | String / Slot | - | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+value | String / Number | null | 选项值 | N
+default-value | String / Number | undefined | 选项值。非受控属性 | N
+visible | Boolean | false | 是否展示 | N
+
+### Cascader Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`。值发生变更时触发
+close | `(trigger: CascaderTriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)。
`type CascaderTriggerSource = 'overlay' \| 'close-btn' \| 'finish'`
+pick | `(value: string \| number, label: string, index: number, level: number)` | `1.0.1`。选择后触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-cascader-active-color | @brand-color | -
+--td-cascader-bg-color | @bg-color-container | -
+--td-cascader-border-color | @component-stroke | -
+--td-cascader-content-height | 78vh | -
+--td-cascader-disabled-color | @text-color-disabled | -
+--td-cascader-options-height | calc(100% - @cascader-step-height) | -
+--td-cascader-options-title-color | @text-color-placeholder | -
+--td-cascader-step-arrow-color | @text-color-placeholder | -
+--td-cascader-step-dot-size | 16rpx | -
+--td-cascader-step-height | 88rpx | -
+--td-cascader-title-color | @text-color-primary | -
+--td-cascader-title-height | 26rpx | -
+--td-cascader-title-padding | @spacer-2 | -
+--td-cascder-title-font-size | 36rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts
new file mode 100644
index 0000000..7aa5bde
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts
@@ -0,0 +1,59 @@
+///
+import { SuperComponent } from '../common/src/index';
+import { TdCascaderProps } from './type';
+export interface CascaderProps extends TdCascaderProps {
+}
+export default class Cascader extends SuperComponent {
+ externalClasses: string[];
+ options: WechatMiniprogram.Component.ComponentOptions;
+ properties: TdCascaderProps>;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ state: {
+ contentHeight: number;
+ stepHeight: number;
+ tabsHeight: number;
+ subTitlesHeight: number;
+ stepsInitHeight: number;
+ };
+ data: {
+ prefix: string;
+ name: string;
+ stepIndex: number;
+ selectedIndexes: any[];
+ selectedValue: any[];
+ scrollTopList: any[];
+ steps: any[];
+ _optionsHeight: number;
+ };
+ observers: {
+ visible(v: any): void;
+ value(): void;
+ options(): void;
+ selectedIndexes(): void;
+ stepIndex(): Promise;
+ };
+ methods: {
+ updateOptionsHeight(steps: number): void;
+ initOptionsHeight(steps: number): Promise;
+ initWithValue(): void;
+ getIndexesByValue(options: import("../common/common").TreeOptionData[], value: any): any[];
+ updateScrollTop(): void;
+ hide(trigger: any): void;
+ onVisibleChange(): void;
+ onClose(): void;
+ onStepClick(e: any): void;
+ onTabChange(e: any): void;
+ genItems(): {
+ selectedValue: any[];
+ steps: any[];
+ items: {
+ [x: string]: any;
+ }[][];
+ };
+ handleSelect(e: any): void;
+ triggerChange(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
new file mode 100644
index 0000000..81931a9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
@@ -0,0 +1,303 @@
+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 config from '../common/config';
+import props from './props';
+import { getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-cascader`;
+function parseOptions(options, keys) {
+ var _a, _b;
+ const label = (_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label';
+ const value = (_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value';
+ return options.map((item) => {
+ return {
+ [label]: item[label],
+ [value]: item[value],
+ };
+ });
+}
+const defaultState = {
+ contentHeight: 0,
+ stepHeight: 0,
+ tabsHeight: 0,
+ subTitlesHeight: 0,
+ stepsInitHeight: 0,
+};
+let Cascader = class Cascader extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.options = {
+ multipleSlots: true,
+ pureDataPattern: /^options$/,
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.state = Object.assign({}, defaultState);
+ this.data = {
+ prefix,
+ name,
+ stepIndex: 0,
+ selectedIndexes: [],
+ selectedValue: [],
+ scrollTopList: [],
+ steps: [],
+ _optionsHeight: 0,
+ };
+ this.observers = {
+ visible(v) {
+ if (v) {
+ const $tabs = this.selectComponent('#tabs');
+ $tabs === null || $tabs === void 0 ? void 0 : $tabs.setTrack();
+ $tabs === null || $tabs === void 0 ? void 0 : $tabs.getTabHeight().then((res) => {
+ this.state.tabsHeight = res.height;
+ });
+ this.initOptionsHeight(this.data.steps.length);
+ this.updateScrollTop();
+ this.initWithValue();
+ }
+ else {
+ this.state = Object.assign({}, defaultState);
+ }
+ },
+ value() {
+ this.initWithValue();
+ },
+ options() {
+ const { selectedValue, steps, items } = this.genItems();
+ this.setData({
+ steps,
+ items,
+ selectedValue,
+ stepIndex: items.length - 1,
+ });
+ },
+ selectedIndexes() {
+ const { visible, theme } = this.properties;
+ const { selectedValue, steps, items } = this.genItems();
+ const setData = {
+ steps,
+ selectedValue,
+ stepIndex: items.length - 1,
+ };
+ if (JSON.stringify(items) !== JSON.stringify(this.data.items)) {
+ Object.assign(setData, { items });
+ }
+ this.setData(setData);
+ if (visible && theme === 'step') {
+ this.updateOptionsHeight(steps.length);
+ }
+ },
+ stepIndex() {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { visible } = this.data;
+ if (visible) {
+ this.updateScrollTop();
+ }
+ });
+ },
+ };
+ this.methods = {
+ updateOptionsHeight(steps) {
+ const { contentHeight, stepsInitHeight, stepHeight, subTitlesHeight } = this.state;
+ this.setData({
+ _optionsHeight: contentHeight - stepsInitHeight - subTitlesHeight - (steps - 1) * stepHeight,
+ });
+ },
+ initOptionsHeight(steps) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { theme, subTitles } = this.properties;
+ const { height } = yield getRect(this, `.${name}__content`);
+ this.state.contentHeight = height;
+ if (theme === 'step') {
+ yield Promise.all([getRect(this, `.${name}__steps`), getRect(this, `.${name}__step`)]).then(([stepsRect, stepRect]) => {
+ this.state.stepsInitHeight = stepsRect.height - (steps - 1) * stepRect.height;
+ this.state.stepHeight = stepRect.height;
+ });
+ }
+ if (subTitles.length > 0) {
+ const { height } = yield getRect(this, `.${name}__options-title`);
+ this.state.subTitlesHeight = height;
+ }
+ const optionsInitHeight = this.state.contentHeight - this.state.subTitlesHeight;
+ this.setData({
+ _optionsHeight: theme === 'step'
+ ? optionsInitHeight - this.state.stepsInitHeight - (steps - 1) * this.state.stepHeight
+ : optionsInitHeight - this.state.tabsHeight,
+ });
+ });
+ },
+ initWithValue() {
+ if (this.data.value != null && this.data.value !== '') {
+ const selectedIndexes = this.getIndexesByValue(this.data.options, this.data.value);
+ if (selectedIndexes) {
+ this.setData({ selectedIndexes });
+ }
+ }
+ else {
+ this.setData({ selectedIndexes: [] });
+ }
+ },
+ getIndexesByValue(options, value) {
+ var _a, _b, _c;
+ const { keys } = this.data;
+ for (let i = 0, size = options.length; i < size; i += 1) {
+ const opt = options[i];
+ if (opt[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value'] === value) {
+ return [i];
+ }
+ if (opt[(_b = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _b !== void 0 ? _b : 'children']) {
+ const res = this.getIndexesByValue(opt[(_c = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _c !== void 0 ? _c : 'children'], value);
+ if (res) {
+ return [i, ...res];
+ }
+ }
+ }
+ },
+ updateScrollTop() {
+ const { visible, items, selectedIndexes, stepIndex } = this.data;
+ if (visible) {
+ getRect(this, '.cascader-radio-group-0').then((rect) => {
+ var _a;
+ const eachRadioHeight = rect.height / ((_a = items[0]) === null || _a === void 0 ? void 0 : _a.length);
+ this.setData({
+ [`scrollTopList[${stepIndex}]`]: eachRadioHeight * selectedIndexes[stepIndex],
+ });
+ });
+ }
+ },
+ hide(trigger) {
+ this.setData({ visible: false });
+ this.triggerEvent('close', { trigger: trigger });
+ },
+ onVisibleChange() {
+ this.hide('overlay');
+ },
+ onClose() {
+ if (this.data.checkStrictly) {
+ this.triggerChange();
+ }
+ this.hide('close-btn');
+ },
+ onStepClick(e) {
+ const { index } = e.currentTarget.dataset;
+ this.setData({ stepIndex: index });
+ },
+ onTabChange(e) {
+ const { value } = e.detail;
+ this.setData({
+ stepIndex: value,
+ });
+ },
+ genItems() {
+ var _a, _b, _c, _d, _e;
+ const { options, selectedIndexes, keys, placeholder } = this.data;
+ const selectedValue = [];
+ const steps = [];
+ const items = [parseOptions(options, keys)];
+ if (options.length > 0) {
+ let current = options;
+ for (let i = 0, size = selectedIndexes.length; i < size; i += 1) {
+ const index = selectedIndexes[i];
+ const next = current[index];
+ current = next[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'];
+ selectedValue.push(next[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value']);
+ steps.push(next[(_c = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _c !== void 0 ? _c : 'label']);
+ if (next[(_d = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _d !== void 0 ? _d : 'children']) {
+ items.push(parseOptions(next[(_e = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _e !== void 0 ? _e : 'children'], keys));
+ }
+ }
+ }
+ if (steps.length < items.length) {
+ steps.push(placeholder);
+ }
+ return {
+ selectedValue,
+ steps,
+ items,
+ };
+ },
+ handleSelect(e) {
+ var _a, _b, _c, _d, _e;
+ const { level } = e.target.dataset;
+ const { value } = e.detail;
+ const { checkStrictly } = this.properties;
+ const { selectedIndexes, items, keys, options, selectedValue } = this.data;
+ const index = items[level].findIndex((item) => { var _a; return item[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value'] === value; });
+ let item = selectedIndexes.slice(0, level).reduce((acc, item, index) => {
+ var _a;
+ if (index === 0) {
+ return acc[item];
+ }
+ return acc[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'][item];
+ }, options);
+ if (level === 0) {
+ item = item[index];
+ }
+ else {
+ item = item[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'][index];
+ }
+ if (item.disabled) {
+ return;
+ }
+ this.triggerEvent('pick', {
+ value: item[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'],
+ label: item[(_c = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _c !== void 0 ? _c : 'label'],
+ index,
+ level,
+ });
+ selectedIndexes[level] = index;
+ if (checkStrictly && selectedValue.includes(String(value))) {
+ selectedIndexes.length = level;
+ this.setData({ selectedIndexes });
+ return;
+ }
+ selectedIndexes.length = level + 1;
+ const { items: newItems } = this.genItems();
+ if ((_e = item === null || item === void 0 ? void 0 : item[(_d = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _d !== void 0 ? _d : 'children']) === null || _e === void 0 ? void 0 : _e.length) {
+ this.setData({
+ selectedIndexes,
+ [`items[${level + 1}]`]: newItems[level + 1],
+ });
+ }
+ else {
+ this.setData({
+ selectedIndexes,
+ }, this.triggerChange);
+ this.hide('finish');
+ }
+ },
+ triggerChange() {
+ var _a;
+ const { items, selectedValue, selectedIndexes } = this.data;
+ this._trigger('change', {
+ value: (_a = selectedValue[selectedValue.length - 1]) !== null && _a !== void 0 ? _a : '',
+ selectedOptions: items.map((item, index) => item[selectedIndexes[index]]).filter(Boolean),
+ });
+ },
+ };
+ }
+};
+Cascader = __decorate([
+ wxComponent()
+], Cascader);
+export default Cascader;
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.json b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.json
new file mode 100644
index 0000000..6f4fec8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.json
@@ -0,0 +1,11 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-popup": "../popup/popup",
+ "t-tabs": "../tabs/tabs",
+ "t-tab-panel": "../tab-panel/tab-panel",
+ "t-radio-group": "../radio-group/radio-group"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml
new file mode 100644
index 0000000..cab98bc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+ {{subTitles[stepIndex]}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxss b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxss
new file mode 100644
index 0000000..5845aa2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxss
@@ -0,0 +1,132 @@
+.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-cascader {
+ display: flex;
+ flex-direction: column;
+ background-color: var(--td-cascader-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ color: var(--td-cascader-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ border-radius: var(--td-radius-extra-large, 24rpx) var(--td-radius-extra-large, 24rpx) 0 0;
+ --td-radio-icon-checked-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ --td-tab-item-active-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ --td-tab-track-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-cascader__close-btn {
+ right: 32rpx;
+ top: 24rpx;
+ position: absolute;
+}
+.t-cascader__title {
+ position: relative;
+ font-weight: 700;
+ text-align: center;
+ line-height: var(--td-cascader-title-height, 26rpx);
+ padding: var(--td-cascader-title-padding, var(--td-spacer-2, 32rpx));
+ font-size: var(--td-cascder-title-font-size, 36rpx);
+}
+.t-cascader__content {
+ width: 100%;
+ height: var(--td-cascader-content-height, 78vh);
+ display: flex;
+ flex-direction: column;
+}
+.t-cascader__options {
+ width: 100vw;
+}
+.t-cascader__options-title {
+ color: var(--td-cascader-options-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-font-size-base, 28rpx);
+ line-height: 44rpx;
+ padding-top: 40rpx;
+ padding-left: var(--td-spacer-2, 32rpx);
+ box-sizing: border-box;
+}
+.t-cascader__options-container {
+ flex: 1;
+ display: flex;
+ transition: all ease 0.3s;
+}
+.t-cascader__step {
+ display: flex;
+ align-items: center;
+ height: var(--td-cascader-step-height, 88rpx);
+}
+.t-cascader__steps {
+ padding: 0 32rpx 10rpx;
+ position: relative;
+}
+.t-cascader__steps::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-cascader-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-cascader__steps::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-cascader__step-dot {
+ position: relative;
+ width: var(--td-cascader-step-dot-size, 16rpx);
+ height: var(--td-cascader-step-dot-size, 16rpx);
+ border-radius: 50%;
+ border: 2rpx solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ box-sizing: border-box;
+}
+.t-cascader__step-dot:not(.t-cascader__step-dot--last)::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 50%;
+ top: calc(var(--td-cascader-step-dot-size, 16rpx) + 14rpx);
+ height: 36rpx;
+ width: 2rpx;
+ background: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ transform: translateX(-50%);
+}
+.t-cascader__step-dot--active {
+ background: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-cascader__step-label {
+ padding-left: var(--td-spacer-2, 32rpx);
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-cascader__step-label--active {
+ color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-weight: 600;
+}
+.t-cascader__step-arrow {
+ color: var(--td-cascader-step-arrow-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ margin-left: auto;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/props.d.ts b/miniprogram_npm/tdesign-miniprogram/cascader/props.d.ts
new file mode 100644
index 0000000..9009f89
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCascaderProps } from './type';
+declare const props: TdCascaderProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/props.js b/miniprogram_npm/tdesign-miniprogram/cascader/props.js
new file mode 100644
index 0000000..cbae378
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/props.js
@@ -0,0 +1,45 @@
+const props = {
+ checkStrictly: {
+ type: Boolean,
+ value: false,
+ },
+ closeBtn: {
+ type: Boolean,
+ value: true,
+ },
+ keys: {
+ type: Object,
+ },
+ options: {
+ type: Array,
+ value: [],
+ },
+ placeholder: {
+ type: String,
+ value: '选择选项',
+ },
+ subTitles: {
+ type: Array,
+ value: [],
+ },
+ theme: {
+ type: String,
+ value: 'step',
+ },
+ title: {
+ type: String,
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ value: null,
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts b/miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts
new file mode 100644
index 0000000..37edc3c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts
@@ -0,0 +1,47 @@
+import { TreeOptionData, KeysType } from '../common/common';
+export interface TdCascaderProps {
+ checkStrictly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ closeBtn?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: KeysType;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ placeholder?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ subTitles?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'step' | 'tab';
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+ defaultValue?: {
+ type: null;
+ value?: string | number;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/type.js b/miniprogram_npm/tdesign-miniprogram/cascader/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.d.ts b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.d.ts
new file mode 100644
index 0000000..30d14dc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.d.ts
@@ -0,0 +1,13 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class CellGroup extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ properties: import("./type").TdCellGroupProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ methods: {
+ updateLastChid(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.js b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.js
new file mode 100644
index 0000000..966ceec
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.js
@@ -0,0 +1,43 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-cell-group`;
+let CellGroup = class CellGroup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-title`];
+ this.relations = {
+ '../cell/cell': {
+ type: 'child',
+ linked() {
+ this.updateLastChid();
+ },
+ unlinked() {
+ this.updateLastChid();
+ },
+ },
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.methods = {
+ updateLastChid() {
+ const items = this.$children;
+ items.forEach((child, index) => child.setData({ isLastChild: index === items.length - 1 }));
+ },
+ };
+ }
+};
+CellGroup = __decorate([
+ wxComponent()
+], CellGroup);
+export default CellGroup;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.json b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.json
new file mode 100644
index 0000000..79f2730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared"
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.wxml b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.wxml
new file mode 100644
index 0000000..404f3f3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.wxml
@@ -0,0 +1,9 @@
+
+
+ {{ title }}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.wxss b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.wxss
new file mode 100644
index 0000000..2076b12
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.wxss
@@ -0,0 +1,71 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-cell-group {
+ position: relative;
+}
+.t-cell-group__title {
+ font-family: PingFangSC-Regular;
+ font-size: var(--td-cell-group-title-font-size, 28rpx);
+ color: var(--td-cell-group-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ text-align: left;
+ line-height: var(--td-cell-group-title-line-height, 90rpx);
+ background-color: var(--td-cell-group-title-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ padding-left: var(--td-cell-group-title-padding-left, 32rpx);
+}
+.t-cell-group--bordered::before {
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ top: 0;
+ border-top: 1px solid var(--td-cell-group-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+ transform-origin: 0 0;
+ transform-origin: top;
+ z-index: 1;
+}
+.t-cell-group--bordered::after {
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ border-bottom: 1px solid var(--td-cell-group-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+ transform-origin: bottom;
+ z-index: 1;
+}
+.t-cell-group--card {
+ margin: 0 32rpx;
+ border-radius: var(--td-radius-large, 18rpx);
+ overflow: hidden;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/props.d.ts b/miniprogram_npm/tdesign-miniprogram/cell-group/props.d.ts
new file mode 100644
index 0000000..4c4a9d0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCellGroupProps } from './type';
+declare const props: TdCellGroupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/props.js b/miniprogram_npm/tdesign-miniprogram/cell-group/props.js
new file mode 100644
index 0000000..5d4873c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/props.js
@@ -0,0 +1,15 @@
+const props = {
+ bordered: {
+ type: Boolean,
+ value: false,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ title: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/type.d.ts b/miniprogram_npm/tdesign-miniprogram/cell-group/type.d.ts
new file mode 100644
index 0000000..f7aedeb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/type.d.ts
@@ -0,0 +1,14 @@
+export interface TdCellGroupProps {
+ bordered?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'card';
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell-group/type.js b/miniprogram_npm/tdesign-miniprogram/cell-group/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell-group/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md
new file mode 100644
index 0000000..b905035
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md
@@ -0,0 +1,100 @@
+:: BASE_DOC ::
+
+## API
+
+### Cell 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
+align | String | middle | options: top/middle/bottom | N
+arrow | Boolean / Object | false | \- | N
+bordered | Boolean | true | \- | N
+description | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+hover | Boolean | - | \- | N
+image | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+jump-type | String | navigateTo | options: switchTab/reLaunch/redirectTo/navigateTo | N
+left-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+note | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+required | Boolean | false | \- | N
+right-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+url | String | - | \- | N
+
+### Cell Events
+
+name | params | description
+-- | -- | --
+click | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+
+### Cell External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-center | \-
+t-class-description | \-
+t-class-hover | \-
+t-class-image | \-
+t-class-left | \-
+t-class-left-icon | \-
+t-class-note | \-
+t-class-right | \-
+t-class-right-icon | \-
+t-class-title | \-
+
+
+### CellGroup 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
+bordered | Boolean | false | \- | N
+theme | String | default | options: default/card | N
+title | String | - | \- | N
+
+### CellGroup External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-title | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-cell-group-border-color | @component-stroke | -
+--td-cell-group-title-bg-color | @bg-color-secondarycontainer | -
+--td-cell-group-title-color | @text-color-placeholder | -
+--td-cell-group-title-font-size | 28rpx | -
+--td-cell-group-title-line-height | 90rpx | -
+--td-cell-group-title-padding-left | 32rpx | -
+--td-cell-bg-color | @bg-color-container | -
+--td-cell-border-color | @component-stroke | -
+--td-cell-border-left-space | @cell-horizontal-padding | -
+--td-cell-border-right-space | 0 | -
+--td-cell-border-width | 1px | -
+--td-cell-description-color | @text-color-secondary | -
+--td-cell-description-font-size | @font-size-base | -
+--td-cell-description-line-height | 44rpx | -
+--td-cell-height | auto | -
+--td-cell-horizontal-padding | 32rpx | -
+--td-cell-hover-color | @bg-color-secondarycontainer | -
+--td-cell-image-height | 96rpx | -
+--td-cell-image-width | 96rpx | -
+--td-cell-left-icon-color | @brand-color | -
+--td-cell-left-icon-font-size | 48rpx | -
+--td-cell-line-height | 48rpx | -
+--td-cell-note-color | @text-color-placeholder | -
+--td-cell-note-font-size | @font-size-m | -
+--td-cell-required-color | @error-color | -
+--td-cell-required-font-size | @font-size-m | -
+--td-cell-right-icon-color | @text-color-placeholder | -
+--td-cell-right-icon-font-size | 48rpx | -
+--td-cell-title-color | @text-color-primary | -
+--td-cell-title-font-size | @font-size-m | -
+--td-cell-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/README.md b/miniprogram_npm/tdesign-miniprogram/cell/README.md
new file mode 100644
index 0000000..6e50a23
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/README.md
@@ -0,0 +1,145 @@
+---
+title: Cell 单元格
+description: 用于各个类别行的信息展示。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-cell": "tdesign-miniprogram/cell/cell",
+ "t-cell-group": "tdesign-miniprogram/cell-group/cell-group"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 类型
+
+单行单元格
+
+
+
+{{ base }}
+
+多行单元格
+
+
+
+{{ multiple }}
+
+### 样式
+
+卡片单元格
+
+{{ theme }}
+
+## API
+
+### Cell Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+align | String | middle | 右侧内容的对齐方式,默认居中对齐。可选项:top/middle/bottom | N
+arrow | Boolean / Object | false | 是否显示右侧箭头 | N
+bordered | Boolean | true | 是否显示下边框 | N
+description | String / Slot | - | 下方内容描述。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+hover | Boolean | - | 是否开启点击反馈 | N
+image | String / Slot | - | 主图。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+jump-type | String | navigateTo | 链接跳转类型。可选项:switchTab/reLaunch/redirectTo/navigateTo | N
+left-icon | String / Object / Slot | - | 左侧图标,出现在单元格标题的左侧。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+note | String / Slot | - | 和标题同行的说明文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+required | Boolean | false | 是否显示表单必填星号 | N
+right-icon | String / Object / Slot | - | 最右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+title | String / Slot | - | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+url | String | - | 点击后跳转链接地址。如果值为空,则表示不需要跳转 | N
+
+### Cell Events
+
+名称 | 参数 | 描述
+-- | -- | --
+click | - | 右侧内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+
+### Cell External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-center | 中间(`title`, `description`)内容样式类
+t-class-description | 下方描述内容样式类
+t-class-hover | 悬停样式类
+t-class-image | 图片样式类
+t-class-left | 左侧内容样式类
+t-class-left-icon | 左侧图标样式类
+t-class-note | 右侧说明文字样式类
+t-class-right | 右侧内容样式类
+t-class-right-icon | 右侧图标样式类
+t-class-title | 标题样式类
+
+
+### CellGroup Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+bordered | Boolean | false | 是否显示组边框 | N
+theme | String | default | 单元格组风格。可选项:default/card | N
+title | String | - | 单元格组标题 | N
+
+### CellGroup External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-title | 标题样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-cell-group-border-color | @component-stroke | -
+--td-cell-group-title-bg-color | @bg-color-secondarycontainer | -
+--td-cell-group-title-color | @text-color-placeholder | -
+--td-cell-group-title-font-size | 28rpx | -
+--td-cell-group-title-line-height | 90rpx | -
+--td-cell-group-title-padding-left | 32rpx | -
+--td-cell-bg-color | @bg-color-container | -
+--td-cell-border-color | @component-stroke | -
+--td-cell-border-left-space | @cell-horizontal-padding | -
+--td-cell-border-right-space | 0 | -
+--td-cell-border-width | 1px | -
+--td-cell-description-color | @text-color-secondary | -
+--td-cell-description-font-size | @font-size-base | -
+--td-cell-description-line-height | 44rpx | -
+--td-cell-height | auto | -
+--td-cell-horizontal-padding | 32rpx | -
+--td-cell-hover-color | @bg-color-secondarycontainer | -
+--td-cell-image-height | 96rpx | -
+--td-cell-image-width | 96rpx | -
+--td-cell-left-icon-color | @brand-color | -
+--td-cell-left-icon-font-size | 48rpx | -
+--td-cell-line-height | 48rpx | -
+--td-cell-note-color | @text-color-placeholder | -
+--td-cell-note-font-size | @font-size-m | -
+--td-cell-required-color | @error-color | -
+--td-cell-required-font-size | @font-size-m | -
+--td-cell-right-icon-color | @text-color-placeholder | -
+--td-cell-right-icon-font-size | 48rpx | -
+--td-cell-title-color | @text-color-primary | -
+--td-cell-title-font-size | @font-size-m | -
+--td-cell-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts b/miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts
new file mode 100644
index 0000000..d6a8910
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts
@@ -0,0 +1,22 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Cell extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdCellProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ isLastChild: boolean;
+ };
+ observers: {
+ leftIcon(v: any): void;
+ rightIcon(v: any): void;
+ arrow(v: any): void;
+ };
+ setIcon(name: any, value: any, defaultValue: any): void;
+ onClick(e: any): void;
+ jumpLink(urlKey?: string, link?: string): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.js b/miniprogram_npm/tdesign-miniprogram/cell/cell.js
new file mode 100644
index 0000000..c7c5ec5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.js
@@ -0,0 +1,75 @@
+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 { calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-cell`;
+let Cell = class Cell extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-title`,
+ `${prefix}-class-description`,
+ `${prefix}-class-note`,
+ `${prefix}-class-hover`,
+ `${prefix}-class-image`,
+ `${prefix}-class-left`,
+ `${prefix}-class-left-icon`,
+ `${prefix}-class-center`,
+ `${prefix}-class-right`,
+ `${prefix}-class-right-icon`,
+ ];
+ this.relations = {
+ '../cell-group/cell-group': {
+ type: 'parent',
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ isLastChild: false,
+ };
+ this.observers = {
+ leftIcon(v) {
+ this.setIcon('_leftIcon', v, '');
+ },
+ rightIcon(v) {
+ this.setIcon('_rightIcon', v, '');
+ },
+ arrow(v) {
+ this.setIcon('_arrow', v, 'chevron-right');
+ },
+ };
+ }
+ setIcon(name, value, defaultValue) {
+ this.setData({
+ [name]: calcIcon(value, defaultValue),
+ });
+ }
+ onClick(e) {
+ this.triggerEvent('click', e.detail);
+ this.jumpLink();
+ }
+ jumpLink(urlKey = 'url', link = 'jumpType') {
+ const url = this.data[urlKey];
+ const jumpType = this.data[link];
+ if (url) {
+ wx[jumpType]({ url });
+ }
+ }
+};
+Cell = __decorate([
+ wxComponent()
+], Cell);
+export default Cell;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.json b/miniprogram_npm/tdesign-miniprogram/cell/cell.json
new file mode 100644
index 0000000..b7d275d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.wxml b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxml
new file mode 100644
index 0000000..5e04b22
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ title}}
+
+
+ *
+
+
+
+
+ {{description}}
+
+
+
+
+
+ {{note}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
new file mode 100644
index 0000000..d46b310
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
@@ -0,0 +1,127 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-cell {
+ position: relative;
+ display: flex;
+ box-sizing: border-box;
+ width: 100%;
+ padding: var(--td-cell-vertical-padding, 32rpx) var(--td-cell-horizontal-padding, 32rpx);
+ line-height: var(--td-cell-line-height, 48rpx);
+ height: var(--td-cell-height, auto);
+ background-color: var(--td-cell-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-cell::after {
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ border-bottom: var(--td-cell-border-width, 1px) solid var(--td-cell-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+ transform-origin: bottom;
+ left: var(--td-cell-border-left-space, var(--td-cell-horizontal-padding, 32rpx));
+ right: var(--td-cell-border-right-space, 0);
+}
+.t-cell--borderless::after {
+ display: none;
+}
+.t-cell__description {
+ font-size: var(--td-cell-description-font-size, var(--td-font-size-base, 28rpx));
+ line-height: var(--td-cell-description-line-height, 44rpx);
+ color: var(--td-cell-description-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+}
+.t-cell__description-text {
+ margin-top: calc(var(--td-spacer, 16rpx) / 2);
+}
+.t-cell__note {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ color: var(--td-cell-note-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-cell-note-font-size, var(--td-font-size-m, 32rpx));
+}
+.t-cell__title {
+ margin-right: var(--td-spacer-2, 32rpx);
+}
+.t-cell__title,
+.t-cell__note {
+ flex: 1 1 auto;
+}
+.t-cell__title:empty,
+.t-cell__note:empty {
+ display: none;
+}
+.t-cell__title-text {
+ display: flex;
+ font-size: var(--td-cell-title-font-size, var(--td-font-size-m, 32rpx));
+ color: var(--td-cell-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-weight: 400;
+}
+.t-cell__left,
+.t-cell__right {
+ align-self: stretch;
+}
+.t-cell__left:not(:empty) {
+ margin-right: var(--td-spacer-1, 24rpx);
+}
+.t-cell__left-icon {
+ color: var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-size: var(--td-cell-left-icon-font-size, 48rpx);
+}
+.t-cell__left-image {
+ height: var(--td-cell-image-height, 96rpx);
+ width: var(--td-cell-image-width, 96rpx);
+}
+.t-cell__note:not(:empty) + .t-cell__right {
+ margin-left: calc(var(--td-spacer, 16rpx) / 2);
+}
+.t-cell__right {
+ display: flex;
+}
+.t-cell__right-icon {
+ color: var(--td-cell-right-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-cell-right-icon-font-size, 48rpx);
+}
+.t-cell__right--middle {
+ align-items: center;
+}
+.t-cell__right--top {
+ align-items: flex-start;
+}
+.t-cell__right--bottom {
+ align-items: flex-end;
+}
+.t-cell--hover {
+ background-color: var(--td-cell-hover-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-cell--required {
+ font-size: var(--td-cell-required-font-size, var(--td-font-size-m, 32rpx));
+ color: var(--td-cell-required-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/props.d.ts b/miniprogram_npm/tdesign-miniprogram/cell/props.d.ts
new file mode 100644
index 0000000..ad657e5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCellProps } from './type';
+declare const props: TdCellProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/props.js b/miniprogram_npm/tdesign-miniprogram/cell/props.js
new file mode 100644
index 0000000..c538253
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/props.js
@@ -0,0 +1,48 @@
+const props = {
+ align: {
+ type: String,
+ value: 'middle',
+ },
+ arrow: {
+ type: null,
+ value: false,
+ },
+ bordered: {
+ type: Boolean,
+ value: true,
+ },
+ description: {
+ type: String,
+ },
+ hover: {
+ type: Boolean,
+ },
+ image: {
+ type: String,
+ },
+ jumpType: {
+ type: String,
+ value: 'navigateTo',
+ },
+ leftIcon: {
+ type: null,
+ },
+ note: {
+ type: String,
+ },
+ required: {
+ type: Boolean,
+ value: false,
+ },
+ rightIcon: {
+ type: null,
+ },
+ title: {
+ type: String,
+ },
+ url: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/type.d.ts b/miniprogram_npm/tdesign-miniprogram/cell/type.d.ts
new file mode 100644
index 0000000..7ba2258
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/type.d.ts
@@ -0,0 +1,54 @@
+export interface TdCellProps {
+ align?: {
+ type: StringConstructor;
+ value?: 'top' | 'middle' | 'bottom';
+ };
+ arrow?: {
+ type: null;
+ value?: boolean | object;
+ };
+ bordered?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ hover?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ jumpType?: {
+ type: StringConstructor;
+ value?: 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo';
+ };
+ leftIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ note?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ required?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ rightIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ url?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/type.js b/miniprogram_npm/tdesign-miniprogram/cell/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.d.ts b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.d.ts
new file mode 100644
index 0000000..cbea034
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.d.ts
@@ -0,0 +1,29 @@
+import { SuperComponent } from '../common/src/index';
+export default class CheckTag extends SuperComponent {
+ data: {
+ prefix: string;
+ classPrefix: string;
+ className: string;
+ };
+ properties: import("./type").TdCheckTagProps;
+ externalClasses: string[];
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ options: {
+ multipleSlots: boolean;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ observers: {
+ 'size, disabled, checked'(): void;
+ icon(v: any): void;
+ };
+ methods: {
+ setClass(): void;
+ onClick(): void;
+ onClose(e: WechatMiniprogram.BaseEvent): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.js b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.js
new file mode 100644
index 0000000..a6eef8c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.js
@@ -0,0 +1,84 @@
+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, calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-tag`;
+let CheckTag = class CheckTag extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.data = {
+ prefix,
+ classPrefix: name,
+ className: '',
+ };
+ this.properties = props;
+ this.externalClasses = [`${prefix}-class`];
+ this.controlledProps = [
+ {
+ key: 'checked',
+ event: 'change',
+ },
+ ];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.lifetimes = {
+ attached() {
+ this.setClass();
+ },
+ };
+ this.observers = {
+ 'size, disabled, checked'() {
+ this.setClass();
+ },
+ icon(v) {
+ this.setData({
+ _icon: calcIcon(v),
+ });
+ },
+ };
+ this.methods = {
+ setClass() {
+ const { classPrefix } = this.data;
+ const { size, variant, disabled, checked, shape } = this.properties;
+ const tagClass = [
+ classPrefix,
+ `${classPrefix}--checkable`,
+ disabled ? `${classPrefix}--disabled` : '',
+ checked ? `${classPrefix}--checked` : '',
+ `${classPrefix}--${checked ? 'primary' : 'default'}`,
+ `${classPrefix}--${size}`,
+ `${classPrefix}--${variant}`,
+ `${classPrefix}--${shape}`,
+ ];
+ const className = classNames(tagClass);
+ this.setData({
+ className,
+ });
+ },
+ onClick() {
+ if (this.data.disabled)
+ return;
+ const { checked } = this.data;
+ this._trigger('click');
+ this._trigger('change', { checked: !checked });
+ },
+ onClose(e) {
+ if (this.data.disabled)
+ return;
+ this._trigger('close', e);
+ },
+ };
+ }
+};
+CheckTag = __decorate([
+ wxComponent()
+], CheckTag);
+export default CheckTag;
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.json b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxml b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxml
new file mode 100644
index 0000000..7dbdb9a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{checked ? content[0] : content[1]}}
+ {{content}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxss b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxss
new file mode 100644
index 0000000..548240b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxss
@@ -0,0 +1,233 @@
+.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-tag {
+ display: inline-flex;
+ align-items: center;
+ border: 2rpx solid transparent;
+ box-sizing: border-box;
+ border-radius: var(--td-tag-square-border-radius, 8rpx);
+ font-size: var(--td-tag-medium-font-size, var(--td-font-size-s, 24rpx));
+ user-select: none;
+ vertical-align: middle;
+}
+.t-tag__text {
+ word-wrap: normal;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.t-tag__icon {
+ display: flex;
+ align-items: center;
+}
+.t-tag__icon:not(:empty) + .t-tag__text:not(:empty) {
+ margin-left: 8rpx;
+}
+.t-tag--small {
+ height: var(--td-tag-small-height, 40rpx);
+ line-height: var(--td-tag-small-height, 40rpx);
+ padding: 0 var(--td-tag-small-padding, 11rpx);
+ font-size: var(--td-tag-small-font-size, var(--td-font-size, 20rpx));
+}
+.t-tag--small .t-icon,
+.t-tag--small .t-icon-close {
+ font-size: var(--td-tag-small-icon-size, 24rpx);
+}
+.t-tag--medium {
+ height: var(--td-tag-medium-height, 48rpx);
+ line-height: var(--td-tag-medium-height, 48rpx);
+ padding: 0 var(--td-tag-medium-padding, 15rpx);
+ font-size: var(--td-tag-medium-font-size, var(--td-font-size-s, 24rpx));
+}
+.t-tag--medium .t-icon,
+.t-tag--medium .t-icon-close {
+ font-size: var(--td-tag-medium-icon-size, 28rpx);
+}
+.t-tag--large {
+ height: var(--td-tag-large-height, 56rpx);
+ line-height: var(--td-tag-large-height, 56rpx);
+ padding: 0 var(--td-tag-large-padding, 15rpx);
+ font-size: var(--td-tag-large-font-size, var(--td-font-size-base, 28rpx));
+}
+.t-tag--large .t-icon,
+.t-tag--large .t-icon-close {
+ font-size: var(--td-tag-large-icon-size, 32rpx);
+}
+.t-tag--extra-large {
+ height: var(--td-tag-extra-large-height, 80rpx);
+ line-height: var(--td-tag-extra-large-height, 80rpx);
+ padding: 0 var(--td-tag-extra-large-padding, 31rpx);
+ font-size: var(--td-tag-extra-large-font-size, var(--td-font-size-base, 28rpx));
+}
+.t-tag--extra-large .t-icon,
+.t-tag--extra-large .t-icon-close {
+ font-size: var(--td-tag-extra-large-icon-size, 32rpx);
+}
+.t-tag.t-tag--square {
+ border-radius: var(--td-tag-square-border-radius, 8rpx);
+}
+.t-tag.t-tag--round {
+ border-radius: var(--td-tag-round-border-radius, 999px);
+}
+.t-tag.t-tag--mark {
+ border-radius: 0 var(--td-tag-mark-border-radius, var(--td-tag-round-border-radius, 999px)) var(--td-tag-mark-border-radius, var(--td-tag-round-border-radius, 999px)) 0;
+}
+.t-tag--dark.t-tag--default {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ background-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-tag--dark.t-tag--primary {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tag--dark.t-tag--success {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-tag--dark.t-tag--warning {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-tag--dark.t-tag--danger {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-tag--dark.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tag--outline.t-tag--default {
+ color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tag--outline.t-tag--primary {
+ color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tag--outline.t-tag--success {
+ color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-tag--outline.t-tag--warning {
+ color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-tag--outline.t-tag--danger {
+ color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+}
+.t-tag--outline.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tag--outline.t-tag--default {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--primary {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--success {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--warning {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--danger {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--light.t-tag--default {
+ color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tag--light.t-tag--primary {
+ color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+ background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tag--light.t-tag--success {
+ color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ border-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+ background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-tag--light.t-tag--warning {
+ color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ border-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+ background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-tag--light.t-tag--danger {
+ color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+ background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+}
+.t-tag--light.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tag--light-outline.t-tag--default {
+ color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tag--light-outline.t-tag--primary {
+ color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tag--light-outline.t-tag--success {
+ color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-tag--light-outline.t-tag--warning {
+ color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-tag--light-outline.t-tag--danger {
+ color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+}
+.t-tag--light-outline.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ border-color: var(--td-component-border, var(--td-gray-color-4, #dcdcdc));
+}
+.t-tag.t-tag--closable.t-tag--disabled {
+ cursor: not-allowed;
+ color: var(--td-tag-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ background-color: var(--td-tag-disabled-background-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+ border-color: var(--td-tag-disabled-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/props.d.ts b/miniprogram_npm/tdesign-miniprogram/check-tag/props.d.ts
new file mode 100644
index 0000000..57c816f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCheckTagProps } from './type';
+declare const props: TdCheckTagProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/props.js b/miniprogram_npm/tdesign-miniprogram/check-tag/props.js
new file mode 100644
index 0000000..cd3a325
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/props.js
@@ -0,0 +1,37 @@
+const props = {
+ checked: {
+ type: null,
+ value: undefined,
+ },
+ defaultChecked: {
+ type: null,
+ value: undefined,
+ },
+ closable: {
+ type: Boolean,
+ value: false,
+ },
+ content: {
+ type: null,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ shape: {
+ type: String,
+ value: 'square',
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ variant: {
+ type: String,
+ value: 'dark',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/type.d.ts b/miniprogram_npm/tdesign-miniprogram/check-tag/type.d.ts
new file mode 100644
index 0000000..c047f1b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/type.d.ts
@@ -0,0 +1,39 @@
+import { SizeEnum } from '../common/common';
+export interface TdCheckTagProps {
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ closable?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: null;
+ value?: string | number | string[];
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'square' | 'round' | 'mark';
+ };
+ size?: {
+ type: StringConstructor;
+ value?: SizeEnum;
+ };
+ variant?: {
+ type: StringConstructor;
+ value?: 'dark' | 'light' | 'outline' | 'light-outline';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/type.js b/miniprogram_npm/tdesign-miniprogram/check-tag/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/check-tag/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts
new file mode 100644
index 0000000..fe1681b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts
@@ -0,0 +1,38 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class CheckBoxGroup extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ checkboxOptions: any[];
+ };
+ properties: import("./type").TdCheckboxGroupProps;
+ observers: {
+ value(): void;
+ options(): void;
+ disabled(v: any): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ $checkAll: any;
+ methods: {
+ getChildren(): any;
+ updateChildren(): void;
+ updateValue({ value, checked, checkAll, item, indeterminate }: {
+ value: any;
+ checked: any;
+ checkAll: any;
+ item: any;
+ indeterminate: any;
+ }): void;
+ initWithOptions(): void;
+ handleInnerChildChange(e: any): void;
+ setCheckall(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js
new file mode 100644
index 0000000..6d57e56
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js
@@ -0,0 +1,162 @@
+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}-checkbox-group`;
+let CheckBoxGroup = class CheckBoxGroup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.relations = {
+ '../checkbox/checkbox': {
+ type: 'descendant',
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ checkboxOptions: [],
+ };
+ this.properties = props;
+ this.observers = {
+ value() {
+ this.updateChildren();
+ },
+ options() {
+ this.initWithOptions();
+ },
+ disabled(v) {
+ var _a;
+ if ((_a = this.data.options) === null || _a === void 0 ? void 0 : _a.length) {
+ this.initWithOptions();
+ return;
+ }
+ this.getChildren().forEach((item) => {
+ item.setDisabled(v);
+ });
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.setCheckall();
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.$checkAll = null;
+ this.methods = {
+ getChildren() {
+ let items = this.$children;
+ if (!items.length) {
+ items = this.selectAllComponents(`.${prefix}-checkbox-option`);
+ }
+ return items || [];
+ },
+ updateChildren() {
+ const items = this.getChildren();
+ const { value } = this.data;
+ if (items.length > 0) {
+ items.forEach((item) => {
+ !item.data.checkAll &&
+ item.setData({
+ checked: value === null || value === void 0 ? void 0 : value.includes(item.data.value),
+ });
+ });
+ if (items.some((item) => item.data.checkAll)) {
+ this.setCheckall();
+ }
+ }
+ },
+ updateValue({ value, checked, checkAll, item, indeterminate }) {
+ let { value: newValue } = this.data;
+ const { max } = this.data;
+ const keySet = new Set(this.getChildren().map((item) => item.data.value));
+ newValue = newValue.filter((value) => keySet.has(value));
+ if (max && checked && newValue.length === max)
+ return;
+ if (checkAll) {
+ const items = this.getChildren();
+ newValue =
+ !checked && indeterminate
+ ? items
+ .filter(({ data }) => !(data.disabled && !newValue.includes(data.value)))
+ .map((item) => item.data.value)
+ : items
+ .filter(({ data }) => {
+ if (data.disabled) {
+ return newValue.includes(data.value);
+ }
+ return checked && !data.checkAll;
+ })
+ .map(({ data }) => data.value);
+ }
+ else if (checked) {
+ newValue = newValue.concat(value);
+ }
+ else {
+ const index = newValue.findIndex((v) => v === value);
+ newValue.splice(index, 1);
+ }
+ this._trigger('change', { value: newValue, context: item });
+ },
+ initWithOptions() {
+ const { options, value, keys } = this.data;
+ if (!(options === null || options === void 0 ? void 0 : options.length) || !Array.isArray(options))
+ return;
+ const checkboxOptions = options.map((item) => {
+ var _a, _b, _c;
+ const isLabel = ['number', 'string'].includes(typeof item);
+ return isLabel
+ ? {
+ label: `${item}`,
+ value: item,
+ checked: value === null || value === void 0 ? void 0 : value.includes(item),
+ }
+ : Object.assign(Object.assign({}, item), { label: item[(_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label'], value: item[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'], checked: value === null || value === void 0 ? void 0 : value.includes(item[(_c = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _c !== void 0 ? _c : 'value']) });
+ });
+ this.setData({
+ checkboxOptions,
+ });
+ },
+ handleInnerChildChange(e) {
+ var _a;
+ const { item } = e.target.dataset;
+ const { checked } = e.detail;
+ const rect = {};
+ if (item.checkAll) {
+ rect.indeterminate = (_a = this.$checkAll) === null || _a === void 0 ? void 0 : _a.data.indeterminate;
+ }
+ this.updateValue(Object.assign(Object.assign(Object.assign({}, item), { checked, item }), rect));
+ },
+ setCheckall() {
+ const items = this.getChildren();
+ if (!this.$checkAll) {
+ this.$checkAll = items.find((item) => item.data.checkAll);
+ }
+ if (!this.$checkAll)
+ return;
+ const { value } = this.data;
+ const valueSet = new Set(value === null || value === void 0 ? void 0 : value.filter((val) => val !== this.$checkAll.data.value));
+ const isCheckall = items.every((item) => (item.data.checkAll ? true : valueSet.has(item.data.value)));
+ this.$checkAll.setData({
+ checked: valueSet.size > 0,
+ indeterminate: !isCheckall,
+ });
+ },
+ };
+ }
+};
+CheckBoxGroup = __decorate([
+ wxComponent()
+], CheckBoxGroup);
+export default CheckBoxGroup;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json
new file mode 100644
index 0000000..9d5b437
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-checkbox": "../checkbox/checkbox"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml
new file mode 100644
index 0000000..7ad58da
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxss b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts
new file mode 100644
index 0000000..f6e5bf5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCheckboxGroupProps } from './type';
+declare const props: TdCheckboxGroupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js
new file mode 100644
index 0000000..008d05e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js
@@ -0,0 +1,34 @@
+const props = {
+ borderless: {
+ type: Boolean,
+ value: false,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ keys: {
+ type: Object,
+ },
+ max: {
+ type: Number,
+ value: undefined,
+ },
+ name: {
+ type: String,
+ value: '',
+ },
+ options: {
+ type: Array,
+ value: [],
+ },
+ value: {
+ type: Array,
+ value: null,
+ },
+ defaultValue: {
+ type: Array,
+ value: [],
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts
new file mode 100644
index 0000000..568a469
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts
@@ -0,0 +1,43 @@
+import { KeysType } from '../common/common';
+export interface TdCheckboxGroupProps {
+ borderless?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: KeysType;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ value?: {
+ type: ArrayConstructor;
+ value?: T;
+ };
+ defaultValue?: {
+ type: ArrayConstructor;
+ value?: T;
+ };
+}
+export declare type CheckboxOption = string | number | CheckboxOptionObj;
+export interface CheckboxOptionObj {
+ label?: string;
+ value?: string | number;
+ disabled?: boolean;
+ checkAll?: true;
+}
+export declare type CheckboxGroupValue = Array;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md
new file mode 100644
index 0000000..33355f7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md
@@ -0,0 +1,88 @@
+:: BASE_DOC ::
+
+## API
+
+### Checkbox 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
+block | Boolean | true | \- | N
+borderless | Boolean | false | \- | N
+check-all | Boolean | false | \- | N
+checked | Boolean | false | \- | N
+default-checked | Boolean | undefined | uncontrolled property | N
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content-disabled | Boolean | - | \- | N
+disabled | Boolean | undefined | \- | N
+icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'rectangle' \| string[]` | N
+indeterminate | Boolean | false | \- | N
+label | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max-content-row | Number | 5 | \- | N
+max-label-row | Number | 3 | \- | N
+name | String | - | \- | N
+placement | String | left | options: left/right | N
+readonly | Boolean | false | \- | N
+value | String / Number / Boolean | - | value of checkbox。Typescript:`string \| number \| boolean` | N
+
+### Checkbox Events
+
+name | params | description
+-- | -- | --
+change | `(checked: boolean, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | \-
+
+### Checkbox External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-border | \-
+t-class-content | \-
+t-class-icon | \-
+t-class-label | \-
+
+
+### CheckboxGroup 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
+borderless | Boolean | false | \- | N
+disabled | Boolean | undefined | \- | N
+keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max | Number | undefined | \- | N
+name | String | - | \- | N
+options | Array | [] | Typescript:`Array` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+value | Array | [] | Typescript:`T` `type CheckboxGroupValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+default-value | Array | undefined | uncontrolled property。Typescript:`T` `type CheckboxGroupValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+
+### CheckboxGroup Events
+
+name | params | description
+-- | -- | --
+change | `(value: CheckboxGroupValue, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-checkbox-bg-color | @bg-color-container | -
+--td-checkbox-border-color | @component-stroke | -
+--td-checkbox-description-color | @text-color-secondary | -
+--td-checkbox-description-disabled-color | @text-color-disabled | -
+--td-checkbox-description-line-height | 44rpx | -
+--td-checkbox-font-size | 32rpx | -
+--td-checkbox-icon-checked-color | @brand-color | -
+--td-checkbox-icon-color | @component-border | -
+--td-checkbox-icon-disabled-bg-color | @bg-color-component-disabled | -
+--td-checkbox-icon-disabled-color | @brand-color-disabled | -
+--td-checkbox-icon-size | 48rpx | -
+--td-checkbox-tag-active-bg-color | @brand-color-light | -
+--td-checkbox-tag-active-color | @brand-color | -
+--td-checkbox-title-color | @text-color-primary | -
+--td-checkbox-title-disabled-color | @text-color-disabled | -
+--td-checkbox-title-line-height | 48rpx | -
+--td-checkbox-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/README.md b/miniprogram_npm/tdesign-miniprogram/checkbox/README.md
new file mode 100644
index 0000000..f6030c1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/README.md
@@ -0,0 +1,152 @@
+---
+title: Checkbox 多选框
+description: 用于预设的一组选项中执行多项选择,并呈现选择结果。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
+ "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+纵向多选框
+
+{{ base }}
+
+横向多选框
+
+{{ horizontal }}
+
+带全选多选框
+
+{{ all }}
+
+### 组件状态
+
+多选框状态
+
+{{ status }}
+
+### 组件样式
+
+勾选样式
+
+{{ type }}
+
+勾选显示位置
+
+{{ right }}
+
+非通栏多选样式
+
+{{ card }}
+
+### 组件规格
+
+多选框尺寸规格
+
+{{ special }}
+
+## API
+
+### Checkbox Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+block | Boolean | true | 是否为块级元素 | N
+borderless | Boolean | false | 是否开启无边框模式 | N
+check-all | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
+checked | Boolean | false | 是否选中 | N
+default-checked | Boolean | undefined | 是否选中。非受控属性 | N
+content | String / Slot | - | 多选框内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content-disabled | Boolean | - | 是否禁用组件内容(content)触发选中 | N
+disabled | Boolean | undefined | 是否禁用组件。如果父组件存在 CheckboxGroup,默认值由 CheckboxGroup.disabled 控制。优先级:Checkbox.disabled > CheckboxGroup.disabled > Form.disabled | N
+icon | String / Array | 'circle' | 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标,半选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标。TS 类型:`'circle' \| 'line' \| 'rectangle' \| string[]` | N
+indeterminate | Boolean | false | 是否为半选 | N
+label | String / Slot | - | 主文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max-content-row | Number | 5 | 内容最大行数限制 | N
+max-label-row | Number | 3 | 主文案最大行数限制 | N
+name | String | - | HTML 元素原生属性 | N
+placement | String | left | 多选框和内容相对位置。可选项:left/right | N
+readonly | Boolean | false | 只读状态 | N
+value | String / Number / Boolean | - | 多选框的值。TS 类型:`string \| number \| boolean` | N
+
+### Checkbox Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(checked: boolean, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | 值变化时触发。`context` 表示当前点击项内容。
+
+### Checkbox External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-border | 边框样式类
+t-class-content | 内容样式类
+t-class-icon | 图标样式类
+t-class-label | 标签样式类
+
+
+### CheckboxGroup Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+borderless | Boolean | false | 是否开启无边框模式 | N
+disabled | Boolean | undefined | 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled | N
+keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max | Number | undefined | 支持最多选中的数量 | N
+name | String | - | 统一设置内部复选框 HTML 属性 | N
+options | Array | [] | 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」。TS 类型:`Array` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+value | Array | [] | 选中值。TS 类型:`T` `type CheckboxGroupValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+default-value | Array | undefined | 选中值。非受控属性。TS 类型:`T` `type CheckboxGroupValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+
+### CheckboxGroup Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: CheckboxGroupValue, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | 值变化时触发。`context` 表示当前点击项内容。
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-checkbox-bg-color | @bg-color-container | -
+--td-checkbox-border-color | @component-stroke | -
+--td-checkbox-description-color | @text-color-secondary | -
+--td-checkbox-description-disabled-color | @text-color-disabled | -
+--td-checkbox-description-line-height | 44rpx | -
+--td-checkbox-font-size | 32rpx | -
+--td-checkbox-icon-checked-color | @brand-color | -
+--td-checkbox-icon-color | @component-border | -
+--td-checkbox-icon-disabled-bg-color | @bg-color-component-disabled | -
+--td-checkbox-icon-disabled-color | @brand-color-disabled | -
+--td-checkbox-icon-size | 48rpx | -
+--td-checkbox-tag-active-bg-color | @brand-color-light | -
+--td-checkbox-tag-active-color | @brand-color | -
+--td-checkbox-title-color | @text-color-primary | -
+--td-checkbox-title-disabled-color | @text-color-disabled | -
+--td-checkbox-title-line-height | 48rpx | -
+--td-checkbox-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts
new file mode 100644
index 0000000..3cfb0f9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts
@@ -0,0 +1,100 @@
+import { SuperComponent, ComponentsOptionsType, RelationsOptions } from '../common/src/index';
+export default class CheckBox extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ relations: RelationsOptions;
+ options: ComponentsOptionsType;
+ properties: {
+ theme: {
+ type: StringConstructor;
+ value: string;
+ };
+ tId: {
+ type: StringConstructor;
+ };
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ borderless?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checkAll?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ contentDisabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string[] | "rectangle" | "circle" | "line";
+ };
+ indeterminate?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ maxContentRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ maxLabelRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: "left" | "right";
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: string | number | boolean;
+ };
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ _disabled: boolean;
+ };
+ observers: {
+ disabled(v: any): void;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ methods: {
+ handleTap(e: WechatMiniprogram.TouchEvent): void;
+ setDisabled(disabled: Boolean): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js
new file mode 100644
index 0000000..b4e3025
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js
@@ -0,0 +1,99 @@
+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}-checkbox`;
+let CheckBox = class CheckBox extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-label`,
+ `${prefix}-class-icon`,
+ `${prefix}-class-content`,
+ `${prefix}-class-border`,
+ ];
+ this.behaviors = ['wx://form-field'];
+ this.relations = {
+ '../checkbox-group/checkbox-group': {
+ type: 'ancestor',
+ linked(parent) {
+ const { value, disabled, borderless } = parent.data;
+ const valueSet = new Set(value);
+ const checkedFromParent = valueSet.has(this.data.value);
+ const data = {
+ _disabled: this.data.disabled == null ? disabled : this.data.disabled,
+ };
+ if (borderless) {
+ data.borderless = true;
+ }
+ data.checked = this.data.checked || checkedFromParent;
+ if (this.data.checked) {
+ parent.updateValue(this.data);
+ }
+ if (this.data.checkAll) {
+ data.checked = valueSet.size > 0;
+ }
+ this.setData(data);
+ },
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = Object.assign(Object.assign({}, Props), { theme: {
+ type: String,
+ value: 'default',
+ }, tId: {
+ type: String,
+ } });
+ this.data = {
+ prefix,
+ classPrefix: name,
+ _disabled: false,
+ };
+ this.observers = {
+ disabled(v) {
+ this.setData({ _disabled: v });
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'checked',
+ event: 'change',
+ },
+ ];
+ this.methods = {
+ handleTap(e) {
+ const { _disabled, readonly, contentDisabled } = this.data;
+ const { target } = e.currentTarget.dataset;
+ if (_disabled || readonly || (target === 'text' && contentDisabled))
+ return;
+ const { value, label } = this.data;
+ const checked = !this.data.checked;
+ const parent = this.$parent;
+ if (parent) {
+ parent.updateValue(Object.assign(Object.assign({}, this.data), { checked, item: { label, value, checked } }));
+ }
+ else {
+ this._trigger('change', { context: { value, label }, checked });
+ }
+ },
+ setDisabled(disabled) {
+ this.setData({
+ _disabled: this.data.disabled || disabled,
+ });
+ },
+ };
+ }
+};
+CheckBox = __decorate([
+ wxComponent()
+], CheckBox);
+export default CheckBox;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml
new file mode 100644
index 0000000..26a15bd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{label}}
+
+
+
+
+ {{content}}
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss
new file mode 100644
index 0000000..6622ddb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss
@@ -0,0 +1,202 @@
+.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-checkbox {
+ display: inline-flex;
+ vertical-align: middle;
+ position: relative;
+ font-size: var(--td-checkbox-font-size, 32rpx);
+ background: var(--td-checkbox-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-checkbox:focus {
+ outline: 0;
+}
+.t-checkbox--block {
+ display: flex;
+ padding: var(--td-checkbox-vertical-padding, 32rpx);
+}
+.t-checkbox--right {
+ flex-direction: row-reverse;
+}
+.t-checkbox .limit-title-row {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.t-checkbox .image-center {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-checkbox__icon-left {
+ margin-right: 20rpx;
+ width: 40rpx;
+}
+.t-checkbox__icon-right {
+ right: 0px;
+ display: contents;
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-checkbox__icon-image {
+ width: var(--td-checkbox-icon-size, 48rpx);
+ height: var(--td-checkbox-icon-size, 48rpx);
+ vertical-align: top;
+}
+.t-checkbox__icon {
+ position: relative;
+ display: block;
+ width: var(--td-checkbox-icon-size, 48rpx);
+ height: var(--td-checkbox-icon-size, 48rpx);
+ color: var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ font-size: var(--td-checkbox-icon-size, 48rpx);
+ margin-top: calc((var(--td-checkbox-title-line-height, 48rpx) - var(--td-checkbox-icon-size, 48rpx)) / 2);
+}
+.t-checkbox__icon:empty {
+ display: none;
+}
+.t-checkbox__icon--checked {
+ color: var(--td-checkbox-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-checkbox__icon--disabled {
+ cursor: not-allowed;
+ color: var(--td-checkbox-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-checkbox__icon--left {
+ margin-right: 16rpx;
+}
+.t-checkbox__icon-circle {
+ width: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx) * 2);
+ height: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx) * 2);
+ border: calc(4rpx * 2) solid var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ box-sizing: border-box;
+}
+.t-checkbox__icon-circle--disabled {
+ background: var(--td-checkbox-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-checkbox__icon-rectangle {
+ width: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx * 2) * 2);
+ height: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx * 2) * 2);
+ border: calc(4rpx * 2) solid var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ box-sizing: border-box;
+}
+.t-checkbox__icon-rectangle--disabled {
+ background: var(--td-checkbox-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-checkbox__icon-line::before,
+.t-checkbox__icon-line::after {
+ content: '';
+ display: block;
+ position: absolute;
+ width: 5rpx;
+ border-radius: 2rpx;
+ background: var(--td-checkbox-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ transform-origin: top center;
+}
+.t-checkbox__icon-line::before {
+ height: 16rpx;
+ left: 8rpx;
+ top: 22rpx;
+ transform: rotate(-45deg);
+}
+.t-checkbox__icon-line::after {
+ height: 26rpx;
+ right: 8rpx;
+ top: 14rpx;
+ transform: rotate(45deg);
+}
+.t-checkbox__icon-line--disabled::before,
+.t-checkbox__icon-line--disabled::after {
+ background: var(--td-checkbox-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-checkbox__content {
+ flex: 1;
+}
+.t-checkbox__title {
+ color: var(--td-checkbox-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ line-height: var(--td-checkbox-title-line-height, 48rpx);
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.t-checkbox__title--disabled {
+ color: var(--td-checkbox-title-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-checkbox__description {
+ color: var(--td-checkbox-description-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ font-size: 28rpx;
+ line-height: var(--td-checkbox-description-line-height, 44rpx);
+}
+.t-checkbox__description--disabled {
+ color: var(--td-checkbox-description-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-checkbox__title + .t-checkbox__description:not(:empty) {
+ margin-top: 8rpx;
+}
+.t-checkbox__border {
+ position: absolute;
+ bottom: 0;
+ left: 96rpx;
+ right: 0;
+ height: 1px;
+ background: var(--td-checkbox-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+}
+.t-checkbox__border--right {
+ left: 32rpx;
+}
+.t-checkbox--tag {
+ font-size: 28rpx;
+ padding-top: 16rpx;
+ padding-bottom: 16rpx;
+ text-align: center;
+ background-color: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+ border-radius: 12rpx;
+}
+.t-checkbox--tag.t-checkbox--checked {
+ color: var(--td-checkbox-tag-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-checkbox-tag-active-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-checkbox--tag .t-checkbox__title--checked {
+ color: var(--td-checkbox-tag-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-checkbox--tag .t-checkbox__content {
+ margin-right: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts
new file mode 100644
index 0000000..81c619e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCheckboxProps } from './type';
+declare const props: TdCheckboxProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/props.js b/miniprogram_npm/tdesign-miniprogram/checkbox/props.js
new file mode 100644
index 0000000..b7192f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/props.js
@@ -0,0 +1,67 @@
+const props = {
+ block: {
+ type: Boolean,
+ value: true,
+ },
+ borderless: {
+ type: Boolean,
+ value: false,
+ },
+ checkAll: {
+ type: Boolean,
+ value: false,
+ },
+ checked: {
+ type: Boolean,
+ value: null,
+ },
+ defaultChecked: {
+ type: Boolean,
+ value: false,
+ },
+ content: {
+ type: String,
+ },
+ contentDisabled: {
+ type: Boolean,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ icon: {
+ type: null,
+ value: 'circle',
+ },
+ indeterminate: {
+ type: Boolean,
+ value: false,
+ },
+ label: {
+ type: String,
+ },
+ maxContentRow: {
+ type: Number,
+ value: 5,
+ },
+ maxLabelRow: {
+ type: Number,
+ value: 3,
+ },
+ name: {
+ type: String,
+ value: '',
+ },
+ placement: {
+ type: String,
+ value: 'left',
+ },
+ readonly: {
+ type: Boolean,
+ value: false,
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts
new file mode 100644
index 0000000..1250d5b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts
@@ -0,0 +1,70 @@
+export interface TdCheckboxProps {
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ borderless?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checkAll?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ contentDisabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: 'circle' | 'line' | 'rectangle' | string[];
+ };
+ indeterminate?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ maxContentRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ maxLabelRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'left' | 'right';
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: string | number | boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/type.js b/miniprogram_npm/tdesign-miniprogram/checkbox/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/col/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/col/README.en-US.md
new file mode 100644
index 0000000..7ad8352
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/README.en-US.md
@@ -0,0 +1,21 @@
+:: BASE_DOC ::
+
+## API
+
+### Col 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
+offset | String / Number | - | \- | N
+span | String / Number | - | \- | N
+
+
+### Row 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
+gutter | String / Number | - | \- | N
diff --git a/miniprogram_npm/tdesign-miniprogram/col/README.md b/miniprogram_npm/tdesign-miniprogram/col/README.md
new file mode 100644
index 0000000..3247301
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/README.md
@@ -0,0 +1,59 @@
+---
+title: Layout 布局
+description: 以规则的网格阵列来指导和规范页面中的版面布局以及信息分布,提高界面内布局的一致性,节约成本。
+spline: base
+isComponent: true
+---
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-row": "tdesign-miniprogram/row/row",
+ "t-col": "tdesign-miniprogram/col/col"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+### 组件类型
+
+基础
+
+{{ base }}
+
+
+增加间距
+
+{{ offset }}
+
+
+
+## API
+
+### Col Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+offset | String / Number | - | 列的偏移量(默认单位px) | N
+span | String / Number | - | 列的宽度(默认单位px) | N
+
+
+### Row Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+gutter | String / Number | - | 列之间的间距(默认单位px) | N
diff --git a/miniprogram_npm/tdesign-miniprogram/col/col.d.ts b/miniprogram_npm/tdesign-miniprogram/col/col.d.ts
new file mode 100644
index 0000000..ecebf64
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/col.d.ts
@@ -0,0 +1,10 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Col extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdColProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ relations: RelationsOptions;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/col/col.js b/miniprogram_npm/tdesign-miniprogram/col/col.js
new file mode 100644
index 0000000..cbaecdd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/col.js
@@ -0,0 +1,31 @@
+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}-col`;
+let Col = class Col extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.relations = {
+ '../row/row': {
+ type: 'parent',
+ },
+ };
+ }
+};
+Col = __decorate([
+ wxComponent()
+], Col);
+export default Col;
diff --git a/miniprogram_npm/tdesign-miniprogram/col/col.json b/miniprogram_npm/tdesign-miniprogram/col/col.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/col.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/col/col.wxml b/miniprogram_npm/tdesign-miniprogram/col/col.wxml
new file mode 100644
index 0000000..cd7f331
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/col.wxml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/col/col.wxs b/miniprogram_npm/tdesign-miniprogram/col/col.wxs
new file mode 100644
index 0000000..1822c0b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/col.wxs
@@ -0,0 +1,17 @@
+var utils = require('../common/utils.wxs');
+
+function getColStyles(gutter, style, customStyle) {
+ var _style = '';
+ if (gutter) {
+ _style = utils._style({
+ 'padding-right': utils.addUnit(gutter / 2),
+ 'padding-left': utils.addUnit(gutter / 2),
+ });
+ }
+
+ return utils._style([style, customStyle]) + _style;
+}
+
+module.exports = {
+ getColStyles: getColStyles,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/col/col.wxss b/miniprogram_npm/tdesign-miniprogram/col/col.wxss
new file mode 100644
index 0000000..8d6d0b9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/col.wxss
@@ -0,0 +1,176 @@
+.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-col {
+ display: block;
+ box-sizing: border-box;
+ min-height: 1px;
+}
+.t-col--1 {
+ width: 4.16666667%;
+}
+.t-col--offset-1 {
+ margin-left: 4.16666667%;
+}
+.t-col--2 {
+ width: 8.33333333%;
+}
+.t-col--offset-2 {
+ margin-left: 8.33333333%;
+}
+.t-col--3 {
+ width: 12.5%;
+}
+.t-col--offset-3 {
+ margin-left: 12.5%;
+}
+.t-col--4 {
+ width: 16.66666667%;
+}
+.t-col--offset-4 {
+ margin-left: 16.66666667%;
+}
+.t-col--5 {
+ width: 20.83333333%;
+}
+.t-col--offset-5 {
+ margin-left: 20.83333333%;
+}
+.t-col--6 {
+ width: 25%;
+}
+.t-col--offset-6 {
+ margin-left: 25%;
+}
+.t-col--7 {
+ width: 29.16666667%;
+}
+.t-col--offset-7 {
+ margin-left: 29.16666667%;
+}
+.t-col--8 {
+ width: 33.33333333%;
+}
+.t-col--offset-8 {
+ margin-left: 33.33333333%;
+}
+.t-col--9 {
+ width: 37.5%;
+}
+.t-col--offset-9 {
+ margin-left: 37.5%;
+}
+.t-col--10 {
+ width: 41.66666667%;
+}
+.t-col--offset-10 {
+ margin-left: 41.66666667%;
+}
+.t-col--11 {
+ width: 45.83333333%;
+}
+.t-col--offset-11 {
+ margin-left: 45.83333333%;
+}
+.t-col--12 {
+ width: 50%;
+}
+.t-col--offset-12 {
+ margin-left: 50%;
+}
+.t-col--13 {
+ width: 54.16666667%;
+}
+.t-col--offset-13 {
+ margin-left: 54.16666667%;
+}
+.t-col--14 {
+ width: 58.33333333%;
+}
+.t-col--offset-14 {
+ margin-left: 58.33333333%;
+}
+.t-col--15 {
+ width: 62.5%;
+}
+.t-col--offset-15 {
+ margin-left: 62.5%;
+}
+.t-col--16 {
+ width: 66.66666667%;
+}
+.t-col--offset-16 {
+ margin-left: 66.66666667%;
+}
+.t-col--17 {
+ width: 70.83333333%;
+}
+.t-col--offset-17 {
+ margin-left: 70.83333333%;
+}
+.t-col--18 {
+ width: 75%;
+}
+.t-col--offset-18 {
+ margin-left: 75%;
+}
+.t-col--19 {
+ width: 79.16666667%;
+}
+.t-col--offset-19 {
+ margin-left: 79.16666667%;
+}
+.t-col--20 {
+ width: 83.33333333%;
+}
+.t-col--offset-20 {
+ margin-left: 83.33333333%;
+}
+.t-col--21 {
+ width: 87.5%;
+}
+.t-col--offset-21 {
+ margin-left: 87.5%;
+}
+.t-col--22 {
+ width: 91.66666667%;
+}
+.t-col--offset-22 {
+ margin-left: 91.66666667%;
+}
+.t-col--23 {
+ width: 95.83333333%;
+}
+.t-col--offset-23 {
+ margin-left: 95.83333333%;
+}
+.t-col--24 {
+ width: 100%;
+}
+.t-col--offset-24 {
+ margin-left: 100%;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/col/props.d.ts b/miniprogram_npm/tdesign-miniprogram/col/props.d.ts
new file mode 100644
index 0000000..15de965
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/props.d.ts
@@ -0,0 +1,3 @@
+import { TdColProps } from './type';
+declare const props: TdColProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/col/props.js b/miniprogram_npm/tdesign-miniprogram/col/props.js
new file mode 100644
index 0000000..05857f3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/props.js
@@ -0,0 +1,9 @@
+const props = {
+ offset: {
+ type: null,
+ },
+ span: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/col/type.d.ts b/miniprogram_npm/tdesign-miniprogram/col/type.d.ts
new file mode 100644
index 0000000..af55fa4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/type.d.ts
@@ -0,0 +1,10 @@
+export interface TdColProps {
+ offset?: {
+ type: null;
+ value?: string | number;
+ };
+ span?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/col/type.js b/miniprogram_npm/tdesign-miniprogram/col/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/col/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.d.ts
new file mode 100644
index 0000000..4ae0ff4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.d.ts
@@ -0,0 +1,28 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+import type { TdCollapsePanelProps } from './type';
+export interface CollapsePanelProps extends TdCollapsePanelProps {
+}
+export default class CollapsePanel extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ relations: RelationsOptions;
+ properties: TdCollapsePanelProps;
+ data: {
+ prefix: string;
+ expanded: boolean;
+ classPrefix: string;
+ classBasePrefix: string;
+ ultimateExpandIcon: boolean;
+ ultimateDisabled: boolean;
+ };
+ observers: {
+ disabled(v: any): void;
+ };
+ methods: {
+ updateExpanded(activeValues?: any[]): void;
+ updateStyle(expanded: boolean): Promise;
+ onClick(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.js b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.js
new file mode 100644
index 0000000..27b3214
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.js
@@ -0,0 +1,95 @@
+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 { getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-collapse-panel`;
+let CollapsePanel = class CollapsePanel extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`, `${prefix}-class-header`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.relations = {
+ '../collapse/collapse': {
+ type: 'ancestor',
+ linked(target) {
+ const { value, expandIcon, disabled } = target.properties;
+ this.setData({
+ ultimateExpandIcon: this.properties.expandIcon == null ? expandIcon : this.properties.expandIcon,
+ ultimateDisabled: this.properties.disabled == null ? disabled : this.properties.disabled,
+ });
+ this.updateExpanded(value);
+ },
+ },
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ expanded: false,
+ classPrefix: name,
+ classBasePrefix: prefix,
+ ultimateExpandIcon: false,
+ ultimateDisabled: false,
+ };
+ this.observers = {
+ disabled(v) {
+ this.setData({ ultimateDisabled: !!v });
+ },
+ };
+ this.methods = {
+ updateExpanded(activeValues = []) {
+ if (!this.$parent) {
+ return;
+ }
+ const { value } = this.properties;
+ const { defaultExpandAll } = this.$parent.data;
+ const expanded = defaultExpandAll ? !this.data.expanded : activeValues.includes(value);
+ if (expanded === this.properties.expanded)
+ return;
+ this.setData({ expanded });
+ this.updateStyle(expanded);
+ },
+ updateStyle(expanded) {
+ return getRect(this, `.${name}__content`)
+ .then((rect) => rect.height)
+ .then((height) => {
+ const animation = wx.createAnimation({
+ duration: 0,
+ timingFunction: 'ease-in-out',
+ });
+ if (expanded) {
+ animation.height(height).top(0).step({ duration: 300 }).height('auto').step();
+ }
+ else {
+ animation.height(height).top(1).step({ duration: 1 }).height(0).step({ duration: 300 });
+ }
+ this.setData({ animation: animation.export() });
+ });
+ },
+ onClick() {
+ const { ultimateDisabled } = this.data;
+ const { value } = this.properties;
+ if (ultimateDisabled)
+ return;
+ if (this.$parent.data.defaultExpandAll) {
+ this.updateExpanded();
+ }
+ else {
+ this.$parent.switch(value);
+ }
+ },
+ };
+ }
+};
+CollapsePanel = __decorate([
+ wxComponent()
+], CollapsePanel);
+export default CollapsePanel;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.json b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.json
new file mode 100644
index 0000000..e33d33e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-cell": "../cell/cell"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.wxml b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.wxml
new file mode 100644
index 0000000..577ca8e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{content}}
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.wxss b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.wxss
new file mode 100644
index 0000000..92cccc6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/collapse-panel.wxss
@@ -0,0 +1,191 @@
+.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-collapse-panel {
+ background-color: var(--td-collapse-panel-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-collapse-panel--disabled {
+ pointer-events: none;
+}
+.t-collapse-panel--disabled .t-collapse-panel__content,
+.t-collapse-panel--disabled .t-collapse-panel__header {
+ opacity: 0.3;
+}
+.t-collapse-panel--top {
+ display: flex;
+ flex-direction: column-reverse;
+}
+.t-collapse-panel__header {
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding-left: var(--td-collapse-horizontal-padding, 32rpx);
+ height: var(--td-collapse-header-height, auto);
+ color: var(--td-collapse-header-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-collapse-panel__header--top {
+ position: relative;
+}
+.t-collapse-panel__header--top::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: unset;
+ left: unset;
+ right: unset;
+ background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-collapse-panel__header--top::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-collapse-panel__header--bottom {
+ position: relative;
+}
+.t-collapse-panel__header--bottom::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-collapse-panel__header--bottom::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-collapse-panel__header::after {
+ left: 32rpx;
+}
+.t-collapse-panel__header-right {
+ display: inline-flex;
+ align-items: center;
+ height: 100%;
+}
+.t-collapse-panel__header-icon {
+ height: 100%;
+ padding-left: 8px;
+ width: 44px;
+ padding-right: 8px;
+ color: var(--td-collapse-icon-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+}
+.t-collapse-panel__extra {
+ font-size: var(--td-collapse-extra-font-size, var(--td-font-size-m, 32rpx));
+}
+.t-collapse-panel__body {
+ position: relative;
+}
+.t-collapse-panel__body::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-collapse-panel__body::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-collapse-panel__wrapper {
+ height: 0;
+ overflow: hidden;
+}
+.t-collapse-panel__content {
+ color: var(--td-collapse-content-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-collapse-content-font-size, var(--td-font-size-base, 28rpx));
+ padding: var(--td-collapse-content-padding, 32rpx);
+ line-height: var(--td-collapse-content-line-height, 1.5);
+}
+.t-collapse-panel__content--disabled {
+ color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.t-collapse-panel__content--expanded.t-collapse-panel__content--bottom {
+ position: relative;
+}
+.t-collapse-panel__content--expanded.t-collapse-panel__content--bottom::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-collapse-panel__content--expanded.t-collapse-panel__content--bottom::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-collapse-panel__content--expanded.t-collapse-panel__content--top {
+ position: relative;
+}
+.t-collapse-panel__content--expanded.t-collapse-panel__content--top::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: unset;
+ left: unset;
+ right: unset;
+ background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-collapse-panel__content--expanded.t-collapse-panel__content--top::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-collapse-panel__arrow--top {
+ transform: rotate(180deg);
+}
+.class-title {
+ font-size: var(--td-collapse-title-font-size, var(--td-font-size-m, 32rpx));
+}
+.class-title--disabled {
+ color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.class-note--disabled {
+ color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.class-right-icon--disabled {
+ color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/props.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse-panel/props.d.ts
new file mode 100644
index 0000000..829dbea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCollapsePanelProps } from './type';
+declare const props: TdCollapsePanelProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/props.js b/miniprogram_npm/tdesign-miniprogram/collapse-panel/props.js
new file mode 100644
index 0000000..429cd0a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/props.js
@@ -0,0 +1,33 @@
+const props = {
+ content: {
+ type: String,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ expandIcon: {
+ type: null,
+ value: undefined,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ header: {
+ type: String,
+ },
+ headerLeftIcon: {
+ type: String,
+ },
+ headerRightContent: {
+ type: String,
+ },
+ placement: {
+ type: String,
+ value: 'bottom',
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/type.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse-panel/type.d.ts
new file mode 100644
index 0000000..9834253
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/type.d.ts
@@ -0,0 +1,38 @@
+export interface TdCollapsePanelProps {
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ expandIcon?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-header', 't-class-content'];
+ };
+ header?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ headerLeftIcon?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ headerRightContent?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'bottom' | 'top';
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse-panel/type.js b/miniprogram_npm/tdesign-miniprogram/collapse-panel/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse-panel/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/collapse/README.en-US.md
new file mode 100644
index 0000000..f1edbff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/README.en-US.md
@@ -0,0 +1,65 @@
+:: BASE_DOC ::
+
+## API
+
+### Collapse 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
+default-expand-all | Boolean | false | \- | N
+disabled | Boolean | - | \- | N
+expand-icon | Boolean | true | \- | N
+expand-mutex | Boolean | false | \- | N
+theme | String | default | options: default/card | N
+value | Array | [] | Typescript:`CollapseValue` `type CollapseValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
+default-value | Array | undefined | uncontrolled property。Typescript:`CollapseValue` `type CollapseValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
+
+### Collapse Events
+
+name | params | description
+-- | -- | --
+change | `(value: CollapseValue)` | \-
+
+
+### CollapsePanel 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
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+disabled | Boolean | undefined | \- | N
+expand-icon | Boolean / Slot | undefined | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header-left-icon | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header-right-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+placement | String | bottom | `0.34.0`。options: bottom/top | N
+value | String / Number | - | \- | N
+### CollapsePanel External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+t-class-header | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-collapse-border-color | @border-level-1-color | -
+--td-collapse-content-font-size | @font-size-base | -
+--td-collapse-content-line-height | 1.5 | -
+--td-collapse-content-padding | 32rpx | -
+--td-collapse-content-text-color | @text-color-primary | -
+--td-collapse-extra-font-size | @font-size-m | -
+--td-collapse-header-height | auto | -
+--td-collapse-header-text-color | @text-color-primary | -
+--td-collapse-header-text-disabled-color | @text-color-disabled | -
+--td-collapse-horizontal-padding | 32rpx | -
+--td-collapse-icon-color | @font-gray-3 | -
+--td-collapse-panel-bg-color | @bg-color-container | -
+--td-collapse-title-font-size | @font-size-m | -
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/README.md b/miniprogram_npm/tdesign-miniprogram/collapse/README.md
new file mode 100644
index 0000000..22a3352
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/README.md
@@ -0,0 +1,119 @@
+---
+title: Collapse 折叠面板
+description: 用于对复杂区域进行分组和隐藏 常用于订单信息展示等
+spline: data
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.7.3 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-collapse": "tdesign-miniprogram/collapse/collapse",
+ "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 类型
+
+基础折叠面板
+
+{{ base }}
+
+
+带操作说明
+
+{{ action }}
+
+手风琴模式
+
+{{ accordion }}
+
+### 样式
+
+卡片折叠面板
+
+{{ theme }}
+
+## API
+
+### Collapse Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+default-expand-all | Boolean | false | 默认是否展开全部 | N
+disabled | Boolean | - | 是否禁用面板展开/收起操作 | N
+expand-icon | Boolean | true | 展开图标 | N
+expand-mutex | Boolean | false | 每个面板互斥展开,每次只展开一个面板 | N
+theme | String | default | 折叠面板风格。可选项:default/card | N
+value | Array | [] | 展开的面板集合。TS 类型:`CollapseValue` `type CollapseValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
+default-value | Array | undefined | 展开的面板集合。非受控属性。TS 类型:`CollapseValue` `type CollapseValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
+
+### Collapse Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: CollapseValue)` | 切换面板时触发,返回变化的值
+
+
+### CollapsePanel Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+content | String / Slot | - | 折叠面板内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+disabled | Boolean | undefined | 禁止当前面板展开,优先级大于 Collapse 的同名属性 | N
+expand-icon | Boolean / Slot | undefined | 当前折叠面板展开图标,优先级大于 Collapse 的同名属性。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header | String / Slot | - | 面板头内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header-left-icon | String / Slot | - | 面板头左侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header-right-content | String / Slot | - | 面板头的右侧区域,一般用于呈现面板操作。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+placement | String | bottom | `0.34.0`。选项卡内容的位置。可选项:bottom/top | N
+value | String / Number | - | 当前面板唯一标识,如果值为空则取当前面下标兜底作为唯一标识 | N
+### CollapsePanel External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-header | 头部样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-collapse-border-color | @border-level-1-color | -
+--td-collapse-content-font-size | @font-size-base | -
+--td-collapse-content-line-height | 1.5 | -
+--td-collapse-content-padding | 32rpx | -
+--td-collapse-content-text-color | @text-color-primary | -
+--td-collapse-extra-font-size | @font-size-m | -
+--td-collapse-header-height | auto | -
+--td-collapse-header-text-color | @text-color-primary | -
+--td-collapse-header-text-disabled-color | @text-color-disabled | -
+--td-collapse-horizontal-padding | 32rpx | -
+--td-collapse-icon-color | @font-gray-3 | -
+--td-collapse-panel-bg-color | @bg-color-container | -
+--td-collapse-title-font-size | @font-size-m | -
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/collapse.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.d.ts
new file mode 100644
index 0000000..9fcf0ce
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.d.ts
@@ -0,0 +1,24 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+import type { CollapseValue, TdCollapseProps } from './type';
+export interface CollapseProps extends TdCollapseProps {
+}
+export default class Collapse extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ properties: TdCollapseProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ observers: {
+ 'value, expandMutex '(): void;
+ };
+ methods: {
+ updateExpanded(): void;
+ switch(panelValue: CollapseValue): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/collapse.js b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.js
new file mode 100644
index 0000000..cf6631f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.js
@@ -0,0 +1,61 @@
+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}-collapse`;
+let Collapse = class Collapse extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.relations = {
+ '../collapse-panel/collapse-panel': {
+ type: 'descendant',
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.observers = {
+ 'value, expandMutex '() {
+ this.updateExpanded();
+ },
+ };
+ this.methods = {
+ updateExpanded() {
+ this.$children.forEach((child) => {
+ child.updateExpanded(this.properties.value);
+ });
+ },
+ switch(panelValue) {
+ const { expandMutex, value: activeValues } = this.properties;
+ let value = [];
+ const hit = activeValues.indexOf(panelValue);
+ if (hit > -1) {
+ value = activeValues.filter((item) => item !== panelValue);
+ }
+ else {
+ value = expandMutex ? [panelValue] : activeValues.concat(panelValue);
+ }
+ this._trigger('change', { value });
+ },
+ };
+ }
+};
+Collapse = __decorate([
+ wxComponent()
+], Collapse);
+export default Collapse;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/collapse.json b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.json
new file mode 100644
index 0000000..79f2730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared"
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/collapse.wxml b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.wxml
new file mode 100644
index 0000000..24b8770
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.wxml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/collapse.wxss b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.wxss
new file mode 100644
index 0000000..62a6a01
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/collapse.wxss
@@ -0,0 +1,32 @@
+.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-collapse--card {
+ margin: 0 32rpx;
+ border-radius: var(--td-radius-large, 18rpx);
+ overflow: hidden;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/index.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse/index.d.ts
new file mode 100644
index 0000000..69a68c1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/index.d.ts
@@ -0,0 +1,4 @@
+export { default as Collapse } from './collapse';
+export * from './type';
+export * from './props';
+export { CollapseProps } from './collapse';
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/index.js b/miniprogram_npm/tdesign-miniprogram/collapse/index.js
new file mode 100644
index 0000000..53d3447
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/index.js
@@ -0,0 +1,3 @@
+export { default as Collapse } from './collapse';
+export * from './type';
+export * from './props';
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/props.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse/props.d.ts
new file mode 100644
index 0000000..8ab2059
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCollapseProps } from './type';
+declare const props: TdCollapseProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/props.js b/miniprogram_npm/tdesign-miniprogram/collapse/props.js
new file mode 100644
index 0000000..3dfb242
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/props.js
@@ -0,0 +1,30 @@
+const props = {
+ defaultExpandAll: {
+ type: Boolean,
+ value: false,
+ },
+ disabled: {
+ type: Boolean,
+ },
+ expandIcon: {
+ type: Boolean,
+ value: true,
+ },
+ expandMutex: {
+ type: Boolean,
+ value: false,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ value: {
+ type: Array,
+ value: null,
+ },
+ defaultValue: {
+ type: Array,
+ value: [],
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/type.d.ts b/miniprogram_npm/tdesign-miniprogram/collapse/type.d.ts
new file mode 100644
index 0000000..8599bc1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/type.d.ts
@@ -0,0 +1,31 @@
+export interface TdCollapseProps {
+ defaultExpandAll?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ expandIcon?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ expandMutex?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'card';
+ };
+ value?: {
+ type: ArrayConstructor;
+ value?: CollapseValue;
+ };
+ defaultValue?: {
+ type: ArrayConstructor;
+ value?: CollapseValue;
+ };
+}
+export declare type CollapseValue = Array;
diff --git a/miniprogram_npm/tdesign-miniprogram/collapse/type.js b/miniprogram_npm/tdesign-miniprogram/collapse/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/collapse/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/color-picker/README.en-US.md
new file mode 100644
index 0000000..ffa7809
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/README.en-US.md
@@ -0,0 +1,31 @@
+:: BASE_DOC ::
+
+## API
+
+### ColorPicker 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
+auto-close | Boolean | true | \- | N
+enable-alpha | Boolean | false | \- | N
+fixed | Boolean | false | `1.8.5` | N
+footer | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+format | String | RGB | options: RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N
+header | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+popup-props | Object | {} | Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
+swatch-colors | Array | - | swatch colors。Typescript:`Array \| null` | N
+type | String | base | options: base/multiple。Typescript:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
+use-popup | Boolean | false | \- | N
+value | String | - | color value | N
+default-value | String | undefined | color value。uncontrolled property | N
+visible | Boolean | false | \- | N
+
+### ColorPicker Events
+
+name | params | description
+-- | -- | --
+change | `(value: string, context: { color: ColorObject; trigger: ColorPickerChangeTrigger })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts)。
`type ColorPickerChangeTrigger = 'palette-hue-bar' \| 'palette-alpha-bar' \| 'preset' `
+close | `(trigger: ColorPickerTrigger)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts)。
`type ColorPickerTrigger = 'overlay'`
+palette-bar-change | `(detail: { color: ColorObject })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts)。
`interface ColorObject { alpha: number; css: string; hex: string; hex8: string; hsl: string; hsla: string; hsv: string; hsva: string; rgb: string; rgba: string; value: number;}`
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/README.md b/miniprogram_npm/tdesign-miniprogram/color-picker/README.md
new file mode 100644
index 0000000..3237819
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/README.md
@@ -0,0 +1,82 @@
+---
+title: ColorPicker 颜色选择器
+description: 用于颜色选择,支持多种格式。
+spline: data
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-color-picker": "tdesign-miniprogram/color-picker/color-picker"
+}
+```
+
+## 代码演示
+
+### 组件类型
+
+#### 基础颜色选择器
+
+{{ base }}
+
+#### 带色板的颜色选择器
+
+{{ multiple }}
+
+### 组件状态
+
+{{ format }}
+
+
+## API
+
+### ColorPicker Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+auto-close | Boolean | true | 自动关闭。在点击遮罩层时自动关闭,不需要手动设置 visible | N
+enable-alpha | Boolean | false | 是否开启透明通道 | N
+fixed | Boolean | false | `1.8.5`。如果 color-picker 是在一个 `position:fixed` 的区域,需要显式指定属性 fixed 为 true | N
+footer | Slot | - | 底部插槽,仅在 `usePopup` 为 `true` 时有效。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+format | String | RGB | 格式化色值。`enableAlpha` 为真时,`RGBA/HSLA/HSVA` 等值有效。可选项:RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N
+header | Slot | - | 顶部插槽,仅在 `usePopup` 为 `true` 时有效。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+popup-props | Object | {} | popupProps透传。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
+swatch-colors | Array | - | 系统预设的颜色样例,值为 `null` 或 `[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色。TS 类型:`Array \| null` | N
+type | String | base | 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容。可选项:base/multiple。TS 类型:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
+use-popup | Boolean | false | 是否使用弹出层包裹颜色选择器 | N
+value | String | - | 色值 | N
+default-value | String | undefined | 色值。非受控属性 | N
+visible | Boolean | false | 是否显示颜色选择器。`usePopup` 为 true 时有效 | N
+
+### ColorPicker Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: string, context: { color: ColorObject; trigger: ColorPickerChangeTrigger })` | 选中的色值发生变化时触发,第一个参数 `value` 表示新色值,`context.color` 表示当前调色板控制器的色值,`context.trigger` 表示触发颜色变化的来源。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts)。
`type ColorPickerChangeTrigger = 'palette-hue-bar' \| 'palette-alpha-bar' \| 'preset' `
+close | `(trigger: ColorPickerTrigger)` | 关闭按钮时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts)。
`type ColorPickerTrigger = 'overlay'`
+palette-bar-change | `(detail: { color: ColorObject })` | 调色板控制器的值变化时触发,`context.color` 指调色板控制器的值。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts)。
`interface ColorObject { alpha: number; css: string; hex: string; hex8: string; hsl: string; hsla: string; hsv: string; hsva: string; rgb: string; rgba: string; value: number;}`
+
+## FAQ
+
+如果使用场景为 `scroll-view`,除了需要显示指定 `fixed` 属性为 `true`,还需要手动调用组件的 debouncedUpdateEleRect() 事件。
+
+```html
+
+
+
+```
+
+```js
+onScroll(e) {
+ if (!this.colorPicker) this.colorPicker = this.selectComponent('#ColorPicker');
+ this.colorPicker.debouncedUpdateEleRect(e);
+}
+```
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.d.ts b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.d.ts
new file mode 100644
index 0000000..751ec5b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.d.ts
@@ -0,0 +1,104 @@
+import { SuperComponent } from '../common/src/index';
+import type { Coordinate } from './interfaces';
+import { Color } from './utils';
+export default class ColorPicker extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdColorPickerProps;
+ observers: {
+ format(): void;
+ swatchColors(value: any): void;
+ type(value: any): void;
+ 'usePopup, visible'(usePopup: boolean, visible: boolean): void;
+ value(v: string): void;
+ };
+ color: Color;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ panelRect: {
+ width: number;
+ height: number;
+ };
+ sliderRect: {
+ width: number;
+ left: number;
+ };
+ saturationInfo: {
+ saturation: number;
+ value: number;
+ };
+ saturationThumbStyle: {
+ left: number;
+ top: number;
+ };
+ sliderInfo: {
+ value: number;
+ };
+ hueSliderStyle: {
+ left: number;
+ };
+ alphaSliderStyle: {
+ left: number;
+ };
+ innerValue: string;
+ showPrimaryColorPreview: boolean;
+ previewColor: string;
+ formatList: any[];
+ innerSwatchList: any;
+ isMultiple: boolean;
+ defaultOverlayProps: {};
+ };
+ lifetimes: {
+ ready(): void;
+ attached(): void;
+ detached(): void;
+ };
+ methods: {
+ init(): void;
+ updateEleRect(e: WechatMiniprogram.TouchEvent): void;
+ getEleReact(): void;
+ clickSwatch(e: any): void;
+ setCoreStyle(): void;
+ emitColorChange(trigger: any): void;
+ defaultEmptyColor(): string;
+ updateColor(): void;
+ getSaturationAndValueByCoordinate(coordinate: Coordinate): {
+ saturation: number;
+ value: number;
+ };
+ getSaturationThumbStyle({ saturation, value }: {
+ saturation: any;
+ value: any;
+ }): {
+ color: any;
+ left: string;
+ top: string;
+ };
+ getSliderThumbStyle({ value, maxValue }: {
+ value: any;
+ maxValue: any;
+ }): {
+ left: string;
+ color: any;
+ };
+ onChangeSaturation({ saturation, value }: {
+ saturation: any;
+ value: any;
+ }): void;
+ formatValue(): any;
+ onChangeSlider({ value, isAlpha }: {
+ value: any;
+ isAlpha: any;
+ }): void;
+ handleSaturationDrag(e: any): void;
+ handleSliderDrag(e: any, isAlpha?: boolean): void;
+ handleDiffDrag(e: any): void;
+ onTouchStart(e: any): void;
+ onTouchMove(e: any): void;
+ onTouchEnd(e: any): void;
+ close(trigger: string): void;
+ onVisibleChange(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.js b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.js
new file mode 100644
index 0000000..90c2375
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.js
@@ -0,0 +1,359 @@
+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 { SATURATION_PANEL_DEFAULT_HEIGHT, SATURATION_PANEL_DEFAULT_WIDTH, SLIDER_DEFAULT_WIDTH, DEFAULT_COLOR, ALPHA_MAX, HUE_MAX, DEFAULT_SYSTEM_SWATCH_COLORS, } from './constants';
+import { getRect, debounce } from '../common/utils';
+import { Color, getColorObject } from './utils';
+const { prefix } = config;
+const name = `${prefix}-color-picker`;
+const getCoordinate = (e, react, isFixed) => {
+ var _a;
+ const { pageX, pageY, clientY } = e.changedTouches[0] || {};
+ const offsetY = isFixed ? react.top : (_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.offsetTop;
+ return {
+ x: Math.min(Math.max(0, pageX - react.left), react.width),
+ y: Math.min(Math.max(0, (isFixed ? clientY : pageY) - offsetY), react.height),
+ };
+};
+const getFormatList = (format, color) => {
+ const FORMAT_MAP = {
+ HSV: Object.values(color.getHsva()),
+ HSVA: Object.values(color.getHsva()),
+ HSL: Object.values(color.getHsla()),
+ HSLA: Object.values(color.getHsla()),
+ HSB: Object.values(color.getHsla()),
+ RGB: Object.values(color.getRgba()),
+ RGBA: Object.values(color.getRgba()),
+ CMYK: [...Object.values(color.getCmyk()), 0],
+ CSS: [color.css, 0],
+ HEX: [color.hex, 0],
+ };
+ const cur = FORMAT_MAP[format];
+ if (cur) {
+ return [...cur.slice(0, cur.length - 1), `${Math.round(color.alpha * 100)}%`];
+ }
+ return FORMAT_MAP.RGB;
+};
+const genSwatchList = (prop) => {
+ if (prop === undefined) {
+ return DEFAULT_SYSTEM_SWATCH_COLORS;
+ }
+ if (!prop || !prop.length) {
+ return [];
+ }
+ return prop;
+};
+let ColorPicker = class ColorPicker extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.observers = {
+ format() {
+ this.setCoreStyle();
+ },
+ swatchColors(value) {
+ this.setData({
+ innerSwatchList: genSwatchList(value),
+ });
+ },
+ type(value) {
+ this.setData({
+ isMultiple: value === 'multiple',
+ });
+ },
+ 'usePopup, visible'(usePopup, visible) {
+ if (this.timer) {
+ clearTimeout(this.timer);
+ }
+ if (usePopup && visible) {
+ this.timer = setTimeout(() => {
+ this.getEleReact();
+ }, 350);
+ }
+ },
+ value(v) {
+ if (v) {
+ this.init();
+ }
+ },
+ };
+ this.color = new Color(props.defaultValue.value || props.value.value || DEFAULT_COLOR);
+ this.data = {
+ prefix,
+ classPrefix: name,
+ panelRect: {
+ width: SATURATION_PANEL_DEFAULT_WIDTH,
+ height: SATURATION_PANEL_DEFAULT_HEIGHT,
+ },
+ sliderRect: {
+ width: SLIDER_DEFAULT_WIDTH,
+ left: 0,
+ },
+ saturationInfo: {
+ saturation: 0,
+ value: 0,
+ },
+ saturationThumbStyle: {
+ left: 0,
+ top: 0,
+ },
+ sliderInfo: {
+ value: 0,
+ },
+ hueSliderStyle: {
+ left: 0,
+ },
+ alphaSliderStyle: {
+ left: 0,
+ },
+ innerValue: props.defaultValue.value || props.value.value,
+ showPrimaryColorPreview: false,
+ previewColor: props.defaultValue.value || props.value.value,
+ formatList: getFormatList(props.format.value, this.color),
+ innerSwatchList: genSwatchList(props.swatchColors.value),
+ isMultiple: props.type.value === 'multiple',
+ defaultOverlayProps: {},
+ };
+ this.lifetimes = {
+ ready() {
+ this.init();
+ },
+ attached() {
+ this.debouncedUpdateEleRect = debounce((e) => this.updateEleRect(e), 150);
+ },
+ detached() {
+ clearTimeout(this.timer);
+ },
+ };
+ this.methods = {
+ init() {
+ const { value, defaultValue } = this.properties;
+ const innerValue = value || defaultValue;
+ if (innerValue) {
+ this.setData({
+ innerValue,
+ });
+ }
+ this.color = new Color(innerValue || DEFAULT_COLOR);
+ this.updateColor();
+ this.getEleReact();
+ },
+ updateEleRect(e) {
+ if (!e)
+ return;
+ const { scrollTop } = e.detail;
+ const { width, height, left, initTop } = this.data.panelRect;
+ this.setData({
+ panelRect: {
+ width,
+ height,
+ left,
+ top: initTop - scrollTop,
+ initTop,
+ },
+ });
+ },
+ getEleReact() {
+ Promise.all([getRect(this, `.${name}__saturation`), getRect(this, `.${name}__slider`)]).then(([saturationRect, sliderRect]) => {
+ this.setData({
+ panelRect: {
+ width: saturationRect.width || SATURATION_PANEL_DEFAULT_WIDTH,
+ height: saturationRect.height || SATURATION_PANEL_DEFAULT_HEIGHT,
+ left: saturationRect.left || 0,
+ top: saturationRect.top || 0,
+ initTop: saturationRect.top || 0,
+ },
+ sliderRect: {
+ left: sliderRect.left || 0,
+ width: sliderRect.width || SLIDER_DEFAULT_WIDTH,
+ },
+ }, () => {
+ this.setCoreStyle();
+ });
+ });
+ },
+ clickSwatch(e) {
+ const swatch = e.currentTarget.dataset.value;
+ this.color.update(swatch);
+ this.emitColorChange('preset');
+ this.setCoreStyle();
+ },
+ setCoreStyle() {
+ this.setData({
+ sliderInfo: {
+ value: this.color.hue,
+ },
+ hueSliderStyle: this.getSliderThumbStyle({ value: this.color.hue, maxValue: HUE_MAX }),
+ alphaSliderStyle: this.getSliderThumbStyle({ value: this.color.alpha * 100, maxValue: ALPHA_MAX }),
+ saturationInfo: {
+ saturation: this.color.saturation,
+ value: this.color.value,
+ },
+ saturationThumbStyle: this.getSaturationThumbStyle({
+ saturation: this.color.saturation,
+ value: this.color.value,
+ }),
+ previewColor: this.color.rgba,
+ formatList: getFormatList(this.properties.format, this.color),
+ });
+ },
+ emitColorChange(trigger) {
+ this.setData({
+ innerValue: this.formatValue(),
+ });
+ this.triggerEvent('change', {
+ value: this.formatValue(),
+ context: {
+ trigger,
+ color: getColorObject(this.color),
+ },
+ });
+ },
+ defaultEmptyColor() {
+ return DEFAULT_COLOR;
+ },
+ updateColor() {
+ const result = this.data.innerValue || this.defaultEmptyColor();
+ this.color.update(result);
+ },
+ getSaturationAndValueByCoordinate(coordinate) {
+ const { width, height } = this.data.panelRect;
+ const { x, y } = coordinate;
+ let saturation = x / width;
+ let value = 1 - y / height;
+ saturation = Math.min(1, Math.max(0, saturation));
+ value = Math.min(1, Math.max(0, value));
+ return {
+ saturation,
+ value,
+ };
+ },
+ getSaturationThumbStyle({ saturation, value }) {
+ const { width, height } = this.data.panelRect;
+ const top = Math.round((1 - value) * height);
+ const left = Math.round(saturation * width);
+ return {
+ color: this.color.rgb,
+ left: `${left}px`,
+ top: `${top}px`,
+ };
+ },
+ getSliderThumbStyle({ value, maxValue }) {
+ const { width } = this.data.sliderRect;
+ if (!width) {
+ return;
+ }
+ const left = Math.round((value / maxValue) * 100);
+ return {
+ left: `${left}%`,
+ color: this.color.rgb,
+ };
+ },
+ onChangeSaturation({ saturation, value }) {
+ const { saturation: sat, value: val } = this.color;
+ let changeTrigger = 'palette-saturation-brightness';
+ if (value !== val && saturation !== sat) {
+ this.color.saturation = saturation;
+ this.color.value = value;
+ changeTrigger = 'palette-saturation-brightness';
+ }
+ else if (saturation !== sat) {
+ this.color.saturation = saturation;
+ changeTrigger = 'palette-saturation';
+ }
+ else if (value !== val) {
+ this.color.value = value;
+ changeTrigger = 'palette-brightness';
+ }
+ else {
+ return;
+ }
+ this.triggerEvent('palette-bar-change', {
+ color: getColorObject(this.color),
+ });
+ this.emitColorChange(changeTrigger);
+ this.setCoreStyle();
+ },
+ formatValue() {
+ return this.color.getFormatsColorMap()[this.properties.format] || this.color.css;
+ },
+ onChangeSlider({ value, isAlpha }) {
+ if (isAlpha) {
+ this.color.alpha = value / 100;
+ }
+ else {
+ this.color.hue = value;
+ }
+ this.emitColorChange(isAlpha ? 'palette-alpha-bar' : 'palette-hue-bar');
+ this.setCoreStyle();
+ },
+ handleSaturationDrag(e) {
+ const { usePopup, fixed } = this.properties;
+ const coordinate = getCoordinate(e, this.data.panelRect, usePopup || fixed);
+ const { saturation, value } = this.getSaturationAndValueByCoordinate(coordinate);
+ this.onChangeSaturation({ saturation, value });
+ },
+ handleSliderDrag(e, isAlpha = false) {
+ const { width } = this.data.sliderRect;
+ const coordinate = getCoordinate(e, this.data.sliderRect);
+ const { x } = coordinate;
+ const maxValue = isAlpha ? ALPHA_MAX : HUE_MAX;
+ let value = Math.round((x / width) * maxValue * 100) / 100;
+ if (value < 0)
+ value = 0;
+ if (value > maxValue)
+ value = maxValue;
+ this.onChangeSlider({ value, isAlpha });
+ },
+ handleDiffDrag(e) {
+ const dragType = e.target.dataset.type || e.currentTarget.dataset.type;
+ switch (dragType) {
+ case 'saturation':
+ this.handleSaturationDrag(e);
+ break;
+ case 'hue-slider':
+ this.handleSliderDrag(e);
+ break;
+ case 'alpha-slider':
+ this.handleSliderDrag(e, true);
+ break;
+ default:
+ break;
+ }
+ },
+ onTouchStart(e) {
+ this.handleDiffDrag(e);
+ },
+ onTouchMove(e) {
+ this.handleDiffDrag(e);
+ },
+ onTouchEnd(e) {
+ wx.nextTick(() => {
+ this.handleDiffDrag(e);
+ });
+ },
+ close(trigger) {
+ if (this.properties.autoClose) {
+ this.setData({ visible: false });
+ }
+ this.triggerEvent('close', { trigger });
+ },
+ onVisibleChange() {
+ this.close('overlay');
+ },
+ };
+ }
+};
+ColorPicker = __decorate([
+ wxComponent()
+], ColorPicker);
+export default ColorPicker;
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.json b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.json
new file mode 100644
index 0000000..b93d975
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-popup": "../popup/popup"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.wxml b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.wxml
new file mode 100644
index 0000000..8d21c22
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.wxss b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.wxss
new file mode 100644
index 0000000..0a37277
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/color-picker.wxss
@@ -0,0 +1,300 @@
+.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-color-picker__panel {
+ padding: 0;
+ width: var(--td-color-picker-panel-width, 750rpx);
+ background: var(--td-color-picker-background, #fff);
+ border-top-left-radius: var(--td-color-picker-panel-radius, 24rpx);
+ border-top-right-radius: var(--td-color-picker-panel-radius, 24rpx);
+ user-select: none;
+}
+.t-color-picker__body {
+ padding: var(--td-color-picker-panel-padding, 32rpx);
+ padding-bottom: 56rpx;
+}
+.t-color-picker__thumb {
+ position: absolute;
+ z-index: 1;
+ outline: none;
+ width: var(--td-color-picker-slider-thumb-size, 48rpx);
+ height: var(--td-color-picker-slider-thumb-size, 48rpx);
+ border-radius: var(--td-color-picker-border-radius-circle, 50%);
+ box-shadow: var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12));
+ color: var(--td-text-color-brand, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ box-sizing: border-box;
+}
+.t-color-picker__thumb::before,
+.t-color-picker__thumb::after {
+ content: '';
+ position: absolute;
+ border-radius: var(--td-color-picker-border-radius-circle, 50%);
+ box-sizing: border-box;
+ display: block;
+ border: 1px solid #dcdcdc;
+}
+.t-color-picker__thumb::before {
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: #fff;
+}
+.t-color-picker__thumb::after {
+ left: 3px;
+ top: 3px;
+ width: calc(100% - 6px);
+ height: calc(100% - 6px);
+ padding: var(--td-color-picker-slider-thumb-padding, 6rpx);
+ background: currentcolor;
+}
+.t-color-picker__saturation {
+ height: var(--td-color-picker-saturation-height, 288rpx);
+ border-radius: var(--td-color-picker-saturation-radius, 12rpx);
+ position: relative;
+ overflow: hidden;
+ background: transparent;
+}
+.t-color-picker__saturation::before,
+.t-color-picker__saturation::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.t-color-picker__saturation::before {
+ /* stylelint-disable-next-line color-no-hex */
+ background: linear-gradient(90deg, #fff, transparent);
+}
+.t-color-picker__saturation::after {
+ /* stylelint-disable-next-line color-no-hex */
+ background: linear-gradient(0deg, #000, transparent);
+}
+.t-color-picker__saturation .t-color-picker__thumb {
+ width: var(--td-color-picker-saturation-thumb-size, 48rpx);
+ height: var(--td-color-picker-saturation-thumb-size, 48rpx);
+ border-radius: var(--td-color-picker-border-radius-circle, 50%);
+ transform: translate(-50%, -50%);
+}
+.t-color-picker__slider-wrapper {
+ border-radius: calc(var(--td-color-picker-slider-height, 16rpx) / 2);
+ padding: var(--td-color-picker-slider-wrapper-padding, 0 18rpx);
+ position: relative;
+}
+.t-color-picker__slider-wrapper--hue-type {
+ /* stylelint-disable-next-line color-named */
+ background: linear-gradient(90deg, red, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red);
+ margin: 16rpx 0;
+}
+.t-color-picker__slider-wrapper--alpha-type {
+ background: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ margin: 40rpx 0 16rpx 0;
+ /* stylelint-disable-next-line color-no-hex */
+ background-image: linear-gradient(45deg, #c5c5c5 25%, transparent 0, transparent 75%, #c5c5c5 0, #c5c5c5), linear-gradient(45deg, #c5c5c5 25%, transparent 0, transparent 75%, #c5c5c5 0, #c5c5c5);
+ background-size: 6px 6px;
+ background-position: 0 0, 3px 3px;
+}
+.t-color-picker__slider-wrapper--alpha-type .t-color-picker__rail {
+ background: linear-gradient(to right, transparent, currentcolor);
+}
+.t-color-picker__slider-padding {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: var(--td-color-picker-slider-height, 16rpx);
+ border-radius: calc(var(--td-color-picker-slider-height, 16rpx) / 2);
+}
+.t-color-picker__slider {
+ height: var(--td-color-picker-slider-height, 16rpx);
+ position: relative;
+ border-radius: calc(var(--td-color-picker-slider-height, 16rpx) / 2);
+ color: transparent;
+ outline: none;
+ z-index: 1;
+}
+.t-color-picker__slider .t-color-picker__thumb {
+ transform: translate(var(--td-color-picker-slider-thumb-transform-x, -18rpx), -50%);
+ top: 50%;
+}
+.t-color-picker__slider .t-color-picker__rail {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ border-radius: inherit;
+}
+.t-color-picker__sliders-wrapper {
+ display: flex;
+ align-items: center;
+ margin: 32rpx 0 40rpx;
+}
+.t-color-picker__sliders {
+ width: 100%;
+}
+.t-color-picker__sliders-preview {
+ flex-shrink: 0;
+ margin-left: var(--td-color-picker-margin, 24rpx);
+ width: var(--td-color-picker-gradient-preview-width, 56rpx);
+ height: var(--td-color-picker-gradient-preview-height, 56rpx);
+ border-radius: var(--td-color-picker-gradient-preview-radius, 6rpx);
+ overflow: hidden;
+ background: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ /* stylelint-disable-next-line color-no-hex */
+ background-image: linear-gradient(45deg, #c5c5c5 25%, transparent 0, transparent 75%, #c5c5c5 0, #c5c5c5), linear-gradient(45deg, #c5c5c5 25%, transparent 0, transparent 75%, #c5c5c5 0, #c5c5c5);
+ background-size: 6px 6px;
+ background-position: 0 0, 3px 3px;
+}
+.t-color-picker__sliders-preview-inner {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+.t-color-picker__format {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ color: rgba(0, 0, 0, 0.4);
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 56rpx;
+ height: 56rpx;
+ margin-top: 40rpx;
+}
+.t-color-picker__format-item {
+ background: var(--td-color-picker-format-background-color, var(--td-gray-color-1, #f3f3f3));
+}
+.t-color-picker__format-item--first {
+ flex-shrink: 0;
+ width: 136rpx;
+ border: 1px solid #dcdcdc;
+ border-radius: 12rpx;
+ margin-right: 24rpx;
+}
+.t-color-picker__format-item--second {
+ flex: 1;
+}
+.t-color-picker__format-inputs {
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+}
+.t-color-picker__format-input {
+ flex: 1;
+ width: 0;
+ margin-left: -1px;
+ border: 1px solid #dcdcdc;
+ border-radius: 12rpx;
+}
+.t-color-picker__format-input:not(:first-child):not(:last-child) {
+ border-radius: 0;
+}
+.t-color-picker__format-input:first-child:not(:last-child) {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.t-color-picker__format-input:last-child:not(:first-child) {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.t-color-picker__format-input--fixed {
+ flex-shrink: 0;
+ flex-grow: 0;
+ flex-basis: 133rpx;
+}
+.t-color-picker__swatches-wrap {
+ margin-top: 56rpx;
+ position: relative;
+}
+.t-color-picker__swatches + .t-color-picker__swatches {
+ margin-top: var(--td-color-picker-margin, 24rpx);
+}
+.t-color-picker__swatches-title {
+ font: var(--td-color-picker-swatches-title-font, 32rpx);
+ padding: 0;
+ color: rgba(0, 0, 0, 0.9);
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 48rpx;
+ line-height: 48rpx;
+}
+.t-color-picker__swatches-items {
+ margin-top: 24rpx;
+ width: 100%;
+ list-style: none;
+ display: flex;
+ overflow-x: auto;
+ overflow-y: auto;
+}
+.t-color-picker__swatches-items::-webkit-scrollbar {
+ display: none;
+ width: 0;
+ height: 0;
+ color: transparent;
+}
+.t-color-picker__swatches-item {
+ width: var(--td-color-picker-swatch-width, 48rpx);
+ height: var(--td-color-picker-swatch-height, 48rpx);
+ border-radius: 6rpx;
+ padding: var(--td-color-picker-swatch-padding, 0);
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ transform-origin: center;
+ transition: all var(--td-anim-duration-base, 0.2s) var(--td-anim-time-fn-easing, cubic-bezier(0.38, 0, 0.24, 1));
+ box-sizing: border-box;
+ flex-shrink: 0;
+ margin-right: 24rpx;
+ border-radius: var(--td-color-picker-swatch-border-radius, 6rpx);
+}
+.t-color-picker__swatches-item::after {
+ content: '';
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ left: 0;
+ top: 0;
+ opacity: 0;
+ background: rgba(0, 0, 0, 0.2);
+}
+.t-color-picker__swatches-item:active::after {
+ opacity: 1;
+}
+.t-color-picker__swatches-inner {
+ width: 100%;
+ height: 100%;
+ display: block;
+ border-radius: var(--td-color-picker-swatch-border-radius, 6rpx);
+ position: relative;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/constants.d.ts b/miniprogram_npm/tdesign-miniprogram/color-picker/constants.d.ts
new file mode 100644
index 0000000..95998fb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/constants.d.ts
@@ -0,0 +1,7 @@
+export declare const DEFAULT_COLOR = "#001F97";
+export declare const DEFAULT_SYSTEM_SWATCH_COLORS: string[];
+export declare const SATURATION_PANEL_DEFAULT_WIDTH = 343;
+export declare const SATURATION_PANEL_DEFAULT_HEIGHT = 144;
+export declare const SLIDER_DEFAULT_WIDTH = 303;
+export declare const HUE_MAX = 360;
+export declare const ALPHA_MAX = 100;
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/constants.js b/miniprogram_npm/tdesign-miniprogram/color-picker/constants.js
new file mode 100644
index 0000000..ec77e63
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/constants.js
@@ -0,0 +1,18 @@
+export const DEFAULT_COLOR = '#001F97';
+export const DEFAULT_SYSTEM_SWATCH_COLORS = [
+ '#F2F3FF',
+ '#D9E1FF',
+ '#B5C7FF',
+ '#8EABFF',
+ '#618DFF',
+ '#366EF4',
+ '#0052D9',
+ '#003CAB',
+ '#002A7C',
+ '#001A57',
+];
+export const SATURATION_PANEL_DEFAULT_WIDTH = 343;
+export const SATURATION_PANEL_DEFAULT_HEIGHT = 144;
+export const SLIDER_DEFAULT_WIDTH = 303;
+export const HUE_MAX = 360;
+export const ALPHA_MAX = 100;
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/interfaces.d.ts b/miniprogram_npm/tdesign-miniprogram/color-picker/interfaces.d.ts
new file mode 100644
index 0000000..df8e678
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/interfaces.d.ts
@@ -0,0 +1,5 @@
+export interface Coordinate {
+ x: number;
+ y: number;
+}
+export declare type ColorPickerChangeTrigger = 'palette-saturation-brightness' | 'palette-saturation' | 'palette-brightness' | 'palette-hue-bar' | 'palette-alpha-bar' | 'preset';
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/interfaces.js b/miniprogram_npm/tdesign-miniprogram/color-picker/interfaces.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/interfaces.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/props.d.ts b/miniprogram_npm/tdesign-miniprogram/color-picker/props.d.ts
new file mode 100644
index 0000000..177f6e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/props.d.ts
@@ -0,0 +1,3 @@
+import { TdColorPickerProps } from './type';
+declare const props: TdColorPickerProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/props.js b/miniprogram_npm/tdesign-miniprogram/color-picker/props.js
new file mode 100644
index 0000000..8d9e60a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/props.js
@@ -0,0 +1,46 @@
+const props = {
+ autoClose: {
+ type: Boolean,
+ value: true,
+ },
+ enableAlpha: {
+ type: Boolean,
+ value: false,
+ },
+ fixed: {
+ type: Boolean,
+ value: false,
+ },
+ format: {
+ type: String,
+ value: 'RGB',
+ },
+ popupProps: {
+ type: Object,
+ value: {},
+ },
+ swatchColors: {
+ type: Array,
+ },
+ type: {
+ type: String,
+ value: 'base',
+ },
+ usePopup: {
+ type: Boolean,
+ value: false,
+ },
+ value: {
+ type: String,
+ value: null,
+ },
+ defaultValue: {
+ type: String,
+ value: '',
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/template.wxml b/miniprogram_npm/tdesign-miniprogram/color-picker/template.wxml
new file mode 100644
index 0000000..fd92e0d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/template.wxml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{format}}
+
+
+ {{item}}
+
+
+
+
+
+
+ 系统预设色彩
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/type.d.ts b/miniprogram_npm/tdesign-miniprogram/color-picker/type.d.ts
new file mode 100644
index 0000000..c307246
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/type.d.ts
@@ -0,0 +1,48 @@
+import { PopupProps } from '../popup/index';
+export interface TdColorPickerProps {
+ autoClose?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ enableAlpha?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ fixed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ format?: {
+ type: StringConstructor;
+ value?: 'RGB' | 'RGBA' | 'HSL' | 'HSLA' | 'HSB' | 'HSV' | 'HSVA' | 'HEX' | 'CMYK' | 'CSS';
+ };
+ popupProps?: {
+ type: ObjectConstructor;
+ value?: PopupProps;
+ };
+ swatchColors?: {
+ type: ArrayConstructor;
+ value?: Array | null;
+ };
+ type?: {
+ type: StringConstructor;
+ value?: TypeEnum;
+ };
+ usePopup?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ defaultValue?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export declare type TypeEnum = 'base' | 'multiple';
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/type.js b/miniprogram_npm/tdesign-miniprogram/color-picker/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/color-picker/utils.d.ts
new file mode 100644
index 0000000..c985ed7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/utils.d.ts
@@ -0,0 +1 @@
+export * from '../common/shared/color-picker/index';
diff --git a/miniprogram_npm/tdesign-miniprogram/color-picker/utils.js b/miniprogram_npm/tdesign-miniprogram/color-picker/utils.js
new file mode 100644
index 0000000..c985ed7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/color-picker/utils.js
@@ -0,0 +1 @@
+export * from '../common/shared/color-picker/index';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/bus.d.ts b/miniprogram_npm/tdesign-miniprogram/common/bus.d.ts
new file mode 100644
index 0000000..fddbb54
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/bus.d.ts
@@ -0,0 +1,7 @@
+export default class Bus {
+ listeners: Map;
+ emitted: Set;
+ constructor();
+ on(evtName: string, listener: any): void;
+ emit(evtName: string): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/bus.js b/miniprogram_npm/tdesign-miniprogram/common/bus.js
new file mode 100644
index 0000000..5a6c889
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/bus.js
@@ -0,0 +1,22 @@
+export default class Bus {
+ constructor() {
+ this.listeners = new Map();
+ this.emitted = new Set();
+ }
+ on(evtName, listener) {
+ if (this.emitted.has(evtName)) {
+ listener();
+ return;
+ }
+ const target = this.listeners.get(evtName) || [];
+ target.push(listener);
+ this.listeners.set(evtName, target);
+ }
+ emit(evtName) {
+ const listeners = this.listeners.get(evtName);
+ if (listeners) {
+ listeners.forEach((func) => func());
+ }
+ this.emitted.add(evtName);
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/common.d.ts b/miniprogram_npm/tdesign-miniprogram/common/common.d.ts
new file mode 100644
index 0000000..12f8f81
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/common.d.ts
@@ -0,0 +1,56 @@
+export declare type Classes = Array;
+export interface Styles {
+ [css: string]: string | number;
+}
+export declare type ImageEvent = any;
+export declare type PlainObject = {
+ [key: string]: any;
+};
+export declare type OptionData = {
+ label?: string;
+ value?: string | number;
+} & PlainObject;
+export declare type TreeOptionData = {
+ children?: Array> | boolean;
+ label?: string;
+ text?: string;
+ value?: T;
+ content?: string;
+} & PlainObject;
+export declare type SizeEnum = 'small' | 'medium' | 'large';
+export declare type ShapeEnum = 'circle' | 'round';
+export declare type HorizontalAlignEnum = 'left' | 'center' | 'right';
+export declare type VerticalAlignEnum = 'top' | 'middle' | 'bottom';
+export declare type LayoutEnum = 'vertical' | 'horizontal';
+export declare type ClassName = {
+ [className: string]: any;
+} | ClassName[] | string;
+export declare type CSSSelector = string;
+export interface KeysType {
+ value?: string;
+ label?: string;
+ disabled?: string;
+}
+export interface TreeKeysType extends KeysType {
+ children?: string;
+}
+export interface HTMLElementAttributes {
+ [attribute: string]: string;
+}
+export interface TScroll {
+ bufferSize?: number;
+ isFixedRowHeight?: boolean;
+ rowHeight?: number;
+ threshold?: number;
+ type: 'lazy' | 'virtual';
+}
+export declare type InfinityScroll = TScroll;
+export interface ScrollToElementParams {
+ index?: number;
+ top?: number;
+ time?: number;
+ behavior?: 'auto' | 'smooth';
+}
+export interface ComponentScrollToElementParams extends ScrollToElementParams {
+ key?: string | number;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/common.js b/miniprogram_npm/tdesign-miniprogram/common/common.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/common.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/component.d.ts b/miniprogram_npm/tdesign-miniprogram/common/component.d.ts
new file mode 100644
index 0000000..a8d86ae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/component.d.ts
@@ -0,0 +1,3 @@
+///
+declare const TComponent: typeof Component;
+export default TComponent;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/component.js b/miniprogram_npm/tdesign-miniprogram/common/component.js
new file mode 100644
index 0000000..4e01a69
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/component.js
@@ -0,0 +1,5 @@
+const TComponent = (options) => {
+ options.options = Object.assign({ multipleSlots: true, addGlobalClass: true }, options.options);
+ return Component(options);
+};
+export default TComponent;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/config.d.ts b/miniprogram_npm/tdesign-miniprogram/common/config.d.ts
new file mode 100644
index 0000000..68879b4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/config.d.ts
@@ -0,0 +1,5 @@
+declare const _default: {
+ prefix: string;
+};
+export default _default;
+export declare const prefix = "t";
diff --git a/miniprogram_npm/tdesign-miniprogram/common/config.js b/miniprogram_npm/tdesign-miniprogram/common/config.js
new file mode 100644
index 0000000..c0dfab2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/config.js
@@ -0,0 +1,4 @@
+export default {
+ prefix: "t",
+};
+export const prefix = "t";
diff --git a/miniprogram_npm/tdesign-miniprogram/common/index.wxss b/miniprogram_npm/tdesign-miniprogram/common/index.wxss
new file mode 100644
index 0000000..1d532d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/index.wxss
@@ -0,0 +1,27 @@
+.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);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts
new file mode 100644
index 0000000..d9336de
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts
@@ -0,0 +1,19 @@
+import type { TDate, TCalendarType, TCalendarValue } from './type';
+export default class TCalendar {
+ firstDayOfWeek: number;
+ value: TCalendarValue | TCalendarValue[];
+ type: TCalendarType;
+ minDate: Date;
+ maxDate: Date;
+ format: (day: TDate) => TDate;
+ constructor(options?: {});
+ getTrimValue(): Date | Date[];
+ getDays(weekdays: string[]): any[];
+ getMonths(): any[];
+ select({ cellType, year, month, date }: {
+ cellType: any;
+ year: any;
+ month: any;
+ date: any;
+ }): Date | TCalendarValue[];
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js
new file mode 100644
index 0000000..62fda1f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js
@@ -0,0 +1,127 @@
+import { getDateRect, isSameDate, getMonthDateRect, isValidDate, getDate } from '../date';
+export default class TCalendar {
+ constructor(options = {}) {
+ this.type = 'single';
+ Object.assign(this, options);
+ if (!this.minDate)
+ this.minDate = getDate();
+ if (!this.maxDate)
+ this.maxDate = getDate(6);
+ }
+ getTrimValue() {
+ const { value, type } = this;
+ const format = (val) => {
+ if (val instanceof Date)
+ return val;
+ if (typeof val === 'number')
+ return new Date(val);
+ return new Date();
+ };
+ if (type === 'single' && isValidDate(value))
+ return format(value);
+ if (type === 'multiple' || type === 'range') {
+ if (Array.isArray(value)) {
+ const isValid = value.every((item) => isValidDate(item));
+ return isValid ? value.map((item) => format(item)) : [];
+ }
+ return [];
+ }
+ }
+ getDays(weekdays) {
+ const ans = [];
+ let i = this.firstDayOfWeek % 7;
+ while (ans.length < 7) {
+ ans.push(weekdays[i]);
+ i = (i + 1) % 7;
+ }
+ return ans;
+ }
+ getMonths() {
+ const ans = [];
+ const selectedDate = this.getTrimValue();
+ const { minDate, maxDate, type, format } = this;
+ let { year: minYear, month: minMonth, time: minTime } = getDateRect(minDate);
+ const { year: maxYear, month: maxMonth, time: maxTime } = getDateRect(maxDate);
+ const calcType = (year, month, date) => {
+ const curDate = new Date(year, month, date, 23, 59, 59);
+ if (type === 'single' && selectedDate) {
+ if (isSameDate({ year, month, date }, selectedDate))
+ return 'selected';
+ }
+ if (type === 'multiple' && selectedDate) {
+ const hit = selectedDate.some((item) => isSameDate({ year, month, date }, item));
+ if (hit) {
+ return 'selected';
+ }
+ }
+ if (type === 'range' && selectedDate) {
+ if (Array.isArray(selectedDate)) {
+ const [startDate, endDate] = selectedDate;
+ if (startDate && isSameDate({ year, month, date }, startDate))
+ return 'start';
+ if (endDate && isSameDate({ year, month, date }, endDate))
+ return 'end';
+ if (startDate && endDate && curDate.getTime() > startDate.getTime() && curDate.getTime() < endDate.getTime())
+ return 'centre';
+ }
+ }
+ const minCurDate = new Date(year, month, date, 0, 0, 0);
+ if (curDate.getTime() < minTime || minCurDate.getTime() > maxTime) {
+ return 'disabled';
+ }
+ return '';
+ };
+ while (minYear < maxYear || (minYear === maxYear && minMonth <= maxMonth)) {
+ const target = getMonthDateRect(new Date(minYear, minMonth, 1));
+ const months = [];
+ for (let i = 1; i <= 31; i++) {
+ if (i > target.lastDate)
+ break;
+ const dateObj = {
+ date: new Date(minYear, minMonth, i),
+ day: i,
+ type: calcType(minYear, minMonth, i),
+ };
+ months.push(format ? format(dateObj) : dateObj);
+ }
+ ans.push({
+ year: minYear,
+ month: minMonth,
+ months,
+ weekdayOfFirstDay: target.weekdayOfFirstDay,
+ });
+ const curDate = getDateRect(new Date(minYear, minMonth + 1, 1));
+ minYear = curDate.year;
+ minMonth = curDate.month;
+ }
+ return ans;
+ }
+ select({ cellType, year, month, date }) {
+ const { type } = this;
+ const selectedDate = this.getTrimValue();
+ if (cellType === 'disabled')
+ return;
+ const selected = new Date(year, month, date);
+ this.value = selected;
+ if (type === 'range' && Array.isArray(selectedDate)) {
+ if (selectedDate.length === 1 && selected > selectedDate[0]) {
+ this.value = [selectedDate[0], selected];
+ }
+ else {
+ this.value = [selected];
+ }
+ }
+ else if (type === 'multiple' && Array.isArray(selectedDate)) {
+ const newVal = [...selectedDate];
+ const index = selectedDate.findIndex((item) => isSameDate(item, selected));
+ if (index > -1) {
+ newVal.splice(index, 1);
+ }
+ else {
+ newVal.push(selected);
+ }
+ this.value = newVal;
+ }
+ return this.value;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts
new file mode 100644
index 0000000..621b949
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts
@@ -0,0 +1,11 @@
+export interface TDate {
+ date: Date;
+ day: number;
+ type: TDateType;
+ className?: string;
+ prefix?: string;
+ suffix?: string;
+}
+export declare type TCalendarValue = number | Date;
+export declare type TDateType = 'selected' | 'disabled' | 'start' | 'centre' | 'end' | '';
+export declare type TCalendarType = 'single' | 'multiple' | 'range';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts
new file mode 100644
index 0000000..d0e92a8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts
@@ -0,0 +1,7 @@
+export declare const rgb2cmyk: (red: number, green: number, blue: number) => number[];
+export declare const cmyk2rgb: (cyan: number, magenta: number, yellow: number, black: number) => {
+ r: number;
+ g: number;
+ b: number;
+};
+export declare const cmykInputToColor: (input: string) => string;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/cmyk.js b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/cmyk.js
new file mode 100644
index 0000000..d6273be
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/cmyk.js
@@ -0,0 +1,57 @@
+export const rgb2cmyk = (red, green, blue) => {
+ let computedC = 0;
+ let computedM = 0;
+ let computedY = 0;
+ let computedK = 0;
+ const r = parseInt(`${red}`.replace(/\s/g, ''), 10);
+ const g = parseInt(`${green}`.replace(/\s/g, ''), 10);
+ const b = parseInt(`${blue}`.replace(/\s/g, ''), 10);
+ if (r === 0 && g === 0 && b === 0) {
+ computedK = 1;
+ return [0, 0, 0, 1];
+ }
+ computedC = 1 - r / 255;
+ computedM = 1 - g / 255;
+ computedY = 1 - b / 255;
+ const minCMY = Math.min(computedC, Math.min(computedM, computedY));
+ computedC = (computedC - minCMY) / (1 - minCMY);
+ computedM = (computedM - minCMY) / (1 - minCMY);
+ computedY = (computedY - minCMY) / (1 - minCMY);
+ computedK = minCMY;
+ return [computedC, computedM, computedY, computedK];
+};
+export const cmyk2rgb = (cyan, magenta, yellow, black) => {
+ let c = cyan / 100;
+ let m = magenta / 100;
+ let y = yellow / 100;
+ const k = black / 100;
+ c = c * (1 - k) + k;
+ m = m * (1 - k) + k;
+ y = y * (1 - k) + k;
+ let r = 1 - c;
+ let g = 1 - m;
+ let b = 1 - y;
+ r = Math.round(255 * r);
+ g = Math.round(255 * g);
+ b = Math.round(255 * b);
+ return {
+ r,
+ g,
+ b,
+ };
+};
+const REG_CMYK_STRING = /cmyk\((\d+%?),(\d+%?),(\d+%?),(\d+%?)\)/;
+const toNumber = (str) => Math.max(0, Math.min(255, parseInt(str, 10)));
+export const cmykInputToColor = (input) => {
+ if (/cmyk/i.test(input)) {
+ const str = input.replace(/\s/g, '');
+ const match = str.match(REG_CMYK_STRING);
+ const c = toNumber(match[1]);
+ const m = toNumber(match[2]);
+ const y = toNumber(match[3]);
+ const k = toNumber(match[4]);
+ const { r, g, b } = cmyk2rgb(c, m, y, k);
+ return `rgb(${r}, ${g}, ${b})`;
+ }
+ return input;
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/color.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/color.d.ts
new file mode 100644
index 0000000..49b30fa
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/color.d.ts
@@ -0,0 +1,107 @@
+import tinyColor from 'tinycolor2';
+import { GradientColors, GradientColorPoint } from './gradient';
+export interface ColorObject {
+ alpha: number;
+ css: string;
+ hex: string;
+ hex8: string;
+ hsl: string;
+ hsla: string;
+ hsv: string;
+ hsva: string;
+ rgb: string;
+ rgba: string;
+ saturation: number;
+ value: number;
+ isGradient: boolean;
+ linearGradient?: string;
+}
+interface ColorStates {
+ s: number;
+ v: number;
+ h: number;
+ a: number;
+}
+interface GradientStates {
+ colors: GradientColorPoint[];
+ degree: number;
+ selectedId: string;
+ css?: string;
+}
+export declare const gradientColors2string: (object: GradientColors) => string;
+export declare const getColorWithoutAlpha: (color: string) => string;
+export declare const genId: () => string;
+export declare const genGradientPoint: (left: number, color: string) => GradientColorPoint;
+export declare class Color {
+ states: ColorStates;
+ originColor: string;
+ isGradient: boolean;
+ gradientStates: GradientStates;
+ constructor(input: string);
+ update(input: string): void;
+ get saturation(): number;
+ set saturation(value: number);
+ get value(): number;
+ set value(value: number);
+ get hue(): number;
+ set hue(value: number);
+ get alpha(): number;
+ set alpha(value: number);
+ get rgb(): string;
+ get rgba(): string;
+ get hsv(): string;
+ get hsva(): string;
+ get hsl(): string;
+ get hsla(): string;
+ get hex(): string;
+ get hex8(): string;
+ get cmyk(): string;
+ get css(): string;
+ get linearGradient(): string;
+ get gradientColors(): GradientColorPoint[];
+ set gradientColors(colors: GradientColorPoint[]);
+ get gradientSelectedId(): string;
+ set gradientSelectedId(id: string);
+ get gradientDegree(): number;
+ set gradientDegree(degree: number);
+ get gradientSelectedPoint(): GradientColorPoint;
+ getFormatsColorMap(): {
+ HEX: string;
+ CMYK: string;
+ RGB: string;
+ RGBA: string;
+ HSL: string;
+ HSLA: string;
+ HSV: string;
+ HSVA: string;
+ CSS: string;
+ HEX8: string;
+ };
+ updateCurrentGradientColor(): false | this;
+ updateStates(input: string): void;
+ getRgba(): {
+ r: number;
+ g: number;
+ b: number;
+ a: number;
+ };
+ getCmyk(): {
+ c: number;
+ m: number;
+ y: number;
+ k: number;
+ };
+ getHsva(): tinyColor.ColorFormats.HSVA;
+ getHsla(): tinyColor.ColorFormats.HSLA;
+ equals(color: string): boolean;
+ static isValid(color: string): boolean;
+ static hsva2color(h: number, s: number, v: number, a: number): string;
+ static hsla2color(h: number, s: number, l: number, a: number): string;
+ static rgba2color(r: number, g: number, b: number, a: number): string;
+ static hex2color(hex: string, a: number): string;
+ static object2color(object: any, format: string): string;
+ static isGradientColor: (input: string) => boolean;
+ static compare: (color1: string, color2: string) => boolean;
+}
+export declare const getColorObject: (color: Color) => ColorObject;
+export default Color;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/color.js b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/color.js
new file mode 100644
index 0000000..847ec5b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/color.js
@@ -0,0 +1,334 @@
+import tinyColor from 'tinycolor2';
+import { cmykInputToColor, rgb2cmyk } from './cmyk';
+import { parseGradientString, isGradientColor } from './gradient';
+const mathRound = Math.round;
+const hsv2rgba = (states) => tinyColor(states).toRgb();
+const hsv2hsva = (states) => tinyColor(states).toHsv();
+const hsv2hsla = (states) => tinyColor(states).toHsl();
+export const gradientColors2string = (object) => {
+ const { points, degree } = object;
+ const colorsStop = points
+ .sort((pA, pB) => pA.left - pB.left)
+ .map((p) => `${p.color} ${Math.round(p.left * 100) / 100}%`);
+ return `linear-gradient(${degree}deg,${colorsStop.join(',')})`;
+};
+export const getColorWithoutAlpha = (color) => tinyColor(color).setAlpha(1).toHexString();
+export const genId = () => (1 + Math.random() * 4294967295).toString(16);
+export const genGradientPoint = (left, color) => ({
+ id: genId(),
+ left,
+ color,
+});
+export class Color {
+ constructor(input) {
+ this.states = {
+ s: 100,
+ v: 100,
+ h: 100,
+ a: 1,
+ };
+ this.gradientStates = {
+ colors: [],
+ degree: 0,
+ selectedId: null,
+ css: '',
+ };
+ this.update(input);
+ }
+ update(input) {
+ var _a, _b;
+ const gradientColors = parseGradientString(input);
+ if (this.isGradient && !gradientColors) {
+ const colorHsv = tinyColor(input).toHsv();
+ this.states = colorHsv;
+ this.updateCurrentGradientColor();
+ return;
+ }
+ this.originColor = input;
+ this.isGradient = false;
+ let colorInput = input;
+ if (gradientColors) {
+ this.isGradient = true;
+ const object = gradientColors;
+ const points = object.points.map((c) => genGradientPoint(c.left, c.color));
+ this.gradientStates = {
+ colors: points,
+ degree: object.degree,
+ selectedId: ((_a = points[0]) === null || _a === void 0 ? void 0 : _a.id) || null,
+ };
+ this.gradientStates.css = this.linearGradient;
+ colorInput = (_b = this.gradientSelectedPoint) === null || _b === void 0 ? void 0 : _b.color;
+ }
+ this.updateStates(colorInput);
+ }
+ get saturation() {
+ return this.states.s;
+ }
+ set saturation(value) {
+ this.states.s = Math.max(0, Math.min(100, value));
+ this.updateCurrentGradientColor();
+ }
+ get value() {
+ return this.states.v;
+ }
+ set value(value) {
+ this.states.v = Math.max(0, Math.min(100, value));
+ this.updateCurrentGradientColor();
+ }
+ get hue() {
+ return this.states.h;
+ }
+ set hue(value) {
+ this.states.h = Math.max(0, Math.min(360, value));
+ this.updateCurrentGradientColor();
+ }
+ get alpha() {
+ return this.states.a;
+ }
+ set alpha(value) {
+ this.states.a = Math.max(0, Math.min(1, Math.round(value * 100) / 100));
+ this.updateCurrentGradientColor();
+ }
+ get rgb() {
+ const { r, g, b } = hsv2rgba(this.states);
+ return `rgb(${mathRound(r)}, ${mathRound(g)}, ${mathRound(b)})`;
+ }
+ get rgba() {
+ const { r, g, b, a } = hsv2rgba(this.states);
+ return `rgba(${mathRound(r)}, ${mathRound(g)}, ${mathRound(b)}, ${a})`;
+ }
+ get hsv() {
+ const { h, s, v } = this.getHsva();
+ return `hsv(${h}, ${s}%, ${v}%)`;
+ }
+ get hsva() {
+ const { h, s, v, a } = this.getHsva();
+ return `hsva(${h}, ${s}%, ${v}%, ${a})`;
+ }
+ get hsl() {
+ const { h, s, l } = this.getHsla();
+ return `hsl(${h}, ${s}%, ${l}%)`;
+ }
+ get hsla() {
+ const { h, s, l, a } = this.getHsla();
+ return `hsla(${h}, ${s}%, ${l}%, ${a})`;
+ }
+ get hex() {
+ return tinyColor(this.states).toHexString();
+ }
+ get hex8() {
+ return tinyColor(this.states).toHex8String();
+ }
+ get cmyk() {
+ const { c, m, y, k } = this.getCmyk();
+ return `cmyk(${c}, ${m}, ${y}, ${k})`;
+ }
+ get css() {
+ if (this.isGradient) {
+ return this.linearGradient;
+ }
+ return this.rgba;
+ }
+ get linearGradient() {
+ const { gradientColors, gradientDegree } = this;
+ return gradientColors2string({
+ points: gradientColors,
+ degree: gradientDegree,
+ });
+ }
+ get gradientColors() {
+ return this.gradientStates.colors;
+ }
+ set gradientColors(colors) {
+ this.gradientStates.colors = colors;
+ this.gradientStates.css = this.linearGradient;
+ }
+ get gradientSelectedId() {
+ return this.gradientStates.selectedId;
+ }
+ set gradientSelectedId(id) {
+ var _a;
+ if (id === this.gradientSelectedId) {
+ return;
+ }
+ this.gradientStates.selectedId = id;
+ this.updateStates((_a = this.gradientSelectedPoint) === null || _a === void 0 ? void 0 : _a.color);
+ }
+ get gradientDegree() {
+ return this.gradientStates.degree;
+ }
+ set gradientDegree(degree) {
+ this.gradientStates.degree = Math.max(0, Math.min(360, degree));
+ this.gradientStates.css = this.linearGradient;
+ }
+ get gradientSelectedPoint() {
+ const { gradientColors, gradientSelectedId } = this;
+ return gradientColors.find((color) => color.id === gradientSelectedId);
+ }
+ getFormatsColorMap() {
+ return {
+ HEX: this.hex,
+ CMYK: this.cmyk,
+ RGB: this.rgb,
+ RGBA: this.rgba,
+ HSL: this.hsl,
+ HSLA: this.hsla,
+ HSV: this.hsv,
+ HSVA: this.hsva,
+ CSS: this.css,
+ HEX8: this.hex8,
+ };
+ }
+ updateCurrentGradientColor() {
+ const { isGradient, gradientColors, gradientSelectedId } = this;
+ const { length } = gradientColors;
+ const current = this.gradientSelectedPoint;
+ if (!isGradient || length === 0 || !current) {
+ return false;
+ }
+ const index = gradientColors.findIndex((color) => color.id === gradientSelectedId);
+ const newColor = Object.assign(Object.assign({}, current), { color: this.rgba });
+ gradientColors.splice(index, 1, newColor);
+ this.gradientColors = gradientColors.slice();
+ return this;
+ }
+ updateStates(input) {
+ const color = tinyColor(cmykInputToColor(input));
+ const hsva = color.toHsv();
+ this.states = hsva;
+ }
+ getRgba() {
+ const { r, g, b, a } = hsv2rgba(this.states);
+ return {
+ r: mathRound(r),
+ g: mathRound(g),
+ b: mathRound(b),
+ a,
+ };
+ }
+ getCmyk() {
+ const { r, g, b } = this.getRgba();
+ const [c, m, y, k] = rgb2cmyk(r, g, b);
+ return {
+ c: mathRound(c * 100),
+ m: mathRound(m * 100),
+ y: mathRound(y * 100),
+ k: mathRound(k * 100),
+ };
+ }
+ getHsva() {
+ let { h, s, v, a } = hsv2hsva(this.states);
+ h = mathRound(h);
+ s = mathRound(s * 100);
+ v = mathRound(v * 100);
+ a *= 1;
+ return {
+ h,
+ s,
+ v,
+ a,
+ };
+ }
+ getHsla() {
+ let { h, s, l, a } = hsv2hsla(this.states);
+ h = mathRound(h);
+ s = mathRound(s * 100);
+ l = mathRound(l * 100);
+ a *= 1;
+ return {
+ h,
+ s,
+ l,
+ a,
+ };
+ }
+ equals(color) {
+ return tinyColor.equals(this.rgba, color);
+ }
+ static isValid(color) {
+ if (parseGradientString(color)) {
+ return true;
+ }
+ return tinyColor(color).isValid();
+ }
+ static hsva2color(h, s, v, a) {
+ return tinyColor({
+ h,
+ s,
+ v,
+ a,
+ }).toHsvString();
+ }
+ static hsla2color(h, s, l, a) {
+ return tinyColor({
+ h,
+ s,
+ l,
+ a,
+ }).toHslString();
+ }
+ static rgba2color(r, g, b, a) {
+ return tinyColor({
+ r,
+ g,
+ b,
+ a,
+ }).toHsvString();
+ }
+ static hex2color(hex, a) {
+ const color = tinyColor(hex);
+ color.setAlpha(a);
+ return color.toHexString();
+ }
+ static object2color(object, format) {
+ if (format === 'CMYK') {
+ const { c, m, y, k } = object;
+ return `cmyk(${c}, ${m}, ${y}, ${k})`;
+ }
+ const color = tinyColor(object, {
+ format,
+ });
+ return color.toRgbString();
+ }
+}
+Color.isGradientColor = (input) => !!isGradientColor(input);
+Color.compare = (color1, color2) => {
+ const isGradientColor1 = Color.isGradientColor(color1);
+ const isGradientColor2 = Color.isGradientColor(color2);
+ if (isGradientColor1 && isGradientColor2) {
+ const gradientColor1 = gradientColors2string(parseGradientString(color1));
+ const gradientColor2 = gradientColors2string(parseGradientString(color2));
+ return gradientColor1 === gradientColor2;
+ }
+ if (!isGradientColor1 && !isGradientColor2) {
+ return tinyColor.equals(color1, color2);
+ }
+ return false;
+};
+const COLOR_OBJECT_OUTPUT_KEYS = [
+ 'alpha',
+ 'css',
+ 'hex',
+ 'hex8',
+ 'hsl',
+ 'hsla',
+ 'hsv',
+ 'hsva',
+ 'rgb',
+ 'rgba',
+ 'saturation',
+ 'value',
+ 'isGradient',
+];
+export const getColorObject = (color) => {
+ if (!color) {
+ return null;
+ }
+ const colorObject = Object.create(null);
+ COLOR_OBJECT_OUTPUT_KEYS.forEach((key) => (colorObject[key] = color[key]));
+ if (color.isGradient) {
+ colorObject.linearGradient = color.linearGradient;
+ }
+ return colorObject;
+};
+export default Color;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts
new file mode 100644
index 0000000..3f496b0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts
@@ -0,0 +1,12 @@
+export interface GradientColorPoint {
+ id?: string;
+ color?: string;
+ left?: number;
+}
+export interface GradientColors {
+ points: GradientColorPoint[];
+ degree: number;
+}
+export declare const isGradientColor: (input: string) => null | RegExpExecArray;
+export declare const parseGradientString: (input: string) => GradientColors | boolean;
+export default parseGradientString;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/gradient.js b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/gradient.js
new file mode 100644
index 0000000..18eacb2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/gradient.js
@@ -0,0 +1,119 @@
+import isString from 'lodash/isString';
+import isNull from 'lodash/isNull';
+import tinyColor from 'tinycolor2';
+const combineRegExp = (regexpList, flags) => {
+ let source = '';
+ for (let i = 0; i < regexpList.length; i++) {
+ if (isString(regexpList[i])) {
+ source += regexpList[i];
+ }
+ else {
+ source += regexpList[i].source;
+ }
+ }
+ return new RegExp(source, flags);
+};
+const generateRegExp = () => {
+ const searchFlags = 'gi';
+ const rAngle = /(?:[+-]?\d*\.?\d+)(?:deg|grad|rad|turn)/;
+ const rSideCornerCapture = /to\s+((?:(?:left|right|top|bottom)(?:\s+(?:top|bottom|left|right))?))/;
+ const rComma = /\s*,\s*/;
+ const rColorHex = /#(?:[a-f0-9]{6}|[a-f0-9]{3})/;
+ const rDigits3 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)/;
+ const rDigits4 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)/;
+ const rValue = /(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?/;
+ const rKeyword = /[_a-z-][_a-z0-9-]*/;
+ const rColor = combineRegExp(['(?:', rColorHex, '|', '(?:rgb|hsl)', rDigits3, '|', '(?:rgba|hsla)', rDigits4, '|', rKeyword, ')'], '');
+ const rColorStop = combineRegExp([rColor, '(?:\\s+', rValue, '(?:\\s+', rValue, ')?)?'], '');
+ const rColorStopList = combineRegExp(['(?:', rColorStop, rComma, ')*', rColorStop], '');
+ const rLineCapture = combineRegExp(['(?:(', rAngle, ')|', rSideCornerCapture, ')'], '');
+ const rGradientSearch = combineRegExp(['(?:(', rLineCapture, ')', rComma, ')?(', rColorStopList, ')'], searchFlags);
+ const rColorStopSearch = combineRegExp(['\\s*(', rColor, ')', '(?:\\s+', '(', rValue, '))?', '(?:', rComma, '\\s*)?'], searchFlags);
+ return {
+ gradientSearch: rGradientSearch,
+ colorStopSearch: rColorStopSearch,
+ };
+};
+const parseGradient = (regExpLib, input) => {
+ let result;
+ let matchColorStop;
+ let stopResult;
+ regExpLib.gradientSearch.lastIndex = 0;
+ const matchGradient = regExpLib.gradientSearch.exec(input);
+ if (!isNull(matchGradient)) {
+ result = {
+ original: matchGradient[0],
+ colorStopList: [],
+ };
+ if (matchGradient[1]) {
+ result.line = matchGradient[1];
+ }
+ if (matchGradient[2]) {
+ result.angle = matchGradient[2];
+ }
+ if (matchGradient[3]) {
+ result.sideCorner = matchGradient[3];
+ }
+ regExpLib.colorStopSearch.lastIndex = 0;
+ matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
+ while (!isNull(matchColorStop)) {
+ stopResult = {
+ color: matchColorStop[1],
+ };
+ if (matchColorStop[2]) {
+ stopResult.position = matchColorStop[2];
+ }
+ result.colorStopList.push(stopResult);
+ matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
+ }
+ }
+ return result;
+};
+const REGEXP_LIB = generateRegExp();
+const REG_GRADIENT = /.*gradient\s*\(((?:\([^)]*\)|[^)(]*)*)\)/gim;
+export const isGradientColor = (input) => {
+ REG_GRADIENT.lastIndex = 0;
+ return REG_GRADIENT.exec(input);
+};
+const sideCornerDegreeMap = {
+ top: 0,
+ right: 90,
+ bottom: 180,
+ left: 270,
+ 'top left': 225,
+ 'left top': 225,
+ 'top right': 135,
+ 'right top': 135,
+ 'bottom left': 315,
+ 'left bottom': 315,
+ 'bottom right': 45,
+ 'right bottom': 45,
+};
+export const parseGradientString = (input) => {
+ const match = isGradientColor(input);
+ if (!match) {
+ return false;
+ }
+ const gradientColors = {
+ points: [],
+ degree: 0,
+ };
+ const result = parseGradient(REGEXP_LIB, match[1]);
+ if (result.original.trim() !== match[1].trim()) {
+ return false;
+ }
+ const points = result.colorStopList.map(({ color, position }) => {
+ const point = Object.create(null);
+ point.color = tinyColor(color).toRgbString();
+ point.left = parseFloat(position);
+ return point;
+ });
+ gradientColors.points = points;
+ let degree = parseInt(result.angle, 10);
+ if (Number.isNaN(degree)) {
+ degree = sideCornerDegreeMap[result.sideCorner] || 90;
+ }
+ gradientColors.degree = degree;
+ return gradientColors;
+};
+export default parseGradientString;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/index.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/index.d.ts
new file mode 100644
index 0000000..ad18475
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/index.d.ts
@@ -0,0 +1,3 @@
+export * from './cmyk';
+export * from './color';
+export * from './gradient';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/index.js b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/index.js
new file mode 100644
index 0000000..ad18475
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/color-picker/index.js
@@ -0,0 +1,3 @@
+export * from './cmyk';
+export * from './color';
+export * from './gradient';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts
new file mode 100644
index 0000000..e123831
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts
@@ -0,0 +1,21 @@
+export declare type CompareDate = Date | number | {
+ year: number;
+ month: number;
+ date: number;
+};
+export declare const getDateRect: (date: Date | number) => {
+ year: number;
+ month: number;
+ date: number;
+ day: number;
+ time: number;
+};
+export declare const isSameDate: (date1: CompareDate, date2: CompareDate) => boolean;
+export declare const getMonthDateRect: (date: Date | number) => {
+ year: number;
+ month: number;
+ weekdayOfFirstDay: number;
+ lastDate: number;
+};
+export declare const isValidDate: (val: any) => boolean;
+export declare const getDate: (...args: any[]) => any;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/date.js b/miniprogram_npm/tdesign-miniprogram/common/shared/date.js
new file mode 100644
index 0000000..3ac46b3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/date.js
@@ -0,0 +1,41 @@
+export const getDateRect = (date) => {
+ const _date = new Date(date);
+ return {
+ year: _date.getFullYear(),
+ month: _date.getMonth(),
+ date: _date.getDate(),
+ day: _date.getDay(),
+ time: _date.getTime(),
+ };
+};
+export const isSameDate = (date1, date2) => {
+ if (date1 instanceof Date || typeof date1 === 'number')
+ date1 = getDateRect(date1);
+ if (date2 instanceof Date || typeof date2 === 'number')
+ date2 = getDateRect(date2);
+ const keys = ['year', 'month', 'date'];
+ return keys.every((key) => date1[key] === date2[key]);
+};
+export const getMonthDateRect = (date) => {
+ const { year, month } = getDateRect(date);
+ const firstDay = new Date(year, month, 1);
+ const weekdayOfFirstDay = firstDay.getDay();
+ const lastDate = new Date(+new Date(year, month + 1, 1) - 24 * 3600 * 1000).getDate();
+ return {
+ year,
+ month,
+ weekdayOfFirstDay,
+ lastDate,
+ };
+};
+export const isValidDate = (val) => typeof val === 'number' || val instanceof Date;
+export const getDate = (...args) => {
+ const now = new Date();
+ if (args.length === 0)
+ return now;
+ if (args.length === 1 && args[0] <= 1000) {
+ const { year, month, date } = getDateRect(now);
+ return new Date(year, month + args[0], date);
+ }
+ return Date.apply(null, args);
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts
new file mode 100644
index 0000000..ed3f4a0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts
@@ -0,0 +1,15 @@
+declare type ControlInstance = {
+ controlled: boolean;
+ initValue: any;
+ set(newVal: any, extObj?: Object, fn?: any): void;
+ get(): any;
+ change(newVal: any, customChangeData?: any, customUpdateFn?: any): void;
+};
+declare type ControlOption = {
+ valueKey?: string;
+ defaultValueKey?: string;
+ changeEventName?: string;
+ strict?: boolean;
+};
+declare function useControl(this: any, option?: ControlOption): ControlInstance;
+export { ControlOption, ControlInstance, useControl };
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/control.js b/miniprogram_npm/tdesign-miniprogram/common/src/control.js
new file mode 100644
index 0000000..03c9e77
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/control.js
@@ -0,0 +1,40 @@
+const defaultOption = {
+ valueKey: 'value',
+ defaultValueKey: 'defaultValue',
+ changeEventName: 'change',
+ strict: true,
+};
+function useControl(option = {}) {
+ const { valueKey, defaultValueKey, changeEventName, strict } = Object.assign(Object.assign({}, defaultOption), option);
+ const props = this.properties || {};
+ const value = props[valueKey];
+ const defaultValue = props[strict ? defaultValueKey : valueKey];
+ let controlled = false;
+ if (strict && typeof value !== 'undefined' && value !== null) {
+ controlled = true;
+ }
+ const set = (newVal, extObj, fn) => {
+ this.setData(Object.assign({ [`_${valueKey}`]: newVal }, extObj), fn);
+ };
+ return {
+ controlled,
+ initValue: controlled ? value : defaultValue,
+ set,
+ get: () => {
+ return this.data[`_${valueKey}`];
+ },
+ change: (newVal, customChangeData, customUpdateFn) => {
+ this.triggerEvent(changeEventName, typeof customChangeData !== 'undefined' ? customChangeData : newVal);
+ if (controlled) {
+ return;
+ }
+ if (typeof customUpdateFn === 'function') {
+ customUpdateFn();
+ }
+ else {
+ set(newVal);
+ }
+ },
+ };
+}
+export { useControl };
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts
new file mode 100644
index 0000000..4183d79
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts
@@ -0,0 +1,15 @@
+export declare const getPrototypeOf: (obj: any) => any;
+export declare const isObject: (something: any) => boolean;
+export declare const iterateInheritedPrototype: (callback: (proto: Record) => boolean | void, fromCtor: any, toCtor: any, includeToCtor?: boolean) => void;
+export interface ClassInstanceToObjectOptions {
+ bindTo?: any;
+ excludes?: string[];
+ till?: any;
+ enumerable?: 0 | boolean;
+ configurable?: 0 | boolean;
+ writable?: 0 | boolean;
+}
+export declare const toObject: (something: any, options?: ClassInstanceToObjectOptions) => {
+ [key: string]: any;
+};
+export declare const isPlainObject: (something: any) => boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js
new file mode 100644
index 0000000..045abd7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js
@@ -0,0 +1,57 @@
+export const getPrototypeOf = function (obj) {
+ return Object.getPrototypeOf ? Object.getPrototypeOf(obj) : obj.__proto__;
+};
+export const isObject = function isObject(something) {
+ const type = typeof something;
+ return something !== null && (type === 'function' || type === 'object');
+};
+export const iterateInheritedPrototype = function iterateInheritedPrototype(callback, fromCtor, toCtor, includeToCtor = true) {
+ let proto = fromCtor.prototype || fromCtor;
+ const toProto = toCtor.prototype || toCtor;
+ while (proto) {
+ if (!includeToCtor && proto === toProto)
+ break;
+ if (callback(proto) === false)
+ break;
+ if (proto === toProto)
+ break;
+ proto = getPrototypeOf(proto);
+ }
+};
+export const toObject = function toObject(something, options = {}) {
+ const obj = {};
+ if (!isObject(something))
+ return obj;
+ const excludes = options.excludes || ['constructor'];
+ const { enumerable = true, configurable = 0, writable = 0 } = options;
+ const defaultDesc = {};
+ if (enumerable !== 0)
+ defaultDesc.enumerable = enumerable;
+ if (configurable !== 0)
+ defaultDesc.configurable = configurable;
+ if (writable !== 0)
+ defaultDesc.writable = writable;
+ iterateInheritedPrototype((proto) => {
+ Object.getOwnPropertyNames(proto).forEach((key) => {
+ if (excludes.indexOf(key) >= 0)
+ return;
+ if (Object.prototype.hasOwnProperty.call(obj, key))
+ return;
+ const desc = Object.getOwnPropertyDescriptor(proto, key);
+ const fnKeys = ['get', 'set', 'value'];
+ fnKeys.forEach((k) => {
+ if (typeof desc[k] === 'function') {
+ const oldFn = desc[k];
+ desc[k] = function (...args) {
+ return oldFn.apply(Object.prototype.hasOwnProperty.call(options, 'bindTo') ? options.bindTo : this, args);
+ };
+ }
+ });
+ Object.defineProperty(obj, key, Object.assign(Object.assign({}, desc), defaultDesc));
+ });
+ }, something, options.till || Object, false);
+ return obj;
+};
+export const isPlainObject = function isPlainObject(something) {
+ return Object.prototype.toString.call(something) === '[object Object]';
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts
new file mode 100644
index 0000000..94e7ce1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts
@@ -0,0 +1,4 @@
+export * from './superComponent';
+export * from './flatTool';
+export * from './instantiationDecorator';
+export * from './control';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/index.js b/miniprogram_npm/tdesign-miniprogram/common/src/index.js
new file mode 100644
index 0000000..94e7ce1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/index.js
@@ -0,0 +1,4 @@
+export * from './superComponent';
+export * from './flatTool';
+export * from './instantiationDecorator';
+export * from './control';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
new file mode 100644
index 0000000..3a06f2c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
@@ -0,0 +1,3 @@
+import { SuperComponent } from './superComponent';
+export declare const toComponent: (options: Record) => Record;
+export declare const wxComponent: () => (constructor: new () => SuperComponent) => void;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js
new file mode 100644
index 0000000..d9b15b7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js
@@ -0,0 +1,139 @@
+import { isPlainObject, toObject } from './flatTool';
+import { canUseVirtualHost } from '../version';
+const RawLifeCycles = ['Created', 'Attached', 'Ready', 'Moved', 'Detached', 'Error'];
+const NativeLifeCycles = RawLifeCycles.map((k) => k.toLowerCase());
+const ComponentNativeProps = [
+ 'properties',
+ 'data',
+ 'observers',
+ 'methods',
+ 'behaviors',
+ ...NativeLifeCycles,
+ 'relations',
+ 'externalClasses',
+ 'options',
+ 'lifetimes',
+ 'pageLifeTimes',
+ 'definitionFilter',
+];
+export const toComponent = function toComponent(options) {
+ const { relations, behaviors = [], externalClasses = [] } = options;
+ if (options.properties) {
+ Object.keys(options.properties).forEach((k) => {
+ let opt = options.properties[k];
+ if (!isPlainObject(opt)) {
+ opt = { type: opt };
+ }
+ options.properties[k] = opt;
+ });
+ const ariaProps = [
+ { key: 'ariaHidden', type: Boolean },
+ { key: 'ariaRole', type: String },
+ { key: 'ariaLabel', type: String },
+ { key: 'ariaLabelledby', type: String },
+ { key: 'ariaDescribedby', type: String },
+ { key: 'ariaBusy', type: Boolean },
+ ];
+ ariaProps.forEach(({ key, type }) => {
+ options.properties[key] = {
+ type,
+ };
+ });
+ options.properties.style = { type: String, value: '' };
+ options.properties.customStyle = { type: String, value: '' };
+ }
+ if (!options.methods)
+ options.methods = {};
+ if (!options.lifetimes)
+ options.lifetimes = {};
+ const inits = {};
+ if (relations) {
+ const getRelations = (relation, path) => Behavior({
+ created() {
+ Object.defineProperty(this, `$${relation}`, {
+ get: () => {
+ const nodes = this.getRelationNodes(path) || [];
+ return relation === 'parent' ? nodes[0] : nodes;
+ },
+ });
+ },
+ });
+ const map = {};
+ Object.keys(relations).forEach((path) => {
+ const comp = relations[path];
+ const relation = ['parent', 'ancestor'].includes(comp.type) ? 'parent' : 'children';
+ const mixin = getRelations(relation, path);
+ map[relation] = mixin;
+ });
+ behaviors.push(...Object.keys(map).map((key) => map[key]));
+ }
+ options.behaviors = [...behaviors];
+ options.externalClasses = ['class', ...externalClasses];
+ Object.getOwnPropertyNames(options).forEach((k) => {
+ const desc = Object.getOwnPropertyDescriptor(options, k);
+ if (!desc)
+ return;
+ if (NativeLifeCycles.indexOf(k) < 0 && typeof desc.value === 'function') {
+ Object.defineProperty(options.methods, k, desc);
+ delete options[k];
+ }
+ else if (ComponentNativeProps.indexOf(k) < 0) {
+ inits[k] = desc;
+ }
+ else if (NativeLifeCycles.indexOf(k) >= 0) {
+ options.lifetimes[k] = options[k];
+ }
+ });
+ if (Object.keys(inits).length) {
+ const oldCreated = options.lifetimes.created;
+ const oldAttached = options.lifetimes.attached;
+ const { controlledProps = [] } = options;
+ options.lifetimes.created = function (...args) {
+ Object.defineProperties(this, inits);
+ if (oldCreated)
+ oldCreated.apply(this, args);
+ };
+ options.lifetimes.attached = function (...args) {
+ if (oldAttached)
+ oldAttached.apply(this, args);
+ controlledProps.forEach(({ key }) => {
+ const defaultKey = `default${key.replace(/^(\w)/, (m, m1) => m1.toUpperCase())}`;
+ const props = this.properties;
+ if (props[key] == null) {
+ this._selfControlled = true;
+ }
+ if (props[key] == null && props[defaultKey] != null) {
+ this.setData({
+ [key]: props[defaultKey],
+ });
+ }
+ });
+ };
+ options.methods._trigger = function (evtName, detail, opts) {
+ const target = controlledProps.find((item) => item.event == evtName);
+ if (target) {
+ const { key } = target;
+ if (this._selfControlled) {
+ this.setData({
+ [key]: detail[key],
+ });
+ }
+ }
+ this.triggerEvent(evtName, detail, opts);
+ };
+ }
+ return options;
+};
+export const wxComponent = function wxComponent() {
+ return function (constructor) {
+ class WxComponent extends constructor {
+ }
+ const current = new WxComponent();
+ current.options = current.options || {};
+ if (canUseVirtualHost()) {
+ current.options.virtualHost = true;
+ }
+ const obj = toComponent(toObject(current));
+ Component(obj);
+ };
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts
new file mode 100644
index 0000000..4455e19
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts
@@ -0,0 +1,19 @@
+///
+export interface ComponentsOptionsType extends WechatMiniprogram.Component.ComponentOptions {
+ styleIsolation?: 'isolated' | 'apply-shared' | 'shared' | 'page-isolated' | 'page-apply-shared' | 'page-shared';
+}
+export interface RelationsOptions {
+ [componentName: string]: WechatMiniprogram.Component.RelationOption;
+}
+export interface SuperComponent extends WechatMiniprogram.Component.Lifetimes, WechatMiniprogram.Component.OtherOption, WechatMiniprogram.Component.InstanceMethods {
+ properties: P;
+ data: D;
+ options: ComponentsOptionsType;
+ methods: M | Record any>;
+ $global: Function;
+ [x: string]: any;
+}
+export declare class SuperComponent {
+ readonly app: any;
+ constructor();
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js
new file mode 100644
index 0000000..3cb17dc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js
@@ -0,0 +1,5 @@
+export class SuperComponent {
+ constructor() {
+ this.app = getApp();
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/_variables.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/_variables.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/base.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/base.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/icons.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/icons.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/index.wxss
new file mode 100644
index 0000000..1d532d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/index.wxss
@@ -0,0 +1,27 @@
+.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);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_clearfix.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_clearfix.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_cursor.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_cursor.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_hairline.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_hairline.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_index.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_components.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_components.wxss
new file mode 100644
index 0000000..6171d7a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_components.wxss
@@ -0,0 +1,17 @@
+@media (prefers-color-scheme: light) {
+ page,
+ .page {
+ --td-picker-transparent-color: rgba(255, 255, 255, 0);
+ }
+}
+@media (prefers-color-scheme: dark) {
+ page,
+ .page {
+ --td-button-primary-disabled-color: var(--td-font-white-4);
+ --td-skeleton-animation-gradient: rgba(255, 255, 255, 0.06);
+ --td-slider-dot-bg-color: var(--td-gray-color-4);
+ --td-slider-dot-disabled-bg-color: var(--td-gray-color-11);
+ --td-slider-dot-disabled-border-color: var(--td-gray-color-12);
+ --td-picker-transparent-color: transparent;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_dark.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_dark.wxss
new file mode 100644
index 0000000..33ec432
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_dark.wxss
@@ -0,0 +1,123 @@
+@media (prefers-color-scheme: dark) {
+ page,
+ .page {
+ --td-primary-color-1: #1b2f51;
+ --td-primary-color-2: #173463;
+ --td-primary-color-3: #143975;
+ --td-primary-color-4: #103d88;
+ --td-primary-color-5: #0d429a;
+ --td-primary-color-6: #054bbe;
+ --td-primary-color-7: #2667d4;
+ --td-primary-color-8: #4582e6;
+ --td-primary-color-9: #699ef5;
+ --td-primary-color-10: #96bbf8;
+ --td-warning-color-1: #4f2a1d;
+ --td-warning-color-2: #582f21;
+ --td-warning-color-3: #733c23;
+ --td-warning-color-4: #a75d2b;
+ --td-warning-color-5: #cf6e2d;
+ --td-warning-color-6: #dc7633;
+ --td-warning-color-7: #e8935c;
+ --td-warning-color-8: #ecbf91;
+ --td-warning-color-9: #eed7bf;
+ --td-warning-color-10: #f3e9dc;
+ --td-error-color-1: #472324;
+ --td-error-color-2: #5e2a2d;
+ --td-error-color-3: #703439;
+ --td-error-color-4: #83383e;
+ --td-error-color-5: #a03f46;
+ --td-error-color-6: #c64751;
+ --td-error-color-7: #de6670;
+ --td-error-color-8: #ec888e;
+ --td-error-color-9: #edb1b6;
+ --td-error-color-10: #eeced0;
+ --td-success-color-1: #193a2a;
+ --td-success-color-2: #1a4230;
+ --td-success-color-3: #17533d;
+ --td-success-color-4: #0d7a55;
+ --td-success-color-5: #059465;
+ --td-success-color-6: #43af8a;
+ --td-success-color-7: #46bf96;
+ --td-success-color-8: #80d2b6;
+ --td-success-color-9: #b4e1d3;
+ --td-success-color-10: #deede8;
+ --td-gray-color-1: #f3f3f3;
+ --td-gray-color-2: #eee;
+ --td-gray-color-3: #e8e8e8;
+ --td-gray-color-4: #ddd;
+ --td-gray-color-5: #c6c6c6;
+ --td-gray-color-6: #a6a6a6;
+ --td-gray-color-7: #8b8b8b;
+ --td-gray-color-8: #777;
+ --td-gray-color-9: #5e5e5e;
+ --td-gray-color-10: #4b4b4b;
+ --td-gray-color-11: #383838;
+ --td-gray-color-12: #2c2c2c;
+ --td-gray-color-13: #242424;
+ --td-gray-color-14: #181818;
+ --td-font-white-1: rgba(255, 255, 255, 0.9);
+ --td-font-white-2: rgba(255, 255, 255, 0.55);
+ --td-font-white-3: rgba(255, 255, 255, 0.35);
+ --td-font-white-4: rgba(255, 255, 255, 0.22);
+ --td-font-gray-1: rgba(0, 0, 0, 0.9);
+ --td-font-gray-2: rgba(0, 0, 0, 0.6);
+ --td-font-gray-3: rgba(0, 0, 0, 0.4);
+ --td-font-gray-4: rgba(0, 0, 0, 0.26);
+ --td-brand-color: var(--td-primary-color-8);
+ --td-warning-color: var(--td-warning-color-5);
+ --td-error-color: var(--td-error-color-6);
+ --td-success-color: var(--td-success-color-5);
+ --td-brand-color-focus: var(--td-primary-color-1);
+ --td-brand-color-active: var(--td-primary-color-9);
+ --td-brand-color-disabled: var(--td-primary-color-3);
+ --td-brand-color-light: var(--td-primary-color-1);
+ --td-brand-color-light-active: var(--td-primary-color-2);
+ --td-warning-color-focus: var(--td-warning-color-2);
+ --td-warning-color-active: var(--td-warning-color-4);
+ --td-warning-color-disabled: var(--td-warning-color-3);
+ --td-warning-color-light: var(--td-warning-color-1);
+ --td-warning-color-light-active: var(--td-warning-color-2);
+ --td-error-color-focus: var(--td-error-color-2);
+ --td-error-color-active: var(--td-error-color-5);
+ --td-error-color-disabled: var(--td-error-color-3);
+ --td-error-color-light: var(--td-error-color-1);
+ --td-error-color-light-active: var(--td-error-color-2);
+ --td-success-color-focus: var(--td-success-color-2);
+ --td-success-color-active: var(--td-success-color-4);
+ --td-success-color-disabled: var(--td-success-color-3);
+ --td-success-color-light: var(--td-success-color-1);
+ --td-success-color-light-active: var(--td-success-color-2);
+ --td-mask-active: rgba(0, 0, 0, 0.4);
+ --td-mask-disabled: rgba(0, 0, 0, 0.6);
+ --td-bg-color-page: var(--td-gray-color-14);
+ --td-bg-color-container: var(--td-gray-color-13);
+ --td-bg-color-secondarycontainer: var(--td-gray-color-12);
+ --td-bg-color-component: var(--td-gray-color-11);
+ --td-bg-color-container-active: var(--td-gray-color-12);
+ --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
+ --td-bg-color-component-active: var(--td-gray-color-10);
+ --td-bg-color-component-disabled: var(--td-gray-color-12);
+ --td-bg-color-specialcomponent: transparent;
+ --td-text-color-primary: var(--td-font-white-1);
+ --td-text-color-secondary: var(--td-font-white-2);
+ --td-text-color-placeholder: var(--td-font-white-3);
+ --td-text-color-disabled: var(--td-font-white-4);
+ --td-text-color-anti: var(--td-font-white-1);
+ --td-text-color-brand: var(--td-primary-color-8);
+ --td-text-color-link: var(--td-primary-color-8);
+ --td-border-level-1-color: var(--td-gray-color-11);
+ --td-component-stroke: var(--td-gray-color-11);
+ --td-border-level-2-color: var(--td-gray-color-9);
+ --td-component-border: var(--td-gray-color-9);
+ --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.12);
+ --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 0.12), 0 3px 14px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.16);
+ --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 0.14), 0 6px 30px rgba(0, 0, 0, 0.12), 0 8px 10px rgba(0, 0, 0, 0.2);
+ --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
+ --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
+ --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
+ --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
+ --td-table-shadow-color: rgba(0, 0, 0, 0.55);
+ --td-scrollbar-color: rgba(255, 255, 255, 0.1);
+ --td-scroll-track-color: #333;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_font.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_font.wxss
new file mode 100644
index 0000000..f0cf5a1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_font.wxss
@@ -0,0 +1,33 @@
+page,
+.page {
+ --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
+ --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
+ --td-font-size-link-small: 24rpx;
+ --td-font-size-link-medium: 28rpx;
+ --td-font-size-link-large: 32rpx;
+ --td-font-size-mark-extra-small: 20rpx;
+ --td-font-size-mark-small: 24rpx;
+ --td-font-size-mark-medium: 28rpx;
+ --td-font-size-mark-large: 32rpx;
+ --td-font-size-body-extra-small: 20rpx;
+ --td-font-size-body-small: 24rpx;
+ --td-font-size-body-medium: 28rpx;
+ --td-font-size-body-large: 32rpx;
+ --td-font-size-title-small: 28rpx;
+ --td-font-size-title-medium: 32rpx;
+ --td-font-size-title-large: 36rpx;
+ --td-font-size-title-extra-large: 40rpx;
+ --td-font-size-headline-small: 48rpx;
+ --td-font-size-headline-medium: 56rpx;
+ --td-font-size-headline-large: 72rpx;
+ --td-font-size-display-medium: 96rpx;
+ --td-font-size-display-large: 128rpx;
+ --td-font-size: 20rpx;
+ --td-font-size-xs: var(--td-font-size-body-extra-small);
+ --td-font-size-s: var(--td-font-size-body-small);
+ --td-font-size-base: var(--td-font-size-title-small);
+ --td-font-size-m: var(--td-font-size-title-medium);
+ --td-font-size-l: var(--td-font-size-title-large);
+ --td-font-size-xl: var(--td-font-size-title-extra-large);
+ --td-font-size-xxl: var(--td-font-size-headline-large);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss
new file mode 100644
index 0000000..33e32f1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss
@@ -0,0 +1,319 @@
+@media (prefers-color-scheme: light) {
+ page,
+ .page {
+ --td-primary-color-1: #f2f3ff;
+ --td-primary-color-2: #d9e1ff;
+ --td-primary-color-3: #b5c7ff;
+ --td-primary-color-4: #8eabff;
+ --td-primary-color-5: #618dff;
+ --td-primary-color-6: #366ef4;
+ --td-primary-color-7: #0052d9;
+ --td-primary-color-8: #003cab;
+ --td-primary-color-9: #002a7c;
+ --td-primary-color-10: #001a57;
+ --td-warning-color-1: #fff1e9;
+ --td-warning-color-2: #ffd9c2;
+ --td-warning-color-3: #ffb98c;
+ --td-warning-color-4: #fa9550;
+ --td-warning-color-5: #e37318;
+ --td-warning-color-6: #be5a00;
+ --td-warning-color-7: #954500;
+ --td-warning-color-8: #713300;
+ --td-warning-color-9: #532300;
+ --td-warning-color-10: #3b1700;
+ --td-error-color-1: #fff0ed;
+ --td-error-color-2: #ffd8d2;
+ --td-error-color-3: #ffb9b0;
+ --td-error-color-4: #ff9285;
+ --td-error-color-5: #f6685d;
+ --td-error-color-6: #d54941;
+ --td-error-color-7: #ad352f;
+ --td-error-color-8: #881f1c;
+ --td-error-color-9: #68070a;
+ --td-error-color-10: #490002;
+ --td-success-color-1: #e3f9e9;
+ --td-success-color-2: #c6f3d7;
+ --td-success-color-3: #92dab2;
+ --td-success-color-4: #56c08d;
+ --td-success-color-5: #2ba471;
+ --td-success-color-6: #008858;
+ --td-success-color-7: #006c45;
+ --td-success-color-8: #005334;
+ --td-success-color-9: #003b23;
+ --td-success-color-10: #002515;
+ --td-gray-color-1: #f3f3f3;
+ --td-gray-color-2: #eeeeee;
+ --td-gray-color-3: #e7e7e7;
+ --td-gray-color-4: #dcdcdc;
+ --td-gray-color-5: #c5c5c5;
+ --td-gray-color-6: #a6a6a6;
+ --td-gray-color-7: #8b8b8b;
+ --td-gray-color-8: #777777;
+ --td-gray-color-9: #5e5e5e;
+ --td-gray-color-10: #4b4b4b;
+ --td-gray-color-11: #383838;
+ --td-gray-color-12: #2c2c2c;
+ --td-gray-color-13: #242424;
+ --td-gray-color-14: #181818;
+ --td-font-white-1: #ffffff;
+ --td-font-white-2: rgba(255, 255, 255, 0.55);
+ --td-font-white-3: rgba(255, 255, 255, 0.35);
+ --td-font-white-4: rgba(255, 255, 255, 0.22);
+ --td-font-gray-1: rgba(0, 0, 0, 0.9);
+ --td-font-gray-2: rgba(0, 0, 0, 0.6);
+ --td-font-gray-3: rgba(0, 0, 0, 0.4);
+ --td-font-gray-4: rgba(0, 0, 0, 0.26);
+ --td-brand-color: var(--td-primary-color-7);
+ --td-warning-color: var(--td-warning-color-5);
+ --td-error-color: var(--td-error-color-6);
+ --td-success-color: var(--td-success-color-5);
+ --td-brand-color-focus: var(--td-primary-color-1);
+ --td-brand-color-active: var(--td-primary-color-8);
+ --td-brand-color-disabled: var(--td-primary-color-3);
+ --td-brand-color-light: var(--td-primary-color-1);
+ --td-brand-color-light-active: var(--td-primary-color-2);
+ --td-warning-color-active: var(--td-warning-color-6);
+ --td-warning-color-disabled: var(--td-warning-color-3);
+ --td-warning-color-focus: var(--td-warning-color-2);
+ --td-warning-color-light: var(--td-warning-color-1);
+ --td-warning-color-light-active: var(--td-warning-color-2);
+ --td-error-color-focus: var(--td-error-color-2);
+ --td-error-color-active: var(--td-error-color-7);
+ --td-error-color-disabled: var(--td-error-color-3);
+ --td-error-color-light: var(--td-error-color-1);
+ --td-error-color-light-active: var(--td-error-color-2);
+ --td-success-color-focus: var(--td-success-color-2);
+ --td-success-color-active: var(--td-success-color-6);
+ --td-success-color-disabled: var(--td-success-color-3);
+ --td-success-color-light: var(--td-success-color-1);
+ --td-success-color-light-active: var(--td-success-color-2);
+ --td-mask-active: rgba(0, 0, 0, 0.6);
+ --td-mask-disabled: rgba(255, 255, 255, 0.6);
+ --td-bg-color-page: var(--td-gray-color-1);
+ --td-bg-color-container: var(--td-font-white-1);
+ --td-bg-color-container-active: var(--td-gray-color-3);
+ --td-bg-color-secondarycontainer: var(--td-gray-color-1);
+ --td-bg-color-secondarycontainer-active: var(--td-gray-color-4);
+ --td-bg-color-component: var(--td-gray-color-3);
+ --td-bg-color-component-active: var(--td-gray-color-6);
+ --td-bg-color-component-disabled: var(--td-gray-color-2);
+ --td-bg-color-secondarycomponent: var(--td-gray-color-4);
+ --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
+ --td-bg-color-specialcomponent: #fff;
+ --td-text-color-primary: var(--td-font-gray-1);
+ --td-text-color-secondary: var(--td-font-gray-2);
+ --td-text-color-placeholder: var(--td-font-gray-3);
+ --td-text-color-disabled: var(--td-font-gray-4);
+ --td-text-color-anti: var(--td-font-white-1);
+ --td-text-color-brand: var(--td-brand-color);
+ --td-text-color-link: var(--td-brand-color);
+ --td-border-level-1-color: var(--td-gray-color-3);
+ --td-component-stroke: var(--td-gray-color-3);
+ --td-border-level-2-color: var(--td-gray-color-4);
+ --td-component-border: var(--td-gray-color-4);
+ --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
+ --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06), 0 5px 5px -3px rgba(0, 0, 0, 0.1);
+ --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08);
+ --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
+ --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
+ --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
+ --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
+ --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
+ --td-table-shadow-color: rgba(0, 0, 0, 0.08);
+ --td-scrollbar-color: rgba(0, 0, 0, 0.1);
+ --td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
+ --td-scroll-track-color: #fff;
+ }
+}
+@media (prefers-color-scheme: dark) {
+ page,
+ .page {
+ --td-primary-color-1: #1b2f51;
+ --td-primary-color-2: #173463;
+ --td-primary-color-3: #143975;
+ --td-primary-color-4: #103d88;
+ --td-primary-color-5: #0d429a;
+ --td-primary-color-6: #054bbe;
+ --td-primary-color-7: #2667d4;
+ --td-primary-color-8: #4582e6;
+ --td-primary-color-9: #699ef5;
+ --td-primary-color-10: #96bbf8;
+ --td-warning-color-1: #4f2a1d;
+ --td-warning-color-2: #582f21;
+ --td-warning-color-3: #733c23;
+ --td-warning-color-4: #a75d2b;
+ --td-warning-color-5: #cf6e2d;
+ --td-warning-color-6: #dc7633;
+ --td-warning-color-7: #e8935c;
+ --td-warning-color-8: #ecbf91;
+ --td-warning-color-9: #eed7bf;
+ --td-warning-color-10: #f3e9dc;
+ --td-error-color-1: #472324;
+ --td-error-color-2: #5e2a2d;
+ --td-error-color-3: #703439;
+ --td-error-color-4: #83383e;
+ --td-error-color-5: #a03f46;
+ --td-error-color-6: #c64751;
+ --td-error-color-7: #de6670;
+ --td-error-color-8: #ec888e;
+ --td-error-color-9: #edb1b6;
+ --td-error-color-10: #eeced0;
+ --td-success-color-1: #193a2a;
+ --td-success-color-2: #1a4230;
+ --td-success-color-3: #17533d;
+ --td-success-color-4: #0d7a55;
+ --td-success-color-5: #059465;
+ --td-success-color-6: #43af8a;
+ --td-success-color-7: #46bf96;
+ --td-success-color-8: #80d2b6;
+ --td-success-color-9: #b4e1d3;
+ --td-success-color-10: #deede8;
+ --td-gray-color-1: #f3f3f3;
+ --td-gray-color-2: #eee;
+ --td-gray-color-3: #e8e8e8;
+ --td-gray-color-4: #ddd;
+ --td-gray-color-5: #c6c6c6;
+ --td-gray-color-6: #a6a6a6;
+ --td-gray-color-7: #8b8b8b;
+ --td-gray-color-8: #777;
+ --td-gray-color-9: #5e5e5e;
+ --td-gray-color-10: #4b4b4b;
+ --td-gray-color-11: #383838;
+ --td-gray-color-12: #2c2c2c;
+ --td-gray-color-13: #242424;
+ --td-gray-color-14: #181818;
+ --td-font-white-1: rgba(255, 255, 255, 0.9);
+ --td-font-white-2: rgba(255, 255, 255, 0.55);
+ --td-font-white-3: rgba(255, 255, 255, 0.35);
+ --td-font-white-4: rgba(255, 255, 255, 0.22);
+ --td-font-gray-1: rgba(0, 0, 0, 0.9);
+ --td-font-gray-2: rgba(0, 0, 0, 0.6);
+ --td-font-gray-3: rgba(0, 0, 0, 0.4);
+ --td-font-gray-4: rgba(0, 0, 0, 0.26);
+ --td-brand-color: var(--td-primary-color-8);
+ --td-warning-color: var(--td-warning-color-5);
+ --td-error-color: var(--td-error-color-6);
+ --td-success-color: var(--td-success-color-5);
+ --td-brand-color-focus: var(--td-primary-color-1);
+ --td-brand-color-active: var(--td-primary-color-9);
+ --td-brand-color-disabled: var(--td-primary-color-3);
+ --td-brand-color-light: var(--td-primary-color-1);
+ --td-brand-color-light-active: var(--td-primary-color-2);
+ --td-warning-color-focus: var(--td-warning-color-2);
+ --td-warning-color-active: var(--td-warning-color-4);
+ --td-warning-color-disabled: var(--td-warning-color-3);
+ --td-warning-color-light: var(--td-warning-color-1);
+ --td-warning-color-light-active: var(--td-warning-color-2);
+ --td-error-color-focus: var(--td-error-color-2);
+ --td-error-color-active: var(--td-error-color-5);
+ --td-error-color-disabled: var(--td-error-color-3);
+ --td-error-color-light: var(--td-error-color-1);
+ --td-error-color-light-active: var(--td-error-color-2);
+ --td-success-color-focus: var(--td-success-color-2);
+ --td-success-color-active: var(--td-success-color-4);
+ --td-success-color-disabled: var(--td-success-color-3);
+ --td-success-color-light: var(--td-success-color-1);
+ --td-success-color-light-active: var(--td-success-color-2);
+ --td-mask-active: rgba(0, 0, 0, 0.4);
+ --td-mask-disabled: rgba(0, 0, 0, 0.6);
+ --td-bg-color-page: var(--td-gray-color-14);
+ --td-bg-color-container: var(--td-gray-color-13);
+ --td-bg-color-secondarycontainer: var(--td-gray-color-12);
+ --td-bg-color-component: var(--td-gray-color-11);
+ --td-bg-color-container-active: var(--td-gray-color-12);
+ --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
+ --td-bg-color-component-active: var(--td-gray-color-10);
+ --td-bg-color-component-disabled: var(--td-gray-color-12);
+ --td-bg-color-specialcomponent: transparent;
+ --td-text-color-primary: var(--td-font-white-1);
+ --td-text-color-secondary: var(--td-font-white-2);
+ --td-text-color-placeholder: var(--td-font-white-3);
+ --td-text-color-disabled: var(--td-font-white-4);
+ --td-text-color-anti: var(--td-font-white-1);
+ --td-text-color-brand: var(--td-primary-color-8);
+ --td-text-color-link: var(--td-primary-color-8);
+ --td-border-level-1-color: var(--td-gray-color-11);
+ --td-component-stroke: var(--td-gray-color-11);
+ --td-border-level-2-color: var(--td-gray-color-9);
+ --td-component-border: var(--td-gray-color-9);
+ --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.12);
+ --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 0.12), 0 3px 14px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.16);
+ --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 0.14), 0 6px 30px rgba(0, 0, 0, 0.12), 0 8px 10px rgba(0, 0, 0, 0.2);
+ --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
+ --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
+ --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
+ --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
+ --td-table-shadow-color: rgba(0, 0, 0, 0.55);
+ --td-scrollbar-color: rgba(255, 255, 255, 0.1);
+ --td-scroll-track-color: #333;
+ }
+}
+page,
+.page {
+ --td-radius-small: 6rpx;
+ --td-radius-default: 12rpx;
+ --td-radius-large: 18rpx;
+ --td-radius-extra-large: 24rpx;
+ --td-radius-round: 999px;
+ --td-radius-circle: 50%;
+}
+page,
+.page {
+ --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
+ --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
+ --td-font-size-link-small: 24rpx;
+ --td-font-size-link-medium: 28rpx;
+ --td-font-size-link-large: 32rpx;
+ --td-font-size-mark-extra-small: 20rpx;
+ --td-font-size-mark-small: 24rpx;
+ --td-font-size-mark-medium: 28rpx;
+ --td-font-size-mark-large: 32rpx;
+ --td-font-size-body-extra-small: 20rpx;
+ --td-font-size-body-small: 24rpx;
+ --td-font-size-body-medium: 28rpx;
+ --td-font-size-body-large: 32rpx;
+ --td-font-size-title-small: 28rpx;
+ --td-font-size-title-medium: 32rpx;
+ --td-font-size-title-large: 36rpx;
+ --td-font-size-title-extra-large: 40rpx;
+ --td-font-size-headline-small: 48rpx;
+ --td-font-size-headline-medium: 56rpx;
+ --td-font-size-headline-large: 72rpx;
+ --td-font-size-display-medium: 96rpx;
+ --td-font-size-display-large: 128rpx;
+ --td-font-size: 20rpx;
+ --td-font-size-xs: var(--td-font-size-body-extra-small);
+ --td-font-size-s: var(--td-font-size-body-small);
+ --td-font-size-base: var(--td-font-size-title-small);
+ --td-font-size-m: var(--td-font-size-title-medium);
+ --td-font-size-l: var(--td-font-size-title-large);
+ --td-font-size-xl: var(--td-font-size-title-extra-large);
+ --td-font-size-xxl: var(--td-font-size-headline-large);
+}
+page,
+.page {
+ --td-spacer: 16rpx;
+ --td-spacer-1: 24rpx;
+ --td-spacer-2: 32rpx;
+ --td-spacer-3: 48rpx;
+ --td-spacer-4: 64rpx;
+ --td-spacer-5: 96rpx;
+ --td-spacer-6: 160rpx;
+}
+@media (prefers-color-scheme: light) {
+ page,
+ .page {
+ --td-picker-transparent-color: rgba(255, 255, 255, 0);
+ }
+}
+@media (prefers-color-scheme: dark) {
+ page,
+ .page {
+ --td-button-primary-disabled-color: var(--td-font-white-4);
+ --td-skeleton-animation-gradient: rgba(255, 255, 255, 0.06);
+ --td-slider-dot-bg-color: var(--td-gray-color-4);
+ --td-slider-dot-disabled-bg-color: var(--td-gray-color-11);
+ --td-slider-dot-disabled-border-color: var(--td-gray-color-12);
+ --td-picker-transparent-color: transparent;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_light.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_light.wxss
new file mode 100644
index 0000000..21e6cad
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_light.wxss
@@ -0,0 +1,127 @@
+@media (prefers-color-scheme: light) {
+ page,
+ .page {
+ --td-primary-color-1: #f2f3ff;
+ --td-primary-color-2: #d9e1ff;
+ --td-primary-color-3: #b5c7ff;
+ --td-primary-color-4: #8eabff;
+ --td-primary-color-5: #618dff;
+ --td-primary-color-6: #366ef4;
+ --td-primary-color-7: #0052d9;
+ --td-primary-color-8: #003cab;
+ --td-primary-color-9: #002a7c;
+ --td-primary-color-10: #001a57;
+ --td-warning-color-1: #fff1e9;
+ --td-warning-color-2: #ffd9c2;
+ --td-warning-color-3: #ffb98c;
+ --td-warning-color-4: #fa9550;
+ --td-warning-color-5: #e37318;
+ --td-warning-color-6: #be5a00;
+ --td-warning-color-7: #954500;
+ --td-warning-color-8: #713300;
+ --td-warning-color-9: #532300;
+ --td-warning-color-10: #3b1700;
+ --td-error-color-1: #fff0ed;
+ --td-error-color-2: #ffd8d2;
+ --td-error-color-3: #ffb9b0;
+ --td-error-color-4: #ff9285;
+ --td-error-color-5: #f6685d;
+ --td-error-color-6: #d54941;
+ --td-error-color-7: #ad352f;
+ --td-error-color-8: #881f1c;
+ --td-error-color-9: #68070a;
+ --td-error-color-10: #490002;
+ --td-success-color-1: #e3f9e9;
+ --td-success-color-2: #c6f3d7;
+ --td-success-color-3: #92dab2;
+ --td-success-color-4: #56c08d;
+ --td-success-color-5: #2ba471;
+ --td-success-color-6: #008858;
+ --td-success-color-7: #006c45;
+ --td-success-color-8: #005334;
+ --td-success-color-9: #003b23;
+ --td-success-color-10: #002515;
+ --td-gray-color-1: #f3f3f3;
+ --td-gray-color-2: #eeeeee;
+ --td-gray-color-3: #e7e7e7;
+ --td-gray-color-4: #dcdcdc;
+ --td-gray-color-5: #c5c5c5;
+ --td-gray-color-6: #a6a6a6;
+ --td-gray-color-7: #8b8b8b;
+ --td-gray-color-8: #777777;
+ --td-gray-color-9: #5e5e5e;
+ --td-gray-color-10: #4b4b4b;
+ --td-gray-color-11: #383838;
+ --td-gray-color-12: #2c2c2c;
+ --td-gray-color-13: #242424;
+ --td-gray-color-14: #181818;
+ --td-font-white-1: #ffffff;
+ --td-font-white-2: rgba(255, 255, 255, 0.55);
+ --td-font-white-3: rgba(255, 255, 255, 0.35);
+ --td-font-white-4: rgba(255, 255, 255, 0.22);
+ --td-font-gray-1: rgba(0, 0, 0, 0.9);
+ --td-font-gray-2: rgba(0, 0, 0, 0.6);
+ --td-font-gray-3: rgba(0, 0, 0, 0.4);
+ --td-font-gray-4: rgba(0, 0, 0, 0.26);
+ --td-brand-color: var(--td-primary-color-7);
+ --td-warning-color: var(--td-warning-color-5);
+ --td-error-color: var(--td-error-color-6);
+ --td-success-color: var(--td-success-color-5);
+ --td-brand-color-focus: var(--td-primary-color-1);
+ --td-brand-color-active: var(--td-primary-color-8);
+ --td-brand-color-disabled: var(--td-primary-color-3);
+ --td-brand-color-light: var(--td-primary-color-1);
+ --td-brand-color-light-active: var(--td-primary-color-2);
+ --td-warning-color-active: var(--td-warning-color-6);
+ --td-warning-color-disabled: var(--td-warning-color-3);
+ --td-warning-color-focus: var(--td-warning-color-2);
+ --td-warning-color-light: var(--td-warning-color-1);
+ --td-warning-color-light-active: var(--td-warning-color-2);
+ --td-error-color-focus: var(--td-error-color-2);
+ --td-error-color-active: var(--td-error-color-7);
+ --td-error-color-disabled: var(--td-error-color-3);
+ --td-error-color-light: var(--td-error-color-1);
+ --td-error-color-light-active: var(--td-error-color-2);
+ --td-success-color-focus: var(--td-success-color-2);
+ --td-success-color-active: var(--td-success-color-6);
+ --td-success-color-disabled: var(--td-success-color-3);
+ --td-success-color-light: var(--td-success-color-1);
+ --td-success-color-light-active: var(--td-success-color-2);
+ --td-mask-active: rgba(0, 0, 0, 0.6);
+ --td-mask-disabled: rgba(255, 255, 255, 0.6);
+ --td-bg-color-page: var(--td-gray-color-1);
+ --td-bg-color-container: var(--td-font-white-1);
+ --td-bg-color-container-active: var(--td-gray-color-3);
+ --td-bg-color-secondarycontainer: var(--td-gray-color-1);
+ --td-bg-color-secondarycontainer-active: var(--td-gray-color-4);
+ --td-bg-color-component: var(--td-gray-color-3);
+ --td-bg-color-component-active: var(--td-gray-color-6);
+ --td-bg-color-component-disabled: var(--td-gray-color-2);
+ --td-bg-color-secondarycomponent: var(--td-gray-color-4);
+ --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
+ --td-bg-color-specialcomponent: #fff;
+ --td-text-color-primary: var(--td-font-gray-1);
+ --td-text-color-secondary: var(--td-font-gray-2);
+ --td-text-color-placeholder: var(--td-font-gray-3);
+ --td-text-color-disabled: var(--td-font-gray-4);
+ --td-text-color-anti: var(--td-font-white-1);
+ --td-text-color-brand: var(--td-brand-color);
+ --td-text-color-link: var(--td-brand-color);
+ --td-border-level-1-color: var(--td-gray-color-3);
+ --td-component-stroke: var(--td-gray-color-3);
+ --td-border-level-2-color: var(--td-gray-color-4);
+ --td-component-border: var(--td-gray-color-4);
+ --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
+ --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06), 0 5px 5px -3px rgba(0, 0, 0, 0.1);
+ --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08);
+ --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
+ --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
+ --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
+ --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
+ --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
+ --td-table-shadow-color: rgba(0, 0, 0, 0.08);
+ --td-scrollbar-color: rgba(0, 0, 0, 0.1);
+ --td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
+ --td-scroll-track-color: #fff;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_radius.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_radius.wxss
new file mode 100644
index 0000000..d559d99
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_radius.wxss
@@ -0,0 +1,9 @@
+page,
+.page {
+ --td-radius-small: 6rpx;
+ --td-radius-default: 12rpx;
+ --td-radius-large: 18rpx;
+ --td-radius-extra-large: 24rpx;
+ --td-radius-round: 999px;
+ --td-radius-circle: 50%;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_spacer.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_spacer.wxss
new file mode 100644
index 0000000..bda90f9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_spacer.wxss
@@ -0,0 +1,10 @@
+page,
+.page {
+ --td-spacer: 16rpx;
+ --td-spacer-1: 24rpx;
+ --td-spacer-2: 32rpx;
+ --td-spacer-3: 48rpx;
+ --td-spacer-4: 64rpx;
+ --td-spacer-5: 96rpx;
+ --td-spacer-6: 160rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss
new file mode 100644
index 0000000..a04e7c5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss
@@ -0,0 +1,8 @@
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss
new file mode 100644
index 0000000..e88ef0e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss
@@ -0,0 +1,6 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss
new file mode 100644
index 0000000..1d532d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss
@@ -0,0 +1,27 @@
+.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);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml
new file mode 100644
index 0000000..a7607c7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml
@@ -0,0 +1,16 @@
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/button.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/button.wxml
new file mode 100644
index 0000000..ed8e8f2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/button.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml
new file mode 100644
index 0000000..0db675e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml
@@ -0,0 +1,14 @@
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/image.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/image.wxml
new file mode 100644
index 0000000..a47c5a4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/image.wxml
@@ -0,0 +1,21 @@
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/common/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/common/utils.d.ts
new file mode 100644
index 0000000..6639e87
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/utils.d.ts
@@ -0,0 +1,40 @@
+///
+///
+///
+export declare const systemInfo: WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
+export declare const appBaseInfo: WechatMiniprogram.AppBaseInfo | WechatMiniprogram.SystemInfo;
+export declare const deviceInfo: WechatMiniprogram.DeviceInfo | WechatMiniprogram.SystemInfo;
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
+export declare const throttle: (func: any, wait?: number, options?: any) => (...args: any[]) => void;
+export declare const classNames: (...args: any[]) => string;
+export declare const styles: (styleObj: any) => string;
+export declare const getAnimationFrame: (context: any, cb: Function) => any;
+export declare const getRect: (context: any, selector: string, needAll?: boolean) => Promise;
+export declare const isNumber: (value: any) => boolean;
+export declare const isNull: (value: any) => boolean;
+export declare const isUndefined: (value: any) => boolean;
+export declare const isDef: (value: any) => boolean;
+export declare const isIOS: () => boolean;
+export declare const addUnit: (value?: string | number) => string | undefined;
+export declare const getCharacterLength: (type: string, char: string | number, max?: number) => {
+ length: number;
+ characters: string;
+};
+export declare const chunk: (arr: any[], size: number) => any[][];
+export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
+export declare const unitConvert: (value: number | string | null | undefined) => number;
+export declare const setIcon: (iconName: any, icon: any, defaultIcon: any) => {
+ [x: string]: any;
+};
+export declare const isBool: (val: any) => boolean;
+export declare const isObject: (val: any) => boolean;
+export declare const isString: (val: any) => boolean;
+export declare const toCamel: (str: any) => any;
+export declare const getCurrentPage: () => T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject;
+export declare const uniqueFactory: (compName: any) => () => string;
+export declare const calcIcon: (icon: string | Record, defaultIcon?: string) => string | Record;
+export declare const isOverSize: (size: any, sizeLimit: any) => boolean;
+export declare const rpx2px: (rpx: any) => number;
+export declare const nextTick: () => Promise;
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/utils.js b/miniprogram_npm/tdesign-miniprogram/common/utils.js
new file mode 100644
index 0000000..2ae1bb5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/utils.js
@@ -0,0 +1,252 @@
+import { prefix } from './config';
+import { getWindowInfo, getAppBaseInfo, getDeviceInfo } from './wechat';
+export const systemInfo = getWindowInfo();
+export const appBaseInfo = getAppBaseInfo();
+export const deviceInfo = getDeviceInfo();
+export const debounce = function (func, wait = 500) {
+ let timerId;
+ return function (...rest) {
+ if (timerId) {
+ clearTimeout(timerId);
+ }
+ timerId = setTimeout(() => {
+ func.apply(this, rest);
+ }, wait);
+ };
+};
+export const throttle = (func, wait = 100, options = null) => {
+ let previous = 0;
+ let timerid = null;
+ if (!options) {
+ options = {
+ leading: true,
+ };
+ }
+ return function (...args) {
+ const now = Date.now();
+ if (!previous && !options.leading)
+ previous = now;
+ const remaining = wait - (now - previous);
+ const context = this;
+ if (remaining <= 0) {
+ if (timerid) {
+ clearTimeout(timerid);
+ timerid = null;
+ }
+ previous = now;
+ func.apply(context, args);
+ }
+ };
+};
+export const classNames = function (...args) {
+ const hasOwn = {}.hasOwnProperty;
+ const classes = [];
+ args.forEach((arg) => {
+ if (!arg)
+ return;
+ const argType = typeof arg;
+ if (argType === 'string' || argType === 'number') {
+ classes.push(arg);
+ }
+ else if (Array.isArray(arg) && arg.length) {
+ const inner = classNames(...arg);
+ if (inner) {
+ classes.push(inner);
+ }
+ }
+ else if (argType === 'object') {
+ for (const key in arg) {
+ if (hasOwn.call(arg, key) && arg[key]) {
+ classes.push(key);
+ }
+ }
+ }
+ });
+ return classes.join(' ');
+};
+export const styles = function (styleObj) {
+ return Object.keys(styleObj)
+ .map((styleKey) => `${styleKey}: ${styleObj[styleKey]}`)
+ .join('; ');
+};
+export const getAnimationFrame = function (context, cb) {
+ return context
+ .createSelectorQuery()
+ .selectViewport()
+ .boundingClientRect()
+ .exec(() => {
+ cb();
+ });
+};
+export const getRect = function (context, selector, needAll = false) {
+ return new Promise((resolve, reject) => {
+ context
+ .createSelectorQuery()[needAll ? 'selectAll' : 'select'](selector)
+ .boundingClientRect((rect) => {
+ if (rect) {
+ resolve(rect);
+ }
+ else {
+ reject(rect);
+ }
+ })
+ .exec();
+ });
+};
+export const isNumber = function (value) {
+ return /^\d+(\.\d+)?$/.test(value);
+};
+export const isNull = function (value) {
+ return value === null;
+};
+export const isUndefined = (value) => typeof value === 'undefined';
+export const isDef = function (value) {
+ return !isUndefined(value) && !isNull(value);
+};
+export const isIOS = function () {
+ var _a;
+ return !!(((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.system) === null || _a === void 0 ? void 0 : _a.toLowerCase().search('ios')) + 1);
+};
+export const addUnit = function (value) {
+ if (!isDef(value)) {
+ return undefined;
+ }
+ value = String(value);
+ return isNumber(value) ? `${value}px` : value;
+};
+export const getCharacterLength = (type, char, max) => {
+ const str = String(char !== null && char !== void 0 ? char : '');
+ if (str.length === 0) {
+ return {
+ length: 0,
+ characters: '',
+ };
+ }
+ if (type === 'maxcharacter') {
+ let len = 0;
+ for (let i = 0; i < str.length; i += 1) {
+ let currentStringLength = 0;
+ if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+ currentStringLength = 2;
+ }
+ else {
+ currentStringLength = 1;
+ }
+ if (len + currentStringLength > max) {
+ return {
+ length: len,
+ characters: str.slice(0, i),
+ };
+ }
+ len += currentStringLength;
+ }
+ return {
+ length: len,
+ characters: str,
+ };
+ }
+ else if (type === 'maxlength') {
+ const length = str.length > max ? max : str.length;
+ return {
+ length,
+ characters: str.slice(0, length),
+ };
+ }
+ return {
+ length: str.length,
+ characters: str,
+ };
+};
+export const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
+export const getInstance = function (context, selector) {
+ if (!context) {
+ const pages = getCurrentPages();
+ const page = pages[pages.length - 1];
+ context = page.$$basePage || page;
+ }
+ const instance = context ? context.selectComponent(selector) : null;
+ if (!instance) {
+ console.warn('未找到组件,请检查selector是否正确');
+ return null;
+ }
+ return instance;
+};
+export const unitConvert = (value) => {
+ var _a;
+ if (typeof value === 'string') {
+ if (value.includes('rpx')) {
+ return (parseInt(value, 10) * ((_a = systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.screenWidth) !== null && _a !== void 0 ? _a : 750)) / 750;
+ }
+ return parseInt(value, 10);
+ }
+ return value !== null && value !== void 0 ? value : 0;
+};
+export const setIcon = (iconName, icon, defaultIcon) => {
+ if (icon) {
+ if (typeof icon === 'string') {
+ return {
+ [`${iconName}Name`]: icon,
+ [`${iconName}Data`]: {},
+ };
+ }
+ else if (typeof icon === 'object') {
+ return {
+ [`${iconName}Name`]: '',
+ [`${iconName}Data`]: icon,
+ };
+ }
+ else {
+ return {
+ [`${iconName}Name`]: defaultIcon,
+ [`${iconName}Data`]: {},
+ };
+ }
+ }
+ return {
+ [`${iconName}Name`]: '',
+ [`${iconName}Data`]: {},
+ };
+};
+export const isBool = (val) => typeof val === 'boolean';
+export const isObject = (val) => typeof val === 'object' && val != null;
+export const isString = (val) => typeof val === 'string';
+export const toCamel = (str) => str.replace(/-(\w)/g, (match, m1) => m1.toUpperCase());
+export const getCurrentPage = function () {
+ const pages = getCurrentPages();
+ return pages[pages.length - 1];
+};
+export const uniqueFactory = (compName) => {
+ let number = 0;
+ return () => `${prefix}_${compName}_${number++}`;
+};
+export const calcIcon = (icon, defaultIcon) => {
+ if (icon && ((isBool(icon) && defaultIcon) || isString(icon))) {
+ return { name: isBool(icon) ? defaultIcon : icon };
+ }
+ if (isObject(icon)) {
+ return icon;
+ }
+ return null;
+};
+export const isOverSize = (size, sizeLimit) => {
+ var _a;
+ if (!sizeLimit)
+ return false;
+ const base = 1000;
+ const unitMap = {
+ B: 1,
+ KB: base,
+ MB: base * base,
+ GB: base * base * base,
+ };
+ const computedSize = typeof sizeLimit === 'number' ? sizeLimit * base : (sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.size) * unitMap[(_a = sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.unit) !== null && _a !== void 0 ? _a : 'KB'];
+ return size > computedSize;
+};
+export const rpx2px = (rpx) => Math.floor((systemInfo.windowWidth * rpx) / 750);
+export const nextTick = () => {
+ return new Promise((resolve) => {
+ wx.nextTick(() => {
+ resolve();
+ });
+ });
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/utils.wxs b/miniprogram_npm/tdesign-miniprogram/common/utils.wxs
new file mode 100644
index 0000000..10c7ade
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/utils.wxs
@@ -0,0 +1,144 @@
+/* utils */
+
+/**
+ * addUnit */
+// 为 css 添加单位
+function addUnit(value) {
+ // prettier-ignore
+ var REGEXP = getRegExp('^-?\d+(.\d+)?$');
+ if (value == null) {
+ return undefined;
+ }
+ return REGEXP.test('' + value) ? value + 'px' : value;
+}
+
+function isString(string) {
+ return string && string.constructor === 'String';
+}
+
+function isArray(array) {
+ return array && array.constructor === 'Array';
+}
+
+function isObject(obj) {
+ return obj && obj.constructor === 'Object';
+}
+
+var isNoEmptyObj = function (obj) {
+ return isObject(obj) && JSON.stringify(obj) !== '{}';
+};
+
+function includes(arr, value) {
+ if (!arr || !isArray(arr)) return false;
+
+ var i = 0;
+ var len = arr.length;
+
+ for (; i < len; i++) {
+ if (arr[i] === value) return true;
+ }
+ return false;
+}
+
+function cls(base, arr) {
+ var res = [base];
+ var i = 0;
+ for (var size = arr.length; i < size; i++) {
+ var item = arr[i];
+
+ if (item && item.constructor === 'Array') {
+ var key = arr[i][0];
+ var value = arr[i][1];
+
+ if (value) {
+ res.push(base + '--' + key);
+ }
+ } else if (typeof item === 'string' || typeof item === 'number') {
+ if (item) {
+ res.push(base + '--' + item);
+ }
+ }
+ }
+ return res.join(' ');
+}
+
+function getBadgeAriaLabel(options) {
+ var maxCount = options.maxCount || 99;
+ if (options.dot) {
+ return '有新的消息';
+ }
+ if (options.count === '...') {
+ return '有很多消息';
+ }
+ if (isNaN(options.count)) {
+ return options.count;
+ }
+ var str1 = '有' + maxCount + '+条消息';
+ var str2 = '有' + options.count + '条消息';
+ return Number(options.count) > maxCount ? str1 : str2;
+}
+
+function endsWith(str, endStr) {
+ return str.slice(-endStr.length) === endStr ? str : str + endStr;
+}
+
+function keys(obj) {
+ return JSON.stringify(obj)
+ .replace(getRegExp('{|}|"', 'g'), '')
+ .split(',')
+ .map(function (item) {
+ return item.split(':')[0];
+ });
+}
+
+function kebabCase(str) {
+ return str
+ .replace(getRegExp('[A-Z]', 'g'), function (ele) {
+ return '-' + ele;
+ })
+ .toLowerCase();
+}
+
+function _style(styles) {
+ if (isArray(styles)) {
+ return styles
+ .filter(function (item) {
+ return item != null && item !== '';
+ })
+ .map(function (item) {
+ return isArray(item) ? _style(item) : endsWith(item, ';');
+ })
+ .join(' ');
+ }
+
+ if (isObject(styles)) {
+ return keys(styles)
+ .filter(function (key) {
+ return styles[key] != null && styles[key] !== '';
+ })
+ .map(function (key) {
+ return [kebabCase(key), [styles[key]]].join(':');
+ })
+ .join(';');
+ }
+
+ return styles;
+}
+
+function isValidIconName(str) {
+ // prettier-ignore
+ return getRegExp('^[A-Za-z0-9\-]+$').test(str);
+}
+
+module.exports = {
+ addUnit: addUnit,
+ isString: isString,
+ isArray: isArray,
+ isObject: isObject,
+ isNoEmptyObj: isNoEmptyObj,
+ includes: includes,
+ cls: cls,
+ getBadgeAriaLabel: getBadgeAriaLabel,
+ _style: _style,
+ isValidIconName: isValidIconName,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/version.d.ts b/miniprogram_npm/tdesign-miniprogram/common/version.d.ts
new file mode 100644
index 0000000..21e0b9e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/version.d.ts
@@ -0,0 +1,4 @@
+export declare function compareVersion(v1: any, v2: any): 0 | 1 | -1;
+export declare function canIUseFormFieldButton(): boolean;
+export declare function canUseVirtualHost(): boolean;
+export declare function canUseProxyScrollView(): boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/version.js b/miniprogram_npm/tdesign-miniprogram/common/version.js
new file mode 100644
index 0000000..86a4521
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/version.js
@@ -0,0 +1,43 @@
+import { getAppBaseInfo } from './wechat';
+let systemInfo;
+function getSystemInfo() {
+ if (systemInfo == null) {
+ systemInfo = getAppBaseInfo();
+ }
+ return systemInfo;
+}
+export function compareVersion(v1, v2) {
+ v1 = v1.split('.');
+ v2 = v2.split('.');
+ const len = Math.max(v1.length, v2.length);
+ while (v1.length < len) {
+ v1.push('0');
+ }
+ while (v2.length < len) {
+ v2.push('0');
+ }
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i]);
+ const num2 = parseInt(v2[i]);
+ if (num1 > num2) {
+ return 1;
+ }
+ else if (num1 < num2) {
+ return -1;
+ }
+ }
+ return 0;
+}
+function judgeByVersion(version) {
+ const currentSDKVersion = getSystemInfo().SDKVersion;
+ return compareVersion(currentSDKVersion, version) >= 0;
+}
+export function canIUseFormFieldButton() {
+ return judgeByVersion('2.10.3');
+}
+export function canUseVirtualHost() {
+ return judgeByVersion('2.19.2');
+}
+export function canUseProxyScrollView() {
+ return judgeByVersion('2.19.2');
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/wechat.d.ts b/miniprogram_npm/tdesign-miniprogram/common/wechat.d.ts
new file mode 100644
index 0000000..db57069
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/wechat.d.ts
@@ -0,0 +1,4 @@
+export declare const getObserver: (context: any, selector: string) => Promise;
+export declare const getWindowInfo: () => WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
+export declare const getAppBaseInfo: () => WechatMiniprogram.SystemInfo | WechatMiniprogram.AppBaseInfo;
+export declare const getDeviceInfo: () => WechatMiniprogram.SystemInfo | WechatMiniprogram.DeviceInfo;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/wechat.js b/miniprogram_npm/tdesign-miniprogram/common/wechat.js
new file mode 100644
index 0000000..c776abf
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/wechat.js
@@ -0,0 +1,19 @@
+export const getObserver = (context, selector) => {
+ return new Promise((resolve, reject) => {
+ context
+ .createIntersectionObserver(context)
+ .relativeToViewport()
+ .observe(selector, (res) => {
+ resolve(res);
+ });
+ });
+};
+export const getWindowInfo = () => {
+ return wx.getWindowInfo ? wx.getWindowInfo() || wx.getSystemInfoSync() : wx.getSystemInfoSync();
+};
+export const getAppBaseInfo = () => {
+ return wx.getAppBaseInfo ? wx.getAppBaseInfo() || wx.getSystemInfoSync() : wx.getSystemInfoSync();
+};
+export const getDeviceInfo = () => {
+ return wx.getDeviceInfo ? wx.getDeviceInfo() || wx.getSystemInfoSync() : wx.getSystemInfoSync();
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/count-down/README.en-US.md
new file mode 100644
index 0000000..2938c3f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/README.en-US.md
@@ -0,0 +1,43 @@
+:: BASE_DOC ::
+
+## API
+
+### CountDown 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
+auto-start | Boolean | true | \- | N
+content | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+format | String | HH:mm:ss | \- | N
+millisecond | Boolean | false | \- | N
+size | String | 'medium' | `0.5.1`。options: small/medium/large | N
+split-with-unit | Boolean | false | `0.5.1` | N
+theme | String | 'default' | `0.5.1`。options: default/round/square | N
+time | Number | 0 | required | Y
+
+### CountDown Events
+
+name | params | description
+-- | -- | --
+change | `(time: TimeData)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/count-down/type.ts)。
`interface TimeData { days: number; hours: number; minutes: number; seconds: number; milliseconds: number }`
+finish | \- | \-
+### CountDown External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-count | \-
+t-class-split | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-countdown-bg-color | @error-color | -
+--td-countdown-default-color | @text-color-primary | -
+--td-countdown-round-border-radius | @radius-circle | -
+--td-countdown-round-color | @text-color-anti | -
+--td-countdown-square-border-radius | @radius-small | -
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/README.md b/miniprogram_npm/tdesign-miniprogram/count-down/README.md
new file mode 100644
index 0000000..0ced81e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/README.md
@@ -0,0 +1,79 @@
+---
+title: CountDown 倒计时
+description: 用于实时展示倒计时数值。
+spline: data
+isComponent: true
+---
+
+


+
+> CountDown 组件用于实时展示倒计时数值。
+如果需要与站点演示一致的数字字体效果,推荐您到 数字字体章节,将 TCloudNumber 字体下载并将包含的 TCloudNumberVF.ttf 做为 TCloudNumber 字体资源引入到具体项目中使用。
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-count-down": "tdesign-miniprogram/count-down/count-down"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础倒计时
+
+{{ base }}
+
+### 调整尺寸
+
+{{ size }}
+
+## API
+
+### CountDown Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+auto-start | Boolean | true | 是否自动开始倒计时 | N
+content | String / Slot | 'default' | 最终倒计时的展示内容,值为'default'时使用默认的格式,否则使用自定义样式插槽。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+format | String | HH:mm:ss | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒 | N
+millisecond | Boolean | false | 是否开启毫秒级渲染 | N
+size | String | 'medium' | `0.5.1`。倒计时尺寸。可选项:small/medium/large | N
+split-with-unit | Boolean | false | `0.5.1`。使用时间单位分割 | N
+theme | String | 'default' | `0.5.1`。倒计时风格。可选项:default/round/square | N
+time | Number | 0 | 必需。倒计时时长,单位毫秒 | Y
+
+### CountDown Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(time: TimeData)` | 时间变化时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/count-down/type.ts)。
`interface TimeData { days: number; hours: number; minutes: number; seconds: number; milliseconds: number }`
+finish | \- | 倒计时结束时触发
+### CountDown External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-count | 计数样式类
+t-class-split | 分隔线样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-countdown-bg-color | @error-color | -
+--td-countdown-default-color | @text-color-primary | -
+--td-countdown-round-border-radius | @radius-circle | -
+--td-countdown-round-color | @text-color-anti | -
+--td-countdown-square-border-radius | @radius-small | -
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/count-down.d.ts b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.d.ts
new file mode 100644
index 0000000..60bd7f2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.d.ts
@@ -0,0 +1,33 @@
+import { SuperComponent } from '../common/src/index';
+export default class CountDown extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdCountDownProps;
+ observers: {
+ time(): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ timeDataUnit: {
+ DD: string;
+ HH: string;
+ mm: string;
+ ss: string;
+ SSS: string;
+ };
+ timeData: import("./utils").TimeData;
+ formattedTime: string;
+ };
+ timeoutId: null | number;
+ lifetimes: {
+ detached(): void;
+ };
+ methods: {
+ start(): void;
+ pause(): void;
+ reset(): void;
+ getTime(): number;
+ updateTime(remain: number): void;
+ doCount(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/count-down.js b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.js
new file mode 100644
index 0000000..3582cb4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.js
@@ -0,0 +1,100 @@
+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 { isSameSecond, parseFormat, parseTimeData, TimeDataUnit } from './utils';
+const { prefix } = config;
+const name = `${prefix}-count-down`;
+let CountDown = class CountDown extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-count`, `${prefix}-class-split`];
+ this.properties = props;
+ this.observers = {
+ time() {
+ this.reset();
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ timeDataUnit: TimeDataUnit,
+ timeData: parseTimeData(0),
+ formattedTime: '0',
+ };
+ this.timeoutId = null;
+ this.lifetimes = {
+ detached() {
+ if (this.timeoutId) {
+ clearTimeout(this.timeoutId);
+ this.timeoutId = null;
+ }
+ },
+ };
+ this.methods = {
+ start() {
+ if (this.counting) {
+ return;
+ }
+ this.counting = true;
+ this.endTime = Date.now() + this.remain;
+ this.doCount();
+ },
+ pause() {
+ this.counting = false;
+ this.timeoutId && clearTimeout(this.timeoutId);
+ },
+ reset() {
+ this.pause();
+ this.remain = this.properties.time;
+ this.updateTime(this.remain);
+ if (this.properties.autoStart) {
+ this.start();
+ }
+ },
+ getTime() {
+ return Math.max(this.endTime - Date.now(), 0);
+ },
+ updateTime(remain) {
+ const { format } = this.properties;
+ this.remain = remain;
+ const timeData = parseTimeData(remain);
+ this.triggerEvent('change', timeData);
+ const { timeText } = parseFormat(remain, format);
+ const timeRange = format.split(':');
+ this.setData({
+ timeRange,
+ timeData,
+ formattedTime: timeText.replace(/:/g, ' : '),
+ });
+ if (remain === 0) {
+ this.pause();
+ this.triggerEvent('finish');
+ }
+ },
+ doCount() {
+ this.timeoutId = setTimeout(() => {
+ const time = this.getTime();
+ if (this.properties.millisecond) {
+ this.updateTime(time);
+ }
+ else if (!isSameSecond(time, this.remain) || time === 0) {
+ this.updateTime(time);
+ }
+ if (time !== 0) {
+ this.doCount();
+ }
+ }, 33);
+ },
+ };
+ }
+};
+CountDown = __decorate([
+ wxComponent()
+], CountDown);
+export default CountDown;
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/count-down.json b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxml b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxml
new file mode 100644
index 0000000..f96b3ee
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxml
@@ -0,0 +1,22 @@
+
+ module.exports.format = function(num) { return num < 10 ? '0' + num : num; }
+
+
+
+
+ {{formattedTime}}
+
+
+ {{_this.format(timeData[timeRange[index]])}}
+ {{splitWithUnit ? timeDataUnit[timeRange[index]] : ':'}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxss b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxss
new file mode 100644
index 0000000..4775bf2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/count-down.wxss
@@ -0,0 +1,137 @@
+.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-count-down--small.t-count-down--default {
+ font-size: var(--td-font-size-base, 28rpx);
+}
+.t-count-down--small.t-count-down--round > .t-count-down__item {
+ font-size: var(--td-font-size-s, 24rpx);
+}
+.t-count-down--small.t-count-down--square > .t-count-down__item {
+ font-size: var(--td-font-size-s, 24rpx);
+}
+.t-count-down--small.t-count-down--round > .t-count-down__item,
+.t-count-down--small.t-count-down--square > .t-count-down__item {
+ width: 40rpx;
+ height: 40rpx;
+}
+.t-count-down--small.t-count-down--round > .t-count-down__split--dot,
+.t-count-down--small.t-count-down--square > .t-count-down__split--dot {
+ margin: 0 4rpx;
+ font-size: var(--td-font-size-base, 28rpx);
+ font-weight: 700;
+}
+.t-count-down--small.t-count-down--round > .t-count-down__split--text,
+.t-count-down--small.t-count-down--square > .t-count-down__split--text {
+ margin: 0 8rpx;
+ font-size: var(--td-font-size, 20rpx);
+}
+.t-count-down--medium.t-count-down--default {
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-count-down--medium.t-count-down--round > .t-count-down__item {
+ font-size: var(--td-font-size-base, 28rpx);
+}
+.t-count-down--medium.t-count-down--square > .t-count-down__item {
+ font-size: var(--td-font-size-base, 28rpx);
+}
+.t-count-down--medium.t-count-down--round > .t-count-down__item,
+.t-count-down--medium.t-count-down--square > .t-count-down__item {
+ width: 48rpx;
+ height: 48rpx;
+}
+.t-count-down--medium.t-count-down--round > .t-count-down__split--dot,
+.t-count-down--medium.t-count-down--square > .t-count-down__split--dot {
+ margin: 0 6rpx;
+ font-size: var(--td-font-size-m, 32rpx);
+ font-weight: 700;
+}
+.t-count-down--medium.t-count-down--round > .t-count-down__split--text,
+.t-count-down--medium.t-count-down--square > .t-count-down__split--text {
+ margin: 0 10rpx;
+ font-size: var(--td-font-size-s, 24rpx);
+}
+.t-count-down--large.t-count-down--default {
+ font-size: 36rpx;
+}
+.t-count-down--large.t-count-down--round > .t-count-down__item {
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-count-down--large.t-count-down--square > .t-count-down__item {
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-count-down--large.t-count-down--round > .t-count-down__item,
+.t-count-down--large.t-count-down--square > .t-count-down__item {
+ width: 56rpx;
+ height: 56rpx;
+}
+.t-count-down--large.t-count-down--round > .t-count-down__split--dot,
+.t-count-down--large.t-count-down--square > .t-count-down__split--dot {
+ margin: 0 12rpx;
+ font-size: 36rpx;
+ font-weight: 700;
+}
+.t-count-down--large.t-count-down--round > .t-count-down__split--text,
+.t-count-down--large.t-count-down--square > .t-count-down__split--text {
+ margin: 0 12rpx;
+ font-size: var(--td-font-size-base, 28rpx);
+}
+.t-count-down {
+ font-family: TCloudNumber, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Source Han Sans CN, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
+ display: flex;
+}
+.t-count-down .t-count-down__item,
+.t-count-down .t-count-down__split {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-count-down--square > .t-count-down__split--dot,
+.t-count-down--round > .t-count-down__split--dot {
+ color: var(--td-error-color, var(--td-error-color-6, #d54941));
+}
+.t-count-down--square > .t-count-down__split--text,
+.t-count-down--round > .t-count-down__split--text {
+ color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+}
+.t-count-down--default {
+ color: var(--td-countdown-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-count-down--square {
+ color: var(--td-countdown-round-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-count-down--square > .t-count-down__item {
+ border-radius: var(--td-countdown-square-border-radius, var(--td-radius-small, 6rpx));
+ background: var(--td-countdown-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-count-down--round {
+ color: var(--td-countdown-round-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-count-down--round > .t-count-down__item {
+ border-radius: var(--td-countdown-round-border-radius, var(--td-radius-circle, 50%));
+ background: var(--td-countdown-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/props.d.ts b/miniprogram_npm/tdesign-miniprogram/count-down/props.d.ts
new file mode 100644
index 0000000..8cab4af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCountDownProps } from './type';
+declare const props: TdCountDownProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/props.js b/miniprogram_npm/tdesign-miniprogram/count-down/props.js
new file mode 100644
index 0000000..3b67fea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/props.js
@@ -0,0 +1,36 @@
+const props = {
+ autoStart: {
+ type: Boolean,
+ value: true,
+ },
+ content: {
+ type: String,
+ value: 'default',
+ },
+ format: {
+ type: String,
+ value: 'HH:mm:ss',
+ },
+ millisecond: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ splitWithUnit: {
+ type: Boolean,
+ value: false,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ time: {
+ type: Number,
+ value: 0,
+ required: true,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/type.d.ts b/miniprogram_npm/tdesign-miniprogram/count-down/type.d.ts
new file mode 100644
index 0000000..2d362a6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/type.d.ts
@@ -0,0 +1,35 @@
+export interface TdCountDownProps {
+ autoStart?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ format?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ millisecond?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'small' | 'medium' | 'large';
+ };
+ splitWithUnit?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'round' | 'square';
+ };
+ time: {
+ type: NumberConstructor;
+ value?: number;
+ required?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/type.js b/miniprogram_npm/tdesign-miniprogram/count-down/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/count-down/utils.d.ts
new file mode 100644
index 0000000..18c1fac
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/utils.d.ts
@@ -0,0 +1,25 @@
+export interface TimeData {
+ DD: number;
+ HH: number;
+ mm: number;
+ ss: number;
+ SSS: number;
+}
+export declare const TimeDataUnit: {
+ DD: string;
+ HH: string;
+ mm: string;
+ ss: string;
+ SSS: string;
+};
+export declare const parseTimeData: (time: number) => TimeData;
+export declare const isSameSecond: (time1: number, time2: number) => boolean;
+export declare type TTimeList = {
+ digit: string;
+ unit: string;
+ match: string;
+}[];
+export declare const parseFormat: (time: number, format: string) => {
+ timeText: string;
+ timeList: TTimeList;
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/count-down/utils.js b/miniprogram_npm/tdesign-miniprogram/count-down/utils.js
new file mode 100644
index 0000000..4aa6dc3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/count-down/utils.js
@@ -0,0 +1,61 @@
+export const TimeDataUnit = {
+ DD: '天',
+ HH: '时',
+ mm: '分',
+ ss: '秒',
+ SSS: '毫秒',
+};
+const SECOND = 1000;
+const MINUTE = 60 * SECOND;
+const HOUR = 60 * MINUTE;
+const DAY = 24 * HOUR;
+export const parseTimeData = function (time) {
+ const days = Math.floor(time / DAY);
+ const hours = Math.floor((time % DAY) / HOUR);
+ const minutes = Math.floor((time % HOUR) / MINUTE);
+ const seconds = Math.floor((time % MINUTE) / SECOND);
+ const milliseconds = Math.floor(time % SECOND);
+ return {
+ DD: days,
+ HH: hours,
+ mm: minutes,
+ ss: seconds,
+ SSS: milliseconds,
+ };
+};
+export const isSameSecond = function (time1, time2) {
+ return Math.floor(time1 / 1000) === Math.floor(time2 / 1000);
+};
+export const parseFormat = function (time, format) {
+ const obj = {
+ 'D+': Math.floor(time / 86400000),
+ 'H+': Math.floor((time % 86400000) / 3600000),
+ 'm+': Math.floor((time % 3600000) / 60000),
+ 's+': Math.floor((time % 60000) / 1000),
+ 'S+': Math.floor(time % 1000),
+ };
+ const timeList = [];
+ let timeText = format;
+ Object.keys(obj).forEach((prop) => {
+ if (new RegExp(`(${prop})`).test(timeText)) {
+ timeText = timeText.replace(RegExp.$1, (match, offset, source) => {
+ const v = `${obj[prop]}`;
+ let digit = v;
+ if (match.length > 1) {
+ digit = (match.replace(new RegExp(match[0], 'g'), '0') + v).substr(v.length);
+ }
+ const unit = source.substr(offset + match.length);
+ const last = timeList[timeList.length - 1];
+ if (last) {
+ const index = last.unit.indexOf(match);
+ if (index !== -1) {
+ last.unit = last.unit.substr(0, index);
+ }
+ }
+ timeList.push({ digit, unit, match });
+ return digit;
+ });
+ }
+ });
+ return { timeText, timeList };
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/date-time-picker/README.en-US.md
new file mode 100644
index 0000000..5e74c6e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/README.en-US.md
@@ -0,0 +1,55 @@
+:: BASE_DOC ::
+
+## API
+
+### DateTimePicker 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
+auto-close | Boolean | false | \- | N
+cancel-btn | String | 取消 | \- | N
+confirm-btn | String | - | \- | N
+custom-locale | String | zh | \- | N
+end | String / Number | - | \- | N
+filter | Function | - | Typescript:`(type: TimeModeValues, columns: DateTimePickerColumn) => DateTimePickerColumn` `type DateTimePickerColumn = DateTimePickerColumnItem[]` `interface DateTimePickerColumnItem { label: string,value: string}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+footer | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+format | String | 'YYYY-MM-DD HH:mm:ss' | \- | N
+header | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+mode | String / Array | 'date' | Typescript:`DateTimePickerMode` `type DateTimePickerMode = TimeModeValues \| Array ` `type TimeModeValues = 'year' \| 'month' \| 'date' \| 'hour' \| 'minute' \| 'second'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+popup-props | Object | {} | popup properties。Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+show-week | Boolean | false | \- | N
+start | String / Number | - | \- | N
+steps | Object | - | \- | N
+title | String | - | title of picker | N
+use-popup | Boolean | true | \- | N
+value | String / Number | - | Typescript:`DateValue` `type DateValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+default-value | String / Number | undefined | uncontrolled property。Typescript:`DateValue` `type DateValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+visible | Boolean | false | \- | N
+
+### DateTimePicker Events
+
+name | params | description
+-- | -- | --
+cancel | \- | \-
+change | `(value: DateValue)` | \-
+close | `(trigger: TriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
+confirm | `(value: DateValue)` | `1.0.1`
+pick | `(value: DateValue)` | \-
+
+### DateTimePicker External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-cancel | \-
+t-class-confirm | \-
+t-class-title | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-data-time-picker-year-width | 128rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/README.md b/miniprogram_npm/tdesign-miniprogram/date-time-picker/README.md
new file mode 100644
index 0000000..23e5752
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/README.md
@@ -0,0 +1,109 @@
+---
+title: DateTimePicker 时间选择器
+description: 用于选择一个时间点或者一个时间段。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+#### 年月日选择器
+
+{{ year-month-date }}
+
+#### 年月选择器
+
+{{ year-month }}
+
+### 时间选择器器
+
+包括:`时分秒`、`时分`两个示例
+
+{{ time }}
+
+#### 年月日时分秒选择器
+
+{{ date-all }}
+
+### 组件用法
+
+#### 调整步数
+
+{{ steps }}
+
+#### 不使用 Popup
+
+{{ without-popup }}
+
+## API
+
+### DateTimePicker Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+auto-close | Boolean | false | 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible | N
+cancel-btn | String | 取消 | 取消按钮文字 | N
+confirm-btn | String | - | 确定按钮文字 | N
+custom-locale | String | zh | 组件国际化语言,目前支持: 简体中文(zh)、(tc)、英文(en)、日语(ja)、韩语(ko)、俄语(ru)等六种语言 | N
+end | String / Number | - | 选择器的最大可选时间,默认为当前时间+10年 | N
+filter | Function | - | 列选项过滤函数,支持自定义列内容。(type 值可为: year, month, date, hour, minute, second)。TS 类型:`(type: TimeModeValues, columns: DateTimePickerColumn) => DateTimePickerColumn` `type DateTimePickerColumn = DateTimePickerColumnItem[]` `interface DateTimePickerColumnItem { label: string,value: string}`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+footer | Slot | - | 底部内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+format | String | 'YYYY-MM-DD HH:mm:ss' | 用于格式化 pick、change、confirm 事件返回的值,[详细文档](https://day.js.org/docs/en/display/format) | N
+header | Boolean / Slot | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+mode | String / Array | 'date' | year = 年;month = 年月;date = 年月日;hour = 年月日时; minute = 年月日时分;当类型为数组时,第一个值控制年月日,第二个值控制时分秒。TS 类型:`DateTimePickerMode` `type DateTimePickerMode = TimeModeValues \| Array ` `type TimeModeValues = 'year' \| 'month' \| 'date' \| 'hour' \| 'minute' \| 'second'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+popup-props | Object | {} | 透传 `Popup` 组件全部属性。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+show-week | Boolean | false | 【开发中】是否在日期旁边显示周几(如周一,周二,周日等) | N
+start | String / Number | - | 选择器的最小可选时间,默认为当前时间-10年 | N
+steps | Object | - | 时间间隔步数,示例:`{ minute: 5 }` | N
+title | String | - | 标题 | N
+use-popup | Boolean | true | 是否使用弹出层包裹 | N
+value | String / Number | - | 选中值。TS 类型:`DateValue` `type DateValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+default-value | String / Number | undefined | 选中值。非受控属性。TS 类型:`DateValue` `type DateValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts) | N
+visible | Boolean | false | 是否显示 | N
+
+### DateTimePicker Events
+
+名称 | 参数 | 描述
+-- | -- | --
+cancel | \- | 取消按钮点击时触发
+change | `(value: DateValue)` | 确认按钮点击时触发
+close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
+confirm | `(value: DateValue)` | `1.0.1`。确认按钮点击时触发
+pick | `(value: DateValue)` | 选中值发生变化时触发
+
+### DateTimePicker External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-cancel | 取消样式类
+t-class-confirm | 确认样式类
+t-class-title | 标题样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-data-time-picker-year-width | 128rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.d.ts
new file mode 100644
index 0000000..6d4da9c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.d.ts
@@ -0,0 +1,75 @@
+import type { Dayjs } from 'dayjs';
+import { SuperComponent } from '../common/src/index';
+declare enum ModeItem {
+ YEAR = "year",
+ MONTH = "month",
+ DATE = "date",
+ HOUR = "hour",
+ MINUTE = "minute",
+ SECOND = "second"
+}
+interface ColumnItemValue {
+ value: string | number;
+ label: string | number;
+}
+export default class DateTimePicker extends SuperComponent {
+ properties: import("./type").TdDateTimePickerProps;
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ observers: {
+ 'start, end, value': () => void;
+ customLocale(v: any): void;
+ mode(m: any): void;
+ };
+ date: any;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ columns: any[];
+ columnsValue: any[];
+ fullModes: any[];
+ locale: any;
+ dayjsLocale: any;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ methods: {
+ updateColumns(): void;
+ getParseDate(): Dayjs;
+ getMinDate(): Dayjs;
+ getMaxDate(): Dayjs;
+ getDateRect(type?: string): any[];
+ getDate(): Dayjs;
+ clipDate(date: Dayjs): Dayjs;
+ setYear(date: Dayjs, year: number): Dayjs;
+ setMonth(date: Dayjs, month: number): Dayjs;
+ getColumnOptions(): any[];
+ getOptionByType(type: any): ColumnItemValue[];
+ getYearOptions(dateParams: any): ColumnItemValue[];
+ getOptionEdge(minOrMax: 'min' | 'max', type: any): any;
+ getMonthOptions(): ColumnItemValue[];
+ getDayOptions(): ColumnItemValue[];
+ getHourOptions(): ColumnItemValue[];
+ getMinuteOptions(): ColumnItemValue[];
+ getValueCols(this: DateTimePicker): {
+ columns: any;
+ columnsValue: any;
+ };
+ getColumnsValue(): string[];
+ getNewDate(value: number, type: ModeItem): Dayjs;
+ onColumnChange(e: WechatMiniprogram.CustomEvent): void;
+ onConfirm(): void;
+ onCancel(): void;
+ onVisibleChange(e: any): void;
+ onClose(e: any): void;
+ resetColumns(): void;
+ };
+ getFullModeArray(mode: any): any;
+ getFullModeByModeString(modeString: any, matchModes: any): any;
+ isTimeMode(): boolean;
+}
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.js
new file mode 100644
index 0000000..3a6f630
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.js
@@ -0,0 +1,369 @@
+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 _a, _b;
+import dayjs from 'dayjs';
+import localeData from 'dayjs/plugin/localeData';
+import config from '../common/config';
+import { SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+import dayjsLocaleMap from './locale/dayjs';
+dayjs.extend(localeData);
+dayjs.locale('zh-cn');
+const defaultLocale = ((_a = dayjsLocaleMap[dayjs.locale()]) === null || _a === void 0 ? void 0 : _a.key) || ((_b = dayjsLocaleMap.default) === null || _b === void 0 ? void 0 : _b.key);
+const { prefix } = config;
+const name = `${prefix}-date-time-picker`;
+var ModeItem;
+(function (ModeItem) {
+ ModeItem["YEAR"] = "year";
+ ModeItem["MONTH"] = "month";
+ ModeItem["DATE"] = "date";
+ ModeItem["HOUR"] = "hour";
+ ModeItem["MINUTE"] = "minute";
+ ModeItem["SECOND"] = "second";
+})(ModeItem || (ModeItem = {}));
+const DATE_MODES = ['year', 'month', 'date'];
+const TIME_MODES = ['hour', 'minute', 'second'];
+const FULL_MODES = [...DATE_MODES, ...TIME_MODES];
+const DEFAULT_MIN_DATE = dayjs('2000-01-01 00:00:00');
+const DEFAULT_MAX_DATE = dayjs('2030-12-31 23:59:59');
+let DateTimePicker = class DateTimePicker extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.properties = props;
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-confirm`, `${prefix}-class-cancel`, `${prefix}-class-title`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.observers = {
+ 'start, end, value': function () {
+ this.updateColumns();
+ },
+ customLocale(v) {
+ if (!v || !dayjsLocaleMap[v].key)
+ return;
+ this.setData({
+ locale: dayjsLocaleMap[v].i18n,
+ dayjsLocale: dayjsLocaleMap[v].key,
+ });
+ },
+ mode(m) {
+ const fullModes = this.getFullModeArray(m);
+ this.setData({
+ fullModes,
+ });
+ this.updateColumns();
+ },
+ };
+ this.date = null;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ columns: [],
+ columnsValue: [],
+ fullModes: [],
+ locale: dayjsLocaleMap[defaultLocale].i18n,
+ dayjsLocale: dayjsLocaleMap[defaultLocale].key,
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.methods = {
+ updateColumns() {
+ this.date = this.getParseDate();
+ const { columns, columnsValue } = this.getValueCols();
+ this.setData({
+ columns,
+ columnsValue,
+ });
+ },
+ getParseDate() {
+ const { value, defaultValue } = this.properties;
+ const minDate = this.getMinDate();
+ const isTimeMode = this.isTimeMode();
+ let currentValue = value || defaultValue;
+ if (isTimeMode) {
+ const dateStr = dayjs(minDate).format('YYYY-MM-DD');
+ currentValue = dayjs(`${dateStr} ${currentValue}`);
+ }
+ const parseDate = dayjs(currentValue || minDate);
+ const isDateValid = parseDate.isValid();
+ return isDateValid ? parseDate : minDate;
+ },
+ getMinDate() {
+ const { start } = this.properties;
+ return start ? dayjs(start) : DEFAULT_MIN_DATE;
+ },
+ getMaxDate() {
+ const { end } = this.properties;
+ return end ? dayjs(end) : DEFAULT_MAX_DATE;
+ },
+ getDateRect(type = 'default') {
+ const map = {
+ min: 'getMinDate',
+ max: 'getMaxDate',
+ default: 'getDate',
+ };
+ const date = this[map[type]]();
+ const keys = ['year', 'month', 'date', 'hour', 'minute', 'second'];
+ return keys.map((k) => { var _a; return (_a = date[k]) === null || _a === void 0 ? void 0 : _a.call(date); });
+ },
+ getDate() {
+ return this.clipDate((this === null || this === void 0 ? void 0 : this.date) || DEFAULT_MIN_DATE);
+ },
+ clipDate(date) {
+ const minDate = this.getMinDate();
+ const maxDate = this.getMaxDate();
+ return dayjs(Math.min(Math.max(minDate.valueOf(), date.valueOf()), maxDate.valueOf()));
+ },
+ setYear(date, year) {
+ const beforeMonthDays = date.date();
+ const afterMonthDays = date.year(year).daysInMonth();
+ const tempDate = date.date(Math.min(beforeMonthDays.valueOf(), afterMonthDays.valueOf()));
+ return tempDate.year(year);
+ },
+ setMonth(date, month) {
+ const beforeMonthDays = date.date();
+ const afterMonthDays = date.month(month).daysInMonth();
+ const tempDate = date.date(Math.min(beforeMonthDays.valueOf(), afterMonthDays.valueOf()));
+ return tempDate.month(month);
+ },
+ getColumnOptions() {
+ const { fullModes, filter } = this.data;
+ const columnOptions = [];
+ fullModes === null || fullModes === void 0 ? void 0 : fullModes.forEach((mode) => {
+ const columnOption = this.getOptionByType(mode);
+ if (typeof filter === 'function') {
+ columnOptions.push(filter(mode, columnOption));
+ }
+ else {
+ columnOptions.push(columnOption);
+ }
+ });
+ return columnOptions;
+ },
+ getOptionByType(type) {
+ var _a;
+ const { locale, steps } = this.data;
+ const options = [];
+ const minEdge = this.getOptionEdge('min', type);
+ const maxEdge = this.getOptionEdge('max', type);
+ const step = (_a = steps === null || steps === void 0 ? void 0 : steps[type]) !== null && _a !== void 0 ? _a : 1;
+ const dayjsMonthsShort = dayjs().locale(this.data.dayjsLocale).localeData().monthsShort();
+ for (let i = minEdge; i <= maxEdge; i += step) {
+ options.push({
+ value: `${i}`,
+ label: type === 'month' ? dayjsMonthsShort[i] : `${i + locale[type]}`,
+ });
+ }
+ return options;
+ },
+ getYearOptions(dateParams) {
+ const { locale } = this.data;
+ const { minDateYear, maxDateYear } = dateParams;
+ const years = [];
+ for (let i = minDateYear; i <= maxDateYear; i += 1) {
+ years.push({
+ value: `${i}`,
+ label: `${i + locale.year}`,
+ });
+ }
+ return years;
+ },
+ getOptionEdge(minOrMax, type) {
+ const selDateArray = this.getDateRect();
+ const compareArray = this.getDateRect(minOrMax);
+ const edge = {
+ month: [0, 11],
+ date: [1, this.getDate().daysInMonth()],
+ hour: [0, 23],
+ minute: [0, 59],
+ second: [0, 59],
+ };
+ const types = ['year', 'month', 'date', 'hour', 'minute', 'second'];
+ for (let i = 0, size = selDateArray.length; i < size; i += 1) {
+ if (types[i] === type)
+ return compareArray[i];
+ if (compareArray[i] !== selDateArray[i])
+ return edge[type][minOrMax === 'min' ? 0 : 1];
+ }
+ return edge[type][minOrMax === 'min' ? 0 : 1];
+ },
+ getMonthOptions() {
+ const months = [];
+ const minMonth = this.getOptionEdge('min', 'month');
+ const maxMonth = this.getOptionEdge('max', 'month');
+ const dayjsMonthsShort = dayjs.monthsShort();
+ for (let i = minMonth; i <= maxMonth; i += 1) {
+ months.push({
+ value: `${i}`,
+ label: dayjsMonthsShort[i],
+ });
+ }
+ return months;
+ },
+ getDayOptions() {
+ const { locale } = this.data;
+ const days = [];
+ const minDay = this.getOptionEdge('min', 'date');
+ const maxDay = this.getOptionEdge('max', 'date');
+ for (let i = minDay; i <= maxDay; i += 1) {
+ days.push({
+ value: `${i}`,
+ label: `${i + locale.day}`,
+ });
+ }
+ return days;
+ },
+ getHourOptions() {
+ const { locale } = this.data;
+ const hours = [];
+ const minHour = this.getOptionEdge('min', 'hour');
+ const maxHour = this.getOptionEdge('max', 'hour');
+ for (let i = minHour; i <= maxHour; i += 1) {
+ hours.push({
+ value: `${i}`,
+ label: `${i + locale.hour}`,
+ });
+ }
+ return hours;
+ },
+ getMinuteOptions() {
+ const { locale } = this.data;
+ const minutes = [];
+ const minMinute = this.getOptionEdge('min', 'minute');
+ const maxMinute = this.getOptionEdge('max', 'minute');
+ for (let i = minMinute; i <= maxMinute; i += 1) {
+ minutes.push({
+ value: `${i}`,
+ label: `${i + locale.minute}`,
+ });
+ }
+ return minutes;
+ },
+ getValueCols() {
+ return {
+ columns: this.getColumnOptions(),
+ columnsValue: this.getColumnsValue(),
+ };
+ },
+ getColumnsValue() {
+ const { fullModes } = this.data;
+ const date = this.getDate();
+ const columnsValue = [];
+ fullModes === null || fullModes === void 0 ? void 0 : fullModes.forEach((mode) => {
+ columnsValue.push(`${date[mode]()}`);
+ });
+ return columnsValue;
+ },
+ getNewDate(value, type) {
+ let newValue = this.getDate();
+ switch (type) {
+ case ModeItem.YEAR:
+ newValue = this.setYear(newValue, value);
+ break;
+ case ModeItem.MONTH:
+ newValue = this.setMonth(newValue, value);
+ break;
+ case ModeItem.DATE:
+ newValue = newValue.date(value);
+ break;
+ case ModeItem.HOUR:
+ newValue = newValue.hour(value);
+ break;
+ case ModeItem.MINUTE:
+ newValue = newValue.minute(value);
+ break;
+ case ModeItem.SECOND:
+ newValue = newValue.second(value);
+ break;
+ default:
+ break;
+ }
+ return this.clipDate(newValue);
+ },
+ onColumnChange(e) {
+ const { value, column } = e === null || e === void 0 ? void 0 : e.detail;
+ const { fullModes, format } = this.data;
+ const columnValue = value === null || value === void 0 ? void 0 : value[column];
+ const columnType = fullModes === null || fullModes === void 0 ? void 0 : fullModes[column];
+ const newValue = this.getNewDate(parseInt(columnValue, 10), columnType);
+ this.date = newValue;
+ const { columns, columnsValue } = this.getValueCols();
+ this.setData({
+ columns,
+ columnsValue,
+ });
+ const date = this.getDate();
+ const pickValue = format ? date.format(format) : date.valueOf();
+ this.triggerEvent('pick', { value: pickValue });
+ },
+ onConfirm() {
+ const { format } = this.properties;
+ const date = this.getDate();
+ const value = format ? date.format(format) : date.valueOf();
+ this._trigger('change', { value });
+ this.triggerEvent('confirm', { value });
+ this.resetColumns();
+ },
+ onCancel() {
+ this.resetColumns();
+ this.triggerEvent('cancel');
+ },
+ onVisibleChange(e) {
+ if (!e.detail.visible) {
+ this.resetColumns();
+ }
+ },
+ onClose(e) {
+ const { trigger } = e.detail;
+ this.triggerEvent('close', { trigger });
+ },
+ resetColumns() {
+ const parseDate = this.getParseDate();
+ this.date = parseDate;
+ const { columns, columnsValue } = this.getValueCols();
+ this.setData({
+ columns,
+ columnsValue,
+ });
+ },
+ };
+ }
+ getFullModeArray(mode) {
+ if (typeof mode === 'string' || mode instanceof String) {
+ return this.getFullModeByModeString(mode, FULL_MODES);
+ }
+ if (Array.isArray(mode)) {
+ if ((mode === null || mode === void 0 ? void 0 : mode.length) === 1) {
+ return this.getFullModeByModeString(mode[0], FULL_MODES);
+ }
+ if ((mode === null || mode === void 0 ? void 0 : mode.length) === 2) {
+ const dateModes = this.getFullModeByModeString(mode[0], DATE_MODES);
+ const timeModes = this.getFullModeByModeString(mode[1], TIME_MODES);
+ return [...dateModes, ...timeModes];
+ }
+ }
+ }
+ getFullModeByModeString(modeString, matchModes) {
+ if (!modeString) {
+ return [];
+ }
+ const endIndex = matchModes === null || matchModes === void 0 ? void 0 : matchModes.findIndex((mode) => modeString === mode);
+ return matchModes === null || matchModes === void 0 ? void 0 : matchModes.slice(0, endIndex + 1);
+ }
+ isTimeMode() {
+ const { fullModes } = this.data;
+ return fullModes[0] === ModeItem.HOUR;
+ }
+};
+DateTimePicker = __decorate([
+ wxComponent()
+], DateTimePicker);
+export default DateTimePicker;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.json b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.json
new file mode 100644
index 0000000..1207def
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-picker": "../picker/picker",
+ "t-picker-item": "../picker-item/picker-item"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.wxml b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.wxml
new file mode 100644
index 0000000..eea4578
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.wxss b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.wxss
new file mode 100644
index 0000000..6c89e6e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker.wxss
@@ -0,0 +1,31 @@
+.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-date-time-picker__item--roomly {
+ width: var(--td-data-time-picker-year-width, 128rpx);
+ flex: 0 0 var(--td-data-time-picker-year-width, 128rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/dayjs.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/dayjs.d.ts
new file mode 100644
index 0000000..0d6f6df
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/dayjs.d.ts
@@ -0,0 +1,174 @@
+import enLocale from 'dayjs/locale/en';
+declare const _default: {
+ default: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ en: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ 'zh-cn': {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ zh: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ 'zh-tw': {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ tc: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ ko: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ kr: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ ja: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+ ru: {
+ key: string;
+ label: string;
+ locale: enLocale.Locale;
+ i18n: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+ };
+ };
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/dayjs.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/dayjs.js
new file mode 100644
index 0000000..0bff459
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/dayjs.js
@@ -0,0 +1,74 @@
+import enLocale from 'dayjs/locale/en';
+import zhLocale from 'dayjs/locale/zh-cn';
+import tcLocale from 'dayjs/locale/zh-tw';
+import koLocale from 'dayjs/locale/ko';
+import jaLocale from 'dayjs/locale/ja';
+import ruLocale from 'dayjs/locale/ru';
+import en from './en';
+import zh from './zh';
+import tc from './tc';
+import ko from './ko';
+import ja from './ja';
+import ru from './ru';
+export default {
+ default: {
+ key: 'zh-cn',
+ label: '简体中文',
+ locale: zhLocale,
+ i18n: zh,
+ },
+ en: {
+ key: 'en',
+ label: 'English',
+ locale: enLocale,
+ i18n: en,
+ },
+ 'zh-cn': {
+ key: 'zh-cn',
+ label: '简体中文',
+ locale: zhLocale,
+ i18n: zh,
+ },
+ zh: {
+ key: 'zh-cn',
+ label: '简体中文',
+ locale: zhLocale,
+ i18n: zh,
+ },
+ 'zh-tw': {
+ key: 'zh-tw',
+ label: '繁体中文',
+ locale: tcLocale,
+ i18n: tc,
+ },
+ tc: {
+ key: 'zh-tw',
+ label: '繁体中文',
+ locale: tcLocale,
+ i18n: tc,
+ },
+ ko: {
+ key: 'ko',
+ label: '한국어',
+ locale: koLocale,
+ i18n: ko,
+ },
+ kr: {
+ key: 'ko',
+ label: '한국어',
+ locale: koLocale,
+ i18n: ko,
+ },
+ ja: {
+ key: 'ja',
+ label: '日本語',
+ locale: jaLocale,
+ i18n: ja,
+ },
+ ru: {
+ key: 'ru',
+ label: 'русский',
+ locale: ruLocale,
+ i18n: ru,
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/en.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/en.d.ts
new file mode 100644
index 0000000..9665c2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/en.d.ts
@@ -0,0 +1,13 @@
+declare const _default: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/en.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/en.js
new file mode 100644
index 0000000..fc53887
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/en.js
@@ -0,0 +1,12 @@
+export default {
+ year: '',
+ month: '',
+ date: '',
+ hour: '',
+ minute: '',
+ second: '',
+ am: 'AM',
+ pm: 'PM',
+ confirm: 'confirm',
+ cancel: 'cancel',
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ja.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ja.d.ts
new file mode 100644
index 0000000..9665c2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ja.d.ts
@@ -0,0 +1,13 @@
+declare const _default: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ja.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ja.js
new file mode 100644
index 0000000..7851cab
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ja.js
@@ -0,0 +1,12 @@
+export default {
+ year: '年',
+ month: '月',
+ date: '日',
+ hour: '時',
+ minute: '分',
+ second: '秒',
+ am: '午前',
+ pm: '午後',
+ confirm: '確認',
+ cancel: 'キャンセル',
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ko.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ko.d.ts
new file mode 100644
index 0000000..9665c2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ko.d.ts
@@ -0,0 +1,13 @@
+declare const _default: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ko.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ko.js
new file mode 100644
index 0000000..1a9a214
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ko.js
@@ -0,0 +1,12 @@
+export default {
+ year: '년',
+ month: '월',
+ date: '일',
+ hour: '시',
+ minute: '분',
+ second: '초',
+ am: '오전',
+ pm: '오후',
+ confirm: '확인',
+ cancel: '취소',
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ru.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ru.d.ts
new file mode 100644
index 0000000..9665c2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ru.d.ts
@@ -0,0 +1,13 @@
+declare const _default: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ru.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ru.js
new file mode 100644
index 0000000..ced8fc2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/ru.js
@@ -0,0 +1,12 @@
+export default {
+ year: '',
+ month: '',
+ date: '',
+ hour: '',
+ minute: '',
+ second: '',
+ am: 'до полудня',
+ pm: 'после полудня',
+ confirm: 'подтвердить',
+ cancel: 'отменить',
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/tc.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/tc.d.ts
new file mode 100644
index 0000000..9665c2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/tc.d.ts
@@ -0,0 +1,13 @@
+declare const _default: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/tc.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/tc.js
new file mode 100644
index 0000000..78a4a4b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/tc.js
@@ -0,0 +1,12 @@
+export default {
+ year: '年',
+ month: '月',
+ date: '日',
+ hour: '時',
+ minute: '分',
+ second: '秒',
+ am: '上午',
+ pm: '下午',
+ confirm: '確定',
+ cancel: '取消',
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/zh.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/zh.d.ts
new file mode 100644
index 0000000..9665c2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/zh.d.ts
@@ -0,0 +1,13 @@
+declare const _default: {
+ year: string;
+ month: string;
+ date: string;
+ hour: string;
+ minute: string;
+ second: string;
+ am: string;
+ pm: string;
+ confirm: string;
+ cancel: string;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/zh.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/zh.js
new file mode 100644
index 0000000..8c808d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/locale/zh.js
@@ -0,0 +1,12 @@
+export default {
+ year: '年',
+ month: '月',
+ date: '日',
+ hour: '时',
+ minute: '分',
+ second: '秒',
+ am: '上午',
+ pm: '下午',
+ confirm: '确定',
+ cancel: '取消',
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/props.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/props.d.ts
new file mode 100644
index 0000000..8837a6a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDateTimePickerProps } from './type';
+declare const props: TdDateTimePickerProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/props.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/props.js
new file mode 100644
index 0000000..53688c2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/props.js
@@ -0,0 +1,73 @@
+const props = {
+ autoClose: {
+ type: Boolean,
+ value: false,
+ },
+ cancelBtn: {
+ type: String,
+ value: '取消',
+ },
+ confirmBtn: {
+ type: String,
+ value: '',
+ },
+ customLocale: {
+ type: String,
+ value: 'zh',
+ },
+ end: {
+ type: null,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ filter: {
+ type: null,
+ },
+ format: {
+ type: String,
+ value: 'YYYY-MM-DD HH:mm:ss',
+ },
+ header: {
+ type: Boolean,
+ value: true,
+ },
+ mode: {
+ type: null,
+ value: 'date',
+ },
+ popupProps: {
+ type: Object,
+ value: {},
+ },
+ showWeek: {
+ type: Boolean,
+ value: false,
+ },
+ start: {
+ type: null,
+ },
+ steps: {
+ type: Object,
+ },
+ title: {
+ type: String,
+ value: '',
+ },
+ usePopup: {
+ type: Boolean,
+ value: true,
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/type.d.ts b/miniprogram_npm/tdesign-miniprogram/date-time-picker/type.d.ts
new file mode 100644
index 0000000..55aaa06
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/type.d.ts
@@ -0,0 +1,87 @@
+import { PopupProps } from '../popup/index';
+export interface TdDateTimePickerProps {
+ autoClose?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ cancelBtn?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ confirmBtn?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ customLocale?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ end?: {
+ type: null;
+ value?: string | number;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-confirm', 't-class-cancel', 't-class-title'];
+ };
+ filter?: {
+ type: undefined;
+ value?: (type: TimeModeValues, columns: DateTimePickerColumn) => DateTimePickerColumn;
+ };
+ format?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ header?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ mode?: {
+ type: null;
+ value?: DateTimePickerMode;
+ };
+ popupProps?: {
+ type: ObjectConstructor;
+ value?: PopupProps;
+ };
+ showWeek?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ start?: {
+ type: null;
+ value?: string | number;
+ };
+ steps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ usePopup?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: DateValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: DateValue;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export declare type DateTimePickerColumn = DateTimePickerColumnItem[];
+export interface DateTimePickerColumnItem {
+ label: string;
+ value: string;
+}
+export declare type DateTimePickerMode = TimeModeValues | Array;
+export declare type TimeModeValues = 'year' | 'month' | 'date' | 'hour' | 'minute' | 'second';
+export declare type DateValue = string | number;
diff --git a/miniprogram_npm/tdesign-miniprogram/date-time-picker/type.js b/miniprogram_npm/tdesign-miniprogram/date-time-picker/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/date-time-picker/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md
new file mode 100644
index 0000000..d886dee
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md
@@ -0,0 +1,58 @@
+:: BASE_DOC ::
+
+## API
+
+### Dialog 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
+actions | Array / Slot | - | Typescript:`Array`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+button-layout | String | horizontal | options: horizontal/vertical | N
+cancel-btn | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+close-btn | Boolean / Object | false | `0.31.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+close-on-overlay-click | Boolean | false | \- | N
+confirm-btn | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+overlay-props | Object | {} | Typescript:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+prevent-scroll-through | Boolean | true | \- | N
+show-overlay | Boolean | true | \- | N
+title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+using-custom-navbar | Boolean | false | \- | N
+visible | Boolean | - | \- | N
+z-index | Number | 11500 | \- | N
+
+### Dialog Events
+
+name | params | description
+-- | -- | --
+cancel | - | \-
+close | `(trigger: DialogEventSource)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts)。
`type DialogEventSource = 'cancel' \| 'overlay' \| 'close-btn'`
+confirm | - | \-
+overlay-click | - | \-
+### Dialog External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-action | \-
+t-class-cancel | \-
+t-class-confirm | \-
+t-class-content | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-dialog-body-max-height | 912rpx | -
+--td-dialog-border-radius | @radius-extra-large | -
+--td-dialog-close-color | @text-color-placeholder | -
+--td-dialog-content-color | @text-color-secondary | -
+--td-dialog-content-font-size | 32rpx | -
+--td-dialog-content-line-height | 48rpx | -
+--td-dialog-title-color | @text-color-primary | -
+--td-dialog-title-font-size | 36rpx | -
+--td-dialog-title-line-height | 52rpx | -
+--td-dialog-width | 622rpx | -
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/README.md b/miniprogram_npm/tdesign-miniprogram/dialog/README.md
new file mode 100644
index 0000000..6cc1feb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/README.md
@@ -0,0 +1,119 @@
+---
+title: Dialog 对话框
+description: 用于显示重要提示或请求用户进行重要操作,一种打断当前操作的模态视图。
+spline: message
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+按钮的样式,默认使用 `variant = text`,如果任意按钮改变了 `variant`,那么全部按钮都改变成这个。
+
+#### 反馈类对话框
+
+{{ base }}
+
+> 使用这种方式,对话框的 `visible` 是受控的,需要手动设置额 `visible` 为 `false` 才会关闭对话框。
+
+#### 确认类对话框
+
+{{ confirm }}
+
+#### 输入类对话框
+
+{{ with-input }}
+
+#### 带图片对话框
+
+{{ with-image }}
+
+### 组件状态
+
+{{ status }}
+
+### 组件用法
+#### 命令调用
+
+{{ command }}
+
+#### 开放能力按钮
+
+当传入的按钮类型为对象时,整个对象都将透传至 `t-button`,因此按钮可以直接使用开放能力
+
+{{ button }}
+
+## API
+
+### Dialog Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+actions | Array / Slot | - | 操作栏。TS 类型:`Array`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+button-layout | String | horizontal | 多按钮排列方式。可选项:horizontal/vertical | N
+cancel-btn | String / Object / Slot | - | 取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 Slot 自定义按钮时,需自行控制取消事件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+close-btn | Boolean / Object | false | `0.31.0`。是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;使用 Object 时透传至图标组件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+close-on-overlay-click | Boolean | false | 点击蒙层时是否触发关闭事件 | N
+confirm-btn | String / Object / Slot | - | 确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 Slot 自定义按钮时,需自行控制确认事件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content | String / Slot | - | 内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+overlay-props | Object | {} | 透传至 Overlay 组件。TS 类型:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+prevent-scroll-through | Boolean | true | 防止滚动穿透 | N
+show-overlay | Boolean | true | 是否显示遮罩层 | N
+title | String / Slot | - | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+visible | Boolean | - | 控制对话框是否显示 | N
+z-index | Number | 11500 | 对话框层级,Web 侧样式默认为 2500,移动端样式默认 2500,小程序样式默认为 11500 | N
+
+### Dialog Events
+
+名称 | 参数 | 描述
+-- | -- | --
+cancel | - | 如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件
+close | `(trigger: DialogEventSource)` | 关闭事件,点击 取消按钮 或 点击蒙层 时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts)。
`type DialogEventSource = 'cancel' \| 'overlay' \| 'close-btn'`
+confirm | - | 如果“确认”按钮存在,则点击“确认”按钮时触发
+overlay-click | - | 如果蒙层存在,点击蒙层时触发
+### Dialog External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-action | 操作样式类
+t-class-cancel | 取消样式类
+t-class-confirm | 确认样式类
+t-class-content | 内容样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-dialog-body-max-height | 912rpx | -
+--td-dialog-border-radius | @radius-extra-large | -
+--td-dialog-close-color | @text-color-placeholder | -
+--td-dialog-content-color | @text-color-secondary | -
+--td-dialog-content-font-size | 32rpx | -
+--td-dialog-content-line-height | 48rpx | -
+--td-dialog-title-color | @text-color-primary | -
+--td-dialog-title-font-size | 36rpx | -
+--td-dialog-title-line-height | 52rpx | -
+--td-dialog-width | 622rpx | -
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts
new file mode 100644
index 0000000..4efa470
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts
@@ -0,0 +1,28 @@
+import { SuperComponent } from '../common/src/index';
+export default class Dialog extends SuperComponent {
+ behaviors: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ properties: import("./type").TdDialogProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ buttonVariant: string;
+ };
+ observers: {
+ 'confirmBtn, cancelBtn'(confirm: any, cancel: any): void;
+ };
+ methods: {
+ onTplButtonTap(e: any): void;
+ onConfirm(): void;
+ onCancel(): void;
+ onClose(): void;
+ close(): void;
+ overlayClick(): void;
+ onActionTap(index: number): void;
+ openValueCBHandle(e: any): void;
+ openValueErrCBHandle(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.js b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.js
new file mode 100644
index 0000000..54153d7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.js
@@ -0,0 +1,149 @@
+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 { isObject, toCamel } from '../common/utils';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-dialog`;
+let Dialog = class Dialog extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [useCustomNavbar];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-confirm`,
+ `${prefix}-class-cancel`,
+ `${prefix}-class-action`,
+ ];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ buttonVariant: 'text',
+ };
+ this.observers = {
+ 'confirmBtn, cancelBtn'(confirm, cancel) {
+ const { prefix, classPrefix, buttonLayout } = this.data;
+ const rect = { buttonVariant: 'text' };
+ const useBaseVariant = [confirm, cancel].some((item) => isObject(item) && item.variant && item.variant !== 'text');
+ const buttonMap = { confirm, cancel };
+ const cls = [`${classPrefix}__button`];
+ const externalCls = [];
+ if (useBaseVariant) {
+ rect.buttonVariant = 'base';
+ cls.push(`${classPrefix}__button--${buttonLayout}`);
+ }
+ else {
+ cls.push(`${classPrefix}__button--text`);
+ externalCls.push(`${classPrefix}-button`);
+ }
+ Object.keys(buttonMap).forEach((key) => {
+ const btn = buttonMap[key];
+ const base = {
+ block: true,
+ rootClass: [...cls, `${classPrefix}__button--${key}`],
+ tClass: [...externalCls, `${prefix}-class-${key}`],
+ variant: rect.buttonVariant,
+ openType: '',
+ };
+ if (key === 'cancel' && rect.buttonVariant === 'base') {
+ base.theme = 'light';
+ }
+ if (typeof btn === 'string') {
+ rect[`_${key}`] = Object.assign(Object.assign({}, base), { content: btn });
+ }
+ else if (btn && typeof btn === 'object') {
+ rect[`_${key}`] = Object.assign(Object.assign({}, base), btn);
+ }
+ else {
+ rect[`_${key}`] = null;
+ }
+ });
+ this.setData(Object.assign({}, rect));
+ },
+ };
+ this.methods = {
+ onTplButtonTap(e) {
+ var _a, _b, _c;
+ const evtType = e.type;
+ const { type, extra } = e.target.dataset;
+ const button = this.data[`_${type}`];
+ const cbName = `bind${evtType}`;
+ if (type === 'action') {
+ this.onActionTap(extra);
+ return;
+ }
+ if (typeof button[cbName] === 'function') {
+ const closeFlag = button[cbName](e);
+ if (closeFlag) {
+ this.close();
+ }
+ }
+ const hasOpenType = !!button.openType;
+ if (!hasOpenType && ['confirm', 'cancel'].includes(type)) {
+ (_a = this[toCamel(`on-${type}`)]) === null || _a === void 0 ? void 0 : _a.call(this, type);
+ }
+ if (evtType !== 'tap') {
+ const success = ((_c = (_b = e.detail) === null || _b === void 0 ? void 0 : _b.errMsg) === null || _c === void 0 ? void 0 : _c.indexOf('ok')) > -1;
+ this.triggerEvent(success ? 'open-type-event' : 'open-type-error-event', e.detail);
+ }
+ },
+ onConfirm() {
+ this.triggerEvent('confirm');
+ if (this._onConfirm) {
+ this._onConfirm();
+ this.close();
+ }
+ },
+ onCancel() {
+ this.triggerEvent('close', { trigger: 'cancel' });
+ this.triggerEvent('cancel');
+ if (this._onCancel) {
+ this._onCancel();
+ this.close();
+ }
+ },
+ onClose() {
+ this.triggerEvent('close', { trigger: 'close-btn' });
+ this.close();
+ },
+ close() {
+ this.setData({ visible: false });
+ },
+ overlayClick() {
+ if (this.properties.closeOnOverlayClick) {
+ this.triggerEvent('close', { trigger: 'overlay' });
+ this.close();
+ }
+ this.triggerEvent('overlay-click');
+ },
+ onActionTap(index) {
+ this.triggerEvent('action', { index });
+ if (this._onAction) {
+ this._onAction({ index });
+ this.close();
+ }
+ },
+ openValueCBHandle(e) {
+ this.triggerEvent('open-type-event', e.detail);
+ },
+ openValueErrCBHandle(e) {
+ this.triggerEvent('open-type-error-event', e.detail);
+ },
+ };
+ }
+};
+Dialog = __decorate([
+ wxComponent()
+], Dialog);
+export default Dialog;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.json b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.json
new file mode 100644
index 0000000..95bed64
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-popup": "../popup/popup",
+ "t-icon": "../icon/icon",
+ "t-button": "../button/button"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml
new file mode 100644
index 0000000..1c60f26
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{content}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs
new file mode 100644
index 0000000..8f70e47
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs
@@ -0,0 +1,13 @@
+module.exports.getTypeof = function (obj) {
+ return typeof obj;
+};
+
+module.exports.getActionClass = function (prefix, buttonLayout) {
+ var cls = [prefix + '__button', prefix + '__button--action'];
+
+ if (buttonLayout) {
+ cls.push(prefix + '__button--' + buttonLayout);
+ }
+
+ return cls.join(' ');
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss
new file mode 100644
index 0000000..cb11c8a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss
@@ -0,0 +1,132 @@
+.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-dialog {
+ overflow: hidden;
+ width: var(--td-dialog-width, 622rpx);
+ border-radius: var(--td-dialog-border-radius, var(--td-radius-extra-large, 24rpx));
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+}
+.t-dialog__wrapper {
+ --td-popup-border-radius: var(--td-dialog-border-radius, var(--td-radius-extra-large, 24rpx));
+}
+.t-dialog__close-btn {
+ position: absolute;
+ top: var(--td-spacer, 16rpx);
+ right: var(--td-spacer, 16rpx);
+ color: var(--td-dialog-close-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ z-index: 1;
+ /* skyline适配新增 */
+}
+.t-dialog__content {
+ padding-top: var(--td-spacer-3, 48rpx);
+ padding-right: var(--td-spacer-3, 48rpx);
+ padding-bottom: 0;
+ padding-left: var(--td-spacer-3, 48rpx);
+ max-height: var(--td-dialog-body-max-height, 912rpx);
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-dialog__content:empty {
+ display: none;
+}
+.t-dialog__header {
+ text-align: center;
+ font-weight: bold;
+ font-size: var(--td-dialog-title-font-size, 36rpx);
+ line-height: var(--td-dialog-title-line-height, 52rpx);
+ color: var(--td-dialog-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-dialog__header + .t-dialog__body {
+ margin-top: var(--td-spacer, 16rpx);
+}
+.t-dialog__body {
+ overflow-y: scroll;
+ text-align: center;
+ -webkit-overflow-scrolling: touch;
+ font-size: var(--td-dialog-content-font-size, 32rpx);
+ color: var(--td-dialog-content-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ line-height: var(--td-dialog-content-line-height, 48rpx);
+}
+.t-dialog__body-text {
+ word-wrap: break-word;
+}
+.t-dialog__body--left {
+ text-align: left;
+}
+.t-dialog__body--right {
+ text-align: right;
+}
+.t-dialog__footer {
+ display: flex;
+ padding: var(--td-spacer-3, 48rpx);
+}
+.t-dialog__footer--column {
+ flex-flow: column-reverse;
+}
+.t-dialog__footer--column .t-dialog__button {
+ width: 100%;
+}
+.t-dialog__footer--full {
+ padding: var(--td-spacer-4, 64rpx) 0 0;
+}
+.t-dialog__button {
+ position: relative;
+ flex: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.t-dialog__button--horizontal + .t-dialog__button--horizontal {
+ margin-left: var(--td-spacer-1, 24rpx);
+}
+.t-dialog__button--vertical + .t-dialog__button--vertical {
+ margin-bottom: var(--td-spacer-1, 24rpx);
+}
+.t-dialog__button--text {
+ flex: 1;
+ --td-button-border-radius: 0;
+ --td-button-medium-height: 112rpx;
+ border-radius: 0;
+}
+.t-dialog__button--text:before {
+ content: ' ';
+ position: absolute;
+ box-sizing: border-box;
+ top: 0;
+ left: 0;
+ border-top: 1px solid var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7));
+ border-left: 1px solid var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7));
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ width: 200%;
+ height: 200%;
+ border-radius: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts
new file mode 100644
index 0000000..8c8cf22
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts
@@ -0,0 +1,44 @@
+///
+///
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+interface DialogAlertOptionsType {
+ context?: Context;
+ selector?: string;
+ title?: string;
+ content?: string;
+ zIndex?: number;
+ asyncClose?: boolean;
+ confirmButtonText?: string;
+ textAlign?: string;
+ cancelBtn?: string | object;
+ confirmBtn?: string | object;
+ showOverlay?: boolean;
+ closeOnOverlayClick?: boolean;
+ preventScrollThrough?: boolean;
+}
+interface DialogConfirmOptionsType extends DialogAlertOptionsType {
+ cancelButtonText?: string;
+}
+interface Action {
+ content: string;
+ theme?: 'default' | 'primary' | 'danger' | 'light';
+}
+interface DialogActionOptionsType {
+ context?: Context;
+ selector?: string;
+ title?: string;
+ content: string;
+ zIndex?: number;
+ asyncClose?: boolean;
+ actions?: Action[];
+ buttonLayout?: 'vertical' | 'horizontal';
+}
+declare const _default: {
+ alert(options: DialogAlertOptionsType): Promise;
+ confirm(options: DialogConfirmOptionsType): Promise;
+ close(options?: DialogConfirmOptionsType): Promise;
+ action(options: DialogActionOptionsType): Promise<{
+ index: number;
+ }>;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/index.js b/miniprogram_npm/tdesign-miniprogram/dialog/index.js
new file mode 100644
index 0000000..4986b1f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/index.js
@@ -0,0 +1,72 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import props from './props';
+import { getInstance } from '../common/utils';
+const defaultOptions = {
+ actions: [],
+ buttonLayout: props.buttonLayout.value,
+ cancelBtn: props.cancelBtn.value,
+ closeOnOverlayClick: props.closeOnOverlayClick.value,
+ confirmBtn: props.confirmBtn.value,
+ content: '',
+ preventScrollThrough: props.preventScrollThrough.value,
+ showOverlay: props.showOverlay.value,
+ title: '',
+ visible: props.visible.value,
+};
+export default {
+ alert(options) {
+ const _a = Object.assign(Object.assign({}, defaultOptions), options), { context, selector = '#t-dialog' } = _a, otherOptions = __rest(_a, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (!instance)
+ return Promise.reject();
+ return new Promise((resolve) => {
+ instance.setData(Object.assign(Object.assign({ cancelBtn: '' }, otherOptions), { visible: true }));
+ instance._onConfirm = resolve;
+ });
+ },
+ confirm(options) {
+ const _a = Object.assign(Object.assign({}, defaultOptions), options), { context, selector = '#t-dialog' } = _a, otherOptions = __rest(_a, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (!instance)
+ return Promise.reject();
+ return new Promise((resolve, reject) => {
+ instance.setData(Object.assign(Object.assign({}, otherOptions), { visible: true }));
+ instance._onConfirm = resolve;
+ instance._onCancel = reject;
+ });
+ },
+ close(options) {
+ const { context, selector = '#t-dialog' } = Object.assign({}, options);
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.close();
+ return Promise.resolve();
+ }
+ return Promise.reject();
+ },
+ action(options) {
+ const _a = Object.assign(Object.assign({}, defaultOptions), options), { context, selector = '#t-dialog', actions } = _a, otherOptions = __rest(_a, ["context", "selector", "actions"]);
+ const instance = getInstance(context, selector);
+ if (!instance)
+ return Promise.reject();
+ const { buttonLayout = 'vertical' } = options;
+ const maxLengthSuggestion = buttonLayout === 'vertical' ? 7 : 3;
+ if (!actions || (typeof actions === 'object' && (actions.length === 0 || actions.length > maxLengthSuggestion))) {
+ console.warn(`action 数量建议控制在1至${maxLengthSuggestion}个`);
+ }
+ return new Promise((resolve) => {
+ instance.setData(Object.assign(Object.assign({ actions }, otherOptions), { buttonLayout, visible: true }));
+ instance._onAction = resolve;
+ });
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts
new file mode 100644
index 0000000..15d9d87
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDialogProps } from './type';
+declare const props: TdDialogProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/props.js b/miniprogram_npm/tdesign-miniprogram/dialog/props.js
new file mode 100644
index 0000000..75472f4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/props.js
@@ -0,0 +1,56 @@
+const props = {
+ actions: {
+ type: Array,
+ },
+ buttonLayout: {
+ type: String,
+ value: 'horizontal',
+ },
+ cancelBtn: {
+ type: null,
+ },
+ closeBtn: {
+ type: null,
+ value: false,
+ },
+ closeOnOverlayClick: {
+ type: Boolean,
+ value: false,
+ },
+ confirmBtn: {
+ type: null,
+ },
+ content: {
+ type: String,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ overlayProps: {
+ type: Object,
+ value: {},
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: true,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ style: {
+ type: String,
+ value: '',
+ },
+ title: {
+ type: String,
+ },
+ visible: {
+ type: Boolean,
+ },
+ zIndex: {
+ type: Number,
+ value: 11500,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts
new file mode 100644
index 0000000..ef3c799
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts
@@ -0,0 +1,68 @@
+import { ButtonProps } from '../button/index';
+import { TdOverlayProps as OverlayProps } from '../overlay/type';
+export interface TdDialogProps {
+ actions?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ buttonLayout?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ cancelBtn?: {
+ type: null;
+ value?: string | ButtonProps | null;
+ };
+ closeBtn?: {
+ type: null;
+ value?: boolean | ButtonProps | null;
+ };
+ closeOnOverlayClick?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ confirmBtn?: {
+ type: null;
+ value?: string | ButtonProps | null;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-content', 't-class-confirm', 't-class-cancel'];
+ };
+ overlayProps?: {
+ type: ObjectConstructor;
+ value?: OverlayProps;
+ };
+ preventScrollThrough?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/type.js b/miniprogram_npm/tdesign-miniprogram/dialog/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/divider/README.en-US.md
new file mode 100644
index 0000000..08a4d5a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/README.en-US.md
@@ -0,0 +1,31 @@
+:: BASE_DOC ::
+
+## API
+
+### Divider 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
+align | String | center | options: left/right/center | N
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+dashed | Boolean | false | \- | N
+layout | String | horizontal | options: horizontal/vertical | N
+### Divider External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-divider-color | @bg-color-component | -
+--td-divider-content-color | @font-gray-3 | -
+--td-divider-content-font-size | 24rpx | -
+--td-divider-content-line-height | 40rpx | -
+--td-divider-content-line-style | solid | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/README.md b/miniprogram_npm/tdesign-miniprogram/divider/README.md
new file mode 100644
index 0000000..d567bcb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/README.md
@@ -0,0 +1,67 @@
+---
+title: Divider 分割线
+description: 用于分割、组织、细化有一定逻辑的组织元素内容和页面结构。
+spline: message
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-divider": "tdesign-miniprogram/divider/divider"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+
+### 基础分割符
+
+分割符主要是由直线和文字组成,通过`slot`传入分割线文案或者其他自定义内容,通过`layout`控制分隔符是垂直还是横向
+
+{{ base }}
+
+### 虚线样式
+
+{{ theme }}
+
+## API
+
+### Divider Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+align | String | center | 文本位置(仅在水平分割线有效)。可选项:left/right/center | N
+content | String / Slot | - | 子元素。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+dashed | Boolean | false | 是否虚线(仅在水平分割线有效) | N
+layout | String | horizontal | 分隔线类型有两种:水平和垂直。可选项:horizontal/vertical | N
+### Divider External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-divider-color | @bg-color-component | -
+--td-divider-content-color | @font-gray-3 | -
+--td-divider-content-font-size | 24rpx | -
+--td-divider-content-line-height | 40rpx | -
+--td-divider-content-line-style | solid | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/divider.d.ts b/miniprogram_npm/tdesign-miniprogram/divider/divider.d.ts
new file mode 100644
index 0000000..d4d837c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/divider.d.ts
@@ -0,0 +1,18 @@
+import { SuperComponent } from '../common/src/index';
+export default class Divider extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdDividerProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ observers: {
+ lineColor(): void;
+ };
+ methods: {
+ setStyle(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/divider.js b/miniprogram_npm/tdesign-miniprogram/divider/divider.js
new file mode 100644
index 0000000..7e3247d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/divider.js
@@ -0,0 +1,43 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-divider`;
+let Divider = class Divider extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.observers = {
+ lineColor() {
+ this.setStyle();
+ },
+ };
+ this.methods = {
+ setStyle() {
+ const { lineColor } = this.properties;
+ const dividerStyle = `${lineColor ? `border-color: ${lineColor};` : ''}`;
+ this.setData({
+ dividerStyle,
+ });
+ },
+ };
+ }
+};
+Divider = __decorate([
+ wxComponent()
+], Divider);
+export default Divider;
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/divider.json b/miniprogram_npm/tdesign-miniprogram/divider/divider.json
new file mode 100644
index 0000000..79f2730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/divider.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared"
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/divider.wxml b/miniprogram_npm/tdesign-miniprogram/divider/divider.wxml
new file mode 100644
index 0000000..fb83e6b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/divider.wxml
@@ -0,0 +1,13 @@
+
+
+
+
+
+ {{content}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/divider.wxss b/miniprogram_npm/tdesign-miniprogram/divider/divider.wxss
new file mode 100644
index 0000000..28433f3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/divider.wxss
@@ -0,0 +1,85 @@
+.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-divider {
+ display: flex;
+ color: var(--td-divider-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-divider-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-style: var(--td-divider-content-line-style, solid);
+ border-width: 0;
+}
+.t-divider::before,
+.t-divider::after {
+ content: '';
+ display: block;
+ flex: 1;
+ box-sizing: border-box;
+ border: inherit;
+ border-color: inherit;
+ border-style: inherit;
+}
+.t-divider--horizontal {
+ align-items: center;
+ margin-top: 20rpx;
+ margin-bottom: 20rpx;
+}
+.t-divider--horizontal::before,
+.t-divider--horizontal::after {
+ border-top-width: 1px;
+ transform: scaleY(0.5);
+ transform-origin: bottom;
+}
+.t-divider--horizontal .t-divider__content:not(:empty) {
+ margin: 0 24rpx;
+}
+.t-divider--vertical {
+ flex-direction: column;
+ height: 28rpx;
+ margin: 0 16rpx;
+}
+.t-divider--vertical::before,
+.t-divider--vertical::after {
+ border-left-width: 1px;
+ transform: scaleX(0.5);
+ transform-origin: bottom;
+}
+.t-divider--vertical-center {
+ align-items: center;
+ height: 100%;
+}
+.t-divider--dashed {
+ border-style: dashed;
+}
+.t-divider__content {
+ font-size: var(--td-divider-content-font-size, 24rpx);
+ line-height: var(--td-divider-content-line-height, 40rpx);
+ color: var(--td-divider-content-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-divider--left::before,
+.t-divider--right::after {
+ max-width: 60rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/props.d.ts b/miniprogram_npm/tdesign-miniprogram/divider/props.d.ts
new file mode 100644
index 0000000..806aab2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDividerProps } from './type';
+declare const props: TdDividerProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/props.js b/miniprogram_npm/tdesign-miniprogram/divider/props.js
new file mode 100644
index 0000000..395a3aa
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/props.js
@@ -0,0 +1,18 @@
+const props = {
+ align: {
+ type: String,
+ value: 'center',
+ },
+ content: {
+ type: String,
+ },
+ dashed: {
+ type: Boolean,
+ value: false,
+ },
+ layout: {
+ type: String,
+ value: 'horizontal',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/type.d.ts b/miniprogram_npm/tdesign-miniprogram/divider/type.d.ts
new file mode 100644
index 0000000..424a7b2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/type.d.ts
@@ -0,0 +1,18 @@
+export interface TdDividerProps {
+ align?: {
+ type: StringConstructor;
+ value?: 'left' | 'right' | 'center';
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ dashed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/divider/type.js b/miniprogram_npm/tdesign-miniprogram/divider/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/divider/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/drawer/README.en-US.md
new file mode 100644
index 0000000..6504ced
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/README.en-US.md
@@ -0,0 +1,47 @@
+:: BASE_DOC ::
+
+## API
+
+### Drawer 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
+close-on-overlay-click | Boolean | true | \- | N
+destroy-on-close | Boolean | false | \- | N
+footer | Slot | - | `0.29.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon: string; }。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts) | N
+placement | String | right | options: left/right | N
+show-overlay | Boolean | true | \- | N
+title | String / Slot | - | `0.29.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+using-custom-navbar | Boolean | false | \- | N
+visible | Boolean | false | \- | N
+z-index | Number | 11500 | \- | N
+
+### Drawer Events
+
+name | params | description
+-- | -- | --
+close | `(trigger: TriggerSource)` | \-
+item-click | `(index: number; item: DrawerItem)` | \-
+overlay-click | \- | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-drawer-bg-color | @bg-color-container | -
+--td-drawer-border-color | @border-color | -
+--td-drawer-footer-padding-bottom | 40rpx | -
+--td-drawer-hover-color | @bg-color-secondarycontainer | -
+--td-drawer-item-icon-color | @drawer-title-color
+--td-drawer-item-height | 48rpx | -
+--td-drawer-item-icon-size | 48rpx | -
+--td-drawer-item-padding | 32rpx | -
+--td-drawer-sidebar-height | 70vh | -
+--td-drawer-title-color | @font-gray-1 | -
+--td-drawer-title-font-size | 36rpx | -
+--td-drawer-title-padding | 48rpx 32rpx 16rpx | -
+--td-drawer-width | 560rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/README.md b/miniprogram_npm/tdesign-miniprogram/drawer/README.md
new file mode 100644
index 0000000..c5fd96f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/README.md
@@ -0,0 +1,90 @@
+---
+title: Drawer 抽屉
+description: 用作一组平行关系页面/内容的切换器,相较于Tab,同屏可展示更多的选项数量。。
+spline: message
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.7.2 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-drawer": "tdesign-miniprogram/drawer/drawer"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+### 基础抽屉
+{{ base }}
+
+### 带图标的抽屉
+{{ icon-drawer }}
+
+>Drawer的 `visible` 是受控的,需要手动设置 `visible` 为 `true` 才会开启抽屉
+
+
+
+## API
+
+### Drawer Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+close-on-overlay-click | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N
+destroy-on-close | Boolean | false | 抽屉关闭时是否销毁节点 | N
+footer | Slot | - | `0.29.0`。抽屉的底部。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon: string; }。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts) | N
+placement | String | right | 抽屉方向。可选项:left/right | N
+show-overlay | Boolean | true | 是否显示遮罩层 | N
+title | String / Slot | - | `0.29.0`。抽屉的标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+visible | Boolean | false | 组件是否可见 | N
+z-index | Number | 11500 | 抽屉层级,样式默认为 11500 | N
+
+### Drawer Events
+
+名称 | 参数 | 描述
+-- | -- | --
+close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
+item-click | `(index: number; item: DrawerItem)` | 点击抽屉里的列表项
+overlay-click | \- | 如果蒙层存在,点击蒙层时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-drawer-bg-color | @bg-color-container | -
+--td-drawer-border-color | @border-color | -
+--td-drawer-footer-padding-bottom | 40rpx | -
+--td-drawer-hover-color | @bg-color-secondarycontainer | -
+--td-drawer-item-icon-color | @drawer-title-color
+--td-drawer-item-height | 48rpx | -
+--td-drawer-item-icon-size | 48rpx | -
+--td-drawer-item-padding | 32rpx | -
+--td-drawer-sidebar-height | 70vh | -
+--td-drawer-title-color | @font-gray-1 | -
+--td-drawer-title-font-size | 36rpx | -
+--td-drawer-title-padding | 48rpx 32rpx 16rpx | -
+--td-drawer-width | 560rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/drawer.d.ts b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.d.ts
new file mode 100644
index 0000000..22932ab
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.d.ts
@@ -0,0 +1,16 @@
+import { ComponentsOptionsType, SuperComponent } from '../common/src/index';
+export default class Drawer extends SuperComponent {
+ behaviors: string[];
+ externalClasses: any[];
+ options: ComponentsOptionsType;
+ properties: import("./type").TdDrawerProps;
+ data: {
+ classPrefix: string;
+ };
+ methods: {
+ visibleChange({ detail }: {
+ detail: any;
+ }): void;
+ itemClick(detail: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/drawer.js b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.js
new file mode 100644
index 0000000..74d8f3d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.js
@@ -0,0 +1,49 @@
+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 useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-drawer`;
+let Drawer = class Drawer extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [useCustomNavbar];
+ this.externalClasses = [];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ classPrefix: name,
+ };
+ this.methods = {
+ visibleChange({ detail }) {
+ const { visible } = detail;
+ const { showOverlay } = this.data;
+ this.setData({
+ visible,
+ });
+ if (!visible) {
+ this.triggerEvent('close', { trigger: 'overlay' });
+ }
+ if (showOverlay) {
+ this.triggerEvent('overlay-click', { visible: visible });
+ }
+ },
+ itemClick(detail) {
+ const { index, item } = detail.currentTarget.dataset;
+ this.triggerEvent('item-click', { index, item });
+ },
+ };
+ }
+};
+Drawer = __decorate([
+ wxComponent()
+], Drawer);
+export default Drawer;
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/drawer.json b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.json
new file mode 100644
index 0000000..4d58963
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-popup": "../popup/popup",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/drawer.wxml b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.wxml
new file mode 100644
index 0000000..a7ff8ac
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.wxml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ {{title}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/drawer.wxss b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.wxss
new file mode 100644
index 0000000..ac6cb63
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/drawer.wxss
@@ -0,0 +1,90 @@
+.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-drawer {
+ background: var(--td-drawer-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ height: 100vh;
+ width: var(--td-drawer-width, 560rpx);
+ display: flex;
+ flex-direction: column;
+}
+.t-drawer--hover {
+ background-color: var(--td-drawer-hover-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-drawer__title {
+ font-weight: 600;
+ font-size: var(--td-drawer-title-font-size, 36rpx);
+ padding: 48rpx 32rpx 16rpx;
+ color: var(--td-drawer-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-drawer__sidebar {
+ height: var(--td-drawer-sidebar-height, 70vh);
+}
+.t-drawer__sidebar-item {
+ display: flex;
+ align-items: center;
+ position: relative;
+ padding-top: var(--td-drawer-item-padding, 32rpx);
+ padding-right: 0;
+ padding-bottom: var(--td-drawer-item-padding, 32rpx);
+ padding-left: var(--td-drawer-item-padding, 32rpx);
+ line-height: var(--td-drawer-item-height, 48rpx);
+}
+.t-drawer__sidebar-item::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-drawer-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-drawer__sidebar-item::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-drawer__sidebar-item::after {
+ left: var(--td-drawer-item-padding, 32rpx);
+}
+.t-drawer__sidebar-item-title {
+ flex: 1;
+ color: var(--td-drawer-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-drawer__sidebar-item-icon {
+ padding-right: 16rpx;
+ color: var(--td-drawer-item-icon-color, var(--td-drawer-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))));
+ font-size: var(--td-drawer-item-icon-size, 48rpx);
+}
+.t-drawer__footer {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ padding-bottom: var(--td-drawer-footer-padding-bottom, 40rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/props.d.ts b/miniprogram_npm/tdesign-miniprogram/drawer/props.d.ts
new file mode 100644
index 0000000..dbb379d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDrawerProps } from './type';
+declare const props: TdDrawerProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/props.js b/miniprogram_npm/tdesign-miniprogram/drawer/props.js
new file mode 100644
index 0000000..5101669
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/props.js
@@ -0,0 +1,33 @@
+const props = {
+ closeOnOverlayClick: {
+ type: Boolean,
+ value: true,
+ },
+ destroyOnClose: {
+ type: Boolean,
+ value: false,
+ },
+ items: {
+ type: Array,
+ },
+ placement: {
+ type: String,
+ value: 'right',
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ title: {
+ type: String,
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+ zIndex: {
+ type: Number,
+ value: 11500,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/type.d.ts b/miniprogram_npm/tdesign-miniprogram/drawer/type.d.ts
new file mode 100644
index 0000000..7efbbbe
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/type.d.ts
@@ -0,0 +1,42 @@
+export interface TdDrawerProps {
+ closeOnOverlayClick?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ destroyOnClose?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ items?: {
+ type: ArrayConstructor;
+ value?: DrawerItem[];
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'left' | 'right';
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
+export interface DrawerItem {
+ title: string;
+ icon: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/drawer/type.js b/miniprogram_npm/tdesign-miniprogram/drawer/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/drawer/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.d.ts
new file mode 100644
index 0000000..6f7f2c7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.d.ts
@@ -0,0 +1,48 @@
+import { RelationsOptions, SuperComponent } from '../common/src/index';
+import type { TdDropdownItemProps } from './type';
+export interface DropdownItemProps extends TdDropdownItemProps {
+}
+export default class DropdownMenuItem extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ properties: TdDropdownItemProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ show: boolean;
+ top: number;
+ maskHeight: number;
+ initValue: any;
+ hasChanged: boolean;
+ duration: string | number;
+ zIndex: number;
+ overlay: boolean;
+ labelAlias: string;
+ valueAlias: string;
+ computedLabel: string;
+ firstCheckedValue: string;
+ };
+ relations: RelationsOptions;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ keys(obj: any): void;
+ value(v: any): void;
+ 'label, computedLabel'(): void;
+ show(visible: any): void;
+ };
+ methods: {
+ closeDropdown(): void;
+ getParentBottom(cb: any): void;
+ handleTreeClick(e: any): void;
+ handleRadioChange(e: any): void;
+ handleMaskClick(): void;
+ handleReset(): void;
+ handleConfirm(): void;
+ onLeaved(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.js b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.js
new file mode 100644
index 0000000..a8e3e63
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.js
@@ -0,0 +1,158 @@
+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 menuProps from '../dropdown-menu/props';
+import { getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-dropdown-item`;
+let DropdownMenuItem = class DropdownMenuItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-column`,
+ `${prefix}-class-column-item`,
+ `${prefix}-class-column-item-label`,
+ `${prefix}-class-footer`,
+ ];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ show: false,
+ top: 0,
+ maskHeight: 0,
+ initValue: null,
+ hasChanged: false,
+ duration: menuProps.duration.value,
+ zIndex: menuProps.zIndex.value,
+ overlay: menuProps.showOverlay.value,
+ labelAlias: 'label',
+ valueAlias: 'value',
+ computedLabel: '',
+ firstCheckedValue: '',
+ };
+ this.relations = {
+ '../dropdown-menu/dropdown-menu': {
+ type: 'parent',
+ linked(target) {
+ const { zIndex, duration, showOverlay } = target.properties;
+ this.setData({
+ zIndex,
+ duration,
+ showOverlay,
+ });
+ },
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ keys(obj) {
+ this.setData({
+ labelAlias: obj.label || 'label',
+ valueAlias: obj.value || 'value',
+ });
+ },
+ value(v) {
+ const { options, labelAlias, valueAlias } = this.data;
+ if (this.data.multiple) {
+ if (!Array.isArray(v))
+ throw TypeError('应传入数组类型的 value');
+ }
+ const target = options.find((item) => item[valueAlias] === v);
+ if (target) {
+ this.setData({
+ computedLabel: target[labelAlias],
+ });
+ }
+ },
+ 'label, computedLabel'() {
+ var _a;
+ (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.getAllItems();
+ },
+ show(visible) {
+ if (visible) {
+ this.getParentBottom(() => {
+ this.setData({ wrapperVisible: true });
+ });
+ }
+ },
+ };
+ this.methods = {
+ closeDropdown() {
+ var _a;
+ (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.setData({
+ activeIdx: -1,
+ });
+ this.setData({
+ show: false,
+ });
+ this.triggerEvent('close');
+ },
+ getParentBottom(cb) {
+ getRect(this.$parent, `#${prefix}-bar`).then((rect) => {
+ this.setData({
+ top: rect.bottom,
+ maskHeight: rect.top,
+ }, cb);
+ });
+ },
+ handleTreeClick(e) {
+ const { level, value: itemValue } = e.currentTarget.dataset;
+ const { value } = this.data;
+ value[level] = itemValue;
+ this._trigger('change', { value });
+ },
+ handleRadioChange(e) {
+ const { value } = e.detail;
+ this._trigger('change', { value });
+ if (!this.data.multiple) {
+ this.closeDropdown();
+ }
+ else {
+ const firstChecked = this.data.options.find((item) => value.includes(item.value));
+ if (firstChecked) {
+ this.data.firstCheckedValue = firstChecked.value;
+ }
+ }
+ },
+ handleMaskClick() {
+ var _a;
+ if ((_a = this.$parent) === null || _a === void 0 ? void 0 : _a.properties.closeOnClickOverlay) {
+ this.closeDropdown();
+ }
+ },
+ handleReset() {
+ this._trigger('change', { value: [] });
+ this._trigger('reset');
+ },
+ handleConfirm() {
+ this._trigger('confirm', { value: this.data.value });
+ this.closeDropdown();
+ this.setData({ firstCheckedValue: this.data.firstCheckedValue });
+ },
+ onLeaved() {
+ this.setData({ wrapperVisible: false });
+ },
+ };
+ }
+};
+DropdownMenuItem = __decorate([
+ wxComponent()
+], DropdownMenuItem);
+export default DropdownMenuItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.json b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.json
new file mode 100644
index 0000000..60fb367
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.json
@@ -0,0 +1,12 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-button": "../button/button",
+ "t-radio": "../radio/radio",
+ "t-radio-group": "../radio-group/radio-group",
+ "t-checkbox": "../checkbox/checkbox",
+ "t-checkbox-group": "../checkbox-group/checkbox-group",
+ "t-popup": "../popup/popup"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.wxml b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.wxml
new file mode 100644
index 0000000..c75e3ad
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.wxml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.wxss b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.wxss
new file mode 100644
index 0000000..4df5049
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/dropdown-item.wxss
@@ -0,0 +1,135 @@
+.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);
+}
+/** dropdown-item */
+.t-dropdown-item {
+ position: fixed;
+ right: 0;
+ left: 0;
+ top: 0;
+ overflow: hidden;
+ bottom: 0;
+ /** 树形结构 */
+}
+.t-dropdown-item__content {
+ display: flex;
+ flex-direction: column;
+ z-index: 11600;
+ overflow: hidden;
+}
+.t-dropdown-item__popup-host {
+ display: block;
+ width: 100%;
+ height: max-content;
+ overflow: hidden;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+.t-dropdown-item__body {
+ flex: 1;
+ background: var(--td-dropdown-menu-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ overflow: auto;
+ max-height: var(--td-dropdown-body-max-height, 560rpx);
+}
+.t-dropdown-item__body--tree {
+ display: flex;
+ overflow: hidden;
+}
+.t-dropdown-item__body--multi {
+ padding-top: var(--td-spacer, 16rpx);
+ padding-bottom: var(--td-spacer, 16rpx);
+ overflow-y: auto;
+}
+.t-dropdown-item__scroll {
+ max-height: var(--td-dropdown-body-max-height, 560rpx);
+}
+.t-dropdown-item__footer {
+ display: flex;
+ background: var(--td-dropdown-menu-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ padding: 32rpx;
+ position: relative;
+}
+.t-dropdown-item__footer::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: unset;
+ left: unset;
+ right: unset;
+ background-color: var(--td-component-border, var(--td-gray-color-4, #dcdcdc));
+}
+.t-dropdown-item__footer::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-dropdown-item__footer-btn {
+ flex: 1;
+}
+.t-dropdown-item__footer-btn + .t-dropdown-item__footer-btn {
+ margin-left: 32rpx;
+}
+.t-dropdown-item__body:empty,
+.t-dropdown-item__footer:empty {
+ display: none;
+}
+.t-dropdown-item__radio,
+.t-dropdown-item__checkbox {
+ width: 100%;
+ overflow: scroll;
+ box-sizing: border-box;
+}
+.t-dropdown-item__radio-group,
+.t-dropdown-item__checkbox-group {
+ display: grid;
+ grid-gap: 24rpx;
+}
+.t-dropdown-item__radio-group {
+ display: grid;
+ grid-gap: 0rpx;
+}
+.t-dropdown-item__checkbox-group {
+ padding: 32rpx;
+}
+.t-dropdown-item__tree-item {
+ height: var(--td-tree-item-height, 96rpx);
+ line-height: var(--td-tree-item-height, 96rpx);
+ font-size: var(--td-tree-item-font-size, 32rpx);
+ padding-left: 32rpx;
+}
+.t-dropdown-item__tree-item--active {
+ color: var(--td-tree-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-dropdown-item__mask {
+ position: fixed;
+ width: 100vh;
+ top: 0;
+ left: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/index.wxs b/miniprogram_npm/tdesign-miniprogram/dropdown-item/index.wxs
new file mode 100644
index 0000000..e774f06
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/index.wxs
@@ -0,0 +1,9 @@
+var getStyles = function (top, zIndex) {
+ var topStyle = top ? 'top:' + top + 'px;' : '';
+ var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
+ return topStyle + zIndexStyle;
+};
+
+module.exports = {
+ getStyles: getStyles,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-item/props.d.ts
new file mode 100644
index 0000000..aa95de6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDropdownItemProps } from './type';
+declare const props: TdDropdownItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/props.js b/miniprogram_npm/tdesign-miniprogram/dropdown-item/props.js
new file mode 100644
index 0000000..4f6e90a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/props.js
@@ -0,0 +1,41 @@
+const props = {
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ keys: {
+ type: Object,
+ },
+ label: {
+ type: String,
+ value: '',
+ },
+ multiple: {
+ type: Boolean,
+ value: false,
+ },
+ options: {
+ type: Array,
+ value: [],
+ },
+ optionsColumns: {
+ type: null,
+ value: 1,
+ },
+ placement: {
+ type: String,
+ value: 'left',
+ },
+ value: {
+ type: null,
+ value: undefined,
+ },
+ defaultValue: {
+ type: null,
+ value: undefined,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-item/type.d.ts
new file mode 100644
index 0000000..ca43657
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/type.d.ts
@@ -0,0 +1,56 @@
+import { KeysType } from '../common/common';
+export interface TdDropdownItemProps {
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: [
+ 't-class',
+ 't-class-content',
+ 't-class-column',
+ 't-class-column-item',
+ 't-class-column-item-label',
+ 't-class-footer'
+ ];
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: KeysType;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ multiple?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ optionsColumns?: {
+ type: null;
+ value?: string | number;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'left' | 'right';
+ };
+ value?: {
+ type: null;
+ value?: DropdownValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: DropdownValue;
+ };
+}
+export interface DropdownOption {
+ label: string;
+ disabled: boolean;
+ value: DropdownValue;
+}
+export declare type DropdownValue = string | number | Array;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-item/type.js b/miniprogram_npm/tdesign-miniprogram/dropdown-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/README.en-US.md
new file mode 100644
index 0000000..27dfd72
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/README.en-US.md
@@ -0,0 +1,91 @@
+:: BASE_DOC ::
+
+## API
+
+### DropdownMenu 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
+arrow-icon | String / Object | 'caret-down-small' | \- | N
+close-on-click-overlay | Boolean | true | \- | N
+duration | String / Number | 200 | \- | N
+show-overlay | Boolean | true | \- | N
+z-index | Number | 11600 | \- | N
+
+### DropdownMenu Events
+
+name | params | description
+-- | -- | --
+close | \- | \-
+open | \- | \-
+
+### DropdownMenu External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-icon | \-
+t-class-item | \-
+t-class-label | \-
+
+
+### DropdownItem 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
+disabled | Boolean | false | \- | N
+footer | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+label | String | - | \- | N
+multiple | Boolean | false | \- | N
+options | Array | [] | Typescript:`Array` `interface DropdownOption { label: string; disabled: boolean; value: DropdownValue; }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dropdown-item/type.ts) | N
+options-columns | String / Number | 1 | \- | N
+options-layout | String | columns | `deprecated` | N
+placement | String | left | options: left/right | N
+value | String / Number / Array | undefined | Typescript:`DropdownValue ` `type DropdownValue = string \| number \| Array;`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dropdown-item/type.ts) | N
+default-value | String / Number / Array | undefined | uncontrolled property。Typescript:`DropdownValue ` `type DropdownValue = string \| number \| Array;`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dropdown-item/type.ts) | N
+
+### DropdownItem Events
+
+name | params | description
+-- | -- | --
+change | `(value: DropdownValue)` | \-
+close | \- | \-
+confirm | `(value: DropdownValue)` | \-
+reset | \- | \-
+
+### DropdownItem External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-column | \-
+t-class-column-item | \-
+t-class-column-item-label | \-
+t-class-content | \-
+t-class-footer | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-dropdown-menu-active-color | @brand-color | -
+--td-dropdown-menu-bg-color | @bg-color-container | -
+--td-dropdown-menu-border-width | 1px | -
+--td-dropdown-menu-color | @text-color-primary | -
+--td-dropdown-menu-disabled-color | @text-color-disabled | -
+--td-dropdown-menu-font-size | 28rpx | -
+--td-dropdown-menu-height | 96rpx | -
+--td-dropdown-menu-icon-size | 40rpx | -
+--td-dropdown-body-max-height | 560rpx | -
+--td-dropdown-menu-bg-color | @bg-color-container | -
+--td-tree-bg-color | @bg-color-container | -
+--td-tree-item-active-color | @brand-color | -
+--td-tree-item-font-size | 32rpx | -
+--td-tree-item-height | 96rpx | -
+--td-tree-root-bg-color | @bg-color-secondarycontainer | -
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/README.md b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/README.md
new file mode 100644
index 0000000..41e3b52
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/README.md
@@ -0,0 +1,138 @@
+---
+title: DropdownMenu 下拉菜单
+description: 菜单呈现数个并列的选项类目,用于整个页面的内容筛选,由菜单面板和菜单选项组成。
+spline: message
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.8.0 版本上线,请留意版本。
+
+
+## 引入
+
+### 引入组件
+
+在 `app.json` 或 `page.json` 中引入组件:
+
+```json
+"usingComponents": {
+ "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu",
+ "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 单选下拉菜单
+
+{{ single }}
+
+### 多列下拉菜单
+
+{{ multi }}
+
+### 树形下拉菜单
+
+{{ tree }}
+
+## API
+
+### DropdownMenu Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+arrow-icon | String / Object | 'caret-down-small' | 自定义箭头图标 | N
+close-on-click-overlay | Boolean | true | 是否在点击遮罩层后关闭菜单 | N
+duration | String / Number | 200 | 动画时长 | N
+show-overlay | Boolean | true | 是否显示遮罩层 | N
+z-index | Number | 11600 | 菜单栏 z-index 层级 | N
+
+### DropdownMenu Events
+
+名称 | 参数 | 描述
+-- | -- | --
+close | \- | 菜单关闭时触发
+open | \- | 菜单展开时触发
+
+### DropdownMenu External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-icon | 图标样式类
+t-class-item | 选项样式类
+t-class-label | 标签样式类
+
+
+### DropdownItem Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+disabled | Boolean | false | 是否禁用操作项 | N
+footer | Slot | - | 底部。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+label | String | - | 标题 | N
+multiple | Boolean | false | 是否多选 | N
+options | Array | [] | 选项数据。TS 类型:`Array` `interface DropdownOption { label: string; disabled: boolean; value: DropdownValue; }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dropdown-item/type.ts) | N
+options-columns | String / Number | 1 | 选项分栏(1-3) | N
+options-layout | String | columns | 已废弃。选项排列;不再支持 tree 布局,可与 treeSelect 配合使用 | N
+placement | String | left | 复选框和内容相对位置,仅单选菜单栏有效。可选项:left/right | N
+value | String / Number / Array | undefined | 选中值。TS 类型:`DropdownValue ` `type DropdownValue = string \| number \| Array;`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dropdown-item/type.ts) | N
+default-value | String / Number / Array | undefined | 选中值。非受控属性。TS 类型:`DropdownValue ` `type DropdownValue = string \| number \| Array;`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dropdown-item/type.ts) | N
+
+### DropdownItem Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: DropdownValue)` | 值改变时触发
+close | \- | 关闭时触发
+confirm | `(value: DropdownValue)` | 点击确认时触发
+reset | \- | 点击重置时触发
+
+### DropdownItem External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-column | 菜单列样式类
+t-class-column-item | 菜单列选项样式类
+t-class-column-item-label | 菜单列选项标签样式类
+t-class-content | 内容样式类
+t-class-footer | 底部样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-dropdown-menu-active-color | @brand-color | -
+--td-dropdown-menu-bg-color | @bg-color-container | -
+--td-dropdown-menu-border-width | 1px | -
+--td-dropdown-menu-color | @text-color-primary | -
+--td-dropdown-menu-disabled-color | @text-color-disabled | -
+--td-dropdown-menu-font-size | 28rpx | -
+--td-dropdown-menu-height | 96rpx | -
+--td-dropdown-menu-icon-size | 40rpx | -
+--td-dropdown-body-max-height | 560rpx | -
+--td-dropdown-menu-bg-color | @bg-color-container | -
+--td-tree-bg-color | @bg-color-container | -
+--td-tree-item-active-color | @brand-color | -
+--td-tree-item-font-size | 32rpx | -
+--td-tree-item-height | 96rpx | -
+--td-tree-root-bg-color | @bg-color-secondarycontainer | -
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.d.ts
new file mode 100644
index 0000000..c92f0e4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.d.ts
@@ -0,0 +1,33 @@
+import { RelationsOptions, SuperComponent } from '../common/src/index';
+import type { TdDropdownMenuProps } from './type';
+export interface DropdownMenuProps extends TdDropdownMenuProps {
+}
+export default class DropdownMenu extends SuperComponent {
+ externalClasses: string[];
+ properties: TdDropdownMenuProps;
+ nodes: any;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ menus: any;
+ activeIdx: number;
+ bottom: number;
+ _arrowIcon: {
+ name: string | object;
+ };
+ };
+ relations: RelationsOptions;
+ lifetimes: {
+ ready(): void;
+ };
+ observers: {
+ arrowIcon(v: any): void;
+ activeIdx(v: number): void;
+ };
+ methods: {
+ toggle(index: number): void;
+ getAllItems(): void;
+ handleToggle(e: WechatMiniprogram.BaseEvent): void;
+ noop(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js
new file mode 100644
index 0000000..e3f5ac8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js
@@ -0,0 +1,103 @@
+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 { calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-dropdown-menu`;
+let DropdownMenu = class DropdownMenu extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-item`, `${prefix}-class-label`, `${prefix}-class-icon`];
+ this.properties = props;
+ this.nodes = null;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ menus: null,
+ activeIdx: -1,
+ bottom: 0,
+ _arrowIcon: { name: props.arrowIcon.value },
+ };
+ this.relations = {
+ '../dropdown-item/dropdown-item': {
+ type: 'child',
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.getAllItems();
+ },
+ };
+ this.observers = {
+ arrowIcon(v) {
+ this.setData({
+ _arrowIcon: calcIcon(v),
+ });
+ },
+ activeIdx(v) {
+ this.triggerEvent(v === -1 ? 'close' : 'open');
+ },
+ };
+ this.methods = {
+ toggle(index) {
+ const { activeIdx, duration } = this.data;
+ const prevItem = this.$children[activeIdx];
+ const currItem = this.$children[index];
+ if (currItem === null || currItem === void 0 ? void 0 : currItem.data.disabled)
+ return;
+ if (activeIdx !== -1) {
+ prevItem.triggerEvent('close');
+ prevItem.setData({
+ show: false,
+ }, () => {
+ setTimeout(() => {
+ prevItem.triggerEvent('closed');
+ }, duration);
+ });
+ }
+ if (index == null || activeIdx === index) {
+ this.setData({
+ activeIdx: -1,
+ });
+ }
+ else {
+ currItem.triggerEvent('open');
+ this.setData({
+ activeIdx: index,
+ });
+ currItem.setData({
+ show: true,
+ }, () => {
+ setTimeout(() => {
+ currItem.triggerEvent('opened');
+ }, duration);
+ });
+ }
+ },
+ getAllItems() {
+ const menus = this.$children.map(({ data }) => ({
+ label: data.label || data.computedLabel,
+ disabled: data.disabled,
+ }));
+ this.setData({
+ menus,
+ });
+ },
+ handleToggle(e) {
+ const { index } = e.currentTarget.dataset;
+ this.toggle(index);
+ },
+ noop() { },
+ };
+ }
+};
+DropdownMenu = __decorate([
+ wxComponent()
+], DropdownMenu);
+export default DropdownMenu;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.json b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.wxml b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.wxml
new file mode 100644
index 0000000..52b7b98
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.wxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ {{item.label}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.wxss b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.wxss
new file mode 100644
index 0000000..f86c34b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.wxss
@@ -0,0 +1,86 @@
+.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-dropdown-menu {
+ display: flex;
+ height: var(--td-dropdown-menu-height, 96rpx);
+ background: var(--td-dropdown-menu-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ position: relative;
+}
+.t-dropdown-menu::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-component-border, var(--td-gray-color-4, #dcdcdc));
+}
+.t-dropdown-menu::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-dropdown-menu:after {
+ height: var(--td-dropdown-menu-border-width, 1px);
+}
+.t-dropdown-menu__item {
+ display: flex;
+ flex: 1;
+ align-items: center;
+ justify-content: center;
+ padding: 0 var(--td-spacer, 16rpx);
+ position: relative;
+ overflow: hidden;
+ color: var(--td-dropdown-menu-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-dropdown-menu__item--active {
+ color: var(--td-dropdown-menu-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-dropdown-menu__item--disabled {
+ color: var(--td-dropdown-menu-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-dropdown-menu__icon {
+ font-size: var(--td-dropdown-menu-icon-size, 40rpx);
+ padding: 4rpx;
+ box-sizing: border-box;
+ transition: transform 240ms ease;
+}
+.t-dropdown-menu__icon--active {
+ transform: rotate(180deg);
+}
+.t-dropdown-menu__icon:not(:empty) {
+ margin-left: 8rpx;
+}
+.t-dropdown-menu__title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: var(--td-dropdown-menu-font-size, 28rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/index.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/index.d.ts
new file mode 100644
index 0000000..dea9f1d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/index.d.ts
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './dropdown-menu';
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/index.js b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/index.js
new file mode 100644
index 0000000..dea9f1d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/index.js
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './dropdown-menu';
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/props.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/props.d.ts
new file mode 100644
index 0000000..b662f85
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDropdownMenuProps } from './type';
+declare const props: TdDropdownMenuProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/props.js b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/props.js
new file mode 100644
index 0000000..909cff6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/props.js
@@ -0,0 +1,23 @@
+const props = {
+ arrowIcon: {
+ type: null,
+ value: 'caret-down-small',
+ },
+ closeOnClickOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ duration: {
+ type: null,
+ value: 200,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ zIndex: {
+ type: Number,
+ value: 11600,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/type.d.ts b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/type.d.ts
new file mode 100644
index 0000000..07734f1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/type.d.ts
@@ -0,0 +1,22 @@
+export interface TdDropdownMenuProps {
+ arrowIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ closeOnClickOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ duration?: {
+ type: null;
+ value?: string | number;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/type.js b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/empty/README.en-US.md
new file mode 100644
index 0000000..cfdbbdd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/README.en-US.md
@@ -0,0 +1,33 @@
+:: BASE_DOC ::
+
+## API
+
+### Empty 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 | Slot | - | action block。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+description | String / Slot | - | empty component description。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Object | - | \- | N
+image | String / Slot | - | image url, or Image component props, or custom any node you need.。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+### Empty External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-description | \-
+t-class-image | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-empty-action-margin-top | @spacer-4 | -
+--td-empty-description-color | @font-gray-3 | -
+--td-empty-description-font-size | @font-size-base | -
+--td-empty-description-line-height | 44rpx | -
+--td-empty-description-margin-top | @spacer-2 | -
+--td-empty-icon-color | @font-gray-3 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/README.md b/miniprogram_npm/tdesign-miniprogram/empty/README.md
new file mode 100644
index 0000000..802b9a1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/README.md
@@ -0,0 +1,73 @@
+---
+title: Empty 空状态
+description: 用于空状态时的占位提示。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-empty": "tdesign-miniprogram/empty/empty"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 类型
+
+图标空状态
+
+{{ base }}
+
+自定义图片空状态
+
+{{ imageEmpty }}
+
+带操作空状态
+
+{{ buttonEmpty }}
+
+
+
+## API
+
+### Empty Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+action | Slot | - | 操作按钮。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+description | String / Slot | - | 描述文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。 | N
+image | String / Slot | - | 图片地址。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+### Empty External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-description | 描述样式类
+t-class-image | 图片样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-empty-action-margin-top | @spacer-4 | -
+--td-empty-description-color | @font-gray-3 | -
+--td-empty-description-font-size | @font-size-base | -
+--td-empty-description-line-height | 44rpx | -
+--td-empty-description-margin-top | @spacer-2 | -
+--td-empty-icon-color | @font-gray-3 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/empty.d.ts b/miniprogram_npm/tdesign-miniprogram/empty/empty.d.ts
new file mode 100644
index 0000000..cd582e0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/empty.d.ts
@@ -0,0 +1,15 @@
+import { SuperComponent } from '../common/src/index';
+export default class extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ properties: import("./type").TdEmptyProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ observers: {
+ icon(icon: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/empty.js b/miniprogram_npm/tdesign-miniprogram/empty/empty.js
new file mode 100644
index 0000000..7d99bf9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/empty.js
@@ -0,0 +1,36 @@
+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 props from './props';
+import config from '../common/config';
+import { setIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-empty`;
+let default_1 = class extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-description`, `${prefix}-class-image`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.observers = {
+ icon(icon) {
+ const obj = setIcon('icon', icon, '');
+ this.setData(Object.assign({}, obj));
+ },
+ };
+ }
+};
+default_1 = __decorate([
+ wxComponent()
+], default_1);
+export default default_1;
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/empty.json b/miniprogram_npm/tdesign-miniprogram/empty/empty.json
new file mode 100644
index 0000000..b7d275d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/empty.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/empty.wxml b/miniprogram_npm/tdesign-miniprogram/empty/empty.wxml
new file mode 100644
index 0000000..142b73c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/empty.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+ {{description}}
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/empty.wxss b/miniprogram_npm/tdesign-miniprogram/empty/empty.wxss
new file mode 100644
index 0000000..04c4a89
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/empty.wxss
@@ -0,0 +1,49 @@
+.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-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+.t-empty__icon {
+ font-size: 192rpx;
+ color: var(--td-empty-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-empty__thumb + .t-empty__description:not(:empty) {
+ margin-top: var(--td-empty-description-margin-top, var(--td-spacer-2, 32rpx));
+}
+.t-empty__description {
+ text-align: center;
+ color: var(--td-empty-description-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-empty-description-font-size, var(--td-font-size-base, 28rpx));
+ line-height: var(--td-empty-description-line-height, 44rpx);
+ white-space: pre-wrap;
+}
+.t-empty__description + .t-empty__actions:not(:empty) {
+ margin-top: var(--td-empty-action-margin-top, var(--td-spacer-4, 64rpx));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/props.d.ts b/miniprogram_npm/tdesign-miniprogram/empty/props.d.ts
new file mode 100644
index 0000000..6f04c79
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/props.d.ts
@@ -0,0 +1,3 @@
+import { TdEmptyProps } from './type';
+declare const props: TdEmptyProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/props.js b/miniprogram_npm/tdesign-miniprogram/empty/props.js
new file mode 100644
index 0000000..aa55217
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/props.js
@@ -0,0 +1,15 @@
+const props = {
+ description: {
+ type: String,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ icon: {
+ type: null,
+ },
+ image: {
+ type: String,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/type.d.ts b/miniprogram_npm/tdesign-miniprogram/empty/type.d.ts
new file mode 100644
index 0000000..8a319f3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/type.d.ts
@@ -0,0 +1,18 @@
+export interface TdEmptyProps {
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-description', 't-class-image', 't-class-actions'];
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/empty/type.js b/miniprogram_npm/tdesign-miniprogram/empty/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/empty/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/fab/README.en-US.md
new file mode 100644
index 0000000..a0f6a5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/README.en-US.md
@@ -0,0 +1,31 @@
+:: BASE_DOC ::
+
+## API
+
+### Fab Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+style | String | right: 16px; bottom: 32px; | \- | N
+custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
+button-props | Object | - | Typescript:`ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
+draggable | String / Boolean | false | Typescript:`boolean \| FabDirectionEnum ` `type FabDirectionEnum = 'all' \| 'vertical' \| 'horizontal'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
+icon | String | - | \- | N
+text | String | - | \- | N
+using-custom-navbar | Boolean | false | \- | N
+y-bounds | Array | - | Typescript:`Array` | N
+
+### Fab Events
+
+name | params | description
+-- | -- | --
+click | `({e: Event})` | \-
+drag-end | `(e: TouchEvent)` | \-
+drag-start | `(e: TouchEvent)` | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-fab-shadow | @shadow-2 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/README.md b/miniprogram_npm/tdesign-miniprogram/fab/README.md
new file mode 100644
index 0000000..3bcf05a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/README.md
@@ -0,0 +1,85 @@
+---
+title: Fab 悬浮按钮
+description: 当功能使用图标即可表意清楚时,可使用纯图标悬浮按钮,例如:添加、发布。
+spline: form
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.7.2 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+
+```json
+"usingComponents": {
+ "t-fab": "tdesign-miniprogram/fab/fab"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础使用
+
+{{ base }}
+
+### 进阶使用
+
+{{ advance }}
+
+### 可移动悬浮按钮
+
+{{ draggable }}
+
+## FAQ
+
+### 为什么通过 style/customStyle 设置 top/left 调整初试定位后,会使页面内容无法点击以及拖拽异常?
+
+由于 `position: fixed;` 会使得元素脱离文档流,它将悬浮于页面上方。同时,元素没有设置宽高,当同时使用 `top`、`right`、`bottom` 和 `left` 属性时,浏览器会根据给定的 `top`、`right`、`bottom` 和 `left` 创建一个矩形框来容纳元素及其内容,所以会出现元素覆盖页面内容及拖拽异常等问题。
+
+Fab 组件默认定位 `right: 16px; bottom: 32px;`,且拖拽功能也是通过调整 `right` 与 `bottom` 属性值实现,因此在使用 `Fab` 组件时,仅支持通过 `style/customStyle` 属性设置 `right/bottom` 来调整初试位置, 避免使用 `top/left`。
+
+
+## API
+
+### Fab Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | String | right: 16px; bottom: 32px; | 悬浮按钮的样式,常用于调整位置(即将废弃,建议使用 `style`) | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+button-props | Object | - | 透传至 Button 组件。TS 类型:`ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
+draggable | String / Boolean | false | 是否可拖拽。`true` / `'all'`可拖动
`'vertical'`可垂直拖动
`'horizontal'`可水平拖动
`false`禁止拖动。TS 类型:`boolean \| FabDirectionEnum ` `type FabDirectionEnum = 'all' \| 'vertical' \| 'horizontal'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
+icon | String | - | 图标 | N
+text | String | - | 文本内容 | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+y-bounds | Array | - | 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80]。TS 类型:`Array` | N
+
+### Fab Events
+
+名称 | 参数 | 描述
+-- | -- | --
+click | `({e: Event})` | 悬浮按钮点击事件
+drag-end | `(e: TouchEvent)` | 结束拖拽时触发
+drag-start | `(e: TouchEvent)` | 开始拖拽时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-fab-shadow | @shadow-2 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.d.ts
new file mode 100644
index 0000000..9a5320c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.d.ts
@@ -0,0 +1,21 @@
+import { SuperComponent } from '../../common/src/index';
+import type { TdDraggableProps } from './type';
+export interface DraggableProps extends TdDraggableProps {
+}
+export default class Draggable extends SuperComponent {
+ properties: TdDraggableProps;
+ externalClasses: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ onTouchStart(e: any): void;
+ onTouchMove(e: any): void;
+ onTouchEnd(e: any): Promise;
+ computedRect(): Promise;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.js b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.js
new file mode 100644
index 0000000..e21089f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.js
@@ -0,0 +1,81 @@
+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 config from '../../common/config';
+import props from './props';
+import { getRect, systemInfo } from '../../common/utils';
+const { prefix } = config;
+const name = `${prefix}-draggable`;
+let Draggable = class Draggable extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.properties = props;
+ this.externalClasses = [`${prefix}-class`];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.lifetimes = {
+ ready() {
+ this.computedRect();
+ },
+ };
+ this.methods = {
+ onTouchStart(e) {
+ if (this.properties.direction === 'none')
+ return;
+ this.startX = e.touches[0].clientX + systemInfo.windowWidth - this.rect.right;
+ this.startY = e.touches[0].clientY + systemInfo.windowHeight - this.rect.bottom;
+ this.triggerEvent('start', { startX: this.startX, startY: this.startY, rect: this.rect, e });
+ },
+ onTouchMove(e) {
+ if (this.properties.direction === 'none')
+ return;
+ let x = this.startX - e.touches[0].clientX;
+ let y = this.startY - e.touches[0].clientY;
+ if (this.properties.direction === 'vertical') {
+ x = systemInfo.windowWidth - this.rect.right;
+ }
+ if (this.properties.direction === 'horizontal') {
+ y = systemInfo.windowHeight - this.rect.bottom;
+ }
+ this.triggerEvent('move', { x, y, rect: this.rect, e });
+ },
+ onTouchEnd(e) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this.properties.direction === 'none')
+ return;
+ yield this.computedRect();
+ this.triggerEvent('end', { rect: this.rect, e });
+ });
+ },
+ computedRect() {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.rect = { right: 0, bottom: 0, width: 0, height: 0 };
+ try {
+ this.rect = yield getRect(this, `.${this.data.classPrefix}`);
+ }
+ catch (e) {
+ }
+ });
+ },
+ };
+ }
+};
+Draggable = __decorate([
+ wxComponent()
+], Draggable);
+export default Draggable;
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.json b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.json
new file mode 100644
index 0000000..a89ef4d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.wxml b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.wxml
new file mode 100644
index 0000000..18b3022
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.wxml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.wxss b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.wxss
new file mode 100644
index 0000000..350c759
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/draggable.wxss
@@ -0,0 +1,30 @@
+.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-draggable {
+ position: fixed;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/index.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/draggable/index.d.ts
new file mode 100644
index 0000000..6c4d04d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './draggable';
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/index.js b/miniprogram_npm/tdesign-miniprogram/fab/draggable/index.js
new file mode 100644
index 0000000..6c4d04d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './draggable';
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/props.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/draggable/props.d.ts
new file mode 100644
index 0000000..65e51bb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDraggableProps } from './type';
+declare const props: TdDraggableProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/props.js b/miniprogram_npm/tdesign-miniprogram/fab/draggable/props.js
new file mode 100644
index 0000000..27b0bde
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/props.js
@@ -0,0 +1,7 @@
+const props = {
+ direction: {
+ type: String,
+ value: 'all',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/type.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/draggable/type.d.ts
new file mode 100644
index 0000000..580f63d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/type.d.ts
@@ -0,0 +1,6 @@
+export interface TdDraggableProps {
+ direction?: {
+ type: StringConstructor;
+ value?: 'all' | 'vertical' | 'horizontal' | 'none';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/draggable/type.js b/miniprogram_npm/tdesign-miniprogram/fab/draggable/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/draggable/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/fab.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/fab.d.ts
new file mode 100644
index 0000000..7c4503d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/fab.d.ts
@@ -0,0 +1,27 @@
+import { SuperComponent } from '../common/src/index';
+export default class Fab extends SuperComponent {
+ behaviors: string[];
+ properties: import("./type").TdFabProps;
+ externalClasses: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ buttonData: {
+ size: string;
+ shape: string;
+ theme: string;
+ tClass: string;
+ };
+ moveStyle: any;
+ };
+ observers: {
+ 'buttonProps.**, icon, text, ariaLabel, yBounds'(): void;
+ };
+ methods: {
+ onTplButtonTap(e: any): void;
+ onStart(e: any): void;
+ onMove(e: any): void;
+ onEnd(e: any): void;
+ computedSize(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/fab.js b/miniprogram_npm/tdesign-miniprogram/fab/fab.js
new file mode 100644
index 0000000..52af69e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/fab.js
@@ -0,0 +1,80 @@
+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 useCustomNavbar from '../mixins/using-custom-navbar';
+import { unitConvert, systemInfo } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-fab`;
+const baseButtonProps = {
+ size: 'large',
+ shape: 'circle',
+ theme: 'primary',
+ tClass: `${prefix}-fab__button`,
+};
+let Fab = class Fab extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [useCustomNavbar];
+ this.properties = props;
+ this.externalClasses = [`class`, `${prefix}-class`, `${prefix}-class-button`];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ buttonData: baseButtonProps,
+ moveStyle: null,
+ };
+ this.observers = {
+ 'buttonProps.**, icon, text, ariaLabel, yBounds'() {
+ var _a;
+ this.setData({
+ buttonData: Object.assign(Object.assign(Object.assign(Object.assign({}, baseButtonProps), { shape: this.properties.text ? 'round' : 'circle', icon: this.properties.icon }), this.properties.buttonProps), { content: this.properties.text, ariaLabel: this.properties.ariaLabel }),
+ }, (_a = this.computedSize) === null || _a === void 0 ? void 0 : _a.bind(this));
+ },
+ };
+ this.methods = {
+ onTplButtonTap(e) {
+ this.triggerEvent('click', e);
+ },
+ onStart(e) {
+ this.triggerEvent('dragstart', e.detail.e);
+ },
+ onMove(e) {
+ const { yBounds } = this.properties;
+ const { distanceTop } = this.data;
+ const { x, y, rect } = e.detail;
+ const maxX = systemInfo.windowWidth - rect.width;
+ const maxY = systemInfo.windowHeight - Math.max(distanceTop, unitConvert(yBounds[0])) - rect.height;
+ const right = Math.max(0, Math.min(x, maxX));
+ const bottom = Math.max(0, unitConvert(yBounds[1]), Math.min(y, maxY));
+ this.setData({
+ moveStyle: `right: ${right}px; bottom: ${bottom}px;`,
+ });
+ },
+ onEnd(e) {
+ this.triggerEvent('dragend', e.detail.e);
+ },
+ computedSize() {
+ var _a, _b;
+ if (!this.properties.draggable)
+ return;
+ const insChild = this.selectComponent('#draggable');
+ if ((_b = (_a = this.properties) === null || _a === void 0 ? void 0 : _a.yBounds) === null || _b === void 0 ? void 0 : _b[1]) {
+ this.setData({ moveStyle: `bottom: ${unitConvert(this.properties.yBounds[1])}px` }, insChild.computedRect);
+ }
+ else {
+ insChild.computedRect();
+ }
+ },
+ };
+ }
+};
+Fab = __decorate([
+ wxComponent()
+], Fab);
+export default Fab;
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/fab.json b/miniprogram_npm/tdesign-miniprogram/fab/fab.json
new file mode 100644
index 0000000..04d333f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/fab.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-button": "../button/button",
+ "t-draggable": "./draggable/draggable"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/fab.wxml b/miniprogram_npm/tdesign-miniprogram/fab/fab.wxml
new file mode 100644
index 0000000..231fc4e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/fab.wxml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/fab.wxss b/miniprogram_npm/tdesign-miniprogram/fab/fab.wxss
new file mode 100644
index 0000000..e5f8e51
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/fab.wxss
@@ -0,0 +1,36 @@
+.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-fab {
+ position: fixed;
+}
+.t-fab__button {
+ box-shadow: var(--td-fab-shadow, var(--td-shadow-2, 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06), 0 5px 5px -3px rgba(0, 0, 0, 0.1)));
+}
+.t-fab__draggable {
+ position: fixed;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/props.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/props.d.ts
new file mode 100644
index 0000000..2cf4647
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/props.d.ts
@@ -0,0 +1,3 @@
+import { TdFabProps } from './type';
+declare const props: TdFabProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/props.js b/miniprogram_npm/tdesign-miniprogram/fab/props.js
new file mode 100644
index 0000000..b9c6e26
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/props.js
@@ -0,0 +1,29 @@
+const props = {
+ buttonProps: {
+ type: Object,
+ },
+ draggable: {
+ type: null,
+ value: false,
+ },
+ icon: {
+ type: String,
+ value: '',
+ },
+ style: {
+ type: String,
+ value: 'right: 16px; bottom: 32px;',
+ },
+ text: {
+ type: String,
+ value: '',
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ yBounds: {
+ type: Array,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/template/draggable.wxml b/miniprogram_npm/tdesign-miniprogram/fab/template/draggable.wxml
new file mode 100644
index 0000000..fd12176
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/template/draggable.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/template/view.wxml b/miniprogram_npm/tdesign-miniprogram/fab/template/view.wxml
new file mode 100644
index 0000000..ef7b1a1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/template/view.wxml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/type.d.ts b/miniprogram_npm/tdesign-miniprogram/fab/type.d.ts
new file mode 100644
index 0000000..722cf6d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/type.d.ts
@@ -0,0 +1,32 @@
+import { ButtonProps } from '../button/index';
+export interface TdFabProps {
+ buttonProps?: {
+ type: ObjectConstructor;
+ value?: ButtonProps;
+ };
+ draggable?: {
+ type: null;
+ value?: boolean | FabDirectionEnum;
+ };
+ icon?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ yBounds?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+}
+export declare type FabDirectionEnum = 'all' | 'vertical' | 'horizontal';
diff --git a/miniprogram_npm/tdesign-miniprogram/fab/type.js b/miniprogram_npm/tdesign-miniprogram/fab/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/fab/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/footer/README.en-US.md
new file mode 100644
index 0000000..b063af4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/README.en-US.md
@@ -0,0 +1,37 @@
+:: BASE_DOC ::
+
+## API
+
+### Footer 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
+copyright | String | '' | `deprecated` | N
+links | Array | [] | `1.0.0`。Typescript:`Array` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
+logo | Object | - | Typescript:`FooterLogo` `interface FooterLogo { icon: string; title?: string; url?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
+text | String | '' | `1.0.0` | N
+text-link-list | Array | [] | `deprecated`。Typescript:`Array` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
+theme | String | 'text' | `deprecated`。options: text/logo | N
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-footer-link-color | @brand-color | -
+--td-footer-link-dividing-line-color | @font-gray-3 | -
+--td-footer-link-dividing-line-padding | @spacer-1 | -
+--td-footer-link-font-size | @font-size-s | -
+--td-footer-link-line-height | 40rpx | -
+--td-footer-logo-icon-height | 48rpx | -
+--td-footer-logo-icon-margin-right | @spacer | -
+--td-footer-logo-icon-width | 48rpx | -
+--td-footer-logo-title-font-size | @font-size-m | -
+--td-footer-logo-title-line-height | 48rpx | -
+--td-footer-logo-title-url-width | 256rpx | -
+--td-footer-text-color | @font-gray-3 | -
+--td-footer-text-font-size | @font-size-s | -
+--td-footer-text-line-height | 40rpx | -
+--td-footer-text-margin-top | 8rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/README.md b/miniprogram_npm/tdesign-miniprogram/footer/README.md
new file mode 100644
index 0000000..4acbfd8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/README.md
@@ -0,0 +1,77 @@
+---
+title: Footer 页脚
+description: 用于基础列表展示,可附带文字、品牌 logo、操作,常用商详、个人中心、设置等页面。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-footer": "tdesign-miniprogram/footer/footer"
+}
+```
+
+## 代码演示
+
+
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 类型
+
+基础页脚
+
+{{ base }}
+
+基础加链接页脚
+
+{{ link }}
+
+品牌页脚
+
+{{ logo }}
+
+## API
+
+### Footer Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+copyright | String | '' | 已废弃。版权信息,type 为`text`生效 | N
+links | Array | [] | `1.0.0`。链接列表。name 表示链接名称, url 表示链接 page 路径,目前只支持小程序内部跳转,openType 表示跳转方式。TS 类型:`Array` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
+logo | Object | - | 图标配置。`logo.icon` 表示图标链接地址,`logo.title` 表示标题文本,`logo.url` 表示链接。TS 类型:`FooterLogo` `interface FooterLogo { icon: string; title?: string; url?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
+text | String | '' | `1.0.0`。版权信息 | N
+text-link-list | Array | [] | 已废弃。链接列表,type 为`text`生效。name 表示链接名称, url 表示链接 page 路径,目前只支持小程序内部跳转,openType 表示跳转方式。TS 类型:`Array` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
+theme | String | 'text' | 已废弃。页脚展示类型。可选项:text/logo | N
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-footer-link-color | @brand-color | -
+--td-footer-link-dividing-line-color | @font-gray-3 | -
+--td-footer-link-dividing-line-padding | @spacer-1 | -
+--td-footer-link-font-size | @font-size-s | -
+--td-footer-link-line-height | 40rpx | -
+--td-footer-logo-icon-height | 48rpx | -
+--td-footer-logo-icon-margin-right | @spacer | -
+--td-footer-logo-icon-width | 48rpx | -
+--td-footer-logo-title-font-size | @font-size-m | -
+--td-footer-logo-title-line-height | 48rpx | -
+--td-footer-logo-title-url-width | 256rpx | -
+--td-footer-text-color | @font-gray-3 | -
+--td-footer-text-font-size | @font-size-s | -
+--td-footer-text-line-height | 40rpx | -
+--td-footer-text-margin-top | 8rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/footer.d.ts b/miniprogram_npm/tdesign-miniprogram/footer/footer.d.ts
new file mode 100644
index 0000000..6ffe46b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/footer.d.ts
@@ -0,0 +1,9 @@
+import { SuperComponent } from '../common/src/index';
+export default class Footer extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdFooterProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/footer.js b/miniprogram_npm/tdesign-miniprogram/footer/footer.js
new file mode 100644
index 0000000..a640f75
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/footer.js
@@ -0,0 +1,26 @@
+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}-footer`;
+let Footer = class Footer extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ }
+};
+Footer = __decorate([
+ wxComponent()
+], Footer);
+export default Footer;
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/footer.json b/miniprogram_npm/tdesign-miniprogram/footer/footer.json
new file mode 100644
index 0000000..bdf8a57
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/footer.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/footer.wxml b/miniprogram_npm/tdesign-miniprogram/footer/footer.wxml
new file mode 100644
index 0000000..56e8d99
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/footer.wxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+ {{logo.title}}
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ |
+
+
+ {{text}}
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/footer.wxss b/miniprogram_npm/tdesign-miniprogram/footer/footer.wxss
new file mode 100644
index 0000000..9807f94
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/footer.wxss
@@ -0,0 +1,78 @@
+.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-footer {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+}
+.t-footer__text {
+ font-size: var(--td-footer-text-font-size, var(--td-font-size-s, 24rpx));
+ line-height: var(--td-footer-text-line-height, 40rpx);
+ color: var(--td-footer-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-footer__link-list + .t-footer__text:not(:empty) {
+ margin-top: var(--td-footer-text-margin-top, 8rpx);
+}
+.t-footer__link-list {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.t-footer__link-item {
+ color: var(--td-footer-link-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-size: var(--td-footer-link-font-size, var(--td-font-size-s, 24rpx));
+ line-height: var(--td-footer-link-line-height, 40rpx);
+ text-decoration: underline;
+}
+.t-footer__link-line {
+ font-size: 24rpx;
+ color: var(--td-footer-link-dividing-line-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ display: inline-block;
+ padding: 0 var(--td-footer-link-dividing-line-padding, var(--td-spacer-1, 24rpx));
+}
+.t-footer__logo {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.t-footer__icon {
+ width: var(--td-footer-logo-icon-width, 48rpx);
+ height: var(--td-footer-logo-icon-height, 48rpx);
+ margin-right: var(--td-footer-logo-icon-margin-right, var(--td-spacer, 16rpx));
+}
+.t-footer__title {
+ color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ font-weight: bold;
+ font-size: var(--td-footer-logo-title-font-size, var(--td-font-size-m, 32rpx));
+ line-height: var(--td-footer-logo-title-line-height, 48rpx);
+ font-style: italic;
+}
+.t-footer__title-url {
+ width: var(--td-footer-logo-title-url-width, 256rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/props.d.ts b/miniprogram_npm/tdesign-miniprogram/footer/props.d.ts
new file mode 100644
index 0000000..f9a5618
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/props.d.ts
@@ -0,0 +1,3 @@
+import { TdFooterProps } from './type';
+declare const props: TdFooterProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/props.js b/miniprogram_npm/tdesign-miniprogram/footer/props.js
new file mode 100644
index 0000000..f61b9ac
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/props.js
@@ -0,0 +1,14 @@
+const props = {
+ links: {
+ type: Array,
+ value: [],
+ },
+ logo: {
+ type: Object,
+ },
+ text: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/type.d.ts b/miniprogram_npm/tdesign-miniprogram/footer/type.d.ts
new file mode 100644
index 0000000..1a69105
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/type.d.ts
@@ -0,0 +1,24 @@
+export interface TdFooterProps {
+ links?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ logo?: {
+ type: ObjectConstructor;
+ value?: FooterLogo;
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
+export interface LinkObj {
+ name: string;
+ url?: string;
+ openType?: 'navigate' | 'redirect' | 'relaunch' | 'switchTab' | 'navigateBack';
+}
+export interface FooterLogo {
+ icon: string;
+ title?: string;
+ url?: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/footer/type.js b/miniprogram_npm/tdesign-miniprogram/footer/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/footer/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts
new file mode 100644
index 0000000..4c43196
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts
@@ -0,0 +1,31 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class GridItem extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ relations: RelationsOptions;
+ properties: import("./type").TdGridItemProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ gridItemStyle: string;
+ gridItemWrapperStyle: string;
+ gridItemContentStyle: string;
+ align: string;
+ column: number;
+ describedbyID: string;
+ };
+ observers: {
+ icon(icon: any): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ updateStyle(): void;
+ getWidthStyle(): string;
+ getPaddingStyle(): string;
+ getBorderStyle(): string;
+ onClick(e: any): void;
+ jumpLink(): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js
new file mode 100644
index 0000000..33397e9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js
@@ -0,0 +1,130 @@
+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, isObject } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { uniqueFactory, setIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-grid-item`;
+const getUniqueID = uniqueFactory('grid_item');
+var LinkTypes;
+(function (LinkTypes) {
+ LinkTypes["redirect-to"] = "redirectTo";
+ LinkTypes["switch-tab"] = "switchTab";
+ LinkTypes["relaunch"] = "reLaunch";
+ LinkTypes["navigate-to"] = "navigateTo";
+})(LinkTypes || (LinkTypes = {}));
+let GridItem = class GridItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-image`,
+ `${prefix}-class-text`,
+ `${prefix}-class-description`,
+ ];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.relations = {
+ '../grid/grid': {
+ type: 'ancestor',
+ linked(target) {
+ this.parent = target;
+ this.updateStyle();
+ this.setData({
+ column: target.data.column,
+ });
+ },
+ },
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ gridItemStyle: '',
+ gridItemWrapperStyle: '',
+ gridItemContentStyle: '',
+ align: 'center',
+ column: 0,
+ describedbyID: '',
+ };
+ this.observers = {
+ icon(icon) {
+ const obj = setIcon('icon', icon, '');
+ this.setData(Object.assign({}, obj));
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.setData({
+ describedbyID: getUniqueID(),
+ });
+ },
+ };
+ }
+ updateStyle() {
+ const { hover, align } = this.parent.properties;
+ const gridItemStyles = [];
+ const gridItemWrapperStyles = [];
+ const gridItemContentStyles = [];
+ const widthStyle = this.getWidthStyle();
+ const paddingStyle = this.getPaddingStyle();
+ const borderStyle = this.getBorderStyle();
+ widthStyle && gridItemStyles.push(widthStyle);
+ paddingStyle && gridItemWrapperStyles.push(paddingStyle);
+ borderStyle && gridItemContentStyles.push(borderStyle);
+ this.setData({
+ gridItemStyle: `${gridItemStyles.join(';')}`,
+ gridItemWrapperStyle: gridItemWrapperStyles.join(';'),
+ gridItemContentStyle: gridItemContentStyles.join(';'),
+ hover,
+ layout: this.properties.layout,
+ align: align,
+ });
+ }
+ getWidthStyle() {
+ const { column } = this.parent.properties;
+ return column > 0 ? `width:${(1 / column) * 100}%` : '';
+ }
+ getPaddingStyle() {
+ const { gutter } = this.parent.properties;
+ if (gutter)
+ return `padding-left:${gutter}rpx;padding-top:${gutter}rpx`;
+ return '';
+ }
+ getBorderStyle() {
+ const { gutter } = this.parent.properties;
+ let { border } = this.parent.properties;
+ if (!border)
+ return '';
+ if (!isObject(border))
+ border = {};
+ const { color = '#266FE8', width = 2, style = 'solid' } = border;
+ if (gutter)
+ return `border:${width}rpx ${style} ${color}`;
+ return `border-top:${width}rpx ${style} ${color};border-left:${width}rpx ${style} ${color}`;
+ }
+ onClick(e) {
+ const { item } = e.currentTarget.dataset;
+ this.triggerEvent('click', item);
+ this.jumpLink();
+ }
+ jumpLink() {
+ const { url, jumpType } = this.properties;
+ if (url && jumpType) {
+ if (LinkTypes[jumpType]) {
+ wx[LinkTypes[jumpType]]({ url });
+ }
+ }
+ }
+};
+GridItem = __decorate([
+ wxComponent()
+], GridItem);
+export default GridItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json
new file mode 100644
index 0000000..a707ea9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-image": "../image/image",
+ "t-icon": "../icon/icon",
+ "t-badge": "../badge/badge"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml
new file mode 100644
index 0000000..1c53204
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml
@@ -0,0 +1,79 @@
+
+
+
+ module.exports.getImageSize = function(column) { if (column >= 5) return 'small'; if (column == 4) return 'middle';
+ return 'large'; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{text}}
+
+
+
+ {{description}}
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss
new file mode 100644
index 0000000..c2daddc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss
@@ -0,0 +1,130 @@
+.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-grid-item {
+ box-sizing: border-box;
+ height: 100%;
+ display: inline-block;
+ vertical-align: top;
+ background-color: var(--td-grid-item-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-grid-item--hover {
+ background-color: var(--td-grid-item-hover-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-grid-item--auto-size {
+ width: 168rpx;
+}
+.t-grid-item__content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ overflow: hidden;
+ position: relative;
+ padding: var(--td-grid-item-padding, 32rpx) 0 24rpx;
+}
+.t-grid-item__content--horizontal {
+ flex-direction: row;
+ padding-left: var(--td-grid-item-padding, 32rpx);
+}
+.t-grid-item__content--left {
+ justify-self: flex-start;
+ align-items: flex-start;
+}
+.t-grid-item__content--left .t-grid-item__words {
+ text-align: left;
+}
+.t-grid-item__words {
+ width: 100%;
+ text-align: center;
+ position: relative;
+ flex-direction: column;
+ display: flex;
+ flex: 1;
+ justify-content: center;
+ align-items: center;
+}
+.t-grid-item__words--horizontal {
+ margin-left: 24rpx;
+}
+.t-grid-item__words:empty {
+ display: none;
+}
+.t-grid-item__image:not(:empty) {
+ width: var(--td-grid-item-image-width, 96rpx);
+ height: var(--td-grid-item-image-width, 96rpx);
+}
+.t-grid-item__image:not(:empty).t-grid-item__image--small {
+ width: var(--td-grid-item-image-small-width, 64rpx);
+ height: var(--td-grid-item-image-small-width, 64rpx);
+}
+.t-grid-item__image:not(:empty).t-grid-item__image--middle {
+ width: var(--td-grid-item-image-middle-width, 80rpx);
+ height: var(--td-grid-item-image-middle-width, 80rpx);
+}
+.t-grid-item__image:not(:empty) .t-grid__image {
+ width: 100%;
+ height: 100%;
+}
+.t-grid-item__image--icon {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+ border-radius: var(--td-radius-default, 12rpx);
+}
+.t-grid-item__text {
+ width: inherit;
+ color: var(--td-grid-item-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-grid-item-text-font-size, 28rpx);
+ line-height: var(--td-grid-item-text-line-height, 44rpx);
+ padding-top: var(--td-grid-item-text-padding-top, 16rpx);
+}
+.t-grid-item__text--small {
+ font-size: var(--td-grid-item-text-small-font-size, 24rpx);
+}
+.t-grid-item__text--middle {
+ font-size: var(--td-grid-item-text-middle-font-size, 24rpx);
+}
+.t-grid-item__text--horizontal {
+ padding-top: 0;
+ text-align: left;
+}
+.t-grid-item__description {
+ padding-top: var(--td-grid-item-description-padding-top, 0);
+ width: inherit;
+ color: var(--td-grid-item-description-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-grid-item-description-font-size, 24rpx);
+ line-height: var(--td-grid-item-description-line-height, 40rpx);
+}
+.t-grid-item__description--horizontal {
+ margin-top: var(--td-grid-item-horizontal-text-description-top, 0);
+ padding-left: var(--td-grid-item-horizontal-text-padding-left, 0);
+ text-align-last: left;
+}
+.t-grid-item__icon {
+ font-size: 48rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts
new file mode 100644
index 0000000..bd6c2fb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdGridItemProps } from './type';
+declare const props: TdGridItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/props.js b/miniprogram_npm/tdesign-miniprogram/grid-item/props.js
new file mode 100644
index 0000000..8c70df0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/props.js
@@ -0,0 +1,34 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ value: null,
+ },
+ description: {
+ type: String,
+ },
+ icon: {
+ type: null,
+ },
+ image: {
+ type: String,
+ },
+ imageProps: {
+ type: Object,
+ },
+ jumpType: {
+ type: String,
+ value: 'navigate-to',
+ },
+ layout: {
+ type: String,
+ value: 'vertical',
+ },
+ text: {
+ type: String,
+ },
+ url: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts
new file mode 100644
index 0000000..f4dc902
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts
@@ -0,0 +1,40 @@
+import { BadgeProps } from '../badge/index';
+import { ImageProps } from '../image/index';
+export interface TdGridItemProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: BadgeProps;
+ };
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ imageProps?: {
+ type: ObjectConstructor;
+ value?: ImageProps;
+ };
+ jumpType?: {
+ type: StringConstructor;
+ value?: 'redirect-to' | 'switch-tab' | 'relaunch' | 'navigate-to';
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: 'vertical' | 'horizontal';
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ url?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/type.js b/miniprogram_npm/tdesign-miniprogram/grid-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md
new file mode 100644
index 0000000..b7ed1a8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md
@@ -0,0 +1,79 @@
+:: BASE_DOC ::
+
+## API
+
+### Grid 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
+align | String | center | options: left/center | N
+border | Boolean / Object | false | Typescript:`boolean \| { color?: string; width?: string; style?: 'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'groove' \| 'inset' \| 'outset' }` | N
+column | Number | 4 | \- | N
+gutter | Number | - | \- | N
+hover | Boolean | false | \- | N
+theme | String | default | options: default/card | N
+### Grid External Classes
+
+className | Description
+-- | --
+t-class | \-
+
+
+### GridItem 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
+badge-props | Object | null | Typescript:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/grid-item/type.ts) | N
+description | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Object | - | \- | N
+image | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+image-props | Object | - | Typescript:`ImageProps`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/grid-item/type.ts) | N
+jump-type | String | navigate-to | options: redirect-to/switch-tab/relaunch/navigate-to | N
+layout | String | vertical | options: vertical/horizontal | N
+text | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+url | String | - | \- | N
+
+### GridItem Events
+
+name | params | description
+-- | -- | --
+click | \- | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+### GridItem External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+t-class-description | \-
+t-class-image | \-
+t-class-text | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-grid-bg-color | @bg-color-container | -
+--td-grid-card-radius | @radius-large | -
+--td-grid-item-bg-color | @bg-color-container | -
+--td-grid-item-description-color | @font-gray-3 | -
+--td-grid-item-description-font-size | 24rpx | -
+--td-grid-item-description-line-height | 40rpx | -
+--td-grid-item-description-padding-top | 8rpx | -
+--td-grid-item-horizontal-text-description-top | 4rpx | -
+--td-grid-item-horizontal-text-padding-left | 24rpx | -
+--td-grid-item-hover-bg-color | @bg-color-secondarycontainer | -
+--td-grid-item-image-middle-width | 80rpx | -
+--td-grid-item-image-small-width | 64rpx | -
+--td-grid-item-image-width | 96rpx | -
+--td-grid-item-padding | 32rpx | -
+--td-grid-item-text-color | @font-gray-1 | -
+--td-grid-item-text-font-size | 28rpx | -
+--td-grid-item-text-line-height | 44rpx | -
+--td-grid-item-text-middle-font-size | 24rpx | -
+--td-grid-item-text-padding-top | 16rpx | -
+--td-grid-item-text-small-font-size | 24rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/README.md b/miniprogram_npm/tdesign-miniprogram/grid/README.md
new file mode 100644
index 0000000..93499f4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/README.md
@@ -0,0 +1,140 @@
+---
+title: Grid 宫格
+description: 用于功能入口布局,将页面或特定区域切分成若干等大的区块,形成若干功能入口。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-grid": "tdesign-miniprogram/grid/grid",
+ "t-grid-item": "tdesign-miniprogram/grid-item/grid-item"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+基础宫格
+
+{{ base }}
+
+带说明的宫格
+
+{{ description }}
+
+带边框的宫格
+
+{{ border }}
+
+带徽章的宫格
+
+{{ badge }}
+
+可滑动的宫格
+
+{{ scroll }}
+
+### 组件样式
+
+可传图标的宫格
+
+{{ icon-grid }}
+
+多行宫格
+
+{{ multiple }}
+
+卡片宫格
+
+{{ card }}
+
+
+## API
+
+### Grid Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+align | String | center | 内容对齐方式。可选项:left/center | N
+border | Boolean / Object | false | 边框,默认不显示。值为 true 则显示默认边框,值类型为 object 则表示自定义边框样式。TS 类型:`boolean \| { color?: string; width?: string; style?: 'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'groove' \| 'inset' \| 'outset' }` | N
+column | Number | 4 | 每一行的列数量;为 0 时等于固定大小 | N
+gutter | Number | - | 间隔大小 | N
+hover | Boolean | false | 是否开启点击反馈 | N
+theme | String | default | 宫格的风格。可选项:default/card | N
+### Grid External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+
+
+### GridItem Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+badge-props | Object | null | 透传至 Badge 属性。TS 类型:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/grid-item/type.ts) | N
+description | String / Slot | - | 文本以外的更多描述,辅助信息。可以通过 Props 传入文本,也可以自定义标题节点。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` | N
+image | String / Slot | - | 图片,可以是图片地址,也可以自定义图片节点,值为 slot 的时候才能使用插槽。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+image-props | Object | - | 透传至 Image 组件。TS 类型:`ImageProps`,[Image API Documents](./image?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/grid-item/type.ts) | N
+jump-type | String | navigate-to | 链接跳转类型。可选项:redirect-to/switch-tab/relaunch/navigate-to | N
+layout | String | vertical | 内容布局方式。可选项:vertical/horizontal | N
+text | String / Slot | - | 文本,可以通过 Props 传入文本,也可以自定义标题节点。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+url | String | - | 点击后的跳转链接 | N
+
+### GridItem Events
+
+名称 | 参数 | 描述
+-- | -- | --
+click | \- | 点击子项后触发。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+### GridItem External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-description | 描述样式类
+t-class-image | 图片样式类
+t-class-text | 文本样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-grid-bg-color | @bg-color-container | -
+--td-grid-card-radius | @radius-large | -
+--td-grid-item-bg-color | @bg-color-container | -
+--td-grid-item-description-color | @font-gray-3 | -
+--td-grid-item-description-font-size | 24rpx | -
+--td-grid-item-description-line-height | 40rpx | -
+--td-grid-item-description-padding-top | 8rpx | -
+--td-grid-item-horizontal-text-description-top | 4rpx | -
+--td-grid-item-horizontal-text-padding-left | 24rpx | -
+--td-grid-item-hover-bg-color | @bg-color-secondarycontainer | -
+--td-grid-item-image-middle-width | 80rpx | -
+--td-grid-item-image-small-width | 64rpx | -
+--td-grid-item-image-width | 96rpx | -
+--td-grid-item-padding | 32rpx | -
+--td-grid-item-text-color | @font-gray-1 | -
+--td-grid-item-text-font-size | 28rpx | -
+--td-grid-item-text-line-height | 44rpx | -
+--td-grid-item-text-middle-font-size | 24rpx | -
+--td-grid-item-text-padding-top | 16rpx | -
+--td-grid-item-text-small-font-size | 24rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts b/miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts
new file mode 100644
index 0000000..5bc9604
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts
@@ -0,0 +1,22 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Grid extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ properties: import("./type").TdGridProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ contentStyle: string;
+ };
+ observers: {
+ 'column,hover,align,gutter,border'(): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ doForChild(action: (item: WechatMiniprogram.Component.TrivialInstance) => void): void;
+ updateContentStyle(): void;
+ getContentMargin(): string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.js b/miniprogram_npm/tdesign-miniprogram/grid/grid.js
new file mode 100644
index 0000000..1dc8b04
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.js
@@ -0,0 +1,66 @@
+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 { isObject, SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-grid`;
+let Grid = class Grid extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = ['t-class'];
+ this.relations = {
+ '../grid-item/grid-item': {
+ type: 'descendant',
+ },
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ contentStyle: '',
+ };
+ this.observers = {
+ 'column,hover,align,gutter,border'() {
+ this.updateContentStyle();
+ this.doForChild((child) => child.updateStyle());
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.updateContentStyle();
+ },
+ };
+ this.methods = {
+ doForChild(action) {
+ this.$children.forEach(action);
+ },
+ updateContentStyle() {
+ const contentStyles = [];
+ const marginStyle = this.getContentMargin();
+ marginStyle && contentStyles.push(marginStyle);
+ this.setData({
+ contentStyle: contentStyles.join(';'),
+ });
+ },
+ getContentMargin() {
+ const { gutter } = this.properties;
+ let { border } = this.properties;
+ if (!border)
+ return `margin-left:-${gutter}rpx; margin-top:-${gutter}rpx`;
+ if (!isObject(border))
+ border = {};
+ const { width = 2 } = border;
+ return `margin-left:-${width}rpx; margin-top:-${width}rpx`;
+ },
+ };
+ }
+};
+Grid = __decorate([
+ wxComponent()
+], Grid);
+export default Grid;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.json b/miniprogram_npm/tdesign-miniprogram/grid/grid.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.wxml b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxml
new file mode 100644
index 0000000..d497d7c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.wxss b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxss
new file mode 100644
index 0000000..a3ae3c3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxss
@@ -0,0 +1,40 @@
+.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-grid {
+ position: relative;
+ overflow: hidden;
+ background-color: var(--td-grid-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-grid__content {
+ width: auto;
+}
+.t-grid--card {
+ margin: 0 32rpx;
+ border-radius: var(--td-grid-card-radius, var(--td-radius-large, 18rpx));
+ overflow: hidden;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/props.d.ts b/miniprogram_npm/tdesign-miniprogram/grid/props.d.ts
new file mode 100644
index 0000000..f8f2feb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/props.d.ts
@@ -0,0 +1,3 @@
+import { TdGridProps } from './type';
+declare const props: TdGridProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/props.js b/miniprogram_npm/tdesign-miniprogram/grid/props.js
new file mode 100644
index 0000000..cca90bc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/props.js
@@ -0,0 +1,26 @@
+const props = {
+ align: {
+ type: String,
+ value: 'center',
+ },
+ border: {
+ type: null,
+ value: false,
+ },
+ column: {
+ type: Number,
+ value: 4,
+ },
+ gutter: {
+ type: Number,
+ },
+ hover: {
+ type: Boolean,
+ value: false,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/type.d.ts b/miniprogram_npm/tdesign-miniprogram/grid/type.d.ts
new file mode 100644
index 0000000..bb10d5e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/type.d.ts
@@ -0,0 +1,30 @@
+export interface TdGridProps {
+ align?: {
+ type: StringConstructor;
+ value?: 'left' | 'center';
+ };
+ border?: {
+ type: null;
+ value?: boolean | {
+ color?: string;
+ width?: string;
+ style?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'outset';
+ };
+ };
+ column?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ gutter?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ hover?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'card';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/type.js b/miniprogram_npm/tdesign-miniprogram/grid/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/guide/README.en-US.md
new file mode 100644
index 0000000..9091588
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/README.en-US.md
@@ -0,0 +1,110 @@
+:: BASE_DOC ::
+
+## API
+
+### Guide 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
+back-button-props | Object | - | Typescript:`ButtonProps` | N
+counter | String / Function | - | Typescript:`string \| ((params: { total: number; current: number }) => string)` | N
+current | Number | - | \- | N
+default-current | Number | undefined | uncontrolled property | N
+finish-button-props | Object | - | Typescript:`ButtonProps` | N
+hide-back | Boolean | false | \- | N
+hide-counter | Boolean | false | \- | N
+hide-skip | Boolean | false | \- | N
+highlight-padding | Number | 16 | \- | N
+mode | String | popover | options: popover/dialog | N
+next-button-props | Object | - | Typescript:`ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/guide/type.ts) | N
+show-overlay | Boolean | true | \- | N
+skip-button-props | Object | - | Typescript:`ButtonProps` | N
+steps | Array | - | Typescript:`Array` | N
+using-custom-navbar | Boolean | false | \- | N
+z-index | Number | 999999 | \- | N
+
+### Guide Events
+
+name | params | description
+-- | -- | --
+back | `(detail: { current: number, total: number })` | \-
+change | `(current: number, context?: { total: number })` | \-
+finish | `(detail: { current: number, total: number })` | \-
+next-step-click | `(detail: { next: number, current: number, total: number })` | \-
+skip | `(detail: { current: number, total: number })` | \-
+
+### Guide External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-back | \-
+t-class-body | \-
+t-class-finish | \-
+t-class-footer | \-
+t-class-next | \-
+t-class-popover | \-
+t-class-reference | \-
+t-class-skip | \-
+t-class-title | \-
+t-class-tooltip | \-
+
+### GuideStep
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+back-button-props | Object | - | Typescript:`ButtonProps` | N
+body | String | - | \- | N
+element | Function | - | required。Typescript:`StepElement` `type StepElement = () => Promise`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/guide/type.ts) | Y
+finish-button-props | Object | - | Typescript:`ButtonProps` | N
+highlight-padding | Number | - | \- | N
+mode | String | - | options: popover/dialog | N
+next-button-props | Object | - | Typescript:`ButtonProps` | N
+offset | Array | - | this api is in discussing. do not use it。Typescript:`Array` | N
+placement | String | 'top' | Typescript:`StepPopoverPlacement ` `type StepPopoverPlacement = 'top'\|'left'\|'right'\|'bottom'\|'top-left'\|'top-right'\|'bottom-left'\|'bottom-right'\|'left-top'\|'left-bottom'\|'right-top'\|'right-bottom'\|'center'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/guide/type.ts) | N
+show-overlay | Boolean | true | \- | N
+skip-button-props | Object | - | Typescript:`ButtonProps` | N
+title | String | - | title of current step | N
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-guide-body-color | @font-gray-2 | -
+--td-guide-body-font-weight | 400 | -
+--td-guide-dialog-body-font-size | @font-size-m | -
+--td-guide-dialog-body-line-height | 48rpx | -
+--td-guide-dialog-body-margin-top | 16rpx | -
+--td-guide-dialog-body-text-align | center | -
+--td-guide-dialog-border-radius | @radius-extra-large | -
+--td-guide-dialog-footer-button-padding | 0 @spacer-3 | -
+--td-guide-dialog-padding | @spacer-3 0 | -
+--td-guide-dialog-title-font-size | 36rpx | -
+--td-guide-dialog-title-line-height | 52rpx | -
+--td-guide-dialog-title-text-align | center | -
+--td-guide-dialog-width | 622rpx | -
+--td-guide-footer-button-space | @spacer-1 | -
+--td-guide-footer-margin-top | @spacer-3 | -
+--td-guide-footer-text-align | right | -
+--td-guide-popover-bg-color | @font-white-1 | -
+--td-guide-popover-body-font-size | @font-size-base | -
+--td-guide-popover-body-line-height | 44rpx | -
+--td-guide-popover-body-margin-top | 8rpx | -
+--td-guide-popover-body-text-align | left | -
+--td-guide-popover-border | 2rpx solid @gray-color-4 | -
+--td-guide-popover-border-radius | @radius-large | -
+--td-guide-popover-max-width | 540rpx | -
+--td-guide-popover-min-width | 480rpx | -
+--td-guide-popover-padding | @spacer-2 | -
+--td-guide-popover-shadow | @shadow-3 | -
+--td-guide-popover-title-font-size | @font-size-m | -
+--td-guide-popover-title-line-height | 48rpx | -
+--td-guide-popover-title-text-align | left | -
+--td-guide-reference-border | 4rpx solid @brand-color | -
+--td-guide-reference-border-radius | @radius-default | -
+--td-guide-reference-mask-color | @font-gray-2 | -
+--td-guide-title-color | @font-gray-1 | -
+--td-guide-title-font-weight | 600 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/README.md b/miniprogram_npm/tdesign-miniprogram/guide/README.md
new file mode 100644
index 0000000..855c2b3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/README.md
@@ -0,0 +1,158 @@
+---
+title: Guide 按钮
+description: 逐步骤进行指引或解释说明的组件,常用于用户不熟悉的或需进行特别强调的页面。
+spline: base
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-guide": "tdesign-miniprogram/guide/guide"
+}
+```
+
+
+
+
+### 01 组件类型
+
+#### 基础按钮
+
+{{ base }}
+
+#### 不带遮罩的引导
+
+{{ no-mask }}
+
+#### 弹窗形式的引导
+
+{{ dialog }}
+
+#### 气泡与弹窗混合的引导
+
+{{ multiple }}
+
+#### 自定义气泡
+
+{{ content }}
+
+## API
+
+### Guide Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+back-button-props | Object | - | 透传 返回按钮 的全部属性,示例:`{ content: '返回', theme: 'default' }`。TS 类型:`ButtonProps` | N
+counter | String / Function | - | 用于自定义渲染计数部分。TS 类型:`string \| ((params: { total: number; current: number }) => string)` | N
+current | Number | - | 当前步骤,即整个引导的进度。-1 则不展示,用于需要中断展示的场景 | N
+default-current | Number | undefined | 当前步骤,即整个引导的进度。-1 则不展示,用于需要中断展示的场景。非受控属性 | N
+finish-button-props | Object | - | 透传 完成按钮 的全部属性,示例:`{ content: '完成', theme: 'primary' }`。TS 类型:`ButtonProps` | N
+hide-back | Boolean | false | 是否隐藏返回按钮 | N
+hide-counter | Boolean | false | 是否隐藏计数 | N
+hide-skip | Boolean | false | 是否隐藏跳过按钮 | N
+highlight-padding | Number | 16 | 高亮框的内边距,单位rpx | N
+mode | String | popover | 引导框的类型。可选项:popover/dialog | N
+next-button-props | Object | - | 透传 下一步按钮 的全部属性,示例:{ content: '下一步', theme: 'primary' }。TS 类型:`ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/guide/type.ts) | N
+show-overlay | Boolean | true | 是否出现遮罩层 | N
+skip-button-props | Object | - | 透传 跳过按钮 的全部属性,{ content: '跳过', theme: 'default' }。TS 类型:`ButtonProps` | N
+steps | Array | - | 用于定义每个步骤的内容,包括高亮的节点、相对位置和具体的文案内容等。TS 类型:`Array` | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+z-index | Number | 999999 | 提示框的层级 | N
+
+### Guide Events
+
+名称 | 参数 | 描述
+-- | -- | --
+back | `(detail: { current: number, total: number })` | 点击返回按钮时触发
+change | `(current: number, context?: { total: number })` | 当前步骤发生变化时触发
+finish | `(detail: { current: number, total: number })` | 点击完成按钮时触发
+next-step-click | `(detail: { next: number, current: number, total: number })` | 点击下一步时触发
+skip | `(detail: { current: number, total: number })` | 点击跳过按钮时触发
+
+### Guide External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-back | 返回按钮样式类
+t-class-body | 高亮框提示内容主体样式类
+t-class-finish | 结束按钮样式类
+t-class-footer | 高亮框底部操作区域样式类
+t-class-next | 下一步按钮样式类
+t-class-popover | 引导框样式类
+t-class-reference | 高亮框样式类
+t-class-skip | 跳过按钮样式类
+t-class-title | 高亮框提示内容标题样式类
+t-class-tooltip | 高亮框提示内容区域样式类
+
+### GuideStep
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+back-button-props | Object | - | 用于自定义当前引导框的返回按钮的内容。TS 类型:`ButtonProps` | N
+body | String | - | 当前步骤提示框的内容,支持插槽:slot="body-{{index}}" (1、当要显示body-{{index}}插槽时,请将body设置为空;2、当要显示content-{{index}}插槽完全自定义内容时,请将body和title都设置为空) | N
+element | Function | - | 必需。高亮的节点。示例: `() => new Promise((resolve) => this.createSelectorQuery().select('#tdesign').boundingClientRect((rect) => resolve(rect)).exec())`。TS 类型:`StepElement` `type StepElement = () => Promise`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/guide/type.ts) | Y
+finish-button-props | Object | - | 透传 完成 的全部属性,示例:`{ content: '完成', theme: 'primary' }`。TS 类型:`ButtonProps` | N
+highlight-padding | Number | - | 高亮框的内边距,单位rpx | N
+mode | String | - | 引导框的类型。可选项:popover/dialog | N
+next-button-props | Object | - | 用于自定义当前引导框的下一步按钮的内容。TS 类型:`ButtonProps` | N
+offset | Array | - | 相对于 placement 的偏移量[left, top],默认单位rpx,示例:[-10, 20] 或 ['10px', '8px'] 或 ['20rpx', '16rpx'] (仅当 `mode` 为 `popover` 时生效)。TS 类型:`Array` | N
+placement | String | 'top' | 引导框相对于高亮元素出现的位置,(仅当 `mode` 为 `popover` 时生效)。TS 类型:`StepPopoverPlacement ` `type StepPopoverPlacement = 'top'\|'left'\|'right'\|'bottom'\|'top-left'\|'top-right'\|'bottom-left'\|'bottom-right'\|'left-top'\|'left-bottom'\|'right-top'\|'right-bottom'\|'center'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/guide/type.ts) | N
+show-overlay | Boolean | true | 是否出现遮罩层 | N
+skip-button-props | Object | - | 用于自定义当前步骤引导框的跳过按钮的内容。TS 类型:`ButtonProps` | N
+title | String | - | 当前步骤的标题内容,支持插槽:slot="title-{{index}}" (1、当要显示body-{{index}}插槽时,请将title设置为空;2、当要显示content-{{index}}插槽完全自定义内容时,请将body和title都设置为空) | N
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-guide-body-color | @font-gray-2 | -
+--td-guide-body-font-weight | 400 | -
+--td-guide-dialog-body-font-size | @font-size-m | -
+--td-guide-dialog-body-line-height | 48rpx | -
+--td-guide-dialog-body-margin-top | 16rpx | -
+--td-guide-dialog-body-text-align | center | -
+--td-guide-dialog-border-radius | @radius-extra-large | -
+--td-guide-dialog-footer-button-padding | 0 @spacer-3 | -
+--td-guide-dialog-padding | @spacer-3 0 | -
+--td-guide-dialog-title-font-size | 36rpx | -
+--td-guide-dialog-title-line-height | 52rpx | -
+--td-guide-dialog-title-text-align | center | -
+--td-guide-dialog-width | 622rpx | -
+--td-guide-footer-button-space | @spacer-1 | -
+--td-guide-footer-margin-top | @spacer-3 | -
+--td-guide-footer-text-align | right | -
+--td-guide-popover-bg-color | @font-white-1 | -
+--td-guide-popover-body-font-size | @font-size-base | -
+--td-guide-popover-body-line-height | 44rpx | -
+--td-guide-popover-body-margin-top | 8rpx | -
+--td-guide-popover-body-text-align | left | -
+--td-guide-popover-border | 2rpx solid @gray-color-4 | -
+--td-guide-popover-border-radius | @radius-large | -
+--td-guide-popover-max-width | 540rpx | -
+--td-guide-popover-min-width | 480rpx | -
+--td-guide-popover-padding | @spacer-2 | -
+--td-guide-popover-shadow | @shadow-3 | -
+--td-guide-popover-title-font-size | @font-size-m | -
+--td-guide-popover-title-line-height | 48rpx | -
+--td-guide-popover-title-text-align | left | -
+--td-guide-reference-border | 4rpx solid @brand-color | -
+--td-guide-reference-border-radius | @radius-default | -
+--td-guide-reference-mask-color | @font-gray-2 | -
+--td-guide-title-color | @font-gray-1 | -
+--td-guide-title-font-weight | 600 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/content.wxml b/miniprogram_npm/tdesign-miniprogram/guide/content.wxml
new file mode 100644
index 0000000..0b7030a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/content.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ {{title}}
+
+ {{body}}
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/guide.d.ts b/miniprogram_npm/tdesign-miniprogram/guide/guide.d.ts
new file mode 100644
index 0000000..839774d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/guide.d.ts
@@ -0,0 +1,103 @@
+///
+import { SuperComponent } from '../common/src/index';
+import { TdGuideProps, GuideStep } from './type';
+export interface GuideProps extends TdGuideProps {
+}
+export { GuideStep };
+export default class Guide extends SuperComponent {
+ externalClasses: string[];
+ properties: TdGuideProps;
+ options: WechatMiniprogram.Component.ComponentOptions;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ visible: boolean;
+ _current: number;
+ _steps: any[];
+ buttonProps: {};
+ referenceStyle: string;
+ popoverStyle: string;
+ title: string;
+ body: string;
+ nonOverlay: boolean;
+ modeType: string;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ 'steps, current, showOverlay'(): Promise;
+ };
+ lifetimes: {
+ created(): void;
+ attached(): void;
+ };
+ methods: {
+ init(): Promise;
+ placementOffset({ placement, offset }: GuideStep, place: CSSStyleDeclaration): Promise;
+ buttonProps(step: any, mode: any): {
+ skipButton: any;
+ nextButton: any;
+ backButton: any;
+ finishButton: any;
+ };
+ renderCounter(): any;
+ buttonContent(button: any): string;
+ onTplButtonTap(e: any): void;
+ getPlacement(): {
+ center: (rect: any, place: any, offset: any) => {
+ top: string;
+ left: string;
+ };
+ bottom: (rect: any, place: any, offset: any) => {
+ top: string;
+ left: string;
+ };
+ 'bottom-left': (rect: any, place: any, offset: any) => {
+ top: string;
+ left: string;
+ };
+ 'bottom-right': (rect: any, place: any, offset: any) => {
+ top: string;
+ right: string;
+ };
+ left: (rect: any, place: any, offset: any) => {
+ top: string;
+ right: string;
+ };
+ 'left-top': (rect: any, place: any, offset: any) => {
+ top: string;
+ right: string;
+ };
+ 'left-bottom': (rect: any, place: any, offset: any) => {
+ bottom: string;
+ right: string;
+ };
+ right: (rect: any, place: any, offset: any) => {
+ top: string;
+ left: string;
+ };
+ 'right-top': (rect: any, place: any, offset: any) => {
+ top: string;
+ left: string;
+ };
+ 'right-bottom': (rect: any, place: any, offset: any) => {
+ bottom: string;
+ left: string;
+ };
+ top: (rect: any, place: any, offset: any) => {
+ bottom: string;
+ left: string;
+ };
+ 'top-left': (rect: any, place: any, offset: any) => {
+ bottom: string;
+ left: string;
+ };
+ 'top-right': (rect: any, place: any, offset: any) => {
+ bottom: string;
+ right: string;
+ };
+ };
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/guide.js b/miniprogram_npm/tdesign-miniprogram/guide/guide.js
new file mode 100644
index 0000000..1dd22d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/guide.js
@@ -0,0 +1,270 @@
+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 isFunction from 'lodash/isFunction';
+import { SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+import config from '../common/config';
+import { systemInfo, debounce, getRect, isNumber, rpx2px, styles, unitConvert, nextTick } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-guide`;
+let Guide = class Guide extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-reference`,
+ `${prefix}-class-popover`,
+ `${prefix}-class-tooltip`,
+ `${prefix}-class-title`,
+ `${prefix}-class-body`,
+ `${prefix}-class-footer`,
+ `${prefix}-class-skip`,
+ `${prefix}-class-next`,
+ `${prefix}-class-back`,
+ `${prefix}-class-finish`,
+ ];
+ this.properties = props;
+ this.options = {
+ pureDataPattern: /^_/,
+ multipleSlots: true,
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ visible: false,
+ _current: -1,
+ _steps: [],
+ buttonProps: {},
+ referenceStyle: '',
+ popoverStyle: '',
+ title: '',
+ body: '',
+ nonOverlay: false,
+ modeType: '',
+ };
+ this.controlledProps = [
+ {
+ key: 'current',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ 'steps, current, showOverlay'() {
+ return __awaiter(this, void 0, void 0, function* () {
+ this._init();
+ });
+ },
+ };
+ this.lifetimes = {
+ created() {
+ this._init = debounce(() => this.init(), 20);
+ this._getPlacement = this.getPlacement();
+ },
+ attached() {
+ this._init();
+ },
+ };
+ this.methods = {
+ init() {
+ var _a, _b, _c, _d, _e, _f, _g;
+ return __awaiter(this, void 0, void 0, function* () {
+ const { steps, current } = this.properties;
+ const { _steps, _current } = this.data;
+ const step = steps[current];
+ if (!step) {
+ return this.setData({ visible: false });
+ }
+ const modeType = ((_a = step.mode) !== null && _a !== void 0 ? _a : this.data.mode) === 'dialog' ? 'dialog' : 'popover';
+ const showOverlay = (_b = step.showOverlay) !== null && _b !== void 0 ? _b : this.data.showOverlay;
+ this.setData({ nonOverlay: !showOverlay, modeType });
+ if (steps === _steps && current === _current)
+ return;
+ if (modeType === 'popover') {
+ const rect = yield step.element();
+ if (!rect)
+ return;
+ const highlightPadding = rpx2px((_c = step.highlightPadding) !== null && _c !== void 0 ? _c : this.data.highlightPadding);
+ const referenceTop = rect.top - highlightPadding;
+ const referenceRight = systemInfo.windowWidth - rect.right - highlightPadding;
+ const referenceBottom = systemInfo.windowHeight - rect.bottom - highlightPadding;
+ const referenceLeft = rect.left - highlightPadding;
+ const style = {
+ top: `${referenceTop}px`,
+ right: `${referenceRight}px`,
+ bottom: `${referenceBottom}px`,
+ left: `${referenceLeft}px`,
+ };
+ this.setData({
+ _steps: this.data.steps,
+ _current: this.data.current,
+ visible: true,
+ referenceStyle: styles(style),
+ title: (_d = step.title) !== null && _d !== void 0 ? _d : '',
+ body: (_e = step.body) !== null && _e !== void 0 ? _e : '',
+ buttonProps: this.buttonProps(step, 'popover'),
+ });
+ const popoverStyle = yield this.placementOffset(step, style);
+ this.setData({ popoverStyle });
+ }
+ else {
+ this.setData({
+ _steps: this.data.steps,
+ _current: this.data.current,
+ visible: true,
+ title: (_f = step.title) !== null && _f !== void 0 ? _f : '',
+ body: (_g = step.body) !== null && _g !== void 0 ? _g : '',
+ buttonProps: this.buttonProps(step, 'dialog'),
+ });
+ }
+ });
+ },
+ placementOffset({ placement, offset }, place) {
+ var _a, _b;
+ return __awaiter(this, void 0, void 0, function* () {
+ yield nextTick();
+ const rect = yield getRect(this, `.${name}__container`);
+ const style = (_b = (_a = this._getPlacement)[placement]) === null || _b === void 0 ? void 0 : _b.call(_a, rect, place, offset);
+ return styles(Object.assign({ position: 'absolute' }, style));
+ });
+ },
+ buttonProps(step, mode) {
+ var _a, _b, _c, _d;
+ let skipButton = (_a = step.skipButtonProps) !== null && _a !== void 0 ? _a : this.data.skipButtonProps;
+ const size = mode === 'popover' ? 'extra-small' : 'medium';
+ skipButton = Object.assign(Object.assign({ theme: 'light', content: '跳过', size }, skipButton), { tClass: `${prefix}-class-skip ${name}__button ${(skipButton === null || skipButton === void 0 ? void 0 : skipButton.class) || ''}`, type: 'skip' });
+ let nextButton = (_b = step.nextButtonProps) !== null && _b !== void 0 ? _b : this.data.nextButtonProps;
+ nextButton = Object.assign(Object.assign({ theme: 'primary', content: '下一步', size }, nextButton), { tClass: `${prefix}-class-next ${name}__button ${(nextButton === null || nextButton === void 0 ? void 0 : nextButton.class) || ''}`, type: 'next' });
+ nextButton = Object.assign(Object.assign({}, nextButton), { content: this.buttonContent(nextButton) });
+ let backButton = (_c = step.backButtonProps) !== null && _c !== void 0 ? _c : this.data.backButtonProps;
+ backButton = Object.assign(Object.assign({ theme: 'light', content: '返回', size }, backButton), { tClass: `${prefix}-class-back ${name}__button ${(backButton === null || backButton === void 0 ? void 0 : backButton.class) || ''}`, type: 'back' });
+ let finishButton = (_d = step.finishButtonProps) !== null && _d !== void 0 ? _d : this.data.finishButtonProps;
+ finishButton = Object.assign(Object.assign({ theme: 'primary', content: '完成', size }, finishButton), { tClass: `${prefix}-class-finish ${name}__button ${(finishButton === null || finishButton === void 0 ? void 0 : finishButton.class) || ''}`, type: 'finish' });
+ finishButton = Object.assign(Object.assign({}, finishButton), { content: this.buttonContent(finishButton) });
+ return {
+ skipButton,
+ nextButton,
+ backButton,
+ finishButton,
+ };
+ },
+ renderCounter() {
+ const { steps, current, counter } = this.data;
+ const stepsTotal = steps.length;
+ const innerCurrent = current + 1;
+ const popupSlotCounter = isFunction(counter) ? counter({ total: stepsTotal, current: innerCurrent }) : counter;
+ return counter ? popupSlotCounter : `(${innerCurrent}/${stepsTotal})`;
+ },
+ buttonContent(button) {
+ const { hideCounter } = this.data;
+ return `${button.content.replace(/ \(.*?\)/, '')} ${hideCounter ? '' : this.renderCounter()}`;
+ },
+ onTplButtonTap(e) {
+ const { type } = e.target.dataset;
+ const parmas = { e, current: this.data.current, total: this.data.steps.length };
+ switch (type) {
+ case 'next':
+ this.triggerEvent('next-step-click', Object.assign({ next: this.data.current + 1 }, parmas));
+ this.setData({ current: this.data.current + 1 });
+ break;
+ case 'skip':
+ this.triggerEvent('skip', parmas);
+ this.setData({ current: -1 });
+ break;
+ case 'back':
+ this.triggerEvent('back', parmas);
+ this.setData({ current: 0 });
+ break;
+ case 'finish':
+ this.triggerEvent('finish', parmas);
+ this.setData({ current: -1 });
+ break;
+ default:
+ break;
+ }
+ this.triggerEvent('change', { current: this.data.current });
+ },
+ getPlacement() {
+ const space = rpx2px(32);
+ const offsetLeft = (offset) => unitConvert(isNumber(offset === null || offset === void 0 ? void 0 : offset[0]) ? `${offset === null || offset === void 0 ? void 0 : offset[0]}rpx` : (offset === null || offset === void 0 ? void 0 : offset[0]) || 0);
+ const offsetTop = (offset) => unitConvert(isNumber(offset === null || offset === void 0 ? void 0 : offset[1]) ? `${offset === null || offset === void 0 ? void 0 : offset[1]}rpx` : (offset === null || offset === void 0 ? void 0 : offset[1]) || 0);
+ const bottom = (place) => parseFloat(place.bottom);
+ const left = (place) => parseFloat(place.left);
+ const right = (place) => parseFloat(place.right);
+ const top = (place) => parseFloat(place.top);
+ const height = (place) => systemInfo.windowHeight - bottom(place) - top(place);
+ const width = (place) => systemInfo.windowWidth - left(place) - right(place);
+ return {
+ center: (rect, place, offset) => ({
+ top: `${Math.max(height(place) + top(place) + space + offsetTop(offset), 1)}px`,
+ left: `${Math.max(width(place) / 2 + left(place) - rect.width / 2 + offsetLeft(offset), 1)}px`,
+ }),
+ bottom: (rect, place, offset) => ({
+ top: `${Math.max(height(place) + top(place) + space + offsetTop(offset), 1)}px`,
+ left: `${Math.max(width(place) / 2 + left(place) - rect.width / 2 + offsetLeft(offset), 1)}px`,
+ }),
+ 'bottom-left': (rect, place, offset) => ({
+ top: `${Math.max(height(place) + top(place) + space + offsetTop(offset), 1)}px`,
+ left: `${Math.max(left(place) + offsetLeft(offset), 1)}px`,
+ }),
+ 'bottom-right': (rect, place, offset) => ({
+ top: `${Math.max(height(place) + top(place) + space + offsetTop(offset), 1)}px`,
+ right: `${Math.max(right(place) - offsetLeft(offset), 1)}px`,
+ }),
+ left: (rect, place, offset) => ({
+ top: `${Math.max(height(place) / 2 + top(place) - rect.height / 2 + offsetTop(offset), 1)}px`,
+ right: `${Math.max(width(place) + right(place) + space - offsetLeft(offset), 1)}px`,
+ }),
+ 'left-top': (rect, place, offset) => ({
+ top: `${Math.max(top(place) + offsetTop(offset), 1)}px`,
+ right: `${Math.max(width(place) + right(place) + space - offsetLeft(offset), 1)}px`,
+ }),
+ 'left-bottom': (rect, place, offset) => ({
+ bottom: `${Math.max(bottom(place) - offsetTop(offset), 1)}px`,
+ right: `${Math.max(width(place) + right(place) + space - offsetLeft(offset), 1)}px`,
+ }),
+ right: (rect, place, offset) => ({
+ top: `${Math.max(height(place) / 2 + top(place) - rect.height / 2 + offsetTop(offset), 1)}px`,
+ left: `${Math.max(left(place) + width(place) + space + offsetLeft(offset), 1)}px`,
+ }),
+ 'right-top': (rect, place, offset) => ({
+ top: `${Math.max(top(place) + offsetTop(offset), 1)}px`,
+ left: `${Math.max(left(place) + width(place) + space + offsetLeft(offset), 1)}px`,
+ }),
+ 'right-bottom': (rect, place, offset) => ({
+ bottom: `${Math.max(bottom(place) - offsetTop(offset), 1)}px`,
+ left: `${Math.max(left(place) + width(place) + space + offsetLeft(offset), 1)}px`,
+ }),
+ top: (rect, place, offset) => ({
+ bottom: `${Math.max(height(place) + bottom(place) + space - offsetTop(offset), 1)}px`,
+ left: `${Math.max(width(place) / 2 + left(place) - rect.width / 2 + offsetLeft(offset), 1)}px`,
+ }),
+ 'top-left': (rect, place, offset) => ({
+ bottom: `${Math.max(height(place) + bottom(place) + space - offsetTop(offset), 1)}px`,
+ left: `${Math.max(left(place) + offsetLeft(offset), 1)}px`,
+ }),
+ 'top-right': (rect, place, offset) => ({
+ bottom: `${Math.max(height(place) + bottom(place) + space - offsetTop(offset), 1)}px`,
+ right: `${Math.max(right(place) - offsetLeft(offset), 1)}px`,
+ }),
+ };
+ },
+ };
+ }
+};
+Guide = __decorate([
+ wxComponent()
+], Guide);
+export default Guide;
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/guide.json b/miniprogram_npm/tdesign-miniprogram/guide/guide.json
new file mode 100644
index 0000000..0563242
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/guide.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-overlay": "../overlay/overlay",
+ "t-button": "../button/button",
+ "t-popup": "../popup/popup"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/guide.wxml b/miniprogram_npm/tdesign-miniprogram/guide/guide.wxml
new file mode 100644
index 0000000..fe3b9cf
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/guide.wxml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/guide.wxss b/miniprogram_npm/tdesign-miniprogram/guide/guide.wxss
new file mode 100644
index 0000000..4b5e001
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/guide.wxss
@@ -0,0 +1,99 @@
+.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-guide__reference {
+ position: absolute;
+ box-shadow: 0 0 0 0 var(--td-guide-reference-mask-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))), var(--td-guide-reference-mask-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))) 0 0 0 5000px;
+ border-radius: var(--td-guide-reference-border-radius, var(--td-radius-default, 12rpx));
+ transition: all var(--td-anim-duration-base, 0.2s) var(--td-anim-time-fn-ease-out, cubic-bezier(0, 0, 0.15, 1));
+}
+.t-guide__reference--nonoverlay {
+ box-shadow: none;
+ border: var(--td-guide-reference-border, 4rpx solid var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-guide__container {
+ display: inline-block;
+}
+.t-guide__container--popover {
+ background-color: var(--td-guide-popover-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ border: var(--td-guide-popover-border, 2rpx solid var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ border-radius: var(--td-guide-popover-border-radius, var(--td-radius-large, 18rpx));
+ box-shadow: var(--td-guide-popover-shadow, var(--td-shadow-3, 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08)));
+ padding: var(--td-guide-popover-padding, var(--td-spacer-2, 32rpx));
+ min-width: var(--td-guide-popover-min-width, 480rpx);
+ max-width: var(--td-guide-popover-max-width, 540rpx);
+}
+.t-guide__container--dialog {
+ background-color: var(--td-guide-popover-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ border-radius: var(--td-guide-dialog-border-radius, var(--td-radius-extra-large, 24rpx));
+ padding: var(--td-guide-dialog-padding, var(--td-spacer-3, 48rpx) 0);
+ width: var(--td-guide-dialog-width, 622rpx);
+}
+.t-guide__title--popover {
+ text-align: var(--td-guide-popover-title-text-align, left);
+ color: var(--td-guide-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-guide-popover-title-font-size, var(--td-font-size-m, 32rpx));
+ font-weight: var(--td-guide-title-font-weight, 600);
+ line-height: var(--td-guide-popover-title-line-height, 48rpx);
+}
+.t-guide__title--dialog {
+ text-align: var(--td-guide-dialog-title-text-align, center);
+ color: var(--td-guide-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-guide-dialog-title-font-size, 36rpx);
+ font-weight: var(--td-guide-title-font-weight, 600);
+ line-height: var(--td-guide-dialog-title-line-height, 52rpx);
+}
+.t-guide__body--popover {
+ margin-top: var(--td-guide-popover-body-margin-top, 8rpx);
+ text-align: var(--td-guide-popover-body-text-align, left);
+ color: var(--td-guide-body-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ font-size: var(--td-guide-popover-body-font-size, var(--td-font-size-base, 28rpx));
+ font-weight: var(--td-guide-body-font-weight, 400);
+ line-height: var(--td-guide-popover-body-line-height, 44rpx);
+}
+.t-guide__body--dialog {
+ margin-top: var(--td-guide-dialog-body-margin-top, 16rpx);
+ text-align: var(--td-guide-dialog-body-text-align, center);
+ color: var(--td-guide-body-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ font-size: var(--td-guide-dialog-body-font-size, var(--td-font-size-m, 32rpx));
+ font-weight: var(--td-guide-body-font-weight, 400);
+ line-height: var(--td-guide-dialog-body-line-height, 48rpx);
+}
+.t-guide__footer {
+ text-align: var(--td-guide-footer-text-align, right);
+ margin-top: var(--td-guide-footer-margin-top, var(--td-spacer-3, 48rpx));
+}
+.t-guide__footer .t-guide__button + .t-guide__button {
+ margin-left: var(--td-guide-footer-button-space, var(--td-spacer-1, 24rpx));
+}
+.t-guide__footer--dialog {
+ display: flex;
+ padding: var(--td-guide-dialog-footer-button-padding, 0 var(--td-spacer-3, 48rpx));
+}
+.t-guide__footer--dialog .t-guide__button:last-child {
+ flex-grow: 1;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/props.d.ts b/miniprogram_npm/tdesign-miniprogram/guide/props.d.ts
new file mode 100644
index 0000000..208d046
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/props.d.ts
@@ -0,0 +1,3 @@
+import { TdGuideProps } from './type';
+declare const props: TdGuideProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/props.js b/miniprogram_npm/tdesign-miniprogram/guide/props.js
new file mode 100644
index 0000000..07039c3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/props.js
@@ -0,0 +1,60 @@
+const props = {
+ backButtonProps: {
+ type: Object,
+ },
+ counter: {
+ type: null,
+ },
+ current: {
+ type: Number,
+ value: null,
+ },
+ defaultCurrent: {
+ type: Number,
+ },
+ finishButtonProps: {
+ type: Object,
+ },
+ hideBack: {
+ type: Boolean,
+ value: false,
+ },
+ hideCounter: {
+ type: Boolean,
+ value: false,
+ },
+ hideSkip: {
+ type: Boolean,
+ value: false,
+ },
+ highlightPadding: {
+ type: Number,
+ value: 16,
+ },
+ mode: {
+ type: String,
+ value: 'popover',
+ },
+ nextButtonProps: {
+ type: Object,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ skipButtonProps: {
+ type: Object,
+ },
+ steps: {
+ type: Array,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ zIndex: {
+ type: Number,
+ value: 999999,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/type.d.ts b/miniprogram_npm/tdesign-miniprogram/guide/type.d.ts
new file mode 100644
index 0000000..54b7bdb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/type.d.ts
@@ -0,0 +1,87 @@
+///
+import { ButtonProps } from '../button/index';
+export interface TdGuideProps {
+ backButtonProps?: {
+ type: ObjectConstructor;
+ value?: ButtonProps;
+ };
+ counter?: {
+ type: StringConstructor;
+ value?: string | ((params: {
+ total: number;
+ current: number;
+ }) => string);
+ };
+ current?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ defaultCurrent?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ finishButtonProps?: {
+ type: ObjectConstructor;
+ value?: ButtonProps;
+ };
+ hideBack?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ hideCounter?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ hideSkip?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ highlightPadding?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ mode?: {
+ type: StringConstructor;
+ value?: 'popover' | 'dialog';
+ };
+ nextButtonProps?: {
+ type: ObjectConstructor;
+ value?: ButtonProps;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ skipButtonProps?: {
+ type: ObjectConstructor;
+ value?: ButtonProps;
+ };
+ steps?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
+export interface GuideStep {
+ backButtonProps?: ButtonProps;
+ body?: string;
+ element: StepElement;
+ finishButtonProps?: ButtonProps;
+ highlightPadding?: number;
+ mode?: 'popover' | 'dialog';
+ nextButtonProps?: ButtonProps;
+ offset?: Array;
+ placement?: StepPopoverPlacement;
+ showOverlay?: boolean;
+ skipButtonProps?: ButtonProps;
+ title?: string;
+}
+export declare type StepElement = () => Promise;
+export declare type StepPopoverPlacement = 'top' | 'left' | 'right' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom' | 'center';
diff --git a/miniprogram_npm/tdesign-miniprogram/guide/type.js b/miniprogram_npm/tdesign-miniprogram/guide/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/guide/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/icon/README.en-US.md
new file mode 100644
index 0000000..b408f55
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/README.en-US.md
@@ -0,0 +1,26 @@
+:: BASE_DOC ::
+
+## API
+
+
+### Icon 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
+color | String | - | \- | N
+name | String | - | required | Y
+prefix | String | - | \- | N
+size | String / Number | - | \- | N
+
+### Icon Events
+
+name | params | description
+-- | -- | --
+click | \- | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+### Icon External Classes
+
+className | Description
+-- | --
+t-class | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/README.md b/miniprogram_npm/tdesign-miniprogram/icon/README.md
new file mode 100644
index 0000000..916e3f9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/README.md
@@ -0,0 +1,122 @@
+---
+title: Icon 图标
+description: 图标。
+spline: base
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon"
+}
+```
+
+## 常见问题
+
+
+
+ 控制台告警:Failed to load font
+ 👇
+
+
+ 告警属于开发者工具的 bug,可以忽略,具体可以看 官网文档
+
+
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+### 基础组件图标
+
+{{ base }}
+
+### 自定义组件图标
+
+{{ custom }}
+
+自定义图标用法,下面以 `iconfont` 为例
+
+#### 准备图标文件
+
+文件后缀应为`.wxss`,如下方代码块所示:
+
+```css
+@font-face {
+ font-family: 'icon'; // 使用自定义的字体名称
+ ···
+}
+
+.icon {
+ font-family: 'icon' !important; // 字体名称
+ ···
+}
+
+.icon-a-0:before { // icon 图标。注意 FontClass 前缀与 font-family 保持一致
+ content: '\e64d';
+}
+```
+- 添加所需图标,下载图标。图标库一般会提供 **在线链接** 或者 **下载至本地** 等使用方式。**在线链接** 方式会指向一个 `.css` 文件,可以下载或复制其内容,将其修改成后缀名为 `.wxss` 的文件
+- 将 `.wxss` 文件中的 `FontClass/Symbol前缀` 与 `Font Family` 两项内容保持一致,如: `FontClass/Symbol` 前缀为 `icon-`,则 `Font Family` 为 `icon`。
+
+> 注:若是采用 `下载至本地` 方式,需关注 `.css` 和 `.ttf` 文件。由于微信小程序不支持处理 `ttf、woff、eot` 等文件,但支持 `base64`,所以需要将 `.ttf` 文件转换为 `base64` (可借助转换工具,如 [transfonter.org](https://transfonter.org/),会得到一个 `stylesheet.css` 文件),然后将 `.css` 文件中的 `@font-face {}` 内容替换为 `stylesheet.css` 中的 `base64` 内容,最后将 `.css` 文件修改后缀为 `.wxss`
+
+#### 引入自定义图标
+
+- 全局引入:在项目 `app.wxss`,使用 `@import` 引入上述的 `.wxss` 文件
+- 局部引入:在 `page` 对应的 `.wxss` 中,使用 `@import` 引入上述的 `.wxss` 文件
+
+#### 自定义图标的使用
+
+ `` 组件中的 `prefix` 属性值与前面设置的 `Font Family` 保持一致,即 `prefix="icon"`,`name` 属性值为自定义图标名称,如图标的 `className` 为 `icon-a-1h`,则 `name="a-1h"`。
+
+### 图片链接
+
+{{ iconImage }}
+
+### 全部图标
+
+
+
+
大部分图标在 1.8.0 版本中新增,如果发现引入组件库后,部分图标无法使用,请检查安装的组件库`tdesign-miniprogram`的版本。支持中文英文搜索,如果觉得可以再增加其他关键词提示,欢迎到 图标仓库 提交PR,帮我们一起补充。
+
+
+
+
+
+## API
+
+### Icon Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+color | String | - | 图标颜色 | N
+name | String | - | 必需。图标名称或图片链接 | Y
+prefix | String | - | 自定义图标前缀 | N
+size | String / Number | - | 图标大小, 如 `20`, `20px`, `48rpx`, 默认单位是 `px` | N
+
+### Icon Events
+
+名称 | 参数 | 描述
+-- | -- | --
+click | \- | 点击图标时触发。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+### Icon External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts b/miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts
new file mode 100644
index 0000000..b70696a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts
@@ -0,0 +1,18 @@
+import { SuperComponent } from '../common/src/index';
+export default class Icon extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdIconProps;
+ data: {
+ componentPrefix: string;
+ classPrefix: string;
+ isImage: boolean;
+ iconStyle: any;
+ };
+ observers: {
+ 'name, color, size, style'(): void;
+ };
+ methods: {
+ onTap(event: any): void;
+ setIconStyle(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.js b/miniprogram_npm/tdesign-miniprogram/icon/icon.js
new file mode 100644
index 0000000..797cae0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.js
@@ -0,0 +1,71 @@
+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 config from '../common/config';
+import props from './props';
+import { styles, addUnit, getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-icon`;
+let Icon = class Icon extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.data = {
+ componentPrefix: prefix,
+ classPrefix: name,
+ isImage: false,
+ iconStyle: undefined,
+ };
+ this.observers = {
+ 'name, color, size, style'() {
+ this.setIconStyle();
+ },
+ };
+ this.methods = {
+ onTap(event) {
+ this.triggerEvent('click', event.detail);
+ },
+ setIconStyle() {
+ const { name, color, size, classPrefix } = this.data;
+ const isImage = name.indexOf('/') !== -1;
+ const sizeValue = addUnit(size);
+ const colorStyle = color ? { color: color } : {};
+ const fontStyle = size ? { 'font-size': sizeValue } : {};
+ const iconStyle = Object.assign(Object.assign({}, colorStyle), fontStyle);
+ this.setData({ isImage }, () => __awaiter(this, void 0, void 0, function* () {
+ if (isImage) {
+ let iconSize = sizeValue;
+ if (!iconSize) {
+ yield getRect(this, `.${classPrefix}`)
+ .then((res) => {
+ iconSize = addUnit(res === null || res === void 0 ? void 0 : res.height);
+ })
+ .catch(() => { });
+ }
+ iconStyle.width = iconSize;
+ iconStyle.height = iconSize;
+ }
+ this.setData({ iconStyle: `${styles(iconStyle)}` });
+ }));
+ },
+ };
+ }
+};
+Icon = __decorate([
+ wxComponent()
+], Icon);
+export default Icon;
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.json b/miniprogram_npm/tdesign-miniprogram/icon/icon.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.wxml b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxml
new file mode 100644
index 0000000..bfa4de8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.wxss b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxss
new file mode 100644
index 0000000..26f660f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxss
@@ -0,0 +1,6407 @@
+.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);
+}
+@font-face {
+ font-family: t;
+ src: url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.eot'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.eot?#iefix') format('ded-opentype'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.woff') format('woff'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.ttf') format('truetype'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.svg') format('svg');
+ /* iOS 4.1- */
+ font-weight: normal;
+ font-style: normal;
+}
+.t-icon--image {
+ width: 100%;
+ height: 100%;
+}
+.t-icon__image {
+ vertical-align: top;
+ width: 100%;
+ height: 100%;
+}
+.t-icon-base {
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+ text-align: center;
+ display: block;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.t-icon {
+ /* stylelint-disable-next-line declaration-no-important */
+ font-family: t !important;
+ /* prevent issues with browser extensions that change fonts */
+}
+.t-icon-accessibility-filled:before {
+ content: '\E001';
+}
+.t-icon-accessibility:before {
+ content: '\E002';
+}
+.t-icon-activity-filled:before {
+ content: '\E003';
+}
+.t-icon-activity:before {
+ content: '\E004';
+}
+.t-icon-add-and-subtract:before {
+ content: '\E005';
+}
+.t-icon-add-circle-filled:before {
+ content: '\E006';
+}
+.t-icon-add-circle:before {
+ content: '\E007';
+}
+.t-icon-add-rectangle-filled:before {
+ content: '\E008';
+}
+.t-icon-add-rectangle:before {
+ content: '\E009';
+}
+.t-icon-add:before {
+ content: '\E00A';
+}
+.t-icon-address-book-filled:before {
+ content: '\E00B';
+}
+.t-icon-address-book:before {
+ content: '\E00C';
+}
+.t-icon-adjustment-filled:before {
+ content: '\E00D';
+}
+.t-icon-adjustment:before {
+ content: '\E00E';
+}
+.t-icon-airplay-wave-filled:before {
+ content: '\E00F';
+}
+.t-icon-airplay-wave:before {
+ content: '\E010';
+}
+.t-icon-alarm-add-filled:before {
+ content: '\E011';
+}
+.t-icon-alarm-add:before {
+ content: '\E012';
+}
+.t-icon-alarm-filled:before {
+ content: '\E013';
+}
+.t-icon-alarm-off-filled:before {
+ content: '\E014';
+}
+.t-icon-alarm-off:before {
+ content: '\E015';
+}
+.t-icon-alarm:before {
+ content: '\E016';
+}
+.t-icon-align-top:before {
+ content: '\E017';
+}
+.t-icon-align-vertical:before {
+ content: '\E018';
+}
+.t-icon-alpha:before {
+ content: '\E019';
+}
+.t-icon-analytics-filled:before {
+ content: '\E01A';
+}
+.t-icon-analytics:before {
+ content: '\E01B';
+}
+.t-icon-anchor:before {
+ content: '\E01C';
+}
+.t-icon-angry-filled:before {
+ content: '\E01D';
+}
+.t-icon-angry:before {
+ content: '\E01E';
+}
+.t-icon-animation-1-filled:before {
+ content: '\E01F';
+}
+.t-icon-animation-1:before {
+ content: '\E020';
+}
+.t-icon-animation-filled:before {
+ content: '\E021';
+}
+.t-icon-animation:before {
+ content: '\E022';
+}
+.t-icon-anticlockwise-filled:before {
+ content: '\E023';
+}
+.t-icon-anticlockwise:before {
+ content: '\E024';
+}
+.t-icon-api:before {
+ content: '\E025';
+}
+.t-icon-app-filled:before {
+ content: '\E026';
+}
+.t-icon-app:before {
+ content: '\E027';
+}
+.t-icon-apple-filled:before {
+ content: '\E028';
+}
+.t-icon-apple:before {
+ content: '\E029';
+}
+.t-icon-application-filled:before {
+ content: '\E02A';
+}
+.t-icon-application:before {
+ content: '\E02B';
+}
+.t-icon-architecture-hui-style-filled:before {
+ content: '\E02C';
+}
+.t-icon-architecture-hui-style:before {
+ content: '\E02D';
+}
+.t-icon-archway-1-filled:before {
+ content: '\E02E';
+}
+.t-icon-archway-1:before {
+ content: '\E02F';
+}
+.t-icon-archway-filled:before {
+ content: '\E030';
+}
+.t-icon-archway:before {
+ content: '\E031';
+}
+.t-icon-arrow-down-circle-filled:before {
+ content: '\E032';
+}
+.t-icon-arrow-down-circle:before {
+ content: '\E033';
+}
+.t-icon-arrow-down-rectangle-filled:before {
+ content: '\E034';
+}
+.t-icon-arrow-down-rectangle:before {
+ content: '\E035';
+}
+.t-icon-arrow-down:before {
+ content: '\E036';
+}
+.t-icon-arrow-left-circle-filled:before {
+ content: '\E037';
+}
+.t-icon-arrow-left-circle:before {
+ content: '\E038';
+}
+.t-icon-arrow-left-down-circle-filled:before {
+ content: '\E039';
+}
+.t-icon-arrow-left-down-circle:before {
+ content: '\E03A';
+}
+.t-icon-arrow-left-down:before {
+ content: '\E03B';
+}
+.t-icon-arrow-left-right-1:before {
+ content: '\E03C';
+}
+.t-icon-arrow-left-right-2:before {
+ content: '\E03D';
+}
+.t-icon-arrow-left-right-3:before {
+ content: '\E03E';
+}
+.t-icon-arrow-left-right-circle-filled:before {
+ content: '\E03F';
+}
+.t-icon-arrow-left-right-circle:before {
+ content: '\E040';
+}
+.t-icon-arrow-left-up-circle-filled:before {
+ content: '\E041';
+}
+.t-icon-arrow-left-up-circle:before {
+ content: '\E042';
+}
+.t-icon-arrow-left-up:before {
+ content: '\E043';
+}
+.t-icon-arrow-left:before {
+ content: '\E044';
+}
+.t-icon-arrow-right-circle-filled:before {
+ content: '\E045';
+}
+.t-icon-arrow-right-circle:before {
+ content: '\E046';
+}
+.t-icon-arrow-right-down-circle-filled:before {
+ content: '\E047';
+}
+.t-icon-arrow-right-down-circle:before {
+ content: '\E048';
+}
+.t-icon-arrow-right-down:before {
+ content: '\E049';
+}
+.t-icon-arrow-right-up-circle-filled:before {
+ content: '\E04A';
+}
+.t-icon-arrow-right-up-circle:before {
+ content: '\E04B';
+}
+.t-icon-arrow-right-up:before {
+ content: '\E04C';
+}
+.t-icon-arrow-right:before {
+ content: '\E04D';
+}
+.t-icon-arrow-triangle-down-filled:before {
+ content: '\E04E';
+}
+.t-icon-arrow-triangle-down:before {
+ content: '\E04F';
+}
+.t-icon-arrow-triangle-up-filled:before {
+ content: '\E050';
+}
+.t-icon-arrow-triangle-up:before {
+ content: '\E051';
+}
+.t-icon-arrow-up-circle-filled:before {
+ content: '\E052';
+}
+.t-icon-arrow-up-circle:before {
+ content: '\E053';
+}
+.t-icon-arrow-up-down-1:before {
+ content: '\E054';
+}
+.t-icon-arrow-up-down-2:before {
+ content: '\E055';
+}
+.t-icon-arrow-up-down-3:before {
+ content: '\E056';
+}
+.t-icon-arrow-up-down-circle-filled:before {
+ content: '\E057';
+}
+.t-icon-arrow-up-down-circle:before {
+ content: '\E058';
+}
+.t-icon-arrow-up:before {
+ content: '\E059';
+}
+.t-icon-artboard:before {
+ content: '\E05A';
+}
+.t-icon-article-filled:before {
+ content: '\E05B';
+}
+.t-icon-article:before {
+ content: '\E05C';
+}
+.t-icon-assignment-checked-filled:before {
+ content: '\E05D';
+}
+.t-icon-assignment-checked:before {
+ content: '\E05E';
+}
+.t-icon-assignment-code-filled:before {
+ content: '\E05F';
+}
+.t-icon-assignment-code:before {
+ content: '\E060';
+}
+.t-icon-assignment-error-filled:before {
+ content: '\E061';
+}
+.t-icon-assignment-error:before {
+ content: '\E062';
+}
+.t-icon-assignment-filled:before {
+ content: '\E063';
+}
+.t-icon-assignment-user-filled:before {
+ content: '\E064';
+}
+.t-icon-assignment-user:before {
+ content: '\E065';
+}
+.t-icon-assignment:before {
+ content: '\E066';
+}
+.t-icon-attach:before {
+ content: '\E067';
+}
+.t-icon-attic-1-filled:before {
+ content: '\E068';
+}
+.t-icon-attic-1:before {
+ content: '\E069';
+}
+.t-icon-attic-filled:before {
+ content: '\E06A';
+}
+.t-icon-attic:before {
+ content: '\E06B';
+}
+.t-icon-audio-filled:before {
+ content: '\E06C';
+}
+.t-icon-audio:before {
+ content: '\E06D';
+}
+.t-icon-awkward-filled:before {
+ content: '\E06E';
+}
+.t-icon-awkward:before {
+ content: '\E06F';
+}
+.t-icon-backtop-rectangle-filled:before {
+ content: '\E070';
+}
+.t-icon-backtop-rectangle:before {
+ content: '\E071';
+}
+.t-icon-backtop:before {
+ content: '\E072';
+}
+.t-icon-backup-filled:before {
+ content: '\E073';
+}
+.t-icon-backup:before {
+ content: '\E074';
+}
+.t-icon-backward-filled:before {
+ content: '\E075';
+}
+.t-icon-backward:before {
+ content: '\E076';
+}
+.t-icon-bad-laugh-filled:before {
+ content: '\E077';
+}
+.t-icon-bad-laugh:before {
+ content: '\E078';
+}
+.t-icon-bamboo-shoot-filled:before {
+ content: '\E079';
+}
+.t-icon-bamboo-shoot:before {
+ content: '\E07A';
+}
+.t-icon-banana-filled:before {
+ content: '\E07B';
+}
+.t-icon-banana:before {
+ content: '\E07C';
+}
+.t-icon-barbecue-filled:before {
+ content: '\E07D';
+}
+.t-icon-barbecue:before {
+ content: '\E07E';
+}
+.t-icon-barcode-1:before {
+ content: '\E07F';
+}
+.t-icon-barcode:before {
+ content: '\E080';
+}
+.t-icon-base-station:before {
+ content: '\E081';
+}
+.t-icon-battery-add-filled:before {
+ content: '\E082';
+}
+.t-icon-battery-add:before {
+ content: '\E083';
+}
+.t-icon-battery-charging-filled:before {
+ content: '\E084';
+}
+.t-icon-battery-charging:before {
+ content: '\E085';
+}
+.t-icon-battery-filled:before {
+ content: '\E086';
+}
+.t-icon-battery-low-filled:before {
+ content: '\E087';
+}
+.t-icon-battery-low:before {
+ content: '\E088';
+}
+.t-icon-battery:before {
+ content: '\E089';
+}
+.t-icon-bean-filled:before {
+ content: '\E08A';
+}
+.t-icon-bean:before {
+ content: '\E08B';
+}
+.t-icon-beer-filled:before {
+ content: '\E08C';
+}
+.t-icon-beer:before {
+ content: '\E08D';
+}
+.t-icon-beta:before {
+ content: '\E08E';
+}
+.t-icon-bifurcate-filled:before {
+ content: '\E08F';
+}
+.t-icon-bifurcate:before {
+ content: '\E090';
+}
+.t-icon-bill-filled:before {
+ content: '\E091';
+}
+.t-icon-bill:before {
+ content: '\E092';
+}
+.t-icon-bluetooth:before {
+ content: '\E093';
+}
+.t-icon-bone-filled:before {
+ content: '\E094';
+}
+.t-icon-bone:before {
+ content: '\E095';
+}
+.t-icon-book-filled:before {
+ content: '\E096';
+}
+.t-icon-book-open-filled:before {
+ content: '\E097';
+}
+.t-icon-book-open:before {
+ content: '\E098';
+}
+.t-icon-book-unknown-filled:before {
+ content: '\E099';
+}
+.t-icon-book-unknown:before {
+ content: '\E09A';
+}
+.t-icon-book:before {
+ content: '\E09B';
+}
+.t-icon-bookmark-add-filled:before {
+ content: '\E09C';
+}
+.t-icon-bookmark-add:before {
+ content: '\E09D';
+}
+.t-icon-bookmark-checked-filled:before {
+ content: '\E09E';
+}
+.t-icon-bookmark-checked:before {
+ content: '\E09F';
+}
+.t-icon-bookmark-double-filled:before {
+ content: '\E0A0';
+}
+.t-icon-bookmark-double:before {
+ content: '\E0A1';
+}
+.t-icon-bookmark-filled:before {
+ content: '\E0A2';
+}
+.t-icon-bookmark-minus-filled:before {
+ content: '\E0A3';
+}
+.t-icon-bookmark-minus:before {
+ content: '\E0A4';
+}
+.t-icon-bookmark:before {
+ content: '\E0A5';
+}
+.t-icon-braces:before {
+ content: '\E0A6';
+}
+.t-icon-brackets:before {
+ content: '\E0A7';
+}
+.t-icon-bread-filled:before {
+ content: '\E0A8';
+}
+.t-icon-bread:before {
+ content: '\E0A9';
+}
+.t-icon-bridge-1-filled:before {
+ content: '\E0AA';
+}
+.t-icon-bridge-1:before {
+ content: '\E0AB';
+}
+.t-icon-bridge-2-filled:before {
+ content: '\E0AC';
+}
+.t-icon-bridge-2:before {
+ content: '\E0AD';
+}
+.t-icon-bridge-3:before {
+ content: '\E0AE';
+}
+.t-icon-bridge-4:before {
+ content: '\E0AF';
+}
+.t-icon-bridge-5-filled:before {
+ content: '\E0B0';
+}
+.t-icon-bridge-5:before {
+ content: '\E0B1';
+}
+.t-icon-bridge-6-filled:before {
+ content: '\E0B2';
+}
+.t-icon-bridge-6:before {
+ content: '\E0B3';
+}
+.t-icon-bridge:before {
+ content: '\E0B4';
+}
+.t-icon-brightness-1-filled:before {
+ content: '\E0B5';
+}
+.t-icon-brightness-1:before {
+ content: '\E0B6';
+}
+.t-icon-brightness-filled:before {
+ content: '\E0B7';
+}
+.t-icon-brightness:before {
+ content: '\E0B8';
+}
+.t-icon-broccoli-filled:before {
+ content: '\E0B9';
+}
+.t-icon-broccoli:before {
+ content: '\E0BA';
+}
+.t-icon-browse-filled:before {
+ content: '\E0BB';
+}
+.t-icon-browse-gallery-filled:before {
+ content: '\E0BC';
+}
+.t-icon-browse-gallery:before {
+ content: '\E0BD';
+}
+.t-icon-browse-off-filled:before {
+ content: '\E0BE';
+}
+.t-icon-browse-off:before {
+ content: '\E0BF';
+}
+.t-icon-browse:before {
+ content: '\E0C0';
+}
+.t-icon-brush-filled:before {
+ content: '\E0C1';
+}
+.t-icon-brush:before {
+ content: '\E0C2';
+}
+.t-icon-bug-filled:before {
+ content: '\E0C3';
+}
+.t-icon-bug-report-filled:before {
+ content: '\E0C4';
+}
+.t-icon-bug-report:before {
+ content: '\E0C5';
+}
+.t-icon-bug:before {
+ content: '\E0C6';
+}
+.t-icon-building-1-filled:before {
+ content: '\E0C7';
+}
+.t-icon-building-1:before {
+ content: '\E0C8';
+}
+.t-icon-building-2-filled:before {
+ content: '\E0C9';
+}
+.t-icon-building-2:before {
+ content: '\E0CA';
+}
+.t-icon-building-3-filled:before {
+ content: '\E0CB';
+}
+.t-icon-building-3:before {
+ content: '\E0CC';
+}
+.t-icon-building-4-filled:before {
+ content: '\E0CD';
+}
+.t-icon-building-4:before {
+ content: '\E0CE';
+}
+.t-icon-building-5-filled:before {
+ content: '\E0CF';
+}
+.t-icon-building-5:before {
+ content: '\E0D0';
+}
+.t-icon-building-filled:before {
+ content: '\E0D1';
+}
+.t-icon-building:before {
+ content: '\E0D2';
+}
+.t-icon-bulletpoint:before {
+ content: '\E0D3';
+}
+.t-icon-button-filled:before {
+ content: '\E0D4';
+}
+.t-icon-button:before {
+ content: '\E0D5';
+}
+.t-icon-cabbage-filled:before {
+ content: '\E0D6';
+}
+.t-icon-cabbage:before {
+ content: '\E0D7';
+}
+.t-icon-cake-filled:before {
+ content: '\E0D8';
+}
+.t-icon-cake:before {
+ content: '\E0D9';
+}
+.t-icon-calculation-1-filled:before {
+ content: '\E0DA';
+}
+.t-icon-calculation-1:before {
+ content: '\E0DB';
+}
+.t-icon-calculation:before {
+ content: '\E0DC';
+}
+.t-icon-calculator-1:before {
+ content: '\E0DD';
+}
+.t-icon-calculator-filled:before {
+ content: '\E0DE';
+}
+.t-icon-calculator:before {
+ content: '\E0DF';
+}
+.t-icon-calendar-1-filled:before {
+ content: '\E0E0';
+}
+.t-icon-calendar-1:before {
+ content: '\E0E1';
+}
+.t-icon-calendar-2-filled:before {
+ content: '\E0E2';
+}
+.t-icon-calendar-2:before {
+ content: '\E0E3';
+}
+.t-icon-calendar-edit-filled:before {
+ content: '\E0E4';
+}
+.t-icon-calendar-edit:before {
+ content: '\E0E5';
+}
+.t-icon-calendar-event-filled:before {
+ content: '\E0E6';
+}
+.t-icon-calendar-event:before {
+ content: '\E0E7';
+}
+.t-icon-calendar-filled:before {
+ content: '\E0E8';
+}
+.t-icon-calendar:before {
+ content: '\E0E9';
+}
+.t-icon-call-1-filled:before {
+ content: '\E0EA';
+}
+.t-icon-call-1:before {
+ content: '\E0EB';
+}
+.t-icon-call-cancel-filled:before {
+ content: '\E0EC';
+}
+.t-icon-call-cancel:before {
+ content: '\E0ED';
+}
+.t-icon-call-filled:before {
+ content: '\E0EE';
+}
+.t-icon-call-forwarded-filled:before {
+ content: '\E0EF';
+}
+.t-icon-call-forwarded:before {
+ content: '\E0F0';
+}
+.t-icon-call-incoming-filled:before {
+ content: '\E0F1';
+}
+.t-icon-call-incoming:before {
+ content: '\E0F2';
+}
+.t-icon-call-off-filled:before {
+ content: '\E0F3';
+}
+.t-icon-call-off:before {
+ content: '\E0F4';
+}
+.t-icon-call:before {
+ content: '\E0F5';
+}
+.t-icon-calm-1-filled:before {
+ content: '\E0F6';
+}
+.t-icon-calm-1:before {
+ content: '\E0F7';
+}
+.t-icon-calm-filled:before {
+ content: '\E0F8';
+}
+.t-icon-calm:before {
+ content: '\E0F9';
+}
+.t-icon-camera-1-filled:before {
+ content: '\E0FA';
+}
+.t-icon-camera-1:before {
+ content: '\E0FB';
+}
+.t-icon-camera-2-filled:before {
+ content: '\E0FC';
+}
+.t-icon-camera-2:before {
+ content: '\E0FD';
+}
+.t-icon-camera-filled:before {
+ content: '\E0FE';
+}
+.t-icon-camera-off-filled:before {
+ content: '\E0FF';
+}
+.t-icon-camera-off:before {
+ content: '\E100';
+}
+.t-icon-camera:before {
+ content: '\E101';
+}
+.t-icon-candy-filled:before {
+ content: '\E102';
+}
+.t-icon-candy:before {
+ content: '\E103';
+}
+.t-icon-card-filled:before {
+ content: '\E104';
+}
+.t-icon-card:before {
+ content: '\E105';
+}
+.t-icon-cardmembership-filled:before {
+ content: '\E106';
+}
+.t-icon-cardmembership:before {
+ content: '\E107';
+}
+.t-icon-caret-down-small:before {
+ content: '\E108';
+}
+.t-icon-caret-down:before {
+ content: '\E109';
+}
+.t-icon-caret-left-small:before {
+ content: '\E10A';
+}
+.t-icon-caret-left:before {
+ content: '\E10B';
+}
+.t-icon-caret-right-small:before {
+ content: '\E10C';
+}
+.t-icon-caret-right:before {
+ content: '\E10D';
+}
+.t-icon-caret-up-small:before {
+ content: '\E10E';
+}
+.t-icon-caret-up:before {
+ content: '\E10F';
+}
+.t-icon-cart-add-filled:before {
+ content: '\E110';
+}
+.t-icon-cart-add:before {
+ content: '\E111';
+}
+.t-icon-cart-filled:before {
+ content: '\E112';
+}
+.t-icon-cart:before {
+ content: '\E113';
+}
+.t-icon-cast-filled:before {
+ content: '\E114';
+}
+.t-icon-cast:before {
+ content: '\E115';
+}
+.t-icon-castle-1-filled:before {
+ content: '\E116';
+}
+.t-icon-castle-1:before {
+ content: '\E117';
+}
+.t-icon-castle-2-filled:before {
+ content: '\E118';
+}
+.t-icon-castle-2:before {
+ content: '\E119';
+}
+.t-icon-castle-3-filled:before {
+ content: '\E11A';
+}
+.t-icon-castle-3:before {
+ content: '\E11B';
+}
+.t-icon-castle-4-filled:before {
+ content: '\E11C';
+}
+.t-icon-castle-4:before {
+ content: '\E11D';
+}
+.t-icon-castle-5-filled:before {
+ content: '\E11E';
+}
+.t-icon-castle-5:before {
+ content: '\E11F';
+}
+.t-icon-castle-6-filled:before {
+ content: '\E120';
+}
+.t-icon-castle-6:before {
+ content: '\E121';
+}
+.t-icon-castle-7-filled:before {
+ content: '\E122';
+}
+.t-icon-castle-7:before {
+ content: '\E123';
+}
+.t-icon-castle-filled:before {
+ content: '\E124';
+}
+.t-icon-castle:before {
+ content: '\E125';
+}
+.t-icon-cat-filled:before {
+ content: '\E126';
+}
+.t-icon-cat:before {
+ content: '\E127';
+}
+.t-icon-catalog-filled:before {
+ content: '\E128';
+}
+.t-icon-catalog:before {
+ content: '\E129';
+}
+.t-icon-cd-filled:before {
+ content: '\E12A';
+}
+.t-icon-cd:before {
+ content: '\E12B';
+}
+.t-icon-celsius:before {
+ content: '\E12C';
+}
+.t-icon-center-focus-strong-filled:before {
+ content: '\E12D';
+}
+.t-icon-center-focus-strong:before {
+ content: '\E12E';
+}
+.t-icon-centimeter:before {
+ content: '\E12F';
+}
+.t-icon-certificate-1-filled:before {
+ content: '\E130';
+}
+.t-icon-certificate-1:before {
+ content: '\E131';
+}
+.t-icon-certificate-filled:before {
+ content: '\E132';
+}
+.t-icon-certificate:before {
+ content: '\E133';
+}
+.t-icon-chart-3d-filled:before {
+ content: '\E134';
+}
+.t-icon-chart-3d:before {
+ content: '\E135';
+}
+.t-icon-chart-add-filled:before {
+ content: '\E136';
+}
+.t-icon-chart-add:before {
+ content: '\E137';
+}
+.t-icon-chart-analytics:before {
+ content: '\E138';
+}
+.t-icon-chart-area-filled:before {
+ content: '\E139';
+}
+.t-icon-chart-area-multi-filled:before {
+ content: '\E13A';
+}
+.t-icon-chart-area-multi:before {
+ content: '\E13B';
+}
+.t-icon-chart-area:before {
+ content: '\E13C';
+}
+.t-icon-chart-bar-filled:before {
+ content: '\E13D';
+}
+.t-icon-chart-bar:before {
+ content: '\E13E';
+}
+.t-icon-chart-bubble-filled:before {
+ content: '\E13F';
+}
+.t-icon-chart-bubble:before {
+ content: '\E140';
+}
+.t-icon-chart-column-filled:before {
+ content: '\E141';
+}
+.t-icon-chart-column:before {
+ content: '\E142';
+}
+.t-icon-chart-combo-filled:before {
+ content: '\E143';
+}
+.t-icon-chart-combo:before {
+ content: '\E144';
+}
+.t-icon-chart-filled:before {
+ content: '\E145';
+}
+.t-icon-chart-line-data-1:before {
+ content: '\E146';
+}
+.t-icon-chart-line-data:before {
+ content: '\E147';
+}
+.t-icon-chart-line-multi:before {
+ content: '\E148';
+}
+.t-icon-chart-line:before {
+ content: '\E149';
+}
+.t-icon-chart-maximum:before {
+ content: '\E14A';
+}
+.t-icon-chart-median:before {
+ content: '\E14B';
+}
+.t-icon-chart-minimum:before {
+ content: '\E14C';
+}
+.t-icon-chart-pie-filled:before {
+ content: '\E14D';
+}
+.t-icon-chart-pie:before {
+ content: '\E14E';
+}
+.t-icon-chart-radar-filled:before {
+ content: '\E14F';
+}
+.t-icon-chart-radar:before {
+ content: '\E150';
+}
+.t-icon-chart-radial:before {
+ content: '\E151';
+}
+.t-icon-chart-ring-1-filled:before {
+ content: '\E152';
+}
+.t-icon-chart-ring-1:before {
+ content: '\E153';
+}
+.t-icon-chart-ring-filled:before {
+ content: '\E154';
+}
+.t-icon-chart-ring:before {
+ content: '\E155';
+}
+.t-icon-chart-scatter:before {
+ content: '\E156';
+}
+.t-icon-chart-stacked-filled:before {
+ content: '\E157';
+}
+.t-icon-chart-stacked:before {
+ content: '\E158';
+}
+.t-icon-chart:before {
+ content: '\E159';
+}
+.t-icon-chat-add-filled:before {
+ content: '\E15A';
+}
+.t-icon-chat-add:before {
+ content: '\E15B';
+}
+.t-icon-chat-bubble-1-filled:before {
+ content: '\E15C';
+}
+.t-icon-chat-bubble-1:before {
+ content: '\E15D';
+}
+.t-icon-chat-bubble-add-filled:before {
+ content: '\E15E';
+}
+.t-icon-chat-bubble-add:before {
+ content: '\E15F';
+}
+.t-icon-chat-bubble-error-filled:before {
+ content: '\E160';
+}
+.t-icon-chat-bubble-error:before {
+ content: '\E161';
+}
+.t-icon-chat-bubble-filled:before {
+ content: '\E162';
+}
+.t-icon-chat-bubble-help-filled:before {
+ content: '\E163';
+}
+.t-icon-chat-bubble-help:before {
+ content: '\E164';
+}
+.t-icon-chat-bubble-history-filled:before {
+ content: '\E165';
+}
+.t-icon-chat-bubble-history:before {
+ content: '\E166';
+}
+.t-icon-chat-bubble-locked-filled:before {
+ content: '\E167';
+}
+.t-icon-chat-bubble-locked:before {
+ content: '\E168';
+}
+.t-icon-chat-bubble-smile-filled:before {
+ content: '\E169';
+}
+.t-icon-chat-bubble-smile:before {
+ content: '\E16A';
+}
+.t-icon-chat-bubble:before {
+ content: '\E16B';
+}
+.t-icon-chat-checked-filled:before {
+ content: '\E16C';
+}
+.t-icon-chat-checked:before {
+ content: '\E16D';
+}
+.t-icon-chat-clear-filled:before {
+ content: '\E16E';
+}
+.t-icon-chat-clear:before {
+ content: '\E16F';
+}
+.t-icon-chat-double-filled:before {
+ content: '\E170';
+}
+.t-icon-chat-double:before {
+ content: '\E171';
+}
+.t-icon-chat-error-filled:before {
+ content: '\E172';
+}
+.t-icon-chat-error:before {
+ content: '\E173';
+}
+.t-icon-chat-filled:before {
+ content: '\E174';
+}
+.t-icon-chat-heart-filled:before {
+ content: '\E175';
+}
+.t-icon-chat-heart:before {
+ content: '\E176';
+}
+.t-icon-chat-message-filled:before {
+ content: '\E177';
+}
+.t-icon-chat-message:before {
+ content: '\E178';
+}
+.t-icon-chat-off-filled:before {
+ content: '\E179';
+}
+.t-icon-chat-off:before {
+ content: '\E17A';
+}
+.t-icon-chat-poll-filled:before {
+ content: '\E17B';
+}
+.t-icon-chat-poll:before {
+ content: '\E17C';
+}
+.t-icon-chat-setting-filled:before {
+ content: '\E17D';
+}
+.t-icon-chat-setting:before {
+ content: '\E17E';
+}
+.t-icon-chat:before {
+ content: '\E17F';
+}
+.t-icon-check-circle-filled:before {
+ content: '\E180';
+}
+.t-icon-check-circle:before {
+ content: '\E181';
+}
+.t-icon-check-double:before {
+ content: '\E182';
+}
+.t-icon-check-rectangle-filled:before {
+ content: '\E183';
+}
+.t-icon-check-rectangle:before {
+ content: '\E184';
+}
+.t-icon-check:before {
+ content: '\E185';
+}
+.t-icon-cheese-filled:before {
+ content: '\E186';
+}
+.t-icon-cheese:before {
+ content: '\E187';
+}
+.t-icon-cherry-filled:before {
+ content: '\E188';
+}
+.t-icon-cherry:before {
+ content: '\E189';
+}
+.t-icon-chevron-down-circle-filled:before {
+ content: '\E18A';
+}
+.t-icon-chevron-down-circle:before {
+ content: '\E18B';
+}
+.t-icon-chevron-down-double-s:before {
+ content: '\E18C';
+}
+.t-icon-chevron-down-double:before {
+ content: '\E18D';
+}
+.t-icon-chevron-down-rectangle-filled:before {
+ content: '\E18E';
+}
+.t-icon-chevron-down-rectangle:before {
+ content: '\E18F';
+}
+.t-icon-chevron-down-s:before {
+ content: '\E190';
+}
+.t-icon-chevron-down:before {
+ content: '\E191';
+}
+.t-icon-chevron-left-circle-filled:before {
+ content: '\E192';
+}
+.t-icon-chevron-left-circle:before {
+ content: '\E193';
+}
+.t-icon-chevron-left-double-s:before {
+ content: '\E194';
+}
+.t-icon-chevron-left-double:before {
+ content: '\E195';
+}
+.t-icon-chevron-left-rectangle-filled:before {
+ content: '\E196';
+}
+.t-icon-chevron-left-rectangle:before {
+ content: '\E197';
+}
+.t-icon-chevron-left-s:before {
+ content: '\E198';
+}
+.t-icon-chevron-left:before {
+ content: '\E199';
+}
+.t-icon-chevron-right-circle-filled:before {
+ content: '\E19A';
+}
+.t-icon-chevron-right-circle:before {
+ content: '\E19B';
+}
+.t-icon-chevron-right-double-s:before {
+ content: '\E19C';
+}
+.t-icon-chevron-right-double:before {
+ content: '\E19D';
+}
+.t-icon-chevron-right-rectangle-filled:before {
+ content: '\E19E';
+}
+.t-icon-chevron-right-rectangle:before {
+ content: '\E19F';
+}
+.t-icon-chevron-right-s:before {
+ content: '\E1A0';
+}
+.t-icon-chevron-right:before {
+ content: '\E1A1';
+}
+.t-icon-chevron-up-circle-filled:before {
+ content: '\E1A2';
+}
+.t-icon-chevron-up-circle:before {
+ content: '\E1A3';
+}
+.t-icon-chevron-up-double-s:before {
+ content: '\E1A4';
+}
+.t-icon-chevron-up-double:before {
+ content: '\E1A5';
+}
+.t-icon-chevron-up-rectangle-filled:before {
+ content: '\E1A6';
+}
+.t-icon-chevron-up-rectangle:before {
+ content: '\E1A7';
+}
+.t-icon-chevron-up-s:before {
+ content: '\E1A8';
+}
+.t-icon-chevron-up:before {
+ content: '\E1A9';
+}
+.t-icon-chicken:before {
+ content: '\E1AA';
+}
+.t-icon-chili-filled:before {
+ content: '\E1AB';
+}
+.t-icon-chili:before {
+ content: '\E1AC';
+}
+.t-icon-chimney-1-filled:before {
+ content: '\E1AD';
+}
+.t-icon-chimney-1:before {
+ content: '\E1AE';
+}
+.t-icon-chimney-2-filled:before {
+ content: '\E1AF';
+}
+.t-icon-chimney-2:before {
+ content: '\E1B0';
+}
+.t-icon-chimney-filled:before {
+ content: '\E1B1';
+}
+.t-icon-chimney:before {
+ content: '\E1B2';
+}
+.t-icon-chinese-cabbage-filled:before {
+ content: '\E1B3';
+}
+.t-icon-chinese-cabbage:before {
+ content: '\E1B4';
+}
+.t-icon-church-filled:before {
+ content: '\E1B5';
+}
+.t-icon-church:before {
+ content: '\E1B6';
+}
+.t-icon-circle-filled:before {
+ content: '\E1B7';
+}
+.t-icon-circle:before {
+ content: '\E1B8';
+}
+.t-icon-city-1-filled:before {
+ content: '\E1B9';
+}
+.t-icon-city-1:before {
+ content: '\E1BA';
+}
+.t-icon-city-10-filled:before {
+ content: '\E1BB';
+}
+.t-icon-city-10:before {
+ content: '\E1BC';
+}
+.t-icon-city-11-filled:before {
+ content: '\E1BD';
+}
+.t-icon-city-11:before {
+ content: '\E1BE';
+}
+.t-icon-city-12-filled:before {
+ content: '\E1BF';
+}
+.t-icon-city-12:before {
+ content: '\E1C0';
+}
+.t-icon-city-13-filled:before {
+ content: '\E1C1';
+}
+.t-icon-city-13:before {
+ content: '\E1C2';
+}
+.t-icon-city-14-filled:before {
+ content: '\E1C3';
+}
+.t-icon-city-14:before {
+ content: '\E1C4';
+}
+.t-icon-city-15-filled:before {
+ content: '\E1C5';
+}
+.t-icon-city-15:before {
+ content: '\E1C6';
+}
+.t-icon-city-2-filled:before {
+ content: '\E1C7';
+}
+.t-icon-city-2:before {
+ content: '\E1C8';
+}
+.t-icon-city-3-filled:before {
+ content: '\E1C9';
+}
+.t-icon-city-3:before {
+ content: '\E1CA';
+}
+.t-icon-city-4-filled:before {
+ content: '\E1CB';
+}
+.t-icon-city-4:before {
+ content: '\E1CC';
+}
+.t-icon-city-5-filled:before {
+ content: '\E1CD';
+}
+.t-icon-city-5:before {
+ content: '\E1CE';
+}
+.t-icon-city-6-filled:before {
+ content: '\E1CF';
+}
+.t-icon-city-6:before {
+ content: '\E1D0';
+}
+.t-icon-city-7-filled:before {
+ content: '\E1D1';
+}
+.t-icon-city-7:before {
+ content: '\E1D2';
+}
+.t-icon-city-8-filled:before {
+ content: '\E1D3';
+}
+.t-icon-city-8:before {
+ content: '\E1D4';
+}
+.t-icon-city-9-filled:before {
+ content: '\E1D5';
+}
+.t-icon-city-9:before {
+ content: '\E1D6';
+}
+.t-icon-city-ancient-1-filled:before {
+ content: '\E1D7';
+}
+.t-icon-city-ancient-1:before {
+ content: '\E1D8';
+}
+.t-icon-city-ancient-2-filled:before {
+ content: '\E1D9';
+}
+.t-icon-city-ancient-2:before {
+ content: '\E1DA';
+}
+.t-icon-city-ancient-filled:before {
+ content: '\E1DB';
+}
+.t-icon-city-ancient:before {
+ content: '\E1DC';
+}
+.t-icon-city-filled:before {
+ content: '\E1DD';
+}
+.t-icon-city:before {
+ content: '\E1DE';
+}
+.t-icon-clear-filled:before {
+ content: '\E1DF';
+}
+.t-icon-clear-formatting-1-filled:before {
+ content: '\E1E0';
+}
+.t-icon-clear-formatting-1:before {
+ content: '\E1E1';
+}
+.t-icon-clear-formatting-filled:before {
+ content: '\E1E2';
+}
+.t-icon-clear-formatting:before {
+ content: '\E1E3';
+}
+.t-icon-clear:before {
+ content: '\E1E4';
+}
+.t-icon-close-circle-filled:before {
+ content: '\E1E5';
+}
+.t-icon-close-circle:before {
+ content: '\E1E6';
+}
+.t-icon-close-octagon-filled:before {
+ content: '\E1E7';
+}
+.t-icon-close-octagon:before {
+ content: '\E1E8';
+}
+.t-icon-close-rectangle-filled:before {
+ content: '\E1E9';
+}
+.t-icon-close-rectangle:before {
+ content: '\E1EA';
+}
+.t-icon-close:before {
+ content: '\E1EB';
+}
+.t-icon-cloud-download:before {
+ content: '\E1EC';
+}
+.t-icon-cloud-filled:before {
+ content: '\E1ED';
+}
+.t-icon-cloud-upload:before {
+ content: '\E1EE';
+}
+.t-icon-cloud:before {
+ content: '\E1EF';
+}
+.t-icon-cloudy-day-filled:before {
+ content: '\E1F0';
+}
+.t-icon-cloudy-day:before {
+ content: '\E1F1';
+}
+.t-icon-cloudy-night-filled:before {
+ content: '\E1F2';
+}
+.t-icon-cloudy-night-rain-filled:before {
+ content: '\E1F3';
+}
+.t-icon-cloudy-night-rain:before {
+ content: '\E1F4';
+}
+.t-icon-cloudy-night:before {
+ content: '\E1F5';
+}
+.t-icon-cloudy-rain-filled:before {
+ content: '\E1F6';
+}
+.t-icon-cloudy-rain:before {
+ content: '\E1F7';
+}
+.t-icon-cloudy-sunny-filled:before {
+ content: '\E1F8';
+}
+.t-icon-cloudy-sunny:before {
+ content: '\E1F9';
+}
+.t-icon-code-1:before {
+ content: '\E1FA';
+}
+.t-icon-code-off:before {
+ content: '\E1FB';
+}
+.t-icon-code:before {
+ content: '\E1FC';
+}
+.t-icon-cola-filled:before {
+ content: '\E1FD';
+}
+.t-icon-cola:before {
+ content: '\E1FE';
+}
+.t-icon-collage-filled:before {
+ content: '\E1FF';
+}
+.t-icon-collage:before {
+ content: '\E200';
+}
+.t-icon-collection-filled:before {
+ content: '\E201';
+}
+.t-icon-collection:before {
+ content: '\E202';
+}
+.t-icon-color-invert-filled:before {
+ content: '\E203';
+}
+.t-icon-color-invert:before {
+ content: '\E204';
+}
+.t-icon-combination-filled:before {
+ content: '\E205';
+}
+.t-icon-combination:before {
+ content: '\E206';
+}
+.t-icon-command:before {
+ content: '\E207';
+}
+.t-icon-compass-1-filled:before {
+ content: '\E208';
+}
+.t-icon-compass-1:before {
+ content: '\E209';
+}
+.t-icon-compass-filled:before {
+ content: '\E20A';
+}
+.t-icon-compass:before {
+ content: '\E20B';
+}
+.t-icon-component-breadcrumb-filled:before {
+ content: '\E20C';
+}
+.t-icon-component-breadcrumb:before {
+ content: '\E20D';
+}
+.t-icon-component-checkbox-filled:before {
+ content: '\E20E';
+}
+.t-icon-component-checkbox:before {
+ content: '\E20F';
+}
+.t-icon-component-divider-horizontal-filled:before {
+ content: '\E210';
+}
+.t-icon-component-divider-horizontal:before {
+ content: '\E211';
+}
+.t-icon-component-divider-vertical-filled:before {
+ content: '\E212';
+}
+.t-icon-component-divider-vertical:before {
+ content: '\E213';
+}
+.t-icon-component-dropdown-filled:before {
+ content: '\E214';
+}
+.t-icon-component-dropdown:before {
+ content: '\E215';
+}
+.t-icon-component-grid-filled:before {
+ content: '\E216';
+}
+.t-icon-component-grid:before {
+ content: '\E217';
+}
+.t-icon-component-input-filled:before {
+ content: '\E218';
+}
+.t-icon-component-input:before {
+ content: '\E219';
+}
+.t-icon-component-layout-filled:before {
+ content: '\E21A';
+}
+.t-icon-component-layout:before {
+ content: '\E21B';
+}
+.t-icon-component-radio:before {
+ content: '\E21C';
+}
+.t-icon-component-space-filled:before {
+ content: '\E21D';
+}
+.t-icon-component-space:before {
+ content: '\E21E';
+}
+.t-icon-component-steps-filled:before {
+ content: '\E21F';
+}
+.t-icon-component-steps:before {
+ content: '\E220';
+}
+.t-icon-component-switch-filled:before {
+ content: '\E221';
+}
+.t-icon-component-switch:before {
+ content: '\E222';
+}
+.t-icon-constraint:before {
+ content: '\E223';
+}
+.t-icon-contrast-1-filled:before {
+ content: '\E224';
+}
+.t-icon-contrast-1:before {
+ content: '\E225';
+}
+.t-icon-contrast-filled:before {
+ content: '\E226';
+}
+.t-icon-contrast:before {
+ content: '\E227';
+}
+.t-icon-control-platform-filled:before {
+ content: '\E228';
+}
+.t-icon-control-platform:before {
+ content: '\E229';
+}
+.t-icon-cooperate-filled:before {
+ content: '\E22A';
+}
+.t-icon-cooperate:before {
+ content: '\E22B';
+}
+.t-icon-coordinate-system-filled:before {
+ content: '\E22C';
+}
+.t-icon-coordinate-system:before {
+ content: '\E22D';
+}
+.t-icon-copy-filled:before {
+ content: '\E22E';
+}
+.t-icon-copy:before {
+ content: '\E22F';
+}
+.t-icon-copyright-filled:before {
+ content: '\E230';
+}
+.t-icon-copyright:before {
+ content: '\E231';
+}
+.t-icon-corn-filled:before {
+ content: '\E232';
+}
+.t-icon-corn:before {
+ content: '\E233';
+}
+.t-icon-coupon-filled:before {
+ content: '\E234';
+}
+.t-icon-coupon:before {
+ content: '\E235';
+}
+.t-icon-course-filled:before {
+ content: '\E236';
+}
+.t-icon-course:before {
+ content: '\E237';
+}
+.t-icon-cpu-filled:before {
+ content: '\E238';
+}
+.t-icon-cpu:before {
+ content: '\E239';
+}
+.t-icon-crack-filled:before {
+ content: '\E23A';
+}
+.t-icon-crack:before {
+ content: '\E23B';
+}
+.t-icon-creditcard-add-filled:before {
+ content: '\E23C';
+}
+.t-icon-creditcard-add:before {
+ content: '\E23D';
+}
+.t-icon-creditcard-filled:before {
+ content: '\E23E';
+}
+.t-icon-creditcard-off-filled:before {
+ content: '\E23F';
+}
+.t-icon-creditcard-off:before {
+ content: '\E240';
+}
+.t-icon-creditcard:before {
+ content: '\E241';
+}
+.t-icon-crooked-smile-filled:before {
+ content: '\E242';
+}
+.t-icon-crooked-smile:before {
+ content: '\E243';
+}
+.t-icon-cry-and-laugh-filled:before {
+ content: '\E244';
+}
+.t-icon-cry-and-laugh:before {
+ content: '\E245';
+}
+.t-icon-cry-loudly-filled:before {
+ content: '\E246';
+}
+.t-icon-cry-loudly:before {
+ content: '\E247';
+}
+.t-icon-css3-filled:before {
+ content: '\E248';
+}
+.t-icon-css3:before {
+ content: '\E249';
+}
+.t-icon-cucumber:before {
+ content: '\E24A';
+}
+.t-icon-currency-exchange:before {
+ content: '\E24B';
+}
+.t-icon-cursor-filled:before {
+ content: '\E24C';
+}
+.t-icon-cursor:before {
+ content: '\E24D';
+}
+.t-icon-curtain-filled:before {
+ content: '\E24E';
+}
+.t-icon-curtain:before {
+ content: '\E24F';
+}
+.t-icon-curve:before {
+ content: '\E250';
+}
+.t-icon-cut-1:before {
+ content: '\E251';
+}
+.t-icon-cut:before {
+ content: '\E252';
+}
+.t-icon-dam-1-filled:before {
+ content: '\E253';
+}
+.t-icon-dam-1:before {
+ content: '\E254';
+}
+.t-icon-dam-2-filled:before {
+ content: '\E255';
+}
+.t-icon-dam-2:before {
+ content: '\E256';
+}
+.t-icon-dam-3-filled:before {
+ content: '\E257';
+}
+.t-icon-dam-3:before {
+ content: '\E258';
+}
+.t-icon-dam-4-filled:before {
+ content: '\E259';
+}
+.t-icon-dam-4:before {
+ content: '\E25A';
+}
+.t-icon-dam-5-filled:before {
+ content: '\E25B';
+}
+.t-icon-dam-5:before {
+ content: '\E25C';
+}
+.t-icon-dam-6-filled:before {
+ content: '\E25D';
+}
+.t-icon-dam-6:before {
+ content: '\E25E';
+}
+.t-icon-dam-7-filled:before {
+ content: '\E25F';
+}
+.t-icon-dam-7:before {
+ content: '\E260';
+}
+.t-icon-dam-filled:before {
+ content: '\E261';
+}
+.t-icon-dam:before {
+ content: '\E262';
+}
+.t-icon-dart-board-filled:before {
+ content: '\E263';
+}
+.t-icon-dart-board:before {
+ content: '\E264';
+}
+.t-icon-dashboard-1-filled:before {
+ content: '\E265';
+}
+.t-icon-dashboard-1:before {
+ content: '\E266';
+}
+.t-icon-dashboard-filled:before {
+ content: '\E267';
+}
+.t-icon-dashboard:before {
+ content: '\E268';
+}
+.t-icon-data-base-filled:before {
+ content: '\E269';
+}
+.t-icon-data-base:before {
+ content: '\E26A';
+}
+.t-icon-data-checked-filled:before {
+ content: '\E26B';
+}
+.t-icon-data-checked:before {
+ content: '\E26C';
+}
+.t-icon-data-display:before {
+ content: '\E26D';
+}
+.t-icon-data-error-filled:before {
+ content: '\E26E';
+}
+.t-icon-data-error:before {
+ content: '\E26F';
+}
+.t-icon-data-filled:before {
+ content: '\E270';
+}
+.t-icon-data-search-filled:before {
+ content: '\E271';
+}
+.t-icon-data-search:before {
+ content: '\E272';
+}
+.t-icon-data:before {
+ content: '\E273';
+}
+.t-icon-delete-1-filled:before {
+ content: '\E274';
+}
+.t-icon-delete-1:before {
+ content: '\E275';
+}
+.t-icon-delete-filled:before {
+ content: '\E276';
+}
+.t-icon-delete-time-filled:before {
+ content: '\E277';
+}
+.t-icon-delete-time:before {
+ content: '\E278';
+}
+.t-icon-delete:before {
+ content: '\E279';
+}
+.t-icon-delta-filled:before {
+ content: '\E27A';
+}
+.t-icon-delta:before {
+ content: '\E27B';
+}
+.t-icon-depressed-filled:before {
+ content: '\E27C';
+}
+.t-icon-depressed:before {
+ content: '\E27D';
+}
+.t-icon-desktop-1-filled:before {
+ content: '\E27E';
+}
+.t-icon-desktop-1:before {
+ content: '\E27F';
+}
+.t-icon-desktop-filled:before {
+ content: '\E280';
+}
+.t-icon-desktop:before {
+ content: '\E281';
+}
+.t-icon-despise-filled:before {
+ content: '\E282';
+}
+.t-icon-despise:before {
+ content: '\E283';
+}
+.t-icon-device-filled:before {
+ content: '\E284';
+}
+.t-icon-device:before {
+ content: '\E285';
+}
+.t-icon-discount-filled:before {
+ content: '\E286';
+}
+.t-icon-discount:before {
+ content: '\E287';
+}
+.t-icon-dissatisfaction-filled:before {
+ content: '\E288';
+}
+.t-icon-dissatisfaction:before {
+ content: '\E289';
+}
+.t-icon-divide:before {
+ content: '\E28A';
+}
+.t-icon-dividers-1:before {
+ content: '\E28B';
+}
+.t-icon-dividers:before {
+ content: '\E28C';
+}
+.t-icon-doge-filled:before {
+ content: '\E28D';
+}
+.t-icon-doge:before {
+ content: '\E28E';
+}
+.t-icon-double-storey-filled:before {
+ content: '\E28F';
+}
+.t-icon-double-storey:before {
+ content: '\E290';
+}
+.t-icon-download-1:before {
+ content: '\E291';
+}
+.t-icon-download-2-filled:before {
+ content: '\E292';
+}
+.t-icon-download-2:before {
+ content: '\E293';
+}
+.t-icon-download:before {
+ content: '\E294';
+}
+.t-icon-downscale:before {
+ content: '\E295';
+}
+.t-icon-drag-drop:before {
+ content: '\E296';
+}
+.t-icon-drag-move:before {
+ content: '\E297';
+}
+.t-icon-drink-filled:before {
+ content: '\E298';
+}
+.t-icon-drink:before {
+ content: '\E299';
+}
+.t-icon-drumstick-filled:before {
+ content: '\E29A';
+}
+.t-icon-drumstick:before {
+ content: '\E29B';
+}
+.t-icon-dv-filled:before {
+ content: '\E29C';
+}
+.t-icon-dv:before {
+ content: '\E29D';
+}
+.t-icon-dvd-filled:before {
+ content: '\E29E';
+}
+.t-icon-dvd:before {
+ content: '\E29F';
+}
+.t-icon-earphone-filled:before {
+ content: '\E2A0';
+}
+.t-icon-earphone:before {
+ content: '\E2A1';
+}
+.t-icon-earth-filled:before {
+ content: '\E2A2';
+}
+.t-icon-earth:before {
+ content: '\E2A3';
+}
+.t-icon-edit-1-filled:before {
+ content: '\E2A4';
+}
+.t-icon-edit-1:before {
+ content: '\E2A5';
+}
+.t-icon-edit-2-filled:before {
+ content: '\E2A6';
+}
+.t-icon-edit-2:before {
+ content: '\E2A7';
+}
+.t-icon-edit-filled:before {
+ content: '\E2A8';
+}
+.t-icon-edit-off-filled:before {
+ content: '\E2A9';
+}
+.t-icon-edit-off:before {
+ content: '\E2AA';
+}
+.t-icon-edit:before {
+ content: '\E2AB';
+}
+.t-icon-education-filled:before {
+ content: '\E2AC';
+}
+.t-icon-education:before {
+ content: '\E2AD';
+}
+.t-icon-eggplant-filled:before {
+ content: '\E2AE';
+}
+.t-icon-eggplant:before {
+ content: '\E2AF';
+}
+.t-icon-ellipsis:before {
+ content: '\E2B0';
+}
+.t-icon-emo-emotional-filled:before {
+ content: '\E2B1';
+}
+.t-icon-emo-emotional:before {
+ content: '\E2B2';
+}
+.t-icon-enter:before {
+ content: '\E2B3';
+}
+.t-icon-equal:before {
+ content: '\E2B4';
+}
+.t-icon-error-circle-filled:before {
+ content: '\E2B5';
+}
+.t-icon-error-circle:before {
+ content: '\E2B6';
+}
+.t-icon-error-triangle-filled:before {
+ content: '\E2B7';
+}
+.t-icon-error-triangle:before {
+ content: '\E2B8';
+}
+.t-icon-error:before {
+ content: '\E2B9';
+}
+.t-icon-excited-1-filled:before {
+ content: '\E2BA';
+}
+.t-icon-excited-1:before {
+ content: '\E2BB';
+}
+.t-icon-excited-filled:before {
+ content: '\E2BC';
+}
+.t-icon-excited:before {
+ content: '\E2BD';
+}
+.t-icon-expand-down-filled:before {
+ content: '\E2BE';
+}
+.t-icon-expand-down:before {
+ content: '\E2BF';
+}
+.t-icon-expand-horizontal:before {
+ content: '\E2C0';
+}
+.t-icon-expand-up-filled:before {
+ content: '\E2C1';
+}
+.t-icon-expand-up:before {
+ content: '\E2C2';
+}
+.t-icon-expand-vertical:before {
+ content: '\E2C3';
+}
+.t-icon-explore-filled:before {
+ content: '\E2C4';
+}
+.t-icon-explore-off-filled:before {
+ content: '\E2C5';
+}
+.t-icon-explore-off:before {
+ content: '\E2C6';
+}
+.t-icon-explore:before {
+ content: '\E2C7';
+}
+.t-icon-exposure-filled:before {
+ content: '\E2C8';
+}
+.t-icon-exposure:before {
+ content: '\E2C9';
+}
+.t-icon-extension-filled:before {
+ content: '\E2CA';
+}
+.t-icon-extension-off-filled:before {
+ content: '\E2CB';
+}
+.t-icon-extension-off:before {
+ content: '\E2CC';
+}
+.t-icon-extension:before {
+ content: '\E2CD';
+}
+.t-icon-face-retouching-filled:before {
+ content: '\E2CE';
+}
+.t-icon-face-retouching:before {
+ content: '\E2CF';
+}
+.t-icon-fact-check-filled:before {
+ content: '\E2D0';
+}
+.t-icon-fact-check:before {
+ content: '\E2D1';
+}
+.t-icon-fahrenheit-scale:before {
+ content: '\E2D2';
+}
+.t-icon-feel-at-ease-filled:before {
+ content: '\E2D3';
+}
+.t-icon-feel-at-ease:before {
+ content: '\E2D4';
+}
+.t-icon-ferocious-filled:before {
+ content: '\E2D5';
+}
+.t-icon-ferocious:before {
+ content: '\E2D6';
+}
+.t-icon-ferris-wheel-filled:before {
+ content: '\E2D7';
+}
+.t-icon-ferris-wheel:before {
+ content: '\E2D8';
+}
+.t-icon-file-1-filled:before {
+ content: '\E2D9';
+}
+.t-icon-file-1:before {
+ content: '\E2DA';
+}
+.t-icon-file-add-1-filled:before {
+ content: '\E2DB';
+}
+.t-icon-file-add-1:before {
+ content: '\E2DC';
+}
+.t-icon-file-add-filled:before {
+ content: '\E2DD';
+}
+.t-icon-file-add:before {
+ content: '\E2DE';
+}
+.t-icon-file-attachment-filled:before {
+ content: '\E2DF';
+}
+.t-icon-file-attachment:before {
+ content: '\E2E0';
+}
+.t-icon-file-blocked-filled:before {
+ content: '\E2E1';
+}
+.t-icon-file-blocked:before {
+ content: '\E2E2';
+}
+.t-icon-file-code-1-filled:before {
+ content: '\E2E3';
+}
+.t-icon-file-code-1:before {
+ content: '\E2E4';
+}
+.t-icon-file-code-filled:before {
+ content: '\E2E5';
+}
+.t-icon-file-code:before {
+ content: '\E2E6';
+}
+.t-icon-file-copy-filled:before {
+ content: '\E2E7';
+}
+.t-icon-file-copy:before {
+ content: '\E2E8';
+}
+.t-icon-file-download-filled:before {
+ content: '\E2E9';
+}
+.t-icon-file-download:before {
+ content: '\E2EA';
+}
+.t-icon-file-excel-filled:before {
+ content: '\E2EB';
+}
+.t-icon-file-excel:before {
+ content: '\E2EC';
+}
+.t-icon-file-export-filled:before {
+ content: '\E2ED';
+}
+.t-icon-file-export:before {
+ content: '\E2EE';
+}
+.t-icon-file-filled:before {
+ content: '\E2EF';
+}
+.t-icon-file-icon-filled:before {
+ content: '\E2F0';
+}
+.t-icon-file-icon:before {
+ content: '\E2F1';
+}
+.t-icon-file-image-filled:before {
+ content: '\E2F2';
+}
+.t-icon-file-image:before {
+ content: '\E2F3';
+}
+.t-icon-file-import-filled:before {
+ content: '\E2F4';
+}
+.t-icon-file-import:before {
+ content: '\E2F5';
+}
+.t-icon-file-locked-filled:before {
+ content: '\E2F6';
+}
+.t-icon-file-locked:before {
+ content: '\E2F7';
+}
+.t-icon-file-minus-filled:before {
+ content: '\E2F8';
+}
+.t-icon-file-minus:before {
+ content: '\E2F9';
+}
+.t-icon-file-music-filled:before {
+ content: '\E2FA';
+}
+.t-icon-file-music:before {
+ content: '\E2FB';
+}
+.t-icon-file-onenote-filled:before {
+ content: '\E2FC';
+}
+.t-icon-file-onenote:before {
+ content: '\E2FD';
+}
+.t-icon-file-outlook-filled:before {
+ content: '\E2FE';
+}
+.t-icon-file-outlook:before {
+ content: '\E2FF';
+}
+.t-icon-file-paste-filled:before {
+ content: '\E300';
+}
+.t-icon-file-paste:before {
+ content: '\E301';
+}
+.t-icon-file-pdf-filled:before {
+ content: '\E302';
+}
+.t-icon-file-pdf:before {
+ content: '\E303';
+}
+.t-icon-file-powerpoint-filled:before {
+ content: '\E304';
+}
+.t-icon-file-powerpoint:before {
+ content: '\E305';
+}
+.t-icon-file-restore-filled:before {
+ content: '\E306';
+}
+.t-icon-file-restore:before {
+ content: '\E307';
+}
+.t-icon-file-safety-filled:before {
+ content: '\E308';
+}
+.t-icon-file-safety:before {
+ content: '\E309';
+}
+.t-icon-file-search-filled:before {
+ content: '\E30A';
+}
+.t-icon-file-search:before {
+ content: '\E30B';
+}
+.t-icon-file-setting-filled:before {
+ content: '\E30C';
+}
+.t-icon-file-setting:before {
+ content: '\E30D';
+}
+.t-icon-file-teams-filled:before {
+ content: '\E30E';
+}
+.t-icon-file-teams:before {
+ content: '\E30F';
+}
+.t-icon-file-transmit-double-filled:before {
+ content: '\E310';
+}
+.t-icon-file-transmit-double:before {
+ content: '\E311';
+}
+.t-icon-file-transmit-filled:before {
+ content: '\E312';
+}
+.t-icon-file-transmit:before {
+ content: '\E313';
+}
+.t-icon-file-unknown-filled:before {
+ content: '\E314';
+}
+.t-icon-file-unknown:before {
+ content: '\E315';
+}
+.t-icon-file-unlocked-filled:before {
+ content: '\E316';
+}
+.t-icon-file-unlocked:before {
+ content: '\E317';
+}
+.t-icon-file-word-filled:before {
+ content: '\E318';
+}
+.t-icon-file-word:before {
+ content: '\E319';
+}
+.t-icon-file-zip-filled:before {
+ content: '\E31A';
+}
+.t-icon-file-zip:before {
+ content: '\E31B';
+}
+.t-icon-file:before {
+ content: '\E31C';
+}
+.t-icon-fill-color-1-filled:before {
+ content: '\E31D';
+}
+.t-icon-fill-color-1:before {
+ content: '\E31E';
+}
+.t-icon-fill-color-filled:before {
+ content: '\E31F';
+}
+.t-icon-fill-color:before {
+ content: '\E320';
+}
+.t-icon-film-1-filled:before {
+ content: '\E321';
+}
+.t-icon-film-1:before {
+ content: '\E322';
+}
+.t-icon-film-filled:before {
+ content: '\E323';
+}
+.t-icon-film:before {
+ content: '\E324';
+}
+.t-icon-filter-1-filled:before {
+ content: '\E325';
+}
+.t-icon-filter-1:before {
+ content: '\E326';
+}
+.t-icon-filter-2-filled:before {
+ content: '\E327';
+}
+.t-icon-filter-2:before {
+ content: '\E328';
+}
+.t-icon-filter-3-filled:before {
+ content: '\E329';
+}
+.t-icon-filter-3:before {
+ content: '\E32A';
+}
+.t-icon-filter-clear-filled:before {
+ content: '\E32B';
+}
+.t-icon-filter-clear:before {
+ content: '\E32C';
+}
+.t-icon-filter-filled:before {
+ content: '\E32D';
+}
+.t-icon-filter-off-filled:before {
+ content: '\E32E';
+}
+.t-icon-filter-off:before {
+ content: '\E32F';
+}
+.t-icon-filter-sort-filled:before {
+ content: '\E330';
+}
+.t-icon-filter-sort:before {
+ content: '\E331';
+}
+.t-icon-filter:before {
+ content: '\E332';
+}
+.t-icon-fingerprint-1:before {
+ content: '\E333';
+}
+.t-icon-fingerprint-2:before {
+ content: '\E334';
+}
+.t-icon-fingerprint-3:before {
+ content: '\E335';
+}
+.t-icon-fingerprint:before {
+ content: '\E336';
+}
+.t-icon-fish-filled:before {
+ content: '\E337';
+}
+.t-icon-fish:before {
+ content: '\E338';
+}
+.t-icon-flag-1-filled:before {
+ content: '\E339';
+}
+.t-icon-flag-1:before {
+ content: '\E33A';
+}
+.t-icon-flag-2-filled:before {
+ content: '\E33B';
+}
+.t-icon-flag-2:before {
+ content: '\E33C';
+}
+.t-icon-flag-3-filled:before {
+ content: '\E33D';
+}
+.t-icon-flag-3:before {
+ content: '\E33E';
+}
+.t-icon-flag-4-filled:before {
+ content: '\E33F';
+}
+.t-icon-flag-4:before {
+ content: '\E340';
+}
+.t-icon-flag-filled:before {
+ content: '\E341';
+}
+.t-icon-flag:before {
+ content: '\E342';
+}
+.t-icon-flashlight-filled:before {
+ content: '\E343';
+}
+.t-icon-flashlight:before {
+ content: '\E344';
+}
+.t-icon-flight-landing-filled:before {
+ content: '\E345';
+}
+.t-icon-flight-landing:before {
+ content: '\E346';
+}
+.t-icon-flight-takeoff-filled:before {
+ content: '\E347';
+}
+.t-icon-flight-takeoff:before {
+ content: '\E348';
+}
+.t-icon-flip-smiling-face-filled:before {
+ content: '\E349';
+}
+.t-icon-flip-smiling-face:before {
+ content: '\E34A';
+}
+.t-icon-flip-to-back-filled:before {
+ content: '\E34B';
+}
+.t-icon-flip-to-back:before {
+ content: '\E34C';
+}
+.t-icon-flip-to-front-filled:before {
+ content: '\E34D';
+}
+.t-icon-flip-to-front:before {
+ content: '\E34E';
+}
+.t-icon-focus-filled:before {
+ content: '\E34F';
+}
+.t-icon-focus:before {
+ content: '\E350';
+}
+.t-icon-fog-filled:before {
+ content: '\E351';
+}
+.t-icon-fog-night-filled:before {
+ content: '\E352';
+}
+.t-icon-fog-night:before {
+ content: '\E353';
+}
+.t-icon-fog-sunny-filled:before {
+ content: '\E354';
+}
+.t-icon-fog-sunny:before {
+ content: '\E355';
+}
+.t-icon-fog:before {
+ content: '\E356';
+}
+.t-icon-folder-1-filled:before {
+ content: '\E357';
+}
+.t-icon-folder-1:before {
+ content: '\E358';
+}
+.t-icon-folder-add-1-filled:before {
+ content: '\E359';
+}
+.t-icon-folder-add-1:before {
+ content: '\E35A';
+}
+.t-icon-folder-add-filled:before {
+ content: '\E35B';
+}
+.t-icon-folder-add:before {
+ content: '\E35C';
+}
+.t-icon-folder-blocked-filled:before {
+ content: '\E35D';
+}
+.t-icon-folder-blocked:before {
+ content: '\E35E';
+}
+.t-icon-folder-details-filled:before {
+ content: '\E35F';
+}
+.t-icon-folder-details:before {
+ content: '\E360';
+}
+.t-icon-folder-export-filled:before {
+ content: '\E361';
+}
+.t-icon-folder-export:before {
+ content: '\E362';
+}
+.t-icon-folder-filled:before {
+ content: '\E363';
+}
+.t-icon-folder-import-filled:before {
+ content: '\E364';
+}
+.t-icon-folder-import:before {
+ content: '\E365';
+}
+.t-icon-folder-locked-filled:before {
+ content: '\E366';
+}
+.t-icon-folder-locked:before {
+ content: '\E367';
+}
+.t-icon-folder-minus-filled:before {
+ content: '\E368';
+}
+.t-icon-folder-minus:before {
+ content: '\E369';
+}
+.t-icon-folder-move-filled:before {
+ content: '\E36A';
+}
+.t-icon-folder-move:before {
+ content: '\E36B';
+}
+.t-icon-folder-off-filled:before {
+ content: '\E36C';
+}
+.t-icon-folder-off:before {
+ content: '\E36D';
+}
+.t-icon-folder-open-1-filled:before {
+ content: '\E36E';
+}
+.t-icon-folder-open-1:before {
+ content: '\E36F';
+}
+.t-icon-folder-open-filled:before {
+ content: '\E370';
+}
+.t-icon-folder-open:before {
+ content: '\E371';
+}
+.t-icon-folder-search-filled:before {
+ content: '\E372';
+}
+.t-icon-folder-search:before {
+ content: '\E373';
+}
+.t-icon-folder-setting-filled:before {
+ content: '\E374';
+}
+.t-icon-folder-setting:before {
+ content: '\E375';
+}
+.t-icon-folder-shared-filled:before {
+ content: '\E376';
+}
+.t-icon-folder-shared:before {
+ content: '\E377';
+}
+.t-icon-folder-unlocked-filled:before {
+ content: '\E378';
+}
+.t-icon-folder-unlocked:before {
+ content: '\E379';
+}
+.t-icon-folder-zip-filled:before {
+ content: '\E37A';
+}
+.t-icon-folder-zip:before {
+ content: '\E37B';
+}
+.t-icon-folder:before {
+ content: '\E37C';
+}
+.t-icon-forest-filled:before {
+ content: '\E37D';
+}
+.t-icon-forest:before {
+ content: '\E37E';
+}
+.t-icon-fork-filled:before {
+ content: '\E37F';
+}
+.t-icon-fork:before {
+ content: '\E380';
+}
+.t-icon-form-filled:before {
+ content: '\E381';
+}
+.t-icon-form:before {
+ content: '\E382';
+}
+.t-icon-format-horizontal-align-bottom:before {
+ content: '\E383';
+}
+.t-icon-format-horizontal-align-center:before {
+ content: '\E384';
+}
+.t-icon-format-horizontal-align-top:before {
+ content: '\E385';
+}
+.t-icon-format-vertical-align-center:before {
+ content: '\E386';
+}
+.t-icon-format-vertical-align-left:before {
+ content: '\E387';
+}
+.t-icon-format-vertical-align-right:before {
+ content: '\E388';
+}
+.t-icon-forward-filled:before {
+ content: '\E389';
+}
+.t-icon-forward:before {
+ content: '\E38A';
+}
+.t-icon-frame-1-filled:before {
+ content: '\E38B';
+}
+.t-icon-frame-1:before {
+ content: '\E38C';
+}
+.t-icon-frame-filled:before {
+ content: '\E38D';
+}
+.t-icon-frame:before {
+ content: '\E38E';
+}
+.t-icon-fries-filled:before {
+ content: '\E38F';
+}
+.t-icon-fries:before {
+ content: '\E390';
+}
+.t-icon-fullscreen-1:before {
+ content: '\E391';
+}
+.t-icon-fullscreen-2:before {
+ content: '\E392';
+}
+.t-icon-fullscreen-exit-1:before {
+ content: '\E393';
+}
+.t-icon-fullscreen-exit:before {
+ content: '\E394';
+}
+.t-icon-fullscreen:before {
+ content: '\E395';
+}
+.t-icon-function-curve:before {
+ content: '\E396';
+}
+.t-icon-functions-1:before {
+ content: '\E397';
+}
+.t-icon-functions:before {
+ content: '\E398';
+}
+.t-icon-gamepad-1-filled:before {
+ content: '\E399';
+}
+.t-icon-gamepad-1:before {
+ content: '\E39A';
+}
+.t-icon-gamepad-filled:before {
+ content: '\E39B';
+}
+.t-icon-gamepad:before {
+ content: '\E39C';
+}
+.t-icon-gamma:before {
+ content: '\E39D';
+}
+.t-icon-garlic-filled:before {
+ content: '\E39E';
+}
+.t-icon-garlic:before {
+ content: '\E39F';
+}
+.t-icon-gender-female:before {
+ content: '\E3A0';
+}
+.t-icon-gender-male:before {
+ content: '\E3A1';
+}
+.t-icon-gesture-applause-filled:before {
+ content: '\E3A2';
+}
+.t-icon-gesture-applause:before {
+ content: '\E3A3';
+}
+.t-icon-gesture-click-filled:before {
+ content: '\E3A4';
+}
+.t-icon-gesture-click:before {
+ content: '\E3A5';
+}
+.t-icon-gesture-down-filled:before {
+ content: '\E3A6';
+}
+.t-icon-gesture-down:before {
+ content: '\E3A7';
+}
+.t-icon-gesture-expansion-filled:before {
+ content: '\E3A8';
+}
+.t-icon-gesture-expansion:before {
+ content: '\E3A9';
+}
+.t-icon-gesture-left-filled:before {
+ content: '\E3AA';
+}
+.t-icon-gesture-left-slip-filled:before {
+ content: '\E3AB';
+}
+.t-icon-gesture-left-slip:before {
+ content: '\E3AC';
+}
+.t-icon-gesture-left:before {
+ content: '\E3AD';
+}
+.t-icon-gesture-open-filled:before {
+ content: '\E3AE';
+}
+.t-icon-gesture-open:before {
+ content: '\E3AF';
+}
+.t-icon-gesture-pray-filled:before {
+ content: '\E3B0';
+}
+.t-icon-gesture-pray:before {
+ content: '\E3B1';
+}
+.t-icon-gesture-press-filled:before {
+ content: '\E3B2';
+}
+.t-icon-gesture-press:before {
+ content: '\E3B3';
+}
+.t-icon-gesture-ranslation-filled:before {
+ content: '\E3B4';
+}
+.t-icon-gesture-ranslation:before {
+ content: '\E3B5';
+}
+.t-icon-gesture-right-filled:before {
+ content: '\E3B6';
+}
+.t-icon-gesture-right-slip-filled:before {
+ content: '\E3B7';
+}
+.t-icon-gesture-right-slip:before {
+ content: '\E3B8';
+}
+.t-icon-gesture-right:before {
+ content: '\E3B9';
+}
+.t-icon-gesture-slide-left-and-right-filled:before {
+ content: '\E3BA';
+}
+.t-icon-gesture-slide-left-and-right:before {
+ content: '\E3BB';
+}
+.t-icon-gesture-slide-up-filled:before {
+ content: '\E3BC';
+}
+.t-icon-gesture-slide-up:before {
+ content: '\E3BD';
+}
+.t-icon-gesture-typing-filled:before {
+ content: '\E3BE';
+}
+.t-icon-gesture-typing:before {
+ content: '\E3BF';
+}
+.t-icon-gesture-up-and-down-filled:before {
+ content: '\E3C0';
+}
+.t-icon-gesture-up-and-down:before {
+ content: '\E3C1';
+}
+.t-icon-gesture-up-filled:before {
+ content: '\E3C2';
+}
+.t-icon-gesture-up:before {
+ content: '\E3C3';
+}
+.t-icon-gesture-wipe-down-filled:before {
+ content: '\E3C4';
+}
+.t-icon-gesture-wipe-down:before {
+ content: '\E3C5';
+}
+.t-icon-gift-filled:before {
+ content: '\E3C6';
+}
+.t-icon-gift:before {
+ content: '\E3C7';
+}
+.t-icon-giggle-filled:before {
+ content: '\E3C8';
+}
+.t-icon-giggle:before {
+ content: '\E3C9';
+}
+.t-icon-git-branch-filled:before {
+ content: '\E3CA';
+}
+.t-icon-git-branch:before {
+ content: '\E3CB';
+}
+.t-icon-git-commit-filled:before {
+ content: '\E3CC';
+}
+.t-icon-git-commit:before {
+ content: '\E3CD';
+}
+.t-icon-git-merge-filled:before {
+ content: '\E3CE';
+}
+.t-icon-git-merge:before {
+ content: '\E3CF';
+}
+.t-icon-git-pull-request-filled:before {
+ content: '\E3D0';
+}
+.t-icon-git-pull-request:before {
+ content: '\E3D1';
+}
+.t-icon-git-repository-commits-filled:before {
+ content: '\E3D2';
+}
+.t-icon-git-repository-commits:before {
+ content: '\E3D3';
+}
+.t-icon-git-repository-filled:before {
+ content: '\E3D4';
+}
+.t-icon-git-repository-private-filled:before {
+ content: '\E3D5';
+}
+.t-icon-git-repository-private:before {
+ content: '\E3D6';
+}
+.t-icon-git-repository:before {
+ content: '\E3D7';
+}
+.t-icon-gps-filled:before {
+ content: '\E3D8';
+}
+.t-icon-gps:before {
+ content: '\E3D9';
+}
+.t-icon-grape-filled:before {
+ content: '\E3DA';
+}
+.t-icon-grape:before {
+ content: '\E3DB';
+}
+.t-icon-greater-than-or-equal:before {
+ content: '\E3DC';
+}
+.t-icon-greater-than:before {
+ content: '\E3DD';
+}
+.t-icon-green-onion:before {
+ content: '\E3DE';
+}
+.t-icon-grid-add-filled:before {
+ content: '\E3DF';
+}
+.t-icon-grid-add:before {
+ content: '\E3E0';
+}
+.t-icon-grid-view-filled:before {
+ content: '\E3E1';
+}
+.t-icon-grid-view:before {
+ content: '\E3E2';
+}
+.t-icon-guitar-filled:before {
+ content: '\E3E3';
+}
+.t-icon-guitar:before {
+ content: '\E3E4';
+}
+.t-icon-hamburger-filled:before {
+ content: '\E3E5';
+}
+.t-icon-hamburger:before {
+ content: '\E3E6';
+}
+.t-icon-happy-filled:before {
+ content: '\E3E7';
+}
+.t-icon-happy:before {
+ content: '\E3E8';
+}
+.t-icon-hard-disk-storage-filled:before {
+ content: '\E3E9';
+}
+.t-icon-hard-disk-storage:before {
+ content: '\E3EA';
+}
+.t-icon-hard-drive-filled:before {
+ content: '\E3EB';
+}
+.t-icon-hard-drive:before {
+ content: '\E3EC';
+}
+.t-icon-hashtag:before {
+ content: '\E3ED';
+}
+.t-icon-hd-filled:before {
+ content: '\E3EE';
+}
+.t-icon-hd:before {
+ content: '\E3EF';
+}
+.t-icon-heart-filled:before {
+ content: '\E3F0';
+}
+.t-icon-heart:before {
+ content: '\E3F1';
+}
+.t-icon-help-circle-filled:before {
+ content: '\E3F2';
+}
+.t-icon-help-circle:before {
+ content: '\E3F3';
+}
+.t-icon-help-rectangle-filled:before {
+ content: '\E3F4';
+}
+.t-icon-help-rectangle:before {
+ content: '\E3F5';
+}
+.t-icon-help:before {
+ content: '\E3F6';
+}
+.t-icon-highlight-1-filled:before {
+ content: '\E3F7';
+}
+.t-icon-highlight-1:before {
+ content: '\E3F8';
+}
+.t-icon-highlight:before {
+ content: '\E3F9';
+}
+.t-icon-history-setting:before {
+ content: '\E3FA';
+}
+.t-icon-history:before {
+ content: '\E3FB';
+}
+.t-icon-home-filled:before {
+ content: '\E3FC';
+}
+.t-icon-home:before {
+ content: '\E3FD';
+}
+.t-icon-horizontal-filled:before {
+ content: '\E3FE';
+}
+.t-icon-horizontal:before {
+ content: '\E3FF';
+}
+.t-icon-hospital-1-filled:before {
+ content: '\E400';
+}
+.t-icon-hospital-1:before {
+ content: '\E401';
+}
+.t-icon-hospital-filled:before {
+ content: '\E402';
+}
+.t-icon-hospital:before {
+ content: '\E403';
+}
+.t-icon-hotspot-wave-filled:before {
+ content: '\E404';
+}
+.t-icon-hotspot-wave:before {
+ content: '\E405';
+}
+.t-icon-hourglass-filled:before {
+ content: '\E406';
+}
+.t-icon-hourglass:before {
+ content: '\E407';
+}
+.t-icon-houses-1-filled:before {
+ content: '\E408';
+}
+.t-icon-houses-1:before {
+ content: '\E409';
+}
+.t-icon-houses-2-filled:before {
+ content: '\E40A';
+}
+.t-icon-houses-2:before {
+ content: '\E40B';
+}
+.t-icon-houses-filled:before {
+ content: '\E40C';
+}
+.t-icon-houses:before {
+ content: '\E40D';
+}
+.t-icon-html5-filled:before {
+ content: '\E40E';
+}
+.t-icon-html5:before {
+ content: '\E40F';
+}
+.t-icon-https-filled:before {
+ content: '\E410';
+}
+.t-icon-https:before {
+ content: '\E411';
+}
+.t-icon-ice-cream-filled:before {
+ content: '\E412';
+}
+.t-icon-ice-cream:before {
+ content: '\E413';
+}
+.t-icon-icon-filled:before {
+ content: '\E414';
+}
+.t-icon-icon:before {
+ content: '\E415';
+}
+.t-icon-image-1-filled:before {
+ content: '\E416';
+}
+.t-icon-image-1:before {
+ content: '\E417';
+}
+.t-icon-image-add-filled:before {
+ content: '\E418';
+}
+.t-icon-image-add:before {
+ content: '\E419';
+}
+.t-icon-image-edit-filled:before {
+ content: '\E41A';
+}
+.t-icon-image-edit:before {
+ content: '\E41B';
+}
+.t-icon-image-error-filled:before {
+ content: '\E41C';
+}
+.t-icon-image-error:before {
+ content: '\E41D';
+}
+.t-icon-image-filled:before {
+ content: '\E41E';
+}
+.t-icon-image-off-filled:before {
+ content: '\E41F';
+}
+.t-icon-image-off:before {
+ content: '\E420';
+}
+.t-icon-image-search-filled:before {
+ content: '\E421';
+}
+.t-icon-image-search:before {
+ content: '\E422';
+}
+.t-icon-image:before {
+ content: '\E423';
+}
+.t-icon-indent-left:before {
+ content: '\E424';
+}
+.t-icon-indent-right:before {
+ content: '\E425';
+}
+.t-icon-indicator-filled:before {
+ content: '\E426';
+}
+.t-icon-indicator:before {
+ content: '\E427';
+}
+.t-icon-info-circle-filled:before {
+ content: '\E428';
+}
+.t-icon-info-circle:before {
+ content: '\E429';
+}
+.t-icon-ink-filled:before {
+ content: '\E42A';
+}
+.t-icon-ink:before {
+ content: '\E42B';
+}
+.t-icon-install-desktop-filled:before {
+ content: '\E42C';
+}
+.t-icon-install-desktop:before {
+ content: '\E42D';
+}
+.t-icon-install-filled:before {
+ content: '\E42E';
+}
+.t-icon-install-mobile-filled:before {
+ content: '\E42F';
+}
+.t-icon-install-mobile:before {
+ content: '\E430';
+}
+.t-icon-install:before {
+ content: '\E431';
+}
+.t-icon-institution-checked-filled:before {
+ content: '\E432';
+}
+.t-icon-institution-checked:before {
+ content: '\E433';
+}
+.t-icon-institution-filled:before {
+ content: '\E434';
+}
+.t-icon-institution:before {
+ content: '\E435';
+}
+.t-icon-internet-filled:before {
+ content: '\E436';
+}
+.t-icon-internet:before {
+ content: '\E437';
+}
+.t-icon-ipod-filled:before {
+ content: '\E438';
+}
+.t-icon-ipod:before {
+ content: '\E439';
+}
+.t-icon-joyful-filled:before {
+ content: '\E43A';
+}
+.t-icon-joyful:before {
+ content: '\E43B';
+}
+.t-icon-jump-double:before {
+ content: '\E43C';
+}
+.t-icon-jump-off:before {
+ content: '\E43D';
+}
+.t-icon-jump:before {
+ content: '\E43E';
+}
+.t-icon-key-filled:before {
+ content: '\E43F';
+}
+.t-icon-key:before {
+ content: '\E440';
+}
+.t-icon-keyboard-filled:before {
+ content: '\E441';
+}
+.t-icon-keyboard:before {
+ content: '\E442';
+}
+.t-icon-laptop-filled:before {
+ content: '\E443';
+}
+.t-icon-laptop:before {
+ content: '\E444';
+}
+.t-icon-layers-filled:before {
+ content: '\E445';
+}
+.t-icon-layers:before {
+ content: '\E446';
+}
+.t-icon-layout-filled:before {
+ content: '\E447';
+}
+.t-icon-layout:before {
+ content: '\E448';
+}
+.t-icon-leaderboard-filled:before {
+ content: '\E449';
+}
+.t-icon-leaderboard:before {
+ content: '\E44A';
+}
+.t-icon-lemon-filled:before {
+ content: '\E44B';
+}
+.t-icon-lemon-slice-filled:before {
+ content: '\E44C';
+}
+.t-icon-lemon-slice:before {
+ content: '\E44D';
+}
+.t-icon-lemon:before {
+ content: '\E44E';
+}
+.t-icon-less-than-or-equal:before {
+ content: '\E44F';
+}
+.t-icon-less-than:before {
+ content: '\E450';
+}
+.t-icon-letters-a:before {
+ content: '\E451';
+}
+.t-icon-letters-b:before {
+ content: '\E452';
+}
+.t-icon-letters-c:before {
+ content: '\E453';
+}
+.t-icon-letters-d:before {
+ content: '\E454';
+}
+.t-icon-letters-e:before {
+ content: '\E455';
+}
+.t-icon-letters-f:before {
+ content: '\E456';
+}
+.t-icon-letters-g:before {
+ content: '\E457';
+}
+.t-icon-letters-h:before {
+ content: '\E458';
+}
+.t-icon-letters-i:before {
+ content: '\E459';
+}
+.t-icon-letters-j:before {
+ content: '\E45A';
+}
+.t-icon-letters-k:before {
+ content: '\E45B';
+}
+.t-icon-letters-l:before {
+ content: '\E45C';
+}
+.t-icon-letters-m:before {
+ content: '\E45D';
+}
+.t-icon-letters-n:before {
+ content: '\E45E';
+}
+.t-icon-letters-o:before {
+ content: '\E45F';
+}
+.t-icon-letters-p:before {
+ content: '\E460';
+}
+.t-icon-letters-q:before {
+ content: '\E461';
+}
+.t-icon-letters-r:before {
+ content: '\E462';
+}
+.t-icon-letters-s:before {
+ content: '\E463';
+}
+.t-icon-letters-t:before {
+ content: '\E464';
+}
+.t-icon-letters-u:before {
+ content: '\E465';
+}
+.t-icon-letters-v:before {
+ content: '\E466';
+}
+.t-icon-letters-w:before {
+ content: '\E467';
+}
+.t-icon-letters-x:before {
+ content: '\E468';
+}
+.t-icon-letters-y:before {
+ content: '\E469';
+}
+.t-icon-letters-z:before {
+ content: '\E46A';
+}
+.t-icon-lightbulb-circle-filled:before {
+ content: '\E46B';
+}
+.t-icon-lightbulb-circle:before {
+ content: '\E46C';
+}
+.t-icon-lightbulb-filled:before {
+ content: '\E46D';
+}
+.t-icon-lightbulb:before {
+ content: '\E46E';
+}
+.t-icon-lighthouse-1-filled:before {
+ content: '\E46F';
+}
+.t-icon-lighthouse-1:before {
+ content: '\E470';
+}
+.t-icon-lighthouse-2-filled:before {
+ content: '\E471';
+}
+.t-icon-lighthouse-2:before {
+ content: '\E472';
+}
+.t-icon-lighthouse-filled:before {
+ content: '\E473';
+}
+.t-icon-lighthouse:before {
+ content: '\E474';
+}
+.t-icon-lighting-circle-filled:before {
+ content: '\E475';
+}
+.t-icon-lighting-circle:before {
+ content: '\E476';
+}
+.t-icon-line-height:before {
+ content: '\E477';
+}
+.t-icon-link-1:before {
+ content: '\E478';
+}
+.t-icon-link-unlink:before {
+ content: '\E479';
+}
+.t-icon-link:before {
+ content: '\E47A';
+}
+.t-icon-liquor-filled:before {
+ content: '\E47B';
+}
+.t-icon-liquor:before {
+ content: '\E47C';
+}
+.t-icon-list-numbered:before {
+ content: '\E47D';
+}
+.t-icon-list:before {
+ content: '\E47E';
+}
+.t-icon-load:before {
+ content: '\E47F';
+}
+.t-icon-loading:before {
+ content: '\E480';
+}
+.t-icon-location-1-filled:before {
+ content: '\E481';
+}
+.t-icon-location-1:before {
+ content: '\E482';
+}
+.t-icon-location-enlargement-filled:before {
+ content: '\E483';
+}
+.t-icon-location-enlargement:before {
+ content: '\E484';
+}
+.t-icon-location-error-filled:before {
+ content: '\E485';
+}
+.t-icon-location-error:before {
+ content: '\E486';
+}
+.t-icon-location-filled:before {
+ content: '\E487';
+}
+.t-icon-location-parking-place-filled:before {
+ content: '\E488';
+}
+.t-icon-location-parking-place:before {
+ content: '\E489';
+}
+.t-icon-location-reduction-filled:before {
+ content: '\E48A';
+}
+.t-icon-location-reduction:before {
+ content: '\E48B';
+}
+.t-icon-location-setting-filled:before {
+ content: '\E48C';
+}
+.t-icon-location-setting:before {
+ content: '\E48D';
+}
+.t-icon-location:before {
+ content: '\E48E';
+}
+.t-icon-lock-off-filled:before {
+ content: '\E48F';
+}
+.t-icon-lock-off:before {
+ content: '\E490';
+}
+.t-icon-lock-on-filled:before {
+ content: '\E491';
+}
+.t-icon-lock-on:before {
+ content: '\E492';
+}
+.t-icon-lock-time-filled:before {
+ content: '\E493';
+}
+.t-icon-lock-time:before {
+ content: '\E494';
+}
+.t-icon-login:before {
+ content: '\E495';
+}
+.t-icon-logo-adobe-illustrate-filled:before {
+ content: '\E496';
+}
+.t-icon-logo-adobe-illustrate:before {
+ content: '\E497';
+}
+.t-icon-logo-adobe-lightroom-filled:before {
+ content: '\E498';
+}
+.t-icon-logo-adobe-lightroom:before {
+ content: '\E499';
+}
+.t-icon-logo-adobe-photoshop-filled:before {
+ content: '\E49A';
+}
+.t-icon-logo-adobe-photoshop:before {
+ content: '\E49B';
+}
+.t-icon-logo-alipay-filled:before {
+ content: '\E49C';
+}
+.t-icon-logo-alipay:before {
+ content: '\E49D';
+}
+.t-icon-logo-android-filled:before {
+ content: '\E49E';
+}
+.t-icon-logo-android:before {
+ content: '\E49F';
+}
+.t-icon-logo-apple-filled:before {
+ content: '\E4A0';
+}
+.t-icon-logo-apple:before {
+ content: '\E4A1';
+}
+.t-icon-logo-behance-filled:before {
+ content: '\E4A2';
+}
+.t-icon-logo-behance:before {
+ content: '\E4A3';
+}
+.t-icon-logo-chrome-filled:before {
+ content: '\E4A4';
+}
+.t-icon-logo-chrome:before {
+ content: '\E4A5';
+}
+.t-icon-logo-cinema4d-filled:before {
+ content: '\E4A6';
+}
+.t-icon-logo-cinema4d:before {
+ content: '\E4A7';
+}
+.t-icon-logo-codepen:before {
+ content: '\E4A8';
+}
+.t-icon-logo-codesandbox:before {
+ content: '\E4A9';
+}
+.t-icon-logo-dribbble-filled:before {
+ content: '\E4AA';
+}
+.t-icon-logo-dribbble:before {
+ content: '\E4AB';
+}
+.t-icon-logo-facebook-filled:before {
+ content: '\E4AC';
+}
+.t-icon-logo-facebook:before {
+ content: '\E4AD';
+}
+.t-icon-logo-figma-filled:before {
+ content: '\E4AE';
+}
+.t-icon-logo-figma:before {
+ content: '\E4AF';
+}
+.t-icon-logo-framer-filled:before {
+ content: '\E4B0';
+}
+.t-icon-logo-framer:before {
+ content: '\E4B1';
+}
+.t-icon-logo-github-filled:before {
+ content: '\E4B2';
+}
+.t-icon-logo-github:before {
+ content: '\E4B3';
+}
+.t-icon-logo-gitlab-filled:before {
+ content: '\E4B4';
+}
+.t-icon-logo-gitlab:before {
+ content: '\E4B5';
+}
+.t-icon-logo-ie-filled:before {
+ content: '\E4B6';
+}
+.t-icon-logo-ie:before {
+ content: '\E4B7';
+}
+.t-icon-logo-instagram-filled:before {
+ content: '\E4B8';
+}
+.t-icon-logo-instagram:before {
+ content: '\E4B9';
+}
+.t-icon-logo-qq-filled:before {
+ content: '\E4BA';
+}
+.t-icon-logo-qq:before {
+ content: '\E4BB';
+}
+.t-icon-logo-twitter-filled:before {
+ content: '\E4BC';
+}
+.t-icon-logo-twitter:before {
+ content: '\E4BD';
+}
+.t-icon-logo-wechat-stroke-filled:before {
+ content: '\E4BE';
+}
+.t-icon-logo-wechat-stroke:before {
+ content: '\E4BF';
+}
+.t-icon-logo-wechatpay-filled:before {
+ content: '\E4C0';
+}
+.t-icon-logo-wechatpay:before {
+ content: '\E4C1';
+}
+.t-icon-logo-wecom:before {
+ content: '\E4C2';
+}
+.t-icon-logo-windows-filled:before {
+ content: '\E4C3';
+}
+.t-icon-logo-windows:before {
+ content: '\E4C4';
+}
+.t-icon-logo-youtube-filled:before {
+ content: '\E4C5';
+}
+.t-icon-logo-youtube:before {
+ content: '\E4C6';
+}
+.t-icon-logout:before {
+ content: '\E4C7';
+}
+.t-icon-look-around-filled:before {
+ content: '\E4C8';
+}
+.t-icon-look-around:before {
+ content: '\E4C9';
+}
+.t-icon-loudspeaker-filled:before {
+ content: '\E4CA';
+}
+.t-icon-loudspeaker:before {
+ content: '\E4CB';
+}
+.t-icon-mail-filled:before {
+ content: '\E4CC';
+}
+.t-icon-mail:before {
+ content: '\E4CD';
+}
+.t-icon-map-3d-filled:before {
+ content: '\E4CE';
+}
+.t-icon-map-3d:before {
+ content: '\E4CF';
+}
+.t-icon-map-add-filled:before {
+ content: '\E4D0';
+}
+.t-icon-map-add:before {
+ content: '\E4D1';
+}
+.t-icon-map-aiming-filled:before {
+ content: '\E4D2';
+}
+.t-icon-map-aiming:before {
+ content: '\E4D3';
+}
+.t-icon-map-blocked-filled:before {
+ content: '\E4D4';
+}
+.t-icon-map-blocked:before {
+ content: '\E4D5';
+}
+.t-icon-map-bubble-filled:before {
+ content: '\E4D6';
+}
+.t-icon-map-bubble:before {
+ content: '\E4D7';
+}
+.t-icon-map-cancel-filled:before {
+ content: '\E4D8';
+}
+.t-icon-map-cancel:before {
+ content: '\E4D9';
+}
+.t-icon-map-chat-filled:before {
+ content: '\E4DA';
+}
+.t-icon-map-chat:before {
+ content: '\E4DB';
+}
+.t-icon-map-checked-filled:before {
+ content: '\E4DC';
+}
+.t-icon-map-checked:before {
+ content: '\E4DD';
+}
+.t-icon-map-collection-filled:before {
+ content: '\E4DE';
+}
+.t-icon-map-collection:before {
+ content: '\E4DF';
+}
+.t-icon-map-connection-filled:before {
+ content: '\E4E0';
+}
+.t-icon-map-connection:before {
+ content: '\E4E1';
+}
+.t-icon-map-distance-filled:before {
+ content: '\E4E2';
+}
+.t-icon-map-distance:before {
+ content: '\E4E3';
+}
+.t-icon-map-double-filled:before {
+ content: '\E4E4';
+}
+.t-icon-map-double:before {
+ content: '\E4E5';
+}
+.t-icon-map-edit-filled:before {
+ content: '\E4E6';
+}
+.t-icon-map-edit:before {
+ content: '\E4E7';
+}
+.t-icon-map-filled:before {
+ content: '\E4E8';
+}
+.t-icon-map-grid-filled:before {
+ content: '\E4E9';
+}
+.t-icon-map-grid:before {
+ content: '\E4EA';
+}
+.t-icon-map-information-1-filled:before {
+ content: '\E4EB';
+}
+.t-icon-map-information-1:before {
+ content: '\E4EC';
+}
+.t-icon-map-information-2-filled:before {
+ content: '\E4ED';
+}
+.t-icon-map-information-2:before {
+ content: '\E4EE';
+}
+.t-icon-map-information-filled:before {
+ content: '\E4EF';
+}
+.t-icon-map-information:before {
+ content: '\E4F0';
+}
+.t-icon-map-location-filled:before {
+ content: '\E4F1';
+}
+.t-icon-map-location:before {
+ content: '\E4F2';
+}
+.t-icon-map-locked-filled:before {
+ content: '\E4F3';
+}
+.t-icon-map-locked:before {
+ content: '\E4F4';
+}
+.t-icon-map-marked-filled:before {
+ content: '\E4F5';
+}
+.t-icon-map-marked:before {
+ content: '\E4F6';
+}
+.t-icon-map-navigation-filled:before {
+ content: '\E4F7';
+}
+.t-icon-map-navigation:before {
+ content: '\E4F8';
+}
+.t-icon-map-outline-filled:before {
+ content: '\E4F9';
+}
+.t-icon-map-outline:before {
+ content: '\E4FA';
+}
+.t-icon-map-route-planning-filled:before {
+ content: '\E4FB';
+}
+.t-icon-map-route-planning:before {
+ content: '\E4FC';
+}
+.t-icon-map-ruler-filled:before {
+ content: '\E4FD';
+}
+.t-icon-map-ruler:before {
+ content: '\E4FE';
+}
+.t-icon-map-safety-filled:before {
+ content: '\E4FF';
+}
+.t-icon-map-safety:before {
+ content: '\E500';
+}
+.t-icon-map-search-1-filled:before {
+ content: '\E501';
+}
+.t-icon-map-search-1:before {
+ content: '\E502';
+}
+.t-icon-map-search-filled:before {
+ content: '\E503';
+}
+.t-icon-map-search:before {
+ content: '\E504';
+}
+.t-icon-map-setting-filled:before {
+ content: '\E505';
+}
+.t-icon-map-setting:before {
+ content: '\E506';
+}
+.t-icon-map-unlocked-filled:before {
+ content: '\E507';
+}
+.t-icon-map-unlocked:before {
+ content: '\E508';
+}
+.t-icon-map:before {
+ content: '\E509';
+}
+.t-icon-mark-as-unread-filled:before {
+ content: '\E50A';
+}
+.t-icon-mark-as-unread:before {
+ content: '\E50B';
+}
+.t-icon-markup-filled:before {
+ content: '\E50C';
+}
+.t-icon-markup:before {
+ content: '\E50D';
+}
+.t-icon-mathematics-filled:before {
+ content: '\E50E';
+}
+.t-icon-mathematics:before {
+ content: '\E50F';
+}
+.t-icon-measurement-1-filled:before {
+ content: '\E510';
+}
+.t-icon-measurement-1:before {
+ content: '\E511';
+}
+.t-icon-measurement-2-filled:before {
+ content: '\E512';
+}
+.t-icon-measurement-2:before {
+ content: '\E513';
+}
+.t-icon-measurement-filled:before {
+ content: '\E514';
+}
+.t-icon-measurement:before {
+ content: '\E515';
+}
+.t-icon-meat-pepper-filled:before {
+ content: '\E516';
+}
+.t-icon-meat-pepper:before {
+ content: '\E517';
+}
+.t-icon-media-library-filled:before {
+ content: '\E518';
+}
+.t-icon-media-library:before {
+ content: '\E519';
+}
+.t-icon-member-filled:before {
+ content: '\E51A';
+}
+.t-icon-member:before {
+ content: '\E51B';
+}
+.t-icon-menu-application:before {
+ content: '\E51C';
+}
+.t-icon-menu-filled:before {
+ content: '\E51D';
+}
+.t-icon-menu-fold:before {
+ content: '\E51E';
+}
+.t-icon-menu-unfold:before {
+ content: '\E51F';
+}
+.t-icon-menu:before {
+ content: '\E520';
+}
+.t-icon-merge-cells-filled:before {
+ content: '\E521';
+}
+.t-icon-merge-cells:before {
+ content: '\E522';
+}
+.t-icon-microphone-1-filled:before {
+ content: '\E523';
+}
+.t-icon-microphone-1:before {
+ content: '\E524';
+}
+.t-icon-microphone-2-filled:before {
+ content: '\E525';
+}
+.t-icon-microphone-2:before {
+ content: '\E526';
+}
+.t-icon-microphone-filled:before {
+ content: '\E527';
+}
+.t-icon-microphone:before {
+ content: '\E528';
+}
+.t-icon-milk-filled:before {
+ content: '\E529';
+}
+.t-icon-milk:before {
+ content: '\E52A';
+}
+.t-icon-minus-circle-filled:before {
+ content: '\E52B';
+}
+.t-icon-minus-circle:before {
+ content: '\E52C';
+}
+.t-icon-minus-rectangle-filled:before {
+ content: '\E52D';
+}
+.t-icon-minus-rectangle:before {
+ content: '\E52E';
+}
+.t-icon-minus:before {
+ content: '\E52F';
+}
+.t-icon-mirror-filled:before {
+ content: '\E530';
+}
+.t-icon-mirror:before {
+ content: '\E531';
+}
+.t-icon-mobile-blocked-filled:before {
+ content: '\E532';
+}
+.t-icon-mobile-blocked:before {
+ content: '\E533';
+}
+.t-icon-mobile-filled:before {
+ content: '\E534';
+}
+.t-icon-mobile-list-filled:before {
+ content: '\E535';
+}
+.t-icon-mobile-list:before {
+ content: '\E536';
+}
+.t-icon-mobile-navigation-filled:before {
+ content: '\E537';
+}
+.t-icon-mobile-navigation:before {
+ content: '\E538';
+}
+.t-icon-mobile-shortcut-filled:before {
+ content: '\E539';
+}
+.t-icon-mobile-shortcut:before {
+ content: '\E53A';
+}
+.t-icon-mobile-vibrate-filled:before {
+ content: '\E53B';
+}
+.t-icon-mobile-vibrate:before {
+ content: '\E53C';
+}
+.t-icon-mobile:before {
+ content: '\E53D';
+}
+.t-icon-mode-dark-filled:before {
+ content: '\E53E';
+}
+.t-icon-mode-dark:before {
+ content: '\E53F';
+}
+.t-icon-mode-light-filled:before {
+ content: '\E540';
+}
+.t-icon-mode-light:before {
+ content: '\E541';
+}
+.t-icon-module-filled:before {
+ content: '\E542';
+}
+.t-icon-module:before {
+ content: '\E543';
+}
+.t-icon-money-filled:before {
+ content: '\E544';
+}
+.t-icon-money:before {
+ content: '\E545';
+}
+.t-icon-monument-filled:before {
+ content: '\E546';
+}
+.t-icon-monument:before {
+ content: '\E547';
+}
+.t-icon-moon-fall-filled:before {
+ content: '\E548';
+}
+.t-icon-moon-fall:before {
+ content: '\E549';
+}
+.t-icon-moon-filled:before {
+ content: '\E54A';
+}
+.t-icon-moon-rising-filled:before {
+ content: '\E54B';
+}
+.t-icon-moon-rising:before {
+ content: '\E54C';
+}
+.t-icon-moon:before {
+ content: '\E54D';
+}
+.t-icon-more:before {
+ content: '\E54E';
+}
+.t-icon-mosque-1-filled:before {
+ content: '\E54F';
+}
+.t-icon-mosque-1:before {
+ content: '\E550';
+}
+.t-icon-mosque-filled:before {
+ content: '\E551';
+}
+.t-icon-mosque:before {
+ content: '\E552';
+}
+.t-icon-mouse-filled:before {
+ content: '\E553';
+}
+.t-icon-mouse:before {
+ content: '\E554';
+}
+.t-icon-move-1:before {
+ content: '\E555';
+}
+.t-icon-move:before {
+ content: '\E556';
+}
+.t-icon-movie-clapper-filled:before {
+ content: '\E557';
+}
+.t-icon-movie-clapper:before {
+ content: '\E558';
+}
+.t-icon-multiply:before {
+ content: '\E559';
+}
+.t-icon-museum-1-filled:before {
+ content: '\E55A';
+}
+.t-icon-museum-1:before {
+ content: '\E55B';
+}
+.t-icon-museum-2-filled:before {
+ content: '\E55C';
+}
+.t-icon-museum-2:before {
+ content: '\E55D';
+}
+.t-icon-museum-filled:before {
+ content: '\E55E';
+}
+.t-icon-museum:before {
+ content: '\E55F';
+}
+.t-icon-mushroom-1-filled:before {
+ content: '\E560';
+}
+.t-icon-mushroom-1:before {
+ content: '\E561';
+}
+.t-icon-mushroom-filled:before {
+ content: '\E562';
+}
+.t-icon-mushroom:before {
+ content: '\E563';
+}
+.t-icon-music-1-filled:before {
+ content: '\E564';
+}
+.t-icon-music-1:before {
+ content: '\E565';
+}
+.t-icon-music-2-filled:before {
+ content: '\E566';
+}
+.t-icon-music-2:before {
+ content: '\E567';
+}
+.t-icon-music-filled:before {
+ content: '\E568';
+}
+.t-icon-music-rectangle-add-filled:before {
+ content: '\E569';
+}
+.t-icon-music-rectangle-add:before {
+ content: '\E56A';
+}
+.t-icon-music:before {
+ content: '\E56B';
+}
+.t-icon-navigation-arrow-filled:before {
+ content: '\E56C';
+}
+.t-icon-navigation-arrow:before {
+ content: '\E56D';
+}
+.t-icon-next-filled:before {
+ content: '\E56E';
+}
+.t-icon-next:before {
+ content: '\E56F';
+}
+.t-icon-no-expression-filled:before {
+ content: '\E570';
+}
+.t-icon-no-expression:before {
+ content: '\E571';
+}
+.t-icon-noodle-filled:before {
+ content: '\E572';
+}
+.t-icon-noodle:before {
+ content: '\E573';
+}
+.t-icon-notification-add-filled:before {
+ content: '\E574';
+}
+.t-icon-notification-add:before {
+ content: '\E575';
+}
+.t-icon-notification-circle-filled:before {
+ content: '\E576';
+}
+.t-icon-notification-circle:before {
+ content: '\E577';
+}
+.t-icon-notification-error-filled:before {
+ content: '\E578';
+}
+.t-icon-notification-error:before {
+ content: '\E579';
+}
+.t-icon-notification-filled:before {
+ content: '\E57A';
+}
+.t-icon-notification:before {
+ content: '\E57B';
+}
+.t-icon-numbers-0-1:before {
+ content: '\E57C';
+}
+.t-icon-numbers-0:before {
+ content: '\E57D';
+}
+.t-icon-numbers-1-1:before {
+ content: '\E57E';
+}
+.t-icon-numbers-1:before {
+ content: '\E57F';
+}
+.t-icon-numbers-2-1:before {
+ content: '\E580';
+}
+.t-icon-numbers-2:before {
+ content: '\E581';
+}
+.t-icon-numbers-3-1:before {
+ content: '\E582';
+}
+.t-icon-numbers-3:before {
+ content: '\E583';
+}
+.t-icon-numbers-4-1:before {
+ content: '\E584';
+}
+.t-icon-numbers-4:before {
+ content: '\E585';
+}
+.t-icon-numbers-5-1:before {
+ content: '\E586';
+}
+.t-icon-numbers-5:before {
+ content: '\E587';
+}
+.t-icon-numbers-6-1:before {
+ content: '\E588';
+}
+.t-icon-numbers-6:before {
+ content: '\E589';
+}
+.t-icon-numbers-7-1:before {
+ content: '\E58A';
+}
+.t-icon-numbers-7:before {
+ content: '\E58B';
+}
+.t-icon-numbers-8-1:before {
+ content: '\E58C';
+}
+.t-icon-numbers-8:before {
+ content: '\E58D';
+}
+.t-icon-numbers-9-1:before {
+ content: '\E58E';
+}
+.t-icon-numbers-9:before {
+ content: '\E58F';
+}
+.t-icon-nut-filled:before {
+ content: '\E590';
+}
+.t-icon-nut:before {
+ content: '\E591';
+}
+.t-icon-object-storage:before {
+ content: '\E592';
+}
+.t-icon-open-mouth-filled:before {
+ content: '\E593';
+}
+.t-icon-open-mouth:before {
+ content: '\E594';
+}
+.t-icon-opera-filled:before {
+ content: '\E595';
+}
+.t-icon-opera:before {
+ content: '\E596';
+}
+.t-icon-order-adjustment-column:before {
+ content: '\E597';
+}
+.t-icon-order-ascending:before {
+ content: '\E598';
+}
+.t-icon-order-descending:before {
+ content: '\E599';
+}
+.t-icon-outbox-filled:before {
+ content: '\E59A';
+}
+.t-icon-outbox:before {
+ content: '\E59B';
+}
+.t-icon-page-first:before {
+ content: '\E59C';
+}
+.t-icon-page-head-filled:before {
+ content: '\E59D';
+}
+.t-icon-page-head:before {
+ content: '\E59E';
+}
+.t-icon-page-last:before {
+ content: '\E59F';
+}
+.t-icon-palace-1-filled:before {
+ content: '\E5A0';
+}
+.t-icon-palace-1:before {
+ content: '\E5A1';
+}
+.t-icon-palace-2-filled:before {
+ content: '\E5A2';
+}
+.t-icon-palace-2:before {
+ content: '\E5A3';
+}
+.t-icon-palace-3-filled:before {
+ content: '\E5A4';
+}
+.t-icon-palace-3:before {
+ content: '\E5A5';
+}
+.t-icon-palace-4-filled:before {
+ content: '\E5A6';
+}
+.t-icon-palace-4:before {
+ content: '\E5A7';
+}
+.t-icon-palace-filled:before {
+ content: '\E5A8';
+}
+.t-icon-palace:before {
+ content: '\E5A9';
+}
+.t-icon-palette-1-filled:before {
+ content: '\E5AA';
+}
+.t-icon-palette-1:before {
+ content: '\E5AB';
+}
+.t-icon-palette-filled:before {
+ content: '\E5AC';
+}
+.t-icon-palette:before {
+ content: '\E5AD';
+}
+.t-icon-panorama-horizontal-filled:before {
+ content: '\E5AE';
+}
+.t-icon-panorama-horizontal:before {
+ content: '\E5AF';
+}
+.t-icon-panorama-vertical-filled:before {
+ content: '\E5B0';
+}
+.t-icon-panorama-vertical:before {
+ content: '\E5B1';
+}
+.t-icon-pantone-filled:before {
+ content: '\E5B2';
+}
+.t-icon-pantone:before {
+ content: '\E5B3';
+}
+.t-icon-parabola:before {
+ content: '\E5B4';
+}
+.t-icon-parentheses:before {
+ content: '\E5B5';
+}
+.t-icon-paste-filled:before {
+ content: '\E5B6';
+}
+.t-icon-paste:before {
+ content: '\E5B7';
+}
+.t-icon-patio-filled:before {
+ content: '\E5B8';
+}
+.t-icon-patio:before {
+ content: '\E5B9';
+}
+.t-icon-pause-circle-filled:before {
+ content: '\E5BA';
+}
+.t-icon-pause-circle-stroke-filled:before {
+ content: '\E5BB';
+}
+.t-icon-pause-circle-stroke:before {
+ content: '\E5BC';
+}
+.t-icon-pause-circle:before {
+ content: '\E5BD';
+}
+.t-icon-pause:before {
+ content: '\E5BE';
+}
+.t-icon-pea-filled:before {
+ content: '\E5BF';
+}
+.t-icon-pea:before {
+ content: '\E5C0';
+}
+.t-icon-peach-filled:before {
+ content: '\E5C1';
+}
+.t-icon-peach:before {
+ content: '\E5C2';
+}
+.t-icon-pear-filled:before {
+ content: '\E5C3';
+}
+.t-icon-pear:before {
+ content: '\E5C4';
+}
+.t-icon-pearl-of-the-orient-filled:before {
+ content: '\E5C5';
+}
+.t-icon-pearl-of-the-orient:before {
+ content: '\E5C6';
+}
+.t-icon-pen-ball-filled:before {
+ content: '\E5C7';
+}
+.t-icon-pen-ball:before {
+ content: '\E5C8';
+}
+.t-icon-pen-brush-filled:before {
+ content: '\E5C9';
+}
+.t-icon-pen-brush:before {
+ content: '\E5CA';
+}
+.t-icon-pen-filled:before {
+ content: '\E5CB';
+}
+.t-icon-pen-mark-filled:before {
+ content: '\E5CC';
+}
+.t-icon-pen-mark:before {
+ content: '\E5CD';
+}
+.t-icon-pen-quill-filled:before {
+ content: '\E5CE';
+}
+.t-icon-pen-quill:before {
+ content: '\E5CF';
+}
+.t-icon-pen:before {
+ content: '\E5D0';
+}
+.t-icon-pending-filled:before {
+ content: '\E5D1';
+}
+.t-icon-pending:before {
+ content: '\E5D2';
+}
+.t-icon-percent:before {
+ content: '\E5D3';
+}
+.t-icon-personal-information-filled:before {
+ content: '\E5D4';
+}
+.t-icon-personal-information:before {
+ content: '\E5D5';
+}
+.t-icon-phone-locked-filled:before {
+ content: '\E5D6';
+}
+.t-icon-phone-locked:before {
+ content: '\E5D7';
+}
+.t-icon-phone-search-filled:before {
+ content: '\E5D8';
+}
+.t-icon-phone-search:before {
+ content: '\E5D9';
+}
+.t-icon-pi:before {
+ content: '\E5DA';
+}
+.t-icon-piano-filled:before {
+ content: '\E5DB';
+}
+.t-icon-piano:before {
+ content: '\E5DC';
+}
+.t-icon-pin-filled:before {
+ content: '\E5DD';
+}
+.t-icon-pin:before {
+ content: '\E5DE';
+}
+.t-icon-play-circle-filled:before {
+ content: '\E5DF';
+}
+.t-icon-play-circle-stroke-add-filled:before {
+ content: '\E5E0';
+}
+.t-icon-play-circle-stroke-add:before {
+ content: '\E5E1';
+}
+.t-icon-play-circle-stroke-filled:before {
+ content: '\E5E2';
+}
+.t-icon-play-circle-stroke:before {
+ content: '\E5E3';
+}
+.t-icon-play-circle:before {
+ content: '\E5E4';
+}
+.t-icon-play-demo-filled:before {
+ content: '\E5E5';
+}
+.t-icon-play-demo:before {
+ content: '\E5E6';
+}
+.t-icon-play-rectangle-filled:before {
+ content: '\E5E7';
+}
+.t-icon-play-rectangle:before {
+ content: '\E5E8';
+}
+.t-icon-play:before {
+ content: '\E5E9';
+}
+.t-icon-plus:before {
+ content: '\E5EA';
+}
+.t-icon-popsicle-filled:before {
+ content: '\E5EB';
+}
+.t-icon-popsicle:before {
+ content: '\E5EC';
+}
+.t-icon-portrait-filled:before {
+ content: '\E5ED';
+}
+.t-icon-portrait:before {
+ content: '\E5EE';
+}
+.t-icon-pout-filled:before {
+ content: '\E5EF';
+}
+.t-icon-pout:before {
+ content: '\E5F0';
+}
+.t-icon-poweroff:before {
+ content: '\E5F1';
+}
+.t-icon-precise-monitor:before {
+ content: '\E5F2';
+}
+.t-icon-previous-filled:before {
+ content: '\E5F3';
+}
+.t-icon-previous:before {
+ content: '\E5F4';
+}
+.t-icon-print-filled:before {
+ content: '\E5F5';
+}
+.t-icon-print:before {
+ content: '\E5F6';
+}
+.t-icon-pumpkin-filled:before {
+ content: '\E5F7';
+}
+.t-icon-pumpkin:before {
+ content: '\E5F8';
+}
+.t-icon-pyramid-filled:before {
+ content: '\E5F9';
+}
+.t-icon-pyramid-maya-filled:before {
+ content: '\E5FA';
+}
+.t-icon-pyramid-maya:before {
+ content: '\E5FB';
+}
+.t-icon-pyramid:before {
+ content: '\E5FC';
+}
+.t-icon-qrcode:before {
+ content: '\E5FD';
+}
+.t-icon-quadratic:before {
+ content: '\E5FE';
+}
+.t-icon-questionnaire-double-filled:before {
+ content: '\E5FF';
+}
+.t-icon-questionnaire-double:before {
+ content: '\E600';
+}
+.t-icon-questionnaire-filled:before {
+ content: '\E601';
+}
+.t-icon-questionnaire:before {
+ content: '\E602';
+}
+.t-icon-queue-filled:before {
+ content: '\E603';
+}
+.t-icon-queue:before {
+ content: '\E604';
+}
+.t-icon-radar:before {
+ content: '\E605';
+}
+.t-icon-radio-1-filled:before {
+ content: '\E606';
+}
+.t-icon-radio-1:before {
+ content: '\E607';
+}
+.t-icon-radio-2-filled:before {
+ content: '\E608';
+}
+.t-icon-radio-2:before {
+ content: '\E609';
+}
+.t-icon-radish-filled:before {
+ content: '\E60A';
+}
+.t-icon-radish:before {
+ content: '\E60B';
+}
+.t-icon-rain-heavy:before {
+ content: '\E60C';
+}
+.t-icon-rain-light-filled:before {
+ content: '\E60D';
+}
+.t-icon-rain-light:before {
+ content: '\E60E';
+}
+.t-icon-rain-medium:before {
+ content: '\E60F';
+}
+.t-icon-rainbow:before {
+ content: '\E610';
+}
+.t-icon-rectangle-filled:before {
+ content: '\E611';
+}
+.t-icon-rectangle:before {
+ content: '\E612';
+}
+.t-icon-refresh:before {
+ content: '\E613';
+}
+.t-icon-relation:before {
+ content: '\E614';
+}
+.t-icon-relativity-filled:before {
+ content: '\E615';
+}
+.t-icon-relativity:before {
+ content: '\E616';
+}
+.t-icon-remote-wave-filled:before {
+ content: '\E617';
+}
+.t-icon-remote-wave:before {
+ content: '\E618';
+}
+.t-icon-remove:before {
+ content: '\E619';
+}
+.t-icon-replay-filled:before {
+ content: '\E61A';
+}
+.t-icon-replay:before {
+ content: '\E61B';
+}
+.t-icon-rice-ball-filled:before {
+ content: '\E61C';
+}
+.t-icon-rice-ball:before {
+ content: '\E61D';
+}
+.t-icon-rice-filled:before {
+ content: '\E61E';
+}
+.t-icon-rice:before {
+ content: '\E61F';
+}
+.t-icon-roast-filled:before {
+ content: '\E620';
+}
+.t-icon-roast:before {
+ content: '\E621';
+}
+.t-icon-rocket-filled:before {
+ content: '\E622';
+}
+.t-icon-rocket:before {
+ content: '\E623';
+}
+.t-icon-rollback:before {
+ content: '\E624';
+}
+.t-icon-rollfront:before {
+ content: '\E625';
+}
+.t-icon-root-list-filled:before {
+ content: '\E626';
+}
+.t-icon-root-list:before {
+ content: '\E627';
+}
+.t-icon-rotate-locked-filled:before {
+ content: '\E628';
+}
+.t-icon-rotate-locked:before {
+ content: '\E629';
+}
+.t-icon-rotate:before {
+ content: '\E62A';
+}
+.t-icon-rotation:before {
+ content: '\E62B';
+}
+.t-icon-round-filled:before {
+ content: '\E62C';
+}
+.t-icon-round:before {
+ content: '\E62D';
+}
+.t-icon-router-wave-filled:before {
+ content: '\E62E';
+}
+.t-icon-router-wave:before {
+ content: '\E62F';
+}
+.t-icon-rss:before {
+ content: '\E630';
+}
+.t-icon-ruler-filled:before {
+ content: '\E631';
+}
+.t-icon-ruler:before {
+ content: '\E632';
+}
+.t-icon-sailing-hotel-filled:before {
+ content: '\E633';
+}
+.t-icon-sailing-hotel:before {
+ content: '\E634';
+}
+.t-icon-sandwich-filled:before {
+ content: '\E635';
+}
+.t-icon-sandwich:before {
+ content: '\E636';
+}
+.t-icon-saturation-filled:before {
+ content: '\E637';
+}
+.t-icon-saturation:before {
+ content: '\E638';
+}
+.t-icon-sausage-filled:before {
+ content: '\E639';
+}
+.t-icon-sausage:before {
+ content: '\E63A';
+}
+.t-icon-save-filled:before {
+ content: '\E63B';
+}
+.t-icon-save:before {
+ content: '\E63C';
+}
+.t-icon-saving-pot-filled:before {
+ content: '\E63D';
+}
+.t-icon-saving-pot:before {
+ content: '\E63E';
+}
+.t-icon-scan:before {
+ content: '\E63F';
+}
+.t-icon-screen-4k-filled:before {
+ content: '\E640';
+}
+.t-icon-screen-4k:before {
+ content: '\E641';
+}
+.t-icon-screencast-filled:before {
+ content: '\E642';
+}
+.t-icon-screencast:before {
+ content: '\E643';
+}
+.t-icon-screenshot:before {
+ content: '\E644';
+}
+.t-icon-scroll-bar-filled:before {
+ content: '\E645';
+}
+.t-icon-scroll-bar:before {
+ content: '\E646';
+}
+.t-icon-sd-card-1-filled:before {
+ content: '\E647';
+}
+.t-icon-sd-card-1:before {
+ content: '\E648';
+}
+.t-icon-sd-card-filled:before {
+ content: '\E649';
+}
+.t-icon-sd-card:before {
+ content: '\E64A';
+}
+.t-icon-search-error-filled:before {
+ content: '\E64B';
+}
+.t-icon-search-error:before {
+ content: '\E64C';
+}
+.t-icon-search-filled:before {
+ content: '\E64D';
+}
+.t-icon-search:before {
+ content: '\E64E';
+}
+.t-icon-secured-filled:before {
+ content: '\E64F';
+}
+.t-icon-secured:before {
+ content: '\E650';
+}
+.t-icon-send-cancel-filled:before {
+ content: '\E651';
+}
+.t-icon-send-cancel:before {
+ content: '\E652';
+}
+.t-icon-send-filled:before {
+ content: '\E653';
+}
+.t-icon-send:before {
+ content: '\E654';
+}
+.t-icon-sensors-1:before {
+ content: '\E655';
+}
+.t-icon-sensors-2:before {
+ content: '\E656';
+}
+.t-icon-sensors-off:before {
+ content: '\E657';
+}
+.t-icon-sensors:before {
+ content: '\E658';
+}
+.t-icon-sequence-filled:before {
+ content: '\E659';
+}
+.t-icon-sequence:before {
+ content: '\E65A';
+}
+.t-icon-serenity-filled:before {
+ content: '\E65B';
+}
+.t-icon-serenity:before {
+ content: '\E65C';
+}
+.t-icon-server-filled:before {
+ content: '\E65D';
+}
+.t-icon-server:before {
+ content: '\E65E';
+}
+.t-icon-service-filled:before {
+ content: '\E65F';
+}
+.t-icon-service:before {
+ content: '\E660';
+}
+.t-icon-setting-1-filled:before {
+ content: '\E661';
+}
+.t-icon-setting-1:before {
+ content: '\E662';
+}
+.t-icon-setting-filled:before {
+ content: '\E663';
+}
+.t-icon-setting:before {
+ content: '\E664';
+}
+.t-icon-share-1-filled:before {
+ content: '\E665';
+}
+.t-icon-share-1:before {
+ content: '\E666';
+}
+.t-icon-share-filled:before {
+ content: '\E667';
+}
+.t-icon-share:before {
+ content: '\E668';
+}
+.t-icon-sharpness-filled:before {
+ content: '\E669';
+}
+.t-icon-sharpness:before {
+ content: '\E66A';
+}
+.t-icon-shield-error-filled:before {
+ content: '\E66B';
+}
+.t-icon-shield-error:before {
+ content: '\E66C';
+}
+.t-icon-shimen-filled:before {
+ content: '\E66D';
+}
+.t-icon-shimen:before {
+ content: '\E66E';
+}
+.t-icon-shop-1-filled:before {
+ content: '\E66F';
+}
+.t-icon-shop-1:before {
+ content: '\E670';
+}
+.t-icon-shop-2-filled:before {
+ content: '\E671';
+}
+.t-icon-shop-2:before {
+ content: '\E672';
+}
+.t-icon-shop-3-filled:before {
+ content: '\E673';
+}
+.t-icon-shop-3:before {
+ content: '\E674';
+}
+.t-icon-shop-4-filled:before {
+ content: '\E675';
+}
+.t-icon-shop-4:before {
+ content: '\E676';
+}
+.t-icon-shop-5-filled:before {
+ content: '\E677';
+}
+.t-icon-shop-5:before {
+ content: '\E678';
+}
+.t-icon-shop-filled:before {
+ content: '\E679';
+}
+.t-icon-shop:before {
+ content: '\E67A';
+}
+.t-icon-shrimp-filled:before {
+ content: '\E67B';
+}
+.t-icon-shrimp:before {
+ content: '\E67C';
+}
+.t-icon-shrink-horizontal:before {
+ content: '\E67D';
+}
+.t-icon-shrink-vertical:before {
+ content: '\E67E';
+}
+.t-icon-shutter-filled:before {
+ content: '\E67F';
+}
+.t-icon-shutter:before {
+ content: '\E680';
+}
+.t-icon-shutup-filled:before {
+ content: '\E681';
+}
+.t-icon-shutup:before {
+ content: '\E682';
+}
+.t-icon-sim-card-1-filled:before {
+ content: '\E683';
+}
+.t-icon-sim-card-1:before {
+ content: '\E684';
+}
+.t-icon-sim-card-2-filled:before {
+ content: '\E685';
+}
+.t-icon-sim-card-2:before {
+ content: '\E686';
+}
+.t-icon-sim-card-filled:before {
+ content: '\E687';
+}
+.t-icon-sim-card:before {
+ content: '\E688';
+}
+.t-icon-sinister-smile-filled:before {
+ content: '\E689';
+}
+.t-icon-sinister-smile:before {
+ content: '\E68A';
+}
+.t-icon-sip-filled:before {
+ content: '\E68B';
+}
+.t-icon-sip:before {
+ content: '\E68C';
+}
+.t-icon-sitemap-filled:before {
+ content: '\E68D';
+}
+.t-icon-sitemap:before {
+ content: '\E68E';
+}
+.t-icon-slash:before {
+ content: '\E68F';
+}
+.t-icon-sleep-filled:before {
+ content: '\E690';
+}
+.t-icon-sleep:before {
+ content: '\E691';
+}
+.t-icon-slice-filled:before {
+ content: '\E692';
+}
+.t-icon-slice:before {
+ content: '\E693';
+}
+.t-icon-slideshow-filled:before {
+ content: '\E694';
+}
+.t-icon-slideshow:before {
+ content: '\E695';
+}
+.t-icon-smile-filled:before {
+ content: '\E696';
+}
+.t-icon-smile:before {
+ content: '\E697';
+}
+.t-icon-sneer-filled:before {
+ content: '\E698';
+}
+.t-icon-sneer:before {
+ content: '\E699';
+}
+.t-icon-snowflake:before {
+ content: '\E69A';
+}
+.t-icon-sonic:before {
+ content: '\E69B';
+}
+.t-icon-sound-down-filled:before {
+ content: '\E69C';
+}
+.t-icon-sound-down:before {
+ content: '\E69D';
+}
+.t-icon-sound-filled:before {
+ content: '\E69E';
+}
+.t-icon-sound-high-filled:before {
+ content: '\E69F';
+}
+.t-icon-sound-high:before {
+ content: '\E6A0';
+}
+.t-icon-sound-low-filled:before {
+ content: '\E6A1';
+}
+.t-icon-sound-low:before {
+ content: '\E6A2';
+}
+.t-icon-sound-mute-1-filled:before {
+ content: '\E6A3';
+}
+.t-icon-sound-mute-1:before {
+ content: '\E6A4';
+}
+.t-icon-sound-mute-filled:before {
+ content: '\E6A5';
+}
+.t-icon-sound-mute:before {
+ content: '\E6A6';
+}
+.t-icon-sound-up-filled:before {
+ content: '\E6A7';
+}
+.t-icon-sound-up:before {
+ content: '\E6A8';
+}
+.t-icon-sound:before {
+ content: '\E6A9';
+}
+.t-icon-space:before {
+ content: '\E6AA';
+}
+.t-icon-speechless-1-filled:before {
+ content: '\E6AB';
+}
+.t-icon-speechless-1:before {
+ content: '\E6AC';
+}
+.t-icon-speechless-filled:before {
+ content: '\E6AD';
+}
+.t-icon-speechless:before {
+ content: '\E6AE';
+}
+.t-icon-star-filled:before {
+ content: '\E6AF';
+}
+.t-icon-star:before {
+ content: '\E6B0';
+}
+.t-icon-statue-of-jesus-filled:before {
+ content: '\E6B1';
+}
+.t-icon-statue-of-jesus:before {
+ content: '\E6B2';
+}
+.t-icon-sticky-note-filled:before {
+ content: '\E6B3';
+}
+.t-icon-sticky-note:before {
+ content: '\E6B4';
+}
+.t-icon-stop-circle-filled:before {
+ content: '\E6B5';
+}
+.t-icon-stop-circle-stroke-filled:before {
+ content: '\E6B6';
+}
+.t-icon-stop-circle-stroke:before {
+ content: '\E6B7';
+}
+.t-icon-stop-circle:before {
+ content: '\E6B8';
+}
+.t-icon-stop:before {
+ content: '\E6B9';
+}
+.t-icon-store-filled:before {
+ content: '\E6BA';
+}
+.t-icon-store:before {
+ content: '\E6BB';
+}
+.t-icon-street-road-1-filled:before {
+ content: '\E6BC';
+}
+.t-icon-street-road-1:before {
+ content: '\E6BD';
+}
+.t-icon-street-road-filled:before {
+ content: '\E6BE';
+}
+.t-icon-street-road:before {
+ content: '\E6BF';
+}
+.t-icon-subtitle-filled:before {
+ content: '\E6C0';
+}
+.t-icon-subtitle:before {
+ content: '\E6C1';
+}
+.t-icon-subway-line-filled:before {
+ content: '\E6C2';
+}
+.t-icon-subway-line:before {
+ content: '\E6C3';
+}
+.t-icon-sum:before {
+ content: '\E6C4';
+}
+.t-icon-sun-fall-filled:before {
+ content: '\E6C5';
+}
+.t-icon-sun-fall:before {
+ content: '\E6C6';
+}
+.t-icon-sun-rising-filled:before {
+ content: '\E6C7';
+}
+.t-icon-sun-rising:before {
+ content: '\E6C8';
+}
+.t-icon-sunny-filled:before {
+ content: '\E6C9';
+}
+.t-icon-sunny:before {
+ content: '\E6CA';
+}
+.t-icon-support-filled:before {
+ content: '\E6CB';
+}
+.t-icon-support:before {
+ content: '\E6CC';
+}
+.t-icon-surprised-1-filled:before {
+ content: '\E6CD';
+}
+.t-icon-surprised-1:before {
+ content: '\E6CE';
+}
+.t-icon-surprised-filled:before {
+ content: '\E6CF';
+}
+.t-icon-surprised:before {
+ content: '\E6D0';
+}
+.t-icon-swap-left:before {
+ content: '\E6D1';
+}
+.t-icon-swap-right:before {
+ content: '\E6D2';
+}
+.t-icon-swap:before {
+ content: '\E6D3';
+}
+.t-icon-swear-1-filled:before {
+ content: '\E6D4';
+}
+.t-icon-swear-1:before {
+ content: '\E6D5';
+}
+.t-icon-swear-2-filled:before {
+ content: '\E6D6';
+}
+.t-icon-swear-2:before {
+ content: '\E6D7';
+}
+.t-icon-system-2:before {
+ content: '\E6D8';
+}
+.t-icon-system-3-filled:before {
+ content: '\E6D9';
+}
+.t-icon-system-3:before {
+ content: '\E6DA';
+}
+.t-icon-system-application-filled:before {
+ content: '\E6DB';
+}
+.t-icon-system-application:before {
+ content: '\E6DC';
+}
+.t-icon-system-blocked-filled:before {
+ content: '\E6DD';
+}
+.t-icon-system-blocked:before {
+ content: '\E6DE';
+}
+.t-icon-system-code-filled:before {
+ content: '\E6DF';
+}
+.t-icon-system-code:before {
+ content: '\E6E0';
+}
+.t-icon-system-components-filled:before {
+ content: '\E6E1';
+}
+.t-icon-system-components:before {
+ content: '\E6E2';
+}
+.t-icon-system-coordinate-filled:before {
+ content: '\E6E3';
+}
+.t-icon-system-coordinate:before {
+ content: '\E6E4';
+}
+.t-icon-system-device-filled:before {
+ content: '\E6E5';
+}
+.t-icon-system-device:before {
+ content: '\E6E6';
+}
+.t-icon-system-interface-filled:before {
+ content: '\E6E7';
+}
+.t-icon-system-interface:before {
+ content: '\E6E8';
+}
+.t-icon-system-location-filled:before {
+ content: '\E6E9';
+}
+.t-icon-system-location:before {
+ content: '\E6EA';
+}
+.t-icon-system-locked-filled:before {
+ content: '\E6EB';
+}
+.t-icon-system-locked:before {
+ content: '\E6EC';
+}
+.t-icon-system-log-filled:before {
+ content: '\E6ED';
+}
+.t-icon-system-log:before {
+ content: '\E6EE';
+}
+.t-icon-system-marked-filled:before {
+ content: '\E6EF';
+}
+.t-icon-system-marked:before {
+ content: '\E6F0';
+}
+.t-icon-system-messages-filled:before {
+ content: '\E6F1';
+}
+.t-icon-system-messages:before {
+ content: '\E6F2';
+}
+.t-icon-system-regulation-filled:before {
+ content: '\E6F3';
+}
+.t-icon-system-regulation:before {
+ content: '\E6F4';
+}
+.t-icon-system-search-filled:before {
+ content: '\E6F5';
+}
+.t-icon-system-search:before {
+ content: '\E6F6';
+}
+.t-icon-system-setting-filled:before {
+ content: '\E6F7';
+}
+.t-icon-system-setting:before {
+ content: '\E6F8';
+}
+.t-icon-system-storage-filled:before {
+ content: '\E6F9';
+}
+.t-icon-system-storage:before {
+ content: '\E6FA';
+}
+.t-icon-system-sum:before {
+ content: '\E6FB';
+}
+.t-icon-system-unlocked-filled:before {
+ content: '\E6FC';
+}
+.t-icon-system-unlocked:before {
+ content: '\E6FD';
+}
+.t-icon-tab-filled:before {
+ content: '\E6FE';
+}
+.t-icon-tab:before {
+ content: '\E6FF';
+}
+.t-icon-table-1-filled:before {
+ content: '\E700';
+}
+.t-icon-table-1:before {
+ content: '\E701';
+}
+.t-icon-table-2-filled:before {
+ content: '\E702';
+}
+.t-icon-table-2:before {
+ content: '\E703';
+}
+.t-icon-table-add-filled:before {
+ content: '\E704';
+}
+.t-icon-table-add:before {
+ content: '\E705';
+}
+.t-icon-table-filled:before {
+ content: '\E706';
+}
+.t-icon-table-split-filled:before {
+ content: '\E707';
+}
+.t-icon-table-split:before {
+ content: '\E708';
+}
+.t-icon-table:before {
+ content: '\E709';
+}
+.t-icon-tag-filled:before {
+ content: '\E70A';
+}
+.t-icon-tag:before {
+ content: '\E70B';
+}
+.t-icon-tangerinr-filled:before {
+ content: '\E70C';
+}
+.t-icon-tangerinr:before {
+ content: '\E70D';
+}
+.t-icon-tape-filled:before {
+ content: '\E70E';
+}
+.t-icon-tape:before {
+ content: '\E70F';
+}
+.t-icon-task-1-filled:before {
+ content: '\E710';
+}
+.t-icon-task-1:before {
+ content: '\E711';
+}
+.t-icon-task-add-1:before {
+ content: '\E712';
+}
+.t-icon-task-add-filled:before {
+ content: '\E713';
+}
+.t-icon-task-add:before {
+ content: '\E714';
+}
+.t-icon-task-checked-1:before {
+ content: '\E715';
+}
+.t-icon-task-checked-filled:before {
+ content: '\E716';
+}
+.t-icon-task-checked:before {
+ content: '\E717';
+}
+.t-icon-task-double-filled:before {
+ content: '\E718';
+}
+.t-icon-task-double:before {
+ content: '\E719';
+}
+.t-icon-task-error-filled:before {
+ content: '\E71A';
+}
+.t-icon-task-error:before {
+ content: '\E71B';
+}
+.t-icon-task-filled:before {
+ content: '\E71C';
+}
+.t-icon-task-location-filled:before {
+ content: '\E71D';
+}
+.t-icon-task-location:before {
+ content: '\E71E';
+}
+.t-icon-task-marked-filled:before {
+ content: '\E71F';
+}
+.t-icon-task-marked:before {
+ content: '\E720';
+}
+.t-icon-task-setting-filled:before {
+ content: '\E721';
+}
+.t-icon-task-setting:before {
+ content: '\E722';
+}
+.t-icon-task-time-filled:before {
+ content: '\E723';
+}
+.t-icon-task-time:before {
+ content: '\E724';
+}
+.t-icon-task-visible-filled:before {
+ content: '\E725';
+}
+.t-icon-task-visible:before {
+ content: '\E726';
+}
+.t-icon-task:before {
+ content: '\E727';
+}
+.t-icon-tea-filled:before {
+ content: '\E728';
+}
+.t-icon-tea:before {
+ content: '\E729';
+}
+.t-icon-teahouse-filled:before {
+ content: '\E72A';
+}
+.t-icon-teahouse:before {
+ content: '\E72B';
+}
+.t-icon-template-filled:before {
+ content: '\E72C';
+}
+.t-icon-template:before {
+ content: '\E72D';
+}
+.t-icon-temple-filled:before {
+ content: '\E72E';
+}
+.t-icon-temple:before {
+ content: '\E72F';
+}
+.t-icon-terminal-rectangle-1-filled:before {
+ content: '\E730';
+}
+.t-icon-terminal-rectangle-1:before {
+ content: '\E731';
+}
+.t-icon-terminal-rectangle-filled:before {
+ content: '\E732';
+}
+.t-icon-terminal-rectangle:before {
+ content: '\E733';
+}
+.t-icon-terminal-window-filled:before {
+ content: '\E734';
+}
+.t-icon-terminal-window:before {
+ content: '\E735';
+}
+.t-icon-terminal:before {
+ content: '\E736';
+}
+.t-icon-textbox-filled:before {
+ content: '\E737';
+}
+.t-icon-textbox:before {
+ content: '\E738';
+}
+.t-icon-textformat-bold:before {
+ content: '\E739';
+}
+.t-icon-textformat-color:before {
+ content: '\E73A';
+}
+.t-icon-textformat-italic:before {
+ content: '\E73B';
+}
+.t-icon-textformat-strikethrough:before {
+ content: '\E73C';
+}
+.t-icon-textformat-underline:before {
+ content: '\E73D';
+}
+.t-icon-textformat-wrap:before {
+ content: '\E73E';
+}
+.t-icon-theaters-filled:before {
+ content: '\E73F';
+}
+.t-icon-theaters:before {
+ content: '\E740';
+}
+.t-icon-thumb-down-1-filled:before {
+ content: '\E741';
+}
+.t-icon-thumb-down-1:before {
+ content: '\E742';
+}
+.t-icon-thumb-down-2-filled:before {
+ content: '\E743';
+}
+.t-icon-thumb-down-2:before {
+ content: '\E744';
+}
+.t-icon-thumb-down-filled:before {
+ content: '\E745';
+}
+.t-icon-thumb-down:before {
+ content: '\E746';
+}
+.t-icon-thumb-up-1-filled:before {
+ content: '\E747';
+}
+.t-icon-thumb-up-1:before {
+ content: '\E748';
+}
+.t-icon-thumb-up-2-filled:before {
+ content: '\E749';
+}
+.t-icon-thumb-up-2:before {
+ content: '\E74A';
+}
+.t-icon-thumb-up-filled:before {
+ content: '\E74B';
+}
+.t-icon-thumb-up:before {
+ content: '\E74C';
+}
+.t-icon-thunder:before {
+ content: '\E74D';
+}
+.t-icon-thunderstorm-night-filled:before {
+ content: '\E74E';
+}
+.t-icon-thunderstorm-night:before {
+ content: '\E74F';
+}
+.t-icon-thunderstorm-sunny-filled:before {
+ content: '\E750';
+}
+.t-icon-thunderstorm-sunny:before {
+ content: '\E751';
+}
+.t-icon-thunderstorm:before {
+ content: '\E752';
+}
+.t-icon-ticket-filled:before {
+ content: '\E753';
+}
+.t-icon-ticket:before {
+ content: '\E754';
+}
+.t-icon-time-filled:before {
+ content: '\E755';
+}
+.t-icon-time:before {
+ content: '\E756';
+}
+.t-icon-tips-double-filled:before {
+ content: '\E757';
+}
+.t-icon-tips-double:before {
+ content: '\E758';
+}
+.t-icon-tips-filled:before {
+ content: '\E759';
+}
+.t-icon-tips:before {
+ content: '\E75A';
+}
+.t-icon-tomato-filled:before {
+ content: '\E75B';
+}
+.t-icon-tomato:before {
+ content: '\E75C';
+}
+.t-icon-tools-circle-filled:before {
+ content: '\E75D';
+}
+.t-icon-tools-circle:before {
+ content: '\E75E';
+}
+.t-icon-tools-filled:before {
+ content: '\E75F';
+}
+.t-icon-tools:before {
+ content: '\E760';
+}
+.t-icon-tornado:before {
+ content: '\E761';
+}
+.t-icon-tower-1-filled:before {
+ content: '\E762';
+}
+.t-icon-tower-1:before {
+ content: '\E763';
+}
+.t-icon-tower-2-filled:before {
+ content: '\E764';
+}
+.t-icon-tower-2:before {
+ content: '\E765';
+}
+.t-icon-tower-3-filled:before {
+ content: '\E766';
+}
+.t-icon-tower-3:before {
+ content: '\E767';
+}
+.t-icon-tower-clock-filled:before {
+ content: '\E768';
+}
+.t-icon-tower-clock:before {
+ content: '\E769';
+}
+.t-icon-tower-filled:before {
+ content: '\E76A';
+}
+.t-icon-tower:before {
+ content: '\E76B';
+}
+.t-icon-town-filled:before {
+ content: '\E76C';
+}
+.t-icon-town:before {
+ content: '\E76D';
+}
+.t-icon-traffic-events-filled:before {
+ content: '\E76E';
+}
+.t-icon-traffic-events:before {
+ content: '\E76F';
+}
+.t-icon-traffic-filled:before {
+ content: '\E770';
+}
+.t-icon-traffic:before {
+ content: '\E771';
+}
+.t-icon-transform-1-filled:before {
+ content: '\E772';
+}
+.t-icon-transform-1:before {
+ content: '\E773';
+}
+.t-icon-transform-2:before {
+ content: '\E774';
+}
+.t-icon-transform-3:before {
+ content: '\E775';
+}
+.t-icon-transform-filled:before {
+ content: '\E776';
+}
+.t-icon-transform:before {
+ content: '\E777';
+}
+.t-icon-translate-1:before {
+ content: '\E778';
+}
+.t-icon-translate:before {
+ content: '\E779';
+}
+.t-icon-tree-round-dot-filled:before {
+ content: '\E77A';
+}
+.t-icon-tree-round-dot-vertical-filled:before {
+ content: '\E77B';
+}
+.t-icon-tree-round-dot-vertical:before {
+ content: '\E77C';
+}
+.t-icon-tree-round-dot:before {
+ content: '\E77D';
+}
+.t-icon-tree-square-dot-filled:before {
+ content: '\E77E';
+}
+.t-icon-tree-square-dot-vertical-filled:before {
+ content: '\E77F';
+}
+.t-icon-tree-square-dot-vertical:before {
+ content: '\E780';
+}
+.t-icon-tree-square-dot:before {
+ content: '\E781';
+}
+.t-icon-trending-down:before {
+ content: '\E782';
+}
+.t-icon-trending-up:before {
+ content: '\E783';
+}
+.t-icon-tv-1-filled:before {
+ content: '\E784';
+}
+.t-icon-tv-1:before {
+ content: '\E785';
+}
+.t-icon-tv-2-filled:before {
+ content: '\E786';
+}
+.t-icon-tv-2:before {
+ content: '\E787';
+}
+.t-icon-tv-filled:before {
+ content: '\E788';
+}
+.t-icon-tv:before {
+ content: '\E789';
+}
+.t-icon-typography-filled:before {
+ content: '\E78A';
+}
+.t-icon-typography:before {
+ content: '\E78B';
+}
+.t-icon-uncomfortable-1-filled:before {
+ content: '\E78C';
+}
+.t-icon-uncomfortable-1:before {
+ content: '\E78D';
+}
+.t-icon-uncomfortable-2-filled:before {
+ content: '\E78E';
+}
+.t-icon-uncomfortable-2:before {
+ content: '\E78F';
+}
+.t-icon-uncomfortable-filled:before {
+ content: '\E790';
+}
+.t-icon-uncomfortable:before {
+ content: '\E791';
+}
+.t-icon-undertake-delivery-filled:before {
+ content: '\E792';
+}
+.t-icon-undertake-delivery:before {
+ content: '\E793';
+}
+.t-icon-undertake-environment-protection-filled:before {
+ content: '\E794';
+}
+.t-icon-undertake-environment-protection:before {
+ content: '\E795';
+}
+.t-icon-undertake-filled:before {
+ content: '\E796';
+}
+.t-icon-undertake-hold-up-filled:before {
+ content: '\E797';
+}
+.t-icon-undertake-hold-up:before {
+ content: '\E798';
+}
+.t-icon-undertake-transaction-filled:before {
+ content: '\E799';
+}
+.t-icon-undertake-transaction:before {
+ content: '\E79A';
+}
+.t-icon-undertake:before {
+ content: '\E79B';
+}
+.t-icon-unfold-less:before {
+ content: '\E79C';
+}
+.t-icon-unfold-more:before {
+ content: '\E79D';
+}
+.t-icon-unhappy-1-filled:before {
+ content: '\E79E';
+}
+.t-icon-unhappy-1:before {
+ content: '\E79F';
+}
+.t-icon-unhappy-filled:before {
+ content: '\E7A0';
+}
+.t-icon-unhappy:before {
+ content: '\E7A1';
+}
+.t-icon-uninstall-filled:before {
+ content: '\E7A2';
+}
+.t-icon-uninstall:before {
+ content: '\E7A3';
+}
+.t-icon-upload-1:before {
+ content: '\E7A4';
+}
+.t-icon-upload:before {
+ content: '\E7A5';
+}
+.t-icon-upscale:before {
+ content: '\E7A6';
+}
+.t-icon-usb-filled:before {
+ content: '\E7A7';
+}
+.t-icon-usb:before {
+ content: '\E7A8';
+}
+.t-icon-user-1-filled:before {
+ content: '\E7A9';
+}
+.t-icon-user-1:before {
+ content: '\E7AA';
+}
+.t-icon-user-add-filled:before {
+ content: '\E7AB';
+}
+.t-icon-user-add:before {
+ content: '\E7AC';
+}
+.t-icon-user-arrow-down-filled:before {
+ content: '\E7AD';
+}
+.t-icon-user-arrow-down:before {
+ content: '\E7AE';
+}
+.t-icon-user-arrow-left-filled:before {
+ content: '\E7AF';
+}
+.t-icon-user-arrow-left:before {
+ content: '\E7B0';
+}
+.t-icon-user-arrow-right-filled:before {
+ content: '\E7B1';
+}
+.t-icon-user-arrow-right:before {
+ content: '\E7B2';
+}
+.t-icon-user-arrow-up-filled:before {
+ content: '\E7B3';
+}
+.t-icon-user-arrow-up:before {
+ content: '\E7B4';
+}
+.t-icon-user-avatar-filled:before {
+ content: '\E7B5';
+}
+.t-icon-user-avatar:before {
+ content: '\E7B6';
+}
+.t-icon-user-blocked-filled:before {
+ content: '\E7B7';
+}
+.t-icon-user-blocked:before {
+ content: '\E7B8';
+}
+.t-icon-user-business-filled:before {
+ content: '\E7B9';
+}
+.t-icon-user-business:before {
+ content: '\E7BA';
+}
+.t-icon-user-checked-1-filled:before {
+ content: '\E7BB';
+}
+.t-icon-user-checked-1:before {
+ content: '\E7BC';
+}
+.t-icon-user-checked-filled:before {
+ content: '\E7BD';
+}
+.t-icon-user-checked:before {
+ content: '\E7BE';
+}
+.t-icon-user-circle-filled:before {
+ content: '\E7BF';
+}
+.t-icon-user-circle:before {
+ content: '\E7C0';
+}
+.t-icon-user-clear-filled:before {
+ content: '\E7C1';
+}
+.t-icon-user-clear:before {
+ content: '\E7C2';
+}
+.t-icon-user-error-1-filled:before {
+ content: '\E7C3';
+}
+.t-icon-user-error-1:before {
+ content: '\E7C4';
+}
+.t-icon-user-filled:before {
+ content: '\E7C5';
+}
+.t-icon-user-invisible-filled:before {
+ content: '\E7C6';
+}
+.t-icon-user-invisible:before {
+ content: '\E7C7';
+}
+.t-icon-user-list-filled:before {
+ content: '\E7C8';
+}
+.t-icon-user-list:before {
+ content: '\E7C9';
+}
+.t-icon-user-locked-filled:before {
+ content: '\E7CA';
+}
+.t-icon-user-locked:before {
+ content: '\E7CB';
+}
+.t-icon-user-marked-filled:before {
+ content: '\E7CC';
+}
+.t-icon-user-marked:before {
+ content: '\E7CD';
+}
+.t-icon-user-password-filled:before {
+ content: '\E7CE';
+}
+.t-icon-user-password:before {
+ content: '\E7CF';
+}
+.t-icon-user-safety-filled:before {
+ content: '\E7D0';
+}
+.t-icon-user-safety:before {
+ content: '\E7D1';
+}
+.t-icon-user-search-filled:before {
+ content: '\E7D2';
+}
+.t-icon-user-search:before {
+ content: '\E7D3';
+}
+.t-icon-user-setting-filled:before {
+ content: '\E7D4';
+}
+.t-icon-user-setting:before {
+ content: '\E7D5';
+}
+.t-icon-user-talk-1-filled:before {
+ content: '\E7D6';
+}
+.t-icon-user-talk-1:before {
+ content: '\E7D7';
+}
+.t-icon-user-talk-filled:before {
+ content: '\E7D8';
+}
+.t-icon-user-talk-off-1-filled:before {
+ content: '\E7D9';
+}
+.t-icon-user-talk-off-1:before {
+ content: '\E7DA';
+}
+.t-icon-user-talk:before {
+ content: '\E7DB';
+}
+.t-icon-user-time-filled:before {
+ content: '\E7DC';
+}
+.t-icon-user-time:before {
+ content: '\E7DD';
+}
+.t-icon-user-transmit-filled:before {
+ content: '\E7DE';
+}
+.t-icon-user-transmit:before {
+ content: '\E7DF';
+}
+.t-icon-user-unknown-filled:before {
+ content: '\E7E0';
+}
+.t-icon-user-unknown:before {
+ content: '\E7E1';
+}
+.t-icon-user-unlocked-filled:before {
+ content: '\E7E2';
+}
+.t-icon-user-unlocked:before {
+ content: '\E7E3';
+}
+.t-icon-user-vip-filled:before {
+ content: '\E7E4';
+}
+.t-icon-user-vip:before {
+ content: '\E7E5';
+}
+.t-icon-user-visible-filled:before {
+ content: '\E7E6';
+}
+.t-icon-user-visible:before {
+ content: '\E7E7';
+}
+.t-icon-user:before {
+ content: '\E7E8';
+}
+.t-icon-usercase-filled:before {
+ content: '\E7E9';
+}
+.t-icon-usercase-link-filled:before {
+ content: '\E7EA';
+}
+.t-icon-usercase-link:before {
+ content: '\E7EB';
+}
+.t-icon-usercase:before {
+ content: '\E7EC';
+}
+.t-icon-usergroup-add-filled:before {
+ content: '\E7ED';
+}
+.t-icon-usergroup-add:before {
+ content: '\E7EE';
+}
+.t-icon-usergroup-clear-filled:before {
+ content: '\E7EF';
+}
+.t-icon-usergroup-clear:before {
+ content: '\E7F0';
+}
+.t-icon-usergroup-filled:before {
+ content: '\E7F1';
+}
+.t-icon-usergroup:before {
+ content: '\E7F2';
+}
+.t-icon-vehicle-filled:before {
+ content: '\E7F3';
+}
+.t-icon-vehicle:before {
+ content: '\E7F4';
+}
+.t-icon-verified-filled:before {
+ content: '\E7F5';
+}
+.t-icon-verified:before {
+ content: '\E7F6';
+}
+.t-icon-verify-filled:before {
+ content: '\E7F7';
+}
+.t-icon-verify:before {
+ content: '\E7F8';
+}
+.t-icon-vertical-filled:before {
+ content: '\E7F9';
+}
+.t-icon-vertical:before {
+ content: '\E7FA';
+}
+.t-icon-video-camera-1-filled:before {
+ content: '\E7FB';
+}
+.t-icon-video-camera-1:before {
+ content: '\E7FC';
+}
+.t-icon-video-camera-2-filled:before {
+ content: '\E7FD';
+}
+.t-icon-video-camera-2:before {
+ content: '\E7FE';
+}
+.t-icon-video-camera-3-filled:before {
+ content: '\E7FF';
+}
+.t-icon-video-camera-3:before {
+ content: '\E800';
+}
+.t-icon-video-camera-dollar-filled:before {
+ content: '\E801';
+}
+.t-icon-video-camera-dollar:before {
+ content: '\E802';
+}
+.t-icon-video-camera-filled:before {
+ content: '\E803';
+}
+.t-icon-video-camera-minus-filled:before {
+ content: '\E804';
+}
+.t-icon-video-camera-minus:before {
+ content: '\E805';
+}
+.t-icon-video-camera-music-filled:before {
+ content: '\E806';
+}
+.t-icon-video-camera-music:before {
+ content: '\E807';
+}
+.t-icon-video-camera-off-filled:before {
+ content: '\E808';
+}
+.t-icon-video-camera-off:before {
+ content: '\E809';
+}
+.t-icon-video-camera:before {
+ content: '\E80A';
+}
+.t-icon-video-filled:before {
+ content: '\E80B';
+}
+.t-icon-video-library-filled:before {
+ content: '\E80C';
+}
+.t-icon-video-library:before {
+ content: '\E80D';
+}
+.t-icon-video:before {
+ content: '\E80E';
+}
+.t-icon-view-agenda-filled:before {
+ content: '\E80F';
+}
+.t-icon-view-agenda:before {
+ content: '\E810';
+}
+.t-icon-view-column:before {
+ content: '\E811';
+}
+.t-icon-view-in-ar-filled:before {
+ content: '\E812';
+}
+.t-icon-view-in-ar:before {
+ content: '\E813';
+}
+.t-icon-view-list:before {
+ content: '\E814';
+}
+.t-icon-view-module-filled:before {
+ content: '\E815';
+}
+.t-icon-view-module:before {
+ content: '\E816';
+}
+.t-icon-visual-recognition-filled:before {
+ content: '\E817';
+}
+.t-icon-visual-recognition:before {
+ content: '\E818';
+}
+.t-icon-wallet-filled:before {
+ content: '\E819';
+}
+.t-icon-wallet:before {
+ content: '\E81A';
+}
+.t-icon-watch-filled:before {
+ content: '\E81B';
+}
+.t-icon-watch:before {
+ content: '\E81C';
+}
+.t-icon-watermelon-filled:before {
+ content: '\E81D';
+}
+.t-icon-watermelon:before {
+ content: '\E81E';
+}
+.t-icon-wave-bye-filled:before {
+ content: '\E81F';
+}
+.t-icon-wave-bye:before {
+ content: '\E820';
+}
+.t-icon-wave-left-filled:before {
+ content: '\E821';
+}
+.t-icon-wave-left:before {
+ content: '\E822';
+}
+.t-icon-wave-right-filled:before {
+ content: '\E823';
+}
+.t-icon-wave-right:before {
+ content: '\E824';
+}
+.t-icon-wealth-1-filled:before {
+ content: '\E825';
+}
+.t-icon-wealth-1:before {
+ content: '\E826';
+}
+.t-icon-wealth-filled:before {
+ content: '\E827';
+}
+.t-icon-wealth:before {
+ content: '\E828';
+}
+.t-icon-widget-filled:before {
+ content: '\E829';
+}
+.t-icon-widget:before {
+ content: '\E82A';
+}
+.t-icon-wifi-1-filled:before {
+ content: '\E82B';
+}
+.t-icon-wifi-1:before {
+ content: '\E82C';
+}
+.t-icon-wifi-off-1-filled:before {
+ content: '\E82D';
+}
+.t-icon-wifi-off-1:before {
+ content: '\E82E';
+}
+.t-icon-wifi-off:before {
+ content: '\E82F';
+}
+.t-icon-wifi:before {
+ content: '\E830';
+}
+.t-icon-window-1-filled:before {
+ content: '\E831';
+}
+.t-icon-window-1:before {
+ content: '\E832';
+}
+.t-icon-window-filled:before {
+ content: '\E833';
+}
+.t-icon-window:before {
+ content: '\E834';
+}
+.t-icon-windy-rain:before {
+ content: '\E835';
+}
+.t-icon-windy:before {
+ content: '\E836';
+}
+.t-icon-wink-filled:before {
+ content: '\E837';
+}
+.t-icon-wink:before {
+ content: '\E838';
+}
+.t-icon-work-filled:before {
+ content: '\E839';
+}
+.t-icon-work-history-filled:before {
+ content: '\E83A';
+}
+.t-icon-work-history:before {
+ content: '\E83B';
+}
+.t-icon-work-off-filled:before {
+ content: '\E83C';
+}
+.t-icon-work-off:before {
+ content: '\E83D';
+}
+.t-icon-work:before {
+ content: '\E83E';
+}
+.t-icon-wry-smile-filled:before {
+ content: '\E83F';
+}
+.t-icon-wry-smile:before {
+ content: '\E840';
+}
+.t-icon-zoom-in-filled:before {
+ content: '\E841';
+}
+.t-icon-zoom-in:before {
+ content: '\E842';
+}
+.t-icon-zoom-out-filled:before {
+ content: '\E843';
+}
+.t-icon-zoom-out:before {
+ content: '\E844';
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/props.d.ts b/miniprogram_npm/tdesign-miniprogram/icon/props.d.ts
new file mode 100644
index 0000000..a472c01
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/props.d.ts
@@ -0,0 +1,3 @@
+import { TdIconProps } from './type';
+declare const props: TdIconProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/props.js b/miniprogram_npm/tdesign-miniprogram/icon/props.js
new file mode 100644
index 0000000..4d0ffa2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/props.js
@@ -0,0 +1,19 @@
+const props = {
+ color: {
+ type: String,
+ value: '',
+ },
+ name: {
+ type: String,
+ value: '',
+ required: true,
+ },
+ prefix: {
+ type: String,
+ value: '',
+ },
+ size: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/type.d.ts b/miniprogram_npm/tdesign-miniprogram/icon/type.d.ts
new file mode 100644
index 0000000..c92226c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/type.d.ts
@@ -0,0 +1,19 @@
+export interface TdIconProps {
+ color?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ name: {
+ type: StringConstructor;
+ value?: string;
+ required?: boolean;
+ };
+ prefix?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ size?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/type.js b/miniprogram_npm/tdesign-miniprogram/icon/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/image-viewer/README.en-US.md
new file mode 100644
index 0000000..b16272d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/README.en-US.md
@@ -0,0 +1,40 @@
+:: BASE_DOC ::
+
+## API
+
+### ImageViewer 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
+background-color | String | 'rgba(0, 0, 0, 1)' | \- | N
+close-btn | String / Boolean / Object / Slot | false | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+delete-btn | String / Boolean / Object / Slot | false | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+images | Array | [] | Typescript:`Array` | N
+initial-index | Number | 0 | Typescript:`Number` | N
+show-index | Boolean | false | \- | N
+using-custom-navbar | Boolean | false | `v1.1.4` | N
+visible | Boolean | false | hide or show image viewer | N
+default-visible | Boolean | undefined | hide or show image viewer。uncontrolled property | N
+
+### ImageViewer Events
+
+name | params | description
+-- | -- | --
+change | `(index: Number)` | \-
+close | `(trigger: 'overlay' \| 'button', visible: Boolean, index: Number)` | \-
+delete | `(index: Number)` | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-image-viewer-close-margin-left | @spacer-1 | -
+--td-image-viewer-delete-margin-right | @spacer-1 | -
+--td-image-viewer-nav-bg-color | @font-gray-3 | -
+--td-image-viewer-nav-color | @font-white-1 | -
+--td-image-viewer-nav-height | 96rpx | -
+--td-image-viewer-nav-index-font-size | @font-size-base | -
+--td-image-viewer-top | @position-fixed-top | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/README.md b/miniprogram_npm/tdesign-miniprogram/image-viewer/README.md
new file mode 100644
index 0000000..e02fda6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/README.md
@@ -0,0 +1,86 @@
+---
+title: ImageViewer 图片预览
+description: 图片全屏放大预览效果,包含全屏背景色、页码位置样式、增加操作等规范。
+spline: data
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.10.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-image-viewer": "tdesign-miniprogram/image-viewer/image-viewer",
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 类型
+
+#### 基础图片预览
+
+{{ base }}
+
+#### 带操作图片预览
+
+顶部区域可以配置关闭按钮、页码信息、删除按钮。
+
+{{ delete }}
+
+> 当使用自定义导航栏的时候,顶部的操作按钮会被遮挡,此时需要开启 `using-custom-navbar` 来解决
+
+## API
+
+### ImageViewer Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+background-color | String | 'rgba(0, 0, 0, 1)' | 遮罩的背景颜色 | N
+close-btn | String / Boolean / Object / Slot | false | 是否显示关闭操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `close`,值为 `Object` 类型,表示透传至 `icon` ,不传表示不显示图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+delete-btn | String / Boolean / Object / Slot | false | 是否显示删除操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `delete`,值为 `Object` 类型,表示透传至 `icon`,不传表示不显示图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+images | Array | [] | 图片数组。TS 类型:`Array` | N
+initial-index | Number | 0 | 初始化页码。TS 类型:`Number` | N
+show-index | Boolean | false | 是否显示页码 | N
+using-custom-navbar | Boolean | false | `v1.1.4`。是否使用了自定义导航栏 | N
+visible | Boolean | false | 隐藏/显示预览 | N
+default-visible | Boolean | undefined | 隐藏/显示预览。非受控属性 | N
+
+### ImageViewer Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(index: Number)` | 翻页时回调
+close | `(trigger: 'overlay' \| 'button', visible: Boolean, index: Number)` | 点击操作按钮button或者overlay时触发
+delete | `(index: Number)` | 点击删除操作按钮时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-image-viewer-close-margin-left | @spacer-1 | -
+--td-image-viewer-delete-margin-right | @spacer-1 | -
+--td-image-viewer-nav-bg-color | @font-gray-3 | -
+--td-image-viewer-nav-color | @font-white-1 | -
+--td-image-viewer-nav-height | 96rpx | -
+--td-image-viewer-nav-index-font-size | @font-size-base | -
+--td-image-viewer-top | @position-fixed-top | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.d.ts b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.d.ts
new file mode 100644
index 0000000..ee40827
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.d.ts
@@ -0,0 +1,88 @@
+import { SuperComponent } from '../common/src/index';
+export default class ImageViewer extends SuperComponent {
+ externalClasses: string[];
+ properties: {
+ backgroundColor?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ closeBtn?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ deleteBtn?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ images?: {
+ type: ArrayConstructor;
+ value?: string[];
+ };
+ initialIndex?: {
+ type: NumberConstructor;
+ value?: Number;
+ };
+ showIndex?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultVisible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ currentSwiperIndex: number;
+ windowHeight: number;
+ windowWidth: number;
+ swiperStyle: {};
+ imagesStyle: {};
+ maskTop: number;
+ };
+ options: {
+ multipleSlots: boolean;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ ready(): void;
+ observers: {
+ 'visible,initialIndex,images'(visible: any, initialIndex: any, images: any): void;
+ closeBtn(v: any): void;
+ deleteBtn(v: any): void;
+ };
+ methods: {
+ calcMaskTop(): void;
+ saveScreenSize(): void;
+ calcImageDisplayStyle(imageWidth: any, imageHeight: any): {
+ styleObj: {
+ width: string;
+ height: string;
+ left: string;
+ transform: string;
+ };
+ } | {
+ styleObj: {
+ width: string;
+ height: string;
+ left?: undefined;
+ transform?: undefined;
+ };
+ };
+ onImageLoadSuccess(e: WechatMiniprogram.TouchEvent): void;
+ onSwiperChange(e: WechatMiniprogram.TouchEvent): void;
+ onClose(e: any): void;
+ onDelete(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.js b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.js
new file mode 100644
index 0000000..2f874c3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.js
@@ -0,0 +1,153 @@
+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 { styles, calcIcon, systemInfo } from '../common/utils';
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-image-viewer`;
+let ImageViewer = class ImageViewer extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = Object.assign({}, props);
+ this.data = {
+ prefix,
+ classPrefix: name,
+ currentSwiperIndex: 0,
+ windowHeight: 0,
+ windowWidth: 0,
+ swiperStyle: {},
+ imagesStyle: {},
+ maskTop: 0,
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.controlledProps = [
+ {
+ key: 'visible',
+ event: 'close',
+ },
+ ];
+ this.observers = {
+ 'visible,initialIndex,images'(visible, initialIndex, images) {
+ if (visible && (images === null || images === void 0 ? void 0 : images.length)) {
+ this.setData({
+ currentSwiperIndex: initialIndex >= images.length ? images.length - 1 : initialIndex,
+ });
+ }
+ },
+ closeBtn(v) {
+ this.setData({
+ _closeBtn: calcIcon(v, 'close'),
+ });
+ },
+ deleteBtn(v) {
+ this.setData({
+ _deleteBtn: calcIcon(v, 'delete'),
+ });
+ },
+ };
+ this.methods = {
+ calcMaskTop() {
+ if (this.data.usingCustomNavbar) {
+ const rect = (wx === null || wx === void 0 ? void 0 : wx.getMenuButtonBoundingClientRect()) || null;
+ const { statusBarHeight } = systemInfo;
+ if (rect && statusBarHeight) {
+ this.setData({
+ maskTop: rect.top - statusBarHeight + rect.bottom,
+ });
+ }
+ }
+ },
+ saveScreenSize() {
+ const { windowHeight, windowWidth } = systemInfo;
+ this.setData({
+ windowHeight,
+ windowWidth,
+ });
+ },
+ calcImageDisplayStyle(imageWidth, imageHeight) {
+ const { windowWidth, windowHeight } = this.data;
+ const ratio = imageWidth / imageHeight;
+ if (imageWidth < windowWidth && imageHeight < windowHeight) {
+ return {
+ styleObj: {
+ width: `${imageWidth * 2}rpx`,
+ height: `${imageHeight * 2}rpx`,
+ left: '50%',
+ transform: 'translate(-50%, -50%)',
+ },
+ };
+ }
+ if (ratio >= 1) {
+ return {
+ styleObj: {
+ width: '100vw',
+ height: `${(windowWidth / ratio) * 2}rpx`,
+ },
+ };
+ }
+ const scaledHeight = ratio * windowHeight * 2;
+ if (scaledHeight < windowWidth) {
+ return {
+ styleObj: {
+ width: `${scaledHeight}rpx`,
+ height: '100vh',
+ left: '50%',
+ transform: 'translate(-50%, -50%)',
+ },
+ };
+ }
+ return {
+ styleObj: {
+ width: '100vw',
+ height: `${(windowWidth / imageWidth) * imageHeight * 2}rpx`,
+ },
+ };
+ },
+ onImageLoadSuccess(e) {
+ const { detail: { width, height }, currentTarget: { dataset: { index }, }, } = e;
+ const { mode, styleObj } = this.calcImageDisplayStyle(width, height);
+ const originImagesStyle = this.data.imagesStyle;
+ const originSwiperStyle = this.data.swiperStyle;
+ this.setData({
+ swiperStyle: Object.assign(Object.assign({}, originSwiperStyle), { [index]: {
+ style: `height: ${styleObj.height}`,
+ } }),
+ imagesStyle: Object.assign(Object.assign({}, originImagesStyle), { [index]: {
+ mode,
+ style: styles(Object.assign({}, styleObj)),
+ } }),
+ });
+ },
+ onSwiperChange(e) {
+ const { detail: { current }, } = e;
+ this.setData({
+ currentSwiperIndex: current,
+ });
+ this._trigger('change', { index: current });
+ },
+ onClose(e) {
+ const { source } = e.currentTarget.dataset;
+ this._trigger('close', { visible: false, trigger: source || 'button', index: this.data.currentSwiperIndex });
+ },
+ onDelete() {
+ this._trigger('delete', { index: this.data.currentSwiperIndex });
+ },
+ };
+ }
+ ready() {
+ this.saveScreenSize();
+ this.calcMaskTop();
+ }
+};
+ImageViewer = __decorate([
+ wxComponent()
+], ImageViewer);
+export default ImageViewer;
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.json b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.json
new file mode 100644
index 0000000..10c8fc0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-image": "../image/image",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.wxml b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.wxml
new file mode 100644
index 0000000..ea639a3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.wxml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{currentSwiperIndex + 1}}/{{images.length}}
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.wxss b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.wxss
new file mode 100644
index 0000000..6170c25
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/image-viewer.wxss
@@ -0,0 +1,101 @@
+.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-viewer {
+ position: fixed;
+ top: var(--td-image-viewer-top, var(--td-position-fixed-top, 0));
+ left: 0;
+ bottom: 0;
+ right: 0;
+ z-index: 1001;
+ transform: translateZ(0);
+ overflow: hidden;
+}
+.t-image-viewer__mask {
+ position: absolute;
+ z-index: 1000;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
+.t-image-viewer__content {
+ width: 100vw;
+ display: inline-block;
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+ z-index: 1005;
+}
+.t-image-viewer .swiper {
+ outline: 0;
+}
+.t-image-viewer__image {
+ width: 100%;
+ display: inline-block;
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-image-viewer .t-image--external {
+ width: inherit;
+ height: inherit;
+ display: block;
+}
+.t-image-viewer__nav {
+ width: 100%;
+ position: absolute;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: var(--td-image-viewer-nav-height, 96rpx);
+ background-color: var(--td-image-viewer-nav-bg-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+ left: 0;
+ color: var(--td-image-viewer-nav-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ z-index: 1005;
+}
+.t-image-viewer__nav-close {
+ margin-left: var(--td-image-viewer-close-margin-left, var(--td-spacer-1, 24rpx));
+}
+.t-image-viewer__nav-close:empty {
+ display: none;
+}
+.t-image-viewer__nav-delete {
+ margin-right: var(--td-image-viewer-delete-margin-right, var(--td-spacer-1, 24rpx));
+}
+.t-image-viewer__nav-delete:empty {
+ display: none;
+}
+.t-image-viewer__nav-close,
+.t-image-viewer__nav-delete {
+ font-size: 48rpx;
+}
+.t-image-viewer__nav-index {
+ flex: 1;
+ font-size: var(--td-image-viewer-nav-index-font-size, var(--td-font-size-base, 28rpx));
+ text-align: center;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/props.d.ts b/miniprogram_npm/tdesign-miniprogram/image-viewer/props.d.ts
new file mode 100644
index 0000000..9fec1e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/props.d.ts
@@ -0,0 +1,3 @@
+import { TdImageViewerProps } from './type';
+declare const props: TdImageViewerProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/props.js b/miniprogram_npm/tdesign-miniprogram/image-viewer/props.js
new file mode 100644
index 0000000..b329aa5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/props.js
@@ -0,0 +1,39 @@
+const props = {
+ backgroundColor: {
+ type: String,
+ value: 'rgba(0, 0, 0, 1)',
+ },
+ closeBtn: {
+ type: null,
+ value: false,
+ },
+ deleteBtn: {
+ type: null,
+ value: false,
+ },
+ images: {
+ type: Array,
+ value: [],
+ },
+ initialIndex: {
+ type: Number,
+ value: 0,
+ },
+ showIndex: {
+ type: Boolean,
+ value: false,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ visible: {
+ type: Boolean,
+ value: null,
+ },
+ defaultVisible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/type.d.ts b/miniprogram_npm/tdesign-miniprogram/image-viewer/type.d.ts
new file mode 100644
index 0000000..b60a275
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/type.d.ts
@@ -0,0 +1,38 @@
+export interface TdImageViewerProps {
+ backgroundColor?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ closeBtn?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ deleteBtn?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ images?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ initialIndex?: {
+ type: NumberConstructor;
+ value?: Number;
+ };
+ showIndex?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultVisible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image-viewer/type.js b/miniprogram_npm/tdesign-miniprogram/image-viewer/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image-viewer/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/image/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/image/README.en-US.md
new file mode 100644
index 0000000..46e7da9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/README.en-US.md
@@ -0,0 +1,46 @@
+:: 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_npm/tdesign-miniprogram/image/README.md b/miniprogram_npm/tdesign-miniprogram/image/README.md
new file mode 100644
index 0000000..55be345
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/README.md
@@ -0,0 +1,91 @@
+---
+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_npm/tdesign-miniprogram/image/image-info.json b/miniprogram_npm/tdesign-miniprogram/image/image-info.json
new file mode 100644
index 0000000..7157c4c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image-info.json
@@ -0,0 +1,75 @@
+{
+ "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_npm/tdesign-miniprogram/image/image.d.ts b/miniprogram_npm/tdesign-miniprogram/image/image.d.ts
new file mode 100644
index 0000000..36dc635
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.d.ts
@@ -0,0 +1,26 @@
+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: any;
+ 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_npm/tdesign-miniprogram/image/image.js b/miniprogram_npm/tdesign-miniprogram/image/image.js
new file mode 100644
index 0000000..61cf6fd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.js
@@ -0,0 +1,97 @@
+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 = undefined;
+ 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_npm/tdesign-miniprogram/image/image.json b/miniprogram_npm/tdesign-miniprogram/image/image.json
new file mode 100644
index 0000000..1c9137b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-loading": "../loading/loading",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.wxml b/miniprogram_npm/tdesign-miniprogram/image/image.wxml
new file mode 100644
index 0000000..be3b850
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.wxml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ {{loading}}
+
+
+
+
+
+
+
+
+
+ {{error}}
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.wxss b/miniprogram_npm/tdesign-miniprogram/image/image.wxss
new file mode 100644
index 0000000..7d550a0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.wxss
@@ -0,0 +1,71 @@
+.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_npm/tdesign-miniprogram/image/index.d.ts b/miniprogram_npm/tdesign-miniprogram/image/index.d.ts
new file mode 100644
index 0000000..0f85c43
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/index.d.ts
@@ -0,0 +1,4 @@
+import { TdImageProps } from './type';
+export declare type ImageProps = TdImageProps;
+export * from './props';
+export * from './image';
diff --git a/miniprogram_npm/tdesign-miniprogram/image/index.js b/miniprogram_npm/tdesign-miniprogram/image/index.js
new file mode 100644
index 0000000..4fd3953
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/index.js
@@ -0,0 +1,2 @@
+export * from './props';
+export * from './image';
diff --git a/miniprogram_npm/tdesign-miniprogram/image/props.d.ts b/miniprogram_npm/tdesign-miniprogram/image/props.d.ts
new file mode 100644
index 0000000..0ab571b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/props.d.ts
@@ -0,0 +1,3 @@
+import { TdImageProps } from './type';
+declare const props: TdImageProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/image/props.js b/miniprogram_npm/tdesign-miniprogram/image/props.js
new file mode 100644
index 0000000..b2a17da
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/props.js
@@ -0,0 +1,45 @@
+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_npm/tdesign-miniprogram/image/type.d.ts b/miniprogram_npm/tdesign-miniprogram/image/type.d.ts
new file mode 100644
index 0000000..4279319
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/type.d.ts
@@ -0,0 +1,46 @@
+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_npm/tdesign-miniprogram/image/type.js b/miniprogram_npm/tdesign-miniprogram/image/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/index.d.ts b/miniprogram_npm/tdesign-miniprogram/index.d.ts
new file mode 100644
index 0000000..9af8cc5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/index.d.ts
@@ -0,0 +1,4 @@
+export { default as ActionSheet, ActionSheetTheme } from './action-sheet/index';
+export { default as Dialog } from './dialog/index';
+export { default as Message } from './message/index';
+export { default as Toast } from './toast/index';
diff --git a/miniprogram_npm/tdesign-miniprogram/index.js b/miniprogram_npm/tdesign-miniprogram/index.js
new file mode 100644
index 0000000..9af8cc5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/index.js
@@ -0,0 +1,4 @@
+export { default as ActionSheet, ActionSheetTheme } from './action-sheet/index';
+export { default as Dialog } from './dialog/index';
+export { default as Message } from './message/index';
+export { default as Toast } from './toast/index';
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/README.en-US.md
new file mode 100644
index 0000000..6cac63c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/README.en-US.md
@@ -0,0 +1,9 @@
+:: BASE_DOC ::
+
+## API
+### IndexesAnchor Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+external-classes | Array | - | `['t-class']` | N
+index | String / Number | - | \- | N
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/README.md b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/README.md
new file mode 100644
index 0000000..43a5deb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/README.md
@@ -0,0 +1,13 @@
+:: BASE_DOC ::
+
+## API
+### IndexesAnchor Props
+
+名称 | 类型 | 默认值 | 说明 | 必传
+-- | -- | -- | -- | --
+index | String / Number | - | 索引字符 | N
+
+### IndexesAnchor 外部样式类
+类名 | 说明
+-- | --
+t-class | 根节点样式类
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.d.ts b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.d.ts
new file mode 100644
index 0000000..62d07a1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.d.ts
@@ -0,0 +1,13 @@
+import { RelationsOptions, SuperComponent } from '../common/src/index';
+export default class IndexesAnchor extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdIndexesAnchorProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ anchorStyle: string;
+ sticky: boolean;
+ active: boolean;
+ };
+ relations: RelationsOptions;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.js b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.js
new file mode 100644
index 0000000..704f5cb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.js
@@ -0,0 +1,34 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-indexes-anchor`;
+let IndexesAnchor = class IndexesAnchor extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ anchorStyle: '',
+ sticky: false,
+ active: false,
+ };
+ this.relations = {
+ '../indexes/indexes': {
+ type: 'parent',
+ },
+ };
+ }
+};
+IndexesAnchor = __decorate([
+ wxComponent()
+], IndexesAnchor);
+export default IndexesAnchor;
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.json b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.json
new file mode 100644
index 0000000..79f2730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared"
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.wxml b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.wxml
new file mode 100644
index 0000000..bbe6d8e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.wxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.wxss b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.wxss
new file mode 100644
index 0000000..4541456
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/indexes-anchor.wxss
@@ -0,0 +1,77 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-indexes-anchor {
+ color: var(--td-indexes-anchor-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-indexes-anchor-font-size, 28rpx);
+ line-height: var(--td-indexes-anchor-line-height, 44rpx);
+}
+.t-indexes-anchor__header {
+ display: none;
+ padding: 8rpx 32rpx;
+ background-color: var(--td-indexes-anchor-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-indexes-anchor__header--active {
+ background-color: var(--td-indexes-anchor-active-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ position: relative;
+}
+.t-indexes-anchor__header--active::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-component-border, var(--td-gray-color-4, #dcdcdc));
+}
+.t-indexes-anchor__header--active::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-indexes-anchor__slot {
+ overflow: hidden;
+}
+.t-indexes-anchor__slot:empty + .t-indexes-anchor__header {
+ display: block;
+}
+.t-indexes-anchor__wrapper {
+ will-change: transform;
+}
+.t-indexes-anchor__wrapper--sticky {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 1;
+}
+.t-indexes-anchor__wrapper--active {
+ color: var(--td-indexes-anchor-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-weight: var(--td-indexes-anchor-active-font-weight, 600);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/props.d.ts b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/props.d.ts
new file mode 100644
index 0000000..7b52adf
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/props.d.ts
@@ -0,0 +1,3 @@
+import { TdIndexesAnchorProps } from './type';
+declare const props: TdIndexesAnchorProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/props.js b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/props.js
new file mode 100644
index 0000000..0f7a053
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/props.js
@@ -0,0 +1,6 @@
+const props = {
+ index: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/type.d.ts b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/type.d.ts
new file mode 100644
index 0000000..1e7fe4c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/type.d.ts
@@ -0,0 +1,6 @@
+export interface TdIndexesAnchorProps {
+ index?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes-anchor/type.js b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes-anchor/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/indexes/README.en-US.md
new file mode 100644
index 0000000..9aa9137
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/README.en-US.md
@@ -0,0 +1,62 @@
+:: BASE_DOC ::
+
+## API
+
+### Indexes 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
+index-list | Array | - | `0.32.0`。Typescript:`string [] \| number[]` | N
+list | Array | [] | `deprecated`。Typescript:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/indexes/type.ts) | N
+sticky | Boolean | true | Typescript:`Boolean` | N
+sticky-offset | Number | 0 | `1.0.0` | N
+
+### Indexes Events
+
+name | params | description
+-- | -- | --
+change | `(index: string \| number)` | `0.34.0`
+select | `(index: string \| number)` | \-
+
+
+### IndexesAnchor 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
+index | String / Number | - | \- | N
+### IndexesAnchor External Classes
+
+className | Description
+-- | --
+t-class | class name of root node
+t-class-sidebar | \-
+t-class-sidebar-item | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-indexes-sidebar-active-bg-color | @brand-color | -
+--td-indexes-sidebar-active-color | @font-white-1 | -
+--td-indexes-sidebar-color | @font-gray-1 | -
+--td-indexes-sidebar-font-size | 24rpx | -
+--td-indexes-sidebar-item-size | 40rpx | -
+--td-indexes-sidebar-line-height | 40rpx | -
+--td-indexes-sidebar-right | 16rpx | -
+--td-indexes-sidebar-tips-bg-color | @brand-color-light | -
+--td-indexes-sidebar-tips-color | @brand-color | -
+--td-indexes-sidebar-tips-font-size | 40rpx | -
+--td-indexes-sidebar-tips-right | calc(100% + 32rpx) | -
+--td-indexes-sidebar-tips-size | 96rpx | -
+--td-indexes-anchor-active-bg-color | @bg-color-container | -
+--td-indexes-anchor-active-color | @brand-color | -
+--td-indexes-anchor-active-font-weight | 600 | -
+--td-indexes-anchor-bg-color | @bg-color-secondarycontainer | -
+--td-indexes-anchor-color | @font-gray-1 | -
+--td-indexes-anchor-font-size | 28rpx | -
+--td-indexes-anchor-line-height | 44rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/README.md b/miniprogram_npm/tdesign-miniprogram/indexes/README.md
new file mode 100644
index 0000000..9ddfa1c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/README.md
@@ -0,0 +1,105 @@
+---
+title: Indexes 索引
+description: 用于页面中信息快速检索,可以根据目录中的页码快速找到所需的内容。
+spline: navigation
+isComponent: true
+---
+
+


+
+
+
+ IndexesAnchor 索引锚点组件于 0.32.0 版本上线,请留意版本。
+
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-indexes": "tdesign-miniprogram/indexes/indexes",
+ "t-indexes-anchor": "tdesign-miniprogram/indexes-anchor/indexes-anchor"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础索引
+
+
+{{ base }}
+
+### 自定义索引
+
+{{ custom }}
+
+### API
+
+### Indexes Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+index-list | Array | - | `0.32.0`。索引字符列表。不传默认 `A-Z`。TS 类型:`string [] \| number[]` | N
+list | Array | [] | 已废弃。索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。TS 类型:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/indexes/type.ts) | N
+sticky | Boolean | true | 索引是否吸顶,默认为true。TS 类型:`Boolean` | N
+sticky-offset | Number | 0 | `1.0.0`。锚点吸顶时与顶部的距离 | N
+
+### Indexes Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(index: string \| number)` | `0.34.0`。索引发生变更时触发事件
+select | `(index: string \| number)` | 点击侧边栏时触发事件
+
+
+### IndexesAnchor Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+index | String / Number | - | 索引字符 | N
+### IndexesAnchor External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-sidebar | 侧边栏样式类
+t-class-sidebar-item | 侧边栏选项样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-indexes-sidebar-active-bg-color | @brand-color | -
+--td-indexes-sidebar-active-color | @font-white-1 | -
+--td-indexes-sidebar-color | @font-gray-1 | -
+--td-indexes-sidebar-font-size | 24rpx | -
+--td-indexes-sidebar-item-size | 40rpx | -
+--td-indexes-sidebar-line-height | 40rpx | -
+--td-indexes-sidebar-right | 16rpx | -
+--td-indexes-sidebar-tips-bg-color | @brand-color-light | -
+--td-indexes-sidebar-tips-color | @brand-color | -
+--td-indexes-sidebar-tips-font-size | 40rpx | -
+--td-indexes-sidebar-tips-right | calc(100% + 32rpx) | -
+--td-indexes-sidebar-tips-size | 96rpx | -
+--td-indexes-anchor-active-bg-color | @bg-color-container | -
+--td-indexes-anchor-active-color | @brand-color | -
+--td-indexes-anchor-active-font-weight | 600 | -
+--td-indexes-anchor-bg-color | @bg-color-secondarycontainer | -
+--td-indexes-anchor-color | @font-gray-1 | -
+--td-indexes-anchor-font-size | 28rpx | -
+--td-indexes-anchor-line-height | 44rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/indexes.d.ts b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.d.ts
new file mode 100644
index 0000000..0071d19
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.d.ts
@@ -0,0 +1,45 @@
+import { RelationsOptions, SuperComponent } from '../common/src/index';
+export default class Indexes extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdIndexesProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ _height: number;
+ _indexList: any[];
+ scrollTop: number;
+ activeAnchor: any;
+ showTips: boolean;
+ };
+ relations: RelationsOptions;
+ behaviors: string[];
+ timer: any;
+ groupTop: any[];
+ sidebar: any;
+ currentTouchAnchor: any;
+ observers: {
+ indexList(v: any): void;
+ height(v: any): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ setHeight(height: string | number): void;
+ setIndexList(list: any): void;
+ getAllRect(): void;
+ getAnchorsRect(): Promise;
+ getSidebarRect(): void;
+ toggleTips(flag: boolean): void;
+ setAnchorByIndex(index: any): void;
+ onClick(e: any): void;
+ onTouchMove(e: any): void;
+ onTouchCancel(): void;
+ onTouchEnd(e: any): void;
+ onAnchorTouch: (...args: any[]) => void;
+ setAnchorOnScroll(scrollTop: number): void;
+ onScroll({ scrollTop }: {
+ scrollTop: any;
+ }): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/indexes.js b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.js
new file mode 100644
index 0000000..aad4eeb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.js
@@ -0,0 +1,236 @@
+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 { getRect, throttle, systemInfo } from '../common/utils';
+import pageScrollMixin from '../mixins/page-scroll';
+const { prefix } = config;
+const name = `${prefix}-indexes`;
+let Indexes = class Indexes extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-sidebar`, `${prefix}-class-sidebar-item`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ _height: 0,
+ _indexList: [],
+ scrollTop: 0,
+ activeAnchor: null,
+ showTips: false,
+ };
+ this.relations = {
+ '../indexes-anchor/indexes-anchor': {
+ type: 'child',
+ },
+ };
+ this.behaviors = [pageScrollMixin()];
+ this.timer = null;
+ this.groupTop = [];
+ this.sidebar = null;
+ this.currentTouchAnchor = null;
+ this.observers = {
+ indexList(v) {
+ this.setIndexList(v);
+ this.setHeight(this.data._height);
+ },
+ height(v) {
+ this.setHeight(v);
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.timer = null;
+ this.groupTop = [];
+ this.sidebar = null;
+ if (this.data._height === 0) {
+ this.setHeight();
+ }
+ if (this.data.indexList === null) {
+ this.setIndexList();
+ }
+ },
+ };
+ this.methods = {
+ setHeight(height) {
+ if (!height) {
+ const { windowHeight } = systemInfo;
+ height = windowHeight;
+ }
+ this.setData({
+ _height: height,
+ }, () => {
+ this.getAllRect();
+ });
+ },
+ setIndexList(list) {
+ if (!list) {
+ const start = 'A'.charCodeAt(0);
+ const alphabet = [];
+ for (let i = start, end = start + 26; i < end; i += 1) {
+ alphabet.push(String.fromCharCode(i));
+ }
+ this.setData({ _indexList: alphabet });
+ }
+ else {
+ this.setData({ _indexList: list });
+ }
+ },
+ getAllRect() {
+ this.getAnchorsRect().then(() => {
+ this.groupTop.forEach((item, index) => {
+ const next = this.groupTop[index + 1];
+ item.totalHeight = ((next === null || next === void 0 ? void 0 : next.top) || Infinity) - item.top;
+ });
+ this.setAnchorOnScroll(0);
+ });
+ this.getSidebarRect();
+ },
+ getAnchorsRect() {
+ return Promise.all(this.$children.map((child) => getRect(child, `.${name}-anchor`).then((rect) => {
+ this.groupTop.push({
+ height: rect.height,
+ top: rect.top,
+ anchor: child.data.index,
+ });
+ })));
+ },
+ getSidebarRect() {
+ getRect(this, `#id-${name}__bar`).then((rect) => {
+ const { top, height } = rect;
+ const { length } = this.data._indexList;
+ this.sidebar = {
+ top,
+ height,
+ itemHeight: (height - (length - 1) * 2) / length,
+ };
+ });
+ },
+ toggleTips(flag) {
+ if (!flag) {
+ clearInterval(this.timer);
+ this.timer = setTimeout(() => {
+ this.setData({
+ showTips: false,
+ });
+ }, 300);
+ }
+ else {
+ this.setData({
+ showTips: true,
+ });
+ }
+ },
+ setAnchorByIndex(index) {
+ const { _indexList, stickyOffset } = this.data;
+ const activeAnchor = _indexList[index];
+ if (this.data.activeAnchor !== null && this.data.activeAnchor === activeAnchor)
+ return;
+ const target = this.groupTop.find((item) => item.anchor === activeAnchor);
+ if (target) {
+ this.currentTouchAnchor = activeAnchor;
+ const scrollTop = target.top - stickyOffset;
+ wx.pageScrollTo({
+ scrollTop,
+ duration: 0,
+ });
+ this.toggleTips(true);
+ this.triggerEvent('select', { index: activeAnchor });
+ this.setData({ activeAnchor });
+ }
+ },
+ onClick(e) {
+ const { index } = e.currentTarget.dataset;
+ this.setAnchorByIndex(index);
+ },
+ onTouchMove(e) {
+ this.onAnchorTouch(e);
+ },
+ onTouchCancel() {
+ this.toggleTips(false);
+ },
+ onTouchEnd(e) {
+ this.toggleTips(false);
+ this.onAnchorTouch(e);
+ },
+ onAnchorTouch: throttle(function (e) {
+ const getAnchorIndex = (clientY) => {
+ const offsetY = clientY - this.sidebar.top;
+ if (offsetY <= 0) {
+ return 0;
+ }
+ if (offsetY > this.sidebar.height) {
+ return this.data._indexList.length - 1;
+ }
+ return Math.floor(offsetY / this.sidebar.itemHeight);
+ };
+ const index = getAnchorIndex(e.changedTouches[0].clientY);
+ this.setAnchorByIndex(index);
+ }, 1000 / 30),
+ setAnchorOnScroll(scrollTop) {
+ if (!this.groupTop) {
+ return;
+ }
+ const { sticky, stickyOffset, activeAnchor } = this.data;
+ scrollTop += stickyOffset;
+ const curIndex = this.groupTop.findIndex((group) => scrollTop >= group.top - group.height && scrollTop <= group.top + group.totalHeight - group.height);
+ if (curIndex === -1)
+ return;
+ const curGroup = this.groupTop[curIndex];
+ if (this.currentTouchAnchor !== null) {
+ this.triggerEvent('change', { index: curGroup.anchor });
+ this.currentTouchAnchor = null;
+ }
+ else if (activeAnchor !== curGroup.anchor) {
+ this.triggerEvent('change', { index: curGroup.anchor });
+ this.setData({ activeAnchor: curGroup.anchor });
+ }
+ if (sticky) {
+ const offset = curGroup.top - scrollTop;
+ const betwixt = offset < curGroup.height && offset > 0 && scrollTop > stickyOffset;
+ this.$children.forEach((child, index) => {
+ if (index === curIndex) {
+ const sticky = scrollTop > stickyOffset;
+ const anchorStyle = `transform: translate3d(0, ${betwixt ? offset : 0}px, 0); top: ${stickyOffset}px`;
+ if (anchorStyle !== child.data.anchorStyle || sticky !== child.data.sticky) {
+ child.setData({
+ sticky,
+ active: true,
+ style: `height: ${curGroup.height}px`,
+ anchorStyle,
+ });
+ }
+ }
+ else if (index + 1 === curIndex) {
+ const anchorStyle = `transform: translate3d(0, ${betwixt ? offset - curGroup.height : 0}px, 0); top: ${stickyOffset}px`;
+ if (anchorStyle !== child.data.anchorStyle) {
+ child.setData({
+ sticky: true,
+ active: true,
+ style: `height: ${curGroup.height}px`,
+ anchorStyle,
+ });
+ }
+ }
+ else {
+ child.setData({ active: false, sticky: false, anchorStyle: '' });
+ }
+ });
+ }
+ },
+ onScroll({ scrollTop }) {
+ this.setAnchorOnScroll(scrollTop);
+ },
+ };
+ }
+};
+Indexes = __decorate([
+ wxComponent()
+], Indexes);
+export default Indexes;
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/indexes.json b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.json
new file mode 100644
index 0000000..4ae6508
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-cell": "../cell/cell",
+ "t-cell-group": "../cell-group/cell-group"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxml b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxml
new file mode 100644
index 0000000..e2e60b8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxs b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxs
new file mode 100644
index 0000000..e8bbe2b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxs
@@ -0,0 +1,7 @@
+function getFirstCharacter(str) {
+ return str.toString().substring(0, 1);
+}
+
+module.exports = {
+ getFirstCharacter: getFirstCharacter,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxss b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxss
new file mode 100644
index 0000000..a723a73
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/indexes.wxss
@@ -0,0 +1,78 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-indexes {
+ position: relative;
+ height: 100vh;
+}
+.t-indexes__sidebar {
+ position: fixed;
+ right: var(--td-indexes-sidebar-right, 16rpx);
+ width: var(--td-indexes-sidebar-item-size, 40rpx);
+ color: var(--td-indexes-sidebar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-indexes-sidebar-font-size, 24rpx);
+ line-height: var(--td-indexes-sidebar-line-height, 40rpx);
+ display: flex;
+ flex-flow: column nowrap;
+ top: 50%;
+ transform: translateY(-50%);
+ z-index: 1;
+}
+.t-indexes__sidebar-item {
+ border-radius: 50%;
+ position: relative;
+ text-align: center;
+}
+.t-indexes__sidebar-item--active {
+ background-color: var(--td-indexes-sidebar-active-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ color: var(--td-indexes-sidebar-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-indexes__sidebar-item + .t-indexes__sidebar-item {
+ margin-top: 4rpx;
+}
+.t-indexes__sidebar-tips {
+ min-width: var(--td-indexes-sidebar-tips-size, 96rpx);
+ max-width: 198rpx;
+ padding: 0 32rpx;
+ box-sizing: border-box;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ height: var(--td-indexes-sidebar-tips-size, 96rpx);
+ line-height: var(--td-indexes-sidebar-tips-size, 96rpx);
+ text-align: center;
+ font-size: var(--td-indexes-sidebar-tips-font-size, 40rpx);
+ font-weight: 700;
+ color: var(--td-indexes-sidebar-tips-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-indexes-sidebar-tips-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+ border-radius: var(--td-indexes-sidebar-tips-size, 96rpx);
+ position: absolute;
+ top: 50%;
+ bottom: 0;
+ transform: translateY(-50%);
+ right: var(--td-indexes-sidebar-tips-right, calc(100% + 32rpx));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/props.d.ts b/miniprogram_npm/tdesign-miniprogram/indexes/props.d.ts
new file mode 100644
index 0000000..a3e1619
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/props.d.ts
@@ -0,0 +1,3 @@
+import { TdIndexesProps } from './type';
+declare const props: TdIndexesProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/props.js b/miniprogram_npm/tdesign-miniprogram/indexes/props.js
new file mode 100644
index 0000000..2ad93ee
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/props.js
@@ -0,0 +1,14 @@
+const props = {
+ indexList: {
+ type: null,
+ },
+ sticky: {
+ type: Boolean,
+ value: true,
+ },
+ stickyOffset: {
+ type: Number,
+ value: 0,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/type.d.ts b/miniprogram_npm/tdesign-miniprogram/indexes/type.d.ts
new file mode 100644
index 0000000..ecf0242
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/type.d.ts
@@ -0,0 +1,14 @@
+export interface TdIndexesProps {
+ indexList?: {
+ type: null;
+ value?: string[] | number[];
+ };
+ sticky?: {
+ type: BooleanConstructor;
+ value?: Boolean;
+ };
+ stickyOffset?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/indexes/type.js b/miniprogram_npm/tdesign-miniprogram/indexes/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/indexes/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/input/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/input/README.en-US.md
new file mode 100644
index 0000000..e9f0d2b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/README.en-US.md
@@ -0,0 +1,110 @@
+:: BASE_DOC ::
+
+## API
+
+### Input 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
+adjust-position | Boolean | true | \- | N
+align | String | left | text align type。options: left/center/right | N
+allow-input-over-max | Boolean | false | allow to continue input on value length is over `maxlength` or `maxcharacter` | N
+always-embed | Boolean | false | \- | N
+auto-focus | Boolean | false | \- | N
+borderless | Boolean | false | input without border | N
+clear-trigger | String | always | show clear icon, clicked to clear input value。options: always / focus | N
+clearable | Boolean / Object | false | show clear icon, clicked to clear input value | N
+confirm-hold | Boolean | false | \- | N
+confirm-type | String | done | options: send/search/next/go/done | N
+cursor | Number | - | required | Y
+cursor-color | String | #0052d9 | \- | N
+cursor-spacing | Number | 0 | \- | N
+disabled | Boolean | undefined | make input to be disabled | N
+error-message | String | - | `deprecated` | N
+focus | Boolean | false | \- | N
+format | Function | - | input value formatter, `type=number` does not work. if you need to format number, `InputNumber` Component might be better。Typescript:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
+hold-keyboard | Boolean | false | \- | N
+label | String / Slot | - | text on the left of input。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+layout | String | horizontal | options: vertical/horizontal | N
+maxcharacter | Number | - | \- | N
+maxlength | Number | -1 | \- | N
+password | Boolean | false | `deprecated` | N
+placeholder | String | undefined | \- | N
+placeholder-class | String | input-placeholder | \- | N
+placeholder-style | String | - | required | Y
+prefix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+readonly | Boolean | undefined | \- | N
+safe-password-cert-path | String | - | \- | N
+safe-password-custom-hash | String | - | \- | N
+safe-password-length | Number | - | \- | N
+safe-password-nonce | String | - | \- | N
+safe-password-salt | String | - | \- | N
+safe-password-time-stamp | Number | - | \- | N
+selection-end | Number | -1 | \- | N
+selection-start | Number | -1 | \- | N
+size | String | medium | `deprecated`。options: small/medium。Typescript:`'medium' \| 'small'` | N
+status | String | default | options: default/success/warning/error | N
+suffix | String / Slot | - | suffix content before suffixIcon。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+suffix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+tips | String / Slot | - | tips on the bottom of input, different `status` can make tips to be different color。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+type | String | text | options: text/number/idcard/digit/safe-password/password/nickname | N
+value | String / Number | - | input value。Typescript:`InputValue` `type InputValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
+default-value | String / Number | undefined | input value。uncontrolled property。Typescript:`InputValue` `type InputValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
+
+### Input Events
+
+name | params | description
+-- | -- | --
+blur | `(value: InputValue)` | \-
+change | `(value: InputValue, cursor: number, keyCode: number)` | \-
+clear | \- | \-
+click | `(trigger: InputTrigger)` | `0.32.0`
+enter | `(value: InputValue)` | \-
+focus | `(value: InputValue)` | \-
+keyboardheightchange | `(height: number, duration: number)` | \-
+nicknamereview | `(pass: boolean, timeout: boolean)` | \-
+validate | `(detail: { error?: 'exceed-maximum' \| 'below-minimum' })` | trigger on text length being over max length or max character
+
+### Input External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-clearable | \-
+t-class-input | \-
+t-class-label | \-
+t-class-prefix-icon | \-
+t-class-suffix | \-
+t-class-suffix-icon | \-
+t-class-tips | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-input-align-items | center | -
+--td-input-bg-color | @bg-color-container | -
+--td-input-border-color | @component-stroke | -
+--td-input-border-left-space | 32rpx | -
+--td-input-border-right-space | 0 | -
+--td-input-default-text-color | @text-color-primary | -
+--td-input-default-tips-color | @text-color-placeholder | -
+--td-input-disabled-text-color | @text-color-disabled | -
+--td-input-error-text-color | @error-color | -
+--td-input-error-tips-color | @error-color | -
+--td-input-label-max-width | 5em | -
+--td-input-label-min-width | 2em | -
+--td-input-label-text-color | @text-color-primary | -
+--td-input-placeholder-text-color | @text-color-placeholder | -
+--td-input-placeholder-text-font-size | @font-size-m | -
+--td-input-prefix-icon-color | @text-color-primary | -
+--td-input-success-text-color | @success-color | -
+--td-input-success-tips-color | @success-color | -
+--td-input-suffix-icon-color | @text-color-placeholder | -
+--td-input-suffix-text-color | @text-color-primary | -
+--td-input-vertical-padding | 32rpx | -
+--td-input-warning-text-color | @warning-color | -
+--td-input-warning-tips-color | @warning-color | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/input/README.md b/miniprogram_npm/tdesign-miniprogram/input/README.md
new file mode 100644
index 0000000..0d2add9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/README.md
@@ -0,0 +1,190 @@
+---
+title: Input 输入框
+description: 用于单行文本信息输入。
+spline: form
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-input": "tdesign-miniprogram/input/input"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 01 组件类型
+
+基础输入框
+
+{{ base }}
+
+带字数限制输入框
+
+{{ maxlength }}
+
+带操作输入框
+
+{{ suffix }}
+
+带图标输入框
+
+{{ prefix }}
+
+特定类型输入框
+
+{{ special }}
+
+### 02 组件状态
+
+输入框状态
+
+{{ status }}
+
+信息超长状态
+
+{{ label }}
+
+### 03 组件样式
+
+内容位置
+
+{{ align }}
+
+竖排样式
+
+{{ layout }}
+
+非通栏样式
+
+{{ banner }}
+
+标签外置样式
+
+{{ bordered }}
+
+自定义样式文本框
+
+{{ custom }}
+
+## API
+
+### Input Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N
+align | String | left | 文本内容位置,居左/居中/居右。可选项:left/center/right | N
+allow-input-over-max | Boolean | false | 超出 `maxlength` 或 `maxcharacter` 之后是否允许继续输入 | N
+always-embed | Boolean | false | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) | N
+auto-focus | Boolean | false | (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 | N
+borderless | Boolean | false | 是否开启无边框模式 | N
+clear-trigger | String | always | 清空图标触发方式,仅在输入框有值时有效。可选项:always / focus | N
+clearable | Boolean / Object | false | 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon` | N
+confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N
+confirm-type | String | done | 设置键盘右下角按钮的文字,仅在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-color | String | #0052d9 | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | N
+cursor-spacing | Number | 0 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | N
+disabled | Boolean | undefined | 是否禁用输入框 | N
+error-message | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N
+focus | Boolean | false | 获取焦点 | N
+format | Function | - | 指定输入框展示值的格式。TS 类型:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
+hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N
+label | String / Slot | - | 左侧文本。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+layout | String | horizontal | 标题输入框布局方式。可选项:vertical/horizontal | N
+maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
+maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
+password | Boolean | false | 已废弃。是否是密码类型(已废弃,请更为使用 type 指定输入框类型) | N
+placeholder | String | undefined | 占位符 | N
+placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 | N
+placeholder-style | String | - | 必需。指定 placeholder 的样式 | Y
+prefix-icon | String / Object / Slot | - | 组件前置图标。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+readonly | Boolean | undefined | 只读状态 | N
+safe-password-cert-path | String | - | 安全键盘加密公钥的路径,只支持包内路径 | N
+safe-password-custom-hash | String | - | 安全键盘计算 hash 的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))` | N
+safe-password-length | Number | - | 安全键盘输入密码长度 | N
+safe-password-nonce | String | - | 安全键盘加密盐值 | N
+safe-password-salt | String | - | 安全键盘计算 hash 盐值,若指定custom-hash 则无效 | N
+safe-password-time-stamp | Number | - | 安全键盘加密时间戳 | N
+selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N
+selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N
+size | String | medium | 已废弃。输入框尺寸。可选项:small/medium。TS 类型:`'medium' \| 'small'` | N
+status | String | default | 输入框状态。可选项:default/success/warning/error | N
+suffix | String / Slot | - | 后置图标前的后置内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+suffix-icon | String / Object / Slot | - | 后置文本内容。值为字符串则表示图标名称,值为 `Object` 类型,表示透传至 `icon`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+tips | String / Slot | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+type | String | text | 输入框类型。可选项:text/number/idcard/digit/safe-password/password/nickname | N
+value | String / Number | - | 输入框的值。TS 类型:`InputValue` `type InputValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
+default-value | String / Number | undefined | 输入框的值。非受控属性。TS 类型:`InputValue` `type InputValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
+
+### Input Events
+
+名称 | 参数 | 描述
+-- | -- | --
+blur | `(value: InputValue)` | 失去焦点时触发
+change | `(value: InputValue, cursor: number, keyCode: number)` | 输入框值发生变化时触发;cursor 为光标位置;
+clear | \- | 清空按钮点击时触发
+click | `(trigger: InputTrigger)` | `0.32.0`。点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。
`type InputTrigger = 'suffix' \| 'suffix-icon';`
+enter | `(value: InputValue)` | 回车键按下时触发
+focus | `(value: InputValue)` | 获得焦点时触发
+keyboardheightchange | `(height: number, duration: number)` | 键盘高度发生变化的时候触发此事件
+nicknamereview | `(pass: boolean, timeout: boolean)` | 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效
+validate | `(detail: { error?: 'exceed-maximum' \| 'below-minimum' })` | 字数超出限制时触发
+
+### Input External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-clearable | 清空按钮样式类
+t-class-input | 输入框样式类
+t-class-label | 标签样式类
+t-class-prefix-icon | 前置图标样式类
+t-class-suffix | 后置样式类
+t-class-suffix-icon | 后置图标样式类
+t-class-tips | 提示样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+
+名称 | 默认值 | 描述
+-- | -- | --
+--td-input-align-items | center | -
+--td-input-bg-color | @bg-color-container | -
+--td-input-border-color | @component-stroke | -
+--td-input-border-left-space | 32rpx | -
+--td-input-border-right-space | 0 | -
+--td-input-default-text-color | @text-color-primary | -
+--td-input-default-tips-color | @text-color-placeholder | -
+--td-input-disabled-text-color | @text-color-disabled | -
+--td-input-error-text-color | @error-color | -
+--td-input-error-tips-color | @error-color | -
+--td-input-label-max-width | 5em | -
+--td-input-label-min-width | 2em | -
+--td-input-label-text-color | @text-color-primary | -
+--td-input-placeholder-text-color | @text-color-placeholder | -
+--td-input-placeholder-text-font-size | @font-size-m | -
+--td-input-prefix-icon-color | @text-color-primary | -
+--td-input-success-text-color | @success-color | -
+--td-input-success-tips-color | @success-color | -
+--td-input-suffix-icon-color | @text-color-placeholder | -
+--td-input-suffix-text-color | @text-color-primary | -
+--td-input-vertical-padding | 32rpx | -
+--td-input-warning-text-color | @warning-color | -
+--td-input-warning-tips-color | @warning-color | -
diff --git a/miniprogram_npm/tdesign-miniprogram/input/input.d.ts b/miniprogram_npm/tdesign-miniprogram/input/input.d.ts
new file mode 100644
index 0000000..94b84bc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/input.d.ts
@@ -0,0 +1,37 @@
+import { SuperComponent } from '../common/src/index';
+export default class Input extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ behaviors: string[];
+ properties: import("./type").TdInputProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ classBasePrefix: string;
+ showClearIcon: boolean;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ observers: {
+ prefixIcon(v: any): void;
+ suffixIcon(v: any): void;
+ clearable(v: any): void;
+ 'clearTrigger, clearable, disabled, readonly'(): void;
+ };
+ methods: {
+ updateValue(value: any): void;
+ updateClearIconVisible(value?: boolean): void;
+ onInput(e: any): void;
+ onFocus(e: any): void;
+ onBlur(e: any): void;
+ onConfirm(e: any): void;
+ onSuffixClick(): void;
+ onSuffixIconClick(): void;
+ clearInput(e: any): void;
+ onKeyboardHeightChange(e: any): void;
+ onNickNameReview(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/input/input.js b/miniprogram_npm/tdesign-miniprogram/input/input.js
new file mode 100644
index 0000000..e8cc458
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/input.js
@@ -0,0 +1,140 @@
+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, calcIcon, isDef } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-input`;
+let Input = class Input extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-prefix-icon`,
+ `${prefix}-class-label`,
+ `${prefix}-class-input`,
+ `${prefix}-class-clearable`,
+ `${prefix}-class-suffix`,
+ `${prefix}-class-suffix-icon`,
+ `${prefix}-class-tips`,
+ ];
+ this.behaviors = ['wx://form-field'];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ classBasePrefix: prefix,
+ showClearIcon: true,
+ };
+ this.lifetimes = {
+ ready() {
+ var _a;
+ const { value, defaultValue } = this.properties;
+ this.updateValue((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : '');
+ },
+ };
+ this.observers = {
+ prefixIcon(v) {
+ this.setData({
+ _prefixIcon: calcIcon(v),
+ });
+ },
+ suffixIcon(v) {
+ this.setData({
+ _suffixIcon: calcIcon(v),
+ });
+ },
+ clearable(v) {
+ this.setData({
+ _clearIcon: calcIcon(v, 'close-circle-filled'),
+ });
+ },
+ 'clearTrigger, clearable, disabled, readonly'() {
+ this.updateClearIconVisible();
+ },
+ };
+ this.methods = {
+ updateValue(value) {
+ const { allowInputOverMax, maxcharacter, maxlength } = this.properties;
+ if (!allowInputOverMax && maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
+ const { length, characters } = getCharacterLength('maxcharacter', value, maxcharacter);
+ this.setData({
+ value: characters,
+ count: length,
+ });
+ }
+ else if (!allowInputOverMax && maxlength && maxlength > 0 && !Number.isNaN(maxlength)) {
+ const { length, characters } = getCharacterLength('maxlength', value, maxlength);
+ this.setData({
+ value: characters,
+ count: length,
+ });
+ }
+ else {
+ this.setData({
+ value,
+ count: isDef(value) ? String(value).length : 0,
+ });
+ }
+ },
+ updateClearIconVisible(value = false) {
+ const { clearTrigger, disabled, readonly } = this.properties;
+ if (disabled || readonly) {
+ this.setData({ showClearIcon: false });
+ return;
+ }
+ this.setData({ showClearIcon: value || clearTrigger === 'always' });
+ },
+ onInput(e) {
+ const { value, cursor, keyCode } = e.detail;
+ this.updateValue(value);
+ this.triggerEvent('change', { value: this.data.value, cursor, keyCode });
+ },
+ onFocus(e) {
+ this.updateClearIconVisible(true);
+ this.triggerEvent('focus', e.detail);
+ },
+ onBlur(e) {
+ this.updateClearIconVisible();
+ if (typeof this.properties.format === 'function') {
+ const v = this.properties.format(e.detail.value);
+ this.updateValue(v);
+ this.triggerEvent('blur', { value: this.data.value, cursor: this.data.count });
+ return;
+ }
+ this.triggerEvent('blur', e.detail);
+ },
+ onConfirm(e) {
+ this.triggerEvent('enter', e.detail);
+ },
+ onSuffixClick() {
+ this.triggerEvent('click', { trigger: 'suffix' });
+ },
+ onSuffixIconClick() {
+ this.triggerEvent('click', { trigger: 'suffix-icon' });
+ },
+ clearInput(e) {
+ this.triggerEvent('clear', e.detail);
+ this.setData({ value: '' });
+ },
+ onKeyboardHeightChange(e) {
+ this.triggerEvent('keyboardheightchange', e.detail);
+ },
+ onNickNameReview(e) {
+ this.triggerEvent('nicknamereview', e.detail);
+ },
+ };
+ }
+};
+Input = __decorate([
+ wxComponent()
+], Input);
+export default Input;
diff --git a/miniprogram_npm/tdesign-miniprogram/input/input.json b/miniprogram_npm/tdesign-miniprogram/input/input.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/input.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/input/input.wxml b/miniprogram_npm/tdesign-miniprogram/input/input.wxml
new file mode 100644
index 0000000..8caeadd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/input.wxml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{label}}
+
+
+
+
+
+
+
+
+
+
+
+ {{suffix}}
+
+
+
+
+
+
+
+ {{tips}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/input/input.wxs b/miniprogram_npm/tdesign-miniprogram/input/input.wxs
new file mode 100644
index 0000000..ee9eb11
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/input.wxs
@@ -0,0 +1,16 @@
+function getInputClass(classPrefix, suffix, align, disabled) {
+ var className = [classPrefix + '__control'];
+
+ if (align) {
+ className.push(classPrefix + '--' + align);
+ }
+
+ if (disabled) {
+ className.push(classPrefix + '__control--disabled');
+ }
+ return className.join(' ');
+}
+
+module.exports = {
+ getInputClass: getInputClass,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/input/input.wxss b/miniprogram_npm/tdesign-miniprogram/input/input.wxss
new file mode 100644
index 0000000..b22ee64
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/input.wxss
@@ -0,0 +1,191 @@
+.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-input {
+ background-color: var(--td-input-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ display: flex;
+ align-items: var(--td-input-align-items, center);
+ flex: 1;
+ padding: var(--td-input-vertical-padding, 32rpx);
+ overflow: hidden;
+}
+.t-input--border {
+ position: relative;
+}
+.t-input--border::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-input-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-input--border::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-input--border:after {
+ left: var(--td-input-border-left-space, 32rpx);
+ right: var(--td-input-border-right-space, 0);
+}
+.t-input--layout-vertical {
+ flex-direction: column;
+ align-items: start;
+}
+.t-input__wrap--prefix {
+ display: flex;
+}
+.t-input__icon--prefix {
+ font-size: 48rpx;
+ color: var(--td-input-prefix-icon-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-input__label:not(:empty) {
+ min-width: var(--td-input-label-min-width, 2em);
+ max-width: var(--td-input-label-max-width, 5em);
+ font-size: var(--td-font-size-m, 32rpx);
+ line-height: 48rpx;
+ color: var(--td-input-label-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ margin-right: var(--td-spacer-2, 32rpx);
+ word-wrap: break-word;
+}
+.t-input--layout-vertical .t-input__label:not(:empty) {
+ font-size: var(--td-font-size-base, 28rpx);
+ padding-bottom: 8rpx;
+}
+.t-input__icon--prefix:not(:empty) + .t-input__label:not(:empty) {
+ padding-left: 8rpx;
+}
+.t-input__label:not(:empty) + .t-input__wrap {
+ margin-left: var(--td-spacer-2, 32rpx);
+}
+.t-input__icon--prefix:not(:empty) + .t-input__label:empty {
+ margin-right: var(--td-spacer-2, 32rpx);
+}
+.t-input__wrap {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ flex-wrap: wrap;
+ justify-content: center;
+ flex-shrink: 1;
+ flex: 1;
+}
+.t-input__wrap .t-input__content {
+ display: flex;
+ width: 100%;
+ align-items: center;
+ line-height: 48rpx;
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-input__wrap--clearable-icon,
+.t-input__wrap--suffix-icon,
+.t-input__wrap--suffix {
+ flex: 0 0 auto;
+ padding-left: var(--td-spacer-1, 24rpx);
+}
+.t-input__wrap--clearable-icon:empty,
+.t-input__wrap--suffix-icon:empty,
+.t-input__wrap--suffix:empty {
+ display: none;
+}
+.t-input__wrap--clearable-icon,
+.t-input__wrap--suffix-icon {
+ font-size: 48rpx;
+ color: var(--td-input-suffix-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-input__wrap--suffix {
+ font-size: var(--td-font-size-m, 32rpx);
+ color: var(--td-input-suffix-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-input__icon--prefix:empty,
+.t-input__tips:empty,
+.t-input__wrap--clearable-icon:empty,
+.t-input__wrap--suffix-icon:empty,
+.t-input__wrap--suffix:empty {
+ display: none;
+}
+.t-input__control {
+ display: block;
+ box-sizing: border-box;
+ width: 100%;
+ min-width: 0;
+ min-height: 48rpx;
+ margin: 0;
+ padding: 0;
+ color: var(--td-input-default-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ line-height: inherit;
+ background-color: transparent;
+ border: 0;
+ resize: none;
+ font-size: inherit;
+}
+.t-input__control--disabled {
+ color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ cursor: not-allowed;
+ opacity: 1;
+ -webkit-text-fill-color: currentColor;
+}
+.t-input__control--read-only {
+ cursor: default;
+}
+.t-input--left {
+ text-align: left;
+}
+.t-input--right {
+ text-align: right;
+}
+.t-input--center {
+ text-align: center;
+}
+.t-input__placeholder {
+ color: var(--td-input-placeholder-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-input-placeholder-text-font-size, var(--td-font-size-m, 32rpx));
+}
+.t-input__placeholder--disabled {
+ color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-input__tips {
+ font-size: var(--td-font-size-s, 24rpx);
+ line-height: 40rpx;
+ padding-top: 8rpx;
+}
+.t-input--default + .t-input__tips {
+ color: var(--td-input-default-tips-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-input--success + .t-input__tips {
+ color: var(--td-input-success-tips-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-input--warning + .t-input__tips {
+ color: var(--td-input-warning-tips-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-input--error + .t-input__tips {
+ color: var(--td-input-error-tips-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/input/props.d.ts b/miniprogram_npm/tdesign-miniprogram/input/props.d.ts
new file mode 100644
index 0000000..1bd2f9a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/props.d.ts
@@ -0,0 +1,3 @@
+import { TdInputProps } from './type';
+declare const props: TdInputProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/input/props.js b/miniprogram_npm/tdesign-miniprogram/input/props.js
new file mode 100644
index 0000000..029d064
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/props.js
@@ -0,0 +1,154 @@
+const props = {
+ adjustPosition: {
+ type: Boolean,
+ value: true,
+ },
+ align: {
+ type: String,
+ value: 'left',
+ },
+ allowInputOverMax: {
+ type: Boolean,
+ value: false,
+ },
+ alwaysEmbed: {
+ type: Boolean,
+ value: false,
+ },
+ autoFocus: {
+ type: Boolean,
+ value: false,
+ },
+ borderless: {
+ type: Boolean,
+ value: false,
+ },
+ clearTrigger: {
+ type: String,
+ value: 'always',
+ },
+ clearable: {
+ type: null,
+ value: false,
+ },
+ confirmHold: {
+ type: Boolean,
+ value: false,
+ },
+ confirmType: {
+ type: String,
+ value: 'done',
+ },
+ cursor: {
+ type: Number,
+ required: true,
+ },
+ cursorColor: {
+ type: String,
+ value: '#0052d9',
+ },
+ cursorSpacing: {
+ type: Number,
+ value: 0,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ focus: {
+ type: Boolean,
+ value: false,
+ },
+ format: {
+ type: null,
+ },
+ holdKeyboard: {
+ type: Boolean,
+ value: false,
+ },
+ label: {
+ type: String,
+ },
+ layout: {
+ type: String,
+ value: 'horizontal',
+ },
+ maxcharacter: {
+ type: Number,
+ },
+ maxlength: {
+ type: Number,
+ value: -1,
+ },
+ placeholder: {
+ type: String,
+ value: undefined,
+ },
+ placeholderClass: {
+ type: String,
+ value: 'input-placeholder',
+ },
+ placeholderStyle: {
+ type: String,
+ value: '',
+ required: true,
+ },
+ prefixIcon: {
+ type: null,
+ },
+ readonly: {
+ type: null,
+ value: undefined,
+ },
+ safePasswordCertPath: {
+ type: String,
+ value: '',
+ },
+ safePasswordCustomHash: {
+ type: String,
+ value: '',
+ },
+ safePasswordLength: {
+ type: Number,
+ },
+ safePasswordNonce: {
+ type: String,
+ value: '',
+ },
+ safePasswordSalt: {
+ type: String,
+ value: '',
+ },
+ safePasswordTimeStamp: {
+ type: Number,
+ },
+ selectionEnd: {
+ type: Number,
+ value: -1,
+ },
+ selectionStart: {
+ type: Number,
+ value: -1,
+ },
+ status: {
+ type: String,
+ value: 'default',
+ },
+ suffix: {
+ type: String,
+ },
+ suffixIcon: {
+ type: null,
+ },
+ tips: {
+ type: String,
+ },
+ type: {
+ type: String,
+ value: 'text',
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/input/type.d.ts b/miniprogram_npm/tdesign-miniprogram/input/type.d.ts
new file mode 100644
index 0000000..a5b6b8a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/type.d.ts
@@ -0,0 +1,166 @@
+export interface TdInputProps {
+ adjustPosition?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ align?: {
+ type: StringConstructor;
+ value?: 'left' | 'center' | 'right';
+ };
+ allowInputOverMax?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ alwaysEmbed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ autoFocus?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ borderless?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ clearTrigger?: {
+ type: StringConstructor;
+ value?: 'always' | 'focus';
+ };
+ clearable?: {
+ type: null;
+ value?: boolean | object;
+ };
+ confirmHold?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ confirmType?: {
+ type: StringConstructor;
+ value?: 'send' | 'search' | 'next' | 'go' | 'done';
+ };
+ cursor: {
+ type: NumberConstructor;
+ value?: number;
+ required?: boolean;
+ };
+ cursorColor?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ cursorSpacing?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ focus?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ format?: {
+ type: undefined;
+ value?: InputFormatType;
+ };
+ holdKeyboard?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: 'vertical' | 'horizontal';
+ };
+ 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;
+ };
+ prefixIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ safePasswordCertPath?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ safePasswordCustomHash?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ safePasswordLength?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ safePasswordNonce?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ safePasswordSalt?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ safePasswordTimeStamp?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ selectionEnd?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ selectionStart?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ status?: {
+ type: StringConstructor;
+ value?: 'default' | 'success' | 'warning' | 'error';
+ };
+ suffix?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ suffixIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ tips?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ type?: {
+ type: StringConstructor;
+ value?: 'text' | 'number' | 'idcard' | 'digit' | 'safe-password' | 'password' | 'nickname';
+ };
+ value?: {
+ type: null;
+ value?: InputValue;
+ };
+}
+export declare type InputFormatType = (value: InputValue) => string;
+export declare type InputValue = string | number;
diff --git a/miniprogram_npm/tdesign-miniprogram/input/type.js b/miniprogram_npm/tdesign-miniprogram/input/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/input/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/link/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/link/README.en-US.md
new file mode 100644
index 0000000..6240694
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/README.en-US.md
@@ -0,0 +1,58 @@
+:: BASE_DOC ::
+
+## API
+
+### Link 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
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+disabled | Boolean | false | make link to be disabled | N
+hover | Boolean | - | \- | N
+navigator-props | Object | - | \- | N
+prefix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | 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
+status | String | normal | `deprecated`。options: normal/active/disabled | N
+suffix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+theme | String | default | options: default/primary/danger/warning/success | N
+underline | Boolean | - | \- | N
+
+### Link Events
+
+name | params | description
+-- | -- | --
+complete | \- | \-
+fail | \- | \-
+success | \- | \-
+### Link External Classes
+
+className | Description
+-- | --
+t-class | class name of root node
+t-class-content | \-
+t-class-hover | \-
+t-class-prefix-icon | \-
+t-class-suffix-icon | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-link-danger-active-color | @error-color-active | -
+--td-link-danger-color | @error-color | -
+--td-link-danger-disabled-color | @error-color-disabled | -
+--td-link-default-active-color | @brand-color-active | -
+--td-link-default-color | @font-gray-1 | -
+--td-link-default-disabled-color | @text-color-disabled | -
+--td-link-primary-active-color | @brand-color-active | -
+--td-link-primary-color | @brand-color | -
+--td-link-primary-disabled-color | @brand-color-disabled | -
+--td-link-success-active-color | @success-color-active | -
+--td-link-success-color | @success-color | -
+--td-link-success-disabled-color | @success-color-disabled | -
+--td-link-warning-active-color | @warning-color-active | -
+--td-link-warning-color | @warning-color | -
+--td-link-warning-disabled-color | @warning-color-disabled | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/link/README.md b/miniprogram_npm/tdesign-miniprogram/link/README.md
new file mode 100644
index 0000000..d3e5140
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/README.md
@@ -0,0 +1,122 @@
+---
+title: Link 链接
+description: 文字超链接用于跳转一个新页面,如当前项目跳转,友情链接等。
+spline: navigation
+isComponent: true
+---
+
+
+
+ 该组件于 0.32.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-link": "tdesign-miniprogram/link/link",
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+基础文字链接
+
+{{ content }}
+
+下划线文字链接
+
+{{ underline }}
+
+前置图标文字链接
+
+{{ prefix }}
+
+后置图标文字链接
+
+{{ suffix }}
+
+### 组件状态
+
+不同主题
+
+{{ theme }}
+
+禁用状态
+
+{{ disabled }}
+
+### 组件样式
+
+链接尺寸
+
+{{ size }}
+
+## API
+
+### Link Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+content | String / Slot | - | 链接内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+disabled | Boolean | false | 是否为禁用态 | N
+hover | Boolean | - | 是否开启点击反馈 | N
+navigator-props | Object | - | 与 navigator 原生组件属性保持一致,具体使用参考:[微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)。使用时请将形如 `open-type` 风格的属性名改为 `openType` 风格 | N
+prefix-icon | String / Object / Slot | - | 前置图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+size | String | medium | 尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+status | String | normal | 已废弃。组件状态。可选项:normal/active/disabled | N
+suffix-icon | String / Object / Slot | - | 后置图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+theme | String | default | 组件风格,依次为默认色、品牌色、危险色、警告色、成功色。可选项:default/primary/danger/warning/success | N
+underline | Boolean | - | 是否显示链接下划线 | N
+
+### Link Events
+
+名称 | 参数 | 描述
+-- | -- | --
+complete | \- | 页面链接执行完成后触发(失败或成功均会触发)
+fail | \- | 页面链接跳转失败后触发
+success | \- | 页面链接跳转成功后触发
+### Link External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-hover | 悬停样式类
+t-class-prefix-icon | 前置图标样式类
+t-class-suffix-icon | 后置图标样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-link-danger-active-color | @error-color-active | -
+--td-link-danger-color | @error-color | -
+--td-link-danger-disabled-color | @error-color-disabled | -
+--td-link-default-active-color | @brand-color-active | -
+--td-link-default-color | @font-gray-1 | -
+--td-link-default-disabled-color | @text-color-disabled | -
+--td-link-primary-active-color | @brand-color-active | -
+--td-link-primary-color | @brand-color | -
+--td-link-primary-disabled-color | @brand-color-disabled | -
+--td-link-success-active-color | @success-color-active | -
+--td-link-success-color | @success-color | -
+--td-link-success-disabled-color | @success-color-disabled | -
+--td-link-warning-active-color | @warning-color-active | -
+--td-link-warning-color | @warning-color | -
+--td-link-warning-disabled-color | @warning-color-disabled | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/link/link.d.ts b/miniprogram_npm/tdesign-miniprogram/link/link.d.ts
new file mode 100644
index 0000000..ad1b82f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/link.d.ts
@@ -0,0 +1,26 @@
+import { SuperComponent } from '../common/src/index';
+export default class Link extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdLinkProps;
+ options: {
+ multipleSlots: boolean;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ observers: {
+ 'theme, status, size, underline, navigatorProps'(): void;
+ prefixIcon(v: any): void;
+ suffixIcon(v: any): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ setClass(): void;
+ onSuccess(e: any): void;
+ onFail(e: any): void;
+ onComplete(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/link/link.js b/miniprogram_npm/tdesign-miniprogram/link/link.js
new file mode 100644
index 0000000..e02d0d0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/link.js
@@ -0,0 +1,81 @@
+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 { calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-link`;
+let Link = class Link extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-hover`,
+ `${prefix}-class-prefix-icon`,
+ `${prefix}-class-content`,
+ `${prefix}-class-suffix-icon`,
+ ];
+ this.properties = props;
+ this.options = {
+ multipleSlots: true,
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.observers = {
+ 'theme, status, size, underline, navigatorProps'() {
+ this.setClass();
+ },
+ prefixIcon(v) {
+ this.setData({
+ _prefixIcon: calcIcon(v),
+ });
+ },
+ suffixIcon(v) {
+ this.setData({
+ _suffixIcon: calcIcon(v),
+ });
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.setClass();
+ },
+ };
+ this.methods = {
+ setClass() {
+ const { theme, size, underline, navigatorProps, disabled } = this.properties;
+ const classList = [name, `${name}--${theme}`, `${name}--${size}`];
+ if (underline) {
+ classList.push(`${name}--underline`);
+ }
+ if ((navigatorProps && !navigatorProps.url && !['navigateBack', 'exit'].includes(navigatorProps.openType)) ||
+ disabled) {
+ classList.push(`${name}--disabled`);
+ }
+ this.setData({
+ className: classList.join(' '),
+ });
+ },
+ onSuccess(e) {
+ this.triggerEvent('success', e);
+ },
+ onFail(e) {
+ this.triggerEvent('fail', e);
+ },
+ onComplete(e) {
+ this.triggerEvent('complete', e);
+ },
+ };
+ }
+};
+Link = __decorate([
+ wxComponent()
+], Link);
+export default Link;
diff --git a/miniprogram_npm/tdesign-miniprogram/link/link.json b/miniprogram_npm/tdesign-miniprogram/link/link.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/link.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/link/link.wxml b/miniprogram_npm/tdesign-miniprogram/link/link.wxml
new file mode 100644
index 0000000..933aa87
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/link.wxml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+ {{content}}
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/link/link.wxss b/miniprogram_npm/tdesign-miniprogram/link/link.wxss
new file mode 100644
index 0000000..733a773
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/link.wxss
@@ -0,0 +1,148 @@
+.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-link--small .t-link__content {
+ font-size: 24rpx;
+ line-height: 40rpx;
+}
+.t-link--small .t-link__prefix-icon,
+.t-link--small .t-link__suffix-icon {
+ font-size: 28rpx;
+}
+.t-link--medium .t-link__content {
+ font-size: 28rpx;
+ line-height: 44rpx;
+}
+.t-link--medium .t-link__prefix-icon,
+.t-link--medium .t-link__suffix-icon {
+ font-size: 32rpx;
+}
+.t-link--large .t-link__content {
+ font-size: 32rpx;
+ line-height: 48rpx;
+}
+.t-link--large .t-link__prefix-icon,
+.t-link--large .t-link__suffix-icon {
+ font-size: 36rpx;
+}
+.t-link--primary {
+ color: var(--td-link-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-link--primary.t-link--underline::after {
+ border-color: var(--td-link-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-link--primary.t-link--disabled {
+ color: var(--td-link-primary-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-link--primary.t-link--hover {
+ color: var(--td-link-primary-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-link--primary.t-link--hover.t-link--underline::after {
+ border-color: var(--td-link-primary-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-link--success {
+ color: var(--td-link-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-link--success.t-link--underline::after {
+ border-color: var(--td-link-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-link--success.t-link--disabled {
+ color: var(--td-link-success-disabled-color, var(--td-success-color-disabled, var(--td-success-color-3, #92dab2)));
+}
+.t-link--success.t-link--hover {
+ color: var(--td-link-success-active-color, var(--td-success-color-active, var(--td-success-color-6, #008858)));
+}
+.t-link--success.t-link--hover.t-link--underline::after {
+ border-color: var(--td-link-success-active-color, var(--td-success-color-active, var(--td-success-color-6, #008858)));
+}
+.t-link--warning {
+ color: var(--td-link-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-link--warning.t-link--underline::after {
+ border-color: var(--td-link-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-link--warning.t-link--disabled {
+ color: var(--td-link-warning-disabled-color, var(--td-warning-color-disabled, var(--td-warning-color-3, #ffb98c)));
+}
+.t-link--warning.t-link--hover {
+ color: var(--td-link-warning-active-color, var(--td-warning-color-active, var(--td-warning-color-6, #be5a00)));
+}
+.t-link--warning.t-link--hover.t-link--underline::after {
+ border-color: var(--td-link-warning-active-color, var(--td-warning-color-active, var(--td-warning-color-6, #be5a00)));
+}
+.t-link--default {
+ color: var(--td-link-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-link--default.t-link--underline::after {
+ border-color: var(--td-link-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-link--default.t-link--disabled {
+ color: var(--td-link-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-link--default.t-link--hover {
+ color: var(--td-link-default-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-link--default.t-link--hover.t-link--underline::after {
+ border-color: var(--td-link-default-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-link--danger {
+ color: var(--td-link-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-link--danger.t-link--underline::after {
+ border-color: var(--td-link-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-link--danger.t-link--disabled {
+ color: var(--td-link-danger-disabled-color, var(--td-error-color-disabled, var(--td-error-color-3, #ffb9b0)));
+}
+.t-link--danger.t-link--hover {
+ color: var(--td-link-danger-active-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-link--danger.t-link--hover.t-link--underline::after {
+ border-color: var(--td-link-danger-active-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
+}
+.t-link {
+ position: relative;
+ display: flex;
+ align-items: center;
+ box-sizing: content-box;
+}
+.t-link--underline::after {
+ content: '';
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 0;
+ bottom: 0;
+ opacity: 1;
+ border-bottom: 2rpx solid #cd0be7;
+}
+.t-link__prefix-icon:not(:empty) + .t-link__content:not(:empty) {
+ padding-left: 8rpx;
+}
+.t-link__content:not(:empty) + .t-link__suffix-icon:not(:empty) {
+ padding-left: 8rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/link/props.d.ts b/miniprogram_npm/tdesign-miniprogram/link/props.d.ts
new file mode 100644
index 0000000..bbdacae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/props.d.ts
@@ -0,0 +1,3 @@
+import { TdLinkProps } from './type';
+declare const props: TdLinkProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/link/props.js b/miniprogram_npm/tdesign-miniprogram/link/props.js
new file mode 100644
index 0000000..8ce30cb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/props.js
@@ -0,0 +1,33 @@
+const props = {
+ content: {
+ type: String,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ hover: {
+ type: Boolean,
+ },
+ navigatorProps: {
+ type: Object,
+ },
+ prefixIcon: {
+ type: null,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ suffixIcon: {
+ type: null,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ underline: {
+ type: Boolean,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/link/type.d.ts b/miniprogram_npm/tdesign-miniprogram/link/type.d.ts
new file mode 100644
index 0000000..f261141
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/type.d.ts
@@ -0,0 +1,39 @@
+import { SizeEnum } from '../common/common';
+export interface TdLinkProps {
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ hover?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ navigatorProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ prefixIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: SizeEnum;
+ };
+ suffixIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'primary' | 'danger' | 'warning' | 'success';
+ };
+ underline?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/link/type.js b/miniprogram_npm/tdesign-miniprogram/link/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/link/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md
new file mode 100644
index 0000000..10f987e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md
@@ -0,0 +1,41 @@
+:: 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
+fullscreen | Boolean | false | `1.8.5` | 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 | '20px' | \- | 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_npm/tdesign-miniprogram/loading/README.md b/miniprogram_npm/tdesign-miniprogram/loading/README.md
new file mode 100644
index 0000000..13be619
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/README.md
@@ -0,0 +1,97 @@
+---
+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
+fullscreen | Boolean | false | `1.8.5`。是否显示为全屏加载 | 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 | '20px' | 尺寸,示例: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_npm/tdesign-miniprogram/loading/index.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/index.d.ts
new file mode 100644
index 0000000..2806bd6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './loading';
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/index.js b/miniprogram_npm/tdesign-miniprogram/loading/index.js
new file mode 100644
index 0000000..2806bd6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './loading';
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts
new file mode 100644
index 0000000..4d2f2d4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts
@@ -0,0 +1,77 @@
+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;
+ };
+ fullscreen?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ 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_npm/tdesign-miniprogram/loading/loading.js b/miniprogram_npm/tdesign-miniprogram/loading/loading.js
new file mode 100644
index 0000000..f59a423
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.js
@@ -0,0 +1,61 @@
+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_npm/tdesign-miniprogram/loading/loading.json b/miniprogram_npm/tdesign-miniprogram/loading/loading.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.wxml b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxml
new file mode 100644
index 0000000..0557730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{text}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.wxss b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxss
new file mode 100644
index 0000000..160f9a6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxss
@@ -0,0 +1,232 @@
+.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--fullscreen {
+ position: fixed;
+ display: flex;
+ align-items: center;
+ vertical-align: middle;
+ justify-content: center;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: var(--td-loading-z-index, 3500);
+ background-color: var(--td-loading-full-bg-color, rgba(255, 255, 255, 0.6));
+}
+.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_npm/tdesign-miniprogram/loading/props.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/props.d.ts
new file mode 100644
index 0000000..a05a659
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/props.d.ts
@@ -0,0 +1,3 @@
+import { TdLoadingProps } from './type';
+declare const props: TdLoadingProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/props.js b/miniprogram_npm/tdesign-miniprogram/loading/props.js
new file mode 100644
index 0000000..15579d4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/props.js
@@ -0,0 +1,52 @@
+const props = {
+ delay: {
+ type: Number,
+ value: 0,
+ },
+ duration: {
+ type: Number,
+ value: 800,
+ },
+ fullscreen: {
+ type: Boolean,
+ value: false,
+ },
+ 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: '20px',
+ },
+ text: {
+ type: String,
+ },
+ theme: {
+ type: String,
+ value: 'circular',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/type.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/type.d.ts
new file mode 100644
index 0000000..1f9de06
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/type.d.ts
@@ -0,0 +1,54 @@
+export interface TdLoadingProps {
+ delay?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ fullscreen?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ 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_npm/tdesign-miniprogram/loading/type.js b/miniprogram_npm/tdesign-miniprogram/loading/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/index.d.ts b/miniprogram_npm/tdesign-miniprogram/message-item/index.d.ts
new file mode 100644
index 0000000..82441ea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/index.d.ts
@@ -0,0 +1,17 @@
+///
+///
+///
+import { MessageProps } from '../message/message.interface';
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+interface MessageActionOptionsType extends Optional {
+ context?: Context;
+ selector?: string;
+}
+declare const _default: {
+ info(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ success(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ warning(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ error(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ hide(options: MessageActionOptionsType): void;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/index.js b/miniprogram_npm/tdesign-miniprogram/message-item/index.js
new file mode 100644
index 0000000..b35e682
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/index.js
@@ -0,0 +1,46 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import { MessageType } from '../message/message.interface';
+import { getInstance } from '../common/utils';
+const showMessage = function (options, theme = MessageType.info) {
+ const { context, selector = '#t-message' } = options, otherOptions = __rest(options, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.resetData(() => {
+ instance.setData(Object.assign({ theme }, otherOptions), instance.show.bind(instance));
+ });
+ return instance;
+ }
+ console.error('未找到组件,请确认 selector && context 是否正确');
+};
+export default {
+ info(options) {
+ return showMessage(options, MessageType.info);
+ },
+ success(options) {
+ return showMessage(options, MessageType.success);
+ },
+ warning(options) {
+ return showMessage(options, MessageType.warning);
+ },
+ error(options) {
+ return showMessage(options, MessageType.error);
+ },
+ hide(options) {
+ const { context, selector = '#t-message' } = Object.assign({}, options);
+ const instance = getInstance(context, selector);
+ if (!instance) {
+ return;
+ }
+ instance.hide();
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/message-item.d.ts b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.d.ts
new file mode 100644
index 0000000..49bdb7e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.d.ts
@@ -0,0 +1,39 @@
+///
+import { SuperComponent, ComponentsOptionsType } from '../common/src/index';
+import { MessageProps } from '../message/message.interface';
+export default class Message extends SuperComponent {
+ externalClasses: string[];
+ options: ComponentsOptionsType;
+ properties: MessageProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ loop: number;
+ animation: any[];
+ showAnimation: any[];
+ wrapTop: number;
+ fadeClass: string;
+ };
+ closeTimeoutContext: number;
+ nextAnimationContext: number;
+ resetAnimation: WechatMiniprogram.Animation;
+ observers: {
+ marquee(val: any): void;
+ 'icon, theme'(icon: any, theme: any): void;
+ link(v: any): void;
+ closeBtn(v: any): void;
+ };
+ lifetimes: {
+ ready(): void;
+ detached(): void;
+ };
+ memoInitialData(): void;
+ resetData(cb: () => void): void;
+ checkAnimation(): void;
+ clearMessageAnimation(): void;
+ show(offsetHeight?: number): void;
+ hide(): void;
+ reset(): void;
+ handleClose(): void;
+ handleLinkClick(): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/message-item.js b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.js
new file mode 100644
index 0000000..2903510
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.js
@@ -0,0 +1,187 @@
+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 '../message/props';
+import { getRect, unitConvert, calcIcon, isObject } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-message`;
+const SHOW_DURATION = 500;
+const THEME_ICON = {
+ info: 'info-circle-filled',
+ success: 'check-circle-filled',
+ warning: 'info-circle-filled',
+ error: 'error-circle-filled',
+};
+let Message = class Message extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-icon`,
+ `${prefix}-class-link`,
+ `${prefix}-class-close-btn`,
+ ];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = Object.assign({}, props);
+ this.data = {
+ prefix,
+ classPrefix: name,
+ loop: -1,
+ animation: [],
+ showAnimation: [],
+ wrapTop: -999,
+ fadeClass: '',
+ };
+ this.closeTimeoutContext = 0;
+ this.nextAnimationContext = 0;
+ this.resetAnimation = wx.createAnimation({
+ duration: 0,
+ timingFunction: 'linear',
+ });
+ this.observers = {
+ marquee(val) {
+ if (JSON.stringify(val) === '{}' || JSON.stringify(val) === 'true') {
+ this.setData({
+ marquee: {
+ speed: 50,
+ loop: -1,
+ delay: 0,
+ },
+ });
+ }
+ },
+ 'icon, theme'(icon, theme) {
+ this.setData({
+ _icon: calcIcon(icon, THEME_ICON[theme]),
+ });
+ },
+ link(v) {
+ const _link = isObject(v) ? Object.assign({}, v) : { content: v };
+ this.setData({ _link });
+ },
+ closeBtn(v) {
+ this.setData({
+ _closeBtn: calcIcon(v, 'close'),
+ });
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.memoInitialData();
+ },
+ detached() {
+ this.clearMessageAnimation();
+ },
+ };
+ }
+ memoInitialData() {
+ this.initialData = Object.assign(Object.assign({}, this.properties), this.data);
+ }
+ resetData(cb) {
+ this.setData(Object.assign({}, this.initialData), cb);
+ }
+ checkAnimation() {
+ const { marquee } = this.properties;
+ if (!marquee || marquee.loop === 0) {
+ return;
+ }
+ const speeding = marquee.speed;
+ if (this.data.loop > 0) {
+ this.data.loop -= 1;
+ }
+ else if (this.data.loop === 0) {
+ this.setData({ animation: this.resetAnimation.translateX(0).step().export() });
+ return;
+ }
+ if (this.nextAnimationContext) {
+ this.clearMessageAnimation();
+ }
+ const warpID = `#${name}__text-wrap`;
+ const nodeID = `#${name}__text`;
+ Promise.all([getRect(this, nodeID), getRect(this, warpID)]).then(([nodeRect, wrapRect]) => {
+ this.setData({
+ animation: this.resetAnimation.translateX(wrapRect.width).step().export(),
+ }, () => {
+ const durationTime = ((nodeRect.width + wrapRect.width) / speeding) * 1000;
+ const nextAnimation = wx
+ .createAnimation({
+ duration: durationTime,
+ })
+ .translateX(-nodeRect.width)
+ .step()
+ .export();
+ setTimeout(() => {
+ this.nextAnimationContext = setTimeout(this.checkAnimation.bind(this), durationTime);
+ this.setData({ animation: nextAnimation });
+ }, 20);
+ });
+ });
+ }
+ clearMessageAnimation() {
+ clearTimeout(this.nextAnimationContext);
+ this.nextAnimationContext = 0;
+ }
+ show(offsetHeight = 0) {
+ const { duration, marquee, offset, id } = this.properties;
+ this.setData({
+ visible: true,
+ loop: marquee.loop || this.data.loop,
+ fadeClass: `${name}__fade`,
+ wrapTop: unitConvert(offset[0]) + offsetHeight,
+ });
+ this.reset();
+ this.checkAnimation();
+ if (duration && duration > 0) {
+ this.closeTimeoutContext = setTimeout(() => {
+ this.hide();
+ this.triggerEvent('duration-end', { self: this });
+ }, duration);
+ }
+ const wrapID = id ? `#${id}` : `#${name}`;
+ getRect(this, wrapID).then((wrapRect) => {
+ this.setData({ height: wrapRect.height }, () => {
+ this.setData({
+ fadeClass: ``,
+ });
+ });
+ });
+ }
+ hide() {
+ this.reset();
+ this.setData({
+ fadeClass: `${name}__fade`,
+ });
+ setTimeout(() => {
+ this.setData({ visible: false, animation: [] });
+ }, SHOW_DURATION);
+ if (typeof this.onHide === 'function') {
+ this.onHide();
+ }
+ }
+ reset() {
+ if (this.nextAnimationContext) {
+ this.clearMessageAnimation();
+ }
+ clearTimeout(this.closeTimeoutContext);
+ this.closeTimeoutContext = 0;
+ }
+ handleClose() {
+ this.hide();
+ this.triggerEvent('close-btn-click');
+ }
+ handleLinkClick() {
+ this.triggerEvent('link-click');
+ }
+};
+Message = __decorate([
+ wxComponent()
+], Message);
+export default Message;
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/message-item.json b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.json
new file mode 100644
index 0000000..e98fd68
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-link": "../link/link"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxml b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxml
new file mode 100644
index 0000000..479d473
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{content}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxs b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxs
new file mode 100644
index 0000000..4cf0bd9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxs
@@ -0,0 +1,29 @@
+var isEmptyObj = function (obj) {
+ return JSON.stringify(obj) === '{}';
+};
+
+var changeNumToStr = function (arr) {
+ return arr.map(function (item) {
+ return typeof item === 'number' ? item + 'rpx' : item;
+ });
+};
+
+var getMessageStyles = function (zIndex, offset, wrapTop) {
+ var arr = changeNumToStr(offset || [0, 0]);
+ var left = arr[1] || 0;
+ var right = arr[1] || 0;
+
+ var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
+ var styleOffset = '';
+
+ styleOffset += 'top:' + wrapTop + 'px;';
+ styleOffset += 'left:' + left + ';';
+ styleOffset += 'right:' + right + ';';
+
+ return zIndexStyle + styleOffset;
+};
+
+module.exports = {
+ getMessageStyles: getMessageStyles,
+ isEmptyObj: isEmptyObj,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss
new file mode 100644
index 0000000..2b0e579
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss
@@ -0,0 +1,91 @@
+.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-message {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ transition: opacity 0.3s, transform 0.4s, top 0.4s;
+ display: flex;
+ justify-content: flex-start;
+ height: 96rpx;
+ align-items: center;
+ z-index: 15000;
+ padding: 0 32rpx;
+ box-sizing: border-box;
+ border-radius: var(--td-message-border-radius, var(--td-radius-default, 12rpx));
+ line-height: 1;
+ background-color: var(--td-message-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ box-shadow: var(--td-message-box-shadow, var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12)));
+}
+.t-message__text {
+ display: inline-block;
+ color: var(--td-message-content-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-size: var(--td-font-size-base, 28rpx);
+ line-height: 44rpx;
+}
+.t-message__text-wrap {
+ flex: 1 1 auto;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+}
+.t-message__text-nowrap {
+ word-break: keep-all;
+ white-space: nowrap;
+}
+.t-message--info {
+ color: var(--td-message-info-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-message--success {
+ color: var(--td-message-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-message--warning {
+ color: var(--td-message-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-message--error {
+ color: var(--td-message-error-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-message__icon--left,
+.t-message__icon--right {
+ font-size: 44rpx;
+}
+.t-message__icon--left:not(:empty) {
+ margin-right: var(--td-spacer, 16rpx);
+}
+.t-message__icon--right {
+ color: var(--td-message-close-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-message__icon--right:not(:empty),
+.t-message__link {
+ flex: 0 0 auto;
+ margin-left: var(--td-spacer, 16rpx);
+}
+.t-message__fade {
+ opacity: 0;
+ transform: translateY(-100%);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/message/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/message/README.en-US.md
new file mode 100644
index 0000000..b614655
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/README.en-US.md
@@ -0,0 +1,58 @@
+:: BASE_DOC ::
+
+## API
+
+### Message 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 | - | `deprecated`。operation。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+align | String | left | options: left/center。Typescript:`MessageAlignType` `type MessageAlignType = 'left' \| 'center'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/message/type.ts) | N
+close-btn | String / Boolean / Object / Slot | false | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+duration | Number | 3000 | \- | N
+gap | String / Number / Boolean | 12 | \- | N
+icon | String / Boolean / Object / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+link | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+marquee | Boolean / Object | false | Typescript:`boolean \| MessageMarquee` `interface MessageMarquee { speed?: number; loop?: number; delay?: number }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/message/type.ts) | N
+offset | Array | - | Typescript:`Array` | N
+single | Boolean | true | \- | N
+theme | String | info | options: info/success/warning/error。Typescript:`MessageThemeList` `type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/message/type.ts) | N
+visible | Boolean | false | \- | N
+default-visible | Boolean | undefined | uncontrolled property | N
+z-index | Number | 15000 | \- | N
+
+### Message Events
+
+name | params | description
+-- | -- | --
+action-btn-click | - | \-
+close-btn-click | - | \-
+duration-end | \- | \-
+link-click | - | \-
+### Message External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-close-btn | \-
+t-class-content | \-
+t-class-icon | \-
+t-class-link | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-message-bg-color | @bg-color-container | -
+--td-message-border-radius | @radius-default | -
+--td-message-box-shadow | @shadow-4 | -
+--td-message-close-icon-color | @font-gray-3 | -
+--td-message-content-font-color | @font-gray-1 | -
+--td-message-error-color | @error-color | -
+--td-message-info-color | @brand-color | -
+--td-message-success-color | @success-color | -
+--td-message-warning-color | @warning-color | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/message/README.md b/miniprogram_npm/tdesign-miniprogram/message/README.md
new file mode 100644
index 0000000..bd52765
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/README.md
@@ -0,0 +1,104 @@
+---
+title: Message 消息通知
+description: 用于轻量级反馈或提示,不会打断用户操作。
+spline: message
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-message": "tdesign-miniprogram/message/message"
+}
+```
+
+### 引入 API
+
+若以 API 形式调用 Message,则需在页面 `page.js` 中引入组件 API:
+
+```js
+import Message from 'tdesign-miniprogram/message/index';
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+弹窗内容为纯文本、标题和副标题、带输入框,用 API `Message.info` 方法调用反馈类对话框。
+
+
+{{ base }}
+
+
+### 组件状态
+
+消息通知类型为普通(info)、警示(warning)、成功(success)、错误(error)
+
+{{ theme }}
+
+## API
+
+### Message Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+action | String / Slot | - | 已废弃。操作。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+align | String | left | 文本对齐方式。可选项:left/center。TS 类型:`MessageAlignType` `type MessageAlignType = 'left' \| 'center'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/message/type.ts) | N
+close-btn | String / Boolean / Object / Slot | false | 关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string ,如:'user',则显示组件内置图标。值类型为 object ,则会透传至 icon 组件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content | String / Slot | - | 用于自定义消息弹出内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+duration | Number | 3000 | 消息内置计时器,计时到达时会触发 duration-end 事件。单位:毫秒。值为 0 则表示没有计时器。 | N
+gap | String / Number / Boolean | 12 | 两条 `message` 之间的间距 | N
+icon | String / Boolean / Object / Slot | true | 消息提醒前面的图标,可以自定义。值为 true 则根据 theme 显示对应的图标,值为 false 则不显示图标。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string ,如:'info',则显示组件内置图标。值类型为 object ,则会透传至 icon 组件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+link | String / Object / Slot | - | 链接名称。值为字符串表示链接名称,值为 `Object` 类型,表示透传至 `Link`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+marquee | Boolean / Object | false | 跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放。TS 类型:`boolean \| MessageMarquee` `interface MessageMarquee { speed?: number; loop?: number; delay?: number }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/message/type.ts) | N
+offset | Array | - | 相对于 placement 的偏移量,默认单位 rpx。示例:[-10, 20] 或 ['10rpx', '8rpx']。TS 类型:`Array` | N
+single | Boolean | true | 是否保持仅显示一条信息 | N
+theme | String | info | 消息组件风格。可选项:info/success/warning/error。TS 类型:`MessageThemeList` `type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/message/type.ts) | N
+visible | Boolean | false | 是否显示,隐藏时默认销毁组件 | N
+default-visible | Boolean | undefined | 是否显示,隐藏时默认销毁组件。非受控属性 | N
+z-index | Number | 15000 | 元素层级,样式默认为 15000 | N
+
+### Message Events
+
+名称 | 参数 | 描述
+-- | -- | --
+action-btn-click | - | 已废弃。当操作按钮存在时,用户点击操作按钮时触发
+close-btn-click | - | 当关闭按钮存在时,用户点击关闭按钮触发
+duration-end | \- | 计时结束后触发
+link-click | - | 当`link`链接存在时,点击链接文本时触发
+### Message External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-close-btn | 关闭按钮样式类
+t-class-content | 内容样式类
+t-class-icon | 图标样式类
+t-class-link | 链接样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-message-bg-color | @bg-color-container | -
+--td-message-border-radius | @radius-default | -
+--td-message-box-shadow | @shadow-4 | -
+--td-message-close-icon-color | @font-gray-3 | -
+--td-message-content-font-color | @font-gray-1 | -
+--td-message-error-color | @error-color | -
+--td-message-info-color | @brand-color | -
+--td-message-success-color | @success-color | -
+--td-message-warning-color | @warning-color | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/message/index.d.ts b/miniprogram_npm/tdesign-miniprogram/message/index.d.ts
new file mode 100644
index 0000000..a8cf1e3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/index.d.ts
@@ -0,0 +1,17 @@
+///
+///
+///
+import { MessageProps } from './message.interface';
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+interface MessageActionOptionsType extends Optional {
+ context?: Context;
+ selector?: string;
+}
+declare const _default: {
+ info(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ success(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ warning(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ error(options: MessageActionOptionsType): WechatMiniprogram.Component.TrivialInstance;
+ hide(options: MessageActionOptionsType): void;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/message/index.js b/miniprogram_npm/tdesign-miniprogram/message/index.js
new file mode 100644
index 0000000..7438e45
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/index.js
@@ -0,0 +1,47 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import { MessageType } from './message.interface';
+import { getInstance } from '../common/utils';
+const showMessage = function (options, theme = MessageType.info) {
+ const { context, selector = '#t-message' } = options, otherOptions = __rest(options, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (typeof otherOptions.single !== 'boolean') {
+ otherOptions.single = true;
+ }
+ if (instance) {
+ instance.setMessage(otherOptions, theme);
+ return instance;
+ }
+ console.error('未找到组件,请确认 selector && context 是否正确');
+};
+export default {
+ info(options) {
+ return showMessage(options, MessageType.info);
+ },
+ success(options) {
+ return showMessage(options, MessageType.success);
+ },
+ warning(options) {
+ return showMessage(options, MessageType.warning);
+ },
+ error(options) {
+ return showMessage(options, MessageType.error);
+ },
+ hide(options) {
+ const { context, selector = '#t-message' } = Object.assign({}, options);
+ const instance = getInstance(context, selector);
+ if (!instance) {
+ return;
+ }
+ instance.hide();
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.d.ts b/miniprogram_npm/tdesign-miniprogram/message/message.d.ts
new file mode 100644
index 0000000..e3de7ca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/message.d.ts
@@ -0,0 +1,37 @@
+///
+import { SuperComponent, ComponentsOptionsType } from '../common/src/index';
+import { MessageType, MessageProps } from './message.interface';
+export default class Message extends SuperComponent {
+ options: ComponentsOptionsType;
+ properties: MessageProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ messageList: any[];
+ };
+ index: number;
+ instances: any[];
+ gap: number;
+ observers: {
+ visible(value: any): void;
+ };
+ pageLifetimes: {
+ show(): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ memoInitialData(): void;
+ setMessage(msg: MessageProps, theme?: MessageType): void;
+ addMessage(msgObj: MessageProps): void;
+ getOffsetHeight(index?: number): number;
+ showMessageItem(options: MessageProps, id: string, offsetHeight: number): WechatMiniprogram.Component.TrivialInstance;
+ close(id: any): void;
+ hide(id?: string): void;
+ hideAll(): void;
+ removeInstance(id: any): void;
+ removeMsg(id: any): void;
+ handleClose(): void;
+ handleLinkClick(): void;
+ handleDurationEnd(): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.interface.d.ts b/miniprogram_npm/tdesign-miniprogram/message/message.interface.d.ts
new file mode 100644
index 0000000..1cfe3d8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/message.interface.d.ts
@@ -0,0 +1,28 @@
+export declare enum MessageType {
+ info = "info",
+ success = "success",
+ warning = "warning",
+ error = "error"
+}
+export interface MessageMarquee {
+ speed?: number;
+ loop?: number;
+ delay?: number;
+}
+export interface MessageProps {
+ visible?: boolean;
+ content: string;
+ align?: string;
+ theme?: MessageType;
+ icon?: boolean | string;
+ link?: string | object;
+ closeBtn?: boolean;
+ action?: string;
+ marquee?: MessageMarquee;
+ offset?: object;
+ duration?: number;
+ zIndex?: number;
+ id?: string;
+ gap?: string | number;
+ single?: boolean;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.interface.js b/miniprogram_npm/tdesign-miniprogram/message/message.interface.js
new file mode 100644
index 0000000..b345007
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/message.interface.js
@@ -0,0 +1,7 @@
+export var MessageType;
+(function (MessageType) {
+ MessageType["info"] = "info";
+ MessageType["success"] = "success";
+ MessageType["warning"] = "warning";
+ MessageType["error"] = "error";
+})(MessageType || (MessageType = {}));
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.js b/miniprogram_npm/tdesign-miniprogram/message/message.js
new file mode 100644
index 0000000..b240baa
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/message.js
@@ -0,0 +1,174 @@
+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 { MessageType } from './message.interface';
+import props from './props';
+import { unitConvert } from '../common/utils';
+const SHOW_DURATION = 400;
+const { prefix } = config;
+const name = `${prefix}-message`;
+let Message = class Message extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = Object.assign({}, props);
+ this.data = {
+ prefix,
+ classPrefix: name,
+ messageList: [],
+ };
+ this.index = 0;
+ this.instances = [];
+ this.gap = 12;
+ this.observers = {
+ visible(value) {
+ if (value) {
+ this.setMessage(this.properties, this.properties.theme);
+ }
+ else {
+ this.setData({
+ messageList: [],
+ });
+ }
+ },
+ };
+ this.pageLifetimes = {
+ show() {
+ this.hideAll();
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.memoInitialData();
+ },
+ };
+ }
+ memoInitialData() {
+ this.initialData = Object.assign(Object.assign({}, this.properties), this.data);
+ }
+ setMessage(msg, theme = MessageType.info) {
+ let id = `${name}_${this.index}`;
+ if (msg.single) {
+ id = name;
+ }
+ this.gap = unitConvert(msg.gap || this.gap);
+ const msgObj = Object.assign(Object.assign({}, msg), { theme,
+ id, gap: this.gap });
+ const instanceIndex = this.instances.findIndex((x) => x.id === id);
+ if (instanceIndex < 0) {
+ this.addMessage(msgObj);
+ }
+ else {
+ const instance = this.instances[instanceIndex];
+ const offsetHeight = this.getOffsetHeight(instanceIndex);
+ instance.resetData(() => {
+ instance.setData(msgObj, instance.show.bind(instance, offsetHeight));
+ instance.onHide = () => {
+ this.close(id);
+ };
+ });
+ }
+ }
+ addMessage(msgObj) {
+ const list = [...this.data.messageList, { id: msgObj.id }];
+ this.setData({
+ messageList: list,
+ }, () => {
+ const offsetHeight = this.getOffsetHeight();
+ const instance = this.showMessageItem(msgObj, msgObj.id, offsetHeight);
+ if (this.instances) {
+ this.instances.push(instance);
+ this.index += 1;
+ }
+ });
+ }
+ getOffsetHeight(index = -1) {
+ let offsetHeight = 0;
+ let len = index;
+ if (len === -1 || len > this.instances.length) {
+ len = this.instances.length;
+ }
+ for (let i = 0; i < len; i += 1) {
+ const instance = this.instances[i];
+ offsetHeight += instance.data.height + instance.data.gap;
+ }
+ return offsetHeight;
+ }
+ showMessageItem(options, id, offsetHeight) {
+ const instance = this.selectComponent(`#${id}`);
+ if (instance) {
+ instance.resetData(() => {
+ instance.setData(options, instance.show.bind(instance, offsetHeight));
+ instance.onHide = () => {
+ this.close(id);
+ };
+ });
+ return instance;
+ }
+ console.error('未找到组件,请确认 selector && context 是否正确');
+ }
+ close(id) {
+ setTimeout(() => {
+ this.removeMsg(id);
+ }, SHOW_DURATION);
+ this.removeInstance(id);
+ }
+ hide(id) {
+ if (!id) {
+ this.hideAll();
+ }
+ const instance = this.instances.find((x) => x.id === id);
+ if (instance) {
+ instance.hide();
+ }
+ }
+ hideAll() {
+ for (let i = 0; i < this.instances.length;) {
+ const instance = this.instances[i];
+ instance.hide();
+ }
+ }
+ removeInstance(id) {
+ const index = this.instances.findIndex((x) => x.id === id);
+ if (index < 0)
+ return;
+ const instance = this.instances[index];
+ const removedHeight = instance.data.height;
+ this.instances.splice(index, 1);
+ for (let i = index; i < this.instances.length; i += 1) {
+ const instance = this.instances[i];
+ instance.setData({
+ wrapTop: instance.data.wrapTop - removedHeight - instance.data.gap,
+ });
+ }
+ }
+ removeMsg(id) {
+ const msgIndex = this.data.messageList.findIndex((x) => x.id === id);
+ if (msgIndex > -1) {
+ this.data.messageList.splice(msgIndex, 1);
+ this.setData({
+ messageList: this.data.messageList,
+ });
+ }
+ }
+ handleClose() {
+ this.triggerEvent('close-btn-click');
+ }
+ handleLinkClick() {
+ this.triggerEvent('link-click');
+ }
+ handleDurationEnd() {
+ this.triggerEvent('duration-end');
+ }
+};
+Message = __decorate([
+ wxComponent()
+], Message);
+export default Message;
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.json b/miniprogram_npm/tdesign-miniprogram/message/message.json
new file mode 100644
index 0000000..6277a4f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/message.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-message-item": "../message-item/message-item"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.wxml b/miniprogram_npm/tdesign-miniprogram/message/message.wxml
new file mode 100644
index 0000000..75b002c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/message.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/message/message.wxss b/miniprogram_npm/tdesign-miniprogram/message/message.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/message/props.d.ts b/miniprogram_npm/tdesign-miniprogram/message/props.d.ts
new file mode 100644
index 0000000..c5a8f65
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/props.d.ts
@@ -0,0 +1,3 @@
+import { TdMessageProps } from './type';
+declare const props: TdMessageProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/message/props.js b/miniprogram_npm/tdesign-miniprogram/message/props.js
new file mode 100644
index 0000000..9d0e022
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/props.js
@@ -0,0 +1,56 @@
+const props = {
+ align: {
+ type: String,
+ value: 'left',
+ },
+ closeBtn: {
+ type: null,
+ value: false,
+ },
+ content: {
+ type: String,
+ },
+ duration: {
+ type: Number,
+ value: 3000,
+ },
+ gap: {
+ type: null,
+ value: 12,
+ },
+ icon: {
+ type: null,
+ value: true,
+ },
+ link: {
+ type: null,
+ },
+ marquee: {
+ type: null,
+ value: false,
+ },
+ offset: {
+ type: Array,
+ },
+ single: {
+ type: Boolean,
+ value: true,
+ },
+ theme: {
+ type: String,
+ value: 'info',
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+ defaultVisible: {
+ type: Boolean,
+ value: false,
+ },
+ zIndex: {
+ type: Number,
+ value: 15000,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/message/type.d.ts b/miniprogram_npm/tdesign-miniprogram/message/type.d.ts
new file mode 100644
index 0000000..718bb3a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/type.d.ts
@@ -0,0 +1,65 @@
+export interface TdMessageProps {
+ align?: {
+ type: StringConstructor;
+ value?: MessageAlignType;
+ };
+ closeBtn?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ gap?: {
+ type: null;
+ value?: string | number | boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ link?: {
+ type: null;
+ value?: string | object;
+ };
+ marquee?: {
+ type: null;
+ value?: boolean | MessageMarquee;
+ };
+ offset?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ single?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: MessageThemeList;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultVisible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
+export declare type MessageAlignType = 'left' | 'center';
+export interface MessageMarquee {
+ speed?: number;
+ loop?: number;
+ delay?: number;
+}
+export declare type MessageThemeList = 'info' | 'success' | 'warning' | 'error';
diff --git a/miniprogram_npm/tdesign-miniprogram/message/type.js b/miniprogram_npm/tdesign-miniprogram/message/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/message/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/index.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/index.js
new file mode 100644
index 0000000..61916d8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/index.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var u=function(_,t){return i.test(t)?n[_.month()]:s[_.month()]};u.s=s,u.f=n;var a=function(_,t){return i.test(t)?r[_.month()]:o[_.month()]};a.s=o,a.f=r;var m={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:u,monthsShort:a,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:d,mm:d,h:"час",hh:d,d:"день",dd:d,M:"месяц",MM:d,y:"год",yy:d},ordinal:function(_){return _},meridiem:function(_){return _<4?"ночи":_<12?"утра":_<17?"дня":"вечера"}};return e.default.locale(m,null,!0),m}));
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/locale/zh-cn.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/locale/zh-cn.js
new file mode 100644
index 0000000..21cf228
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/locale/zh-cn.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return"W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/locale/zh-tw.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/locale/zh-tw.js
new file mode 100644
index 0000000..5970f17
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/locale/zh-tw.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_zh_tw=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(_,e){return"W"===e?_+"週":_+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(_,e){var t=100*_+e;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/plugin/localeData.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/plugin/localeData.js
new file mode 100644
index 0000000..55e01ee
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/dayjs/plugin/localeData.js
@@ -0,0 +1 @@
+!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_localeData=e()}(this,(function(){"use strict";return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return{months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return{firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)}}}));
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_Symbol.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_Symbol.js
new file mode 100644
index 0000000..a013f7c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_Symbol.js
@@ -0,0 +1,6 @@
+var root = require('./_root');
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+module.exports = Symbol;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_baseGetTag.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_baseGetTag.js
new file mode 100644
index 0000000..b927ccc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_baseGetTag.js
@@ -0,0 +1,28 @@
+var Symbol = require('./_Symbol'),
+ getRawTag = require('./_getRawTag'),
+ objectToString = require('./_objectToString');
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+module.exports = baseGetTag;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_freeGlobal.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_freeGlobal.js
new file mode 100644
index 0000000..bbec998
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_freeGlobal.js
@@ -0,0 +1,4 @@
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+module.exports = freeGlobal;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_getRawTag.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_getRawTag.js
new file mode 100644
index 0000000..49a95c9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_getRawTag.js
@@ -0,0 +1,46 @@
+var Symbol = require('./_Symbol');
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
+
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
+ }
+ return result;
+}
+
+module.exports = getRawTag;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_objectToString.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_objectToString.js
new file mode 100644
index 0000000..c614ec0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_objectToString.js
@@ -0,0 +1,22 @@
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+function objectToString(value) {
+ return nativeObjectToString.call(value);
+}
+
+module.exports = objectToString;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_root.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_root.js
new file mode 100644
index 0000000..d2852be
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/_root.js
@@ -0,0 +1,9 @@
+var freeGlobal = require('./_freeGlobal');
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+module.exports = root;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isArray.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isArray.js
new file mode 100644
index 0000000..88ab55f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isArray.js
@@ -0,0 +1,26 @@
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+module.exports = isArray;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isFunction.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isFunction.js
new file mode 100644
index 0000000..907a8cd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isFunction.js
@@ -0,0 +1,37 @@
+var baseGetTag = require('./_baseGetTag'),
+ isObject = require('./isObject');
+
+/** `Object#toString` result references. */
+var asyncTag = '[object AsyncFunction]',
+ funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ proxyTag = '[object Proxy]';
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ }
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
+}
+
+module.exports = isFunction;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isNull.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isNull.js
new file mode 100644
index 0000000..c0a374d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isNull.js
@@ -0,0 +1,22 @@
+/**
+ * Checks if `value` is `null`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
+ * @example
+ *
+ * _.isNull(null);
+ * // => true
+ *
+ * _.isNull(void 0);
+ * // => false
+ */
+function isNull(value) {
+ return value === null;
+}
+
+module.exports = isNull;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isObject.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isObject.js
new file mode 100644
index 0000000..1dc8939
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isObject.js
@@ -0,0 +1,31 @@
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+}
+
+module.exports = isObject;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isObjectLike.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isObjectLike.js
new file mode 100644
index 0000000..301716b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isObjectLike.js
@@ -0,0 +1,29 @@
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isString.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isString.js
new file mode 100644
index 0000000..627eb9c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/lodash/isString.js
@@ -0,0 +1,30 @@
+var baseGetTag = require('./_baseGetTag'),
+ isArray = require('./isArray'),
+ isObjectLike = require('./isObjectLike');
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' ||
+ (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
+}
+
+module.exports = isString;
diff --git a/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/tinycolor2/index.js b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/tinycolor2/index.js
new file mode 100644
index 0000000..4f584ca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/miniprogram_npm/tinycolor2/index.js
@@ -0,0 +1,1188 @@
+// This file is autogenerated. It's used to publish CJS to npm.
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.tinycolor = factory());
+})(this, (function () { 'use strict';
+
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+ }
+
+ // https://github.com/bgrins/TinyColor
+ // Brian Grinstead, MIT License
+
+ var trimLeft = /^\s+/;
+ var trimRight = /\s+$/;
+ function tinycolor(color, opts) {
+ color = color ? color : "";
+ opts = opts || {};
+
+ // If input is already a tinycolor, return itself
+ if (color instanceof tinycolor) {
+ return color;
+ }
+ // If we are called as a function, call using new instead
+ if (!(this instanceof tinycolor)) {
+ return new tinycolor(color, opts);
+ }
+ var rgb = inputToRGB(color);
+ this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
+ this._gradientType = opts.gradientType;
+
+ // Don't let the range of [0,255] come back in [0,1].
+ // Potentially lose a little bit of precision here, but will fix issues where
+ // .5 gets interpreted as half of the total, instead of half of 1
+ // If it was supposed to be 128, this was already taken care of by `inputToRgb`
+ if (this._r < 1) this._r = Math.round(this._r);
+ if (this._g < 1) this._g = Math.round(this._g);
+ if (this._b < 1) this._b = Math.round(this._b);
+ this._ok = rgb.ok;
+ }
+ tinycolor.prototype = {
+ isDark: function isDark() {
+ return this.getBrightness() < 128;
+ },
+ isLight: function isLight() {
+ return !this.isDark();
+ },
+ isValid: function isValid() {
+ return this._ok;
+ },
+ getOriginalInput: function getOriginalInput() {
+ return this._originalInput;
+ },
+ getFormat: function getFormat() {
+ return this._format;
+ },
+ getAlpha: function getAlpha() {
+ return this._a;
+ },
+ getBrightness: function getBrightness() {
+ //http://www.w3.org/TR/AERT#color-contrast
+ var rgb = this.toRgb();
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
+ },
+ getLuminance: function getLuminance() {
+ //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
+ var rgb = this.toRgb();
+ var RsRGB, GsRGB, BsRGB, R, G, B;
+ RsRGB = rgb.r / 255;
+ GsRGB = rgb.g / 255;
+ BsRGB = rgb.b / 255;
+ if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
+ if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
+ if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
+ },
+ setAlpha: function setAlpha(value) {
+ this._a = boundAlpha(value);
+ this._roundA = Math.round(100 * this._a) / 100;
+ return this;
+ },
+ toHsv: function toHsv() {
+ var hsv = rgbToHsv(this._r, this._g, this._b);
+ return {
+ h: hsv.h * 360,
+ s: hsv.s,
+ v: hsv.v,
+ a: this._a
+ };
+ },
+ toHsvString: function toHsvString() {
+ var hsv = rgbToHsv(this._r, this._g, this._b);
+ var h = Math.round(hsv.h * 360),
+ s = Math.round(hsv.s * 100),
+ v = Math.round(hsv.v * 100);
+ return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
+ },
+ toHsl: function toHsl() {
+ var hsl = rgbToHsl(this._r, this._g, this._b);
+ return {
+ h: hsl.h * 360,
+ s: hsl.s,
+ l: hsl.l,
+ a: this._a
+ };
+ },
+ toHslString: function toHslString() {
+ var hsl = rgbToHsl(this._r, this._g, this._b);
+ var h = Math.round(hsl.h * 360),
+ s = Math.round(hsl.s * 100),
+ l = Math.round(hsl.l * 100);
+ return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
+ },
+ toHex: function toHex(allow3Char) {
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
+ },
+ toHexString: function toHexString(allow3Char) {
+ return "#" + this.toHex(allow3Char);
+ },
+ toHex8: function toHex8(allow4Char) {
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
+ },
+ toHex8String: function toHex8String(allow4Char) {
+ return "#" + this.toHex8(allow4Char);
+ },
+ toRgb: function toRgb() {
+ return {
+ r: Math.round(this._r),
+ g: Math.round(this._g),
+ b: Math.round(this._b),
+ a: this._a
+ };
+ },
+ toRgbString: function toRgbString() {
+ return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
+ },
+ toPercentageRgb: function toPercentageRgb() {
+ return {
+ r: Math.round(bound01(this._r, 255) * 100) + "%",
+ g: Math.round(bound01(this._g, 255) * 100) + "%",
+ b: Math.round(bound01(this._b, 255) * 100) + "%",
+ a: this._a
+ };
+ },
+ toPercentageRgbString: function toPercentageRgbString() {
+ return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
+ },
+ toName: function toName() {
+ if (this._a === 0) {
+ return "transparent";
+ }
+ if (this._a < 1) {
+ return false;
+ }
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
+ },
+ toFilter: function toFilter(secondColor) {
+ var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
+ var secondHex8String = hex8String;
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
+ if (secondColor) {
+ var s = tinycolor(secondColor);
+ secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
+ }
+ return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
+ },
+ toString: function toString(format) {
+ var formatSet = !!format;
+ format = format || this._format;
+ var formattedString = false;
+ var hasAlpha = this._a < 1 && this._a >= 0;
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
+ if (needsAlphaFormat) {
+ // Special case for "transparent", all other non-alpha formats
+ // will return rgba when there is transparency.
+ if (format === "name" && this._a === 0) {
+ return this.toName();
+ }
+ return this.toRgbString();
+ }
+ if (format === "rgb") {
+ formattedString = this.toRgbString();
+ }
+ if (format === "prgb") {
+ formattedString = this.toPercentageRgbString();
+ }
+ if (format === "hex" || format === "hex6") {
+ formattedString = this.toHexString();
+ }
+ if (format === "hex3") {
+ formattedString = this.toHexString(true);
+ }
+ if (format === "hex4") {
+ formattedString = this.toHex8String(true);
+ }
+ if (format === "hex8") {
+ formattedString = this.toHex8String();
+ }
+ if (format === "name") {
+ formattedString = this.toName();
+ }
+ if (format === "hsl") {
+ formattedString = this.toHslString();
+ }
+ if (format === "hsv") {
+ formattedString = this.toHsvString();
+ }
+ return formattedString || this.toHexString();
+ },
+ clone: function clone() {
+ return tinycolor(this.toString());
+ },
+ _applyModification: function _applyModification(fn, args) {
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
+ this._r = color._r;
+ this._g = color._g;
+ this._b = color._b;
+ this.setAlpha(color._a);
+ return this;
+ },
+ lighten: function lighten() {
+ return this._applyModification(_lighten, arguments);
+ },
+ brighten: function brighten() {
+ return this._applyModification(_brighten, arguments);
+ },
+ darken: function darken() {
+ return this._applyModification(_darken, arguments);
+ },
+ desaturate: function desaturate() {
+ return this._applyModification(_desaturate, arguments);
+ },
+ saturate: function saturate() {
+ return this._applyModification(_saturate, arguments);
+ },
+ greyscale: function greyscale() {
+ return this._applyModification(_greyscale, arguments);
+ },
+ spin: function spin() {
+ return this._applyModification(_spin, arguments);
+ },
+ _applyCombination: function _applyCombination(fn, args) {
+ return fn.apply(null, [this].concat([].slice.call(args)));
+ },
+ analogous: function analogous() {
+ return this._applyCombination(_analogous, arguments);
+ },
+ complement: function complement() {
+ return this._applyCombination(_complement, arguments);
+ },
+ monochromatic: function monochromatic() {
+ return this._applyCombination(_monochromatic, arguments);
+ },
+ splitcomplement: function splitcomplement() {
+ return this._applyCombination(_splitcomplement, arguments);
+ },
+ // Disabled until https://github.com/bgrins/TinyColor/issues/254
+ // polyad: function (number) {
+ // return this._applyCombination(polyad, [number]);
+ // },
+ triad: function triad() {
+ return this._applyCombination(polyad, [3]);
+ },
+ tetrad: function tetrad() {
+ return this._applyCombination(polyad, [4]);
+ }
+ };
+
+ // If input is an object, force 1 into "1.0" to handle ratios properly
+ // String input requires "1.0" as input, so 1 will be treated as 1
+ tinycolor.fromRatio = function (color, opts) {
+ if (_typeof(color) == "object") {
+ var newColor = {};
+ for (var i in color) {
+ if (color.hasOwnProperty(i)) {
+ if (i === "a") {
+ newColor[i] = color[i];
+ } else {
+ newColor[i] = convertToPercentage(color[i]);
+ }
+ }
+ }
+ color = newColor;
+ }
+ return tinycolor(color, opts);
+ };
+
+ // Given a string or object, convert that input to RGB
+ // Possible string inputs:
+ //
+ // "red"
+ // "#f00" or "f00"
+ // "#ff0000" or "ff0000"
+ // "#ff000000" or "ff000000"
+ // "rgb 255 0 0" or "rgb (255, 0, 0)"
+ // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
+ // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
+ // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
+ // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
+ // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
+ // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
+ //
+ function inputToRGB(color) {
+ var rgb = {
+ r: 0,
+ g: 0,
+ b: 0
+ };
+ var a = 1;
+ var s = null;
+ var v = null;
+ var l = null;
+ var ok = false;
+ var format = false;
+ if (typeof color == "string") {
+ color = stringInputToObject(color);
+ }
+ if (_typeof(color) == "object") {
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
+ rgb = rgbToRgb(color.r, color.g, color.b);
+ ok = true;
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
+ s = convertToPercentage(color.s);
+ v = convertToPercentage(color.v);
+ rgb = hsvToRgb(color.h, s, v);
+ ok = true;
+ format = "hsv";
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
+ s = convertToPercentage(color.s);
+ l = convertToPercentage(color.l);
+ rgb = hslToRgb(color.h, s, l);
+ ok = true;
+ format = "hsl";
+ }
+ if (color.hasOwnProperty("a")) {
+ a = color.a;
+ }
+ }
+ a = boundAlpha(a);
+ return {
+ ok: ok,
+ format: color.format || format,
+ r: Math.min(255, Math.max(rgb.r, 0)),
+ g: Math.min(255, Math.max(rgb.g, 0)),
+ b: Math.min(255, Math.max(rgb.b, 0)),
+ a: a
+ };
+ }
+
+ // Conversion Functions
+ // --------------------
+
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
+ //
+
+ // `rgbToRgb`
+ // Handle bounds / percentage checking to conform to CSS color spec
+ //
+ // *Assumes:* r, g, b in [0, 255] or [0, 1]
+ // *Returns:* { r, g, b } in [0, 255]
+ function rgbToRgb(r, g, b) {
+ return {
+ r: bound01(r, 255) * 255,
+ g: bound01(g, 255) * 255,
+ b: bound01(b, 255) * 255
+ };
+ }
+
+ // `rgbToHsl`
+ // Converts an RGB color value to HSL.
+ // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
+ // *Returns:* { h, s, l } in [0,1]
+ function rgbToHsl(r, g, b) {
+ r = bound01(r, 255);
+ g = bound01(g, 255);
+ b = bound01(b, 255);
+ var max = Math.max(r, g, b),
+ min = Math.min(r, g, b);
+ var h,
+ s,
+ l = (max + min) / 2;
+ if (max == min) {
+ h = s = 0; // achromatic
+ } else {
+ var d = max - min;
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+ switch (max) {
+ case r:
+ h = (g - b) / d + (g < b ? 6 : 0);
+ break;
+ case g:
+ h = (b - r) / d + 2;
+ break;
+ case b:
+ h = (r - g) / d + 4;
+ break;
+ }
+ h /= 6;
+ }
+ return {
+ h: h,
+ s: s,
+ l: l
+ };
+ }
+
+ // `hslToRgb`
+ // Converts an HSL color value to RGB.
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
+ // *Returns:* { r, g, b } in the set [0, 255]
+ function hslToRgb(h, s, l) {
+ var r, g, b;
+ h = bound01(h, 360);
+ s = bound01(s, 100);
+ l = bound01(l, 100);
+ function hue2rgb(p, q, t) {
+ if (t < 0) t += 1;
+ if (t > 1) t -= 1;
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
+ if (t < 1 / 2) return q;
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+ return p;
+ }
+ if (s === 0) {
+ r = g = b = l; // achromatic
+ } else {
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ var p = 2 * l - q;
+ r = hue2rgb(p, q, h + 1 / 3);
+ g = hue2rgb(p, q, h);
+ b = hue2rgb(p, q, h - 1 / 3);
+ }
+ return {
+ r: r * 255,
+ g: g * 255,
+ b: b * 255
+ };
+ }
+
+ // `rgbToHsv`
+ // Converts an RGB color value to HSV
+ // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
+ // *Returns:* { h, s, v } in [0,1]
+ function rgbToHsv(r, g, b) {
+ r = bound01(r, 255);
+ g = bound01(g, 255);
+ b = bound01(b, 255);
+ var max = Math.max(r, g, b),
+ min = Math.min(r, g, b);
+ var h,
+ s,
+ v = max;
+ var d = max - min;
+ s = max === 0 ? 0 : d / max;
+ if (max == min) {
+ h = 0; // achromatic
+ } else {
+ switch (max) {
+ case r:
+ h = (g - b) / d + (g < b ? 6 : 0);
+ break;
+ case g:
+ h = (b - r) / d + 2;
+ break;
+ case b:
+ h = (r - g) / d + 4;
+ break;
+ }
+ h /= 6;
+ }
+ return {
+ h: h,
+ s: s,
+ v: v
+ };
+ }
+
+ // `hsvToRgb`
+ // Converts an HSV color value to RGB.
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
+ // *Returns:* { r, g, b } in the set [0, 255]
+ function hsvToRgb(h, s, v) {
+ h = bound01(h, 360) * 6;
+ s = bound01(s, 100);
+ v = bound01(v, 100);
+ var i = Math.floor(h),
+ f = h - i,
+ p = v * (1 - s),
+ q = v * (1 - f * s),
+ t = v * (1 - (1 - f) * s),
+ mod = i % 6,
+ r = [v, q, p, p, t, v][mod],
+ g = [t, v, v, q, p, p][mod],
+ b = [p, p, t, v, v, q][mod];
+ return {
+ r: r * 255,
+ g: g * 255,
+ b: b * 255
+ };
+ }
+
+ // `rgbToHex`
+ // Converts an RGB color to hex
+ // Assumes r, g, and b are contained in the set [0, 255]
+ // Returns a 3 or 6 character hex
+ function rgbToHex(r, g, b, allow3Char) {
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
+
+ // Return a 3 character hex if possible
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
+ }
+ return hex.join("");
+ }
+
+ // `rgbaToHex`
+ // Converts an RGBA color plus alpha transparency to hex
+ // Assumes r, g, b are contained in the set [0, 255] and
+ // a in [0, 1]. Returns a 4 or 8 character rgba hex
+ function rgbaToHex(r, g, b, a, allow4Char) {
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
+
+ // Return a 4 character hex if possible
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
+ }
+ return hex.join("");
+ }
+
+ // `rgbaToArgbHex`
+ // Converts an RGBA color to an ARGB Hex8 string
+ // Rarely used, but required for "toFilter()"
+ function rgbaToArgbHex(r, g, b, a) {
+ var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
+ return hex.join("");
+ }
+
+ // `equals`
+ // Can be called with any tinycolor input
+ tinycolor.equals = function (color1, color2) {
+ if (!color1 || !color2) return false;
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
+ };
+ tinycolor.random = function () {
+ return tinycolor.fromRatio({
+ r: Math.random(),
+ g: Math.random(),
+ b: Math.random()
+ });
+ };
+
+ // Modification Functions
+ // ----------------------
+ // Thanks to less.js for some of the basics here
+ //
+
+ function _desaturate(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.s -= amount / 100;
+ hsl.s = clamp01(hsl.s);
+ return tinycolor(hsl);
+ }
+ function _saturate(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.s += amount / 100;
+ hsl.s = clamp01(hsl.s);
+ return tinycolor(hsl);
+ }
+ function _greyscale(color) {
+ return tinycolor(color).desaturate(100);
+ }
+ function _lighten(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.l += amount / 100;
+ hsl.l = clamp01(hsl.l);
+ return tinycolor(hsl);
+ }
+ function _brighten(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var rgb = tinycolor(color).toRgb();
+ rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
+ rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
+ rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
+ return tinycolor(rgb);
+ }
+ function _darken(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.l -= amount / 100;
+ hsl.l = clamp01(hsl.l);
+ return tinycolor(hsl);
+ }
+
+ // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
+ // Values outside of this range will be wrapped into this range.
+ function _spin(color, amount) {
+ var hsl = tinycolor(color).toHsl();
+ var hue = (hsl.h + amount) % 360;
+ hsl.h = hue < 0 ? 360 + hue : hue;
+ return tinycolor(hsl);
+ }
+
+ // Combination Functions
+ // ---------------------
+ // Thanks to jQuery xColor for some of the ideas behind these
+ //
+
+ function _complement(color) {
+ var hsl = tinycolor(color).toHsl();
+ hsl.h = (hsl.h + 180) % 360;
+ return tinycolor(hsl);
+ }
+ function polyad(color, number) {
+ if (isNaN(number) || number <= 0) {
+ throw new Error("Argument to polyad must be a positive number");
+ }
+ var hsl = tinycolor(color).toHsl();
+ var result = [tinycolor(color)];
+ var step = 360 / number;
+ for (var i = 1; i < number; i++) {
+ result.push(tinycolor({
+ h: (hsl.h + i * step) % 360,
+ s: hsl.s,
+ l: hsl.l
+ }));
+ }
+ return result;
+ }
+ function _splitcomplement(color) {
+ var hsl = tinycolor(color).toHsl();
+ var h = hsl.h;
+ return [tinycolor(color), tinycolor({
+ h: (h + 72) % 360,
+ s: hsl.s,
+ l: hsl.l
+ }), tinycolor({
+ h: (h + 216) % 360,
+ s: hsl.s,
+ l: hsl.l
+ })];
+ }
+ function _analogous(color, results, slices) {
+ results = results || 6;
+ slices = slices || 30;
+ var hsl = tinycolor(color).toHsl();
+ var part = 360 / slices;
+ var ret = [tinycolor(color)];
+ for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
+ hsl.h = (hsl.h + part) % 360;
+ ret.push(tinycolor(hsl));
+ }
+ return ret;
+ }
+ function _monochromatic(color, results) {
+ results = results || 6;
+ var hsv = tinycolor(color).toHsv();
+ var h = hsv.h,
+ s = hsv.s,
+ v = hsv.v;
+ var ret = [];
+ var modification = 1 / results;
+ while (results--) {
+ ret.push(tinycolor({
+ h: h,
+ s: s,
+ v: v
+ }));
+ v = (v + modification) % 1;
+ }
+ return ret;
+ }
+
+ // Utility Functions
+ // ---------------------
+
+ tinycolor.mix = function (color1, color2, amount) {
+ amount = amount === 0 ? 0 : amount || 50;
+ var rgb1 = tinycolor(color1).toRgb();
+ var rgb2 = tinycolor(color2).toRgb();
+ var p = amount / 100;
+ var rgba = {
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
+ b: (rgb2.b - rgb1.b) * p + rgb1.b,
+ a: (rgb2.a - rgb1.a) * p + rgb1.a
+ };
+ return tinycolor(rgba);
+ };
+
+ // Readability Functions
+ // ---------------------
+ // false
+ // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
+ tinycolor.isReadable = function (color1, color2, wcag2) {
+ var readability = tinycolor.readability(color1, color2);
+ var wcag2Parms, out;
+ out = false;
+ wcag2Parms = validateWCAG2Parms(wcag2);
+ switch (wcag2Parms.level + wcag2Parms.size) {
+ case "AAsmall":
+ case "AAAlarge":
+ out = readability >= 4.5;
+ break;
+ case "AAlarge":
+ out = readability >= 3;
+ break;
+ case "AAAsmall":
+ out = readability >= 7;
+ break;
+ }
+ return out;
+ };
+
+ // `mostReadable`
+ // Given a base color and a list of possible foreground or background
+ // colors for that base, returns the most readable color.
+ // Optionally returns Black or White if the most readable color is unreadable.
+ // *Example*
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
+ tinycolor.mostReadable = function (baseColor, colorList, args) {
+ var bestColor = null;
+ var bestScore = 0;
+ var readability;
+ var includeFallbackColors, level, size;
+ args = args || {};
+ includeFallbackColors = args.includeFallbackColors;
+ level = args.level;
+ size = args.size;
+ for (var i = 0; i < colorList.length; i++) {
+ readability = tinycolor.readability(baseColor, colorList[i]);
+ if (readability > bestScore) {
+ bestScore = readability;
+ bestColor = tinycolor(colorList[i]);
+ }
+ }
+ if (tinycolor.isReadable(baseColor, bestColor, {
+ level: level,
+ size: size
+ }) || !includeFallbackColors) {
+ return bestColor;
+ } else {
+ args.includeFallbackColors = false;
+ return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
+ }
+ };
+
+ // Big List of Colors
+ // ------------------
+ //
+ var names = tinycolor.names = {
+ aliceblue: "f0f8ff",
+ antiquewhite: "faebd7",
+ aqua: "0ff",
+ aquamarine: "7fffd4",
+ azure: "f0ffff",
+ beige: "f5f5dc",
+ bisque: "ffe4c4",
+ black: "000",
+ blanchedalmond: "ffebcd",
+ blue: "00f",
+ blueviolet: "8a2be2",
+ brown: "a52a2a",
+ burlywood: "deb887",
+ burntsienna: "ea7e5d",
+ cadetblue: "5f9ea0",
+ chartreuse: "7fff00",
+ chocolate: "d2691e",
+ coral: "ff7f50",
+ cornflowerblue: "6495ed",
+ cornsilk: "fff8dc",
+ crimson: "dc143c",
+ cyan: "0ff",
+ darkblue: "00008b",
+ darkcyan: "008b8b",
+ darkgoldenrod: "b8860b",
+ darkgray: "a9a9a9",
+ darkgreen: "006400",
+ darkgrey: "a9a9a9",
+ darkkhaki: "bdb76b",
+ darkmagenta: "8b008b",
+ darkolivegreen: "556b2f",
+ darkorange: "ff8c00",
+ darkorchid: "9932cc",
+ darkred: "8b0000",
+ darksalmon: "e9967a",
+ darkseagreen: "8fbc8f",
+ darkslateblue: "483d8b",
+ darkslategray: "2f4f4f",
+ darkslategrey: "2f4f4f",
+ darkturquoise: "00ced1",
+ darkviolet: "9400d3",
+ deeppink: "ff1493",
+ deepskyblue: "00bfff",
+ dimgray: "696969",
+ dimgrey: "696969",
+ dodgerblue: "1e90ff",
+ firebrick: "b22222",
+ floralwhite: "fffaf0",
+ forestgreen: "228b22",
+ fuchsia: "f0f",
+ gainsboro: "dcdcdc",
+ ghostwhite: "f8f8ff",
+ gold: "ffd700",
+ goldenrod: "daa520",
+ gray: "808080",
+ green: "008000",
+ greenyellow: "adff2f",
+ grey: "808080",
+ honeydew: "f0fff0",
+ hotpink: "ff69b4",
+ indianred: "cd5c5c",
+ indigo: "4b0082",
+ ivory: "fffff0",
+ khaki: "f0e68c",
+ lavender: "e6e6fa",
+ lavenderblush: "fff0f5",
+ lawngreen: "7cfc00",
+ lemonchiffon: "fffacd",
+ lightblue: "add8e6",
+ lightcoral: "f08080",
+ lightcyan: "e0ffff",
+ lightgoldenrodyellow: "fafad2",
+ lightgray: "d3d3d3",
+ lightgreen: "90ee90",
+ lightgrey: "d3d3d3",
+ lightpink: "ffb6c1",
+ lightsalmon: "ffa07a",
+ lightseagreen: "20b2aa",
+ lightskyblue: "87cefa",
+ lightslategray: "789",
+ lightslategrey: "789",
+ lightsteelblue: "b0c4de",
+ lightyellow: "ffffe0",
+ lime: "0f0",
+ limegreen: "32cd32",
+ linen: "faf0e6",
+ magenta: "f0f",
+ maroon: "800000",
+ mediumaquamarine: "66cdaa",
+ mediumblue: "0000cd",
+ mediumorchid: "ba55d3",
+ mediumpurple: "9370db",
+ mediumseagreen: "3cb371",
+ mediumslateblue: "7b68ee",
+ mediumspringgreen: "00fa9a",
+ mediumturquoise: "48d1cc",
+ mediumvioletred: "c71585",
+ midnightblue: "191970",
+ mintcream: "f5fffa",
+ mistyrose: "ffe4e1",
+ moccasin: "ffe4b5",
+ navajowhite: "ffdead",
+ navy: "000080",
+ oldlace: "fdf5e6",
+ olive: "808000",
+ olivedrab: "6b8e23",
+ orange: "ffa500",
+ orangered: "ff4500",
+ orchid: "da70d6",
+ palegoldenrod: "eee8aa",
+ palegreen: "98fb98",
+ paleturquoise: "afeeee",
+ palevioletred: "db7093",
+ papayawhip: "ffefd5",
+ peachpuff: "ffdab9",
+ peru: "cd853f",
+ pink: "ffc0cb",
+ plum: "dda0dd",
+ powderblue: "b0e0e6",
+ purple: "800080",
+ rebeccapurple: "663399",
+ red: "f00",
+ rosybrown: "bc8f8f",
+ royalblue: "4169e1",
+ saddlebrown: "8b4513",
+ salmon: "fa8072",
+ sandybrown: "f4a460",
+ seagreen: "2e8b57",
+ seashell: "fff5ee",
+ sienna: "a0522d",
+ silver: "c0c0c0",
+ skyblue: "87ceeb",
+ slateblue: "6a5acd",
+ slategray: "708090",
+ slategrey: "708090",
+ snow: "fffafa",
+ springgreen: "00ff7f",
+ steelblue: "4682b4",
+ tan: "d2b48c",
+ teal: "008080",
+ thistle: "d8bfd8",
+ tomato: "ff6347",
+ turquoise: "40e0d0",
+ violet: "ee82ee",
+ wheat: "f5deb3",
+ white: "fff",
+ whitesmoke: "f5f5f5",
+ yellow: "ff0",
+ yellowgreen: "9acd32"
+ };
+
+ // Make it easy to access colors via `hexNames[hex]`
+ var hexNames = tinycolor.hexNames = flip(names);
+
+ // Utilities
+ // ---------
+
+ // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
+ function flip(o) {
+ var flipped = {};
+ for (var i in o) {
+ if (o.hasOwnProperty(i)) {
+ flipped[o[i]] = i;
+ }
+ }
+ return flipped;
+ }
+
+ // Return a valid alpha value [0,1] with all invalid values being set to 1
+ function boundAlpha(a) {
+ a = parseFloat(a);
+ if (isNaN(a) || a < 0 || a > 1) {
+ a = 1;
+ }
+ return a;
+ }
+
+ // Take input from [0, n] and return it as [0, 1]
+ function bound01(n, max) {
+ if (isOnePointZero(n)) n = "100%";
+ var processPercent = isPercentage(n);
+ n = Math.min(max, Math.max(0, parseFloat(n)));
+
+ // Automatically convert percentage into number
+ if (processPercent) {
+ n = parseInt(n * max, 10) / 100;
+ }
+
+ // Handle floating point rounding errors
+ if (Math.abs(n - max) < 0.000001) {
+ return 1;
+ }
+
+ // Convert into [0, 1] range if it isn't already
+ return n % max / parseFloat(max);
+ }
+
+ // Force a number between 0 and 1
+ function clamp01(val) {
+ return Math.min(1, Math.max(0, val));
+ }
+
+ // Parse a base-16 hex value into a base-10 integer
+ function parseIntFromHex(val) {
+ return parseInt(val, 16);
+ }
+
+ // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
+ //
+ function isOnePointZero(n) {
+ return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
+ }
+
+ // Check to see if string passed in is a percentage
+ function isPercentage(n) {
+ return typeof n === "string" && n.indexOf("%") != -1;
+ }
+
+ // Force a hex value to have 2 characters
+ function pad2(c) {
+ return c.length == 1 ? "0" + c : "" + c;
+ }
+
+ // Replace a decimal with it's percentage value
+ function convertToPercentage(n) {
+ if (n <= 1) {
+ n = n * 100 + "%";
+ }
+ return n;
+ }
+
+ // Converts a decimal to a hex value
+ function convertDecimalToHex(d) {
+ return Math.round(parseFloat(d) * 255).toString(16);
+ }
+ // Converts a hex value to a decimal
+ function convertHexToDecimal(h) {
+ return parseIntFromHex(h) / 255;
+ }
+ var matchers = function () {
+ //
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
+
+ //
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
+
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
+
+ // Actual matching.
+ // Parentheses and commas are optional, but not required.
+ // Whitespace can take the place of commas or opening paren
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
+ return {
+ CSS_UNIT: new RegExp(CSS_UNIT),
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
+ };
+ }();
+
+ // `isValidCSSUnit`
+ // Take in a single string / number and check to see if it looks like a CSS unit
+ // (see `matchers` above for definition).
+ function isValidCSSUnit(color) {
+ return !!matchers.CSS_UNIT.exec(color);
+ }
+
+ // `stringInputToObject`
+ // Permissive string parsing. Take in a number of formats, and output an object
+ // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
+ function stringInputToObject(color) {
+ color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
+ var named = false;
+ if (names[color]) {
+ color = names[color];
+ named = true;
+ } else if (color == "transparent") {
+ return {
+ r: 0,
+ g: 0,
+ b: 0,
+ a: 0,
+ format: "name"
+ };
+ }
+
+ // Try to match string input using regular expressions.
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
+ // Just return an object and let the conversion functions handle that.
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
+ var match;
+ if (match = matchers.rgb.exec(color)) {
+ return {
+ r: match[1],
+ g: match[2],
+ b: match[3]
+ };
+ }
+ if (match = matchers.rgba.exec(color)) {
+ return {
+ r: match[1],
+ g: match[2],
+ b: match[3],
+ a: match[4]
+ };
+ }
+ if (match = matchers.hsl.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ l: match[3]
+ };
+ }
+ if (match = matchers.hsla.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ l: match[3],
+ a: match[4]
+ };
+ }
+ if (match = matchers.hsv.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ v: match[3]
+ };
+ }
+ if (match = matchers.hsva.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ v: match[3],
+ a: match[4]
+ };
+ }
+ if (match = matchers.hex8.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1]),
+ g: parseIntFromHex(match[2]),
+ b: parseIntFromHex(match[3]),
+ a: convertHexToDecimal(match[4]),
+ format: named ? "name" : "hex8"
+ };
+ }
+ if (match = matchers.hex6.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1]),
+ g: parseIntFromHex(match[2]),
+ b: parseIntFromHex(match[3]),
+ format: named ? "name" : "hex"
+ };
+ }
+ if (match = matchers.hex4.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1] + "" + match[1]),
+ g: parseIntFromHex(match[2] + "" + match[2]),
+ b: parseIntFromHex(match[3] + "" + match[3]),
+ a: convertHexToDecimal(match[4] + "" + match[4]),
+ format: named ? "name" : "hex8"
+ };
+ }
+ if (match = matchers.hex3.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1] + "" + match[1]),
+ g: parseIntFromHex(match[2] + "" + match[2]),
+ b: parseIntFromHex(match[3] + "" + match[3]),
+ format: named ? "name" : "hex"
+ };
+ }
+ return false;
+ }
+ function validateWCAG2Parms(parms) {
+ // return valid WCAG2 parms for isReadable.
+ // If input parms are invalid, return {"level":"AA", "size":"small"}
+ var level, size;
+ parms = parms || {
+ level: "AA",
+ size: "small"
+ };
+ level = (parms.level || "AA").toUpperCase();
+ size = (parms.size || "small").toLowerCase();
+ if (level !== "AA" && level !== "AAA") {
+ level = "AA";
+ }
+ if (size !== "small" && size !== "large") {
+ size = "small";
+ }
+ return {
+ level: level,
+ size: size
+ };
+ }
+
+ return tinycolor;
+
+}));
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts
new file mode 100644
index 0000000..0e9cf2d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts
@@ -0,0 +1,2 @@
+declare const _default: (funcName?: string) => string;
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js
new file mode 100644
index 0000000..1d0dcba
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js
@@ -0,0 +1,41 @@
+import { getCurrentPage } from '../common/utils';
+const onPageScroll = function (event) {
+ const page = getCurrentPage();
+ if (!page)
+ return;
+ const { pageScroller } = page;
+ pageScroller === null || pageScroller === void 0 ? void 0 : pageScroller.forEach((scroller) => {
+ if (typeof scroller === 'function') {
+ scroller(event);
+ }
+ });
+};
+export default (funcName = 'onScroll') => {
+ return Behavior({
+ attached() {
+ var _a;
+ const page = getCurrentPage();
+ if (!page)
+ return;
+ const bindScroller = (_a = this[funcName]) === null || _a === void 0 ? void 0 : _a.bind(this);
+ if (bindScroller) {
+ this._pageScroller = bindScroller;
+ }
+ if (Array.isArray(page.pageScroller)) {
+ page.pageScroller.push(bindScroller);
+ }
+ else {
+ page.pageScroller =
+ typeof page.onPageScroll === 'function' ? [page.onPageScroll.bind(page), bindScroller] : [bindScroller];
+ }
+ page.onPageScroll = onPageScroll;
+ },
+ detached() {
+ var _a;
+ const page = getCurrentPage();
+ if (!page)
+ return;
+ page.pageScroller = ((_a = page.pageScroller) === null || _a === void 0 ? void 0 : _a.filter((item) => item !== this._pageScroller)) || [];
+ },
+ });
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/theme-change.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/theme-change.d.ts
new file mode 100644
index 0000000..4821f37
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/theme-change.d.ts
@@ -0,0 +1,2 @@
+declare const themeChangeBehavior: string;
+export default themeChangeBehavior;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/theme-change.js b/miniprogram_npm/tdesign-miniprogram/mixins/theme-change.js
new file mode 100644
index 0000000..70e44ed
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/theme-change.js
@@ -0,0 +1,23 @@
+import { appBaseInfo } from '../common/utils';
+const themeChangeBehavior = Behavior({
+ data: {
+ theme: 'light',
+ },
+ attached() {
+ this._initTheme();
+ },
+ methods: {
+ _initTheme() {
+ const that = this;
+ that.setData({
+ theme: appBaseInfo.theme,
+ });
+ wx.onThemeChange((res) => {
+ that.setData({
+ theme: res.theme,
+ });
+ });
+ },
+ },
+});
+export default themeChangeBehavior;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts
new file mode 100644
index 0000000..ae80eca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts
@@ -0,0 +1,2 @@
+declare const _default: string;
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/touch.js b/miniprogram_npm/tdesign-miniprogram/mixins/touch.js
new file mode 100644
index 0000000..cbabccc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/touch.js
@@ -0,0 +1,35 @@
+const MinDistance = 10;
+const getDirection = (x, y) => {
+ if (x > y && x > MinDistance) {
+ return 'horizontal';
+ }
+ if (y > x && y > MinDistance) {
+ return 'vertical';
+ }
+ return '';
+};
+export default Behavior({
+ methods: {
+ resetTouchStatus() {
+ this.direction = '';
+ this.deltaX = 0;
+ this.deltaY = 0;
+ this.offsetX = 0;
+ this.offsetY = 0;
+ },
+ touchStart(event) {
+ this.resetTouchStatus();
+ const [touch] = event.touches;
+ this.startX = touch.clientX;
+ this.startY = touch.clientY;
+ },
+ touchMove(event) {
+ const [touch] = event.touches;
+ this.deltaX = touch.clientX - this.startX;
+ this.deltaY = touch.clientY - this.startY;
+ this.offsetX = Math.abs(this.deltaX);
+ this.offsetY = Math.abs(this.deltaY);
+ this.direction = getDirection(this.offsetX, this.offsetY);
+ },
+ },
+});
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts
new file mode 100644
index 0000000..8c23e35
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts
@@ -0,0 +1 @@
+export default function transition(): string;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/transition.js b/miniprogram_npm/tdesign-miniprogram/mixins/transition.js
new file mode 100644
index 0000000..ee5215a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/transition.js
@@ -0,0 +1,123 @@
+import config from '../common/config';
+const { prefix } = config;
+export default function transition() {
+ return Behavior({
+ properties: {
+ visible: {
+ type: Boolean,
+ value: null,
+ observer: 'watchVisible',
+ },
+ appear: Boolean,
+ name: {
+ type: String,
+ value: 'fade',
+ },
+ durations: {
+ type: Number,
+ optionalTypes: [Array],
+ },
+ },
+ data: {
+ transitionClass: '',
+ transitionDurations: 300,
+ className: '',
+ realVisible: false,
+ },
+ created() {
+ this.status = '';
+ this.transitionT = 0;
+ },
+ attached() {
+ this.durations = this.getDurations();
+ if (this.data.visible) {
+ this.enter();
+ }
+ this.inited = true;
+ },
+ detached() {
+ clearTimeout(this.transitionT);
+ },
+ methods: {
+ watchVisible(curr, prev) {
+ if (this.inited && curr !== prev) {
+ curr ? this.enter() : this.leave();
+ }
+ },
+ getDurations() {
+ const { durations } = this.data;
+ if (Array.isArray(durations)) {
+ return durations.map((item) => Number(item));
+ }
+ return [Number(durations), Number(durations)];
+ },
+ enter() {
+ const { name } = this.data;
+ const [duration] = this.durations;
+ this.status = 'entering';
+ this.setData({
+ realVisible: true,
+ transitionClass: `${prefix}-${name}-enter ${prefix}-${name}-enter-active`,
+ });
+ setTimeout(() => {
+ this.setData({
+ transitionClass: `${prefix}-${name}-enter-active ${prefix}-${name}-enter-to`,
+ });
+ }, 30);
+ if (typeof duration === 'number' && duration > 0) {
+ this.transitionT = setTimeout(this.entered.bind(this), duration + 30);
+ }
+ },
+ entered() {
+ this.customDuration = false;
+ clearTimeout(this.transitionT);
+ this.status = 'entered';
+ this.setData({
+ transitionClass: '',
+ });
+ },
+ leave() {
+ const { name } = this.data;
+ const [, duration] = this.durations;
+ this.status = 'leaving';
+ this.setData({
+ transitionClass: `${prefix}-${name}-leave ${prefix}-${name}-leave-active`,
+ });
+ clearTimeout(this.transitionT);
+ setTimeout(() => {
+ this.setData({
+ transitionClass: `${prefix}-${name}-leave-active ${prefix}-${name}-leave-to`,
+ });
+ }, 30);
+ if (typeof duration === 'number' && duration > 0) {
+ this.customDuration = true;
+ this.transitionT = setTimeout(this.leaved.bind(this), duration + 30);
+ }
+ },
+ leaved() {
+ this.customDuration = false;
+ this.triggerEvent('leaved');
+ clearTimeout(this.transitionT);
+ this.status = 'leaved';
+ this.setData({
+ transitionClass: '',
+ });
+ },
+ onTransitionEnd() {
+ if (this.customDuration) {
+ return;
+ }
+ clearTimeout(this.transitionT);
+ if (this.status === 'entering' && this.data.visible) {
+ this.entered();
+ }
+ else if (this.status === 'leaving' && !this.data.visible) {
+ this.leaved();
+ this.setData({
+ realVisible: false,
+ });
+ }
+ },
+ },
+ });
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.d.ts
new file mode 100644
index 0000000..908f771
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.d.ts
@@ -0,0 +1,2 @@
+declare const useCustomNavbarBehavior: string;
+export default useCustomNavbarBehavior;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js b/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js
new file mode 100644
index 0000000..e9bf8e3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js
@@ -0,0 +1,34 @@
+import { systemInfo } from '../common/utils';
+const useCustomNavbarBehavior = Behavior({
+ properties: {
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ customNavbarHeight: {
+ type: Number,
+ value: 0,
+ },
+ },
+ data: {
+ distanceTop: 0,
+ },
+ lifetimes: {
+ attached() {
+ if (this.properties.usingCustomNavbar) {
+ this.calculateCustomNavbarDistanceTop();
+ }
+ },
+ },
+ methods: {
+ calculateCustomNavbarDistanceTop() {
+ const { statusBarHeight } = systemInfo;
+ const menuButton = wx.getMenuButtonBoundingClientRect();
+ const distance = menuButton.top + menuButton.bottom - statusBarHeight;
+ this.setData({
+ distanceTop: Math.max(distance, this.properties.customNavbarHeight + statusBarHeight),
+ });
+ },
+ },
+});
+export default useCustomNavbarBehavior;
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/navbar/README.en-US.md
new file mode 100644
index 0000000..500cdbb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/README.en-US.md
@@ -0,0 +1,56 @@
+:: 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_npm/tdesign-miniprogram/navbar/README.md b/miniprogram_npm/tdesign-miniprogram/navbar/README.md
new file mode 100644
index 0000000..ccfad35
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/README.md
@@ -0,0 +1,105 @@
+---
+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_npm/tdesign-miniprogram/navbar/navbar.d.ts b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.d.ts
new file mode 100644
index 0000000..a53dce9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.d.ts
@@ -0,0 +1,36 @@
+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;
+ _menuRect: any;
+ _leftRect: any;
+ _boxStyle: {};
+ };
+ attached(): void;
+ detached(): void;
+ methods: {
+ initStyle(): void;
+ calcCenterStyle(leftRect: WechatMiniprogram.BoundingClientRectResult, menuRect: WechatMiniprogram.BoundingClientRectResult, defaultStyle: object): void;
+ getLeftRect(): void;
+ getMenuRect(): void;
+ onMenuButtonBoundingClientRectWeightChange(): void;
+ offMenuButtonBoundingClientRectWeightChange(): void;
+ queryElements(capsuleRect: any): void;
+ goBack(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js
new file mode 100644
index 0000000..4d54b11
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js
@@ -0,0 +1,186 @@
+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 { 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,
+ _menuRect: null,
+ _leftRect: null,
+ _boxStyle: {},
+ };
+ this.methods = {
+ initStyle() {
+ this.getMenuRect();
+ const { _menuRect, _leftRect } = this.data;
+ if (!_menuRect || !_leftRect || !systemInfo)
+ return;
+ const _boxStyle = {
+ '--td-navbar-padding-top': `${systemInfo.statusBarHeight}px`,
+ '--td-navbar-right': `${systemInfo.windowWidth - _menuRect.left}px`,
+ '--td-navbar-left-max-width': `${_menuRect.left}px`,
+ '--td-navbar-capsule-height': `${_menuRect.height}px`,
+ '--td-navbar-capsule-width': `${_menuRect.width}px`,
+ '--td-navbar-height': `${(_menuRect.top - systemInfo.statusBarHeight) * 2 + _menuRect.height}px`,
+ };
+ this.calcCenterStyle(_leftRect, _menuRect, _boxStyle);
+ },
+ calcCenterStyle(leftRect, menuRect, defaultStyle) {
+ const maxSpacing = Math.max(leftRect.right, systemInfo.windowWidth - menuRect.left);
+ const _boxStyle = Object.assign(Object.assign({}, defaultStyle), { '--td-navbar-center-left': `${maxSpacing}px`, '--td-navbar-center-width': `${Math.max(menuRect.left - maxSpacing, 0)}px` });
+ const boxStyle = Object.entries(_boxStyle)
+ .map(([k, v]) => `${k}: ${v}`)
+ .join('; ');
+ this.setData({
+ boxStyle,
+ _boxStyle,
+ });
+ },
+ getLeftRect() {
+ getRect(this, `.${name}__left`).then((res) => {
+ if (res.right > this.data._leftRect.right) {
+ this.calcCenterStyle(res, this.data._menuRect, this.data._boxStyle);
+ }
+ });
+ },
+ getMenuRect() {
+ if (wx.getMenuButtonBoundingClientRect) {
+ const rect = wx.getMenuButtonBoundingClientRect();
+ this.setData({
+ _menuRect: rect,
+ _leftRect: {
+ right: systemInfo.windowWidth - rect.left,
+ },
+ });
+ }
+ },
+ onMenuButtonBoundingClientRectWeightChange() {
+ if (wx.onMenuButtonBoundingClientRectWeightChange) {
+ wx.onMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res));
+ }
+ },
+ offMenuButtonBoundingClientRectWeightChange() {
+ if (wx.offMenuButtonBoundingClientRectWeightChange) {
+ wx.offMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res));
+ }
+ },
+ queryElements(capsuleRect) {
+ Promise.all([
+ getRect(this, `.${this.data.classPrefix}__left`),
+ getRect(this, `.${this.data.classPrefix}__center`),
+ ]).then(([leftRect, centerRect]) => {
+ if (Math.round(leftRect.right) > capsuleRect.left) {
+ this.setData({
+ hideLeft: true,
+ hideCenter: true,
+ });
+ }
+ else if (Math.round(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() {
+ this.initStyle();
+ this.getLeftRect();
+ this.onMenuButtonBoundingClientRectWeightChange();
+ }
+ detached() {
+ this.offMenuButtonBoundingClientRectWeightChange();
+ }
+};
+Navbar = __decorate([
+ wxComponent()
+], Navbar);
+export default Navbar;
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/navbar.json b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxml b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxml
new file mode 100644
index 0000000..3ed1f16
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{showTitle}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss
new file mode 100644
index 0000000..a2a93cb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss
@@ -0,0 +1,136 @@
+.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;
+ max-width: var(--td-navbar-left-max-width);
+ overflow: hidden;
+ 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_npm/tdesign-miniprogram/navbar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/navbar/props.d.ts
new file mode 100644
index 0000000..168bee2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdNavbarProps } from './type';
+declare const props: TdNavbarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/props.js b/miniprogram_npm/tdesign-miniprogram/navbar/props.js
new file mode 100644
index 0000000..3906316
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/props.js
@@ -0,0 +1,29 @@
+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_npm/tdesign-miniprogram/navbar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/navbar/type.d.ts
new file mode 100644
index 0000000..11a4e77
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/type.d.ts
@@ -0,0 +1,30 @@
+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_npm/tdesign-miniprogram/navbar/type.js b/miniprogram_npm/tdesign-miniprogram/navbar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/notice-bar/README.en-US.md
new file mode 100644
index 0000000..f555a9b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/README.en-US.md
@@ -0,0 +1,53 @@
+:: BASE_DOC ::
+
+## API
+
+### NoticeBar 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
+content | String / Array / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+direction | String | horizontal | options: horizontal/vertical | N
+interval | Number | 2000 | \- | N
+marquee | Boolean / Object | false | Typescript:`boolean \| NoticeBarMarquee` `interface NoticeBarMarquee { speed?: number; loop?: number; delay?: number }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/notice-bar/type.ts) | N
+operation | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+prefix-icon | String / Boolean / Object / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+suffix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+theme | String | info | options: info/success/warning/error | N
+visible | Boolean | false | \- | N
+default-visible | Boolean | undefined | uncontrolled property | N
+
+### NoticeBar Events
+
+name | params | description
+-- | -- | --
+change | `(current: number, source: '' \| 'autoplay' \| 'touch')` | \-
+click | `(trigger: NoticeBarTrigger)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/notice-bar/type.ts)。
`type NoticeBarTrigger = 'prefix-icon' \| 'content' \| 'operation' \| 'suffix-icon';`
+### NoticeBar External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+t-class-operation | \-
+t-class-prefix-icon | \-
+t-class-suffix-icon | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-notice-bar-error-bg-color | @error-color-1 | -
+--td-notice-bar-error-color | @error-color | -
+--td-notice-bar-font-color | @text-color-primary | -
+--td-notice-bar-info-bg-color | @brand-color-light | -
+--td-notice-bar-info-color | @brand-color | -
+--td-notice-bar-operation-font-color | @brand-color | -
+--td-notice-bar-success-bg-color | @success-color-1 | -
+--td-notice-bar-success-color | @success-color | -
+--td-notice-bar-suffix-icon-color | @text-color-placeholder | -
+--td-notice-bar-warning-bg-color | @warning-color-1 | -
+--td-notice-bar-warning-color | @warning-color | -
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/README.md b/miniprogram_npm/tdesign-miniprogram/notice-bar/README.md
new file mode 100644
index 0000000..8707ef5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/README.md
@@ -0,0 +1,124 @@
+---
+title: NoticeBar 公告栏
+description: 在导航栏下方,用于给用户显示提示消息。
+spline: message
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.9.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-notice-bar": "tdesign-miniprogram/notice-bar/notice-bar"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 01 组件类型
+
+纯文字的公告栏
+
+{{ base }}
+
+带图标的公告栏
+
+{{ iconDemo }}
+
+带关闭的公告栏
+
+{{ suffixIcon }}
+
+带入口的公告栏
+
+{{ event }}
+
+自定义样式的公告栏
+
+{{ custom }}
+
+自定义内容的公告栏
+
+{{ customization }}
+
+### 02 组件状态
+
+公告栏类型有普通(info)、警示(warning)、成功(success)、错误(error)
+
+{{ theme }}
+
+### 03 可滚动公告栏
+
+可滚动公告栏有水平(horizontal)和垂直(vertical)
+
+{{ scrolling }}
+
+
+## API
+
+### NoticeBar Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+content | String / Array / Slot | - | 文本内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+direction | String | horizontal | 滚动方向。可选项:horizontal/vertical | N
+interval | Number | 2000 | 间隔时间【仅在 direction='vertical' 有效】 | N
+marquee | Boolean / Object | false | 跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放【仅在 direction='horizontal' 有效】。TS 类型:`boolean \| NoticeBarMarquee` `interface NoticeBarMarquee { speed?: number; loop?: number; delay?: number }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/notice-bar/type.ts) | N
+operation | String / Slot | - | 右侧额外信息。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+prefix-icon | String / Boolean / Object / Slot | true | 前缀图标。值为字符串表示图标名称,值为 `false` 表示不显示前缀图标,值为 `Object` 类型,表示透传至 `icon`,不传表示使用主题图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+suffix-icon | String / Object / Slot | - | 后缀图标。值为字符串表示图标名称。值为 `Object` 类型,表示透传至 `icon`,不传表示不显示后缀图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+theme | String | info | 内置主题。可选项:info/success/warning/error | N
+visible | Boolean | false | 显示/隐藏 | N
+default-visible | Boolean | undefined | 显示/隐藏。非受控属性 | N
+
+### NoticeBar Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(current: number, source: '' \| 'autoplay' \| 'touch')` | 当 `direction="vertical"` 时轮播切换时触发
+click | `(trigger: NoticeBarTrigger)` | 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/notice-bar/type.ts)。
`type NoticeBarTrigger = 'prefix-icon' \| 'content' \| 'operation' \| 'suffix-icon';`
+### NoticeBar External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-operation | 右侧额外信息样式类
+t-class-prefix-icon | 前置图标样式类
+t-class-suffix-icon | 后置图标样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-notice-bar-error-bg-color | @error-color-1 | -
+--td-notice-bar-error-color | @error-color | -
+--td-notice-bar-font-color | @text-color-primary | -
+--td-notice-bar-info-bg-color | @brand-color-light | -
+--td-notice-bar-info-color | @brand-color | -
+--td-notice-bar-operation-font-color | @brand-color | -
+--td-notice-bar-success-bg-color | @success-color-1 | -
+--td-notice-bar-success-color | @success-color | -
+--td-notice-bar-suffix-icon-color | @text-color-placeholder | -
+--td-notice-bar-warning-bg-color | @warning-color-1 | -
+--td-notice-bar-warning-color | @warning-color | -
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.d.ts b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.d.ts
new file mode 100644
index 0000000..783c09b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.d.ts
@@ -0,0 +1,36 @@
+import { SuperComponent, ComponentsOptionsType } from '../common/src/index';
+export default class NoticeBar extends SuperComponent {
+ externalClasses: string[];
+ options: ComponentsOptionsType;
+ properties: import("./type").TdNoticeBarProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ loop: number;
+ __ready: boolean;
+ };
+ observers: {
+ marquee(val: any): void;
+ visible(visible: any): void;
+ prefixIcon(prefixIcon: any): void;
+ suffixIcon(v: any): void;
+ content(): void;
+ };
+ lifetimes: {
+ created(): void;
+ detached(): void;
+ ready(): void;
+ };
+ methods: {
+ initAnimation(): void;
+ startScrollAnimation(isFirstScroll?: boolean): void;
+ show(): void;
+ clearNoticeBarAnimation(): void;
+ setPrefixIcon(v: any): void;
+ onChange(e: WechatMiniprogram.SwiperChange): void;
+ clickPrefixIcon(): void;
+ clickContent(): void;
+ clickSuffixIcon(): void;
+ clickOperation(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.js b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.js
new file mode 100644
index 0000000..c091c7f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.js
@@ -0,0 +1,192 @@
+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 { getRect, getAnimationFrame, calcIcon } from '../common/utils';
+import props from './props';
+import config from '../common/config';
+const { prefix } = config;
+const name = `${prefix}-notice-bar`;
+const THEME_ICON = {
+ info: 'info-circle-filled',
+ success: 'check-circle-filled',
+ warning: 'info-circle-filled',
+ error: 'error-circle-filled',
+};
+let NoticeBar = class NoticeBar extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-prefix-icon`,
+ `${prefix}-class-operation`,
+ `${prefix}-class-suffix-icon`,
+ ];
+ this.options = {
+ multipleSlots: true,
+ pureDataPattern: /^__/,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ loop: -1,
+ __ready: false,
+ };
+ this.observers = {
+ marquee(val) {
+ if (JSON.stringify(val) === '{}' || JSON.stringify(val) === 'true') {
+ this.setData({
+ marquee: {
+ speed: 50,
+ loop: -1,
+ delay: 0,
+ },
+ });
+ }
+ },
+ visible(visible) {
+ if (!this.data.__ready)
+ return;
+ if (visible) {
+ this.show();
+ }
+ else {
+ this.clearNoticeBarAnimation();
+ }
+ },
+ prefixIcon(prefixIcon) {
+ this.setPrefixIcon(prefixIcon);
+ },
+ suffixIcon(v) {
+ this.setData({
+ _suffixIcon: calcIcon(v),
+ });
+ },
+ content() {
+ if (!this.data.__ready)
+ return;
+ this.clearNoticeBarAnimation();
+ this.initAnimation();
+ },
+ };
+ this.lifetimes = {
+ created() {
+ this.resetAnimation = wx.createAnimation({
+ duration: 0,
+ timingFunction: 'linear',
+ });
+ },
+ detached() {
+ this.clearNoticeBarAnimation();
+ },
+ ready() {
+ this.show();
+ this.setData({ __ready: true });
+ },
+ };
+ this.methods = {
+ initAnimation() {
+ const warpID = `.${name}__content-wrap`;
+ const nodeID = `.${name}__content`;
+ getAnimationFrame(this, () => {
+ Promise.all([getRect(this, nodeID), getRect(this, warpID)])
+ .then(([nodeRect, wrapRect]) => {
+ const { marquee } = this.properties;
+ if (nodeRect == null || wrapRect == null || !nodeRect.width || !wrapRect.width || marquee === false) {
+ return;
+ }
+ if (marquee || wrapRect.width < nodeRect.width) {
+ const speeding = marquee.speed || 50;
+ const delaying = marquee.delay || 0;
+ const animationDuration = ((wrapRect.width + nodeRect.width) / speeding) * 1000;
+ const firstAnimationDuration = (nodeRect.width / speeding) * 1000;
+ this.setData({
+ wrapWidth: Number(wrapRect.width),
+ nodeWidth: Number(nodeRect.width),
+ animationDuration: animationDuration,
+ delay: delaying,
+ loop: marquee.loop - 1,
+ firstAnimationDuration: firstAnimationDuration,
+ });
+ marquee.loop !== 0 && this.startScrollAnimation(true);
+ }
+ })
+ .catch(() => { });
+ });
+ },
+ startScrollAnimation(isFirstScroll = false) {
+ this.clearNoticeBarAnimation();
+ const { wrapWidth, nodeWidth, firstAnimationDuration, animationDuration, delay } = this.data;
+ const delayTime = isFirstScroll ? delay : 0;
+ const durationTime = isFirstScroll ? firstAnimationDuration : animationDuration;
+ this.setData({
+ animationData: this.resetAnimation
+ .translateX(isFirstScroll ? 0 : wrapWidth)
+ .step()
+ .export(),
+ });
+ getAnimationFrame(this, () => {
+ this.setData({
+ animationData: wx
+ .createAnimation({ duration: durationTime, timingFunction: 'linear', delay: delayTime })
+ .translateX(-nodeWidth)
+ .step()
+ .export(),
+ });
+ });
+ this.nextAnimationContext = setTimeout(() => {
+ if (this.data.loop > 0) {
+ this.data.loop -= 1;
+ this.startScrollAnimation();
+ }
+ else if (this.data.loop === 0) {
+ this.setData({ animationData: this.resetAnimation.translateX(0).step().export() });
+ }
+ else if (this.data.loop < 0) {
+ this.startScrollAnimation();
+ }
+ }, durationTime + delayTime);
+ },
+ show() {
+ this.clearNoticeBarAnimation();
+ this.setPrefixIcon(this.properties.prefixIcon);
+ this.initAnimation();
+ },
+ clearNoticeBarAnimation() {
+ this.nextAnimationContext && clearTimeout(this.nextAnimationContext);
+ this.nextAnimationContext = null;
+ },
+ setPrefixIcon(v) {
+ const { theme } = this.properties;
+ this.setData({
+ _prefixIcon: calcIcon(v, THEME_ICON[theme]),
+ });
+ },
+ onChange(e) {
+ const { current, source } = e.detail;
+ this.triggerEvent('change', { current, source });
+ },
+ clickPrefixIcon() {
+ this.triggerEvent('click', { trigger: 'prefix-icon' });
+ },
+ clickContent() {
+ this.triggerEvent('click', { trigger: 'content' });
+ },
+ clickSuffixIcon() {
+ this.triggerEvent('click', { trigger: 'suffix-icon' });
+ },
+ clickOperation() {
+ this.triggerEvent('click', { trigger: 'operation' });
+ },
+ };
+ }
+};
+NoticeBar = __decorate([
+ wxComponent()
+], NoticeBar);
+export default NoticeBar;
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.json b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxml b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxml
new file mode 100644
index 0000000..d61f322
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+ {{content}}
+
+
+ {{operation}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss
new file mode 100644
index 0000000..60c5597
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss
@@ -0,0 +1,103 @@
+.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-notice-bar {
+ display: flex;
+ align-items: flex-start;
+ padding: 26rpx 32rpx;
+ font-size: var(--td-font-size-base, 28rpx);
+}
+.t-notice-bar__content-wrap {
+ flex: 1;
+ overflow-x: hidden;
+ line-height: 44rpx;
+ color: var(--td-notice-bar-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-notice-bar__content {
+ display: inline-block;
+ white-space: nowrap;
+}
+.t-notice-bar__content-wrapable {
+ white-space: normal;
+}
+.t-notice-bar__content--vertical {
+ display: block;
+ height: 44rpx;
+ line-height: 44rpx;
+}
+.t-notice-bar__content--vertical-item {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.t-notice-bar__prefix-icon {
+ color: inherit;
+}
+.t-notice-bar__prefix-icon:not(:empty) {
+ padding-right: var(--td-spacer, 16rpx);
+ width: 44rpx;
+}
+.t-notice-bar__suffix-icon {
+ color: var(--td-notice-bar-suffix-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-notice-bar__prefix-icon,
+.t-notice-bar__suffix-icon {
+ font-size: 44rpx;
+}
+.t-notice-bar__prefix-icon:empty,
+.t-notice-bar__suffix-icon:empty {
+ display: none;
+}
+.t-notice-bar__operation {
+ display: inline-flex;
+ vertical-align: top;
+ color: var(--td-notice-bar-operation-font-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-weight: 700;
+}
+.t-notice-bar__operation:empty {
+ display: none;
+}
+.t-notice-bar__suffix-icon:not(:empty) {
+ padding-left: var(--td-spacer, 16rpx);
+ width: 44rpx;
+}
+.t-notice-bar--info {
+ color: var(--td-notice-bar-info-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-notice-bar-info-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-notice-bar--success {
+ color: var(--td-notice-bar-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-notice-bar-success-bg-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-notice-bar--warning {
+ color: var(--td-notice-bar-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-notice-bar-warning-bg-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-notice-bar--error {
+ color: var(--td-notice-bar-error-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-notice-bar-error-bg-color, var(--td-error-color-1, #fff0ed));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/notice-bar/props.d.ts
new file mode 100644
index 0000000..5fe19dc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdNoticeBarProps } from './type';
+declare const props: TdNoticeBarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/props.js b/miniprogram_npm/tdesign-miniprogram/notice-bar/props.js
new file mode 100644
index 0000000..5b69074
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/props.js
@@ -0,0 +1,40 @@
+const props = {
+ content: {
+ type: null,
+ },
+ direction: {
+ type: String,
+ value: 'horizontal',
+ },
+ interval: {
+ type: Number,
+ value: 2000,
+ },
+ marquee: {
+ type: null,
+ value: false,
+ },
+ operation: {
+ type: String,
+ },
+ prefixIcon: {
+ type: null,
+ value: true,
+ },
+ suffixIcon: {
+ type: null,
+ },
+ theme: {
+ type: String,
+ value: 'info',
+ },
+ visible: {
+ type: Boolean,
+ value: null,
+ },
+ defaultVisible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/notice-bar/type.d.ts
new file mode 100644
index 0000000..61c7ca6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/type.d.ts
@@ -0,0 +1,47 @@
+export interface TdNoticeBarProps {
+ content?: {
+ type: null;
+ value?: string | string[];
+ };
+ direction?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ interval?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ marquee?: {
+ type: null;
+ value?: boolean | NoticeBarMarquee;
+ };
+ operation?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ prefixIcon?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ suffixIcon?: {
+ type: null;
+ value?: string | object;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'info' | 'success' | 'warning' | 'error';
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultVisible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export interface NoticeBarMarquee {
+ speed?: number;
+ loop?: number;
+ delay?: number;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/notice-bar/type.js b/miniprogram_npm/tdesign-miniprogram/notice-bar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/notice-bar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/overlay/README.en-US.md
new file mode 100644
index 0000000..e268e09
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/README.en-US.md
@@ -0,0 +1,31 @@
+
+## API
+
+
+### Overlay 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
+background-color | String | - | \- | N
+duration | Number | 300 | \- | N
+prevent-scroll-through | Boolean | true | \- | N
+using-custom-navbar | Boolean | false | \- | N
+visible | Boolean | false | \- | N
+z-index | Number | 11000 | \- | N
+
+### Overlay Events
+
+name | params | description
+-- | -- | --
+click | `({ visible: boolean })` | \-
+
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-overlay-bg-color | @font-gray-2 | -
+--td-overlay-transition-duration | 300ms | -
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/README.md b/miniprogram_npm/tdesign-miniprogram/overlay/README.md
new file mode 100644
index 0000000..b8098af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/README.md
@@ -0,0 +1,66 @@
+---
+title: Overlay 遮罩层
+description: 通过遮罩层,可以强调部分内容
+spline: message
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.10.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-overlay": "tdesign-miniprogram/overlay/overlay"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础使用
+
+{{ base }}
+
+## API
+
+### Overlay Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+background-color | String | - | 遮罩层的背景色 | N
+duration | Number | 300 | 背景色过渡时间,单位毫秒 | N
+prevent-scroll-through | Boolean | true | 防止滚动穿透,即不允许点击和滚动 | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+visible | Boolean | false | 是否展示 | N
+z-index | Number | 11000 | 遮罩层级 | N
+
+### Overlay Events
+
+名称 | 参数 | 描述
+-- | -- | --
+click | `({ visible: boolean })` | 点击遮罩时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-overlay-bg-color | @font-gray-2 | -
+--td-overlay-transition-duration | 300ms | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/index.d.ts b/miniprogram_npm/tdesign-miniprogram/overlay/index.d.ts
new file mode 100644
index 0000000..164efb7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './overlay';
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/index.js b/miniprogram_npm/tdesign-miniprogram/overlay/index.js
new file mode 100644
index 0000000..164efb7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './overlay';
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts
new file mode 100644
index 0000000..98ff36d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts
@@ -0,0 +1,22 @@
+import { SuperComponent } from '../common/src/index';
+import { TdOverlayProps } from './type';
+export interface OverlayProps extends TdOverlayProps {
+}
+export default class Overlay extends SuperComponent {
+ properties: TdOverlayProps;
+ behaviors: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ computedStyle: string;
+ _zIndex: number;
+ };
+ observers: {
+ backgroundColor(v: any): void;
+ zIndex(v: any): void;
+ };
+ methods: {
+ handleClick(): void;
+ noop(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.js b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.js
new file mode 100644
index 0000000..9e54684
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.js
@@ -0,0 +1,50 @@
+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 transition from '../mixins/transition';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-overlay`;
+let Overlay = class Overlay extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.properties = props;
+ this.behaviors = [transition(), useCustomNavbar];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ computedStyle: '',
+ _zIndex: 11000,
+ };
+ this.observers = {
+ backgroundColor(v) {
+ this.setData({
+ computedStyle: v ? `background-color: ${v};` : '',
+ });
+ },
+ zIndex(v) {
+ if (v !== 0) {
+ this.setData({
+ _zIndex: v,
+ });
+ }
+ },
+ };
+ this.methods = {
+ handleClick() {
+ this.triggerEvent('click', { visible: !this.properties.visible });
+ },
+ noop() { },
+ };
+ }
+};
+Overlay = __decorate([
+ wxComponent()
+], Overlay);
+export default Overlay;
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.json b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.json
new file mode 100644
index 0000000..79f2730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared"
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml
new file mode 100644
index 0000000..90bf385
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss
new file mode 100644
index 0000000..4a2f3ec
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss
@@ -0,0 +1,44 @@
+.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-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ bottom: 0;
+ background-color: var(--td-overlay-bg-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
+ transition-property: opacity;
+ transition-duration: var(--td-overlay-transition-duration, 300ms);
+ transition-timing-function: ease;
+}
+.t-fade-enter {
+ opacity: 0;
+}
+.t-fade-leave-to {
+ opacity: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/props.d.ts b/miniprogram_npm/tdesign-miniprogram/overlay/props.d.ts
new file mode 100644
index 0000000..e42d7f1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/props.d.ts
@@ -0,0 +1,3 @@
+import { TdOverlayProps } from './type';
+declare const props: TdOverlayProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/props.js b/miniprogram_npm/tdesign-miniprogram/overlay/props.js
new file mode 100644
index 0000000..40e2b25
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/props.js
@@ -0,0 +1,19 @@
+const props = {
+ backgroundColor: {
+ type: String,
+ value: '',
+ },
+ duration: {
+ type: Number,
+ value: 300,
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: true,
+ },
+ zIndex: {
+ type: Number,
+ value: 11000,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/type.d.ts b/miniprogram_npm/tdesign-miniprogram/overlay/type.d.ts
new file mode 100644
index 0000000..e46cec9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/type.d.ts
@@ -0,0 +1,26 @@
+export interface TdOverlayProps {
+ backgroundColor?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ preventScrollThrough?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/type.js b/miniprogram_npm/tdesign-miniprogram/overlay/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.d.ts b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.d.ts
new file mode 100644
index 0000000..8cd35ce
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.d.ts
@@ -0,0 +1,33 @@
+import { SuperComponent, RelationsOptions, ComponentsOptionsType } from '../common/src/index';
+export default class PickerItem extends SuperComponent {
+ relations: RelationsOptions;
+ options: ComponentsOptionsType;
+ externalClasses: string[];
+ properties: import("./type").TdPickerItemProps;
+ observers: {
+ options(this: PickerItem): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ offset: number;
+ duration: number;
+ value: string;
+ curIndex: number;
+ columnIndex: number;
+ labelAlias: string;
+ valueAlias: string;
+ };
+ lifetimes: {
+ created(): void;
+ };
+ methods: {
+ onTouchStart(event: any): void;
+ onTouchMove(event: any): void;
+ onTouchEnd(): void;
+ update(): void;
+ resetOrigin(): void;
+ getCount(): any;
+ };
+ calculateViewDeltaY(touchDeltaY: number, itemHeight: number): number;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.js b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.js
new file mode 100644
index 0000000..3c75377
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.js
@@ -0,0 +1,130 @@
+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}-picker-item`;
+const DefaultDuration = 240;
+const range = function (num, min, max) {
+ return Math.min(Math.max(num, min), max);
+};
+let PickerItem = class PickerItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.relations = {
+ '../picker/picker': {
+ type: 'parent',
+ linked(parent) {
+ if ('keys' in parent.data) {
+ const { keys } = parent.data;
+ this.setData({
+ labelAlias: (keys === null || keys === void 0 ? void 0 : keys.label) || 'label',
+ valueAlias: (keys === null || keys === void 0 ? void 0 : keys.value) || 'value',
+ });
+ }
+ },
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.observers = {
+ options() {
+ this.update();
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ offset: 0,
+ duration: 0,
+ value: '',
+ curIndex: 0,
+ columnIndex: 0,
+ labelAlias: 'label',
+ valueAlias: 'value',
+ };
+ this.lifetimes = {
+ created() {
+ this.StartY = 0;
+ this.StartOffset = 0;
+ },
+ };
+ this.methods = {
+ onTouchStart(event) {
+ this.StartY = event.touches[0].clientY;
+ this.StartOffset = this.data.offset;
+ this.setData({ duration: 0 });
+ },
+ onTouchMove(event) {
+ const { pickItemHeight } = this.data;
+ const { StartY, StartOffset } = this;
+ const touchDeltaY = event.touches[0].clientY - StartY;
+ const deltaY = this.calculateViewDeltaY(touchDeltaY, pickItemHeight);
+ this.setData({
+ offset: range(StartOffset + deltaY, -(this.getCount() * pickItemHeight), 0),
+ duration: DefaultDuration,
+ });
+ },
+ onTouchEnd() {
+ const { offset, labelAlias, valueAlias, columnIndex, pickItemHeight } = this.data;
+ const { options } = this.properties;
+ if (offset === this.StartOffset) {
+ return;
+ }
+ const index = range(Math.round(-offset / pickItemHeight), 0, this.getCount() - 1);
+ this.setData({
+ curIndex: index,
+ offset: -index * pickItemHeight,
+ });
+ if (index === this._selectedIndex) {
+ return;
+ }
+ wx.nextTick(() => {
+ var _a, _b, _c;
+ this._selectedIndex = index;
+ this._selectedValue = (_a = options[index]) === null || _a === void 0 ? void 0 : _a[valueAlias];
+ this._selectedLabel = (_b = options[index]) === null || _b === void 0 ? void 0 : _b[labelAlias];
+ (_c = this.$parent) === null || _c === void 0 ? void 0 : _c.triggerColumnChange({
+ index,
+ column: columnIndex,
+ });
+ });
+ },
+ update() {
+ var _a, _b;
+ const { options, value, labelAlias, valueAlias, pickItemHeight } = this.data;
+ const index = options.findIndex((item) => item[valueAlias] === value);
+ const selectedIndex = index > 0 ? index : 0;
+ this.setData({
+ offset: -selectedIndex * pickItemHeight,
+ curIndex: selectedIndex,
+ });
+ this._selectedIndex = selectedIndex;
+ this._selectedValue = (_a = options[selectedIndex]) === null || _a === void 0 ? void 0 : _a[valueAlias];
+ this._selectedLabel = (_b = options[selectedIndex]) === null || _b === void 0 ? void 0 : _b[labelAlias];
+ },
+ resetOrigin() {
+ this.update();
+ },
+ getCount() {
+ var _a, _b;
+ return (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
+ },
+ };
+ }
+ calculateViewDeltaY(touchDeltaY, itemHeight) {
+ return Math.abs(touchDeltaY) > itemHeight ? 1.2 * touchDeltaY : touchDeltaY;
+ }
+};
+PickerItem = __decorate([
+ wxComponent()
+], PickerItem);
+export default PickerItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.json b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxml b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxml
new file mode 100644
index 0000000..29b4eca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ {{option[labelAlias]}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxss b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxss
new file mode 100644
index 0000000..dfae7f4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxss
@@ -0,0 +1,55 @@
+.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);
+}
+:host {
+ display: flex;
+}
+.t-picker-item__group {
+ height: var(--td-picker-group-height, 400rpx);
+ overflow: hidden;
+ flex: 1;
+ z-index: 1;
+}
+.t-picker-item__wrapper {
+ padding: 144rpx 0;
+}
+.t-picker-item__item {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: var(--td-picker-item-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ font-size: var(--td-picker-item-font-size, var(--td-font-size-m, 32rpx));
+}
+.t-picker-item__item-label {
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+.t-picker-item__item--active {
+ color: var(--td-picker-item-active-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-weight: 600;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/picker-item/props.d.ts
new file mode 100644
index 0000000..1140c78
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdPickerItemProps } from './type';
+declare const props: TdPickerItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/props.js b/miniprogram_npm/tdesign-miniprogram/picker-item/props.js
new file mode 100644
index 0000000..a55e0af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/props.js
@@ -0,0 +1,10 @@
+const props = {
+ format: {
+ type: null,
+ },
+ options: {
+ type: Array,
+ value: [],
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/picker-item/type.d.ts
new file mode 100644
index 0000000..295060f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/type.d.ts
@@ -0,0 +1,14 @@
+export interface TdPickerItemProps {
+ format?: {
+ type: undefined;
+ value?: (option: PickerItemOption) => string;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: PickerItemOption[];
+ };
+}
+export interface PickerItemOption {
+ label: string;
+ value: string | number;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker-item/type.js b/miniprogram_npm/tdesign-miniprogram/picker-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/picker/README.en-US.md
new file mode 100644
index 0000000..d02c1a0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/README.en-US.md
@@ -0,0 +1,68 @@
+:: BASE_DOC ::
+
+## API
+
+### Picker 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
+auto-close | Boolean | true | \- | N
+cancel-btn | String / Boolean / Object | true | Typescript:`boolean \| string \| ButtonProps` | N
+confirm-btn | String / Boolean / Object | true | Typescript:`boolean \| string \| ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+footer | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+item-height | Number | 80 | \- | N
+keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+popup-props | Object | {} | popup properties。Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+title | String | '' | \- | N
+use-popup | Boolean | true | \- | N
+using-custom-navbar | Boolean | false | \- | N
+value | Array | - | Typescript:`Array` `type PickerValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+default-value | Array | undefined | uncontrolled property。Typescript:`Array` `type PickerValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+visible | Boolean | false | \- | N
+
+### Picker Events
+
+name | params | description
+-- | -- | --
+cancel | - | \-
+change | `(value: Array, label: string, columns: Array<{ column: number; index: number }> )` | \-
+close | `(trigger: TriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
+confirm | `(value: Array, label: string, columns: Array<{ column: number; index: number }> )` | \-
+pick | `(value: Array, label: string, column: number, index: number)` | \-
+
+
+### PickerItem 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
+format | Function | - | Typescript:`(option: PickerItemOption) => string` | N
+options | Array | [] | Typescript:`PickerItemOption[]` `interface PickerItemOption { label: string; value: string \| number }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker-item/type.ts) | N
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-picker-group-height | 400rpx | -
+--td-picker-bg-color | @bg-color-container | -
+--td-picker-border-radius | 24rpx | -
+--td-picker-button-font-size | 32rpx | -
+--td-picker-cancel-color | @font-gray-2 | -
+--td-picker-confirm-color | @brand-color | -
+--td-picker-indicator-bg-color | @bg-color-secondarycontainer | -
+--td-picker-indicator-border-radius | 12rpx | -
+--td-picker-mask-color-bottom | hsla(0, 0%, 100%, 0.4) | -
+--td-picker-mask-color-top | hsla(0, 0%, 100%, 0.92) | -
+--td-picker-title-color | @font-gray-1 | -
+--td-picker-title-font-size | 36rpx | -
+--td-picker-title-font-weight | 600 | -
+--td-picker-title-line-height | 52rpx | -
+--td-picker-toolbar-height | 116rpx | -
+--td-picker-item-active-color | @font-gray-1 | -
+--td-picker-item-color | @font-gray-2 | -
+--td-picker-item-height | 80rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/README.md b/miniprogram_npm/tdesign-miniprogram/picker/README.md
new file mode 100644
index 0000000..f623b3f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/README.md
@@ -0,0 +1,118 @@
+---
+title: Picker 选择器
+description: 用于一组预设数据中的选择。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-picker": "tdesign-miniprogram/picker/picker",
+ "t-picker-item": "tdesign-miniprogram/picker-item/picker-item",
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+#### 基础选择器
+
+单项和多选选择
+
+{{ base }}
+
+#### 地区选择器
+
+支持省市区切换,支持数据联动
+
+{{ area }}
+
+### 组件状态
+
+是否带标题
+
+{{ with-title }}
+
+### 不使用 Popup
+
+{{ without-popup }}
+
+## API
+
+### Picker Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+auto-close | Boolean | true | 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible | N
+cancel-btn | String / Boolean / Object | true | 取消按钮文字。TS 类型:`boolean \| string \| ButtonProps` | N
+confirm-btn | String / Boolean / Object | true | 确定按钮文字。TS 类型:`boolean \| string \| ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+footer | Slot | - | 底部内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+header | Boolean / Slot | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+item-height | Number | 80 | PickerItem 的子项高度,单位 rpx | N
+keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+popup-props | Object | {} | 透传 `Popup` 组件全部属性。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+title | String | '' | 标题 | N
+use-popup | Boolean | true | 是否使用弹出层包裹 | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+value | Array | - | 选中值。TS 类型:`Array` `type PickerValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+default-value | Array | undefined | 选中值。非受控属性。TS 类型:`Array` `type PickerValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
+visible | Boolean | false | 是否显示 | N
+
+### Picker Events
+
+名称 | 参数 | 描述
+-- | -- | --
+cancel | - | 点击取消按钮时触发
+change | `(value: Array, label: string, columns: Array<{ column: number; index: number }> )` | 选中变化时候触发,即确认变化时触发
+close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
+confirm | `(value: Array, label: string, columns: Array<{ column: number; index: number }> )` | 点击确认按钮时触发
+pick | `(value: Array, label: string, column: number, index: number)` | 任何一列选中都会触发,不同的列参数不同。`column` 表示第几列变化,`index` 表示变化那一列的选中项下标
+
+
+### PickerItem Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+format | Function | - | 格式化标签。TS 类型:`(option: PickerItemOption) => string` | N
+options | Array | [] | 数据源。TS 类型:`PickerItemOption[]` `interface PickerItemOption { label: string; value: string \| number }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker-item/type.ts) | N
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-picker-group-height | 400rpx | -
+--td-picker-bg-color | @bg-color-container | -
+--td-picker-border-radius | 24rpx | -
+--td-picker-button-font-size | 32rpx | -
+--td-picker-cancel-color | @font-gray-2 | -
+--td-picker-confirm-color | @brand-color | -
+--td-picker-indicator-bg-color | @bg-color-secondarycontainer | -
+--td-picker-indicator-border-radius | 12rpx | -
+--td-picker-mask-color-bottom | hsla(0, 0%, 100%, 0.4) | -
+--td-picker-mask-color-top | hsla(0, 0%, 100%, 0.92) | -
+--td-picker-title-color | @font-gray-1 | -
+--td-picker-title-font-size | 36rpx | -
+--td-picker-title-font-weight | 600 | -
+--td-picker-title-line-height | 52rpx | -
+--td-picker-toolbar-height | 116rpx | -
+--td-picker-item-active-color | @font-gray-1 | -
+--td-picker-item-color | @font-gray-2 | -
+--td-picker-item-font-size | @font-size-m | -
+--td-picker-item-height | 80rpx | 已废弃,建议使用 `itemHeight` 属性设置子项高度。
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/picker.d.ts b/miniprogram_npm/tdesign-miniprogram/picker/picker.d.ts
new file mode 100644
index 0000000..4c215e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/picker.d.ts
@@ -0,0 +1,40 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Picker extends SuperComponent {
+ behaviors: string[];
+ properties: import("./type").TdPickerProps;
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ relations: RelationsOptions;
+ observers: {
+ 'value, visible'(): void;
+ keys(obj: any): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ labelAlias: string;
+ valueAlias: string;
+ defaultPopUpProps: {};
+ defaultPopUpzIndex: number;
+ pickItemHeight: number;
+ };
+ methods: {
+ updateChildren(): void;
+ getSelectedValue(): any[];
+ getColumnIndexes(): any;
+ onConfirm(): void;
+ triggerColumnChange({ column, index }: {
+ column: any;
+ index: any;
+ }): void;
+ onCancel(): void;
+ onPopupChange(e: any): void;
+ close(trigger: any): void;
+ };
+ ready(): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/picker.js b/miniprogram_npm/tdesign-miniprogram/picker/picker.js
new file mode 100644
index 0000000..3e210b7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/picker.js
@@ -0,0 +1,121 @@
+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 { rpx2px } from '../common/utils';
+import config from '../common/config';
+import props from './props';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-picker`;
+let Picker = class Picker extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [useCustomNavbar];
+ this.properties = props;
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-confirm`, `${prefix}-class-cancel`, `${prefix}-class-title`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.relations = {
+ '../picker-item/picker-item': {
+ type: 'child',
+ linked() {
+ this.updateChildren();
+ },
+ },
+ };
+ this.observers = {
+ 'value, visible'() {
+ this.updateChildren();
+ },
+ keys(obj) {
+ this.setData({
+ labelAlias: (obj === null || obj === void 0 ? void 0 : obj.label) || 'label',
+ valueAlias: (obj === null || obj === void 0 ? void 0 : obj.value) || 'value',
+ });
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.setData({
+ pickItemHeight: rpx2px(this.properties.itemHeight),
+ });
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ labelAlias: 'label',
+ valueAlias: 'value',
+ defaultPopUpProps: {},
+ defaultPopUpzIndex: 11500,
+ pickItemHeight: 0,
+ };
+ this.methods = {
+ updateChildren() {
+ const { pickItemHeight } = this.data;
+ const { value, defaultValue } = this.properties;
+ this.$children.forEach((child, index) => {
+ var _a, _b;
+ child.setData({
+ value: (_b = (_a = value === null || value === void 0 ? void 0 : value[index]) !== null && _a !== void 0 ? _a : defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue[index]) !== null && _b !== void 0 ? _b : '',
+ columnIndex: index,
+ pickItemHeight,
+ });
+ child.update();
+ });
+ },
+ getSelectedValue() {
+ const value = this.$children.map((item) => item._selectedValue);
+ const label = this.$children.map((item) => item._selectedLabel);
+ return [value, label];
+ },
+ getColumnIndexes() {
+ const columns = this.$children.map((pickerColumn, columnIndex) => {
+ return {
+ column: columnIndex,
+ index: pickerColumn._selectedIndex,
+ };
+ });
+ return columns;
+ },
+ onConfirm() {
+ const [value, label] = this.getSelectedValue();
+ const columns = this.getColumnIndexes();
+ this.close('confirm-btn');
+ this.triggerEvent('change', { value, label, columns });
+ this.triggerEvent('confirm', { value, label, columns });
+ },
+ triggerColumnChange({ column, index }) {
+ const [value, label] = this.getSelectedValue();
+ this.triggerEvent('pick', { value, label, column, index });
+ },
+ onCancel() {
+ this.close('cancel-btn');
+ this.triggerEvent('cancel');
+ },
+ onPopupChange(e) {
+ const { visible } = e.detail;
+ this.close('overlay');
+ this.triggerEvent('visible-change', { visible });
+ },
+ close(trigger) {
+ if (this.data.autoClose) {
+ this.setData({ visible: false });
+ }
+ this.triggerEvent('close', { trigger });
+ },
+ };
+ }
+ ready() {
+ this.$children.map((column, index) => (column.columnIndex = index));
+ }
+};
+Picker = __decorate([
+ wxComponent()
+], Picker);
+export default Picker;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/picker.json b/miniprogram_npm/tdesign-miniprogram/picker/picker.json
new file mode 100644
index 0000000..bc013f5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/picker.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-popup": "../popup/popup"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/picker.wxml b/miniprogram_npm/tdesign-miniprogram/picker/picker.wxml
new file mode 100644
index 0000000..23aa355
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/picker.wxml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/picker.wxss b/miniprogram_npm/tdesign-miniprogram/picker/picker.wxss
new file mode 100644
index 0000000..b1e179c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/picker.wxss
@@ -0,0 +1,101 @@
+.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-picker {
+ position: relative;
+ background-color: var(--td-picker-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ border-top-left-radius: var(--td-picker-border-radius, 24rpx);
+ border-top-right-radius: var(--td-picker-border-radius, 24rpx);
+}
+.t-picker__toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ overflow: hidden;
+ height: var(--td-picker-toolbar-height, 116rpx);
+}
+.t-picker__title {
+ flex: 1;
+ text-align: center;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ color: var(--td-picker-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ line-height: var(--td-picker-title-line-height, 52rpx);
+ font-weight: var(--td-picker-title-font-weight, 600);
+ font-size: var(--td-picker-title-font-size, 36rpx);
+}
+.t-picker__cancel,
+.t-picker__confirm {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ user-select: none;
+ font-size: var(--td-picker-button-font-size, 32rpx);
+ height: 100%;
+ padding: 0 32rpx;
+}
+.t-picker__cancel {
+ color: var(--td-picker-cancel-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+}
+.t-picker__confirm {
+ color: var(--td-picker-confirm-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-picker__main {
+ position: relative;
+ display: flex;
+ justify-content: center;
+ padding-left: 64rpx;
+ padding-right: 64rpx;
+}
+.t-picker__mask {
+ position: absolute;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ backface-visibility: hidden;
+ pointer-events: none;
+ height: 96rpx;
+}
+.t-picker__mask--top {
+ top: 0;
+ background: linear-gradient(180deg, var(--td-picker-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))) 0%, var(--td-picker-transparent-color) 100%);
+}
+.t-picker__mask--bottom {
+ bottom: 0;
+ background: linear-gradient(180deg, var(--td-picker-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))) 0%, var(--td-picker-transparent-color) 100%);
+ transform: matrix(1, 0, 0, -1, 0, 0);
+}
+.t-picker__indicator {
+ position: absolute;
+ left: 32rpx;
+ right: 32rpx;
+ top: 144rpx;
+ pointer-events: none;
+ background-color: var(--td-picker-indicator-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ border-radius: var(--td-picker-indicator-border-radius, 12rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/props.d.ts b/miniprogram_npm/tdesign-miniprogram/picker/props.d.ts
new file mode 100644
index 0000000..d673411
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/props.d.ts
@@ -0,0 +1,3 @@
+import { TdPickerProps } from './type';
+declare const props: TdPickerProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/props.js b/miniprogram_npm/tdesign-miniprogram/picker/props.js
new file mode 100644
index 0000000..4921846
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/props.js
@@ -0,0 +1,53 @@
+const props = {
+ autoClose: {
+ type: Boolean,
+ value: true,
+ },
+ cancelBtn: {
+ type: null,
+ value: true,
+ },
+ confirmBtn: {
+ type: null,
+ value: true,
+ },
+ header: {
+ type: Boolean,
+ value: true,
+ },
+ itemHeight: {
+ type: Number,
+ value: 80,
+ },
+ keys: {
+ type: Object,
+ },
+ popupProps: {
+ type: Object,
+ value: {},
+ },
+ title: {
+ type: String,
+ value: '',
+ },
+ usePopup: {
+ type: Boolean,
+ value: true,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ value: {
+ type: Array,
+ value: null,
+ },
+ defaultValue: {
+ type: Array,
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/template.wxml b/miniprogram_npm/tdesign-miniprogram/picker/template.wxml
new file mode 100644
index 0000000..354830c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/template.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+ {{cancelBtn}}
+ {{title}}
+ {{confirmBtn}}
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/type.d.ts b/miniprogram_npm/tdesign-miniprogram/picker/type.d.ts
new file mode 100644
index 0000000..ae96123
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/type.d.ts
@@ -0,0 +1,58 @@
+import { ButtonProps } from '../button/index';
+import { PopupProps } from '../popup/index';
+import { KeysType } from '../common/common';
+export interface TdPickerProps {
+ autoClose?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ cancelBtn?: {
+ type: null;
+ value?: boolean | string | ButtonProps;
+ };
+ confirmBtn?: {
+ type: null;
+ value?: boolean | string | ButtonProps;
+ };
+ header?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ itemHeight?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: KeysType;
+ };
+ popupProps?: {
+ type: ObjectConstructor;
+ value?: PopupProps;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ usePopup?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ defaultValue?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export declare type PickerValue = string | number;
diff --git a/miniprogram_npm/tdesign-miniprogram/picker/type.js b/miniprogram_npm/tdesign-miniprogram/picker/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/picker/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md
new file mode 100644
index 0000000..286f744
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md
@@ -0,0 +1,43 @@
+:: BASE_DOC ::
+
+## API
+
+### Popup 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
+close-btn | Boolean / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+close-on-overlay-click | Boolean | true | \- | N
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+duration | Number | 240 | \- | N
+overlay-props | Object | {} | Typescript:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/popup/type.ts) | N
+placement | String | top | options: top/left/right/bottom/center | N
+prevent-scroll-through | Boolean | true | \- | N
+show-overlay | Boolean | true | \- | N
+using-custom-navbar | Boolean | false | \- | N
+visible | Boolean | - | Typescript:`boolean` | N
+default-visible | Boolean | undefined | uncontrolled property。Typescript:`boolean` | N
+z-index | Number | 11500 | \- | N
+
+### Popup Events
+
+name | params | description
+-- | -- | --
+visible-change | `(visible: boolean, trigger: PopupSource) ` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/popup/type.ts)。
`type PopupSource = 'close-btn' \| 'overlay'`
+### Popup External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-popup-bg-color | @bg-color-container | -
+--td-popup-border-radius | @radius-default | -
+--td-popup-close-btn-color | @text-color-primary | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/README.md b/miniprogram_npm/tdesign-miniprogram/popup/README.md
new file mode 100644
index 0000000..6928738
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/README.md
@@ -0,0 +1,82 @@
+---
+title: Popup 弹出层
+description: 由其他控件触发,屏幕滑出或弹出一块自定义内容区域。
+spline: message
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-popup": "tdesign-miniprogram/popup/popup"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+基础弹出层
+
+{{ base }}
+
+### 组件示例
+
+应用示例
+
+{{ with-title }}
+
+{{ custom-close }}
+
+## API
+
+### Popup Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+close-btn | Boolean / Slot | - | 关闭按钮,值类型为 Boolean 时表示是否显示关闭按钮。也可以自定义关闭按钮。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+close-on-overlay-click | Boolean | true | 点击遮罩层是否关闭 | N
+content | String / Slot | - | 浮层里面的内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+duration | Number | 240 | 动画过渡时间 | N
+overlay-props | Object | {} | 遮罩层的属性,透传至 overlay。TS 类型:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/popup/type.ts) | N
+placement | String | top | 浮层出现位置。可选项:top/left/right/bottom/center | N
+prevent-scroll-through | Boolean | true | 是否阻止背景滚动 | N
+show-overlay | Boolean | true | 是否显示遮罩层 | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+visible | Boolean | - | 是否显示浮层。TS 类型:`boolean` | N
+default-visible | Boolean | undefined | 是否显示浮层。非受控属性。TS 类型:`boolean` | N
+z-index | Number | 11500 | 组件层级,Web 侧样式默认为 5500,移动端样式默认为 1500,小程序样式默认为11500 | N
+
+### Popup Events
+
+名称 | 参数 | 描述
+-- | -- | --
+visible-change | `(visible: boolean, trigger: PopupSource) ` | 当浮层隐藏或显示时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/popup/type.ts)。
`type PopupSource = 'close-btn' \| 'overlay'`
+### Popup External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-popup-bg-color | @bg-color-container | -
+--td-popup-border-radius | @radius-default | -
+--td-popup-close-btn-color | @text-color-primary | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/index.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/index.d.ts
new file mode 100644
index 0000000..03c4cf3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './popup';
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/index.js b/miniprogram_npm/tdesign-miniprogram/popup/index.js
new file mode 100644
index 0000000..03c4cf3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './popup';
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts
new file mode 100644
index 0000000..23dae8c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts
@@ -0,0 +1,19 @@
+import { TdPopupProps } from './type';
+import { SuperComponent } from '../common/src/index';
+export declare type PopupProps = TdPopupProps;
+export default class Popup extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: TdPopupProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ methods: {
+ handleOverlayClick(): void;
+ handleClose(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.js b/miniprogram_npm/tdesign-miniprogram/popup/popup.js
new file mode 100644
index 0000000..f679e50
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.js
@@ -0,0 +1,44 @@
+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 transition from '../mixins/transition';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+delete props.visible;
+const { prefix } = config;
+const name = `${prefix}-popup`;
+let Popup = class Popup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
+ this.behaviors = [transition(), useCustomNavbar];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.methods = {
+ handleOverlayClick() {
+ const { closeOnOverlayClick } = this.properties;
+ if (closeOnOverlayClick) {
+ this.triggerEvent('visible-change', { visible: false, trigger: 'overlay' });
+ }
+ },
+ handleClose() {
+ this.triggerEvent('visible-change', { visible: false, trigger: 'close-btn' });
+ },
+ };
+ }
+};
+Popup = __decorate([
+ wxComponent()
+], Popup);
+export default Popup;
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.json b/miniprogram_npm/tdesign-miniprogram/popup/popup.json
new file mode 100644
index 0000000..babc8a1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-overlay": "../overlay/overlay",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.wxml b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxml
new file mode 100644
index 0000000..3bb4b94
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.wxs b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxs
new file mode 100644
index 0000000..9070d86
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxs
@@ -0,0 +1,18 @@
+function getPopupStyles(zIndex, distanceTop, placement) {
+ var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
+ if ((placement === 'top' || placement === 'left' || placement === 'right') && distanceTop) {
+ zIndexStyle = zIndexStyle + 'top:' + distanceTop + 'px;';
+ }
+ return zIndexStyle;
+}
+
+function onContentTouchMove(e) {
+ if (e.target && e.target.dataset.prevention) {
+ return false;
+ }
+}
+
+module.exports = {
+ getPopupStyles: getPopupStyles,
+ onContentTouchMove: onContentTouchMove,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss
new file mode 100644
index 0000000..81612c2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss
@@ -0,0 +1,105 @@
+.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-popup {
+ position: fixed;
+ z-index: 11500;
+ max-height: 100vh;
+ transition: all 300ms ease;
+ background-color: var(--td-popup-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-popup__content {
+ position: relative;
+ z-index: 1;
+}
+.t-popup__close {
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 20rpx;
+ line-height: 1;
+ color: var(--td-popup-close-btn-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-popup--top {
+ top: 0;
+ left: 0;
+ width: 100%;
+ border-bottom-left-radius: var(--td-popup-border-radius, var(--td-radius-extra-large, 24rpx));
+ border-bottom-right-radius: var(--td-popup-border-radius, var(--td-radius-extra-large, 24rpx));
+}
+.t-popup--bottom {
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ border-top-left-radius: var(--td-popup-border-radius, var(--td-radius-extra-large, 24rpx));
+ border-top-right-radius: var(--td-popup-border-radius, var(--td-radius-extra-large, 24rpx));
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+}
+.t-popup--left {
+ top: 0;
+ left: 0;
+ height: 100vh;
+}
+.t-popup--right {
+ top: 0;
+ right: 0;
+ height: 100vh;
+}
+.t-popup--center {
+ top: 50%;
+ left: 50%;
+ transform: scale(1) translate3d(-50%, -50%, 0);
+ transform-origin: 0% 0%;
+ border-radius: var(--td-popup-border-radius, var(--td-radius-extra-large, 24rpx));
+}
+.t-popup.t-fade-enter.t-popup--top,
+.t-popup.t-fade-leave-to.t-popup--top {
+ transform: translateY(-100%);
+}
+.t-popup.t-fade-enter.t-popup--bottom,
+.t-popup.t-fade-leave-to.t-popup--bottom {
+ transform: translateY(100%);
+}
+.t-popup.t-fade-enter.t-popup--left,
+.t-popup.t-fade-leave-to.t-popup--left {
+ transform: translateX(-100%);
+}
+.t-popup.t-fade-enter.t-popup--right,
+.t-popup.t-fade-leave-to.t-popup--right {
+ transform: translateX(100%);
+}
+.t-popup.t-fade-enter.t-popup--center,
+.t-popup.t-fade-leave-to.t-popup--center {
+ transform: scale(0.6) translate3d(-50%, -50%, 0);
+ opacity: 0;
+}
+.t-popup.t-dialog-enter.t-popup--center,
+.t-popup.t-dialog-leave-to.t-popup--center {
+ transform: scale(0.6) translate3d(-50%, -50%, 0);
+ opacity: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/props.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/props.d.ts
new file mode 100644
index 0000000..e23cd6c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/props.d.ts
@@ -0,0 +1,3 @@
+import { TdPopupProps } from './type';
+declare const props: TdPopupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/props.js b/miniprogram_npm/tdesign-miniprogram/popup/props.js
new file mode 100644
index 0000000..bf5d380
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/props.js
@@ -0,0 +1,51 @@
+const props = {
+ closeBtn: {
+ type: Boolean,
+ },
+ closeOnOverlayClick: {
+ type: Boolean,
+ value: true,
+ },
+ content: {
+ type: String,
+ },
+ duration: {
+ type: Number,
+ value: 240,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ overlayProps: {
+ type: Object,
+ value: {},
+ },
+ placement: {
+ type: String,
+ value: 'top',
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: true,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ visible: {
+ type: Boolean,
+ value: null,
+ },
+ defaultVisible: {
+ type: Boolean,
+ },
+ zIndex: {
+ type: Number,
+ value: 11500,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/type.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/type.d.ts
new file mode 100644
index 0000000..914749e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/type.d.ts
@@ -0,0 +1,55 @@
+import { OverlayProps } from '../overlay/index';
+export interface TdPopupProps {
+ closeBtn?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ closeOnOverlayClick?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-overlay', 't-class-content'];
+ };
+ overlayProps?: {
+ type: ObjectConstructor;
+ value?: OverlayProps;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'top' | 'left' | 'right' | 'bottom' | 'center';
+ };
+ preventScrollThrough?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultVisible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/type.js b/miniprogram_npm/tdesign-miniprogram/popup/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md
new file mode 100644
index 0000000..f9d303b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md
@@ -0,0 +1,43 @@
+:: BASE_DOC ::
+
+## API
+
+### Progress 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
+color | String / Object / Array | '' | Typescript:`string \| Array \| Record` | N
+label | String / Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+percentage | Number | 0 | \- | N
+status | String | - | options: success/error/warning/active。Typescript:`ProgressStatus` `type ProgressStatus = 'success' \| 'error' \| 'warning' \| 'active'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+stroke-width | String / Number | - | \- | N
+theme | String | line | options: line/plump/circle。Typescript:`ProgressTheme` `type ProgressTheme = 'line' \| 'plump' \| 'circle'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+track-color | String | '' | \- | N
+
+### Progress External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-bar | \-
+t-class-label | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+
+Name | Default Value | Description
+-- | -- | --
+--td-progress-circle-inner-bg-color | @font-white-1 | -
+--td-progress-circle-width | 224rpx | -
+--td-progress-circle-from | 0deg | -
+--td-progress-inner-bg-color | @brand-color | -
+--td-progress-line-stroke-width | 12rpx | -
+--td-progress-stroke-circle-width | 12rpx | -
+--td-progress-stroke-plump-width | 40rpx | -
+--td-progress-track-bg-color | @bg-color-component | -
+--td-progress-circle-label-font-size | 40rpx | -
+--td-progress-circle-label-line-height | 56rpx | -
+--td-progress-circle-label-font-weight | 700 | -
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/README.md b/miniprogram_npm/tdesign-miniprogram/progress/README.md
new file mode 100644
index 0000000..fe838da
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/README.md
@@ -0,0 +1,105 @@
+---
+title: Progress 进度条
+description: 用于展示任务当前的进度。
+spline: message
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.7.3 版本上线,请留意版本。
+
+
+## 引入
+
+### 引入组件
+
+在 `app.json` 或 `page.json` 中引入组件:
+
+```json
+"usingComponents": {
+ "t-progress": "tdesign-miniprogram/progress/progress"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 01 组件类型
+
+基础进度条
+
+{{ base }}
+
+过渡样式
+
+{{ transition }}
+
+自定义颜色/圆角
+
+{{ custom }}
+
+### 02 组件状态
+
+线性进度条
+
+{{ line }}
+
+百分比内显进度条
+
+{{ plump }}
+
+环形进度条
+
+{{ circle }}
+
+## API
+
+### Progress Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+color | String / Object / Array | '' | 进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等。TS 类型:`string \| Array \| Record` | N
+label | String / Boolean / Slot | true | 进度百分比,可自定义。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+percentage | Number | 0 | 进度条百分比 | N
+status | String | - | 进度条状态。可选项:success/error/warning/active。TS 类型:`ProgressStatus` `type ProgressStatus = 'success' \| 'error' \| 'warning' \| 'active'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+stroke-width | String / Number | - | 进度条线宽,默认单位 `px` | N
+theme | String | line | 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间。可选项:line/plump/circle。TS 类型:`ProgressTheme` `type ProgressTheme = 'line' \| 'plump' \| 'circle'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+track-color | String | '' | 进度条未完成部分颜色 | N
+
+### Progress External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-bar | 进度文字样式类
+t-class-label | 标签样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+
+名称 | 默认值 | 描述
+-- | -- | --
+--td-progress-circle-inner-bg-color | @font-white-1 | -
+--td-progress-circle-width | 224rpx | -
+--td-progress-circle-from | 0deg | -
+--td-progress-inner-bg-color | @brand-color | -
+--td-progress-line-stroke-width | 12rpx | -
+--td-progress-stroke-circle-width | 12rpx | -
+--td-progress-stroke-plump-width | 40rpx | -
+--td-progress-track-bg-color | @bg-color-component | -
+--td-progress-circle-label-font-size | 40rpx | -
+--td-progress-circle-label-line-height | 56rpx | -
+--td-progress-circle-label-font-weight | 700 | -
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts
new file mode 100644
index 0000000..ea66946
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts
@@ -0,0 +1,24 @@
+import { SuperComponent } from '../common/src/index';
+export default class Progress extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdProgressProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ colorBar: string;
+ heightBar: string;
+ computedStatus: string;
+ computedProgress: number;
+ isIOS: boolean;
+ };
+ attached(): void;
+ observers: {
+ percentage(percentage: any): void;
+ color(color: any): void;
+ strokeWidth(strokeWidth: any): string;
+ trackColor(trackColor: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.js b/miniprogram_npm/tdesign-miniprogram/progress/progress.js
new file mode 100644
index 0000000..fae98d5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.js
@@ -0,0 +1,71 @@
+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 { getBackgroundColor } from './utils';
+import { unitConvert, deviceInfo } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-progress`;
+let Progress = class Progress extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-bar`, `${prefix}-class-label`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ colorBar: '',
+ heightBar: '',
+ computedStatus: '',
+ computedProgress: 0,
+ isIOS: false,
+ };
+ this.observers = {
+ percentage(percentage) {
+ percentage = Math.max(0, Math.min(percentage, 100));
+ this.setData({
+ computedStatus: percentage === 100 ? 'success' : '',
+ computedProgress: percentage,
+ });
+ },
+ color(color) {
+ this.setData({
+ colorBar: getBackgroundColor(color),
+ colorCircle: typeof color === 'object' ? '' : color,
+ });
+ },
+ strokeWidth(strokeWidth) {
+ if (!strokeWidth) {
+ return '';
+ }
+ this.setData({
+ heightBar: unitConvert(strokeWidth),
+ });
+ },
+ trackColor(trackColor) {
+ this.setData({
+ bgColorBar: trackColor,
+ });
+ },
+ };
+ }
+ attached() {
+ var _a;
+ const isIOS = !!(((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.system) === null || _a === void 0 ? void 0 : _a.toLowerCase().search('ios')) + 1);
+ this.setData({
+ isIOS,
+ });
+ }
+};
+Progress = __decorate([
+ wxComponent()
+], Progress);
+export default Progress;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.json b/miniprogram_npm/tdesign-miniprogram/progress/progress.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.wxml b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxml
new file mode 100644
index 0000000..4cdedf9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ _.isString(label)? label: computedProgress + '%' }}
+
+
+
+
+
+
+
+ {{ _.isString(label)? label: computedProgress + '%' }}
+
+
+
+
+ {{ _.isString(label)? label: computedProgress + '%' }}
+
+
+
+
+
+
+
+
+
+ {{ _.isString(label)? label: computedProgress + '%' }}
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.wxs b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxs
new file mode 100644
index 0000000..37f05b2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxs
@@ -0,0 +1,63 @@
+var STATUS = ['success', 'error', 'warning'];
+var STATUS_TEXT = ['success', 'error', 'warning', 'active'];
+
+var PRO_THEME = {
+ LINE: 'line',
+ PLUMP: 'plump',
+ CIRCLE: 'circle',
+};
+
+var STATUS_COLOR = {
+ success: '#00a870',
+ error: '#e34d59',
+ warning: '#ed7b2f',
+};
+var LINE_STATUS_ICON = {
+ success: 'check-circle-filled',
+ error: 'error-circle-filled',
+ warning: 'error-circle-filled',
+};
+var CIRCLE_STATUS_ICON = {
+ success: 'check',
+ error: 'close',
+ warning: 'error',
+};
+
+/**
+ *
+ * 1. getIOSAriaLabel, getAndroidAriaLabel 两个函数的初衷是处理progress异常情况的文案识别。
+ * 2. iOS可以识别%,而安卓不会识别%,如 80, iOS可以识别成 80%, 而安卓只会80,因此android部分做了一个% 拼接,后续看是否有更好的方案去解决。
+ * 3. 安卓 talkback 版本为 8.1.0.278818032 ,只会读一次 80, 最新版本talkback 会读 80.0, 80。(目前也是一个痛点,啰嗦了)
+ *
+ */
+
+var getIOSAriaLabel = function (status) {
+ if (status === 'error') {
+ return '进度失败';
+ }
+ if (status === 'warning') {
+ return '进度异常';
+ }
+ return '';
+};
+
+var getAndroidAriaLabel = function (status) {
+ if (status === 'error') {
+ return '%' + ',进度失败';
+ }
+ if (status === 'warning') {
+ return '%' + ',进度异常';
+ }
+ return '%';
+};
+
+module.exports = {
+ STATUS: STATUS,
+ STATUS_TEXT: STATUS_TEXT,
+ PRO_THEME: PRO_THEME,
+ STATUS_COLOR: STATUS_COLOR,
+ LINE_STATUS_ICON: LINE_STATUS_ICON,
+ CIRCLE_STATUS_ICON: CIRCLE_STATUS_ICON,
+ getAndroidAriaLabel: getAndroidAriaLabel,
+ getIOSAriaLabel: getIOSAriaLabel,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.wxss b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxss
new file mode 100644
index 0000000..fe0eb43
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxss
@@ -0,0 +1,162 @@
+.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-progress {
+ --td-progress-inner-bg-color: var(--td-brand-color, var(--td-primary-color-7, #0052d9));
+ --td-progress-track-bg-color: var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7));
+ --td-progress-circle-from: 0deg;
+}
+.t-progress__inner {
+ position: relative;
+ height: 100%;
+ background: var(--td-progress-inner-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-radius: var(--td-radius-round, 999px);
+ transition: all var(--td-anim-duration-base, 0.2s) var(--td-anim-time-fn-easing, cubic-bezier(0.38, 0, 0.24, 1));
+}
+.t-progress__bar {
+ width: 100%;
+ height: var(--td-progress-line-stroke-width, 12rpx);
+ overflow: hidden;
+ background: var(--td-progress-track-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-radius: var(--td-radius-round, 999px);
+}
+.t-progress__info {
+ padding-left: var(--td-spacer, 16rpx);
+ box-sizing: border-box;
+ color: var(--td-progress-info-dark-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ white-space: nowrap;
+ display: inline-flex;
+}
+.t-progress--thin {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.t-progress--thin .t-progress__icon {
+ font-size: calc(var(--td-font-size-base, 28rpx) + 2px);
+}
+.t-progress--plump {
+ height: var(--td-progress-stroke-plump-width, 40rpx);
+ border-radius: calc(var(--td-progress-stroke-plump-width, 40rpx) / 2);
+ display: flex;
+ align-items: center;
+}
+.t-progress--plump .t-progress__info {
+ font-size: var(--td-font-size-s, 24rpx);
+}
+.t-progress--over-ten .t-progress__info {
+ position: absolute;
+ top: 50%;
+ right: var(--td-spacer, 16rpx);
+ color: var(--td-progress-info-light-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ transform: translateY(-50%);
+}
+.t-progress--under-ten .t-progress__info,
+.t-progress--under-ten .t-progress__inner {
+ display: inline-block;
+}
+.t-progress--under-ten .t-progress__info {
+ vertical-align: top;
+}
+.t-progress__canvas--circle {
+ position: relative;
+ width: var(--td-progress-circle-width, 224rpx);
+ height: var(--td-progress-circle-width, 224rpx);
+ border-radius: var(--td-radius-circle, 50%);
+}
+.t-progress__canvas--circle .t-progress__canvas--inner {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ width: calc(100% - var(--td-progress-stroke-circle-width, 12rpx)*2);
+ height: calc(100% - var(--td-progress-stroke-circle-width, 12rpx)*2);
+ border-radius: var(--td-radius-circle, 50%);
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ background-color: var(--td-progress-circle-inner-bg-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-progress__canvas--circle .t-progress__info {
+ margin: 0;
+ font-size: var(--td-progress-circle-label-font-size, 40rpx);
+ font-weight: var(--td-progress-circle-label-font-weight, 700);
+ line-height: var(--td-progress-circle-label-line-height, 56rpx);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+.t-progress__canvas--circle .t-progress__icon {
+ font-size: 96rpx;
+}
+.t-progress--status--active .t-progress__inner::before {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1;
+ content: '';
+ animation: progress-active-animation 2s cubic-bezier(0.23, 0.99, 0.86, 0.2) infinite;
+ background: var(--td-progress-inner-bg-color-active, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ opacity: 0.2;
+}
+.t-progress--status--success .t-progress__inner {
+ background: var(--td-progress-inner-bg-color-success, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-progress--status--success .t-progress__icon {
+ color: var(--td-success-color, var(--td-success-color-5, #2ba471));
+}
+.t-progress--status--warning .t-progress__inner {
+ background: var(--td-progress-inner-bg-color-warning, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-progress--status--warning .t-progress__icon {
+ color: var(--td-warning-color, var(--td-warning-color-5, #e37318));
+}
+.t-progress--status--error .t-progress__inner {
+ background: var(--td-progress-inner-bg-color-error, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-progress--status--error .t-progress__icon {
+ color: var(--td-error-color, var(--td-error-color-6, #d54941));
+}
+@keyframes progress-active-animation {
+ 0% {
+ width: 0;
+ opacity: 0.1;
+ }
+ 35% {
+ width: 50%;
+ opacity: 0.4;
+ }
+ 100% {
+ width: 100%;
+ opacity: 0;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/props.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/props.d.ts
new file mode 100644
index 0000000..214f11a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/props.d.ts
@@ -0,0 +1,3 @@
+import { TdProgressProps } from './type';
+declare const props: TdProgressProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/props.js b/miniprogram_npm/tdesign-miniprogram/progress/props.js
new file mode 100644
index 0000000..406b7bc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/props.js
@@ -0,0 +1,33 @@
+const props = {
+ color: {
+ type: null,
+ value: '',
+ },
+ label: {
+ type: null,
+ value: true,
+ },
+ percentage: {
+ type: Number,
+ value: 0,
+ },
+ status: {
+ type: String,
+ },
+ strokeWidth: {
+ type: null,
+ },
+ style: {
+ type: String,
+ value: '',
+ },
+ theme: {
+ type: String,
+ value: 'line',
+ },
+ trackColor: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/type.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/type.d.ts
new file mode 100644
index 0000000..763d3bc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/type.d.ts
@@ -0,0 +1,36 @@
+export interface TdProgressProps {
+ color?: {
+ type: null;
+ value?: string | Array | Record;
+ };
+ label?: {
+ type: null;
+ value?: string | boolean;
+ };
+ percentage?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ status?: {
+ type: StringConstructor;
+ value?: ProgressStatus;
+ };
+ strokeWidth?: {
+ type: null;
+ value?: string | number;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: ProgressTheme;
+ };
+ trackColor?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
+export declare type ProgressStatus = 'success' | 'error' | 'warning' | 'active';
+export declare type ProgressTheme = 'line' | 'plump' | 'circle';
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/type.js b/miniprogram_npm/tdesign-miniprogram/progress/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts
new file mode 100644
index 0000000..84b7889
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts
@@ -0,0 +1,11 @@
+export declare type Gradients = {
+ [percent: string]: string;
+};
+export declare type FromTo = {
+ from: string;
+ to: string;
+};
+export declare type LinearGradient = {
+ direction?: string;
+} & (Gradients | FromTo);
+export declare function getBackgroundColor(color: string | string[] | LinearGradient): string;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/utils.js b/miniprogram_npm/tdesign-miniprogram/progress/utils.js
new file mode 100644
index 0000000..455982c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/utils.js
@@ -0,0 +1,30 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+export function getBackgroundColor(color) {
+ if (typeof color === 'string') {
+ return color;
+ }
+ if (Array.isArray(color)) {
+ if (color[0] && color[0][0] === '#') {
+ color.unshift('90deg');
+ }
+ return `linear-gradient( ${color.join(',')} )`;
+ }
+ const { from, to, direction = 'to right' } = color, rest = __rest(color, ["from", "to", "direction"]);
+ let keys = Object.keys(rest);
+ if (keys.length) {
+ keys = keys.sort((a, b) => parseFloat(a.substr(0, a.length - 1)) - parseFloat(b.substr(0, b.length - 1)));
+ const tempArr = keys.map((key) => `${rest[key]} ${key}`);
+ return `linear-gradient(${direction}, ${tempArr.join(',')})`;
+ }
+ return `linear-gradient(${direction}, ${from}, ${to})`;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/README.en-US.md
new file mode 100644
index 0000000..891acfb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/README.en-US.md
@@ -0,0 +1,54 @@
+:: BASE_DOC ::
+
+## API
+
+### PullDownRefresh 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
+disabled | Boolean | false | disabled pull down refresh | N
+enable-back-to-top | Boolean | true | `1.1.5` | N
+enable-passive | Boolean | false | `1.1.5` | N
+header | Slot | - | `1.2.10`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+loading-bar-height | String / Number | 50 | \- | N
+loading-props | Object | - | Typescript:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/pull-down-refresh/type.ts) | N
+loading-texts | Array | [] | Typescript:`string[]` | N
+lower-threshold | String / Number | 50 | `1.1.5` | N
+max-bar-height | String / Number | 80 | \- | N
+refresh-timeout | Number | 3000 | \- | N
+scroll-into-view | String | - | `1.1.5` | N
+show-scrollbar | Boolean | true | \- | N
+upper-threshold | String / Number | 50 | `1.1.5` | N
+using-custom-navbar | Boolean | false | \- | N
+value | Boolean | false | \- | N
+default-value | Boolean | undefined | uncontrolled property | N
+
+### PullDownRefresh Events
+
+name | params | description
+-- | -- | --
+change | `(value: boolean)` | \-
+dragend | `(scrollTop: number, scrollLeft: number)` | `1.2.10`
+dragging | `(scrollTop: number, scrollLeft: number)` | `1.2.10`
+dragstart | `(scrollTop: number, scrollLeft: number)` | `1.2.10`
+refresh | \- | \-
+scrolltolower | \- | \-
+timeout | \- | \-
+
+### PullDownRefresh External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-indicator | \-
+t-class-loading | \-
+t-class-text | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-pull-down-refresh-color | @font-gray-3 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/README.md b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/README.md
new file mode 100644
index 0000000..b777846
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/README.md
@@ -0,0 +1,87 @@
+---
+title: PullDownRefresh 下拉刷新
+description: 用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。
+spline: message
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 顶部下拉刷新
+
+由于组件内无法监听页面滚动,需要由页面获取组件实例,并将页面滚动事件传递到组件。
+
+{{ base }}
+
+> 在使用 pull-down-refresh 组件的页面,建议开启 `disableScroll: true`
+
+## API
+
+### PullDownRefresh Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+disabled | Boolean | false | 是否禁用下拉刷新 | N
+enable-back-to-top | Boolean | true | `1.1.5`。iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向。自 2.27.3 版本开始,若非显式设置为 false,则在显示尺寸大于屏幕 90% 时自动开启 | N
+enable-passive | Boolean | false | `1.1.5`。开启 passive 特性,能优化一定的滚动性能 | N
+header | Slot | - | `1.2.10`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+loading-bar-height | String / Number | 50 | 加载中下拉高度,如果值为数字则单位是:'px' | N
+loading-props | Object | - | 加载loading样式。TS 类型:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/pull-down-refresh/type.ts) | N
+loading-texts | Array | [] | 提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']。TS 类型:`string[]` | N
+lower-threshold | String / Number | 50 | `1.1.5`。距底部/右边多远时,触发 scrolltolower 事件 | N
+max-bar-height | String / Number | 80 | 最大下拉高度,如果值为数字则单位是:'px' | N
+refresh-timeout | Number | 3000 | 刷新超时时间 | N
+scroll-into-view | String | - | `1.1.5`。值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素 | N
+show-scrollbar | Boolean | true | 滚动条显隐控制 (同时开启 enhanced 属性后生效) | N
+upper-threshold | String / Number | 50 | `1.1.5`。距顶部/左边多远时,触发 scrolltoupper 事件 | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+value | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态 | N
+default-value | Boolean | undefined | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态。非受控属性 | N
+
+### PullDownRefresh Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: boolean)` | 下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态
+dragend | `(scrollTop: number, scrollLeft: number)` | `1.2.10`。滑动结束事件
+dragging | `(scrollTop: number, scrollLeft: number)` | `1.2.10`。滑动事件
+dragstart | `(scrollTop: number, scrollLeft: number)` | `1.2.10`。滑动开始事件
+refresh | \- | 结束下拉时触发
+scrolltolower | \- | 滚动到页面底部时触发
+timeout | \- | 刷新超时触发
+
+### PullDownRefresh External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-indicator | 指示样式类
+t-class-loading | 加载样式类
+t-class-text | 文本样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-pull-down-refresh-color | @font-gray-3 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/props.d.ts b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/props.d.ts
new file mode 100644
index 0000000..b7cb543
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/props.d.ts
@@ -0,0 +1,3 @@
+import { TdPullDownRefreshProps } from './type';
+declare const props: TdPullDownRefreshProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/props.js b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/props.js
new file mode 100644
index 0000000..b520f78
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/props.js
@@ -0,0 +1,65 @@
+const props = {
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ enableBackToTop: {
+ type: Boolean,
+ value: true,
+ },
+ enablePassive: {
+ type: Boolean,
+ value: false,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ loadingBarHeight: {
+ type: null,
+ value: 50,
+ },
+ loadingProps: {
+ type: Object,
+ },
+ loadingTexts: {
+ type: Array,
+ value: [],
+ },
+ lowerThreshold: {
+ type: null,
+ value: 50,
+ },
+ maxBarHeight: {
+ type: null,
+ value: 80,
+ },
+ refreshTimeout: {
+ type: Number,
+ value: 3000,
+ },
+ scrollIntoView: {
+ type: String,
+ value: '',
+ },
+ showScrollbar: {
+ type: Boolean,
+ value: true,
+ },
+ upperThreshold: {
+ type: null,
+ value: 50,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+ value: {
+ type: Boolean,
+ value: null,
+ },
+ defaultValue: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts
new file mode 100644
index 0000000..ec7a896
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts
@@ -0,0 +1,58 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class PullDownRefresh extends SuperComponent {
+ pixelRatio: number;
+ startPoint: {
+ pageX: number;
+ pageY: number;
+ } | null;
+ isPulling: boolean;
+ maxRefreshAnimateTimeFlag: number;
+ closingAnimateTimeFlag: number;
+ refreshStatusTimer: any;
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ pureDataPattern: RegExp;
+ };
+ relations: RelationsOptions;
+ properties: import("./type").TdPullDownRefreshProps;
+ behaviors: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ barHeight: number;
+ tipsHeight: number;
+ refreshStatus: number;
+ loosing: boolean;
+ enableToRefresh: boolean;
+ scrollTop: number;
+ _maxBarHeight: number;
+ _loadingBarHeight: number;
+ };
+ lifetimes: {
+ attached(): void;
+ detached(): void;
+ };
+ observers: {
+ value(val: any): void;
+ barHeight(val: any): void;
+ maxBarHeight(v: any): void;
+ loadingBarHeight(v: any): void;
+ };
+ methods: {
+ resetTimer(): void;
+ onScrollToBottom(): void;
+ onScrollToTop(): void;
+ onScroll(e: any): void;
+ onTouchStart(e: WechatMiniprogram.Component.TrivialInstance): void;
+ onTouchMove(e: WechatMiniprogram.Component.TrivialInstance): void;
+ onTouchEnd(e: WechatMiniprogram.Component.TrivialInstance): void;
+ onDragStart(e: WechatMiniprogram.ScrollViewDragStart): void;
+ onDragging(e: WechatMiniprogram.ScrollViewDragging): void;
+ onDragEnd(e: WechatMiniprogram.ScrollViewDragEnd): void;
+ doRefresh(): void;
+ setRefreshBarHeight(value: number): Promise;
+ setScrollTop(scrollTop: number): void;
+ scrollToTop(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js
new file mode 100644
index 0000000..5b1c649
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js
@@ -0,0 +1,214 @@
+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 { unitConvert, systemInfo } from '../common/utils';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-pull-down-refresh`;
+let PullDownRefresh = class PullDownRefresh extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.pixelRatio = 1;
+ this.startPoint = null;
+ this.isPulling = false;
+ this.maxRefreshAnimateTimeFlag = 0;
+ this.closingAnimateTimeFlag = 0;
+ this.refreshStatusTimer = null;
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-loading`, `${prefix}-class-text`, `${prefix}-class-indicator`];
+ this.options = {
+ multipleSlots: true,
+ pureDataPattern: /^_/,
+ };
+ this.relations = {
+ '../back-top/back-top': {
+ type: 'descendant',
+ },
+ };
+ this.properties = props;
+ this.behaviors = [useCustomNavbar];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ barHeight: 0,
+ tipsHeight: 0,
+ refreshStatus: -1,
+ loosing: false,
+ enableToRefresh: true,
+ scrollTop: 0,
+ _maxBarHeight: 0,
+ _loadingBarHeight: 0,
+ };
+ this.lifetimes = {
+ attached() {
+ const { screenWidth } = systemInfo;
+ const { loadingTexts, maxBarHeight, loadingBarHeight } = this.properties;
+ this.setData({
+ _maxBarHeight: unitConvert(maxBarHeight),
+ _loadingBarHeight: unitConvert(loadingBarHeight),
+ loadingTexts: Array.isArray(loadingTexts) && loadingTexts.length >= 4
+ ? loadingTexts
+ : ['下拉刷新', '松手刷新', '正在刷新', '刷新完成'],
+ });
+ this.pixelRatio = 750 / screenWidth;
+ },
+ detached() {
+ clearTimeout(this.maxRefreshAnimateTimeFlag);
+ clearTimeout(this.closingAnimateTimeFlag);
+ this.resetTimer();
+ },
+ };
+ this.observers = {
+ value(val) {
+ if (!val) {
+ clearTimeout(this.maxRefreshAnimateTimeFlag);
+ if (this.data.refreshStatus > 0) {
+ this.setData({
+ refreshStatus: 3,
+ });
+ }
+ this.setData({ barHeight: 0 });
+ }
+ else {
+ this.doRefresh();
+ }
+ },
+ barHeight(val) {
+ this.resetTimer();
+ if (val === 0 && this.data.refreshStatus !== -1) {
+ this.refreshStatusTimer = setTimeout(() => {
+ this.setData({ refreshStatus: -1 });
+ }, 240);
+ }
+ this.setData({ tipsHeight: Math.min(val, this.data._loadingBarHeight) });
+ },
+ maxBarHeight(v) {
+ this.setData({ _maxBarHeight: unitConvert(v) });
+ },
+ loadingBarHeight(v) {
+ this.setData({ _loadingBarHeight: unitConvert(v) });
+ },
+ };
+ this.methods = {
+ resetTimer() {
+ if (this.refreshStatusTimer) {
+ clearTimeout(this.refreshStatusTimer);
+ this.refreshStatusTimer = null;
+ }
+ },
+ onScrollToBottom() {
+ this.triggerEvent('scrolltolower');
+ },
+ onScrollToTop() {
+ this.setData({
+ enableToRefresh: true,
+ });
+ },
+ onScroll(e) {
+ const { scrollTop } = e.detail;
+ this.setData({
+ enableToRefresh: scrollTop === 0,
+ });
+ this.triggerEvent('scroll', { scrollTop });
+ },
+ onTouchStart(e) {
+ if (this.isPulling || !this.data.enableToRefresh || this.properties.disabled)
+ return;
+ const { touches } = e;
+ if (touches.length !== 1)
+ return;
+ const { pageX, pageY } = touches[0];
+ this.setData({ loosing: false });
+ this.startPoint = { pageX, pageY };
+ this.isPulling = true;
+ },
+ onTouchMove(e) {
+ if (!this.startPoint || this.properties.disabled)
+ return;
+ const { touches } = e;
+ if (touches.length !== 1)
+ return;
+ const { pageY } = touches[0];
+ const offset = pageY - this.startPoint.pageY;
+ if (offset > 0) {
+ this.setRefreshBarHeight(offset);
+ }
+ },
+ onTouchEnd(e) {
+ if (!this.startPoint || this.properties.disabled)
+ return;
+ const { changedTouches } = e;
+ if (changedTouches.length !== 1)
+ return;
+ const { pageY } = changedTouches[0];
+ const barHeight = pageY - this.startPoint.pageY;
+ this.startPoint = null;
+ this.isPulling = false;
+ this.setData({ loosing: true });
+ if (barHeight > this.data._loadingBarHeight) {
+ this._trigger('change', { value: true });
+ this.triggerEvent('refresh');
+ }
+ else {
+ this.setData({ barHeight: 0 });
+ }
+ },
+ onDragStart(e) {
+ const { scrollTop, scrollLeft } = e.detail;
+ this.triggerEvent('dragstart', { scrollTop, scrollLeft });
+ },
+ onDragging(e) {
+ const { scrollTop, scrollLeft } = e.detail;
+ this.triggerEvent('dragging', { scrollTop, scrollLeft });
+ },
+ onDragEnd(e) {
+ const { scrollTop, scrollLeft } = e.detail;
+ this.triggerEvent('dragend', { scrollTop, scrollLeft });
+ },
+ doRefresh() {
+ if (this.properties.disabled)
+ return;
+ this.setData({
+ barHeight: this.data._loadingBarHeight,
+ refreshStatus: 2,
+ loosing: true,
+ });
+ this.maxRefreshAnimateTimeFlag = setTimeout(() => {
+ this.maxRefreshAnimateTimeFlag = null;
+ if (this.data.refreshStatus === 2) {
+ this.triggerEvent('timeout');
+ this._trigger('change', { value: false });
+ }
+ }, this.properties.refreshTimeout);
+ },
+ setRefreshBarHeight(value) {
+ const barHeight = Math.min(value, this.data._maxBarHeight);
+ const data = { barHeight };
+ if (barHeight >= this.data._loadingBarHeight) {
+ data.refreshStatus = 1;
+ }
+ else {
+ data.refreshStatus = 0;
+ }
+ return new Promise((resolve) => {
+ this.setData(data, () => resolve(barHeight));
+ });
+ },
+ setScrollTop(scrollTop) {
+ this.setData({ scrollTop });
+ },
+ scrollToTop() {
+ this.setScrollTop(0);
+ },
+ };
+ }
+};
+PullDownRefresh = __decorate([
+ wxComponent()
+], PullDownRefresh);
+export default PullDownRefresh;
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.json b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.json
new file mode 100644
index 0000000..f20e164
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-loading": "../loading/loading"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml
new file mode 100644
index 0000000..a69012f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+ {{loadingTexts[refreshStatus]}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxss b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxss
new file mode 100644
index 0000000..e1b3a38
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxss
@@ -0,0 +1,56 @@
+.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-pull-down-refresh {
+ overflow: hidden;
+ height: 100%;
+}
+.t-pull-down-refresh__track {
+ position: relative;
+}
+.t-pull-down-refresh__track--loosing {
+ transition: transform ease 0.24s;
+}
+.t-pull-down-refresh__tips {
+ position: absolute;
+ color: var(--td-pull-down-refresh-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: 24rpx;
+ top: 0;
+ width: 100%;
+ transform: translateY(-100%);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ overflow: hidden;
+}
+.t-pull-down-refresh__tips--loosing {
+ transition: height ease 0.24s;
+}
+.t-pull-down-refresh__text {
+ margin: 16rpx 0 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/type.d.ts b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/type.d.ts
new file mode 100644
index 0000000..def88f7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/type.d.ts
@@ -0,0 +1,67 @@
+import { LoadingProps } from '../loading/index';
+export interface TdPullDownRefreshProps {
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ enableBackToTop?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ enablePassive?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-loading', 't-class-text', 't-class-indicator'];
+ };
+ loadingBarHeight?: {
+ type: null;
+ value?: string | number;
+ };
+ loadingProps?: {
+ type: ObjectConstructor;
+ value?: LoadingProps;
+ };
+ loadingTexts?: {
+ type: ArrayConstructor;
+ value?: string[];
+ };
+ lowerThreshold?: {
+ type: null;
+ value?: string | number;
+ };
+ maxBarHeight?: {
+ type: null;
+ value?: string | number;
+ };
+ refreshTimeout?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ scrollIntoView?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ showScrollbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ upperThreshold?: {
+ type: null;
+ value?: string | number;
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultValue?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/type.js b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/props.d.ts b/miniprogram_npm/tdesign-miniprogram/radio-group/props.d.ts
new file mode 100644
index 0000000..40dcb03
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/props.d.ts
@@ -0,0 +1,3 @@
+import { TdRadioGroupProps } from './type';
+declare const props: TdRadioGroupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/props.js b/miniprogram_npm/tdesign-miniprogram/radio-group/props.js
new file mode 100644
index 0000000..8802a7b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/props.js
@@ -0,0 +1,44 @@
+const props = {
+ allowUncheck: {
+ type: Boolean,
+ value: false,
+ },
+ borderless: {
+ type: Boolean,
+ value: false,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ icon: {
+ type: null,
+ value: 'circle',
+ },
+ keys: {
+ type: Object,
+ },
+ name: {
+ type: String,
+ value: '',
+ },
+ options: {
+ type: Array,
+ },
+ placement: {
+ type: String,
+ value: 'left',
+ },
+ readonly: {
+ type: null,
+ value: undefined,
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.d.ts b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.d.ts
new file mode 100644
index 0000000..c6141ea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.d.ts
@@ -0,0 +1,26 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class RadioGroup extends SuperComponent {
+ externalClasses: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ radioOptions: any[];
+ };
+ relations: RelationsOptions;
+ properties: import("./type").TdRadioGroupProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(v: any): void;
+ options(): void;
+ disabled(v: any): void;
+ };
+ methods: {
+ getChildren(): any;
+ updateValue(value: any): void;
+ handleRadioChange(e: any): void;
+ initWithOptions(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.js b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.js
new file mode 100644
index 0000000..493c23e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.js
@@ -0,0 +1,119 @@
+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 config from '../common/config';
+import { SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-radio-group`;
+let RadioGroup = class RadioGroup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ radioOptions: [],
+ };
+ this.relations = {
+ '../radio/radio': {
+ type: 'descendant',
+ linked(target) {
+ const { value, disabled, readonly } = this.data;
+ target.setData({
+ checked: value === target.data.value,
+ });
+ target.setDisabled(disabled);
+ target.setReadonly(readonly);
+ },
+ },
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value(v) {
+ this.getChildren().forEach((item) => {
+ item.setData({
+ checked: v === item.data.value,
+ });
+ });
+ },
+ options() {
+ this.initWithOptions();
+ },
+ disabled(v) {
+ var _a;
+ if ((_a = this.data.options) === null || _a === void 0 ? void 0 : _a.length) {
+ this.initWithOptions();
+ return;
+ }
+ this.getChildren().forEach((item) => {
+ item.setDisabled(v);
+ });
+ },
+ };
+ this.methods = {
+ getChildren() {
+ let items = this.$children;
+ if (!(items === null || items === void 0 ? void 0 : items.length)) {
+ items = this.selectAllComponents(`.${prefix}-radio-option`);
+ }
+ return items;
+ },
+ updateValue(value) {
+ this._trigger('change', { value });
+ },
+ handleRadioChange(e) {
+ const { checked } = e.detail;
+ const { value, index, allowUncheck } = e.target.dataset;
+ this._trigger('change', checked === false && allowUncheck ? { value: null, index } : { value, index });
+ },
+ initWithOptions() {
+ const { options, value, keys, disabled, readonly } = this.data;
+ if (!(options === null || options === void 0 ? void 0 : options.length) || !Array.isArray(options)) {
+ this.setData({
+ radioOptions: [],
+ });
+ return;
+ }
+ const optionsValue = [];
+ try {
+ options.forEach((element) => {
+ var _a, _b, _c;
+ const typeName = typeof element;
+ if (typeName === 'number' || typeName === 'string') {
+ optionsValue.push({
+ label: `${element}`,
+ value: element,
+ checked: value === element,
+ disabled,
+ readonly,
+ });
+ }
+ else if (typeName === 'object') {
+ optionsValue.push(Object.assign(Object.assign({}, element), { label: element[(_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label'], value: element[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'], checked: value === element[(_c = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _c !== void 0 ? _c : 'value'], disabled: element.disabled || disabled, readonly: element.readonly || readonly }));
+ }
+ });
+ this.setData({
+ radioOptions: optionsValue,
+ });
+ }
+ catch (error) {
+ console.error('error', error);
+ }
+ },
+ };
+ }
+};
+RadioGroup = __decorate([
+ wxComponent()
+], RadioGroup);
+export default RadioGroup;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.json b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.json
new file mode 100644
index 0000000..c2c7a60
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-radio": "../radio/radio"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.wxml b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.wxml
new file mode 100644
index 0000000..096c01a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.wxss b/miniprogram_npm/tdesign-miniprogram/radio-group/radio-group.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/type.d.ts b/miniprogram_npm/tdesign-miniprogram/radio-group/type.d.ts
new file mode 100644
index 0000000..d7954bd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/type.d.ts
@@ -0,0 +1,56 @@
+import { KeysType } from '../common/common';
+export interface TdRadioGroupProps {
+ allowUncheck?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ borderless?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: 'circle' | 'line' | 'dot' | Array;
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: KeysType;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'left' | 'right';
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: T;
+ };
+ defaultValue?: {
+ type: null;
+ value?: T;
+ };
+}
+export declare type RadioOption = string | number | RadioOptionObj;
+export interface RadioOptionObj {
+ label?: string;
+ value?: string | number;
+ readonly?: boolean;
+ disabled?: boolean;
+ allowUncheck?: boolean;
+}
+export declare type RadioValue = string | number | boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio-group/type.js b/miniprogram_npm/tdesign-miniprogram/radio-group/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio-group/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/radio/README.en-US.md
new file mode 100644
index 0000000..638511a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/README.en-US.md
@@ -0,0 +1,90 @@
+:: BASE_DOC ::
+
+## API
+
+### Radio 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
+allow-uncheck | Boolean | false | \- | N
+block | Boolean | true | \- | N
+checked | Boolean | false | \- | N
+default-checked | Boolean | undefined | uncontrolled property | N
+content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content-disabled | Boolean | false | \- | N
+disabled | Boolean | undefined | \- | N
+icon | String / Array / Slot | 'circle' | Typescript:`'circle' \| 'line' \| 'dot' \| Array` | N
+label | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max-content-row | Number | 5 | \- | N
+max-label-row | Number | 3 | \- | N
+name | String | - | \- | N
+placement | String | - | options: left/right | N
+readonly | Boolean | undefined | \- | N
+value | String / Number / Boolean | false | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio/type.ts) | N
+
+### Radio Events
+
+name | params | description
+-- | -- | --
+change | `(checked: boolean)` | \-
+
+### Radio External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-border | \-
+t-class-content | \-
+t-class-icon | \-
+t-class-label | \-
+
+
+### RadioGroup 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
+allow-uncheck | Boolean | false | \- | N
+borderless | Boolean | false | \- | N
+disabled | Boolean | undefined | \- | N
+icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'dot' \| Array` | N
+keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+name | String | - | \- | N
+options | Array | - | Typescript:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string; value?: string \| number; readonly?: boolean; disabled?: boolean; allowUncheck?: boolean; }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
+placement | String | left | options: left/right | N
+readonly | Boolean | undefined | \- | N
+value | String / Number / Boolean | - | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
+default-value | String / Number / Boolean | undefined | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
+
+### RadioGroup Events
+
+name | params | description
+-- | -- | --
+change | `(value: RadioValue)` | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-radio-bg-color | @bg-color-container | -
+--td-radio-border-color | @component-stroke | -
+--td-radio-content-checked-color | @font-gray-2 | -
+--td-radio-content-color | @font-gray-2 | -
+--td-radio-content-disabled-color | @font-gray-4 | -
+--td-radio-content-font-size | 28rpx | -
+--td-radio-content-line-height | 44rpx | -
+--td-radio-font-size | 32rpx | -
+--td-radio-icon-checked-color | @brand-color | -
+--td-radio-icon-color | @component-border | -
+--td-radio-icon-disabled-bg-color | @bg-color-component-disabled | -
+--td-radio-icon-disabled-color | @brand-color-disabled | -
+--td-radio-icon-size | 48rpx | -
+--td-radio-label-checked-color | @font-gray-1 | -
+--td-radio-label-color | @font-gray-1 | -
+--td-radio-label-disabled-color | @font-gray-4 | -
+--td-radio-label-line-height | 48rpx | -
+--td-radio-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/README.md b/miniprogram_npm/tdesign-miniprogram/radio/README.md
new file mode 100644
index 0000000..90ede13
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/README.md
@@ -0,0 +1,143 @@
+---
+title: Radio 单选框
+description: 用于在预设的一组选项中执行单项选择,并呈现选择结果。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-radio": "tdesign-miniprogram/radio/radio",
+ "t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 纵向单选框
+
+{{ base }}
+
+### 横向单选框
+
+{{ horizontal }}
+
+### 单选框状态
+
+{{ status }}
+
+### 勾选样式
+
+{{ theme }}
+
+### 勾选显示位置
+
+{{ align }}
+
+### 非通栏单选样式
+
+{{ card }}
+
+### 特殊样式
+
+{{ special }}
+
+## API
+
+### Radio Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+allow-uncheck | Boolean | false | 是否允许取消选中 | N
+block | Boolean | true | 是否为块级元素 | N
+checked | Boolean | false | 是否选中 | N
+default-checked | Boolean | undefined | 是否选中。非受控属性 | N
+content | String / Slot | - | 单选内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+content-disabled | Boolean | false | 是否禁用组件内容(content)触发选中 | N
+disabled | Boolean | undefined | 是否为禁用态 | N
+icon | String / Array / Slot | 'circle' | 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标]`。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标,值为 slot 时使用插槽。TS 类型:`'circle' \| 'line' \| 'dot' \| Array` | N
+label | String / Slot | - | 主文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+max-content-row | Number | 5 | 内容最大行数限制 | N
+max-label-row | Number | 3 | 主文案最大行数限制 | N
+name | String | - | HTML 元素原生属性 | N
+placement | String | - | 复选框和内容相对位置。优先级高于 RadioGroup.placement。Radio 单独存在时,默认值为 left。如果父组件存在 RadioGroup,默认值便由 RadioGroup.placement 决定。可选项:left/right | N
+readonly | Boolean | undefined | 只读状态 | N
+value | String / Number / Boolean | false | 单选按钮的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio/type.ts) | N
+
+### Radio Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(checked: boolean)` | 值变化时触发
+
+### Radio External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-border | 边框样式类
+t-class-content | 内容样式类
+t-class-icon | 图标样式类
+t-class-label | 标签样式类
+
+
+### RadioGroup Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+allow-uncheck | Boolean | false | 是否允许取消选中 | N
+borderless | Boolean | false | 是否开启无边框模式 | N
+disabled | Boolean | undefined | 是否禁用全部子单选框 | N
+icon | String / Array | 'circle' | 自定义选中图标和非选中图标。示例:[选中态图标,非选中态图标]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标;仅在使用 options 时生效。TS 类型:`'circle' \| 'line' \| 'dot' \| Array` | N
+keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+name | String | - | HTML 元素原生属性 | N
+options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string; value?: string \| number; readonly?: boolean; disabled?: boolean; allowUncheck?: boolean; }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
+placement | String | left | 复选框和内容相对位置。优先级低于 Radio.placement。可选项:left/right | N
+readonly | Boolean | undefined | 只读状态 | N
+value | String / Number / Boolean | - | 选中的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
+default-value | String / Number / Boolean | undefined | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
+
+### RadioGroup Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: RadioValue)` | 选中值发生变化时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-radio-bg-color | @bg-color-container | -
+--td-radio-border-color | @component-stroke | -
+--td-radio-content-checked-color | @font-gray-2 | -
+--td-radio-content-color | @font-gray-2 | -
+--td-radio-content-disabled-color | @font-gray-4 | -
+--td-radio-content-font-size | 28rpx | -
+--td-radio-content-line-height | 44rpx | -
+--td-radio-font-size | 32rpx | -
+--td-radio-icon-checked-color | @brand-color | -
+--td-radio-icon-color | @component-border | -
+--td-radio-icon-disabled-bg-color | @bg-color-component-disabled | -
+--td-radio-icon-disabled-color | @brand-color-disabled | -
+--td-radio-icon-size | 48rpx | -
+--td-radio-label-checked-color | @font-gray-1 | -
+--td-radio-label-color | @font-gray-1 | -
+--td-radio-label-disabled-color | @font-gray-4 | -
+--td-radio-label-line-height | 48rpx | -
+--td-radio-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/props.d.ts b/miniprogram_npm/tdesign-miniprogram/radio/props.d.ts
new file mode 100644
index 0000000..c59a8d0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/props.d.ts
@@ -0,0 +1,3 @@
+import { TdRadioProps } from './type';
+declare const props: TdRadioProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/props.js b/miniprogram_npm/tdesign-miniprogram/radio/props.js
new file mode 100644
index 0000000..3569da0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/props.js
@@ -0,0 +1,60 @@
+const props = {
+ allowUncheck: {
+ type: Boolean,
+ value: false,
+ },
+ block: {
+ type: Boolean,
+ value: true,
+ },
+ checked: {
+ type: Boolean,
+ value: null,
+ },
+ defaultChecked: {
+ type: Boolean,
+ value: false,
+ },
+ content: {
+ type: String,
+ },
+ contentDisabled: {
+ type: Boolean,
+ value: false,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ icon: {
+ type: null,
+ value: 'circle',
+ },
+ label: {
+ type: String,
+ },
+ maxContentRow: {
+ type: Number,
+ value: 5,
+ },
+ maxLabelRow: {
+ type: Number,
+ value: 3,
+ },
+ name: {
+ type: String,
+ value: '',
+ },
+ placement: {
+ type: String,
+ },
+ readonly: {
+ type: null,
+ value: undefined,
+ },
+ value: {
+ type: null,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/radio.d.ts b/miniprogram_npm/tdesign-miniprogram/radio/radio.d.ts
new file mode 100644
index 0000000..5e142e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/radio.d.ts
@@ -0,0 +1,107 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Radio extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ relations: RelationsOptions;
+ options: {
+ multipleSlots: boolean;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ properties: {
+ borderless: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
+ tId: {
+ type: StringConstructor;
+ };
+ allowUncheck?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ contentDisabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string[] | "circle" | "line" | "dot";
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ maxContentRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ maxLabelRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: "left" | "right";
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: import("./type").RadioValue;
+ };
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ customIcon: boolean;
+ slotIcon: boolean;
+ optionLinked: boolean;
+ iconVal: any[];
+ _placement: string;
+ _disabled: boolean;
+ _readonly: boolean;
+ };
+ observers: {
+ disabled(v: any): void;
+ readonly(v: any): void;
+ };
+ methods: {
+ handleTap(e: any): void;
+ doChange(): void;
+ init(): void;
+ setDisabled(disabled: Boolean): void;
+ setReadonly(readonly: Boolean): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/radio.js b/miniprogram_npm/tdesign-miniprogram/radio/radio.js
new file mode 100644
index 0000000..6ee99e2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/radio.js
@@ -0,0 +1,118 @@
+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 config from '../common/config';
+import { SuperComponent, wxComponent } from '../common/src/index';
+import Props from './props';
+const { prefix } = config;
+const name = `${prefix}-radio`;
+let Radio = class Radio extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-label`,
+ `${prefix}-class-icon`,
+ `${prefix}-class-content`,
+ `${prefix}-class-border`,
+ ];
+ this.behaviors = ['wx://form-field'];
+ this.relations = {
+ '../radio-group/radio-group': {
+ type: 'ancestor',
+ linked(parent) {
+ if (parent.data.borderless) {
+ this.setData({ borderless: true });
+ }
+ },
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.lifetimes = {
+ attached() {
+ this.init();
+ },
+ };
+ this.properties = Object.assign(Object.assign({}, Props), { borderless: {
+ type: Boolean,
+ value: false,
+ }, tId: {
+ type: String,
+ } });
+ this.controlledProps = [
+ {
+ key: 'checked',
+ event: 'change',
+ },
+ ];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ customIcon: false,
+ slotIcon: false,
+ optionLinked: false,
+ iconVal: [],
+ _placement: '',
+ _disabled: false,
+ _readonly: false,
+ };
+ this.observers = {
+ disabled(v) {
+ this.setData({ _disabled: v });
+ },
+ readonly(v) {
+ this.setData({ _readonly: v });
+ },
+ };
+ this.methods = {
+ handleTap(e) {
+ const { _disabled, _readonly, contentDisabled } = this.data;
+ const { target } = e.currentTarget.dataset;
+ if (_disabled || _readonly || (target === 'text' && contentDisabled))
+ return;
+ this.doChange();
+ },
+ doChange() {
+ var _a;
+ const { value, checked, allowUncheck } = this.data;
+ const isAllowUncheck = Boolean(allowUncheck || ((_a = this.$parent) === null || _a === void 0 ? void 0 : _a.data.allowUncheck));
+ if (this.$parent) {
+ this.$parent.updateValue(checked && isAllowUncheck ? null : value);
+ }
+ else {
+ this._trigger('change', { checked: isAllowUncheck ? !checked : true });
+ }
+ },
+ init() {
+ var _a, _b, _c, _d, _e, _f;
+ const { icon } = this.data;
+ const isIdArr = Array.isArray(((_a = this.$parent) === null || _a === void 0 ? void 0 : _a.icon) || icon);
+ this.setData({
+ customIcon: isIdArr,
+ slotIcon: icon === 'slot',
+ iconVal: isIdArr ? ((_b = this.$parent) === null || _b === void 0 ? void 0 : _b.icon) || icon : [],
+ _placement: (_f = (_c = this.data.placement) !== null && _c !== void 0 ? _c : (_e = (_d = this.$parent) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.placement) !== null && _f !== void 0 ? _f : 'left',
+ });
+ },
+ setDisabled(disabled) {
+ this.setData({
+ _disabled: this.data.disabled || disabled,
+ });
+ },
+ setReadonly(readonly) {
+ this.setData({
+ _readonly: this.data.readonly || readonly,
+ });
+ },
+ };
+ }
+};
+Radio = __decorate([
+ wxComponent()
+], Radio);
+export default Radio;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/radio.json b/miniprogram_npm/tdesign-miniprogram/radio/radio.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/radio.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/radio.wxml b/miniprogram_npm/tdesign-miniprogram/radio/radio.wxml
new file mode 100644
index 0000000..eb3ebea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/radio.wxml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{label}}
+
+
+
+
+
+ {{content}}
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/radio.wxss b/miniprogram_npm/tdesign-miniprogram/radio/radio.wxss
new file mode 100644
index 0000000..f8af3d8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/radio.wxss
@@ -0,0 +1,206 @@
+.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);
+}
+.limit-title-row {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.t-radio {
+ position: relative;
+ display: inline-flex;
+ vertical-align: middle;
+ font-size: var(--td-radio-font-size, 32rpx);
+ background: var(--td-radio-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-radio:focus {
+ outline: 0;
+}
+.t-radio--block {
+ display: flex;
+ padding: var(--td-radio-vertical-padding, 32rpx);
+}
+.t-radio--right {
+ flex-direction: row-reverse;
+}
+.t-radio__icon {
+ position: relative;
+ margin-top: calc((var(--td-radio-label-line-height, 48rpx) - var(--td-radio-icon-size, 48rpx)) / 2);
+ width: var(--td-radio-icon-size, 48rpx);
+ height: var(--td-radio-icon-size, 48rpx);
+ font-size: var(--td-radio-icon-size, 48rpx);
+ color: var(--td-radio-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ overflow: hidden;
+}
+.t-radio__icon:empty {
+ display: none;
+}
+.t-radio__icon--left {
+ margin-right: 16rpx;
+}
+.t-radio__icon--checked {
+ color: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-radio__icon--disabled {
+ cursor: not-allowed;
+ color: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-radio__icon-circle {
+ width: var(--td-radio-icon-size, 48rpx);
+ height: var(--td-radio-icon-size, 48rpx);
+ box-sizing: border-box;
+}
+.t-radio__icon-circle::after {
+ content: '';
+ width: calc(200% - 6rpx);
+ height: calc(200% - 6rpx);
+ border-radius: 50%;
+ border: 3px solid var(--td-radio-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ box-sizing: border-box;
+}
+.t-radio__icon-circle--disabled::after {
+ background: var(--td-radio-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-radio__icon-line::before,
+.t-radio__icon-line::after {
+ content: '';
+ display: block;
+ position: absolute;
+ width: 5rpx;
+ border-radius: 2rpx;
+ background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ transform-origin: top center;
+}
+.t-radio__icon-line::before {
+ height: 16rpx;
+ left: 8rpx;
+ top: 22rpx;
+ transform: rotate(-45deg);
+}
+.t-radio__icon-line::after {
+ height: 26rpx;
+ right: 8rpx;
+ top: 14rpx;
+ transform: rotate(45deg);
+}
+.t-radio__icon-line--disabled::before,
+.t-radio__icon-line--disabled::after {
+ background: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-radio__icon-dot {
+ width: calc((var(--td-radio-icon-size, 48rpx) - 6rpx) * 2);
+ height: calc((var(--td-radio-icon-size, 48rpx) - 6rpx) * 2);
+ border: 6rpx solid var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-radio__icon-dot::after {
+ content: '';
+ display: block;
+ width: var(--td-radio-icon-size, 48rpx);
+ height: var(--td-radio-icon-size, 48rpx);
+ background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-radius: 50%;
+}
+.t-radio__icon-dot--disabled {
+ border-color: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-radio__icon-dot--disabled::after {
+ background: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-radio__image {
+ line-height: var(--td-radio-icon-size, 48rpx);
+}
+.t-radio-icon__image {
+ height: var(--td-radio-icon-size, 48rpx);
+ width: var(--td-radio-icon-size, 48rpx);
+ vertical-align: sub;
+}
+.t-radio__content {
+ flex: 1;
+}
+.t-radio__content:empty {
+ display: none;
+}
+.t-radio__title {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ color: var(--td-radio-label-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ line-height: var(--td-radio-label-line-height, 48rpx);
+}
+.t-radio__title--checked {
+ color: var(--td-radio-label-checked-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-radio__title--disabled {
+ cursor: not-allowed;
+ color: var(--td-radio-label-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-radio__description {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ color: var(--td-radio-content-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ font-size: var(--td-radio-content-font-size, 28rpx);
+ line-height: var(--td-radio-content-line-height, 44rpx);
+}
+.t-radio__description--checked {
+ color: var(--td-radio-content-checked-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+}
+.t-radio__description--disabled {
+ cursor: not-allowed;
+ color: var(--td-radio-content-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-radio__description:empty {
+ display: none;
+}
+.t-radio__title + .t-radio__description {
+ margin-top: 8rpx;
+}
+.t-radio__border {
+ position: absolute;
+ bottom: 0;
+ height: 1px;
+ background: var(--td-radio-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ left: 96rpx;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-radio__border--right {
+ left: 32rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/type.d.ts b/miniprogram_npm/tdesign-miniprogram/radio/type.d.ts
new file mode 100644
index 0000000..c39da7f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/type.d.ts
@@ -0,0 +1,63 @@
+export interface TdRadioProps {
+ allowUncheck?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ contentDisabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: 'circle' | 'line' | 'dot' | Array;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ maxContentRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ maxLabelRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'left' | 'right';
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: T;
+ };
+}
+export declare type RadioValue = string | number | boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/radio/type.js b/miniprogram_npm/tdesign-miniprogram/radio/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/radio/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/rate/README.en-US.md
new file mode 100644
index 0000000..1d6b692
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/README.en-US.md
@@ -0,0 +1,50 @@
+:: BASE_DOC ::
+
+## API
+
+### Rate 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
+allow-half | Boolean | false | \- | N
+color | String / Array | '#ED7B2F' | `0.30.0`。Typescript:`string \| Array` | N
+count | Number | 5 | \- | N
+disabled | Boolean | undefined | \- | N
+gap | String / Number | 8 | \- | N
+icon | String / Array | - | `0.30.0`。Typescript:`string \| string[]` | N
+icon-prefix | String | undefined | \- | N
+placement | String | top | options: top / bottom / '' | N
+show-text | Boolean | false | \- | N
+size | String | 24px | \- | N
+texts | Array | [] | Typescript:`Array` | N
+value | Number | 0 | \- | N
+default-value | Number | undefined | uncontrolled property | N
+variant | String | outline | options: outline/filled | N
+
+### Rate Events
+
+name | params | description
+-- | -- | --
+change | `(value: number)` | \-
+### Rate External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-icon | \-
+t-class-text | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-rate-icon-scale | 1.33 | -
+--td-rate-selected-color | @warning-color | -
+--td-rate-text-active-color | @font-gray-1 | -
+--td-rate-text-active-font-weight | 600 | -
+--td-rate-text-color | @font-gray-4 | -
+--td-rate-text-font-size | @font-size-m | -
+--td-rate-unselected-color | @bg-color-secondarycomponent | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/README.md b/miniprogram_npm/tdesign-miniprogram/rate/README.md
new file mode 100644
index 0000000..181f687
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/README.md
@@ -0,0 +1,119 @@
+---
+title: Rate 评分
+description: 用于对某行为/事物进行打分。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+{
+ "usingComponents": {
+ "t-rate": "tdesign-miniprogram/rate/rate"
+ }
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+实心评分
+
+{{ base }}
+
+自定义评分
+
+{{ custom }}
+
+自定义评分数量
+
+{{ count }}
+
+带描述评分
+
+{{ show-text }}
+
+### 组件状态
+
+{{ action }}
+
+### 组件样式
+
+评分大小
+
+{{ size }}
+
+设置评分颜色
+
+{{ color }}
+
+### 特殊样式
+
+竖向带描述评分
+
+{{ special }}
+
+自定义图片前缀
+
+{{iconPrefix}}
+
+
+## API
+
+### Rate Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+allow-half | Boolean | false | 是否允许半选 | N
+color | String / Array | '#ED7B2F' | `0.30.0`。评分图标的颜色,样式中默认为 #ED7B2F。一个值表示设置选中高亮的五角星颜色,示例:[选中颜色]。数组则表示分别设置 选中高亮的五角星颜色 和 未选中暗灰的五角星颜色,[选中颜色,未选中颜色]。示例:['#ED7B2F', '#E3E6EB']。TS 类型:`string \| Array` | N
+count | Number | 5 | 评分的数量 | N
+disabled | Boolean | undefined | 是否禁用评分 | N
+gap | String / Number | 8 | 评分图标的间距 | N
+icon | String / Array | - | `0.30.0`。自定义评分图标,[选中图标,未选中图标]。TS 类型:`string \| string[]` | N
+icon-prefix | String | undefined | 定义图标前缀 | N
+placement | String | top | 选择评分弹框的位置,值为空字符表示不显示评分弹框。可选项:top / bottom / '' | N
+show-text | Boolean | false | 是否显示对应的辅助文字 | N
+size | String | 24px | 评分图标的大小 | N
+texts | Array | [] | 评分等级对应的辅助文字。组件内置默认值为:['极差', '失望', '一般', '满意', '惊喜']。自定义值示例:['1分', '2分', '3分', '4分', '5分']。TS 类型:`Array` | N
+value | Number | 0 | 选择评分的值 | N
+default-value | Number | undefined | 选择评分的值。非受控属性 | N
+variant | String | outline | 已废弃。形状类型,有描边类型和填充类型两种。可选项:outline/filled | N
+
+### Rate Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: number)` | 评分数改变时触发
+### Rate External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-icon | 图标样式类
+t-class-text | 文本样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-rate-icon-scale | 1.33 | -
+--td-rate-selected-color | @warning-color | -
+--td-rate-text-active-color | @font-gray-1 | -
+--td-rate-text-active-font-weight | 600 | -
+--td-rate-text-color | @font-gray-4 | -
+--td-rate-text-font-size | @font-size-m | -
+--td-rate-unselected-color | @bg-color-secondarycomponent | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/props.d.ts b/miniprogram_npm/tdesign-miniprogram/rate/props.d.ts
new file mode 100644
index 0000000..f908fa5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/props.d.ts
@@ -0,0 +1,3 @@
+import { TdRateProps } from './type';
+declare const props: TdRateProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/props.js b/miniprogram_npm/tdesign-miniprogram/rate/props.js
new file mode 100644
index 0000000..fb99e43
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/props.js
@@ -0,0 +1,58 @@
+const props = {
+ allowHalf: {
+ type: Boolean,
+ value: false,
+ },
+ color: {
+ type: null,
+ value: '#ED7B2F',
+ },
+ count: {
+ type: Number,
+ value: 5,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ gap: {
+ type: null,
+ value: 8,
+ },
+ icon: {
+ type: null,
+ },
+ iconPrefix: {
+ type: String,
+ value: undefined,
+ },
+ placement: {
+ type: String,
+ value: 'top',
+ },
+ showText: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: '24px',
+ },
+ texts: {
+ type: Array,
+ value: [],
+ },
+ value: {
+ type: Number,
+ value: null,
+ },
+ defaultValue: {
+ type: Number,
+ value: 0,
+ },
+ variant: {
+ type: String,
+ value: 'outline',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/rate.d.ts b/miniprogram_npm/tdesign-miniprogram/rate/rate.d.ts
new file mode 100644
index 0000000..e6070ab
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/rate.d.ts
@@ -0,0 +1,29 @@
+import { SuperComponent } from '../common/src/index';
+export default class Rate extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdRateProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ defaultTexts: string[];
+ tipsVisible: boolean;
+ tipsLeft: number;
+ actionType: string;
+ scaleIndex: number;
+ isVisibleToScreenReader: boolean;
+ };
+ methods: {
+ onTouch(e: WechatMiniprogram.TouchEvent, eventType: 'tap' | 'move'): void;
+ onTap(e: WechatMiniprogram.TouchEvent): void;
+ onTouchStart(): void;
+ onTouchMove(e: WechatMiniprogram.TouchEvent): void;
+ onTouchEnd(): void;
+ hideTips(): void;
+ onSelect(e: WechatMiniprogram.TouchEvent): void;
+ showAlertText(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/rate.js b/miniprogram_npm/tdesign-miniprogram/rate/rate.js
new file mode 100644
index 0000000..ad72249
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/rate.js
@@ -0,0 +1,118 @@
+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 { unitConvert, getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-rate`;
+let Rate = class Rate extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-icon`, `${prefix}-class-text`];
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ defaultTexts: ['极差', '失望', '一般', '满意', '惊喜'],
+ tipsVisible: false,
+ tipsLeft: 0,
+ actionType: '',
+ scaleIndex: -1,
+ isVisibleToScreenReader: false,
+ };
+ this.methods = {
+ onTouch(e, eventType) {
+ const { count, allowHalf, gap, value: currentValue, size } = this.properties;
+ const [touch] = e.changedTouches;
+ const margin = unitConvert(gap);
+ getRect(this, `.${name}__wrapper`).then((rect) => {
+ const { width, left } = rect;
+ const starWidth = (width - (count - 1) * margin) / count;
+ const offsetX = touch.pageX - left;
+ const num = (offsetX + margin) / (starWidth + margin);
+ const remainder = num % 1;
+ const integral = num - remainder;
+ let value = remainder <= 0.5 && allowHalf ? integral + 0.5 : integral + 1;
+ if (value > count) {
+ value = count;
+ }
+ else if (value < 0) {
+ value = 0;
+ }
+ if (eventType === 'move' || (eventType === 'tap' && allowHalf)) {
+ const left = Math.ceil(value - 1) * (unitConvert(gap) + unitConvert(size)) + unitConvert(size) * 0.5;
+ this.setData({
+ tipsVisible: true,
+ actionType: eventType,
+ scaleIndex: Math.ceil(value),
+ tipsLeft: Math.max(left, 0),
+ });
+ }
+ if (value !== currentValue) {
+ this._trigger('change', { value });
+ }
+ if (this.touchEnd) {
+ this.hideTips();
+ }
+ });
+ },
+ onTap(e) {
+ const { disabled } = this.properties;
+ if (disabled)
+ return;
+ this.onTouch(e, 'tap');
+ },
+ onTouchStart() {
+ this.touchEnd = false;
+ },
+ onTouchMove(e) {
+ this.onTouch(e, 'move');
+ this.showAlertText();
+ },
+ onTouchEnd() {
+ this.touchEnd = true;
+ this.hideTips();
+ },
+ hideTips() {
+ if (this.data.actionType === 'move') {
+ this.setData({ tipsVisible: false, scaleIndex: -1 });
+ }
+ },
+ onSelect(e) {
+ const { value } = e.currentTarget.dataset;
+ const { actionType } = this.data;
+ if (actionType === 'move')
+ return;
+ this._trigger('change', { value });
+ setTimeout(() => this.setData({ tipsVisible: false, scaleIndex: -1 }), 300);
+ },
+ showAlertText() {
+ if (this.data.isVisibleToScreenReader === true)
+ return;
+ this.setData({
+ isVisibleToScreenReader: true,
+ });
+ setTimeout(() => {
+ this.setData({
+ isVisibleToScreenReader: false,
+ });
+ }, 2e3);
+ },
+ };
+ }
+};
+Rate = __decorate([
+ wxComponent()
+], Rate);
+export default Rate;
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/rate.json b/miniprogram_npm/tdesign-miniprogram/rate/rate.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/rate.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/rate.wxml b/miniprogram_npm/tdesign-miniprogram/rate/rate.wxml
new file mode 100644
index 0000000..a31cd1c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/rate.wxml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+ {{utils.getText(texts,value,defaultTexts)}}
+ {{value+'星'}} {{utils.getText(texts,value,defaultTexts)}}
+
+
+
+
+ {{utils.ceil(value) - 0.5}}
+
+
+
+ {{utils.ceil(value)}}
+
+
+
+
+ {{value}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/rate.wxs b/miniprogram_npm/tdesign-miniprogram/rate/rate.wxs
new file mode 100644
index 0000000..8387b10
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/rate.wxs
@@ -0,0 +1,65 @@
+module.exports = {
+ getText: function (texts, val, defaultTexts) {
+ if (!texts.length) {
+ texts = defaultTexts;
+ }
+ var curVal = Math.floor(val - 1);
+ return texts[curVal] || '未评分';
+ },
+
+ getIconName: function (defaultValue, value, index, icon) {
+ var curVal = value >= 0 ? value : defaultValue;
+ var name = ['star-filled', 'star-filled'];
+
+ if (icon) {
+ name = icon.constructor == 'Array' ? icon : [icon, icon];
+ }
+
+ return name[curVal >= index + 1 ? 0 : 1];
+ },
+
+ getIconClass: function (classPrefix, defaultValue, value, index, allowHalf, disabled, scaleIndex) {
+ var curVal = value >= 0 ? value : defaultValue;
+ var className = [];
+ if (curVal >= index + 1) {
+ className.push(classPrefix + '--selected');
+ if (disabled) {
+ className.push(classPrefix + '--disabled');
+ }
+ if (scaleIndex === index + 1) {
+ className.push(classPrefix + '--current');
+ }
+ } else if (allowHalf && curVal - index > 0) {
+ className.push(classPrefix + '--selected-half');
+ if (scaleIndex === index + 1) {
+ className.push(classPrefix + '--current');
+ }
+ if (disabled) {
+ className.push(classPrefix + '--disabled-half');
+ }
+ } else {
+ className.push(classPrefix + '--unselected');
+ }
+ return className.join(' ');
+ },
+
+ ceil: function (value) {
+ return Math.ceil(value);
+ },
+
+ getColor: function (color) {
+ if (color.constructor === 'Array' && color.length === 2) {
+ return ';--td-rate-selected-color: ' + color[0] + '; --td-rate-unselected-color: ' + color[1];
+ }
+
+ if (typeof color === 'string') {
+ return ';--td-rate-selected-color: ' + color;
+ }
+
+ return '';
+ },
+
+ regSize: function (val) {
+ return val.indexOf('px') ? val : val + 'px';
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/rate.wxss b/miniprogram_npm/tdesign-miniprogram/rate/rate.wxss
new file mode 100644
index 0000000..44db501
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/rate.wxss
@@ -0,0 +1,109 @@
+.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-rate {
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+}
+.t-rate__wrapper {
+ line-height: 1em;
+ display: inline-flex;
+}
+.t-rate__icon {
+ display: block;
+ line-height: 1em;
+ width: 1em;
+ transition: transform 0.3s ease;
+}
+.t-rate__icon--current {
+ transform: scale(var(--td-rate-icon-scale, 1.33));
+}
+.t-rate__icon--selected {
+ color: var(--td-rate-selected-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-rate__icon--selected-half {
+ color: transparent;
+ background: linear-gradient(to right, var(--td-rate-selected-color, var(--td-warning-color, var(--td-warning-color-5, #e37318))) 0%, var(--td-rate-selected-color, var(--td-warning-color, var(--td-warning-color-5, #e37318))) 50%, var(--td-rate-unselected-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc))) 51%, var(--td-rate-unselected-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc))) 100%);
+ -webkit-background-clip: text;
+ background-clip: text;
+}
+.t-rate__icon--unselected {
+ color: var(--td-rate-unselected-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-rate__text {
+ font-size: var(--td-rate-text-font-size, var(--td-font-size-m, 32rpx));
+ color: var(--td-rate-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ margin-left: 32rpx;
+ vertical-align: middle;
+}
+.t-rate__text--active {
+ color: var(--td-rate-text-active-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ font-weight: var(--td-rate-text-active-font-weight, 600);
+}
+.t-rate__text--sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ clip-path: inset(50%);
+ border: 0;
+}
+.t-rate__tips {
+ position: absolute;
+ display: flex;
+ align-items: center;
+ bottom: calc(100% + 16rpx);
+ padding: 8rpx;
+ border-radius: 12rpx;
+ box-shadow: var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12));
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ transform: translateX(-50%);
+}
+.t-rate__tips--bottom {
+ top: calc(100% + 16rpx);
+ bottom: auto;
+}
+.t-rate__tips-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ width: 64rpx;
+ border-radius: 6rpx;
+}
+.t-rate__tips-item--active {
+ background-color: var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7));
+}
+.t-rate__tips-text {
+ text-align: center;
+ font-size: 24rpx;
+ line-height: 40rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/type.d.ts b/miniprogram_npm/tdesign-miniprogram/rate/type.d.ts
new file mode 100644
index 0000000..0518e2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/type.d.ts
@@ -0,0 +1,58 @@
+export interface TdRateProps {
+ allowHalf?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ color?: {
+ type: null;
+ value?: string | Array;
+ };
+ count?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ gap?: {
+ type: null;
+ value?: string | number;
+ };
+ icon?: {
+ type: null;
+ value?: string | string[];
+ };
+ iconPrefix?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'top' | 'bottom' | '';
+ };
+ showText?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ texts?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ value?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ defaultValue?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ variant?: {
+ type: StringConstructor;
+ value?: 'outline' | 'filled';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/rate/type.js b/miniprogram_npm/tdesign-miniprogram/rate/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/rate/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/result/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/result/README.en-US.md
new file mode 100644
index 0000000..b5c763d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/README.en-US.md
@@ -0,0 +1,41 @@
+:: BASE_DOC ::
+
+## API
+
+### Result 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
+description | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Boolean / Object | true | \- | N
+image | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+theme | String | default | options: default/success/warning/error | N
+title | String / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+### Result External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-description | \-
+t-class-image | \-
+t-class-title | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-result-description-color | @font-gray-2 | -
+--td-result-description-font-size | @font-size-base | -
+--td-result-description-line-height | 44rpx | -
+--td-result-description-margin-top | @spacer | -
+--td-result-icon-default-color | @brand-color | -
+--td-result-icon-error-color | @error-color | -
+--td-result-icon-success-color | @success-color | -
+--td-result-icon-warning-color | @warning-color | -
+--td-result-title-color | @font-gray-1 | -
+--td-result-title-font-size | @font-size-l | -
+--td-result-title-line-height | 56rpx | -
+--td-result-title-margin-top | @spacer-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/result/README.md b/miniprogram_npm/tdesign-miniprogram/result/README.md
new file mode 100644
index 0000000..76085fe
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/README.md
@@ -0,0 +1,99 @@
+---
+title: Result 结果
+description: 反馈结果状态。
+spline: data
+isComponent: true
+---
+
+


+
+
+
+ 该组件于 0.16.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-result": "tdesign-miniprogram/result/result"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+基础结果
+
+{{ theme }}
+
+带描述的结果
+
+{{ description }}
+
+自定义结果
+
+{{ custom }}
+
+## 常见问题
+
+
+
+ 本地图片无法正确引用?
+ 👇
+
+
+ 建议使用绝对路径,而不是相对路径。绝对路径以 app.json 所在位置为基准。
+
+
+
+## API
+
+### Result Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+description | String / Slot | - | 描述文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Boolean / Object | true | 图标名称。值为字符串表示图标名称,值为 `false` 表示不显示图标,值为 `Object` 类型,表示透传至 `icon`,不传表示使用主题图标。 | N
+image | String / Slot | - | 图片地址。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+theme | String | default | 内置主题。可选项:default/success/warning/error | N
+title | String / Slot | '' | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+### Result External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-description | 描述样式类
+t-class-image | 图片样式类
+t-class-title | 标题样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-result-description-color | @font-gray-2 | -
+--td-result-description-font-size | @font-size-base | -
+--td-result-description-line-height | 44rpx | -
+--td-result-description-margin-top | @spacer | -
+--td-result-icon-default-color | @brand-color | -
+--td-result-icon-error-color | @error-color | -
+--td-result-icon-success-color | @success-color | -
+--td-result-icon-warning-color | @warning-color | -
+--td-result-title-color | @font-gray-1 | -
+--td-result-title-font-size | @font-size-l | -
+--td-result-title-line-height | 56rpx | -
+--td-result-title-margin-top | @spacer-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/result/index.d.ts b/miniprogram_npm/tdesign-miniprogram/result/index.d.ts
new file mode 100644
index 0000000..74469ef
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/index.d.ts
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './result';
diff --git a/miniprogram_npm/tdesign-miniprogram/result/index.js b/miniprogram_npm/tdesign-miniprogram/result/index.js
new file mode 100644
index 0000000..74469ef
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/index.js
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './result';
diff --git a/miniprogram_npm/tdesign-miniprogram/result/props.d.ts b/miniprogram_npm/tdesign-miniprogram/result/props.d.ts
new file mode 100644
index 0000000..7336c63
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/props.d.ts
@@ -0,0 +1,3 @@
+import { TdResultProps } from './type';
+declare const props: TdResultProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/result/props.js b/miniprogram_npm/tdesign-miniprogram/result/props.js
new file mode 100644
index 0000000..2ede7ba
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/props.js
@@ -0,0 +1,21 @@
+const props = {
+ description: {
+ type: String,
+ },
+ icon: {
+ type: null,
+ value: true,
+ },
+ image: {
+ type: String,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ title: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/result/result.d.ts b/miniprogram_npm/tdesign-miniprogram/result/result.d.ts
new file mode 100644
index 0000000..9dfa5ff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/result.d.ts
@@ -0,0 +1,21 @@
+import { SuperComponent } from '../common/src/index';
+export default class extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ properties: import("./type").TdResultProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ observers: {
+ 'icon, theme'(): void;
+ };
+ methods: {
+ initIcon(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/result/result.js b/miniprogram_npm/tdesign-miniprogram/result/result.js
new file mode 100644
index 0000000..d70e77b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/result.js
@@ -0,0 +1,59 @@
+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 props from './props';
+import config from '../common/config';
+import { calcIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-result`;
+const THEME_ICON = {
+ default: 'error-circle',
+ success: 'check-circle',
+ warning: 'error-circle',
+ error: 'close-circle',
+};
+let default_1 = class extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-image`,
+ `${prefix}-class-title`,
+ `${prefix}-class-description`,
+ ];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.lifetimes = {
+ ready() {
+ this.initIcon();
+ },
+ };
+ this.observers = {
+ 'icon, theme'() {
+ this.initIcon();
+ },
+ };
+ this.methods = {
+ initIcon() {
+ const { icon, theme } = this.properties;
+ this.setData({
+ _icon: calcIcon(icon, THEME_ICON[theme]),
+ });
+ },
+ };
+ }
+};
+default_1 = __decorate([
+ wxComponent()
+], default_1);
+export default default_1;
diff --git a/miniprogram_npm/tdesign-miniprogram/result/result.json b/miniprogram_npm/tdesign-miniprogram/result/result.json
new file mode 100644
index 0000000..b7d275d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/result.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/result/result.wxml b/miniprogram_npm/tdesign-miniprogram/result/result.wxml
new file mode 100644
index 0000000..a5104e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/result.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{title}}
+
+
+
+ {{description}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/result/result.wxss b/miniprogram_npm/tdesign-miniprogram/result/result.wxss
new file mode 100644
index 0000000..aa282af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/result.wxss
@@ -0,0 +1,65 @@
+.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-result {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+.t-result__icon {
+ font-size: 160rpx;
+}
+.t-result__title {
+ line-height: var(--td-result-title-line-height, 56rpx);
+ font-size: var(--td-result-title-font-size, var(--td-font-size-xl, 40rpx));
+ font-weight: 700;
+ color: var(--td-result-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-result__thumb:not(:empty) + .t-result__title:not(:empty) {
+ margin-top: var(--td-result-title-margin-top, var(--td-spacer-1, 24rpx));
+}
+.t-result__description {
+ text-align: center;
+ color: var(--td-result-description-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
+ font-size: var(--td-result-description-font-size, var(--td-font-size-base, 28rpx));
+ line-height: var(--td-result-description-line-height, 44rpx);
+}
+.t-result__title + .t-result__description:not(:empty) {
+ margin-top: var(--td-result-description-margin-top, var(--td-spacer, 16rpx));
+}
+.t-result--theme-default {
+ color: var(--td-result-icon-default-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-result--theme-success {
+ color: var(--td-result-icon-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-result--theme-warning {
+ color: var(--td-result-icon-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-result--theme-error {
+ color: var(--td-result-icon-error-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/result/type.d.ts b/miniprogram_npm/tdesign-miniprogram/result/type.d.ts
new file mode 100644
index 0000000..80b4136
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/type.d.ts
@@ -0,0 +1,22 @@
+export interface TdResultProps {
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ icon?: {
+ type: null;
+ value?: string | boolean | object;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'success' | 'warning' | 'error';
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/result/type.js b/miniprogram_npm/tdesign-miniprogram/result/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/result/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/row/README.md b/miniprogram_npm/tdesign-miniprogram/row/README.md
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/row/props.d.ts b/miniprogram_npm/tdesign-miniprogram/row/props.d.ts
new file mode 100644
index 0000000..34bd697
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/props.d.ts
@@ -0,0 +1,3 @@
+import { TdRowProps } from './type';
+declare const props: TdRowProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/row/props.js b/miniprogram_npm/tdesign-miniprogram/row/props.js
new file mode 100644
index 0000000..2faa498
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/props.js
@@ -0,0 +1,6 @@
+const props = {
+ gutter: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/row/row.d.ts b/miniprogram_npm/tdesign-miniprogram/row/row.d.ts
new file mode 100644
index 0000000..136e65c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/row.d.ts
@@ -0,0 +1,15 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Row extends SuperComponent {
+ externalClasses: any[];
+ properties: import("./type").TdRowProps;
+ data: {
+ prefix: string;
+ };
+ relations: RelationsOptions;
+ observers: {
+ gutter(): void;
+ };
+ methods: {
+ setGutter(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/row/row.js b/miniprogram_npm/tdesign-miniprogram/row/row.js
new file mode 100644
index 0000000..a82c5c8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/row.js
@@ -0,0 +1,49 @@
+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;
+let Row = class Row extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [];
+ this.properties = props;
+ this.data = {
+ prefix,
+ };
+ this.relations = {
+ '../col/col': {
+ type: 'child',
+ linked(target) {
+ const { gutter } = this.data;
+ if (gutter) {
+ target.setData({ gutter });
+ }
+ },
+ },
+ };
+ this.observers = {
+ gutter() {
+ this.setGutter();
+ },
+ };
+ this.methods = {
+ setGutter() {
+ const { gutter } = this.data;
+ const cols = this.$children;
+ cols.forEach((col) => {
+ col.setData({ gutter });
+ });
+ },
+ };
+ }
+};
+Row = __decorate([
+ wxComponent()
+], Row);
+export default Row;
diff --git a/miniprogram_npm/tdesign-miniprogram/row/row.json b/miniprogram_npm/tdesign-miniprogram/row/row.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/row.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/row/row.wxml b/miniprogram_npm/tdesign-miniprogram/row/row.wxml
new file mode 100644
index 0000000..6f82c33
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/row.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/row/row.wxs b/miniprogram_npm/tdesign-miniprogram/row/row.wxs
new file mode 100644
index 0000000..9d83b9d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/row.wxs
@@ -0,0 +1,17 @@
+var utils = require('../common/utils.wxs');
+
+function getRowStyles(gutter, style, customStyle) {
+ var _style = '';
+ if (gutter) {
+ _style = utils._style({
+ 'margin-right': utils.addUnit(-gutter / 2),
+ 'margin-left': utils.addUnit(-gutter / 2),
+ });
+ }
+
+ return utils._style([style, customStyle]) + _style;
+}
+
+module.exports = {
+ getRowStyles: getRowStyles,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/row/row.wxss b/miniprogram_npm/tdesign-miniprogram/row/row.wxss
new file mode 100644
index 0000000..69fab88
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/row.wxss
@@ -0,0 +1,6 @@
+.t-row {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ box-sizing: border-box;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/row/type.d.ts b/miniprogram_npm/tdesign-miniprogram/row/type.d.ts
new file mode 100644
index 0000000..f151c1c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/type.d.ts
@@ -0,0 +1,6 @@
+export interface TdRowProps {
+ gutter?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/row/type.js b/miniprogram_npm/tdesign-miniprogram/row/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/row/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.d.ts b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.d.ts
new file mode 100644
index 0000000..e42dd4c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.d.ts
@@ -0,0 +1,10 @@
+import { SuperComponent } from '../common/src/index';
+export default class ScrollView extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ properties: {
+ scrollIntoView: {
+ type: StringConstructor;
+ };
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.js b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.js
new file mode 100644
index 0000000..240d8eb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.js
@@ -0,0 +1,26 @@
+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 { canUseProxyScrollView } from '../common/version';
+const { prefix } = config;
+let ScrollView = class ScrollView extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.behaviors = canUseProxyScrollView() ? ['wx://proxy-scroll-view'] : [];
+ this.properties = {
+ scrollIntoView: {
+ type: String,
+ },
+ };
+ }
+};
+ScrollView = __decorate([
+ wxComponent()
+], ScrollView);
+export default ScrollView;
diff --git a/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.json b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.wxml b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.wxml
new file mode 100644
index 0000000..8731320
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.wxml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.wxss b/miniprogram_npm/tdesign-miniprogram/scroll-view/scroll-view.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram_npm/tdesign-miniprogram/search/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/search/README.en-US.md
new file mode 100644
index 0000000..2071986
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/README.en-US.md
@@ -0,0 +1,79 @@
+
+## 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
+clear-trigger | String | always | show clear icon, clicked to clear input value。options: always / focus | 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 | - | The maximum number of characters that the user can enter. One Chinese character represents two characters in length. Use either `maxcharacter` or `maxlength` | N
+maxlength | Number | -1 | \- | N
+placeholder | String | '' | \- | N
+placeholder-class | String | input-placeholder | \- | N
+placeholder-style | String | - | required | Y
+readonly | Boolean | undefined | \- | N
+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 | @text-color-placeholder | -
+--td-search-clear-icon-font-size | 48rpx | -
+--td-search-font-size | @font-size-m | -
+--td-search-height | 80rpx | -
+--td-search-icon-color | @text-color-placeholder | -
+--td-search-icon-font-size | 48rpx | -
+--td-search-label-color | @text-color-primary | -
+--td-search-padding | 16rpx 24rpx | -
+--td-search-placeholder-color | @text-color-placeholder | -
+--td-search-result-high-light-color | @brand-color | -
+--td-search-square-radius | @radius-default | -
+--td-search-text-color | @text-color-primary | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/search/README.md b/miniprogram_npm/tdesign-miniprogram/search/README.md
new file mode 100644
index 0000000..6fd6f4b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/README.md
@@ -0,0 +1,127 @@
+---
+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
+clear-trigger | String | always | 清空图标触发方式,仅在输入框有值时有效。可选项:always / focus | 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
+readonly | Boolean | undefined | 只读状态 | N
+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 | @text-color-placeholder | -
+--td-search-clear-icon-font-size | 48rpx | -
+--td-search-font-size | @font-size-m | -
+--td-search-height | 80rpx | -
+--td-search-icon-color | @text-color-placeholder | -
+--td-search-icon-font-size | 48rpx | -
+--td-search-label-color | @text-color-primary | -
+--td-search-padding | 16rpx 24rpx | -
+--td-search-placeholder-color | @text-color-placeholder | -
+--td-search-result-high-light-color | @brand-color | -
+--td-search-square-radius | @radius-default | -
+--td-search-text-color | @text-color-primary | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/search/props.d.ts b/miniprogram_npm/tdesign-miniprogram/search/props.d.ts
new file mode 100644
index 0000000..81c5bff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSearchProps } from './type';
+declare const props: TdSearchProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/search/props.js b/miniprogram_npm/tdesign-miniprogram/search/props.js
new file mode 100644
index 0000000..5af169d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/props.js
@@ -0,0 +1,107 @@
+const props = {
+ action: {
+ type: String,
+ value: '',
+ },
+ adjustPosition: {
+ type: Boolean,
+ value: true,
+ },
+ alwaysEmbed: {
+ type: Boolean,
+ value: false,
+ },
+ center: {
+ type: Boolean,
+ value: false,
+ },
+ clearTrigger: {
+ type: String,
+ value: 'always',
+ },
+ 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,
+ },
+ readonly: {
+ type: null,
+ value: undefined,
+ },
+ resultList: {
+ type: Array,
+ value: [],
+ },
+ selectionEnd: {
+ type: Number,
+ value: -1,
+ },
+ selectionStart: {
+ type: Number,
+ value: -1,
+ },
+ shape: {
+ type: String,
+ value: 'square',
+ },
+ type: {
+ type: String,
+ value: 'text',
+ },
+ value: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/search/search.d.ts b/miniprogram_npm/tdesign-miniprogram/search/search.d.ts
new file mode 100644
index 0000000..bb16745
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/search.d.ts
@@ -0,0 +1,27 @@
+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;
+ 'clearTrigger, clearable, disabled, readonly'(): void;
+ };
+ data: {
+ classPrefix: string;
+ prefix: string;
+ isShowResultList: boolean;
+ isSelected: boolean;
+ showClearIcon: boolean;
+ };
+ updateClearIconVisible(value?: boolean): void;
+ 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_npm/tdesign-miniprogram/search/search.js b/miniprogram_npm/tdesign-miniprogram/search/search.js
new file mode 100644
index 0000000..2bae360
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/search.js
@@ -0,0 +1,118 @@
+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,
+ });
+ }
+ },
+ 'clearTrigger, clearable, disabled, readonly'() {
+ this.updateClearIconVisible();
+ },
+ };
+ this.data = {
+ classPrefix: name,
+ prefix,
+ isShowResultList: false,
+ isSelected: false,
+ showClearIcon: true,
+ };
+ }
+ updateClearIconVisible(value = false) {
+ const { clearTrigger, disabled, readonly } = this.properties;
+ if (disabled || readonly) {
+ this.setData({ showClearIcon: false });
+ return;
+ }
+ this.setData({ showClearIcon: value || String(clearTrigger) === 'always' });
+ }
+ 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.updateClearIconVisible(true);
+ this.triggerEvent('focus', { value });
+ }
+ onBlur(e) {
+ const { value } = e.detail;
+ this.updateClearIconVisible();
+ 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_npm/tdesign-miniprogram/search/search.json b/miniprogram_npm/tdesign-miniprogram/search/search.json
new file mode 100644
index 0000000..ed5b2b6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/search.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-cell": "../cell/cell"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/search/search.wxml b/miniprogram_npm/tdesign-miniprogram/search/search.wxml
new file mode 100644
index 0000000..a07d3fe
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/search.wxml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{action}}
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/search/search.wxs b/miniprogram_npm/tdesign-miniprogram/search/search.wxs
new file mode 100644
index 0000000..ac86989
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/search.wxs
@@ -0,0 +1,6 @@
+var highLight = function (label, keyword) {
+ return label.replace(keyword, '' + keyword + '');
+};
+module.exports = {
+ highLight: highLight,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/search/search.wxss b/miniprogram_npm/tdesign-miniprogram/search/search.wxss
new file mode 100644
index 0000000..fff90d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/search.wxss
@@ -0,0 +1,116 @@
+.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-input--disabled {
+ color: var(--td-search-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ cursor: not-allowed;
+ opacity: 1;
+ -webkit-text-fill-color: currentColor;
+}
+.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))));
+ font-size: var(--td-search-icon-font-size, 48rpx);
+}
+.t-search__clear {
+ position: relative;
+ margin-left: 10px;
+ font-size: var(--td-search-clear-icon-font-size, 48rpx);
+ 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_npm/tdesign-miniprogram/search/type.d.ts b/miniprogram_npm/tdesign-miniprogram/search/type.d.ts
new file mode 100644
index 0000000..c7f2370
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/type.d.ts
@@ -0,0 +1,108 @@
+export interface TdSearchProps {
+ action?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ adjustPosition?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ alwaysEmbed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ center?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ clearTrigger?: {
+ type: StringConstructor;
+ value?: 'always' | 'focus';
+ };
+ 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;
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ resultList?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ selectionEnd?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ selectionStart?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'square' | 'round';
+ };
+ type?: {
+ type: StringConstructor;
+ value?: 'text' | 'number' | 'idcard' | 'digit' | 'nickname';
+ };
+ value?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/search/type.js b/miniprogram_npm/tdesign-miniprogram/search/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/search/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts
new file mode 100644
index 0000000..cdda046
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSideBarItemProps } from './type';
+declare const props: TdSideBarItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js
new file mode 100644
index 0000000..8ce799a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js
@@ -0,0 +1,20 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ label: {
+ type: String,
+ value: '',
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts
new file mode 100644
index 0000000..fd2334f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts
@@ -0,0 +1,44 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class SideBarItem extends SuperComponent {
+ externalClasses: string[];
+ properties: {
+ tId: {
+ type: StringConstructor;
+ };
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: import("../badge").BadgeProps;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+ };
+ relations: RelationsOptions;
+ observers: {
+ icon(v: any): void;
+ };
+ data: {
+ classPrefix: string;
+ prefix: string;
+ active: boolean;
+ isPre: boolean;
+ isNext: boolean;
+ };
+ methods: {
+ updateActive(value: any): void;
+ handleClick(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js
new file mode 100644
index 0000000..123b951
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js
@@ -0,0 +1,60 @@
+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}-side-bar-item`;
+let SideBarItem = class SideBarItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = Object.assign(Object.assign({}, props), { tId: {
+ type: String,
+ } });
+ this.relations = {
+ '../side-bar/side-bar': {
+ type: 'parent',
+ linked(parent) {
+ this.parent = parent;
+ this.updateActive(parent.data.value);
+ },
+ },
+ };
+ this.observers = {
+ icon(v) {
+ this.setData({ _icon: typeof v === 'string' ? { name: v } : v });
+ },
+ };
+ this.data = {
+ classPrefix: name,
+ prefix,
+ active: false,
+ isPre: false,
+ isNext: false,
+ };
+ this.methods = {
+ updateActive(value) {
+ const active = value === this.data.value;
+ this.setData({
+ active,
+ });
+ },
+ handleClick() {
+ var _a;
+ if (this.data.disabled)
+ return;
+ const { value, label } = this.data;
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a.doChange({ value, label });
+ },
+ };
+ }
+};
+SideBarItem = __decorate([
+ wxComponent()
+], SideBarItem);
+export default SideBarItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json
new file mode 100644
index 0000000..3c096d3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-badge": "../badge/badge",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml
new file mode 100644
index 0000000..e222b30
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{label}}
+
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss
new file mode 100644
index 0000000..b344033
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss
@@ -0,0 +1,93 @@
+.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-side-bar-item {
+ display: flex;
+ align-items: center;
+ position: relative;
+ padding: 32rpx;
+ font-size: var(--td-side-bar-font-size, 32rpx);
+ color: var(--td-side-bar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ background: var(--td-side-bar-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ min-height: var(--td-side-bar-item-height, 112rpx);
+ box-sizing: border-box;
+ white-space: wrap;
+ line-height: var(--td-side-bar-item-line-height, 48rpx);
+}
+.t-side-bar-item--active {
+ font-weight: 600;
+ background: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ color: var(--td-side-bar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ --td-badge-content-text-color: var(--td-side-bar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-side-bar-item__icon {
+ font-size: var(--td-side-bar-icon-size, 40rpx);
+ margin-right: 4rpx;
+}
+.t-side-bar-item__prefix,
+.t-side-bar-item__suffix {
+ z-index: 1;
+ position: absolute;
+ right: 0;
+ width: 100%;
+ height: calc(var(--td-side-bar-border-radius, 18rpx) * 2);
+ background: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ pointer-events: none;
+}
+.t-side-bar-item__prefix::after,
+.t-side-bar-item__suffix::after {
+ content: '';
+ display: block;
+ width: 100%;
+ height: 100%;
+ background-color: var(--td-side-bar-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-side-bar-item__prefix {
+ top: calc(var(--td-side-bar-border-radius, 18rpx) * -2);
+}
+.t-side-bar-item__prefix::after {
+ border-bottom-right-radius: var(--td-side-bar-border-radius, 18rpx);
+}
+.t-side-bar-item__suffix {
+ bottom: calc(var(--td-side-bar-border-radius, 18rpx) * -2);
+}
+.t-side-bar-item__suffix::after {
+ border-top-right-radius: var(--td-side-bar-border-radius, 18rpx);
+}
+.t-side-bar-item--disabled {
+ color: var(--td-side-bar-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-side-bar-item__line {
+ width: 6rpx;
+ height: 28rpx;
+ position: absolute;
+ left: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ background: var(--td-side-bar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-radius: 8rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts
new file mode 100644
index 0000000..94aff15
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts
@@ -0,0 +1,23 @@
+import { BadgeProps } from '../badge/index';
+export interface TdSideBarItemProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: BadgeProps;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md
new file mode 100644
index 0000000..926da55
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md
@@ -0,0 +1,50 @@
+:: BASE_DOC ::
+
+## API
+
+### SideBar 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
+value | String / Number | - | \- | N
+default-value | String / Number | undefined | uncontrolled property | N
+
+### SideBar Events
+
+name | params | description
+-- | -- | --
+change | `(value: number \| string, label: string)` | \-
+click | `(value: number \| string, label: string)` | \-
+
+
+### SideBarItem 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
+badge-props | Object | - | Typescript:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/side-bar-item/type.ts) | N
+disabled | Boolean | false | \- | N
+icon | String / Object | - | \- | N
+label | String | - | \- | N
+value | String / Number | - | \- | N
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-side-bar-bg-color | @bg-color-secondarycontainer | -
+--td-side-bar-height | 100% | -
+--td-side-bar-width | 206rpx | -
+--td-side-bar-active-color | @brand-color | -
+--td-side-bar-bg-color | @bg-color-secondarycontainer | -
+--td-side-bar-border-radius | 18rpx | -
+--td-side-bar-color | @font-gray-1 | -
+--td-side-bar-disabled-color | @font-gray-4 | -
+--td-side-bar-font-size | 32rpx | -
+--td-side-bar-icon-size | 40rpx | -
+--td-side-bar-item-height | 112rpx | -
+--td-side-bar-item-line-height | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/README.md b/miniprogram_npm/tdesign-miniprogram/side-bar/README.md
new file mode 100644
index 0000000..c82c353
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/README.md
@@ -0,0 +1,99 @@
+---
+title: SideBar 侧边栏
+description: 用于内容分类后的展示切换。
+spline: navigation
+isComponent: true
+---
+
+
+
+ 该组件于 0.25.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+{
+ "usingComponents": {
+ "t-side-bar": "tdesign-miniprogram/side-bar/side-bar",
+ "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item",
+ }
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 锚点用法
+
+{{ base }}
+
+### 切页用法
+
+{{ switch }}
+
+### 带图标侧边导航
+
+{{ with-icon }}
+
+### 自定义样式
+
+{{ custom }}
+
+## API
+
+### SideBar Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+value | String / Number | - | 选项值 | N
+default-value | String / Number | undefined | 选项值。非受控属性 | N
+
+### SideBar Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: number \| string, label: string)` | 选项值发生变化时触发
+click | `(value: number \| string, label: string)` | 点击选项时触发
+
+
+### SideBarItem Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+badge-props | Object | - | 透传至 Badge 组件。TS 类型:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/side-bar-item/type.ts) | N
+disabled | Boolean | false | 是否禁用 | N
+icon | String / Object | - | 图标,传对象则透传至 Icon | N
+label | String | - | 展示的标签 | N
+value | String / Number | - | 当前选项的值 | N
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-side-bar-bg-color | @bg-color-secondarycontainer | -
+--td-side-bar-height | 100% | -
+--td-side-bar-width | 206rpx | -
+--td-side-bar-active-color | @brand-color | -
+--td-side-bar-bg-color | @bg-color-secondarycontainer | -
+--td-side-bar-border-radius | 18rpx | -
+--td-side-bar-color | @font-gray-1 | -
+--td-side-bar-disabled-color | @font-gray-4 | -
+--td-side-bar-font-size | 32rpx | -
+--td-side-bar-icon-size | 40rpx | -
+--td-side-bar-item-height | 112rpx | -
+--td-side-bar-item-line-height | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts
new file mode 100644
index 0000000..fcab408
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSideBarProps } from './type';
+declare const props: TdSideBarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/props.js b/miniprogram_npm/tdesign-miniprogram/side-bar/props.js
new file mode 100644
index 0000000..a8aca64
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/props.js
@@ -0,0 +1,10 @@
+const props = {
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts
new file mode 100644
index 0000000..f5ac06e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts
@@ -0,0 +1,24 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class SideBar extends SuperComponent {
+ externalClasses: string[];
+ children: any[];
+ relations: RelationsOptions;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ properties: import("./type").TdSideBarProps;
+ observers: {
+ value(v: any): void;
+ };
+ data: {
+ classPrefix: string;
+ prefix: string;
+ };
+ methods: {
+ doChange({ value, label }: {
+ value: any;
+ label: any;
+ }): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js
new file mode 100644
index 0000000..c5736f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js
@@ -0,0 +1,58 @@
+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}-side-bar`;
+const relationsPath = '../side-bar-item/side-bar-item';
+let SideBar = class SideBar extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.children = [];
+ this.relations = {
+ [relationsPath]: {
+ type: 'child',
+ linked(child) {
+ this.children.push(child);
+ },
+ unlinked(child) {
+ const index = this.children.findIndex((item) => item === child);
+ this.children.splice(index, 1);
+ },
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.properties = props;
+ this.observers = {
+ value(v) {
+ this.$children.forEach((item) => {
+ item.updateActive(v);
+ });
+ },
+ };
+ this.data = {
+ classPrefix: name,
+ prefix,
+ };
+ this.methods = {
+ doChange({ value, label }) {
+ this._trigger('change', { value, label });
+ },
+ };
+ }
+};
+SideBar = __decorate([
+ wxComponent()
+], SideBar);
+export default SideBar;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json
new file mode 100644
index 0000000..2093b53
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-side-bar-item": "../side-bar-item/side-bar-item"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml
new file mode 100644
index 0000000..b251c7f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss
new file mode 100644
index 0000000..5abb8f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss
@@ -0,0 +1,41 @@
+.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-side-bar {
+ display: flex;
+ flex-direction: column;
+ width: var(--td-side-bar-width, 206rpx);
+ height: var(--td-side-bar-height, 100%);
+ overflow-y: auto;
+}
+.t-side-bar::-webkit-scrollbar {
+ display: none;
+}
+.t-side-bar__padding {
+ flex: 1;
+ background-color: var(--td-side-bar-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts
new file mode 100644
index 0000000..39d8876
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts
@@ -0,0 +1,10 @@
+export interface TdSideBarProps {
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+ defaultValue?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/type.js b/miniprogram_npm/tdesign-miniprogram/side-bar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/skeleton/README.en-US.md
new file mode 100644
index 0000000..889a454
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/README.en-US.md
@@ -0,0 +1,38 @@
+:: BASE_DOC ::
+
+## API
+
+### Skeleton 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 | String | none | options: gradient/flashed/none | N
+delay | Number | 0 | \- | N
+loading | Boolean | true | \- | N
+row-col | Array | - | Typescript:`SkeletonRowCol` `type SkeletonRowCol = Array>` `interface SkeletonRowColObj { width?: string; size?: string;height?: string; marginRight?: string; marginLeft?: string; margin?: string; type?: 'rect' \| 'circle' \| 'text';}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/skeleton/type.ts) | N
+theme | String | text | options: avatar/image/text/paragraph | N
+### Skeleton External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-col | \-
+t-class-row | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-skeleton-animation-flashed | rgba(90%, 90%, 90%, 0.3) | -
+--td-skeleton-animation-gradient | rgba(0, 0, 0, 4%) | -
+--td-skeleton-bg-color | @bg-color-page | -
+--td-skeleton-circle-border-radius | @radius-circle | -
+--td-skeleton-circle-height | 96rpx | -
+--td-skeleton-rect-border-radius | @radius-default | -
+--td-skeleton-rect-height | 32rpx | -
+--td-skeleton-row-spacing | @spacer-2 | -
+--td-skeleton-text-border-radius | @radius-small | -
+--td-skeleton-text-height | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/README.md b/miniprogram_npm/tdesign-miniprogram/skeleton/README.md
new file mode 100644
index 0000000..84798e6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/README.md
@@ -0,0 +1,86 @@
+---
+title: Skeleton 骨架屏
+description: 用于等待加载内容所展示的占位图形组合,有动态效果加载效果,减少用户等待焦虑。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-skeleton": "tdesign-miniprogram/skeleton/skeleton"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 骨架屏类型
+
+基础骨架屏
+
+{{ theme }}
+
+单元格骨架屏
+
+{{ cell-group }}
+
+
+宫格骨架屏
+
+{{ grid }}
+
+图文组合骨架屏
+
+{{ image-group }}
+
+### 组件动效
+
+{{ animation }}
+
+
+## API
+
+### Skeleton Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+animation | String | none | 动画效果,有「渐变加载动画」和「闪烁加载动画」两种。值为 'none' 则表示没有动画。可选项:gradient/flashed/none | N
+delay | Number | 0 | 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 | N
+loading | Boolean | true | 是否为加载状态,如果是则显示骨架图,如果不是则显示加载完成的内容 | N
+row-col | Array | - | 高级设置,用于自定义行列数量、宽度高度、间距等。【示例一】,`[1, 1, 2]` 表示输出三行骨架图,第一行一列,第二行一列,第三行两列。【示例二】,`[1, 1, { width: '100px' }]` 表示自定义第三行的宽度为 `100px`。【示例三】,`[1, 2, [{ width, height }, { width, height, marginLeft }]]` 表示第三行有两列,且自定义宽度、高度、尺寸(圆形或方形使用)、间距、内容等。TS 类型:`SkeletonRowCol` `type SkeletonRowCol = Array>` `interface SkeletonRowColObj { width?: string; size?: string;height?: string; marginRight?: string; marginLeft?: string; margin?: string; type?: 'rect' \| 'circle' \| 'text';}`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/skeleton/type.ts) | N
+theme | String | text | 骨架图风格,有基础、头像组合等两大类。可选项:avatar/image/text/paragraph | N
+### Skeleton External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-col | 行样式类
+t-class-row | 列样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-skeleton-animation-flashed | rgba(90%, 90%, 90%, 0.3) | -
+--td-skeleton-animation-gradient | rgba(0, 0, 0, 4%) | -
+--td-skeleton-bg-color | @bg-color-page | -
+--td-skeleton-circle-border-radius | @radius-circle | -
+--td-skeleton-circle-height | 96rpx | -
+--td-skeleton-rect-border-radius | @radius-default | -
+--td-skeleton-rect-height | 32rpx | -
+--td-skeleton-row-spacing | @spacer-2 | -
+--td-skeleton-text-border-radius | @radius-small | -
+--td-skeleton-text-height | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/props.d.ts b/miniprogram_npm/tdesign-miniprogram/skeleton/props.d.ts
new file mode 100644
index 0000000..2c8f4af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSkeletonProps } from './type';
+declare const props: TdSkeletonProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/props.js b/miniprogram_npm/tdesign-miniprogram/skeleton/props.js
new file mode 100644
index 0000000..35c8c48
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/props.js
@@ -0,0 +1,22 @@
+const props = {
+ animation: {
+ type: String,
+ value: 'none',
+ },
+ delay: {
+ type: Number,
+ value: 0,
+ },
+ loading: {
+ type: Boolean,
+ value: true,
+ },
+ rowCol: {
+ type: Array,
+ },
+ theme: {
+ type: String,
+ value: 'text',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.d.ts b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.d.ts
new file mode 100644
index 0000000..f7e1353
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.d.ts
@@ -0,0 +1,25 @@
+import { SuperComponent } from '../common/src/index';
+import { SkeletonRowColObj } from './type';
+import { ClassName, Styles } from '../common/common';
+export default class Skeleton extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdSkeletonProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ parsedRowcols: any[];
+ };
+ observers: {
+ rowCol(): void;
+ 'loading, delay'(): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ init(): void;
+ getColItemClass(obj: SkeletonRowColObj): ClassName;
+ getColItemStyle(obj: SkeletonRowColObj): Styles;
+ isShowSkeleton(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.js b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.js
new file mode 100644
index 0000000..b098834
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.js
@@ -0,0 +1,135 @@
+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 { isNumber, classNames } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-skeleton`;
+const ThemeMap = {
+ avatar: [{ type: 'circle', size: '96rpx' }],
+ image: [{ type: 'rect', size: '144rpx' }],
+ text: [
+ [
+ { width: '24%', height: '32rpx', marginRight: '32rpx' },
+ { width: '76%', height: '32rpx' },
+ ],
+ 1,
+ ],
+ paragraph: [1, 1, 1, { width: '55%' }],
+};
+let Skeleton = class Skeleton extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-col`, `${prefix}-class-row`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ parsedRowcols: [],
+ };
+ this.observers = {
+ rowCol() {
+ this.init();
+ },
+ 'loading, delay'() {
+ this.isShowSkeleton();
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.init();
+ this.isShowSkeleton();
+ },
+ };
+ this.methods = {
+ init() {
+ const { theme, rowCol } = this.properties;
+ const rowCols = [];
+ if (rowCol.length) {
+ rowCols.push(...rowCol);
+ }
+ else {
+ rowCols.push(...ThemeMap[theme || 'text']);
+ }
+ const parsedRowcols = rowCols.map((item) => {
+ if (isNumber(item)) {
+ return [
+ {
+ class: this.getColItemClass({ type: 'text' }),
+ style: {},
+ },
+ ];
+ }
+ if (Array.isArray(item)) {
+ return item.map((col) => {
+ return Object.assign(Object.assign({}, col), { class: this.getColItemClass(col), style: this.getColItemStyle(col) });
+ });
+ }
+ const nItem = item;
+ return [
+ Object.assign(Object.assign({}, nItem), { class: this.getColItemClass(nItem), style: this.getColItemStyle(nItem) }),
+ ];
+ });
+ this.setData({
+ parsedRowcols,
+ });
+ },
+ getColItemClass(obj) {
+ return classNames([
+ `${name}__col`,
+ `${name}--type-${obj.type || 'text'}`,
+ `${name}--animation-${this.properties.animation}`,
+ ]);
+ },
+ getColItemStyle(obj) {
+ const styleName = [
+ 'width',
+ 'height',
+ 'marginRight',
+ 'marginLeft',
+ 'margin',
+ 'size',
+ 'background',
+ 'backgroundColor',
+ 'borderRadius',
+ ];
+ const style = {};
+ styleName.forEach((name) => {
+ if (name in obj) {
+ const px = isNumber(obj[name]) ? `${obj[name]}px` : obj[name];
+ if (name === 'size') {
+ [style.width, style.height] = [px, px];
+ }
+ else {
+ style[name] = px;
+ }
+ }
+ });
+ return style;
+ },
+ isShowSkeleton() {
+ const { loading, delay } = this.properties;
+ if (!loading || delay === 0) {
+ this.setData({
+ isShow: loading,
+ });
+ return;
+ }
+ setTimeout(() => {
+ this.setData({
+ isShow: loading,
+ });
+ }, delay);
+ },
+ };
+ }
+};
+Skeleton = __decorate([
+ wxComponent()
+], Skeleton);
+export default Skeleton;
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.json b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.wxml b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.wxml
new file mode 100644
index 0000000..e6919ad
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.wxss b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.wxss
new file mode 100644
index 0000000..f50341e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/skeleton.wxss
@@ -0,0 +1,103 @@
+.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-skeleton {
+ box-sizing: border-box;
+}
+.t-skeleton__row {
+ display: flex;
+ margin-bottom: var(--td-skeleton-row-spacing, var(--td-spacer-2, 32rpx));
+ align-items: center;
+ justify-content: space-between;
+}
+.t-skeleton__row:only-child,
+.t-skeleton__row:last-child {
+ margin-bottom: 0;
+}
+.t-skeleton__col {
+ background-color: var(--td-skeleton-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-skeleton__col:first-child:last-child,
+.t-skeleton__col:last-child {
+ margin-right: 0;
+}
+.t-skeleton--type-text {
+ width: 100%;
+ height: var(--td-skeleton-text-height, 32rpx);
+ border-radius: var(--td-skeleton-text-border-radius, var(--td-radius-small, 6rpx));
+}
+.t-skeleton--type-rect {
+ width: 100%;
+ height: var(--td-skeleton-rect-height, 32rpx);
+ border-radius: var(--td-skeleton-rect-border-radius, var(--td-radius-default, 12rpx));
+}
+.t-skeleton--type-circle {
+ width: var(--td-skeleton-circle-height, 96rpx);
+ height: var(--td-skeleton-circle-height, 96rpx);
+ border-radius: var(--td-skeleton-circle-border-radius, var(--td-skeleton-circle-border-radius, var(--td-radius-circle, 50%)));
+ flex-shrink: 0;
+}
+.t-skeleton--animation-gradient {
+ position: relative;
+ overflow-x: hidden;
+}
+.t-skeleton--animation-gradient::after {
+ content: ' ';
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ top: 0;
+ background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--td-skeleton-animation-gradient, rgba(0, 0, 0, 0.04)), rgba(255, 255, 255, 0));
+ animation: t-skeleton--gradient 1.5s linear 2s infinite;
+}
+.t-skeleton--animation-flashed {
+ animation: t-skeleton--flashed 2s linear 2s infinite;
+}
+@keyframes t-skeleton--gradient {
+ 0% {
+ transform: translateX(-100%) skewX(-15deg);
+ }
+ 100% {
+ transform: translateX(100%) skewX(-15deg);
+ }
+}
+@keyframes t-skeleton--flashed {
+ 0% {
+ opacity: 1;
+ }
+ 50% {
+ background-color: var(--td-skeleton-animation-flashed, rgba(230, 230, 230, 0.3));
+ opacity: 0.3;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/type.d.ts b/miniprogram_npm/tdesign-miniprogram/skeleton/type.d.ts
new file mode 100644
index 0000000..c96ee71
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/type.d.ts
@@ -0,0 +1,32 @@
+export interface TdSkeletonProps {
+ animation?: {
+ type: StringConstructor;
+ value?: 'gradient' | 'flashed' | 'none';
+ };
+ delay?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ rowCol?: {
+ type: ArrayConstructor;
+ value?: SkeletonRowCol;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'avatar' | 'image' | 'text' | 'paragraph';
+ };
+}
+export declare type SkeletonRowCol = Array>;
+export interface SkeletonRowColObj {
+ width?: string;
+ size?: string;
+ height?: string;
+ marginRight?: string;
+ marginLeft?: string;
+ margin?: string;
+ type?: 'rect' | 'circle' | 'text';
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/skeleton/type.js b/miniprogram_npm/tdesign-miniprogram/skeleton/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/skeleton/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/slider/README.en-US.md
new file mode 100644
index 0000000..5076b36
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/README.en-US.md
@@ -0,0 +1,66 @@
+:: BASE_DOC ::
+
+## API
+
+
+### Slider 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
+colors | Array | [] | `deprecated`。Typescript:`Array` | N
+disabled | Boolean | undefined | \- | N
+disabled-color | Array | [] | `deprecated`。Typescript:`Array` | N
+label | String / Boolean | false | Typescript:`string \| boolean` | N
+marks | Object / Array | {} | Typescript:`Record \| Array` | N
+max | Number | 100 | \- | N
+min | Number | 0 | \- | N
+range | Boolean | false | \- | N
+show-extreme-value | Boolean | false | \- | N
+step | Number | 1 | \- | N
+theme | String | default | `0.30.0`。options: default/capsule | N
+value | Number / Array | 0 | Typescript:`SliderValue` `type SliderValue = number \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
+default-value | Number / Array | undefined | uncontrolled property。Typescript:`SliderValue` `type SliderValue = number \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
+vertical | Boolean | false | \- | N
+
+### Slider Events
+
+name | params | description
+-- | -- | --
+change | `(value: SliderValue)` | \-
+dragend | `(value: SliderValue, e: TouchEvent)` | \-
+dragstart | `(e: TouchEvent)` | \-
+### Slider External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-bar | \-
+t-class-bar-active | \-
+t-class-bar-disabled | \-
+t-class-cursor | \-
+
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-slider-active-color | @brand-color | -
+--td-slider-bar-height | 8rpx | -
+--td-slider-bar-width | 8rpx | -
+--td-slider-capsule-bar-color | @bg-color-component | -
+--td-slider-capsule-bar-heihgt | 48rpx | -
+--td-slider-capsule-bar-width | 48rpx | -
+--td-slider-capsule-line-heihgt | 36rpx | -
+--td-slider-default-color | @bg-color-component | -
+--td-slider-default-color | @bg-color-component-disabled | -
+--td-slider-disabled-color | @brand-color-disabled | -
+--td-slider-disabled-text-color | @text-color-disabled | -
+--td-slider-dot-bg-color | #fff | -
+--td-slider-dot-color | @component-border | -
+--td-slider-dot-disabled-bg-color | #fff | -
+--td-slider-dot-disabled-border-color | #f3f3f3 | -
+--td-slider-dot-size | 40rpx | -
+--td-slider-text-color | @text-color-primary | -
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/README.md b/miniprogram_npm/tdesign-miniprogram/slider/README.md
new file mode 100644
index 0000000..78686e9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/README.md
@@ -0,0 +1,142 @@
+---
+title: Slider 滑动选择器
+description: 用于选择横轴上的数值、区间、档位。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-slider": "tdesign-miniprogram/slider/slider"
+}
+```
+
+## 代码演示
+
+
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+单游标滑块
+
+{{ base }}
+
+双游标滑块
+
+{{ range }}
+
+带数值滑动选择器
+
+{{ label }}
+
+带刻度滑动选择器
+
+{{ step }}
+
+### 组件状态
+
+滑块禁用状态
+
+{{ disabled }}
+
+#### 特殊样式
+
+胶囊型滑块
+
+{{ capsule }}
+
+#### 垂直状态
+
+垂直方向的滑块
+
+{{ vertical }}
+
+
+## API
+
+
+### Slider Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+colors | Array | [] | 已废弃。颜色,[已选择, 未选择]。TS 类型:`Array` | N
+disabled | Boolean | undefined | 是否禁用组件 | N
+disabled-color | Array | [] | 已废弃。禁用状态滑动条的颜色,[已选, 未选]。TS 类型:`Array` | N
+label | String / Boolean | false | 滑块当前值文本。
值为 true 显示默认文案;值为 false 不显示滑块当前值文本;
值为 `${value}%` 则表示组件会根据占位符渲染文案;
值类型为函数时,参数 `value` 标识滑块值,参数 `position=start` 表示范围滑块的起始值,参数 `position=end` 表示范围滑块的终点值。TS 类型:`string \| boolean` | N
+marks | Object / Array | {} | 刻度标记,示例:`[0, 10, 40, 200]` 或者 `{ 5: '5¥', 10: '10%' }`。TS 类型:`Record \| Array` | N
+max | Number | 100 | 滑块范围最大值 | N
+min | Number | 0 | 滑块范围最小值 | N
+range | Boolean | false | 双游标滑块 | N
+show-extreme-value | Boolean | false | 是否边界值 | N
+step | Number | 1 | 步长 | N
+theme | String | default | `0.30.0`。滑块风格。可选项:default/capsule | N
+value | Number / Array | 0 | 滑块值。TS 类型:`SliderValue` `type SliderValue = number \| Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
+default-value | Number / Array | undefined | 滑块值。非受控属性。TS 类型:`SliderValue` `type SliderValue = number \| Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
+vertical | Boolean | false | 是否是垂直的滑块(渲染垂直滑块时,默认高度为400rpx,可通过修改`--td-slider-bar-height`来自定义高度) | N
+
+### Slider Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: SliderValue)` | 滑块值变化时触发
+dragend | `(value: SliderValue, e: TouchEvent)` | 结束拖动时触发
+dragstart | `(e: TouchEvent)` | 开始拖动时触发
+### Slider External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-bar | 滑道底部样式类
+t-class-bar-active | 滑道激活态样式类
+t-class-bar-disabled | 滑道禁用态样式类
+t-class-cursor | 游标样式类
+
+## FAQ
+
+当 slider 外层使用 `hidden` 包裹,需要在 `hidden = false` 时,重新调用组件的 `init` 方法,才能正常渲染(在t-popup/t-dialog中同理)。如下:
+
+```html
+
+```
+
+```js
+const $slider = this.selectComponent('#slider');
+
+$slider.init();
+```
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-slider-active-color | @brand-color | -
+--td-slider-bar-height | 8rpx | vertical为true时默认为400rpx
+--td-slider-bar-width | 8rpx | vertical为true时有效
+--td-slider-capsule-bar-color | @bg-color-component | -
+--td-slider-capsule-bar-heihgt | 48rpx | -
+--td-slider-capsule-bar-width | 48rpx | vertical为true时有效
+--td-slider-capsule-line-heihgt | 36rpx | -
+--td-slider-default-color | @bg-color-component | -
+--td-slider-default-color | @bg-color-component-disabled | -
+--td-slider-disabled-color | @brand-color-disabled | -
+--td-slider-disabled-text-color | @text-color-disabled | -
+--td-slider-dot-bg-color | #fff | -
+--td-slider-dot-color | @component-border | -
+--td-slider-dot-disabled-bg-color | #fff | -
+--td-slider-dot-disabled-border-color | #f3f3f3 | -
+--td-slider-dot-size | 40rpx | -
+--td-slider-text-color | @text-color-primary | -
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/props.d.ts b/miniprogram_npm/tdesign-miniprogram/slider/props.d.ts
new file mode 100644
index 0000000..f6d03ac
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSliderProps } from './type';
+declare const props: TdSliderProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/props.js b/miniprogram_npm/tdesign-miniprogram/slider/props.js
new file mode 100644
index 0000000..291e43d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/props.js
@@ -0,0 +1,51 @@
+const props = {
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ label: {
+ type: null,
+ value: false,
+ },
+ marks: {
+ type: null,
+ value: {},
+ },
+ max: {
+ type: Number,
+ value: 100,
+ },
+ min: {
+ type: Number,
+ value: 0,
+ },
+ range: {
+ type: Boolean,
+ value: false,
+ },
+ showExtremeValue: {
+ type: Boolean,
+ value: false,
+ },
+ step: {
+ type: Number,
+ value: 1,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ value: 0,
+ },
+ vertical: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/slider.d.ts b/miniprogram_npm/tdesign-miniprogram/slider/slider.d.ts
new file mode 100644
index 0000000..df8933d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/slider.d.ts
@@ -0,0 +1,66 @@
+///
+import { SuperComponent } from '../common/src/index';
+import type { SliderValue } from './type';
+declare type dataType = {
+ sliderStyles: string;
+ classPrefix: string;
+ initialLeft: number | null;
+ initialRight: number | null;
+ activeLeft: number;
+ activeRight: number;
+ maxRange: number;
+ lineLeft: number;
+ lineRight: number;
+ dotTopValue: number[];
+ blockSize: number;
+ isScale: boolean;
+ scaleArray: any[];
+ scaleTextArray: any[];
+ _value: SliderValue;
+ prefix: string;
+ isVisibleToScreenReader: boolean;
+ identifier: number[];
+ __inited: boolean;
+};
+export default class Slider extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ pureDataPattern: RegExp;
+ };
+ properties: import("./type").TdSliderProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ data: dataType;
+ observers: {
+ value(newValue: SliderValue): void;
+ _value(newValue: SliderValue): void;
+ marks(val: any): void;
+ };
+ lifetimes: {
+ created(): void;
+ attached(): void;
+ };
+ injectPageScroll(): void;
+ observerScrollTop(rest: any): void;
+ toggleA11yTips(): void;
+ renderLine(val: any): void;
+ triggerValue(value?: SliderValue): void;
+ handlePropsChange(newValue: SliderValue): void;
+ handleMark(marks: any): void;
+ setSingleBarWidth(value: number): void;
+ init(): Promise;
+ stepValue(value: number): number;
+ onSingleLineTap(e: WechatMiniprogram.TouchEvent): void;
+ getSingleChangeValue(e: WechatMiniprogram.TouchEvent): number;
+ convertPosToValue(posValue: number, dir: 0 | 1): number;
+ onLineTap(e: WechatMiniprogram.TouchEvent): void;
+ onTouchStart(e: WechatMiniprogram.TouchEvent): void;
+ onTouchMoveLeft(e: WechatMiniprogram.TouchEvent): void;
+ onTouchMoveRight(e: WechatMiniprogram.TouchEvent): void;
+ setLineStyle(left: number, right: number): void;
+ onTouchEnd(e: WechatMiniprogram.TouchEvent): void;
+ getPagePosition(touch: any): any;
+}
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/slider.js b/miniprogram_npm/tdesign-miniprogram/slider/slider.js
new file mode 100644
index 0000000..65e1e5a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/slider.js
@@ -0,0 +1,408 @@
+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 config from '../common/config';
+import { trimSingleValue, trimValue } from './tool';
+import props from './props';
+import { getRect } from '../common/utils';
+import Bus from '../common/bus';
+const { prefix } = config;
+const name = `${prefix}-slider`;
+let Slider = class Slider extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-bar`,
+ `${prefix}-class-bar-active`,
+ `${prefix}-class-bar-disabled`,
+ `${prefix}-class-cursor`,
+ ];
+ this.options = {
+ pureDataPattern: /^__/,
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.data = {
+ sliderStyles: '',
+ classPrefix: name,
+ initialLeft: null,
+ initialRight: null,
+ activeLeft: 0,
+ activeRight: 0,
+ maxRange: 0,
+ lineLeft: 0,
+ lineRight: 0,
+ dotTopValue: [0, 0],
+ _value: 0,
+ blockSize: 20,
+ isScale: false,
+ scaleArray: [],
+ scaleTextArray: [],
+ prefix,
+ isVisibleToScreenReader: false,
+ identifier: [-1, -1],
+ __inited: false,
+ };
+ this.observers = {
+ value(newValue) {
+ this.handlePropsChange(newValue);
+ },
+ _value(newValue) {
+ this.bus.on('initial', () => this.renderLine(newValue));
+ this.toggleA11yTips();
+ },
+ marks(val) {
+ this.bus.on('initial', () => this.handleMark(val));
+ },
+ };
+ this.lifetimes = {
+ created() {
+ this.bus = new Bus();
+ },
+ attached() {
+ const { value } = this.properties;
+ if (!value)
+ this.handlePropsChange(0);
+ this.init();
+ this.injectPageScroll();
+ },
+ };
+ }
+ injectPageScroll() {
+ const { range, vertical } = this.properties;
+ if (!range || !vertical)
+ return;
+ const pages = getCurrentPages() || [];
+ let curPage = null;
+ if (pages && pages.length - 1 >= 0) {
+ curPage = pages[pages.length - 1];
+ }
+ if (!curPage)
+ return;
+ const originPageScroll = curPage === null || curPage === void 0 ? void 0 : curPage.onPageScroll;
+ curPage.onPageScroll = (rest) => {
+ originPageScroll === null || originPageScroll === void 0 ? void 0 : originPageScroll.call(this, rest);
+ this.observerScrollTop(rest);
+ };
+ }
+ observerScrollTop(rest) {
+ const { scrollTop } = rest || {};
+ this.pageScrollTop = scrollTop;
+ }
+ toggleA11yTips() {
+ this.setData({
+ isVisibleToScreenReader: true,
+ });
+ setTimeout(() => {
+ this.setData({
+ isVisibleToScreenReader: false,
+ });
+ }, 2000);
+ }
+ renderLine(val) {
+ const { min, max, range } = this.properties;
+ const { maxRange } = this.data;
+ if (range) {
+ const left = (maxRange * (val[0] - Number(min))) / (Number(max) - Number(min));
+ const right = (maxRange * (Number(max) - val[1])) / (Number(max) - Number(min));
+ this.setLineStyle(left, right);
+ }
+ else {
+ this.setSingleBarWidth(val);
+ }
+ }
+ triggerValue(value) {
+ if (this.preval === value)
+ return;
+ this.preval = value;
+ this._trigger('change', {
+ value: trimValue(value, this.properties),
+ });
+ }
+ handlePropsChange(newValue) {
+ const value = trimValue(newValue, this.properties);
+ const setValueAndTrigger = () => {
+ this.setData({
+ _value: value,
+ });
+ };
+ if (this.data.maxRange === 0) {
+ this.init().then(setValueAndTrigger);
+ return;
+ }
+ setValueAndTrigger();
+ }
+ handleMark(marks) {
+ const calcPos = (arr) => {
+ const { max, theme } = this.properties;
+ const { blockSize, maxRange } = this.data;
+ const margin = theme === 'capsule' ? blockSize / 2 : 0;
+ return arr.map((item) => ({
+ val: item,
+ left: Math.round((item / Number(max)) * maxRange) + margin,
+ }));
+ };
+ if ((marks === null || marks === void 0 ? void 0 : marks.length) && Array.isArray(marks)) {
+ this.setData({
+ isScale: true,
+ scaleArray: calcPos(marks),
+ scaleTextArray: [],
+ });
+ }
+ if (Object.prototype.toString.call(marks) === '[object Object]') {
+ const scaleArray = Object.keys(marks).map((item) => Number(item));
+ const scaleTextArray = scaleArray.map((item) => marks[item]);
+ this.setData({
+ isScale: scaleArray.length > 0,
+ scaleArray: calcPos(scaleArray),
+ scaleTextArray,
+ });
+ }
+ }
+ setSingleBarWidth(value) {
+ const { max, min, theme } = this.properties;
+ const { maxRange, blockSize } = this.data;
+ const halfBlock = theme === 'capsule' ? Number(blockSize) / 2 : 0;
+ const percentage = (Number(value) - Number(min)) / (Number(max) - Number(min));
+ const width = percentage * maxRange + halfBlock;
+ this.setData({
+ lineBarWidth: `${width}px`,
+ });
+ }
+ init() {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this.data.__inited)
+ return;
+ const line = yield getRect(this, '#sliderLine');
+ const { blockSize } = this.data;
+ const { theme, vertical } = this.properties;
+ const halfBlock = Number(blockSize) / 2;
+ const { top, bottom, right, left } = line;
+ let maxRange = vertical ? bottom - top : right - left;
+ let initialLeft = vertical ? top : left;
+ let initialRight = vertical ? bottom : right;
+ if (initialLeft === 0 && initialRight === 0)
+ return;
+ if (theme === 'capsule') {
+ maxRange = maxRange - Number(blockSize) - 6;
+ initialLeft -= halfBlock;
+ initialRight -= halfBlock;
+ }
+ this.setData({
+ maxRange,
+ initialLeft,
+ initialRight,
+ __inited: true,
+ });
+ this.bus.emit('initial');
+ });
+ }
+ stepValue(value) {
+ const { step, min, max } = this.properties;
+ const decimal = String(step).indexOf('.') > -1 ? String(step).length - String(step).indexOf('.') - 1 : 0;
+ const closestStep = trimSingleValue(Number((Math.round(value / Number(step)) * Number(step)).toFixed(decimal)), Number(min), Number(max));
+ return closestStep;
+ }
+ onSingleLineTap(e) {
+ const { disabled } = this.properties;
+ if (disabled)
+ return;
+ const isSingleLineTap = this.data.identifier[0] === -1;
+ if (isSingleLineTap) {
+ const [touch] = e.changedTouches;
+ this.data.identifier[0] = touch.identifier;
+ }
+ const value = this.getSingleChangeValue(e);
+ if (isSingleLineTap) {
+ this.data.identifier[0] = -1;
+ }
+ this.triggerValue(value);
+ }
+ getSingleChangeValue(e) {
+ const { min, max, theme, vertical } = this.properties;
+ const { initialLeft, maxRange, blockSize } = this.data;
+ const touch = e.changedTouches.find((item) => item.identifier === this.data.identifier[0]);
+ const pagePosition = this.getPagePosition(touch);
+ let offset = 0;
+ if (theme === 'capsule') {
+ offset = Number(blockSize);
+ if (vertical) {
+ offset *= 2;
+ }
+ offset += 6;
+ }
+ else if (vertical) {
+ offset = Number(blockSize);
+ }
+ const currentLeft = pagePosition - initialLeft - offset;
+ let value = 0;
+ if (currentLeft <= 0) {
+ value = Number(min);
+ }
+ else if (currentLeft >= maxRange) {
+ value = Number(max);
+ }
+ else {
+ value = (currentLeft / maxRange) * (Number(max) - Number(min)) + Number(min);
+ }
+ return this.stepValue(value);
+ }
+ convertPosToValue(posValue, dir) {
+ const { maxRange } = this.data;
+ const { max, min } = this.properties;
+ return dir === 0
+ ? (posValue / maxRange) * (Number(max) - Number(min)) + Number(min)
+ : Number(max) - (posValue / maxRange) * (Number(max) - Number(min));
+ }
+ onLineTap(e) {
+ const { disabled, theme, vertical } = this.properties;
+ const { initialLeft, initialRight, maxRange, blockSize } = this.data;
+ if (disabled)
+ return;
+ const [touch] = e.changedTouches;
+ const pagePosition = this.getPagePosition(touch);
+ const halfBlock = theme === 'capsule' ? Number(blockSize) / 2 : 0;
+ const currentLeft = pagePosition - initialLeft;
+ const currentRight = -(pagePosition - initialRight);
+ if (currentLeft < 0 || currentRight > maxRange + Number(blockSize))
+ return;
+ Promise.all([getRect(this, '#leftDot'), getRect(this, '#rightDot')]).then(([leftDot, rightDot]) => {
+ const pageScrollTop = this.pageScrollTop || 0;
+ const leftDotPosition = vertical ? leftDot.top + pageScrollTop : leftDot.left;
+ const distanceLeft = Math.abs(pagePosition - leftDotPosition - halfBlock);
+ const rightDotPosition = vertical ? rightDot.top + pageScrollTop : rightDot.left;
+ const distanceRight = Math.abs(rightDotPosition - pagePosition + halfBlock);
+ const isMoveLeft = distanceLeft < distanceRight;
+ let offset = 0;
+ if (theme === 'capsule') {
+ offset = Number(blockSize);
+ if (vertical) {
+ offset *= 2;
+ }
+ offset += 6;
+ }
+ else if (vertical) {
+ offset = Number(blockSize);
+ }
+ if (isMoveLeft) {
+ const left = pagePosition - initialLeft - offset;
+ const leftValue = this.convertPosToValue(left, 0);
+ this.triggerValue([this.stepValue(leftValue), this.data._value[1]]);
+ }
+ else {
+ let right = -(pagePosition - initialRight);
+ if (vertical) {
+ right += offset / 2;
+ }
+ const rightValue = this.convertPosToValue(right, 1);
+ this.triggerValue([this.data._value[0], this.stepValue(rightValue)]);
+ }
+ });
+ }
+ onTouchStart(e) {
+ this.triggerEvent('dragstart', { e });
+ const [touch] = e.changedTouches;
+ if (e.currentTarget.id === 'rightDot') {
+ this.data.identifier[1] = touch.identifier;
+ }
+ else {
+ this.data.identifier[0] = touch.identifier;
+ }
+ }
+ onTouchMoveLeft(e) {
+ const { disabled, theme, vertical } = this.properties;
+ const { initialLeft, _value, blockSize } = this.data;
+ if (disabled)
+ return;
+ const touch = e.changedTouches.find((item) => item.identifier === this.data.identifier[0]);
+ const pagePosition = this.getPagePosition(touch);
+ let offset = 0;
+ if (theme === 'capsule') {
+ offset += Number(blockSize);
+ }
+ if (vertical) {
+ offset += Number(blockSize) + 6;
+ }
+ const currentLeft = pagePosition - initialLeft - offset;
+ const newData = [..._value];
+ const leftValue = this.convertPosToValue(currentLeft, 0);
+ newData[0] = this.stepValue(leftValue);
+ this.triggerValue(newData);
+ }
+ onTouchMoveRight(e) {
+ const { disabled, vertical } = this.properties;
+ const { initialRight, _value, blockSize } = this.data;
+ if (disabled)
+ return;
+ const touch = e.changedTouches.find((item) => item.identifier === this.data.identifier[1]);
+ const pagePosition = this.getPagePosition(touch);
+ let offset = 0;
+ if (vertical) {
+ offset += Number(blockSize) / 2 + 6;
+ }
+ const currentRight = -(pagePosition - initialRight - offset);
+ const newData = [..._value];
+ const rightValue = this.convertPosToValue(currentRight, 1);
+ newData[1] = this.stepValue(rightValue);
+ this.triggerValue(newData);
+ }
+ setLineStyle(left, right) {
+ const { theme } = this.properties;
+ const { blockSize, maxRange } = this.data;
+ const halfBlock = theme === 'capsule' ? Number(blockSize) / 2 : 0;
+ const [a, b] = this.data._value;
+ const cut = (v) => parseInt(v, 10);
+ this.setData({
+ dotTopValue: [a, b],
+ });
+ if (left + right <= maxRange) {
+ this.setData({
+ lineLeft: cut(left + halfBlock),
+ lineRight: cut(right + halfBlock),
+ });
+ }
+ else {
+ this.setData({
+ lineLeft: cut(maxRange + halfBlock - right),
+ lineRight: cut(maxRange - left + halfBlock * 1.5),
+ });
+ }
+ }
+ onTouchEnd(e) {
+ this.triggerEvent('dragend', { e, value: this.data._value });
+ if (e.currentTarget.id === 'rightDot') {
+ this.data.identifier[1] = -1;
+ }
+ else {
+ this.data.identifier[0] = -1;
+ }
+ }
+ getPagePosition(touch) {
+ const { pageX, pageY } = touch;
+ const { vertical } = this.properties;
+ return vertical ? pageY : pageX;
+ }
+};
+Slider = __decorate([
+ wxComponent()
+], Slider);
+export default Slider;
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/slider.json b/miniprogram_npm/tdesign-miniprogram/slider/slider.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/slider.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/slider.wxml b/miniprogram_npm/tdesign-miniprogram/slider/slider.wxml
new file mode 100644
index 0000000..8658f19
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/slider.wxml
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+ {{ label ? t.getValue(label, min) : min}}
+
+
+
+
+
+ {{scaleTextArray[index]}}
+
+
+
+
+
+
+ {{t.getValue(label, _value) || _value}}
+
+
+
+
+
+
+
+ {{ label ? t.getValue(label, max) : max}}
+
+
+
+
+
+ {{min}}
+
+
+
+
+ {{scaleTextArray[index]}}
+
+
+
+
+
+ {{t.getValue(label, dotTopValue[0]) || dotTopValue[0]}}
+
+
+
+
+
+ {{t.getValue(label, dotTopValue[1]) || dotTopValue[1]}}
+
+
+
+
+
+
+
+ {{max}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/slider.wxs b/miniprogram_npm/tdesign-miniprogram/slider/slider.wxs
new file mode 100644
index 0000000..b4be3ff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/slider.wxs
@@ -0,0 +1,10 @@
+var REGEXP = getRegExp('[$][{value}]{7}');
+
+function getValue(label, value) {
+ if (label && label === 'true') return value;
+ if (REGEXP.test(label)) return label.replace(REGEXP, value);
+}
+
+module.exports = {
+ getValue: getValue,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/slider.wxss b/miniprogram_npm/tdesign-miniprogram/slider/slider.wxss
new file mode 100644
index 0000000..5d62061
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/slider.wxss
@@ -0,0 +1,275 @@
+.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-slider {
+ width: 100%;
+ font-size: 14px;
+ display: flex;
+ align-items: center;
+}
+.t-slider--disabled .t-slider__value,
+.t-slider--disabled .t-slider__range-extreme,
+.t-slider--disabled .t-slider__dot-value,
+.t-slider--disabled .t-slider__scale-desc {
+ color: var(--td-slider-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-slider--disabled .t-slider__dot {
+ background-color: var(--td-slider-dot-disabled-bg-color, #fff);
+ border-color: var(--td-slider-dot-disabled-border-color, #f3f3f3);
+}
+.t-slider--top {
+ padding-top: 40rpx;
+}
+.t-slider__line {
+ position: absolute;
+ top: 0;
+ height: var(--td-slider-bar-height, 8rpx);
+ border-radius: calc(var(--td-slider-bar-height, 8rpx) / 2);
+ background-color: var(--td-slider-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-slider__line--disabled {
+ background-color: var(--td-slider-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-slider__line--capsule {
+ height: var(--td-slider-capsule-line-heihgt, 36rpx);
+}
+.t-slider__line--capsule.t-slider__line--single {
+ border-top-left-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
+ border-bottom-left-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
+}
+.t-slider__dot {
+ border-radius: 50%;
+ border: 2rpx solid var(--td-slider-dot-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ position: absolute;
+ top: 50%;
+ right: 0;
+ transform: translate3d(50%, -50%, 0);
+ z-index: 2;
+ background-color: var(--td-slider-dot-bg-color, #fff);
+ width: var(--td-slider-dot-size, 40rpx);
+ height: var(--td-slider-dot-size, 40rpx);
+ box-shadow: var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12));
+ box-sizing: border-box;
+}
+.t-slider__dot--left {
+ left: 0;
+ transform: translate3d(-50%, -50%, 0);
+}
+.t-slider__dot-value {
+ position: relative;
+ left: 50%;
+ transform: translateX(-50%);
+ top: -52rpx;
+ text-align: center;
+ width: 96rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+}
+.t-slider__value,
+.t-slider__range-extreme,
+.t-slider__dot-value {
+ color: var(--td-slider-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-slider__value--sr-only,
+.t-slider__range-extreme--sr-only,
+.t-slider__dot-value--sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ clip-path: inset(50%);
+ border: 0;
+}
+.t-slider__dot-slider {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+.t-slider__value--min {
+ margin-left: 32rpx;
+}
+.t-slider__value--max {
+ margin-right: 32rpx;
+}
+.t-slider__value--right {
+ flex-basis: 80rpx;
+}
+.t-slider__value--right__value--text {
+ margin-right: 32rpx;
+ text-align: right;
+ display: block;
+}
+.t-slider__bar {
+ margin: 16rpx 32rpx;
+ flex: 10;
+ background-clip: content-box;
+ height: var(--td-slider-bar-height, 8rpx);
+ border-radius: calc(var(--td-slider-bar-height, 8rpx) / 2);
+ position: relative;
+ background-color: var(--td-slider-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-slider__bar--capsule {
+ height: var(--td-slider-capsule-bar-heihgt, 48rpx);
+ border-radius: calc(var(--td-slider-capsule-bar-heihgt, 48rpx) / 2);
+ background-color: var(--td-slider-capsule-bar-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border: 6rpx solid var(--td-slider-capsule-bar-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ box-sizing: border-box;
+}
+.t-slider__bar--marks {
+ background-color: var(--td-slider-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-slider__bar--disabled {
+ background-color: var(--td-slider-default-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-slider__range-extreme--min {
+ margin-left: 32rpx;
+ text-align: left;
+}
+.t-slider__range-extreme--max {
+ margin-right: 32rpx;
+ text-align: right;
+}
+.t-slider__scale-item {
+ background-color: var(--td-slider-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ width: var(--td-slider-bar-height, 8rpx);
+ height: 16rpx;
+ width: 16rpx;
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ margin-top: -8rpx;
+ z-index: 1;
+}
+.t-slider__scale-item--active {
+ background-color: var(--td-slider-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-slider__scale-item--disabled {
+ background-color: var(--td-slider-default-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-slider__scale-item--active.t-slider__scale-item--disabled {
+ background-color: var(--td-slider-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-slider__scale-item--capsule {
+ height: var(--td-slider-capsule-line-heihgt, 36rpx);
+ width: 4rpx;
+ border-radius: 0;
+ background-color: var(--td-slider-capsule-bar-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ margin-top: calc(-0.5 * var(--td-slider-capsule-line-heihgt, 36rpx));
+}
+.t-slider__scale-item--hidden {
+ background-color: transparent;
+}
+.t-slider__scale-desc {
+ position: absolute;
+ left: 50%;
+ color: var(--td-slider-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ transform: translateX(-50%);
+ bottom: 32rpx;
+}
+.t-slider__scale-desc--capsule {
+ bottom: 46rpx;
+}
+.t-slider--vertical {
+ --td-slider-bar-height: 400rpx;
+ height: var(--td-slider-bar-height, 8rpx);
+ justify-content: center;
+ position: relative;
+}
+.t-slider--vertical .t-slider__bar {
+ flex: none;
+ height: 100%;
+ width: var(--td-slider-bar-width, 8rpx);
+}
+.t-slider--vertical .t-slider__bar--capsule {
+ width: var(--td-slider-capsule-bar-width, 48rpx);
+ border-radius: calc(var(--td-slider-capsule-bar-width, 48rpx) / 2);
+}
+.t-slider--vertical .t-slider__line {
+ width: 100%;
+ height: unset;
+ left: 0;
+ border-radius: calc(var(--td-slider-bar-width, 8rpx) / 2);
+}
+.t-slider--vertical .t-slider__line--capsule.t-slider__line--single {
+ border-top-left-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
+ border-top-right-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
+}
+.t-slider--vertical .t-slider__dot {
+ left: 50%;
+ top: 100%;
+ transform: translate(-50%, -50%);
+}
+.t-slider--vertical .t-slider__dot--left {
+ top: 0;
+ transform: translate(-50%, -50%);
+ left: 50%;
+}
+.t-slider--vertical .t-slider__dot--right {
+ left: 50%;
+ transform: translate(-50%, -50%);
+ top: 100%;
+}
+.t-slider--vertical .t-slider__dot-value {
+ left: 54rpx;
+ top: 50%;
+ transform: translate(0, -50%);
+ width: auto;
+}
+.t-slider--vertical .t-slider__range-extreme {
+ position: absolute;
+ left: 50%;
+ transform: translateX(-50%);
+ margin: 0;
+}
+.t-slider--vertical .t-slider__range-extreme--min {
+ top: 0;
+}
+.t-slider--vertical .t-slider__range-extreme--max {
+ bottom: 0;
+}
+.t-slider--vertical .t-slider__scale-item {
+ left: 50%;
+ margin-top: 0;
+}
+.t-slider--vertical .t-slider__scale-item--capsule {
+ height: 4rpx;
+ width: var(--td-slider-capsule-line-heihgt, 36rpx);
+}
+.t-slider--vertical .t-slider__scale-desc {
+ top: 50%;
+ transform: translateY(-50%);
+ bottom: unset;
+ left: 38rpx;
+}
+.t-slider--vertical .t-slider__scale-desc--capsule {
+ left: 52rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/tool.d.ts b/miniprogram_npm/tdesign-miniprogram/slider/tool.d.ts
new file mode 100644
index 0000000..b9383e6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/tool.d.ts
@@ -0,0 +1,2 @@
+export declare const trimSingleValue: (value: any, min: number, max: number) => number;
+export declare const trimValue: (value: number | number[], props: any) => number | number[];
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/tool.js b/miniprogram_npm/tdesign-miniprogram/slider/tool.js
new file mode 100644
index 0000000..671ab5d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/tool.js
@@ -0,0 +1,23 @@
+export const trimSingleValue = (value, min, max) => {
+ if (value < min) {
+ return min;
+ }
+ if (value > max) {
+ return max;
+ }
+ return value;
+};
+export const trimValue = (value, props) => {
+ const { min, max, range } = props;
+ if (range && Array.isArray(value)) {
+ value[0] = trimSingleValue(value[0], min, max);
+ value[1] = trimSingleValue(value[1], min, max);
+ return value[0] <= value[1] ? value : [value[1], value[0]];
+ }
+ if (range) {
+ return [min, max];
+ }
+ if (!range) {
+ return trimSingleValue(value, min, max);
+ }
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/type.d.ts b/miniprogram_npm/tdesign-miniprogram/slider/type.d.ts
new file mode 100644
index 0000000..099ed6c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/type.d.ts
@@ -0,0 +1,51 @@
+export interface TdSliderProps {
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ type: null;
+ value?: string | boolean;
+ };
+ marks?: {
+ type: null;
+ value?: Record | Array;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ min?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ range?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showExtremeValue?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ step?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'capsule';
+ };
+ value?: {
+ type: null;
+ value?: SliderValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: SliderValue;
+ };
+ vertical?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export declare type SliderValue = number | Array;
diff --git a/miniprogram_npm/tdesign-miniprogram/slider/type.js b/miniprogram_npm/tdesign-miniprogram/slider/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/slider/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/step-item/props.d.ts
new file mode 100644
index 0000000..d941a41
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdStepItemProps } from './type';
+declare const props: TdStepItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/props.js b/miniprogram_npm/tdesign-miniprogram/step-item/props.js
new file mode 100644
index 0000000..87c1af0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/props.js
@@ -0,0 +1,18 @@
+const props = {
+ content: {
+ type: String,
+ value: '',
+ },
+ icon: {
+ type: String,
+ },
+ status: {
+ type: String,
+ value: 'default',
+ },
+ title: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/step-item.d.ts b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.d.ts
new file mode 100644
index 0000000..c2f2ecc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.d.ts
@@ -0,0 +1,34 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class StepItem extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ relations: RelationsOptions;
+ externalClasses: string[];
+ properties: import("./type").TdStepItemProps;
+ data: {
+ classPrefix: string;
+ prefix: string;
+ index: number;
+ isDot: boolean;
+ curStatus: string;
+ layout: string;
+ isLastChild: boolean;
+ sequence: string;
+ };
+ observers: {
+ status(value: any): void;
+ };
+ methods: {
+ updateStatus({ current, currentStatus, index, theme, layout, items, sequence }: {
+ current: any;
+ currentStatus: any;
+ index: any;
+ theme: any;
+ layout: any;
+ items: any;
+ sequence: any;
+ }): void;
+ onTap(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/step-item.js b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.js
new file mode 100644
index 0000000..71914b1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.js
@@ -0,0 +1,79 @@
+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';
+const { prefix } = config;
+const name = `${prefix}-steps-item`;
+let StepItem = class StepItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.relations = {
+ '../steps/steps': {
+ type: 'parent',
+ },
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-title`,
+ `${prefix}-class-description`,
+ `${prefix}-class-extra`,
+ ];
+ this.properties = props;
+ this.data = {
+ classPrefix: name,
+ prefix,
+ index: 0,
+ isDot: false,
+ curStatus: '',
+ layout: 'vertical',
+ isLastChild: false,
+ sequence: 'positive',
+ };
+ this.observers = {
+ status(value) {
+ const { curStatus } = this.data;
+ if (curStatus === '' || value === curStatus)
+ return;
+ this.setData({ curStatus: value });
+ },
+ };
+ this.methods = {
+ updateStatus({ current, currentStatus, index, theme, layout, items, sequence }) {
+ let curStatus = this.data.status;
+ if (curStatus === 'default') {
+ if (index < Number(current)) {
+ curStatus = 'finish';
+ }
+ else if (index === Number(current)) {
+ curStatus = currentStatus;
+ }
+ }
+ this.setData({
+ curStatus,
+ index,
+ isDot: theme === 'dot',
+ layout,
+ theme,
+ sequence,
+ isLastChild: index === (sequence === 'positive' ? items.length - 1 : 0),
+ });
+ },
+ onTap() {
+ this.$parent.handleClick(this.data.index);
+ },
+ };
+ }
+};
+StepItem = __decorate([
+ wxComponent()
+], StepItem);
+export default StepItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/step-item.json b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxml b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxml
new file mode 100644
index 0000000..093bdce
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{index + 1}}
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+ {{ content }}
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxs b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxs
new file mode 100644
index 0000000..491902c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxs
@@ -0,0 +1,7 @@
+function getAriaLabel(index, title, content) {
+ return '第' + (index + 1) + '步,' + title + ',' + content;
+}
+
+module.exports = {
+ getAriaLabel: getAriaLabel,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxss b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxss
new file mode 100644
index 0000000..d570736
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/step-item.wxss
@@ -0,0 +1,206 @@
+.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-steps-item {
+ flex: 1;
+ vertical-align: top;
+ position: relative;
+ display: flex;
+}
+.t-steps-item__circle--default {
+ color: var(--td-step-item-default-circle-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ background-color: var(--td-step-item-default-circle-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-steps-item__title--default {
+ color: var(--td-step-item-default-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-steps-item__icon--default {
+ color: var(--td-step-item-default-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-steps-item__dot--default {
+ border-color: var(--td-step-item-default-dot-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ background-color: var(--td-step-item-default-dot-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-steps-item__circle--process {
+ color: var(--td-step-item-process-circle-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ background-color: var(--td-step-item-process-circle-bg, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__title--process {
+ color: var(--td-step-item-process-title-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__icon--process {
+ color: var(--td-step-item-process-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__dot--process {
+ border-color: var(--td-step-item-process-dot-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-step-item-process-dot-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__circle--finish {
+ color: var(--td-step-item-finish-circle-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-step-item-finish-circle-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-steps-item__title--finish {
+ color: var(--td-step-item-finish-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-steps-item__icon--finish {
+ color: var(--td-step-item-finish-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__dot--finish {
+ border-color: var(--td-step-item-finish-dot-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-step-item-finish-dot-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__circle--error {
+ color: var(--td-step-item-error-circle-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-step-item-error-circle-bg, var(--td-error-color-1, #fff0ed));
+}
+.t-steps-item__title--error {
+ color: var(--td-step-item-error-title-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-steps-item__icon--error {
+ color: var(--td-step-item-error-icon-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-steps-item__dot--error {
+ border-color: var(--td-step-item-error-dot-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-step-item-error-dot-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-steps-item--horizontal {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+.t-steps-item__anchor {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-steps-item__anchor--vertical {
+ width: var(--td-step-item-circle-size, 44rpx);
+ height: var(--td-step-item-circle-size, 44rpx);
+}
+.t-steps-item__circle {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: var(--td-step-item-circle-size, 44rpx);
+ height: var(--td-step-item-circle-size, 44rpx);
+ text-align: center;
+ border-radius: 50%;
+ font-size: var(--td-step-item-circle-font-size, 28rpx);
+}
+.t-steps-item__icon {
+ z-index: 1;
+ vertical-align: top;
+ font-size: var(--td-font-size-base, 28rpx);
+ position: relative;
+}
+.t-steps-item__dot {
+ width: var(--td-step-item-dot-size, 16rpx);
+ height: var(--td-step-item-dot-size, 16rpx);
+ border-radius: 50%;
+ border-width: 1px;
+ border-style: solid;
+ box-sizing: border-box;
+}
+.t-steps-item__content {
+ text-align: center;
+}
+.t-steps-item__content--horizontal {
+ max-width: 80px;
+ margin-top: 16rpx;
+}
+.t-steps-item__content--vertical {
+ margin-left: 16rpx;
+ flex: 1;
+ padding-bottom: 32rpx;
+}
+.t-steps-item__content--vertical.t-steps-item__content--last {
+ padding-bottom: 0;
+}
+.t-steps-item__title {
+ position: relative;
+ line-height: var(--td-step-item-circle-size, 44rpx);
+ font-size: var(--td-font-size-base, 28rpx);
+}
+.t-steps-item__title--process {
+ font-weight: 600;
+}
+.t-steps-item__title--vertical {
+ text-align: left;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 8rpx;
+}
+.t-steps-item__description {
+ color: var(--td-step-item-description-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ line-height: 40rpx;
+ font-size: var(--td-font-size-s, 24rpx);
+}
+.t-steps-item__description--vertical {
+ text-align: left;
+}
+.t-steps-item__extra:not(:empty) {
+ margin-top: 16rpx;
+}
+.t-steps-item__line {
+ background-color: var(--td-step-item-line-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ content: '';
+ display: block;
+ position: absolute;
+}
+.t-steps-item__line--horizontal {
+ height: 1px;
+ transform: translateY(-50%);
+ width: calc(100% - 32rpx - var(--td-step-item-circle-size, 44rpx));
+ top: calc(var(--td-step-item-circle-size, 44rpx) / 2 + 1px);
+ left: calc(50% + var(--td-step-item-circle-size, 44rpx) / 2 + 16rpx);
+}
+.t-steps-item__line--horizontal.t-steps-item__line--dot {
+ top: calc(var(--td-step-item-dot-size, 16rpx) / 2);
+}
+.t-steps-item__line--finish,
+.t-steps-item__line--reverse.t-steps-item__line--process {
+ background-color: var(--td-step-item-finish-line-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-steps-item__line--vertical {
+ height: calc(100% - 32rpx - var(--td-step-item-circle-size, 44rpx));
+ width: 1px;
+ transform: translateX(-50%);
+ left: calc(var(--td-step-item-circle-size, 44rpx) / 2);
+ top: calc(var(--td-step-item-circle-size, 44rpx) + 16rpx);
+}
+.t-steps-item__line--vertical.t-steps-item__line--dot {
+ top: var(--td-step-item-circle-size, 44rpx);
+ height: calc(100% - var(--td-step-item-circle-size, 44rpx));
+}
+:host {
+ flex: 1;
+ vertical-align: top;
+ position: relative;
+ align-self: flex-start;
+ width: inherit;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/step-item/type.d.ts
new file mode 100644
index 0000000..ca5e4b4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/type.d.ts
@@ -0,0 +1,19 @@
+export interface TdStepItemProps {
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ icon?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ status?: {
+ type: StringConstructor;
+ value?: StepStatus;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
+export declare type StepStatus = 'default' | 'process' | 'finish' | 'error';
diff --git a/miniprogram_npm/tdesign-miniprogram/step-item/type.js b/miniprogram_npm/tdesign-miniprogram/step-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/step-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/stepper/README.en-US.md
new file mode 100644
index 0000000..b01ce96
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/README.en-US.md
@@ -0,0 +1,49 @@
+:: BASE_DOC ::
+
+## API
+
+### Stepper 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
+disable-input | Boolean | false | \- | N
+disabled | Boolean | undefined | \- | N
+input-width | Number | - | \- | N
+integer | Boolean | true | \- | N
+max | Number | 100 | \- | N
+min | Number | 0 | \- | 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
+step | Number | 1 | \- | N
+theme | String | normal | stylish。options: normal/filled/outline | N
+value | String / Number | 0 | \- | N
+default-value | String / Number | undefined | uncontrolled property | N
+
+### Stepper Events
+
+name | params | description
+-- | -- | --
+blur | `({ type: string \| number })` | \-
+change | `({ value: string \| number })` | \-
+focus | `({ value: string \| number }))` | \-
+overlimit | `({type: 'minus' \| 'plus'})` | \-
+
+### Stepper External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-input | \-
+t-class-minus | \-
+t-class-plus | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-stepper-border-color | @component-border | -
+--td-stepper-border-radius | @radius-small | -
+--td-stepper-input-color | @font-gray-1 | -
+--td-stepper-input-disabled-color | @font-gray-4 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/README.md b/miniprogram_npm/tdesign-miniprogram/stepper/README.md
new file mode 100644
index 0000000..0d734b7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/README.md
@@ -0,0 +1,100 @@
+---
+title: Stepper 步进器
+description: 用于数量的增减。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-stepper": "tdesign-miniprogram/stepper/stepper"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+基础步进器
+
+{{ base }}
+
+### 组件状态
+
+最大最小状态
+
+{{ min-max }}
+
+禁用状态
+
+{{ status }}
+
+### 组件样式
+
+步进器样式
+
+{{ theme }}
+
+步进器尺寸
+
+{{ size }}
+
+
+## API
+
+### Stepper Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+disable-input | Boolean | false | 禁用输入框 | N
+disabled | Boolean | undefined | 禁用全部操作 | N
+input-width | Number | - | 输入框宽度,默认单位 `px` | N
+integer | Boolean | true | 是否整型 | N
+max | Number | 100 | 最大值 | N
+min | Number | 0 | 最小值 | N
+size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+step | Number | 1 | 步长 | N
+theme | String | normal | 组件风格。可选项:normal/filled/outline | N
+value | String / Number | 0 | 值 | N
+default-value | String / Number | undefined | 值。非受控属性 | N
+
+### Stepper Events
+
+名称 | 参数 | 描述
+-- | -- | --
+blur | `({ type: string \| number })` | 输入框失去焦点时触发
+change | `({ value: string \| number })` | 数值发生变更时触发
+focus | `({ value: string \| number }))` | 输入框聚焦时触发
+overlimit | `({type: 'minus' \| 'plus'})` | 数值超出限制时触发
+
+### Stepper External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-input | 输入框样式类
+t-class-minus | 左侧递减号样式类
+t-class-plus | 右侧递增号样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-stepper-border-color | @component-border | -
+--td-stepper-border-radius | @radius-small | -
+--td-stepper-input-color | @font-gray-1 | -
+--td-stepper-input-disabled-color | @font-gray-4 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/props.d.ts b/miniprogram_npm/tdesign-miniprogram/stepper/props.d.ts
new file mode 100644
index 0000000..7f9e104
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/props.d.ts
@@ -0,0 +1,3 @@
+import { TdStepperProps } from './type';
+declare const props: TdStepperProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/props.js b/miniprogram_npm/tdesign-miniprogram/stepper/props.js
new file mode 100644
index 0000000..0a928e9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/props.js
@@ -0,0 +1,46 @@
+const props = {
+ disableInput: {
+ type: Boolean,
+ value: false,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ inputWidth: {
+ type: Number,
+ },
+ integer: {
+ type: Boolean,
+ value: true,
+ },
+ max: {
+ type: Number,
+ value: 100,
+ },
+ min: {
+ type: Number,
+ value: 0,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ step: {
+ type: Number,
+ value: 1,
+ },
+ theme: {
+ type: String,
+ value: 'normal',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ value: 0,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/stepper.d.ts b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.d.ts
new file mode 100644
index 0000000..3938064
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.d.ts
@@ -0,0 +1,78 @@
+import { SuperComponent } from '../common/src/index';
+export default class Stepper extends SuperComponent {
+ externalClasses: string[];
+ properties: {
+ disableInput?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ inputWidth?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ integer?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ min?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: import("../common/common").SizeEnum;
+ };
+ step?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: "outline" | "filled" | "normal";
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+ defaultValue?: {
+ type: null;
+ value?: string | number;
+ };
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(v: any): void;
+ };
+ data: {
+ currentValue: number;
+ classPrefix: string;
+ prefix: string;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ isDisabled(type: any): boolean;
+ getLen(num: number): number;
+ add(a: number, b: number): number;
+ format(value: any): string;
+ setValue(value: any): void;
+ minusValue(): boolean;
+ plusValue(): boolean;
+ filterIllegalChar(value: string | number): string;
+ handleFocus(e: any): void;
+ handleInput(e: any): void;
+ handleBlur(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/stepper.js b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.js
new file mode 100644
index 0000000..0aa3447
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.js
@@ -0,0 +1,134 @@
+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}-stepper`;
+let Stepper = class Stepper extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-input`, `${prefix}-class-minus`, `${prefix}-class-plus`];
+ this.properties = Object.assign({}, props);
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value(v) {
+ this.preValue = Number(v);
+ this.setData({
+ currentValue: this.format(Number(v)),
+ });
+ },
+ };
+ this.data = {
+ currentValue: 0,
+ classPrefix: name,
+ prefix,
+ };
+ this.lifetimes = {
+ attached() {
+ const { value, min } = this.properties;
+ this.setData({
+ currentValue: value ? Number(value) : min,
+ });
+ },
+ };
+ this.methods = {
+ isDisabled(type) {
+ const { min, max, disabled } = this.properties;
+ const { currentValue } = this.data;
+ if (disabled) {
+ return true;
+ }
+ if (type === 'minus' && currentValue <= min) {
+ return true;
+ }
+ if (type === 'plus' && currentValue >= max) {
+ return true;
+ }
+ return false;
+ },
+ getLen(num) {
+ const numStr = num.toString();
+ return numStr.indexOf('.') === -1 ? 0 : numStr.split('.')[1].length;
+ },
+ add(a, b) {
+ const maxLen = Math.max(this.getLen(a), this.getLen(b));
+ const base = Math.pow(10, maxLen);
+ return Math.round(a * base + b * base) / base;
+ },
+ format(value) {
+ const { min, max, step } = this.properties;
+ const len = Math.max(this.getLen(step), this.getLen(value));
+ return Math.max(Math.min(max, value, Number.MAX_SAFE_INTEGER), min, Number.MIN_SAFE_INTEGER).toFixed(len);
+ },
+ setValue(value) {
+ value = this.format(value);
+ if (this.preValue === value)
+ return;
+ this.preValue = value;
+ this._trigger('change', { value: Number(value) });
+ },
+ minusValue() {
+ if (this.isDisabled('minus')) {
+ this.triggerEvent('overlimit', { type: 'minus' });
+ return false;
+ }
+ const { currentValue, step } = this.data;
+ this.setValue(this.add(currentValue, -step));
+ },
+ plusValue() {
+ if (this.isDisabled('plus')) {
+ this.triggerEvent('overlimit', { type: 'plus' });
+ return false;
+ }
+ const { currentValue, step } = this.data;
+ this.setValue(this.add(currentValue, step));
+ },
+ filterIllegalChar(value) {
+ const v = String(value).replace(/[^0-9.]/g, '');
+ const indexOfDot = v.indexOf('.');
+ if (this.properties.integer && indexOfDot !== -1) {
+ return v.split('.')[0];
+ }
+ if (!this.properties.integer && indexOfDot !== -1 && indexOfDot !== v.lastIndexOf('.')) {
+ return v.split('.', 2).join('.');
+ }
+ return v;
+ },
+ handleFocus(e) {
+ const { value } = e.detail;
+ this.triggerEvent('focus', { value });
+ },
+ handleInput(e) {
+ const { value } = e.detail;
+ if (value === '') {
+ return;
+ }
+ const formatted = this.filterIllegalChar(value);
+ this.setData({
+ currentValue: formatted,
+ });
+ this.triggerEvent('input', { value: formatted });
+ },
+ handleBlur(e) {
+ const { value: rawValue } = e.detail;
+ const value = this.format(rawValue);
+ this.setValue(value);
+ this.triggerEvent('blur', { value });
+ },
+ };
+ }
+};
+Stepper = __decorate([
+ wxComponent()
+], Stepper);
+export default Stepper;
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/stepper.json b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.json
new file mode 100644
index 0000000..a81bbaa
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-cell": "../cell/cell",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/stepper.wxml b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.wxml
new file mode 100644
index 0000000..1622717
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.wxml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/stepper.wxss b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.wxss
new file mode 100644
index 0000000..7fd5127
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/stepper.wxss
@@ -0,0 +1,132 @@
+.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-stepper {
+ display: flex;
+ align-items: center;
+ color: var(--td-stepper-input-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-stepper__input {
+ margin: 0 8rpx;
+ text-align: center;
+ vertical-align: top;
+ height: inherit;
+ min-height: inherit;
+}
+.t-stepper__minus,
+.t-stepper__plus {
+ padding: 8rpx;
+ box-sizing: border-box;
+}
+.t-stepper__input,
+.t-stepper__minus-icon,
+.t-stepper__plus-icon {
+ color: inherit;
+}
+.t-stepper__input--normal,
+.t-stepper__input--filled,
+.t-stepper__input--outline {
+ height: inherit;
+ box-sizing: border-box;
+}
+.t-stepper--small {
+ height: 40rpx;
+ font-size: 20rpx;
+}
+.t-stepper--medium {
+ height: 48rpx;
+ font-size: 24rpx;
+}
+.t-stepper--large {
+ height: 56rpx;
+ font-size: 32rpx;
+}
+.t-stepper__input--small {
+ width: 68rpx;
+}
+.t-stepper__input--medium {
+ height: 48rpx;
+ width: 76rpx;
+}
+.t-stepper__input--large {
+ width: 90rpx;
+}
+.t-stepper__icon--small {
+ width: 40rpx;
+ height: 40rpx;
+ font-size: 24rpx;
+}
+.t-stepper__icon--medium {
+ width: 48rpx;
+ height: 48rpx;
+ font-size: 32rpx;
+}
+.t-stepper__icon--large {
+ width: 56rpx;
+ height: 56rpx;
+ font-size: 40rpx;
+}
+.t-stepper__minus--outline,
+.t-stepper__plus--outline {
+ border: 2rpx solid var(--td-stepper-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-stepper__input--outline {
+ border: none;
+ border-top: 2rpx solid var(--td-stepper-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+ border-bottom: 2rpx solid var(--td-stepper-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-stepper__minus--outline,
+.t-stepper__minus--filled {
+ border-radius: 0;
+ border-top-left-radius: var(--td-stepper-border-radius, var(--td-radius-small, 6rpx));
+ border-bottom-left-radius: var(--td-stepper-border-radius, var(--td-radius-small, 6rpx));
+}
+.t-stepper__plus--outline,
+.t-stepper__plus--filled {
+ border-radius: 0;
+ border-top-right-radius: var(--td-stepper-border-radius, var(--td-radius-small, 6rpx));
+ border-bottom-right-radius: var(--td-stepper-border-radius, var(--td-radius-small, 6rpx));
+}
+.t-stepper__minus--filled,
+.t-stepper__plus--filled {
+ background-color: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+}
+.t-stepper__input--filled {
+ background-color: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+ margin: 0 8rpx;
+}
+.t-stepper__input--filled .t-stepper__input {
+ margin: 0;
+}
+.t-stepper--normal-disabled {
+ color: var(--td-stepper-input-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-stepper--filled-disabled,
+.t-stepper--outline-disabled {
+ color: var(--td-stepper-input-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ background-color: var(--td-stepper-input-disabled-bg, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/type.d.ts b/miniprogram_npm/tdesign-miniprogram/stepper/type.d.ts
new file mode 100644
index 0000000..31499e7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/type.d.ts
@@ -0,0 +1,47 @@
+import { SizeEnum } from '../common/common';
+export interface TdStepperProps {
+ disableInput?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ inputWidth?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ integer?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ min?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: SizeEnum;
+ };
+ step?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'normal' | 'filled' | 'outline';
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+ defaultValue?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/stepper/type.js b/miniprogram_npm/tdesign-miniprogram/stepper/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/stepper/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/steps/README.en-US.md
new file mode 100644
index 0000000..3e41273
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/README.en-US.md
@@ -0,0 +1,82 @@
+:: BASE_DOC ::
+
+## API
+
+### Steps 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
+current | String / Number | - | \- | N
+default-current | String / Number | undefined | uncontrolled property | N
+current-status | String | process | options: default/process/finish/error | N
+layout | String | horizontal | options: horizontal/vertical | N
+readonly | Boolean | false | \- | N
+sequence | String | positive | options: positive/reverse | N
+theme | String | default | options: default/dot | N
+
+### Steps Events
+
+name | params | description
+-- | -- | --
+change | `({current: string \| number, previous: string \| number})` | \-
+### Steps External Classes
+
+className | Description
+-- | --
+t-class | \-
+
+
+### StepItem 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
+content | String / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+status | String | default | options: default/process/finish/error。Typescript:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/step-item/type.ts) | N
+sub-step-items | Array | [] | `deprecated`。Typescript:`SubStepItem[]` `interface SubStepItem { status: StepStatus, title: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/step-item/type.ts) | N
+title | String / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+### StepItem External Classes
+
+className | Description
+-- | --
+t-class | class name of root node
+t-class-content | \-
+t-class-description | \-
+t-class-extra | \-
+t-class-title | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-step-item-circle-font-size | 28rpx | -
+--td-step-item-circle-size | 44rpx | -
+--td-step-item-default-circle-bg | @bg-color-secondarycontainer | -
+--td-step-item-default-circle-color | @font-gray-3 | -
+--td-step-item-default-dot-border-color | @component-border | -
+--td-step-item-default-icon-color | @font-gray-3 | -
+--td-step-item-default-title-color | @font-gray-3 | -
+--td-step-item-description-color | @font-gray-3 | -
+--td-step-item-dot-size | 16rpx | -
+--td-step-item-error-circle-bg | @error-color-1 | -
+--td-step-item-error-circle-color | @error-color | -
+--td-step-item-error-dot-border-color | @error-color | -
+--td-step-item-error-icon-color | @error-color | -
+--td-step-item-error-title-color | @error-color | -
+--td-step-item-finish-circle-bg | @brand-color-light | -
+--td-step-item-finish-circle-color | @brand-color | -
+--td-step-item-finish-dot-border-color | @brand-color | -
+--td-step-item-finish-icon-color | @brand-color | -
+--td-step-item-finish-line-color | @brand-color | -
+--td-step-item-finish-title-color | @font-gray-1 | -
+--td-step-item-line-color | @component-border | -
+--td-step-item-process-circle-bg | @brand-color | -
+--td-step-item-process-circle-color | @font-white-1 | -
+--td-step-item-process-dot-border-color | @brand-color | -
+--td-step-item-process-icon-color | @brand-color | -
+--td-step-item-process-title-color | @brand-color | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/README.md b/miniprogram_npm/tdesign-miniprogram/steps/README.md
new file mode 100644
index 0000000..af1525f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/README.md
@@ -0,0 +1,142 @@
+---
+title: Steps 步骤条
+description: 用于任务步骤展示或任务进度展示。
+spline: navigation
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-steps": "tdesign-miniprogram/steps/steps",
+ "t-step-item": "tdesign-miniprogram/step-item/step-item",
+}
+```
+
+## 代码演示
+
+步骤条,方向可以横向和纵向,可以自定义步骤条显示内容以及是否可写
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+#### 水平步骤条
+
+支持三种类型:序号、图标、简略
+
+{{ horizontal }}
+
+#### 垂直步骤条
+
+支持三种类型:序号、图标、简略
+
+{{ vertical }}
+
+### 组件状态
+
+#### 选项卡状态
+
+共支持 4 种状态:未完成(default)、已完成(finish)、进行中(process)、错误(error)
+
+{{ status }}
+
+### 特殊类型
+
+通过已有特性,改造出两种常见类型:
+
+- 垂直自定义(在 Cascader 中使用)
+- 纯展示步骤条
+
+可以参考以下代码实现
+
+{{ special }}
+
+## API
+
+### Steps Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+current | String / Number | - | 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成 | N
+default-current | String / Number | undefined | 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成。非受控属性 | N
+current-status | String | process | 用于控制 current 指向的步骤条的状态。可选项:default/process/finish/error | N
+layout | String | horizontal | 步骤条方向,有两种:横向和纵向。可选项:horizontal/vertical | N
+readonly | Boolean | false | 只读状态 | N
+sequence | String | positive | 步骤条顺序。可选项:positive/reverse | N
+theme | String | default | 步骤条风格。可选项:default/dot | N
+
+### Steps Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `({current: string \| number, previous: string \| number})` | 当前步骤发生变化时触发
+### Steps External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+
+
+### StepItem Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+content | String / Slot | '' | 步骤描述。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+icon | String / Slot | - | 图标。传入 slot 代表使用插槽,其他字符串代表使用内置图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+status | String | default | 当前步骤的状态:默认状态(未开始)、进行中状态、完成状态、错误状态。可选项:default/process/finish/error。TS 类型:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/step-item/type.ts) | N
+sub-step-items | Array | [] | 已废弃。子步骤条,仅支持 layout = 'vertical' 时。TS 类型:`SubStepItem[]` `interface SubStepItem { status: StepStatus, title: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/step-item/type.ts) | N
+title | String / Slot | '' | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+### StepItem External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
+t-class-description | 描述样式类
+t-class-extra | 额外样式类
+t-class-title | 标题样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-step-item-circle-font-size | 28rpx | -
+--td-step-item-circle-size | 44rpx | -
+--td-step-item-default-circle-bg | @bg-color-secondarycontainer | -
+--td-step-item-default-circle-color | @font-gray-3 | -
+--td-step-item-default-dot-border-color | @component-border | -
+--td-step-item-default-icon-color | @font-gray-3 | -
+--td-step-item-default-title-color | @font-gray-3 | -
+--td-step-item-description-color | @font-gray-3 | -
+--td-step-item-dot-size | 16rpx | -
+--td-step-item-error-circle-bg | @error-color-1 | -
+--td-step-item-error-circle-color | @error-color | -
+--td-step-item-error-dot-border-color | @error-color | -
+--td-step-item-error-icon-color | @error-color | -
+--td-step-item-error-title-color | @error-color | -
+--td-step-item-finish-circle-bg | @brand-color-light | -
+--td-step-item-finish-circle-color | @brand-color | -
+--td-step-item-finish-dot-border-color | @brand-color | -
+--td-step-item-finish-icon-color | @brand-color | -
+--td-step-item-finish-line-color | @brand-color | -
+--td-step-item-finish-title-color | @font-gray-1 | -
+--td-step-item-line-color | @component-border | -
+--td-step-item-process-circle-bg | @brand-color | -
+--td-step-item-process-circle-color | @font-white-1 | -
+--td-step-item-process-dot-border-color | @brand-color | -
+--td-step-item-process-icon-color | @brand-color | -
+--td-step-item-process-title-color | @brand-color | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/props.d.ts b/miniprogram_npm/tdesign-miniprogram/steps/props.d.ts
new file mode 100644
index 0000000..fef4049
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/props.d.ts
@@ -0,0 +1,3 @@
+import { TdStepsProps } from './type';
+declare const props: TdStepsProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/props.js b/miniprogram_npm/tdesign-miniprogram/steps/props.js
new file mode 100644
index 0000000..05fa41f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/props.js
@@ -0,0 +1,30 @@
+const props = {
+ current: {
+ type: null,
+ value: null,
+ },
+ defaultCurrent: {
+ type: null,
+ },
+ currentStatus: {
+ type: String,
+ value: 'process',
+ },
+ layout: {
+ type: String,
+ value: 'horizontal',
+ },
+ readonly: {
+ type: Boolean,
+ value: false,
+ },
+ sequence: {
+ type: String,
+ value: 'positive',
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/steps.d.ts b/miniprogram_npm/tdesign-miniprogram/steps/steps.d.ts
new file mode 100644
index 0000000..140370f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/steps.d.ts
@@ -0,0 +1,22 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Steps extends SuperComponent {
+ relations: RelationsOptions;
+ externalClasses: string[];
+ properties: import("./type").TdStepsProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ observers: {
+ current(): void;
+ };
+ methods: {
+ updateChildren(): void;
+ updateLastChid(): void;
+ handleClick(index: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/steps.js b/miniprogram_npm/tdesign-miniprogram/steps/steps.js
new file mode 100644
index 0000000..ebec7fc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/steps.js
@@ -0,0 +1,73 @@
+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';
+const { prefix } = config;
+const name = `${prefix}-steps`;
+let Steps = class Steps extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.relations = {
+ '../step-item/step-item': {
+ type: 'child',
+ linked(child) {
+ this.updateChildren();
+ const { readonly } = this.data;
+ child.setData({
+ readonly,
+ });
+ },
+ unlinked() {
+ this.updateLastChid();
+ },
+ },
+ };
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'current',
+ event: 'change',
+ },
+ ];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.observers = {
+ current() {
+ this.updateChildren();
+ },
+ };
+ this.methods = {
+ updateChildren() {
+ const items = this.$children;
+ items.forEach((item, index) => {
+ item.updateStatus(Object.assign({ index, items }, this.data));
+ });
+ },
+ updateLastChid() {
+ const items = this.$children;
+ items.forEach((child, index) => child.setData({ isLastChild: index === items.length - 1 }));
+ },
+ handleClick(index) {
+ if (!this.data.readonly) {
+ const preIndex = this.data.current;
+ this._trigger('change', {
+ previous: preIndex,
+ current: index,
+ });
+ }
+ },
+ };
+ }
+};
+Steps = __decorate([
+ wxComponent()
+], Steps);
+export default Steps;
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/steps.json b/miniprogram_npm/tdesign-miniprogram/steps/steps.json
new file mode 100644
index 0000000..8dd1021
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/steps.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-step": "../step-item/step-item"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/steps.wxml b/miniprogram_npm/tdesign-miniprogram/steps/steps.wxml
new file mode 100644
index 0000000..5c5c7eb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/steps.wxml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/steps.wxss b/miniprogram_npm/tdesign-miniprogram/steps/steps.wxss
new file mode 100644
index 0000000..f14023e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/steps.wxss
@@ -0,0 +1,46 @@
+.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);
+}
+:host {
+ display: flex;
+}
+.t-step--vertical {
+ padding-right: 32rpx;
+}
+.t-steps {
+ display: flex;
+ width: 100%;
+}
+.t-steps--vertical {
+ flex-direction: column;
+}
+.t-steps--reverse {
+ flex-direction: row-reverse;
+}
+.t-steps--vertical.t-steps--reverse {
+ flex-direction: column-reverse;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/type.d.ts b/miniprogram_npm/tdesign-miniprogram/steps/type.d.ts
new file mode 100644
index 0000000..d0e9147
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/type.d.ts
@@ -0,0 +1,30 @@
+export interface TdStepsProps {
+ current?: {
+ type: null;
+ value?: string | number;
+ };
+ defaultCurrent?: {
+ type: null;
+ value?: string | number;
+ };
+ currentStatus?: {
+ type: StringConstructor;
+ value?: 'default' | 'process' | 'finish' | 'error';
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ sequence?: {
+ type: StringConstructor;
+ value?: 'positive' | 'reverse';
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'dot';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/steps/type.js b/miniprogram_npm/tdesign-miniprogram/steps/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/steps/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md
new file mode 100644
index 0000000..643e0e6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md
@@ -0,0 +1,26 @@
+:: BASE_DOC ::
+
+## API
+
+### Sticky 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
+container | Function | - | \- | N
+disabled | Boolean | false | \- | N
+offset-top | String / Number | 0 | \- | N
+z-index | Number | 99 | \- | N
+
+### Sticky Events
+
+name | params | description
+-- | -- | --
+scroll | `(detail: { scrollTop: number, isFixed: boolean })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+### Sticky External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-content | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/README.md b/miniprogram_npm/tdesign-miniprogram/sticky/README.md
new file mode 100644
index 0000000..d96f665
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/README.md
@@ -0,0 +1,70 @@
+---
+title: Sticky 吸顶
+description: 用于常驻页面顶部的信息、操作展示。
+spline: data
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-sticky": "tdesign-miniprogram/sticky/sticky"
+}
+```
+
+## 代码演示
+
+将内容包裹在 `Sticky` 组件内
+
+
+
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础吸顶
+
+{{ base }}
+
+
+### 吸顶距离
+
+{{ offset }}
+
+### 指定容器
+
+{{ container }}
+
+
+
+## API
+
+### Sticky Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+container | Function | - | 函数返回容器对应的 NodesRef 节点,将对应节点指定为组件的外部容器,滚动时组件会始终保持在容器范围内,当组件即将超出容器底部时,会返回原位置。 | N
+disabled | Boolean | false | 是否禁用组件 | N
+offset-top | String / Number | 0 | 吸顶时与顶部的距离,单位`px` | N
+z-index | Number | 99 | 吸顶时的 z-index | N
+
+### Sticky Events
+
+名称 | 参数 | 描述
+-- | -- | --
+scroll | `(detail: { scrollTop: number, isFixed: boolean })` | 滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
+### Sticky External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-content | 内容样式类
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts
new file mode 100644
index 0000000..a6df66d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './sticky';
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/index.js b/miniprogram_npm/tdesign-miniprogram/sticky/index.js
new file mode 100644
index 0000000..a6df66d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './sticky';
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts
new file mode 100644
index 0000000..175af72
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts
@@ -0,0 +1,3 @@
+import { TdStickyProps } from './type';
+declare const props: TdStickyProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/props.js b/miniprogram_npm/tdesign-miniprogram/sticky/props.js
new file mode 100644
index 0000000..6dcdf7c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/props.js
@@ -0,0 +1,18 @@
+const props = {
+ container: {
+ type: null,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ offsetTop: {
+ type: null,
+ value: 0,
+ },
+ zIndex: {
+ type: Number,
+ value: 99,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts
new file mode 100644
index 0000000..89ba546
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts
@@ -0,0 +1,30 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdStickyProps } from './type';
+export interface StickyProps extends TdStickyProps {
+}
+export default class Sticky extends SuperComponent {
+ externalClasses: string[];
+ properties: TdStickyProps;
+ behaviors: string[];
+ observers: {
+ 'offsetTop, disabled, container'(): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ containerStyle: string;
+ contentStyle: string;
+ };
+ ready(): void;
+ methods: {
+ onScroll(event?: {
+ scrollTop: number;
+ }): void;
+ setDataAfterDiff(data: {
+ isFixed: boolean;
+ height?: number;
+ transform?: number;
+ }): void;
+ getContainerRect(): Promise;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.js b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.js
new file mode 100644
index 0000000..a71da33
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.js
@@ -0,0 +1,116 @@
+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 props from './props';
+import config from '../common/config';
+import pageScrollMixin from '../mixins/page-scroll';
+import { getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-sticky`;
+const ContainerClass = `.${name}`;
+let Sticky = class Sticky extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
+ this.properties = props;
+ this.behaviors = [pageScrollMixin()];
+ this.observers = {
+ 'offsetTop, disabled, container'() {
+ this.onScroll();
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ containerStyle: '',
+ contentStyle: '',
+ };
+ this.methods = {
+ onScroll(event) {
+ const { scrollTop } = event || {};
+ const { container, offsetTop, disabled } = this.properties;
+ if (disabled) {
+ this.setDataAfterDiff({
+ isFixed: false,
+ transform: 0,
+ });
+ return;
+ }
+ this.scrollTop = scrollTop || this.scrollTop;
+ if (typeof container === 'function') {
+ Promise.all([getRect(this, ContainerClass), this.getContainerRect()]).then(([root, container]) => {
+ if (!root || !container)
+ return;
+ if (offsetTop + root.height > container.height + container.top) {
+ this.setDataAfterDiff({
+ isFixed: false,
+ transform: container.height - root.height,
+ });
+ }
+ else if (offsetTop >= root.top) {
+ this.setDataAfterDiff({
+ isFixed: true,
+ height: root.height,
+ transform: 0,
+ });
+ }
+ else {
+ this.setDataAfterDiff({ isFixed: false, transform: 0 });
+ }
+ });
+ return;
+ }
+ getRect(this, ContainerClass).then((root) => {
+ if (!root)
+ return;
+ if (offsetTop >= root.top) {
+ this.setDataAfterDiff({ isFixed: true, height: root.height });
+ this.transform = 0;
+ }
+ else {
+ this.setDataAfterDiff({ isFixed: false });
+ }
+ });
+ },
+ setDataAfterDiff(data) {
+ const { offsetTop } = this.properties;
+ const { containerStyle: prevContainerStyle, contentStyle: prevContentStyle } = this.data;
+ const { isFixed, height, transform } = data;
+ wx.nextTick(() => {
+ let containerStyle = '';
+ let contentStyle = '';
+ if (isFixed) {
+ containerStyle += `height:${height}px;`;
+ contentStyle += `position:fixed;top:${offsetTop}px;left:0;right:0;`;
+ }
+ if (transform) {
+ const translate = `translate3d(0, ${transform}px, 0)`;
+ contentStyle += `-webkit-transform:${translate};transform:${translate};`;
+ }
+ if (prevContainerStyle !== containerStyle || prevContentStyle !== contentStyle) {
+ this.setData({ containerStyle, contentStyle });
+ }
+ this.triggerEvent('scroll', {
+ scrollTop: this.scrollTop,
+ isFixed,
+ });
+ });
+ },
+ getContainerRect() {
+ const nodesRef = this.properties.container();
+ return new Promise((resolve) => nodesRef.boundingClientRect(resolve).exec());
+ },
+ };
+ }
+ ready() {
+ this.onScroll();
+ }
+};
+Sticky = __decorate([
+ wxComponent()
+], Sticky);
+export default Sticky;
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.json b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml
new file mode 100644
index 0000000..eb83eca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss
new file mode 100644
index 0000000..9a1af97
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss
@@ -0,0 +1,30 @@
+.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-sticky {
+ position: relative;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts
new file mode 100644
index 0000000..36195d9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts
@@ -0,0 +1,18 @@
+export interface TdStickyProps {
+ container?: {
+ type: undefined;
+ value?: null;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ offsetTop?: {
+ type: null;
+ value?: string | number;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/type.js b/miniprogram_npm/tdesign-miniprogram/sticky/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/swipe-cell/README.en-US.md
new file mode 100644
index 0000000..125897b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/README.en-US.md
@@ -0,0 +1,22 @@
+:: BASE_DOC ::
+
+## API
+
+### SwipeCell 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
+disabled | Boolean | - | \- | N
+left | Array / Slot | - | Typescript:`Array` | N
+opened | Boolean / Array | false | Typescript:`boolean \| Array` | N
+right | Array / Slot | - | Typescript:`Array` `interface SwipeActionItem {text?: string; icon?: string \| object, className?: string; style?: string; onClick?: () => void; [key: string]: any }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swipe-cell/type.ts) | N
+
+### SwipeCell Events
+
+name | params | description
+-- | -- | --
+click | `(action: SwipeActionItem, source: SwipeSource)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swipe-cell/type.ts)。
`type SwipeSource = 'left' \| 'right'`
+dragend | \- | \-
+dragstart | \- | \-
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/README.md b/miniprogram_npm/tdesign-miniprogram/swipe-cell/README.md
new file mode 100644
index 0000000..73ab66e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/README.md
@@ -0,0 +1,69 @@
+---
+title: SwipeCell 滑动操作
+description: 用于承载列表中的更多操作,通过左右滑动来展示,按钮的宽度固定高度根据列表高度而变化。
+spline: message
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+左滑单操作
+
+{{ left }}
+
+右滑单操作
+
+{{ right }}
+
+左右滑操作
+
+{{ double }}
+
+带图标的滑动操作
+
+{{ icon }}
+
+## API
+
+### SwipeCell Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+disabled | Boolean | - | 是否禁用滑动 | N
+left | Array / Slot | - | 左侧滑动操作项。所有行为同 `right`。TS 类型:`Array` | N
+opened | Boolean / Array | false | 操作项是否呈现为打开态,值为数组时表示分别控制左右滑动的展开和收起状态。TS 类型:`boolean \| Array` | N
+right | Array / Slot | - | 右侧滑动操作项。有两种定义方式,一种是使用数组,二种是使用插槽。`right.text` 表示操作文本,`right.className` 表示操作项类名,`right.style` 表示操作项样式,`right.onClick` 表示点击操作项后执行的回调函数。示例:`[{ text: '删除', icon: 'delete', style: 'background-color: red', onClick: () => {} }]`。TS 类型:`Array` `interface SwipeActionItem {text?: string; icon?: string \| object, className?: string; style?: string; onClick?: () => void; [key: string]: any }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swipe-cell/type.ts) | N
+
+### SwipeCell Events
+
+名称 | 参数 | 描述
+-- | -- | --
+click | `(action: SwipeActionItem, source: SwipeSource)` | 操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swipe-cell/type.ts)。
`type SwipeSource = 'left' \| 'right'`
+dragend | \- | 滑动结束事件
+dragstart | \- | 滑动开始事件
+
+## FAQ
+### `SwipeCell` 组件在真机上无法滑动?
+移除全局配置项: "componentFramework": "glass-easel",详情见: [issue 2524](https://github.com/Tencent/tdesign-miniprogram/issues/2524)。如需使用 `skyline render`,建议页面级粒度开启。
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/props.d.ts b/miniprogram_npm/tdesign-miniprogram/swipe-cell/props.d.ts
new file mode 100644
index 0000000..9a3159c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSwipeCellProps } from './type';
+declare const props: TdSwipeCellProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/props.js b/miniprogram_npm/tdesign-miniprogram/swipe-cell/props.js
new file mode 100644
index 0000000..da087a2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/props.js
@@ -0,0 +1,20 @@
+const props = {
+ disabled: {
+ type: Boolean,
+ },
+ left: {
+ type: Array,
+ },
+ opened: {
+ type: null,
+ value: false,
+ },
+ right: {
+ type: Array,
+ },
+ style: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.d.ts b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.d.ts
new file mode 100644
index 0000000..8faa283
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.d.ts
@@ -0,0 +1,31 @@
+import { SuperComponent } from '../common/src/index';
+export default class SwiperCell extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdSwipeCellProps;
+ data: {
+ prefix: string;
+ wrapperStyle: string;
+ closed: boolean;
+ classPrefix: string;
+ skipMove: boolean;
+ };
+ observers: {
+ 'left, right'(): void;
+ };
+ lifetimes: {
+ attached(): void;
+ ready(): void;
+ detached(): void;
+ };
+ setSwipeWidth(): void;
+ skipMove(): void;
+ catchMove(): void;
+ open(): void;
+ close(): void;
+ closeOther(): void;
+ onTap(): void;
+ onActionTap(event: any): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.js b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.js
new file mode 100644
index 0000000..cd109af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.js
@@ -0,0 +1,92 @@
+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 { getRect } from '../common/utils';
+import { getObserver } from '../common/wechat';
+let ARRAY = [];
+const { prefix } = config;
+const name = `${prefix}-swipe-cell`;
+const ContainerClass = `.${name}`;
+let SwiperCell = class SwiperCell extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ wrapperStyle: '',
+ closed: true,
+ classPrefix: name,
+ skipMove: false,
+ };
+ this.observers = {
+ 'left, right'() {
+ this.setSwipeWidth();
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ ARRAY.push(this);
+ },
+ ready() {
+ this.setSwipeWidth();
+ },
+ detached() {
+ ARRAY = ARRAY.filter((item) => item !== this);
+ },
+ };
+ }
+ setSwipeWidth() {
+ Promise.all([getRect(this, `${ContainerClass}__left`), getRect(this, `${ContainerClass}__right`)]).then(([leftRect, rightRect]) => {
+ if (leftRect.width === 0 && rightRect.width === 0 && !this._hasObserved) {
+ this._hasObserved = true;
+ getObserver(this, `.${name}`).then(() => {
+ this.setSwipeWidth();
+ });
+ }
+ this.setData({
+ leftWidth: leftRect.width,
+ rightWidth: rightRect.width,
+ });
+ });
+ }
+ skipMove() {
+ if (!this.data.skipMove) {
+ this.setData({ skipMove: true });
+ }
+ }
+ catchMove() {
+ if (this.data.skipMove) {
+ this.setData({ skipMove: false });
+ }
+ }
+ open() {
+ this.setData({ opened: true });
+ }
+ close() {
+ this.setData({ opened: false });
+ }
+ closeOther() {
+ ARRAY.filter((item) => item !== this).forEach((item) => item.close());
+ }
+ onTap() {
+ this.close();
+ }
+ onActionTap(event) {
+ const { currentTarget: { dataset: { action }, }, } = event;
+ this.triggerEvent('click', action);
+ }
+};
+SwiperCell = __decorate([
+ wxComponent()
+], SwiperCell);
+export default SwiperCell;
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.json b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.json
new file mode 100644
index 0000000..f783dae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxml b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxml
new file mode 100644
index 0000000..fefbed0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxs b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxs
new file mode 100644
index 0000000..14efbf6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxs
@@ -0,0 +1,185 @@
+var THRESHOLD = 0.3;
+var MIN_DISTANCE = 10;
+var owner;
+var state;
+
+var getState = function (ownerInstance) {
+ owner = ownerInstance;
+ state = owner.getState();
+ state.leftWidth = state.leftWidth || 0;
+ state.rightWidth = state.rightWidth || 0;
+ state.offset = state.offset || 0;
+ state.startOffset = state.startOffset || 0;
+ state.opened = state.opened || false;
+};
+
+var initRightWidth = function (newVal, oldVal, ownerInstance) {
+ getState(ownerInstance);
+ state.rightWidth = newVal;
+ initOpen(ownerInstance);
+};
+
+var initLeftWidth = function (newVal, oldVal, ownerInstance) {
+ getState(ownerInstance);
+ state.leftWidth = newVal;
+ initOpen(ownerInstance);
+};
+
+var initOpen = function (ownerInstance) {
+ getState(ownerInstance);
+ if (state.opened.constructor === 'Boolean') {
+ // opened为boolean类型,判断默认打开
+ if (state.opened && state.rightWidth > 0) {
+ swipeMove(-state.rightWidth);
+ } else if (state.opened && state.leftWidth > 0) {
+ swipeMove(state.leftWidth);
+ }
+ }
+
+ if (state.opened.constructor === 'Array') {
+ // opened为array类型,判断默认打开,同时设定左右action时优先打开右边
+ if (state.opened[1] && state.rightWidth > 0) {
+ swipeMove(-state.rightWidth);
+ } else if (state.opened[0] && state.leftWidth > 0) {
+ swipeMove(state.leftWidth);
+ }
+ }
+};
+
+var resetTouchStatus = function () {
+ state.direction = '';
+ state.deltaX = 0;
+ state.deltaY = 0;
+ state.offsetX = 0;
+ state.offsetY = 0;
+};
+
+var touchMove = function (event) {
+ var touchPoint = event.touches[0];
+ state.deltaX = touchPoint.clientX - state.startX;
+ state.deltaY = touchPoint.clientY - state.startY;
+ state.offsetX = Math.abs(state.deltaX);
+ state.offsetY = Math.abs(state.deltaY);
+ state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
+};
+
+var getDirection = function (x, y) {
+ if (x > y && x > MIN_DISTANCE) {
+ return 'horizontal';
+ }
+ if (y > x && y > MIN_DISTANCE) {
+ return 'vertical';
+ }
+ return '';
+};
+
+var range = function (num, min, max) {
+ return Math.min(Math.max(num, min), max);
+};
+
+var swipeMove = function (_offset) {
+ if (_offset === undefined) _offset = 0;
+ state.offset = range(_offset, -state.rightWidth, +state.leftWidth);
+ var transform = 'translate3d(' + state.offset + 'px, 0, 0)';
+ var transition = state.dragging ? 'none' : 'transform .6s cubic-bezier(0.18, 0.89, 0.32, 1)';
+ owner.selectComponent('#wrapper').setStyle({
+ '-webkit-transform': transform,
+ '-webkit-transition': transition,
+ transform: transform,
+ transition: transition,
+ });
+};
+
+var close = function () {
+ swipeMove(0);
+};
+
+var onCloseChange = function (newVal, oldVal, ownerInstance) {
+ getState(ownerInstance);
+ if (newVal === oldVal) return;
+ if (newVal) {
+ close();
+ }
+};
+
+var onOpenedChange = function (newVal, oldVal, ownerInstance) {
+ getState(ownerInstance);
+ state.opened = newVal;
+ if (newVal === oldVal) return;
+ if (!newVal) {
+ close();
+ }
+};
+
+var touchStart = function (event) {
+ resetTouchStatus();
+ state.startOffset = state.offset;
+ var touchPoint = event.touches[0];
+ state.startX = touchPoint.clientX;
+ state.startY = touchPoint.clientY;
+ owner.callMethod('closeOther');
+};
+
+var startDrag = function (event, ownerInstance) {
+ ownerInstance.callMethod('catchMove');
+ getState(ownerInstance);
+ touchStart(event);
+};
+
+var onDrag = function (event, ownerInstance) {
+ getState(ownerInstance);
+ touchMove(event);
+ if (state.direction === 'vertical') {
+ ownerInstance.callMethod('skipMove');
+ }
+ if (state.direction !== 'horizontal') {
+ return;
+ }
+ if (!state.dragging) {
+ ownerInstance.triggerEvent('dragstart');
+ }
+ state.dragging = true;
+ swipeMove(state.startOffset + state.deltaX);
+ return false;
+};
+
+var open = function (position) {
+ var _offset = position === 'left' ? +state.leftWidth : -state.rightWidth;
+ owner.callMethod('open', { position: position });
+ swipeMove(_offset);
+};
+
+var endDrag = function (event, ownerInstance) {
+ getState(ownerInstance);
+ state.dragging = false;
+ // 左/右侧有可滑动区域,且当前不是已open状态,且滑动幅度超过阈值时open左/右侧(滚动到该侧的最边上)
+ if (
+ +state.rightWidth > 0 &&
+ -state.startOffset < +state.rightWidth &&
+ -state.offset > +state.rightWidth * THRESHOLD
+ ) {
+ open('right');
+ } else if (
+ +state.leftWidth > 0 &&
+ state.startOffset < +state.leftWidth &&
+ state.offset > +state.leftWidth * THRESHOLD
+ ) {
+ open('left');
+ } else {
+ // 仅在有发生侧滑的情况下自动关闭(由js控制是否异步关闭)
+ if (state.startOffset !== state.offset) {
+ close();
+ }
+ }
+ ownerInstance.triggerEvent('dragend');
+};
+
+module.exports = {
+ initLeftWidth: initLeftWidth,
+ initRightWidth: initRightWidth,
+ startDrag: startDrag,
+ onDrag: onDrag,
+ endDrag: endDrag,
+ onCloseChange: onCloseChange,
+ onOpenedChange: onOpenedChange,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxss b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxss
new file mode 100644
index 0000000..7ad58b2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/swipe-cell.wxss
@@ -0,0 +1,59 @@
+.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-swipe-cell {
+ position: relative;
+ overflow: hidden;
+}
+.t-swipe-cell__left,
+.t-swipe-cell__right {
+ position: absolute;
+ top: 0;
+ height: 100%;
+}
+.t-swipe-cell__left {
+ left: 0;
+ transform: translate3d(-100%, 0, 0);
+}
+.t-swipe-cell__right {
+ right: 0;
+ transform: translate3d(100%, 0, 0);
+}
+.t-swipe-cell__content {
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
+ padding: 0 var(--td-spacer-2, 32rpx);
+}
+.t-swipe-cell__icon {
+ font-size: var(--td-font-size-xl, 40rpx);
+}
+.t-swipe-cell__icon + .t-swipe-cell__text:not(:empty) {
+ margin-left: var(--td-spacer, 16rpx);
+ font-size: var(--td-font-size-base, 28rpx);
+ line-height: 44rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/type.d.ts b/miniprogram_npm/tdesign-miniprogram/swipe-cell/type.d.ts
new file mode 100644
index 0000000..de819ce
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/type.d.ts
@@ -0,0 +1,30 @@
+export interface TdSwipeCellProps {
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ left?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ opened?: {
+ type: null;
+ value?: boolean | Array;
+ };
+ right?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
+export interface SwipeActionItem {
+ text?: string;
+ icon?: string | object;
+ className?: string;
+ style?: string;
+ onClick?: () => void;
+ [key: string]: any;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swipe-cell/type.js b/miniprogram_npm/tdesign-miniprogram/swipe-cell/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swipe-cell/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/index.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper-nav/index.d.ts
new file mode 100644
index 0000000..5dcaf6b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/index.d.ts
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './swiper-nav';
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/index.js b/miniprogram_npm/tdesign-miniprogram/swiper-nav/index.js
new file mode 100644
index 0000000..5dcaf6b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/index.js
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './swiper-nav';
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/props.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper-nav/props.d.ts
new file mode 100644
index 0000000..70971ea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSwiperNavProps } from './type';
+declare const props: TdSwiperNavProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/props.js b/miniprogram_npm/tdesign-miniprogram/swiper-nav/props.js
new file mode 100644
index 0000000..04f2f55
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/props.js
@@ -0,0 +1,31 @@
+const props = {
+ current: {
+ type: Number,
+ value: 0,
+ },
+ direction: {
+ type: String,
+ value: 'horizontal',
+ },
+ minShowNum: {
+ type: Number,
+ value: 2,
+ },
+ paginationPosition: {
+ type: String,
+ value: 'bottom',
+ },
+ showControls: {
+ type: Boolean,
+ value: false,
+ },
+ total: {
+ type: Number,
+ value: 0,
+ },
+ type: {
+ type: String,
+ value: 'dots',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.d.ts
new file mode 100644
index 0000000..ce01166
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.d.ts
@@ -0,0 +1,45 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+import { TdSwiperNavProps } from './type';
+export interface SwiperNavProps extends TdSwiperNavProps {
+}
+export default class SwiperNav extends SuperComponent {
+ externalClasses: string[];
+ properties: {
+ current: {
+ type: NumberConstructor;
+ value: number;
+ };
+ total: {
+ type: NumberConstructor;
+ value: number;
+ };
+ type: {
+ type: StringConstructor;
+ value: string;
+ };
+ minShowNum: {
+ type: NumberConstructor;
+ value: number;
+ };
+ showControls: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
+ direction: {
+ type: StringConstructor;
+ value: string;
+ };
+ paginationPosition: {
+ type: StringConstructor;
+ value: string;
+ };
+ };
+ relations: RelationsOptions;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ methods: {
+ nav(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.js b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.js
new file mode 100644
index 0000000..991c5af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.js
@@ -0,0 +1,70 @@
+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';
+const { prefix } = config;
+const name = `${prefix}-swiper-nav`;
+let SwiperNav = class SwiperNav extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = {
+ current: {
+ type: Number,
+ value: 0,
+ },
+ total: {
+ type: Number,
+ value: 0,
+ },
+ type: {
+ type: String,
+ value: 'dots',
+ },
+ minShowNum: {
+ type: Number,
+ value: 2,
+ },
+ showControls: {
+ type: Boolean,
+ value: false,
+ },
+ direction: {
+ type: String,
+ value: 'horizontal',
+ },
+ paginationPosition: {
+ type: String,
+ value: 'bottom',
+ },
+ };
+ this.relations = {
+ '../swiper/swiper': {
+ type: 'parent',
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.methods = {
+ nav(e) {
+ var _a;
+ const { dir } = e.target.dataset;
+ const source = 'nav';
+ this.triggerEvent('nav-btn-change', { dir, source });
+ if (this.$parent) {
+ (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.doNavBtnChange(dir, source);
+ }
+ },
+ };
+ }
+};
+SwiperNav = __decorate([
+ wxComponent()
+], SwiperNav);
+export default SwiperNav;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.json b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.json
new file mode 100644
index 0000000..79f2730
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared"
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.wxml b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.wxml
new file mode 100644
index 0000000..0598edb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.wxss b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.wxss
new file mode 100644
index 0000000..a5fd6a4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/swiper-nav.wxss
@@ -0,0 +1,158 @@
+.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-swiper-nav__dots,
+.t-swiper-nav__dots-bar {
+ display: flex;
+ flex-direction: row;
+}
+.t-swiper-nav__dots-item,
+.t-swiper-nav__dots-bar-item {
+ width: var(--td-swiper-nav-dot-size, 12rpx);
+ height: var(--td-swiper-nav-dot-size, 12rpx);
+ background: var(--td-swiper-nav-dot-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
+ border-radius: 50%;
+ margin: 0 10rpx;
+ transition: all 0.4s ease-in;
+}
+.t-swiper-nav__dots-item--vertical,
+.t-swiper-nav__dots-bar-item--vertical {
+ margin: 10rpx 0;
+}
+.t-swiper-nav__dots-item--active,
+.t-swiper-nav__dots-bar-item--active {
+ background-color: var(--td-swiper-nav-dot-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-swiper-nav__dots-bar-item--vertical.t-swiper-nav__dots-bar-item--active {
+ width: var(--td-swiper-nav-dot-size, 12rpx);
+ height: var(--td-swiper-nav-dots-bar-active-width, 40rpx);
+}
+.t-swiper-nav__dots-bar-item--active {
+ width: var(--td-swiper-nav-dots-bar-active-width, 40rpx);
+ border-radius: calc(var(--td-swiper-nav-dot-size, 12rpx) / 2);
+ background-color: var(--td-swiper-nav-dot-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+}
+.t-swiper-nav--left {
+ position: absolute;
+ left: 24rpx;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-swiper-nav--right {
+ position: absolute;
+ right: 24rpx;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-swiper-nav--top-left {
+ position: absolute;
+ top: 24rpx;
+ left: 24rpx;
+}
+.t-swiper-nav--top {
+ position: absolute;
+ left: 50%;
+ top: 24rpx;
+ transform: translateX(-50%);
+}
+.t-swiper-nav--top-right {
+ position: absolute;
+ top: 24rpx;
+ right: 24rpx;
+}
+.t-swiper-nav--bottom-left {
+ position: absolute;
+ left: 24rpx;
+ bottom: 24rpx;
+}
+.t-swiper-nav--bottom {
+ position: absolute;
+ left: 50%;
+ bottom: 24rpx;
+ transform: translateX(-50%);
+}
+.t-swiper-nav--bottom-right {
+ position: absolute;
+ right: 24rpx;
+ bottom: 24rpx;
+}
+.t-swiper-nav--vertical {
+ flex-direction: column;
+}
+.t-swiper-nav__fraction {
+ padding: 0 16rpx;
+ height: var(--td-swiper-nav-fraction-height, 48rpx);
+ line-height: var(--td-swiper-nav-fraction-height, 48rpx);
+ border-radius: calc(var(--td-swiper-nav-fraction-height, 48rpx) / 2);
+ background: var(--td-swiper-nav-fraction-bg-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+ color: var(--td-swiper-nav-fraction-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ font-size: var(--td-swiper-nav-fraction-font-size, 24rpx);
+}
+.t-swiper-nav__btn {
+ width: 100%;
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-swiper-nav__btn--prev,
+.t-swiper-nav__btn--next {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+ width: var(--td-swiper-nav-btn-size, 48rpx);
+ height: var(--td-swiper-nav-btn-size, 48rpx);
+ border-radius: 50%;
+ background: var(--td-swiper-nav-btn-bg-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+}
+.t-swiper-nav__btn--prev::after,
+.t-swiper-nav__btn--next::after {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ display: block;
+ content: '';
+ width: 12rpx;
+ height: 12rpx;
+ border-color: var(--td-swiper-nav-btn-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ border-style: solid;
+}
+.t-swiper-nav__btn--prev {
+ left: 30rpx;
+}
+.t-swiper-nav__btn--prev::after {
+ margin-left: 4rpx;
+ border-width: 2rpx 0 0 2rpx;
+ transform: translate(-50%, -50%) rotateZ(-45deg);
+}
+.t-swiper-nav__btn--next {
+ right: 30rpx;
+}
+.t-swiper-nav__btn--next::after {
+ margin-left: -4rpx;
+ border-width: 2rpx 2rpx 0 0;
+ transform: translate(-50%, -50%) rotateZ(45deg);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/type.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper-nav/type.d.ts
new file mode 100644
index 0000000..5fa2712
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/type.d.ts
@@ -0,0 +1,31 @@
+export interface TdSwiperNavProps {
+ current?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ direction?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ minShowNum?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ paginationPosition?: {
+ type: StringConstructor;
+ value?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right';
+ };
+ showControls?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ total?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ type?: {
+ type: StringConstructor;
+ value?: SwiperNavigationType;
+ };
+}
+export declare type SwiperNavigationType = 'dots' | 'dots-bar' | 'fraction';
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper-nav/type.js b/miniprogram_npm/tdesign-miniprogram/swiper-nav/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper-nav/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/swiper/README.en-US.md
new file mode 100644
index 0000000..684aa8f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/README.en-US.md
@@ -0,0 +1,82 @@
+:: BASE_DOC ::
+
+## API
+
+### Swiper 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
+autoplay | Boolean | true | \- | N
+current | Number | 0 | \- | N
+direction | String | horizontal | options: horizontal/vertical | N
+display-multiple-items | Number | 1 | `0.32.0` | N
+duration | Number | 300 | \- | N
+easing-function | String | default | `0.32.0`。options: default/linear/easeInCubic/easeOutCubic/easeInOutCubic | N
+height | String / Number | 192 | \- | N
+image-props | Object | - | `0.34.0` | N
+interval | Number | 5000 | \- | N
+list | Array | - | `0.32.0`。Typescript:`string[] \| SwiperList[]` `interface SwiperList { value: string, ariaLabel: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper/type.ts) | N
+loop | Boolean | true | \- | N
+navigation | Boolean / Object / Slot | true | Typescript:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper/type.ts) | N
+next-margin | String / Number | 0 | `0.32.0` | N
+pagination-position | String | bottom | options: top-left/top/top-right/bottom-left/bottom/bottom-right | N
+previous-margin | String / Number | 0 | `0.32.0` | N
+snap-to-edge | Boolean | false | `0.32.0` | N
+
+### Swiper Events
+
+name | params | description
+-- | -- | --
+change | `(current: number, source: SwiperChangeSource)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`
+click | `(index: number)` | `0.34.0`
+image-load | `(index: number)` | `1.1.4`
+### Swiper External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-image | \-
+t-class-nav | \-
+t-class-next-image | \-
+t-class-prev-image | \-
+
+
+### SwiperNav 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
+current | Number | 0 | `0.34.0` | N
+direction | String | horizontal | `0.34.0`。options: horizontal/vertical | N
+min-show-num | Number | 2 | \- | N
+pagination-position | String | bottom | `0.34.0`。options: top-left/top/top-right/bottom-left/bottom/bottom-right | N
+show-controls | Boolean | false | `0.32.0` | N
+total | Number | 0 | `0.34.0` | N
+type | String | dots | Typescript:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper-nav/type.ts) | N
+### SwiperNav 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-swiper-item-padding | 0 | -
+--td-swiper-radius | @radius-large | -
+--td-swiper-nav-btn-bg-color | @font-gray-3 | -
+--td-swiper-nav-btn-color | @font-white-1 | -
+--td-swiper-nav-btn-size | 48rpx | -
+--td-swiper-nav-dot-active-color | @font-white-1 | -
+--td-swiper-nav-dot-color | @font-white-2 | -
+--td-swiper-nav-dot-size | 12rpx | -
+--td-swiper-nav-dots-bar-active-width | 40rpx | -
+--td-swiper-nav-fraction-bg-color | @font-gray-3 | -
+--td-swiper-nav-fraction-color | @font-white-1 | -
+--td-swiper-nav-fraction-font-size | 24rpx | -
+--td-swiper-nav-fraction-height | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/README.md b/miniprogram_npm/tdesign-miniprogram/swiper/README.md
new file mode 100644
index 0000000..8ddfb4b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/README.md
@@ -0,0 +1,144 @@
+---
+title: Swiper 轮播图
+description: 用于循环轮播一组图片或内容,也可以滑动进行切换,轮播动效时间可以设置。
+spline: message
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-swiper": "tdesign-miniprogram/swiper/swiper",
+ "t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav",
+}
+```
+
+### 组件说明
+
+从 `0.32.0` 版本开始,依赖原生 `swiper` 组件实现,移除了 `swiper-item` 组件,新增了 `list` 属性;
+
+## 代码演示
+
+多种轮播样式,通过 `navigation` 设置导航样式,没有值则不显示,也可以自定义 `nav` 组件
+
+
+
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+#### 点状(dots)轮播图
+
+{{ base }}
+
+#### 点条状(dots-bar)轮播图
+
+{{ custom }}
+
+#### 分式(fraction)导航器轮播图
+
+{{ fraction }}
+
+#### 切换按钮(controls)轮播图
+
+{{ nav-btn }}
+
+#### 卡片式(cards)轮播图
+
+{{ cards }}
+
+### 组件样式
+
+#### 垂直模式
+
+{{ vertical }}
+
+## API
+
+### Swiper Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+autoplay | Boolean | true | 是否自动播放 | N
+current | Number | 0 | 当前轮播在哪一项(下标) | N
+direction | String | horizontal | 轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
+display-multiple-items | Number | 1 | `0.32.0`。同时显示的滑块数量 | N
+duration | Number | 300 | 滑动动画时长 | N
+easing-function | String | default | `0.32.0`。指定 swiper 切换缓动动画类型。可选项:default/linear/easeInCubic/easeOutCubic/easeInOutCubic | N
+height | String / Number | 192 | 轮播的高度;默认单位 `px` | N
+image-props | Object | - | `0.34.0`。透传至 Image 组件 | N
+interval | Number | 5000 | 轮播间隔时间 | N
+list | Array | - | `0.32.0`。图片列表。TS 类型:`string[] \| SwiperList[]` `interface SwiperList { value: string, ariaLabel: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper/type.ts) | N
+loop | Boolean | true | 是否循环播放 | N
+navigation | Boolean / Object / Slot | true | 导航器全部配置,true 的话使用默认配置。TS 类型:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper/type.ts) | N
+next-margin | String / Number | 0 | `0.32.0`。后边距,可用于露出后一项的一小部分。默认单位 `px` | N
+pagination-position | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right | N
+previous-margin | String / Number | 0 | `0.32.0`。前边距,可用于露出前一项的一小部分。默认单位 `px` | N
+snap-to-edge | Boolean | false | `0.32.0`。当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素 | N
+
+### Swiper Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(current: number, source: SwiperChangeSource)` | 轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`
+click | `(index: number)` | `0.34.0`。点击轮播项时触发
+image-load | `(index: number)` | `1.1.4`。图片加载时触发
+### Swiper External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-image | 当前图片样式类
+t-class-nav | 导航样式类
+t-class-next-image | 下一图片样式类
+t-class-prev-image | 上一图片样式类
+
+
+### SwiperNav Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+current | Number | 0 | `0.34.0`。当前轮播在哪一项(下标) | N
+direction | String | horizontal | `0.34.0`。轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
+min-show-num | Number | 2 | 小于这个数字不会显示导航器 | N
+pagination-position | String | bottom | `0.34.0`。页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right | N
+show-controls | Boolean | false | `0.32.0`。是否显示两侧的控制按钮 | N
+total | Number | 0 | `0.34.0`。总共的项数 | N
+type | String | dots | 导航器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等。TS 类型:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper-nav/type.ts) | N
+### SwiperNav External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-swiper-item-padding | 0 | -
+--td-swiper-radius | @radius-large | -
+--td-swiper-nav-btn-bg-color | @font-gray-3 | -
+--td-swiper-nav-btn-color | @font-white-1 | -
+--td-swiper-nav-btn-size | 48rpx | -
+--td-swiper-nav-dot-active-color | @font-white-1 | -
+--td-swiper-nav-dot-color | @font-white-2 | -
+--td-swiper-nav-dot-size | 12rpx | -
+--td-swiper-nav-dots-bar-active-width | 40rpx | -
+--td-swiper-nav-fraction-bg-color | @font-gray-3 | -
+--td-swiper-nav-fraction-color | @font-white-1 | -
+--td-swiper-nav-fraction-font-size | 24rpx | -
+--td-swiper-nav-fraction-height | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/index.wxs b/miniprogram_npm/tdesign-miniprogram/swiper/index.wxs
new file mode 100644
index 0000000..41eca3d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/index.wxs
@@ -0,0 +1,25 @@
+function isPrev(current, index, list) {
+ return (current - 1 + list.length) % list.length === index;
+}
+
+function isNext(current, index, list) {
+ return (current + 1 + list.length) % list.length === index;
+}
+
+function getImageClass(prefix, current, index, list) {
+ var arr = [prefix + '-swiper__image-host', prefix + '-swiper__image', prefix + '-class-image'];
+
+ if (isPrev(current, index, list)) {
+ arr.push(prefix + '-class-prev-image');
+ }
+
+ if (isNext(current, index, list)) {
+ arr.push(prefix + '-class-next-image');
+ }
+
+ return arr.join(' ');
+}
+
+module.exports.isPrev = isPrev;
+module.exports.isNext = isNext;
+module.exports.getImageClass = getImageClass;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/props.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper/props.d.ts
new file mode 100644
index 0000000..399c9af
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSwiperProps } from './type';
+declare const props: TdSwiperProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/props.js b/miniprogram_npm/tdesign-miniprogram/swiper/props.js
new file mode 100644
index 0000000..84d0499
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/props.js
@@ -0,0 +1,65 @@
+const props = {
+ autoplay: {
+ type: Boolean,
+ value: true,
+ },
+ current: {
+ type: Number,
+ value: 0,
+ },
+ direction: {
+ type: String,
+ value: 'horizontal',
+ },
+ displayMultipleItems: {
+ type: Number,
+ value: 1,
+ },
+ duration: {
+ type: Number,
+ value: 300,
+ },
+ easingFunction: {
+ type: String,
+ value: 'default',
+ },
+ height: {
+ type: null,
+ value: 192,
+ },
+ imageProps: {
+ type: Object,
+ },
+ interval: {
+ type: Number,
+ value: 5000,
+ },
+ list: {
+ type: Array,
+ },
+ loop: {
+ type: Boolean,
+ value: true,
+ },
+ navigation: {
+ type: null,
+ value: true,
+ },
+ nextMargin: {
+ type: null,
+ value: 0,
+ },
+ paginationPosition: {
+ type: String,
+ value: 'bottom',
+ },
+ previousMargin: {
+ type: null,
+ value: 0,
+ },
+ snapToEdge: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/swiper.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.d.ts
new file mode 100644
index 0000000..e653a57
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.d.ts
@@ -0,0 +1,28 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Swiper extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdSwiperProps;
+ observers: {
+ navCurrent(v: any): void;
+ };
+ $nav: any;
+ relations: RelationsOptions;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ updateNav(currentValue: any): void;
+ onTap(e: any): void;
+ onChange(e: any): void;
+ onNavBtnChange(e: any): void;
+ doNavBtnChange(dir: any, source: any): void;
+ onImageLoad(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/swiper.js b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.js
new file mode 100644
index 0000000..1569741
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.js
@@ -0,0 +1,104 @@
+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}-swiper`;
+let Swiper = class Swiper extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-nav`,
+ `${prefix}-class-image`,
+ `${prefix}-class-prev-image`,
+ `${prefix}-class-next-image`,
+ ];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.observers = {
+ navCurrent(v) {
+ this.updateNav(v);
+ },
+ };
+ this.$nav = null;
+ this.relations = {
+ '../swiper-nav/swiper-nav': {
+ type: 'child',
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.lifetimes = {
+ ready() {
+ const { current } = this.properties;
+ this.setData({ navCurrent: current });
+ },
+ };
+ this.methods = {
+ updateNav(currentValue) {
+ var _a;
+ if (this.data.navigation)
+ return;
+ const $nav = (_a = this.getRelationNodes('./swiper-nav')) === null || _a === void 0 ? void 0 : _a[0];
+ if (!$nav)
+ return;
+ const { direction, paginationPosition, list } = this.properties;
+ $nav.setData({
+ current: currentValue,
+ total: list.length,
+ direction,
+ paginationPosition,
+ });
+ },
+ onTap(e) {
+ const { index } = e.currentTarget.dataset;
+ this.triggerEvent('click', { index });
+ },
+ onChange(e) {
+ const { current, source } = e.detail;
+ this.setData({
+ navCurrent: current,
+ });
+ this.triggerEvent('change', { current, source });
+ },
+ onNavBtnChange(e) {
+ const { dir, source } = e.detail;
+ this.doNavBtnChange(dir, source);
+ },
+ doNavBtnChange(dir, source) {
+ const { current, list, loop } = this.data;
+ const count = list.length;
+ let nextPos = dir === 'next' ? current + 1 : current - 1;
+ if (loop) {
+ nextPos = dir === 'next' ? (current + 1) % count : (current - 1 + count) % count;
+ }
+ else {
+ nextPos = nextPos < 0 || nextPos >= count ? current : nextPos;
+ }
+ if (nextPos === current)
+ return;
+ this.setData({
+ current: nextPos,
+ });
+ this.triggerEvent('change', { current: nextPos, source });
+ },
+ onImageLoad(e) {
+ this.triggerEvent('image-load', { index: e.target.dataset.custom });
+ },
+ };
+ }
+};
+Swiper = __decorate([
+ wxComponent()
+], Swiper);
+export default Swiper;
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/swiper.json b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.json
new file mode 100644
index 0000000..3989ca7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-swiper-nav": "../swiper-nav/swiper-nav",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/swiper.wxml b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.wxml
new file mode 100644
index 0000000..acc79a3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.wxml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/swiper.wxss b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.wxss
new file mode 100644
index 0000000..8695eed
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/swiper.wxss
@@ -0,0 +1,48 @@
+.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-swiper {
+ position: relative;
+}
+.t-swiper-host {
+ border-radius: var(--td-swiper-radius, var(--td-radius-large, 18rpx));
+ overflow: hidden;
+ transform: translateY(0);
+}
+.t-swiper__item {
+ display: flex;
+ align-items: center;
+ box-sizing: border-box;
+ padding: var(--td-swiper-item-padding, 0);
+}
+.t-swiper__image {
+ width: 100%;
+ transition: all 0.3s ease;
+}
+.t-swiper__image-host {
+ width: 100%;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/type.d.ts b/miniprogram_npm/tdesign-miniprogram/swiper/type.d.ts
new file mode 100644
index 0000000..2c4a1ce
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/type.d.ts
@@ -0,0 +1,71 @@
+import { SwiperNavProps } from '../swiper-nav/index';
+export interface TdSwiperProps {
+ autoplay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ current?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ direction?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ displayMultipleItems?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ easingFunction?: {
+ type: StringConstructor;
+ value?: 'default' | 'linear' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic';
+ };
+ height?: {
+ type: null;
+ value?: string | number;
+ };
+ imageProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ interval?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ list?: {
+ type: ArrayConstructor;
+ value?: string[] | SwiperList[];
+ };
+ loop?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ navigation?: {
+ type: null;
+ value?: SwiperNavProps | boolean;
+ };
+ nextMargin?: {
+ type: null;
+ value?: string | number;
+ };
+ paginationPosition?: {
+ type: StringConstructor;
+ value?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right';
+ };
+ previousMargin?: {
+ type: null;
+ value?: string | number;
+ };
+ snapToEdge?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
+export interface SwiperList {
+ value: string;
+ ariaLabel: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/swiper/type.js b/miniprogram_npm/tdesign-miniprogram/swiper/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/swiper/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md
new file mode 100644
index 0000000..1271e39
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md
@@ -0,0 +1,61 @@
+:: BASE_DOC ::
+
+## API
+
+### Switch 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
+custom-value | Array | [true, false] | Typescript:`Array` | N
+disabled | Boolean | undefined | \- | N
+icon | Array | [] | `0.27.0`。Typescript:`string[]` | N
+label | Array | [] | `0.27.0`。Typescript:`string[]` | N
+loading | Boolean | false | `0.27.0` | N
+size | String | medium | `0.27.0`。options: small/medium/large | N
+value | String / Number / Boolean | null | Typescript:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+default-value | String / Number / Boolean | undefined | uncontrolled property。Typescript:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+
+### Switch Events
+
+name | params | description
+-- | -- | --
+change | `(value: SwitchValue)` | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-switch-checked-color | @brand-color | -
+--td-switch-checked-disabled-color | @brand-color-disabled | -
+--td-switch-dot-border-color | @bg-color-secondarycontainer | -
+--td-switch-dot-horizontal-margin | 6rpx | -
+--td-switch-dot-large-size | 52rpx | -
+--td-switch-dot-plain-horizontal-margin | 10rpx | -
+--td-switch-dot-plain-large-size | 44rpx | -
+--td-switch-dot-plain-size | 36rpx | -
+--td-switch-dot-plain-small-size | 28rpx | -
+--td-switch-dot-shadow | @shadow-1 | -
+--td-switch-dot-size | 44rpx | -
+--td-switch-dot-small-size | 36rpx | -
+--td-switch-height | 56rpx | -
+--td-switch-icon-large-size | 48rpx | -
+--td-switch-icon-size | 40rpx | -
+--td-switch-icon-small-size | 32rpx | -
+--td-switch-label-checked-color | @switch-checked-color | -
+--td-switch-label-color | @font-gray-4 | -
+--td-switch-label-font-size | 28rpx | -
+--td-switch-label-large-font-size | 32rpx | -
+--td-switch-label-small-font-size | 24rpx | -
+--td-switch-large-height | 64rpx | -
+--td-switch-large-radius | calc(@switch-large-height / 2) | -
+--td-switch-large-width | 104rpx | -
+--td-switch-radius | calc(@switch-height / 2) | -
+--td-switch-small-height | 48rpx | -
+--td-switch-small-radius | calc(@switch-small-height / 2) | -
+--td-switch-small-width | 78rpx | -
+--td-switch-unchecked-color | @font-gray-4 | -
+--td-switch-unchecked-disabled-color | @bg-color-component-disabled | -
+--td-switch-width | 90rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/README.md b/miniprogram_npm/tdesign-miniprogram/switch/README.md
new file mode 100644
index 0000000..5bbc9c3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/README.md
@@ -0,0 +1,105 @@
+---
+title: Switch 开关
+description: 用于控制某个功能的开启和关闭。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-switch": "tdesign-miniprogram/switch/switch"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础开关
+
+{{ base }}
+
+### 带描述开关
+
+{{ label }}
+
+### 自定义颜色
+
+{{ color }}
+
+### 开关状态
+
+{{ status }}
+
+### 尺寸
+
+{{ size }}
+
+## API
+
+### Switch Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+custom-value | Array | [true, false] | 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close']。TS 类型:`Array` | N
+disabled | Boolean | undefined | 是否禁用组件。优先级:Switch.disabled > Form.disabled | N
+icon | Array | [] | `0.27.0`。开关的图标;[打开时的图标,关闭时的图标]。TS 类型:`string[]` | N
+label | Array | [] | `0.27.0`。开关的标签;[打开时的标签,关闭时的标签]。TS 类型:`string[]` | N
+loading | Boolean | false | `0.27.0`。是否处于加载中状态 | N
+size | String | medium | `0.27.0`。开关尺寸。可选项:small/medium/large | N
+value | String / Number / Boolean | null | 开关值。TS 类型:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+default-value | String / Number / Boolean | undefined | 开关值。非受控属性。TS 类型:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+
+### Switch Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: SwitchValue)` | 数据发生变化时触发
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-switch-checked-color | @brand-color | -
+--td-switch-checked-disabled-color | @brand-color-disabled | -
+--td-switch-dot-border-color | @bg-color-secondarycontainer | -
+--td-switch-dot-horizontal-margin | 6rpx | -
+--td-switch-dot-large-size | 52rpx | -
+--td-switch-dot-plain-horizontal-margin | 10rpx | -
+--td-switch-dot-plain-large-size | 44rpx | -
+--td-switch-dot-plain-size | 36rpx | -
+--td-switch-dot-plain-small-size | 28rpx | -
+--td-switch-dot-shadow | @shadow-1 | -
+--td-switch-dot-size | 44rpx | -
+--td-switch-dot-small-size | 36rpx | -
+--td-switch-height | 56rpx | -
+--td-switch-icon-large-size | 48rpx | -
+--td-switch-icon-size | 40rpx | -
+--td-switch-icon-small-size | 32rpx | -
+--td-switch-label-checked-color | @switch-checked-color | -
+--td-switch-label-color | @font-gray-4 | -
+--td-switch-label-font-size | 28rpx | -
+--td-switch-label-large-font-size | 32rpx | -
+--td-switch-label-small-font-size | 24rpx | -
+--td-switch-large-height | 64rpx | -
+--td-switch-large-radius | calc(@switch-large-height / 2) | -
+--td-switch-large-width | 104rpx | -
+--td-switch-radius | calc(@switch-height / 2) | -
+--td-switch-small-height | 48rpx | -
+--td-switch-small-radius | calc(@switch-small-height / 2) | -
+--td-switch-small-width | 78rpx | -
+--td-switch-unchecked-color | @font-gray-4 | -
+--td-switch-unchecked-disabled-color | @bg-color-component-disabled | -
+--td-switch-width | 90rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/props.d.ts b/miniprogram_npm/tdesign-miniprogram/switch/props.d.ts
new file mode 100644
index 0000000..489f18a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSwitchProps } from './type';
+declare const props: TdSwitchProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/props.js b/miniprogram_npm/tdesign-miniprogram/switch/props.js
new file mode 100644
index 0000000..c50b128
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/props.js
@@ -0,0 +1,35 @@
+const props = {
+ customValue: {
+ type: Array,
+ value: [true, false],
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ icon: {
+ type: Array,
+ value: [],
+ },
+ label: {
+ type: Array,
+ value: [],
+ },
+ loading: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ value: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts b/miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts
new file mode 100644
index 0000000..7db8002
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts
@@ -0,0 +1,21 @@
+import { SuperComponent } from '../common/src/index';
+export default class Switch extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ properties: import("./type").TdSwitchProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ checked: boolean;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(val: any): void;
+ };
+ methods: {
+ handleSwitch(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.js b/miniprogram_npm/tdesign-miniprogram/switch/switch.js
new file mode 100644
index 0000000..8f9277e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.js
@@ -0,0 +1,53 @@
+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';
+const { prefix } = config;
+const name = `${prefix}-switch`;
+let Switch = class Switch extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = ['t-class', 't-class-label', 't-class-body', 't-class-dot'];
+ this.behaviors = ['wx://form-field'];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ checked: false,
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value(val) {
+ const [activeValue] = this.data.customValue;
+ this.setData({
+ checked: val === activeValue,
+ });
+ },
+ };
+ this.methods = {
+ handleSwitch() {
+ const { loading, disabled, value, customValue } = this.data;
+ const [activeValue, inactiveValue] = customValue;
+ if (loading || disabled)
+ return;
+ this._trigger('change', {
+ value: value === activeValue ? inactiveValue : activeValue,
+ });
+ },
+ };
+ }
+};
+Switch = __decorate([
+ wxComponent()
+], Switch);
+export default Switch;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.json b/miniprogram_npm/tdesign-miniprogram/switch/switch.json
new file mode 100644
index 0000000..a32e8cd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-loading": "../loading/loading"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.wxml b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxml
new file mode 100644
index 0000000..df9f312
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ {{checked ? label[0] : label[1]}}
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.wxss b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxss
new file mode 100644
index 0000000..d4f1949
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxss
@@ -0,0 +1,161 @@
+.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-switch {
+ display: flex;
+ align-items: center;
+ overflow: hidden;
+}
+.t-switch__label {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-wrap: nowrap;
+ font-size: var(--td-switch-label-font-size, 28rpx);
+ color: var(--td-switch-label-color, var(--td-bg-color-secondarycontainer-active, var(--td-gray-color-4, #dcdcdc)));
+ overflow: hidden;
+}
+.t-switch__label--checked {
+ color: var(--td-switch-label-checked-color, var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-switch__label--disabled {
+ color: var(--td-switch-unchecked-disabled-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-switch__label--checked.t-switch__label--disabled {
+ color: var(--td-switch-checked-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-switch__label--large {
+ font-size: var(--td-switch-label-large-font-size, 32rpx);
+}
+.t-switch__label--small {
+ font-size: var(--td-switch-label-small-font-size, 24rpx);
+}
+.t-switch__label:empty {
+ display: none;
+}
+.t-switch__icon {
+ font-size: var(--td-switch-icon-size, 40rpx);
+}
+.t-switch__icon--large {
+ font-size: var(--td-switch-icon-large-size, 48rpx);
+}
+.t-switch__icon--small {
+ font-size: var(--td-switch-icon-small-size, 32rpx);
+}
+.t-switch__loading {
+ color: var(--td-switch-label-checked-color, var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-switch__body {
+ vertical-align: middle;
+ width: var(--td-switch-width, 90rpx);
+ height: var(--td-switch-height, 56rpx);
+ border-radius: var(--td-switch-radius, calc(var(--td-switch-height, 56rpx) / 2));
+ background-color: var(--td-switch-unchecked-color, var(--td-bg-color-secondarycontainer-active, var(--td-gray-color-4, #dcdcdc)));
+ position: relative;
+ transition: all 0.3s ease;
+ overflow: hidden;
+}
+.t-switch__body--checked {
+ background-color: var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-switch__body--disabled {
+ background-color: var(--td-switch-unchecked-disabled-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-switch__body--checked.t-switch__body--disabled {
+ background-color: var(--td-switch-checked-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-switch__body--large {
+ width: var(--td-switch-large-width, 104rpx);
+ height: var(--td-switch-large-height, 64rpx);
+ border-radius: var(--td-switch-large-radius, calc(var(--td-switch-large-height, 64rpx) / 2));
+}
+.t-switch__body--small {
+ width: var(--td-switch-small-width, 78rpx);
+ height: var(--td-switch-small-height, 48rpx);
+ border-radius: var(--td-switch-small-radius, calc(var(--td-switch-small-height, 48rpx) / 2));
+}
+.t-switch__dot {
+ position: absolute;
+ left: var(--td-switch-dot-horizontal-margin, 6rpx);
+ top: 50%;
+ width: var(--td-switch-dot-size, 44rpx);
+ height: var(--td-switch-dot-size, 44rpx);
+ border-radius: 50%;
+ background-color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ transition: all 0.3s;
+ transform: translateY(-50%);
+ box-shadow: var(--td-switch-dot-shadow, var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12)));
+}
+.t-switch__dot:after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 200%;
+ height: 200%;
+ border: 1px solid var(--td-switch-dot-border-color, var(--td-gray-color-4, #dcdcdc));
+ border-radius: 50%;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ box-sizing: border-box;
+}
+.t-switch__dot--large {
+ width: var(--td-switch-dot-large-size, 52rpx);
+ height: var(--td-switch-dot-large-size, 52rpx);
+}
+.t-switch__dot--small {
+ width: var(--td-switch-dot-small-size, 36rpx);
+ height: var(--td-switch-dot-small-size, 36rpx);
+}
+.t-switch__dot--checked {
+ left: calc(var(--td-switch-width, 90rpx) - var(--td-switch-dot-size, 44rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
+}
+.t-switch__dot--large.t-switch__dot--checked {
+ left: calc(var(--td-switch-large-width, 104rpx) - var(--td-switch-dot-large-size, 52rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
+}
+.t-switch__dot--small.t-switch__dot--checked {
+ left: calc(var(--td-switch-small-width, 78rpx) - var(--td-switch-dot-small-size, 36rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
+}
+.t-switch__dot--plain:not(.t-switch__dot--checked) {
+ width: var(--td-switch-dot-plain-size, 36rpx);
+ height: var(--td-switch-dot-plain-size, 36rpx);
+ left: var(--td-switch-dot-plain-horizontal-margin, 10rpx);
+}
+.t-switch__dot--large.t-switch__dot--plain:not(.t-switch__dot--checked) {
+ width: var(--td-switch-dot-plain-large-size, 44rpx);
+ height: var(--td-switch-dot-plain-large-size, 44rpx);
+}
+.t-switch__dot--small.t-switch__dot--plain:not(.t-switch__dot--checked) {
+ width: var(--td-switch-dot-plain-small-size, 28rpx);
+ height: var(--td-switch-dot-plain-small-size, 28rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/type.d.ts b/miniprogram_npm/tdesign-miniprogram/switch/type.d.ts
new file mode 100644
index 0000000..eecf253
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/type.d.ts
@@ -0,0 +1,35 @@
+export interface TdSwitchProps {
+ customValue?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: ArrayConstructor;
+ value?: string[];
+ };
+ label?: {
+ type: ArrayConstructor;
+ value?: string[];
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'small' | 'medium' | 'large';
+ };
+ value?: {
+ type: null;
+ value?: SwitchValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: SwitchValue;
+ };
+}
+export declare type SwitchValue = string | number | boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/type.js b/miniprogram_npm/tdesign-miniprogram/switch/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/props.d.ts
new file mode 100644
index 0000000..026ee8b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTabBarItemProps } from './type';
+declare const props: TdTabBarItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/props.js b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/props.js
new file mode 100644
index 0000000..5af83e4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/props.js
@@ -0,0 +1,15 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ },
+ icon: {
+ type: null,
+ },
+ subTabBar: {
+ type: Array,
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.d.ts
new file mode 100644
index 0000000..4efd9f7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.d.ts
@@ -0,0 +1,37 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class TabBarItem extends SuperComponent {
+ externalClasses: string[];
+ parent: any;
+ relations: RelationsOptions;
+ options: {
+ multipleSlots: boolean;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ isSpread: boolean;
+ isChecked: boolean;
+ hasChildren: boolean;
+ currentName: string;
+ split: boolean;
+ iconOnly: boolean;
+ theme: string;
+ crowded: boolean;
+ shape: string;
+ };
+ properties: import("./type").TdTabBarItemProps;
+ observers: {
+ subTabBar(value: Record[]): void;
+ icon(v: any): void;
+ };
+ lifetimes: {
+ attached(): Promise;
+ };
+ methods: {
+ showSpread(): void;
+ toggle(): void;
+ selectChild(event: any): void;
+ checkActive(value: any): void;
+ closeSpread(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.js b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.js
new file mode 100644
index 0000000..87752d0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.js
@@ -0,0 +1,120 @@
+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 { wxComponent, SuperComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { getRect, calcIcon } from '../common/utils';
+const { prefix } = config;
+const classPrefix = `${prefix}-tab-bar-item`;
+let TabBarItem = class TabBarItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.parent = null;
+ this.relations = {
+ '../tab-bar/tab-bar': {
+ type: 'ancestor',
+ linked(parent) {
+ const { theme, split, shape } = parent.data;
+ this.setData({
+ theme,
+ split,
+ shape,
+ currentName: this.properties.value ? this.properties.value : parent.initName(),
+ });
+ parent.updateChildren();
+ },
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.data = {
+ prefix,
+ classPrefix,
+ isSpread: false,
+ isChecked: false,
+ hasChildren: false,
+ currentName: '',
+ split: true,
+ iconOnly: false,
+ theme: '',
+ crowded: false,
+ shape: 'normal',
+ };
+ this.properties = props;
+ this.observers = {
+ subTabBar(value) {
+ this.setData({
+ hasChildren: value.length > 0,
+ });
+ },
+ icon(v) {
+ this.setData({
+ _icon: calcIcon(v),
+ });
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ return __awaiter(this, void 0, void 0, function* () {
+ const res = yield getRect(this, `.${classPrefix}__text`);
+ this.setData({ iconOnly: res.height === 0 });
+ });
+ },
+ };
+ this.methods = {
+ showSpread() {
+ this.setData({
+ isSpread: true,
+ });
+ },
+ toggle() {
+ const { currentName, hasChildren, isSpread } = this.data;
+ if (hasChildren) {
+ this.setData({
+ isSpread: !isSpread,
+ });
+ }
+ this.$parent.updateValue(currentName);
+ this.$parent.changeOtherSpread(currentName);
+ },
+ selectChild(event) {
+ const { value } = event.target.dataset;
+ this.$parent.updateValue(value);
+ this.setData({
+ isSpread: false,
+ });
+ },
+ checkActive(value) {
+ const { currentName, subTabBar } = this.data;
+ const isChecked = (subTabBar === null || subTabBar === void 0 ? void 0 : subTabBar.some((item) => item.value === value)) || currentName === value;
+ this.setData({
+ isChecked,
+ });
+ },
+ closeSpread() {
+ this.setData({
+ isSpread: false,
+ });
+ },
+ };
+ }
+};
+TabBarItem = __decorate([
+ wxComponent()
+], TabBarItem);
+export default TabBarItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.json b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.json
new file mode 100644
index 0000000..0603787
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-badge": "../badge/badge"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.wxml b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.wxml
new file mode 100644
index 0000000..972c508
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.wxml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ child.label }}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.wxss b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.wxss
new file mode 100644
index 0000000..0af2277
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/tab-bar-item.wxss
@@ -0,0 +1,147 @@
+.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);
+}
+:host {
+ flex: 1;
+}
+.t-tab-bar-item {
+ flex: 1;
+ height: var(--td-tab-bar-height, 80rpx);
+ box-sizing: border-box;
+ user-select: none;
+ position: relative;
+ margin: 16rpx 0;
+ background-color: var(--td-tab-bar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ padding: 0 24rpx;
+}
+.t-tab-bar-item--text-only {
+ font-size: 32rpx;
+}
+.t-tab-bar-item--split + .t-tab-bar-item--split::before {
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ border-left: 1px solid var(--td-tab-bar-border-color, var(--td-border-color, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleX(0.5);
+ top: 16rpx;
+ bottom: 16rpx;
+}
+.t-tab-bar-item--crowded {
+ padding: 0 16rpx;
+}
+.t-tab-bar-item--round {
+ border-radius: 99px;
+}
+.t-tab-bar-item__content {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ border-radius: 16rpx;
+ color: var(--td-tab-bar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tab-bar-item__content--checked {
+ color: var(--td-tab-bar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-weight: 600;
+}
+.t-tab-bar-item__content--tag {
+ border-radius: 99px;
+}
+.t-tab-bar-item__content--tag.t-tab-bar-item__content--checked {
+ background-color: var(--td-tab-bar-active-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tab-bar-item__icon {
+ display: contents;
+}
+.t-tab-bar-item__icon:empty {
+ display: none;
+}
+.t-tab-bar-item__text {
+ display: flex;
+ align-items: center;
+}
+.t-tab-bar-item__text--small {
+ font-size: 20rpx;
+ line-height: 32rpx;
+}
+.t-tab-bar-item__icon-menu {
+ margin-right: 8rpx;
+}
+.t-tab-bar-item__spread {
+ position: absolute;
+ top: 0;
+ left: 7%;
+ width: 86%;
+ background-color: var(--td-tab-bar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ transform: translate3d(0, calc(-100% - 32rpx), 0);
+ z-index: 1;
+ border-radius: 12rpx;
+ color: var(--td-tab-bar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ box-shadow: var(--td-tab-bar-spread-shadow, var(--td-shadow-3, 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08)));
+}
+.t-tab-bar-item__spread::before {
+ display: block;
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 50%;
+ width: 0;
+ height: 0;
+ border: 16rpx solid transparent;
+ border-top: 16rpx solid var(--td-tab-bar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ transform: translate3d(-50%, 32rpx, 0);
+}
+.t-tab-bar-item__spread-item {
+ width: 100%;
+ height: 96rpx;
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ position: relative;
+ flex-direction: column;
+}
+.t-tab-bar-item__spread-item--active {
+ background-color: var(--td-tab-bar-hover-bg-color, rgba(0, 0, 0, 0.05));
+}
+.t-tab-bar-item__spread-item-split {
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ background-color: var(--td-tab-bar-spread-border-color, var(--td-border-color, var(--td-gray-color-3, #e7e7e7)));
+ width: 80%;
+ height: 1px;
+ transform: translateY(0.5);
+}
+.t-tab-bar-item__spread-item-text {
+ padding-top: 24rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/type.d.ts
new file mode 100644
index 0000000..6fbbd6c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/type.d.ts
@@ -0,0 +1,23 @@
+import { BadgeProps } from '../badge/index';
+export interface TdTabBarItemProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: BadgeProps;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ subTabBar?: {
+ type: ArrayConstructor;
+ value?: SubTabBarItem[];
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+}
+export interface SubTabBarItem {
+ value: string;
+ label: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar-item/type.js b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/tab-bar/README.en-US.md
new file mode 100644
index 0000000..127e5e0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/README.en-US.md
@@ -0,0 +1,58 @@
+:: BASE_DOC ::
+
+## API
+
+### TabBar 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
+bordered | Boolean | true | \- | N
+fixed | Boolean | true | \- | N
+safe-area-inset-bottom | Boolean | true | \- | N
+shape | String | normal | options: normal/round | N
+split | Boolean | true | \- | N
+theme | String | normal | options: normal/tag | N
+value | String / Number / Array | - | Typescript:`string \| number \| Array` | N
+default-value | String / Number / Array | undefined | uncontrolled property。Typescript:`string \| number \| Array` | N
+
+### TabBar Events
+
+name | params | description
+-- | -- | --
+change | `(value: string \| number)` | \-
+### TabBar External Classes
+
+className | Description
+-- | --
+t-class | \-
+
+
+### TabBarItem 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
+badge-props | Object | - | Typescript:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-bar-item/type.ts) | N
+icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+sub-tab-bar | Array | - | Typescript:`SubTabBarItem[] ` `interface SubTabBarItem { value: string; label: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-bar-item/type.ts) | N
+value | String / Number | - | \- | N
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-tab-bar-active-bg | @brand-color-light | -
+--td-tab-bar-active-color | @brand-color | -
+--td-tab-bar-bg-color | @bg-color-container | -
+--td-tab-bar-border-color | @border-color | -
+--td-tab-bar-color | @font-gray-1 | -
+--td-tab-bar-height | 80rpx | -
+--td-tab-bar-hover-bg-color | rgba(0, 0, 0, 0.05) | -
+--td-tab-bar-spread-border-color | @border-color | -
+--td-tab-bar-spread-shadow | @shadow-3 | -
+--td-tab-bar-border-color | @border-color | -
+--td-tab-bar-round-shadow | @shadow-3 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/README.md b/miniprogram_npm/tdesign-miniprogram/tab-bar/README.md
new file mode 100644
index 0000000..be4f7e0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/README.md
@@ -0,0 +1,115 @@
+---
+title: TabBar 标签栏
+description: 用于在不同功能模块之间进行快速切换,位于页面底部。
+spline: navigation
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
+ "t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+
+### 组件类型
+#### 纯文本标签栏
+
+{{ text-only }}
+
+#### 图标加文字标签栏
+
+{{ base }}
+
+#### 纯图标标签栏
+
+{{ icon-only }}
+
+#### 双层级纯文本标签栏
+
+{{ sub }}
+
+### 组件样式
+
+#### 弱选中标签栏
+
+{{ badge }}
+
+#### 悬浮胶囊标签栏
+
+{{ round }}
+
+#### 自定义主题
+
+{{ custom }}
+
+## API
+
+### TabBar Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+bordered | Boolean | true | 是否显示外边框 | N
+fixed | Boolean | true | 是否固定在底部 | N
+safe-area-inset-bottom | Boolean | true | 是否为 iPhoneX 留出底部安全距离 | N
+shape | String | normal | 标签栏的形状。可选项:normal/round | N
+split | Boolean | true | 是否需要分割线 | N
+theme | String | normal | 选项风格。可选项:normal/tag | N
+value | String / Number / Array | - | 当前选中标签的索引。TS 类型:`string \| number \| Array` | N
+default-value | String / Number / Array | undefined | 当前选中标签的索引。非受控属性。TS 类型:`string \| number \| Array` | N
+
+### TabBar Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: string \| number)` | 选中标签切换时触发
+### TabBar External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+
+
+### TabBarItem Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+badge-props | Object | - | 图标右上角提示信息。TS 类型:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-bar-item/type.ts) | N
+icon | String / Object / Slot | - | 图标名称。传入对象时透传至 Icon 组件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+sub-tab-bar | Array | - | 二级菜单。TS 类型:`SubTabBarItem[] ` `interface SubTabBarItem { value: string; label: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-bar-item/type.ts) | N
+value | String / Number | - | 标识符 | N
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-tab-bar-active-bg | @brand-color-light | -
+--td-tab-bar-active-color | @brand-color | -
+--td-tab-bar-bg-color | @bg-color-container | -
+--td-tab-bar-border-color | @border-color | -
+--td-tab-bar-color | @font-gray-1 | -
+--td-tab-bar-height | 80rpx | -
+--td-tab-bar-hover-bg-color | rgba(0, 0, 0, 0.05) | -
+--td-tab-bar-spread-border-color | @border-color | -
+--td-tab-bar-spread-shadow | @shadow-3 | -
+--td-tab-bar-border-color | @border-color | -
+--td-tab-bar-round-shadow | @shadow-3 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-bar/props.d.ts
new file mode 100644
index 0000000..338c35e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTabBarProps } from './type';
+declare const props: TdTabBarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/props.js b/miniprogram_npm/tdesign-miniprogram/tab-bar/props.js
new file mode 100644
index 0000000..1f26596
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/props.js
@@ -0,0 +1,37 @@
+const props = {
+ bordered: {
+ type: Boolean,
+ value: true,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ fixed: {
+ type: Boolean,
+ value: true,
+ },
+ safeAreaInsetBottom: {
+ type: Boolean,
+ value: true,
+ },
+ shape: {
+ type: String,
+ value: 'normal',
+ },
+ split: {
+ type: Boolean,
+ value: true,
+ },
+ theme: {
+ type: String,
+ value: 'normal',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.d.ts
new file mode 100644
index 0000000..13e2da6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.d.ts
@@ -0,0 +1,28 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Tabbar extends SuperComponent {
+ relations: RelationsOptions;
+ externalClasses: string[];
+ backupValue: number;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ properties: import("./type").TdTabBarProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ showChildren(): void;
+ updateChildren(): void;
+ updateValue(value: any): void;
+ changeOtherSpread(value: any): void;
+ initName(): any;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.js b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.js
new file mode 100644
index 0000000..e002ace
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.js
@@ -0,0 +1,78 @@
+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';
+const { prefix } = config;
+const classPrefix = `${prefix}-tab-bar`;
+let Tabbar = class Tabbar extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.relations = {
+ '../tab-bar-item/tab-bar-item': {
+ type: 'descendant',
+ },
+ };
+ this.externalClasses = [`${prefix}-class`];
+ this.backupValue = -1;
+ this.data = {
+ prefix,
+ classPrefix,
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value() {
+ this.updateChildren();
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.showChildren();
+ },
+ };
+ this.methods = {
+ showChildren() {
+ const { value } = this.data;
+ this.$children.forEach((child) => {
+ child.setData({ crowded: this.$children.length > 3 });
+ if (child.properties.value === value) {
+ child.showSpread();
+ }
+ });
+ },
+ updateChildren() {
+ const { value } = this.data;
+ this.$children.forEach((child) => {
+ child.checkActive(value);
+ });
+ },
+ updateValue(value) {
+ this._trigger('change', { value });
+ },
+ changeOtherSpread(value) {
+ this.$children.forEach((child) => {
+ if (child.properties.value !== value) {
+ child.closeSpread();
+ }
+ });
+ },
+ initName() {
+ return (this.backupValue += 1);
+ },
+ };
+ }
+};
+Tabbar = __decorate([
+ wxComponent()
+], Tabbar);
+export default Tabbar;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.json b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.wxml b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.wxml
new file mode 100644
index 0000000..64e2043
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.wxml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.wxss b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.wxss
new file mode 100644
index 0000000..8b7f4c7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.wxss
@@ -0,0 +1,69 @@
+.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-tab-bar {
+ display: flex;
+ flex-wrap: nowrap;
+ align-items: center;
+ position: relative;
+ font-size: 16px;
+ background-color: var(--td-tab-bar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ box-sizing: border-box;
+}
+.t-tab-bar--normal.t-tab-bar--border::before {
+ z-index: 1;
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ top: 0;
+ border-top: 1px solid var(--td-tab-bar-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+ transform-origin: 0 0;
+}
+.t-tab-bar--fixed {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ right: 0;
+}
+.t-tab-bar--normal.t-tab-bar--safe {
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+}
+.t-tab-bar--round {
+ margin-left: 32rpx;
+ margin-right: 32rpx;
+ border-radius: 999px;
+ box-shadow: var(--td-tab-bar-round-shadow, var(--td-shadow-3, 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08)));
+}
+.t-tab-bar--fixed.t-tab-bar--round.t-tab-bar--safe {
+ bottom: constant(safe-area-inset-bottom);
+ bottom: env(safe-area-inset-bottom);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-bar/type.d.ts
new file mode 100644
index 0000000..32ec1d8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/type.d.ts
@@ -0,0 +1,38 @@
+export interface TdTabBarProps {
+ bordered?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class'];
+ };
+ fixed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ safeAreaInsetBottom?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'normal' | 'round';
+ };
+ split?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'normal' | 'tag';
+ };
+ value?: {
+ type: null;
+ value?: string | number | Array;
+ };
+ defaultValue?: {
+ type: null;
+ value?: string | number | Array;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-bar/type.js b/miniprogram_npm/tdesign-miniprogram/tab-bar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-bar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts
new file mode 100644
index 0000000..9329be0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTabPanelProps } from './type';
+declare const props: TdTabPanelProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/props.js b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.js
new file mode 100644
index 0000000..36216ca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.js
@@ -0,0 +1,23 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ label: {
+ type: String,
+ value: '',
+ },
+ panel: {
+ type: String,
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts
new file mode 100644
index 0000000..c146e28
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts
@@ -0,0 +1,24 @@
+///
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class TabPanel extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdTabPanelProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ active: boolean;
+ hide: boolean;
+ id: string;
+ };
+ setId(id: any): void;
+ observers: {
+ 'label, badgeProps, disabled, icon, panel, value'(): void;
+ };
+ getComputedName(): string;
+ update(): void;
+ render(active: Boolean, parent: WechatMiniprogram.Component.TrivialInstance): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js
new file mode 100644
index 0000000..22d5c3d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js
@@ -0,0 +1,62 @@
+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 props from './props';
+import config from '../common/config';
+const { prefix } = config;
+const name = `${prefix}-tab-panel`;
+let TabPanel = class TabPanel extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.relations = {
+ '../tabs/tabs': {
+ type: 'ancestor',
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ active: false,
+ hide: true,
+ id: '',
+ };
+ this.observers = {
+ 'label, badgeProps, disabled, icon, panel, value'() {
+ this.update();
+ },
+ };
+ }
+ setId(id) {
+ this.setData({ id });
+ }
+ getComputedName() {
+ if (this.properties.value != null) {
+ return `${this.properties.value}`;
+ }
+ return `${this.index}`;
+ }
+ update() {
+ var _a;
+ (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.updateTabs();
+ }
+ render(active, parent) {
+ this.initialized = this.initialized || active;
+ this.setData({
+ active,
+ hide: !parent.data.animation && !active,
+ });
+ }
+};
+TabPanel = __decorate([
+ wxComponent()
+], TabPanel);
+export default TabPanel;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml
new file mode 100644
index 0000000..5327c0e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml
@@ -0,0 +1,12 @@
+
+
+
+ {{panel}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss
new file mode 100644
index 0000000..444cf58
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss
@@ -0,0 +1,42 @@
+.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-tab-panel {
+ flex-shrink: 0;
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+}
+.t-tab-panel--active {
+ height: auto;
+}
+.t-tab-panel--inactive {
+ height: 0;
+ overflow: visible;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts
new file mode 100644
index 0000000..0941617
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts
@@ -0,0 +1,27 @@
+import { TabValue } from '../tabs/index';
+export interface TdTabPanelProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ panel?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: TabValue;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/type.js b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md
new file mode 100644
index 0000000..6373bd9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md
@@ -0,0 +1,75 @@
+:: BASE_DOC ::
+
+## API
+
+### Tabs 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 | Object | - | Typescript:`TabAnimation` `type TabAnimation = { duration: number } & Record`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+middle | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+show-bottom-line | Boolean | true | \- | N
+space-evenly | Boolean | true | \- | N
+split | Boolean | true | \- | N
+sticky | Boolean | false | \- | N
+sticky-props | Object | - | Typescript:`StickyProps`,[Sticky API Documents](./sticky?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+swipeable | Boolean | true | \- | N
+theme | String | line | options: line/tag/card | N
+value | String / Number | - | Typescript:`TabValue` `type TabValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+default-value | String / Number | undefined | uncontrolled property。Typescript:`TabValue` `type TabValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+
+### Tabs Events
+
+name | params | description
+-- | -- | --
+change | `(value: TabValue, label: string)` | \-
+click | `(value: TabValue, label: string)` | \-
+scroll | `(scrollTop: number, isFixed: boolean)` | \-
+### Tabs External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-active | \-
+t-class-content | \-
+t-class-item | \-
+t-class-track | \-
+
+
+### TabPanel 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
+badge-props | Object | - | \- | N
+disabled | Boolean | false | \- | N
+icon | String / Object | - | \- | N
+label | String | - | \- | N
+panel | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+value | String / Number | - | Typescript:`TabValue`,[Tabs API Documents](./tabs?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-tab-border-color | @component-stroke | -
+--td-tab-font-size | 28rpx | -
+--td-tab-icon-size | 36rpx | -
+--td-tab-item-active-color | @brand-color | -
+--td-tab-item-color | @font-gray-1 | -
+--td-tab-item-disabled-color | @font-gray-4 | -
+--td-tab-item-height | 96rpx | -
+--td-tab-item-tag-active-bg | @brand-color-light | -
+--td-tab-item-tag-bg | @bg-color-secondarycontainer | -
+--td-tab-item-tag-height | 64rpx | -
+--td-tab-item-vertical-height | 108rpx | -
+--td-tab-item-vertical-width | 208rpx | -
+--td-tab-nav-bg-color | @bg-color-container | -
+--td-tab-track-color | @brand-color | -
+--td-tab-track-radius | 8rpx | -
+--td-tab-track-thickness | 6rpx | -
+--td-tab-track-width | 32rpx | -
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/README.md b/miniprogram_npm/tdesign-miniprogram/tabs/README.md
new file mode 100644
index 0000000..9a60ce7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/README.md
@@ -0,0 +1,188 @@
+---
+title: Tabs 选项卡
+description: 用于内容分类后的展示切换。
+spline: navigation
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-tabs": "tdesign-miniprogram/tabs/tabs",
+ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础选项卡
+
+{{ base }}
+
+### 等距选项卡
+
+{{ scroll }}
+
+### 带图标选项卡
+
+{{ with-icon }}
+
+### 带徽章选项卡
+
+{{ with-badge }}
+
+### 带内容区选项卡
+
+{{ with-content }}
+
+### 选项卡状态
+
+{{ status }}
+
+### 选项卡尺寸
+
+{{ size }}
+
+### 选项卡样式
+
+使用 theme 属性可以变换风格,支持 line = 线条(默认);tag = 标签;card = 卡片
+
+{{ theme }}
+
+
+
+
+
+
+### 受控用法
+
+```html
+
+ 标签一内容
+ 标签二内容
+
+```
+
+```js
+Page({
+ data: {
+ value: '0',
+ },
+ onTabsChange(e) {
+ this.setData({ value: e.detail.value })
+ },
+});
+```
+
+### 与 Popup 使用
+
+```html
+
+
+ 标签一内容
+ 标签二内容
+ 标签三内容
+
+
+```
+
+```js
+Page({
+ data: {
+ visible: false
+ },
+ showPopup() {
+ this.setData({
+ visible: true
+ }, () => {
+ const tabs = this.selectComponent('tabs');
+
+ tabs.setTrack(); // 这一步很重要,因为小程序的无法正确执行生命周期,所以需要手动设置下 tabs 的滑块
+ })
+ }
+})
+```
+
+## API
+
+### Tabs Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+animation | Object | - | 动画效果设置。其中 duration 表示动画时长。(单位:秒)。TS 类型:`TabAnimation` `type TabAnimation = { duration: number } & Record`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+middle | Slot | - | 中间内容,介于头部和内容之间。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+show-bottom-line | Boolean | true | 是否展示底部激活线条 | N
+space-evenly | Boolean | true | 选项卡头部空间是否均分 | N
+split | Boolean | true | `1.1.10`。是否展示分割线 | N
+sticky | Boolean | false | 是否开启粘性布局 | N
+sticky-props | Object | - | 透传至 Sticky 组件。TS 类型:`StickyProps`,[Sticky API Documents](./sticky?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+swipeable | Boolean | true | 是否可以滑动切换 | N
+theme | String | line | 标签的样式。可选项:line/tag/card | N
+value | String / Number | - | 激活的选项卡值。TS 类型:`TabValue` `type TabValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+default-value | String / Number | undefined | 激活的选项卡值。非受控属性。TS 类型:`TabValue` `type TabValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+
+### Tabs Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: TabValue, label: string)` | 激活的选项卡发生变化时触发
+click | `(value: TabValue, label: string)` | 点击选项卡时触发
+scroll | `(scrollTop: number, isFixed: boolean)` | 页面滚动时触发
+### Tabs External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-active | 激活态样式类
+t-class-content | 内容样式类
+t-class-item | 选项样式类
+t-class-track | 滚动条样式类
+
+
+### TabPanel Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+badge-props | Object | - | 透传至 Badge 组件 | N
+disabled | Boolean | false | 是否禁用当前选项卡 | N
+icon | String / Object | - | `1.0.0-rc.1`。图标,传对象则透传至 Icon | N
+label | String | - | 选项卡名称 | N
+panel | String / Slot | - | 用于自定义选项卡面板内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+value | String / Number | - | 选项卡的值,唯一标识。TS 类型:`TabValue`,[Tabs API Documents](./tabs?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-tab-border-color | @component-stroke | -
+--td-tab-font-size | 28rpx | -
+--td-tab-icon-size | 36rpx | -
+--td-tab-item-active-color | @brand-color | -
+--td-tab-item-color | @font-gray-1 | -
+--td-tab-item-disabled-color | @font-gray-4 | -
+--td-tab-item-height | 96rpx | -
+--td-tab-item-tag-active-bg | @brand-color-light | -
+--td-tab-item-tag-bg | @bg-color-secondarycontainer | -
+--td-tab-item-tag-height | 64rpx | -
+--td-tab-item-vertical-height | 108rpx | -
+--td-tab-item-vertical-width | 208rpx | -
+--td-tab-nav-bg-color | @bg-color-container | -
+--td-tab-track-color | @brand-color | -
+--td-tab-track-radius | 8rpx | -
+--td-tab-track-thickness | 6rpx | -
+--td-tab-track-width | 32rpx | -
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts
new file mode 100644
index 0000000..2f91d15
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts
@@ -0,0 +1,3 @@
+export * from './tabs';
+export * from './type';
+export * from './props';
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/index.js b/miniprogram_npm/tdesign-miniprogram/tabs/index.js
new file mode 100644
index 0000000..2f91d15
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/index.js
@@ -0,0 +1,3 @@
+export * from './tabs';
+export * from './type';
+export * from './props';
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts
new file mode 100644
index 0000000..215fa49
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTabsProps } from './type';
+declare const props: TdTabsProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/props.js b/miniprogram_npm/tdesign-miniprogram/tabs/props.js
new file mode 100644
index 0000000..9caa438
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/props.js
@@ -0,0 +1,43 @@
+const props = {
+ animation: {
+ type: Object,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ showBottomLine: {
+ type: Boolean,
+ value: true,
+ },
+ spaceEvenly: {
+ type: Boolean,
+ value: true,
+ },
+ split: {
+ type: Boolean,
+ value: true,
+ },
+ sticky: {
+ type: Boolean,
+ value: false,
+ },
+ stickyProps: {
+ type: Object,
+ },
+ swipeable: {
+ type: Boolean,
+ value: true,
+ },
+ theme: {
+ type: String,
+ value: 'line',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts
new file mode 100644
index 0000000..1efdbf6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts
@@ -0,0 +1,55 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+import { TdTabsProps } from './type';
+export interface TabsProps extends TdTabsProps {
+}
+export default class Tabs extends SuperComponent {
+ options: {
+ pureDataPattern: RegExp;
+ };
+ behaviors: string[];
+ externalClasses: string[];
+ relations: RelationsOptions;
+ properties: TdTabsProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(name: any): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ tabs: any[];
+ currentLabels: any[];
+ currentIndex: number;
+ trackStyle: string;
+ offset: number;
+ scrollLeft: number;
+ tabID: string;
+ placement: string;
+ };
+ lifetimes: {
+ created(): void;
+ attached(): void;
+ };
+ initChildId(): void;
+ methods: {
+ onScroll(e: any): void;
+ updateTabs(cb: any): void;
+ setCurrentIndexByName(name: any): void;
+ setCurrentIndex(index: number): void;
+ getCurrentName(): any;
+ calcScrollOffset(containerWidth: number, targetLeft: number, targetWidth: number, offset: number): number;
+ getTabHeight(): Promise;
+ getTrackSize(): Promise;
+ setTrack(): Promise;
+ onTabTap(event: any): void;
+ onTouchStart(event: any): void;
+ onTouchMove(event: any): void;
+ onTouchEnd(): void;
+ onTouchScroll(event: WechatMiniprogram.CustomEvent): void;
+ changeIndex(index: any): void;
+ getAvailableTabIndex(deltaX: number): any;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js
new file mode 100644
index 0000000..25efd5a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js
@@ -0,0 +1,287 @@
+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 props from './props';
+import config from '../common/config';
+import touch from '../mixins/touch';
+import { getRect, uniqueFactory } from '../common/utils';
+import { getObserver } from '../common/wechat';
+const { prefix } = config;
+const name = `${prefix}-tabs`;
+const getUniqueID = uniqueFactory('tabs');
+let Tabs = class Tabs extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ pureDataPattern: /^currentLabels$/,
+ };
+ this.behaviors = [touch];
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-item`,
+ `${prefix}-class-active`,
+ `${prefix}-class-track`,
+ `${prefix}-class-content`,
+ ];
+ this.relations = {
+ '../tab-panel/tab-panel': {
+ type: 'descendant',
+ linked(target) {
+ this.children.push(target);
+ this.initChildId();
+ target.index = this.children.length - 1;
+ this.updateTabs();
+ },
+ unlinked(target) {
+ this.children = this.children.filter((item) => item.index !== target.index);
+ this.updateTabs(() => this.setTrack());
+ this.initChildId();
+ },
+ },
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value(name) {
+ if (name !== this.getCurrentName()) {
+ this.setCurrentIndexByName(name);
+ }
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ tabs: [],
+ currentLabels: [],
+ currentIndex: -1,
+ trackStyle: '',
+ offset: 0,
+ scrollLeft: 0,
+ tabID: '',
+ placement: 'top',
+ };
+ this.lifetimes = {
+ created() {
+ this.children = this.children || [];
+ },
+ attached() {
+ wx.nextTick(() => {
+ this.setTrack();
+ });
+ getRect(this, `.${name}`).then((rect) => {
+ this.containerWidth = rect.width;
+ });
+ this.setData({
+ tabID: getUniqueID(),
+ });
+ },
+ };
+ this.methods = {
+ onScroll(e) {
+ const { scrollLeft } = e.detail;
+ this.setData({
+ scrollLeft,
+ });
+ },
+ updateTabs(cb) {
+ const { children } = this;
+ const tabs = children.map((child) => child.data);
+ tabs.forEach((item) => {
+ if (typeof item.icon === 'string') {
+ item.icon = { name: item.icon };
+ }
+ });
+ this.setData({ tabs }, cb);
+ this.setCurrentIndexByName(this.properties.value);
+ },
+ setCurrentIndexByName(name) {
+ const { children } = this;
+ const index = children.findIndex((child) => child.getComputedName() === `${name}`);
+ if (index > -1) {
+ this.setCurrentIndex(index);
+ }
+ },
+ setCurrentIndex(index) {
+ if (index <= -1 || index >= this.children.length)
+ return;
+ const Labels = [];
+ this.children.forEach((child, idx) => {
+ const isActive = index === idx;
+ if (isActive !== child.data.active || !child.initialized) {
+ child.render(isActive, this);
+ }
+ Labels.push(child.data.label);
+ });
+ const { currentIndex, currentLabels } = this.data;
+ if (currentIndex === index && currentLabels.join('') === Labels.join(''))
+ return;
+ this.setData({
+ currentIndex: index,
+ currentLabels: Labels,
+ }, () => {
+ this.setTrack();
+ });
+ },
+ getCurrentName() {
+ if (this.children) {
+ const activeTab = this.children[this.data.currentIndex];
+ if (activeTab) {
+ return activeTab.getComputedName();
+ }
+ }
+ },
+ calcScrollOffset(containerWidth, targetLeft, targetWidth, offset) {
+ return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2;
+ },
+ getTabHeight() {
+ return getRect(this, `.${name}`);
+ },
+ getTrackSize() {
+ return new Promise((resolve, reject) => {
+ if (this.trackWidth) {
+ resolve(this.trackWidth);
+ return;
+ }
+ getRect(this, `.${prefix}-tabs__track`)
+ .then((res) => {
+ if (res) {
+ this.trackWidth = res.width;
+ resolve(this.trackWidth);
+ }
+ })
+ .catch(reject);
+ });
+ },
+ setTrack() {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { children } = this;
+ if (!children)
+ return;
+ const { currentIndex } = this.data;
+ if (currentIndex <= -1)
+ return;
+ try {
+ const res = yield getRect(this, `.${prefix}-tabs__item`, true);
+ const rect = res[currentIndex];
+ if (!rect)
+ return;
+ let count = 0;
+ let distance = 0;
+ let totalSize = 0;
+ res.forEach((item) => {
+ if (count < currentIndex) {
+ distance += item.width;
+ count += 1;
+ }
+ totalSize += item.width;
+ });
+ if (this.containerWidth) {
+ const offset = this.calcScrollOffset(this.containerWidth, rect.left, rect.width, this.data.scrollLeft);
+ const maxOffset = totalSize - this.containerWidth;
+ this.setData({
+ offset: Math.min(Math.max(offset, 0), maxOffset),
+ });
+ }
+ else if (!this._hasObserved) {
+ this._hasObserved = true;
+ getObserver(this, `.${name}`).then(() => this.setTrack());
+ }
+ if (this.data.theme === 'line') {
+ const trackLineWidth = yield this.getTrackSize();
+ distance += (rect.width - trackLineWidth) / 2;
+ }
+ this.setData({
+ trackStyle: `-webkit-transform: translateX(${distance}px);
+ transform: translateX(${distance}px);
+ `,
+ });
+ }
+ catch (err) {
+ this.triggerEvent('error', err);
+ }
+ });
+ },
+ onTabTap(event) {
+ const { index } = event.currentTarget.dataset;
+ this.changeIndex(index);
+ },
+ onTouchStart(event) {
+ if (!this.properties.swipeable)
+ return;
+ this.touchStart(event);
+ },
+ onTouchMove(event) {
+ if (!this.properties.swipeable)
+ return;
+ this.touchMove(event);
+ },
+ onTouchEnd() {
+ if (!this.properties.swipeable)
+ return;
+ const { direction, deltaX, offsetX } = this;
+ const minSwipeDistance = 50;
+ if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
+ const index = this.getAvailableTabIndex(deltaX);
+ if (index !== -1) {
+ this.changeIndex(index);
+ }
+ }
+ },
+ onTouchScroll(event) {
+ this._trigger('scroll', event.detail);
+ },
+ changeIndex(index) {
+ const currentTab = this.data.tabs[index];
+ const { value, label } = currentTab;
+ if (!(currentTab === null || currentTab === void 0 ? void 0 : currentTab.disabled) && index !== this.data.currentIndex) {
+ this._trigger('change', { value, label });
+ }
+ this._trigger('click', { value, label });
+ },
+ getAvailableTabIndex(deltaX) {
+ const step = deltaX > 0 ? -1 : 1;
+ const { currentIndex, tabs } = this.data;
+ const len = tabs.length;
+ for (let i = step; currentIndex + step >= 0 && currentIndex + step < len; i += step) {
+ const newIndex = currentIndex + i;
+ if (newIndex >= 0 && newIndex < len && tabs[newIndex]) {
+ if (!tabs[newIndex].disabled) {
+ return newIndex;
+ }
+ }
+ else {
+ return currentIndex;
+ }
+ }
+ return -1;
+ },
+ };
+ }
+ initChildId() {
+ this.children.forEach((item, index) => {
+ item.setId(`${this.data.tabID}_panel_${index}`);
+ });
+ }
+};
+Tabs = __decorate([
+ wxComponent()
+], Tabs);
+export default Tabs;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.json b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.json
new file mode 100644
index 0000000..f9b94db
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-sticky": "../sticky/sticky",
+ "t-badge": "../badge/badge",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml
new file mode 100644
index 0000000..611045a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.label}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs
new file mode 100644
index 0000000..b3f1e42
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs
@@ -0,0 +1,16 @@
+/* eslint-disable */
+
+function animate(options) {
+ var result = [];
+
+ if (options.duration) {
+ result.push('transition-duration: ' + options.duration + 's');
+ result.push('transform: translate3d( ' + -100 * options.currentIndex + '%,0, 0)');
+ }
+
+ return result.join(';');
+}
+
+module.exports = {
+ animate: animate,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss
new file mode 100644
index 0000000..d6d0a26
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss
@@ -0,0 +1,210 @@
+.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-tabs {
+ position: relative;
+ font-size: var(--td-tab-font-size, 28rpx);
+ background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ flex-wrap: wrap;
+}
+.t-tabs__wrapper {
+ display: flex;
+ overflow: hidden;
+ background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tabs__wrapper--card {
+ background: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ --td-tab-border-color: transparent;
+}
+.t-tabs__item {
+ position: relative;
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: center;
+ font-weight: 400;
+ color: var(--td-tab-item-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ padding: 0 var(--td-spacer-2, 32rpx);
+ box-sizing: border-box;
+ white-space: nowrap;
+ overflow: hidden;
+ height: var(--td-tab-item-height, 96rpx);
+}
+.t-tabs__item--active {
+ font-weight: 600;
+ color: var(--td-tab-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tabs__item--disabled {
+ color: var(--td-tab-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-tabs__item--evenly {
+ flex: 1 0 auto;
+}
+.t-tabs__item-inner {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-tabs__item-inner--tag {
+ width: 100%;
+ text-align: center;
+ padding: 0 var(--td-spacer-2, 32rpx);
+ line-height: var(--td-tab-item-tag-height, 64rpx);
+ border-radius: calc(var(--td-tab-item-tag-height, 64rpx) / 2);
+ background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tabs__item-inner--active.t-tabs__item-inner--tag {
+ background-color: var(--td-tab-item-tag-active-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tabs__item--tag:not(.t-tabs__item--evenly) {
+ padding: 0 calc(var(--td-spacer, 16rpx) / 2);
+}
+.t-tabs__item--tag:not(.t-tabs__item--evenly):first-child {
+ margin-left: var(--td-spacer, 16rpx);
+}
+.t-tabs__item--tag:not(.t-tabs__item--evenly):last-child {
+ padding-right: var(--td-spacer-1, 24rpx);
+}
+.t-tabs__item--tag {
+ padding: 0 var(--td-spacer, 16rpx);
+}
+.t-tabs__item--card.t-tabs__item--active {
+ background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ border-radius: var(--td-radius-large, 18rpx) var(--td-radius-large, 18rpx) 0 0;
+}
+.t-tabs__item--card.t-tabs__item--active:first-child {
+ border-top-left-radius: 0;
+}
+.t-tabs__item--card.t-tabs__item--active:last-child {
+ border-top-right-radius: 0;
+}
+.t-tabs__item--card.t-tabs__item--pre {
+ border-bottom-right-radius: var(--td-radius-large, 18rpx);
+}
+.t-tabs__item-prefix,
+.t-tabs__item-suffix {
+ position: absolute;
+ bottom: 0;
+ width: 18rpx;
+ height: 18rpx;
+ background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tabs__item-prefix::after,
+.t-tabs__item-suffix::after {
+ content: '';
+ display: block;
+ width: 100%;
+ height: 100%;
+ background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tabs__item-prefix {
+ right: 0;
+}
+.t-tabs__item-prefix::after {
+ border-bottom-right-radius: var(--td-radius-large, 18rpx);
+}
+.t-tabs__item-suffix {
+ left: 0;
+}
+.t-tabs__item-suffix::after {
+ border-bottom-left-radius: var(--td-radius-large, 18rpx);
+}
+.t-tabs__badge--active {
+ --td-badge-content-text-color: var(--td-tab-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tabs__badge--disabled {
+ --td-badge-content-text-color: var(--td-tab-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-tabs__icon {
+ font-size: var(--td-tab-icon-size, 36rpx);
+ margin-right: calc(var(--td-spacer, 16rpx) / 4);
+}
+.t-tabs__content {
+ overflow: hidden;
+}
+.t-tabs__nav {
+ position: relative;
+ user-select: none;
+ display: flex;
+ flex-wrap: nowrap;
+ align-items: center;
+}
+.t-tabs__nav.t-tabs__nav--evenly {
+ width: 100%;
+}
+.t-tabs__track {
+ position: absolute;
+ font-weight: 600;
+ z-index: 1;
+ transition-duration: 0.3s;
+ background-color: var(--td-tab-track-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ left: 0;
+ bottom: 1rpx;
+ width: var(--td-tab-track-width, 32rpx);
+ height: var(--td-tab-track-thickness, 6rpx);
+ border-radius: var(--td-tab-track-radius, 8rpx);
+}
+.t-tabs__scroll {
+ position: relative;
+ height: var(--td-tab-item-height, 96rpx);
+}
+.t-tabs__scroll--split {
+ position: relative;
+}
+.t-tabs__scroll--split::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-tab-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-tabs__scroll--split::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-tabs__scroll::-webkit-scrollbar {
+ display: none;
+}
+.t-tabs__content {
+ width: 100%;
+}
+.t-tabs__content-inner {
+ display: block;
+}
+.t-tabs__content--animated .t-tabs__content-inner {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ will-change: left;
+ transition-property: transform;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts
new file mode 100644
index 0000000..2e0a946
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts
@@ -0,0 +1,51 @@
+import { StickyProps } from '../sticky/index';
+export interface TdTabsProps {
+ animation?: {
+ type: ObjectConstructor;
+ value?: TabAnimation;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-item', 't-class-active', 't-class-track'];
+ };
+ showBottomLine?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ spaceEvenly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ split?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ sticky?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ stickyProps?: {
+ type: ObjectConstructor;
+ value?: StickyProps;
+ };
+ swipeable?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'line' | 'tag' | 'card';
+ };
+ value?: {
+ type: null;
+ value?: TabValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: TabValue;
+ };
+}
+export declare type TabAnimation = {
+ duration: number;
+} & Record;
+export declare type TabValue = string | number;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/type.js b/miniprogram_npm/tdesign-miniprogram/tabs/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tag/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/tag/README.en-US.md
new file mode 100644
index 0000000..27af848
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/README.en-US.md
@@ -0,0 +1,100 @@
+:: 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_npm/tdesign-miniprogram/tag/README.md b/miniprogram_npm/tdesign-miniprogram/tag/README.md
new file mode 100644
index 0000000..2f21c3d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/README.md
@@ -0,0 +1,148 @@
+---
+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_npm/tdesign-miniprogram/tag/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tag/props.d.ts
new file mode 100644
index 0000000..8074655
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTagProps } from './type';
+declare const props: TdTagProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tag/props.js b/miniprogram_npm/tdesign-miniprogram/tag/props.js
new file mode 100644
index 0000000..37b936b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/props.js
@@ -0,0 +1,36 @@
+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_npm/tdesign-miniprogram/tag/tag.d.ts b/miniprogram_npm/tdesign-miniprogram/tag/tag.d.ts
new file mode 100644
index 0000000..2c86ef0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/tag.d.ts
@@ -0,0 +1,28 @@
+///
+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_npm/tdesign-miniprogram/tag/tag.js b/miniprogram_npm/tdesign-miniprogram/tag/tag.js
new file mode 100644
index 0000000..da271cd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/tag.js
@@ -0,0 +1,93 @@
+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_npm/tdesign-miniprogram/tag/tag.json b/miniprogram_npm/tdesign-miniprogram/tag/tag.json
new file mode 100644
index 0000000..6f15f57
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/tag.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": ".././icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tag/tag.wxml b/miniprogram_npm/tdesign-miniprogram/tag/tag.wxml
new file mode 100644
index 0000000..f4d8ee7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/tag.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/tag/tag.wxss b/miniprogram_npm/tdesign-miniprogram/tag/tag.wxss
new file mode 100644
index 0000000..6d60d28
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/tag.wxss
@@ -0,0 +1,244 @@
+.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-tag {
+ display: inline-flex;
+ align-items: center;
+ border: 2rpx solid transparent;
+ box-sizing: border-box;
+ border-radius: var(--td-tag-square-border-radius, 8rpx);
+ font-size: var(--td-tag-medium-font-size, var(--td-font-size-s, 24rpx));
+ user-select: none;
+ vertical-align: middle;
+}
+.t-tag__text {
+ word-wrap: normal;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.t-tag__icon,
+.t-tag__icon-close {
+ display: flex;
+ align-items: center;
+}
+.t-tag__icon-close {
+ color: var(--td-tag-close-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+}
+.t-tag__icon:not(:empty) + .t-tag__text:not(:empty),
+.t-tag__text:not(:empty) + .t-tag__icon-close:not(:empty) {
+ margin-left: 8rpx;
+}
+.t-tag.t-tag--small {
+ height: var(--td-tag-small-height, 40rpx);
+ line-height: var(--td-tag-small-height, 40rpx);
+ padding: 0 var(--td-tag-small-padding, 11rpx);
+ font-size: var(--td-tag-small-font-size, var(--td-font-size, 20rpx));
+}
+.t-tag.t-tag--small .t-icon,
+.t-tag.t-tag--small .t-icon-close {
+ font-size: var(--td-tag-small-icon-size, 24rpx);
+}
+.t-tag.t-tag--small .t-tag__icon:not(:empty) + .t-tag__text:not(:empty),
+.t-tag.t-tag--small .t-tag__text:not(:empty) + .t-tag__icon-close:not(:empty) {
+ margin-left: 4rpx;
+}
+.t-tag.t-tag--medium {
+ height: var(--td-tag-medium-height, 48rpx);
+ line-height: var(--td-tag-medium-height, 48rpx);
+ padding: 0 var(--td-tag-medium-padding, 15rpx);
+ font-size: var(--td-tag-medium-font-size, var(--td-font-size-s, 24rpx));
+}
+.t-tag.t-tag--medium .t-icon,
+.t-tag.t-tag--medium .t-icon-close {
+ font-size: var(--td-tag-medium-icon-size, 28rpx);
+}
+.t-tag.t-tag--large {
+ height: var(--td-tag-large-height, 56rpx);
+ line-height: var(--td-tag-large-height, 56rpx);
+ padding: 0 var(--td-tag-large-padding, 15rpx);
+ font-size: var(--td-tag-large-font-size, var(--td-font-size-base, 28rpx));
+}
+.t-tag.t-tag--large .t-icon,
+.t-tag.t-tag--large .t-icon-close {
+ font-size: var(--td-tag-large-icon-size, 32rpx);
+}
+.t-tag.t-tag--extra-large {
+ height: var(--td-tag-extra-large-height, 80rpx);
+ line-height: var(--td-tag-extra-large-height, 80rpx);
+ padding: 0 var(--td-tag-extra-large-padding, 31rpx);
+ font-size: var(--td-tag-extra-large-font-size, var(--td-font-size-base, 28rpx));
+}
+.t-tag.t-tag--extra-large .t-icon,
+.t-tag.t-tag--extra-large .t-icon-close {
+ font-size: var(--td-tag-extra-large-icon-size, 32rpx);
+}
+.t-tag.t-tag--square {
+ border-radius: var(--td-tag-square-border-radius, 8rpx);
+}
+.t-tag.t-tag--round {
+ border-radius: var(--td-tag-round-border-radius, 999px);
+}
+.t-tag.t-tag--mark {
+ border-radius: 0;
+ border-top-right-radius: var(--td-tag-mark-border-radius, var(--td-tag-round-border-radius, 999px));
+ border-bottom-right-radius: var(--td-tag-mark-border-radius, var(--td-tag-round-border-radius, 999px));
+}
+.t-tag--dark.t-tag--default {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ background-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-tag--dark.t-tag--primary {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tag--dark.t-tag--success {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-tag--dark.t-tag--warning {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-tag--dark.t-tag--danger {
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-tag--dark.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tag--outline.t-tag--default {
+ color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tag--outline.t-tag--primary {
+ color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tag--outline.t-tag--success {
+ color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-tag--outline.t-tag--warning {
+ color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-tag--outline.t-tag--danger {
+ color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+}
+.t-tag--outline.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tag--outline.t-tag--default {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--primary {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--success {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--warning {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--outline.t-tag--danger {
+ background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tag--light.t-tag--default {
+ color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tag--light.t-tag--primary {
+ color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+ background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tag--light.t-tag--success {
+ color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ border-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+ background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-tag--light.t-tag--warning {
+ color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ border-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+ background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-tag--light.t-tag--danger {
+ color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+ background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+}
+.t-tag--light.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tag--light-outline.t-tag--default {
+ color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tag--light-outline.t-tag--primary {
+ color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tag--light-outline.t-tag--success {
+ color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+ background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
+}
+.t-tag--light-outline.t-tag--warning {
+ color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+ background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
+}
+.t-tag--light-outline.t-tag--danger {
+ color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
+}
+.t-tag--light-outline.t-tag--default {
+ color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ border-color: var(--td-component-border, var(--td-gray-color-4, #dcdcdc));
+}
+.t-tag.t-tag--closable.t-tag--disabled {
+ cursor: not-allowed;
+ color: var(--td-tag-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+ background-color: var(--td-tag-disabled-background-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+ border-color: var(--td-tag-disabled-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tag/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tag/type.d.ts
new file mode 100644
index 0000000..bd1147d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/type.d.ts
@@ -0,0 +1,38 @@
+export interface TdTagProps {
+ closable?: {
+ type: null;
+ value?: boolean | object;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class'];
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ maxWidth?: {
+ type: null;
+ value?: string | number;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'square' | 'round' | 'mark';
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'small' | 'medium' | 'large' | 'extra-large';
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'primary' | 'warning' | 'danger' | 'success';
+ };
+ variant?: {
+ type: StringConstructor;
+ value?: 'dark' | 'light' | 'outline' | 'light-outline';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tag/type.js b/miniprogram_npm/tdesign-miniprogram/tag/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tag/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/textarea/README.en-US.md
new file mode 100644
index 0000000..a62b4ed
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/README.en-US.md
@@ -0,0 +1,72 @@
+:: BASE_DOC ::
+
+## API
+
+
+### Textarea 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
+adjust-position | Boolean | true | \- | N
+allow-input-over-max | Boolean | false | \- | N
+autofocus | Boolean | false | \- | N
+autosize | Boolean / Object | false | Typescript:`boolean \| { maxHeight?: number, minHeight?: number }` | N
+bordered | Boolean | false | \- | N
+confirm-hold | Boolean | false | \- | N
+confirm-type | String | return | options: return/send/search/next/go/done。Typescript:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N
+cursor | Number | -1 | \- | N
+cursor-spacing | Number | 0 | \- | N
+disable-default-padding | Boolean | false | \- | N
+disabled | Boolean | undefined | \- | N
+fixed | Boolean | false | \- | N
+focus | Boolean | false | \- | N
+hold-keyboard | Boolean | false | \- | N
+indicator | Boolean | false | \- | N
+label | String / Slot | - | [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 | undefined | \- | N
+placeholder-class | String | textarea-placeholder | \- | N
+placeholder-style | String | - | \- | N
+readonly | Boolean | undefined | \- | N
+selection-end | Number | -1 | \- | N
+selection-start | Number | -1 | \- | N
+show-confirm-bar | Boolean | true | \- | N
+value | String / Number | - | Typescript:`TextareaValue` `type TextareaValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/textarea/type.ts) | N
+default-value | String / Number | undefined | uncontrolled property。Typescript:`TextareaValue` `type TextareaValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/textarea/type.ts) | N
+
+### Textarea Events
+
+name | params | description
+-- | -- | --
+blur | `(value: TextareaValue, cursor: number)` | \-
+change | `(value: TextareaValue, cursor: number)` | \-
+enter | `(value: TextareaValue)` | \-
+focus | `(value: TextareaValue)` | \-
+keyboardheightchange | `(height: number, duration: number)` | \-
+line-change | `(value: TextareaValue)` | \-
+
+### Textarea External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-indicator | \-
+t-class-label | \-
+t-class-textarea | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-textarea-background-color | @bg-color-container | -
+--td-textarea-border-color | rgba(220, 220, 220, 1) | -
+--td-textarea-border-radius | @radius-default | -
+--td-textarea-disabled-text-color | @font-gray-4 | -
+--td-textarea-indicator-text-color | @font-gray-3 | -
+--td-textarea-label-color | @font-gray-1 | -
+--td-textarea-placeholder-color | @font-gray-3 | -
+--td-textarea-text-color | @font-gray-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/README.md b/miniprogram_npm/tdesign-miniprogram/textarea/README.md
new file mode 100644
index 0000000..289d509
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/README.md
@@ -0,0 +1,135 @@
+---
+title: Textarea 多行文本框
+description: 用于多行文本信息输入。
+spline: form
+isComponent: true
+---
+
+


+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-textarea": "tdesign-miniprogram/textarea/textarea"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+基础多行文本框
+
+{{ base }}
+
+带标题多行文本框
+
+{{ label }}
+
+自动增高多行文本框
+
+{{ autosize }}
+
+设置最大字符个数
+
+{{ maxlength }}
+
+设置最大字符个数,一个汉字表示两个字符
+
+{{ maxcharacter }}
+
+### 组件状态
+
+禁用多行文本框
+
+{{ disabled }}
+
+### 自定义组件样式
+
+标签外置输入框
+
+{{ custom }}
+
+## 提示
+
+- 如果需要在页面中调整 `textarea` 中 `placeholder` 样式,请使用名称为`t-textarea__placeholder`的Class选择器,直接覆盖组件内部样式(注意权重)。
+
+## API
+
+
+### Textarea Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N
+allow-input-over-max | Boolean | false | 超出maxlength或maxcharacter之后是否还允许输入 | N
+autofocus | Boolean | false | 自动聚焦,拉起键盘 | N
+autosize | Boolean / Object | false | 是否自动增高,值为 true 时,style.height 不生效。支持传入对象,如 { maxHeight: 120, minHeight: 20 }。TS 类型:`boolean \| { maxHeight?: number, minHeight?: number }` | N
+bordered | Boolean | false | 是否显示外边框 | N
+confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起点 | N
+confirm-type | String | return | 设置键盘右下角按钮的文字,仅在 type='text'时生效。可选项:return/send/search/next/go/done。TS 类型:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N
+cursor | Number | -1 | 指定 focus 时的光标位置 | N
+cursor-spacing | Number | 0 | 指定光标与键盘的距离。取textarea距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离 | N
+disable-default-padding | Boolean | false | 是否去掉 iOS 下的默认内边距 | N
+disabled | Boolean | undefined | 是否禁用文本框 | N
+fixed | Boolean | false | 如果 textarea 是在一个 `position:fixed` 的区域,需要显式指定属性 fixed 为 true | N
+focus | Boolean | false | 自动聚焦 | N
+hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N
+indicator | Boolean | false | 显示文本计数器,如 0/140。当 `maxlength < 0 && maxcharacter < 0` 成立时, indicator无效 | N
+label | String / Slot | - | 左侧文本。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度 | N
+maxlength | Number | -1 | 用户最多可以输入的字符个数,值为 -1 的时候不限制最大长度 | N
+placeholder | String | undefined | 占位符 | N
+placeholder-class | String | textarea-placeholder | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight | N
+placeholder-style | String | - | 指定 placeholder 的样式,目前仅支持 color ,font-size和font-weight | N
+readonly | Boolean | undefined | 只读状态 | N
+selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N
+selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N
+show-confirm-bar | Boolean | true | 是否显示键盘上方带有”完成“按钮那一栏 | N
+value | String / Number | - | 文本框值。TS 类型:`TextareaValue` `type TextareaValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/textarea/type.ts) | N
+default-value | String / Number | undefined | 文本框值。非受控属性。TS 类型:`TextareaValue` `type TextareaValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/textarea/type.ts) | N
+
+### Textarea Events
+
+名称 | 参数 | 描述
+-- | -- | --
+blur | `(value: TextareaValue, cursor: number)` | 失去焦点时触发
+change | `(value: TextareaValue, cursor: number)` | 输入内容变化时触发
+enter | `(value: TextareaValue)` | 点击完成时触发
+focus | `(value: TextareaValue)` | 获得焦点时触发
+keyboardheightchange | `(height: number, duration: number)` | 键盘高度发生变化的时候触发此事件
+line-change | `(value: TextareaValue)` | 行高发生变化时触发
+
+### Textarea External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-indicator | 计数器样式类
+t-class-label | 左侧文本样式类
+t-class-textarea | 多行文本框样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-textarea-background-color | @bg-color-container | -
+--td-textarea-border-color | rgba(220, 220, 220, 1) | -
+--td-textarea-border-radius | @radius-default | -
+--td-textarea-disabled-text-color | @font-gray-4 | -
+--td-textarea-indicator-text-color | @font-gray-3 | -
+--td-textarea-label-color | @font-gray-1 | -
+--td-textarea-placeholder-color | @font-gray-3 | -
+--td-textarea-text-color | @font-gray-1 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/props.d.ts b/miniprogram_npm/tdesign-miniprogram/textarea/props.d.ts
new file mode 100644
index 0000000..83213f6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTextareaProps } from './type';
+declare const props: TdTextareaProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/props.js b/miniprogram_npm/tdesign-miniprogram/textarea/props.js
new file mode 100644
index 0000000..08fc790
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/props.js
@@ -0,0 +1,108 @@
+const props = {
+ adjustPosition: {
+ type: Boolean,
+ value: true,
+ },
+ allowInputOverMax: {
+ type: Boolean,
+ value: false,
+ },
+ autofocus: {
+ type: Boolean,
+ value: false,
+ },
+ autosize: {
+ type: null,
+ value: false,
+ },
+ bordered: {
+ type: Boolean,
+ value: false,
+ },
+ confirmHold: {
+ type: Boolean,
+ value: false,
+ },
+ confirmType: {
+ type: String,
+ value: 'return',
+ },
+ cursor: {
+ type: Number,
+ value: -1,
+ },
+ cursorSpacing: {
+ type: Number,
+ value: 0,
+ },
+ disableDefaultPadding: {
+ type: Boolean,
+ value: false,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ fixed: {
+ type: Boolean,
+ value: false,
+ },
+ focus: {
+ type: Boolean,
+ value: false,
+ },
+ holdKeyboard: {
+ type: Boolean,
+ value: false,
+ },
+ indicator: {
+ type: Boolean,
+ value: false,
+ },
+ label: {
+ type: String,
+ },
+ maxcharacter: {
+ type: Number,
+ },
+ maxlength: {
+ type: Number,
+ value: -1,
+ },
+ placeholder: {
+ type: String,
+ value: undefined,
+ },
+ placeholderClass: {
+ type: String,
+ value: 'textarea-placeholder',
+ },
+ placeholderStyle: {
+ type: String,
+ value: '',
+ },
+ readonly: {
+ type: null,
+ value: undefined,
+ },
+ selectionEnd: {
+ type: Number,
+ value: -1,
+ },
+ selectionStart: {
+ type: Number,
+ value: -1,
+ },
+ showConfirmBar: {
+ type: Boolean,
+ value: true,
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.d.ts b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.d.ts
new file mode 100644
index 0000000..a3d8ec2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.d.ts
@@ -0,0 +1,34 @@
+import { SuperComponent } from '../common/src/index';
+export default class Textarea extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ behaviors: string[];
+ externalClasses: string[];
+ properties: import("./type").TdTextareaProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ count: number;
+ };
+ observers: {
+ value(val: any): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ updateCount(val: any): void;
+ updateValue(val: any): void;
+ calculateValue(value: any, maxcharacter: any, maxlength: any): {
+ value: any;
+ count: number;
+ };
+ onInput(event: any): void;
+ onFocus(event: any): void;
+ onBlur(event: any): void;
+ onConfirm(event: any): void;
+ onLineChange(event: any): void;
+ onKeyboardHeightChange(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js
new file mode 100644
index 0000000..65bf283
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js
@@ -0,0 +1,107 @@
+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}-textarea`;
+let Textarea = class Textarea extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.behaviors = ['wx://form-field'];
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-textarea`,
+ `${prefix}-class-label`,
+ `${prefix}-class-indicator`,
+ ];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ count: 0,
+ };
+ this.observers = {
+ value(val) {
+ this.updateCount(val !== null && val !== void 0 ? val : this.properties.defaultValue);
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ var _a;
+ const { value, defaultValue } = this.properties;
+ this.updateValue((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : '');
+ },
+ };
+ this.methods = {
+ updateCount(val) {
+ const { maxcharacter, maxlength } = this.properties;
+ const { count } = this.calculateValue(val, maxcharacter, maxlength);
+ this.setData({
+ count,
+ });
+ },
+ updateValue(val) {
+ const { maxcharacter, maxlength } = this.properties;
+ const { value, count } = this.calculateValue(val, maxcharacter, maxlength);
+ this.setData({
+ value,
+ count,
+ });
+ },
+ calculateValue(value, maxcharacter, maxlength) {
+ const { allowInputOverMax } = this.properties;
+ if (maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
+ const { length, characters } = getCharacterLength('maxcharacter', value, allowInputOverMax ? Infinity : maxcharacter);
+ return {
+ value: characters,
+ count: length,
+ };
+ }
+ if (maxlength > 0 && !Number.isNaN(maxlength)) {
+ const { length, characters } = getCharacterLength('maxlength', value, allowInputOverMax ? Infinity : maxlength);
+ return {
+ value: characters,
+ count: length,
+ };
+ }
+ return {
+ value,
+ count: value ? String(value).length : 0,
+ };
+ },
+ onInput(event) {
+ const { value, cursor } = event.detail;
+ this.updateValue(value);
+ this.triggerEvent('change', { value: this.data.value, cursor });
+ },
+ onFocus(event) {
+ this.triggerEvent('focus', Object.assign({}, event.detail));
+ },
+ onBlur(event) {
+ this.triggerEvent('blur', Object.assign({}, event.detail));
+ },
+ onConfirm(event) {
+ this.triggerEvent('enter', Object.assign({}, event.detail));
+ },
+ onLineChange(event) {
+ this.triggerEvent('line-change', Object.assign({}, event.detail));
+ },
+ onKeyboardHeightChange(e) {
+ this.triggerEvent('keyboardheightchange', e.detail);
+ },
+ };
+ }
+};
+Textarea = __decorate([
+ wxComponent()
+], Textarea);
+export default Textarea;
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.json b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxml b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxml
new file mode 100644
index 0000000..fbe79bf
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+ {{count}} / {{maxcharacter || maxlength}}
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxs b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxs
new file mode 100644
index 0000000..d675197
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxs
@@ -0,0 +1,16 @@
+/* eslint-disable */
+var utils = require('../common/utils.wxs');
+
+function textareaStyle(autosize) {
+ if (autosize && autosize.constructor === 'Object') {
+ return utils._style({
+ 'min-height': utils.addUnit(autosize.minHeight),
+ 'max-height': utils.addUnit(autosize.maxHeight),
+ });
+ }
+ return '';
+}
+
+module.exports = {
+ textareaStyle: textareaStyle,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxss b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxss
new file mode 100644
index 0000000..f278fb9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.wxss
@@ -0,0 +1,86 @@
+.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-textarea {
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+ padding: 32rpx 32rpx;
+ background-color: var(--td-textarea-background-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-textarea__label:not(:empty) {
+ font-size: var(--td-font-size-base, 28rpx);
+ color: var(--td-textarea-label-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ flex-shrink: 0;
+ line-height: 44rpx;
+ padding-bottom: var(--td-spacer, 16rpx);
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+.t-textarea__wrapper {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ flex: 1 1 auto;
+ overflow: hidden;
+}
+.t-textarea__wrapper-inner {
+ flex: 1 1 auto;
+ box-sizing: border-box;
+ width: inherit;
+ min-width: 0;
+ min-height: 20px;
+ margin: 0;
+ padding: 0;
+ text-align: left;
+ background-color: transparent;
+ border: 0;
+ resize: none;
+ font-size: var(--td-font-size-m, 32rpx);
+ color: var(--td-textarea-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ line-height: 48rpx;
+}
+.t-textarea__placeholder {
+ color: var(--td-textarea-placeholder-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-textarea__indicator:not(:empty) {
+ flex-shrink: 0;
+ color: var(--td-textarea-indicator-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ font-size: var(--td-spacer-1, 24rpx);
+ text-align: right;
+ line-height: 40rpx;
+ padding-top: var(--td-spacer, 16rpx);
+}
+.t-textarea--border {
+ border-radius: var(--td-textarea-border-radius, var(--td-radius-default, 12rpx));
+ border: 2rpx solid var(--td-textarea-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-textarea .t-is-disabled {
+ color: var(--td-textarea-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/type.d.ts b/miniprogram_npm/tdesign-miniprogram/textarea/type.d.ts
new file mode 100644
index 0000000..b113606
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/type.d.ts
@@ -0,0 +1,114 @@
+export interface TdTextareaProps {
+ adjustPosition?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ allowInputOverMax?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ autofocus?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ autosize?: {
+ type: null;
+ value?: boolean | {
+ maxHeight?: number;
+ minHeight?: number;
+ };
+ };
+ bordered?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ confirmHold?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ confirmType?: {
+ type: StringConstructor;
+ value?: 'return' | 'send' | 'search' | 'next' | 'go' | 'done';
+ };
+ cursor?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ cursorSpacing?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ disableDefaultPadding?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ fixed?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ focus?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ holdKeyboard?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ indicator?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ 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;
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ selectionEnd?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ selectionStart?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ showConfirmBar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: TextareaValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: TextareaValue;
+ };
+}
+export declare type TextareaValue = string | number;
diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/type.js b/miniprogram_npm/tdesign-miniprogram/textarea/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/textarea/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/toast/README.en-US.md
new file mode 100644
index 0000000..579747c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/README.en-US.md
@@ -0,0 +1,44 @@
+:: BASE_DOC ::
+
+## API
+
+### Toast 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
+direction | String | row | options: row/column | N
+duration | Number | 2000 | \- | N
+icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+message | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+overlay-props | Object | - | Typescript:`OverlayProps `,[Overlay API Documents](./overlay?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/toast/type.ts) | N
+placement | String | middle | options: top/middle/bottom | N
+prevent-scroll-through | Boolean | false | \- | N
+show-overlay | Boolean | false | \- | N
+theme | String | - | options: loading/success/error | N
+using-custom-navbar | Boolean | false | \- | N
+
+### Toast Events
+
+name | params | description
+-- | -- | --
+close | \- | \-
+destroy | \- | \-
+### Toast 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-toast-bg-color | @font-gray-2 | -
+--td-toast-color | @font-white-1 | -
+--td-toast-column-icon-size | 64rpx | -
+--td-toast-max-width | 374rpx | -
+--td-toast-radius | 8rpx | -
+--td-toast-row-icon-size | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/README.md b/miniprogram_npm/tdesign-miniprogram/toast/README.md
new file mode 100644
index 0000000..bc6e1ee
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/README.md
@@ -0,0 +1,81 @@
+---
+title: Toast 轻提示
+description: 用于轻量级反馈或提示,不会打断用户操作。
+spline: message
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-toast": "tdesign-miniprogram/toast/toast"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 基础提示
+
+{{ base }}
+
+### 组件状态
+
+{{ theme }}
+
+### 显示遮罩
+{{ cover }}
+
+### 手动关闭
+{{ close }}
+## API
+
+### Toast Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+direction | String | row | 图标排列方式。可选项:row/column | N
+duration | Number | 2000 | 弹窗显示毫秒数 | N
+icon | String / Object / Slot | - | 自定义图标。传入对象则透传至 Icon 组件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+message | String / Slot | - | 弹窗显示文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+overlay-props | Object | - | 遮罩层属性,透传至 Overlay。TS 类型:`OverlayProps `,[Overlay API Documents](./overlay?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/toast/type.ts) | N
+placement | String | middle | 弹窗展示位置。可选项: top/middle/bottom | N
+prevent-scroll-through | Boolean | false | 防止滚动穿透,即不允许点击和滚动 | N
+show-overlay | Boolean | false | 是否显示遮罩层 | N
+theme | String | - | 提示类型。可选项:loading/success/error | N
+using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
+
+### Toast Events
+
+名称 | 参数 | 描述
+-- | -- | --
+close | \- | 轻提示隐藏的时候触发
+destroy | \- | 轻提示销毁的时候触发
+### Toast External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-toast-bg-color | @font-gray-2 | -
+--td-toast-color | @font-white-1 | -
+--td-toast-column-icon-size | 64rpx | -
+--td-toast-max-width | 374rpx | -
+--td-toast-radius | 8rpx | -
+--td-toast-row-icon-size | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/index.d.ts b/miniprogram_npm/tdesign-miniprogram/toast/index.d.ts
new file mode 100644
index 0000000..4f0c188
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/index.d.ts
@@ -0,0 +1,22 @@
+///
+///
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+declare type ToastType = 'loading' | 'success' | 'error';
+declare type ToastPositionType = 'top' | 'middle' | 'bottom';
+declare type ToastDirectionType = 'row' | 'column';
+export declare type ToastOptionsType = {
+ context?: Context;
+ selector?: string;
+ icon?: string;
+ message?: string;
+ duration?: number;
+ theme?: ToastType;
+ placement?: ToastPositionType;
+ preventScrollThrough?: boolean;
+ direction?: ToastDirectionType;
+ close?: () => void;
+};
+declare function Toast(options: ToastOptionsType): void;
+declare function showToast(options?: ToastOptionsType): void;
+declare function hideToast(options?: ToastOptionsType): void;
+export { Toast as default, showToast, hideToast };
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/index.js b/miniprogram_npm/tdesign-miniprogram/toast/index.js
new file mode 100644
index 0000000..216f208
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/index.js
@@ -0,0 +1,31 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import { getInstance } from '../common/utils';
+function Toast(options) {
+ var _a;
+ const { context, selector = '#t-toast' } = options, Options = __rest(options, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.show(Object.assign(Object.assign({}, Options), { duration: (_a = Options.duration) !== null && _a !== void 0 ? _a : 2000 }));
+ }
+}
+function showToast(options = {}) {
+ Toast(options);
+}
+function hideToast(options = {}) {
+ const { context, selector = '#t-toast' } = options;
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.hide();
+ }
+}
+export { Toast as default, showToast, hideToast };
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/props.d.ts b/miniprogram_npm/tdesign-miniprogram/toast/props.d.ts
new file mode 100644
index 0000000..c6b0f86
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/props.d.ts
@@ -0,0 +1,3 @@
+import { TdToastProps } from './type';
+declare const props: TdToastProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/props.js b/miniprogram_npm/tdesign-miniprogram/toast/props.js
new file mode 100644
index 0000000..cbdfd0c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/props.js
@@ -0,0 +1,39 @@
+const props = {
+ direction: {
+ type: String,
+ value: 'row',
+ },
+ duration: {
+ type: Number,
+ value: 2000,
+ },
+ icon: {
+ type: null,
+ },
+ message: {
+ type: String,
+ },
+ overlayProps: {
+ type: Object,
+ },
+ placement: {
+ type: String,
+ value: 'middle',
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: false,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: false,
+ },
+ theme: {
+ type: String,
+ },
+ usingCustomNavbar: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/toast.d.ts b/miniprogram_npm/tdesign-miniprogram/toast/toast.d.ts
new file mode 100644
index 0000000..ce0f9fc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/toast.d.ts
@@ -0,0 +1,31 @@
+///
+import { SuperComponent } from '../common/src/index';
+import { ToastOptionsType } from './index';
+declare type Timer = NodeJS.Timeout | null;
+export default class Toast extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ behaviors: string[];
+ hideTimer: Timer;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ typeMapIcon: string;
+ };
+ properties: import("./type").TdToastProps;
+ lifetimes: {
+ detached(): void;
+ };
+ pageLifetimes: {
+ hide(): void;
+ };
+ methods: {
+ show(options: ToastOptionsType): void;
+ hide(): void;
+ destroyed(): void;
+ loop(): void;
+ };
+}
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/toast.js b/miniprogram_npm/tdesign-miniprogram/toast/toast.js
new file mode 100644
index 0000000..be660e5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/toast.js
@@ -0,0 +1,91 @@
+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 transition from '../mixins/transition';
+import { calcIcon } from '../common/utils';
+import useCustomNavbar from '../mixins/using-custom-navbar';
+const { prefix } = config;
+const name = `${prefix}-toast`;
+let Toast = class Toast extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.behaviors = [transition(), useCustomNavbar];
+ this.hideTimer = null;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ typeMapIcon: '',
+ };
+ this.properties = props;
+ this.lifetimes = {
+ detached() {
+ this.destroyed();
+ },
+ };
+ this.pageLifetimes = {
+ hide() {
+ this.hide();
+ },
+ };
+ this.methods = {
+ show(options) {
+ if (this.hideTimer)
+ clearTimeout(this.hideTimer);
+ const iconMap = {
+ loading: 'loading',
+ success: 'check-circle',
+ warning: 'error-circle',
+ error: 'close-circle',
+ };
+ const typeMapIcon = iconMap[options === null || options === void 0 ? void 0 : options.theme];
+ const defaultOptions = {
+ direction: props.direction.value,
+ duration: props.duration.value,
+ icon: props.icon.value,
+ message: props.message.value,
+ placement: props.placement.value,
+ preventScrollThrough: props.preventScrollThrough.value,
+ theme: props.theme.value,
+ };
+ const data = Object.assign(Object.assign(Object.assign({}, defaultOptions), options), { visible: true, isLoading: (options === null || options === void 0 ? void 0 : options.theme) === 'loading', _icon: calcIcon(typeMapIcon !== null && typeMapIcon !== void 0 ? typeMapIcon : options.icon) });
+ const { duration } = data;
+ this.setData(data);
+ if (duration > 0) {
+ this.hideTimer = setTimeout(() => {
+ this.hide();
+ }, duration);
+ }
+ },
+ hide() {
+ var _a, _b;
+ if (!this.data.visible)
+ return;
+ this.setData({ visible: false });
+ (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
+ this.triggerEvent('close');
+ },
+ destroyed() {
+ if (this.hideTimer) {
+ clearTimeout(this.hideTimer);
+ this.hideTimer = null;
+ }
+ this.triggerEvent('destory');
+ },
+ loop() { },
+ };
+ }
+};
+Toast = __decorate([
+ wxComponent()
+], Toast);
+export default Toast;
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/toast.json b/miniprogram_npm/tdesign-miniprogram/toast/toast.json
new file mode 100644
index 0000000..bccc6a2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/toast.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-loading": "../loading/loading",
+ "t-overlay": "../overlay/overlay"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/toast.wxml b/miniprogram_npm/tdesign-miniprogram/toast/toast.wxml
new file mode 100644
index 0000000..44576ff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/toast.wxml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+ {{message}}
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/toast.wxss b/miniprogram_npm/tdesign-miniprogram/toast/toast.wxss
new file mode 100644
index 0000000..a927e1a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/toast.wxss
@@ -0,0 +1,98 @@
+.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-toast {
+ position: fixed;
+ right: -50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 12001;
+ opacity: 1;
+ transition: opacity 300ms ease;
+ background-color: var(--td-toast-bg-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
+ border-radius: var(--td-toast-radius, 8rpx);
+ font-size: 28rpx;
+ color: var(--td-toast-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
+ max-width: var(--td-toast-max-width, 374rpx);
+ width: fit-content;
+ box-sizing: border-box;
+}
+.t-toast--column {
+ padding: 48rpx;
+ min-width: 160rpx;
+ min-height: 160rpx;
+ border-radius: 16rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-toast--loading.t-toast--with-text {
+ min-width: 204rpx;
+ min-height: 204rpx;
+ padding-top: 0;
+ padding-bottom: 0;
+}
+.t-toast__content {
+ align-items: center;
+ line-height: 44rpx;
+}
+.t-toast__content--row {
+ display: flex;
+ text-align: left;
+ padding: 28rpx 44rpx;
+}
+.t-toast__content--column {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+.t-toast__icon--row {
+ display: flex;
+ font-size: var(--td-toast-row-icon-size, 48rpx);
+}
+.t-toast__icon--column {
+ font-size: var(--td-toast-column-icon-size, 64rpx);
+}
+.t-toast__text {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -webkit-line-clamp: 3;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ white-space: pre-line;
+}
+.t-toast__text--column:not(:empty):not(:only-child) {
+ margin-top: 16rpx;
+}
+.t-toast__text--row:not(:empty):not(:only-child) {
+ margin-left: 16rpx;
+}
+.t-toast.t-fade-enter,
+.t-toast.t-fade-leave-to {
+ opacity: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/type.d.ts b/miniprogram_npm/tdesign-miniprogram/toast/type.d.ts
new file mode 100644
index 0000000..b93d02c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/type.d.ts
@@ -0,0 +1,43 @@
+import { OverlayProps } from '../overlay/index';
+export interface TdToastProps {
+ direction?: {
+ type: StringConstructor;
+ value?: 'row' | 'column';
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ message?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ overlayProps?: {
+ type: ObjectConstructor;
+ value?: OverlayProps;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'top' | 'middle' | 'bottom';
+ };
+ preventScrollThrough?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'loading' | 'success' | 'error';
+ };
+ usingCustomNavbar?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/toast/type.js b/miniprogram_npm/tdesign-miniprogram/toast/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/toast/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/transition/README.en-US.md
new file mode 100644
index 0000000..4bb6d13
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/README.en-US.md
@@ -0,0 +1,15 @@
+:: BASE_DOC ::
+
+## API
+
+### Transition 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
+appear | Boolean | false | \- | N
+destory-on-hide | Boolean | false | \- | N
+durations | Number / Array | - | Typescript:`number \| number[]` | N
+name | String | t-transition | \- | N
+visible | Boolean | false | \- | N
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/README.md b/miniprogram_npm/tdesign-miniprogram/transition/README.md
new file mode 100644
index 0000000..27e1b41
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/README.md
@@ -0,0 +1,46 @@
+---
+title: Transition 过渡
+description: 过渡组件。
+spline: message
+isComponent: true
+---
+
+## 引入
+
+### 引入组件
+
+在 `app.json` 或 `page.json` 中引入组件:
+
+```json
+"usingComponents": {
+ "t-transition": "tdesign-miniprogram/transition/transition"
+}
+```
+
+## 用法
+
+### 组件方式
+
+```xml
+
+
+
+
+```
+
+## API
+
+### Transition Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+appear | Boolean | false | 首次出现是否展示动画 | N
+destory-on-hide | Boolean | false | 隐藏时是否销毁内容 | N
+durations | Number / Array | - | 指定过渡时间。TS 类型:`number \| number[]` | N
+name | String | t-transition | 过渡类名 | N
+visible | Boolean | false | 是否显示 | N
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/index.d.ts b/miniprogram_npm/tdesign-miniprogram/transition/index.d.ts
new file mode 100644
index 0000000..e5ac999
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/index.d.ts
@@ -0,0 +1,2 @@
+export * from './props';
+export * from './type';
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/index.js b/miniprogram_npm/tdesign-miniprogram/transition/index.js
new file mode 100644
index 0000000..e5ac999
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/index.js
@@ -0,0 +1,2 @@
+export * from './props';
+export * from './type';
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/props.d.ts b/miniprogram_npm/tdesign-miniprogram/transition/props.d.ts
new file mode 100644
index 0000000..0343aed
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTransitionProps } from './type';
+declare const props: TdTransitionProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/props.js b/miniprogram_npm/tdesign-miniprogram/transition/props.js
new file mode 100644
index 0000000..6a7619a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/props.js
@@ -0,0 +1,22 @@
+const props = {
+ appear: {
+ type: Boolean,
+ value: false,
+ },
+ destoryOnHide: {
+ type: Boolean,
+ value: false,
+ },
+ durations: {
+ type: null,
+ },
+ name: {
+ type: String,
+ value: 't-transition',
+ },
+ visible: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/transition.d.ts b/miniprogram_npm/tdesign-miniprogram/transition/transition.d.ts
new file mode 100644
index 0000000..e487bd5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/transition.d.ts
@@ -0,0 +1,8 @@
+import { SuperComponent } from '../common/src/index';
+export default class Transition extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ data: {
+ classPrefix: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/transition.js b/miniprogram_npm/tdesign-miniprogram/transition/transition.js
new file mode 100644
index 0000000..b24f56a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/transition.js
@@ -0,0 +1,25 @@
+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 transition from '../mixins/transition';
+import config from '../common/config';
+const { prefix } = config;
+const name = `${prefix}-transition`;
+let Transition = class Transition extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.behaviors = [transition()];
+ this.data = {
+ classPrefix: name,
+ };
+ }
+};
+Transition = __decorate([
+ wxComponent()
+], Transition);
+export default Transition;
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/transition.json b/miniprogram_npm/tdesign-miniprogram/transition/transition.json
new file mode 100644
index 0000000..4f0a3f0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/transition.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/transition.wxml b/miniprogram_npm/tdesign-miniprogram/transition/transition.wxml
new file mode 100644
index 0000000..d8390d8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/transition.wxml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/transition.wxss b/miniprogram_npm/tdesign-miniprogram/transition/transition.wxss
new file mode 100644
index 0000000..aa8777f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/transition.wxss
@@ -0,0 +1,14 @@
+.t-transition-enter {
+ opacity: 0;
+}
+.t-transition-enter-to {
+ opacity: 1;
+ transition: opacity 1s;
+}
+.t-transition-leave {
+ opacity: 1;
+}
+.t-transition-leave-to {
+ opacity: 0;
+ transition: opacity 1s;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/type.d.ts b/miniprogram_npm/tdesign-miniprogram/transition/type.d.ts
new file mode 100644
index 0000000..998100c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/type.d.ts
@@ -0,0 +1,22 @@
+export interface TdTransitionProps {
+ appear?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ destoryOnHide?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ durations?: {
+ type: null;
+ value?: number | number[];
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/transition/type.js b/miniprogram_npm/tdesign-miniprogram/transition/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/transition/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/tree-select/README.en-US.md
new file mode 100644
index 0000000..bceb50c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/README.en-US.md
@@ -0,0 +1,46 @@
+:: BASE_DOC ::
+
+## API
+
+### TreeSelect 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
+height | String / Number | 336 | \- | N
+keys | Object | - | alias filed name in data。Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+multiple | Boolean | false | \- | N
+options | Array | [] | Typescript:`Array` | N
+value | String / Number / Array | - | Typescript:`TreeSelectValue` `type TreeSelectValue = string \| number \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tree-select/type.ts) | N
+default-value | String / Number / Array | undefined | uncontrolled property。Typescript:`TreeSelectValue` `type TreeSelectValue = string \| number \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tree-select/type.ts) | N
+
+### TreeSelect Events
+
+name | params | description
+-- | -- | --
+change | `(value: TreeSelectValue, level: TreeLevel) ` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tree-select/type.ts)。
`type TreeLevel = 0 \| 1 \| 2`
+
+### TreeSelect External Classes
+
+className | Description
+-- | --
+t-class | \-
+t-class-left-column | \-
+t-class-left-item | \-
+t-class-middle-item | \-
+t-class-right-column | \-
+t-class-right-item | \-
+t-class-right-item-label | \-
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-tree-bg-color | @bg-color-container | -
+--td-tree-colum-width | 206rpx | -
+--td-tree-item-active-color | @brand-color | -
+--td-tree-item-font-size | 32rpx | -
+--td-tree-item-height | 112rpx | -
+--td-tree-root-bg-color | @bg-color-secondarycontainer | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/README.md b/miniprogram_npm/tdesign-miniprogram/tree-select/README.md
new file mode 100644
index 0000000..94e7af1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/README.md
@@ -0,0 +1,92 @@
+---
+title: TreeSelect 树形选择
+description: 适用于选择树形的数据结构。
+spline: form
+isComponent: true
+---
+
+
+
+ 该组件于 0.32.0 版本上线,请留意版本。
+
+
+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-tree-select": "tdesign-miniprogram/tree-select/tree-select"
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 组件类型
+
+#### 基础树形选择
+
+{{ base }}
+
+#### 多选树形选择
+
+{{ multiple }}
+
+### 组件状态
+
+#### 三级树形选择
+
+{{ normal }}
+
+## API
+
+### TreeSelect Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+height | String / Number | 336 | 高度,默认单位为 px | N
+keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+multiple | Boolean | false | 是否允许多选 | N
+options | Array | [] | 选项。TS 类型:`Array` | N
+value | String / Number / Array | - | 选中值。TS 类型:`TreeSelectValue` `type TreeSelectValue = string \| number \| Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tree-select/type.ts) | N
+default-value | String / Number / Array | undefined | 选中值。非受控属性。TS 类型:`TreeSelectValue` `type TreeSelectValue = string \| number \| Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tree-select/type.ts) | N
+
+### TreeSelect Events
+
+名称 | 参数 | 描述
+-- | -- | --
+change | `(value: TreeSelectValue, level: TreeLevel) ` | 点击任何节点均会触发;level 代表当前点击的层级,0 代表最左侧,依次递进。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tree-select/type.ts)。
`type TreeLevel = 0 \| 1 \| 2`
+
+### TreeSelect External Classes
+
+类名 | 描述
+-- | --
+t-class | 根节点样式类
+t-class-left-column | 左侧第一列样式类
+t-class-left-item | 左侧第一列子项样式类
+t-class-middle-item | 中间列子项样式类
+t-class-right-column | 右侧第一列样式类
+t-class-right-item | 右侧第一列子项样式类
+t-class-right-item-label | 右侧第一列子项标签样式类
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-tree-bg-color | @bg-color-container | -
+--td-tree-colum-width | 206rpx | -
+--td-tree-item-active-color | @brand-color | -
+--td-tree-item-font-size | 32rpx | -
+--td-tree-item-height | 112rpx | -
+--td-tree-root-bg-color | @bg-color-secondarycontainer | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/index.wxs b/miniprogram_npm/tdesign-miniprogram/tree-select/index.wxs
new file mode 100644
index 0000000..dc28a9d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/index.wxs
@@ -0,0 +1,7 @@
+var getTreeClass = function (level, total) {
+ if (level === 0) return 'right';
+ if (level === 1 && level !== total - 1) return 'middle';
+ return 'left';
+};
+
+module.exports.getTreeClass = getTreeClass;
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tree-select/props.d.ts
new file mode 100644
index 0000000..465bea2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTreeSelectProps } from './type';
+declare const props: TdTreeSelectProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/props.js b/miniprogram_npm/tdesign-miniprogram/tree-select/props.js
new file mode 100644
index 0000000..bca5d9e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/props.js
@@ -0,0 +1,25 @@
+const props = {
+ height: {
+ type: null,
+ value: 336,
+ },
+ keys: {
+ type: Object,
+ },
+ multiple: {
+ type: Boolean,
+ value: false,
+ },
+ options: {
+ type: Array,
+ value: [],
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.d.ts b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.d.ts
new file mode 100644
index 0000000..4203334
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.d.ts
@@ -0,0 +1,60 @@
+import { SuperComponent } from '../common/src/index';
+import type { TreeOptionData } from '../common/common';
+export default class TreeSelect extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ scrollIntoView: any;
+ };
+ properties: {
+ customValue: {
+ type: any;
+ value: any;
+ };
+ height?: {
+ type: null;
+ value?: string | number;
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: import("../common/common").KeysType;
+ };
+ multiple?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: TreeOptionData[];
+ };
+ value?: {
+ type: null;
+ value?: import("./type").TreeSelectValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: import("./type").TreeSelectValue;
+ };
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ 'value, customValue, options, keys, multiple'(): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ methods: {
+ buildTreeOptions(): void;
+ getScrollIntoView(status: string): void;
+ onRootChange(e: any): void;
+ handleTreeClick(e: any): void;
+ handleRadioChange(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.js b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.js
new file mode 100644
index 0000000..3b8d1d4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.js
@@ -0,0 +1,144 @@
+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}-tree-select`;
+let TreeSelect = class TreeSelect extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-left-column`,
+ `${prefix}-class-left-item`,
+ `${prefix}-class-middle-item`,
+ `${prefix}-class-right-column`,
+ `${prefix}-class-right-item`,
+ `${prefix}-class-right-item-label`,
+ ];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ scrollIntoView: null,
+ };
+ this.properties = Object.assign(Object.assign({}, props), { customValue: {
+ type: null,
+ value: null,
+ } });
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ 'value, customValue, options, keys, multiple'() {
+ this.buildTreeOptions();
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.getScrollIntoView('init');
+ },
+ };
+ this.methods = {
+ buildTreeOptions() {
+ const { options, value, defaultValue, customValue, multiple, keys } = this.data;
+ const treeOptions = [];
+ let level = -1;
+ let node = { children: options };
+ if (options.length === 0)
+ return;
+ while (node && node.children) {
+ level += 1;
+ const list = node.children.map((item) => ({
+ label: item[(keys === null || keys === void 0 ? void 0 : keys.label) || 'label'],
+ value: item[(keys === null || keys === void 0 ? void 0 : keys.value) || 'value'],
+ children: item.children,
+ }));
+ const thisValue = (customValue === null || customValue === void 0 ? void 0 : customValue[level]) || (value === null || value === void 0 ? void 0 : value[level]);
+ treeOptions.push([...list]);
+ if (thisValue == null) {
+ const [firstChild] = list;
+ node = firstChild;
+ }
+ else {
+ const child = list.find((child) => child.value === thisValue);
+ node = child !== null && child !== void 0 ? child : list[0];
+ }
+ }
+ const leafLevel = Math.max(0, level);
+ if (multiple) {
+ const finalValue = customValue || value || defaultValue;
+ if (finalValue[leafLevel] != null && !Array.isArray(finalValue[leafLevel])) {
+ throw TypeError('应传入数组类型的 value');
+ }
+ }
+ this.setData({
+ innerValue: customValue ||
+ (treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.map((ele, idx) => {
+ const v = idx === treeOptions.length - 1 && multiple ? [ele[0].value] : ele[0].value;
+ return (value === null || value === void 0 ? void 0 : value[idx]) || v;
+ })),
+ leafLevel,
+ treeOptions,
+ });
+ },
+ getScrollIntoView(status) {
+ const { value, customValue, scrollIntoView } = this.data;
+ if (status === 'init') {
+ const _value = customValue || value;
+ const scrollIntoView = Array.isArray(_value)
+ ? _value.map((item) => {
+ return Array.isArray(item) ? item[0] : item;
+ })
+ : [_value];
+ this.setData({
+ scrollIntoView,
+ });
+ }
+ else {
+ if (scrollIntoView === null)
+ return;
+ this.setData({
+ scrollIntoView: null,
+ });
+ }
+ },
+ onRootChange(e) {
+ const { innerValue } = this.data;
+ const { value: itemValue } = e.detail;
+ this.getScrollIntoView('none');
+ innerValue[0] = itemValue;
+ this._trigger('change', { value: innerValue, level: 0 });
+ },
+ handleTreeClick(e) {
+ const { level, value: itemValue } = e.currentTarget.dataset;
+ const { innerValue } = this.data;
+ innerValue[level] = itemValue;
+ this.getScrollIntoView('none');
+ this._trigger('change', { value: innerValue, level: 1 });
+ },
+ handleRadioChange(e) {
+ const { innerValue } = this.data;
+ const { value: itemValue } = e.detail;
+ const { level } = e.target.dataset;
+ innerValue[level] = itemValue;
+ this.getScrollIntoView('none');
+ this._trigger('change', { value: innerValue, level });
+ },
+ };
+ }
+};
+TreeSelect = __decorate([
+ wxComponent()
+], TreeSelect);
+export default TreeSelect;
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.json b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.json
new file mode 100644
index 0000000..2527f51
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.json
@@ -0,0 +1,13 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-radio": "../radio/radio",
+ "t-radio-group": "../radio-group/radio-group",
+ "t-checkbox": "../checkbox/checkbox",
+ "t-checkbox-group": "../checkbox-group/checkbox-group",
+ "t-side-bar": "../side-bar/side-bar",
+ "t-side-bar-item": "../side-bar-item/side-bar-item",
+ "t-scroll-view": "../scroll-view/scroll-view"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.wxml b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.wxml
new file mode 100644
index 0000000..8b13be8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.wxml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+ {{item.label}}
+
+
+
+
+ {{item.label}}
+
+
+
+
+ {{item.label}}
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.wxss b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.wxss
new file mode 100644
index 0000000..8886161
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/tree-select.wxss
@@ -0,0 +1,66 @@
+.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-tree-select {
+ display: flex;
+ background-color: var(--td-tree-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tree-select__column {
+ width: var(--td-tree-colum-width, 206rpx);
+ color: var(--td-tree-colum-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+}
+.t-tree-select__column--left {
+ background: var(--td-tree-root-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tree-select__column--right {
+ flex: 1;
+}
+.t-tree-select__column::-webkit-scrollbar {
+ display: none;
+ width: 0;
+ height: 0;
+ color: transparent;
+}
+.t-tree-select__item {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -webkit-line-clamp: 1;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ height: var(--td-tree-item-height, 112rpx);
+ line-height: var(--td-tree-item-height, 112rpx);
+ font-size: var(--td-tree-item-font-size, 32rpx);
+ padding-left: 32rpx;
+}
+.t-tree-select__item--active {
+ font-weight: 600;
+ color: var(--td-tree-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tree-select-column {
+ width: 100%;
+ height: auto;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tree-select/type.d.ts
new file mode 100644
index 0000000..de289dc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/type.d.ts
@@ -0,0 +1,28 @@
+import { TreeOptionData, KeysType } from '../common/common';
+export interface TdTreeSelectProps {
+ height?: {
+ type: null;
+ value?: string | number;
+ };
+ keys?: {
+ type: ObjectConstructor;
+ value?: KeysType;
+ };
+ multiple?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ value?: {
+ type: null;
+ value?: TreeSelectValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: TreeSelectValue;
+ };
+}
+export declare type TreeSelectValue = string | number | Array;
diff --git a/miniprogram_npm/tdesign-miniprogram/tree-select/type.js b/miniprogram_npm/tdesign-miniprogram/tree-select/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tree-select/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/upload/README.en-US.md
new file mode 100644
index 0000000..152c161
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/README.en-US.md
@@ -0,0 +1,53 @@
+:: BASE_DOC ::
+
+## API
+
+### Upload 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
+add-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+allow-upload-duplicate-file | Boolean | false | `暂不支持`。allow to upload duplicate name files | N
+config | Object | - | Typescript:`UploadMpConfig` `type UploadMpConfig = ImageConfig \| VideoConfig` `interface ImageConfig { count?: number; sizeType?: Array; sourceType?: Array }` `type SizeTypeValues = 'original' \| 'compressed'` `type SourceTypeValues = 'album' \| 'camera'` `interface VideoConfig { sourceType?: Array; compressed?: boolean; maxDuration?: number; camera?: 'back' \| 'front' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+disabled | Boolean | undefined | make upload to be disabled | N
+draggable | Boolean / Object | - | Typescript:`boolean \| {vibrate?: boolean; collisionVibrate?: boolean}` | N
+files | Array | - | Typescript:`Array` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+default-files | Array | undefined | uncontrolled property。Typescript:`Array` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+grid-config | Object | - | Typescript:`{column?: number; width?: number; height?: number;}` | N
+gutter | Number | 16 | \- | N
+image-props | Object | - | Typescript:`ImageProps`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+max | Number | 0 | max count of files limit | N
+media-type | Array | ['image', 'video'] | Typescript:`Array` `type MediaType = 'image' \| 'video'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+request-method | Function | - | \- | N
+size-limit | Number / Object | - | files size limit。Typescript:`number \| SizeLimitObj` `interface SizeLimitObj { size: number; unit: SizeUnit ; message?: string }` `type SizeUnitArray = ['B', 'KB', 'MB', 'GB']` `type SizeUnit = SizeUnitArray[number]`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+source | String | media | options: media/messageFile | N
+transition | Object | { backTransition: true, duration: 300, timingFunction: 'ease' } | Typescript:`Transition` `interface Transition { backTransition?: boolean, duration?: number, timingFunction?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+
+### Upload Events
+
+name | params | description
+-- | -- | --
+add | `(files: MediaContext)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts)。
`type MediaContext = VideoContext[] \| ImageContext[]`
`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`
`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`
+click | `(file: VideoContext \| ImageContext)` | \-
+complete | \- | \-
+drop | `(files: MediaContext) ` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts)。
`type MediaContext = VideoContext[] \| ImageContext[]; interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }; interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number}`
+fail | \- | \-
+remove | `(index: number; file: UploadFile)` | \-
+select-change | `(files: MediaContext[]; currentSelectedFiles: MediaContext[])` | \-
+success | `(files: MediaContext)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts)。
`type MediaContext = VideoContext[] \| ImageContext[]`
`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`
`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`
+
+### CSS Variables
+
+The component provides the following CSS variables, which can be used to customize styles.
+Name | Default Value | Description
+-- | -- | --
+--td-upload-add-bg-color | @bg-color-secondarycontainer | -
+--td-upload-add-color | @font-gray-3 | -
+--td-upload-add-disabled-bg-color | @bg-color-component-disabled | -
+--td-upload-add-icon-disabled-color | @text-color-disabled | -
+--td-upload-add-icon-font-size | 56rpx | -
+--td-upload-disabled-mask | rgba(255, 255, 255, 0.55) | -
+--td-upload-radius | @radius-default | -
+--td-upload-drag-z-index | 999 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/README.md b/miniprogram_npm/tdesign-miniprogram/upload/README.md
new file mode 100644
index 0000000..bcb4deb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/README.md
@@ -0,0 +1,109 @@
+---
+title: Upload 上传
+description: 用于相册读取或拉起拍照的图片上传功能。
+spline: form
+isComponent: true
+---
+
+


+## 引入
+
+全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
+
+```json
+"usingComponents": {
+ "t-upload": "tdesign-miniprogram/upload/upload",
+}
+```
+
+## 代码演示
+
+ 在开发者工具中预览效果
+
+
+Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
+
+
+### 单选上传图片
+
+图片上传有两种方式:
+
+1 选择完所有图片之后,统一上传,因此选择完就直接展示
+
+2 每次选择图片都上传,展示每次上传图片的进度
+
+{{ single }}
+
+### 多选上传图片
+
+{{ multiple }}
+
+### 长按拖拽排序图片
+
+{{ drag }}
+
+### 加载状态
+
+支持多种状态:`loading`、`reload`、`failed`;
+
+其中 `loading` 还可以通过传入 `percent` 来区分是否展示进度。
+
+{{ status }}
+
+### 从聊天记录上选
+
+使用 `wx.chooseMessageFile` 实现,需要基础版本库 `2.5.0+`
+
+{{ messageFile }}
+
+## API
+
+### Upload Props
+
+名称 | 类型 | 默认值 | 描述 | 必传
+-- | -- | -- | -- | --
+style | Object | - | 样式 | N
+custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
+add-content | String / Slot | - | 添加按钮内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
+allow-upload-duplicate-file | Boolean | false | `暂不支持`。是否允许重复上传相同文件名的文件 | N
+config | Object | - | 图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)。TS 类型:`UploadMpConfig` `type UploadMpConfig = ImageConfig \| VideoConfig` `interface ImageConfig { count?: number; sizeType?: Array; sourceType?: Array }` `type SizeTypeValues = 'original' \| 'compressed'` `type SourceTypeValues = 'album' \| 'camera'` `interface VideoConfig { sourceType?: Array; compressed?: boolean; maxDuration?: number; camera?: 'back' \| 'front' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+disabled | Boolean | undefined | 是否禁用组件 | N
+draggable | Boolean / Object | - | 是否支持拖拽排序。长按时是否振动,碰撞时是否振动。示例一:`true`。示例二:`{ vibrate: true, collisionVibrate: true }`。TS 类型:`boolean \| {vibrate?: boolean; collisionVibrate?: boolean}` | N
+files | Array | - | 已上传文件列表。TS 类型:`Array` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+default-files | Array | undefined | 已上传文件列表。非受控属性。TS 类型:`Array` `interface UploadFile { url: string; name?: string; size?: number; type?: 'image' \| 'video'; percent?: number; status: 'loading' \| 'reload' \| 'failed' \| 'done' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+grid-config | Object | - | upload组件每行上传图片列数以及图片的宽度和高度。TS 类型:`{column?: number; width?: number; height?: number;}` | N
+gutter | Number | 16 | 预览窗格的 `gutter` 大小,单位 rpx | N
+image-props | Object | - | 透传 Image 组件全部属性。TS 类型:`ImageProps`,[Image API Documents](./image?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+max | Number | 0 | 用于控制文件上传数量,值为 0 则不限制 | N
+media-type | Array | ['image', 'video'] | 支持上传的文件类型,图片或视频。TS 类型:`Array` `type MediaType = 'image' \| 'video'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+request-method | Function | - | 自定义上传方法 | N
+size-limit | Number / Object | - | 图片文件大小限制,默认单位 KB。可选单位有:`'B' \| 'KB' \| 'MB' \| 'GB'`。示例一:`1000`。示例二:`{ size: 2, unit: 'MB', message: '图片大小不超过 {sizeLimit} MB' }`。TS 类型:`number \| SizeLimitObj` `interface SizeLimitObj { size: number; unit: SizeUnit ; message?: string }` `type SizeUnitArray = ['B', 'KB', 'MB', 'GB']` `type SizeUnit = SizeUnitArray[number]`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+source | String | media | 来源。可选项:media/messageFile | N
+transition | Object | { backTransition: true, duration: 300, timingFunction: 'ease' } | 拖拽位置移动时的过渡参数,`duration`单位为ms。TS 类型:`Transition` `interface Transition { backTransition?: boolean, duration?: number, timingFunction?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts) | N
+
+### Upload Events
+
+名称 | 参数 | 描述
+-- | -- | --
+add | `(files: MediaContext)` | 选择后触发,仅包含本次选择的照片;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts)。
`type MediaContext = VideoContext[] \| ImageContext[]`
`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`
`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`
+click | `(file: VideoContext \| ImageContext)` | 点击已选文件时触发;常用于重新上传
+complete | \- | 上传成功或失败后触发
+drop | `(files: MediaContext) ` | 拖拽结束后触发,包含所有上传的文件(拖拽后的文件顺序);`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size` 选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts)。
`type MediaContext = VideoContext[] \| ImageContext[]; interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }; interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number}`
+fail | \- | 上传失败后触发
+remove | `(index: number; file: UploadFile)` | 移除文件时触发
+select-change | `(files: MediaContext[]; currentSelectedFiles: MediaContext[])` | 选择文件或图片之后,上传之前,触发该事件。
`files` 表示之前已经上传完成的文件列表。
`currentSelectedFiles` 表示本次上传选中的文件列表
+success | `(files: MediaContext)` | 上传成功后触发,包含所有上传的文件;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/upload/type.ts)。
`type MediaContext = VideoContext[] \| ImageContext[]`
`interface VideoContext { name?: string; type?: string; url?: string; duration?: number; size?: number; width?: number; height?: number; thumb: string; progress: number }`
`interface ImageContext { name: string; type: string; url: string; size: number; width: number; height: number; progress: number }`
+
+### CSS Variables
+
+组件提供了下列 CSS 变量,可用于自定义样式。
+名称 | 默认值 | 描述
+-- | -- | --
+--td-upload-add-bg-color | @bg-color-secondarycontainer | -
+--td-upload-add-color | @font-gray-3 | -
+--td-upload-add-disabled-bg-color | @bg-color-component-disabled | -
+--td-upload-add-icon-disabled-color | @text-color-disabled | -
+--td-upload-add-icon-font-size | 56rpx | -
+--td-upload-disabled-mask | rgba(255, 255, 255, 0.55) | -
+--td-upload-radius | @radius-default | -
+--td-upload-drag-z-index | 999 | -
\ No newline at end of file
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/drag.wxs b/miniprogram_npm/tdesign-miniprogram/upload/drag.wxs
new file mode 100644
index 0000000..a136b58
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/drag.wxs
@@ -0,0 +1,238 @@
+var classPrefix = '';
+var startIndex = 0;
+var endIndex = 0;
+var dragCollisionList = [];
+
+var isOutRange = function (x1, y1, x2, y2, x3, y3) {
+ return x1 < 0 || x1 >= y1 || x2 < 0 || x2 >= y2 || x3 < 0 || x3 >= y3;
+};
+
+var sortCore = function (sKey, eKey, st) {
+ var _ = st.dragBaseData;
+
+ var excludeFix = function (cKey, type) {
+ if (st.list[cKey].fixed) {
+ // fixed 元素位置不会变化, 这里直接用 cKey(sortKey) 获取, 更加快捷
+ type ? --cKey : ++cKey;
+ return excludeFix(cKey, type);
+ }
+ return cKey;
+ };
+
+ // 先获取到 endKey 对应的 realKey, 防止下面排序过程中该 realKey 被修改
+ var endRealKey = -1;
+ st.list.forEach(function (item) {
+ if (item.sortKey === eKey) endRealKey = item.realKey;
+ });
+
+ return st.list.map(function (item) {
+ if (item.fixed) return item;
+ var cKey = item.sortKey;
+ var rKey = item.realKey;
+
+ if (sKey < eKey) {
+ // 正序拖动
+ if (cKey > sKey && cKey <= eKey) {
+ --rKey;
+ cKey = excludeFix(--cKey, true);
+ } else if (cKey === sKey) {
+ rKey = endRealKey;
+ cKey = eKey;
+ }
+ } else if (sKey > eKey) {
+ // 倒序拖动
+ if (cKey >= eKey && cKey < sKey) {
+ ++rKey;
+ cKey = excludeFix(++cKey, false);
+ } else if (cKey === sKey) {
+ rKey = endRealKey;
+ cKey = eKey;
+ }
+ }
+
+ if (item.sortKey !== cKey) {
+ item.tranX = (cKey % _.columns) * 100 + '%';
+ item.tranY = Math.floor(cKey / _.columns) * 100 + '%';
+ item.sortKey = cKey;
+ item.realKey = rKey;
+ }
+ return item;
+ });
+};
+
+var triggerCustomEvent = function (list, type, ins) {
+ var _list = [],
+ listData = [];
+
+ list.forEach(function (item) {
+ _list[item.sortKey] = item;
+ });
+
+ _list.forEach(function (item) {
+ if (!item.extraNode) {
+ listData.push(item.data);
+ }
+ });
+
+ ins.triggerEvent(type, { listData: listData });
+};
+
+var longPress = function (event, ownerInstance) {
+ var ins = event.instance;
+ var st = ownerInstance.getState();
+ var _ = st.dragBaseData;
+
+ var sTouch = event.changedTouches[0];
+ if (!sTouch) return;
+
+ st.cur = ins.getDataset().index;
+ longPressIndex = st.cur;
+
+ // 初始项是固定项则返回
+ var item = st.list[st.cur];
+ if (item && item.fixed) return;
+
+ // 如果已经在 drag 中则返回, 防止多指触发 drag 动作, touchstart 事件中有效果
+ if (st.dragging) return;
+ st.dragging = true;
+ ownerInstance.callMethod('dragStatusChange', { dragging: true });
+
+ // 计算X,Y轴初始位移, 使 item 中心移动到点击处, 单列时候X轴初始不做位移
+ st.tranX = _.columns === 1 ? 0 : sTouch.pageX - (_.itemWidth / 2 + _.wrapLeft);
+ st.tranY = sTouch.pageY - (_.itemHeight / 2 + _.wrapTop);
+ st.sId = sTouch.identifier;
+ ins.setStyle({
+ transform: 'translate3d(' + st.tranX + 'px, ' + st.tranY + 'px, 0)',
+ });
+ st.itemsInstance.forEach(function (item, index) {
+ item.removeClass(classPrefix + '__drag--tran').removeClass(classPrefix + '__drag--cur');
+ item.addClass(index === st.cur ? classPrefix + '__drag--cur' : classPrefix + '__drag--tran');
+ });
+ ownerInstance.callMethod('dragVibrate', { vibrateType: 'longPress' });
+};
+
+var touchMove = function (event, ownerInstance) {
+ var ins = event.instance;
+ var st = ownerInstance.getState();
+ var _ = st.dragBaseData;
+
+ var mTouch = event.changedTouches[0];
+ if (!mTouch) return;
+
+ if (!st.dragging) return;
+
+ // 如果不是同一个触发点则返回
+ if (st.sId !== mTouch.identifier) return;
+
+ // 计算X,Y轴位移, 单列时候X轴初始不做位移
+ var tranX = _.columns === 1 ? 0 : mTouch.pageX - (_.itemWidth / 2 + _.wrapLeft);
+ var tranY = mTouch.pageY - (_.itemHeight / 2 + _.wrapTop);
+
+ // 到顶到底自动滑动
+ if (mTouch.clientY > _.windowHeight - _.itemHeight - _.realBottomSize) {
+ // 当前触摸点pageY + item高度 - (屏幕高度 - 底部固定区域高度)
+ ownerInstance.callMethod('pageScroll', {
+ scrollTop: mTouch.pageY + _.itemHeight - (_.windowHeight - _.realBottomSize),
+ });
+ } else if (mTouch.clientY < _.itemHeight + _.realTopSize) {
+ // 当前触摸点pageY - item高度 - 顶部固定区域高度
+ ownerInstance.callMethod('pageScroll', {
+ scrollTop: mTouch.pageY - _.itemHeight - _.realTopSize,
+ });
+ }
+
+ // 设置当前激活元素偏移量
+ ins.setStyle({
+ transform: 'translate3d(' + tranX + 'px, ' + tranY + 'px, 0)',
+ });
+
+ var startKey = st.list[st.cur].sortKey;
+ var curX = Math.round(tranX / _.itemWidth);
+ var curY = Math.round(tranY / _.itemHeight);
+ var endKey = curX + _.columns * curY;
+
+ // 目标项是固定项则返回
+ var item = st.list[endKey];
+ if (item && item.fixed) return;
+
+ // X轴或Y轴超出范围则返回
+ if (isOutRange(curX, _.columns, curY, _.rows, endKey, st.list.length)) return;
+
+ // 防止拖拽过程中发生乱序问题
+ if (startKey === endKey || startKey === st.preStartKey) return;
+ st.preStartKey = startKey;
+
+ dragCollisionList = sortCore(startKey, endKey, st);
+ startIndex = startKey;
+ endIndex = endKey;
+ st.itemsInstance.forEach(function (itemIns, index) {
+ var item = dragCollisionList[index];
+ if (index !== st.cur) {
+ itemIns.setStyle({
+ transform: 'translate3d(' + item.tranX + ',' + item.tranY + ', 0)',
+ });
+ }
+ });
+
+ ownerInstance.callMethod('dragVibrate', { vibrateType: 'touchMove' });
+ ownerInstance.callMethod('dragCollision', {
+ dragCollisionList: dragCollisionList,
+ startIndex: startIndex,
+ endIndex: endIndex,
+ });
+ triggerCustomEvent(dragCollisionList, 'change', ownerInstance);
+};
+
+var touchEnd = function (event, ownerInstance) {
+ var ins = event.instance;
+ var st = ownerInstance.getState();
+
+ if (!st.dragging) return;
+ triggerCustomEvent(st.list, 'sortend', ownerInstance);
+ ins.addClass(classPrefix + '__drag--tran');
+ ins.setStyle({
+ transform: 'translate3d(' + st.list[st.cur].tranX + ',' + st.list[st.cur].tranY + ', 0)',
+ });
+ st.preStartKey = -1;
+ st.dragging = false;
+ ownerInstance.callMethod('dragStatusChange', { dragging: false });
+ ownerInstance.callMethod('dragEnd', {
+ dragCollisionList: dragCollisionList,
+ startIndex: startIndex,
+ endIndex: endIndex,
+ });
+ st.cur = -1;
+ st.tranX = 0;
+ st.tranY = 0;
+};
+
+var baseDataObserver = function (newVal, oldVal, ownerInstance, ins) {
+ var st = ownerInstance.getState();
+ st.dragBaseData = newVal;
+ classPrefix = newVal.classPrefix;
+};
+
+var listObserver = function (newVal, oldVal, ownerInstance, ins) {
+ var st = ownerInstance.getState();
+ st.itemsInstance = ownerInstance.selectAllComponents('.' + classPrefix + '__drag-item');
+ st.list = newVal || [];
+ st.list.forEach(function (item, index) {
+ var itemIns = st.itemsInstance[index];
+ if (item && itemIns) {
+ itemIns.removeClass(classPrefix + '__drag--tran');
+ itemIns.setStyle({
+ transform: 'translate3d(' + item.tranX + ',' + item.tranY + ', 0)',
+ });
+ if (item.fixed) itemIns.addClass(classPrefix + '__drag--fixed');
+ }
+ });
+ dragCollisionList = [];
+};
+
+module.exports = {
+ longPress: longPress,
+ touchMove: touchMove,
+ touchEnd: touchEnd,
+ baseDataObserver: baseDataObserver,
+ listObserver: listObserver,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/props.d.ts b/miniprogram_npm/tdesign-miniprogram/upload/props.d.ts
new file mode 100644
index 0000000..2f7371c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/props.d.ts
@@ -0,0 +1,3 @@
+import { TdUploadProps } from './type';
+declare const props: TdUploadProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/props.js b/miniprogram_npm/tdesign-miniprogram/upload/props.js
new file mode 100644
index 0000000..f130336
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/props.js
@@ -0,0 +1,59 @@
+const props = {
+ addContent: {
+ type: String,
+ },
+ allowUploadDuplicateFile: {
+ type: Boolean,
+ value: false,
+ },
+ config: {
+ type: Object,
+ },
+ disabled: {
+ type: null,
+ value: undefined,
+ },
+ draggable: {
+ type: null,
+ },
+ files: {
+ type: Array,
+ value: null,
+ },
+ defaultFiles: {
+ type: Array,
+ },
+ gridConfig: {
+ type: Object,
+ },
+ gutter: {
+ type: Number,
+ value: 16,
+ },
+ imageProps: {
+ type: Object,
+ },
+ max: {
+ type: Number,
+ value: 0,
+ },
+ mediaType: {
+ type: Array,
+ value: ['image', 'video'],
+ },
+ requestMethod: {
+ type: null,
+ },
+ sizeLimit: {
+ type: null,
+ },
+ source: {
+ type: String,
+ value: 'media',
+ },
+ transition: {
+ type: Object,
+ value: { backTransition: true, duration: 300, timingFunction: 'ease' },
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/type.d.ts b/miniprogram_npm/tdesign-miniprogram/upload/type.d.ts
new file mode 100644
index 0000000..4aa0e45
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/type.d.ts
@@ -0,0 +1,109 @@
+import { ImageProps } from '../image/index';
+export interface TdUploadProps {
+ addContent?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ allowUploadDuplicateFile?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ config?: {
+ type: ObjectConstructor;
+ value?: UploadMpConfig;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ draggable?: {
+ type: null;
+ value?: boolean | {
+ vibrate?: boolean;
+ collisionVibrate?: boolean;
+ };
+ };
+ files?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ defaultFiles?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ gridConfig?: {
+ type: ObjectConstructor;
+ value?: {
+ column?: number;
+ width?: number;
+ height?: number;
+ };
+ };
+ gutter?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ imageProps?: {
+ type: ObjectConstructor;
+ value?: ImageProps;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ mediaType?: {
+ type: ArrayConstructor;
+ value?: Array;
+ };
+ requestMethod?: {
+ type: undefined;
+ value?: null;
+ };
+ sizeLimit?: {
+ type: null;
+ value?: number | SizeLimitObj;
+ };
+ source?: {
+ type: StringConstructor;
+ value?: 'media' | 'messageFile';
+ };
+ transition?: {
+ type: ObjectConstructor;
+ value?: Transition;
+ };
+}
+export declare type UploadMpConfig = ImageConfig | VideoConfig;
+export interface ImageConfig {
+ count?: number;
+ sizeType?: Array;
+ sourceType?: Array;
+}
+export declare type SizeTypeValues = 'original' | 'compressed';
+export declare type SourceTypeValues = 'album' | 'camera';
+export interface VideoConfig {
+ sourceType?: Array;
+ compressed?: boolean;
+ maxDuration?: number;
+ camera?: 'back' | 'front';
+}
+export interface UploadFile {
+ url: string;
+ name?: string;
+ size?: number;
+ type?: 'image' | 'video';
+ percent?: number;
+ status: 'loading' | 'reload' | 'failed' | 'done';
+}
+export declare type MediaType = 'image' | 'video';
+export interface SizeLimitObj {
+ size: number;
+ unit: SizeUnit;
+ message?: string;
+}
+export declare type SizeUnitArray = ['B', 'KB', 'MB', 'GB'];
+export declare type SizeUnit = SizeUnitArray[number];
+export interface Transition {
+ backTransition?: boolean;
+ duration?: number;
+ timingFunction?: string;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/type.js b/miniprogram_npm/tdesign-miniprogram/upload/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload-info.json b/miniprogram_npm/tdesign-miniprogram/upload/upload-info.json
new file mode 100644
index 0000000..a71eeef
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload-info.json
@@ -0,0 +1,123 @@
+{
+ "key": "Upload",
+ "label": "上传",
+ "icon": "",
+ "properties": [
+ {
+ "key": "addContent",
+ "type": ["String", "TNode"],
+ "defaultValue": "",
+ "desc": "添加按钮内容。值为空,使用默认图标渲染;值为 slot 则表示使用插槽渲染;其他值无效。",
+ "label": ""
+ },
+ {
+ "key": "config",
+ "type": ["Object"],
+ "defaultValue": "",
+ "desc": "图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)",
+ "label": ""
+ },
+ {
+ "key": "deleteBtn",
+ "type": ["String", "TNode"],
+ "defaultValue": "",
+ "desc": "删除图标。值为空,使用默认图标渲染;值为 slot 则表示使用插槽渲染;其他值无效。",
+ "label": ""
+ },
+ {
+ "key": "fileListDisplay",
+ "type": ["TNode"],
+ "defaultValue": "",
+ "desc": "【开发中】用于完全自定义文件列表内容",
+ "label": ""
+ },
+ {
+ "key": "files",
+ "type": ["Array"],
+ "defaultValue": "",
+ "desc": "已上传文件列表",
+ "label": ""
+ },
+ {
+ "key": "gridConfig",
+ "type": ["Object"],
+ "defaultValue": "",
+ "desc": "upload组件每行上传图片列数以及图片的宽度和高度",
+ "label": ""
+ },
+ {
+ "key": "gutter",
+ "type": ["Number"],
+ "defaultValue": "16",
+ "desc": "预览窗格的 gutter 大小,单位 rpx",
+ "label": ""
+ },
+ {
+ "key": "imageProps",
+ "type": ["Object"],
+ "defaultValue": "",
+ "desc": "透传 Image 组件全部属性",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "defaultValue": "0",
+ "desc": "用于控制文件上传数量,值为 0 则不限制",
+ "label": ""
+ },
+ {
+ "key": "mediaType",
+ "type": ["Array"],
+ "defaultValue": "['image', 'video']",
+ "desc": "支持上传的文件类型,图片或视频",
+ "label": ""
+ },
+ {
+ "key": "requestMethod",
+ "type": ["Function"],
+ "defaultValue": "",
+ "desc": "自定义上传方法",
+ "label": ""
+ },
+ {
+ "key": "sizeLimit",
+ "type": ["Number", "Object"],
+ "defaultValue": "",
+ "desc": "图片文件大小限制,单位 KB。可选单位有:`'B' | 'KB' | 'MB' | 'GB'`。示例一:`1000`。示例二:`{ size: 2, unit: 'MB', message: '图片大小不超过 {sizeLimit} MB' }`",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "add",
+ "desc": "上传成功后触发,仅包含本次选择的照片;`context.url` 表示选定视频的临时文件路径 (本地路径)。`context.duration` 表示选定视频的时间长度。`context.size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述",
+ "label": ""
+ },
+ {
+ "key": "complete",
+ "desc": "上传成功或失败后触发",
+ "label": ""
+ },
+ {
+ "key": "fail",
+ "desc": "上传失败后触发",
+ "label": ""
+ },
+ {
+ "key": "remove",
+ "desc": "移除文件时触发",
+ "label": ""
+ },
+ {
+ "key": "selectChange",
+ "desc": "选择文件或图片之后,上传之前,触发该事件。
`params.value` 表示之前已经上传完成的文件列表。
`params.currentSelectedFiles` 表示本次上传选中的文件列表",
+ "label": ""
+ },
+ {
+ "key": "success",
+ "desc": "上传成功后触发,包含所有上传的文件;`context.url` 表示选定视频的临时文件路径 (本地路径)。`context.duration` 表示选定视频的时间长度。`context.size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述",
+ "label": ""
+ }
+ ]
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload.d.ts b/miniprogram_npm/tdesign-miniprogram/upload/upload.d.ts
new file mode 100644
index 0000000..6c3225a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload.d.ts
@@ -0,0 +1,60 @@
+import { SuperComponent } from '../common/src/index';
+import { UploadFile } from './type';
+export default class Upload extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ data: {
+ classPrefix: string;
+ prefix: string;
+ current: boolean;
+ proofs: any[];
+ customFiles: UploadFile[];
+ customLimit: number;
+ column: number;
+ dragBaseData: {};
+ rows: number;
+ dragWrapStyle: string;
+ dragList: any[];
+ dragging: boolean;
+ dragLayout: boolean;
+ };
+ properties: import("./type").TdUploadProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ 'files, max, draggable'(files: UploadFile, max: number): void;
+ gridConfig(): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ onProofTap(e: any): void;
+ handleLimit(customFiles: UploadFile[], max: number): void;
+ triggerSuccessEvent(files: any): void;
+ triggerFailEvent(err: any): void;
+ onFileClick(e: any): void;
+ getFileType(mediaType: string[], tempFilePath: string, fileType?: string): string;
+ getRandFileName(filePath: any): string;
+ onDelete(e: any): void;
+ deleteHandle(index: number): void;
+ updateGrid(): void;
+ initDragLayout(): void;
+ initDragList(): void;
+ initDragBaseData(): void;
+ methods: {
+ uploadFiles(files: UploadFile[]): Promise;
+ startUpload(files: UploadFile[]): any;
+ onAddTap(): void;
+ chooseMedia(mediaType: any): void;
+ chooseMessageFile(mediaType: any): void;
+ afterSelect(files: any): void;
+ dragVibrate(e: any): void;
+ dragStatusChange(e: any): void;
+ dragEnd(e: any): void;
+ triggerDropEvent(files: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload.js b/miniprogram_npm/tdesign-miniprogram/upload/upload.js
new file mode 100644
index 0000000..f115238
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload.js
@@ -0,0 +1,352 @@
+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 __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import { isObject, SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+import config from '../common/config';
+import { isOverSize } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-upload`;
+let Upload = class Upload extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.data = {
+ classPrefix: name,
+ prefix,
+ current: false,
+ proofs: [],
+ customFiles: [],
+ customLimit: 0,
+ column: 4,
+ dragBaseData: {},
+ rows: 0,
+ dragWrapStyle: '',
+ dragList: [],
+ dragging: true,
+ dragLayout: false,
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'files',
+ event: 'success',
+ },
+ ];
+ this.observers = {
+ 'files, max, draggable'(files, max) {
+ this.handleLimit(files, max);
+ },
+ gridConfig() {
+ this.updateGrid();
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.handleLimit(this.data.customFiles, this.data.max);
+ this.updateGrid();
+ },
+ };
+ this.methods = {
+ uploadFiles(files) {
+ return new Promise((resolve) => {
+ const task = this.data.requestMethod(files);
+ if (task instanceof Promise) {
+ return task;
+ }
+ resolve({});
+ });
+ },
+ startUpload(files) {
+ if (typeof this.data.requestMethod === 'function') {
+ return this.uploadFiles(files)
+ .then(() => {
+ files.forEach((file) => {
+ file.percent = 100;
+ });
+ this.triggerSuccessEvent(files);
+ })
+ .catch((err) => {
+ this.triggerFailEvent(err);
+ });
+ }
+ this.triggerSuccessEvent(files);
+ this.handleLimit(this.data.customFiles, this.data.max);
+ return Promise.resolve();
+ },
+ onAddTap() {
+ const { disabled, mediaType, source } = this.properties;
+ if (disabled)
+ return;
+ if (source === 'media') {
+ this.chooseMedia(mediaType);
+ }
+ else {
+ this.chooseMessageFile(mediaType);
+ }
+ },
+ chooseMedia(mediaType) {
+ const { config, sizeLimit, customLimit } = this.data;
+ wx.chooseMedia(Object.assign(Object.assign({ count: customLimit, mediaType }, config), { success: (res) => {
+ const files = [];
+ res.tempFiles.forEach((temp) => {
+ const { size, fileType, tempFilePath, width, height, duration, thumbTempFilePath } = temp, res = __rest(temp, ["size", "fileType", "tempFilePath", "width", "height", "duration", "thumbTempFilePath"]);
+ if (isOverSize(size, sizeLimit)) {
+ let title = `${fileType === 'image' ? '图片' : '视频'}大小超过限制`;
+ if (typeof sizeLimit !== 'number') {
+ title = sizeLimit.message.replace('{sizeLimit}', sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.size);
+ }
+ wx.showToast({ icon: 'none', title });
+ return;
+ }
+ const name = this.getRandFileName(tempFilePath);
+ files.push(Object.assign({ name, type: this.getFileType(mediaType, tempFilePath, fileType), url: tempFilePath, size: size, width: width, height: height, duration: duration, thumb: thumbTempFilePath, percent: 0 }, res));
+ });
+ this.afterSelect(files);
+ }, fail: (err) => {
+ this.triggerFailEvent(err);
+ }, complete: (res) => {
+ this.triggerEvent('complete', res);
+ } }));
+ },
+ chooseMessageFile(mediaType) {
+ const { max, config, sizeLimit } = this.properties;
+ wx.chooseMessageFile(Object.assign(Object.assign({ count: max, type: Array.isArray(mediaType) ? 'all' : mediaType }, config), { success: (res) => {
+ const files = [];
+ res.tempFiles.forEach((temp) => {
+ const { size, type: fileType, path: tempFilePath } = temp, res = __rest(temp, ["size", "type", "path"]);
+ if (isOverSize(size, sizeLimit)) {
+ let title = `${fileType === 'image' ? '图片' : '视频'}大小超过限制`;
+ if (typeof sizeLimit !== 'number') {
+ title = sizeLimit.message.replace('{sizeLimit}', sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.size);
+ }
+ wx.showToast({ icon: 'none', title });
+ return;
+ }
+ const name = this.getRandFileName(tempFilePath);
+ files.push(Object.assign({ name, type: this.getFileType(mediaType, tempFilePath, fileType), url: tempFilePath, size: size, percent: 0 }, res));
+ });
+ this.afterSelect(files);
+ }, fail: (err) => this.triggerFailEvent(err), complete: (res) => this.triggerEvent('complete', res) }));
+ },
+ afterSelect(files) {
+ this._trigger('select-change', {
+ files: [...this.data.customFiles],
+ currentSelectedFiles: [files],
+ });
+ this._trigger('add', { files });
+ this.startUpload(files);
+ },
+ dragVibrate(e) {
+ var _a;
+ const { vibrateType } = e;
+ const { draggable } = this.data;
+ const dragVibrate = (_a = draggable === null || draggable === void 0 ? void 0 : draggable.vibrate) !== null && _a !== void 0 ? _a : true;
+ const dragCollisionVibrate = draggable === null || draggable === void 0 ? void 0 : draggable.collisionVibrate;
+ if ((dragVibrate && vibrateType === 'longPress') || (dragCollisionVibrate && vibrateType === 'touchMove')) {
+ wx.vibrateShort({
+ type: 'light',
+ });
+ }
+ },
+ dragStatusChange(e) {
+ const { dragging } = e;
+ this.setData({ dragging });
+ },
+ dragEnd(e) {
+ const { dragCollisionList } = e;
+ let files = [];
+ if (dragCollisionList.length === 0) {
+ files = this.data.customFiles;
+ }
+ else {
+ files = dragCollisionList.reduce((list, item) => {
+ const { realKey, data, fixed } = item;
+ if (!fixed) {
+ list[realKey] = Object.assign({}, data);
+ }
+ return list;
+ }, []);
+ }
+ this.triggerDropEvent(files);
+ },
+ triggerDropEvent(files) {
+ const { transition } = this.properties;
+ if (transition.backTransition) {
+ const timer = setTimeout(() => {
+ this.triggerEvent('drop', { files });
+ clearTimeout(timer);
+ }, transition.duration);
+ }
+ else {
+ this.triggerEvent('drop', { files });
+ }
+ },
+ };
+ }
+ onProofTap(e) {
+ var _a;
+ this.onFileClick(e);
+ const { index } = e.currentTarget.dataset;
+ wx.previewImage({
+ urls: this.data.customFiles.filter((file) => file.percent !== -1).map((file) => file.url),
+ current: (_a = this.data.customFiles[index]) === null || _a === void 0 ? void 0 : _a.url,
+ });
+ }
+ handleLimit(customFiles, max) {
+ if (max === 0) {
+ max = 20;
+ }
+ this.setData({
+ customFiles: customFiles.length > max ? customFiles.slice(0, max) : customFiles,
+ customLimit: max - customFiles.length,
+ dragging: true,
+ });
+ this.initDragLayout();
+ }
+ triggerSuccessEvent(files) {
+ this._trigger('success', { files: [...this.data.customFiles, ...files] });
+ }
+ triggerFailEvent(err) {
+ this.triggerEvent('fail', err);
+ }
+ onFileClick(e) {
+ const { file } = e.currentTarget.dataset;
+ this.triggerEvent('click', { file });
+ }
+ getFileType(mediaType, tempFilePath, fileType) {
+ if (fileType)
+ return fileType;
+ if (mediaType.length === 1) {
+ return mediaType[0];
+ }
+ const videoType = ['avi', 'wmv', 'mkv', 'mp4', 'mov', 'rm', '3gp', 'flv', 'mpg', 'rmvb'];
+ const temp = tempFilePath.split('.');
+ const postfix = temp[temp.length - 1];
+ if (videoType.includes(postfix.toLocaleLowerCase())) {
+ return 'video';
+ }
+ return 'image';
+ }
+ getRandFileName(filePath) {
+ const extIndex = filePath.lastIndexOf('.');
+ const extName = extIndex === -1 ? '' : filePath.substr(extIndex);
+ return parseInt(`${Date.now()}${Math.floor(Math.random() * 900 + 100)}`, 10).toString(36) + extName;
+ }
+ onDelete(e) {
+ const { index } = e.currentTarget.dataset;
+ this.deleteHandle(index);
+ }
+ deleteHandle(index) {
+ const { customFiles } = this.data;
+ const delFile = customFiles[index];
+ this.triggerEvent('remove', { index, file: delFile });
+ }
+ updateGrid() {
+ let { gridConfig = {} } = this.properties;
+ if (!isObject(gridConfig))
+ gridConfig = {};
+ const { column = 4, width = 160, height = 160 } = gridConfig;
+ this.setData({
+ gridItemStyle: `width:${width}rpx;height:${height}rpx`,
+ column: column,
+ });
+ }
+ initDragLayout() {
+ const { draggable, disabled } = this.properties;
+ if (!draggable || disabled)
+ return;
+ this.initDragList();
+ this.initDragBaseData();
+ }
+ initDragList() {
+ let i = 0;
+ const { column, customFiles, customLimit } = this.data;
+ const dragList = [];
+ customFiles.forEach((item, index) => {
+ dragList.push({
+ realKey: i,
+ sortKey: index,
+ tranX: `${(index % column) * 100}%`,
+ tranY: `${Math.floor(index / column) * 100}%`,
+ data: Object.assign({}, item),
+ });
+ i += 1;
+ });
+ if (customLimit > 0) {
+ const listLength = dragList.length;
+ dragList.push({
+ realKey: listLength,
+ sortKey: listLength,
+ tranX: `${(listLength % column) * 100}%`,
+ tranY: `${Math.floor(listLength / column) * 100}%`,
+ fixed: true,
+ });
+ }
+ this.data.rows = Math.ceil(dragList.length / column);
+ this.setData({
+ dragList,
+ });
+ }
+ initDragBaseData() {
+ const { classPrefix, rows, column, customFiles } = this.data;
+ if (customFiles.length === 0) {
+ this.setData({
+ dragBaseData: {},
+ dragWrapStyle: '',
+ dragLayout: false,
+ });
+ return;
+ }
+ const query = this.createSelectorQuery();
+ const selectorGridItem = `.${classPrefix} >>> .t-grid-item`;
+ const selectorGrid = `.${classPrefix} >>> .t-grid`;
+ query.select(selectorGridItem).boundingClientRect();
+ query.select(selectorGrid).boundingClientRect();
+ query.selectViewport().scrollOffset();
+ query.exec((res) => {
+ const [{ width, height }, { left, top }, { scrollTop }] = res;
+ const dragBaseData = {
+ rows,
+ classPrefix,
+ itemWidth: width,
+ itemHeight: height,
+ wrapLeft: left,
+ wrapTop: top + scrollTop,
+ columns: column,
+ };
+ const dragWrapStyle = `height: ${rows * height}px`;
+ this.setData({
+ dragBaseData,
+ dragWrapStyle,
+ dragLayout: true,
+ }, () => {
+ const timer = setTimeout(() => {
+ this.setData({ dragging: false });
+ clearTimeout(timer);
+ }, 0);
+ });
+ });
+ }
+};
+Upload = __decorate([
+ wxComponent()
+], Upload);
+export default Upload;
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload.json b/miniprogram_npm/tdesign-miniprogram/upload/upload.json
new file mode 100644
index 0000000..1ac0a3b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload.json
@@ -0,0 +1,10 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {
+ "t-grid": "../grid/grid",
+ "t-grid-item": "../grid-item/grid-item",
+ "t-icon": "../icon/icon",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload.wxml b/miniprogram_npm/tdesign-miniprogram/upload/upload.wxml
new file mode 100644
index 0000000..9272e74
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload.wxml
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{file.percent ? file.percent + '%' : '上传中...'}}
+
+
+
+ {{file.status == 'reload' ? '重新上传' : '上传失败'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{addContent}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{file.percent ? file.percent + '%' : '上传中...'}}
+
+
+
+ {{file.status == 'reload' ? '重新上传' : '上传失败'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{addContent}}
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload.wxs b/miniprogram_npm/tdesign-miniprogram/upload/upload.wxs
new file mode 100644
index 0000000..03b321f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload.wxs
@@ -0,0 +1,15 @@
+module.exports.getWrapperAriaRole = function (file) {
+ return file.status && file.status != 'done' ? 'text' : 'button';
+};
+
+module.exports.getWrapperAriaLabel = function (file) {
+ if (file.status && file.status != 'done') {
+ if (file.status == 'loading') {
+ return file.percent ? '上传中:' + file.percent + '%' : '上传中';
+ } else {
+ return file.status == 'reload' ? '重新上传' : '上传失败';
+ }
+ } else {
+ return file.type === 'video' ? '视频' : '图像';
+ }
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/upload/upload.wxss b/miniprogram_npm/tdesign-miniprogram/upload/upload.wxss
new file mode 100644
index 0000000..07556b7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/upload/upload.wxss
@@ -0,0 +1,144 @@
+.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-upload {
+ position: relative;
+}
+.t-upload__grid-content {
+ padding: 0;
+}
+.t-upload__grid-file {
+ position: relative;
+}
+.t-upload__add-icon {
+ width: 100%;
+ height: 100%;
+ display: none;
+ align-items: center;
+ justify-content: center;
+ font-size: var(--td-upload-add-icon-font-size, 56rpx);
+ background-color: var(--td-upload-add-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ color: var(--td-upload-add-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
+ border-radius: var(--td-upload-radius, var(--td-radius-default, 12rpx));
+}
+.t-upload__add-icon--disabled {
+ background-color: var(--td-upload-add-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+ color: var(--td-upload-add-icon-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
+}
+.t-upload__add-icon:only-child {
+ display: flex;
+}
+.t-upload__thumbnail {
+ width: 100%;
+ height: 100%;
+ max-height: 100%;
+ overflow: hidden;
+}
+.t-upload__wrapper {
+ position: relative;
+ border-radius: var(--td-upload-radius, var(--td-radius-default, 12rpx));
+ overflow: hidden;
+}
+.t-upload__wrapper--disabled::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: var(--td-upload-disabled-mask, rgba(0, 0.6));
+ z-index: 1;
+}
+.t-upload__close-btn {
+ position: absolute;
+ top: 0;
+ right: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 40rpx;
+ height: 40rpx;
+ border-top-right-radius: var(--td-upload-radius, var(--td-radius-default, 12rpx));
+ border-bottom-left-radius: var(--td-upload-radius, var(--td-radius-default, 12rpx));
+ background-color: var(--td-font-gray-3, rgba(0, 0, 0, 0.4));
+}
+.t-upload__progress-mask {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: var(--td-font-gray-2, rgba(0, 0, 0, 0.6));
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ border-radius: var(--td-upload-radius, var(--td-radius-default, 12rpx));
+ color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
+ padding: 32rpx 0;
+ box-sizing: border-box;
+}
+.t-upload__progress-text {
+ font-size: 24rpx;
+ line-height: 40rpx;
+ margin-top: 8rpx;
+}
+.t-upload__progress-loading {
+ animation: spin infinite linear 0.6s;
+}
+.t-upload__drag {
+ position: relative;
+ width: 100%;
+ --td-grid-item-bg-color: transparent;
+}
+.t-upload__drag-item {
+ position: absolute;
+ z-index: 1;
+ top: 0px;
+ left: 0px;
+ height: auto;
+ width: 100%;
+}
+.t-upload__drag--fixed {
+ z-index: 0;
+}
+.t-upload__drag--tran {
+ transition-property: transform;
+ transition-duration: var(--td-upload-drag-transition-duration);
+ transition-timing-function: var(--td-upload-drag-transition-timing-function);
+}
+.t-upload__drag--cur {
+ z-index: var(--td-upload-drag-z-index, 999);
+}
+@keyframes spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/miniprogram_npm/tinycolor2/index.js b/miniprogram_npm/tinycolor2/index.js
new file mode 100644
index 0000000..348f06d
--- /dev/null
+++ b/miniprogram_npm/tinycolor2/index.js
@@ -0,0 +1,1201 @@
+module.exports = (function() {
+var __MODS__ = {};
+var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
+var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
+var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
+var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
+__DEFINE__(1740983753194, function(require, module, exports) {
+// This file is autogenerated. It's used to publish CJS to npm.
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.tinycolor = factory());
+})(this, (function () {
+
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+ }
+
+ // https://github.com/bgrins/TinyColor
+ // Brian Grinstead, MIT License
+
+ var trimLeft = /^\s+/;
+ var trimRight = /\s+$/;
+ function tinycolor(color, opts) {
+ color = color ? color : "";
+ opts = opts || {};
+
+ // If input is already a tinycolor, return itself
+ if (color instanceof tinycolor) {
+ return color;
+ }
+ // If we are called as a function, call using new instead
+ if (!(this instanceof tinycolor)) {
+ return new tinycolor(color, opts);
+ }
+ var rgb = inputToRGB(color);
+ this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
+ this._gradientType = opts.gradientType;
+
+ // Don't let the range of [0,255] come back in [0,1].
+ // Potentially lose a little bit of precision here, but will fix issues where
+ // .5 gets interpreted as half of the total, instead of half of 1
+ // If it was supposed to be 128, this was already taken care of by `inputToRgb`
+ if (this._r < 1) this._r = Math.round(this._r);
+ if (this._g < 1) this._g = Math.round(this._g);
+ if (this._b < 1) this._b = Math.round(this._b);
+ this._ok = rgb.ok;
+ }
+ tinycolor.prototype = {
+ isDark: function isDark() {
+ return this.getBrightness() < 128;
+ },
+ isLight: function isLight() {
+ return !this.isDark();
+ },
+ isValid: function isValid() {
+ return this._ok;
+ },
+ getOriginalInput: function getOriginalInput() {
+ return this._originalInput;
+ },
+ getFormat: function getFormat() {
+ return this._format;
+ },
+ getAlpha: function getAlpha() {
+ return this._a;
+ },
+ getBrightness: function getBrightness() {
+ //http://www.w3.org/TR/AERT#color-contrast
+ var rgb = this.toRgb();
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
+ },
+ getLuminance: function getLuminance() {
+ //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
+ var rgb = this.toRgb();
+ var RsRGB, GsRGB, BsRGB, R, G, B;
+ RsRGB = rgb.r / 255;
+ GsRGB = rgb.g / 255;
+ BsRGB = rgb.b / 255;
+ if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
+ if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
+ if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
+ },
+ setAlpha: function setAlpha(value) {
+ this._a = boundAlpha(value);
+ this._roundA = Math.round(100 * this._a) / 100;
+ return this;
+ },
+ toHsv: function toHsv() {
+ var hsv = rgbToHsv(this._r, this._g, this._b);
+ return {
+ h: hsv.h * 360,
+ s: hsv.s,
+ v: hsv.v,
+ a: this._a
+ };
+ },
+ toHsvString: function toHsvString() {
+ var hsv = rgbToHsv(this._r, this._g, this._b);
+ var h = Math.round(hsv.h * 360),
+ s = Math.round(hsv.s * 100),
+ v = Math.round(hsv.v * 100);
+ return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
+ },
+ toHsl: function toHsl() {
+ var hsl = rgbToHsl(this._r, this._g, this._b);
+ return {
+ h: hsl.h * 360,
+ s: hsl.s,
+ l: hsl.l,
+ a: this._a
+ };
+ },
+ toHslString: function toHslString() {
+ var hsl = rgbToHsl(this._r, this._g, this._b);
+ var h = Math.round(hsl.h * 360),
+ s = Math.round(hsl.s * 100),
+ l = Math.round(hsl.l * 100);
+ return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
+ },
+ toHex: function toHex(allow3Char) {
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
+ },
+ toHexString: function toHexString(allow3Char) {
+ return "#" + this.toHex(allow3Char);
+ },
+ toHex8: function toHex8(allow4Char) {
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
+ },
+ toHex8String: function toHex8String(allow4Char) {
+ return "#" + this.toHex8(allow4Char);
+ },
+ toRgb: function toRgb() {
+ return {
+ r: Math.round(this._r),
+ g: Math.round(this._g),
+ b: Math.round(this._b),
+ a: this._a
+ };
+ },
+ toRgbString: function toRgbString() {
+ return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
+ },
+ toPercentageRgb: function toPercentageRgb() {
+ return {
+ r: Math.round(bound01(this._r, 255) * 100) + "%",
+ g: Math.round(bound01(this._g, 255) * 100) + "%",
+ b: Math.round(bound01(this._b, 255) * 100) + "%",
+ a: this._a
+ };
+ },
+ toPercentageRgbString: function toPercentageRgbString() {
+ return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
+ },
+ toName: function toName() {
+ if (this._a === 0) {
+ return "transparent";
+ }
+ if (this._a < 1) {
+ return false;
+ }
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
+ },
+ toFilter: function toFilter(secondColor) {
+ var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
+ var secondHex8String = hex8String;
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
+ if (secondColor) {
+ var s = tinycolor(secondColor);
+ secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
+ }
+ return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
+ },
+ toString: function toString(format) {
+ var formatSet = !!format;
+ format = format || this._format;
+ var formattedString = false;
+ var hasAlpha = this._a < 1 && this._a >= 0;
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
+ if (needsAlphaFormat) {
+ // Special case for "transparent", all other non-alpha formats
+ // will return rgba when there is transparency.
+ if (format === "name" && this._a === 0) {
+ return this.toName();
+ }
+ return this.toRgbString();
+ }
+ if (format === "rgb") {
+ formattedString = this.toRgbString();
+ }
+ if (format === "prgb") {
+ formattedString = this.toPercentageRgbString();
+ }
+ if (format === "hex" || format === "hex6") {
+ formattedString = this.toHexString();
+ }
+ if (format === "hex3") {
+ formattedString = this.toHexString(true);
+ }
+ if (format === "hex4") {
+ formattedString = this.toHex8String(true);
+ }
+ if (format === "hex8") {
+ formattedString = this.toHex8String();
+ }
+ if (format === "name") {
+ formattedString = this.toName();
+ }
+ if (format === "hsl") {
+ formattedString = this.toHslString();
+ }
+ if (format === "hsv") {
+ formattedString = this.toHsvString();
+ }
+ return formattedString || this.toHexString();
+ },
+ clone: function clone() {
+ return tinycolor(this.toString());
+ },
+ _applyModification: function _applyModification(fn, args) {
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
+ this._r = color._r;
+ this._g = color._g;
+ this._b = color._b;
+ this.setAlpha(color._a);
+ return this;
+ },
+ lighten: function lighten() {
+ return this._applyModification(_lighten, arguments);
+ },
+ brighten: function brighten() {
+ return this._applyModification(_brighten, arguments);
+ },
+ darken: function darken() {
+ return this._applyModification(_darken, arguments);
+ },
+ desaturate: function desaturate() {
+ return this._applyModification(_desaturate, arguments);
+ },
+ saturate: function saturate() {
+ return this._applyModification(_saturate, arguments);
+ },
+ greyscale: function greyscale() {
+ return this._applyModification(_greyscale, arguments);
+ },
+ spin: function spin() {
+ return this._applyModification(_spin, arguments);
+ },
+ _applyCombination: function _applyCombination(fn, args) {
+ return fn.apply(null, [this].concat([].slice.call(args)));
+ },
+ analogous: function analogous() {
+ return this._applyCombination(_analogous, arguments);
+ },
+ complement: function complement() {
+ return this._applyCombination(_complement, arguments);
+ },
+ monochromatic: function monochromatic() {
+ return this._applyCombination(_monochromatic, arguments);
+ },
+ splitcomplement: function splitcomplement() {
+ return this._applyCombination(_splitcomplement, arguments);
+ },
+ // Disabled until https://github.com/bgrins/TinyColor/issues/254
+ // polyad: function (number) {
+ // return this._applyCombination(polyad, [number]);
+ // },
+ triad: function triad() {
+ return this._applyCombination(polyad, [3]);
+ },
+ tetrad: function tetrad() {
+ return this._applyCombination(polyad, [4]);
+ }
+ };
+
+ // If input is an object, force 1 into "1.0" to handle ratios properly
+ // String input requires "1.0" as input, so 1 will be treated as 1
+ tinycolor.fromRatio = function (color, opts) {
+ if (_typeof(color) == "object") {
+ var newColor = {};
+ for (var i in color) {
+ if (color.hasOwnProperty(i)) {
+ if (i === "a") {
+ newColor[i] = color[i];
+ } else {
+ newColor[i] = convertToPercentage(color[i]);
+ }
+ }
+ }
+ color = newColor;
+ }
+ return tinycolor(color, opts);
+ };
+
+ // Given a string or object, convert that input to RGB
+ // Possible string inputs:
+ //
+ // "red"
+ // "#f00" or "f00"
+ // "#ff0000" or "ff0000"
+ // "#ff000000" or "ff000000"
+ // "rgb 255 0 0" or "rgb (255, 0, 0)"
+ // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
+ // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
+ // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
+ // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
+ // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
+ // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
+ //
+ function inputToRGB(color) {
+ var rgb = {
+ r: 0,
+ g: 0,
+ b: 0
+ };
+ var a = 1;
+ var s = null;
+ var v = null;
+ var l = null;
+ var ok = false;
+ var format = false;
+ if (typeof color == "string") {
+ color = stringInputToObject(color);
+ }
+ if (_typeof(color) == "object") {
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
+ rgb = rgbToRgb(color.r, color.g, color.b);
+ ok = true;
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
+ s = convertToPercentage(color.s);
+ v = convertToPercentage(color.v);
+ rgb = hsvToRgb(color.h, s, v);
+ ok = true;
+ format = "hsv";
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
+ s = convertToPercentage(color.s);
+ l = convertToPercentage(color.l);
+ rgb = hslToRgb(color.h, s, l);
+ ok = true;
+ format = "hsl";
+ }
+ if (color.hasOwnProperty("a")) {
+ a = color.a;
+ }
+ }
+ a = boundAlpha(a);
+ return {
+ ok: ok,
+ format: color.format || format,
+ r: Math.min(255, Math.max(rgb.r, 0)),
+ g: Math.min(255, Math.max(rgb.g, 0)),
+ b: Math.min(255, Math.max(rgb.b, 0)),
+ a: a
+ };
+ }
+
+ // Conversion Functions
+ // --------------------
+
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
+ //
+
+ // `rgbToRgb`
+ // Handle bounds / percentage checking to conform to CSS color spec
+ //
+ // *Assumes:* r, g, b in [0, 255] or [0, 1]
+ // *Returns:* { r, g, b } in [0, 255]
+ function rgbToRgb(r, g, b) {
+ return {
+ r: bound01(r, 255) * 255,
+ g: bound01(g, 255) * 255,
+ b: bound01(b, 255) * 255
+ };
+ }
+
+ // `rgbToHsl`
+ // Converts an RGB color value to HSL.
+ // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
+ // *Returns:* { h, s, l } in [0,1]
+ function rgbToHsl(r, g, b) {
+ r = bound01(r, 255);
+ g = bound01(g, 255);
+ b = bound01(b, 255);
+ var max = Math.max(r, g, b),
+ min = Math.min(r, g, b);
+ var h,
+ s,
+ l = (max + min) / 2;
+ if (max == min) {
+ h = s = 0; // achromatic
+ } else {
+ var d = max - min;
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+ switch (max) {
+ case r:
+ h = (g - b) / d + (g < b ? 6 : 0);
+ break;
+ case g:
+ h = (b - r) / d + 2;
+ break;
+ case b:
+ h = (r - g) / d + 4;
+ break;
+ }
+ h /= 6;
+ }
+ return {
+ h: h,
+ s: s,
+ l: l
+ };
+ }
+
+ // `hslToRgb`
+ // Converts an HSL color value to RGB.
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
+ // *Returns:* { r, g, b } in the set [0, 255]
+ function hslToRgb(h, s, l) {
+ var r, g, b;
+ h = bound01(h, 360);
+ s = bound01(s, 100);
+ l = bound01(l, 100);
+ function hue2rgb(p, q, t) {
+ if (t < 0) t += 1;
+ if (t > 1) t -= 1;
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
+ if (t < 1 / 2) return q;
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+ return p;
+ }
+ if (s === 0) {
+ r = g = b = l; // achromatic
+ } else {
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ var p = 2 * l - q;
+ r = hue2rgb(p, q, h + 1 / 3);
+ g = hue2rgb(p, q, h);
+ b = hue2rgb(p, q, h - 1 / 3);
+ }
+ return {
+ r: r * 255,
+ g: g * 255,
+ b: b * 255
+ };
+ }
+
+ // `rgbToHsv`
+ // Converts an RGB color value to HSV
+ // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
+ // *Returns:* { h, s, v } in [0,1]
+ function rgbToHsv(r, g, b) {
+ r = bound01(r, 255);
+ g = bound01(g, 255);
+ b = bound01(b, 255);
+ var max = Math.max(r, g, b),
+ min = Math.min(r, g, b);
+ var h,
+ s,
+ v = max;
+ var d = max - min;
+ s = max === 0 ? 0 : d / max;
+ if (max == min) {
+ h = 0; // achromatic
+ } else {
+ switch (max) {
+ case r:
+ h = (g - b) / d + (g < b ? 6 : 0);
+ break;
+ case g:
+ h = (b - r) / d + 2;
+ break;
+ case b:
+ h = (r - g) / d + 4;
+ break;
+ }
+ h /= 6;
+ }
+ return {
+ h: h,
+ s: s,
+ v: v
+ };
+ }
+
+ // `hsvToRgb`
+ // Converts an HSV color value to RGB.
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
+ // *Returns:* { r, g, b } in the set [0, 255]
+ function hsvToRgb(h, s, v) {
+ h = bound01(h, 360) * 6;
+ s = bound01(s, 100);
+ v = bound01(v, 100);
+ var i = Math.floor(h),
+ f = h - i,
+ p = v * (1 - s),
+ q = v * (1 - f * s),
+ t = v * (1 - (1 - f) * s),
+ mod = i % 6,
+ r = [v, q, p, p, t, v][mod],
+ g = [t, v, v, q, p, p][mod],
+ b = [p, p, t, v, v, q][mod];
+ return {
+ r: r * 255,
+ g: g * 255,
+ b: b * 255
+ };
+ }
+
+ // `rgbToHex`
+ // Converts an RGB color to hex
+ // Assumes r, g, and b are contained in the set [0, 255]
+ // Returns a 3 or 6 character hex
+ function rgbToHex(r, g, b, allow3Char) {
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
+
+ // Return a 3 character hex if possible
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
+ }
+ return hex.join("");
+ }
+
+ // `rgbaToHex`
+ // Converts an RGBA color plus alpha transparency to hex
+ // Assumes r, g, b are contained in the set [0, 255] and
+ // a in [0, 1]. Returns a 4 or 8 character rgba hex
+ function rgbaToHex(r, g, b, a, allow4Char) {
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
+
+ // Return a 4 character hex if possible
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
+ }
+ return hex.join("");
+ }
+
+ // `rgbaToArgbHex`
+ // Converts an RGBA color to an ARGB Hex8 string
+ // Rarely used, but required for "toFilter()"
+ function rgbaToArgbHex(r, g, b, a) {
+ var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
+ return hex.join("");
+ }
+
+ // `equals`
+ // Can be called with any tinycolor input
+ tinycolor.equals = function (color1, color2) {
+ if (!color1 || !color2) return false;
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
+ };
+ tinycolor.random = function () {
+ return tinycolor.fromRatio({
+ r: Math.random(),
+ g: Math.random(),
+ b: Math.random()
+ });
+ };
+
+ // Modification Functions
+ // ----------------------
+ // Thanks to less.js for some of the basics here
+ //
+
+ function _desaturate(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.s -= amount / 100;
+ hsl.s = clamp01(hsl.s);
+ return tinycolor(hsl);
+ }
+ function _saturate(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.s += amount / 100;
+ hsl.s = clamp01(hsl.s);
+ return tinycolor(hsl);
+ }
+ function _greyscale(color) {
+ return tinycolor(color).desaturate(100);
+ }
+ function _lighten(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.l += amount / 100;
+ hsl.l = clamp01(hsl.l);
+ return tinycolor(hsl);
+ }
+ function _brighten(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var rgb = tinycolor(color).toRgb();
+ rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
+ rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
+ rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
+ return tinycolor(rgb);
+ }
+ function _darken(color, amount) {
+ amount = amount === 0 ? 0 : amount || 10;
+ var hsl = tinycolor(color).toHsl();
+ hsl.l -= amount / 100;
+ hsl.l = clamp01(hsl.l);
+ return tinycolor(hsl);
+ }
+
+ // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
+ // Values outside of this range will be wrapped into this range.
+ function _spin(color, amount) {
+ var hsl = tinycolor(color).toHsl();
+ var hue = (hsl.h + amount) % 360;
+ hsl.h = hue < 0 ? 360 + hue : hue;
+ return tinycolor(hsl);
+ }
+
+ // Combination Functions
+ // ---------------------
+ // Thanks to jQuery xColor for some of the ideas behind these
+ //
+
+ function _complement(color) {
+ var hsl = tinycolor(color).toHsl();
+ hsl.h = (hsl.h + 180) % 360;
+ return tinycolor(hsl);
+ }
+ function polyad(color, number) {
+ if (isNaN(number) || number <= 0) {
+ throw new Error("Argument to polyad must be a positive number");
+ }
+ var hsl = tinycolor(color).toHsl();
+ var result = [tinycolor(color)];
+ var step = 360 / number;
+ for (var i = 1; i < number; i++) {
+ result.push(tinycolor({
+ h: (hsl.h + i * step) % 360,
+ s: hsl.s,
+ l: hsl.l
+ }));
+ }
+ return result;
+ }
+ function _splitcomplement(color) {
+ var hsl = tinycolor(color).toHsl();
+ var h = hsl.h;
+ return [tinycolor(color), tinycolor({
+ h: (h + 72) % 360,
+ s: hsl.s,
+ l: hsl.l
+ }), tinycolor({
+ h: (h + 216) % 360,
+ s: hsl.s,
+ l: hsl.l
+ })];
+ }
+ function _analogous(color, results, slices) {
+ results = results || 6;
+ slices = slices || 30;
+ var hsl = tinycolor(color).toHsl();
+ var part = 360 / slices;
+ var ret = [tinycolor(color)];
+ for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
+ hsl.h = (hsl.h + part) % 360;
+ ret.push(tinycolor(hsl));
+ }
+ return ret;
+ }
+ function _monochromatic(color, results) {
+ results = results || 6;
+ var hsv = tinycolor(color).toHsv();
+ var h = hsv.h,
+ s = hsv.s,
+ v = hsv.v;
+ var ret = [];
+ var modification = 1 / results;
+ while (results--) {
+ ret.push(tinycolor({
+ h: h,
+ s: s,
+ v: v
+ }));
+ v = (v + modification) % 1;
+ }
+ return ret;
+ }
+
+ // Utility Functions
+ // ---------------------
+
+ tinycolor.mix = function (color1, color2, amount) {
+ amount = amount === 0 ? 0 : amount || 50;
+ var rgb1 = tinycolor(color1).toRgb();
+ var rgb2 = tinycolor(color2).toRgb();
+ var p = amount / 100;
+ var rgba = {
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
+ b: (rgb2.b - rgb1.b) * p + rgb1.b,
+ a: (rgb2.a - rgb1.a) * p + rgb1.a
+ };
+ return tinycolor(rgba);
+ };
+
+ // Readability Functions
+ // ---------------------
+ // false
+ // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
+ tinycolor.isReadable = function (color1, color2, wcag2) {
+ var readability = tinycolor.readability(color1, color2);
+ var wcag2Parms, out;
+ out = false;
+ wcag2Parms = validateWCAG2Parms(wcag2);
+ switch (wcag2Parms.level + wcag2Parms.size) {
+ case "AAsmall":
+ case "AAAlarge":
+ out = readability >= 4.5;
+ break;
+ case "AAlarge":
+ out = readability >= 3;
+ break;
+ case "AAAsmall":
+ out = readability >= 7;
+ break;
+ }
+ return out;
+ };
+
+ // `mostReadable`
+ // Given a base color and a list of possible foreground or background
+ // colors for that base, returns the most readable color.
+ // Optionally returns Black or White if the most readable color is unreadable.
+ // *Example*
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
+ tinycolor.mostReadable = function (baseColor, colorList, args) {
+ var bestColor = null;
+ var bestScore = 0;
+ var readability;
+ var includeFallbackColors, level, size;
+ args = args || {};
+ includeFallbackColors = args.includeFallbackColors;
+ level = args.level;
+ size = args.size;
+ for (var i = 0; i < colorList.length; i++) {
+ readability = tinycolor.readability(baseColor, colorList[i]);
+ if (readability > bestScore) {
+ bestScore = readability;
+ bestColor = tinycolor(colorList[i]);
+ }
+ }
+ if (tinycolor.isReadable(baseColor, bestColor, {
+ level: level,
+ size: size
+ }) || !includeFallbackColors) {
+ return bestColor;
+ } else {
+ args.includeFallbackColors = false;
+ return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
+ }
+ };
+
+ // Big List of Colors
+ // ------------------
+ //
+ var names = tinycolor.names = {
+ aliceblue: "f0f8ff",
+ antiquewhite: "faebd7",
+ aqua: "0ff",
+ aquamarine: "7fffd4",
+ azure: "f0ffff",
+ beige: "f5f5dc",
+ bisque: "ffe4c4",
+ black: "000",
+ blanchedalmond: "ffebcd",
+ blue: "00f",
+ blueviolet: "8a2be2",
+ brown: "a52a2a",
+ burlywood: "deb887",
+ burntsienna: "ea7e5d",
+ cadetblue: "5f9ea0",
+ chartreuse: "7fff00",
+ chocolate: "d2691e",
+ coral: "ff7f50",
+ cornflowerblue: "6495ed",
+ cornsilk: "fff8dc",
+ crimson: "dc143c",
+ cyan: "0ff",
+ darkblue: "00008b",
+ darkcyan: "008b8b",
+ darkgoldenrod: "b8860b",
+ darkgray: "a9a9a9",
+ darkgreen: "006400",
+ darkgrey: "a9a9a9",
+ darkkhaki: "bdb76b",
+ darkmagenta: "8b008b",
+ darkolivegreen: "556b2f",
+ darkorange: "ff8c00",
+ darkorchid: "9932cc",
+ darkred: "8b0000",
+ darksalmon: "e9967a",
+ darkseagreen: "8fbc8f",
+ darkslateblue: "483d8b",
+ darkslategray: "2f4f4f",
+ darkslategrey: "2f4f4f",
+ darkturquoise: "00ced1",
+ darkviolet: "9400d3",
+ deeppink: "ff1493",
+ deepskyblue: "00bfff",
+ dimgray: "696969",
+ dimgrey: "696969",
+ dodgerblue: "1e90ff",
+ firebrick: "b22222",
+ floralwhite: "fffaf0",
+ forestgreen: "228b22",
+ fuchsia: "f0f",
+ gainsboro: "dcdcdc",
+ ghostwhite: "f8f8ff",
+ gold: "ffd700",
+ goldenrod: "daa520",
+ gray: "808080",
+ green: "008000",
+ greenyellow: "adff2f",
+ grey: "808080",
+ honeydew: "f0fff0",
+ hotpink: "ff69b4",
+ indianred: "cd5c5c",
+ indigo: "4b0082",
+ ivory: "fffff0",
+ khaki: "f0e68c",
+ lavender: "e6e6fa",
+ lavenderblush: "fff0f5",
+ lawngreen: "7cfc00",
+ lemonchiffon: "fffacd",
+ lightblue: "add8e6",
+ lightcoral: "f08080",
+ lightcyan: "e0ffff",
+ lightgoldenrodyellow: "fafad2",
+ lightgray: "d3d3d3",
+ lightgreen: "90ee90",
+ lightgrey: "d3d3d3",
+ lightpink: "ffb6c1",
+ lightsalmon: "ffa07a",
+ lightseagreen: "20b2aa",
+ lightskyblue: "87cefa",
+ lightslategray: "789",
+ lightslategrey: "789",
+ lightsteelblue: "b0c4de",
+ lightyellow: "ffffe0",
+ lime: "0f0",
+ limegreen: "32cd32",
+ linen: "faf0e6",
+ magenta: "f0f",
+ maroon: "800000",
+ mediumaquamarine: "66cdaa",
+ mediumblue: "0000cd",
+ mediumorchid: "ba55d3",
+ mediumpurple: "9370db",
+ mediumseagreen: "3cb371",
+ mediumslateblue: "7b68ee",
+ mediumspringgreen: "00fa9a",
+ mediumturquoise: "48d1cc",
+ mediumvioletred: "c71585",
+ midnightblue: "191970",
+ mintcream: "f5fffa",
+ mistyrose: "ffe4e1",
+ moccasin: "ffe4b5",
+ navajowhite: "ffdead",
+ navy: "000080",
+ oldlace: "fdf5e6",
+ olive: "808000",
+ olivedrab: "6b8e23",
+ orange: "ffa500",
+ orangered: "ff4500",
+ orchid: "da70d6",
+ palegoldenrod: "eee8aa",
+ palegreen: "98fb98",
+ paleturquoise: "afeeee",
+ palevioletred: "db7093",
+ papayawhip: "ffefd5",
+ peachpuff: "ffdab9",
+ peru: "cd853f",
+ pink: "ffc0cb",
+ plum: "dda0dd",
+ powderblue: "b0e0e6",
+ purple: "800080",
+ rebeccapurple: "663399",
+ red: "f00",
+ rosybrown: "bc8f8f",
+ royalblue: "4169e1",
+ saddlebrown: "8b4513",
+ salmon: "fa8072",
+ sandybrown: "f4a460",
+ seagreen: "2e8b57",
+ seashell: "fff5ee",
+ sienna: "a0522d",
+ silver: "c0c0c0",
+ skyblue: "87ceeb",
+ slateblue: "6a5acd",
+ slategray: "708090",
+ slategrey: "708090",
+ snow: "fffafa",
+ springgreen: "00ff7f",
+ steelblue: "4682b4",
+ tan: "d2b48c",
+ teal: "008080",
+ thistle: "d8bfd8",
+ tomato: "ff6347",
+ turquoise: "40e0d0",
+ violet: "ee82ee",
+ wheat: "f5deb3",
+ white: "fff",
+ whitesmoke: "f5f5f5",
+ yellow: "ff0",
+ yellowgreen: "9acd32"
+ };
+
+ // Make it easy to access colors via `hexNames[hex]`
+ var hexNames = tinycolor.hexNames = flip(names);
+
+ // Utilities
+ // ---------
+
+ // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
+ function flip(o) {
+ var flipped = {};
+ for (var i in o) {
+ if (o.hasOwnProperty(i)) {
+ flipped[o[i]] = i;
+ }
+ }
+ return flipped;
+ }
+
+ // Return a valid alpha value [0,1] with all invalid values being set to 1
+ function boundAlpha(a) {
+ a = parseFloat(a);
+ if (isNaN(a) || a < 0 || a > 1) {
+ a = 1;
+ }
+ return a;
+ }
+
+ // Take input from [0, n] and return it as [0, 1]
+ function bound01(n, max) {
+ if (isOnePointZero(n)) n = "100%";
+ var processPercent = isPercentage(n);
+ n = Math.min(max, Math.max(0, parseFloat(n)));
+
+ // Automatically convert percentage into number
+ if (processPercent) {
+ n = parseInt(n * max, 10) / 100;
+ }
+
+ // Handle floating point rounding errors
+ if (Math.abs(n - max) < 0.000001) {
+ return 1;
+ }
+
+ // Convert into [0, 1] range if it isn't already
+ return n % max / parseFloat(max);
+ }
+
+ // Force a number between 0 and 1
+ function clamp01(val) {
+ return Math.min(1, Math.max(0, val));
+ }
+
+ // Parse a base-16 hex value into a base-10 integer
+ function parseIntFromHex(val) {
+ return parseInt(val, 16);
+ }
+
+ // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
+ //
+ function isOnePointZero(n) {
+ return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
+ }
+
+ // Check to see if string passed in is a percentage
+ function isPercentage(n) {
+ return typeof n === "string" && n.indexOf("%") != -1;
+ }
+
+ // Force a hex value to have 2 characters
+ function pad2(c) {
+ return c.length == 1 ? "0" + c : "" + c;
+ }
+
+ // Replace a decimal with it's percentage value
+ function convertToPercentage(n) {
+ if (n <= 1) {
+ n = n * 100 + "%";
+ }
+ return n;
+ }
+
+ // Converts a decimal to a hex value
+ function convertDecimalToHex(d) {
+ return Math.round(parseFloat(d) * 255).toString(16);
+ }
+ // Converts a hex value to a decimal
+ function convertHexToDecimal(h) {
+ return parseIntFromHex(h) / 255;
+ }
+ var matchers = function () {
+ //
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
+
+ //
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
+
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
+
+ // Actual matching.
+ // Parentheses and commas are optional, but not required.
+ // Whitespace can take the place of commas or opening paren
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
+ return {
+ CSS_UNIT: new RegExp(CSS_UNIT),
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
+ };
+ }();
+
+ // `isValidCSSUnit`
+ // Take in a single string / number and check to see if it looks like a CSS unit
+ // (see `matchers` above for definition).
+ function isValidCSSUnit(color) {
+ return !!matchers.CSS_UNIT.exec(color);
+ }
+
+ // `stringInputToObject`
+ // Permissive string parsing. Take in a number of formats, and output an object
+ // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
+ function stringInputToObject(color) {
+ color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
+ var named = false;
+ if (names[color]) {
+ color = names[color];
+ named = true;
+ } else if (color == "transparent") {
+ return {
+ r: 0,
+ g: 0,
+ b: 0,
+ a: 0,
+ format: "name"
+ };
+ }
+
+ // Try to match string input using regular expressions.
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
+ // Just return an object and let the conversion functions handle that.
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
+ var match;
+ if (match = matchers.rgb.exec(color)) {
+ return {
+ r: match[1],
+ g: match[2],
+ b: match[3]
+ };
+ }
+ if (match = matchers.rgba.exec(color)) {
+ return {
+ r: match[1],
+ g: match[2],
+ b: match[3],
+ a: match[4]
+ };
+ }
+ if (match = matchers.hsl.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ l: match[3]
+ };
+ }
+ if (match = matchers.hsla.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ l: match[3],
+ a: match[4]
+ };
+ }
+ if (match = matchers.hsv.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ v: match[3]
+ };
+ }
+ if (match = matchers.hsva.exec(color)) {
+ return {
+ h: match[1],
+ s: match[2],
+ v: match[3],
+ a: match[4]
+ };
+ }
+ if (match = matchers.hex8.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1]),
+ g: parseIntFromHex(match[2]),
+ b: parseIntFromHex(match[3]),
+ a: convertHexToDecimal(match[4]),
+ format: named ? "name" : "hex8"
+ };
+ }
+ if (match = matchers.hex6.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1]),
+ g: parseIntFromHex(match[2]),
+ b: parseIntFromHex(match[3]),
+ format: named ? "name" : "hex"
+ };
+ }
+ if (match = matchers.hex4.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1] + "" + match[1]),
+ g: parseIntFromHex(match[2] + "" + match[2]),
+ b: parseIntFromHex(match[3] + "" + match[3]),
+ a: convertHexToDecimal(match[4] + "" + match[4]),
+ format: named ? "name" : "hex8"
+ };
+ }
+ if (match = matchers.hex3.exec(color)) {
+ return {
+ r: parseIntFromHex(match[1] + "" + match[1]),
+ g: parseIntFromHex(match[2] + "" + match[2]),
+ b: parseIntFromHex(match[3] + "" + match[3]),
+ format: named ? "name" : "hex"
+ };
+ }
+ return false;
+ }
+ function validateWCAG2Parms(parms) {
+ // return valid WCAG2 parms for isReadable.
+ // If input parms are invalid, return {"level":"AA", "size":"small"}
+ var level, size;
+ parms = parms || {
+ level: "AA",
+ size: "small"
+ };
+ level = (parms.level || "AA").toUpperCase();
+ size = (parms.size || "small").toLowerCase();
+ if (level !== "AA" && level !== "AAA") {
+ level = "AA";
+ }
+ if (size !== "small" && size !== "large") {
+ size = "small";
+ }
+ return {
+ level: level,
+ size: size
+ };
+ }
+
+ return tinycolor;
+
+}));
+
+}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
+return __REQUIRE__(1740983753194);
+})()
+//miniprogram-npm-outsideDeps=[]
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/miniprogram_npm/tinycolor2/index.js.map b/miniprogram_npm/tinycolor2/index.js.map
new file mode 100644
index 0000000..b315216
--- /dev/null
+++ b/miniprogram_npm/tinycolor2/index.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["tinycolor.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["// This file is autogenerated. It's used to publish CJS to npm.\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.tinycolor = factory());\n})(this, (function () { \n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n }\n\n // https://github.com/bgrins/TinyColor\n // Brian Grinstead, MIT License\n\n var trimLeft = /^\\s+/;\n var trimRight = /\\s+$/;\n function tinycolor(color, opts) {\n color = color ? color : \"\";\n opts = opts || {};\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n var rgb = inputToRGB(color);\n this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) this._r = Math.round(this._r);\n if (this._g < 1) this._g = Math.round(this._g);\n if (this._b < 1) this._b = Math.round(this._b);\n this._ok = rgb.ok;\n }\n tinycolor.prototype = {\n isDark: function isDark() {\n return this.getBrightness() < 128;\n },\n isLight: function isLight() {\n return !this.isDark();\n },\n isValid: function isValid() {\n return this._ok;\n },\n getOriginalInput: function getOriginalInput() {\n return this._originalInput;\n },\n getFormat: function getFormat() {\n return this._format;\n },\n getAlpha: function getAlpha() {\n return this._a;\n },\n getBrightness: function getBrightness() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function getLuminance() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r / 255;\n GsRGB = rgb.g / 255;\n BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n },\n setAlpha: function setAlpha(value) {\n this._a = boundAlpha(value);\n this._roundA = Math.round(100 * this._a) / 100;\n return this;\n },\n toHsv: function toHsv() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v,\n a: this._a\n };\n },\n toHsvString: function toHsvString() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = Math.round(hsv.h * 360),\n s = Math.round(hsv.s * 100),\n v = Math.round(hsv.v * 100);\n return this._a == 1 ? \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" : \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \" + this._roundA + \")\";\n },\n toHsl: function toHsl() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return {\n h: hsl.h * 360,\n s: hsl.s,\n l: hsl.l,\n a: this._a\n };\n },\n toHslString: function toHslString() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = Math.round(hsl.h * 360),\n s = Math.round(hsl.s * 100),\n l = Math.round(hsl.l * 100);\n return this._a == 1 ? \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" : \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \" + this._roundA + \")\";\n },\n toHex: function toHex(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function toHexString(allow3Char) {\n return \"#\" + this.toHex(allow3Char);\n },\n toHex8: function toHex8(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function toHex8String(allow4Char) {\n return \"#\" + this.toHex8(allow4Char);\n },\n toRgb: function toRgb() {\n return {\n r: Math.round(this._r),\n g: Math.round(this._g),\n b: Math.round(this._b),\n a: this._a\n };\n },\n toRgbString: function toRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \")\" : \"rgba(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function toPercentageRgb() {\n return {\n r: Math.round(bound01(this._r, 255) * 100) + \"%\",\n g: Math.round(bound01(this._g, 255) * 100) + \"%\",\n b: Math.round(bound01(this._b, 255) * 100) + \"%\",\n a: this._a\n };\n },\n toPercentageRgbString: function toPercentageRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%)\" : \"rgba(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function toName() {\n if (this._a === 0) {\n return \"transparent\";\n }\n if (this._a < 1) {\n return false;\n }\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function toFilter(secondColor) {\n var hex8String = \"#\" + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = \"#\" + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\" + gradientType + \"startColorstr=\" + hex8String + \",endColorstr=\" + secondHex8String + \")\";\n },\n toString: function toString(format) {\n var formatSet = !!format;\n format = format || this._format;\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n },\n clone: function clone() {\n return tinycolor(this.toString());\n },\n _applyModification: function _applyModification(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function lighten() {\n return this._applyModification(_lighten, arguments);\n },\n brighten: function brighten() {\n return this._applyModification(_brighten, arguments);\n },\n darken: function darken() {\n return this._applyModification(_darken, arguments);\n },\n desaturate: function desaturate() {\n return this._applyModification(_desaturate, arguments);\n },\n saturate: function saturate() {\n return this._applyModification(_saturate, arguments);\n },\n greyscale: function greyscale() {\n return this._applyModification(_greyscale, arguments);\n },\n spin: function spin() {\n return this._applyModification(_spin, arguments);\n },\n _applyCombination: function _applyCombination(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function analogous() {\n return this._applyCombination(_analogous, arguments);\n },\n complement: function complement() {\n return this._applyCombination(_complement, arguments);\n },\n monochromatic: function monochromatic() {\n return this._applyCombination(_monochromatic, arguments);\n },\n splitcomplement: function splitcomplement() {\n return this._applyCombination(_splitcomplement, arguments);\n },\n // Disabled until https://github.com/bgrins/TinyColor/issues/254\n // polyad: function (number) {\n // return this._applyCombination(polyad, [number]);\n // },\n triad: function triad() {\n return this._applyCombination(polyad, [3]);\n },\n tetrad: function tetrad() {\n return this._applyCombination(polyad, [4]);\n }\n };\n\n // If input is an object, force 1 into \"1.0\" to handle ratios properly\n // String input requires \"1.0\" as input, so 1 will be treated as 1\n tinycolor.fromRatio = function (color, opts) {\n if (_typeof(color) == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n } else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n return tinycolor(color, opts);\n };\n\n // Given a string or object, convert that input to RGB\n // Possible string inputs:\n //\n // \"red\"\n // \"#f00\" or \"f00\"\n // \"#ff0000\" or \"ff0000\"\n // \"#ff000000\" or \"ff000000\"\n // \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n // \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n // \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n // \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n // \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n // \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n // \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n //\n function inputToRGB(color) {\n var rgb = {\n r: 0,\n g: 0,\n b: 0\n };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n if (_typeof(color) == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a\n };\n }\n\n // Conversion Functions\n // --------------------\n\n // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n // \n\n // `rgbToRgb`\n // Handle bounds / percentage checking to conform to CSS color spec\n // \n // *Assumes:* r, g, b in [0, 255] or [0, 1]\n // *Returns:* { r, g, b } in [0, 255]\n function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n }\n\n // `rgbToHsl`\n // Converts an RGB color value to HSL.\n // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n // *Returns:* { h, s, l } in [0,1]\n function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n l = (max + min) / 2;\n if (max == min) {\n h = s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n l: l\n };\n }\n\n // `hslToRgb`\n // Converts an HSL color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hslToRgb(h, s, l) {\n var r, g, b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n }\n\n // `rgbToHsv`\n // Converts an RGB color value to HSV\n // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n // *Returns:* { h, s, v } in [0,1]\n function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n v = max;\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n v: v\n };\n }\n\n // `hsvToRgb`\n // Converts an HSV color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n }\n\n // `rgbToHex`\n // Converts an RGB color to hex\n // Assumes r, g, and b are contained in the set [0, 255]\n // Returns a 3 or 6 character hex\n function rgbToHex(r, g, b, allow3Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join(\"\");\n }\n\n // `rgbaToHex`\n // Converts an RGBA color plus alpha transparency to hex\n // Assumes r, g, b are contained in the set [0, 255] and\n // a in [0, 1]. Returns a 4 or 8 character rgba hex\n function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join(\"\");\n }\n\n // `rgbaToArgbHex`\n // Converts an RGBA color to an ARGB Hex8 string\n // Rarely used, but required for \"toFilter()\"\n function rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n return hex.join(\"\");\n }\n\n // `equals`\n // Can be called with any tinycolor input\n tinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) return false;\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n };\n tinycolor.random = function () {\n return tinycolor.fromRatio({\n r: Math.random(),\n g: Math.random(),\n b: Math.random()\n });\n };\n\n // Modification Functions\n // ----------------------\n // Thanks to less.js for some of the basics here\n // \n\n function _desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n function _saturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n function _greyscale(color) {\n return tinycolor(color).desaturate(100);\n }\n function _lighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n function _brighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var rgb = tinycolor(color).toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return tinycolor(rgb);\n }\n function _darken(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n\n // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n // Values outside of this range will be wrapped into this range.\n function _spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n }\n\n // Combination Functions\n // ---------------------\n // Thanks to jQuery xColor for some of the ideas behind these\n // \n\n function _complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n }\n function polyad(color, number) {\n if (isNaN(number) || number <= 0) {\n throw new Error(\"Argument to polyad must be a positive number\");\n }\n var hsl = tinycolor(color).toHsl();\n var result = [tinycolor(color)];\n var step = 360 / number;\n for (var i = 1; i < number; i++) {\n result.push(tinycolor({\n h: (hsl.h + i * step) % 360,\n s: hsl.s,\n l: hsl.l\n }));\n }\n return result;\n }\n function _splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [tinycolor(color), tinycolor({\n h: (h + 72) % 360,\n s: hsl.s,\n l: hsl.l\n }), tinycolor({\n h: (h + 216) % 360,\n s: hsl.s,\n l: hsl.l\n })];\n }\n function _analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n }\n function _monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h,\n s = hsv.s,\n v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n while (results--) {\n ret.push(tinycolor({\n h: h,\n s: s,\n v: v\n }));\n v = (v + modification) % 1;\n }\n return ret;\n }\n\n // Utility Functions\n // ---------------------\n\n tinycolor.mix = function (color1, color2, amount) {\n amount = amount === 0 ? 0 : amount || 50;\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a\n };\n return tinycolor(rgba);\n };\n\n // Readability Functions\n // ---------------------\n // false\n // tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\n tinycolor.isReadable = function (color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n out = false;\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n };\n\n // `mostReadable`\n // Given a base color and a list of possible foreground or background\n // colors for that base, returns the most readable color.\n // Optionally returns Black or White if the most readable color is unreadable.\n // *Example*\n // tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n // tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n // tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n // tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\n tinycolor.mostReadable = function (baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors;\n level = args.level;\n size = args.size;\n for (var i = 0; i < colorList.length; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n if (tinycolor.isReadable(baseColor, bestColor, {\n level: level,\n size: size\n }) || !includeFallbackColors) {\n return bestColor;\n } else {\n args.includeFallbackColors = false;\n return tinycolor.mostReadable(baseColor, [\"#fff\", \"#000\"], args);\n }\n };\n\n // Big List of Colors\n // ------------------\n // \n var names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n };\n\n // Make it easy to access colors via `hexNames[hex]`\n var hexNames = tinycolor.hexNames = flip(names);\n\n // Utilities\n // ---------\n\n // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\n function flip(o) {\n var flipped = {};\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n }\n\n // Return a valid alpha value [0,1] with all invalid values being set to 1\n function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n }\n\n // Take input from [0, n] and return it as [0, 1]\n function bound01(n, max) {\n if (isOnePointZero(n)) n = \"100%\";\n var processPercent = isPercentage(n);\n n = Math.min(max, Math.max(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return n % max / parseFloat(max);\n }\n\n // Force a number between 0 and 1\n function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n }\n\n // Parse a base-16 hex value into a base-10 integer\n function parseIntFromHex(val) {\n return parseInt(val, 16);\n }\n\n // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n //