naive-ui 2.41.1 → 2.43.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/dist/index.js +3349 -1068
- package/dist/index.mjs +3339 -1070
- package/dist/index.prod.js +1 -1
- package/dist/index.prod.mjs +1 -1
- package/es/_internal/icon/src/styles/index.cssr.mjs +0 -1
- package/es/_internal/icons/replaceable.mjs +1 -1
- package/es/_internal/scrollbar/src/Scrollbar.d.ts +3 -3
- package/es/_internal/select-menu/src/SelectMenu.d.ts +4 -4
- package/es/_internal/selection/src/Selection.d.ts +115 -13
- package/es/_internal/selection/styles/light.d.ts +14 -1
- package/es/_mixins/use-theme.mjs +1 -1
- package/es/_utils/index.d.ts +1 -0
- package/es/_utils/naive/prop.d.ts +19 -10
- package/es/_utils/naive/prop.mjs +21 -21
- package/es/_utils/ts/ts.d.ts +3 -0
- package/es/alert/src/Alert.d.ts +2 -2
- package/es/anchor/index.d.ts +1 -0
- package/es/anchor/src/AnchorAdapter.d.ts +1 -1
- package/es/anchor/src/BaseAnchor.mjs +29 -5
- package/es/anchor/src/Link.d.ts +3 -2
- package/es/anchor/src/Link.mjs +5 -2
- package/es/anchor/src/public-types.d.ts +5 -0
- package/es/anchor/src/public-types.mjs +1 -0
- package/es/auto-complete/src/AutoComplete.d.ts +155 -14
- package/es/auto-complete/styles/light.d.ts +14 -1
- package/es/avatar-group/index.d.ts +3 -2
- package/es/avatar-group/src/AvatarGroup.d.ts +1 -4
- package/es/avatar-group/src/generic-public-types.d.ts +18 -0
- package/es/avatar-group/src/generic-public-types.mjs +1 -0
- package/es/avatar-group/src/public-types.d.ts +10 -0
- package/es/avatar-group/src/public-types.mjs +1 -0
- package/es/back-top/src/BackTop.d.ts +1 -1
- package/es/badge/src/Badge.d.ts +1 -1
- package/es/button/src/Button.d.ts +1 -1
- package/es/card/src/Card.d.ts +7 -2
- package/es/card/src/Card.mjs +3 -1
- package/es/carousel/src/Carousel.d.ts +4 -4
- package/es/carousel/src/Carousel.mjs +2 -2
- package/es/carousel/src/CarouselDots.d.ts +2 -2
- package/es/carousel/src/CarouselItem.mjs +1 -1
- package/es/cascader/src/Cascader.d.ts +163 -20
- package/es/cascader/src/CascaderMenu.d.ts +56 -4
- package/es/cascader/src/CascaderOption.d.ts +56 -4
- package/es/cascader/src/CascaderSelectMenu.d.ts +57 -5
- package/es/cascader/src/CascaderSubmenu.d.ts +56 -4
- package/es/cascader/styles/light.d.ts +14 -1
- package/es/color-picker/src/ColorInputUnit.d.ts +26 -2
- package/es/color-picker/src/ColorPicker.d.ts +128 -11
- package/es/color-picker/src/ColorPickerTrigger.mjs +2 -1
- package/es/color-picker/src/utils.d.ts +2 -0
- package/es/color-picker/src/utils.mjs +23 -0
- package/es/color-picker/styles/light.d.ts +17 -4
- package/es/components.d.ts +1 -0
- package/es/components.mjs +1 -0
- package/es/config-provider/src/ConfigProvider.d.ts +1 -1
- package/es/config-provider/src/ConfigProvider.mjs +1 -1
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/src/DataTable.d.ts +690 -68
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +334 -26
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +332 -24
- package/es/data-table/src/TableParts/Body.d.ts +332 -24
- package/es/data-table/src/TableParts/Cell.mjs +1 -1
- package/es/data-table/src/TableParts/Header.d.ts +332 -24
- package/es/data-table/src/interface.d.ts +253 -18
- package/es/data-table/src/use-sorter.d.ts +2 -5
- package/es/data-table/src/use-table-data.d.ts +1 -4
- package/es/data-table/src/utils.mjs +4 -1
- package/es/data-table/styles/light.d.ts +84 -6
- package/es/date-picker/src/DatePicker.d.ts +229 -23
- package/es/date-picker/src/DatePicker.mjs +1 -1
- package/es/date-picker/src/panel/date.d.ts +110 -10
- package/es/date-picker/src/panel/daterange.d.ts +111 -11
- package/es/date-picker/src/panel/datetime.d.ts +111 -11
- package/es/date-picker/src/panel/datetime.mjs +1 -1
- package/es/date-picker/src/panel/datetimerange.d.ts +112 -12
- package/es/date-picker/src/panel/datetimerange.mjs +2 -2
- package/es/date-picker/src/panel/month.d.ts +110 -10
- package/es/date-picker/src/panel/monthrange.d.ts +111 -11
- package/es/date-picker/src/panel/panelHeader.d.ts +436 -36
- package/es/date-picker/src/panel/use-calendar.d.ts +109 -9
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +110 -10
- package/es/date-picker/src/panel/use-dual-calendar.mjs +3 -3
- package/es/date-picker/src/panel/use-panel-common.d.ts +109 -9
- package/es/date-picker/src/panel/use-panel-common.mjs +1 -1
- package/es/date-picker/src/props.d.ts +85 -7
- package/es/date-picker/src/props.mjs +1 -1
- package/es/date-picker/src/utils.d.ts +2 -1
- package/es/date-picker/src/utils.mjs +4 -1
- package/es/date-picker/styles/light.d.ts +28 -2
- package/es/dialog/src/Dialog.d.ts +9 -6
- package/es/dialog/src/Dialog.mjs +1 -0
- package/es/dialog/src/DialogEnvironment.d.ts +11 -4
- package/es/dialog/src/DialogEnvironment.mjs +3 -0
- package/es/dialog/src/DialogProvider.d.ts +38 -34
- package/es/dialog/src/dialogProps.d.ts +2 -1
- package/es/dialog/src/dialogProps.mjs +2 -1
- package/es/drawer/src/Drawer.d.ts +4 -4
- package/es/drawer/src/DrawerBodyWrapper.d.ts +1 -1
- package/es/dropdown/src/Dropdown.d.ts +165 -24
- package/es/dropdown/src/DropdownMenu.d.ts +2 -2
- package/es/dropdown/src/DropdownOption.d.ts +2 -2
- package/es/dropdown/styles/light.d.ts +16 -3
- package/es/dynamic-input/src/DynamicInput.d.ts +153 -12
- package/es/dynamic-input/src/InputPreset.d.ts +52 -4
- package/es/dynamic-input/src/PairPreset.d.ts +52 -4
- package/es/dynamic-input/styles/light.d.ts +14 -1
- package/es/dynamic-tags/src/DynamicTags.d.ts +153 -12
- package/es/dynamic-tags/styles/light.d.ts +14 -1
- package/es/element/src/Element.mjs +1 -1
- package/es/ellipsis/src/Ellipsis.d.ts +154 -11
- package/es/ellipsis/src/PerformantEllipsis.d.ts +84 -6
- package/es/ellipsis/styles/light.d.ts +14 -1
- package/es/empty/src/Empty.d.ts +1 -1
- package/es/form/src/FormItem.d.ts +8 -2
- package/es/form/src/FormItem.mjs +6 -3
- package/es/form/src/FormItemCol.d.ts +7 -1
- package/es/form/src/FormItemGridItem.d.ts +7 -1
- package/es/form/src/FormItemRow.d.ts +7 -1
- package/es/form/src/utils.d.ts +1 -1
- package/es/form/src/utils.mjs +1 -1
- package/es/global-style/src/GlobalStyle.mjs +1 -1
- package/es/gradient-text/src/GradientText.d.ts +2 -2
- package/es/grid/src/GridItem.d.ts +1 -1
- package/es/heatmap/index.d.ts +6 -0
- package/es/heatmap/index.mjs +4 -0
- package/es/heatmap/src/ColorIndicator.d.ts +25 -0
- package/es/heatmap/src/ColorIndicator.mjs +41 -0
- package/es/heatmap/src/Heatmap.d.ts +385 -0
- package/es/heatmap/src/Heatmap.mjs +333 -0
- package/es/heatmap/src/Rect.d.ts +57 -0
- package/es/heatmap/src/Rect.mjs +67 -0
- package/es/heatmap/src/animationStyle.d.ts +6 -0
- package/es/heatmap/src/animationStyle.mjs +51 -0
- package/es/heatmap/src/interface.d.ts +7 -0
- package/es/heatmap/src/interface.mjs +1 -0
- package/es/heatmap/src/public-types.d.ts +16 -0
- package/es/heatmap/src/public-types.mjs +1 -0
- package/es/heatmap/src/styles/index.cssr.d.ts +2 -0
- package/es/heatmap/src/styles/index.cssr.mjs +102 -0
- package/es/heatmap/src/styles/rtl.cssr.d.ts +2 -0
- package/es/heatmap/src/styles/rtl.cssr.mjs +4 -0
- package/es/heatmap/src/theme.d.ts +8 -0
- package/es/heatmap/src/theme.mjs +7 -0
- package/es/heatmap/src/utils/index.d.ts +32 -0
- package/es/heatmap/src/utils/index.mjs +148 -0
- package/es/heatmap/styles/dark.d.ts +3 -0
- package/es/heatmap/styles/dark.mjs +16 -0
- package/es/heatmap/styles/index.d.ts +3 -0
- package/es/heatmap/styles/index.mjs +2 -0
- package/es/heatmap/styles/light.d.ts +31 -0
- package/es/heatmap/styles/light.mjs +45 -0
- package/es/heatmap/styles/rtl.d.ts +2 -0
- package/es/heatmap/styles/rtl.mjs +5 -0
- package/es/highlight/src/utils.mjs +10 -10
- package/es/icon/src/styles/index.cssr.mjs +0 -1
- package/es/image/index.d.ts +3 -1
- package/es/image/index.mjs +2 -1
- package/es/image/src/Image.d.ts +133 -23
- package/es/image/src/Image.mjs +48 -23
- package/es/image/src/ImageGroup.d.ts +200 -35
- package/es/image/src/ImageGroup.mjs +130 -26
- package/es/image/src/ImagePreview.d.ts +258 -23
- package/es/image/src/ImagePreview.mjs +84 -42
- package/es/image/src/interface.d.ts +42 -3
- package/es/image/src/public-types.d.ts +14 -0
- package/es/image/styles/light.d.ts +14 -1
- package/es/input/src/Input.d.ts +146 -12
- package/es/input/src/Input.mjs +6 -4
- package/es/input/src/InputGroupLabel.d.ts +129 -22
- package/es/input/src/InputGroupLabel.mjs +14 -8
- package/es/input/styles/dark.d.ts +139 -2
- package/es/input/styles/dark.mjs +114 -108
- package/es/input/styles/light.d.ts +76 -3
- package/es/input/styles/light.mjs +7 -2
- package/es/input-number/src/InputNumber.d.ts +152 -11
- package/es/input-number/styles/light.d.ts +14 -1
- package/es/input-otp/src/InputOtp.d.ts +158 -12
- package/es/input-otp/src/InputOtp.mjs +12 -4
- package/es/input-otp/src/public-types.d.ts +1 -0
- package/es/input-otp/src/styles/index.cssr.mjs +12 -3
- package/es/input-otp/styles/dark.mjs +1 -1
- package/es/input-otp/styles/light.d.ts +14 -1
- package/es/layout/src/LayoutSider.d.ts +1 -1
- package/es/legacy-transfer/src/Transfer.d.ts +154 -13
- package/es/legacy-transfer/src/TransferFilter.d.ts +52 -4
- package/es/legacy-transfer/src/TransferList.d.ts +52 -4
- package/es/legacy-transfer/src/TransferListItem.d.ts +52 -4
- package/es/legacy-transfer/styles/light.d.ts +14 -1
- package/es/locales/common/arDZ.mjs +6 -0
- package/es/locales/common/azAZ.mjs +6 -0
- package/es/locales/common/csCZ.mjs +6 -0
- package/es/locales/common/daDK.d.ts +3 -0
- package/es/locales/common/daDK.mjs +130 -0
- package/es/locales/common/deDE.mjs +6 -0
- package/es/locales/common/enGB.mjs +6 -0
- package/es/locales/common/enUS.d.ts +6 -0
- package/es/locales/common/enUS.mjs +6 -0
- package/es/locales/common/eo.mjs +6 -0
- package/es/locales/common/esAR.mjs +6 -0
- package/es/locales/common/etEE.mjs +6 -0
- package/es/locales/common/faIR.mjs +6 -0
- package/es/locales/common/frFR.mjs +6 -0
- package/es/locales/common/idID.mjs +6 -0
- package/es/locales/common/itIT.mjs +6 -0
- package/es/locales/common/jaJP.mjs +6 -0
- package/es/locales/common/kmKH.mjs +6 -0
- package/es/locales/common/koKR.mjs +6 -0
- package/es/locales/common/nbNO.mjs +6 -0
- package/es/locales/common/nlNL.mjs +6 -0
- package/es/locales/common/plPL.mjs +6 -0
- package/es/locales/common/ptBR.mjs +6 -0
- package/es/locales/common/ruRU.mjs +6 -0
- package/es/locales/common/skSK.mjs +6 -0
- package/es/locales/common/svSE.mjs +8 -2
- package/es/locales/common/thTH.mjs +6 -0
- package/es/locales/common/trTR.mjs +6 -0
- package/es/locales/common/ugCN.mjs +6 -0
- package/es/locales/common/ukUA.mjs +6 -0
- package/es/locales/common/uzUZ.mjs +6 -0
- package/es/locales/common/viVN.mjs +6 -0
- package/es/locales/common/zhCN.mjs +6 -0
- package/es/locales/common/zhTW.mjs +6 -0
- package/es/locales/date/daDK.d.ts +3 -0
- package/es/locales/date/daDK.mjs +6 -0
- package/es/locales/index.d.ts +2 -0
- package/es/locales/index.mjs +2 -0
- package/es/locales/utils/index.mjs +1 -1
- package/es/log/src/Log.d.ts +1 -1
- package/es/log/src/Log.mjs +1 -1
- package/es/marquee/src/Marquee.mjs +12 -10
- package/es/mention/src/Mention.d.ts +155 -14
- package/es/mention/styles/light.d.ts +14 -1
- package/es/menu/src/Menu.d.ts +314 -28
- package/es/menu/src/MenuOption.d.ts +113 -9
- package/es/menu/src/MenuOption.mjs +4 -3
- package/es/menu/src/MenuOptionContent.d.ts +1 -1
- package/es/menu/src/MenuOptionGroup.d.ts +1 -1
- package/es/menu/src/MenuOptionGroup.mjs +11 -4
- package/es/menu/src/Submenu.d.ts +114 -10
- package/es/menu/src/use-menu-child.d.ts +2 -0
- package/es/menu/src/use-menu-child.mjs +2 -1
- package/es/menu/styles/light.d.ts +33 -7
- package/es/message/src/Message.d.ts +1 -0
- package/es/message/src/Message.mjs +3 -1
- package/es/message/src/MessageProvider.d.ts +10 -1
- package/es/message/src/styles/index.cssr.mjs +1 -0
- package/es/message/styles/light.d.ts +1 -0
- package/es/message/styles/light.mjs +2 -1
- package/es/modal/src/BodyWrapper.d.ts +13 -7
- package/es/modal/src/BodyWrapper.mjs +4 -3
- package/es/modal/src/Modal.d.ts +32 -15
- package/es/modal/src/Modal.mjs +14 -6
- package/es/modal/src/ModalEnvironment.d.ts +22 -10
- package/es/modal/src/ModalEnvironment.mjs +1 -1
- package/es/modal/src/ModalProvider.d.ts +2 -1
- package/es/modal/src/ModalProvider.mjs +4 -2
- package/es/modal/src/presetProps.d.ts +3 -2
- package/es/modal/src/styles/index.cssr.mjs +4 -2
- package/es/notification/src/Notification.d.ts +2 -2
- package/es/notification/src/NotificationEnvironment.d.ts +1 -1
- package/es/notification/src/NotificationProvider.d.ts +5 -5
- package/es/number-animation/src/NumberAnimation.mjs +1 -1
- package/es/pagination/src/Pagination.d.ts +460 -33
- package/es/pagination/styles/light.d.ts +42 -3
- package/es/popconfirm/src/Popconfirm.d.ts +163 -22
- package/es/popconfirm/src/Popconfirm.mjs +3 -3
- package/es/popconfirm/src/PopconfirmPanel.d.ts +3 -3
- package/es/popconfirm/styles/light.d.ts +14 -1
- package/es/popover/src/Popover.d.ts +133 -16
- package/es/popover/src/PopoverBody.d.ts +129 -12
- package/es/popover/src/PopoverBody.mjs +8 -4
- package/es/popover/src/styles/index.cssr.mjs +1 -1
- package/es/popover/src/styles/rtl.cssr.d.ts +2 -0
- package/es/popover/src/styles/rtl.cssr.mjs +5 -0
- package/es/popover/styles/dark.mjs +4 -0
- package/es/popover/styles/index.d.ts +1 -0
- package/es/popover/styles/index.mjs +2 -1
- package/es/popover/styles/light.d.ts +27 -2
- package/es/popover/styles/light.mjs +7 -2
- package/es/popover/styles/rtl.d.ts +2 -0
- package/es/popover/styles/rtl.mjs +7 -0
- package/es/popselect/src/Popselect.d.ts +217 -76
- package/es/popselect/src/PopselectPanel.d.ts +55 -7
- package/es/popselect/styles/light.d.ts +14 -1
- package/es/progress/src/Circle.d.ts +1 -1
- package/es/progress/src/Circle.mjs +14 -3
- package/es/progress/src/Progress.d.ts +1 -1
- package/es/radio/src/Radio.mjs +5 -5
- package/es/radio/src/RadioButton.d.ts +2 -2
- package/es/radio/src/styles/radio.cssr.mjs +3 -7
- package/es/rate/src/Rate.d.ts +1 -1
- package/es/result/src/Result.d.ts +1 -1
- package/es/select/src/Select.d.ts +164 -21
- package/es/select/styles/light.d.ts +14 -1
- package/es/styles.d.ts +3 -3
- package/es/styles.mjs +3 -3
- package/es/tabs/src/Tab.d.ts +3 -3
- package/es/tabs/src/Tabs.d.ts +1 -1
- package/es/tabs/src/Tabs.mjs +1 -1
- package/es/tabs/src/styles/index.cssr.mjs +4 -4
- package/es/tag/src/Tag.d.ts +1 -1
- package/es/theme-editor/src/ThemeEditor.mjs +1 -1
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/time-picker/src/Panel.d.ts +59 -11
- package/es/time-picker/src/TimePicker.d.ts +156 -15
- package/es/time-picker/styles/light.d.ts +14 -1
- package/es/timeline/src/TimelineItem.d.ts +1 -1
- package/es/tooltip/src/Tooltip.d.ts +166 -25
- package/es/tooltip/styles/light.d.ts +16 -3
- package/es/transfer/src/Transfer.d.ts +154 -13
- package/es/transfer/src/TransferFilter.d.ts +52 -4
- package/es/transfer/src/TransferList.d.ts +52 -4
- package/es/transfer/src/TransferListItem.d.ts +52 -4
- package/es/transfer/styles/light.d.ts +14 -1
- package/es/tree/src/Tree.d.ts +42 -38
- package/es/tree/src/Tree.mjs +3 -1
- package/es/tree/src/TreeNode.d.ts +2 -2
- package/es/tree/src/TreeNodeContent.d.ts +3 -3
- package/es/tree/src/styles/index.cssr.mjs +7 -2
- package/es/tree/styles/light.d.ts +4 -4
- package/es/tree-select/src/TreeSelect.d.ts +172 -29
- package/es/tree-select/styles/index.d.ts +1 -0
- package/es/tree-select/styles/index.mjs +2 -1
- package/es/tree-select/styles/light.d.ts +22 -9
- package/es/tree-select/styles/rtl.d.ts +2 -0
- package/es/tree-select/styles/rtl.mjs +11 -0
- package/es/typography/src/create-header.d.ts +1 -1
- package/es/typography/src/headers.d.ts +6 -6
- package/es/upload/src/Upload.d.ts +1 -0
- package/es/upload/src/Upload.mjs +6 -3
- package/es/upload/src/UploadFile.d.ts +8 -6
- package/es/upload/src/UploadFile.mjs +1 -1
- package/es/upload/src/icons.d.ts +2 -2
- package/es/upload/src/icons.mjs +22 -18
- package/es/upload/src/styles/rtl.cssr.d.ts +2 -0
- package/es/upload/src/styles/rtl.cssr.mjs +5 -0
- package/es/upload/styles/index.d.ts +1 -0
- package/es/upload/styles/index.mjs +2 -1
- package/es/upload/styles/rtl.d.ts +2 -0
- package/es/upload/styles/rtl.mjs +5 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/virtual-list/src/VirtualList.d.ts +1 -1
- package/generic/AvatarGroup.vue +26 -0
- package/generic/index.ts +1 -0
- package/lib/_internal/icon/src/styles/index.cssr.js +0 -1
- package/lib/_internal/scrollbar/src/Scrollbar.d.ts +3 -3
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +4 -4
- package/lib/_internal/selection/src/Selection.d.ts +115 -13
- package/lib/_internal/selection/styles/light.d.ts +14 -1
- package/lib/_utils/index.d.ts +1 -0
- package/lib/_utils/naive/prop.d.ts +19 -10
- package/lib/_utils/naive/prop.js +21 -21
- package/lib/_utils/ts/ts.d.ts +3 -0
- package/lib/alert/src/Alert.d.ts +2 -2
- package/lib/anchor/index.d.ts +1 -0
- package/lib/anchor/src/AnchorAdapter.d.ts +1 -1
- package/lib/anchor/src/AnchorAdapter.js +17 -7
- package/lib/anchor/src/BaseAnchor.js +30 -5
- package/lib/anchor/src/Link.d.ts +3 -2
- package/lib/anchor/src/Link.js +4 -1
- package/lib/anchor/src/public-types.d.ts +5 -0
- package/lib/anchor/src/public-types.js +2 -0
- package/lib/auto-complete/src/AutoComplete.d.ts +155 -14
- package/lib/auto-complete/styles/light.d.ts +14 -1
- package/lib/avatar-group/index.d.ts +3 -2
- package/lib/avatar-group/src/AvatarGroup.d.ts +1 -4
- package/lib/avatar-group/src/generic-public-types.d.ts +18 -0
- package/lib/avatar-group/src/generic-public-types.js +2 -0
- package/lib/avatar-group/src/public-types.d.ts +10 -0
- package/lib/avatar-group/src/public-types.js +2 -0
- package/lib/back-top/src/BackTop.d.ts +1 -1
- package/lib/badge/src/Badge.d.ts +1 -1
- package/lib/button/src/Button.d.ts +1 -1
- package/lib/card/src/Card.d.ts +7 -2
- package/lib/card/src/Card.js +3 -2
- package/lib/carousel/src/Carousel.d.ts +4 -4
- package/lib/carousel/src/Carousel.js +19 -9
- package/lib/carousel/src/CarouselDots.d.ts +2 -2
- package/lib/cascader/src/Cascader.d.ts +163 -20
- package/lib/cascader/src/CascaderMenu.d.ts +56 -4
- package/lib/cascader/src/CascaderOption.d.ts +56 -4
- package/lib/cascader/src/CascaderSelectMenu.d.ts +57 -5
- package/lib/cascader/src/CascaderSubmenu.d.ts +56 -4
- package/lib/cascader/styles/light.d.ts +14 -1
- package/lib/color-picker/src/ColorInputUnit.d.ts +26 -2
- package/lib/color-picker/src/ColorPicker.d.ts +128 -11
- package/lib/color-picker/src/ColorPickerTrigger.js +2 -1
- package/lib/color-picker/src/utils.d.ts +2 -0
- package/lib/color-picker/src/utils.js +26 -0
- package/lib/color-picker/styles/light.d.ts +14 -1
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/ConfigProvider.d.ts +1 -1
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/src/DataTable.d.ts +674 -52
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +333 -25
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +332 -24
- package/lib/data-table/src/TableParts/Body.d.ts +332 -24
- package/lib/data-table/src/TableParts/Header.d.ts +332 -24
- package/lib/data-table/src/interface.d.ts +253 -18
- package/lib/data-table/src/use-sorter.d.ts +2 -5
- package/lib/data-table/src/use-table-data.d.ts +1 -4
- package/lib/data-table/src/utils.js +2 -1
- package/lib/data-table/styles/light.d.ts +84 -6
- package/lib/date-picker/src/DatePicker.d.ts +229 -23
- package/lib/date-picker/src/DatePicker.js +1 -1
- package/lib/date-picker/src/panel/date.d.ts +110 -10
- package/lib/date-picker/src/panel/daterange.d.ts +111 -11
- package/lib/date-picker/src/panel/datetime.d.ts +110 -10
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +111 -11
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +110 -10
- package/lib/date-picker/src/panel/monthrange.d.ts +111 -11
- package/lib/date-picker/src/panel/panelHeader.d.ts +436 -36
- package/lib/date-picker/src/panel/use-calendar.d.ts +109 -9
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +110 -10
- package/lib/date-picker/src/panel/use-dual-calendar.js +3 -3
- package/lib/date-picker/src/panel/use-panel-common.d.ts +109 -9
- package/lib/date-picker/src/panel/use-panel-common.js +1 -1
- package/lib/date-picker/src/props.d.ts +85 -7
- package/lib/date-picker/src/props.js +1 -1
- package/lib/date-picker/src/utils.d.ts +2 -1
- package/lib/date-picker/src/utils.js +5 -1
- package/lib/date-picker/styles/light.d.ts +28 -2
- package/lib/dialog/src/Dialog.d.ts +5 -2
- package/lib/dialog/src/Dialog.js +1 -1
- package/lib/dialog/src/DialogEnvironment.d.ts +11 -4
- package/lib/dialog/src/DialogEnvironment.js +3 -3
- package/lib/dialog/src/DialogProvider.d.ts +38 -34
- package/lib/dialog/src/dialogProps.d.ts +2 -1
- package/lib/dialog/src/dialogProps.js +2 -1
- package/lib/drawer/src/Drawer.d.ts +4 -4
- package/lib/drawer/src/DrawerBodyWrapper.d.ts +1 -1
- package/lib/dropdown/src/Dropdown.d.ts +162 -21
- package/lib/dropdown/src/DropdownMenu.d.ts +2 -2
- package/lib/dropdown/styles/light.d.ts +14 -1
- package/lib/dynamic-input/src/DynamicInput.d.ts +153 -12
- package/lib/dynamic-input/src/InputPreset.d.ts +52 -4
- package/lib/dynamic-input/src/PairPreset.d.ts +52 -4
- package/lib/dynamic-input/styles/light.d.ts +14 -1
- package/lib/dynamic-tags/src/DynamicTags.d.ts +153 -12
- package/lib/dynamic-tags/styles/light.d.ts +14 -1
- package/lib/ellipsis/src/Ellipsis.d.ts +154 -11
- package/lib/ellipsis/src/PerformantEllipsis.d.ts +84 -6
- package/lib/ellipsis/src/PerformantEllipsis.js +17 -7
- package/lib/ellipsis/styles/light.d.ts +14 -1
- package/lib/empty/src/Empty.d.ts +1 -1
- package/lib/form/src/FormItem.d.ts +8 -2
- package/lib/form/src/FormItem.js +3 -2
- package/lib/form/src/FormItemCol.d.ts +7 -1
- package/lib/form/src/FormItemCol.js +17 -7
- package/lib/form/src/FormItemGridItem.d.ts +7 -1
- package/lib/form/src/FormItemGridItem.js +17 -7
- package/lib/form/src/FormItemRow.d.ts +7 -1
- package/lib/form/src/FormItemRow.js +17 -7
- package/lib/form/src/utils.d.ts +1 -1
- package/lib/gradient-text/src/GradientText.d.ts +2 -2
- package/lib/grid/src/GridItem.d.ts +1 -1
- package/lib/heatmap/index.d.ts +6 -0
- package/lib/heatmap/index.js +27 -0
- package/lib/heatmap/src/ColorIndicator.d.ts +25 -0
- package/lib/heatmap/src/ColorIndicator.js +27 -0
- package/lib/heatmap/src/Heatmap.d.ts +385 -0
- package/lib/heatmap/src/Heatmap.js +248 -0
- package/lib/heatmap/src/Rect.d.ts +57 -0
- package/lib/heatmap/src/Rect.js +64 -0
- package/lib/heatmap/src/animationStyle.d.ts +6 -0
- package/lib/heatmap/src/animationStyle.js +52 -0
- package/lib/heatmap/src/interface.d.ts +7 -0
- package/lib/heatmap/src/interface.js +2 -0
- package/lib/heatmap/src/public-types.d.ts +16 -0
- package/lib/heatmap/src/public-types.js +2 -0
- package/lib/heatmap/src/styles/index.cssr.d.ts +2 -0
- package/lib/heatmap/src/styles/index.cssr.js +107 -0
- package/lib/heatmap/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/heatmap/src/styles/rtl.cssr.js +9 -0
- package/lib/heatmap/src/theme.d.ts +8 -0
- package/lib/heatmap/src/theme.js +10 -0
- package/lib/heatmap/src/utils/index.d.ts +32 -0
- package/lib/heatmap/src/utils/index.js +135 -0
- package/lib/heatmap/styles/dark.d.ts +3 -0
- package/lib/heatmap/styles/dark.js +13 -0
- package/lib/heatmap/styles/index.d.ts +3 -0
- package/lib/heatmap/styles/index.js +10 -0
- package/lib/heatmap/styles/light.d.ts +31 -0
- package/lib/heatmap/styles/light.js +39 -0
- package/lib/heatmap/styles/rtl.d.ts +2 -0
- package/lib/heatmap/styles/rtl.js +11 -0
- package/lib/highlight/src/utils.js +10 -21
- package/lib/icon/src/styles/index.cssr.js +0 -1
- package/lib/image/index.d.ts +3 -1
- package/lib/image/index.js +4 -1
- package/lib/image/src/Image.d.ts +133 -23
- package/lib/image/src/Image.js +43 -23
- package/lib/image/src/ImageGroup.d.ts +200 -35
- package/lib/image/src/ImageGroup.js +111 -26
- package/lib/image/src/ImagePreview.d.ts +258 -23
- package/lib/image/src/ImagePreview.js +60 -33
- package/lib/image/src/interface.d.ts +42 -3
- package/lib/image/src/public-types.d.ts +14 -0
- package/lib/image/styles/light.d.ts +14 -1
- package/lib/input/src/Input.d.ts +146 -12
- package/lib/input/src/Input.js +24 -12
- package/lib/input/src/InputGroupLabel.d.ts +129 -22
- package/lib/input/src/InputGroupLabel.js +8 -6
- package/lib/input/styles/dark.d.ts +139 -2
- package/lib/input/styles/dark.js +35 -29
- package/lib/input/styles/light.d.ts +76 -3
- package/lib/input/styles/light.js +7 -2
- package/lib/input-number/src/InputNumber.d.ts +152 -11
- package/lib/input-number/styles/light.d.ts +14 -1
- package/lib/input-otp/src/InputOtp.d.ts +158 -12
- package/lib/input-otp/src/InputOtp.js +12 -16
- package/lib/input-otp/src/public-types.d.ts +1 -0
- package/lib/input-otp/src/styles/index.cssr.js +11 -2
- package/lib/input-otp/styles/dark.js +1 -1
- package/lib/input-otp/styles/light.d.ts +14 -1
- package/lib/layout/src/LayoutSider.d.ts +1 -1
- package/lib/legacy-transfer/src/Transfer.d.ts +154 -13
- package/lib/legacy-transfer/src/TransferFilter.d.ts +52 -4
- package/lib/legacy-transfer/src/TransferList.d.ts +52 -4
- package/lib/legacy-transfer/src/TransferListItem.d.ts +52 -4
- package/lib/legacy-transfer/styles/light.d.ts +14 -1
- package/lib/locales/common/arDZ.js +6 -0
- package/lib/locales/common/azAZ.js +6 -0
- package/lib/locales/common/csCZ.js +6 -0
- package/lib/locales/common/daDK.d.ts +3 -0
- package/lib/locales/common/daDK.js +132 -0
- package/lib/locales/common/deDE.js +6 -0
- package/lib/locales/common/enGB.js +6 -0
- package/lib/locales/common/enUS.d.ts +6 -0
- package/lib/locales/common/enUS.js +6 -0
- package/lib/locales/common/eo.js +6 -0
- package/lib/locales/common/esAR.js +6 -0
- package/lib/locales/common/etEE.js +6 -0
- package/lib/locales/common/faIR.js +6 -0
- package/lib/locales/common/frFR.js +6 -0
- package/lib/locales/common/idID.js +6 -0
- package/lib/locales/common/itIT.js +6 -0
- package/lib/locales/common/jaJP.js +6 -0
- package/lib/locales/common/kmKH.js +6 -0
- package/lib/locales/common/koKR.js +6 -0
- package/lib/locales/common/nbNO.js +6 -0
- package/lib/locales/common/nlNL.js +6 -0
- package/lib/locales/common/plPL.js +6 -0
- package/lib/locales/common/ptBR.js +6 -0
- package/lib/locales/common/ruRU.js +6 -0
- package/lib/locales/common/skSK.js +6 -0
- package/lib/locales/common/svSE.js +8 -2
- package/lib/locales/common/thTH.js +6 -0
- package/lib/locales/common/trTR.js +6 -0
- package/lib/locales/common/ugCN.js +6 -0
- package/lib/locales/common/ukUA.js +6 -0
- package/lib/locales/common/uzUZ.js +6 -0
- package/lib/locales/common/viVN.js +6 -0
- package/lib/locales/common/zhCN.js +6 -0
- package/lib/locales/common/zhTW.js +6 -0
- package/lib/locales/date/daDK.d.ts +3 -0
- package/lib/locales/date/daDK.js +8 -0
- package/lib/locales/index.d.ts +2 -0
- package/lib/locales/index.js +6 -2
- package/lib/log/src/Log.d.ts +1 -1
- package/lib/marquee/src/Marquee.js +4 -3
- package/lib/mention/src/Mention.d.ts +155 -14
- package/lib/mention/styles/light.d.ts +14 -1
- package/lib/menu/src/Menu.d.ts +314 -28
- package/lib/menu/src/MenuOption.d.ts +113 -9
- package/lib/menu/src/MenuOption.js +6 -4
- package/lib/menu/src/MenuOptionContent.d.ts +1 -1
- package/lib/menu/src/MenuOptionGroup.d.ts +1 -1
- package/lib/menu/src/MenuOptionGroup.js +8 -2
- package/lib/menu/src/Submenu.d.ts +114 -10
- package/lib/menu/src/use-menu-child.d.ts +2 -0
- package/lib/menu/src/use-menu-child.js +2 -1
- package/lib/menu/styles/light.d.ts +28 -2
- package/lib/message/src/Message.d.ts +1 -0
- package/lib/message/src/Message.js +3 -2
- package/lib/message/src/MessageProvider.d.ts +10 -1
- package/lib/message/src/styles/index.cssr.js +1 -0
- package/lib/message/styles/light.d.ts +1 -0
- package/lib/message/styles/light.js +1 -1
- package/lib/modal/src/BodyWrapper.d.ts +10 -4
- package/lib/modal/src/BodyWrapper.js +7 -3
- package/lib/modal/src/Modal.d.ts +28 -11
- package/lib/modal/src/Modal.js +10 -4
- package/lib/modal/src/ModalEnvironment.d.ts +22 -10
- package/lib/modal/src/ModalEnvironment.js +18 -8
- package/lib/modal/src/ModalProvider.d.ts +2 -1
- package/lib/modal/src/ModalProvider.js +4 -2
- package/lib/modal/src/presetProps.d.ts +2 -1
- package/lib/modal/src/styles/index.cssr.js +3 -1
- package/lib/notification/src/Notification.d.ts +2 -2
- package/lib/notification/src/NotificationEnvironment.d.ts +1 -1
- package/lib/notification/src/NotificationProvider.d.ts +5 -5
- package/lib/pagination/src/Pagination.d.ts +460 -33
- package/lib/pagination/styles/light.d.ts +42 -3
- package/lib/popconfirm/src/Popconfirm.d.ts +159 -18
- package/lib/popconfirm/src/Popconfirm.js +20 -15
- package/lib/popconfirm/src/PopconfirmPanel.d.ts +1 -1
- package/lib/popconfirm/styles/light.d.ts +14 -1
- package/lib/popover/src/Popover.d.ts +133 -16
- package/lib/popover/src/Popover.js +17 -7
- package/lib/popover/src/PopoverBody.d.ts +129 -12
- package/lib/popover/src/PopoverBody.js +5 -2
- package/lib/popover/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/popover/src/styles/rtl.cssr.js +10 -0
- package/lib/popover/styles/dark.js +4 -0
- package/lib/popover/styles/index.d.ts +1 -0
- package/lib/popover/styles/index.js +3 -1
- package/lib/popover/styles/light.d.ts +27 -2
- package/lib/popover/styles/light.js +7 -2
- package/lib/popover/styles/rtl.d.ts +2 -0
- package/lib/popover/styles/rtl.js +13 -0
- package/lib/popselect/src/Popselect.d.ts +213 -72
- package/lib/popselect/src/Popselect.js +17 -7
- package/lib/popselect/src/PopselectPanel.d.ts +55 -7
- package/lib/popselect/styles/light.d.ts +14 -1
- package/lib/preset.js +17 -7
- package/lib/progress/src/Circle.d.ts +1 -1
- package/lib/progress/src/Circle.js +11 -2
- package/lib/progress/src/Progress.d.ts +1 -1
- package/lib/radio/src/Radio.js +2 -2
- package/lib/radio/src/RadioButton.d.ts +2 -2
- package/lib/radio/src/styles/radio.cssr.js +3 -7
- package/lib/rate/src/Rate.d.ts +1 -1
- package/lib/result/src/Result.d.ts +1 -1
- package/lib/select/src/Select.d.ts +164 -21
- package/lib/select/styles/light.d.ts +14 -1
- package/lib/styles.d.ts +3 -3
- package/lib/styles.js +5 -2
- package/lib/tabs/src/Tab.d.ts +3 -3
- package/lib/tabs/src/Tabs.d.ts +1 -1
- package/lib/tabs/src/styles/index.cssr.js +4 -4
- package/lib/tag/src/Tag.d.ts +1 -1
- package/lib/themes/dark.js +103 -101
- package/lib/themes/light.js +102 -100
- package/lib/time-picker/src/Panel.d.ts +59 -11
- package/lib/time-picker/src/TimePicker.d.ts +156 -15
- package/lib/time-picker/styles/light.d.ts +14 -1
- package/lib/timeline/src/TimelineItem.d.ts +1 -1
- package/lib/tooltip/src/Tooltip.d.ts +159 -18
- package/lib/tooltip/styles/light.d.ts +14 -1
- package/lib/transfer/src/Transfer.d.ts +154 -13
- package/lib/transfer/src/TransferFilter.d.ts +52 -4
- package/lib/transfer/src/TransferList.d.ts +52 -4
- package/lib/transfer/src/TransferListItem.d.ts +52 -4
- package/lib/transfer/styles/light.d.ts +14 -1
- package/lib/tree/src/Tree.d.ts +42 -38
- package/lib/tree/src/Tree.js +4 -3
- package/lib/tree/src/TreeNode.d.ts +2 -2
- package/lib/tree/src/TreeNodeContent.d.ts +3 -3
- package/lib/tree/src/styles/index.cssr.js +7 -2
- package/lib/tree-select/src/TreeSelect.d.ts +169 -26
- package/lib/tree-select/styles/index.d.ts +1 -0
- package/lib/tree-select/styles/index.js +3 -1
- package/lib/tree-select/styles/light.d.ts +14 -1
- package/lib/tree-select/styles/rtl.d.ts +2 -0
- package/lib/tree-select/styles/rtl.js +20 -0
- package/lib/typography/src/create-header.d.ts +1 -1
- package/lib/typography/src/headers.d.ts +6 -6
- package/lib/upload/src/Upload.d.ts +1 -0
- package/lib/upload/src/Upload.js +4 -3
- package/lib/upload/src/UploadFile.d.ts +4 -2
- package/lib/upload/src/UploadFile.js +1 -1
- package/lib/upload/src/icons.d.ts +2 -2
- package/lib/upload/src/icons.js +12 -7
- package/lib/upload/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/upload/src/styles/rtl.cssr.js +10 -0
- package/lib/upload/styles/index.d.ts +1 -0
- package/lib/upload/styles/index.js +3 -1
- package/lib/upload/styles/rtl.d.ts +2 -0
- package/lib/upload/styles/rtl.js +11 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual-list/src/VirtualList.d.ts +1 -1
- package/package.json +30 -19
- package/volar.d.ts +24 -22
- package/web-types.json +599 -61
- package/es/avatar-group/src/interface.d.ts +0 -8
- package/lib/avatar-group/src/interface.d.ts +0 -8
- /package/es/{avatar-group/src/interface.mjs → _utils/ts/ts.mjs} +0 -0
- /package/lib/{avatar-group/src/interface.js → _utils/ts/ts.js} +0 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { addDays, format, parseISO, startOfWeek } from 'date-fns';
|
|
2
|
+
import { groupBy, mapValues, maxBy } from 'lodash';
|
|
3
|
+
import { pxfy } from 'seemly';
|
|
4
|
+
import { computed, defineComponent, h } from 'vue';
|
|
5
|
+
import { useConfig, useLocale, useRtl, useTheme, useThemeClass } from "../../_mixins/index.mjs";
|
|
6
|
+
import { createKey, resolveSlot, resolveWrappedSlot } from "../../_utils/index.mjs";
|
|
7
|
+
import { transformNaiveFirstDayOfWeekToDateFns } from "../../date-picker/src/utils.mjs";
|
|
8
|
+
import heatmapLight from "../styles/light.mjs";
|
|
9
|
+
import { useLoadingStyleClass } from "./animationStyle.mjs";
|
|
10
|
+
import HeatmapColorIndicator from "./ColorIndicator.mjs";
|
|
11
|
+
import Rect from "./Rect.mjs";
|
|
12
|
+
import style from "./styles/index.cssr.mjs";
|
|
13
|
+
import { heatmapColorThemes } from "./theme.mjs";
|
|
14
|
+
import { completeDataGaps, createDayRect, createLoadingMatrix, createSparseMatrix } from "./utils/index.mjs";
|
|
15
|
+
export const heatmapProps = Object.assign(Object.assign({}, useTheme.props), {
|
|
16
|
+
activeColors: Array,
|
|
17
|
+
colorTheme: String,
|
|
18
|
+
data: Array,
|
|
19
|
+
loadingData: Object,
|
|
20
|
+
fillCalendarLeading: Boolean,
|
|
21
|
+
firstDayOfWeek: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0
|
|
24
|
+
},
|
|
25
|
+
loading: Boolean,
|
|
26
|
+
minimumColor: String,
|
|
27
|
+
showColorIndicator: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
showWeekLabels: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
showMonthLabels: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'medium'
|
|
42
|
+
},
|
|
43
|
+
tooltip: {
|
|
44
|
+
type: [Boolean, Object],
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
xGap: [Number, String],
|
|
48
|
+
yGap: [Number, String]
|
|
49
|
+
});
|
|
50
|
+
export default defineComponent({
|
|
51
|
+
name: 'Heatmap',
|
|
52
|
+
slots: Object,
|
|
53
|
+
props: heatmapProps,
|
|
54
|
+
setup(props) {
|
|
55
|
+
const {
|
|
56
|
+
mergedClsPrefixRef,
|
|
57
|
+
mergedRtlRef,
|
|
58
|
+
inlineThemeDisabled
|
|
59
|
+
} = useConfig(props);
|
|
60
|
+
const {
|
|
61
|
+
localeRef,
|
|
62
|
+
dateLocaleRef
|
|
63
|
+
} = useLocale('Heatmap');
|
|
64
|
+
const themeRef = useTheme('Heatmap', '-heatmap', style, heatmapLight, props, mergedClsPrefixRef);
|
|
65
|
+
const rtlEnabledRef = useRtl('Heatmap', mergedRtlRef, mergedClsPrefixRef);
|
|
66
|
+
const cssVarsRef = computed(() => {
|
|
67
|
+
const {
|
|
68
|
+
xGap,
|
|
69
|
+
yGap,
|
|
70
|
+
size
|
|
71
|
+
} = props;
|
|
72
|
+
const {
|
|
73
|
+
common: {
|
|
74
|
+
cubicBezierEaseInOut
|
|
75
|
+
},
|
|
76
|
+
self: {
|
|
77
|
+
fontWeight,
|
|
78
|
+
textColor,
|
|
79
|
+
borderColor,
|
|
80
|
+
loadingColorStart,
|
|
81
|
+
[createKey('rectSize', size)]: rectSize,
|
|
82
|
+
[createKey('borderRadius', size)]: sizeBorderRadius,
|
|
83
|
+
[createKey('xGap', size)]: defaultXGap,
|
|
84
|
+
[createKey('yGap', size)]: defaultYGap,
|
|
85
|
+
[createKey('fontSize', size)]: fontSize
|
|
86
|
+
}
|
|
87
|
+
} = themeRef.value;
|
|
88
|
+
const cssVars = {
|
|
89
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
90
|
+
'--n-font-size': fontSize,
|
|
91
|
+
'--n-font-weight': fontWeight,
|
|
92
|
+
'--n-text-color': textColor,
|
|
93
|
+
'--n-border-radius': sizeBorderRadius,
|
|
94
|
+
'--n-border-color': borderColor,
|
|
95
|
+
'--n-loading-color-start': loadingColorStart,
|
|
96
|
+
'--n-rect-size': rectSize,
|
|
97
|
+
'--n-x-gap': xGap !== undefined ? typeof xGap === 'number' ? pxfy(xGap) : xGap : defaultXGap,
|
|
98
|
+
'--n-y-gap': yGap !== undefined ? typeof yGap === 'number' ? pxfy(yGap) : yGap : defaultYGap
|
|
99
|
+
};
|
|
100
|
+
return cssVars;
|
|
101
|
+
});
|
|
102
|
+
const themeClassHandle = inlineThemeDisabled ? useThemeClass('heatmap', computed(() => {
|
|
103
|
+
const {
|
|
104
|
+
size
|
|
105
|
+
} = props;
|
|
106
|
+
return size[0];
|
|
107
|
+
}), cssVarsRef, props) : undefined;
|
|
108
|
+
const mergedColorsRef = computed(() => {
|
|
109
|
+
const {
|
|
110
|
+
mininumColor: builtInMinimumColor,
|
|
111
|
+
activeColors: builtInActiveColors
|
|
112
|
+
} = themeRef.value.self;
|
|
113
|
+
const mergedMininumColor = props.minimumColor || builtInMinimumColor;
|
|
114
|
+
const theme = props.colorTheme && heatmapColorThemes[props.colorTheme];
|
|
115
|
+
const mergedActiveColors = props.activeColors || theme || builtInActiveColors;
|
|
116
|
+
return [mergedMininumColor, ...mergedActiveColors];
|
|
117
|
+
});
|
|
118
|
+
const normalizedDataRef = computed(() => {
|
|
119
|
+
if (!props.data || props.data.length === 0) {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
122
|
+
return completeDataGaps(props.data, transformNaiveFirstDayOfWeekToDateFns(props.firstDayOfWeek), props.fillCalendarLeading);
|
|
123
|
+
});
|
|
124
|
+
const normalizedLoadingDataRef = computed(() => {
|
|
125
|
+
if (!props.loadingData || props.loadingData.length === 0) {
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
return completeDataGaps(props.loadingData, transformNaiveFirstDayOfWeekToDateFns(props.firstDayOfWeek), props.fillCalendarLeading);
|
|
129
|
+
});
|
|
130
|
+
const maxValueRef = computed(() => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const validData = normalizedDataRef.value.filter(d => d.value !== null);
|
|
133
|
+
return (_b = (_a = maxBy(validData, d => d.value)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
|
|
134
|
+
});
|
|
135
|
+
const heatmapMatrixRef = computed(() => {
|
|
136
|
+
const data = normalizedDataRef.value;
|
|
137
|
+
const loadingData = normalizedLoadingDataRef.value;
|
|
138
|
+
if (props.loading && !loadingData.length) {
|
|
139
|
+
return createLoadingMatrix(transformNaiveFirstDayOfWeekToDateFns(props.firstDayOfWeek));
|
|
140
|
+
}
|
|
141
|
+
const finalData = props.loading ? loadingData : data;
|
|
142
|
+
if (!finalData.length) return [];
|
|
143
|
+
const maxValue = maxValueRef.value;
|
|
144
|
+
const colors = mergedColorsRef.value;
|
|
145
|
+
const calendarStartDate = finalData[0].timestamp;
|
|
146
|
+
const dayRects = finalData.map(item => createDayRect(item, calendarStartDate, transformNaiveFirstDayOfWeekToDateFns(props.firstDayOfWeek), colors, maxValue));
|
|
147
|
+
return createSparseMatrix(7, dayRects, dayRect => dayRect.rowIndex, dayRect => dayRect.colIndex);
|
|
148
|
+
});
|
|
149
|
+
const weekLabelsRef = computed(() => {
|
|
150
|
+
const {
|
|
151
|
+
weekdayFormat
|
|
152
|
+
} = localeRef.value;
|
|
153
|
+
const {
|
|
154
|
+
locale
|
|
155
|
+
} = dateLocaleRef.value;
|
|
156
|
+
const baseDate = startOfWeek(new Date(), {
|
|
157
|
+
weekStartsOn: transformNaiveFirstDayOfWeekToDateFns(props.firstDayOfWeek)
|
|
158
|
+
});
|
|
159
|
+
return Array.from({
|
|
160
|
+
length: 7
|
|
161
|
+
}, (_, i) => {
|
|
162
|
+
return {
|
|
163
|
+
label: format(addDays(baseDate, i), weekdayFormat, {
|
|
164
|
+
locale
|
|
165
|
+
}),
|
|
166
|
+
visible: i % 2 !== 0
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
const loadingMonthLabelsRef = computed(() => {
|
|
171
|
+
const {
|
|
172
|
+
monthFormat
|
|
173
|
+
} = localeRef.value;
|
|
174
|
+
const {
|
|
175
|
+
locale
|
|
176
|
+
} = dateLocaleRef.value;
|
|
177
|
+
const currentYear = new Date().getFullYear();
|
|
178
|
+
// for more consistent month label widths
|
|
179
|
+
const colSpans = [5, 4, 5, 4, 5, 4, 5, 4, 4, 5, 4, 4];
|
|
180
|
+
return Array.from({
|
|
181
|
+
length: 12
|
|
182
|
+
}, (_, i) => {
|
|
183
|
+
const monthDate = new Date(currentYear, i, 1);
|
|
184
|
+
return {
|
|
185
|
+
name: format(monthDate, monthFormat, {
|
|
186
|
+
locale
|
|
187
|
+
}),
|
|
188
|
+
colSpan: colSpans[i]
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
function getColsMonth(matrix) {
|
|
193
|
+
const cols = matrix[0].length;
|
|
194
|
+
const res = [];
|
|
195
|
+
for (let col = 0; col < cols; col++) {
|
|
196
|
+
for (let row = 0; row < matrix.length; row++) {
|
|
197
|
+
const cell = matrix[row][col];
|
|
198
|
+
if ((cell === null || cell === void 0 ? void 0 : cell.value) !== null) {
|
|
199
|
+
res.push({
|
|
200
|
+
week: col,
|
|
201
|
+
month: format(cell.timestamp, 'yyyy-MM')
|
|
202
|
+
});
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return res;
|
|
208
|
+
}
|
|
209
|
+
const dataMonthLabelsRef = computed(() => {
|
|
210
|
+
const {
|
|
211
|
+
monthFormat
|
|
212
|
+
} = localeRef.value;
|
|
213
|
+
const {
|
|
214
|
+
locale
|
|
215
|
+
} = dateLocaleRef.value;
|
|
216
|
+
const matrix = heatmapMatrixRef.value;
|
|
217
|
+
if (!matrix || matrix.length === 0 || !matrix[0]) {
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
const colsWithMonth = getColsMonth(matrix);
|
|
221
|
+
const monthStats = mapValues(groupBy(colsWithMonth, 'month'), entries => {
|
|
222
|
+
const weekNumbers = entries.map(e => e.week);
|
|
223
|
+
return {
|
|
224
|
+
weekCount: entries.length,
|
|
225
|
+
start: Math.min(...weekNumbers),
|
|
226
|
+
end: Math.max(...weekNumbers)
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
return Object.entries(monthStats).filter(([, stats]) => stats.weekCount >= 3) // ensure have enough space
|
|
230
|
+
.sort(([a], [b]) => a.localeCompare(b)).map(([month, stats]) => {
|
|
231
|
+
const monthDate = new Date(parseISO(`${month}-01`));
|
|
232
|
+
return {
|
|
233
|
+
name: format(monthDate, monthFormat, {
|
|
234
|
+
locale
|
|
235
|
+
}),
|
|
236
|
+
colSpan: stats.end - stats.start + 1
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
const monthLabelsRef = computed(() => {
|
|
241
|
+
return props.loading && !props.loadingData ? loadingMonthLabelsRef.value : dataMonthLabelsRef.value;
|
|
242
|
+
});
|
|
243
|
+
const loadingClassRef = useLoadingStyleClass(props, themeRef);
|
|
244
|
+
return {
|
|
245
|
+
weekLabels: weekLabelsRef,
|
|
246
|
+
monthLabels: monthLabelsRef,
|
|
247
|
+
mergedColors: mergedColorsRef,
|
|
248
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
249
|
+
rtlEnabled: rtlEnabledRef,
|
|
250
|
+
locale: localeRef,
|
|
251
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
252
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
253
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
254
|
+
heatmapMatrix: heatmapMatrixRef,
|
|
255
|
+
loadingClass: loadingClassRef
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
render() {
|
|
259
|
+
const {
|
|
260
|
+
loading,
|
|
261
|
+
showWeekLabels,
|
|
262
|
+
showMonthLabels,
|
|
263
|
+
showColorIndicator,
|
|
264
|
+
mergedClsPrefix,
|
|
265
|
+
themeClass,
|
|
266
|
+
cssVars,
|
|
267
|
+
rtlEnabled,
|
|
268
|
+
locale,
|
|
269
|
+
weekLabels,
|
|
270
|
+
monthLabels,
|
|
271
|
+
mergedColors,
|
|
272
|
+
$slots,
|
|
273
|
+
heatmapMatrix,
|
|
274
|
+
loadingClass,
|
|
275
|
+
onRender
|
|
276
|
+
} = this;
|
|
277
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
278
|
+
return h("div", {
|
|
279
|
+
class: [themeClass, `${mergedClsPrefix}-heatmap`, rtlEnabled && `${mergedClsPrefix}-heatmap--rtl`],
|
|
280
|
+
style: cssVars
|
|
281
|
+
}, h("div", {
|
|
282
|
+
class: `${mergedClsPrefix}-heatmap__content`
|
|
283
|
+
}, h("table", {
|
|
284
|
+
class: `${mergedClsPrefix}-heatmap__calendar-table`
|
|
285
|
+
}, showMonthLabels && h("thead", null, h("tr", null, showWeekLabels && h("th", {
|
|
286
|
+
class: `${mergedClsPrefix}-heatmap__week-header-cell`
|
|
287
|
+
}), monthLabels.map((monthLabel, index) => h("th", {
|
|
288
|
+
key: `month-${index}`,
|
|
289
|
+
colspan: monthLabel.colSpan,
|
|
290
|
+
class: `${mergedClsPrefix}-heatmap__month-label-cell`
|
|
291
|
+
}, monthLabel.name)))), h("tbody", null, weekLabels.map((weekLabel, rowIdx) => {
|
|
292
|
+
return h("tr", {
|
|
293
|
+
key: `row-${rowIdx}`
|
|
294
|
+
}, showWeekLabels && h("td", {
|
|
295
|
+
class: `${mergedClsPrefix}-heatmap__week-label-cell`
|
|
296
|
+
}, weekLabel.visible ? weekLabel.label : null), (heatmapMatrix[rowIdx] || []).map((day, weekIdx) => {
|
|
297
|
+
return day.value !== null ? h("td", {
|
|
298
|
+
key: `day-${rowIdx}-${weekIdx}`,
|
|
299
|
+
class: `${mergedClsPrefix}-heatmap__day-cell`
|
|
300
|
+
}, h(Rect, {
|
|
301
|
+
mergedClsPrefix: mergedClsPrefix,
|
|
302
|
+
data: day,
|
|
303
|
+
color: day.color,
|
|
304
|
+
tooltip: this.tooltip,
|
|
305
|
+
loading: loading,
|
|
306
|
+
loadingClass: loadingClass
|
|
307
|
+
}, {
|
|
308
|
+
tooltip: () => {
|
|
309
|
+
var _a;
|
|
310
|
+
return (_a = $slots.tooltip) === null || _a === void 0 ? void 0 : _a.call($slots, day);
|
|
311
|
+
}
|
|
312
|
+
})) : h("td", {
|
|
313
|
+
key: `empty-${rowIdx}-${weekIdx}`,
|
|
314
|
+
class: `${mergedClsPrefix}-heatmap__day-cell`
|
|
315
|
+
}, h("div", {
|
|
316
|
+
class: `${mergedClsPrefix}-heatmap__empty-cell`
|
|
317
|
+
}));
|
|
318
|
+
}));
|
|
319
|
+
})))), h("div", {
|
|
320
|
+
class: `${mergedClsPrefix}-heatmap__footer`
|
|
321
|
+
}, resolveWrappedSlot($slots.footer, children => children && h("div", {
|
|
322
|
+
class: `${mergedClsPrefix}-heatmap__footer`
|
|
323
|
+
}, children)), h("div", {
|
|
324
|
+
class: `${mergedClsPrefix}-heatmap__indicator`
|
|
325
|
+
}, resolveSlot($slots.indicator, () => [showColorIndicator && h(HeatmapColorIndicator, {
|
|
326
|
+
colors: mergedColors,
|
|
327
|
+
clsPrefix: mergedClsPrefix
|
|
328
|
+
}, {
|
|
329
|
+
'leading-text': () => resolveSlot($slots['indicator-leading-text'], () => [locale.less]),
|
|
330
|
+
'trailing-text': () => resolveSlot($slots['indicator-trailing-text'], () => [locale.more])
|
|
331
|
+
})]))));
|
|
332
|
+
}
|
|
333
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { PropType, SlotsType, VNode } from 'vue';
|
|
2
|
+
import type { PopoverProps } from '../../popover/src/Popover';
|
|
3
|
+
import type { HeatmapDataItem } from './public-types';
|
|
4
|
+
export interface RectSlots {
|
|
5
|
+
tooltip?: (props: HeatmapDataItem) => VNode[];
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
mergedClsPrefix: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
data: {
|
|
13
|
+
type: PropType<HeatmapDataItem>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
color: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
style: ObjectConstructor;
|
|
21
|
+
loading: BooleanConstructor;
|
|
22
|
+
loadingClass: StringConstructor;
|
|
23
|
+
tooltip: {
|
|
24
|
+
type: PropType<PopoverProps | boolean>;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>, {
|
|
28
|
+
cssVars: import("vue").ComputedRef<{
|
|
29
|
+
'--n-rect-color': string;
|
|
30
|
+
}>;
|
|
31
|
+
tooltipProps: import("vue").ComputedRef<PopoverProps>;
|
|
32
|
+
defaultTooltipContent: import("vue").ComputedRef<string>;
|
|
33
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
|
+
mergedClsPrefix: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
data: {
|
|
39
|
+
type: PropType<HeatmapDataItem>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
color: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
style: ObjectConstructor;
|
|
47
|
+
loading: BooleanConstructor;
|
|
48
|
+
loadingClass: StringConstructor;
|
|
49
|
+
tooltip: {
|
|
50
|
+
type: PropType<PopoverProps | boolean>;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{}>, {
|
|
54
|
+
tooltip: boolean | PopoverProps;
|
|
55
|
+
loading: boolean;
|
|
56
|
+
}, SlotsType<RectSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { computed, defineComponent, h } from 'vue';
|
|
2
|
+
import { resolveSlotWithTypedProps } from "../../_utils/index.mjs";
|
|
3
|
+
import Tooltip from "../../tooltip/src/Tooltip.mjs";
|
|
4
|
+
export default defineComponent({
|
|
5
|
+
name: 'HeatmapRect',
|
|
6
|
+
slots: Object,
|
|
7
|
+
props: {
|
|
8
|
+
mergedClsPrefix: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
style: Object,
|
|
21
|
+
loading: Boolean,
|
|
22
|
+
loadingClass: String,
|
|
23
|
+
tooltip: {
|
|
24
|
+
type: [Boolean, Object],
|
|
25
|
+
default: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(props) {
|
|
29
|
+
const cssVarsRef = computed(() => ({
|
|
30
|
+
'--n-rect-color': props.color
|
|
31
|
+
}));
|
|
32
|
+
const tooltipPropsRef = computed(() => {
|
|
33
|
+
return typeof props.tooltip === 'object' ? props.tooltip : {};
|
|
34
|
+
});
|
|
35
|
+
const defaultTooltipContentRef = computed(() => {
|
|
36
|
+
const date = new Date(props.data.timestamp).toLocaleDateString();
|
|
37
|
+
return props.data.value !== null ? `${date} ${props.data.value}` : date;
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
cssVars: cssVarsRef,
|
|
41
|
+
tooltipProps: tooltipPropsRef,
|
|
42
|
+
defaultTooltipContent: defaultTooltipContentRef
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
render() {
|
|
46
|
+
const {
|
|
47
|
+
mergedClsPrefix,
|
|
48
|
+
style,
|
|
49
|
+
cssVars,
|
|
50
|
+
tooltip,
|
|
51
|
+
tooltipProps,
|
|
52
|
+
defaultTooltipContent,
|
|
53
|
+
loading,
|
|
54
|
+
data
|
|
55
|
+
} = this;
|
|
56
|
+
const triggerNode = h("div", {
|
|
57
|
+
class: [`${mergedClsPrefix}-heatmap-rect`, loading && `${mergedClsPrefix}-heatmap-rect--loading`, loading && this.loadingClass],
|
|
58
|
+
style: [cssVars, style]
|
|
59
|
+
});
|
|
60
|
+
return tooltip === false || loading ? triggerNode : h(Tooltip, Object.assign({
|
|
61
|
+
trigger: "hover"
|
|
62
|
+
}, tooltipProps), {
|
|
63
|
+
default: () => resolveSlotWithTypedProps(this.$slots.tooltip, data, () => [h("div", null, defaultTooltipContent)]),
|
|
64
|
+
trigger: () => triggerNode
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { MergedTheme, Theme } from '../../_mixins';
|
|
3
|
+
import type { HeatmapThemeVars } from '../styles';
|
|
4
|
+
export declare function useLoadingStyleClass(props: {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
}, themeRef: ComputedRef<MergedTheme<Theme<'Heatmap', HeatmapThemeVars, any>>>): Ref<string>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useSsrAdapter } from '@css-render/vue3-ssr';
|
|
2
|
+
import { hash } from 'css-render';
|
|
3
|
+
import { inject, onMounted, ref, watchEffect } from 'vue';
|
|
4
|
+
import { c } from "../../_utils/cssr/index.mjs";
|
|
5
|
+
import { configProviderInjectionKey } from "../../config-provider/src/context.mjs";
|
|
6
|
+
export function useLoadingStyleClass(props, themeRef) {
|
|
7
|
+
const loadingClassRef = ref('');
|
|
8
|
+
const adapter = useSsrAdapter();
|
|
9
|
+
const NConfigProvider = inject(configProviderInjectionKey, null);
|
|
10
|
+
const styleMountTarget = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget;
|
|
11
|
+
onMounted(() => {
|
|
12
|
+
watchEffect(() => {
|
|
13
|
+
if (!props.loading) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const {
|
|
17
|
+
self: {
|
|
18
|
+
loadingColorStart,
|
|
19
|
+
loadingColorEnd
|
|
20
|
+
}
|
|
21
|
+
} = themeRef.value;
|
|
22
|
+
const loadingColorHash = hash(loadingColorStart) + hash(loadingColorEnd);
|
|
23
|
+
const className = `heatmap-loading-${loadingColorHash}`;
|
|
24
|
+
const animationName = `heatmap-loading-animation-${loadingColorHash}`;
|
|
25
|
+
loadingClassRef.value = className;
|
|
26
|
+
const cnode = c([c(`.${className}`, `
|
|
27
|
+
animation: 2s ${animationName} infinite cubic-bezier(0.36, 0, 0.64, 1);
|
|
28
|
+
`), c(`@keyframes ${animationName}`, `
|
|
29
|
+
0% {
|
|
30
|
+
background: ${loadingColorStart};
|
|
31
|
+
}
|
|
32
|
+
40% {
|
|
33
|
+
background: ${loadingColorEnd};
|
|
34
|
+
}
|
|
35
|
+
80% {
|
|
36
|
+
background: ${loadingColorStart};
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
background: ${loadingColorStart};
|
|
40
|
+
}
|
|
41
|
+
`)]);
|
|
42
|
+
// We don't unmount it since we didn't know its mount count
|
|
43
|
+
cnode.mount({
|
|
44
|
+
id: loadingColorHash,
|
|
45
|
+
ssr: adapter,
|
|
46
|
+
parent: styleMountTarget
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
return loadingClassRef;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export type HeatmapData = HeatmapDataItem[];
|
|
3
|
+
export interface HeatmapDataItem {
|
|
4
|
+
timestamp: number;
|
|
5
|
+
value?: number | null;
|
|
6
|
+
}
|
|
7
|
+
export type HeatmapTooltipSlotProps = HeatmapDataItem;
|
|
8
|
+
export interface HeatmapSlots {
|
|
9
|
+
footer?: () => VNode[];
|
|
10
|
+
indicator?: () => VNode[];
|
|
11
|
+
'indicator-leading-text'?: () => VNode[];
|
|
12
|
+
'indicator-trailing-text'?: () => VNode[];
|
|
13
|
+
tooltip?: (props: HeatmapTooltipSlotProps) => VNode[];
|
|
14
|
+
}
|
|
15
|
+
export type HeatmapFirstDayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
16
|
+
export type { HeatmapColorTheme } from './theme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { c, cB, cE, cM } from "../../../_utils/cssr/index.mjs";
|
|
2
|
+
// vars:
|
|
3
|
+
// --n-font-size
|
|
4
|
+
// --n-font-weight
|
|
5
|
+
// --n-text-color
|
|
6
|
+
// --n-border-radius
|
|
7
|
+
// --n-x-gap
|
|
8
|
+
// --n-y-gap
|
|
9
|
+
// --n-rect-size
|
|
10
|
+
// --n-rect-color (for individual rect background color)
|
|
11
|
+
// --n-bezier
|
|
12
|
+
export default c([cB('heatmap', `
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
max-width: fit-content;
|
|
16
|
+
font-size: var(--n-font-size);
|
|
17
|
+
`, [cE('content', `
|
|
18
|
+
display: block;
|
|
19
|
+
`), cE('calendar-table', `
|
|
20
|
+
border-collapse: separate;
|
|
21
|
+
border-spacing: var(--n-y-gap) var(--n-x-gap);
|
|
22
|
+
font-size: var(--n-font-size);
|
|
23
|
+
`), cE('week-header-cell', `
|
|
24
|
+
width: 27px;
|
|
25
|
+
padding: 0;
|
|
26
|
+
border: none;
|
|
27
|
+
font-size: var(--n-font-size);
|
|
28
|
+
`), cE('month-label-cell', `
|
|
29
|
+
font-size: var(--n-font-size);
|
|
30
|
+
color: var(--n-text-color);
|
|
31
|
+
text-align: left;
|
|
32
|
+
height: 15px;
|
|
33
|
+
line-height: 15px;
|
|
34
|
+
font-weight: var(--n-font-weight);
|
|
35
|
+
padding: 0 2px 8px;
|
|
36
|
+
vertical-align: bottom;
|
|
37
|
+
transition: color .3s var(--n-bezier);
|
|
38
|
+
`), cE('week-label-cell', `
|
|
39
|
+
font-size: var(--n-font-size);
|
|
40
|
+
color: var(--n-text-color);
|
|
41
|
+
text-align: right;
|
|
42
|
+
width: 27px;
|
|
43
|
+
height: 11px;
|
|
44
|
+
line-height: 11px;
|
|
45
|
+
padding: 0 4px 0 0;
|
|
46
|
+
border: none;
|
|
47
|
+
vertical-align: middle;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
font-weight: var(--n-font-weight);
|
|
50
|
+
transition: color .3s var(--n-bezier);
|
|
51
|
+
`), cE('day-cell', `
|
|
52
|
+
width: var(--n-rect-size);
|
|
53
|
+
height: var(--n-rect-size);
|
|
54
|
+
padding: 0;
|
|
55
|
+
border: none;
|
|
56
|
+
vertical-align: middle;
|
|
57
|
+
transition: color .3s var(--n-bezier);
|
|
58
|
+
`), cE('empty-cell', `
|
|
59
|
+
width: var(--n-rect-size);
|
|
60
|
+
height: var(--n-rect-size);
|
|
61
|
+
border-radius: var(--n-border-radius);
|
|
62
|
+
`), cE('footer', `
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
margin-left: 17px;
|
|
66
|
+
align-items: center;
|
|
67
|
+
margin-top: 8px;
|
|
68
|
+
&:has(> :only-child) {
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
}
|
|
71
|
+
`), cE('indicator', `
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: flex-end;
|
|
75
|
+
`)]), cB('heatmap-rect', `
|
|
76
|
+
width: var(--n-rect-size);
|
|
77
|
+
height: var(--n-rect-size);
|
|
78
|
+
border-radius: var(--n-border-radius);
|
|
79
|
+
background-color: var(--n-rect-color);
|
|
80
|
+
transition: background-color .3s var(--n-bezier);
|
|
81
|
+
`, [cM('loading', `
|
|
82
|
+
cursor: default;
|
|
83
|
+
background: var(--n-loading-color-start);
|
|
84
|
+
`)]), cB('heatmap-color-indicator', `
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: flex-end;
|
|
88
|
+
gap: 4px;
|
|
89
|
+
font-size: var(--n-font-size);
|
|
90
|
+
`, [cE('cells', `
|
|
91
|
+
display: flex;
|
|
92
|
+
gap: var(--n-x-gap);
|
|
93
|
+
`), cE('cell', `
|
|
94
|
+
width: var(--n-rect-size);
|
|
95
|
+
height: var(--n-rect-size);
|
|
96
|
+
border-radius: var(--n-border-radius);
|
|
97
|
+
transition: background-color .3s var(--n-bezier);
|
|
98
|
+
`), cE('label', `
|
|
99
|
+
font-size: var(--n-font-size);
|
|
100
|
+
color: var(--n-text-color);
|
|
101
|
+
transition: color .3s var(--n-bezier);
|
|
102
|
+
`)])]);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const heatmapColorThemes = {
|
|
2
|
+
green: ['#c6e48b', '#7bc96f', '#239a3b', '#196127'],
|
|
3
|
+
blue: ['#c0e7ff', '#73b3ff', '#0969da', '#0550ae'],
|
|
4
|
+
orange: ['#fed7aa', '#fb923c', '#ea580c', '#c2410c'],
|
|
5
|
+
purple: ['#e9d5ff', '#c084fc', '#9333ea', '#7c3aed'],
|
|
6
|
+
red: ['#fecaca', '#f87171', '#dc2626', '#b91c1c']
|
|
7
|
+
};
|