@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,5 +1,7 @@
|
|
|
1
1
|
# GroupCheckBox
|
|
2
2
|
|
|
3
|
+
> **Renamed in 5.1.0**: this document uses the names from the [API Naming Guide](../../../../docs/NAMING.md); the old names `itemStyle` were removed in 5.1.0 (no compatibility aliases are kept).
|
|
4
|
+
|
|
3
5
|
A multi-select group of checkboxes wrapped in the shared form editor shell. Options are rendered in a horizontal row; the bound `value` can be either a **delimiter-joined string** or a **bitmask number**.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -68,7 +70,7 @@ import GroupCheckBox from "@ticatec/uniface-element/GroupCheckBox";
|
|
|
68
70
|
| `disabledOptions` | `string[]` | `[]` | Keys of options that stay disabled |
|
|
69
71
|
| `hideOptions` | `string[]` | `[]` | Keys of options that are not rendered |
|
|
70
72
|
| `style` | `string` | `""` | Inline style on the form editor |
|
|
71
|
-
| `
|
|
73
|
+
| `item$style` | `string` | `""` | Inline style applied to each `CheckBox` |
|
|
72
74
|
| `class` | `string` | `""` | Extra class on the form editor |
|
|
73
75
|
| `onchange` | `(value: string \| number) => void` | — | Fired after a **user** toggle; receives the new `value` |
|
|
74
76
|
| `onfocus` | `(e: FocusEvent) => void` | — | First focus into the group |
|
|
@@ -301,7 +303,7 @@ Keep `options` order stable when using bit mode; reordering changes bit meanings
|
|
|
301
303
|
- Root list: `.group-check-box` — `display: flex; flex-direction: row; align-items: center`
|
|
302
304
|
- Compact: `.group-check-box.compact`
|
|
303
305
|
- Shell chrome (border, fill, error) comes from `FormEditor` via `variant` / `error` / `tooltip`
|
|
304
|
-
- Per-item look: `
|
|
306
|
+
- Per-item look: `item$style` on each checkbox; checkbox tokens are those of [`CheckBox`](../../checkbox/README.md)
|
|
305
307
|
|
|
306
308
|
```svelte
|
|
307
309
|
<GroupCheckBox
|
|
@@ -309,7 +311,7 @@ Keep `options` order stable when using bit mode; reordering changes bit meanings
|
|
|
309
311
|
bind:value={value}
|
|
310
312
|
variant="outlined"
|
|
311
313
|
style="min-width: 320px;"
|
|
312
|
-
|
|
314
|
+
item$style="margin-right: 4px;"
|
|
313
315
|
/>
|
|
314
316
|
```
|
|
315
317
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# GroupCheckBox 组复选框
|
|
2
2
|
|
|
3
|
+
> **5.1.0 重命名**:本文使用 [API 命名规范](../../../../docs/NAMING_CN.md) 中的名字;旧名 `itemStyle` 已在 5.1.0 移除(5.1.0 不保留兼容别名)。
|
|
4
|
+
|
|
3
5
|
多选复选框组,包在共享表单编辑器外壳中。选项横向排列;绑定的 `value` 可以是**分隔符拼接的字符串**,也可以是**位掩码数字**。
|
|
4
6
|
|
|
5
7
|
## 安装
|
|
@@ -68,7 +70,7 @@ import GroupCheckBox from "@ticatec/uniface-element/GroupCheckBox";
|
|
|
68
70
|
| `disabledOptions` | `string[]` | `[]` | 保持禁用的选项键 |
|
|
69
71
|
| `hideOptions` | `string[]` | `[]` | 不渲染的选项键 |
|
|
70
72
|
| `style` | `string` | `""` | 表单编辑器内联样式 |
|
|
71
|
-
| `
|
|
73
|
+
| `item$style` | `string` | `""` | 应用到每个 `CheckBox` 的内联样式 |
|
|
72
74
|
| `class` | `string` | `""` | 表单编辑器额外 CSS 类 |
|
|
73
75
|
| `onchange` | `(value: string \| number) => void` | — | **用户**切换后回调,参数为新的 `value` |
|
|
74
76
|
| `onfocus` | `(e: FocusEvent) => void` | — | 焦点进入组时触发 |
|
|
@@ -301,7 +303,7 @@ import GroupCheckBox from "@ticatec/uniface-element/GroupCheckBox";
|
|
|
301
303
|
- 列表根节点:`.group-check-box` — `display: flex; flex-direction: row; align-items: center`
|
|
302
304
|
- 紧凑:`.group-check-box.compact`
|
|
303
305
|
- 边框 / 填充 / 错误等外壳样式来自 `FormEditor` 的 `variant` / `error` / `tooltip`
|
|
304
|
-
- 单项外观:`
|
|
306
|
+
- 单项外观:`item$style`;复选框主题变量见 [`CheckBox`](../../checkbox/README_CN.md)
|
|
305
307
|
|
|
306
308
|
```svelte
|
|
307
309
|
<GroupCheckBox
|
|
@@ -309,7 +311,7 @@ import GroupCheckBox from "@ticatec/uniface-element/GroupCheckBox";
|
|
|
309
311
|
bind:value={value}
|
|
310
312
|
variant="outlined"
|
|
311
313
|
style="min-width: 320px;"
|
|
312
|
-
|
|
314
|
+
item$style="margin-right: 4px;"
|
|
313
315
|
/>
|
|
314
316
|
```
|
|
315
317
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import RadioButton from "../../radio_button/RadioButton.svelte";
|
|
3
3
|
import FormEditor from "../../FormEditor.svelte";
|
|
4
|
-
import type {
|
|
4
|
+
import type {EditorVariant} from "../../types";
|
|
5
|
+
import type {EditorEvents} from "../../events";
|
|
5
6
|
|
|
6
7
|
interface OptionItem {
|
|
7
8
|
[key: string]: any;
|
|
@@ -17,14 +18,15 @@
|
|
|
17
18
|
options: Array<OptionItem>;
|
|
18
19
|
keyField?: string;
|
|
19
20
|
textField?: string;
|
|
20
|
-
|
|
21
|
+
/** 每个选项的内联样式 */
|
|
22
|
+
item$style?: string;
|
|
21
23
|
disabledOptions?: Array<string>;
|
|
22
24
|
variant?: EditorVariant;
|
|
23
25
|
compact?: boolean;
|
|
24
26
|
class?: string;
|
|
25
27
|
onchange?: (value: any) => void;
|
|
26
|
-
onblur?: (
|
|
27
|
-
onfocus?: (
|
|
28
|
+
onblur?: (event: FocusEvent) => void;
|
|
29
|
+
onfocus?: (event: FocusEvent) => void;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
let {
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
options,
|
|
38
40
|
keyField = "code",
|
|
39
41
|
textField = "text",
|
|
40
|
-
|
|
42
|
+
item$style = '',
|
|
41
43
|
disabledOptions = [],
|
|
42
44
|
variant,
|
|
43
45
|
compact = false,
|
|
@@ -116,7 +118,7 @@
|
|
|
116
118
|
{readonly}
|
|
117
119
|
{compact}
|
|
118
120
|
{style}
|
|
119
|
-
|
|
121
|
+
class={className}
|
|
120
122
|
>
|
|
121
123
|
<!-- onclick only forwards focus to the first radio when the container's own
|
|
122
124
|
background is clicked; each RadioButton inside is independently
|
|
@@ -130,7 +132,7 @@
|
|
|
130
132
|
{readonly}
|
|
131
133
|
disabled={disabled || disabledOptions.indexOf(op[keyField]) > -1}
|
|
132
134
|
label={op[textField]}
|
|
133
|
-
style={
|
|
135
|
+
style={item$style}
|
|
134
136
|
bind:group={value}
|
|
135
137
|
value={op[keyField]}
|
|
136
138
|
onchange={handleRadioChange}
|
|
@@ -12,14 +12,15 @@ interface Props {
|
|
|
12
12
|
options: Array<OptionItem>;
|
|
13
13
|
keyField?: string;
|
|
14
14
|
textField?: string;
|
|
15
|
-
|
|
15
|
+
/** 每个选项的内联样式 */
|
|
16
|
+
item$style?: string;
|
|
16
17
|
disabledOptions?: Array<string>;
|
|
17
18
|
variant?: EditorVariant;
|
|
18
19
|
compact?: boolean;
|
|
19
20
|
class?: string;
|
|
20
21
|
onchange?: (value: any) => void;
|
|
21
|
-
onblur?: (
|
|
22
|
-
onfocus?: (
|
|
22
|
+
onblur?: (event: FocusEvent) => void;
|
|
23
|
+
onfocus?: (event: FocusEvent) => void;
|
|
23
24
|
}
|
|
24
25
|
declare const GroupRadioBox: import("svelte").Component<Props, {
|
|
25
26
|
focus: () => void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# GroupRadioBox
|
|
2
2
|
|
|
3
|
+
> **Renamed in 5.1.0**: this document uses the names from the [API Naming Guide](../../../../docs/NAMING.md); the old names `itemStyle` were removed in 5.1.0 (no compatibility aliases are kept).
|
|
4
|
+
|
|
3
5
|
A flexible group radio box component that allows users to select a single option from a predefined list. Features comprehensive state management, custom styling variants, and focus/blur event handling for seamless form integration.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -57,7 +59,7 @@ import GroupRadioBox from "@ticatec/uniface-element/GroupRadioBox";
|
|
|
57
59
|
| `compact` | `boolean` | `false` | Whether to use compact spacing |
|
|
58
60
|
| `disabledOptions` | `Array<string>` | `[]` | Array of option keys to disable |
|
|
59
61
|
| `style` | `string` | `""` | Additional CSS styles |
|
|
60
|
-
| `
|
|
62
|
+
| `item$style` | `string` | `""` | CSS styles for individual radio button items |
|
|
61
63
|
| `class` | `string` | `""` | Custom CSS class |
|
|
62
64
|
| `onchange` | `(value: any) => void` | - | Change event handler |
|
|
63
65
|
| `onfocus` | `(() => void) \| null` | `null` | Focus event handler |
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# GroupRadioBox 组单选框组件
|
|
2
2
|
|
|
3
|
+
> **5.1.0 重命名**:本文使用 [API 命名规范](../../../../docs/NAMING_CN.md) 中的名字;旧名 `itemStyle` 已在 5.1.0 移除(5.1.0 不保留兼容别名)。
|
|
4
|
+
|
|
3
5
|
一个灵活的组单选框组件,允许用户从预定义的选项列表中选择单个选项。具备全面的状态管理、自定义样式变体以及焦点/失焦事件处理,可无缝集成到表单中。
|
|
4
6
|
|
|
5
7
|
## 安装
|
|
@@ -57,7 +59,7 @@ import GroupRadioBox from "@ticatec/uniface-element/GroupRadioBox";
|
|
|
57
59
|
| `compact` | `boolean` | `false` | 是否使用紧凑间距 |
|
|
58
60
|
| `disabledOptions` | `Array<string>` | `[]` | 要禁用的选项键数组 |
|
|
59
61
|
| `style` | `string` | `""` | 附加 CSS 样式 |
|
|
60
|
-
| `
|
|
62
|
+
| `item$style` | `string` | `""` | 单个单选框项目的 CSS 样式 |
|
|
61
63
|
| `class` | `string` | `""` | 自定义 CSS 类 |
|
|
62
64
|
| `onchange` | `(value: any) => void` | - | 更改事件处理程序 |
|
|
63
65
|
| `onfocus` | `(() => void) \| null` | `null` | 焦点事件处理程序 |
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type CommonFieldProps from "../common_editor/CommonFieldProps";
|
|
3
|
+
import type {BeforeRemove} from "../types";
|
|
4
|
+
import AttachmentEditor from "../attachment_files/AttachmentEditor.svelte";
|
|
5
|
+
import type {AttachmentLayout} from "../attachment_files/AttachmentFile";
|
|
6
|
+
import type {FileUpload} from "../attachment_files/FileUpload";
|
|
7
|
+
import type {RejectReason} from "../attachment_files/UploadTask";
|
|
8
|
+
import ImagePreview from "./ImagePreview.svelte";
|
|
9
|
+
import type ImageFile from "./ImageFile";
|
|
10
|
+
|
|
11
|
+
interface Props extends CommonFieldProps {
|
|
12
|
+
/** 已上传的图片列表(可绑定) */
|
|
13
|
+
files?: ImageFile[];
|
|
14
|
+
/** 排列方式:icon(缩略图瓦片,自动换行,默认)/ list(每行一张) */
|
|
15
|
+
layout?: AttachmentLayout;
|
|
16
|
+
/** 内容区高度;超出后内部滚动,不设则随内容自适应 */
|
|
17
|
+
height?: number | string;
|
|
18
|
+
/** 实际执行上传的函数;不传则只展示(不显示上传入口)。onUploaded 的第二个参数可传缩略图地址 */
|
|
19
|
+
uploadFile?: FileUpload;
|
|
20
|
+
/** 允许的文件类型(同 input accept) */
|
|
21
|
+
accept?: string;
|
|
22
|
+
/** 单个文件大小上限(字节) */
|
|
23
|
+
maxSize?: number;
|
|
24
|
+
/** 图片数量上限(含上传中的) */
|
|
25
|
+
maxFiles?: number;
|
|
26
|
+
/** 一次是否允许选择 / 拖入多张 */
|
|
27
|
+
multiple?: boolean;
|
|
28
|
+
/** 上传入口的文字(空态时作为拖放区提示) */
|
|
29
|
+
uploadText?: string;
|
|
30
|
+
/** 没有图片且不能上传时显示的文字 */
|
|
31
|
+
emptyText?: string;
|
|
32
|
+
/** 是否可预览:显示预览按钮,点击打开内置的大图预览 */
|
|
33
|
+
previewable?: boolean;
|
|
34
|
+
/** 自定义预览;传了则不再打开内置预览 */
|
|
35
|
+
onPreview?: (file: ImageFile) => void;
|
|
36
|
+
/** 删除图片前的否决钩子:返回 false 取消删除 */
|
|
37
|
+
beforeRemove?: BeforeRemove<ImageFile>;
|
|
38
|
+
/** 图片被删除后通知 */
|
|
39
|
+
onremove?: (file: ImageFile) => void;
|
|
40
|
+
/** 自定义下载;不传则通过 `file.uri` 直接下载 */
|
|
41
|
+
ondownload?: (file: ImageFile) => void;
|
|
42
|
+
/** 单张图片上传完成并加入 files 后通知 */
|
|
43
|
+
onFileUploaded?: (file: ImageFile, source: File) => void;
|
|
44
|
+
/** 文件因类型 / 大小 / 数量限制被拒绝时通知 */
|
|
45
|
+
onFileRejected?: (file: File, reason: RejectReason) => void;
|
|
46
|
+
/** 上传失败时通知(任务保留在列表中,可重试或移除) */
|
|
47
|
+
onUploadError?: (file: File, error: Error) => void;
|
|
48
|
+
/** files 变化后通知(上传完成或删除) */
|
|
49
|
+
onchange?: (files: ImageFile[]) => void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let {
|
|
53
|
+
disabled = false,
|
|
54
|
+
readonly = false,
|
|
55
|
+
variant,
|
|
56
|
+
compact = false,
|
|
57
|
+
theme,
|
|
58
|
+
tooltip,
|
|
59
|
+
error,
|
|
60
|
+
style = '',
|
|
61
|
+
files = $bindable<ImageFile[]>([]),
|
|
62
|
+
layout = 'icon',
|
|
63
|
+
height,
|
|
64
|
+
uploadFile,
|
|
65
|
+
accept = "image/*",
|
|
66
|
+
maxSize = 1024 * 1024 * 10,
|
|
67
|
+
maxFiles = 10,
|
|
68
|
+
multiple = true,
|
|
69
|
+
uploadText,
|
|
70
|
+
emptyText,
|
|
71
|
+
previewable = true,
|
|
72
|
+
onPreview,
|
|
73
|
+
beforeRemove,
|
|
74
|
+
onremove,
|
|
75
|
+
ondownload,
|
|
76
|
+
onFileUploaded,
|
|
77
|
+
onFileRejected,
|
|
78
|
+
onUploadError,
|
|
79
|
+
onfocus,
|
|
80
|
+
onblur,
|
|
81
|
+
onchange
|
|
82
|
+
}: Props = $props();
|
|
83
|
+
|
|
84
|
+
let editor: {openFileDialog: () => void; focus: () => void} | undefined = $state(undefined);
|
|
85
|
+
let showPreview = $state(false);
|
|
86
|
+
let previewSrc = $state('');
|
|
87
|
+
|
|
88
|
+
const handlePreview = (file: ImageFile) => {
|
|
89
|
+
if (onPreview) {
|
|
90
|
+
onPreview(file);
|
|
91
|
+
} else {
|
|
92
|
+
previewSrc = file.uri;
|
|
93
|
+
showPreview = true;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 打开系统文件选择框(等同于点击上传入口)
|
|
99
|
+
*/
|
|
100
|
+
export function openFileDialog() {
|
|
101
|
+
editor?.openFileDialog();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function focus() {
|
|
105
|
+
editor?.focus();
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<AttachmentEditor bind:this={editor} bind:files showThumbnail
|
|
110
|
+
{disabled} {readonly} {variant} {compact} {theme} {tooltip} {error} {style}
|
|
111
|
+
{layout} {height} {uploadFile} {accept} {maxSize} {maxFiles} {multiple} {uploadText} {emptyText}
|
|
112
|
+
onPreview={previewable || onPreview ? handlePreview : undefined}
|
|
113
|
+
{beforeRemove} {onremove} {ondownload} {onFileUploaded} {onFileRejected} {onUploadError}
|
|
114
|
+
{onfocus} {onblur} {onchange}/>
|
|
115
|
+
|
|
116
|
+
{#if showPreview}
|
|
117
|
+
<ImagePreview bind:visible={showPreview} src={previewSrc}/>
|
|
118
|
+
{/if}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type CommonFieldProps from "../common_editor/CommonFieldProps";
|
|
2
|
+
import type { BeforeRemove } from "../types";
|
|
3
|
+
import type { AttachmentLayout } from "../attachment_files/AttachmentFile";
|
|
4
|
+
import type { FileUpload } from "../attachment_files/FileUpload";
|
|
5
|
+
import type { RejectReason } from "../attachment_files/UploadTask";
|
|
6
|
+
import type ImageFile from "./ImageFile";
|
|
7
|
+
interface Props extends CommonFieldProps {
|
|
8
|
+
/** 已上传的图片列表(可绑定) */
|
|
9
|
+
files?: ImageFile[];
|
|
10
|
+
/** 排列方式:icon(缩略图瓦片,自动换行,默认)/ list(每行一张) */
|
|
11
|
+
layout?: AttachmentLayout;
|
|
12
|
+
/** 内容区高度;超出后内部滚动,不设则随内容自适应 */
|
|
13
|
+
height?: number | string;
|
|
14
|
+
/** 实际执行上传的函数;不传则只展示(不显示上传入口)。onUploaded 的第二个参数可传缩略图地址 */
|
|
15
|
+
uploadFile?: FileUpload;
|
|
16
|
+
/** 允许的文件类型(同 input accept) */
|
|
17
|
+
accept?: string;
|
|
18
|
+
/** 单个文件大小上限(字节) */
|
|
19
|
+
maxSize?: number;
|
|
20
|
+
/** 图片数量上限(含上传中的) */
|
|
21
|
+
maxFiles?: number;
|
|
22
|
+
/** 一次是否允许选择 / 拖入多张 */
|
|
23
|
+
multiple?: boolean;
|
|
24
|
+
/** 上传入口的文字(空态时作为拖放区提示) */
|
|
25
|
+
uploadText?: string;
|
|
26
|
+
/** 没有图片且不能上传时显示的文字 */
|
|
27
|
+
emptyText?: string;
|
|
28
|
+
/** 是否可预览:显示预览按钮,点击打开内置的大图预览 */
|
|
29
|
+
previewable?: boolean;
|
|
30
|
+
/** 自定义预览;传了则不再打开内置预览 */
|
|
31
|
+
onPreview?: (file: ImageFile) => void;
|
|
32
|
+
/** 删除图片前的否决钩子:返回 false 取消删除 */
|
|
33
|
+
beforeRemove?: BeforeRemove<ImageFile>;
|
|
34
|
+
/** 图片被删除后通知 */
|
|
35
|
+
onremove?: (file: ImageFile) => void;
|
|
36
|
+
/** 自定义下载;不传则通过 `file.uri` 直接下载 */
|
|
37
|
+
ondownload?: (file: ImageFile) => void;
|
|
38
|
+
/** 单张图片上传完成并加入 files 后通知 */
|
|
39
|
+
onFileUploaded?: (file: ImageFile, source: File) => void;
|
|
40
|
+
/** 文件因类型 / 大小 / 数量限制被拒绝时通知 */
|
|
41
|
+
onFileRejected?: (file: File, reason: RejectReason) => void;
|
|
42
|
+
/** 上传失败时通知(任务保留在列表中,可重试或移除) */
|
|
43
|
+
onUploadError?: (file: File, error: Error) => void;
|
|
44
|
+
/** files 变化后通知(上传完成或删除) */
|
|
45
|
+
onchange?: (files: ImageFile[]) => void;
|
|
46
|
+
}
|
|
47
|
+
declare const ImageEditor: import("svelte").Component<Props, {
|
|
48
|
+
openFileDialog: () => void;
|
|
49
|
+
focus: () => void;
|
|
50
|
+
}, "files">;
|
|
51
|
+
type ImageEditor = ReturnType<typeof ImageEditor>;
|
|
52
|
+
export default ImageEditor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UploadedFile } from "../attachment_files/AttachmentFile";
|
|
2
|
+
/**
|
|
3
|
+
* ImageEditor 的列表项:name / uri / size? / thumbnail?
|
|
4
|
+
* 缩略图缺省时直接用 uri 显示
|
|
5
|
+
*/
|
|
6
|
+
export default interface ImageFile extends UploadedFile {
|
|
7
|
+
/**
|
|
8
|
+
* 缩略图地址,可选;缺省时直接用 uri 显示
|
|
9
|
+
*/
|
|
10
|
+
thumbnail?: string | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {IconButton} from "../../general/button";
|
|
3
|
+
import {registerEscapeHandler} from "../../overlay/common/escapeClose";
|
|
3
4
|
|
|
4
5
|
let {
|
|
5
6
|
src = "",
|
|
@@ -47,6 +48,13 @@
|
|
|
47
48
|
scale /= 1.2;
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
// Escape 关闭(走共享的 escape 栈,嵌套在 Dialog 里时先关预览)
|
|
52
|
+
$effect(() => {
|
|
53
|
+
if (visible) {
|
|
54
|
+
return registerEscapeHandler(() => { visible = false; });
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
50
58
|
$effect(() => {
|
|
51
59
|
window.addEventListener("resize", updateContainerSize);
|
|
52
60
|
updateContainerSize();
|
|
@@ -91,7 +99,7 @@
|
|
|
91
99
|
|
|
92
100
|
<style>
|
|
93
101
|
.uniface-image-preview-overlay {
|
|
94
|
-
position:
|
|
102
|
+
position: fixed;
|
|
95
103
|
top: 0;
|
|
96
104
|
left: 0;
|
|
97
105
|
bottom: 0;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# ImageEditor
|
|
2
|
+
|
|
3
|
+
An image upload field built on the same implementation as [AttachmentEditor](../attachment_files/README.md): the whole field is a drop zone, the upload entry is a "+" tile (or a dashed row in `list` layout) at the end of the content, tiles show thumbnails, uploads run inline with a progress ring and a cancel button, and a preview button opens the built-in full-size viewer.
|
|
4
|
+
|
|
5
|
+
> Renamed in 5.1.0: `ImageFilesField` → `ImageEditor`, import path `@ticatec/uniface-element/ImageFiles` → `@ticatec/uniface-element/ImageEditor` (no compatibility aliases).
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Thumbnail tiles** (`thumbnail ?? uri`), wrapping automatically; `layout="list"` shows one row per image with a small thumbnail.
|
|
10
|
+
- **Drag & drop** anywhere in the field; `accept` defaults to `image/*`.
|
|
11
|
+
- **Local preview while uploading** (object URL) under the progress ring; cancel / retry / discard.
|
|
12
|
+
- **Built-in preview** — the eye button opens a full-screen viewer with zoom; replace it with `onPreview`, or turn it off with `previewable={false}`.
|
|
13
|
+
- **Limits and notifications** identical to AttachmentEditor: `maxSize`, `maxFiles`, `multiple`, `onFileRejected`, `onUploadError`, `beforeRemove`, `onremove`, `onchange`.
|
|
14
|
+
- **Readonly / disabled** — preview and download stay, delete and the upload entry disappear.
|
|
15
|
+
|
|
16
|
+
## Import
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import ImageEditor from "@ticatec/uniface-element/ImageEditor";
|
|
20
|
+
import type {ImageFile, FileUpload} from "@ticatec/uniface-element/ImageEditor";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Basic usage
|
|
24
|
+
|
|
25
|
+
```svelte
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import ImageEditor from "@ticatec/uniface-element/ImageEditor";
|
|
28
|
+
import type {ImageFile, FileUpload} from "@ticatec/uniface-element/ImageEditor";
|
|
29
|
+
|
|
30
|
+
let files = $state<ImageFile[]>([]);
|
|
31
|
+
|
|
32
|
+
const uploadFile: FileUpload = (file, progressUpdate, onUploaded, onError) => {
|
|
33
|
+
const xhr = new XMLHttpRequest();
|
|
34
|
+
xhr.upload.onprogress = (e) => progressUpdate(e.loaded);
|
|
35
|
+
xhr.onload = () => {
|
|
36
|
+
const res = JSON.parse(xhr.responseText); // {url, thumbnail}
|
|
37
|
+
xhr.status < 300 ? onUploaded(res.url, res.thumbnail) : onError(new Error(xhr.statusText));
|
|
38
|
+
};
|
|
39
|
+
xhr.onerror = () => onError(new Error('Network error'));
|
|
40
|
+
const body = new FormData();
|
|
41
|
+
body.append('file', file);
|
|
42
|
+
xhr.open('POST', '/api/images');
|
|
43
|
+
xhr.send(body);
|
|
44
|
+
return {cancel: async () => { xhr.abort(); return true; }};
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<ImageEditor bind:files {uploadFile} maxFiles={6} height={140}/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Props
|
|
52
|
+
|
|
53
|
+
Props inherited from `CommonFieldProps` (`variant`, `compact`, `disabled`, `readonly`, `theme`, `tooltip`, `error`, `style`, `onfocus`, `onblur`) are not repeated. Everything below except the first three rows behaves exactly as in AttachmentEditor.
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Default | Description |
|
|
56
|
+
|------|------|---------|-------------|
|
|
57
|
+
| `files` | `ImageFile[]` (bindable) | `[]` | Uploaded images: `{name, uri, thumbnail?, size?}`. |
|
|
58
|
+
| `layout` | `'icon' \| 'list'` | `'icon'` | Thumbnail tiles, or one row per image. |
|
|
59
|
+
| `accept` | `string` | `"image/*"` | Allowed types. |
|
|
60
|
+
| `previewable` | `boolean` | `true` | Show the preview button; opens the built-in viewer unless `onPreview` is set. |
|
|
61
|
+
| `onPreview` | `(file: ImageFile) => void` | — | Custom preview handler (replaces the built-in viewer). |
|
|
62
|
+
| `height` | `number \| string` | — | Content height; scrolls inside. |
|
|
63
|
+
| `uploadFile` | `FileUpload` | — | Upload function. `onUploaded(url, thumbnail?)` — pass the thumbnail URL as the second argument when the server generates one. |
|
|
64
|
+
| `maxSize` / `maxFiles` / `multiple` | | `10 MB` / `10` / `true` | Limits. |
|
|
65
|
+
| `uploadText` / `emptyText` | `string` | i18n | Upload entry text / empty text. |
|
|
66
|
+
| `beforeRemove` | `BeforeRemove<ImageFile>` | — | Veto hook; `false` keeps the image. |
|
|
67
|
+
| `onremove` / `ondownload` / `onFileUploaded` / `onFileRejected` / `onUploadError` / `onchange` | | — | Same as AttachmentEditor. |
|
|
68
|
+
|
|
69
|
+
## Methods
|
|
70
|
+
|
|
71
|
+
| Method | Description |
|
|
72
|
+
|--------|-------------|
|
|
73
|
+
| `openFileDialog()` | Opens the system file dialog. |
|
|
74
|
+
| `focus()` | Focuses the first control inside the field. |
|
|
75
|
+
|
|
76
|
+
## `ImageFile`
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
interface ImageFile {
|
|
80
|
+
name: string;
|
|
81
|
+
uri: string; // full-size image URL, also used for preview / download
|
|
82
|
+
thumbnail?: string; // optional; falls back to uri
|
|
83
|
+
size?: number; // bytes, optional
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Related components
|
|
88
|
+
|
|
89
|
+
- [AttachmentEditor](../attachment_files/README.md) — the general file version of this field.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# ImageEditor
|
|
2
|
+
|
|
3
|
+
图片上传字段,与 [AttachmentEditor](../attachment_files/README_CN.md) 是同一套实现:整个字段都是拖放区,上传入口是内容末尾的 "+" 瓦片(`list` 方式是底部虚线行),瓦片显示缩略图,上传进度内联显示(进度环 + 取消),预览按钮打开内置的大图查看器。
|
|
4
|
+
|
|
5
|
+
> 5.1.0 重命名:`ImageFilesField` → `ImageEditor`,引入路径 `@ticatec/uniface-element/ImageFiles` → `@ticatec/uniface-element/ImageEditor`(不保留兼容别名)。
|
|
6
|
+
|
|
7
|
+
## 特性
|
|
8
|
+
|
|
9
|
+
- **缩略图瓦片**(`thumbnail ?? uri`),自动换行;`layout="list"` 每行一张、带小缩略图。
|
|
10
|
+
- **拖放上传**:字段内任意位置;`accept` 默认 `image/*`。
|
|
11
|
+
- **上传中显示本地预览**(object URL)叠加进度环;可取消 / 重试 / 移除。
|
|
12
|
+
- **内置预览**:眼睛按钮打开全屏查看器(可缩放);`onPreview` 可替换为自定义预览,`previewable={false}` 关闭。
|
|
13
|
+
- **限制与通知**与 AttachmentEditor 完全相同:`maxSize`、`maxFiles`、`multiple`、`onFileRejected`、`onUploadError`、`beforeRemove`、`onremove`、`onchange`。
|
|
14
|
+
- **只读 / 禁用**:预览和下载保留,删除和上传入口消失。
|
|
15
|
+
|
|
16
|
+
## 引入
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import ImageEditor from "@ticatec/uniface-element/ImageEditor";
|
|
20
|
+
import type {ImageFile, FileUpload} from "@ticatec/uniface-element/ImageEditor";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 基本用法
|
|
24
|
+
|
|
25
|
+
```svelte
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import ImageEditor from "@ticatec/uniface-element/ImageEditor";
|
|
28
|
+
import type {ImageFile, FileUpload} from "@ticatec/uniface-element/ImageEditor";
|
|
29
|
+
|
|
30
|
+
let files = $state<ImageFile[]>([]);
|
|
31
|
+
|
|
32
|
+
const uploadFile: FileUpload = (file, progressUpdate, onUploaded, onError) => {
|
|
33
|
+
const xhr = new XMLHttpRequest();
|
|
34
|
+
xhr.upload.onprogress = (e) => progressUpdate(e.loaded);
|
|
35
|
+
xhr.onload = () => {
|
|
36
|
+
const res = JSON.parse(xhr.responseText); // {url, thumbnail}
|
|
37
|
+
xhr.status < 300 ? onUploaded(res.url, res.thumbnail) : onError(new Error(xhr.statusText));
|
|
38
|
+
};
|
|
39
|
+
xhr.onerror = () => onError(new Error('网络错误'));
|
|
40
|
+
const body = new FormData();
|
|
41
|
+
body.append('file', file);
|
|
42
|
+
xhr.open('POST', '/api/images');
|
|
43
|
+
xhr.send(body);
|
|
44
|
+
return {cancel: async () => { xhr.abort(); return true; }};
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<ImageEditor bind:files {uploadFile} maxFiles={6} height={140}/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 属性(Props)
|
|
52
|
+
|
|
53
|
+
继承自 `CommonFieldProps` 的属性(`variant`、`compact`、`disabled`、`readonly`、`theme`、`tooltip`、`error`、`style`、`onfocus`、`onblur`)不再重复。除前三行外,其余行为与 AttachmentEditor 完全一致。
|
|
54
|
+
|
|
55
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
56
|
+
|------|------|--------|------|
|
|
57
|
+
| `files` | `ImageFile[]`(可绑定) | `[]` | 已上传的图片:`{name, uri, thumbnail?, size?}`。 |
|
|
58
|
+
| `layout` | `'icon' \| 'list'` | `'icon'` | 缩略图瓦片,或每行一张。 |
|
|
59
|
+
| `accept` | `string` | `"image/*"` | 允许的类型。 |
|
|
60
|
+
| `previewable` | `boolean` | `true` | 显示预览按钮;未设置 `onPreview` 时打开内置查看器。 |
|
|
61
|
+
| `onPreview` | `(file: ImageFile) => void` | — | 自定义预览(替代内置查看器)。 |
|
|
62
|
+
| `height` | `number \| string` | — | 内容区高度,超出内部滚动。 |
|
|
63
|
+
| `uploadFile` | `FileUpload` | — | 上传函数。`onUploaded(url, thumbnail?)`:服务端生成了缩略图时通过第二个参数传回。 |
|
|
64
|
+
| `maxSize` / `maxFiles` / `multiple` | | `10 MB` / `10` / `true` | 限制。 |
|
|
65
|
+
| `uploadText` / `emptyText` | `string` | i18n | 上传入口文字 / 空态文字。 |
|
|
66
|
+
| `beforeRemove` | `BeforeRemove<ImageFile>` | — | 否决钩子:返回 `false` 则不删除。 |
|
|
67
|
+
| `onremove` / `ondownload` / `onFileUploaded` / `onFileRejected` / `onUploadError` / `onchange` | | — | 同 AttachmentEditor。 |
|
|
68
|
+
|
|
69
|
+
## 方法
|
|
70
|
+
|
|
71
|
+
| 方法 | 说明 |
|
|
72
|
+
|------|------|
|
|
73
|
+
| `openFileDialog()` | 打开系统文件框。 |
|
|
74
|
+
| `focus()` | 把焦点移到字段内第一个控件。 |
|
|
75
|
+
|
|
76
|
+
## `ImageFile`
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
interface ImageFile {
|
|
80
|
+
name: string;
|
|
81
|
+
uri: string; // 原图地址,也用于预览 / 下载
|
|
82
|
+
thumbnail?: string; // 可选;缺省用 uri
|
|
83
|
+
size?: number; // 字节,可选
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 相关组件
|
|
88
|
+
|
|
89
|
+
- [AttachmentEditor](../attachment_files/README_CN.md):通用文件版本。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ImageEditor from "./ImageEditor.svelte";
|
|
2
|
+
import ImagePreview from "./ImagePreview.svelte";
|
|
3
|
+
import type ImageFile from "./ImageFile";
|
|
4
|
+
import type { AttachmentLayout, UploadedFile } from "../attachment_files/AttachmentFile";
|
|
5
|
+
import type { RejectReason, UploadStatus, UploadTask } from "../attachment_files/UploadTask";
|
|
6
|
+
import type { OnError, FileUpload, OnUploaded, ProgressUpdate, UploadProgress } from "../attachment_files/FileUpload";
|
|
7
|
+
export default ImageEditor;
|
|
8
|
+
export { ImagePreview };
|
|
9
|
+
export type { ImageFile, UploadedFile, AttachmentLayout, RejectReason, UploadStatus, UploadTask };
|
|
10
|
+
export type { BeforeRemove } from "../types";
|
|
11
|
+
export type { OnError, FileUpload, OnUploaded, ProgressUpdate, UploadProgress };
|