textarea.d.ts.map 2.3 KB

1
  1. {"version":3,"sources":["../src/textarea/textarea.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AASlE,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,cAAc;IAClD,OAAO;;MAEL;IAEF,SAAS,WAAuB;IAEhC,eAAe,WAA0E;IAEzF,UAAU,mCAAS;IAEnB,IAAI;;;;MAIF;IAGF,SAAS;;MAIP;IAEF,OAAO;;;;;;MAsCL;CACH","file":"textarea.d.ts","sourcesContent":["/*\n * @Author: rileycai\n * @Date: 2021-09-22 10:33:54\n * @LastEditTime: 2021-09-28 10:26:44\n * @LastEditors: Please set LastEditors\n * @Description: 新增textarea组件\n * @FilePath: /tdesign-miniprogram/src/textarea/textarea.ts\n */\nimport { SuperComponent, wxComponent } from '../common/src/index';\nimport config from '../common/config';\nimport props from './props';\nimport { getCharacterLength } from '../common/utils';\n\nconst { prefix } = config;\nconst name = `${prefix}-textarea`;\n\n@wxComponent()\nexport default class Textarea extends SuperComponent {\n options = {\n multipleSlots: true, // 在组件定义时的选项中启用多slot支持\n };\n\n behaviors = ['wx://form-field'];\n\n externalClasses = ['t-class', 't-class-textarea', 't-class-placeholder', 't-class-name'];\n\n properties = props;\n\n data = {\n inputValue: '',\n classPrefix: name,\n characterLength: 0,\n };\n\n /* 组件生命周期 */\n lifetimes = {\n ready() {\n this.setData({ inputValue: this.data.value });\n },\n };\n\n methods = {\n onInput(event) {\n const { value } = event.detail;\n const { maxcharacter } = this.properties;\n if (maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {\n const { characters = '', length = 0 } = getCharacterLength(value, maxcharacter);\n this.setData({\n value: characters,\n characterLength: length,\n });\n } else {\n this.setData({ inputValue: value });\n }\n\n this.triggerEvent('change', {\n ...event.detail,\n });\n },\n onFocus(event) {\n this.triggerEvent('focus', {\n ...event.detail,\n });\n },\n onBlur(event) {\n this.triggerEvent('blur', {\n ...event.detail,\n });\n },\n onConfirm(event) {\n this.triggerEvent('enter', {\n ...event.detail,\n });\n },\n onLineChange(event) {\n this.triggerEvent('lineChange', {\n ...event.detail,\n });\n },\n };\n}\n"]}