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
|
+
export*from"./props";export*from"./button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const props={activityType:{type:Number},appParameter:{type:String,value:""},block:{type:Boolean,value:!1},content:{type:String},customDataset:{type:null},disabled:{type:null,value:void 0},entrancePath:{type:String,value:""},ghost:{type:Boolean,value:!1},hoverClass:{type:String,value:""},hoverStartTime:{type:Number,value:20},hoverStayTime:{type:Number,value:70},hoverStopPropagation:{type:Boolean,value:!1},icon:{type:null},lang:{type:String},loading:{type:Boolean,value:!1},loadingProps:{type:Object},needShowEntrance:{type:Boolean,value:!0},openType:{type:String},phoneNumberNoQuotaToast:{type:Boolean,value:!0},sendMessageImg:{type:String,value:"截图"},sendMessagePath:{type:String,value:"当前分享路径"},sendMessageTitle:{type:String,value:"当前标题"},sessionFrom:{type:String,value:""},shape:{type:String,value:"rectangle"},showMessageCard:{type:Boolean,value:!1},size:{type:String,value:"medium"},oId:{type:String,value:""},theme:{type:String,value:"default"},type:{type:String},variant:{type:String,value:"base"}};export default props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="../common/utils.wxs" module="_"/><template name="calendar-header"><view class="{{oClass}} {{classPrefix}} {{switchMode !== 'none' ? classPrefix + '__with-action' : ''}}" id="{{oId}}"><view class="{{classPrefix}}__action" wx:if="{{switchMode !== 'none'}}"><view wx:if="{{switchMode === 'year-month'}}" class="{{_.cls(classPrefix + '__icon', [['disabled', preYearBtnDisable]])}}" data-disabled="{{preYearBtnDisable}}" data-type="pre-year" bindtap="handleSwitchModeChange"><o-icon name="chevron-left-double"/></view><view class="{{_.cls(classPrefix + '__icon', [['disabled', prevMonthBtnDisable]])}}" data-disabled="{{prevMonthBtnDisable}}" data-type="pre-month" bindtap="handleSwitchModeChange"><o-icon name="chevron-left"/></view></view><view class="{{classPrefix}}__title">{{ title }}</view><view class="{{classPrefix}}__action" wx:if="{{switchMode !== 'none'}}"><view class="{{_.cls(classPrefix + '__icon', [['disabled', nextMonthBtnDisable]])}}" data-disabled="{{nextMonthBtnDisable}}" data-type="next-month" bindtap="handleSwitchModeChange"><o-icon name="chevron-right"/></view><view wx:if="{{switchMode === 'year-month'}}" class="{{_.cls(classPrefix + '__icon', [['disabled', nextYearBtnDisable]])}}" data-disabled="{{nextYearBtnDisable}}" data-type="next-year" bindtap="handleSwitchModeChange"><o-icon name="chevron-right-double"/></view></view></view></template>
|
|
@@ -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 TCalendar from"../common/shared/calendar/index";import useCustomNavbar from"../common/mixins/using-custom-navbar";import usingConfig from"../common/mixins/using-config";import{getPrevMonth,getPrevYear,getNextMonth,getNextYear}from"./utils";const{prefix:prefix}=config,componentName="calendar";let Calendar=class extends SuperComponent{constructor(){super(...arguments),this.behaviors=[useCustomNavbar,usingConfig({componentName:"calendar",localeTextPropName:"localeText"})],this.externalClasses=[`${prefix}-class`],this.options={multipleSlots:!0},this.properties=props,this.data={prefix:prefix,classPrefix:`${prefix}-calendar`,months:[],scrollIntoView:"",innerConfirmBtn:{},realLocalText:{},currentMonth:{},actionButtons:{preYearBtnDisable:!1,prevMonthBtnDisable:!1,nextMonthBtnDisable:!1,nextYearBtnDisable:!1}},this.controlledProps=[{key:"value",event:"confirm"},{key:"value",event:"change"}],this.lifetimes={created(){this.base=new TCalendar(this.properties)},ready(){this.initialValue(),this.calcMonths(),this.data.usePopup||this.scrollIntoView()}},this.observers={localeText(){var t;null===(t=this.updateLocale)||void 0===t||t.call(this)},globalConfig(){const{globalConfig:t}=this.data;this.setData({days:this.base.getDays(t.weekdays),realLocalText:t})},type(t){this.base.type=t},allowSameDay(t){this.base.allowSameDay=t},confirmBtn(t){"string"==typeof t?this.setData({innerConfirmBtn:"slot"===t?"slot":{content:t}}):"object"==typeof t&&this.setData({innerConfirmBtn:t})},"firstDayOfWeek,minDate,maxDate"(t,e,a){t&&(this.base.firstDayOfWeek=t),e&&(this.base.minDate=e),a&&(this.base.maxDate=a),this.calcMonths()},value(t){this.base.value=t,this.calcMonths(Array.isArray(t)?t[0]:t)},visible(t){t&&(this.scrollIntoView(),this.base.value=this.data.value,this.calcMonths())},format(t){const{usePopup:e,visible:a}=this.data;this.base.format=t,e&&!a||this.calcMonths()}},this.methods={initialValue(){const{value:t,type:e,minDate:a}=this.data;if(!t){const t=new Date,n=a||new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),s="single"===e?n:[n];"range"===e&&(s[1]=n+864e5),this.setData({value:s}),this.base.value=s}},scrollIntoView(){const{value:t}=this.data;if(!t)return;const e=new Date(Array.isArray(t)?t[0]:t);e&&this.setData({scrollIntoView:`year_${e.getFullYear()}_month_${e.getMonth()}`})},getCurrentYearAndMonth(t){const e=new Date(t);return{year:e.getFullYear(),month:e.getMonth()}},updateActionButton(t){const e=this.getCurrentYearAndMonth(this.base.minDate),a=this.getCurrentYearAndMonth(this.base.maxDate),n=this.getCurrentYearAndMonth(t),s=new Date(e.year,e.month,1).getTime(),r=new Date(a.year,a.month,1).getTime(),i=new Date(n.year,n.month,1),o=getPrevYear(i).getTime(),h=getPrevMonth(i).getTime(),l=getNextMonth(i).getTime(),c=getNextYear(i).getTime(),m=o<s||h<s,u=h<s,g=l>r||c>r,d=l>r;this.setData({actionButtons:{preYearBtnDisable:m,prevMonthBtnDisable:u,nextYearBtnDisable:g,nextMonthBtnDisable:d}})},getCurrentMonth(t,e=this.data.months){const a=t||this.getCurrentDate(),{year:n,month:s}=this.getCurrentYearAndMonth(a),r=e.filter(t=>t.year===n&&t.month===s);return{date:a,currentMonth:r.length>0?r:[e[0]]}},calcCurrentMonth(t){const{date:e,currentMonth:a}=this.getCurrentMonth(t);this.updateActionButton(e),this.setData({currentMonth:a})},calcMonths(t){const e=this.base.getMonths();if("none"===this.data.switchMode)return void this.setData({months:e});const{date:a,currentMonth:n}=this.getCurrentMonth(t,e);this.updateActionButton(a),this.setData({months:e,currentMonth:n})},close(t){this.data.autoClose&&this.setData({visible:!1}),this.triggerEvent("close",{trigger:t})},onVisibleChange(){this.close("overlay")},handleClose(){this.close("close-btn")},handleSelect(t){const{readonly:e}=this.properties,{date:a,year:n,month:s}=t.currentTarget.dataset;if("disabled"===a.type||e)return;const r=this.base.select({cellType:a.type,year:n,month:s,date:a.day}),i=this.toTime(r);this.calcMonths(),null==this.data.confirmBtn&&("single"!==this.data.type&&2!==r.length||(this.setData({visible:!1}),this._trigger("change",{value:i}))),this.triggerEvent("select",{value:i})},onTplButtonTap(){const t=this.base.getTrimValue(),e=this.toTime(t);this.close("confirm-btn"),this._trigger("confirm",{value:e})},toTime:t=>t?Array.isArray(t)?t.map(t=>t.getTime()):t.getTime():null,onScroll(t){this.triggerEvent("scroll",t.detail)},getCurrentDate(){var t,e;let a=Array.isArray(this.base.value)?this.base.value[0]:this.base.value;if(this.data.currentMonth.length>0){const n=null===(t=this.data.currentMonth[0])||void 0===t?void 0:t.year,s=null===(e=this.data.currentMonth[0])||void 0===e?void 0:e.month;a=new Date(n,s,1).getTime()}return a},handleSwitchModeChange(t){const{type:e,disabled:a}=t.currentTarget.dataset;if(a)return;const n=this.getCurrentDate(),s={"pre-year":()=>getPrevYear(n),"pre-month":()=>getPrevMonth(n),"next-month":()=>getNextMonth(n),"next-year":()=>getNextYear(n)}[e]();if(!s)return;const{year:r,month:i}=this.getCurrentYearAndMonth(s);this.triggerEvent("panel-change",{year:r,month:i+1}),this.calcCurrentMonth(s)}}}};Calendar=__decorate([wxComponent()],Calendar);export default Calendar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-popup":"../popup/popup","o-button":"../button/button","o-icon":"../icon/icon"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="./calendar.wxs" module="_this"/><wxs src="../common/utils.wxs" module="_"/><o-popup wx:if="{{usePopup}}" class="class" visible="{{visible}}" usingCustomNavbar="{{usingCustomNavbar}}" bind:visible-change="onVisibleChange" placement="bottom"><include src="./template.wxml"/></o-popup><block wx:else><include src="./template.wxml"/></block>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function getDateLabel(monthItem, dateItem) {
|
|
2
|
+
var weekdayText = ['日', '一', '二', '三', '四', '五', '六'];
|
|
3
|
+
var weekday = (monthItem.weekdayOfFirstDay + dateItem.day - 1) % 7;
|
|
4
|
+
var label = monthItem.month + 1 + '月' + dateItem.day + '日, 星期' + weekdayText[weekday];
|
|
5
|
+
if (dateItem.type === 'start') {
|
|
6
|
+
label = '开始日期:' + label;
|
|
7
|
+
}
|
|
8
|
+
if (dateItem.type === 'end') {
|
|
9
|
+
label = '结束日期:' + label;
|
|
10
|
+
}
|
|
11
|
+
if (isDateSelected(dateItem)) {
|
|
12
|
+
label = '已选中, ' + label;
|
|
13
|
+
}
|
|
14
|
+
if (dateItem.prefix) {
|
|
15
|
+
label += ', ' + dateItem.prefix;
|
|
16
|
+
}
|
|
17
|
+
if (dateItem.suffix) {
|
|
18
|
+
label += ', ' + dateItem.suffix;
|
|
19
|
+
}
|
|
20
|
+
return label;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isDateSelected(dateItem) {
|
|
24
|
+
return ['start', 'end', 'selected', 'centre'].indexOf(dateItem.type) >= 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getMonthTitle(year, month, pattern = '') {
|
|
28
|
+
// prettier-ignore
|
|
29
|
+
var REGEXP = getRegExp('\{year\}|\{month\}', 'g');
|
|
30
|
+
|
|
31
|
+
return pattern.replace(REGEXP, function (match) {
|
|
32
|
+
var replacements = {
|
|
33
|
+
'{year}': year,
|
|
34
|
+
'{month}': month < 10 ? '0' + month : month,
|
|
35
|
+
};
|
|
36
|
+
return replacements[match] || match;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = {
|
|
41
|
+
getDateLabel: getDateLabel,
|
|
42
|
+
isDateSelected: isDateSelected,
|
|
43
|
+
getMonthTitle: getMonthTitle,
|
|
44
|
+
};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
@import '../common/style/index.wxss';
|
|
2
|
+
|
|
3
|
+
.o-calendar {
|
|
4
|
+
width: inherit;
|
|
5
|
+
position: relative;
|
|
6
|
+
z-index: 9999;
|
|
7
|
+
background: var(--o-calendar-bg-color,var(--o-bg-color-container,var(--o-font-white-1,#fff)));
|
|
8
|
+
overflow-x: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.o-calendar--popup {
|
|
12
|
+
border-top-left-radius: var(--o-calendar-radius,var(--o-radius-extraLarge,24rpx));
|
|
13
|
+
border-top-right-radius: var(--o-calendar-radius,var(--o-radius-extraLarge,24rpx));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.o-calendar__title {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
font: var(--o-calendar-title-font,var(--o-font-title-large,600 36rpx / 52rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial)));
|
|
21
|
+
color: var(--o-calendar-title-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
22
|
+
padding: var(--o-spacer-2,32rpx);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.o-calendar__title:focus {
|
|
26
|
+
outline: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.o-calendar__close-btn {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: var(--o-spacer-2,32rpx);
|
|
32
|
+
right: var(--o-spacer-2,32rpx);
|
|
33
|
+
margin: calc(-1 * var(--o-spacer-1,24rpx));
|
|
34
|
+
padding: var(--o-spacer-1,24rpx);
|
|
35
|
+
color: var(--o-calendar-title-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.o-calendar__days {
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-template-columns: repeat(7,1fr);
|
|
41
|
+
grid-column-gap: 8rpx;
|
|
42
|
+
padding: 0 var(--o-spacer-2,32rpx);
|
|
43
|
+
text-align: center;
|
|
44
|
+
line-height: 92rpx;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.o-calendar__days-item {
|
|
48
|
+
height: 92rpx;
|
|
49
|
+
font-size: var(--o-font-size-base,28rpx);
|
|
50
|
+
color: var(--o-calendar-days-color,var(--o-text-color-secondary,var(--o-font-gray-2,#444748)));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.o-calendar__content {
|
|
54
|
+
min-height: 400rpx;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.o-calendar__month {
|
|
60
|
+
font: var(--o-font-title-small,600 28rpx / 44rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial));
|
|
61
|
+
color: var(--o-calendar-title-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
62
|
+
padding: var(--o-spacer-2,32rpx) 0 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.o-calendar__months {
|
|
66
|
+
height: 712rpx;
|
|
67
|
+
padding: 0 var(--o-spacer-2,32rpx) var(--o-spacer-2,32rpx);
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.o-calendar__months::-webkit-scrollbar {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.o-calendar__dates {
|
|
76
|
+
flex: 1;
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: repeat(7,1fr);
|
|
79
|
+
grid-column-gap: 8rpx;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.o-calendar__dates-item {
|
|
83
|
+
position: relative;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
font: var(--o-font-title-medium,600 32rpx / 48rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial));
|
|
88
|
+
border-radius: var(--o-calendar-selected-border-radius,var(--o-radius-default,12rpx));
|
|
89
|
+
height: 120rpx;
|
|
90
|
+
margin-top: var(--o-spacer,16rpx);
|
|
91
|
+
color: var(--o-calendar-title-color,var(--o-text-color-primary,var(--o-font-gray-1,#1c1b1f)));
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
-webkit-tap-highlight-color: transparent;
|
|
94
|
+
-webkit-user-select: none;
|
|
95
|
+
user-select: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.o-calendar__dates-item-prefix,
|
|
99
|
+
.o-calendar__dates-item-suffix {
|
|
100
|
+
position: absolute;
|
|
101
|
+
font: var(--o-font-body-extraSmall,20rpx / 32rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial));
|
|
102
|
+
width: 100%;
|
|
103
|
+
text-align: center;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.o-calendar__dates-item-prefix {
|
|
107
|
+
top: 8rpx;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.o-calendar__dates-item-suffix {
|
|
111
|
+
bottom: 8rpx;
|
|
112
|
+
color: var(--o-calendar-item-suffix-color,var(--o-text-color-placeholder,var(--o-font-gray-3,#8d8d8d)));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.o-calendar__dates-item-suffix--end,
|
|
116
|
+
.o-calendar__dates-item-suffix--selected,
|
|
117
|
+
.o-calendar__dates-item-suffix--start {
|
|
118
|
+
color: var(--o-calendar-selected-color,var(--o-text-color-anti,var(--o-font-white-1,#fff)));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.o-calendar__dates-item-suffix--disabled {
|
|
122
|
+
color: var(--o-calendar-item-disabled-color,var(--o-text-color-disabled,var(--o-font-gray-4,rgba(0,0,0,.26))));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.o-calendar__dates-item--end,
|
|
126
|
+
.o-calendar__dates-item--selected,
|
|
127
|
+
.o-calendar__dates-item--start,
|
|
128
|
+
.o-calendar__dates-item--start-end {
|
|
129
|
+
background: var(--o-calendar-active-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
130
|
+
color: var(--o-calendar-selected-color,var(--o-text-color-anti,var(--o-font-white-1,#fff)));
|
|
131
|
+
border-radius: var(--o-calendar-selected-border-radius,var(--o-radius-default,12rpx));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.o-calendar__dates-item--start {
|
|
135
|
+
border-radius: var(--o-calendar-selected-border-radius,var(--o-radius-default,12rpx)) 0 0 var(--o-calendar-selected-border-radius,var(--o-radius-default,12rpx));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.o-calendar__dates-item--end {
|
|
139
|
+
border-radius: 0 var(--o-calendar-selected-border-radius,var(--o-radius-default,12rpx)) var(--o-calendar-selected-border-radius,var(--o-radius-default,12rpx)) 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.o-calendar__dates-item--start+.o-calendar__dates-item--end::before {
|
|
143
|
+
content: '';
|
|
144
|
+
display: block;
|
|
145
|
+
position: absolute;
|
|
146
|
+
top: 0;
|
|
147
|
+
width: 8rpx;
|
|
148
|
+
height: 100%;
|
|
149
|
+
background: var(--o-calendar-active-color,var(--o-brand-color,var(--o-primary-color-7,#f16e00)));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.o-calendar__dates-item--start+.o-calendar__dates-item--end:before {
|
|
153
|
+
left: -8rpx;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.o-calendar__dates-item--centre {
|
|
157
|
+
border-radius: 0;
|
|
158
|
+
background-color: var(--o-calendar-item-centre-color,var(--o-brand-color-light,var(--o-primary-color-1,#fef3eb)));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.o-calendar__dates-item--centre::after,
|
|
162
|
+
.o-calendar__dates-item--centre::before {
|
|
163
|
+
content: '';
|
|
164
|
+
display: block;
|
|
165
|
+
position: absolute;
|
|
166
|
+
top: 0;
|
|
167
|
+
width: 8rpx;
|
|
168
|
+
height: 100%;
|
|
169
|
+
background-color: var(--o-calendar-item-centre-color,var(--o-brand-color-light,var(--o-primary-color-1,#fef3eb)));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.o-calendar__dates-item--centre:before {
|
|
173
|
+
left: -8rpx;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.o-calendar__dates-item--centre:after {
|
|
177
|
+
right: -8rpx;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.o-calendar__dates-item--disabled {
|
|
181
|
+
color: var(--o-calendar-item-disabled-color,var(--o-text-color-disabled,var(--o-font-gray-4,rgba(0,0,0,.26))));
|
|
182
|
+
cursor: default;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.o-calendar__footer {
|
|
186
|
+
padding: var(--o-spacer-2,32rpx);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.o-calendar-switch-mode--none>.o-calendar__months {
|
|
190
|
+
height: 60vh;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.o-calendar-header {
|
|
194
|
+
display: flex;
|
|
195
|
+
justify-content: space-between;
|
|
196
|
+
align-items: center;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.o-calendar-header__with-action {
|
|
200
|
+
padding: 0 var(--o-spacer-2,32rpx) var(--o-spacer,16rpx) var(--o-spacer-2,32rpx);
|
|
201
|
+
box-sizing: border-box;
|
|
202
|
+
position: relative;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.o-calendar-header__with-action::after {
|
|
206
|
+
content: '';
|
|
207
|
+
display: block;
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: unset;
|
|
210
|
+
bottom: 0;
|
|
211
|
+
left: unset;
|
|
212
|
+
right: unset;
|
|
213
|
+
background-color: var(--o-border-color,var(--o-gray-color-3,#dddddd));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.o-calendar-header__with-action::after {
|
|
217
|
+
height: 1px;
|
|
218
|
+
left: 0;
|
|
219
|
+
right: 0;
|
|
220
|
+
transform: scaleY(.5);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.o-calendar-header__with-action .o-calendar-header__title {
|
|
224
|
+
flex: 1;
|
|
225
|
+
text-align: center;
|
|
226
|
+
font: var(--o-font-title-small,600 28rpx / 44rpx var(--o-font-family,Roboto,PingFang SC,Microsoft YaHei,Arial));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.o-calendar-header__action {
|
|
230
|
+
display: flex;
|
|
231
|
+
font-size: var(--o-font-size-xl,40rpx);
|
|
232
|
+
color: var(--o-calendar-switch-mode-icon-color,var(--o-text-color-secondary,var(--o-font-gray-2,#444748)));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.o-calendar-header__icon {
|
|
236
|
+
padding: var(--o-spacer,16rpx);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.o-calendar-header__icon--disabled {
|
|
240
|
+
color: var(--o-calendar-switch-mode-icon-disabled-color,var(--o-text-color-disabled,var(--o-font-gray-4,rgba(0,0,0,.26))));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.o-calendar-header__title {
|
|
244
|
+
text-align: left;
|
|
245
|
+
}
|
|
246
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./props";export*from"./calendar";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const props={allowSameDay:{type:Boolean,value:!1},autoClose:{type:Boolean,value:!0},confirmBtn:{type:null,value:""},firstDayOfWeek:{type:Number,value:0},format:{type:null},localeText:{type:Object},maxDate:{type:Number},minDate:{type:Number},readonly:{type:Boolean},switchMode:{type:String,value:"none"},title:{type:String},type:{type:String,value:"single"},usePopup:{type:Boolean,value:!0},usingCustomNavbar:{type:Boolean,value:!1},value:{type:null,value:null},defaultValue:{type:null},visible:{type:Boolean,value:!1}};export default props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="./calendar.wxs" module="_this"/><wxs src="../common/utils.wxs" module="_"/><import src="../common/template/button.wxml"/><import src="./calendar-header.wxml"/><view class="{{_.cls(classPrefix, [['popup', usePopup]])}} {{classPrefix}}-switch-mode--{{switchMode}} class {{prefix}}-class" style="{{_._style([style, customStyle])}}"><view class="{{classPrefix}}__title" tabindex="0"><slot name="title"/><text wx:if="{{title || realLocalText.title}}">{{ title || realLocalText.title }}</text></view><o-icon wx:if="{{usePopup}}" name="close" class="{{classPrefix}}__close-btn" size="48rpx" aria-role="button" aria-label="Fermer" bind:tap="handleClose"/><template wx:if="{{switchMode !== 'none'}}" is="calendar-header" data="{{ classPrefix: classPrefix + '-header', switchMode, ...actionButtons, title: _this.getMonthTitle(currentMonth[0].year, realLocalText.months[currentMonth[0].month], realLocalText.monthTitle)}}"/><view aria-hidden class="{{classPrefix}}__days"><view wx:for="{{days}}" wx:key="index" class="{{classPrefix}}__days-item">{{ item }}</view></view><scroll-view class="{{classPrefix}}__months" scroll-into-view="{{scrollIntoView}}" scroll-y enhanced show-scrollbar="{{false}}" bindscroll="onScroll"><block wx:for="{{ switchMode === 'none' ? months : currentMonth}}" wx:key="index"><template wx:if="{{switchMode === 'none'}}" is="calendar-header" data="{{oClass: classPrefix + '__month', classPrefix: classPrefix + '-header', oId: 'year_' + item.year + '_month_' + item.month, switchMode, ...actionButtons, title: _this.getMonthTitle(item.year, realLocalText.months[item.month], realLocalText.monthTitle) }}"/><view class="{{classPrefix}}__dates"><view wx:for="{{(item.weekdayOfFirstDay - firstDayOfWeek + 7) % 7}}" wx:key="index"/><block wx:for="{{item.months}}" wx:for-index="dateIndex" wx:for-item="dateItem" wx:key="dateIndex"><view class="{{classPrefix}}__dates-item {{dateItem.className}} {{classPrefix}}__dates-item--{{dateItem.type}}" data-year="{{item.year}}" data-month="{{item.month}}" data-date="{{dateItem}}" aria-role="button" aria-label="{{_this.getDateLabel(item, dateItem)}}" aria-disabled="{{dateItem.type === 'disabled'}}" bind:tap="handleSelect"><view wx:if="{{dateItem.prefix}}" class="{{classPrefix}}__dates-item-prefix">{{ dateItem.prefix }}</view>{{ dateItem.day }}<view wx:if="{{dateItem.suffix}}" class="{{classPrefix}}__dates-item-suffix {{classPrefix}}__dates-item-suffix--{{dateItem.type}}">{{ dateItem.suffix }}</view></view></block></view></block></scroll-view><view wx:if="{{innerConfirmBtn != null && usePopup}}" class="{{classPrefix}}__footer"><slot wx:if="{{innerConfirmBtn === 'slot'}}" name="confirm-btn"/><block wx:elif="{{innerConfirmBtn}}"><template is="button" data="{{ block: true, theme: 'primary', rootClass: 'o-calendar__confirm-btn', content: realLocalText.confirm, ...innerConfirmBtn }}"/></block></view></view>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getMonthByOffset(t,e){const n=new Date(t);return n.setMonth(n.getMonth()+e),n}export function getYearByOffset(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}export const getPrevMonth=t=>getMonthByOffset(t,-1);export const getNextMonth=t=>getMonthByOffset(t,1);export const getPrevYear=t=>getYearByOffset(t,-1);export const getNextYear=t=>getYearByOffset(t,1);
|
|
@@ -0,0 +1,24 @@
|
|
|
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}-card`;
|
|
8
|
+
|
|
9
|
+
let Card = class Card extends SuperComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.externalClasses = [`${prefix}-class`];
|
|
13
|
+
this.options = { multipleSlots: true };
|
|
14
|
+
this.properties = props;
|
|
15
|
+
this.data = { prefix, classPrefix: name };
|
|
16
|
+
this.methods = {
|
|
17
|
+
onTap() {
|
|
18
|
+
this.triggerEvent('click');
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
Card = __decorate([wxComponent()], Card);
|
|
24
|
+
export default Card;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-image":"../image/image"}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<view class="{{classPrefix}} {{classPrefix}}--{{variant}} class {{prefix}}-class" style="{{style}} {{customStyle}}" bind:tap="onTap">
|
|
2
|
+
<view wx:if="{{title || subtitle || meta || thumbnail || thumbnailSlot}}" class="{{classPrefix}}__header">
|
|
3
|
+
<view wx:if="{{thumbnail || thumbnailSlot}}" class="{{classPrefix}}__thumbnail">
|
|
4
|
+
<o-image wx:if="{{thumbnail}}" src="{{thumbnail}}" mode="aspectFill" width="48" height="48" />
|
|
5
|
+
<slot name="thumbnail" />
|
|
6
|
+
</view>
|
|
7
|
+
<view class="{{classPrefix}}__heading">
|
|
8
|
+
<view wx:if="{{title}}" class="{{classPrefix}}__title">{{title}}</view>
|
|
9
|
+
<view wx:if="{{subtitle}}" class="{{classPrefix}}__subtitle">{{subtitle}}</view>
|
|
10
|
+
<view wx:if="{{meta}}" class="{{classPrefix}}__meta">{{meta}}</view>
|
|
11
|
+
</view>
|
|
12
|
+
<view class="{{classPrefix}}__trailing">
|
|
13
|
+
<slot name="trailing" />
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
<view wx:if="{{description}}" class="{{classPrefix}}__description">{{description}}</view>
|
|
17
|
+
<slot />
|
|
18
|
+
<view wx:if="{{amount}}" class="{{classPrefix}}__amount">
|
|
19
|
+
<text>{{amount}}</text>
|
|
20
|
+
<text wx:if="{{currency}}" class="{{classPrefix}}__currency">{{currency}}</text>
|
|
21
|
+
</view>
|
|
22
|
+
<slot name="footer" />
|
|
23
|
+
</view>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@import '../common/style/index.wxss';
|
|
2
|
+
|
|
3
|
+
/* Card (Figma "atom_surface"): radius 12px, padding 16px.
|
|
4
|
+
* outlined = surface + 1px outline-variant, filled = surface-variant, dark = primary-fixed (#242424). */
|
|
5
|
+
.o-card {
|
|
6
|
+
display: block;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
padding: var(--o-card-padding, 32rpx);
|
|
9
|
+
border-radius: var(--o-card-radius, 24rpx);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
color: var(--o-scheme-on-surface, #1c1b1f);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.o-card--outlined {
|
|
15
|
+
background-color: var(--o-card-bg-color, var(--o-scheme-surface, #fff));
|
|
16
|
+
border: 2rpx solid var(--o-card-border-color, var(--o-scheme-outline-variant, #ddd));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.o-card--filled {
|
|
20
|
+
background-color: var(--o-card-filled-bg-color, var(--o-scheme-surface-variant, #eee));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.o-card--dark {
|
|
24
|
+
background-color: var(--o-card-dark-bg-color, var(--o-static-primary-fixed, #242424));
|
|
25
|
+
color: var(--o-static-on-primary-fixed, #fff);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.o-card__header {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.o-card__thumbnail {
|
|
34
|
+
flex: none;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
width: 96rpx;
|
|
39
|
+
height: 96rpx;
|
|
40
|
+
margin-right: 32rpx;
|
|
41
|
+
border-radius: 16rpx;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
background-color: var(--o-scheme-surface-variant, #eee);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.o-card--dark .o-card__thumbnail {
|
|
47
|
+
background-color: var(--o-static-primary-fixed-dim, #3e3e3e);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.o-card__heading {
|
|
51
|
+
flex: 1;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.o-card__title {
|
|
56
|
+
font: var(--o-type-title-medium, 500 32rpx / 48rpx var(--o-font-family, Roboto, Arial));
|
|
57
|
+
display: -webkit-box;
|
|
58
|
+
-webkit-box-orient: vertical;
|
|
59
|
+
-webkit-line-clamp: 2;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.o-card__subtitle {
|
|
64
|
+
margin-top: 8rpx;
|
|
65
|
+
font: var(--o-type-body-medium, 400 28rpx / 40rpx var(--o-font-family, Roboto, Arial));
|
|
66
|
+
color: var(--o-scheme-on-surface-variant, #444748);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.o-card__meta {
|
|
70
|
+
margin-top: 8rpx;
|
|
71
|
+
font: var(--o-type-body-medium, 400 28rpx / 40rpx var(--o-font-family, Roboto, Arial));
|
|
72
|
+
color: var(--o-card-meta-color, var(--o-scheme-tertiary, #085ebd));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.o-card--dark .o-card__subtitle {
|
|
76
|
+
color: var(--o-static-on-primary-fixed-variant, #dedede);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.o-card__trailing {
|
|
80
|
+
flex: none;
|
|
81
|
+
margin-left: 16rpx;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.o-card__description {
|
|
85
|
+
margin-top: 32rpx;
|
|
86
|
+
font: var(--o-type-body-medium, 400 28rpx / 40rpx var(--o-font-family, Roboto, Arial));
|
|
87
|
+
color: var(--o-scheme-on-surface-variant, #444748);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.o-card--dark .o-card__description {
|
|
91
|
+
color: var(--o-static-on-primary-fixed-variant, #dedede);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.o-card__amount {
|
|
95
|
+
margin-top: 32rpx;
|
|
96
|
+
font: var(--o-type-title-large, 400 44rpx / 56rpx var(--o-font-family, Roboto, Arial));
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.o-card__currency {
|
|
101
|
+
margin-left: 8rpx;
|
|
102
|
+
font: var(--o-type-label-large, 500 28rpx / 40rpx var(--o-font-family, Roboto, Arial));
|
|
103
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// o-card: card of the Max it design system (Figma page "2- Cards", "Description Card").
|
|
2
|
+
const props = {
|
|
3
|
+
// outlined (white + 1px border), filled (surface-variant), dark (black surface, white text)
|
|
4
|
+
variant: { type: String, value: 'outlined' },
|
|
5
|
+
thumbnail: { type: String, value: '' },
|
|
6
|
+
// true when the `thumbnail` slot is used (icon, avatar...)
|
|
7
|
+
thumbnailSlot: { type: Boolean, value: false },
|
|
8
|
+
title: { type: String, value: '' },
|
|
9
|
+
subtitle: { type: String, value: '' },
|
|
10
|
+
// Highlighted line (date, status) in the tertiary blue
|
|
11
|
+
meta: { type: String, value: '' },
|
|
12
|
+
description: { type: String, value: '' },
|
|
13
|
+
amount: { type: String, value: '' },
|
|
14
|
+
currency: { type: String, value: 'FCFA' },
|
|
15
|
+
};
|
|
16
|
+
export default props;
|
|
@@ -0,0 +1,22 @@
|
|
|
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}-card-list`;
|
|
8
|
+
|
|
9
|
+
let CardList = class CardList extends SuperComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.externalClasses = [`${prefix}-class`];
|
|
13
|
+
this.options = { multipleSlots: true };
|
|
14
|
+
this.properties = props;
|
|
15
|
+
this.data = { prefix, classPrefix: name };
|
|
16
|
+
this.methods = {
|
|
17
|
+
onAction() { this.triggerEvent('action'); },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
CardList = __decorate([wxComponent()], CardList);
|
|
22
|
+
export default CardList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-section-title":"../section-title/section-title"}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<view class="o-card-list class {{prefix}}-class" style="{{style}} {{customStyle}}">
|
|
2
|
+
<o-section-title wx:if="{{title}}" title="{{title}}" action="{{action}}" bind:action="onAction" />
|
|
3
|
+
<view wx:if="{{subtitle}}" class="o-txt-small o-card-list__subtitle">{{subtitle}}</view>
|
|
4
|
+
<view class="o-card-list__body o-card-list__body--{{layout}} {{framed ? 'o-surface o-surface--outlined o-card-list__body--framed' : ''}}" style="gap:{{gap}}rpx;{{layout === 'grid' ? 'grid-template-columns:repeat(' + columns + ', minmax(0, 1fr));' : ''}}{{layout === 'carousel' ? 'grid-auto-columns:' + itemWidth + 'rpx;' : ''}}">
|
|
5
|
+
<slot />
|
|
6
|
+
</view>
|
|
7
|
+
</view>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import '../common/style/index.wxss';
|
|
2
|
+
@import '../common/style/card.wxss';
|
|
3
|
+
|
|
4
|
+
/* List container (Figma "3- Lists"): section title, then items stacked, in a grid or in a horizontal carousel. */
|
|
5
|
+
.o-card-list {
|
|
6
|
+
display: block;
|
|
7
|
+
margin-bottom: 24rpx;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.o-card-list__subtitle {
|
|
11
|
+
margin: -8rpx 0 16rpx;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Grid tracks size the slotted items, so the items need no specific style */
|
|
15
|
+
.o-card-list__body {
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: minmax(0, 1fr);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.o-card-list__body--carousel {
|
|
21
|
+
grid-template-columns: none;
|
|
22
|
+
grid-auto-flow: column;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
padding-bottom: 8rpx;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.o-card-list__body--framed {
|
|
28
|
+
gap: 0 !important;
|
|
29
|
+
padding: 8rpx 0;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// o-card-list: List container (Figma "3- Lists"): section title, then items stacked, in a grid or in a horizontal carousel.
|
|
2
|
+
const props = {
|
|
3
|
+
title: { type: String, value: '' },
|
|
4
|
+
subtitle: { type: String, value: '' },
|
|
5
|
+
// Text + chevron on the right of the title ("Voir tout")
|
|
6
|
+
action: { type: String, value: '' },
|
|
7
|
+
// stack | grid | carousel
|
|
8
|
+
layout: { type: String, value: 'stack' },
|
|
9
|
+
columns: { type: Number, value: 2 },
|
|
10
|
+
// Width of each carousel item, in rpx
|
|
11
|
+
itemWidth: { type: Number, value: 560 },
|
|
12
|
+
gap: { type: Number, value: 16 },
|
|
13
|
+
// Items inside one outlined card (list action card, form)
|
|
14
|
+
framed: { type: Boolean, value: false },
|
|
15
|
+
};
|
|
16
|
+
export default props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter,__decorate}from"../common/tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{getRect,debounce}from"../common/utils";import usingConfig from"../common/mixins/using-config";const{prefix:prefix}=config,componentName="cascader";function parseOptions(e,t){var i,s,l;const n=null!==(i=null==t?void 0:t.label)&&void 0!==i?i:"label",a=null!==(s=null==t?void 0:t.value)&&void 0!==s?s:"value",o=null!==(l=null==t?void 0:t.disabled)&&void 0!==l?l:"disabled";return e.map(e=>({[n]:e[n],[a]:e[a],[o]:e[o]}))}function flattenPaths(e,t){var i,s,l,n;const a=null!==(i=null==t?void 0:t.label)&&void 0!==i?i:"label",o=null!==(s=null==t?void 0:t.value)&&void 0!==s?s:"value",h=null!==(l=null==t?void 0:t.children)&&void 0!==l?l:"children",r=null!==(n=null==t?void 0:t.disabled)&&void 0!==n?n:"disabled",d=[],u=(e,t,i)=>{e.forEach((e,s)=>{var l;const n=[...t,e],c=[...i,s],g=null==e?void 0:e[h];if(Array.isArray(g)&&g.length>0)u(g,n,c);else{const t=n.map(e=>{var t;return String(null!==(t=null==e?void 0:e[a])&&void 0!==t?t:"")}),i=[t.join(""),String(null!==(l=null==e?void 0:e.text)&&void 0!==l?l:"")].filter(Boolean).join("");d.push({key:n.map(e=>{var t;return String(null!==(t=null==e?void 0:e[o])&&void 0!==t?t:"")}).join("/"),path:n,indexes:c,labels:t,text:i,disabled:n.some(e=>null==e?void 0:e[r])})}})};return u(e||[],[],[]),d}function buildFragments(e,t){const i=e.join(" / "),s=(e,t,i)=>{t&&e.push({id:e.length,text:t,highlight:i})};if(!t)return[{id:0,text:i,highlight:!1}];const l=[],n=i.toLowerCase(),a=t.toLowerCase();let o=0;for(;o<i.length;){const e=n.indexOf(a,o);if(-1===e){s(l,i.slice(o),!1);break}s(l,i.slice(o,e),!1),s(l,i.slice(e,e+a.length),!0),o=e+a.length}return l.length?l:[{id:0,text:i,highlight:!1}]}function defaultFilter(e,t,i,s){var l,n;const a=e.toLowerCase(),o=i.map(e=>{var t;return String(null!==(t=null==e?void 0:e[s])&&void 0!==t?t:"")}).join("").toLowerCase(),h=String(null!==(n=null===(l=i[i.length-1])||void 0===l?void 0:l.text)&&void 0!==n?n:"").toLowerCase();return o.includes(a)||!!h&&h.includes(a)}const defaultState={contentHeight:0,stepHeight:0,tabsHeight:0,subTitlesHeight:0,stepsInitHeight:0,filterHeight:0,flatPaths:[]};let Cascader=class extends SuperComponent{constructor(){super(...arguments),this.behaviors=[usingConfig({componentName:"cascader"})],this.externalClasses=[`${prefix}-class`],this.options={multipleSlots:!0,pureDataPattern:/^options$/},this.properties=props,this.filterDebounced=null,this.controlledProps=[{key:"value",event:"change"}],this.state=Object.assign({},defaultState),this.data={prefix:prefix,classPrefix:`${prefix}-cascader`,stepIndex:0,selectedIndexes:[],selectedValue:[],scrollTopList:[],steps:[],_optionsHeight:0,filterKeyword:"",filterResults:[],isSearching:!1},this.observers={visible(e){if(e){const e=this.selectComponent("#tabs");null==e||e.setTrack(),null==e||e.getTabHeight().then(e=>{this.state.tabsHeight=e.height}),this.initOptionsHeight(this.data.steps.length),this.updateScrollTop(),this.initWithValue()}else this.state=Object.assign({},defaultState),this.data.isSearching&&this.resetFilter()},value(){this.initWithValue()},options(){const{selectedValue:e,steps:t,items:i}=this.genItems();this.setData({steps:t,items:i,selectedValue:e,stepIndex:i.length-1}),this.invalidateFlatPaths(),this.data.isSearching&&this.applyFilter(this.data.filterKeyword)},keys(){this.invalidateFlatPaths(),this.data.isSearching&&this.applyFilter(this.data.filterKeyword)},filterable(e){!e&&this.data.isSearching&&this.resetFilter()},selectedIndexes(){const{visible:e,theme:t}=this.properties,{selectedValue:i,steps:s,items:l}=this.genItems(),n={steps:s,selectedValue:i,stepIndex:l.length-1};JSON.stringify(l)!==JSON.stringify(this.data.items)&&Object.assign(n,{items:l}),this.setData(n),e&&"step"===t&&this.updateOptionsHeight(s.length)},stepIndex(){return __awaiter(this,void 0,void 0,function*(){const{visible:e}=this.data;e&&this.updateScrollTop()})}},this.methods={updateOptionsHeight(e){const{contentHeight:t,stepsInitHeight:i,stepHeight:s,subTitlesHeight:l,filterHeight:n}=this.state;this.setData({_optionsHeight:t-i-l-n-(e-1)*s})},initOptionsHeight(e){return __awaiter(this,void 0,void 0,function*(){const{classPrefix:t}=this.data,{theme:i,subTitles:s,filterable:l}=this.properties,{height:n}=yield getRect(this,`.${t}__content`);if(this.state.contentHeight=n,"step"===i&&(yield Promise.all([getRect(this,`.${t}__steps`),getRect(this,`.${t}__step`)]).then(([t,i])=>{this.state.stepsInitHeight=t.height-(e-1)*i.height,this.state.stepHeight=i.height})),s.length>0){const{height:e}=yield getRect(this,`.${t}__options-title`);this.state.subTitlesHeight=e}if(l){const e=yield getRect(this,`.${t}__filter`);this.state.filterHeight=e.height}const a=this.state.contentHeight-this.state.subTitlesHeight-this.state.filterHeight;this.setData({_optionsHeight:"step"===i?a-this.state.stepsInitHeight-(e-1)*this.state.stepHeight:a-this.state.tabsHeight})})},initWithValue(){if(null!=this.data.value&&""!==this.data.value){const e=this.getIndexesByValue(this.data.options,this.data.value);e&&this.setData({selectedIndexes:e})}else this.setData({selectedIndexes:[]})},getIndexesByValue(e,t){var i,s,l;const{keys:n}=this.data;for(let a=0,o=e.length;a<o;a+=1){const o=e[a];if(o[null!==(i=null==n?void 0:n.value)&&void 0!==i?i:"value"]===t)return[a];if(o[null!==(s=null==n?void 0:n.children)&&void 0!==s?s:"children"]){const e=this.getIndexesByValue(o[null!==(l=null==n?void 0:n.children)&&void 0!==l?l:"children"],t);if(e)return[a,...e]}}},updateScrollTop(){const{visible:e,items:t,selectedIndexes:i,stepIndex:s}=this.data;e&&getRect(this,".cascader-radio-group-0").then(e=>{var l;const n=e.height/(null===(l=t[0])||void 0===l?void 0:l.length);this.setData({[`scrollTopList[${s}]`]:n*i[s]})})},hide(e){this.setData({visible:!1}),this.triggerEvent("close",{trigger:e})},onVisibleChange(){this.hide("overlay")},onClose(){this.data.checkStrictly&&this.triggerChange(),this.hide("close-btn")},invalidateFlatPaths(){this.state.flatPaths=[]},ensureFlatPaths(){let{flatPaths:e}=this.state;if(!e||0===e.length){const{options:t,keys:i}=this.data;e=flattenPaths(t,i),this.state.flatPaths=e}return e},resetFilter(){this.setData({filterKeyword:"",filterResults:[],isSearching:!1})},onFilterChange(e){var t,i;const s=null!==(i=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.value)&&void 0!==i?i:"";this.filterDebounced||(this.filterDebounced=debounce(e=>this.applyFilter(e),200)),this.filterDebounced(s)},onFilterClear(){this.resetFilter()},applyFilter(e){var t;const i=String(null!=e?e:"").trim();if(!i)return void this.resetFilter();const{keys:s,filter:l}=this.data,n=null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"label",a=l,o=this.ensureFlatPaths(),h=[];o.forEach(e=>{const t=e.path[e.path.length-1];("function"==typeof a?!!a(i,t,e.path):defaultFilter(i,t,e.path,n))&&h.push({key:e.key,indexes:e.indexes,disabled:e.disabled,fragments:buildFragments(e.labels,i)})}),this.setData({filterKeyword:e,filterResults:h,isSearching:!0})},onFilterResultTap(e){const{key:t}=e.currentTarget.dataset,i=this.data.filterResults.find(e=>e.key===t);if(!i||i.disabled)return;const{indexes:s}=i,{items:l}=this.regenItemsByIndexes(s);this.resetFilter(),this.setData({items:l,selectedIndexes:s,stepIndex:s.length-1},()=>this.triggerChange()),this.hide("finish")},regenItemsByIndexes(e){var t,i,s;const{options:l,keys:n,placeholder:a,globalConfig:o}=this.data,h=[],r=[],d=[parseOptions(l,n)],u=null!==(t=null==n?void 0:n.label)&&void 0!==t?t:"label",c=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:"value",g=null!==(s=null==n?void 0:n.children)&&void 0!==s?s:"children";let p=l;for(let t=0,i=e.length;t<i;t+=1){const i=p[e[t]];h.push(i[c]),r.push(i[u]);const s=i[g];Array.isArray(s)&&s.length>0&&(d.push(parseOptions(s,n)),p=s)}return r.length<d.length&&r.push(a||o.placeholder),{selectedValue:h,steps:r,items:d}},onStepClick(e){const{index:t}=e.currentTarget.dataset;this.setData({stepIndex:t})},onTabChange(e){const{value:t}=e.detail;this.setData({stepIndex:t})},genItems(){var e,t,i,s,l;const{options:n,selectedIndexes:a,keys:o,placeholder:h,globalConfig:r}=this.data,d=[],u=[],c=[parseOptions(n,o)];if(n.length>0){let h=n;for(let n=0,r=a.length;n<r;n+=1){const r=h[a[n]];h=r[null!==(e=null==o?void 0:o.children)&&void 0!==e?e:"children"],d.push(r[null!==(t=null==o?void 0:o.value)&&void 0!==t?t:"value"]),u.push(r[null!==(i=null==o?void 0:o.label)&&void 0!==i?i:"label"]),r[null!==(s=null==o?void 0:o.children)&&void 0!==s?s:"children"]&&c.push(parseOptions(r[null!==(l=null==o?void 0:o.children)&&void 0!==l?l:"children"],o))}}return u.length<c.length&&u.push(h||r.placeholder),{selectedValue:d,steps:u,items:c}},handleSelect(e){var t,i,s,l,n,a;const{level:o}=e.target.dataset,{value:h}=e.detail,{checkStrictly:r}=this.properties,{selectedIndexes:d,items:u,keys:c,options:g,selectedValue:p}=this.data,v=u[o].findIndex(e=>{var t;return e[null!==(t=null==c?void 0:c.value)&&void 0!==t?t:"value"]===h});let f=d.slice(0,o).reduce((e,t,i)=>{var s;return 0===i?e[t]:e[null!==(s=null==c?void 0:c.children)&&void 0!==s?s:"children"][t]},g);if(f=0===o?f[v]:f[null!==(t=null==c?void 0:c.children)&&void 0!==t?t:"children"][v],f[null!==(i=null==c?void 0:c.disabled)&&void 0!==i?i:"disabled"])return;if(this.triggerEvent("pick",{value:f[null!==(s=null==c?void 0:c.value)&&void 0!==s?s:"value"],label:f[null!==(l=null==c?void 0:c.label)&&void 0!==l?l:"label"],index:v,level:o}),d[o]=v,r&&p.includes(String(h)))return d.length=o,void this.setData({selectedIndexes:d});d.length=o+1;const{items:m}=this.genItems();(null===(a=null==f?void 0:f[null!==(n=null==c?void 0:c.children)&&void 0!==n?n:"children"])||void 0===a?void 0:a.length)>=0?this.setData({selectedIndexes:d,[`items[${o+1}]`]:m[o+1]}):(this.setData({selectedIndexes:d},this.triggerChange),this.hide("finish"))},triggerChange(){var e;const{items:t,selectedValue:i,selectedIndexes:s}=this.data;this._trigger("change",{value:null!==(e=i[i.length-1])&&void 0!==e?e:"",selectedOptions:t.map((e,t)=>e[s[t]]).filter(Boolean)})}}}};Cascader=__decorate([wxComponent()],Cascader);export default Cascader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"o-icon":"../icon/icon","o-popup":"../popup/popup","o-tabs":"../tabs/tabs","o-tab-panel":"../tab-panel/tab-panel","o-radio-group":"../radio-group/radio-group","o-search":"../search/search"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<wxs src="../common/utils.wxs" module="_"/><o-popup class="class" visible="{{visible}}" placement="bottom" bind:visible-change="onVisibleChange"><view style="{{_._style([style, customStyle])}}" class="{{classPrefix}}"><view class="{{classPrefix}}__title"><slot name="title"/>{{title || globalConfig.title}}</view><view class="{{classPrefix}}__close-btn" bind:tap="onClose"><slot name="close-btn"/><o-icon wx:if="{{closeBtn}}" size="48rpx" name="close"/></view><slot name="header"/><view class="{{classPrefix}}__content"><view wx:if="{{filterable}}" class="{{classPrefix}}__filter"><o-search value="{{filterKeyword}}" placeholder="{{filterPlaceholder || globalConfig.filterPlaceholder}}" bind:change="onFilterChange" bind:clear="onFilterClear"/></view><block wx:if="{{!isSearching}}"><block wx:if="{{steps && steps.length}}"><view wx:if="{{theme == 'step'}}" class="{{classPrefix}}__steps"><view wx:for="{{steps}}" wx:key="index" class="{{classPrefix}}__step" bind:tap="onStepClick" data-index="{{index}}"><view class="{{classPrefix}}__step-dot {{classPrefix}}__step-dot--{{item !== placeholder ? 'active' : ''}} {{classPrefix}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}"></view><view class="{{classPrefix}}__step-label {{classPrefix}}__step-label--{{index === stepIndex ? 'active' : ''}}">{{ item }}</view><o-icon name="chevron-right" size="44rpx" o-class="{{classPrefix}}__step-arrow"/></view></view><block wx:if="{{theme == 'tab'}}"><o-tabs id="tabs" value="{{stepIndex}}" bind:change="onTabChange" space-evenly="{{false}}"><o-tab-panel wx:for="{{steps}}" wx:key="index" value="{{index}}" label="{{item}}"/></o-tabs></block></block><slot name="middle-content"/><view wx:if="{{ subTitles && subTitles[stepIndex] }}" class="{{classPrefix}}__options-title">{{subTitles[stepIndex]}}</view><view class="{{classPrefix}}__options-container" style="width: {{items.length + 1}}00vw; transform: translateX(-{{stepIndex}}00vw)"><scroll-view wx:for="{{items}}" wx:for-item="options" wx:key="index" class="{{classPrefix}}__options" scroll-y scroll-top="{{scrollTopList[index]}}" type="list" style="height: {{_optionsHeight}}px"><view class="cascader-radio-group-{{index}}"><o-radio-group value="{{selectedValue[index]}}" keys="{{keys}}" options="{{options}}" bind:change="handleSelect" data-level="{{index}}" placement="right" icon="line" borderless></o-radio-group></view></scroll-view></view></block><block wx:else><scroll-view wx:if="{{filterResults.length}}" class="{{classPrefix}}__filter-result" scroll-y type="list"><view wx:for="{{filterResults}}" wx:key="key" class="{{classPrefix}}__filter-result-item {{item.disabled ? classPrefix + '__filter-result-item--disabled' : ''}}" hover-class="{{item.disabled ? '' : classPrefix + '__filter-result-item--hover'}}" data-key="{{item.key}}" bind:tap="onFilterResultTap"><block wx:for="{{item.fragments}}" wx:for-item="frag" wx:key="id"><text class="{{frag.highlight ? classPrefix + '__filter-highlight' : ''}}">{{frag.text}}</text></block></view></scroll-view><view wx:else class="{{classPrefix}}__filter-empty">{{globalConfig.empty}}</view></block></view></view></o-popup>
|