diff --git a/miniprogram_npm/@vant/weapp/circle/canvas.d.ts b/miniprogram_npm/@vant/weapp/circle/canvas.d.ts deleted file mode 100644 index 15268c9..0000000 --- a/miniprogram_npm/@vant/weapp/circle/canvas.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -declare type CanvasContext = WechatMiniprogram.CanvasContext; -export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; -export {}; diff --git a/miniprogram_npm/@vant/weapp/circle/canvas.js b/miniprogram_npm/@vant/weapp/circle/canvas.js deleted file mode 100644 index d81df74..0000000 --- a/miniprogram_npm/@vant/weapp/circle/canvas.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.adaptor = void 0; -function adaptor(ctx) { - // @ts-ignore - return Object.assign(ctx, { - setStrokeStyle: function (val) { - ctx.strokeStyle = val; - }, - setLineWidth: function (val) { - ctx.lineWidth = val; - }, - setLineCap: function (val) { - ctx.lineCap = val; - }, - setFillStyle: function (val) { - ctx.fillStyle = val; - }, - setFontSize: function (val) { - ctx.font = String(val); - }, - setGlobalAlpha: function (val) { - ctx.globalAlpha = val; - }, - setLineJoin: function (val) { - ctx.lineJoin = val; - }, - setTextAlign: function (val) { - ctx.textAlign = val; - }, - setMiterLimit: function (val) { - ctx.miterLimit = val; - }, - setShadow: function (offsetX, offsetY, blur, color) { - ctx.shadowOffsetX = offsetX; - ctx.shadowOffsetY = offsetY; - ctx.shadowBlur = blur; - ctx.shadowColor = color; - }, - setTextBaseline: function (val) { - ctx.textBaseline = val; - }, - createCircularGradient: function () { }, - draw: function () { }, - }); -} -exports.adaptor = adaptor; diff --git a/miniprogram_npm/@vant/weapp/circle/index.d.ts b/miniprogram_npm/@vant/weapp/circle/index.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/miniprogram_npm/@vant/weapp/circle/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/miniprogram_npm/@vant/weapp/circle/index.js b/miniprogram_npm/@vant/weapp/circle/index.js deleted file mode 100644 index 9037e1c..0000000 --- a/miniprogram_npm/@vant/weapp/circle/index.js +++ /dev/null @@ -1,203 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var color_1 = require("../common/color"); -var component_1 = require("../common/component"); -var utils_1 = require("../common/utils"); -var validator_1 = require("../common/validator"); -var version_1 = require("../common/version"); -var canvas_1 = require("./canvas"); -function format(rate) { - return Math.min(Math.max(rate, 0), 100); -} -var PERIMETER = 2 * Math.PI; -var BEGIN_ANGLE = -Math.PI / 2; -var STEP = 1; -(0, component_1.VantComponent)({ - props: { - text: String, - lineCap: { - type: String, - value: 'round', - }, - value: { - type: Number, - value: 0, - observer: 'reRender', - }, - speed: { - type: Number, - value: 50, - }, - size: { - type: Number, - value: 100, - observer: function () { - this.drawCircle(this.currentValue); - }, - }, - fill: String, - layerColor: { - type: String, - value: color_1.WHITE, - }, - color: { - type: null, - value: color_1.BLUE, - observer: function () { - var _this = this; - this.setHoverColor().then(function () { - _this.drawCircle(_this.currentValue); - }); - }, - }, - type: { - type: String, - value: '', - }, - strokeWidth: { - type: Number, - value: 4, - }, - clockwise: { - type: Boolean, - value: true, - }, - }, - data: { - hoverColor: color_1.BLUE, - }, - methods: { - getContext: function () { - var _this = this; - var _a = this.data, type = _a.type, size = _a.size; - if (type === '' || !(0, version_1.canIUseCanvas2d)()) { - var ctx = wx.createCanvasContext('van-circle', this); - return Promise.resolve(ctx); - } - var dpr = (0, utils_1.getSystemInfoSync)().pixelRatio; - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(_this) - .select('#van-circle') - .node() - .exec(function (res) { - var canvas = res[0].node; - var ctx = canvas.getContext(type); - if (!_this.inited) { - _this.inited = true; - canvas.width = size * dpr; - canvas.height = size * dpr; - ctx.scale(dpr, dpr); - } - resolve((0, canvas_1.adaptor)(ctx)); - }); - }); - }, - setHoverColor: function () { - var _this = this; - var _a = this.data, color = _a.color, size = _a.size; - if ((0, validator_1.isObj)(color)) { - return this.getContext().then(function (context) { - var LinearColor = context.createLinearGradient(size, 0, 0, 0); - Object.keys(color) - .sort(function (a, b) { return parseFloat(a) - parseFloat(b); }) - .map(function (key) { - return LinearColor.addColorStop(parseFloat(key) / 100, color[key]); - }); - _this.hoverColor = LinearColor; - }); - } - this.hoverColor = color; - return Promise.resolve(); - }, - presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { - var _a = this.data, strokeWidth = _a.strokeWidth, lineCap = _a.lineCap, clockwise = _a.clockwise, size = _a.size; - var position = size / 2; - var radius = position - strokeWidth / 2; - context.setStrokeStyle(strokeStyle); - context.setLineWidth(strokeWidth); - context.setLineCap(lineCap); - context.beginPath(); - context.arc(position, position, radius, beginAngle, endAngle, !clockwise); - context.stroke(); - if (fill) { - context.setFillStyle(fill); - context.fill(); - } - }, - renderLayerCircle: function (context) { - var _a = this.data, layerColor = _a.layerColor, fill = _a.fill; - this.presetCanvas(context, layerColor, 0, PERIMETER, fill); - }, - renderHoverCircle: function (context, formatValue) { - var clockwise = this.data.clockwise; - // 结束角度 - var progress = PERIMETER * (formatValue / 100); - var endAngle = clockwise - ? BEGIN_ANGLE + progress - : 3 * Math.PI - (BEGIN_ANGLE + progress); - this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); - }, - drawCircle: function (currentValue) { - var _this = this; - var size = this.data.size; - this.getContext().then(function (context) { - context.clearRect(0, 0, size, size); - _this.renderLayerCircle(context); - var formatValue = format(currentValue); - if (formatValue !== 0) { - _this.renderHoverCircle(context, formatValue); - } - context.draw(); - }); - }, - reRender: function () { - var _this = this; - // tofector 动画暂时没有想到好的解决方案 - var _a = this.data, value = _a.value, speed = _a.speed; - if (speed <= 0 || speed > 1000) { - this.drawCircle(value); - return; - } - this.clearMockInterval(); - this.currentValue = this.currentValue || 0; - var run = function () { - _this.interval = setTimeout(function () { - if (_this.currentValue !== value) { - if (Math.abs(_this.currentValue - value) < STEP) { - _this.currentValue = value; - } - else if (_this.currentValue < value) { - _this.currentValue += STEP; - } - else { - _this.currentValue -= STEP; - } - _this.drawCircle(_this.currentValue); - run(); - } - else { - _this.clearMockInterval(); - } - }, 1000 / speed); - }; - run(); - }, - clearMockInterval: function () { - if (this.interval) { - clearTimeout(this.interval); - this.interval = null; - } - }, - }, - mounted: function () { - var _this = this; - this.currentValue = this.data.value; - this.setHoverColor().then(function () { - _this.drawCircle(_this.currentValue); - }); - }, - destroyed: function () { - this.clearMockInterval(); - }, -}); diff --git a/miniprogram_npm/@vant/weapp/circle/index.json b/miniprogram_npm/@vant/weapp/circle/index.json deleted file mode 100644 index 467ce29..0000000 --- a/miniprogram_npm/@vant/weapp/circle/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/miniprogram_npm/@vant/weapp/circle/index.wxml b/miniprogram_npm/@vant/weapp/circle/index.wxml deleted file mode 100644 index 52bc59f..0000000 --- a/miniprogram_npm/@vant/weapp/circle/index.wxml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - {{ text }} - diff --git a/miniprogram_npm/@vant/weapp/circle/index.wxss b/miniprogram_npm/@vant/weapp/circle/index.wxss deleted file mode 100644 index 2200751..0000000 --- a/miniprogram_npm/@vant/weapp/circle/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-circle{display:inline-block;position:relative;text-align:center}.van-circle__text{color:var(--circle-text-color,#323233);left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%} \ No newline at end of file diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.d.ts b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.d.ts deleted file mode 100644 index 44ab827..0000000 --- a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -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; - }; -} diff --git a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.js b/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.js deleted file mode 100644 index c79bc9f..0000000 --- a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.js +++ /dev/null @@ -1,78 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { wxComponent, SuperComponent } from '../common/src/index'; -import config from '../common/config'; -import props from './props'; -import { classNames, 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 } = this.properties; - const tagClass = [ - classPrefix, - `${classPrefix}--checkable`, - disabled ? `${classPrefix}--disabled` : '', - checked ? `${classPrefix}--checked` : '', - `${classPrefix}--${checked ? 'primary' : 'default'}`, - `${classPrefix}--${size}`, - `${classPrefix}--${variant}`, - ]; - 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 }); - }, - }; - } -}; -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 deleted file mode 100644 index 049940c..0000000 --- a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "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 deleted file mode 100644 index c0c129c..0000000 --- a/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag.wxml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - -