@ticatec/uniface-element 5.0.4 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/README_CN.md +17 -15
- package/dist/app_layout/ColumnsLayout.svelte +14 -10
- package/dist/app_layout/ColumnsLayout.svelte.d.ts +8 -4
- package/dist/app_layout/README.md +14 -12
- package/dist/app_layout/README_CN.md +14 -12
- package/dist/app_layout/RowsLayout.svelte +14 -10
- package/dist/app_layout/RowsLayout.svelte.d.ts +8 -4
- package/dist/base-calendar/CalendarBase.svelte +4 -10
- package/dist/base-calendar/CalendarBase.svelte.d.ts +0 -4
- package/dist/base-calendar/DateContext.d.ts +1 -0
- package/dist/base-calendar/DateContext.js +5 -8
- package/dist/base-calendar/MonthlyCalendar.svelte +11 -3
- package/dist/base-calendar/MonthlyCalendar.svelte.d.ts +1 -2
- package/dist/base-calendar/YearPickupPanel.svelte +5 -5
- package/dist/base-calendar/YearPickupPanel.svelte.d.ts +2 -2
- package/dist/base-calendar/dateUtils.js +9 -5
- package/dist/composite/pagination_panel/PaginationPanel.svelte +19 -13
- package/dist/composite/pagination_panel/PaginationPanel.svelte.d.ts +8 -5
- package/dist/composite/pagination_panel/README.md +3 -1
- package/dist/composite/pagination_panel/README_CN.md +3 -1
- package/dist/composite/transfer/Transfer.svelte +30 -16
- package/dist/composite/transfer/Transfer.svelte.d.ts +11 -4
- package/dist/composite/transfer/index.d.ts +2 -2
- package/dist/data_display/accordion/Accordion.svelte +10 -9
- package/dist/data_display/accordion/Accordion.svelte.d.ts +2 -1
- package/dist/data_display/accordion/AccordionItemView.svelte +6 -6
- package/dist/data_display/accordion/AccordionItemView.svelte.d.ts +1 -1
- package/dist/data_display/accordion/README.md +6 -4
- package/dist/data_display/accordion/README_CN.md +6 -4
- package/dist/data_display/card/Card.svelte +13 -11
- package/dist/data_display/card/Card.svelte.d.ts +5 -3
- package/dist/data_display/card/CardAction.d.ts +7 -2
- package/dist/data_display/card/CommonCardActionBar.svelte +2 -2
- package/dist/data_display/card/README.md +11 -9
- package/dist/data_display/card/README_CN.md +11 -9
- package/dist/data_display/card/index.d.ts +2 -1
- package/dist/data_display/concise_data_table/Column.d.ts +0 -6
- package/dist/data_display/concise_data_table/ConciseListTable.svelte +6 -5
- package/dist/data_display/concise_data_table/ConciseListTable.svelte.d.ts +4 -3
- package/dist/data_display/concise_data_table/DataCell.svelte +1 -1
- package/dist/data_display/concise_data_table/README.md +7 -5
- package/dist/data_display/concise_data_table/README_CN.md +7 -5
- package/dist/data_display/concise_data_table/TableOptions.d.ts +1 -1
- package/dist/data_display/list_box/ListBox.svelte +11 -15
- package/dist/data_display/list_box/ListBox.svelte.d.ts +6 -9
- package/dist/data_display/list_box/README.md +10 -8
- package/dist/data_display/list_box/README_CN.md +10 -8
- package/dist/data_display/list_box/index.d.ts +2 -3
- package/dist/data_display/tree_view/README.md +4 -2
- package/dist/data_display/tree_view/README_CN.md +4 -2
- package/dist/data_display/tree_view/TreeNodeView.svelte +15 -16
- package/dist/data_display/tree_view/TreeNodeView.svelte.d.ts +4 -5
- package/dist/data_display/tree_view/TreeView.svelte +27 -19
- package/dist/data_display/tree_view/TreeView.svelte.d.ts +12 -4
- package/dist/data_display/tree_view/index.d.ts +2 -3
- package/dist/data_table/DataTable.svelte +46 -15
- package/dist/data_table/DataTable.svelte.d.ts +9 -1
- package/dist/data_table/README.md +10 -8
- package/dist/data_table/README_CN.md +10 -8
- package/dist/data_table/UniDataTable.d.ts +4 -4
- package/dist/data_table/UniDataTable.js +2 -2
- package/dist/data_table/index.d.ts +5 -5
- package/dist/data_table/lib/CellAction.d.ts +9 -0
- package/dist/data_table/lib/CommonHeaderCell.d.ts +2 -2
- package/dist/data_table/lib/CompareFn.d.ts +3 -0
- package/dist/data_table/lib/DataColumn.d.ts +7 -12
- package/dist/data_table/lib/FormatCellFn.d.ts +2 -0
- package/dist/data_table/lib/HrefLink.d.ts +3 -3
- package/dist/data_table/lib/IndicatorColumn.d.ts +2 -1
- package/dist/data_table/lib/RowAction.d.ts +14 -20
- package/dist/data_table/lib/virtualWindow.d.ts +37 -0
- package/dist/data_table/lib/virtualWindow.js +41 -0
- package/dist/data_table/parts/ActionCell.svelte +3 -3
- package/dist/data_table/parts/ActionCell.svelte.d.ts +1 -1
- package/dist/data_table/parts/ActionsPanel.svelte +17 -2
- package/dist/data_table/parts/ActionsPanel.svelte.d.ts +3 -0
- package/dist/data_table/parts/ActionsRow.svelte +7 -5
- package/dist/data_table/parts/ContentPanel.svelte +40 -15
- package/dist/data_table/parts/ContentPanel.svelte.d.ts +11 -6
- package/dist/data_table/parts/FixedColumnsPanel.svelte +32 -16
- package/dist/data_table/parts/FixedColumnsPanel.svelte.d.ts +8 -5
- package/dist/data_table/parts/FixedHeaderPanel.svelte +14 -15
- package/dist/data_table/parts/FixedHeaderPanel.svelte.d.ts +4 -4
- package/dist/data_table/parts/FixedRow.svelte +9 -9
- package/dist/data_table/parts/FixedRow.svelte.d.ts +3 -3
- package/dist/data_table/parts/HrefCell.svelte +1 -1
- package/dist/data_table/parts/PopupMenu.svelte +3 -3
- package/dist/data_table/parts/PopupMenu.svelte.d.ts +1 -1
- package/dist/data_table/parts/TableHeaderPanel.svelte +14 -14
- package/dist/data_table/parts/TableHeaderPanel.svelte.d.ts +4 -4
- package/dist/data_table/parts/TextCell.svelte +1 -1
- package/dist/feedback/progress-bar/ProgressBar.svelte +13 -10
- package/dist/feedback/progress-bar/ProgressBar.svelte.d.ts +6 -3
- package/dist/form/FormEditor.svelte +2 -2
- package/dist/form/FormEditor.svelte.d.ts +1 -1
- package/dist/form/attachment_files/AttachmentEditor.svelte +407 -92
- package/dist/form/attachment_files/AttachmentEditor.svelte.d.ts +71 -15
- package/dist/form/attachment_files/AttachmentFile.d.ts +35 -8
- package/dist/form/attachment_files/AttachmentFile.js +54 -29
- package/dist/form/attachment_files/AttachmentListItem.svelte +208 -0
- package/dist/form/attachment_files/AttachmentListItem.svelte.d.ts +25 -0
- package/dist/form/attachment_files/AttachmentTile.svelte +296 -0
- package/dist/form/attachment_files/AttachmentTile.svelte.d.ts +25 -0
- package/dist/form/attachment_files/FileUpload.d.ts +2 -2
- package/dist/form/attachment_files/README.md +71 -452
- package/dist/form/attachment_files/README_CN.md +68 -449
- package/dist/form/attachment_files/UploadTask.d.ts +27 -0
- package/dist/form/attachment_files/index.d.ts +8 -5
- package/dist/form/attachment_files/index.js +4 -2
- package/dist/form/cascade_options_select/CascadeOptionSelect.svelte +16 -15
- package/dist/form/cascade_options_select/CascadeOptionSelect.svelte.d.ts +6 -5
- package/dist/form/cascade_options_select/IsLeaf.d.ts +4 -0
- package/dist/form/cascade_options_select/IsLeaf.js +1 -0
- package/dist/form/cascade_options_select/OptionsBox.svelte +4 -4
- package/dist/form/cascade_options_select/OptionsBox.svelte.d.ts +2 -2
- package/dist/form/color_picker/ColorPicker.svelte +3 -3
- package/dist/form/color_picker/ColorPickerPanel.svelte +1 -1
- package/dist/form/common_editor/BasePicker.svelte +7 -7
- package/dist/form/common_editor/BasePicker.svelte.d.ts +3 -3
- package/dist/form/common_editor/CommonEditor.svelte +8 -8
- package/dist/form/common_editor/CommonEditor.svelte.d.ts +2 -2
- package/dist/form/common_editor/CommonPicker.svelte +43 -31
- package/dist/form/common_editor/CommonPicker.svelte.d.ts +6 -6
- package/dist/form/common_editor/CommonPickerProps.d.ts +2 -2
- package/dist/form/common_editor/CommonPopupEditor.svelte +13 -13
- package/dist/form/common_editor/CommonPopupEditor.svelte.d.ts +3 -4
- package/dist/form/common_editor/NumberInput.svelte +10 -2
- package/dist/form/common_editor/NumberInput.svelte.d.ts +1 -1
- package/dist/form/common_range_editor/CommonRangeEditor.svelte +17 -17
- package/dist/form/common_range_editor/CommonRangeEditor.svelte.d.ts +5 -5
- package/dist/form/date_picker/DatePicker.svelte +5 -5
- package/dist/form/date_picker/DatePicker.svelte.d.ts +1 -1
- package/dist/form/date_picker/DateTimePicker.svelte +16 -6
- package/dist/form/date_picker/README.md +7 -5
- package/dist/form/date_picker/README_CN.md +7 -5
- package/dist/form/date_picker/ScrollBar.svelte +21 -20
- package/dist/form/date_picker/ScrollBar.svelte.d.ts +3 -3
- package/dist/form/date_range/DateRangeEditor.svelte +6 -6
- package/dist/form/events.d.ts +70 -0
- package/dist/form/events.js +6 -0
- package/dist/form/group_box/group-check-box/GroupCheckBox.svelte +9 -7
- package/dist/form/group_box/group-check-box/GroupCheckBox.svelte.d.ts +4 -3
- package/dist/form/group_box/group-check-box/README.md +5 -3
- package/dist/form/group_box/group-check-box/README_CN.md +5 -3
- package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte +9 -7
- package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte.d.ts +4 -3
- package/dist/form/group_box/group-radio-box/README.md +3 -1
- package/dist/form/group_box/group-radio-box/README_CN.md +3 -1
- package/dist/form/image_editor/ImageEditor.svelte +118 -0
- package/dist/form/image_editor/ImageEditor.svelte.d.ts +52 -0
- package/dist/form/image_editor/ImageFile.d.ts +11 -0
- package/dist/form/image_editor/ImageFile.js +1 -0
- package/dist/form/{image-files → image_editor}/ImagePreview.svelte +10 -2
- package/dist/form/image_editor/README.md +89 -0
- package/dist/form/image_editor/README_CN.md +89 -0
- package/dist/form/image_editor/index.d.ts +11 -0
- package/dist/form/image_editor/index.js +4 -0
- package/dist/form/input_options_select/InputOptionsSelect.svelte +11 -8
- package/dist/form/input_options_select/InputOptionsSelect.svelte.d.ts +2 -1
- package/dist/form/input_options_select/README.md +44 -218
- package/dist/form/input_options_select/README_CN.md +38 -211
- package/dist/form/lookup_editor/LookupEditor.svelte +7 -10
- package/dist/form/lookup_editor/LookupEditor.svelte.d.ts +2 -1
- package/dist/form/memo_editor/MemoEditor.svelte +2 -2
- package/dist/form/memo_editor/MemoEditor.svelte.d.ts +1 -1
- package/dist/form/number_editor/NumberEditor.svelte +13 -1
- package/dist/form/number_editor/NumberEditor.svelte.d.ts +1 -1
- package/dist/form/number_range/NumberRange.svelte +5 -5
- package/dist/form/options_multi_select/OptionsMultiSelect.svelte +13 -13
- package/dist/form/options_multi_select/OptionsMultiSelect.svelte.d.ts +3 -2
- package/dist/form/options_multi_select/README.md +5 -3
- package/dist/form/options_multi_select/README_CN.md +5 -3
- package/dist/form/options_select/OptionsSelect.svelte +19 -15
- package/dist/form/options_select/OptionsSelect.svelte.d.ts +2 -1
- package/dist/form/options_select/README.md +9 -7
- package/dist/form/options_select/README_CN.md +8 -6
- package/dist/form/prompts_text_editor/PromptsTextEditor.svelte +6 -5
- package/dist/form/prompts_text_editor/PromptsTextEditor.svelte.d.ts +2 -1
- package/dist/form/prompts_text_editor/README.md +16 -14
- package/dist/form/prompts_text_editor/README_CN.md +16 -14
- package/dist/form/search_box/SearchBox.svelte +3 -2
- package/dist/form/search_box/SearchBox.svelte.d.ts +1 -1
- package/dist/form/switch/README.md +7 -5
- package/dist/form/switch/README_CN.md +7 -5
- package/dist/form/switch/Switch.svelte +7 -5
- package/dist/form/switch/Switch.svelte.d.ts +4 -2
- package/dist/form/text_editor/PasswordEditor.svelte +2 -2
- package/dist/form/text_editor/PasswordEditor.svelte.d.ts +1 -1
- package/dist/form/text_editor/TextEditor.svelte +6 -4
- package/dist/form/text_editor/TextEditor.svelte.d.ts +1 -1
- package/dist/form/time_editor/README.md +4 -2
- package/dist/form/time_editor/README_CN.md +4 -2
- package/dist/form/time_editor/TimeEditor.svelte +10 -7
- package/dist/form/time_editor/TimeEditor.svelte.d.ts +2 -1
- package/dist/form/types.d.ts +5 -42
- package/dist/form/unit-number-editor/README.md +21 -19
- package/dist/form/unit-number-editor/README_CN.md +21 -19
- package/dist/form/unit-number-editor/UnitNumberEditor.svelte +12 -11
- package/dist/form/unit-number-editor/UnitNumberEditor.svelte.d.ts +4 -3
- package/dist/general/button/Button.svelte +4 -1
- package/dist/general/button/Button.svelte.d.ts +3 -1
- package/dist/general/button/IconButton.svelte +11 -5
- package/dist/general/button/IconButton.svelte.d.ts +5 -2
- package/dist/general/button/IconButton_README.md +9 -6
- package/dist/general/button/IconButton_README_CN.md +9 -6
- package/dist/general/button/TextButton.svelte +15 -5
- package/dist/general/button/TextButton.svelte.d.ts +6 -2
- package/dist/general/button/TextButton_README.md +10 -6
- package/dist/general/button/TextButton_README_CN.md +10 -6
- package/dist/general/icon/Icon.svelte +6 -4
- package/dist/general/icon/Icon.svelte.d.ts +3 -2
- package/dist/general/tag/Tag.svelte +8 -4
- package/dist/general/tag/Tag.svelte.d.ts +3 -1
- package/dist/i18nRes/i18nRes.d.ts +45 -2
- package/dist/i18nRes/i18nRes.js +7 -2
- package/dist/layouts/action_bar/ActionBar.svelte +5 -4
- package/dist/layouts/action_bar/ActionBar.svelte.d.ts +2 -1
- package/dist/layouts/action_bar/ButtonAction.d.ts +1 -23
- package/dist/layouts/action_bar/README.md +20 -18
- package/dist/layouts/action_bar/README_CN.md +19 -17
- package/dist/layouts/box/Box.svelte +4 -3
- package/dist/layouts/box/Box.svelte.d.ts +2 -1
- package/dist/layouts/box/README.md +13 -11
- package/dist/layouts/box/README_CN.md +13 -11
- package/dist/layouts/form_field/FormField.svelte +5 -4
- package/dist/layouts/form_field/FormField.svelte.d.ts +3 -2
- package/dist/layouts/form_field/README.md +11 -9
- package/dist/layouts/form_field/README_CN.md +9 -7
- package/dist/layouts/form_panel/flex_row_form/Cell.svelte +3 -1
- package/dist/layouts/form_panel/flex_row_form/Cell.svelte.d.ts +3 -1
- package/dist/layouts/form_panel/flex_row_form/Row.svelte +3 -1
- package/dist/layouts/form_panel/flex_row_form/Row.svelte.d.ts +3 -1
- package/dist/layouts/form_panel/grid_form/GridField.svelte +8 -4
- package/dist/layouts/form_panel/grid_form/GridField.svelte.d.ts +6 -2
- package/dist/layouts/form_panel/grid_form/GridForm.svelte +3 -1
- package/dist/layouts/form_panel/grid_form/GridForm.svelte.d.ts +3 -1
- package/dist/layouts/form_panel/grid_form/README.md +6 -4
- package/dist/layouts/form_panel/grid_form/README_CN.md +6 -4
- package/dist/layouts/page/Page.svelte +7 -7
- package/dist/layouts/page/Page.svelte.d.ts +2 -2
- package/dist/layouts/page/PageHeader.svelte +4 -4
- package/dist/layouts/page/PageHeader.svelte.d.ts +1 -1
- package/dist/layouts/page/README.md +18 -18
- package/dist/layouts/page/README_CN.md +18 -18
- package/dist/navigation/nav_menu/MenuItem.d.ts +1 -1
- package/dist/navigation/nav_menu/NavigatorMenu.svelte +16 -14
- package/dist/navigation/nav_menu/NavigatorMenu.svelte.d.ts +7 -5
- package/dist/navigation/nav_menu/NavigatorMenuItem.svelte +2 -2
- package/dist/navigation/nav_menu/NavigatorMenuItem.svelte.d.ts +2 -2
- package/dist/navigation/nav_menu/README.md +8 -6
- package/dist/navigation/nav_menu/README_CN.md +8 -6
- package/dist/navigation/nav_menu/index.d.ts +2 -2
- package/dist/navigation/navigator/Navigator.svelte +5 -4
- package/dist/navigation/navigator/Navigator.svelte.d.ts +3 -2
- package/dist/navigation/navigator/README.md +12 -10
- package/dist/navigation/navigator/README_CN.md +12 -10
- package/dist/navigation/pagination/Pagination.svelte +23 -15
- package/dist/navigation/pagination/Pagination.svelte.d.ts +6 -4
- package/dist/navigation/progress_step_bar/ProgressStep.d.ts +2 -1
- package/dist/navigation/progress_step_bar/ProgressStepBar.svelte +5 -4
- package/dist/navigation/progress_step_bar/ProgressStepBar.svelte.d.ts +2 -1
- package/dist/navigation/progress_step_bar/ProgressStepBlock.svelte +3 -3
- package/dist/navigation/progress_step_bar/ProgressStepBlock.svelte.d.ts +1 -1
- package/dist/navigation/progress_step_bar/README.md +37 -35
- package/dist/navigation/progress_step_bar/README_CN.md +36 -34
- package/dist/navigation/tabs/Tabs.svelte +14 -5
- package/dist/navigation/tabs/Tabs.svelte.d.ts +11 -4
- package/dist/navigation/tabs/index.d.ts +2 -2
- package/dist/overlay/common/ModalPopover.svelte +5 -4
- package/dist/overlay/common/ModalPopover.svelte.d.ts +2 -1
- package/dist/overlay/common/Popover.svelte +4 -3
- package/dist/overlay/common/Popover.svelte.d.ts +2 -1
- package/dist/overlay/context-menu/ContextMenuItem.d.ts +3 -3
- package/dist/overlay/context-menu/ContextMenuPanel.svelte +4 -4
- package/dist/overlay/context-menu/index.d.ts +2 -2
- package/dist/overlay/dialog/CommonDialog.svelte +17 -13
- package/dist/overlay/dialog/CommonDialog.svelte.d.ts +9 -5
- package/dist/overlay/dialog/Dialog.svelte +25 -19
- package/dist/overlay/dialog/Dialog.svelte.d.ts +11 -5
- package/dist/overlay/dialog/DialogActions.d.ts +1 -1
- package/dist/overlay/dialog/DialogCloseConfirm.d.ts +4 -1
- package/dist/overlay/dialog/DialogCloseConfirm.js +1 -1
- package/dist/overlay/dialog/DialogManager.svelte.js +2 -1
- package/dist/overlay/dialog/README.md +19 -17
- package/dist/overlay/dialog/README_CN.md +19 -17
- package/dist/overlay/dialog/index.d.ts +2 -2
- package/dist/overlay/message-box/IMessageBox.d.ts +4 -4
- package/dist/overlay/message-box/MessageBox.svelte.js +3 -3
- package/dist/ticatec-uniface-web.css +38 -12
- package/dist/types.d.ts +38 -46
- package/dist/unifaceContext.d.ts +2 -2
- package/dist/utils/prefixFilter.js +0 -1
- package/docs/NAMING.md +362 -0
- package/docs/NAMING_CN.md +362 -0
- package/docs/components/README.md +16 -14
- package/docs/components/accordion/README.md +13 -2
- package/docs/components/accordion/example.svelte +1 -0
- package/docs/components/action-bar/README.md +4 -4
- package/docs/components/attachment-editor/README.md +224 -0
- package/docs/components/attachment-editor/example.svelte +22 -0
- package/docs/components/box/README.md +1 -1
- package/docs/components/button/README.md +8 -1
- package/docs/components/button/example.svelte +1 -0
- package/docs/components/card/README.md +19 -5
- package/docs/components/cascade-options-select/README.md +11 -5
- package/docs/components/columns-layout/README.md +8 -4
- package/docs/components/columns-layout/example.svelte +4 -0
- package/docs/components/common-dialog/README.md +19 -10
- package/docs/components/common-dialog/example.svelte +2 -1
- package/docs/components/concise-data-table/README.md +18 -29
- package/docs/components/concise-data-table/example.svelte +1 -1
- package/docs/components/context-menu/README.md +5 -5
- package/docs/components/context-menu/example.svelte +1 -1
- package/docs/components/criteria-field/README.md +1 -0
- package/docs/components/criteria-field/example.svelte +1 -0
- package/docs/components/data-table/README.md +63 -40
- package/docs/components/data-table/example.svelte +2 -2
- package/docs/components/date-picker/README.md +1 -1
- package/docs/components/date-time-picker/README.md +1 -1
- package/docs/components/dialog/README.md +21 -14
- package/docs/components/dialog/example.svelte +1 -1
- package/docs/components/form-field/README.md +3 -3
- package/docs/components/grid-form/README.md +15 -5
- package/docs/components/grid-form/example.svelte +1 -1
- package/docs/components/group-check-box/README.md +3 -3
- package/docs/components/group-radio-box/README.md +3 -3
- package/docs/components/icon/README.md +6 -5
- package/docs/components/icon-button/README.md +10 -1
- package/docs/components/icon-button/example.svelte +1 -0
- package/docs/components/image-editor/README.md +262 -0
- package/docs/components/{image-files → image-editor}/example.svelte +5 -3
- package/docs/components/input-options-select/README.md +2 -2
- package/docs/components/list-box/README.md +12 -13
- package/docs/components/list-box/example.svelte +3 -3
- package/docs/components/lookup-editor/README.md +1 -1
- package/docs/components/navigator/README.md +2 -1
- package/docs/components/navigator/example.svelte +1 -0
- package/docs/components/navigator-menu/README.md +24 -21
- package/docs/components/navigator-menu/example.svelte +4 -2
- package/docs/components/options-multi-select/README.md +2 -2
- package/docs/components/options-select/README.md +4 -4
- package/docs/components/page/README.md +2 -2
- package/docs/components/page-stack/README.md +67 -0
- package/docs/components/page-stack/example.svelte +7 -0
- package/docs/components/pagination/README.md +24 -7
- package/docs/components/pagination/example.svelte +5 -2
- package/docs/components/pagination-panel/README.md +25 -10
- package/docs/components/pagination-panel/example.svelte +5 -4
- package/docs/components/password-editor/README.md +128 -0
- package/docs/components/{attachment-files → password-editor}/example.svelte +5 -5
- package/docs/components/progress-bar/README.md +14 -4
- package/docs/components/progress-bar/example.svelte +1 -1
- package/docs/components/progress-step-bar/README.md +16 -7
- package/docs/components/progress-step-bar/example.svelte +5 -1
- package/docs/components/prompts-text-editor/README.md +8 -6
- package/docs/components/prompts-text-editor/example.svelte +0 -1
- package/docs/components/rows-layout/README.md +8 -4
- package/docs/components/rows-layout/example.svelte +4 -0
- package/docs/components/switch/README.md +2 -2
- package/docs/components/tabs/README.md +24 -9
- package/docs/components/tag/README.md +13 -2
- package/docs/components/tag/example.svelte +1 -0
- package/docs/components/text-button/README.md +20 -1
- package/docs/components/text-button/example.svelte +2 -0
- package/docs/components/time-editor/README.md +1 -1
- package/docs/components/transfer/README.md +16 -9
- package/docs/components/tree-view/README.md +29 -13
- package/docs/components/tree-view/example.svelte +2 -1
- package/docs/components/unit-number-editor/README.md +11 -8
- package/docs/components/unit-number-editor/example.svelte +0 -1
- package/package.json +13 -7
- package/dist/data_table/lib/CompareFunction.d.ts +0 -3
- package/dist/data_table/lib/FormatCell.d.ts +0 -2
- package/dist/form/attachment_files/FileRender.svelte +0 -125
- package/dist/form/attachment_files/FileRender.svelte.d.ts +0 -9
- package/dist/form/attachment_files/FileUploadBar.svelte +0 -66
- package/dist/form/attachment_files/FileUploadBar.svelte.d.ts +0 -8
- package/dist/form/attachment_files/FileUploadPanel.svelte +0 -161
- package/dist/form/attachment_files/FileUploadPanel.svelte.d.ts +0 -14
- package/dist/form/attachment_files/UploadFile.d.ts +0 -43
- package/dist/form/attachment_files/UploadFile.js +0 -80
- package/dist/form/cascade_options_select/CascadePanel.svelte +0 -52
- package/dist/form/cascade_options_select/CascadePanel.svelte.d.ts +0 -26
- package/dist/form/cascade_options_select/isLeafDetermine.d.ts +0 -4
- package/dist/form/common_editor/EditorEvents.d.ts +0 -14
- package/dist/form/common_editor/EditorEvents.js +0 -2
- package/dist/form/image-files/ImageFile.d.ts +0 -12
- package/dist/form/image-files/ImageFilesField.svelte +0 -128
- package/dist/form/image-files/ImageFilesField.svelte.d.ts +0 -18
- package/dist/form/image-files/ImageRender.svelte +0 -95
- package/dist/form/image-files/ImageRender.svelte.d.ts +0 -10
- package/dist/form/image-files/README.md +0 -468
- package/dist/form/image-files/README_CN.md +0 -468
- package/dist/form/image-files/index.d.ts +0 -10
- package/dist/form/image-files/index.js +0 -2
- package/dist/layout/flex/FlexBlock.svelte +0 -17
- package/dist/layout/flex/FlexBlock.svelte.d.ts +0 -38
- package/dist/layout/flex/README.md +0 -148
- package/dist/layout/flex/README_CN.md +0 -148
- package/dist/layout/flex/index.d.ts +0 -2
- package/dist/layout/flex/index.js +0 -2
- package/dist/layout/index.d.ts +0 -0
- package/dist/layout/index.js +0 -1
- package/docs/components/attachment-files/README.md +0 -332
- package/docs/components/image-files/README.md +0 -174
- /package/dist/data_table/lib/{FormatCell.js → CellAction.js} +0 -0
- /package/dist/data_table/lib/{CompareFunction.js → CompareFn.js} +0 -0
- /package/dist/{form/cascade_options_select/isLeafDetermine.js → data_table/lib/FormatCellFn.js} +0 -0
- /package/dist/form/{image-files/ImageFile.js → attachment_files/UploadTask.js} +0 -0
- /package/dist/form/{image-files → image_editor}/ImagePreview.svelte.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CompareFn } from "./CompareFn";
|
|
2
2
|
export default interface CommonHeaderCell {
|
|
3
3
|
/**
|
|
4
4
|
* 栏目的标题
|
|
@@ -33,5 +33,5 @@ export interface DataHeaderCell extends CommonHeaderCell {
|
|
|
33
33
|
/**
|
|
34
34
|
* 排序的比较函数
|
|
35
35
|
*/
|
|
36
|
-
compareFunction?:
|
|
36
|
+
compareFunction?: CompareFn;
|
|
37
37
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { CellHint,
|
|
1
|
+
import type { CellHint, FormatCellFn } from "./FormatCellFn";
|
|
2
2
|
import type { HrefBuilder } from "./HrefLink";
|
|
3
|
-
import type {
|
|
3
|
+
import type { CompareFn } from "./CompareFn";
|
|
4
4
|
import type { GetCellStyle } from "../../types";
|
|
5
5
|
export default interface DataColumn {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* 列头文字(与 ConciseListTable 的 Column.title 统一)
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
title: string;
|
|
10
10
|
/**
|
|
11
11
|
* 对应的字段/属性名
|
|
12
12
|
*/
|
|
@@ -27,21 +27,16 @@ export default interface DataColumn {
|
|
|
27
27
|
/**
|
|
28
28
|
* 是否可以换行,默认为false
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
wrap?: boolean;
|
|
31
31
|
/**
|
|
32
32
|
* 单元格转换函数
|
|
33
33
|
*/
|
|
34
|
-
formatter?:
|
|
34
|
+
formatter?: FormatCellFn;
|
|
35
35
|
/**
|
|
36
36
|
* 是否将单元格内容作为可信 HTML 渲染({@html}),而非纯文本转义。
|
|
37
37
|
* 仅当 field/formatter 输出为可信标记时才应设为 true。
|
|
38
38
|
*/
|
|
39
39
|
renderHTML?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated 请使用 renderHTML;名称容易被误读为"转义 HTML",
|
|
42
|
-
* 实际含义相反——设为 true 会把内容作为可信 HTML 渲染。仍受支持以兼容旧调用。
|
|
43
|
-
*/
|
|
44
|
-
escapeHTML?: boolean;
|
|
45
40
|
/**
|
|
46
41
|
* 超链接设置
|
|
47
42
|
*/
|
|
@@ -65,7 +60,7 @@ export default interface DataColumn {
|
|
|
65
60
|
/**
|
|
66
61
|
*
|
|
67
62
|
*/
|
|
68
|
-
compareFunction?:
|
|
63
|
+
compareFunction?: CompareFn;
|
|
69
64
|
/**
|
|
70
65
|
* 获取表格的样式
|
|
71
66
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export type HrefBuilder = (item: any) => Array<HrefLink> | HrefLink | string;
|
|
2
|
-
export type
|
|
2
|
+
export type OnHrefClick = () => void;
|
|
3
3
|
export default interface HrefLink {
|
|
4
4
|
/**
|
|
5
5
|
* 显示超链接的文字
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
label: string;
|
|
8
8
|
/**
|
|
9
9
|
* 点击的处理函数
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
handler: OnHrefClick;
|
|
12
12
|
}
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
+
import type { ButtonType, ActionHandler } from "../../types";
|
|
2
|
+
export type { ActionHandler };
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
export type ActionFunction<T = any> = (item: T) => void;
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
4
|
+
* 行动作(DataTable actionsColumn / ActionCell 共用的动作对象,形状与 ButtonAction 一致)
|
|
7
5
|
*/
|
|
8
6
|
export default interface RowAction<T = any> {
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
7
|
+
/** 显示文字 */
|
|
12
8
|
label: string;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type?: 'primary' | 'secondary' | 'third' | 'forth';
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
9
|
+
/** 语义类型 */
|
|
10
|
+
type?: ButtonType;
|
|
11
|
+
/** 前缀图标 */
|
|
20
12
|
icon?: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
/** 提示 */
|
|
14
|
+
tooltip?: string;
|
|
15
|
+
/** 是否禁用 */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** 点击处理 */
|
|
18
|
+
handler: ActionHandler<T>;
|
|
25
19
|
}
|
|
26
20
|
/**
|
|
27
|
-
*
|
|
21
|
+
* 获取某一行的动作列表
|
|
28
22
|
*/
|
|
29
23
|
export type GetRowActions<T = any> = (item: T) => Array<RowAction<T>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-windowing math for the DataTable's opt-in virtual scrolling.
|
|
3
|
+
*
|
|
4
|
+
* The table renders three vertically synced panels (frozen columns, data
|
|
5
|
+
* content, actions). Each panel renders only the rows inside the computed
|
|
6
|
+
* window, with a top and bottom spacer so the scroll container keeps its
|
|
7
|
+
* full natural scrollHeight (the native scrollbar and the existing
|
|
8
|
+
* wheel/scroll sync logic keep working unchanged).
|
|
9
|
+
*
|
|
10
|
+
* All rows share one fixed `rowHeight`; at most one row (`expandIndex`) has
|
|
11
|
+
* an inline expansion panel of `inlineRowHeight` rendered directly below it.
|
|
12
|
+
*/
|
|
13
|
+
export interface VirtualWindow {
|
|
14
|
+
/** Index of the first rendered row (inclusive). */
|
|
15
|
+
start: number;
|
|
16
|
+
/** Index just past the last rendered row (exclusive). */
|
|
17
|
+
end: number;
|
|
18
|
+
/** Height (px) of the spacer above the rendered rows. */
|
|
19
|
+
topPad: number;
|
|
20
|
+
/** Height (px) of the spacer below the rendered rows. */
|
|
21
|
+
bottomPad: number;
|
|
22
|
+
}
|
|
23
|
+
export interface VirtualWindowInput {
|
|
24
|
+
scrollTop: number;
|
|
25
|
+
/** Height (px) of the scrollable viewport. 0 is tolerated (renders overscan only). */
|
|
26
|
+
viewportHeight: number;
|
|
27
|
+
rowHeight: number;
|
|
28
|
+
/** Total number of rows. */
|
|
29
|
+
count: number;
|
|
30
|
+
/** Extra rows rendered above and below the visible range. */
|
|
31
|
+
overscan?: number;
|
|
32
|
+
/** Index of the expanded row, or -1 when none. */
|
|
33
|
+
expandIndex?: number;
|
|
34
|
+
/** Height (px) of the inline expansion panel below the expanded row. */
|
|
35
|
+
inlineRowHeight?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function computeVirtualWindow(input: VirtualWindowInput): VirtualWindow;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-windowing math for the DataTable's opt-in virtual scrolling.
|
|
3
|
+
*
|
|
4
|
+
* The table renders three vertically synced panels (frozen columns, data
|
|
5
|
+
* content, actions). Each panel renders only the rows inside the computed
|
|
6
|
+
* window, with a top and bottom spacer so the scroll container keeps its
|
|
7
|
+
* full natural scrollHeight (the native scrollbar and the existing
|
|
8
|
+
* wheel/scroll sync logic keep working unchanged).
|
|
9
|
+
*
|
|
10
|
+
* All rows share one fixed `rowHeight`; at most one row (`expandIndex`) has
|
|
11
|
+
* an inline expansion panel of `inlineRowHeight` rendered directly below it.
|
|
12
|
+
*/
|
|
13
|
+
/** Top offset (px) of row `i`, accounting for an expansion panel above it. */
|
|
14
|
+
const rowTop = (i, rowHeight, expandIndex, inlineRowHeight) => i * rowHeight + (expandIndex >= 0 && i > expandIndex ? inlineRowHeight : 0);
|
|
15
|
+
export function computeVirtualWindow(input) {
|
|
16
|
+
const { scrollTop, viewportHeight, rowHeight, count } = input;
|
|
17
|
+
const overscan = input.overscan ?? 8;
|
|
18
|
+
const expandIndex = input.expandIndex ?? -1;
|
|
19
|
+
const inlineRowHeight = expandIndex >= 0 ? (input.inlineRowHeight ?? 0) : 0;
|
|
20
|
+
if (count === 0 || rowHeight <= 0) {
|
|
21
|
+
return { start: 0, end: 0, topPad: 0, bottomPad: 0 };
|
|
22
|
+
}
|
|
23
|
+
const st = Math.max(0, scrollTop);
|
|
24
|
+
// First row whose bottom edge is below the viewport top.
|
|
25
|
+
let start = Math.floor(st / rowHeight);
|
|
26
|
+
if (expandIndex >= 0 && start > expandIndex) {
|
|
27
|
+
// The viewport top sits below the expanded row: shift the estimate by the
|
|
28
|
+
// expansion panel's height. Clamping to expandIndex keeps the expanded
|
|
29
|
+
// row (and with it the inline panel, which is rendered inside the #each
|
|
30
|
+
// body next to its row) in the window while any part of the panel is
|
|
31
|
+
// visible.
|
|
32
|
+
start = Math.max(expandIndex, Math.floor((st - inlineRowHeight) / rowHeight));
|
|
33
|
+
}
|
|
34
|
+
start = Math.max(0, Math.min(start, count - 1) - overscan);
|
|
35
|
+
const visibleCount = Math.ceil(viewportHeight / rowHeight) + 1;
|
|
36
|
+
let end = Math.min(count, start + visibleCount + overscan * 2);
|
|
37
|
+
const totalHeight = count * rowHeight + inlineRowHeight;
|
|
38
|
+
const topPad = rowTop(start, rowHeight, expandIndex, inlineRowHeight);
|
|
39
|
+
const bottomPad = totalHeight - rowTop(end, rowHeight, expandIndex, inlineRowHeight);
|
|
40
|
+
return { start, end, topPad, bottomPad };
|
|
41
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type {CellAction, GetCellAction} from "../lib/CellAction";
|
|
3
3
|
import { TextButton } from "../../general/button";
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
let action = $derived(getAction?.(data));
|
|
13
13
|
|
|
14
14
|
const handleClick = async (event: MouseEvent) => {
|
|
15
|
-
await action?.
|
|
15
|
+
await action?.handler(data);
|
|
16
16
|
};
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
{#if action}
|
|
20
20
|
<div style="width: 100; overflow: hidden;">
|
|
21
|
-
<TextButton type={action.type ?? 'primary'} label={action.
|
|
21
|
+
<TextButton type={action.type ?? 'primary'} outer={false} label={action.label} onclick={handleClick} />
|
|
22
22
|
</div>
|
|
23
23
|
{/if}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type TableRow from "./TableRow";
|
|
5
5
|
import { onDestroy, onMount } from "svelte";
|
|
6
6
|
import i18nRes from "../../i18nRes";
|
|
7
|
+
import type { VirtualWindow } from "../lib/virtualWindow";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
actionsColumn: ActionsColumn;
|
|
@@ -13,6 +14,8 @@
|
|
|
13
14
|
expandRow?: TableRow | null;
|
|
14
15
|
rowHeight?: number;
|
|
15
16
|
headerHeight?: number;
|
|
17
|
+
/** Row window when virtual scrolling is on; null renders every row. */
|
|
18
|
+
vwindow?: VirtualWindow | null;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
let {
|
|
@@ -23,8 +26,13 @@
|
|
|
23
26
|
expandRow = null,
|
|
24
27
|
rowHeight,
|
|
25
28
|
headerHeight,
|
|
29
|
+
vwindow = null,
|
|
26
30
|
}: Props = $props();
|
|
27
31
|
|
|
32
|
+
// Virtual scrolling: same shared window as the other panels.
|
|
33
|
+
let visibleRows = $derived(vwindow ? rows.slice(vwindow.start, vwindow.end) : rows);
|
|
34
|
+
let startIndex = $derived(vwindow ? vwindow.start : 0);
|
|
35
|
+
|
|
28
36
|
const handleActionPanelScroll = (e: Event) => {
|
|
29
37
|
const target = e.target as HTMLDivElement;
|
|
30
38
|
scrollTop = target.scrollTop;
|
|
@@ -54,7 +62,7 @@
|
|
|
54
62
|
resizeObserver?.disconnect();
|
|
55
63
|
});
|
|
56
64
|
|
|
57
|
-
let actionText = i18nRes.dataTable.actions;
|
|
65
|
+
let actionText = i18nRes.dataTable.actions();
|
|
58
66
|
</script>
|
|
59
67
|
|
|
60
68
|
<div class="action-panel" bind:this={panel} style="user-select: none; width: {actionsColumn.width}px;">
|
|
@@ -65,7 +73,11 @@
|
|
|
65
73
|
</div>
|
|
66
74
|
<div bind:this={scrollPanel} class="rows-container" style="overflow-y: auto" onscroll={handleActionPanelScroll}>
|
|
67
75
|
<div>
|
|
68
|
-
{#
|
|
76
|
+
{#if vwindow}
|
|
77
|
+
<div style="height: {vwindow.topPad}px"></div>
|
|
78
|
+
{/if}
|
|
79
|
+
{#each visibleRows as row, i (startIndex + i)}
|
|
80
|
+
{@const idx = startIndex + i}
|
|
69
81
|
<ActionsRow
|
|
70
82
|
{row}
|
|
71
83
|
{rowHeight}
|
|
@@ -79,6 +91,9 @@
|
|
|
79
91
|
<div class="inline-panel" style="height: {inlineRowHeight ?? 0}px"> </div>
|
|
80
92
|
{/if}
|
|
81
93
|
{/each}
|
|
94
|
+
{#if vwindow}
|
|
95
|
+
<div style="height: {vwindow.bottomPad}px"></div>
|
|
96
|
+
{/if}
|
|
82
97
|
</div>
|
|
83
98
|
</div>
|
|
84
99
|
<div class="bottom-mask-overlay">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type ActionsColumn from "../lib/ActionsColumn";
|
|
2
2
|
import type TableRow from "./TableRow";
|
|
3
|
+
import type { VirtualWindow } from "../lib/virtualWindow";
|
|
3
4
|
interface Props {
|
|
4
5
|
actionsColumn: ActionsColumn;
|
|
5
6
|
scrollTop?: number;
|
|
@@ -8,6 +9,8 @@ interface Props {
|
|
|
8
9
|
expandRow?: TableRow | null;
|
|
9
10
|
rowHeight?: number;
|
|
10
11
|
headerHeight?: number;
|
|
12
|
+
/** Row window when virtual scrolling is on; null renders every row. */
|
|
13
|
+
vwindow?: VirtualWindow | null;
|
|
11
14
|
}
|
|
12
15
|
declare const ActionsPanel: import("svelte").Component<Props, {}, "scrollTop">;
|
|
13
16
|
type ActionsPanel = ReturnType<typeof ActionsPanel>;
|
|
@@ -93,17 +93,19 @@
|
|
|
93
93
|
<IconButton
|
|
94
94
|
style="flex-shrink: 0; top: 0"
|
|
95
95
|
size="small"
|
|
96
|
+
outer={false}
|
|
96
97
|
type={action.type ?? 'primary'}
|
|
97
98
|
icon={action.icon}
|
|
98
|
-
onclick={() => action.
|
|
99
|
+
onclick={() => action.handler(row.data)}
|
|
99
100
|
/>
|
|
100
101
|
{:else}
|
|
101
102
|
<TextButton
|
|
102
103
|
style="flex-shrink: 0; top: 0"
|
|
103
104
|
size="small"
|
|
105
|
+
outer={false}
|
|
104
106
|
type={action.type ?? 'primary'}
|
|
105
107
|
label={action.label}
|
|
106
|
-
onclick={async () => action.
|
|
108
|
+
onclick={async () => action.handler(row.data)}
|
|
107
109
|
/>
|
|
108
110
|
{/if}
|
|
109
111
|
{/each}
|
|
@@ -113,7 +115,7 @@
|
|
|
113
115
|
</div>
|
|
114
116
|
|
|
115
117
|
{#if showPopup}
|
|
116
|
-
<PopupMenu {parentRect}
|
|
118
|
+
<PopupMenu {parentRect} onclose={() => (showPopup = false)}>
|
|
117
119
|
<div style="padding: 4px 6px; box-sizing: border-box; background-color: #ffffff;">
|
|
118
120
|
{#each [...popupList].reverse() as action (action)}
|
|
119
121
|
<div class="action-popover" style="padding: 4px 6px; text-align: center">
|
|
@@ -124,7 +126,7 @@
|
|
|
124
126
|
type={action.type ?? 'primary'}
|
|
125
127
|
icon={action.icon}
|
|
126
128
|
onclick={async () => {
|
|
127
|
-
action.
|
|
129
|
+
action.handler(row.data);
|
|
128
130
|
showPopup = false;
|
|
129
131
|
}}
|
|
130
132
|
/>
|
|
@@ -135,7 +137,7 @@
|
|
|
135
137
|
type={action.type ?? 'primary'}
|
|
136
138
|
label={action.label}
|
|
137
139
|
onclick={async () => {
|
|
138
|
-
action.
|
|
140
|
+
action.handler(row.data);
|
|
139
141
|
showPopup = false;
|
|
140
142
|
}}
|
|
141
143
|
/>
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
import type TableRow from "./TableRow";
|
|
5
5
|
import { onDestroy, onMount } from "svelte";
|
|
6
6
|
import TableHeaderPanel from "./TableHeaderPanel.svelte";
|
|
7
|
-
import UniDataTable, { type
|
|
7
|
+
import UniDataTable, { type OnWidthChange } from "../UniDataTable";
|
|
8
8
|
import { OrderDirection } from "../lib/OrderDirection";
|
|
9
9
|
import type { GetRowFontStyle } from "../../types";
|
|
10
|
+
import type { VirtualWindow } from "../lib/virtualWindow";
|
|
10
11
|
|
|
11
12
|
interface Props {
|
|
12
13
|
columns: Array<DataColumn>;
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
orderColumn: DataColumn;
|
|
15
16
|
orderDirection: OrderDirection;
|
|
16
17
|
getRowFontStyle?: GetRowFontStyle;
|
|
17
|
-
|
|
18
|
+
emptyText?: string | null;
|
|
18
19
|
list: Array<any>;
|
|
19
20
|
expandRow: TableRow | null;
|
|
20
21
|
scrollTop?: number;
|
|
@@ -24,10 +25,14 @@
|
|
|
24
25
|
inlineComponent?: any;
|
|
25
26
|
table: UniDataTable;
|
|
26
27
|
showVerticalScroll?: boolean;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
showHorizontalScroll?: boolean;
|
|
29
|
+
onWidthChange?: OnWidthChange;
|
|
30
|
+
onCellClick?: (col: DataColumn) => any;
|
|
30
31
|
tabWidth: number;
|
|
32
|
+
/** Row window when virtual scrolling is on; null renders every row. */
|
|
33
|
+
vwindow?: VirtualWindow | null;
|
|
34
|
+
/** Measured height of the scrollable data area (drives the virtual window). */
|
|
35
|
+
viewportHeight?: number;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
let {
|
|
@@ -36,7 +41,7 @@
|
|
|
36
41
|
orderColumn,
|
|
37
42
|
orderDirection,
|
|
38
43
|
getRowFontStyle,
|
|
39
|
-
|
|
44
|
+
emptyText = null,
|
|
40
45
|
list,
|
|
41
46
|
expandRow,
|
|
42
47
|
scrollTop = $bindable(0),
|
|
@@ -46,10 +51,12 @@
|
|
|
46
51
|
inlineComponent = null,
|
|
47
52
|
table,
|
|
48
53
|
showVerticalScroll = false,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
showHorizontalScroll = true,
|
|
55
|
+
onWidthChange,
|
|
56
|
+
onCellClick,
|
|
52
57
|
tabWidth = $bindable(0),
|
|
58
|
+
vwindow = null,
|
|
59
|
+
viewportHeight = $bindable(0),
|
|
53
60
|
}: Props = $props();
|
|
54
61
|
|
|
55
62
|
let scrollLeft = $state(0);
|
|
@@ -62,8 +69,13 @@
|
|
|
62
69
|
onMount(() => {
|
|
63
70
|
resizeObserver = new ResizeObserver(() => {
|
|
64
71
|
viewWidth = Math.round(viewPanel?.clientWidth) - 1;
|
|
72
|
+
viewportHeight = dataPanel?.clientHeight ?? 0;
|
|
65
73
|
});
|
|
66
74
|
resizeObserver.observe(viewPanel);
|
|
75
|
+
if (dataPanel) {
|
|
76
|
+
resizeObserver.observe(dataPanel);
|
|
77
|
+
viewportHeight = dataPanel.clientHeight ?? 0;
|
|
78
|
+
}
|
|
67
79
|
});
|
|
68
80
|
|
|
69
81
|
onDestroy(() => {
|
|
@@ -116,19 +128,25 @@
|
|
|
116
128
|
});
|
|
117
129
|
|
|
118
130
|
let rowWidth = $derived(Math.max(viewWidth, tabWidth));
|
|
119
|
-
let
|
|
131
|
+
let whitespace = $derived(viewWidth > tabWidth);
|
|
132
|
+
|
|
133
|
+
// Virtual scrolling: render only the windowed slice, padded by spacers so the
|
|
134
|
+
// scroll container keeps its full natural scrollHeight. `startIndex` keeps the
|
|
135
|
+
// rendered rows' absolute indices (striping, keys) stable while scrolling.
|
|
136
|
+
let visibleRows = $derived(vwindow ? rows.slice(vwindow.start, vwindow.end) : rows);
|
|
137
|
+
let startIndex = $derived(vwindow ? vwindow.start : 0);
|
|
120
138
|
</script>
|
|
121
139
|
|
|
122
140
|
<div class="data-content-panel" bind:this={viewPanel}>
|
|
123
141
|
<TableHeaderPanel
|
|
124
|
-
{
|
|
142
|
+
{onCellClick}
|
|
125
143
|
{orderColumn}
|
|
126
144
|
{orderDirection}
|
|
127
145
|
dataCols={columns}
|
|
128
146
|
{scrollLeft}
|
|
129
147
|
width={tabWidth}
|
|
130
|
-
{
|
|
131
|
-
{
|
|
148
|
+
{whitespace}
|
|
149
|
+
{onWidthChange}
|
|
132
150
|
{headerHeight}
|
|
133
151
|
/>
|
|
134
152
|
<div
|
|
@@ -140,7 +158,11 @@
|
|
|
140
158
|
>
|
|
141
159
|
{#if rows && rows.length > 0}
|
|
142
160
|
<div style="box-sizing: border-box; width: {rowWidth}px; top: 0px">
|
|
143
|
-
{#
|
|
161
|
+
{#if vwindow}
|
|
162
|
+
<div style="height: {vwindow.topPad}px"></div>
|
|
163
|
+
{/if}
|
|
164
|
+
{#each visibleRows as row, i (startIndex + i)}
|
|
165
|
+
{@const idx = startIndex + i}
|
|
144
166
|
<DataRow
|
|
145
167
|
fontStyle={getRowFontStyle?.(row.data)}
|
|
146
168
|
{rowHeight}
|
|
@@ -161,10 +183,13 @@
|
|
|
161
183
|
</div>
|
|
162
184
|
{/if}
|
|
163
185
|
{/each}
|
|
186
|
+
{#if vwindow}
|
|
187
|
+
<div style="height: {vwindow.bottomPad}px"></div>
|
|
188
|
+
{/if}
|
|
164
189
|
</div>
|
|
165
190
|
{:else}
|
|
166
191
|
<div class="empty-content-board" style="width: 100%">
|
|
167
|
-
<div>{
|
|
192
|
+
<div>{emptyText ?? 'Empty dataset.'}</div>
|
|
168
193
|
</div>
|
|
169
194
|
{/if}
|
|
170
195
|
</div>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type DataColumn from "../lib/DataColumn";
|
|
2
2
|
import type TableRow from "./TableRow";
|
|
3
|
-
import UniDataTable, { type
|
|
3
|
+
import UniDataTable, { type OnWidthChange } from "../UniDataTable";
|
|
4
4
|
import { OrderDirection } from "../lib/OrderDirection";
|
|
5
5
|
import type { GetRowFontStyle } from "../../types";
|
|
6
|
+
import type { VirtualWindow } from "../lib/virtualWindow";
|
|
6
7
|
interface Props {
|
|
7
8
|
columns: Array<DataColumn>;
|
|
8
9
|
rows: Array<TableRow>;
|
|
9
10
|
orderColumn: DataColumn;
|
|
10
11
|
orderDirection: OrderDirection;
|
|
11
12
|
getRowFontStyle?: GetRowFontStyle;
|
|
12
|
-
|
|
13
|
+
emptyText?: string | null;
|
|
13
14
|
list: Array<any>;
|
|
14
15
|
expandRow: TableRow | null;
|
|
15
16
|
scrollTop?: number;
|
|
@@ -19,11 +20,15 @@ interface Props {
|
|
|
19
20
|
inlineComponent?: any;
|
|
20
21
|
table: UniDataTable;
|
|
21
22
|
showVerticalScroll?: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
showHorizontalScroll?: boolean;
|
|
24
|
+
onWidthChange?: OnWidthChange;
|
|
25
|
+
onCellClick?: (col: DataColumn) => any;
|
|
25
26
|
tabWidth: number;
|
|
27
|
+
/** Row window when virtual scrolling is on; null renders every row. */
|
|
28
|
+
vwindow?: VirtualWindow | null;
|
|
29
|
+
/** Measured height of the scrollable data area (drives the virtual window). */
|
|
30
|
+
viewportHeight?: number;
|
|
26
31
|
}
|
|
27
|
-
declare const ContentPanel: import("svelte").Component<Props, {}, "
|
|
32
|
+
declare const ContentPanel: import("svelte").Component<Props, {}, "scrollTop" | "viewportHeight" | "rows" | "inlineRowHeight" | "tabWidth">;
|
|
28
33
|
type ContentPanel = ReturnType<typeof ContentPanel>;
|
|
29
34
|
export default ContentPanel;
|