@ticatec/uniface-element 5.0.5 → 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 +4 -3
- package/README_CN.md +4 -3
- 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/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 +15 -12
- 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 -15
- 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 +15 -14
- package/dist/data_table/DataTable.svelte.d.ts +2 -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/parts/ActionCell.svelte +3 -3
- package/dist/data_table/parts/ActionCell.svelte.d.ts +1 -1
- package/dist/data_table/parts/ActionsRow.svelte +7 -5
- package/dist/data_table/parts/ContentPanel.svelte +14 -14
- package/dist/data_table/parts/ContentPanel.svelte.d.ts +5 -5
- package/dist/data_table/parts/FixedColumnsPanel.svelte +15 -15
- package/dist/data_table/parts/FixedColumnsPanel.svelte.d.ts +4 -4
- package/dist/data_table/parts/FixedHeaderPanel.svelte +13 -13
- 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/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 +15 -5
- 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 +17 -13
- 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 +5 -1
- package/dist/i18nRes/i18nRes.js +5 -1
- 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 +16 -12
- 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/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/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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { untrack, type Snippet } from 'svelte';
|
|
4
4
|
import {SvelteSet} from "svelte/reactivity";
|
|
5
|
-
import type {TreeLazyLoader,
|
|
5
|
+
import type {TreeLazyLoader, IsNodeVisible, BeforeNodeChange, OnNodeChange} from "../../types";
|
|
6
6
|
import TreeNodeView from "./TreeNodeView.svelte";
|
|
7
7
|
import type {OnContextMenu} from "../../overlay/context-menu/ContextMenuItem";
|
|
8
8
|
import type {HierarchyTree, IHierarchyData} from "../../lib";
|
|
@@ -32,11 +32,19 @@
|
|
|
32
32
|
lazyLoader?: TreeLazyLoader | null;
|
|
33
33
|
activeNode?: any;
|
|
34
34
|
class?: string;
|
|
35
|
-
isVisible?:
|
|
36
|
-
|
|
35
|
+
isVisible?: IsNodeVisible;
|
|
36
|
+
/**
|
|
37
|
+
* 切换选中节点前的否决钩子:返回 false 阻止切换;node 为 null 表示取消选中。
|
|
38
|
+
*/
|
|
39
|
+
beforeChange?: BeforeNodeChange;
|
|
40
|
+
/**
|
|
41
|
+
* 选中节点变化后的通知。
|
|
42
|
+
*/
|
|
43
|
+
onchange?: OnNodeChange;
|
|
37
44
|
onfocus?: (event: FocusEvent) => void;
|
|
38
45
|
onblur?: (event: FocusEvent) => void;
|
|
39
|
-
|
|
46
|
+
/** 节点右键菜单回调 (event, node) */
|
|
47
|
+
oncontextmenu?: OnContextMenu;
|
|
40
48
|
title?: string;
|
|
41
49
|
/** 初始展开多少层(0 = 全部折叠,1 = 展开根节点,依此类推)。默认 0。 */
|
|
42
50
|
defaultExpandDepth?: number;
|
|
@@ -53,10 +61,11 @@
|
|
|
53
61
|
activeNode = $bindable<any>(null),
|
|
54
62
|
class: className = '',
|
|
55
63
|
isVisible,
|
|
64
|
+
beforeChange,
|
|
56
65
|
onchange,
|
|
57
66
|
onfocus,
|
|
58
67
|
onblur,
|
|
59
|
-
|
|
68
|
+
oncontextmenu,
|
|
60
69
|
title = undefined,
|
|
61
70
|
defaultExpandDepth = 0
|
|
62
71
|
}: Props = $props();
|
|
@@ -90,14 +99,17 @@
|
|
|
90
99
|
return lazyLoader == null ? !node.isLeaf : lazyLoader.isBranch(node);
|
|
91
100
|
};
|
|
92
101
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
accept =
|
|
96
|
-
if (accept
|
|
102
|
+
// 统一的选中切换入口:先问 beforeChange(或旧语义的 onchange),通过后再更新并通知
|
|
103
|
+
const changeActive = async (node: IHierarchyData<any> | null): Promise<boolean> => {
|
|
104
|
+
const accept = beforeChange == null || (await beforeChange(node)) !== false;
|
|
105
|
+
if (accept) {
|
|
97
106
|
activeNode = node;
|
|
107
|
+
onchange?.(node);
|
|
98
108
|
}
|
|
99
109
|
return accept;
|
|
100
|
-
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const selectNode = async (node: IHierarchyData<any>): Promise<void> => { await changeActive(node); };
|
|
101
113
|
|
|
102
114
|
const handleToggle = async (node: IHierarchyData<any>) => {
|
|
103
115
|
const key = tree.getKey(node.data);
|
|
@@ -132,11 +144,7 @@
|
|
|
132
144
|
}
|
|
133
145
|
|
|
134
146
|
const handleTitleClick = async () => {
|
|
135
|
-
|
|
136
|
-
accept = accept == null ? true : accept;
|
|
137
|
-
if (accept == null || accept == true) {
|
|
138
|
-
activeNode = null;
|
|
139
|
-
}
|
|
147
|
+
await changeActive(null);
|
|
140
148
|
}
|
|
141
149
|
|
|
142
150
|
</script>
|
|
@@ -158,12 +166,12 @@
|
|
|
158
166
|
{nodeIcon}
|
|
159
167
|
{chevronIcon}
|
|
160
168
|
{activeNode}
|
|
161
|
-
|
|
162
|
-
{
|
|
163
|
-
{
|
|
169
|
+
expandable={isBranch(node)}
|
|
170
|
+
{oncontextmenu}
|
|
171
|
+
onselect={selectNode}
|
|
164
172
|
expanded={expanded.has(tree.getKey(node.data))}
|
|
165
173
|
loading={loading.has(tree.getKey(node.data))}
|
|
166
|
-
|
|
174
|
+
ontoggle={() => handleToggle(node)}
|
|
167
175
|
/>
|
|
168
176
|
{/if}
|
|
169
177
|
{/each}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
-
import type { TreeLazyLoader,
|
|
2
|
+
import type { TreeLazyLoader, IsNodeVisible, BeforeNodeChange, OnNodeChange } from "../../types";
|
|
3
3
|
import type { OnContextMenu } from "../../overlay/context-menu/ContextMenuItem";
|
|
4
4
|
import type { HierarchyTree, IHierarchyData } from "../../lib";
|
|
5
5
|
type GetText<T> = (item: T) => string;
|
|
@@ -23,11 +23,19 @@ interface Props {
|
|
|
23
23
|
lazyLoader?: TreeLazyLoader | null;
|
|
24
24
|
activeNode?: any;
|
|
25
25
|
class?: string;
|
|
26
|
-
isVisible?:
|
|
27
|
-
|
|
26
|
+
isVisible?: IsNodeVisible;
|
|
27
|
+
/**
|
|
28
|
+
* 切换选中节点前的否决钩子:返回 false 阻止切换;node 为 null 表示取消选中。
|
|
29
|
+
*/
|
|
30
|
+
beforeChange?: BeforeNodeChange;
|
|
31
|
+
/**
|
|
32
|
+
* 选中节点变化后的通知。
|
|
33
|
+
*/
|
|
34
|
+
onchange?: OnNodeChange;
|
|
28
35
|
onfocus?: (event: FocusEvent) => void;
|
|
29
36
|
onblur?: (event: FocusEvent) => void;
|
|
30
|
-
|
|
37
|
+
/** 节点右键菜单回调 (event, node) */
|
|
38
|
+
oncontextmenu?: OnContextMenu;
|
|
31
39
|
title?: string;
|
|
32
40
|
/** 初始展开多少层(0 = 全部折叠,1 = 展开根节点,依此类推)。默认 0。 */
|
|
33
41
|
defaultExpandDepth?: number;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import TreeView, { type GetIcon, type NodeIconContext, type ChevronIconContext } from "./TreeView.svelte";
|
|
2
|
-
import type { TreeLazyLoader,
|
|
2
|
+
import type { TreeLazyLoader, IsNodeVisible, BeforeNodeChange, OnNodeChange, LoadChildren } from "../../types";
|
|
3
3
|
import type { IHierarchyData } from "../../lib";
|
|
4
4
|
export type { IHierarchyData };
|
|
5
|
-
export type LazyLoader = TreeLazyLoader;
|
|
6
5
|
export default TreeView;
|
|
7
|
-
export type { TreeLazyLoader,
|
|
6
|
+
export type { TreeLazyLoader, IsNodeVisible, BeforeNodeChange, OnNodeChange, LoadChildren };
|
|
8
7
|
export type { GetIcon, NodeIconContext, ChevronIconContext };
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import FixedColumnsPanel from "./parts/FixedColumnsPanel.svelte";
|
|
10
10
|
import ActionPanel from "./parts/ActionsPanel.svelte";
|
|
11
11
|
import { OrderDirection } from "./lib/OrderDirection";
|
|
12
|
-
import type {
|
|
12
|
+
import type { CompareFn } from "./lib/CompareFn";
|
|
13
13
|
import type { GetRowFontStyle } from "../types";
|
|
14
14
|
import { computeVirtualWindow } from "./lib/virtualWindow";
|
|
15
15
|
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
inlineRowHeight?: number;
|
|
25
25
|
rowBorder?: boolean;
|
|
26
26
|
colBorder?: boolean;
|
|
27
|
-
|
|
27
|
+
/** 无数据时显示的文案 */
|
|
28
|
+
emptyText?: string;
|
|
28
29
|
getRowFontStyle?: GetRowFontStyle<T>;
|
|
29
30
|
style?: string;
|
|
30
31
|
/**
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
inlineRowHeight = $bindable(80),
|
|
48
49
|
rowBorder = false,
|
|
49
50
|
colBorder = false,
|
|
50
|
-
|
|
51
|
+
emptyText,
|
|
51
52
|
getRowFontStyle = undefined,
|
|
52
53
|
style = '',
|
|
53
54
|
virtual = false,
|
|
@@ -130,14 +131,14 @@
|
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
|
|
133
|
-
const
|
|
134
|
+
const onWidthChange = () => {
|
|
134
135
|
if (!table) return;
|
|
135
136
|
tabStyle = table.generateTemplateStyle();
|
|
136
137
|
tabWidth = table.width;
|
|
137
138
|
frozenWidth = table.frozenWidth;
|
|
138
139
|
};
|
|
139
140
|
|
|
140
|
-
const sortRows = (compareFun:
|
|
141
|
+
const sortRows = (compareFun: CompareFn, descending: boolean) => {
|
|
141
142
|
if (!table) return;
|
|
142
143
|
expandRow = null;
|
|
143
144
|
let oList = list.sort(compareFun);
|
|
@@ -145,7 +146,7 @@
|
|
|
145
146
|
rows = table.rows;
|
|
146
147
|
};
|
|
147
148
|
|
|
148
|
-
const
|
|
149
|
+
const onCellClick = (col: DataColumn) => {
|
|
149
150
|
if (col.compareFunction != null) {
|
|
150
151
|
if (col.field === orderColumn?.field) {
|
|
151
152
|
orderDirection = orderDirection == OrderDirection.Ascending
|
|
@@ -159,7 +160,7 @@
|
|
|
159
160
|
}
|
|
160
161
|
};
|
|
161
162
|
|
|
162
|
-
const
|
|
163
|
+
const onRowExpand = async (row: TableRow) => {
|
|
163
164
|
if (row == expandRow) {
|
|
164
165
|
expandRow = null;
|
|
165
166
|
inlineComponent = null;
|
|
@@ -174,11 +175,11 @@
|
|
|
174
175
|
{#if table && dataColumns && fixedCols}
|
|
175
176
|
{#if indicatorColumn || fixedCols.length > 0}
|
|
176
177
|
<FixedColumnsPanel
|
|
177
|
-
{
|
|
178
|
+
{onRowExpand}
|
|
178
179
|
bind:selectedRows
|
|
179
180
|
{orderDirection}
|
|
180
181
|
orderColumn={orderColumn as DataColumn}
|
|
181
|
-
{
|
|
182
|
+
{onCellClick}
|
|
182
183
|
{indicatorColumn}
|
|
183
184
|
bind:expandRow
|
|
184
185
|
{rowHeight}
|
|
@@ -186,7 +187,7 @@
|
|
|
186
187
|
{fixedCols}
|
|
187
188
|
{inlineRowHeight}
|
|
188
189
|
{rows}
|
|
189
|
-
{
|
|
190
|
+
{onWidthChange}
|
|
190
191
|
width={frozenWidth}
|
|
191
192
|
bind:scrollTop
|
|
192
193
|
{vwindow}
|
|
@@ -197,8 +198,8 @@
|
|
|
197
198
|
columns={dataColumns}
|
|
198
199
|
{orderDirection}
|
|
199
200
|
orderColumn={orderColumn as DataColumn}
|
|
200
|
-
{
|
|
201
|
-
{
|
|
201
|
+
{onWidthChange}
|
|
202
|
+
{onCellClick}
|
|
202
203
|
{tabWidth}
|
|
203
204
|
bind:rows
|
|
204
205
|
bind:scrollTop
|
|
@@ -209,8 +210,8 @@
|
|
|
209
210
|
{table}
|
|
210
211
|
{inlineComponent}
|
|
211
212
|
bind:inlineRowHeight
|
|
212
|
-
{
|
|
213
|
-
|
|
213
|
+
{emptyText}
|
|
214
|
+
showHorizontalScroll={actionsColumn != null || indicatorColumn != null || fixedCols.length > 0}
|
|
214
215
|
showVerticalScroll={actionsColumn == null}
|
|
215
216
|
{getRowFontStyle}
|
|
216
217
|
{vwindow}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# DataTable
|
|
2
2
|
|
|
3
|
+
> **Renamed in 5.1.0**: this document uses the names from the [API Naming Guide](../../docs/NAMING.md); the old names `displayNo`, `emptyIndicator`, `warp` were removed in 5.1.0 (no compatibility aliases are kept).
|
|
4
|
+
|
|
3
5
|
A powerful and flexible data table component featuring sorting, row selection, inline expansion, custom cell formatting, action columns, frozen columns, and row actions. Perfect for displaying large datasets with complex data structures and user interactions.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -49,7 +51,7 @@ import type { DataColumn, ActionsColumn, IndicatorColumn, RowAction } from "@tic
|
|
|
49
51
|
| `inlineRowHeight` | `number` | `80` | Height of expanded inline rows |
|
|
50
52
|
| `rowBorder` | `boolean` | `false` | Whether to show horizontal row borders |
|
|
51
53
|
| `colBorder` | `boolean` | `false` | Whether to show vertical column borders |
|
|
52
|
-
| `
|
|
54
|
+
| `emptyText` | `string \| undefined` | `undefined` | Text to show when no data is available |
|
|
53
55
|
| `style` | `string` | `""` | Additional CSS styles |
|
|
54
56
|
|
|
55
57
|
## Types
|
|
@@ -64,7 +66,7 @@ interface DataColumn {
|
|
|
64
66
|
frozen?: boolean; // Whether column is frozen/fixed
|
|
65
67
|
align?: 'left' | 'center' | 'right'; // Text alignment
|
|
66
68
|
minWidth?: number; // Minimum column width
|
|
67
|
-
|
|
69
|
+
wrap?: boolean; // Whether text can wrap
|
|
68
70
|
formatter?: FormatCell; // Cell formatting function
|
|
69
71
|
escapeHTML?: boolean; // Whether to escape HTML in content
|
|
70
72
|
href?: HrefBuilder; // Link builder function
|
|
@@ -92,7 +94,7 @@ interface ActionsColumn {
|
|
|
92
94
|
interface IndicatorColumn {
|
|
93
95
|
width: number; // Column width in pixels
|
|
94
96
|
selectable?: boolean; // Whether rows are selectable
|
|
95
|
-
|
|
97
|
+
showRowNo?: boolean; // Whether to show row numbers
|
|
96
98
|
buildInlineComponent?: (data: any) => Promise<any>; // Inline component builder
|
|
97
99
|
}
|
|
98
100
|
```
|
|
@@ -189,7 +191,7 @@ interface RowAction {
|
|
|
189
191
|
const indicatorColumn = {
|
|
190
192
|
width: 60,
|
|
191
193
|
selectable: true,
|
|
192
|
-
|
|
194
|
+
showRowNo: true
|
|
193
195
|
};
|
|
194
196
|
|
|
195
197
|
const actionsColumn = {
|
|
@@ -334,7 +336,7 @@ interface RowAction {
|
|
|
334
336
|
const indicatorColumn = {
|
|
335
337
|
width: 50,
|
|
336
338
|
selectable: false,
|
|
337
|
-
|
|
339
|
+
showRowNo: false,
|
|
338
340
|
buildInlineComponent: async (orderData) => {
|
|
339
341
|
// Simulate API call to fetch order details
|
|
340
342
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
@@ -372,7 +374,7 @@ interface RowAction {
|
|
|
372
374
|
list={orders}
|
|
373
375
|
{indicatorColumn}
|
|
374
376
|
inlineRowHeight={200}
|
|
375
|
-
|
|
377
|
+
emptyText="No orders found"
|
|
376
378
|
/>
|
|
377
379
|
```
|
|
378
380
|
|
|
@@ -509,7 +511,7 @@ interface RowAction {
|
|
|
509
511
|
const indicatorColumn = {
|
|
510
512
|
width: 60,
|
|
511
513
|
selectable: true,
|
|
512
|
-
|
|
514
|
+
showRowNo: true,
|
|
513
515
|
buildInlineComponent: async (product) => {
|
|
514
516
|
// Simulate loading product details
|
|
515
517
|
return ProductDetails;
|
|
@@ -607,7 +609,7 @@ interface RowAction {
|
|
|
607
609
|
inlineRowHeight={300}
|
|
608
610
|
rowBorder={true}
|
|
609
611
|
colBorder={true}
|
|
610
|
-
|
|
612
|
+
emptyText="No products found. Add some products to get started."
|
|
611
613
|
/>
|
|
612
614
|
</div>
|
|
613
615
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# DataTable 数据表格组件
|
|
2
2
|
|
|
3
|
+
> **5.1.0 重命名**:本文使用 [API 命名规范](../../docs/NAMING_CN.md) 中的名字;旧名 `displayNo`, `emptyIndicator`, `warp` 已在 5.1.0 移除(5.1.0 不保留兼容别名)。
|
|
4
|
+
|
|
3
5
|
一个功能强大且灵活的数据表格组件,支持排序、行选择、内联扩展、自定义单元格格式、操作列、冻结列和行操作。非常适合显示大型数据集、复杂数据结构和用户交互。
|
|
4
6
|
|
|
5
7
|
## 安装
|
|
@@ -49,7 +51,7 @@ import type { DataColumn, ActionsColumn, IndicatorColumn, RowAction } from "@tic
|
|
|
49
51
|
| `inlineRowHeight` | `number` | `80` | 扩展内联行高度(像素) |
|
|
50
52
|
| `rowBorder` | `boolean` | `false` | 是否显示水平行边框 |
|
|
51
53
|
| `colBorder` | `boolean` | `false` | 是否显示垂直列边框 |
|
|
52
|
-
| `
|
|
54
|
+
| `emptyText` | `string \| undefined` | `undefined` | 无数据时显示的文本 |
|
|
53
55
|
| `style` | `string` | `""` | 附加 CSS 样式 |
|
|
54
56
|
|
|
55
57
|
## 类型
|
|
@@ -64,7 +66,7 @@ interface DataColumn {
|
|
|
64
66
|
frozen?: boolean; // 列是否冻结/固定
|
|
65
67
|
align?: 'left' | 'center' | 'right'; // 文本对齐方式
|
|
66
68
|
minWidth?: number; // 最小列宽
|
|
67
|
-
|
|
69
|
+
wrap?: boolean; // 文本是否可换行
|
|
68
70
|
formatter?: FormatCell; // 单元格格式化函数
|
|
69
71
|
escapeHTML?: boolean; // 是否转义 HTML 内容
|
|
70
72
|
href?: HrefBuilder; // 链接生成函数
|
|
@@ -92,7 +94,7 @@ interface ActionsColumn {
|
|
|
92
94
|
interface IndicatorColumn {
|
|
93
95
|
width: number; // 列宽(像素)
|
|
94
96
|
selectable?: boolean; // 行是否可选择
|
|
95
|
-
|
|
97
|
+
showRowNo?: boolean; // 是否显示行号
|
|
96
98
|
buildInlineComponent?: (data: any) => Promise<any>; // 内联组件生成器
|
|
97
99
|
}
|
|
98
100
|
```
|
|
@@ -189,7 +191,7 @@ interface RowAction {
|
|
|
189
191
|
const indicatorColumn = {
|
|
190
192
|
width: 60,
|
|
191
193
|
selectable: true,
|
|
192
|
-
|
|
194
|
+
showRowNo: true
|
|
193
195
|
};
|
|
194
196
|
|
|
195
197
|
const actionsColumn = {
|
|
@@ -334,7 +336,7 @@ interface RowAction {
|
|
|
334
336
|
const indicatorColumn = {
|
|
335
337
|
width: 50,
|
|
336
338
|
selectable: false,
|
|
337
|
-
|
|
339
|
+
showRowNo: false,
|
|
338
340
|
buildInlineComponent: async (orderData) => {
|
|
339
341
|
// 模拟 API 调用以获取订单详情
|
|
340
342
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
@@ -372,7 +374,7 @@ interface RowAction {
|
|
|
372
374
|
list={orders}
|
|
373
375
|
{indicatorColumn}
|
|
374
376
|
inlineRowHeight={200}
|
|
375
|
-
|
|
377
|
+
emptyText="未找到订单"
|
|
376
378
|
/>
|
|
377
379
|
```
|
|
378
380
|
|
|
@@ -509,7 +511,7 @@ interface RowAction {
|
|
|
509
511
|
const indicatorColumn = {
|
|
510
512
|
width: 60,
|
|
511
513
|
selectable: true,
|
|
512
|
-
|
|
514
|
+
showRowNo: true,
|
|
513
515
|
buildInlineComponent: async (product) => {
|
|
514
516
|
// 模拟加载产品详情
|
|
515
517
|
return ProductDetails;
|
|
@@ -607,7 +609,7 @@ interface RowAction {
|
|
|
607
609
|
inlineRowHeight={300}
|
|
608
610
|
rowBorder={true}
|
|
609
611
|
colBorder={true}
|
|
610
|
-
|
|
612
|
+
emptyText="未找到产品,请添加一些产品以开始。"
|
|
611
613
|
/>
|
|
612
614
|
</div>
|
|
613
615
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type DataColumn from "./lib/DataColumn";
|
|
2
2
|
import type TableRow from "./parts/TableRow";
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
3
|
+
export type OnRowExpand = (row: TableRow) => void;
|
|
4
|
+
export type OnRowSelect = (row: TableRow, value: boolean) => void;
|
|
5
|
+
export type OnWidthChange = () => void;
|
|
6
|
+
export type OnSelectAll = (value: boolean) => void;
|
|
7
7
|
export declare enum SelectionMode {
|
|
8
8
|
All = 1,
|
|
9
9
|
Partial = 0,
|
|
@@ -48,7 +48,7 @@ export default class UniDataTable {
|
|
|
48
48
|
if (col.visible != false) {
|
|
49
49
|
this._frozenWidth += col.width;
|
|
50
50
|
colStyle += `#tab-${this.id} .fz_col-${idx - inv} {width: ${col.width}px; text-align: ${col.align ?? 'left'}}\n`;
|
|
51
|
-
if (col.
|
|
51
|
+
if (col.wrap) {
|
|
52
52
|
colStyle += `#tab-${this.id} .fz_col-${idx - inv}>div {white-space: wrap}\n`;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -61,7 +61,7 @@ export default class UniDataTable {
|
|
|
61
61
|
if (col.visible != false) {
|
|
62
62
|
this._width += col.width;
|
|
63
63
|
colStyle += `#tab-${this.id} .col-${idx - inv} { width: ${col.width}px ; text-align: ${col.align ?? 'left'} }\n`;
|
|
64
|
-
if (col.
|
|
64
|
+
if (col.wrap) {
|
|
65
65
|
colStyle += `#tab-${this.id} .col-${idx - inv}>div {white-space: wrap}\n`;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import DataTable from "./DataTable.svelte";
|
|
2
2
|
import type ActionsColumn from "./lib/ActionsColumn";
|
|
3
|
-
import type {
|
|
3
|
+
import type { FormatCellFn, CellHint } from "./lib/FormatCellFn";
|
|
4
4
|
import type IndicatorColumn from "./lib/IndicatorColumn";
|
|
5
5
|
import type RowAction from "./lib/RowAction";
|
|
6
|
-
import type { GetRowActions,
|
|
6
|
+
import type { GetRowActions, ActionHandler } from "./lib/RowAction";
|
|
7
7
|
import type DataColumn from "./lib/DataColumn";
|
|
8
|
-
import type { CellAction } from "
|
|
8
|
+
import type { CellAction } from "./lib/CellAction";
|
|
9
9
|
import ActionCell from "./parts/ActionCell.svelte";
|
|
10
10
|
export default DataTable;
|
|
11
11
|
export { ActionCell };
|
|
12
|
-
export type { ActionsColumn, IndicatorColumn,
|
|
13
|
-
export type { RowAction, GetRowActions,
|
|
12
|
+
export type { ActionsColumn, IndicatorColumn, FormatCellFn, CellHint, DataColumn };
|
|
13
|
+
export type { RowAction, GetRowActions, ActionHandler, CellAction };
|
|
@@ -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>>;
|
|
@@ -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}
|