maxit-cli 0.1.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/LICENSE +49 -0
- package/README.md +56 -0
- package/bin/maxit.js +75 -0
- package/lib/commands.js +142 -0
- package/lib/project.js +58 -0
- package/lib/registry.js +50 -0
- package/package.json +30 -0
- package/registry/components/action-sheet/action-sheet.js +1 -0
- package/registry/components/action-sheet/action-sheet.json +1 -0
- package/registry/components/action-sheet/action-sheet.wxml +1 -0
- package/registry/components/action-sheet/action-sheet.wxs +34 -0
- package/registry/components/action-sheet/action-sheet.wxss +197 -0
- package/registry/components/action-sheet/index.js +1 -0
- package/registry/components/action-sheet/props.js +1 -0
- package/registry/components/action-sheet/show.js +1 -0
- package/registry/components/action-sheet/template/grid.wxml +1 -0
- package/registry/components/avatar/avatar.js +1 -0
- package/registry/components/avatar/avatar.json +1 -0
- package/registry/components/avatar/avatar.wxml +1 -0
- package/registry/components/avatar/avatar.wxs +30 -0
- package/registry/components/avatar/avatar.wxss +105 -0
- package/registry/components/avatar/index.js +1 -0
- package/registry/components/avatar/props.js +1 -0
- package/registry/components/avatar-group/avatar-group.js +1 -0
- package/registry/components/avatar-group/avatar-group.json +1 -0
- package/registry/components/avatar-group/avatar-group.wxml +1 -0
- package/registry/components/avatar-group/avatar-group.wxss +248 -0
- package/registry/components/avatar-group/index.js +1 -0
- package/registry/components/avatar-group/props.js +1 -0
- package/registry/components/back-top/back-top.js +1 -0
- package/registry/components/back-top/back-top.json +1 -0
- package/registry/components/back-top/back-top.wxml +1 -0
- package/registry/components/back-top/back-top.wxss +77 -0
- package/registry/components/back-top/index.js +1 -0
- package/registry/components/back-top/props.js +1 -0
- package/registry/components/badge/badge.js +1 -0
- package/registry/components/badge/badge.json +1 -0
- package/registry/components/badge/badge.wxml +1 -0
- package/registry/components/badge/badge.wxs +64 -0
- package/registry/components/badge/badge.wxss +168 -0
- package/registry/components/badge/index.js +1 -0
- package/registry/components/badge/props.js +1 -0
- package/registry/components/balance-card/balance-card.js +34 -0
- package/registry/components/balance-card/balance-card.json +1 -0
- package/registry/components/balance-card/balance-card.wxml +33 -0
- package/registry/components/balance-card/balance-card.wxss +111 -0
- package/registry/components/balance-card/index.js +2 -0
- package/registry/components/balance-card/props.js +14 -0
- package/registry/components/balance-thumb-card/balance-thumb-card.js +39 -0
- package/registry/components/balance-thumb-card/balance-thumb-card.json +1 -0
- package/registry/components/balance-thumb-card/balance-thumb-card.wxml +26 -0
- package/registry/components/balance-thumb-card/balance-thumb-card.wxss +31 -0
- package/registry/components/balance-thumb-card/index.js +2 -0
- package/registry/components/balance-thumb-card/props.js +17 -0
- package/registry/components/bill-card/bill-card.js +23 -0
- package/registry/components/bill-card/bill-card.json +1 -0
- package/registry/components/bill-card/bill-card.wxml +30 -0
- package/registry/components/bill-card/bill-card.wxss +33 -0
- package/registry/components/bill-card/index.js +2 -0
- package/registry/components/bill-card/props.js +18 -0
- package/registry/components/button/button.js +1 -0
- package/registry/components/button/button.json +1 -0
- package/registry/components/button/button.wxml +1 -0
- package/registry/components/button/button.wxss +775 -0
- package/registry/components/button/index.js +1 -0
- package/registry/components/button/props.js +1 -0
- package/registry/components/calendar/calendar-header.wxml +1 -0
- package/registry/components/calendar/calendar.js +1 -0
- package/registry/components/calendar/calendar.json +1 -0
- package/registry/components/calendar/calendar.wxml +1 -0
- package/registry/components/calendar/calendar.wxs +44 -0
- package/registry/components/calendar/calendar.wxss +246 -0
- package/registry/components/calendar/index.js +1 -0
- package/registry/components/calendar/props.js +1 -0
- package/registry/components/calendar/template.wxml +1 -0
- package/registry/components/calendar/utils.js +1 -0
- package/registry/components/card/card.js +24 -0
- package/registry/components/card/card.json +1 -0
- package/registry/components/card/card.wxml +23 -0
- package/registry/components/card/card.wxss +103 -0
- package/registry/components/card/index.js +2 -0
- package/registry/components/card/props.js +16 -0
- package/registry/components/card-list/card-list.js +22 -0
- package/registry/components/card-list/card-list.json +1 -0
- package/registry/components/card-list/card-list.wxml +7 -0
- package/registry/components/card-list/card-list.wxss +30 -0
- package/registry/components/card-list/index.js +2 -0
- package/registry/components/card-list/props.js +16 -0
- package/registry/components/cascader/cascader.js +1 -0
- package/registry/components/cascader/cascader.json +1 -0
- package/registry/components/cascader/cascader.wxml +1 -0
- package/registry/components/cascader/cascader.wxss +178 -0
- package/registry/components/cascader/index.js +1 -0
- package/registry/components/cascader/props.js +1 -0
- package/registry/components/category-filter/category-filter.js +50 -0
- package/registry/components/category-filter/category-filter.json +1 -0
- package/registry/components/category-filter/category-filter.wxml +16 -0
- package/registry/components/category-filter/category-filter.wxss +47 -0
- package/registry/components/category-filter/index.js +2 -0
- package/registry/components/category-filter/props.js +10 -0
- package/registry/components/cell/cell.js +1 -0
- package/registry/components/cell/cell.json +1 -0
- package/registry/components/cell/cell.wxml +1 -0
- package/registry/components/cell/cell.wxss +136 -0
- package/registry/components/cell/index.js +1 -0
- package/registry/components/cell/props.js +1 -0
- package/registry/components/check-tag/check-tag.js +1 -0
- package/registry/components/check-tag/check-tag.json +1 -0
- package/registry/components/check-tag/check-tag.wxml +1 -0
- package/registry/components/check-tag/check-tag.wxss +275 -0
- package/registry/components/check-tag/index.js +1 -0
- package/registry/components/check-tag/props.js +1 -0
- package/registry/components/checkbox/checkbox.js +1 -0
- package/registry/components/checkbox/checkbox.json +1 -0
- package/registry/components/checkbox/checkbox.wxml +1 -0
- package/registry/components/checkbox/checkbox.wxss +230 -0
- package/registry/components/checkbox/index.js +1 -0
- package/registry/components/checkbox/props.js +1 -0
- package/registry/components/checkbox-group/checkbox-group.js +1 -0
- package/registry/components/checkbox-group/checkbox-group.json +1 -0
- package/registry/components/checkbox-group/checkbox-group.wxml +1 -0
- package/registry/components/checkbox-group/checkbox-group.wxss +7 -0
- package/registry/components/checkbox-group/index.js +1 -0
- package/registry/components/checkbox-group/props.js +1 -0
- package/registry/components/collapse/collapse.js +1 -0
- package/registry/components/collapse/collapse.json +1 -0
- package/registry/components/collapse/collapse.wxml +1 -0
- package/registry/components/collapse/collapse.wxss +8 -0
- package/registry/components/collapse/index.js +1 -0
- package/registry/components/collapse/props.js +1 -0
- package/registry/components/collapse-panel/collapse-panel.js +1 -0
- package/registry/components/collapse-panel/collapse-panel.json +1 -0
- package/registry/components/collapse-panel/collapse-panel.wxml +1 -0
- package/registry/components/collapse-panel/collapse-panel.wxss +186 -0
- package/registry/components/collapse-panel/index.js +1 -0
- package/registry/components/collapse-panel/props.js +1 -0
- package/registry/components/color-picker/color-picker.js +1 -0
- package/registry/components/color-picker/color-picker.json +1 -0
- package/registry/components/color-picker/color-picker.wxml +1 -0
- package/registry/components/color-picker/color-picker.wxss +312 -0
- package/registry/components/color-picker/constants.js +1 -0
- package/registry/components/color-picker/index.js +1 -0
- package/registry/components/color-picker/interfaces.js +1 -0
- package/registry/components/color-picker/props.js +1 -0
- package/registry/components/color-picker/template.wxml +1 -0
- package/registry/components/color-picker/utils.js +1 -0
- package/registry/components/common/bus.js +1 -0
- package/registry/components/common/config.js +1 -0
- package/registry/components/common/libs/tinycolor.js +1 -0
- package/registry/components/common/locale.js +20 -0
- package/registry/components/common/mixins/page-scroll.js +1 -0
- package/registry/components/common/mixins/touch.js +1 -0
- package/registry/components/common/mixins/transition.js +1 -0
- package/registry/components/common/mixins/using-config.js +24 -0
- package/registry/components/common/mixins/using-custom-navbar.js +1 -0
- package/registry/components/common/shared/calendar/index.js +1 -0
- package/registry/components/common/shared/color-picker/cmyk.js +1 -0
- package/registry/components/common/shared/color-picker/color.js +1 -0
- package/registry/components/common/shared/color-picker/gradient.js +1 -0
- package/registry/components/common/shared/color-picker/index.js +1 -0
- package/registry/components/common/shared/date.js +1 -0
- package/registry/components/common/shared/qrcode/qrcodegen.js +1 -0
- package/registry/components/common/shared/qrcode/utils.js +1 -0
- package/registry/components/common/src/control.js +1 -0
- package/registry/components/common/src/flatTool.js +1 -0
- package/registry/components/common/src/index.js +1 -0
- package/registry/components/common/src/instantiationDecorator.js +1 -0
- package/registry/components/common/src/superComponent.js +1 -0
- package/registry/components/common/style/card.wxss +245 -0
- package/registry/components/common/style/index.wxss +3 -0
- package/registry/components/common/style/tokens.wxss +233 -0
- package/registry/components/common/template/badge.wxml +1 -0
- package/registry/components/common/template/button.wxml +1 -0
- package/registry/components/common/template/icon.wxml +1 -0
- package/registry/components/common/template/image.wxml +1 -0
- package/registry/components/common/tslib.js +2 -0
- package/registry/components/common/typography/ellipsis.wxml +1 -0
- package/registry/components/common/typography/typography.wxs +49 -0
- package/registry/components/common/utils.js +1 -0
- package/registry/components/common/utils.wxs +149 -0
- package/registry/components/common/validator.js +1 -0
- package/registry/components/common/wechat.js +1 -0
- package/registry/components/consumption-card/consumption-card.js +23 -0
- package/registry/components/consumption-card/consumption-card.json +1 -0
- package/registry/components/consumption-card/consumption-card.wxml +16 -0
- package/registry/components/consumption-card/consumption-card.wxss +36 -0
- package/registry/components/consumption-card/index.js +2 -0
- package/registry/components/consumption-card/props.js +14 -0
- package/registry/components/contact-list/contact-list.js +60 -0
- package/registry/components/contact-list/contact-list.json +1 -0
- package/registry/components/contact-list/contact-list.wxml +24 -0
- package/registry/components/contact-list/contact-list.wxss +73 -0
- package/registry/components/contact-list/index.js +2 -0
- package/registry/components/contact-list/props.js +13 -0
- package/registry/components/description-tile/description-tile.js +22 -0
- package/registry/components/description-tile/description-tile.json +1 -0
- package/registry/components/description-tile/description-tile.wxml +11 -0
- package/registry/components/description-tile/description-tile.wxss +21 -0
- package/registry/components/description-tile/index.js +2 -0
- package/registry/components/description-tile/props.js +10 -0
- package/registry/components/details-card/details-card.js +38 -0
- package/registry/components/details-card/details-card.json +1 -0
- package/registry/components/details-card/details-card.wxml +37 -0
- package/registry/components/details-card/details-card.wxss +119 -0
- package/registry/components/details-card/index.js +2 -0
- package/registry/components/details-card/props.js +22 -0
- package/registry/components/dialog/dialog.js +1 -0
- package/registry/components/dialog/dialog.json +1 -0
- package/registry/components/dialog/dialog.wxml +1 -0
- package/registry/components/dialog/dialog.wxs +13 -0
- package/registry/components/dialog/dialog.wxss +123 -0
- package/registry/components/dialog/index.js +1 -0
- package/registry/components/dialog/props.js +1 -0
- package/registry/components/divider/divider.js +1 -0
- package/registry/components/divider/divider.json +1 -0
- package/registry/components/divider/divider.wxml +1 -0
- package/registry/components/divider/divider.wxss +69 -0
- package/registry/components/divider/index.js +1 -0
- package/registry/components/divider/props.js +1 -0
- package/registry/components/drawer/drawer.js +1 -0
- package/registry/components/drawer/drawer.json +1 -0
- package/registry/components/drawer/drawer.wxml +1 -0
- package/registry/components/drawer/drawer.wxss +75 -0
- package/registry/components/drawer/index.js +1 -0
- package/registry/components/drawer/props.js +1 -0
- package/registry/components/dropdown-item/dropdown-item.js +1 -0
- package/registry/components/dropdown-item/dropdown-item.json +1 -0
- package/registry/components/dropdown-item/dropdown-item.wxml +1 -0
- package/registry/components/dropdown-item/dropdown-item.wxss +116 -0
- package/registry/components/dropdown-item/index.js +1 -0
- package/registry/components/dropdown-item/index.wxs +9 -0
- package/registry/components/dropdown-item/props.js +1 -0
- package/registry/components/dropdown-menu/dropdown-menu.js +1 -0
- package/registry/components/dropdown-menu/dropdown-menu.json +1 -0
- package/registry/components/dropdown-menu/dropdown-menu.wxml +1 -0
- package/registry/components/dropdown-menu/dropdown-menu.wxss +72 -0
- package/registry/components/dropdown-menu/index.js +1 -0
- package/registry/components/dropdown-menu/props.js +1 -0
- package/registry/components/empty/empty.js +1 -0
- package/registry/components/empty/empty.json +1 -0
- package/registry/components/empty/empty.wxml +1 -0
- package/registry/components/empty/empty.wxss +28 -0
- package/registry/components/empty/index.js +1 -0
- package/registry/components/empty/props.js +1 -0
- package/registry/components/entry-card/entry-card.js +23 -0
- package/registry/components/entry-card/entry-card.json +1 -0
- package/registry/components/entry-card/entry-card.wxml +14 -0
- package/registry/components/entry-card/entry-card.wxss +30 -0
- package/registry/components/entry-card/index.js +2 -0
- package/registry/components/entry-card/props.js +11 -0
- package/registry/components/file-drop/file-drop.js +23 -0
- package/registry/components/file-drop/file-drop.json +1 -0
- package/registry/components/file-drop/file-drop.wxml +13 -0
- package/registry/components/file-drop/file-drop.wxss +35 -0
- package/registry/components/file-drop/index.js +2 -0
- package/registry/components/file-drop/props.js +9 -0
- package/registry/components/grid/grid.js +1 -0
- package/registry/components/grid/grid.json +1 -0
- package/registry/components/grid/grid.wxml +1 -0
- package/registry/components/grid/grid.wxss +18 -0
- package/registry/components/grid/index.js +1 -0
- package/registry/components/grid/props.js +1 -0
- package/registry/components/grid-item/grid-item.js +1 -0
- package/registry/components/grid-item/grid-item.json +1 -0
- package/registry/components/grid-item/grid-item.wxml +1 -0
- package/registry/components/grid-item/grid-item.wxss +130 -0
- package/registry/components/grid-item/index.js +1 -0
- package/registry/components/grid-item/props.js +1 -0
- package/registry/components/guide/content.wxml +1 -0
- package/registry/components/guide/guide.js +1 -0
- package/registry/components/guide/guide.json +1 -0
- package/registry/components/guide/guide.wxml +1 -0
- package/registry/components/guide/guide.wxss +79 -0
- package/registry/components/guide/index.js +1 -0
- package/registry/components/guide/props.js +1 -0
- package/registry/components/icon/icon.js +1 -0
- package/registry/components/icon/icon.json +1 -0
- package/registry/components/icon/icon.wxml +1 -0
- package/registry/components/icon/icon.wxss +2361 -0
- package/registry/components/icon/index.js +1 -0
- package/registry/components/icon/props.js +1 -0
- package/registry/components/image/image.js +1 -0
- package/registry/components/image/image.json +1 -0
- package/registry/components/image/image.wxml +1 -0
- package/registry/components/image/image.wxss +55 -0
- package/registry/components/image/index.js +1 -0
- package/registry/components/image/props.js +1 -0
- package/registry/components/image-viewer/image-viewer.js +1 -0
- package/registry/components/image-viewer/image-viewer.json +1 -0
- package/registry/components/image-viewer/image-viewer.wxml +1 -0
- package/registry/components/image-viewer/image-viewer.wxs +7 -0
- package/registry/components/image-viewer/image-viewer.wxss +90 -0
- package/registry/components/image-viewer/index.js +1 -0
- package/registry/components/image-viewer/props.js +1 -0
- package/registry/components/info-card/index.js +2 -0
- package/registry/components/info-card/info-card.js +22 -0
- package/registry/components/info-card/info-card.json +1 -0
- package/registry/components/info-card/info-card.wxml +14 -0
- package/registry/components/info-card/info-card.wxss +56 -0
- package/registry/components/info-card/props.js +11 -0
- package/registry/components/input/index.js +1 -0
- package/registry/components/input/input.js +1 -0
- package/registry/components/input/input.json +1 -0
- package/registry/components/input/input.wxml +1 -0
- package/registry/components/input/input.wxs +16 -0
- package/registry/components/input/input.wxss +313 -0
- package/registry/components/input/props.js +1 -0
- package/registry/components/insight-card/index.js +2 -0
- package/registry/components/insight-card/insight-card.js +19 -0
- package/registry/components/insight-card/insight-card.json +1 -0
- package/registry/components/insight-card/insight-card.wxml +17 -0
- package/registry/components/insight-card/insight-card.wxss +35 -0
- package/registry/components/insight-card/props.js +12 -0
- package/registry/components/link/index.js +1 -0
- package/registry/components/link/link.js +1 -0
- package/registry/components/link/link.json +1 -0
- package/registry/components/link/link.wxml +1 -0
- package/registry/components/link/link.wxss +155 -0
- package/registry/components/link/props.js +1 -0
- package/registry/components/list-item/index.js +2 -0
- package/registry/components/list-item/list-item.js +39 -0
- package/registry/components/list-item/list-item.json +1 -0
- package/registry/components/list-item/list-item.wxml +22 -0
- package/registry/components/list-item/list-item.wxss +110 -0
- package/registry/components/list-item/props.js +22 -0
- package/registry/components/loading/index.js +1 -0
- package/registry/components/loading/loading.js +1 -0
- package/registry/components/loading/loading.json +1 -0
- package/registry/components/loading/loading.wxml +1 -0
- package/registry/components/loading/loading.wxss +281 -0
- package/registry/components/loading/props.js +1 -0
- package/registry/components/main-card/index.js +2 -0
- package/registry/components/main-card/main-card.js +23 -0
- package/registry/components/main-card/main-card.json +1 -0
- package/registry/components/main-card/main-card.wxml +37 -0
- package/registry/components/main-card/main-card.wxss +63 -0
- package/registry/components/main-card/props.js +24 -0
- package/registry/components/media-card/index.js +2 -0
- package/registry/components/media-card/media-card.js +23 -0
- package/registry/components/media-card/media-card.json +1 -0
- package/registry/components/media-card/media-card.wxml +11 -0
- package/registry/components/media-card/media-card.wxss +51 -0
- package/registry/components/media-card/props.js +8 -0
- package/registry/components/message/index.js +1 -0
- package/registry/components/message/message.interface.js +1 -0
- package/registry/components/message/message.js +1 -0
- package/registry/components/message/message.json +1 -0
- package/registry/components/message/message.wxml +1 -0
- package/registry/components/message/message.wxss +2 -0
- package/registry/components/message/props.js +1 -0
- package/registry/components/message-item/index.js +1 -0
- package/registry/components/message-item/message-item.js +1 -0
- package/registry/components/message-item/message-item.json +1 -0
- package/registry/components/message-item/message-item.wxml +1 -0
- package/registry/components/message-item/message-item.wxs +31 -0
- package/registry/components/message-item/message-item.wxss +141 -0
- package/registry/components/navbar/index.js +1 -0
- package/registry/components/navbar/navbar.js +1 -0
- package/registry/components/navbar/navbar.json +1 -0
- package/registry/components/navbar/navbar.wxml +1 -0
- package/registry/components/navbar/navbar.wxss +126 -0
- package/registry/components/navbar/props.js +1 -0
- package/registry/components/notice-bar/index.js +1 -0
- package/registry/components/notice-bar/notice-bar.js +1 -0
- package/registry/components/notice-bar/notice-bar.json +1 -0
- package/registry/components/notice-bar/notice-bar.wxml +1 -0
- package/registry/components/notice-bar/notice-bar.wxss +95 -0
- package/registry/components/notice-bar/props.js +1 -0
- package/registry/components/notification-item/index.js +2 -0
- package/registry/components/notification-item/notification-item.js +35 -0
- package/registry/components/notification-item/notification-item.json +1 -0
- package/registry/components/notification-item/notification-item.wxml +14 -0
- package/registry/components/notification-item/notification-item.wxss +47 -0
- package/registry/components/notification-item/props.js +10 -0
- package/registry/components/offer-card/index.js +2 -0
- package/registry/components/offer-card/offer-card.js +22 -0
- package/registry/components/offer-card/offer-card.json +1 -0
- package/registry/components/offer-card/offer-card.wxml +33 -0
- package/registry/components/offer-card/offer-card.wxss +37 -0
- package/registry/components/offer-card/props.js +21 -0
- package/registry/components/om-card/index.js +2 -0
- package/registry/components/om-card/om-card.js +40 -0
- package/registry/components/om-card/om-card.json +1 -0
- package/registry/components/om-card/om-card.wxml +35 -0
- package/registry/components/om-card/om-card.wxss +90 -0
- package/registry/components/om-card/props.js +14 -0
- package/registry/components/overlay/index.js +1 -0
- package/registry/components/overlay/overlay.js +1 -0
- package/registry/components/overlay/overlay.json +1 -0
- package/registry/components/overlay/overlay.wxml +1 -0
- package/registry/components/overlay/overlay.wxss +22 -0
- package/registry/components/overlay/props.js +1 -0
- package/registry/components/paragraph/index.js +1 -0
- package/registry/components/paragraph/paragraph.js +1 -0
- package/registry/components/paragraph/paragraph.json +1 -0
- package/registry/components/paragraph/paragraph.wxml +1 -0
- package/registry/components/paragraph/paragraph.wxss +151 -0
- package/registry/components/paragraph/props.js +1 -0
- package/registry/components/picker/index.js +1 -0
- package/registry/components/picker/picker.js +1 -0
- package/registry/components/picker/picker.json +1 -0
- package/registry/components/picker/picker.wxml +1 -0
- package/registry/components/picker/picker.wxs +9 -0
- package/registry/components/picker/picker.wxss +84 -0
- package/registry/components/picker/props.js +1 -0
- package/registry/components/picker/template.wxml +1 -0
- package/registry/components/picker-item/index.js +1 -0
- package/registry/components/picker-item/picker-item.js +1 -0
- package/registry/components/picker-item/picker-item.json +1 -0
- package/registry/components/picker-item/picker-item.wxml +1 -0
- package/registry/components/picker-item/picker-item.wxss +41 -0
- package/registry/components/picker-item/props.js +1 -0
- package/registry/components/popover/index.js +1 -0
- package/registry/components/popover/popover.js +1 -0
- package/registry/components/popover/popover.json +1 -0
- package/registry/components/popover/popover.wxml +1 -0
- package/registry/components/popover/popover.wxss +336 -0
- package/registry/components/popover/props.js +1 -0
- package/registry/components/popup/index.js +1 -0
- package/registry/components/popup/popup.js +1 -0
- package/registry/components/popup/popup.json +1 -0
- package/registry/components/popup/popup.wxml +1 -0
- package/registry/components/popup/popup.wxs +21 -0
- package/registry/components/popup/popup.wxss +96 -0
- package/registry/components/popup/props.js +1 -0
- package/registry/components/post-item/index.js +2 -0
- package/registry/components/post-item/post-item.js +22 -0
- package/registry/components/post-item/post-item.json +1 -0
- package/registry/components/post-item/post-item.wxml +5 -0
- package/registry/components/post-item/post-item.wxss +37 -0
- package/registry/components/post-item/props.js +7 -0
- package/registry/components/progress/index.js +1 -0
- package/registry/components/progress/progress.js +1 -0
- package/registry/components/progress/progress.json +1 -0
- package/registry/components/progress/progress.wxml +1 -0
- package/registry/components/progress/progress.wxs +80 -0
- package/registry/components/progress/progress.wxss +161 -0
- package/registry/components/progress/props.js +1 -0
- package/registry/components/progress/utils.js +1 -0
- package/registry/components/purchase-card/index.js +2 -0
- package/registry/components/purchase-card/props.js +13 -0
- package/registry/components/purchase-card/purchase-card.js +40 -0
- package/registry/components/purchase-card/purchase-card.json +1 -0
- package/registry/components/purchase-card/purchase-card.wxml +22 -0
- package/registry/components/purchase-card/purchase-card.wxss +19 -0
- package/registry/components/qrcode/components/qrcode-canvas/props.js +1 -0
- package/registry/components/qrcode/components/qrcode-canvas/qrcode-canvas.js +1 -0
- package/registry/components/qrcode/components/qrcode-canvas/qrcode-canvas.json +1 -0
- package/registry/components/qrcode/components/qrcode-canvas/qrcode-canvas.wxml +1 -0
- package/registry/components/qrcode/components/qrcode-canvas/qrcode-canvas.wxss +10 -0
- package/registry/components/qrcode/components/qrcode-status/props.js +1 -0
- package/registry/components/qrcode/components/qrcode-status/qrcode-status.js +1 -0
- package/registry/components/qrcode/components/qrcode-status/qrcode-status.json +1 -0
- package/registry/components/qrcode/components/qrcode-status/qrcode-status.wxml +1 -0
- package/registry/components/qrcode/components/qrcode-status/qrcode-status.wxss +32 -0
- package/registry/components/qrcode/hooks/useQRCode.js +1 -0
- package/registry/components/qrcode/index.js +1 -0
- package/registry/components/qrcode/props.js +1 -0
- package/registry/components/qrcode/qrcode.js +1 -0
- package/registry/components/qrcode/qrcode.json +1 -0
- package/registry/components/qrcode/qrcode.wxml +1 -0
- package/registry/components/qrcode/qrcode.wxss +36 -0
- package/registry/components/quick-action/index.js +2 -0
- package/registry/components/quick-action/props.js +10 -0
- package/registry/components/quick-action/quick-action.js +22 -0
- package/registry/components/quick-action/quick-action.json +1 -0
- package/registry/components/quick-action/quick-action.wxml +15 -0
- package/registry/components/quick-action/quick-action.wxss +80 -0
- package/registry/components/radio/index.js +1 -0
- package/registry/components/radio/props.js +1 -0
- package/registry/components/radio/radio.js +1 -0
- package/registry/components/radio/radio.json +1 -0
- package/registry/components/radio/radio.wxml +1 -0
- package/registry/components/radio/radio.wxss +219 -0
- package/registry/components/radio-group/index.js +1 -0
- package/registry/components/radio-group/props.js +1 -0
- package/registry/components/radio-group/radio-group.js +1 -0
- package/registry/components/radio-group/radio-group.json +1 -0
- package/registry/components/radio-group/radio-group.wxml +1 -0
- package/registry/components/radio-group/radio-group.wxss +7 -0
- package/registry/components/rate/index.js +1 -0
- package/registry/components/rate/props.js +1 -0
- package/registry/components/rate/rate.js +1 -0
- package/registry/components/rate/rate.json +1 -0
- package/registry/components/rate/rate.wxml +1 -0
- package/registry/components/rate/rate.wxs +65 -0
- package/registry/components/rate/rate.wxss +99 -0
- package/registry/components/rating-card/index.js +2 -0
- package/registry/components/rating-card/props.js +12 -0
- package/registry/components/rating-card/rating-card.js +42 -0
- package/registry/components/rating-card/rating-card.json +1 -0
- package/registry/components/rating-card/rating-card.wxml +24 -0
- package/registry/components/rating-card/rating-card.wxss +49 -0
- package/registry/components/recap-card/index.js +2 -0
- package/registry/components/recap-card/props.js +21 -0
- package/registry/components/recap-card/recap-card.js +38 -0
- package/registry/components/recap-card/recap-card.json +1 -0
- package/registry/components/recap-card/recap-card.wxml +43 -0
- package/registry/components/recap-card/recap-card.wxss +60 -0
- package/registry/components/result/illustrations.js +2 -0
- package/registry/components/result/index.js +1 -0
- package/registry/components/result/props.js +1 -0
- package/registry/components/result/result.js +1 -0
- package/registry/components/result/result.json +1 -0
- package/registry/components/result/result.wxml +1 -0
- package/registry/components/result/result.wxss +97 -0
- package/registry/components/review-item/index.js +2 -0
- package/registry/components/review-item/props.js +13 -0
- package/registry/components/review-item/review-item.js +38 -0
- package/registry/components/review-item/review-item.json +1 -0
- package/registry/components/review-item/review-item.wxml +19 -0
- package/registry/components/review-item/review-item.wxss +65 -0
- package/registry/components/search/index.js +1 -0
- package/registry/components/search/props.js +1 -0
- package/registry/components/search/search.js +1 -0
- package/registry/components/search/search.json +1 -0
- package/registry/components/search/search.wxml +1 -0
- package/registry/components/search/search.wxs +6 -0
- package/registry/components/search/search.wxss +100 -0
- package/registry/components/section-title/index.js +2 -0
- package/registry/components/section-title/props.js +6 -0
- package/registry/components/section-title/section-title.js +22 -0
- package/registry/components/section-title/section-title.json +1 -0
- package/registry/components/section-title/section-title.wxml +6 -0
- package/registry/components/section-title/section-title.wxss +19 -0
- package/registry/components/segmented/index.js +1 -0
- package/registry/components/segmented/props.js +1 -0
- package/registry/components/segmented/segmented.js +1 -0
- package/registry/components/segmented/segmented.json +1 -0
- package/registry/components/segmented/segmented.wxml +1 -0
- package/registry/components/segmented/segmented.wxss +113 -0
- package/registry/components/selection-card/index.js +2 -0
- package/registry/components/selection-card/props.js +11 -0
- package/registry/components/selection-card/selection-card.js +25 -0
- package/registry/components/selection-card/selection-card.json +1 -0
- package/registry/components/selection-card/selection-card.wxml +7 -0
- package/registry/components/selection-card/selection-card.wxss +27 -0
- package/registry/components/shortcut-chip/index.js +2 -0
- package/registry/components/shortcut-chip/props.js +7 -0
- package/registry/components/shortcut-chip/shortcut-chip.js +24 -0
- package/registry/components/shortcut-chip/shortcut-chip.json +1 -0
- package/registry/components/shortcut-chip/shortcut-chip.wxml +4 -0
- package/registry/components/shortcut-chip/shortcut-chip.wxss +29 -0
- package/registry/components/skeleton/index.js +1 -0
- package/registry/components/skeleton/props.js +1 -0
- package/registry/components/skeleton/skeleton.js +1 -0
- package/registry/components/skeleton/skeleton.json +1 -0
- package/registry/components/skeleton/skeleton.wxml +1 -0
- package/registry/components/skeleton/skeleton.wxss +92 -0
- package/registry/components/slider/index.js +1 -0
- package/registry/components/slider/props.js +1 -0
- package/registry/components/slider/slider.js +1 -0
- package/registry/components/slider/slider.json +1 -0
- package/registry/components/slider/slider.wxml +1 -0
- package/registry/components/slider/slider.wxs +10 -0
- package/registry/components/slider/slider.wxss +287 -0
- package/registry/components/slider/tool.js +1 -0
- package/registry/components/step-item/index.js +1 -0
- package/registry/components/step-item/props.js +1 -0
- package/registry/components/step-item/step-item.js +1 -0
- package/registry/components/step-item/step-item.json +1 -0
- package/registry/components/step-item/step-item.wxml +1 -0
- package/registry/components/step-item/step-item.wxs +7 -0
- package/registry/components/step-item/step-item.wxss +226 -0
- package/registry/components/stepper/index.js +1 -0
- package/registry/components/stepper/props.js +1 -0
- package/registry/components/stepper/stepper.js +1 -0
- package/registry/components/stepper/stepper.json +1 -0
- package/registry/components/stepper/stepper.wxml +1 -0
- package/registry/components/stepper/stepper.wxss +130 -0
- package/registry/components/steps/index.js +1 -0
- package/registry/components/steps/props.js +1 -0
- package/registry/components/steps/steps.js +1 -0
- package/registry/components/steps/steps.json +1 -0
- package/registry/components/steps/steps.wxml +1 -0
- package/registry/components/steps/steps.wxss +27 -0
- package/registry/components/sticky/index.js +1 -0
- package/registry/components/sticky/props.js +1 -0
- package/registry/components/sticky/sticky.js +1 -0
- package/registry/components/sticky/sticky.json +1 -0
- package/registry/components/sticky/sticky.wxml +1 -0
- package/registry/components/sticky/sticky.wxss +6 -0
- package/registry/components/story-item/index.js +2 -0
- package/registry/components/story-item/props.js +8 -0
- package/registry/components/story-item/story-item.js +22 -0
- package/registry/components/story-item/story-item.json +1 -0
- package/registry/components/story-item/story-item.wxml +9 -0
- package/registry/components/story-item/story-item.wxss +43 -0
- package/registry/components/swipe-cell/index.js +1 -0
- package/registry/components/swipe-cell/props.js +1 -0
- package/registry/components/swipe-cell/swipe-cell.js +1 -0
- package/registry/components/swipe-cell/swipe-cell.json +1 -0
- package/registry/components/swipe-cell/swipe-cell.wxml +1 -0
- package/registry/components/swipe-cell/swipe-cell.wxs +185 -0
- package/registry/components/swipe-cell/swipe-cell.wxss +40 -0
- package/registry/components/swiper/index.js +1 -0
- package/registry/components/swiper/index.wxs +25 -0
- package/registry/components/swiper/props.js +1 -0
- package/registry/components/swiper/swiper.js +1 -0
- package/registry/components/swiper/swiper.json +1 -0
- package/registry/components/swiper/swiper.wxml +1 -0
- package/registry/components/swiper/swiper.wxss +28 -0
- package/registry/components/swiper-nav/index.js +1 -0
- package/registry/components/swiper-nav/props.js +1 -0
- package/registry/components/swiper-nav/swiper-nav.js +1 -0
- package/registry/components/swiper-nav/swiper-nav.json +1 -0
- package/registry/components/swiper-nav/swiper-nav.wxml +1 -0
- package/registry/components/swiper-nav/swiper-nav.wxss +155 -0
- package/registry/components/switch/index.js +1 -0
- package/registry/components/switch/props.js +1 -0
- package/registry/components/switch/switch.js +1 -0
- package/registry/components/switch/switch.json +1 -0
- package/registry/components/switch/switch.wxml +1 -0
- package/registry/components/switch/switch.wxss +169 -0
- package/registry/components/tab-bar/index.js +1 -0
- package/registry/components/tab-bar/props.js +1 -0
- package/registry/components/tab-bar/tab-bar.js +1 -0
- package/registry/components/tab-bar/tab-bar.json +1 -0
- package/registry/components/tab-bar/tab-bar.wxml +1 -0
- package/registry/components/tab-bar/tab-bar.wxss +50 -0
- package/registry/components/tab-bar-item/index.js +1 -0
- package/registry/components/tab-bar-item/props.js +1 -0
- package/registry/components/tab-bar-item/tab-bar-item.js +1 -0
- package/registry/components/tab-bar-item/tab-bar-item.json +1 -0
- package/registry/components/tab-bar-item/tab-bar-item.wxml +1 -0
- package/registry/components/tab-bar-item/tab-bar-item.wxss +177 -0
- package/registry/components/tab-panel/index.js +1 -0
- package/registry/components/tab-panel/props.js +1 -0
- package/registry/components/tab-panel/tab-panel.js +1 -0
- package/registry/components/tab-panel/tab-panel.json +1 -0
- package/registry/components/tab-panel/tab-panel.wxml +1 -0
- package/registry/components/tab-panel/tab-panel.wxss +20 -0
- package/registry/components/tabs/index.js +1 -0
- package/registry/components/tabs/props.js +1 -0
- package/registry/components/tabs/tabs.js +1 -0
- package/registry/components/tabs/tabs.json +1 -0
- package/registry/components/tabs/tabs.wxml +1 -0
- package/registry/components/tabs/tabs.wxs +30 -0
- package/registry/components/tabs/tabs.wxss +233 -0
- package/registry/components/tag/index.js +1 -0
- package/registry/components/tag/props.js +1 -0
- package/registry/components/tag/tag.js +1 -0
- package/registry/components/tag/tag.json +1 -0
- package/registry/components/tag/tag.wxml +1 -0
- package/registry/components/tag/tag.wxss +268 -0
- package/registry/components/text/index.js +1 -0
- package/registry/components/text/props.js +1 -0
- package/registry/components/text/text.js +1 -0
- package/registry/components/text/text.json +1 -0
- package/registry/components/text/text.wxml +1 -0
- package/registry/components/text/text.wxss +151 -0
- package/registry/components/textarea/index.js +1 -0
- package/registry/components/textarea/props.js +1 -0
- package/registry/components/textarea/textarea.js +1 -0
- package/registry/components/textarea/textarea.json +1 -0
- package/registry/components/textarea/textarea.wxml +1 -0
- package/registry/components/textarea/textarea.wxs +15 -0
- package/registry/components/textarea/textarea.wxss +151 -0
- package/registry/components/ticket/index.js +2 -0
- package/registry/components/ticket/props.js +19 -0
- package/registry/components/ticket/ticket.js +19 -0
- package/registry/components/ticket/ticket.json +1 -0
- package/registry/components/ticket/ticket.wxml +31 -0
- package/registry/components/ticket/ticket.wxss +57 -0
- package/registry/components/title/index.js +1 -0
- package/registry/components/title/props.js +1 -0
- package/registry/components/title/title.js +1 -0
- package/registry/components/title/title.json +1 -0
- package/registry/components/title/title.wxml +1 -0
- package/registry/components/title/title.wxss +151 -0
- package/registry/components/toast/index.js +1 -0
- package/registry/components/toast/props.js +1 -0
- package/registry/components/toast/toast.js +1 -0
- package/registry/components/toast/toast.json +1 -0
- package/registry/components/toast/toast.wxml +1 -0
- package/registry/components/toast/toast.wxss +87 -0
- package/registry/components/toggle-card/index.js +2 -0
- package/registry/components/toggle-card/props.js +7 -0
- package/registry/components/toggle-card/toggle-card.js +37 -0
- package/registry/components/toggle-card/toggle-card.json +1 -0
- package/registry/components/toggle-card/toggle-card.wxml +12 -0
- package/registry/components/toggle-card/toggle-card.wxss +11 -0
- package/registry/components/top-item/index.js +2 -0
- package/registry/components/top-item/props.js +10 -0
- package/registry/components/top-item/top-item.js +22 -0
- package/registry/components/top-item/top-item.json +1 -0
- package/registry/components/top-item/top-item.wxml +8 -0
- package/registry/components/top-item/top-item.wxss +37 -0
- package/registry/components/transaction-card/index.js +2 -0
- package/registry/components/transaction-card/props.js +25 -0
- package/registry/components/transaction-card/transaction-card.js +43 -0
- package/registry/components/transaction-card/transaction-card.json +1 -0
- package/registry/components/transaction-card/transaction-card.wxml +44 -0
- package/registry/components/transaction-card/transaction-card.wxss +45 -0
- package/registry/components/transfer-item/index.js +2 -0
- package/registry/components/transfer-item/props.js +18 -0
- package/registry/components/transfer-item/transfer-item.js +40 -0
- package/registry/components/transfer-item/transfer-item.json +1 -0
- package/registry/components/transfer-item/transfer-item.wxml +34 -0
- package/registry/components/transfer-item/transfer-item.wxss +66 -0
- package/registry/components/upload/drag.wxs +242 -0
- package/registry/components/upload/index.js +1 -0
- package/registry/components/upload/props.js +1 -0
- package/registry/components/upload/upload.js +1 -0
- package/registry/components/upload/upload.json +1 -0
- package/registry/components/upload/upload.wxml +1 -0
- package/registry/components/upload/upload.wxs +129 -0
- package/registry/components/upload/upload.wxss +354 -0
- package/registry/components/wheel-select/index.js +2 -0
- package/registry/components/wheel-select/props.js +8 -0
- package/registry/components/wheel-select/wheel-select.js +38 -0
- package/registry/components/wheel-select/wheel-select.json +1 -0
- package/registry/components/wheel-select/wheel-select.wxml +9 -0
- package/registry/components/wheel-select/wheel-select.wxss +22 -0
- package/registry/registry.json +1033 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__decorate}from"../common/tslib";import config from"../common/config";import{SuperComponent,wxComponent}from"../common/src/index";import Props from"./props";const{prefix:prefix}=config,name=`${prefix}-radio`;let Radio=class 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(e){e.data.borderless&&this.setData({borderless:!0})}}},this.options={multipleSlots:!0},this.lifetimes={attached(){this.init()}},this.properties=Object.assign(Object.assign({},Props),{borderless:{type:Boolean,value:!1},oId:{type:String}}),this.controlledProps=[{key:"checked",event:"change"}],this.data={prefix:prefix,classPrefix:name,customIcon:!1,slotIcon:!1,direction:"vertical",optionLinked:!1,iconVal:[],_placement:"",_disabled:!1,_readonly:!1},this.observers={disabled(e){this.setData({_disabled:e})},readonly(e){this.setData({_readonly:e})}},this.methods={handleTap(e){const{_disabled:t,_readonly:a,contentDisabled:o}=this.data,{target:i}=e.currentTarget.dataset;t||a||"text"===i&&o||this.doChange()},doChange(){var e;const{value:t,checked:a,allowUncheck:o}=this.data,i=Boolean(o||(null===(e=this.$parent)||void 0===e?void 0:e.data.allowUncheck));this.$parent?this.$parent.updateValue(a&&i?null:t):this._trigger("change",{checked:!i||!a})},init(){var e,t,a,o;const{icon:i}=this.data,s=Array.isArray((null===(e=this.$parent)||void 0===e?void 0:e.icon)||i);this.setData({customIcon:s,slotIcon:"slot"===i,iconVal:s?(null===(t=this.$parent)||void 0===t?void 0:t.icon)||i:[],_placement:this.data.placement||(null===(o=null===(a=this.$parent)||void 0===a?void 0:a.data)||void 0===o?void 0:o.placement)||"left"})},setDisabled(e){this.setData({_disabled:this.data.disabled||e})},setReadonly(e){this.setData({_readonly:this.data.readonly||e})}}}};Radio=__decorate([wxComponent()],Radio);export default Radio;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-icon":"../icon/icon"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="../common/utils.wxs" module="_"/><view id="{{oId}}" style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [_placement, direction, ['block', block], ['disabled', _disabled]])}} class {{prefix}}-class" disabled="{{_disabled}}" aria-role="radio" aria-checked="{{checked}}" aria-label="{{label + content}}" aria-disabled="{{_disabled}}" tabindex="{{tabindex}}" mut-bind:tap="handleTap"><view class="{{_.cls(classPrefix + '__icon', [_placement, ['checked', checked], ['disabled', _disabled]])}} {{prefix}}-class-icon"><slot name="icon" wx:if="{{slotIcon}}"/><view wx:elif="{{customIcon}}" class="{{classPrefix}}__image"><image src="{{checked ? iconVal[0] : iconVal[1]}}" class="{{classPrefix}}-icon__image" webp/></view><block wx:else><o-icon wx:if="{{checked && (icon == 'circle' || icon == 'line')}}" name="{{icon == 'circle' ? 'check-circle-filled' : 'check'}}" class="{{classPrefix}}__icon-wrap"/><view wx:if="{{checked && icon == 'dot'}}" class="{{_.cls(classPrefix + '__icon-' + icon, [['disabled', _disabled]])}}"/><view wx:if="{{!checked && (icon == 'circle' || icon == 'dot')}}" class="{{_.cls(classPrefix + '__icon-circle', [['disabled', _disabled]])}}"/><view wx:if="{{!checked && icon == 'line'}}" class="placeholder"></view></block></view><view class="{{classPrefix}}__content" data-target="text" mut-bind:tap="handleTap"><view class="{{_.cls(classPrefix + '__title', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-label" style="-webkit-line-clamp:{{maxLabelRow}}"><block wx:if="{{label}}">{{label}}</block><slot/><slot name="label"/></view><view class="{{_.cls(classPrefix + '__description', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-content" style="-webkit-line-clamp:{{maxContentRow}}"><block wx:if="{{content}}">{{content}}</block><slot name="content"/></view></view><view wx:if="{{!borderless}}" class="{{_.cls(classPrefix + '__border', [_placement])}} {{prefix}}-class-border"/></view>
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
@import '../common/style/index.wxss';
|
|
2
|
+
|
|
3
|
+
.limit-title-row {
|
|
4
|
+
display: -webkit-box;
|
|
5
|
+
-webkit-box-orient: vertical;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.o-radio {
|
|
10
|
+
position: relative;
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
background: var(--o-radio-bg-color,var(--o-bg-color-container,var(--o-font-white-1,#fff)));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.o-radio:focus {
|
|
17
|
+
outline: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.o-radio--block {
|
|
21
|
+
display: flex;
|
|
22
|
+
padding: var(--o-radio-vertical-padding,var(--o-spacer-2,32rpx));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.o-radio--horizontal {
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin-right: var(--o-spacer-2,32rpx);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.o-radio--right {
|
|
31
|
+
flex-direction: row-reverse;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.o-radio__icon {
|
|
35
|
+
position: relative;
|
|
36
|
+
margin-top: calc((var(--o-radio-label-line-height,var(--o-line-height-title-medium,48rpx)) - var(--o-radio-icon-size,48rpx))/ 2);
|
|
37
|
+
width: var(--o-radio-icon-size,48rpx);
|
|
38
|
+
height: var(--o-radio-icon-size,48rpx);
|
|
39
|
+
font-size: var(--o-radio-icon-size,48rpx);
|
|
40
|
+
color: var(--o-radio-icon-color,var(--o-component-border,var(--o-gray-color-4,#dddddd)));
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.o-radio__icon:empty {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.o-radio__icon--left {
|
|
49
|
+
margin-right: var(--o-spacer,16rpx);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.o-radio__icon--checked {
|
|
53
|
+
color: var(--o-radio-icon-checked-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.o-radio__icon--disabled {
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
color: var(--o-radio-icon-disabled-color,var(--o-brand-color-disabled,var(--o-primary-color-3,#f9c599)));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.o-radio__icon-circle {
|
|
62
|
+
width: var(--o-radio-icon-size,48rpx);
|
|
63
|
+
height: var(--o-radio-icon-size,48rpx);
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.o-radio__icon-circle::after {
|
|
68
|
+
content: '';
|
|
69
|
+
width: calc(200% - 6rpx);
|
|
70
|
+
height: calc(200% - 6rpx);
|
|
71
|
+
border-radius: var(--o-radius-circle,50%);
|
|
72
|
+
border: 3px solid var(--o-radio-icon-color,var(--o-component-border,var(--o-gray-color-4,#dddddd)));
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 50%;
|
|
75
|
+
left: 50%;
|
|
76
|
+
transform: translate(-50%,-50%) scale(.5);
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.o-radio__icon-circle--disabled::after {
|
|
81
|
+
background: var(--o-radio-icon-disabled-bg-color,var(--o-bg-color-component-disabled,var(--o-gray-color-2,#eee)));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.o-radio__icon-line::after,
|
|
85
|
+
.o-radio__icon-line::before {
|
|
86
|
+
content: '';
|
|
87
|
+
display: block;
|
|
88
|
+
position: absolute;
|
|
89
|
+
width: 5rpx;
|
|
90
|
+
border-radius: 2rpx;
|
|
91
|
+
background: var(--o-radio-icon-checked-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
92
|
+
transform-origin: top center;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.o-radio__icon-line::before {
|
|
96
|
+
height: 16rpx;
|
|
97
|
+
left: 8rpx;
|
|
98
|
+
top: 22rpx;
|
|
99
|
+
transform: rotate(-45deg);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.o-radio__icon-line::after {
|
|
103
|
+
height: 26rpx;
|
|
104
|
+
right: 8rpx;
|
|
105
|
+
top: 14rpx;
|
|
106
|
+
transform: rotate(45deg);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.o-radio__icon-line--disabled::after,
|
|
110
|
+
.o-radio__icon-line--disabled::before {
|
|
111
|
+
background: var(--o-radio-icon-disabled-color,var(--o-brand-color-disabled,var(--o-primary-color-3,#f9c599)));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.o-radio__icon-dot {
|
|
115
|
+
width: calc((var(--o-radio-icon-size,48rpx) - 6rpx) * 2);
|
|
116
|
+
height: calc((var(--o-radio-icon-size,48rpx) - 6rpx) * 2);
|
|
117
|
+
border: 6rpx solid var(--o-radio-icon-checked-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
118
|
+
border-radius: var(--o-radius-circle,50%);
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 50%;
|
|
121
|
+
left: 50%;
|
|
122
|
+
transform: translate(-50%,-50%) scale(.5);
|
|
123
|
+
box-sizing: border-box;
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.o-radio__icon-dot::after {
|
|
130
|
+
content: '';
|
|
131
|
+
display: block;
|
|
132
|
+
width: var(--o-radio-icon-size,48rpx);
|
|
133
|
+
height: var(--o-radio-icon-size,48rpx);
|
|
134
|
+
background: var(--o-radio-icon-checked-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
135
|
+
border-radius: var(--o-radius-circle,50%);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.o-radio__icon-dot--disabled {
|
|
139
|
+
border-color: var(--o-radio-icon-disabled-color,var(--o-brand-color-disabled,var(--o-primary-color-3,#f9c599)));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.o-radio__icon-dot--disabled::after {
|
|
143
|
+
background: var(--o-radio-icon-disabled-color,var(--o-brand-color-disabled,var(--o-primary-color-3,#f9c599)));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.o-radio__image {
|
|
147
|
+
line-height: var(--o-radio-icon-size,48rpx);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.o-radio-icon__image {
|
|
151
|
+
height: var(--o-radio-icon-size,48rpx);
|
|
152
|
+
width: var(--o-radio-icon-size,48rpx);
|
|
153
|
+
vertical-align: sub;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.o-radio__content {
|
|
157
|
+
flex: 1;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.o-radio__content:empty {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.o-radio__title {
|
|
165
|
+
display: -webkit-box;
|
|
166
|
+
-webkit-box-orient: vertical;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
color: var(--o-radio-label-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
169
|
+
font: var(--o-radio-font,var(--o-font-body-large,32rpx / 48rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial)));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.o-radio__title--checked {
|
|
173
|
+
color: var(--o-radio-label-checked-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.o-radio__title--disabled {
|
|
177
|
+
cursor: not-allowed;
|
|
178
|
+
color: var(--o-radio-label-disabled-color,var(--o-text-color-disabled,var(--o-font-gray-4,rgba(0,0,0,.26))));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.o-radio__description {
|
|
182
|
+
display: -webkit-box;
|
|
183
|
+
-webkit-box-orient: vertical;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
color: var(--o-radio-content-color,var(--o-text-color-secondary,var(--o-font-gray-2,#444748)));
|
|
186
|
+
font: var(--o-radio-content-font,var(--o-font-body-medium,28rpx / 44rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial)));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.o-radio__description--checked {
|
|
190
|
+
color: var(--o-radio-content-checked-color,var(--o-text-color-secondary,var(--o-font-gray-2,#444748)));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.o-radio__description--disabled {
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
color: var(--o-radio-content-disabled-color,var(--o-text-color-disabled,var(--o-font-gray-4,rgba(0,0,0,.26))));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.o-radio__description:empty {
|
|
199
|
+
display: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.o-radio__title+.o-radio__description {
|
|
203
|
+
margin-top: calc(var(--o-spacer,16rpx)/ 2);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.o-radio__border {
|
|
207
|
+
position: absolute;
|
|
208
|
+
bottom: 0;
|
|
209
|
+
height: 1px;
|
|
210
|
+
background: var(--o-radio-border-color,var(--o-component-stroke,var(--o-gray-color-3,#dddddd)));
|
|
211
|
+
left: 96rpx;
|
|
212
|
+
right: 0;
|
|
213
|
+
transform: scaleY(.5);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.o-radio__border--right {
|
|
217
|
+
left: 32rpx;
|
|
218
|
+
}
|
|
219
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./props";export*from"./radio-group";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const props={allowUncheck:{type:Boolean,value:!1},borderless:{type:Boolean,value:!1},direction:{type:String,value:"vertical"},disabled:{type:null,value:void 0},icon:{type:null,value:"circle"},keys:{type:Object},name:{type:String,value:""},options:{type:Array},placement:{type:String,value:"left"},readonly:{type:null,value:void 0},value:{type:null,value:null},defaultValue:{type:null}};export default props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__decorate}from"../common/tslib";import config from"../common/config";import{SuperComponent,wxComponent}from"../common/src/index";import props from"./props";const{prefix:prefix}=config,name=`${prefix}-radio-group`;let RadioGroup=class extends SuperComponent{constructor(){super(...arguments),this.behaviors=["wx://form-field"],this.externalClasses=[`${prefix}-class`],this.data={prefix:prefix,classPrefix:name,radioOptions:[]},this.relations={"../radio/radio":{type:"descendant",linked(e){const{value:t,disabled:i,readonly:o,direction:a}=this.data;e.setData({checked:t===e.data.value,direction:a}),e.setDisabled(i),e.setReadonly(o)}}},this.properties=props,this.controlledProps=[{key:"value",event:"change"}],this.observers={value(e){this.getChildren().forEach(t=>{t.setData({checked:e===t.data.value})})},options(){this.initWithOptions()},disabled(e){var t;(null===(t=this.data.options)||void 0===t?void 0:t.length)?this.initWithOptions():this.getChildren().forEach(t=>{t.setDisabled(e)})},direction(e){this.getChildren().forEach(t=>{t.setData({direction:e})})}},this.methods={getChildren(){let e=this.$children;return(null==e?void 0:e.length)||(e=this.selectAllComponents(`.${prefix}-radio-option`)),e},updateValue(e){this._trigger("change",{value:e})},handleRadioChange(e){const{checked:t}=e.detail,{value:i,index:o,allowUncheck:a}=e.target.dataset;this._trigger("change",!1===t&&a?{value:null,index:o}:{value:i,index:o})},initWithOptions(){const{options:e,value:t,keys:i,disabled:o,readonly:a}=this.data;if(!(null==e?void 0:e.length)||!Array.isArray(e))return void this.setData({radioOptions:[]});const r=[];try{e.forEach(e=>{var s,n,l;const d=typeof e;"number"===d||"string"===d?r.push({label:`${e}`,value:e,checked:t===e,disabled:o,readonly:a}):"object"===d&&r.push(Object.assign(Object.assign({},e),{label:e[null!==(s=null==i?void 0:i.label)&&void 0!==s?s:"label"],value:e[null!==(n=null==i?void 0:i.value)&&void 0!==n?n:"value"],checked:t===e[null!==(l=null==i?void 0:i.value)&&void 0!==l?l:"value"],disabled:e.disabled||o,readonly:e.readonly||a}))}),this.setData({radioOptions:r})}catch(e){console.error("error",e)}}}}};RadioGroup=__decorate([wxComponent()],RadioGroup);export default RadioGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-radio":"../radio/radio"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [direction])}} class {{prefix}}-class" aria-role="radiogroup"><slot/><block wx:for="{{radioOptions}}" wx:key="value"><o-radio class="{{prefix}}-radio-option" data-index="{{index}}" data-value="{{item.value}}" data-allow-uncheck="{{item.allowUncheck || allowUncheck}}" block="{{item.block || true}}" label="{{item.label || ''}}" value="{{item.value}}" checked="{{item.checked || false}}" content="{{item.content || ''}}" allow-uncheck="{{item.allowUncheck || allowUncheck}}" content-disabled="{{item.contentDisabled || false}}" readonly="{{item.readonly || false}}" disabled="{{item.disabled || false}}" icon="{{item.icon || icon}}" placement="{{item.placement || placement}}" max-content-row="{{item.maxContentRow || 5}}" max-label-row="{{item.maxLabelRow || 3}}" name="{{item.name || ''}}" borderless="{{borderless}}" bind:change="handleRadioChange"/></block></view>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./props";export*from"./rate";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const props={allowHalf:{type:Boolean,value:!1},color:{type:null,value:"#f16e00"},count:{type:Number,value:5},disabled:{type:null,value:void 0},gap:{type:null,value:8},icon:{type:null},iconPrefix:{type:String,value:void 0},placement:{type:String,value:"top"},showText:{type:Boolean,value:!1},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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__decorate}from"../common/tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{unitConvert,getRect}from"../common/utils";import usingConfig from"../common/mixins/using-config";const{prefix:prefix}=config,componentName="rate";let Rate=class extends SuperComponent{constructor(){super(...arguments),this.behaviors=[usingConfig({componentName:"rate"})],this.externalClasses=[`${prefix}-class`,`${prefix}-class-icon`,`${prefix}-class-text`],this.properties=props,this.controlledProps=[{key:"value",event:"change"}],this.data={prefix:prefix,classPrefix:`${prefix}-rate`,tipsVisible:!1,tipsLeft:0,actionType:"",scaleIndex:-1,isVisibleToScreenReader:!1},this.methods={onTouch(e,t){const{classPrefix:i}=this.data,{count:s,allowHalf:o,gap:n,value:a,size:r}=this.properties,[c]=e.changedTouches,p=unitConvert(n);getRect(this,`.${i}__wrapper`).then(e=>{const{width:i,left:h}=e,l=(i-(s-1)*p)/s,m=(c.pageX-h+p)/(l+p),u=m%1,d=m-u;let f=u<=.5&&o?d+.5:d+1;f>s?f=s:f<0&&(f=0);const x=Math.ceil(f-1)*(unitConvert(n)+unitConvert(r))+.5*unitConvert(r);this.setData({tipsVisible:!0,actionType:t,scaleIndex:Math.ceil(f),tipsLeft:Math.max(x,0)}),f!==a&&this._trigger("change",{value:f}),this.touchEnd&&this.hideTips()})},onTap(e){const{disabled:t}=this.properties;t||this.onTouch(e,"tap")},onTouchStart(){this.touchEnd=!1},onTouchMove(e){this.onTouch(e,"move"),this.showAlertText()},onTouchEnd(){this.touchEnd=!0,this.hideTips()},hideTips(){"move"===this.data.actionType&&this.setData({tipsVisible:!1,scaleIndex:-1})},onSelect(e){const{value:t}=e.currentTarget.dataset,{actionType:i}=this.data;"move"!==i&&(this._trigger("change",{value:t}),setTimeout(()=>this.setData({tipsVisible:!1,scaleIndex:-1}),300))},showAlertText(){!0!==this.data.isVisibleToScreenReader&&(this.setData({isVisibleToScreenReader:!0}),setTimeout(()=>{this.setData({isVisibleToScreenReader:!1})},2e3))}}}};Rate=__decorate([wxComponent()],Rate);export default Rate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-icon":"../icon/icon"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="../common/utils.wxs" module="_"/><wxs src="./rate.wxs" module="utils"/><view class="{{classPrefix}} class" style="{{_._style([style, customStyle])}}"><view class="{{classPrefix}}__wrapper {{prefix}}-class" style="font-size:{{ utils.regSize(size) }}" bind:touchstart="{{ !disabled ? 'onTouchStart' : '' }}" bind:touchmove="{{ !disabled ? 'onTouchMove' : '' }}" bind:tap="onTap" bind:touchend="{{ !disabled ? 'onTouchEnd' : ''}}" bind:touchcancel="{{ !disabled ? 'onTouchEnd' : ''}}" aria-role="slider" aria-valuemax="{{count}}" aria-valuemin="{{0}}" aria-valuenow="{{value}}" aria-valuetext="{{utils.getText(texts,value,globalConfig)}}"><o-icon wx:for="{{ count }}" wx:key="*this" class="{{classPrefix }}__icon {{utils.getIconClass(classPrefix + '__icon', defaultValue, value, index, allowHalf, disabled, scaleIndex)}}" style="margin-right: {{ count - index > 1 ? _.addUnit(gap) : 0 }}; {{utils.getColor(color)}}" o-class="{{prefix}}-class-icon" name="{{utils.getIconName(defaultValue, value, index, icon)}}" size="{{ size }}" prefix="{{iconPrefix}}"/></view><text wx:if="{{showText}}" class="{{_.cls(classPrefix + '__text', [['active', value > 0]])}} {{prefix}}-class-text" aria-hidden="{{true}}">{{utils.getText(texts,value,globalConfig)}}</text><text wx:if="{{isVisibleToScreenReader}}" class="{{_.cls(classPrefix + '__text', [['active', value > 0], ['sr-only', isVisibleToScreenReader]])}} {{prefix}}-class-text" aria-role="alert" aria-live="assertive">{{value + (value > 1 ? ' étoiles' : ' étoile')}} {{utils.getText(texts,value,globalConfig)}}</text><view wx:if="{{tipsVisible && placement}}" class="{{_.cls(classPrefix + '__tips', [placement])}}" style="left: {{tipsLeft}}px" aria-hidden="{{true}}"><block wx:if="{{actionType == 'tap'}}"><view wx:if="{{allowHalf}}" class="{{_.cls(classPrefix + '__tips-item', [['active', utils.ceil(value) - 0.5 == value]])}}" bind:tap="onSelect" data-value="{{utils.ceil(value) - 0.5}}"><o-icon class="{{classPrefix }}__icon {{classPrefix }}__icon--selected-half" name="{{utils.getIconName(defaultValue, value, index, icon)}}" size="{{ size }}" style="{{utils.getColor(color)}}"/><view class="{{classPrefix}}__tips-text">{{utils.ceil(value) - 0.5}}</view></view><view class="{{_.cls(classPrefix + '__tips-item', [['active', utils.ceil(value) == value]])}}" bind:tap="onSelect" data-value="{{utils.ceil(value)}}"><o-icon class="{{_.cls(classPrefix + '__icon', ['selected'])}}" name="{{utils.getIconName(defaultValue, 0, 0, icon)}}" size="{{ size }}" style="{{utils.getColor(color)}}"/><view class="{{classPrefix}}__tips-text">{{utils.ceil(value)}}</view></view></block><view wx:else class="{{_.cls(classPrefix + '__tips-item', [['active', utils.ceil(value) == value && actionType == 'tap']])}}" bind:tap="onSelect" data-value="{{utils.ceil(value)}}"><o-icon class="{{_.cls(classPrefix + '__icon', [['selected', utils.ceil(value) == value], ['selected-half', utils.ceil(value) != value]]) }}" name="{{utils.getIconName(defaultValue, 0, 0, icon)}}" size="{{ size }}" style="{{utils.getColor(color)}}"/><view class="{{classPrefix}}__tips-text">{{value}}</view></view></view></view>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getText: function (texts, val, globalConfig) {
|
|
3
|
+
if (!texts.length) {
|
|
4
|
+
texts = globalConfig.texts || [];
|
|
5
|
+
}
|
|
6
|
+
var curVal = Math.floor(val - 1);
|
|
7
|
+
return texts[curVal] || globalConfig.noValueText;
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
getIconName: function (defaultValue, value, index, icon) {
|
|
11
|
+
var curVal = value >= 0 ? value : defaultValue;
|
|
12
|
+
var name = ['star-filled', 'star-filled'];
|
|
13
|
+
|
|
14
|
+
if (icon) {
|
|
15
|
+
name = icon.constructor == 'Array' ? icon : [icon, icon];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return name[curVal >= index + 1 ? 0 : 1];
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
getIconClass: function (classPrefix, defaultValue, value, index, allowHalf, disabled, scaleIndex) {
|
|
22
|
+
var curVal = value >= 0 ? value : defaultValue;
|
|
23
|
+
var className = [];
|
|
24
|
+
if (curVal >= index + 1) {
|
|
25
|
+
className.push(classPrefix + '--selected');
|
|
26
|
+
if (disabled) {
|
|
27
|
+
className.push(classPrefix + '--disabled');
|
|
28
|
+
}
|
|
29
|
+
if (scaleIndex === index + 1) {
|
|
30
|
+
className.push(classPrefix + '--current');
|
|
31
|
+
}
|
|
32
|
+
} else if (allowHalf && curVal - index > 0) {
|
|
33
|
+
className.push(classPrefix + '--selected-half');
|
|
34
|
+
if (scaleIndex === index + 1) {
|
|
35
|
+
className.push(classPrefix + '--current');
|
|
36
|
+
}
|
|
37
|
+
if (disabled) {
|
|
38
|
+
className.push(classPrefix + '--disabled-half');
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
className.push(classPrefix + '--unselected');
|
|
42
|
+
}
|
|
43
|
+
return className.join(' ');
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
ceil: function (value) {
|
|
47
|
+
return Math.ceil(value);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
getColor: function (color) {
|
|
51
|
+
if (color.constructor === 'Array' && color.length === 2) {
|
|
52
|
+
return ';--o-rate-selected-color: ' + color[0] + '; --o-rate-unselected-color: ' + color[1];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (typeof color === 'string') {
|
|
56
|
+
return ';--o-rate-selected-color: ' + color;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return '';
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
regSize: function (val) {
|
|
63
|
+
return val.indexOf('px') ? val : val + 'px';
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
@import '../common/style/index.wxss';
|
|
2
|
+
|
|
3
|
+
.o-rate {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: flex-start;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.o-rate__wrapper {
|
|
11
|
+
line-height: 1em;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.o-rate__icon {
|
|
16
|
+
display: block;
|
|
17
|
+
line-height: 1em;
|
|
18
|
+
width: 1em;
|
|
19
|
+
transition: transform .3s ease;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.o-rate__icon--current {
|
|
23
|
+
transform: scale(var(--o-rate-icon-scale,1.33));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.o-rate__icon--selected {
|
|
27
|
+
color: var(--o-rate-selected-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.o-rate__icon--selected-half {
|
|
31
|
+
color: transparent;
|
|
32
|
+
background: linear-gradient(to right,var(--o-rate-selected-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00))) 0,var(--o-rate-selected-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00))) 50%,var(--o-rate-unselected-color,var(--o-component-border,var(--o-gray-color-4,#dddddd))) 51%,var(--o-rate-unselected-color,var(--o-component-border,var(--o-gray-color-4,#dddddd))) 100%);
|
|
33
|
+
-webkit-background-clip: text;
|
|
34
|
+
background-clip: text;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.o-rate__icon--unselected {
|
|
38
|
+
color: var(--o-rate-unselected-color,var(--o-component-border,var(--o-gray-color-4,#dddddd)));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.o-rate__text {
|
|
42
|
+
font-size: var(--o-rate-text-font-size,var(--o-font-size-m,32rpx));
|
|
43
|
+
color: var(--o-rate-text-color,var(--o-text-color-disabled,var(--o-font-gray-4,rgba(0,0,0,.26))));
|
|
44
|
+
margin-left: var(--o-spacer-2,32rpx);
|
|
45
|
+
vertical-align: middle;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.o-rate__text--active {
|
|
49
|
+
color: var(--o-rate-text-active-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
50
|
+
font-weight: var(--o-rate-text-active-font-weight,600);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.o-rate__text--sr-only {
|
|
54
|
+
position: absolute;
|
|
55
|
+
width: 1px;
|
|
56
|
+
height: 1px;
|
|
57
|
+
padding: 0;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
clip: rect(0,0,0,0);
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
clip-path: inset(50%);
|
|
62
|
+
border: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.o-rate__tips {
|
|
66
|
+
position: absolute;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
bottom: calc(100% + 16rpx);
|
|
70
|
+
padding: calc(var(--o-spacer,16rpx)/ 2);
|
|
71
|
+
border-radius: var(--o-radius-default,12rpx);
|
|
72
|
+
box-shadow: var(--o-shadow-1,0 1px 10px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.08),0 2px 4px -1px rgba(0,0,0,.12));
|
|
73
|
+
background-color: var(--o-bg-color-container,var(--o-font-white-1,#fff));
|
|
74
|
+
transform: translateX(-50%);
|
|
75
|
+
z-index: 2;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.o-rate__tips--bottom {
|
|
79
|
+
top: calc(100% + 16rpx);
|
|
80
|
+
bottom: auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.o-rate__tips-item {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
width: 64rpx;
|
|
88
|
+
border-radius: var(--o-radius-small,6rpx);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.o-rate__tips-item--active {
|
|
92
|
+
background-color: var(--o-bg-color-component,var(--o-gray-color-3,#dddddd));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.o-rate__tips-text {
|
|
96
|
+
text-align: center;
|
|
97
|
+
font: var(--o-font-body-medium,28rpx / 44rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial));
|
|
98
|
+
}
|
|
99
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// o-rating-card: Review & rating summary (Figma "Review & Rating Card"): score, stars, optional distribution bars, button.
|
|
2
|
+
const props = {
|
|
3
|
+
title: { type: String, value: '' },
|
|
4
|
+
action: { type: String, value: '' },
|
|
5
|
+
score: { type: Number, value: 0 },
|
|
6
|
+
count: { type: String, value: '' },
|
|
7
|
+
// Full version: distribution bars, 5 values in % from 5 stars to 1 star
|
|
8
|
+
full: { type: Boolean, value: false },
|
|
9
|
+
distribution: { type: Array, value: [] },
|
|
10
|
+
buttonText: { type: String, value: 'Donner un avis' },
|
|
11
|
+
};
|
|
12
|
+
export default props;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __decorate } from '../common/tslib';
|
|
2
|
+
import { SuperComponent, wxComponent } from '../common/src/index';
|
|
3
|
+
import config from '../common/config';
|
|
4
|
+
import props from './props';
|
|
5
|
+
|
|
6
|
+
function stars(rating) {
|
|
7
|
+
const full = Math.round(Number(rating) || 0);
|
|
8
|
+
return [1, 2, 3, 4, 5].map((i) => (i <= full ? 'star-filled' : 'star'));
|
|
9
|
+
}
|
|
10
|
+
const { prefix } = config;
|
|
11
|
+
const name = `${prefix}-rating-card`;
|
|
12
|
+
|
|
13
|
+
// Derived data, recomputed when a property changes and once when attached
|
|
14
|
+
// (the runtime may skip observers for initial property values).
|
|
15
|
+
const observers = {
|
|
16
|
+
score(value) { this.setData({ _stars: stars(value), _score: (Number(value) || 0).toFixed(1) }); },
|
|
17
|
+
distribution(list) {
|
|
18
|
+
this.setData({ _bars: (list || []).map((percent, i) => ({ label: `${5 - i} étoile${5 - i > 1 ? 's' : ''}`, percent })) });
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let RatingCard = class RatingCard extends SuperComponent {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.externalClasses = [`${prefix}-class`];
|
|
26
|
+
this.options = { multipleSlots: true };
|
|
27
|
+
this.properties = props;
|
|
28
|
+
this.data = { prefix, classPrefix: name, _stars: stars(0), _score: '0.0', _bars: [] };
|
|
29
|
+
this.observers = observers;
|
|
30
|
+
this.lifetimes = {
|
|
31
|
+
attached() {
|
|
32
|
+
Object.keys(observers).forEach((key) => observers[key].call(this, this.properties[key]));
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
this.methods = {
|
|
36
|
+
onAction() { this.triggerEvent('action'); },
|
|
37
|
+
onButton() { this.triggerEvent('review'); },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
RatingCard = __decorate([wxComponent()], RatingCard);
|
|
42
|
+
export default RatingCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-icon":"../icon/icon","o-button":"../button/button","o-section-title":"../section-title/section-title"}}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<view class="o-rating-card class {{prefix}}-class" style="{{style}} {{customStyle}}">
|
|
2
|
+
<o-section-title wx:if="{{title}}" title="{{title}}" action="{{action}}" bind:action="onAction" />
|
|
3
|
+
<view class="o-row">
|
|
4
|
+
<view class="o-rating-card__summary">
|
|
5
|
+
<view class="o-row">
|
|
6
|
+
<text class="o-rating-card__score">{{_score}}</text>
|
|
7
|
+
<view wx:if="{{full}}" class="o-rating-card__stars"><o-icon name="star-filled" /></view>
|
|
8
|
+
<view wx:else class="o-rating-card__stars">
|
|
9
|
+
<o-icon wx:for="{{_stars}}" wx:key="index" name="{{item}}" />
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
<view class="o-txt-body">{{count}}</view>
|
|
13
|
+
</view>
|
|
14
|
+
<view wx:if="{{full}}" class="o-grow o-rating-card__bars">
|
|
15
|
+
<view wx:for="{{_bars}}" wx:key="index" class="o-row o-rating-card__bar">
|
|
16
|
+
<text class="o-rating-card__bar-label">{{item.label}}</text>
|
|
17
|
+
<view class="o-grow o-rating-card__track"><view class="o-rating-card__fill" style="width:{{item.percent}}%" /></view>
|
|
18
|
+
</view>
|
|
19
|
+
</view>
|
|
20
|
+
</view>
|
|
21
|
+
<view wx:if="{{buttonText}}" class="o-rating-card__button">
|
|
22
|
+
<o-button theme="secondary" block bind:tap="onButton">{{buttonText}}</o-button>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import '../common/style/index.wxss';
|
|
2
|
+
@import '../common/style/card.wxss';
|
|
3
|
+
|
|
4
|
+
/* Review & rating summary (Figma "Review & Rating Card"): score, stars, optional distribution bars, button. */
|
|
5
|
+
.o-rating-card {
|
|
6
|
+
display: block;
|
|
7
|
+
color: var(--o-scheme-on-surface, #1c1b1f);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.o-rating-card__summary {
|
|
11
|
+
margin-right: 48rpx;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.o-rating-card__score {
|
|
15
|
+
font: var(--o-type-display-small, 400 72rpx / 88rpx var(--o-font-family, Roboto, Arial));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.o-rating-card__stars {
|
|
19
|
+
display: flex;
|
|
20
|
+
margin-left: 16rpx;
|
|
21
|
+
font-size: 40rpx;
|
|
22
|
+
color: var(--o-static-canary, #fc0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.o-rating-card__bar + .o-rating-card__bar {
|
|
26
|
+
margin-top: 4rpx;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.o-rating-card__bar-label {
|
|
30
|
+
width: 120rpx;
|
|
31
|
+
font: var(--o-type-body-medium, 400 28rpx / 40rpx var(--o-font-family, Roboto, Arial));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.o-rating-card__track {
|
|
35
|
+
height: 16rpx;
|
|
36
|
+
border-radius: 8rpx;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
background-color: var(--o-scheme-outline-variant, #ddd);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.o-rating-card__fill {
|
|
42
|
+
height: 100%;
|
|
43
|
+
border-radius: 8rpx;
|
|
44
|
+
background-color: var(--o-static-canary, #fc0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.o-rating-card__button {
|
|
48
|
+
margin-top: 32rpx;
|
|
49
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// o-recap-card: Recap / detail card (Figma "Recap detail Card", "Recap Card"): header, description, key/value sections, toggle, total.
|
|
2
|
+
const props = {
|
|
3
|
+
label: { type: String, value: '' },
|
|
4
|
+
thumbnail: { type: String, value: '' },
|
|
5
|
+
thumbnailIcon: { type: String, value: 'image' },
|
|
6
|
+
title: { type: String, value: '' },
|
|
7
|
+
subtitle: { type: String, value: '' },
|
|
8
|
+
// Text + chevron on the right of the header ("Modifier")
|
|
9
|
+
action: { type: String, value: '' },
|
|
10
|
+
descriptionLabel: { type: String, value: '' },
|
|
11
|
+
description: { type: String, value: '' },
|
|
12
|
+
// [{ title, rows: [{ label, value }] }]
|
|
13
|
+
sections: { type: Array, value: [] },
|
|
14
|
+
toggleLabel: { type: String, value: '' },
|
|
15
|
+
toggleStatus: { type: String, value: '' },
|
|
16
|
+
toggle: { type: Boolean, value: false },
|
|
17
|
+
totalLabel: { type: String, value: '' },
|
|
18
|
+
total: { type: String, value: '' },
|
|
19
|
+
currency: { type: String, value: 'FCFA' },
|
|
20
|
+
};
|
|
21
|
+
export default props;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __decorate } from '../common/tslib';
|
|
2
|
+
import { SuperComponent, wxComponent } from '../common/src/index';
|
|
3
|
+
import config from '../common/config';
|
|
4
|
+
import props from './props';
|
|
5
|
+
|
|
6
|
+
const { prefix } = config;
|
|
7
|
+
const name = `${prefix}-recap-card`;
|
|
8
|
+
|
|
9
|
+
// Derived data, recomputed when a property changes and once when attached
|
|
10
|
+
// (the runtime may skip observers for initial property values).
|
|
11
|
+
const observers = {
|
|
12
|
+
toggle(value) { this.setData({ _toggle: value }); },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let RecapCard = class RecapCard extends SuperComponent {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.externalClasses = [`${prefix}-class`];
|
|
19
|
+
this.options = { multipleSlots: true };
|
|
20
|
+
this.properties = props;
|
|
21
|
+
this.data = { prefix, classPrefix: name, _toggle: false };
|
|
22
|
+
this.observers = observers;
|
|
23
|
+
this.lifetimes = {
|
|
24
|
+
attached() {
|
|
25
|
+
Object.keys(observers).forEach((key) => observers[key].call(this, this.properties[key]));
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
this.methods = {
|
|
29
|
+
onAction() { this.triggerEvent('action'); },
|
|
30
|
+
onToggle(e) {
|
|
31
|
+
this.setData({ _toggle: e.detail.value });
|
|
32
|
+
this.triggerEvent('toggle-change', { value: e.detail.value });
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
RecapCard = __decorate([wxComponent()], RecapCard);
|
|
38
|
+
export default RecapCard;
|