@cpsoft13/z-agent-ui 0.1.0 → 0.2.1
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 +16 -0
- package/README.zh-CN.md +16 -0
- package/bin/check-guards.mjs +2 -0
- package/bin/lines-baseline.json +1 -1
- package/bin/text-baseline.json +39 -0
- package/bin/text-guard.mjs +211 -0
- package/dist/app/app-nav/AppNav.js +34 -32
- package/dist/app/app-nav/AppNav.js.map +1 -1
- package/dist/app/app-shell/AppShell.js +17 -14
- package/dist/app/app-shell/AppShell.js.map +1 -1
- package/dist/app/app-switcher/AppSwitcher.js +14 -12
- package/dist/app/app-switcher/AppSwitcher.js.map +1 -1
- package/dist/app/detail-form/DetailForm.js +8 -5
- package/dist/app/detail-form/DetailForm.js.map +1 -1
- package/dist/app/login/Login.js +26 -23
- package/dist/app/login/Login.js.map +1 -1
- package/dist/app/print/Print.js +19 -16
- package/dist/app/print/Print.js.map +1 -1
- package/dist/app/print/snapshot.js +4 -2
- package/dist/app/print/snapshot.js.map +1 -1
- package/dist/build-info.json +3 -3
- package/dist/components/accordion/Accordion.js +17 -14
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/accordion-item/AccordionItem.js +17 -14
- package/dist/components/accordion-item/AccordionItem.js.map +1 -1
- package/dist/components/alert/Alert.js +13 -11
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/anchor/Anchor.js +8 -5
- package/dist/components/anchor/Anchor.js.map +1 -1
- package/dist/components/avatar/Avatar.js +15 -12
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/badge/Badge.js +16 -13
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +18 -15
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.js +42 -39
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/calendar/Calendar.js +34 -32
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/card/Card.js +8 -5
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/checkbox/Checkbox.js +15 -12
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/command/Command.js +45 -42
- package/dist/components/command/Command.js.map +1 -1
- package/dist/components/context-menu/ContextMenu.js +22 -19
- package/dist/components/context-menu/ContextMenu.js.map +1 -1
- package/dist/components/date-range/DateRange.js +17 -15
- package/dist/components/date-range/DateRange.js.map +1 -1
- package/dist/components/datepicker/Datepicker.js +57 -55
- package/dist/components/datepicker/Datepicker.js.map +1 -1
- package/dist/components/datepicker/calendar.js +6 -4
- package/dist/components/datepicker/calendar.js.map +1 -1
- package/dist/components/datepicker/time-row.js +17 -15
- package/dist/components/datepicker/time-row.js.map +1 -1
- package/dist/components/descriptions/Descriptions.js +18 -15
- package/dist/components/descriptions/Descriptions.js.map +1 -1
- package/dist/components/descriptions/DescriptionsItem.js +14 -11
- package/dist/components/descriptions/DescriptionsItem.js.map +1 -1
- package/dist/components/divider/Divider.js +22 -19
- package/dist/components/divider/Divider.js.map +1 -1
- package/dist/components/drawer/Drawer.js +37 -35
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/embed/Embed.js +40 -36
- package/dist/components/embed/Embed.js.map +1 -1
- package/dist/components/empty/Empty.js +11 -8
- package/dist/components/empty/Empty.js.map +1 -1
- package/dist/components/flex/Flex.js +6 -3
- package/dist/components/flex/Flex.js.map +1 -1
- package/dist/components/form/Form.js +17 -14
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form-item/FormItem.js +11 -8
- package/dist/components/form-item/FormItem.js.map +1 -1
- package/dist/components/grid/Grid.js +20 -17
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/grid/GridCol.js +21 -18
- package/dist/components/grid/GridCol.js.map +1 -1
- package/dist/components/image/Image.js +12 -9
- package/dist/components/image/Image.js.map +1 -1
- package/dist/components/input/Input.js +7 -5
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/m-action-bar/MActionBar.js +8 -5
- package/dist/components/m-action-bar/MActionBar.js.map +1 -1
- package/dist/components/m-action-sheet/MActionSheet.js +26 -23
- package/dist/components/m-action-sheet/MActionSheet.js.map +1 -1
- package/dist/components/m-card/MCard.js +15 -12
- package/dist/components/m-card/MCard.js.map +1 -1
- package/dist/components/m-cell/MCell.js +14 -11
- package/dist/components/m-cell/MCell.js.map +1 -1
- package/dist/components/m-cell-group/MCellGroup.js +17 -14
- package/dist/components/m-cell-group/MCellGroup.js.map +1 -1
- package/dist/components/m-checkbox/MCheckbox.js +10 -7
- package/dist/components/m-checkbox/MCheckbox.js.map +1 -1
- package/dist/components/m-checkout-bar/MCheckoutBar.js +23 -20
- package/dist/components/m-checkout-bar/MCheckoutBar.js.map +1 -1
- package/dist/components/m-chip/MChip.js +15 -12
- package/dist/components/m-chip/MChip.js.map +1 -1
- package/dist/components/m-collapse/MCollapse.js +24 -21
- package/dist/components/m-collapse/MCollapse.js.map +1 -1
- package/dist/components/m-countdown/MCountdown.js +17 -14
- package/dist/components/m-countdown/MCountdown.js.map +1 -1
- package/dist/components/m-coupon/MCoupon.js +56 -53
- package/dist/components/m-coupon/MCoupon.js.map +1 -1
- package/dist/components/m-empty/MEmpty.js +13 -10
- package/dist/components/m-empty/MEmpty.js.map +1 -1
- package/dist/components/m-floating-button/MFloatingButton.js +17 -14
- package/dist/components/m-floating-button/MFloatingButton.js.map +1 -1
- package/dist/components/m-goods-card/MGoodsCard.js +28 -25
- package/dist/components/m-goods-card/MGoodsCard.js.map +1 -1
- package/dist/components/m-grid/MGrid.js +20 -17
- package/dist/components/m-grid/MGrid.js.map +1 -1
- package/dist/components/m-grid-item/MGridItem.js +21 -18
- package/dist/components/m-grid-item/MGridItem.js.map +1 -1
- package/dist/components/m-image-preview/MImagePreview.js +24 -22
- package/dist/components/m-image-preview/MImagePreview.js.map +1 -1
- package/dist/components/m-index-bar/MIndexBar.js +21 -18
- package/dist/components/m-index-bar/MIndexBar.js.map +1 -1
- package/dist/components/m-list/MList.js +33 -30
- package/dist/components/m-list/MList.js.map +1 -1
- package/dist/components/m-navbar/MNavbar.js +23 -20
- package/dist/components/m-navbar/MNavbar.js.map +1 -1
- package/dist/components/m-notice-bar/MNoticeBar.js +14 -12
- package/dist/components/m-notice-bar/MNoticeBar.js.map +1 -1
- package/dist/components/m-number-keyboard/MNumberKeyboard.js +18 -16
- package/dist/components/m-number-keyboard/MNumberKeyboard.js.map +1 -1
- package/dist/components/m-picker/MPicker.js +7 -5
- package/dist/components/m-picker/MPicker.js.map +1 -1
- package/dist/components/m-price/MPrice.js +8 -5
- package/dist/components/m-price/MPrice.js.map +1 -1
- package/dist/components/m-pull-refresh/MPullRefresh.js +25 -22
- package/dist/components/m-pull-refresh/MPullRefresh.js.map +1 -1
- package/dist/components/m-radio/MRadio.js +12 -9
- package/dist/components/m-radio/MRadio.js.map +1 -1
- package/dist/components/m-radio/MRadioGroup.js +12 -9
- package/dist/components/m-radio/MRadioGroup.js.map +1 -1
- package/dist/components/m-search/MSearch.js +26 -23
- package/dist/components/m-search/MSearch.js.map +1 -1
- package/dist/components/m-sku-picker/MSkuPicker.js +37 -35
- package/dist/components/m-sku-picker/MSkuPicker.js.map +1 -1
- package/dist/components/m-stepper/MStepper.js +23 -20
- package/dist/components/m-stepper/MStepper.js.map +1 -1
- package/dist/components/m-swipe-cell/MSwipeCell.js +7 -5
- package/dist/components/m-swipe-cell/MSwipeCell.js.map +1 -1
- package/dist/components/m-swiper/MSwiper.js +44 -41
- package/dist/components/m-swiper/MSwiper.js.map +1 -1
- package/dist/components/m-tabbar/MTabbar.js +12 -9
- package/dist/components/m-tabbar/MTabbar.js.map +1 -1
- package/dist/components/m-tabs/MTabs.js +33 -30
- package/dist/components/m-tabs/MTabs.js.map +1 -1
- package/dist/components/m-uploader/MUploader.js +23 -20
- package/dist/components/m-uploader/MUploader.js.map +1 -1
- package/dist/components/menu/Menu.js +35 -32
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/menu/menu-panel.js +10 -8
- package/dist/components/menu/menu-panel.js.map +1 -1
- package/dist/components/menu-item/MenuItem.js +16 -13
- package/dist/components/menu-item/MenuItem.js.map +1 -1
- package/dist/components/modal/Modal.js +14 -12
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/number-input/NumberInput.js +11 -9
- package/dist/components/number-input/NumberInput.js.map +1 -1
- package/dist/components/option/Option.js +15 -12
- package/dist/components/option/Option.js.map +1 -1
- package/dist/components/pagination/Pagination.js +43 -41
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/popconfirm/Popconfirm.js +16 -14
- package/dist/components/popconfirm/Popconfirm.js.map +1 -1
- package/dist/components/popover/Popover.js +20 -17
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/progress/Progress.js +17 -14
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/radio/Radio.js +8 -5
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.js +19 -16
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/rate/Rate.js +16 -13
- package/dist/components/rate/Rate.js.map +1 -1
- package/dist/components/result/Result.js +18 -15
- package/dist/components/result/Result.js.map +1 -1
- package/dist/components/search-bar/SearchBar.js +13 -11
- package/dist/components/search-bar/SearchBar.js.map +1 -1
- package/dist/components/segmented/Segmented.js +21 -18
- package/dist/components/segmented/Segmented.js.map +1 -1
- package/dist/components/select/Select.js +44 -42
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/sidebar/Sidebar.js +20 -17
- package/dist/components/sidebar/Sidebar.js.map +1 -1
- package/dist/components/skeleton/Skeleton.js +17 -14
- package/dist/components/skeleton/Skeleton.js.map +1 -1
- package/dist/components/slider/Slider.js +30 -27
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/space/Space.js +8 -5
- package/dist/components/space/Space.js.map +1 -1
- package/dist/components/spinner/Spinner.js +15 -12
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/statistic/Statistic.js +16 -13
- package/dist/components/statistic/Statistic.js.map +1 -1
- package/dist/components/steps/Steps.js +10 -7
- package/dist/components/steps/Steps.js.map +1 -1
- package/dist/components/sticky/Sticky.js +20 -17
- package/dist/components/sticky/Sticky.js.map +1 -1
- package/dist/components/switch/Switch.js +15 -12
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/tab-panel/TabPanel.js +14 -11
- package/dist/components/tab-panel/TabPanel.js.map +1 -1
- package/dist/components/table/Table.js +12 -10
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/tabs/Tabs.js +44 -41
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.js +26 -24
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/textarea/Textarea.js +11 -8
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/time-picker/TimePicker.js +47 -44
- package/dist/components/time-picker/TimePicker.js.map +1 -1
- package/dist/components/timeline/Timeline.js +20 -17
- package/dist/components/timeline/Timeline.js.map +1 -1
- package/dist/components/toast/Toast.js +2 -0
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/tooltip/Tooltip.js +18 -15
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tree/Tree.js +9 -7
- package/dist/components/tree/Tree.js.map +1 -1
- package/dist/components/tree-node/TreeNode.js +16 -13
- package/dist/components/tree-node/TreeNode.js.map +1 -1
- package/dist/components/typography/Typography.js +49 -46
- package/dist/components/typography/Typography.js.map +1 -1
- package/dist/components/upload/Upload.js +8 -5
- package/dist/components/upload/Upload.js.map +1 -1
- package/dist/components/virtual-list/VirtualList.js +13 -11
- package/dist/components/virtual-list/VirtualList.js.map +1 -1
- package/dist/components/watermark/Watermark.js +10 -7
- package/dist/components/watermark/Watermark.js.map +1 -1
- package/dist/content/code-editor/CodeEditor.js +28 -26
- package/dist/content/code-editor/CodeEditor.js.map +1 -1
- package/dist/content/code-editor/highlight.js +8 -6
- package/dist/content/code-editor/highlight.js.map +1 -1
- package/dist/content/json-viewer/JsonViewer.js +40 -37
- package/dist/content/json-viewer/JsonViewer.js.map +1 -1
- package/dist/content/markdown/Markdown.js +22 -20
- package/dist/content/markdown/Markdown.js.map +1 -1
- package/dist/content/rich-text/RichText.js +66 -60
- package/dist/content/rich-text/RichText.js.map +1 -1
- package/dist/core/BaseElement.js +82 -27
- package/dist/core/BaseElement.js.map +1 -1
- package/dist/core/copy.js +14 -196
- package/dist/core/copy.js.map +1 -1
- package/dist/core/decorators.js +84 -68
- package/dist/core/decorators.js.map +1 -1
- package/dist/core/define.js +7 -0
- package/dist/core/define.js.map +1 -0
- package/dist/core/format.js +26 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/i18n.js +139 -0
- package/dist/core/i18n.js.map +1 -0
- package/dist/core/locales/en-US.js +274 -0
- package/dist/core/locales/en-US.js.map +1 -0
- package/dist/core/locales/zh-CN.js +318 -0
- package/dist/core/locales/zh-CN.js.map +1 -0
- package/dist/core/morph.js +72 -0
- package/dist/core/morph.js.map +1 -0
- package/dist/core/public.js +30 -16
- package/dist/core/public.js.map +1 -1
- package/dist/core/template.js +31 -8
- package/dist/core/template.js.map +1 -1
- package/dist/core.js +87 -69
- package/dist/core.js.map +1 -1
- package/dist/doc/doc-template-editor-core.js +46 -45
- package/dist/doc/doc-template-editor-core.js.map +1 -1
- package/dist/doc/editor-html.js +44 -42
- package/dist/doc/editor-html.js.map +1 -1
- package/dist/doc/editor-page-layout.js +8 -6
- package/dist/doc/editor-page-layout.js.map +1 -1
- package/dist/doc/editor.js +46 -42
- package/dist/doc/editor.js.map +1 -1
- package/dist/doc/manager.js +38 -36
- package/dist/doc/manager.js.map +1 -1
- package/dist/doc/preview.js +61 -59
- package/dist/doc/preview.js.map +1 -1
- package/dist/doc/render.js +48 -46
- package/dist/doc/render.js.map +1 -1
- package/dist/flow/Flow.js +48 -45
- package/dist/flow/Flow.js.map +1 -1
- package/dist/flow/FlowControls.js +20 -17
- package/dist/flow/FlowControls.js.map +1 -1
- package/dist/flow/FlowHandle.js +26 -23
- package/dist/flow/FlowHandle.js.map +1 -1
- package/dist/flow/FlowMinimap.js +27 -24
- package/dist/flow/FlowMinimap.js.map +1 -1
- package/dist/flow/FlowNode.js +29 -26
- package/dist/flow/FlowNode.js.map +1 -1
- package/dist/flow/flow-geometry.js +34 -32
- package/dist/flow/flow-geometry.js.map +1 -1
- package/dist/primitives/portal/Portal.js +14 -11
- package/dist/primitives/portal/Portal.js.map +1 -1
- package/dist/primitives/position/Position.js +10 -7
- package/dist/primitives/position/Position.js.map +1 -1
- package/dist/property/group/PropertyGroup.js +14 -11
- package/dist/property/group/PropertyGroup.js.map +1 -1
- package/dist/property/panel/PropertyPanel.js +10 -7
- package/dist/property/panel/PropertyPanel.js.map +1 -1
- package/dist/property/row/PropertyRow.js +27 -24
- package/dist/property/row/PropertyRow.js.map +1 -1
- package/dist/react.js +15 -13
- package/dist/react.js.map +1 -1
- package/dist/report/cell/base-cell.js +8 -6
- package/dist/report/cell/base-cell.js.map +1 -1
- package/dist/report/chart/Chart.js +75 -73
- package/dist/report/chart/Chart.js.map +1 -1
- package/dist/report/chart/ChartAxis.js +9 -6
- package/dist/report/chart/ChartAxis.js.map +1 -1
- package/dist/report/chart/ChartSeries.js +6 -3
- package/dist/report/chart/ChartSeries.js.map +1 -1
- package/dist/report/chart/interaction/tooltip.js +10 -8
- package/dist/report/chart/interaction/tooltip.js.map +1 -1
- package/dist/report/chart/renderer/svg.js +10 -8
- package/dist/report/chart/renderer/svg.js.map +1 -1
- package/dist/report/column-selector/ColumnSelector.js +116 -72
- package/dist/report/column-selector/ColumnSelector.js.map +1 -1
- package/dist/report/column-selector/column-selector.css.js +4 -4
- package/dist/report/column-selector/column-selector.css.js.map +1 -1
- package/dist/report/core/report-columns.js +43 -39
- package/dist/report/core/report-columns.js.map +1 -1
- package/dist/report/core/report-group.js +4 -2
- package/dist/report/core/report-group.js.map +1 -1
- package/dist/report/core/report-kpi.js +42 -37
- package/dist/report/core/report-kpi.js.map +1 -1
- package/dist/report/data-list/DataList.js +12 -10
- package/dist/report/data-list/DataList.js.map +1 -1
- package/dist/report/data-list/data-list-render.js +11 -9
- package/dist/report/data-list/data-list-render.js.map +1 -1
- package/dist/report/elements/card-render.js +76 -64
- package/dist/report/elements/card-render.js.map +1 -1
- package/dist/report/elements/report-card.js +45 -43
- package/dist/report/elements/report-card.js.map +1 -1
- package/dist/report/elements/report-group-table.js +31 -29
- package/dist/report/elements/report-group-table.js.map +1 -1
- package/dist/report/gantt/Gantt.js +42 -40
- package/dist/report/gantt/Gantt.js.map +1 -1
- package/dist/report/gantt/chart-render.js +6 -4
- package/dist/report/gantt/chart-render.js.map +1 -1
- package/dist/report/gantt/gantt-view.js +3 -2
- package/dist/report/gantt/gantt-view.js.map +1 -1
- package/dist/report/gantt/left-list.js +14 -12
- package/dist/report/gantt/left-list.js.map +1 -1
- package/dist/report/table/ReportTable.js +102 -86
- package/dist/report/table/ReportTable.js.map +1 -1
- package/dist/report/table/cell-semantic.css.js +17 -0
- package/dist/report/table/cell-semantic.css.js.map +1 -1
- package/dist/report/table/column-config-panel.js +12 -10
- package/dist/report/table/column-config-panel.js.map +1 -1
- package/dist/report/table/report-table-pager.js +7 -5
- package/dist/report/table/report-table-pager.js.map +1 -1
- package/dist/report/table/report-table-tools.js +13 -0
- package/dist/report/table/report-table-tools.js.map +1 -0
- package/dist/report/table/report-table-types.js +8 -6
- package/dist/report/table/report-table-types.js.map +1 -1
- package/dist/report/table/table-render.js +30 -28
- package/dist/report/table/table-render.js.map +1 -1
- package/dist/report/table/table-virtual.js +38 -0
- package/dist/report/table/table-virtual.js.map +1 -0
- package/dist/types/core/BaseElement.d.ts +24 -2
- package/dist/types/core/copy.d.ts +4 -206
- package/dist/types/core/define.d.ts +1 -0
- package/dist/types/core/format.d.ts +10 -0
- package/dist/types/core/i18n.d.ts +50 -0
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/core/locales/en-US.d.ts +3 -0
- package/dist/types/core/locales/zh-CN.d.ts +299 -0
- package/dist/types/core/morph.d.ts +2 -0
- package/dist/types/core/public.d.ts +4 -1
- package/dist/types/core/template.d.ts +18 -0
- package/dist/types/react/index.d.ts +6 -0
- package/dist/types/report/column-selector/ColumnSelector.d.ts +34 -17
- package/dist/types/report/elements/card-render.d.ts +1 -1
- package/dist/types/report/table/ReportTable.d.ts +6 -0
- package/dist/types/report/table/report-table-tools.d.ts +17 -0
- package/dist/types/report/table/report-table-types.d.ts +14 -0
- package/dist/types/report/table/table-virtual.d.ts +24 -0
- package/dist/z-agent-ui.js +30 -16
- package/dist/z-agent-ui.js.map +1 -1
- package/package.json +15 -2
- package/registry/component-manifest.json +26 -4
- package/src/components/accordion/Accordion.ts +2 -2
- package/src/components/accordion-item/AccordionItem.ts +2 -2
- package/src/components/alert/Alert.ts +2 -2
- package/src/components/anchor/Anchor.ts +2 -2
- package/src/components/avatar/Avatar.ts +2 -2
- package/src/components/badge/Badge.ts +2 -2
- package/src/components/breadcrumb/Breadcrumb.ts +2 -2
- package/src/components/button/Button.ts +2 -2
- package/src/components/calendar/Calendar.ts +2 -2
- package/src/components/card/Card.ts +2 -2
- package/src/components/checkbox/Checkbox.ts +2 -2
- package/src/components/command/Command.ts +7 -7
- package/src/components/context-menu/ContextMenu.ts +2 -2
- package/src/components/date-range/DateRange.ts +3 -3
- package/src/components/datepicker/Datepicker.ts +5 -5
- package/src/components/datepicker/time-row.ts +7 -7
- package/src/components/descriptions/Descriptions.ts +2 -2
- package/src/components/descriptions/DescriptionsItem.ts +2 -2
- package/src/components/divider/Divider.ts +2 -2
- package/src/components/drawer/Drawer.ts +2 -2
- package/src/components/embed/Embed.ts +9 -9
- package/src/components/empty/Empty.ts +2 -2
- package/src/components/flex/Flex.ts +2 -2
- package/src/components/form/Form.ts +2 -2
- package/src/components/form-item/FormItem.ts +2 -2
- package/src/components/grid/Grid.ts +2 -2
- package/src/components/grid/GridCol.ts +2 -2
- package/src/components/image/Image.ts +2 -2
- package/src/components/input/Input.ts +2 -2
- package/src/components/m-action-bar/MActionBar.ts +2 -2
- package/src/components/m-action-sheet/MActionSheet.ts +3 -3
- package/src/components/m-card/MCard.ts +2 -2
- package/src/components/m-cell/MCell.ts +2 -2
- package/src/components/m-cell-group/MCellGroup.ts +2 -2
- package/src/components/m-checkbox/MCheckbox.ts +2 -2
- package/src/components/m-checkout-bar/MCheckoutBar.ts +7 -7
- package/src/components/m-chip/MChip.ts +2 -2
- package/src/components/m-collapse/MCollapse.ts +2 -2
- package/src/components/m-countdown/MCountdown.ts +3 -3
- package/src/components/m-coupon/MCoupon.ts +13 -9
- package/src/components/m-empty/MEmpty.ts +2 -2
- package/src/components/m-floating-button/MFloatingButton.ts +2 -2
- package/src/components/m-goods-card/MGoodsCard.ts +4 -4
- package/src/components/m-grid/MGrid.ts +2 -2
- package/src/components/m-grid-item/MGridItem.ts +2 -2
- package/src/components/m-image-preview/MImagePreview.ts +3 -3
- package/src/components/m-index-bar/MIndexBar.ts +3 -3
- package/src/components/m-list/MList.ts +5 -5
- package/src/components/m-navbar/MNavbar.ts +3 -3
- package/src/components/m-notice-bar/MNoticeBar.ts +2 -2
- package/src/components/m-number-keyboard/MNumberKeyboard.ts +2 -2
- package/src/components/m-picker/MPicker.ts +2 -2
- package/src/components/m-price/MPrice.ts +2 -2
- package/src/components/m-pull-refresh/MPullRefresh.ts +5 -5
- package/src/components/m-radio/MRadio.ts +2 -2
- package/src/components/m-radio/MRadioGroup.ts +2 -2
- package/src/components/m-search/MSearch.ts +6 -6
- package/src/components/m-sku-picker/MSkuPicker.ts +9 -9
- package/src/components/m-stepper/MStepper.ts +4 -4
- package/src/components/m-swipe-cell/MSwipeCell.ts +2 -2
- package/src/components/m-swiper/MSwiper.ts +5 -5
- package/src/components/m-tabbar/MTabbar.ts +2 -2
- package/src/components/m-tabs/MTabs.ts +2 -2
- package/src/components/m-uploader/MUploader.ts +8 -8
- package/src/components/menu/Menu.ts +2 -2
- package/src/components/menu-item/MenuItem.ts +2 -2
- package/src/components/modal/Modal.ts +2 -2
- package/src/components/number-input/NumberInput.ts +2 -2
- package/src/components/option/Option.ts +2 -2
- package/src/components/pagination/Pagination.ts +2 -2
- package/src/components/popconfirm/Popconfirm.ts +3 -3
- package/src/components/popover/Popover.ts +2 -2
- package/src/components/progress/Progress.ts +2 -2
- package/src/components/radio/Radio.ts +2 -2
- package/src/components/radio-group/RadioGroup.ts +2 -2
- package/src/components/rate/Rate.ts +2 -2
- package/src/components/result/Result.ts +2 -2
- package/src/components/search-bar/SearchBar.ts +3 -3
- package/src/components/segmented/Segmented.ts +2 -2
- package/src/components/select/Select.ts +6 -6
- package/src/components/sidebar/Sidebar.ts +2 -2
- package/src/components/skeleton/Skeleton.ts +2 -2
- package/src/components/slider/Slider.ts +2 -2
- package/src/components/space/Space.ts +2 -2
- package/src/components/spinner/Spinner.ts +2 -2
- package/src/components/statistic/Statistic.ts +2 -2
- package/src/components/steps/Steps.ts +2 -2
- package/src/components/sticky/Sticky.ts +2 -2
- package/src/components/switch/Switch.ts +2 -2
- package/src/components/tab-panel/TabPanel.ts +2 -2
- package/src/components/table/Table.ts +2 -2
- package/src/components/tabs/Tabs.ts +2 -2
- package/src/components/tag/Tag.ts +2 -2
- package/src/components/textarea/Textarea.ts +2 -2
- package/src/components/time-picker/TimePicker.ts +2 -2
- package/src/components/timeline/Timeline.ts +2 -2
- package/src/components/tooltip/Tooltip.ts +2 -2
- package/src/components/tree/Tree.ts +2 -2
- package/src/components/tree-node/TreeNode.ts +2 -2
- package/src/components/typography/Typography.ts +3 -3
- package/src/components/upload/Upload.ts +2 -2
- package/src/components/virtual-list/VirtualList.ts +2 -2
- package/src/components/watermark/Watermark.ts +2 -2
|
@@ -1,69 +1,73 @@
|
|
|
1
|
-
import { BaseElement as
|
|
1
|
+
import { BaseElement as O } from "../../core/BaseElement.js";
|
|
2
2
|
import { property as i } from "../../core/decorators.js";
|
|
3
|
-
import {
|
|
3
|
+
import { html as u, escapeAttr as M } from "../../core/template.js";
|
|
4
|
+
import "../../core/i18n.js";
|
|
4
5
|
import "../../core/date/presets.js";
|
|
5
|
-
import { observeLegacyAttribute as
|
|
6
|
-
import { COPY as
|
|
6
|
+
import { observeLegacyAttribute as K } from "../../core/legacyAttr.js";
|
|
7
|
+
import { COPY as a } from "../../core/copy.js";
|
|
8
|
+
import { defineElement as k } from "../../core/define.js";
|
|
7
9
|
import "../column-selector/ColumnSelector.js";
|
|
8
10
|
import L from "./report-table.css.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
+
import H from "./report-table-grouped.css.js";
|
|
12
|
+
import E from "./cell-semantic.css.js";
|
|
11
13
|
import P from "./report-table-body.css.js";
|
|
12
|
-
import
|
|
13
|
-
import { handleColumnConfigClick as
|
|
14
|
-
import { takeConfigSnapshot as
|
|
14
|
+
import B from "./report-table-fixed.css.js";
|
|
15
|
+
import { handleColumnConfigClick as q } from "./column-config-panel.js";
|
|
16
|
+
import { takeConfigSnapshot as W, applyConfigSnapshot as A, writePersistedColumnView as $, readPersistedColumnView as F, applyPersistedColumnView as D, reorderColumnsByKeys as U } from "./report-table-config.js";
|
|
15
17
|
import { renderPager as I } from "./report-table-pager.js";
|
|
18
|
+
import { ensureToolsSelector as N, syncToolsSelector as j } from "./report-table-tools.js";
|
|
16
19
|
import "../../primitives/portal/Portal.js";
|
|
17
20
|
import "../../primitives/position/Position.js";
|
|
18
|
-
import { roveByKey as
|
|
19
|
-
import { rowKeyOf as
|
|
20
|
-
import { dataViewRows as
|
|
21
|
-
import { sortRows as
|
|
22
|
-
import { mountTableCells as
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
import { roveByKey as V, gridIntent as G, resolveCell as X, sameCell as Y, roveTo as b } from "../../primitives/roving/roving.js";
|
|
22
|
+
import { rowKeyOf as J } from "./report-table-types.js";
|
|
23
|
+
import { dataViewRows as Q, groupViewRows as Z, paginateViewRows as tt } from "./table-view-rows.js";
|
|
24
|
+
import { sortRows as v, computeFixedOffsets as et, renderHeadRows as st, renderHeaderTipDefs as ot, renderEmptyRow as it, renderBodyRows as rt, renderFooter as nt } from "./table-render.js";
|
|
25
|
+
import { mountTableCells as lt } from "./table-cell-mount.js";
|
|
26
|
+
import { handleVirtualScroll as at, renderTableBody as ht } from "./table-virtual.js";
|
|
27
|
+
import { handleHeadMouseDown as pt, handleResizeMouseMove as ct, handleResizeMouseUp as dt, handleHeadClick as ut, handleCellClick as gt, handleRowClick as ft, handleTableChange as yt, countSelected as _t, bindColumnReorder as mt } from "./table-interactions.js";
|
|
28
|
+
var wt = Object.defineProperty, r = (x, t, e, s) => {
|
|
29
|
+
for (var n = void 0, l = x.length - 1, h; l >= 0; l--)
|
|
30
|
+
(h = x[l]) && (n = h(t, e, n) || n);
|
|
31
|
+
return n && wt(t, e, n), n;
|
|
28
32
|
};
|
|
29
|
-
const
|
|
33
|
+
const R = 32, St = 24, bt = 2e3, C = class C extends O {
|
|
30
34
|
constructor() {
|
|
31
|
-
super(...arguments), this.selectedRowId = "", this.rowClass = null, this.columns = [], this.data = [], this.sortState = [], this.selectedKeys = [], this.selectable = !1, this.editable = !1, this.resizable = !1, this.showColumnSelector = !0, this.persistKey = "", this.rowClickable = !0, this.sortMode = "client", this.rowKey = "", this.draftMode = !1, this.showFooter = !1, this.striped = !1, this.bordered = !1, this.lines = !1, this.size = "md", this.loading = !1, this.maxHeight = "", this.emptyText =
|
|
32
|
-
var
|
|
35
|
+
super(...arguments), this.selectedRowId = "", this.rowClass = null, this.columns = [], this.data = [], this.sortState = [], this.selectedKeys = [], this.selectable = !1, this.editable = !1, this.resizable = !1, this.showColumnSelector = !0, this.persistKey = "", this.rowClickable = !0, this.sortMode = "client", this.rowKey = "", this.draftMode = !1, this.showFooter = !1, this.striped = !1, this.bordered = !1, this.virtual = !1, this.rowHeight = 36, this.lines = !1, this.size = "md", this.loading = !1, this.maxHeight = "", this.emptyText = a.empty, this.loadingText = a.loading, this.footerLabel = a.total, this.requiredColumnText = a.requiredField, this.reorderColumnText = a.reorderColumn, this.footerToggleText = a.total, this.columnSettingsText = a.columnSettings, this.alignLeftText = a.alignLeft, this.alignCenterText = a.alignCenter, this.alignRightText = a.alignRight, this.pinNoneText = a.pinNone, this.pinLeftText = a.pinLeft, this.pinRightText = a.pinRight, this.columnsText = a.columns, this.colFormats = {}, this.formatTypeText = a.formatLabel, this.numberText = a.numberFormat, this.percentText = a.percentFormat, this.decimalPlacesText = a.decimalPlaces, this.thousandsText = a.thousandsSep, this.autoText = a.autoOption, this.columnSelectorOpen = !1, this._configOpen = null, this.group = null, this.tree = null, this.pageSize = 0, this.page = 1, this.pageMode = "client", this.totalRecords = 0, this.pagerTotalText = a.pagerTotal, this.pagerPageText = a.pagerPage, this.prevPageText = a.prevPage, this.nextPageText = a.nextPage, this.pageSizeOptions = "", this.pagerSizeText = a.pagerSize, this.pagerSizeLabel = a.pagerSizeLabel, this._collapsed = /* @__PURE__ */ new Set(), this._vState = { scrollTop: 0, viewportH: 0, start: 0, end: 0 }, this._cursor = null, this._refocusThKey = null, this._refocusSelector = null, this._paged = { rows: [], total: null, page: 1, pageCount: 1, totalRows: 0 }, this._columnWidths = /* @__PURE__ */ new Map(), this._resizeInfo = null, this._leftOffsets = /* @__PURE__ */ new Map(), this._rightOffsets = /* @__PURE__ */ new Map(), this._eventsBound = !1, this._scrollWrapper = null, this._dragKey = null, this._sortedRows = [], this._selectorEl = null, this._onHeadMouseDown = (t) => pt(t, this._interactionHost), this._onResizeMouseMove = (t) => ct(t, this._interactionHost), this._onResizeMouseUp = () => dt(this._interactionHost), this._unbindColDrag = null, this._onHeadClick = (t) => ut(t, this._interactionHost), this._onShadowKeydown = (t) => {
|
|
36
|
+
var m, S, w, p;
|
|
33
37
|
if (t.key === "Escape" && (this.columnSelectorOpen || this._configOpen)) {
|
|
34
38
|
this.columnSelectorOpen = !1, this._configOpen = null, this.requestUpdate();
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
|
-
const e = (S = (
|
|
41
|
+
const e = (S = (m = t.target).closest) == null ? void 0 : S.call(m, ".z-rpt__th--sortable");
|
|
38
42
|
if (e) {
|
|
39
43
|
if (t.key === "Enter" || t.key === " ") {
|
|
40
44
|
t.preventDefault(), e.click();
|
|
41
45
|
return;
|
|
42
46
|
}
|
|
43
|
-
|
|
47
|
+
V(this._sortableThs(), e, t.key, { wrap: !1, axis: "horizontal" }) && t.preventDefault();
|
|
44
48
|
return;
|
|
45
49
|
}
|
|
46
50
|
const s = (p = (w = t.target).closest) == null ? void 0 : p.call(w, ".z-rpt__td");
|
|
47
51
|
if (!s) return;
|
|
48
|
-
const n =
|
|
52
|
+
const n = G(t.key, t);
|
|
49
53
|
if (!n) return;
|
|
50
|
-
const l = s.parentElement,
|
|
51
|
-
if (c < 0 ||
|
|
52
|
-
const g = { row: c, col:
|
|
53
|
-
if (t.preventDefault(),
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const l = s.parentElement, h = this._gridRows(), c = l ? h.indexOf(l) : -1, d = l ? Array.from(l.children).indexOf(s) : -1;
|
|
55
|
+
if (c < 0 || d < 0) return;
|
|
56
|
+
const g = { row: c, col: d }, y = this._gridBounds(h), f = X(g, n, y);
|
|
57
|
+
if (t.preventDefault(), Y(f, g)) return;
|
|
58
|
+
const _ = this._cellAt(h, f);
|
|
59
|
+
_ && (this._cursor = f, b(_, this._allCells(h)));
|
|
56
60
|
}, this._refreshScrollState = () => {
|
|
57
61
|
var n;
|
|
58
62
|
const t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".z-rpt__wrapper");
|
|
59
63
|
if (!t) return;
|
|
60
64
|
const e = t.scrollLeft > 0, s = t.scrollLeft + t.clientWidth < t.scrollWidth - 1;
|
|
61
|
-
t.classList.toggle("z-rpt__wrapper--scrolled-left", e), t.classList.toggle("z-rpt__wrapper--scrolled-right", s);
|
|
65
|
+
t.classList.toggle("z-rpt__wrapper--scrolled-left", e), t.classList.toggle("z-rpt__wrapper--scrolled-right", s), this.virtual && at(t, this._paged.rows.length, this.rowHeight, this.maxHeight, this._vState) && this.requestUpdate();
|
|
62
66
|
}, this._onShadowClick = (t) => {
|
|
63
|
-
var s, n, l,
|
|
64
|
-
if (this._onGroupToggle(t) || this._onPagerClick(t) ||
|
|
67
|
+
var s, n, l, h;
|
|
68
|
+
if (this._onGroupToggle(t) || this._onPagerClick(t) || gt(t, this._interactionHost) || ft(t, this._interactionHost) || q(t.target, this._panelHost)) return;
|
|
65
69
|
const e = (n = (s = t.target) == null ? void 0 : s.closest) == null ? void 0 : n.call(s, ".z-rpt__th--sortable");
|
|
66
|
-
e && !((
|
|
70
|
+
e && !((h = (l = t.target) == null ? void 0 : l.closest) != null && h.call(l, ".z-rpt__resize-handle")) && (this._refocusThKey = e.dataset.key ?? null), this._onHeadClick(t);
|
|
67
71
|
}, this._onGlobalMouseDown = (t) => {
|
|
68
72
|
var s;
|
|
69
73
|
if (!this._configOpen) return;
|
|
@@ -75,7 +79,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
75
79
|
const s = t.type === "z-column-selector-open";
|
|
76
80
|
this.columnSelectorOpen !== s && (this.columnSelectorOpen = s);
|
|
77
81
|
}, this._onTableChange = (t) => {
|
|
78
|
-
this._onPagerSizeChange(t) ||
|
|
82
|
+
this._onPagerSizeChange(t) || yt(t, this._interactionHost);
|
|
79
83
|
};
|
|
80
84
|
}
|
|
81
85
|
// ── Visible columns ────────────────────────────────────
|
|
@@ -95,7 +99,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
95
99
|
// ── 视图行 / 分页 ───────────────────────────────────────
|
|
96
100
|
/** 数据行(已排序)→ 视图行。有 `group` 走分组,否则一条数据一条。 */
|
|
97
101
|
_viewRows(t) {
|
|
98
|
-
return !this.group || !this.group.dims.length ?
|
|
102
|
+
return !this.group || !this.group.dims.length ? Q(t, this.rowKey) : Z(this.group, t, this._collapsed);
|
|
99
103
|
}
|
|
100
104
|
/**
|
|
101
105
|
* 当前表格实际渲染的行(含小计/总计,**不分页**)。
|
|
@@ -104,7 +108,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
104
108
|
* 没有任何断言会红,只有对账时才发现。
|
|
105
109
|
*/
|
|
106
110
|
renderRows() {
|
|
107
|
-
return this._viewRows(
|
|
111
|
+
return this._viewRows(v(this.data, this.sortState, this.sortMode));
|
|
108
112
|
}
|
|
109
113
|
/** 当前生效的页码总数(不分页时恒为 1)。 */
|
|
110
114
|
get pageCount() {
|
|
@@ -141,8 +145,8 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
141
145
|
}
|
|
142
146
|
/** 折叠按钮点击。返回 true = 已消费(不再走行点击)。 */
|
|
143
147
|
_onGroupToggle(t) {
|
|
144
|
-
var l,
|
|
145
|
-
const e = (
|
|
148
|
+
var l, h;
|
|
149
|
+
const e = (h = (l = t.target) == null ? void 0 : l.closest) == null ? void 0 : h.call(l, "[data-toggle]");
|
|
146
150
|
if (!e) return !1;
|
|
147
151
|
const s = e.getAttribute("data-toggle") ?? "", n = !this._collapsed.has(s);
|
|
148
152
|
return n ? this._collapsed.add(s) : this._collapsed.delete(s), this.emit("z-group-toggle", { groupKey: s, collapsed: n }), this.requestUpdate(), !0;
|
|
@@ -165,7 +169,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
165
169
|
}
|
|
166
170
|
// ── Lifecycle ──────────────────────────────────────────
|
|
167
171
|
connectedCallback() {
|
|
168
|
-
super.connectedCallback(), document.addEventListener("mousemove", this._onResizeMouseMove), document.addEventListener("mouseup", this._onResizeMouseUp), document.addEventListener("mousedown", this._onGlobalMouseDown);
|
|
172
|
+
super.connectedCallback(), document.addEventListener("mousemove", this._onResizeMouseMove), document.addEventListener("mouseup", this._onResizeMouseUp), document.addEventListener("mousedown", this._onGlobalMouseDown), this._ensureSelectorEl();
|
|
169
173
|
}
|
|
170
174
|
disconnectedCallback() {
|
|
171
175
|
var t;
|
|
@@ -188,7 +192,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
188
192
|
this.lines = t === "lines";
|
|
189
193
|
}
|
|
190
194
|
render() {
|
|
191
|
-
const t = this._visible, e = this.showColumnSelector, s =
|
|
195
|
+
const t = this._visible, e = this.showColumnSelector, s = et(t, this.selectable, this._columnWidths, e ? R : 0);
|
|
192
196
|
this._leftOffsets = s.left, this._rightOffsets = s.right;
|
|
193
197
|
const n = [
|
|
194
198
|
"z-rpt",
|
|
@@ -200,16 +204,16 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
200
204
|
this.selectable ? "z-rpt--selectable" : "",
|
|
201
205
|
// 两行表头(`col group=`):CSS 靠这个类给第二行算 sticky 的 top
|
|
202
206
|
t.some((p) => !!p.group) ? "z-rpt--grouped" : ""
|
|
203
|
-
].filter(Boolean).join(" "), l =
|
|
207
|
+
].filter(Boolean).join(" "), l = v(this.data, this.sortState, this.sortMode);
|
|
204
208
|
this._sortedRows = l;
|
|
205
|
-
const
|
|
209
|
+
const h = this._viewRows(l), c = tt(h, this.pageMode === "server" ? 0 : this.pageSize, this.page);
|
|
206
210
|
this._paged = this.pageMode === "server" && this.pageSize > 0 ? {
|
|
207
211
|
...c,
|
|
208
212
|
page: Math.max(1, this.page),
|
|
209
213
|
pageCount: Math.max(1, Math.ceil(Math.max(0, this.totalRecords) / this.pageSize) || 1),
|
|
210
214
|
totalRows: this.totalRecords > 0 ? this.totalRecords : c.totalRows
|
|
211
215
|
} : c;
|
|
212
|
-
const
|
|
216
|
+
const d = t.length + (this.selectable ? 1 : 0) + (e ? 1 : 0), g = {
|
|
213
217
|
sortState: this.sortState,
|
|
214
218
|
editable: this.editable,
|
|
215
219
|
// 编辑态全开;查看态由 resizable 单独开"只拖宽"(见属性注释与 [[REQ-021-page-column-width]])
|
|
@@ -239,58 +243,63 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
239
243
|
leftOffsets: this._leftOffsets,
|
|
240
244
|
rightOffsets: this._rightOffsets,
|
|
241
245
|
tools: e
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
reordertext="${b(this.reorderColumnText)}"></z-column-selector>` : "", _ = tt({ vis: t, ctx: g, selectable: this.selectable, tools: m }), w = t.some((p) => (p.group ?? "").trim() !== "") ? d`<colgroup>
|
|
245
|
-
${this.selectable ? d`<col style="width:40px">` : ""}
|
|
246
|
+
}, _ = e ? u`<slot name="tools"></slot>` : "", m = st({ vis: t, ctx: g, selectable: this.selectable, tools: _ }), w = t.some((p) => (p.group ?? "").trim() !== "") ? u`<colgroup>
|
|
247
|
+
${this.selectable ? u`<col style="width:40px">` : ""}
|
|
246
248
|
${t.map((p) => {
|
|
247
|
-
const
|
|
248
|
-
return
|
|
249
|
+
const z = this._columnWidths.get(p.key), T = z != null ? `${z}px` : p.width || "";
|
|
250
|
+
return T ? u`<col style="width:${T}">` : u`<col>`;
|
|
249
251
|
})}
|
|
250
|
-
${e ?
|
|
252
|
+
${e ? u`<col style="width:${R}px">` : ""}
|
|
251
253
|
</colgroup>` : "";
|
|
252
|
-
return
|
|
253
|
-
${
|
|
254
|
+
return u`
|
|
255
|
+
${ot(t)}
|
|
254
256
|
<div class="z-rpt__wrapper" part="wrapper"
|
|
255
257
|
${this.maxHeight ? `style="max-height:${this.maxHeight};overflow-y:auto"` : ""}>
|
|
256
258
|
<table class="${n}" part="table">
|
|
257
259
|
${w}
|
|
258
|
-
<thead class="z-rpt__head" part="head">${
|
|
260
|
+
<thead class="z-rpt__head" part="head">${m}</thead>
|
|
259
261
|
<tbody class="z-rpt__body" part="body">
|
|
260
|
-
${this._paged.rows.length === 0 ?
|
|
261
|
-
${this._paged.total ?
|
|
262
|
+
${this._paged.rows.length === 0 ? it(d, this.emptyText) : ht(this._paged.rows, y, d, this.virtual, this.rowHeight, this.maxHeight, this._vState)}
|
|
263
|
+
${this._paged.total ? rt([this._paged.total], y) : ""}
|
|
262
264
|
</tbody>
|
|
263
|
-
${this.showFooter && t.length > 0 ?
|
|
265
|
+
${this.showFooter && t.length > 0 ? nt(f) : ""}
|
|
264
266
|
</table>
|
|
265
|
-
${this.loading ?
|
|
267
|
+
${this.loading ? u`<div class="z-rpt__loading-overlay" part="loading">
|
|
266
268
|
<span class="z-rpt__spinner" part="spinner"></span>
|
|
267
|
-
<span class="z-rpt__loading-text">${
|
|
269
|
+
<span class="z-rpt__loading-text">${M(this.loadingText)}</span>
|
|
268
270
|
</div>` : ""}
|
|
269
271
|
</div>
|
|
270
272
|
${this._renderPager(this._paged)}
|
|
271
273
|
`;
|
|
272
274
|
}
|
|
275
|
+
_ensureSelectorEl() {
|
|
276
|
+
this._selectorEl = N(this, this._selectorEl, this._onColumnSelectorOpenEvent);
|
|
277
|
+
}
|
|
278
|
+
_syncSelectorProps() {
|
|
279
|
+
j(this._selectorEl, this);
|
|
280
|
+
}
|
|
273
281
|
updated() {
|
|
274
|
-
var e;
|
|
282
|
+
var e, s;
|
|
275
283
|
this._bindEvents(), this._bindWrapperScroll(), this._refreshScrollState();
|
|
276
284
|
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".z-rpt__foot");
|
|
277
285
|
if (this.style.setProperty(
|
|
278
286
|
"--z-rpt-foot-h",
|
|
279
287
|
t ? `${Math.round(t.getBoundingClientRect().height)}px` : "0px"
|
|
280
|
-
), this._applyCursor(), this._restoreFocus(),
|
|
281
|
-
const
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
|
|
288
|
+
), this._applyCursor(), this._restoreFocus(), lt(this.shadowRoot, this._visible, this._sortedRows), this.selectable) {
|
|
289
|
+
const n = this.shadowRoot.querySelector(".z-rpt__select-all");
|
|
290
|
+
if (n) {
|
|
291
|
+
const l = this.data.length, h = _t(this.data, this.rowKey, this.selectedKeys);
|
|
292
|
+
n.checked = l > 0 && h === l, n.indeterminate = h > 0 && h < l;
|
|
285
293
|
}
|
|
286
294
|
}
|
|
295
|
+
(s = this._selectorEl) == null || s.reposition();
|
|
287
296
|
}
|
|
288
297
|
// ── Config snapshot (external persistence) ─────────────
|
|
289
298
|
getConfig() {
|
|
290
|
-
return
|
|
299
|
+
return W(this, this._columnWidths);
|
|
291
300
|
}
|
|
292
301
|
applyConfig(t) {
|
|
293
|
-
|
|
302
|
+
A(this, this._columnWidths, t);
|
|
294
303
|
}
|
|
295
304
|
// ── Column widths (external persistence) ───────────────
|
|
296
305
|
/**
|
|
@@ -309,7 +318,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
309
318
|
let e = !1;
|
|
310
319
|
for (const [s, n] of Object.entries(t)) {
|
|
311
320
|
const l = Math.round(Number(n));
|
|
312
|
-
!Number.isFinite(l) || l <
|
|
321
|
+
!Number.isFinite(l) || l < St || l > bt || this._columnWidths.get(s) !== l && (this._columnWidths.set(s, l), e = !0);
|
|
313
322
|
}
|
|
314
323
|
e && this.requestUpdate();
|
|
315
324
|
}
|
|
@@ -318,12 +327,13 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
318
327
|
return Object.fromEntries(this._columnWidths);
|
|
319
328
|
}
|
|
320
329
|
_emitConfigChange() {
|
|
321
|
-
|
|
330
|
+
var t;
|
|
331
|
+
this.emit("z-config-change", { config: this.getConfig() }), $(this.persistKey, this), (t = this._selectorEl) == null || t.syncColumnState();
|
|
322
332
|
}
|
|
323
333
|
/** 渲染前叠上本机记住的顺序/显隐(放在 updated 会先画一帧默认顺序再跳)。 */
|
|
324
334
|
willUpdate() {
|
|
325
|
-
const t =
|
|
326
|
-
t &&
|
|
335
|
+
const t = F(this.persistKey);
|
|
336
|
+
t && D(this, t), this._syncSelectorProps();
|
|
327
337
|
}
|
|
328
338
|
// ── Public helpers ─────────────────────────────────────
|
|
329
339
|
clearSelection() {
|
|
@@ -417,7 +427,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
417
427
|
_bindEvents() {
|
|
418
428
|
if (this._eventsBound) return;
|
|
419
429
|
const t = this.shadowRoot;
|
|
420
|
-
t && (t.addEventListener("mousedown", this._onHeadMouseDown), t.addEventListener("click", this._onShadowClick), t.addEventListener("change", this._onTableChange), t.addEventListener("keydown", this._onShadowKeydown),
|
|
430
|
+
t && (t.addEventListener("mousedown", this._onHeadMouseDown), t.addEventListener("click", this._onShadowClick), t.addEventListener("change", this._onTableChange), t.addEventListener("keydown", this._onShadowKeydown), this._ensureSelectorEl(), this._unbindColDrag = mt(this.shadowRoot, this._interactionHost, () => this.editable), this._eventsBound = !0);
|
|
421
431
|
}
|
|
422
432
|
// ── 键盘:网格导航与焦点恢复 ────────────────────────────
|
|
423
433
|
/** 表体数据行(不含空态行)。DOM 顺序即行号。 */
|
|
@@ -448,7 +458,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
448
458
|
const t = this._gridRows();
|
|
449
459
|
if (!t.length) return;
|
|
450
460
|
const e = this._gridBounds(t), s = this._cursor, n = s && s.row < e.rows && s.col < e.cols ? s : { row: 0, col: 0 }, l = this._cellAt(t, n);
|
|
451
|
-
l &&
|
|
461
|
+
l && b(l, this._allCells(t), { focus: !1 });
|
|
452
462
|
}
|
|
453
463
|
/**
|
|
454
464
|
* 重渲染后把焦点送回用户刚才所在的位置。
|
|
@@ -459,12 +469,12 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
459
469
|
* 同类缺陷 2026-11-16 已在 `z-column-selector`(勾一列)与 `z-table`(排序)上修过。
|
|
460
470
|
*/
|
|
461
471
|
_restoreFocus() {
|
|
462
|
-
var
|
|
472
|
+
var h, c, d;
|
|
463
473
|
const t = this._refocusThKey, e = this._refocusSelector;
|
|
464
474
|
if (this._refocusThKey = null, this._refocusSelector = null, t) {
|
|
465
|
-
const g = (
|
|
475
|
+
const g = (h = this.shadowRoot) == null ? void 0 : h.querySelector(`.z-rpt__th[data-key="${t}"]`);
|
|
466
476
|
if (g) {
|
|
467
|
-
|
|
477
|
+
b(g, this._sortableThs());
|
|
468
478
|
return;
|
|
469
479
|
}
|
|
470
480
|
}
|
|
@@ -474,7 +484,7 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
474
484
|
s.focus();
|
|
475
485
|
return;
|
|
476
486
|
}
|
|
477
|
-
const n = /data-page-go="prev"/.test(e) ? '[data-page-go="next"]' : /data-page-go="next"/.test(e) ? '[data-page-go="prev"]' : null, l = n ? (
|
|
487
|
+
const n = /data-page-go="prev"/.test(e) ? '[data-page-go="next"]' : /data-page-go="next"/.test(e) ? '[data-page-go="prev"]' : null, l = n ? (d = this.shadowRoot) == null ? void 0 : d.querySelector(n) : null;
|
|
478
488
|
l && !l.disabled && l.focus();
|
|
479
489
|
}
|
|
480
490
|
_sortableThs() {
|
|
@@ -486,12 +496,12 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
486
496
|
_bindWrapperScroll() {
|
|
487
497
|
var e;
|
|
488
498
|
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".z-rpt__wrapper");
|
|
489
|
-
!t || t === this._scrollWrapper || (this._scrollWrapper = t, t.addEventListener("scroll", this._refreshScrollState, { passive: !0 }));
|
|
499
|
+
!t || t === this._scrollWrapper || (this._scrollWrapper = t, this.virtual && this._vState.scrollTop > 0 && (t.scrollTop = this._vState.scrollTop), t.addEventListener("scroll", this._refreshScrollState, { passive: !0 }));
|
|
490
500
|
}
|
|
491
501
|
// ── Selection ──────────────────────────────────────────
|
|
492
502
|
// [WHY] 勾选变更/配置合计开关的统一分发见 table-interactions#handleTableChange
|
|
493
503
|
_getRowKey(t, e) {
|
|
494
|
-
return
|
|
504
|
+
return J(t, e, this.rowKey);
|
|
495
505
|
}
|
|
496
506
|
/**
|
|
497
507
|
* 解析 `selectedRowId`(`id:10` 或 `code:a,b`,逗号分隔多组)判断本行是否命中。
|
|
@@ -503,15 +513,15 @@ const M = 32, ft = 24, yt = 2e3, x = class x extends K {
|
|
|
503
513
|
for (const s of e.split(",")) {
|
|
504
514
|
const n = s.indexOf(":");
|
|
505
515
|
if (n < 0) continue;
|
|
506
|
-
const l = s.slice(0, n).trim(),
|
|
507
|
-
if (!(!l || !
|
|
516
|
+
const l = s.slice(0, n).trim(), h = s.slice(n + 1).trim();
|
|
517
|
+
if (!(!l || !h) && String(t[l] ?? "") === h)
|
|
508
518
|
return !0;
|
|
509
519
|
}
|
|
510
520
|
return !1;
|
|
511
521
|
}
|
|
512
522
|
};
|
|
513
|
-
|
|
514
|
-
let o =
|
|
523
|
+
C.styles = L + H + P + B + E;
|
|
524
|
+
let o = C;
|
|
515
525
|
r([
|
|
516
526
|
i({ type: String, attribute: "selected-row-id" })
|
|
517
527
|
], o.prototype, "selectedRowId");
|
|
@@ -566,6 +576,12 @@ r([
|
|
|
566
576
|
r([
|
|
567
577
|
i({ type: Boolean })
|
|
568
578
|
], o.prototype, "bordered");
|
|
579
|
+
r([
|
|
580
|
+
i({ type: Boolean })
|
|
581
|
+
], o.prototype, "virtual");
|
|
582
|
+
r([
|
|
583
|
+
i({ type: Number, attribute: "row-height" })
|
|
584
|
+
], o.prototype, "rowHeight");
|
|
569
585
|
r([
|
|
570
586
|
i({ type: Boolean })
|
|
571
587
|
], o.prototype, "lines");
|
|
@@ -683,8 +699,8 @@ r([
|
|
|
683
699
|
r([
|
|
684
700
|
i({ type: String, attribute: "pager-size-label" })
|
|
685
701
|
], o.prototype, "pagerSizeLabel");
|
|
686
|
-
|
|
687
|
-
|
|
702
|
+
K(o, "variant");
|
|
703
|
+
k("z-report-table", o);
|
|
688
704
|
export {
|
|
689
705
|
o as ZReportTable
|
|
690
706
|
};
|