@cloudbase/weda-ui-mp 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/actions/showMessage/index.js +3 -0
- package/actions/showModal/index.js +3 -0
- package/actions/showToast/index.js +3 -0
- package/app.js +0 -0
- package/components/button/index.js +89 -0
- package/components/button/index.json +4 -0
- package/components/button/index.wxml +22 -0
- package/components/button/index.wxss +13 -0
- package/components/calendar/arrowright--line.svg +3 -0
- package/components/calendar/index.js +439 -0
- package/components/calendar/index.json +5 -0
- package/components/calendar/index.wxml +35 -0
- package/components/calendar/index.wxss +203 -0
- package/components/carousel/index.js +91 -0
- package/components/carousel/index.json +7 -0
- package/components/carousel/index.wxml +6 -0
- package/components/chart/bar/index.js +331 -0
- package/components/chart/bar/index.json +6 -0
- package/components/chart/bar/index.wxml +1 -0
- package/components/chart/bar/index.wxss +9 -0
- package/components/chart/common/config/bar.js +50 -0
- package/components/chart/common/config/global.js +16 -0
- package/components/chart/common/config/line.js +48 -0
- package/components/chart/common/config/pie.js +36 -0
- package/components/chart/common/core/eChartBar.js +267 -0
- package/components/chart/common/core/eChartBase.js +450 -0
- package/components/chart/common/core/eChartLine.js +251 -0
- package/components/chart/common/core/eChartPie.js +169 -0
- package/components/chart/common/data-transform.js +284 -0
- package/components/chart/common/lib/echarts.min.js +18 -0
- package/components/chart/ec-canvas/ec-canvas.js +277 -0
- package/components/chart/ec-canvas/ec-canvas.json +4 -0
- package/components/chart/ec-canvas/ec-canvas.wxml +4 -0
- package/components/chart/ec-canvas/ec-canvas.wxss +4 -0
- package/components/chart/ec-canvas/wx-canvas.js +111 -0
- package/components/chart/line/index.js +326 -0
- package/components/chart/line/index.json +6 -0
- package/components/chart/line/index.wxml +1 -0
- package/components/chart/line/index.wxss +9 -0
- package/components/chart/pie/index.js +257 -0
- package/components/chart/pie/index.json +6 -0
- package/components/chart/pie/index.wxml +1 -0
- package/components/chart/pie/index.wxss +9 -0
- package/components/chart/statisticsCard/index.js +255 -0
- package/components/chart/statisticsCard/index.json +4 -0
- package/components/chart/statisticsCard/index.wxml +9 -0
- package/components/chart/statisticsCard/index.wxss +42 -0
- package/components/common/form-item-wrapper/index.js +20 -0
- package/components/common/form-item-wrapper/index.json +5 -0
- package/components/common/form-item-wrapper/index.wxml +3 -0
- package/components/container/index.js +32 -0
- package/components/container/index.json +4 -0
- package/components/container/index.wxml +3 -0
- package/components/customer-service/index.js +41 -0
- package/components/customer-service/index.json +5 -0
- package/components/customer-service/index.wxml +3 -0
- package/components/customer-service/index.wxss +7 -0
- package/components/dataView/index.js +109 -0
- package/components/dataView/index.json +7 -0
- package/components/dataView/index.wxml +25 -0
- package/components/dataView/index.wxss +0 -0
- package/components/form/checkbox/index.js +145 -0
- package/components/form/checkbox/index.json +7 -0
- package/components/form/checkbox/index.wxml +13 -0
- package/components/form/checkbox/index.wxss +1 -0
- package/components/form/form/index.js +189 -0
- package/components/form/form/index.json +4 -0
- package/components/form/form/index.wxml +5 -0
- package/components/form/form/index.wxss +3 -0
- package/components/form/form/wd-form.wxss +1091 -0
- package/components/form/formcell/index.js +57 -0
- package/components/form/formcell/index.json +4 -0
- package/components/form/formcell/index.wxml +11 -0
- package/components/form/formcell/index.wxss +31 -0
- package/components/form/input/index.js +116 -0
- package/components/form/input/index.json +7 -0
- package/components/form/input/index.wxml +25 -0
- package/components/form/input/index.wxss +22 -0
- package/components/form/location/components/mapChoose/index.js +495 -0
- package/components/form/location/components/mapChoose/index.json +4 -0
- package/components/form/location/components/mapChoose/index.wxml +54 -0
- package/components/form/location/components/mapChoose/index.wxss +301 -0
- package/components/form/location/index.js +494 -0
- package/components/form/location/index.json +10 -0
- package/components/form/location/index.wxml +29 -0
- package/components/form/location/index.wxss +151 -0
- package/components/form/location/location-btn.svg +4 -0
- package/components/form/location/location.svg +4 -0
- package/components/form/radio/index.js +124 -0
- package/components/form/radio/index.json +7 -0
- package/components/form/radio/index.wxml +13 -0
- package/components/form/radio/index.wxss +1 -0
- package/components/form/select/allTimePicker/dataUtils.js +377 -0
- package/components/form/select/allTimePicker/index.js +487 -0
- package/components/form/select/allTimePicker/index.json +7 -0
- package/components/form/select/allTimePicker/index.wxml +35 -0
- package/components/form/select/allTimePicker/index.wxss +118 -0
- package/components/form/select/dropdown-select/index.js +262 -0
- package/components/form/select/dropdown-select/index.json +4 -0
- package/components/form/select/dropdown-select/index.wxml +35 -0
- package/components/form/select/dropdown-select/index.wxss +293 -0
- package/components/form/select/formats-util.js +15 -0
- package/components/form/select/index.js +1017 -0
- package/components/form/select/index.json +10 -0
- package/components/form/select/index.wxml +56 -0
- package/components/form/select/index.wxss +61 -0
- package/components/form/select/region/index.js +120 -0
- package/components/form/selectMultiple/dropdown-select/index.js +202 -0
- package/components/form/selectMultiple/dropdown-select/index.json +4 -0
- package/components/form/selectMultiple/dropdown-select/index.wxml +37 -0
- package/components/form/selectMultiple/dropdown-select/index.wxss +305 -0
- package/components/form/selectMultiple/index.js +328 -0
- package/components/form/selectMultiple/index.json +9 -0
- package/components/form/selectMultiple/index.wxml +20 -0
- package/components/form/selectMultiple/index.wxss +127 -0
- package/components/form/switch/index.js +90 -0
- package/components/form/switch/index.json +7 -0
- package/components/form/switch/index.wxml +11 -0
- package/components/form/switch/index.wxss +1 -0
- package/components/form/textarea/index.js +90 -0
- package/components/form/textarea/index.json +7 -0
- package/components/form/textarea/index.wxml +8 -0
- package/components/form/textarea/index.wxss +10 -0
- package/components/form/tips/index.js +41 -0
- package/components/form/tips/index.json +4 -0
- package/components/form/tips/index.wxml +1 -0
- package/components/form/tips/index.wxss +5 -0
- package/components/form/uploader/compress.js +31 -0
- package/components/form/uploader/index.js +289 -0
- package/components/form/uploader/index.json +10 -0
- package/components/form/uploader/index.wxml +38 -0
- package/components/form/uploader/index.wxss +47 -0
- package/components/form/uploader/weui-uploader.js +310 -0
- package/components/form/uploader/weui-uploader.json +7 -0
- package/components/form/uploader/weui-uploader.wxml +49 -0
- package/components/form/uploader/weui-uploader.wxss +19 -0
- package/components/form/uploaderFile/index.js +481 -0
- package/components/form/uploaderFile/index.json +9 -0
- package/components/form/uploaderFile/index.wxml +52 -0
- package/components/form/uploaderFile/index.wxss +171 -0
- package/components/form-checkbox/index.js +78 -0
- package/components/form-checkbox/index.json +9 -0
- package/components/form-checkbox/index.wxml +6 -0
- package/components/form-date/index.js +72 -0
- package/components/form-date/index.json +9 -0
- package/components/form-date/index.wxml +25 -0
- package/components/form-email/index.js +99 -0
- package/components/form-email/index.json +9 -0
- package/components/form-email/index.wxml +28 -0
- package/components/form-field-behavior/form-field-behavior.js +423 -0
- package/components/form-field-behavior/item-behavior.js +445 -0
- package/components/form-field-behavior/validator.js +132 -0
- package/components/form-image-uploader/index.js +83 -0
- package/components/form-image-uploader/index.json +9 -0
- package/components/form-image-uploader/index.wxml +27 -0
- package/components/form-input/index.js +103 -0
- package/components/form-input/index.json +9 -0
- package/components/form-input/index.wxml +29 -0
- package/components/form-location/index.js +98 -0
- package/components/form-location/index.json +9 -0
- package/components/form-location/index.wxml +28 -0
- package/components/form-multi-region/index.js +62 -0
- package/components/form-multi-region/index.json +9 -0
- package/components/form-multi-region/index.wxml +6 -0
- package/components/form-phone/index.js +95 -0
- package/components/form-phone/index.json +9 -0
- package/components/form-phone/index.wxml +28 -0
- package/components/form-radio/index.js +70 -0
- package/components/form-radio/index.json +9 -0
- package/components/form-radio/index.wxml +6 -0
- package/components/form-region/index.js +59 -0
- package/components/form-region/index.json +9 -0
- package/components/form-region/index.wxml +6 -0
- package/components/form-select/index.js +114 -0
- package/components/form-select/index.json +9 -0
- package/components/form-select/index.wxml +31 -0
- package/components/form-select-multiple/index.js +97 -0
- package/components/form-select-multiple/index.json +9 -0
- package/components/form-select-multiple/index.wxml +29 -0
- package/components/form-switch/index.js +43 -0
- package/components/form-switch/index.json +9 -0
- package/components/form-switch/index.wxml +6 -0
- package/components/form-text-area/index.js +95 -0
- package/components/form-text-area/index.json +9 -0
- package/components/form-text-area/index.wxml +26 -0
- package/components/form-time/index.js +72 -0
- package/components/form-time/index.json +9 -0
- package/components/form-time/index.wxml +6 -0
- package/components/form-upload-file/index.js +73 -0
- package/components/form-upload-file/index.json +9 -0
- package/components/form-upload-file/index.wxml +26 -0
- package/components/form-url/index.js +104 -0
- package/components/form-url/index.json +9 -0
- package/components/form-url/index.wxml +28 -0
- package/components/formdetail/index.js +330 -0
- package/components/formdetail/index.json +7 -0
- package/components/formdetail/index.wxml +7 -0
- package/components/formdetail/index.wxss +277 -0
- package/components/formdetail/wd-form-detail.wxss +245 -0
- package/components/graphicCard/chevron-right.svg +3 -0
- package/components/graphicCard/index.js +205 -0
- package/components/graphicCard/index.json +7 -0
- package/components/graphicCard/index.wxml +27 -0
- package/components/graphicCard/index.wxss +165 -0
- package/components/grid/_util.wxss +67 -0
- package/components/grid/col/index.js +110 -0
- package/components/grid/col/index.json +4 -0
- package/components/grid/col/index.wxml +3 -0
- package/components/grid/index.js +94 -0
- package/components/grid/index.json +4 -0
- package/components/grid/index.wxml +3 -0
- package/components/grid/index.wxss +1206 -0
- package/components/grid/row/index.js +78 -0
- package/components/grid/row/index.json +4 -0
- package/components/grid/row/index.wxml +3 -0
- package/components/image/index.js +203 -0
- package/components/image/index.json +7 -0
- package/components/image/index.wxml +9 -0
- package/components/image/index.wxss +49 -0
- package/components/listView/arrow-right-line.svg +3 -0
- package/components/listView/emptyText.svg +7 -0
- package/components/listView/index.js +656 -0
- package/components/listView/index.json +7 -0
- package/components/listView/index.wxml +82 -0
- package/components/listView/index.wxss +290 -0
- package/components/listView/more-line.svg +3 -0
- package/components/lottery/index.js +301 -0
- package/components/lottery/index.json +4 -0
- package/components/lottery/index.wxml +41 -0
- package/components/lottery/index.wxss +340 -0
- package/components/modal/index.js +65 -0
- package/components/modal/index.json +9 -0
- package/components/modal/index.wxml +18 -0
- package/components/modal/index.wxss +56 -0
- package/components/navLayout/index.js +123 -0
- package/components/navLayout/index.json +8 -0
- package/components/navLayout/index.wxml +22 -0
- package/components/navLayout/index.wxss +131 -0
- package/components/navigationBar/index.js +205 -0
- package/components/navigationBar/index.json +5 -0
- package/components/navigationBar/index.wxml +83 -0
- package/components/navigationBar/index.wxss +205 -0
- package/components/qrcode/index.js +155 -0
- package/components/qrcode/index.json +5 -0
- package/components/qrcode/index.wxml +2 -0
- package/components/qrcode/index.wxss +10 -0
- package/components/richText/index.js +90 -0
- package/components/richText/index.json +4 -0
- package/components/richText/index.wxml +3 -0
- package/components/richText/index.wxss +67 -0
- package/components/scrollView/index.js +119 -0
- package/components/scrollView/index.json +4 -0
- package/components/scrollView/index.wxml +38 -0
- package/components/slot/index.js +25 -0
- package/components/slot/index.json +4 -0
- package/components/slot/index.wxml +3 -0
- package/components/status-content/arrow-right.svg +1 -0
- package/components/status-content/close.svg +1 -0
- package/components/status-content/error.svg +6 -0
- package/components/status-content/index.js +51 -0
- package/components/status-content/index.json +4 -0
- package/components/status-content/index.wxml +28 -0
- package/components/status-content/index.wxss +145 -0
- package/components/swiper/index.js +65 -0
- package/components/swiper/index.json +4 -0
- package/components/swiper/index.wxml +3 -0
- package/components/tabs/index.js +67 -0
- package/components/tabs/index.json +4 -0
- package/components/tabs/index.wxml +10 -0
- package/components/tabs/index.wxss +61 -0
- package/components/text/index.js +40 -0
- package/components/text/index.json +4 -0
- package/components/text/index.wxml +7 -0
- package/components/text/index.wxss +27 -0
- package/components/tooltip/index.js +290 -0
- package/components/tooltip/index.json +4 -0
- package/components/tooltip/index.wxml +18 -0
- package/components/tooltip/index.wxss +72 -0
- package/components/tooltip/wd-tooltip.wxss +25 -0
- package/components/wd-ad/index.js +66 -0
- package/components/wd-ad/index.json +5 -0
- package/components/wd-ad/index.wxml +3 -0
- package/components/wd-ad/index.wxss +3 -0
- package/components/wd-audio/index.js +273 -0
- package/components/wd-audio/index.json +5 -0
- package/components/wd-audio/index.wxml +3 -0
- package/components/wd-audio/index.wxss +0 -0
- package/components/wd-button/index.js +284 -0
- package/components/wd-button/index.json +7 -0
- package/components/wd-button/index.wxml +32 -0
- package/components/wd-button/index.wxss +2 -0
- package/components/wd-button/wd-button.wxss +498 -0
- package/components/wd-calendar/arrowright--line.svg +3 -0
- package/components/wd-calendar/index.js +157 -0
- package/components/wd-calendar/index.json +5 -0
- package/components/wd-calendar/index.wxml +36 -0
- package/components/wd-calendar/index.wxss +203 -0
- package/components/wd-calendar/weeks.js +41 -0
- package/components/wd-canvas/index.js +250 -0
- package/components/wd-canvas/index.json +5 -0
- package/components/wd-canvas/index.wxml +2 -0
- package/components/wd-canvas/index.wxss +0 -0
- package/components/wd-card/index.js +76 -0
- package/components/wd-card/index.json +5 -0
- package/components/wd-card/index.wxml +11 -0
- package/components/wd-card/index.wxss +6 -0
- package/components/wd-card/wd-card.wxss +114 -0
- package/components/wd-checkbox-list/index.js +170 -0
- package/components/wd-checkbox-list/index.json +7 -0
- package/components/wd-checkbox-list/index.wxml +37 -0
- package/components/wd-checkbox-list/index.wxss +2 -0
- package/components/wd-checkbox-list/wd-checkbox-list.wxss +253 -0
- package/components/wd-date/calendar/index.js +111 -0
- package/components/wd-date/calendar/index.json +7 -0
- package/components/wd-date/calendar/index.wxml +38 -0
- package/components/wd-date/calendar/index.wxss +0 -0
- package/components/wd-date/date-picker/index.js +101 -0
- package/components/wd-date/date-picker/index.json +9 -0
- package/components/wd-date/date-picker/index.wxml +41 -0
- package/components/wd-date/date-picker/index.wxss +7 -0
- package/components/wd-date/index.js +129 -0
- package/components/wd-date/index.json +10 -0
- package/components/wd-date/index.wxml +36 -0
- package/components/wd-date/index.wxss +9 -0
- package/components/wd-date/modal/index.js +28 -0
- package/components/wd-date/modal/index.json +5 -0
- package/components/wd-date/modal/index.wxml +14 -0
- package/components/wd-date/modal/index.wxss +3 -0
- package/components/wd-date/time-picker/index.js +202 -0
- package/components/wd-date/time-picker/index.json +5 -0
- package/components/wd-date/time-picker/index.wxml +13 -0
- package/components/wd-date/time-picker/index.wxss +9 -0
- package/components/wd-date/wd-date.wxss +0 -0
- package/components/wd-date/year-month-picker/index.js +128 -0
- package/components/wd-date/year-month-picker/index.json +5 -0
- package/components/wd-date/year-month-picker/index.wxml +8 -0
- package/components/wd-date/year-month-picker/index.wxss +9 -0
- package/components/wd-date-range/index.js +172 -0
- package/components/wd-date-range/index.json +10 -0
- package/components/wd-date-range/index.wxml +41 -0
- package/components/wd-date-range/index.wxss +9 -0
- package/components/wd-date-range/wd-date-range.wxss +0 -0
- package/components/wd-divider/index.js +46 -0
- package/components/wd-divider/index.json +5 -0
- package/components/wd-divider/index.wxml +1 -0
- package/components/wd-divider/index.wxss +2 -0
- package/components/wd-divider/wd-divider.wxss +26 -0
- package/components/wd-form/form-utils.js +55 -0
- package/components/wd-form/index.js +748 -0
- package/components/wd-form/index.json +5 -0
- package/components/wd-form/index.wxml +13 -0
- package/components/wd-form/index.wxss +23 -0
- package/components/wd-form/remote-value.js +76 -0
- package/components/wd-form/wd-form.wxss +1091 -0
- package/components/wd-form-item/index.js +106 -0
- package/components/wd-form-item/index.json +7 -0
- package/components/wd-form-item/index.wxml +47 -0
- package/components/wd-form-item/index.wxss +2 -0
- package/components/wd-form-item/wd-form-item.wxss +1091 -0
- package/components/wd-form-item-read-only/index.js +59 -0
- package/components/wd-form-item-read-only/index.json +5 -0
- package/components/wd-form-item-read-only/index.wxml +10 -0
- package/components/wd-icon/index.js +140 -0
- package/components/wd-icon/index.json +7 -0
- package/components/wd-icon/index.wxml +4 -0
- package/components/wd-icon/index.wxss +4 -0
- package/components/wd-icon/wd-font-icon.wxss +4432 -0
- package/components/wd-icon/wd-icon.wxss +148 -0
- package/components/wd-image/index.js +244 -0
- package/components/wd-image/index.json +7 -0
- package/components/wd-image/index.wxml +11 -0
- package/components/wd-image/index.wxss +11 -0
- package/components/wd-image/wd-image.wxss +80 -0
- package/components/wd-input/index.js +62 -0
- package/components/wd-input/index.json +7 -0
- package/components/wd-input/index.wxml +57 -0
- package/components/wd-input/inner-input/index.js +202 -0
- package/components/wd-input/inner-input/index.json +9 -0
- package/components/wd-input/inner-input/index.wxml +79 -0
- package/components/wd-input/inner-input/index.wxss +2 -0
- package/components/wd-input/inner-input/wd-input.wxss +1574 -0
- package/components/wd-input-email/index.js +63 -0
- package/components/wd-input-email/index.json +7 -0
- package/components/wd-input-email/index.wxml +55 -0
- package/components/wd-input-group/index.js +57 -0
- package/components/wd-input-group/index.json +5 -0
- package/components/wd-input-group/index.wxml +16 -0
- package/components/wd-input-group/index.wxss +1 -0
- package/components/wd-input-group/wd-input-group.wxss +99 -0
- package/components/wd-input-number/index.js +575 -0
- package/components/wd-input-number/index.json +10 -0
- package/components/wd-input-number/index.wxml +66 -0
- package/components/wd-input-number/index.wxss +8 -0
- package/components/wd-input-number/number.js +309 -0
- package/components/wd-input-number/wd-input-number.wxss +243 -0
- package/components/wd-input-phone/index.js +80 -0
- package/components/wd-input-phone/index.json +7 -0
- package/components/wd-input-phone/index.wxml +55 -0
- package/components/wd-input-url/index.js +63 -0
- package/components/wd-input-url/index.json +7 -0
- package/components/wd-input-url/index.wxml +55 -0
- package/components/wd-input-wrap/index.js +112 -0
- package/components/wd-input-wrap/index.json +7 -0
- package/components/wd-input-wrap/index.wxml +32 -0
- package/components/wd-input-wrap/index.wxss +2 -0
- package/components/wd-input-wrap/wd-input-wrap.wxss +220 -0
- package/components/wd-layout/index.js +33 -0
- package/components/wd-layout/index.json +5 -0
- package/components/wd-layout/index.wxml +13 -0
- package/components/wd-layout/index.wxss +2 -0
- package/components/wd-layout/wd-layout.wxss +78 -0
- package/components/wd-location/index.js +49 -0
- package/components/wd-location/index.json +10 -0
- package/components/wd-location/index.wxml +47 -0
- package/components/wd-menu-base-layout/index.js +20 -0
- package/components/wd-menu-base-layout/index.json +5 -0
- package/components/wd-menu-base-layout/index.wxml +3 -0
- package/components/wd-menu-horizontal-layout/index.js +20 -0
- package/components/wd-menu-horizontal-layout/index.json +5 -0
- package/components/wd-menu-horizontal-layout/index.wxml +3 -0
- package/components/wd-menu-layout/index.js +69 -0
- package/components/wd-menu-layout/index.json +8 -0
- package/components/wd-menu-layout/index.wxml +57 -0
- package/components/wd-menu-layout/index.wxss +13 -0
- package/components/wd-menu-layout/utils/index.js +40 -0
- package/components/wd-menu-layout/wd-menu-layout.wxss +632 -0
- package/components/wd-menu-list/index.js +246 -0
- package/components/wd-menu-list/index.json +7 -0
- package/components/wd-menu-list/index.wxml +50 -0
- package/components/wd-menu-list/index.wxss +146 -0
- package/components/wd-menu-list/wd-menu-list.wxss +621 -0
- package/components/wd-menu-nav-layout/index.js +20 -0
- package/components/wd-menu-nav-layout/index.json +5 -0
- package/components/wd-menu-nav-layout/index.wxml +3 -0
- package/components/wd-menu-plant-layout/index.js +20 -0
- package/components/wd-menu-plant-layout/index.json +5 -0
- package/components/wd-menu-plant-layout/index.wxml +3 -0
- package/components/wd-menu-tab-layout/index.js +20 -0
- package/components/wd-menu-tab-layout/index.json +5 -0
- package/components/wd-menu-tab-layout/index.wxml +3 -0
- package/components/wd-menu-vertical-layout/index.js +20 -0
- package/components/wd-menu-vertical-layout/index.json +5 -0
- package/components/wd-menu-vertical-layout/index.wxml +3 -0
- package/components/wd-modal/index.js +184 -0
- package/components/wd-modal/index.json +5 -0
- package/components/wd-modal/index.wxml +16 -0
- package/components/wd-modal/index.wxss +2 -0
- package/components/wd-modal/wd-modal.wxss +206 -0
- package/components/wd-official-account/index.js +28 -0
- package/components/wd-official-account/index.json +5 -0
- package/components/wd-official-account/index.wxml +1 -0
- package/components/wd-official-account/index.wxss +4 -0
- package/components/wd-progress/index.js +127 -0
- package/components/wd-progress/index.json +7 -0
- package/components/wd-progress/index.wxml +29 -0
- package/components/wd-progress/index.wxss +2 -0
- package/components/wd-progress/wd-progress.wxss +1123 -0
- package/components/wd-radio-list/index.js +157 -0
- package/components/wd-radio-list/index.json +7 -0
- package/components/wd-radio-list/index.wxml +37 -0
- package/components/wd-radio-list/index.wxss +2 -0
- package/components/wd-radio-list/wd-radio-list.wxss +181 -0
- package/components/wd-rating/index.js +359 -0
- package/components/wd-rating/index.json +9 -0
- package/components/wd-rating/index.wxml +37 -0
- package/components/wd-rating/index.wxss +2 -0
- package/components/wd-rating/wd-rating.wxss +1116 -0
- package/components/wd-region/index.js +38 -0
- package/components/wd-region/index.json +10 -0
- package/components/wd-region/index.wxml +28 -0
- package/components/wd-region/index.wxss +4 -0
- package/components/wd-select/index.js +78 -0
- package/components/wd-select/index.json +10 -0
- package/components/wd-select/index.wxml +51 -0
- package/components/wd-select/select.wxss +728 -0
- package/components/wd-select-multiple/index.js +74 -0
- package/components/wd-select-multiple/index.json +10 -0
- package/components/wd-select-multiple/index.wxml +51 -0
- package/components/wd-side-tab/index.js +113 -0
- package/components/wd-side-tab/index.json +7 -0
- package/components/wd-side-tab/index.wxml +6 -0
- package/components/wd-side-tab/index.wxss +1 -0
- package/components/wd-switch/index.js +67 -0
- package/components/wd-switch/index.json +7 -0
- package/components/wd-switch/index.wxml +28 -0
- package/components/wd-switch/index.wxss +2 -0
- package/components/wd-switch/wd-switch.wxss +1212 -0
- package/components/wd-tabbar/index.js +196 -0
- package/components/wd-tabbar/index.json +7 -0
- package/components/wd-tabbar/index.wxml +10 -0
- package/components/wd-tabbar/index.wxss +2 -0
- package/components/wd-tabbar/wd-tabbar.wxss +87 -0
- package/components/wd-tabs/index.js +62 -0
- package/components/wd-tabs/index.json +5 -0
- package/components/wd-tabs/index.wxml +34 -0
- package/components/wd-tabs/index.wxss +8 -0
- package/components/wd-tabs/wd-tabs.wxss +265 -0
- package/components/wd-tag/index.js +171 -0
- package/components/wd-tag/index.json +7 -0
- package/components/wd-tag/index.wxml +22 -0
- package/components/wd-tag/index.wxss +3 -0
- package/components/wd-tag/tag-behavior.js +57 -0
- package/components/wd-tag/tag-item/index.js +198 -0
- package/components/wd-tag/tag-item/index.json +7 -0
- package/components/wd-tag/tag-item/index.wxml +15 -0
- package/components/wd-tag/wd-tag.wxss +319 -0
- package/components/wd-tag-select/index.js +107 -0
- package/components/wd-tag-select/index.json +8 -0
- package/components/wd-tag-select/index.wxml +42 -0
- package/components/wd-tag-select/index.wxss +4 -0
- package/components/wd-tag-select/wd-tag-select.wxss +1253 -0
- package/components/wd-text/index.js +162 -0
- package/components/wd-text/index.json +5 -0
- package/components/wd-text/index.wxml +8 -0
- package/components/wd-text/index.wxss +2 -0
- package/components/wd-text/wd-text.wxss +256 -0
- package/components/wd-textarea/index.js +94 -0
- package/components/wd-textarea/index.json +7 -0
- package/components/wd-textarea/index.wxml +31 -0
- package/components/wd-textarea/index.wxss +7 -0
- package/components/wd-textarea/wd-textarea.wxss +91 -0
- package/components/wd-time/index.js +124 -0
- package/components/wd-time/index.json +11 -0
- package/components/wd-time/index.wxml +36 -0
- package/components/wd-time/index.wxss +9 -0
- package/components/wd-time/wd-time.wxss +0 -0
- package/components/wd-top-tab/index.js +113 -0
- package/components/wd-top-tab/index.json +7 -0
- package/components/wd-top-tab/index.wxml +6 -0
- package/components/wd-top-tab/index.wxss +5 -0
- package/components/wd-unified-link/index.js +115 -0
- package/components/wd-unified-link/index.json +5 -0
- package/components/wd-unified-link/index.wxml +3 -0
- package/components/wd-unified-link/index.wxss +2 -0
- package/components/wd-unified-link/wd-link.wxss +45 -0
- package/components/wd-upload-file/index.js +46 -0
- package/components/wd-upload-file/index.json +8 -0
- package/components/wd-upload-file/index.wxml +39 -0
- package/components/wd-upload-image/index.js +64 -0
- package/components/wd-upload-image/index.json +8 -0
- package/components/wd-upload-image/index.wxml +45 -0
- package/components/web-view/index.js +69 -0
- package/components/web-view/index.json +5 -0
- package/components/web-view/index.wxml +1 -0
- package/components/web-view/index.wxss +1 -0
- package/components/wedaVideo/index.js +179 -0
- package/components/wedaVideo/index.json +4 -0
- package/components/wedaVideo/index.wxml +29 -0
- package/components/wedaVideo/index.wxss +20 -0
- package/components/wxOpenApi/phone/index.js +122 -0
- package/components/wxOpenApi/phone/index.json +4 -0
- package/components/wxOpenApi/phone/index.wxml +4 -0
- package/components/wxOpenApi/phone/index.wxss +22 -0
- package/components/wxOpenApi/phoneCode/index.js +102 -0
- package/components/wxOpenApi/phoneCode/index.json +4 -0
- package/components/wxOpenApi/phoneCode/index.wxml +4 -0
- package/components/wxOpenApi/phoneCode/index.wxss +22 -0
- package/components/wxOpenApi/share/index.js +134 -0
- package/components/wxOpenApi/share/index.json +4 -0
- package/components/wxOpenApi/share/index.wxml +4 -0
- package/components/wxOpenApi/share/index.wxss +22 -0
- package/components/wxOpenApi/userInfo/index.js +97 -0
- package/components/wxOpenApi/userInfo/index.json +4 -0
- package/components/wxOpenApi/userInfo/index.wxml +4 -0
- package/components/wxOpenApi/userInfo/index.wxss +22 -0
- package/index.json +128 -0
- package/package.json +16 -0
- package/style/utils.wxss +162 -0
- package/style/wd-design.wxss +606 -0
- package/style/weda-ui.wxss +1412 -0
- package/style/wedatea2td.wxss +56 -0
- package/utils/classnames.js +39 -0
- package/utils/color.js +76 -0
- package/utils/common-behavior.js +1 -0
- package/utils/constant.js +132 -0
- package/utils/date.js +47 -0
- package/utils/dayjs.min.js +1 -0
- package/utils/debounce.js +134 -0
- package/utils/deepEqual.js +42 -0
- package/utils/destr.js +49 -0
- package/utils/dr_square_point.js +29 -0
- package/utils/enum.js +1247 -0
- package/utils/error.js +12 -0
- package/utils/getCustomInfo.js +34 -0
- package/utils/getFormLegacy.js +401 -0
- package/utils/getModelParams.js +43 -0
- package/utils/getWedaApi.js +1 -0
- package/utils/handleEvents.js +34 -0
- package/utils/lodash.js +65 -0
- package/utils/platform.js +158 -0
- package/utils/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js +1323 -0
- package/utils/qrcode/weapp.qrcode.min.js +911 -0
- package/utils/range.js +82 -0
- package/utils/tcb.js +162 -0
- package/utils/tool.js +74 -0
- package/utils/widget-api.js +28 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
@import '../../style/weda-ui.wxss';
|
|
2
|
+
|
|
3
|
+
/* components/calendar.wxss */
|
|
4
|
+
.weda-calendar {
|
|
5
|
+
background: rgb(255, 255, 255);
|
|
6
|
+
width: 100%;
|
|
7
|
+
opacity: 0.9;
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.weda-calendar .weda-calendar__control {
|
|
12
|
+
width: 100%;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
padding: 16px 16px 0;
|
|
15
|
+
position: relative;
|
|
16
|
+
/* text-align: center; */
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.weda-calendar .weda-calendar__current-date {
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
font-size: inherit;
|
|
22
|
+
line-height: 1.57142em;
|
|
23
|
+
align-items: center;
|
|
24
|
+
width: 100%;
|
|
25
|
+
text-align: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.weda-calendar .weda-calendar__current-date__no {
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
font-size: inherit;
|
|
31
|
+
line-height: 1.57142em;
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
visibility: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.weda-calendar .weda-calendar__current-date-icon {
|
|
38
|
+
width: 16px;
|
|
39
|
+
height: 16px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.weda-calendar .weda-calendar__prevMonth,
|
|
43
|
+
.weda-calendar .weda-calendar__prevMonth__timepicker,
|
|
44
|
+
.weda-calendar .weda-calendar__nextMonth {
|
|
45
|
+
position: absolute;
|
|
46
|
+
width: 1.54285em;
|
|
47
|
+
vertical-align: middle;
|
|
48
|
+
top: 17px;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.weda-calendar .weda-calendar__prevMonth .weda-calendar__prevMonth-icon,
|
|
55
|
+
.weda-calendar
|
|
56
|
+
.weda-calendar__prevMonth__timepicker
|
|
57
|
+
.weda-calendar__prevMonth-icon,
|
|
58
|
+
.weda-calendar .weda-calendar__nextMonth .weda-calendar__nextMonth-icon {
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.weda-calendar .weda-calendar__prevMonth {
|
|
64
|
+
transform: rotate(180deg);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.weda-calendar .weda-calendar__prevMonth__timepicker {
|
|
68
|
+
transform: rotate(180deg);
|
|
69
|
+
right: 38px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.weda-calendar .weda-calendar__nextMonth {
|
|
73
|
+
right: 16px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.weda-calendar .weda-calendar__panel {
|
|
77
|
+
height: 21.85714em;
|
|
78
|
+
padding: 20px 16px 16px 16px;
|
|
79
|
+
width: 100%;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.weda-calendar .weda-calendar__table {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
justify-self: start;
|
|
89
|
+
align-items: flex-start;
|
|
90
|
+
font-size: inherit;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.weda-calendar .weda-calendar__table-head {
|
|
94
|
+
display: block;
|
|
95
|
+
width: 100%;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.weda-calendar .weda-calendar__table-head-row {
|
|
100
|
+
width: 100%;
|
|
101
|
+
padding-bottom: 0;
|
|
102
|
+
display: flex;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.weda-calendar .weda-calendar__table-head-cell {
|
|
106
|
+
flex: 1 1 0%;
|
|
107
|
+
display: flex;
|
|
108
|
+
color: rgba(0, 0, 0, 0.6);
|
|
109
|
+
position: relative;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
font-size: 1em;
|
|
114
|
+
line-height: 1.42857em;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.weda-calendar .weda-calendar__table-body {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
justify-self: center;
|
|
122
|
+
align-items: center;
|
|
123
|
+
flex: 1 1 0%;
|
|
124
|
+
width: 100%;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.weda-calendar .weda-calendar__table-body-row {
|
|
128
|
+
width: 100%;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex: 1 1 0%;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.weda-calendar .weda-calendar__table-body-cell {
|
|
134
|
+
flex: 1 1 0%;
|
|
135
|
+
position: relative;
|
|
136
|
+
width: 100%;
|
|
137
|
+
height: 100%;
|
|
138
|
+
font-size: 1em;
|
|
139
|
+
line-height: 1.42857em;
|
|
140
|
+
box-sizing: border-box;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
flex-direction: row;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.weda-calendar .weda-calendar__table-body-cell-value {
|
|
148
|
+
font-size: 1em;
|
|
149
|
+
text-align: center;
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
width: 40px;
|
|
152
|
+
line-height: 2.85714em;
|
|
153
|
+
box-sizing: border-box;
|
|
154
|
+
color: rgba(0, 0, 0, 0.9);
|
|
155
|
+
position: relative;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.weda-calendar .weda-calendar__table-body-cell.is-disabled {
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.weda-calendar
|
|
163
|
+
.weda-calendar__table-body-cell.is-invalid
|
|
164
|
+
.weda-calendar__table-body-cell-value {
|
|
165
|
+
color: rgba(0, 0, 0, 0.6);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.weda-calendar
|
|
169
|
+
.weda-calendar__table-body-cell.is-disabled
|
|
170
|
+
.weda-calendar__table-body-cell-value {
|
|
171
|
+
color: #c5c5c5;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.weda-calendar
|
|
175
|
+
.weda-calendar__table-body-cell.is-checked
|
|
176
|
+
.weda-calendar__table-body-cell-value {
|
|
177
|
+
color: #fff;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* theme */
|
|
181
|
+
.weda-calendar
|
|
182
|
+
.weda-calendar__table-body-cell.is-checked
|
|
183
|
+
.weda-calendar__table-body-cell-bg {
|
|
184
|
+
position: absolute;
|
|
185
|
+
width: 1.714285em;
|
|
186
|
+
height: 1.714285em;
|
|
187
|
+
background-color: var(--wd-color-brand, #0052d9);
|
|
188
|
+
border-radius: 100%;
|
|
189
|
+
left: calc(50% - 0.85714em);
|
|
190
|
+
top: calc(50% - 0.85714em);
|
|
191
|
+
z-index: -1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.weda-calendar .weda-calendar__table-body-cell-marked {
|
|
195
|
+
position: absolute;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
left: 50%;
|
|
198
|
+
transform: translate(-50%);
|
|
199
|
+
bottom: -10px;
|
|
200
|
+
width: 4px;
|
|
201
|
+
height: 4px;
|
|
202
|
+
top: calc(50% + 14px);
|
|
203
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getStartMoment,
|
|
3
|
+
convertValueToDateItem,
|
|
4
|
+
getYMD,
|
|
5
|
+
convertYearMonthToWeeks,
|
|
6
|
+
} from '../../utils/getFormLegacy';
|
|
7
|
+
|
|
8
|
+
export const WEEKS = ['日', '一', '二', '三', '四', '五', '六'];
|
|
9
|
+
export const BLOCK_NAME = 'weda-calendar';
|
|
10
|
+
|
|
11
|
+
// 配置数组转配置对象
|
|
12
|
+
export const getConfigDataObj = (configData) => {
|
|
13
|
+
if (!Array.isArray(configData)) return;
|
|
14
|
+
const obj = {};
|
|
15
|
+
configData.forEach((item) => {
|
|
16
|
+
if (Object.prototype.toString.call(item) === '[object Object]') {
|
|
17
|
+
const disabled = [true, 'true'].includes(item.disabled) ? true : false;
|
|
18
|
+
const value = getStartMoment('day', item.matchDate, false);
|
|
19
|
+
const dateItem = value ? convertValueToDateItem(value) : {};
|
|
20
|
+
const YMD = getYMD(dateItem);
|
|
21
|
+
obj[YMD] = { ...item, disabled };
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return obj;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// 带上外部配置,转星期
|
|
28
|
+
export const convertWeeks = (year, month, configDataObj) => {
|
|
29
|
+
const weeks = convertYearMonthToWeeks(year, month, null, {
|
|
30
|
+
isPreNext: true,
|
|
31
|
+
isDynamic: true,
|
|
32
|
+
});
|
|
33
|
+
if (!configDataObj || Object.keys(configDataObj).length === 0) return weeks;
|
|
34
|
+
return weeks.map((row) => {
|
|
35
|
+
return row.map((item) => {
|
|
36
|
+
const YMD = getYMD(item);
|
|
37
|
+
const config = configDataObj[YMD];
|
|
38
|
+
return { ...item, ...config };
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import classNames from '../../utils/classnames';
|
|
2
|
+
import { commonCompBehavior } from '../../utils/common-behavior';
|
|
3
|
+
import { WD_PREFIX } from '../../utils/constant';
|
|
4
|
+
import handleEvents from '../../utils/handleEvents';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 兼容小程序旧版的2D画布函数
|
|
8
|
+
* @param ctx
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
const generateCtx2D = (ctx) => {
|
|
12
|
+
if (!ctx) return;
|
|
13
|
+
|
|
14
|
+
const setLineDash = ctx.setLineDash.bind(ctx);
|
|
15
|
+
|
|
16
|
+
ctx.setFillStyle = function (val) {
|
|
17
|
+
ctx.fillStyle = val;
|
|
18
|
+
};
|
|
19
|
+
ctx.setFontSize = function (val) {
|
|
20
|
+
ctx.font = `${val}px`;
|
|
21
|
+
};
|
|
22
|
+
ctx.setGlobalAlpha = function (val) {
|
|
23
|
+
ctx.globalAlpha = val;
|
|
24
|
+
};
|
|
25
|
+
ctx.setLineCap = function (val) {
|
|
26
|
+
ctx.lineCap = val;
|
|
27
|
+
};
|
|
28
|
+
ctx.setLineDash = function (pattern, offset) {
|
|
29
|
+
setLineDash(pattern);
|
|
30
|
+
ctx.lineDashOffset = offset;
|
|
31
|
+
};
|
|
32
|
+
ctx.setLineJoin = function (val) {
|
|
33
|
+
ctx.lineJoin = val;
|
|
34
|
+
};
|
|
35
|
+
ctx.setLineWidth = function (val) {
|
|
36
|
+
ctx.lineWidth = val;
|
|
37
|
+
};
|
|
38
|
+
ctx.setMiterLimit = function (val) {
|
|
39
|
+
ctx.miterLimit = val;
|
|
40
|
+
};
|
|
41
|
+
ctx.setShadow = function (offsetX, offsetY, blur, color) {
|
|
42
|
+
ctx.shadowOffsetX = offsetX;
|
|
43
|
+
ctx.shadowOffsetY = offsetY;
|
|
44
|
+
ctx.shadowBlur = blur;
|
|
45
|
+
ctx.shadowColor = color;
|
|
46
|
+
};
|
|
47
|
+
ctx.setStrokeStyle = function (val) {
|
|
48
|
+
ctx.strokeStyle = val;
|
|
49
|
+
};
|
|
50
|
+
ctx.setTextAlign = function (val) {
|
|
51
|
+
ctx.textAlign = val;
|
|
52
|
+
};
|
|
53
|
+
ctx.setTextBaseline = function (val) {
|
|
54
|
+
ctx.textBaseline = val;
|
|
55
|
+
};
|
|
56
|
+
ctx.draw = () => {};
|
|
57
|
+
|
|
58
|
+
return ctx;
|
|
59
|
+
};
|
|
60
|
+
const generateCtxWebgl = (ctx) => {
|
|
61
|
+
return ctx;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const READY_TIME = 500;
|
|
65
|
+
// canvas默认宽高
|
|
66
|
+
const CANVAS_DEFAULT = {
|
|
67
|
+
width: 300,
|
|
68
|
+
height: 150,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
Component({
|
|
72
|
+
options: {
|
|
73
|
+
virtualHost: true,
|
|
74
|
+
multipleSlots: true,
|
|
75
|
+
},
|
|
76
|
+
behaviors: [commonCompBehavior],
|
|
77
|
+
properties: {
|
|
78
|
+
className: {
|
|
79
|
+
type: String,
|
|
80
|
+
value: '',
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
type: String,
|
|
84
|
+
value: '',
|
|
85
|
+
},
|
|
86
|
+
id: {
|
|
87
|
+
type: String,
|
|
88
|
+
value: '',
|
|
89
|
+
},
|
|
90
|
+
type: {
|
|
91
|
+
type: String,
|
|
92
|
+
value: '2d',
|
|
93
|
+
},
|
|
94
|
+
disableScroll: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
value: false,
|
|
97
|
+
},
|
|
98
|
+
code: {
|
|
99
|
+
type: Object,
|
|
100
|
+
value: () => ({}),
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
domObserver: null,
|
|
104
|
+
readyTimer: null,
|
|
105
|
+
data: {
|
|
106
|
+
cls: '',
|
|
107
|
+
styleMain: '',
|
|
108
|
+
canvasInstance: null,
|
|
109
|
+
canvasCtx: null,
|
|
110
|
+
isCanvasReady: false,
|
|
111
|
+
canvasId: null,
|
|
112
|
+
canvasStyle: CANVAS_DEFAULT,
|
|
113
|
+
},
|
|
114
|
+
lifetimes: {
|
|
115
|
+
attached() {
|
|
116
|
+
this.setData({ canvasId: this.id });
|
|
117
|
+
this.observeModuleExpose();
|
|
118
|
+
this.updateWidgetAPI();
|
|
119
|
+
},
|
|
120
|
+
detached() {
|
|
121
|
+
this.domObserver && this.domObserver.disconnect();
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
updateWidgetAPI() {
|
|
126
|
+
this.setReadonlyAttributes &&
|
|
127
|
+
this.setReadonlyAttributes({
|
|
128
|
+
code: this.properties.code,
|
|
129
|
+
type: this.properties.type,
|
|
130
|
+
disableScroll: this.properties.disableScroll,
|
|
131
|
+
canvasInstance: this.data.canvasInstance,
|
|
132
|
+
canvasCtx: this.data.canvasCtx,
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* 根据初始化代码绘制canvas
|
|
137
|
+
*/
|
|
138
|
+
async canvasInit(init, canvasCtx, canvasInstance, canvasStyle) {
|
|
139
|
+
try {
|
|
140
|
+
// 执行初始化函数前恢复默认宽高,清空画布
|
|
141
|
+
canvasInstance.width = canvasStyle.width;
|
|
142
|
+
canvasInstance.height = canvasStyle.height;
|
|
143
|
+
await init?.(canvasCtx, canvasInstance);
|
|
144
|
+
this.triggerEvent('canvasReady', { canvasInstance, canvasCtx });
|
|
145
|
+
} catch (error) {
|
|
146
|
+
//
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
// 监听模块曝光
|
|
150
|
+
observeModuleExpose() {
|
|
151
|
+
this.domObserver && this.domObserver.disconnect();
|
|
152
|
+
this.domObserver = wx.createIntersectionObserver(this);
|
|
153
|
+
this.domObserver.relativeToViewport().observe(`#${this.id}`, (res) => {
|
|
154
|
+
// 模块曝光
|
|
155
|
+
if (res.intersectionRatio) {
|
|
156
|
+
this.setData({ isCanvasReady: true });
|
|
157
|
+
this.init();
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
getCanvasRectInfo() {
|
|
162
|
+
return new Promise((resolve) => {
|
|
163
|
+
const query = wx.createSelectorQuery().in(this);
|
|
164
|
+
query.select(`#${this.id}`).boundingClientRect();
|
|
165
|
+
query.selectViewport().scrollOffset();
|
|
166
|
+
query.exec(function (res) {
|
|
167
|
+
resolve({ ...res?.[1], ...res?.[0] });
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
init(id = this.id, type = this.properties.type) {
|
|
172
|
+
wx.createSelectorQuery()
|
|
173
|
+
.in(this)
|
|
174
|
+
.select(`#${id || this.id}`)
|
|
175
|
+
.fields({ node: true, size: true })
|
|
176
|
+
.exec(async (res) => {
|
|
177
|
+
if (!res?.[0]?.node) return;
|
|
178
|
+
const canvas = res[0].node;
|
|
179
|
+
|
|
180
|
+
const { pixelRatio: dpr } = await wx.getSystemInfo();
|
|
181
|
+
canvas.width = res[0].width * dpr;
|
|
182
|
+
canvas.height = res[0].height * dpr;
|
|
183
|
+
canvas.dpr = dpr;
|
|
184
|
+
canvas.getCanvasRectInfo = this.getCanvasRectInfo.bind(this);
|
|
185
|
+
|
|
186
|
+
this.setData({
|
|
187
|
+
canvasStyle: { width: canvas.width, height: canvas.height },
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const ctx = canvas.getContext(type);
|
|
191
|
+
const ctxRes =
|
|
192
|
+
{ '2d': generateCtx2D, webgl: generateCtxWebgl }[type]?.(ctx) || {};
|
|
193
|
+
const data = { canvasInstance: canvas, canvasCtx: ctxRes };
|
|
194
|
+
|
|
195
|
+
this.domObserver && this.domObserver.disconnect();
|
|
196
|
+
this.setData(data);
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
...handleEvents([
|
|
200
|
+
{ title: '手指触摸开始', name: 'touchstart' },
|
|
201
|
+
{ title: '手指触摸移动', name: 'touchmove' },
|
|
202
|
+
{ title: '手指触摸结束', name: 'touchend' },
|
|
203
|
+
{ title: '手指触摸被打断', name: 'touchcancel' },
|
|
204
|
+
{ title: '手指/鼠标长按', name: 'longtap' },
|
|
205
|
+
{ title: '错误', name: 'error' },
|
|
206
|
+
]),
|
|
207
|
+
},
|
|
208
|
+
observers: {
|
|
209
|
+
'style,className': function (style, className) {
|
|
210
|
+
// 响应式css api
|
|
211
|
+
const cls = classNames({
|
|
212
|
+
[`${WD_PREFIX}-canvas`]: true,
|
|
213
|
+
[`${WD_PREFIX}-mp-canvas`]: true,
|
|
214
|
+
[className]: className,
|
|
215
|
+
});
|
|
216
|
+
const styleMain = style;
|
|
217
|
+
|
|
218
|
+
this.setData({ cls, styleMain });
|
|
219
|
+
},
|
|
220
|
+
'type,disableScroll,canvasInstance,canvasCtx': function () {
|
|
221
|
+
this.updateWidgetAPI();
|
|
222
|
+
},
|
|
223
|
+
'id,type': function (id, type) {
|
|
224
|
+
if (!this.data.isCanvasReady) return;
|
|
225
|
+
|
|
226
|
+
this.setData({ canvasId: id });
|
|
227
|
+
this.init(id, type);
|
|
228
|
+
},
|
|
229
|
+
'code,canvasStyle,canvasInstance,canvasCtx': function (
|
|
230
|
+
code,
|
|
231
|
+
canvasStyle,
|
|
232
|
+
canvasInstance,
|
|
233
|
+
canvasCtx
|
|
234
|
+
) {
|
|
235
|
+
this.readyTimer && clearTimeout(this.readyTimer);
|
|
236
|
+
if (!canvasCtx || !canvasInstance) return;
|
|
237
|
+
|
|
238
|
+
// 如果初始化代码不是函数,则直接执行canvasReady
|
|
239
|
+
if (typeof code?.init !== 'function') {
|
|
240
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
241
|
+
this.readyTimer = setTimeout(() => {
|
|
242
|
+
this.triggerEvent('canvasReady', { canvasInstance, canvasCtx });
|
|
243
|
+
}, READY_TIME);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
this.canvasInit(code?.init, canvasCtx, canvasInstance, canvasStyle);
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<canvas wx:if="{{type === '2d'}}" id="{{canvasId}}" canvas-id="{{canvasId}}" style="{{styleMain}}" class="{{cls}}" type="{{type}}" disable-scroll="{{disableScroll}}" bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchend" bindtouchcancel="touchcancel" bindlongtap="longtap" binderror="error"></canvas>
|
|
2
|
+
<canvas wx:else id="{{canvasId}}" canvas-id="{{canvasId}}" style="{{styleMain}}" class="{{cls}}" type="{{type}}" disable-scroll="{{disableScroll}}" bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchEnd" bindtouchcancel="touchcancel" bindlongtap="longtap" binderror="error"></canvas>
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import handleEvents from '../../utils/handleEvents';
|
|
2
|
+
import { commonCompBehavior } from '../../utils/common-behavior';
|
|
3
|
+
import { WD_PREFIX } from '../../utils/constant';
|
|
4
|
+
|
|
5
|
+
Component({
|
|
6
|
+
options: {
|
|
7
|
+
virtualHost: true,
|
|
8
|
+
multipleSlots: true,
|
|
9
|
+
},
|
|
10
|
+
behaviors: [commonCompBehavior],
|
|
11
|
+
properties: {
|
|
12
|
+
className: {
|
|
13
|
+
type: String,
|
|
14
|
+
value: '',
|
|
15
|
+
},
|
|
16
|
+
style: {
|
|
17
|
+
type: String,
|
|
18
|
+
value: '',
|
|
19
|
+
},
|
|
20
|
+
id: {
|
|
21
|
+
type: String,
|
|
22
|
+
value: '',
|
|
23
|
+
},
|
|
24
|
+
showHeader: { type: Boolean, value: true },
|
|
25
|
+
showContent: { type: Boolean, value: true },
|
|
26
|
+
showFooter: { type: Boolean, value: false },
|
|
27
|
+
showDivider: { type: Boolean, value: true },
|
|
28
|
+
},
|
|
29
|
+
data: { classPrefix: WD_PREFIX, contentState: 'show' },
|
|
30
|
+
lifetimes: {
|
|
31
|
+
attached() {
|
|
32
|
+
const { showContent } = this.properties;
|
|
33
|
+
this.setData({
|
|
34
|
+
contentState: showContent ? 'show' : 'hide',
|
|
35
|
+
});
|
|
36
|
+
this.updateWidgetAPI();
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
updateWidgetAPI() {
|
|
41
|
+
this.setReadonlyAttributes &&
|
|
42
|
+
this.setReadonlyAttributes({
|
|
43
|
+
showHeader: this.properties.showHeader,
|
|
44
|
+
showContent: this.properties.showContent,
|
|
45
|
+
showFooter: this.properties.showFooter,
|
|
46
|
+
showDivider: this.properties.showDivider,
|
|
47
|
+
contentState: this.data.contentState,
|
|
48
|
+
dealContentState: this.dealContentState.bind(this),
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
...handleEvents([{ title: '点击', name: 'tap' }]),
|
|
52
|
+
/**
|
|
53
|
+
* 控制内容面板显示与隐藏,只针对于折叠模式下有效
|
|
54
|
+
*/
|
|
55
|
+
dealContentState({ state } = {}) {
|
|
56
|
+
const { contentState } = this.data;
|
|
57
|
+
const stateInner = state || (contentState === 'show' ? 'hide' : 'show');
|
|
58
|
+
if (stateInner === contentState) return;
|
|
59
|
+
|
|
60
|
+
this.setData({ contentState: stateInner });
|
|
61
|
+
this.updateWidgetAPI();
|
|
62
|
+
|
|
63
|
+
if (stateInner === 'show') {
|
|
64
|
+
this.triggerEvent('contentShow');
|
|
65
|
+
} else {
|
|
66
|
+
this.triggerEvent('contentHide');
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
observers: {
|
|
71
|
+
showContent: function (showContent) {
|
|
72
|
+
this.setData({ contentState: showContent ? 'show' : 'hide' });
|
|
73
|
+
this.updateWidgetAPI();
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<view id="{{id}}" style="{{style}}" class="{{classPrefix + '-card'}} {{classPrefix + '-mp-card-root'}} {{classPrefix + '-card-root'}} {{showDivider ? 'wd-card--bordered' : ''}} {{contentState !== 'show' ? 'wd-card--collapse-active' : ''}} {{className}}">
|
|
2
|
+
<view class="{{classPrefix + '-card__header'}}" wx:if="{{showHeader}}">
|
|
3
|
+
<slot name="headerSlot"></slot>
|
|
4
|
+
</view>
|
|
5
|
+
<view class="{{classPrefix + '-card__body'}}" wx:if="{{contentState === 'show'}}">
|
|
6
|
+
<slot name="contentSlot"></slot>
|
|
7
|
+
</view>
|
|
8
|
+
<view class="{{classPrefix + '-card__footer'}}" wx:if="{{showFooter}}">
|
|
9
|
+
<slot name="footerSlot"></slot>
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|