foucui 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/README.publish.md +19 -0
- package/dist/components/{QiuAnchor → FouAnchor}/context.d.ts +4 -4
- package/dist/components/{QiuBadge → FouBadge}/composables/useTableHostHeight.d.ts +1 -1
- package/dist/components/FouBadge/index.d.ts +18 -0
- package/dist/components/{QiuBadge → FouBadge}/shared/BadgeTemplateRenderer.vue.d.ts +1 -1
- package/dist/components/{QiuBadge → FouBadge}/shared/badgeTemplate.d.ts +1 -1
- package/dist/components/{QiuButton → FouButton}/index.vue.d.ts +4 -4
- package/dist/components/{QiuCanvasKit/QiuCanvasEditor.vue.d.ts → FouCanvasKit/FouCanvasEditor.vue.d.ts} +4 -2
- package/dist/components/{QiuCanvasKit → FouCanvasKit}/components/DataModulesPanel.vue.d.ts +1 -0
- package/dist/components/{QiuCanvasKit → FouCanvasKit}/index.d.ts +4 -4
- package/dist/components/{QiuCanvasKit → FouCanvasKit}/types.d.ts +1 -1
- package/dist/components/{QiuCarousel → FouCarousel}/context.d.ts +4 -4
- package/dist/components/{QiuCascader → FouCascader}/types.d.ts +7 -7
- package/dist/components/{QiuCheckbox → FouCheckbox}/types.d.ts +1 -1
- package/dist/components/{QiuCollapse → FouCollapse}/context.d.ts +2 -2
- package/dist/components/{QiuDescriptions → FouDescriptions}/context.d.ts +4 -4
- package/dist/components/{QiuDropdown → FouDropdown}/context.d.ts +2 -2
- package/dist/components/{QiuForm → FouForm}/types.d.ts +10 -10
- package/dist/components/FouLoading/index.d.ts +26 -0
- package/dist/components/{QiuLoading → FouLoading}/spinner.vue.d.ts +3 -3
- package/dist/components/{QiuLoading → FouLoading}/types.d.ts +2 -2
- package/dist/components/{QiuMenu → FouMenu}/context.d.ts +2 -2
- package/dist/components/{QiuMenuNav → FouMenuNav}/context.d.ts +2 -2
- package/dist/components/{QiuMsg/QiuMsgItem.vue.d.ts → FouMsg/FouMsgItem.vue.d.ts} +3 -3
- package/dist/components/FouMsg/index.d.ts +30 -0
- package/dist/components/{QiuMsg → FouMsg}/types.d.ts +5 -5
- package/dist/components/{QiuMsgBox → FouMsgBox}/index.d.ts +3 -3
- package/dist/components/{QiuNotification/QiuNotificationItem.vue.d.ts → FouNotification/FouNotificationItem.vue.d.ts} +3 -3
- package/dist/components/FouNotification/index.d.ts +30 -0
- package/dist/components/FouNotification/types.d.ts +12 -0
- package/dist/components/{QiuRadio → FouRadio}/types.d.ts +1 -1
- package/dist/components/FouRow/types.d.ts +4 -0
- package/dist/components/{QiuSelect → FouSelect}/index.vue.d.ts +3 -3
- package/dist/components/{QiuSelect → FouSelect}/types.d.ts +3 -3
- package/dist/components/{QiuStep → FouStep}/index.vue.d.ts +1 -1
- package/dist/components/{QiuSteps → FouSteps}/context.d.ts +5 -5
- package/dist/components/{QiuTabBar → FouTabBar}/index.vue.d.ts +3 -3
- package/dist/components/{QiuTabBar → FouTabBar}/types.d.ts +5 -5
- package/dist/components/{QiuTable → FouTable}/export.d.ts +5 -5
- package/dist/components/FouTable/index.d.ts +3 -0
- package/dist/components/{QiuTable → FouTable}/index.vue.d.ts +60 -60
- package/dist/components/FouTable/registry.d.ts +39 -0
- package/dist/components/{QiuTable → FouTable}/types.d.ts +60 -60
- package/dist/components/{QiuTable → FouTable}/useArea.d.ts +10 -10
- package/dist/components/{QiuTable → FouTable}/useColumns.d.ts +5 -5
- package/dist/components/FouTable/useEdit.d.ts +36 -0
- package/dist/components/{QiuTable → FouTable}/useHistory.d.ts +5 -5
- package/dist/components/{QiuTable → FouTable}/useMerge.d.ts +6 -6
- package/dist/components/{QiuTable → FouTable}/useScrollSync.d.ts +1 -1
- package/dist/components/{QiuTable → FouTable}/utils.d.ts +17 -17
- package/dist/components/FouTree/types.d.ts +13 -0
- package/dist/components/{QiuUpload → FouUpload}/index.vue.d.ts +17 -17
- package/dist/foucui.css +1 -1
- package/dist/foucui.js +10749 -10646
- package/dist/foucui.umd.cjs +40 -40
- package/dist/index.d.ts +43 -43
- package/dist/src/bridge/@/config/index.d.ts +1 -1
- package/dist/src/bridge/@fou/plugins/shortcuts.d.ts +2 -0
- package/package.json +27 -15
- package/components/QiuAffix/index.vue +0 -186
- package/components/QiuAlert/index.vue +0 -208
- package/components/QiuAnchor/context.ts +0 -18
- package/components/QiuAnchor/index.vue +0 -180
- package/components/QiuAnchorLink/index.vue +0 -67
- package/components/QiuApp/index.vue +0 -9
- package/components/QiuAutocomplete/index.vue +0 -408
- package/components/QiuAvatar/index.vue +0 -140
- package/components/QiuBacktop/index.vue +0 -121
- package/components/QiuBadge/api/index.ts +0 -389
- package/components/QiuBadge/components/BadgeImagePickerDialog.vue +0 -243
- package/components/QiuBadge/components/BadgeLibraryManagerDialog.vue +0 -30
- package/components/QiuBadge/components/BadgeLibraryPanel.vue +0 -182
- package/components/QiuBadge/composables/useTableHostHeight.ts +0 -53
- package/components/QiuBadge/index.ts +0 -18
- package/components/QiuBadge/shared/BadgeTemplateRenderer.vue +0 -32
- package/components/QiuBadge/shared/assetUrl.ts +0 -26
- package/components/QiuBadge/shared/badgeTemplate.ts +0 -309
- package/components/QiuBadge/utils/chinaAreaData.ts +0 -44
- package/components/QiuBadge/utils/hostRegion.ts +0 -22
- package/components/QiuBadge/utils/pca-code.json +0 -1
- package/components/QiuBadge/utils/pdfFromElement.ts +0 -348
- package/components/QiuBadge/views/BadgeLibraryView.vue +0 -32
- package/components/QiuBadge/views/BadgeManageView.vue +0 -1364
- package/components/QiuBadge/views/BadgeTemplateEditorView.vue +0 -10
- package/components/QiuBadge/views/BadgeTemplateListView.vue +0 -229
- package/components/QiuBadge/views/DeskLabelTemplateListView.vue +0 -227
- package/components/QiuBadge/views/DeskLabelView.vue +0 -683
- package/components/QiuBadgeDot/index.vue +0 -87
- package/components/QiuButton/index.vue +0 -247
- package/components/QiuButtonGroup/index.vue +0 -63
- package/components/QiuCanvasKit/QiuCanvasEditor.vue +0 -5503
- package/components/QiuCanvasKit/QiuCanvasRenderer.vue +0 -348
- package/components/QiuCanvasKit/assetUrl.ts +0 -11
- package/components/QiuCanvasKit/components/DataModulesPanel.vue +0 -352
- package/components/QiuCanvasKit/export/html.ts +0 -132
- package/components/QiuCanvasKit/export/pdf.ts +0 -48
- package/components/QiuCanvasKit/export/png.ts +0 -50
- package/components/QiuCanvasKit/index.ts +0 -20
- package/components/QiuCanvasKit/modules/badgeCompat.ts +0 -84
- package/components/QiuCanvasKit/modules/dataRegistry.ts +0 -207
- package/components/QiuCanvasKit/modules/merge.ts +0 -71
- package/components/QiuCanvasKit/presets/badge.ts +0 -67
- package/components/QiuCanvasKit/presets/banner.ts +0 -79
- package/components/QiuCanvasKit/types.ts +0 -138
- package/components/QiuCard/index.vue +0 -104
- package/components/QiuCarousel/context.ts +0 -16
- package/components/QiuCarousel/index.vue +0 -343
- package/components/QiuCarouselItem/index.vue +0 -47
- package/components/QiuCascader/index.vue +0 -879
- package/components/QiuCascader/types.ts +0 -48
- package/components/QiuCheckbox/QiuCheckboxGroup.vue +0 -78
- package/components/QiuCheckbox/index.vue +0 -231
- package/components/QiuCheckbox/types.ts +0 -8
- package/components/QiuCode/index.vue +0 -64
- package/components/QiuCol/col.scss +0 -55
- package/components/QiuCol/index.vue +0 -64
- package/components/QiuCollapse/context.ts +0 -10
- package/components/QiuCollapse/index.vue +0 -70
- package/components/QiuCollapseItem/index.vue +0 -167
- package/components/QiuColorField/index.vue +0 -296
- package/components/QiuColorPicker/README.md +0 -118
- package/components/QiuColorPicker/index.vue +0 -60
- package/components/QiuColorfulCard/index.vue +0 -101
- package/components/QiuCombobox/index.vue +0 -277
- package/components/QiuConfigProvider/index.vue +0 -31
- package/components/QiuContextMenu/index.vue +0 -209
- package/components/QiuDate/index.vue +0 -1134
- package/components/QiuDescriptions/context.ts +0 -20
- package/components/QiuDescriptions/index.vue +0 -115
- package/components/QiuDescriptionsItem/index.vue +0 -103
- package/components/QiuDialog/index.vue +0 -828
- package/components/QiuDigitalCard/index.vue +0 -159
- package/components/QiuDivider/index.vue +0 -185
- package/components/QiuDot/index.vue +0 -83
- package/components/QiuDrawer/index.vue +0 -350
- package/components/QiuDropdown/QiuDropdownItem.vue +0 -74
- package/components/QiuDropdown/QiuDropdownMenu.vue +0 -22
- package/components/QiuDropdown/context.ts +0 -9
- package/components/QiuDropdown/index.vue +0 -189
- package/components/QiuEmpty/index.vue +0 -73
- package/components/QiuForm/index.vue +0 -172
- package/components/QiuForm/types.ts +0 -39
- package/components/QiuFormItem/index.vue +0 -276
- package/components/QiuFullscreen/index.vue +0 -11
- package/components/QiuGrid/index.vue +0 -408
- package/components/QiuHoverCard/index.vue +0 -192
- package/components/QiuIcon/index.vue +0 -117
- package/components/QiuIconPicker/iconify.libraries.ts +0 -182
- package/components/QiuIconPicker/icons.catalog.ts +0 -3072
- package/components/QiuIconPicker/index.vue +0 -488
- package/components/QiuImage/index.vue +0 -177
- package/components/QiuInput/index.vue +0 -328
- package/components/QiuInputNumber/index.vue +0 -295
- package/components/QiuInputOtp/index.vue +0 -190
- package/components/QiuKbd/index.vue +0 -57
- package/components/QiuLayoutContainer/index.vue +0 -50
- package/components/QiuLinkPreview/index.vue +0 -224
- package/components/QiuLoading/index.ts +0 -176
- package/components/QiuLoading/spinner.vue +0 -820
- package/components/QiuLoading/types.ts +0 -44
- package/components/QiuMention/index.vue +0 -299
- package/components/QiuMenu/QiuMenuRoot.vue +0 -241
- package/components/QiuMenu/components/QiuMenuItem.vue +0 -340
- package/components/QiuMenu/components/QiuSubMenu.vue +0 -504
- package/components/QiuMenu/context.ts +0 -21
- package/components/QiuMenu/index.vue +0 -43
- package/components/QiuMenuNav/QiuMenuNavItem.vue +0 -100
- package/components/QiuMenuNav/QiuMenuNavSub.vue +0 -120
- package/components/QiuMenuNav/context.ts +0 -14
- package/components/QiuMenuNav/index.vue +0 -148
- package/components/QiuMsg/QiuMsgItem.vue +0 -180
- package/components/QiuMsg/index.ts +0 -158
- package/components/QiuMsg/types.ts +0 -23
- package/components/QiuMsgBox/index.ts +0 -147
- package/components/QiuNotification/QiuNotificationItem.vue +0 -168
- package/components/QiuNotification/index.ts +0 -155
- package/components/QiuNotification/types.ts +0 -14
- package/components/QiuPage/index.vue +0 -12
- package/components/QiuPageHeader/index.vue +0 -115
- package/components/QiuPageMain/index.vue +0 -78
- package/components/QiuPagination/index.vue +0 -421
- package/components/QiuPasswordStrength/index.vue +0 -101
- package/components/QiuPopconfirm/index.vue +0 -196
- package/components/QiuPopover/index.vue +0 -277
- package/components/QiuProgress/index.vue +0 -235
- package/components/QiuQrcode/index.vue +0 -302
- package/components/QiuQueryForm/components/QiuQueryFormBottomPanel.vue +0 -13
- package/components/QiuQueryForm/components/QiuQueryFormLeftPanel.vue +0 -37
- package/components/QiuQueryForm/components/QiuQueryFormRightPanel.vue +0 -37
- package/components/QiuQueryForm/components/QiuQueryFormTopPanel.vue +0 -13
- package/components/QiuQueryForm/index.vue +0 -117
- package/components/QiuRadio/QiuRadioGroup.vue +0 -75
- package/components/QiuRadio/index.vue +0 -191
- package/components/QiuRadio/types.ts +0 -9
- package/components/QiuRate/index.vue +0 -184
- package/components/QiuRefresh/index.vue +0 -32
- package/components/QiuResult/index.vue +0 -103
- package/components/QiuRow/index.vue +0 -60
- package/components/QiuRow/types.ts +0 -5
- package/components/QiuScrollbar/index.vue +0 -107
- package/components/QiuSearchBar/index.vue +0 -154
- package/components/QiuSegmented/index.vue +0 -120
- package/components/QiuSelect/QiuOption.vue +0 -93
- package/components/QiuSelect/index.vue +0 -452
- package/components/QiuSelect/types.ts +0 -15
- package/components/QiuSkeleton/index.vue +0 -78
- package/components/QiuSlider/index.vue +0 -266
- package/components/QiuSpace/index.vue +0 -95
- package/components/QiuSparkline/index.vue +0 -92
- package/components/QiuStatistic/index.vue +0 -4
- package/components/QiuStatistics/index.vue +0 -123
- package/components/QiuStep/index.vue +0 -220
- package/components/QiuSteps/context.ts +0 -25
- package/components/QiuSteps/index.vue +0 -84
- package/components/QiuSwitch/index.vue +0 -145
- package/components/QiuTabBar/index.vue +0 -218
- package/components/QiuTabBar/types.ts +0 -19
- package/components/QiuTabPane/index.vue +0 -82
- package/components/QiuTable/columns.ts +0 -16
- package/components/QiuTable/export.ts +0 -102
- package/components/QiuTable/index.ts +0 -24
- package/components/QiuTable/index.vue +0 -3503
- package/components/QiuTable/registry.ts +0 -75
- package/components/QiuTable/styles/table.scss +0 -1230
- package/components/QiuTable/types.ts +0 -413
- package/components/QiuTable/useArea.ts +0 -202
- package/components/QiuTable/useColumns.ts +0 -325
- package/components/QiuTable/useEdit.ts +0 -136
- package/components/QiuTable/useExtras.ts +0 -115
- package/components/QiuTable/useHistory.ts +0 -77
- package/components/QiuTable/useMerge.ts +0 -105
- package/components/QiuTable/useResize.ts +0 -86
- package/components/QiuTable/useScrollSync.ts +0 -152
- package/components/QiuTable/useVirtual.ts +0 -97
- package/components/QiuTable/utils.ts +0 -165
- package/components/QiuTableColumn/index.vue +0 -101
- package/components/QiuTag/index.vue +0 -143
- package/components/QiuText/index.vue +0 -99
- package/components/QiuTime/index.vue +0 -548
- package/components/QiuTimeAgo/index.vue +0 -103
- package/components/QiuTimeline/index.vue +0 -54
- package/components/QiuTimelineItem/index.vue +0 -140
- package/components/QiuTips/index.vue +0 -323
- package/components/QiuTooltip/index.vue +0 -237
- package/components/QiuTransfer/index.vue +0 -277
- package/components/QiuTree/QiuTreeNode.vue +0 -146
- package/components/QiuTree/index.vue +0 -143
- package/components/QiuTree/types.ts +0 -30
- package/components/QiuTreeSelect/index.vue +0 -259
- package/components/QiuTrend/index.vue +0 -92
- package/components/QiuUpload/index.vue +0 -628
- package/components/QiuUploadCrop/index.vue +0 -1267
- package/components/QiuWatermark/index.vue +0 -121
- package/components/useBodyScrollLock.ts +0 -28
- package/dist/components/QiuBadge/index.d.ts +0 -18
- package/dist/components/QiuBadge/utils/pca-code.json.d.ts +0 -3
- package/dist/components/QiuLoading/index.d.ts +0 -26
- package/dist/components/QiuMsg/index.d.ts +0 -30
- package/dist/components/QiuNotification/index.d.ts +0 -30
- package/dist/components/QiuNotification/types.d.ts +0 -12
- package/dist/components/QiuRow/types.d.ts +0 -4
- package/dist/components/QiuTable/index.d.ts +0 -3
- package/dist/components/QiuTable/registry.d.ts +0 -39
- package/dist/components/QiuTable/useEdit.d.ts +0 -36
- package/dist/components/QiuTree/types.d.ts +0 -13
- package/dist/src/bridge/@qiu/plugins/shortcuts.d.ts +0 -2
- package/plugins/qiu.ts +0 -83
- package/plugins/shortcuts.ts +0 -69
- package/src/bridge/@/api/media.ts +0 -8
- package/src/bridge/@/api/notice.ts +0 -5
- package/src/bridge/@/config/index.ts +0 -38
- package/src/bridge/@/config/media.config.ts +0 -37
- package/src/bridge/@/config/security.config.ts +0 -8
- package/src/bridge/@/i18n/index.ts +0 -6
- package/src/bridge/@/store/modules/bing.ts +0 -9
- package/src/bridge/@/store/modules/errorLog.ts +0 -9
- package/src/bridge/@/store/modules/media.ts +0 -10
- package/src/bridge/@/store/modules/routes.ts +0 -10
- package/src/bridge/@/store/modules/settings.ts +0 -9
- package/src/bridge/@/store/modules/tabs.ts +0 -9
- package/src/bridge/@/store/modules/user.ts +0 -9
- package/src/bridge/@/utils/convertToCamelCase.ts +0 -11
- package/src/bridge/@/utils/index.ts +0 -9
- package/src/bridge/@/utils/pageTitle.ts +0 -4
- package/src/bridge/@/utils/routes.ts +0 -14
- package/src/bridge/@/utils/validate.ts +0 -17
- package/src/bridge/@qiu/plugins/shortcuts.ts +0 -3
- package/src/i18n.ts +0 -8
- package/src/icons/qiu-logo.svg +0 -1
- package/styles/dark.scss +0 -194
- package/styles/normalize.css +0 -349
- package/styles/plain.scss +0 -423
- package/styles/qiu-tokens.scss +0 -40
- package/styles/qiu.scss +0 -1149
- package/styles/technology.scss +0 -452
- package/styles/var.scss +0 -382
- package/styles/variables.scss +0 -77
- /package/dist/components/{QiuAnchorLink → FouAnchorLink}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/api/index.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/components/BadgeImagePickerDialog.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/components/BadgeLibraryManagerDialog.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/components/BadgeLibraryPanel.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/shared/assetUrl.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/utils/chinaAreaData.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/utils/hostRegion.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/utils/pdfFromElement.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/views/BadgeLibraryView.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/views/BadgeManageView.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/views/BadgeTemplateListView.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/views/DeskLabelTemplateListView.vue.d.ts +0 -0
- /package/dist/components/{QiuBadge → FouBadge}/views/DeskLabelView.vue.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit/QiuCanvasRenderer.vue.d.ts → FouCanvasKit/FouCanvasRenderer.vue.d.ts} +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/assetUrl.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/export/html.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/export/pdf.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/export/png.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/modules/badgeCompat.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/modules/dataRegistry.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/modules/merge.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/presets/badge.d.ts +0 -0
- /package/dist/components/{QiuCanvasKit → FouCanvasKit}/presets/banner.d.ts +0 -0
- /package/dist/components/{QiuCarouselItem → FouCarouselItem}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuCheckbox/QiuCheckboxGroup.vue.d.ts → FouCheckbox/FouCheckboxGroup.vue.d.ts} +0 -0
- /package/dist/components/{QiuCheckbox → FouCheckbox}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuCode → FouCode}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuCollapseItem → FouCollapseItem}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuColorField → FouColorField}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuColorPicker → FouColorPicker}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuCombobox → FouCombobox}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuContextMenu → FouContextMenu}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuDescriptionsItem → FouDescriptionsItem}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuDigitalCard → FouDigitalCard}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuDropdown/QiuDropdownItem.vue.d.ts → FouDropdown/FouDropdownItem.vue.d.ts} +0 -0
- /package/dist/components/{QiuDropdown/QiuDropdownMenu.vue.d.ts → FouDropdown/FouDropdownMenu.vue.d.ts} +0 -0
- /package/dist/components/{QiuDropdown → FouDropdown}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuHoverCard → FouHoverCard}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuIcon → FouIcon}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuIconPicker → FouIconPicker}/iconify.libraries.d.ts +0 -0
- /package/dist/components/{QiuIconPicker → FouIconPicker}/icons.catalog.d.ts +0 -0
- /package/dist/components/{QiuInput → FouInput}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuInputNumber → FouInputNumber}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuInputOtp → FouInputOtp}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuKbd → FouKbd}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuLayoutContainer → FouLayoutContainer}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuLinkPreview → FouLinkPreview}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuMention → FouMention}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuMenu/QiuMenuRoot.vue.d.ts → FouMenu/FouMenuRoot.vue.d.ts} +0 -0
- /package/dist/components/{QiuMenuNav/QiuMenuNavItem.vue.d.ts → FouMenuNav/FouMenuNavItem.vue.d.ts} +0 -0
- /package/dist/components/{QiuMenuNav/QiuMenuNavSub.vue.d.ts → FouMenuNav/FouMenuNavSub.vue.d.ts} +0 -0
- /package/dist/components/{QiuMenuNav → FouMenuNav}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuPageMain → FouPageMain}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuPagination → FouPagination}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuPasswordStrength → FouPasswordStrength}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuQrcode → FouQrcode}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuRadio/QiuRadioGroup.vue.d.ts → FouRadio/FouRadioGroup.vue.d.ts} +0 -0
- /package/dist/components/{QiuSearchBar → FouSearchBar}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuSelect/QiuOption.vue.d.ts → FouSelect/FouOption.vue.d.ts} +0 -0
- /package/dist/components/{QiuSparkline → FouSparkline}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuSwitch → FouSwitch}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuTabPane → FouTabPane}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuTable → FouTable}/columns.d.ts +0 -0
- /package/dist/components/{QiuTable → FouTable}/useExtras.d.ts +0 -0
- /package/dist/components/{QiuTable → FouTable}/useResize.d.ts +0 -0
- /package/dist/components/{QiuTable → FouTable}/useVirtual.d.ts +0 -0
- /package/dist/components/{QiuTime → FouTime}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuTimeAgo → FouTimeAgo}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuTimelineItem → FouTimelineItem}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuTooltip → FouTooltip}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuTrend → FouTrend}/index.vue.d.ts +0 -0
- /package/dist/components/{QiuUploadCrop → FouUploadCrop}/index.vue.d.ts +0 -0
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
/** QiuTable 列配置(props.columns) */
|
|
2
|
-
export interface QiuTableColumnConfig {
|
|
3
|
-
/** 列标题(同 title,优先 label) */
|
|
4
|
-
label?: string
|
|
5
|
-
/** vxe 别名,与 label 等价 */
|
|
6
|
-
title?: string
|
|
7
|
-
prop?: string
|
|
8
|
-
field?: string
|
|
9
|
-
/** 固定列宽;与 minWidth 同时存在时以 width 为准 */
|
|
10
|
-
width?: string | number
|
|
11
|
-
/** 最小列宽;未设 width 时作为弹性列下限,并可参与剩余宽度分配 */
|
|
12
|
-
minWidth?: string | number
|
|
13
|
-
/** 最大列宽;拖拽与自适应时的上限 */
|
|
14
|
-
maxWidth?: string | number
|
|
15
|
-
fixed?: boolean | 'left' | 'right'
|
|
16
|
-
sortable?: boolean | string
|
|
17
|
-
/** 开启筛选;未传 filters 时按当前列数据自动生成选项 */
|
|
18
|
-
filterable?: boolean
|
|
19
|
-
align?: 'left' | 'center' | 'right'
|
|
20
|
-
footerAlign?: 'left' | 'center' | 'right'
|
|
21
|
-
/**
|
|
22
|
-
* 编辑器类型(与 type 二选一,优先 editor)
|
|
23
|
-
* switch | select | input | number | date | datetime | text
|
|
24
|
-
*/
|
|
25
|
-
editor?: 'switch' | 'select' | 'input' | 'number' | 'date' | 'datetime' | 'time' | 'text'
|
|
26
|
-
/**
|
|
27
|
-
* 完整编辑渲染对象(优先于 editor / type)
|
|
28
|
-
* 对齐 vxe editRender:{ name, props, options, events, attrs, enabled }
|
|
29
|
-
*/
|
|
30
|
-
editRender?: string | QiuTableEditRender
|
|
31
|
-
/**
|
|
32
|
-
* selection/index/seq,或编辑器类型别名
|
|
33
|
-
*/
|
|
34
|
-
type?: string
|
|
35
|
-
editorProps?: Record<string, any>
|
|
36
|
-
options?: { label: string; value: any }[]
|
|
37
|
-
slot?: string
|
|
38
|
-
formatter?: (row: any, column: QiuTableColumnConfig, cellValue: any) => string
|
|
39
|
-
editable?: boolean
|
|
40
|
-
filters?: { text: string; value: any }[]
|
|
41
|
-
filterMethod?: (value: any, row: any, column: QiuTableColumnConfig) => boolean
|
|
42
|
-
treeNode?: boolean
|
|
43
|
-
dragSort?: boolean
|
|
44
|
-
showOverflowTooltip?: boolean
|
|
45
|
-
className?: string
|
|
46
|
-
headerClassName?: string
|
|
47
|
-
footerClassName?: string
|
|
48
|
-
headerAlign?: 'left' | 'center' | 'right'
|
|
49
|
-
/** 多级表头子列(父子列自动合并表头单元格) */
|
|
50
|
-
children?: QiuTableColumnConfig[]
|
|
51
|
-
/** 表尾格式化 */
|
|
52
|
-
footerFormatter?: (params: {
|
|
53
|
-
column: QiuTableColumnConfig
|
|
54
|
-
items: any[]
|
|
55
|
-
data: any[]
|
|
56
|
-
rowIndex: number
|
|
57
|
-
}) => string
|
|
58
|
-
/** 快捷聚合:sum | avg | count(配合 showFooter) */
|
|
59
|
-
aggFunc?: 'sum' | 'avg' | 'count'
|
|
60
|
-
resizable?: boolean
|
|
61
|
-
/** 全局 formats 名称,或列内 formatter 优先 */
|
|
62
|
-
format?: string
|
|
63
|
-
/** 全局 renderer 名称 */
|
|
64
|
-
cellRender?: string | { name: string; props?: Record<string, any> }
|
|
65
|
-
/** 自定义列面板中是否默认可见 */
|
|
66
|
-
visible?: boolean
|
|
67
|
-
/** 透传业务参数 */
|
|
68
|
-
params?: Record<string, any>
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** 列 editRender 完整对象 */
|
|
72
|
-
export interface QiuTableEditRender {
|
|
73
|
-
/** 内置:input/select/number/date/datetime/time/switch/text;或 QiuTableEditRenderer 注册名 */
|
|
74
|
-
name: string
|
|
75
|
-
props?: Record<string, any>
|
|
76
|
-
options?: { label: string; value: any }[]
|
|
77
|
-
attrs?: Record<string, any>
|
|
78
|
-
events?: Record<string, (...args: any[]) => void>
|
|
79
|
-
/** false 时禁用编辑 */
|
|
80
|
-
enabled?: boolean
|
|
81
|
-
autofocus?: string | boolean
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** @deprecated 使用 QiuTableColumnConfig */
|
|
85
|
-
export type QiuTableColumn = QiuTableColumnConfig
|
|
86
|
-
|
|
87
|
-
export interface QiuTableRegisteredColumn {
|
|
88
|
-
id: symbol
|
|
89
|
-
props: Record<string, any>
|
|
90
|
-
slots: {
|
|
91
|
-
default?: (scope: QiuTableCellScope) => any
|
|
92
|
-
header?: (scope: QiuTableHeaderScope) => any
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface QiuTableCellScope {
|
|
97
|
-
row: any
|
|
98
|
-
column: QiuTableColumnConfig
|
|
99
|
-
$index: number
|
|
100
|
-
cellValue: any
|
|
101
|
-
level?: number
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface QiuTableHeaderScope {
|
|
105
|
-
column: QiuTableColumnConfig
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface QiuTableFlatRow {
|
|
109
|
-
row: any
|
|
110
|
-
level: number
|
|
111
|
-
hasChildren: boolean
|
|
112
|
-
expanded: boolean
|
|
113
|
-
flatIndex: number
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface QiuTableRegisterContext {
|
|
117
|
-
register: (col: QiuTableRegisteredColumn) => void
|
|
118
|
-
unregister: (id: symbol) => void
|
|
119
|
-
update: (col: QiuTableRegisteredColumn) => void
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface QiuTableEditConfig {
|
|
123
|
-
trigger?: 'click' | 'dblclick' | 'manual' | 'always'
|
|
124
|
-
mode?: 'cell' | 'row'
|
|
125
|
-
showIcon?: boolean
|
|
126
|
-
/** 点击表格外自动清除编辑态,默认 true */
|
|
127
|
-
autoClear?: boolean
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface QiuTableSortConfig {
|
|
131
|
-
/** true:不本地排序,仅抛 sort-change */
|
|
132
|
-
remote?: boolean
|
|
133
|
-
multiple?: boolean
|
|
134
|
-
chronological?: boolean
|
|
135
|
-
defaultSort?:
|
|
136
|
-
| { field?: string; prop?: string; order?: 'asc' | 'desc' | null }
|
|
137
|
-
| { field?: string; prop?: string; order?: 'asc' | 'desc' | null }[]
|
|
138
|
-
trigger?: 'default' | 'cell'
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface QiuTableRadioConfig {
|
|
142
|
-
highlight?: boolean
|
|
143
|
-
checkRowKey?: string | number
|
|
144
|
-
strict?: boolean
|
|
145
|
-
trigger?: 'default' | 'row' | 'cell'
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface QiuTableExpandConfig {
|
|
149
|
-
expandAll?: boolean
|
|
150
|
-
accordion?: boolean
|
|
151
|
-
lazy?: boolean
|
|
152
|
-
labelField?: string
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface QiuTableColumnDragConfig {
|
|
156
|
-
enabled?: boolean
|
|
157
|
-
showIcon?: boolean
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface QiuTableKeepSourceConfig {
|
|
161
|
-
enabled?: boolean
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export interface QiuTableFilterConfig {
|
|
165
|
-
/** true:不本地过滤,仅抛 filter-change */
|
|
166
|
-
remote?: boolean
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export interface QiuTableRowConfig {
|
|
170
|
-
/** 点击高亮当前行,默认 true */
|
|
171
|
-
isCurrent?: boolean
|
|
172
|
-
/** 鼠标悬停高亮,默认 true */
|
|
173
|
-
isHover?: boolean
|
|
174
|
-
/** vxe 别名 → isHover */
|
|
175
|
-
highlightHoverRow?: boolean
|
|
176
|
-
/** vxe 别名 → isCurrent */
|
|
177
|
-
highlightCurrentRow?: boolean
|
|
178
|
-
height?: number
|
|
179
|
-
keyField?: string
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/** 键盘行为(对齐 vxe keyboardConfig) */
|
|
183
|
-
export interface QiuTableKeyboardConfig {
|
|
184
|
-
/** ↑↓ 移动当前行 / 活动单元格,默认 true */
|
|
185
|
-
isArrow?: boolean
|
|
186
|
-
/** Enter 进入编辑,默认 true(需 editable) */
|
|
187
|
-
isEnter?: boolean
|
|
188
|
-
/** Esc 退出编辑,默认 true */
|
|
189
|
-
isEsc?: boolean
|
|
190
|
-
/** Tab 横向移动单元格,默认 false */
|
|
191
|
-
isTab?: boolean
|
|
192
|
-
/** Ctrl+Z / Ctrl+Y 撤销重做,默认 true(需 historyConfig 开启) */
|
|
193
|
-
isUndo?: boolean
|
|
194
|
-
/** 编辑时方向键是否仍导航,默认 false */
|
|
195
|
-
isEdit?: boolean
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/** 剪贴板(对齐 vxe clipboardConfig) */
|
|
199
|
-
export interface QiuTableClipboardConfig {
|
|
200
|
-
/** Ctrl+C 复制选区,默认 true */
|
|
201
|
-
isCopy?: boolean
|
|
202
|
-
/** Ctrl+X 剪切,默认 true */
|
|
203
|
-
isCut?: boolean
|
|
204
|
-
/** Ctrl+V 粘贴,默认 true */
|
|
205
|
-
isPaste?: boolean
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/** 溢出提示(对齐 vxe tooltipConfig) */
|
|
209
|
-
export interface QiuTableTooltipConfig {
|
|
210
|
-
/** 全局开启溢出 tooltip,默认 true */
|
|
211
|
-
showAll?: boolean
|
|
212
|
-
/** 主题:light | dark */
|
|
213
|
-
theme?: 'light' | 'dark'
|
|
214
|
-
/** 进入延迟 ms */
|
|
215
|
-
enterDelay?: number
|
|
216
|
-
/** 离开延迟 ms */
|
|
217
|
-
leaveDelay?: number
|
|
218
|
-
/** 自定义内容;返回 null 则不显示 */
|
|
219
|
-
contentMethod?: (params: {
|
|
220
|
-
row: any
|
|
221
|
-
column: QiuTableColumnConfig
|
|
222
|
-
cellValue: any
|
|
223
|
-
}) => string | null | undefined
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/** 导出配置对象(对齐 vxe exportConfig) */
|
|
227
|
-
export interface QiuTableExportConfig {
|
|
228
|
-
filename?: string
|
|
229
|
-
/** 默认格式 */
|
|
230
|
-
type?: 'csv' | 'xls' | 'xlsx'
|
|
231
|
-
sheetName?: string
|
|
232
|
-
/** 导出模式:当前页 / 全部 / 选中 / 指定页码范围 */
|
|
233
|
-
mode?: 'current' | 'all' | 'selected' | 'range'
|
|
234
|
-
modes?: Array<'current' | 'all' | 'selected' | 'range'>
|
|
235
|
-
/** 范围导出起始页(从 1 开始,mode=range 时有效) */
|
|
236
|
-
startPage?: number
|
|
237
|
-
/** 范围导出结束页(从 1 开始,mode=range 时有效) */
|
|
238
|
-
endPage?: number
|
|
239
|
-
/** 打开导出前 */
|
|
240
|
-
beforeExportMethod?: (params: { options: QiuTableExportConfig }) => void | boolean | Promise<void | boolean>
|
|
241
|
-
/** 导出后 */
|
|
242
|
-
afterExportMethod?: (params: { options: QiuTableExportConfig }) => void
|
|
243
|
-
/** 列过滤 */
|
|
244
|
-
columnFilterMethod?: (params: { column: QiuTableColumnConfig }) => boolean
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/** 自定义工具栏工具 */
|
|
248
|
-
export interface QiuTableToolbarTool {
|
|
249
|
-
/** 唯一名称 */
|
|
250
|
-
name: string
|
|
251
|
-
/** 渲染组件;传入组件对象 */
|
|
252
|
-
component?: any
|
|
253
|
-
/** 透传给组件的 props */
|
|
254
|
-
props?: Record<string, any>
|
|
255
|
-
/** 位置:left | center | right,默认 right */
|
|
256
|
-
position?: 'left' | 'center' | 'right'
|
|
257
|
-
/** 排序权重 */
|
|
258
|
-
order?: number
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/** 工具栏配置对象(对齐 vxe toolbarConfig) */
|
|
262
|
-
export interface QiuTableToolbarConfig {
|
|
263
|
-
enabled?: boolean
|
|
264
|
-
/** 刷新按钮,默认 true */
|
|
265
|
-
refresh?: boolean
|
|
266
|
-
/** 导出按钮,默认 true */
|
|
267
|
-
export?: boolean
|
|
268
|
-
/** 导入按钮,默认 false */
|
|
269
|
-
import?: boolean
|
|
270
|
-
/** 打印按钮,默认 false */
|
|
271
|
-
print?: boolean
|
|
272
|
-
/** 列自定义按钮,默认 true */
|
|
273
|
-
custom?: boolean
|
|
274
|
-
/** 全屏按钮,默认 true */
|
|
275
|
-
zoom?: boolean
|
|
276
|
-
/** Excel 复制按钮,默认 false */
|
|
277
|
-
copy?: boolean
|
|
278
|
-
/** 内置工具按钮的位置,默认 right */
|
|
279
|
-
toolsPlacement?: 'left' | 'center' | 'right'
|
|
280
|
-
/** 自定义工具插件 */
|
|
281
|
-
customTools?: QiuTableToolbarTool[]
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/** 编辑历史(undo/redo) */
|
|
285
|
-
export interface QiuTableHistoryConfig {
|
|
286
|
-
/** 默认 false;设 true 或配合 keyboardConfig.isUndo */
|
|
287
|
-
enabled?: boolean
|
|
288
|
-
/** 栈深度,默认 50 */
|
|
289
|
-
size?: number
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/** 解析行 hover 是否开启 */
|
|
293
|
-
export function resolveRowHover(cfg?: QiuTableRowConfig): boolean {
|
|
294
|
-
if (!cfg) return true
|
|
295
|
-
if (cfg.isHover !== undefined) return cfg.isHover !== false
|
|
296
|
-
if (cfg.highlightHoverRow !== undefined) return !!cfg.highlightHoverRow
|
|
297
|
-
return true
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/** 解析当前行高亮是否开启 */
|
|
301
|
-
export function resolveRowCurrent(cfg?: QiuTableRowConfig): boolean {
|
|
302
|
-
if (!cfg) return true
|
|
303
|
-
if (cfg.isCurrent !== undefined) return cfg.isCurrent !== false
|
|
304
|
-
if (cfg.highlightCurrentRow !== undefined) return !!cfg.highlightCurrentRow
|
|
305
|
-
return true
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/** 解析列 editRender 对象 */
|
|
309
|
-
export function resolveEditRender(
|
|
310
|
-
col: Pick<QiuTableColumnConfig, 'editRender' | 'editor' | 'type' | 'editorProps' | 'options'>
|
|
311
|
-
): QiuTableEditRender | undefined {
|
|
312
|
-
if (col.editRender) {
|
|
313
|
-
if (typeof col.editRender === 'string') {
|
|
314
|
-
return { name: col.editRender, props: col.editorProps, options: col.options }
|
|
315
|
-
}
|
|
316
|
-
return {
|
|
317
|
-
...col.editRender,
|
|
318
|
-
props: { ...(col.editorProps || {}), ...(col.editRender.props || {}) },
|
|
319
|
-
options: col.editRender.options || col.options,
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
const name = col.editor || (col.type && QIU_EDITOR_TYPES.has(col.type) ? col.type : undefined)
|
|
323
|
-
if (!name) return undefined
|
|
324
|
-
return { name, props: col.editorProps, options: col.options }
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
export interface QiuTableColumnConfigExtra {
|
|
328
|
-
resizable?: boolean
|
|
329
|
-
/** 未指定列宽时的默认最小宽 */
|
|
330
|
-
minWidth?: number
|
|
331
|
-
/** 默认最大宽 */
|
|
332
|
-
maxWidth?: number
|
|
333
|
-
/** 默认固定宽 */
|
|
334
|
-
width?: number
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
export interface QiuTableMergeCell {
|
|
338
|
-
row: number
|
|
339
|
-
col: number
|
|
340
|
-
rowspan: number
|
|
341
|
-
colspan: number
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export type QiuTableSpanMethod = (params: {
|
|
345
|
-
row: any
|
|
346
|
-
column: QiuTableColumnConfig
|
|
347
|
-
rowIndex: number
|
|
348
|
-
columnIndex: number
|
|
349
|
-
data: any[]
|
|
350
|
-
}) =>
|
|
351
|
-
| { rowspan: number; colspan: number }
|
|
352
|
-
| [number, number]
|
|
353
|
-
| number[]
|
|
354
|
-
| null
|
|
355
|
-
| undefined
|
|
356
|
-
|
|
357
|
-
export interface QiuTablePagerConfig {
|
|
358
|
-
enabled?: boolean
|
|
359
|
-
currentPage?: number
|
|
360
|
-
pageSize?: number
|
|
361
|
-
pageSizes?: number[]
|
|
362
|
-
total?: number
|
|
363
|
-
layouts?: string[]
|
|
364
|
-
background?: boolean
|
|
365
|
-
small?: boolean
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export interface QiuTableFooterMethodParams {
|
|
369
|
-
columns: QiuTableColumnConfig[]
|
|
370
|
-
data: any[]
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export type QiuTableFooterMethod = (params: QiuTableFooterMethodParams) => string[][]
|
|
374
|
-
|
|
375
|
-
export interface QiuTableHeaderCell {
|
|
376
|
-
column: QiuTableColumnConfig & { _key: string }
|
|
377
|
-
label: string
|
|
378
|
-
colspan: number
|
|
379
|
-
rowspan: number
|
|
380
|
-
isLeaf: boolean
|
|
381
|
-
colIndex: number
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
export const QIU_TABLE_REGISTER_KEY = Symbol('qiuTableRegister')
|
|
385
|
-
|
|
386
|
-
export const QIU_EDITOR_TYPES = new Set([
|
|
387
|
-
'switch',
|
|
388
|
-
'select',
|
|
389
|
-
'input',
|
|
390
|
-
'number',
|
|
391
|
-
'date',
|
|
392
|
-
'datetime',
|
|
393
|
-
'time',
|
|
394
|
-
'text',
|
|
395
|
-
])
|
|
396
|
-
|
|
397
|
-
export const QIU_SPECIAL_COL_TYPES = new Set(['selection', 'checkbox', 'index', 'seq', 'radio', 'expand'])
|
|
398
|
-
|
|
399
|
-
export function resolveColumnEditor(
|
|
400
|
-
col: Pick<QiuTableColumnConfig, 'editor' | 'type' | 'editRender'>
|
|
401
|
-
): QiuTableColumnConfig['editor'] | string | undefined {
|
|
402
|
-
const er = resolveEditRender(col)
|
|
403
|
-
if (er?.enabled === false) return undefined
|
|
404
|
-
if (er?.name) {
|
|
405
|
-
if (QIU_EDITOR_TYPES.has(er.name)) return er.name as QiuTableColumnConfig['editor']
|
|
406
|
-
return er.name
|
|
407
|
-
}
|
|
408
|
-
return undefined
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
export function resolveColumnProp(col: QiuTableColumnConfig): string | undefined {
|
|
412
|
-
return col.prop || col.field
|
|
413
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { computed, ref, type Ref } from 'vue'
|
|
2
|
-
import type { QiuTableColumnConfig } from './types'
|
|
3
|
-
import { resolveColumnProp } from './types'
|
|
4
|
-
|
|
5
|
-
export type QiuTableCellPos = {
|
|
6
|
-
rowId: string
|
|
7
|
-
/** 叶子列 prop / field */
|
|
8
|
-
prop: string
|
|
9
|
-
rowIndex: number
|
|
10
|
-
colIndex: number
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 键盘/剪贴板活动单元格与矩形选区
|
|
15
|
-
*/
|
|
16
|
-
export function useTableArea(opts: {
|
|
17
|
-
getRows: () => any[]
|
|
18
|
-
getColumns: () => (QiuTableColumnConfig & { _key: string })[]
|
|
19
|
-
getRowId: (row: any) => string
|
|
20
|
-
}) {
|
|
21
|
-
const activeCell = ref<QiuTableCellPos | null>(null)
|
|
22
|
-
/** 选区对角(与 activeCell 组成矩形) */
|
|
23
|
-
const areaEnd = ref<QiuTableCellPos | null>(null)
|
|
24
|
-
|
|
25
|
-
const leafProps = () =>
|
|
26
|
-
opts
|
|
27
|
-
.getColumns()
|
|
28
|
-
.map((c) => resolveColumnProp(c))
|
|
29
|
-
.filter(Boolean) as string[]
|
|
30
|
-
|
|
31
|
-
const findPos = (rowId: string, prop: string): QiuTableCellPos | null => {
|
|
32
|
-
const rows = opts.getRows()
|
|
33
|
-
const props = leafProps()
|
|
34
|
-
const rowIndex = rows.findIndex((r) => opts.getRowId(r) === rowId)
|
|
35
|
-
const colIndex = props.indexOf(prop)
|
|
36
|
-
if (rowIndex < 0 || colIndex < 0) return null
|
|
37
|
-
return { rowId, prop, rowIndex, colIndex }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const setActive = (row: any, col: QiuTableColumnConfig, extend = false) => {
|
|
41
|
-
const prop = resolveColumnProp(col)
|
|
42
|
-
if (!prop) return
|
|
43
|
-
const pos = findPos(opts.getRowId(row), prop)
|
|
44
|
-
if (!pos) return
|
|
45
|
-
if (extend && activeCell.value) {
|
|
46
|
-
areaEnd.value = pos
|
|
47
|
-
} else {
|
|
48
|
-
activeCell.value = pos
|
|
49
|
-
areaEnd.value = null
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const clearArea = () => {
|
|
54
|
-
activeCell.value = null
|
|
55
|
-
areaEnd.value = null
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const areaBounds = computed(() => {
|
|
59
|
-
const a = activeCell.value
|
|
60
|
-
if (!a) return null
|
|
61
|
-
const b = areaEnd.value || a
|
|
62
|
-
return {
|
|
63
|
-
r0: Math.min(a.rowIndex, b.rowIndex),
|
|
64
|
-
r1: Math.max(a.rowIndex, b.rowIndex),
|
|
65
|
-
c0: Math.min(a.colIndex, b.colIndex),
|
|
66
|
-
c1: Math.max(a.colIndex, b.colIndex),
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
const isCellInArea = (row: any, col: QiuTableColumnConfig) => {
|
|
71
|
-
const bounds = areaBounds.value
|
|
72
|
-
if (!bounds) {
|
|
73
|
-
const a = activeCell.value
|
|
74
|
-
if (!a) return false
|
|
75
|
-
return opts.getRowId(row) === a.rowId && resolveColumnProp(col) === a.prop
|
|
76
|
-
}
|
|
77
|
-
const rows = opts.getRows()
|
|
78
|
-
const props = leafProps()
|
|
79
|
-
const ri = rows.findIndex((r) => opts.getRowId(r) === opts.getRowId(row))
|
|
80
|
-
const ci = props.indexOf(resolveColumnProp(col) || '')
|
|
81
|
-
if (ri < 0 || ci < 0) return false
|
|
82
|
-
return ri >= bounds.r0 && ri <= bounds.r1 && ci >= bounds.c0 && ci <= bounds.c1
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const isActiveCell = (row: any, col: QiuTableColumnConfig) => {
|
|
86
|
-
const a = activeCell.value
|
|
87
|
-
if (!a) return false
|
|
88
|
-
return opts.getRowId(row) === a.rowId && resolveColumnProp(col) === a.prop
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const moveActive = (dRow: number, dCol: number, extend = false) => {
|
|
92
|
-
const rows = opts.getRows()
|
|
93
|
-
const propsList = leafProps()
|
|
94
|
-
if (!rows.length || !propsList.length) return null
|
|
95
|
-
const base = (extend ? areaEnd.value : null) || activeCell.value
|
|
96
|
-
let ri = base?.rowIndex ?? 0
|
|
97
|
-
let ci = base?.colIndex ?? 0
|
|
98
|
-
if (base) {
|
|
99
|
-
ri = Math.max(0, Math.min(rows.length - 1, ri + dRow))
|
|
100
|
-
ci = Math.max(0, Math.min(propsList.length - 1, ci + dCol))
|
|
101
|
-
} else {
|
|
102
|
-
// 无活动格:落在起点(下/右从 0,上/左从末尾)
|
|
103
|
-
ri = dRow < 0 ? rows.length - 1 : 0
|
|
104
|
-
ci = dCol < 0 ? propsList.length - 1 : 0
|
|
105
|
-
}
|
|
106
|
-
const row = rows[ri]
|
|
107
|
-
const prop = propsList[ci]
|
|
108
|
-
const pos: QiuTableCellPos = {
|
|
109
|
-
rowId: opts.getRowId(row),
|
|
110
|
-
prop,
|
|
111
|
-
rowIndex: ri,
|
|
112
|
-
colIndex: ci,
|
|
113
|
-
}
|
|
114
|
-
if (extend && activeCell.value) {
|
|
115
|
-
areaEnd.value = pos
|
|
116
|
-
} else {
|
|
117
|
-
activeCell.value = pos
|
|
118
|
-
areaEnd.value = null
|
|
119
|
-
}
|
|
120
|
-
return { row, prop, pos }
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** 选区 TSV */
|
|
124
|
-
const buildTsv = (formatCell: (row: any, prop: string) => string) => {
|
|
125
|
-
const bounds = areaBounds.value
|
|
126
|
-
const rows = opts.getRows()
|
|
127
|
-
const props = leafProps()
|
|
128
|
-
if (!bounds) {
|
|
129
|
-
const a = activeCell.value
|
|
130
|
-
if (!a) return ''
|
|
131
|
-
return formatCell(rows[a.rowIndex], a.prop)
|
|
132
|
-
}
|
|
133
|
-
const lines: string[] = []
|
|
134
|
-
for (let r = bounds.r0; r <= bounds.r1; r++) {
|
|
135
|
-
const cells: string[] = []
|
|
136
|
-
for (let c = bounds.c0; c <= bounds.c1; c++) {
|
|
137
|
-
const v = formatCell(rows[r], props[c])
|
|
138
|
-
cells.push(String(v ?? '').replace(/\t/g, ' ').replace(/\r?\n/g, ' '))
|
|
139
|
-
}
|
|
140
|
-
lines.push(cells.join('\t'))
|
|
141
|
-
}
|
|
142
|
-
return lines.join('\n')
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/** 从活动格起粘贴 TSV */
|
|
146
|
-
const pasteTsv = (
|
|
147
|
-
text: string,
|
|
148
|
-
apply: (row: any, prop: string, value: string) => void
|
|
149
|
-
) => {
|
|
150
|
-
const a = activeCell.value
|
|
151
|
-
if (!a) return
|
|
152
|
-
const rows = opts.getRows()
|
|
153
|
-
const props = leafProps()
|
|
154
|
-
const matrix = text
|
|
155
|
-
.replace(/\r\n/g, '\n')
|
|
156
|
-
.replace(/\r/g, '\n')
|
|
157
|
-
.split('\n')
|
|
158
|
-
.filter((line, i, arr) => !(i === arr.length - 1 && line === ''))
|
|
159
|
-
.map((line) => line.split('\t'))
|
|
160
|
-
for (let r = 0; r < matrix.length; r++) {
|
|
161
|
-
const row = rows[a.rowIndex + r]
|
|
162
|
-
if (!row) break
|
|
163
|
-
for (let c = 0; c < matrix[r].length; c++) {
|
|
164
|
-
const prop = props[a.colIndex + c]
|
|
165
|
-
if (!prop) break
|
|
166
|
-
apply(row, prop, matrix[r][c])
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const clearAreaValues = (apply: (row: any, prop: string, value: string) => void) => {
|
|
172
|
-
const bounds = areaBounds.value
|
|
173
|
-
const rows = opts.getRows()
|
|
174
|
-
const props = leafProps()
|
|
175
|
-
if (!bounds) {
|
|
176
|
-
const a = activeCell.value
|
|
177
|
-
if (!a) return
|
|
178
|
-
apply(rows[a.rowIndex], a.prop, '')
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
for (let r = bounds.r0; r <= bounds.r1; r++) {
|
|
182
|
-
for (let c = bounds.c0; c <= bounds.c1; c++) {
|
|
183
|
-
apply(rows[r], props[c], '')
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
activeCell: activeCell as Ref<QiuTableCellPos | null>,
|
|
190
|
-
areaEnd,
|
|
191
|
-
areaBounds,
|
|
192
|
-
setActive,
|
|
193
|
-
clearArea,
|
|
194
|
-
isCellInArea,
|
|
195
|
-
isActiveCell,
|
|
196
|
-
moveActive,
|
|
197
|
-
buildTsv,
|
|
198
|
-
pasteTsv,
|
|
199
|
-
clearAreaValues,
|
|
200
|
-
findPos,
|
|
201
|
-
}
|
|
202
|
-
}
|