@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
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
visible?: boolean;
|
|
9
|
-
|
|
9
|
+
/** 是否允许点击遮罩/Escape 关闭 */
|
|
10
|
+
closable?: boolean;
|
|
10
11
|
theme?: string;
|
|
11
12
|
children: Snippet;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
let {
|
|
15
16
|
visible = $bindable(false),
|
|
16
|
-
|
|
17
|
+
closable = true,
|
|
17
18
|
theme,
|
|
18
19
|
children
|
|
19
20
|
}: Props = $props();
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
// or closed on Escape.
|
|
27
28
|
const release = acquireScrollLock();
|
|
28
29
|
const unregisterEscape = registerEscapeHandler(() => {
|
|
29
|
-
if (
|
|
30
|
+
if (closable) visible = false;
|
|
30
31
|
});
|
|
31
32
|
return () => {
|
|
32
33
|
release();
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
45
46
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
46
47
|
<div class="uniface-mask-center"
|
|
47
|
-
onclick={() => { if (
|
|
48
|
+
onclick={() => { if (closable) visible = false; }}>
|
|
48
49
|
<div style="flex: 0 0 auto">
|
|
49
50
|
{@render children()}
|
|
50
51
|
</div>
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
margin?: number;
|
|
15
15
|
onclose?: () => void;
|
|
16
16
|
/** 附加到 .contents-inner 上的 class(用于覆盖 overflow 等样式) */
|
|
17
|
-
|
|
17
|
+
/** 内容容器附加 class */
|
|
18
|
+
body$class?: string;
|
|
18
19
|
children?: Snippet;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
align = 'left',
|
|
27
28
|
autoFit = true,
|
|
28
29
|
margin = 0,
|
|
29
|
-
|
|
30
|
+
body$class = '',
|
|
30
31
|
children
|
|
31
32
|
}: Props = $props();
|
|
32
33
|
|
|
@@ -142,7 +143,7 @@
|
|
|
142
143
|
<div class="uniface-popover" use:outsideClick={close}>
|
|
143
144
|
<div bind:this={contentPanel} style="{horzPos}">
|
|
144
145
|
<div class="contents" style="{style}">
|
|
145
|
-
<div class="contents-inner {
|
|
146
|
+
<div class="contents-inner {body$class}">
|
|
146
147
|
{#if children}
|
|
147
148
|
{@render children()}
|
|
148
149
|
{/if}
|
|
@@ -8,7 +8,8 @@ interface Props {
|
|
|
8
8
|
margin?: number;
|
|
9
9
|
onclose?: () => void;
|
|
10
10
|
/** 附加到 .contents-inner 上的 class(用于覆盖 overflow 等样式) */
|
|
11
|
-
|
|
11
|
+
/** 内容容器附加 class */
|
|
12
|
+
body$class?: string;
|
|
12
13
|
children?: Snippet;
|
|
13
14
|
}
|
|
14
15
|
declare const Popover: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type ContextMenuAction = () => void;
|
|
2
2
|
export interface ContextMenuItem {
|
|
3
3
|
/**
|
|
4
4
|
* Display text for the menu item
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
label?: string;
|
|
7
7
|
/**
|
|
8
8
|
* Action to execute when item is clicked
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
handler?: ContextMenuAction;
|
|
11
11
|
/**
|
|
12
12
|
* Whether the item is disabled
|
|
13
13
|
*/
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
event.preventDefault();
|
|
72
72
|
if (focusedIndex >= 0) {
|
|
73
73
|
const item = contextMenuSvelte.items[focusedIndex];
|
|
74
|
-
if (!item.disabled && item.
|
|
75
|
-
item.
|
|
74
|
+
if (!item.disabled && item.handler) {
|
|
75
|
+
item.handler();
|
|
76
76
|
}
|
|
77
77
|
contextMenuSvelte.hide();
|
|
78
78
|
}
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
event.stopPropagation();
|
|
98
98
|
const item = contextMenuSvelte.items[index];
|
|
99
99
|
if (item.disabled) return;
|
|
100
|
-
item.
|
|
100
|
+
item.handler?.();
|
|
101
101
|
contextMenuSvelte.hide();
|
|
102
102
|
}
|
|
103
103
|
</script>
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
{#if item.icon}
|
|
135
135
|
<img class="menu-item-icon" src={item.icon} alt=""/>
|
|
136
136
|
{/if}
|
|
137
|
-
<span class="menu-item-text">{item.
|
|
137
|
+
<span class="menu-item-text">{item.label}</span>
|
|
138
138
|
</div>
|
|
139
139
|
{/if}
|
|
140
140
|
{/each}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import contextMenu from "./ContextMenu.svelte";
|
|
2
2
|
import type { ContextMenuItem } from "./ContextMenuItem.js";
|
|
3
|
-
import type { OnContextMenu,
|
|
3
|
+
import type { OnContextMenu, ContextMenuAction } from "./ContextMenuItem.js";
|
|
4
4
|
export default contextMenu;
|
|
5
5
|
export { contextMenu };
|
|
6
|
-
export type { ContextMenuItem, OnContextMenu,
|
|
6
|
+
export type { ContextMenuItem, OnContextMenu, ContextMenuAction };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type {Snippet} from 'svelte';
|
|
3
3
|
import Dialog from "./Dialog.svelte";
|
|
4
4
|
import type {ButtonAction, ButtonActions} from "../../types";
|
|
5
|
-
import type {
|
|
5
|
+
import type {BeforeClose} from "./DialogCloseConfirm";
|
|
6
6
|
import {ModalResult, type OnClose} from "./IDialog";
|
|
7
7
|
import i18nRes from "../../i18nRes";
|
|
8
8
|
|
|
@@ -10,12 +10,16 @@
|
|
|
10
10
|
title: string;
|
|
11
11
|
width?: string;
|
|
12
12
|
height?: string;
|
|
13
|
-
|
|
13
|
+
/** 关闭前的否决钩子:结果为 MR_CANCEL / MR_CLOSE 时调用,返回 false 阻止关闭 */
|
|
14
|
+
beforeClose?: BeforeClose | null;
|
|
14
15
|
content$style?: string;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
/** 确认按钮是否可用 */
|
|
17
|
+
confirmable?: boolean;
|
|
18
|
+
/** 点击确认时调用;返回 truthy 值则以 MR_OK 关闭 */
|
|
19
|
+
onconfirm?: (() => Promise<any>) | null;
|
|
17
20
|
confirmText?: string | null;
|
|
18
|
-
|
|
21
|
+
/** 关闭后的通知回调,参数为 ModalResult */
|
|
22
|
+
onclose?: OnClose | null;
|
|
19
23
|
children?: Snippet;
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -23,23 +27,23 @@
|
|
|
23
27
|
title,
|
|
24
28
|
width = 'unset',
|
|
25
29
|
height = 'unset',
|
|
26
|
-
|
|
30
|
+
beforeClose = null,
|
|
27
31
|
content$style = '',
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
confirmable = true,
|
|
33
|
+
onconfirm = null,
|
|
30
34
|
confirmText = null,
|
|
31
|
-
|
|
35
|
+
onclose = null,
|
|
32
36
|
children
|
|
33
37
|
}: Props = $props();
|
|
34
38
|
|
|
35
39
|
let dialog: Dialog;
|
|
36
40
|
|
|
37
41
|
const confirmAction = $derived<ButtonAction>({
|
|
38
|
-
label: confirmText ?? i18nRes.common.btnConfirm
|
|
42
|
+
label: confirmText ?? i18nRes.common.btnConfirm(),
|
|
39
43
|
type: "primary",
|
|
40
|
-
disabled:
|
|
44
|
+
disabled: onconfirm == null || !confirmable,
|
|
41
45
|
handler: async () => {
|
|
42
|
-
const result = await
|
|
46
|
+
const result = await onconfirm?.();
|
|
43
47
|
if (result && result == true) { // 返回 true 自动关闭
|
|
44
48
|
await dialog.close(ModalResult.MR_OK);
|
|
45
49
|
}
|
|
@@ -49,6 +53,6 @@
|
|
|
49
53
|
const actions = $derived<ButtonActions>([confirmAction]);
|
|
50
54
|
</script>
|
|
51
55
|
|
|
52
|
-
<Dialog bind:this={dialog} {title} {content$style} {width} {height} {actions} {
|
|
56
|
+
<Dialog bind:this={dialog} {title} {content$style} {width} {height} {actions} {beforeClose} {onclose}>
|
|
53
57
|
{@render children?.()}
|
|
54
58
|
</Dialog>
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BeforeClose } from "./DialogCloseConfirm";
|
|
3
3
|
import { type OnClose } from "./IDialog";
|
|
4
4
|
interface Props {
|
|
5
5
|
title: string;
|
|
6
6
|
width?: string;
|
|
7
7
|
height?: string;
|
|
8
|
-
|
|
8
|
+
/** 关闭前的否决钩子:结果为 MR_CANCEL / MR_CLOSE 时调用,返回 false 阻止关闭 */
|
|
9
|
+
beforeClose?: BeforeClose | null;
|
|
9
10
|
content$style?: string;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
/** 确认按钮是否可用 */
|
|
12
|
+
confirmable?: boolean;
|
|
13
|
+
/** 点击确认时调用;返回 truthy 值则以 MR_OK 关闭 */
|
|
14
|
+
onconfirm?: (() => Promise<any>) | null;
|
|
12
15
|
confirmText?: string | null;
|
|
13
|
-
|
|
16
|
+
/** 关闭后的通知回调,参数为 ModalResult */
|
|
17
|
+
onclose?: OnClose | null;
|
|
14
18
|
children?: Snippet;
|
|
15
19
|
}
|
|
16
20
|
declare const CommonDialog: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {getContext, hasContext, onMount} from "svelte";
|
|
3
|
-
import type {
|
|
3
|
+
import type {BeforeClose} from "./DialogCloseConfirm";
|
|
4
4
|
import ActionBar from "../../layouts/action_bar";
|
|
5
5
|
import type {ButtonAction, ButtonActions} from "../../types";
|
|
6
6
|
import dialogManager from "./DialogManager.svelte";
|
|
@@ -16,12 +16,18 @@
|
|
|
16
16
|
width?: string;
|
|
17
17
|
height?: string;
|
|
18
18
|
actions?: ButtonActions | null;
|
|
19
|
-
|
|
19
|
+
/** 关闭前的否决钩子:结果为 MR_CANCEL / MR_CLOSE 时调用,返回 false 阻止关闭 */
|
|
20
|
+
beforeClose?: BeforeClose | null;
|
|
20
21
|
content$style?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* 是否允许用户不经过显式动作直接关闭:控制标题栏 X、Escape 键和自动追加的"关闭"动作。
|
|
24
|
+
* 为 false 时用户必须点击 actions 中的某个动作。
|
|
25
|
+
*/
|
|
24
26
|
closable?: boolean;
|
|
27
|
+
/** 自动追加的"关闭"动作的文字 */
|
|
28
|
+
closeText?: string;
|
|
29
|
+
/** 关闭后的通知回调,参数为 ModalResult */
|
|
30
|
+
onclose?: OnClose | null;
|
|
25
31
|
dialog$style?: string;
|
|
26
32
|
children?: Snippet;
|
|
27
33
|
}
|
|
@@ -31,32 +37,32 @@
|
|
|
31
37
|
width = 'unset',
|
|
32
38
|
height = 'unset',
|
|
33
39
|
actions = null,
|
|
34
|
-
|
|
40
|
+
beforeClose = null,
|
|
35
41
|
content$style = '',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onClose = null,
|
|
42
|
+
closeText = i18nRes.common.btnClose(),
|
|
43
|
+
onclose = null,
|
|
39
44
|
closable = true,
|
|
40
45
|
dialog$style = "",
|
|
41
46
|
children
|
|
42
47
|
}: Props = $props();
|
|
43
48
|
|
|
49
|
+
|
|
44
50
|
const dialogId = (function() {
|
|
45
51
|
try { return hasContext('dialogId') ? getContext<string | undefined>('dialogId') : undefined; } catch { return undefined; }
|
|
46
52
|
})();
|
|
47
53
|
|
|
48
|
-
export
|
|
54
|
+
export async function close(result: ModalResult) {
|
|
49
55
|
const isCancelLike = result === ModalResult.MR_CANCEL || result === ModalResult.MR_CLOSE;
|
|
50
|
-
const confirm =
|
|
56
|
+
const confirm = beforeClose && isCancelLike ? (await beforeClose()) !== false : true;
|
|
51
57
|
if (!confirm) return;
|
|
52
58
|
if (dialogId) {
|
|
53
|
-
// stack 模式:
|
|
59
|
+
// stack 模式:onclose 由 manager 统一调用
|
|
54
60
|
dialogManager.resolveWith(dialogId, result);
|
|
55
61
|
} else {
|
|
56
|
-
// 直接渲染模式:自己调
|
|
57
|
-
|
|
62
|
+
// 直接渲染模式:自己调 onclose
|
|
63
|
+
onclose?.(result);
|
|
58
64
|
}
|
|
59
|
-
}
|
|
65
|
+
}
|
|
60
66
|
|
|
61
67
|
// Dialog is modal — the page behind it should not scroll (regression fix:
|
|
62
68
|
// this was previously entirely missing, unlike Popover). Escape now goes
|
|
@@ -67,7 +73,7 @@
|
|
|
67
73
|
onMount(() => {
|
|
68
74
|
const releaseScrollLock = acquireScrollLock();
|
|
69
75
|
const unregisterEscape = registerEscapeHandler(() => {
|
|
70
|
-
void close(ModalResult.MR_CANCEL);
|
|
76
|
+
if (closable) void close(ModalResult.MR_CANCEL);
|
|
71
77
|
});
|
|
72
78
|
return () => {
|
|
73
79
|
releaseScrollLock();
|
|
@@ -76,7 +82,7 @@
|
|
|
76
82
|
});
|
|
77
83
|
|
|
78
84
|
const closeAction = $derived<ButtonAction>({
|
|
79
|
-
label:
|
|
85
|
+
label: closeText,
|
|
80
86
|
type: 'secondary',
|
|
81
87
|
handler: () => close(ModalResult.MR_CANCEL)
|
|
82
88
|
});
|
|
@@ -139,7 +145,7 @@
|
|
|
139
145
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
140
146
|
<div class="title-bar" onmousedown={handleMouseDown} onmouseup={handleMouseUp}>
|
|
141
147
|
<div style="flex: 1 1 auto"><span>{title ?? 'New window'}</span></div>
|
|
142
|
-
{#if
|
|
148
|
+
{#if closable}
|
|
143
149
|
<div style="flex: 0 0 auto; padding-left: 12px">
|
|
144
150
|
<button type="button" class="dialog-action-button" aria-label="Close"
|
|
145
151
|
onclick={() => close(ModalResult.MR_CANCEL)}>
|
|
@@ -152,7 +158,7 @@
|
|
|
152
158
|
{@render children?.()}
|
|
153
159
|
</div>
|
|
154
160
|
<div class="control-bar">
|
|
155
|
-
<ActionBar
|
|
161
|
+
<ActionBar actions={dialogActions}/>
|
|
156
162
|
</div>
|
|
157
163
|
</div>
|
|
158
164
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BeforeClose } from "./DialogCloseConfirm";
|
|
2
2
|
import type { ButtonActions } from "../../types";
|
|
3
3
|
import { ModalResult, type OnClose } from "./IDialog";
|
|
4
4
|
import type { Snippet } from "svelte";
|
|
@@ -7,12 +7,18 @@ interface Props {
|
|
|
7
7
|
width?: string;
|
|
8
8
|
height?: string;
|
|
9
9
|
actions?: ButtonActions | null;
|
|
10
|
-
|
|
10
|
+
/** 关闭前的否决钩子:结果为 MR_CANCEL / MR_CLOSE 时调用,返回 false 阻止关闭 */
|
|
11
|
+
beforeClose?: BeforeClose | null;
|
|
11
12
|
content$style?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* 是否允许用户不经过显式动作直接关闭:控制标题栏 X、Escape 键和自动追加的"关闭"动作。
|
|
15
|
+
* 为 false 时用户必须点击 actions 中的某个动作。
|
|
16
|
+
*/
|
|
15
17
|
closable?: boolean;
|
|
18
|
+
/** 自动追加的"关闭"动作的文字 */
|
|
19
|
+
closeText?: string;
|
|
20
|
+
/** 关闭后的通知回调,参数为 ModalResult */
|
|
21
|
+
onclose?: OnClose | null;
|
|
16
22
|
dialog$style?: string;
|
|
17
23
|
children?: Snippet;
|
|
18
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -27,7 +27,8 @@ class DialogManager {
|
|
|
27
27
|
show(component, params = {}) {
|
|
28
28
|
ensureMounted();
|
|
29
29
|
const id = Math.floor((Date.now() + Math.random()) * 100).toString(36);
|
|
30
|
-
|
|
30
|
+
// onclose 为规范名;onClose 为 5.x 兼容别名(NAMING R1)
|
|
31
|
+
const onClose = (params.onclose ?? params.onClose) ?? null;
|
|
31
32
|
return new Promise(resolve => {
|
|
32
33
|
this.stack = [...this.stack, { id, component, params, resolve, onClose }];
|
|
33
34
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Dialog
|
|
2
2
|
|
|
3
|
+
> **Renamed in 5.1.0**: this document uses the names from the [API Naming Guide](../../../docs/NAMING.md); the old names `DialogCloseConfirm`, `closeConfirm`, `confirmHandler`, `enableConfirm`, `onClose` were removed in 5.1.0 (no compatibility aliases are kept).
|
|
4
|
+
|
|
3
5
|
A flexible modal dialog system built with Svelte 5, offering stack-based management, a Promise API, draggable dialogs, configurable action buttons, and close confirmation. Exposes three things: `Dialog` (the base customizable dialog component), `CommonDialog` (simplified confirm/cancel wrapper), and `dialogManager` (a global stack controller that auto-mounts and returns `Promise<ModalResult>`).
|
|
4
6
|
|
|
5
7
|
## Features
|
|
@@ -13,7 +15,7 @@ A flexible modal dialog system built with Svelte 5, offering stack-based managem
|
|
|
13
15
|
- **Action buttons**: configurable button actions; returning `true` auto-closes
|
|
14
16
|
- **Close confirmation**: optional confirmation before closing (useful for unsaved changes)
|
|
15
17
|
- **ESC to close**: ESC closes the dialog (picker ESC handling takes precedence automatically)
|
|
16
|
-
- **Lifecycle hooks**: `
|
|
18
|
+
- **Lifecycle hooks**: `onclose` callback + Promise resolve, both carrying a `ModalResult`
|
|
17
19
|
- **Customizable styling**: flexible theming and sizing via inline styles
|
|
18
20
|
|
|
19
21
|
## Installation
|
|
@@ -182,7 +184,7 @@ If you don't want the stack / Promise and just want to conditionally render a di
|
|
|
182
184
|
{#if showDialog}
|
|
183
185
|
<Dialog
|
|
184
186
|
title="My Dialog"
|
|
185
|
-
|
|
187
|
+
onclose={handleClose}
|
|
186
188
|
width="500px"
|
|
187
189
|
height="300px"
|
|
188
190
|
>
|
|
@@ -191,7 +193,7 @@ If you don't want the stack / Promise and just want to conditionally render a di
|
|
|
191
193
|
{/if}
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
In direct-render mode there is no `dialogId` context, so `close()` invokes `
|
|
196
|
+
In direct-render mode there is no `dialogId` context, so `close()` invokes `onclose` itself.
|
|
195
197
|
|
|
196
198
|
## Components Overview
|
|
197
199
|
|
|
@@ -217,11 +219,11 @@ The global stack controller. Maintains the dialog stack and exposes `show` / `re
|
|
|
217
219
|
| `width` | `string` | `'unset'` | Dialog width (CSS value) |
|
|
218
220
|
| `height` | `string` | `'unset'` | Dialog height (CSS value) |
|
|
219
221
|
| `actions` | `ButtonActions \| null` | `null` | Action button array. Use `null` entries as separators |
|
|
220
|
-
| `
|
|
222
|
+
| `beforeClose` | `BeforeClose \| null` | `null` | Confirmation function called before closing (when result is `MR_CANCEL` or `MR_CLOSE`). Should return `Promise<boolean>` |
|
|
221
223
|
| `content$style` | `string` | `''` | Custom inline styles for the content area |
|
|
222
224
|
| `hideClose` | `boolean` | `false` | When `true`, hides the close (X) icon in the title bar |
|
|
223
225
|
| `closeAction` | `ButtonAction \| null` | `null` | Override the default close button (label, type, etc.). The handler is always wired to internal close |
|
|
224
|
-
| `
|
|
226
|
+
| `onclose` | `OnClose \| null` | `null` | Callback when dialog closes. Receives a `ModalResult` (see [Modal Results](#modal-results)) |
|
|
225
227
|
| `dialog$style` | `string` | `''` | Custom inline styles for the dialog container |
|
|
226
228
|
|
|
227
229
|
### Methods
|
|
@@ -234,7 +236,7 @@ The global stack controller. Maintains the dialog stack and exposes `show` / `re
|
|
|
234
236
|
|
|
235
237
|
| Event | Description |
|
|
236
238
|
|-------|-------------|
|
|
237
|
-
| `
|
|
239
|
+
| `onclose` | Fires when the dialog closes. Receives `ModalResult.MR_OK` / `MR_CANCEL` / `MR_CLOSE` |
|
|
238
240
|
|
|
239
241
|
## CommonDialog Component
|
|
240
242
|
|
|
@@ -262,8 +264,8 @@ Simplified wrapper that automatically provides a "Confirm" button. Works in both
|
|
|
262
264
|
{#if showDialog}
|
|
263
265
|
<CommonDialog
|
|
264
266
|
title="Confirm Action"
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
onconfirm={handleConfirm}
|
|
268
|
+
onclose={handleClose}
|
|
267
269
|
width="400px"
|
|
268
270
|
>
|
|
269
271
|
<p>Are you sure you want to proceed?</p>
|
|
@@ -278,12 +280,12 @@ Simplified wrapper that automatically provides a "Confirm" button. Works in both
|
|
|
278
280
|
| `title` | `string` | `''` | Dialog title |
|
|
279
281
|
| `width` | `string` | `'unset'` | Dialog width |
|
|
280
282
|
| `height` | `string` | `'unset'` | Dialog height |
|
|
281
|
-
| `
|
|
283
|
+
| `beforeClose` | `BeforeClose \| null` | `null` | Close confirmation function |
|
|
282
284
|
| `content$style` | `string` | `''` | Content area styles |
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
+
| `confirmable` | `boolean` | `true` | Enable/disable the confirm button |
|
|
286
|
+
| `onconfirm` | `(() => Promise<any>) \| null` | `null` | Confirm button handler |
|
|
285
287
|
| `confirmText` | `string \| null` | `null` | Custom confirm button text (defaults to i18n "Confirm") |
|
|
286
|
-
| `
|
|
288
|
+
| `onclose` | `OnClose \| null` | `null` | Close callback receiving `ModalResult` |
|
|
287
289
|
|
|
288
290
|
## Global API
|
|
289
291
|
|
|
@@ -296,7 +298,7 @@ import { dialogManager, ModalResult } from "@ticatec/uniface-element/Dialog";
|
|
|
296
298
|
|
|
297
299
|
const result = await dialogManager.show(MyDialog, {
|
|
298
300
|
title: "Example",
|
|
299
|
-
|
|
301
|
+
onclose: (r) => console.log("closed:", r) // you can also get the result here
|
|
300
302
|
});
|
|
301
303
|
```
|
|
302
304
|
|
|
@@ -367,7 +369,7 @@ Add confirmation before closing with unsaved changes (triggered on X click / ESC
|
|
|
367
369
|
|
|
368
370
|
let originalData = JSON.stringify(data);
|
|
369
371
|
|
|
370
|
-
const
|
|
372
|
+
const beforeClose = async () => {
|
|
371
373
|
const hasChanges = JSON.stringify(data) !== originalData;
|
|
372
374
|
if (hasChanges) {
|
|
373
375
|
return await messageBox.showConfirm("You have unsaved changes. Close anyway?", { title: "Confirm Close" })
|
|
@@ -377,7 +379,7 @@ Add confirmation before closing with unsaved changes (triggered on X click / ESC
|
|
|
377
379
|
};
|
|
378
380
|
</script>
|
|
379
381
|
|
|
380
|
-
<Dialog {
|
|
382
|
+
<Dialog {beforeClose}>
|
|
381
383
|
<!-- content -->
|
|
382
384
|
</Dialog>
|
|
383
385
|
```
|
|
@@ -501,7 +503,7 @@ Key points:
|
|
|
501
503
|
1. **Prefer the imperative API (`dialogManager.show`)**: it returns a Promise, makes result handling ergonomic, and works from services / stores.
|
|
502
504
|
2. **No need to manually mount `DialogBoard`**: the controller auto-mounts. Existing `<DialogBoard/>` placements in legacy code can stay or be removed.
|
|
503
505
|
3. **Return `false` from action handlers** to keep the dialog open (e.g., when validation fails).
|
|
504
|
-
4. **Use `
|
|
506
|
+
4. **Use `beforeClose` for dirty forms** — show a MessageBox asking if the user really wants to leave unsaved changes.
|
|
505
507
|
5. **Pick appropriate sizes** — 400–600px for simple dialogs, 700–900px for form dialogs, responsive sizing for mobile.
|
|
506
508
|
6. **Stacking is supported, but don't overuse it**: multiple simultaneous dialogs can confuse users. Reach for it when genuinely needed.
|
|
507
509
|
|
|
@@ -526,7 +528,7 @@ declare global {
|
|
|
526
528
|
| `<DialogBoard/>` in app root | nothing | Controller auto-mounts; legacy placement can stay |
|
|
527
529
|
| `window.Dialog.showModal(Component, params)` | `window.Dialog.show(Component, params)` or `dialogManager.show(...)` | `showModal` still works (compat alias) but discards the Promise |
|
|
528
530
|
| `ModalResult.Ok` / `ModalResult.Cancel` | `ModalResult.MR_OK` / `ModalResult.MR_CANCEL` | Enum unified with MessageBox |
|
|
529
|
-
| `
|
|
531
|
+
| `onclose(result)` callback | `onclose(result)` + `await dialogManager.show(...)` | Both supported; Promise is the new way |
|
|
530
532
|
|
|
531
533
|
## Related Components
|
|
532
534
|
|