@ticatec/uniface-element 5.0.0 → 5.0.2
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 +29 -54
- package/README_CN.md +37 -57
- package/dist/app_layout/ClassicLayout.svelte +8 -40
- package/dist/app_layout/ColumnsLayout.svelte +3 -3
- package/dist/app_layout/HeaderLayout.svelte +4 -20
- package/dist/app_layout/RowsLayout.svelte +3 -3
- package/dist/app_layout/SidebarLayout.svelte +4 -20
- package/dist/base-calendar/CalendarBase.svelte +29 -6
- package/dist/base-calendar/CalendarBase.svelte.d.ts +4 -0
- package/dist/base-calendar/MonthPickupPanel.svelte +19 -6
- package/dist/base-calendar/MonthPickupPanel.svelte.d.ts +1 -1
- package/dist/base-calendar/MonthlyCalendar.svelte +18 -2
- package/dist/base-calendar/YearPickupPanel.svelte +24 -6
- package/dist/base-calendar/YearPickupPanel.svelte.d.ts +1 -1
- package/dist/composite/pagination_panel/PaginationPanel.svelte +2 -0
- package/dist/composite/transfer/Transfer.svelte +12 -6
- package/dist/data_display/accordion/Accordion.svelte +1 -4
- package/dist/data_display/card/CommonCardActionBar.svelte +31 -37
- package/dist/data_display/concise_data_table/Column.d.ts +6 -0
- package/dist/data_display/concise_data_table/ConciseListTable.svelte +4 -3
- package/dist/data_display/concise_data_table/DataCell.svelte +3 -3
- package/dist/data_display/list_box/ListBox.svelte +96 -23
- package/dist/data_display/list_box/ListBox.svelte.d.ts +4 -0
- package/dist/data_display/tree_view/TreeNodeView.svelte +25 -4
- package/dist/data_table/DataTable.svelte +5 -5
- package/dist/data_table/DataTable.svelte.d.ts +36 -16
- package/dist/data_table/lib/ActionsColumn.d.ts +2 -2
- package/dist/data_table/lib/DataColumn.d.ts +7 -1
- package/dist/data_table/lib/RowAction.d.ts +5 -5
- package/dist/data_table/lib/clickOutSide.js +6 -5
- package/dist/data_table/parts/FixedHeaderPanel.svelte +18 -3
- package/dist/data_table/parts/FixedRow.svelte +10 -1
- package/dist/data_table/parts/HrefCell.svelte +1 -1
- package/dist/data_table/parts/TableHeaderPanel.svelte +18 -2
- package/dist/data_table/parts/TextCell.svelte +2 -2
- package/dist/form/attachment_files/AttachmentEditor.svelte +20 -15
- package/dist/form/attachment_files/FileRender.svelte +1 -1
- package/dist/form/attachment_files/FileUploadBar.svelte +5 -2
- package/dist/form/attachment_files/FileUploadPanel.svelte +11 -73
- package/dist/form/cascade_options_select/CascadeOptionSelect.svelte +10 -2
- package/dist/form/cascade_options_select/OptionsBox.svelte +48 -2
- package/dist/form/checkbox/CheckBox.svelte +2 -7
- package/dist/form/color_picker/ColorPicker.svelte +150 -35
- package/dist/form/color_picker/ColorPicker.svelte.d.ts +7 -25
- package/dist/form/color_picker/ColorPickerPanel.svelte +23 -20
- package/dist/form/color_picker/ColorPickerPanel.svelte.d.ts +5 -18
- package/dist/form/color_picker/README.md +14 -7
- package/dist/form/color_picker/README_CN.md +14 -7
- package/dist/form/common_editor/CommonEditor.svelte +18 -4
- package/dist/form/common_editor/CommonPicker.svelte +14 -10
- package/dist/form/common_editor/CommonPopupEditor.svelte +8 -1
- package/dist/form/common_range_editor/CommonRangeEditor.svelte +11 -2
- package/dist/form/date_picker/DatePicker.svelte +1 -1
- package/dist/form/date_picker/DateTimePicker.svelte +1 -1
- package/dist/form/date_picker/ScrollBar.svelte +20 -12
- package/dist/form/date_picker/ScrollBar.svelte.d.ts +4 -18
- package/dist/form/date_range/DateRangeEditor.svelte +11 -3
- package/dist/form/group_box/group-check-box/GroupCheckBox.svelte +6 -1
- package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte +6 -1
- package/dist/form/image-files/ImageFilesField.svelte +51 -7
- package/dist/form/image-files/ImagePreview.svelte +23 -9
- package/dist/form/image-files/ImageRender.svelte +69 -11
- package/dist/form/input_options_select/InputOptionsSelect.svelte +10 -2
- package/dist/form/lookup_editor/LookupEditor.svelte +9 -2
- package/dist/form/memo_editor/MemoEditor.svelte +2 -2
- package/dist/form/number_editor/NumberEditor.svelte +2 -2
- package/dist/form/options_multi_select/OptionsMultiSelect.svelte +20 -12
- package/dist/form/options_select/OptionsSelect.svelte +15 -6
- package/dist/form/options_select/OptionsSelect.svelte.d.ts +39 -17
- package/dist/form/prompts_text_editor/PromptsTextEditor.svelte +10 -2
- package/dist/form/radio_button/RadioButton.svelte +2 -8
- package/dist/form/switch/Switch.svelte +4 -4
- package/dist/form/text_editor/TextEditor.svelte +2 -2
- package/dist/form/unit-number-editor/UnitNumberEditor.svelte +10 -2
- package/dist/general/button/Button.svelte +5 -0
- package/dist/general/button/Button.svelte.d.ts +1 -0
- package/dist/general/button/IconButton.svelte +3 -1
- package/dist/general/button/IconButton.svelte.d.ts +1 -0
- package/dist/general/button/TextButton.svelte +3 -0
- package/dist/general/button/TextButton.svelte.d.ts +1 -0
- package/dist/general/icon/Icon.svelte +18 -1
- package/dist/general/split/Split.svelte +24 -4
- package/dist/general/tag/Tag.svelte +9 -1
- package/dist/navigation/nav_menu/MenuItem.d.ts +4 -2
- package/dist/navigation/nav_menu/NavigatorMenu.svelte +157 -34
- package/dist/navigation/nav_menu/NavigatorMenu.svelte.d.ts +2 -3
- package/dist/navigation/nav_menu/NavigatorMenuItem.svelte +25 -13
- package/dist/navigation/nav_menu/NavigatorMenuItem.svelte.d.ts +3 -3
- package/dist/navigation/navigator/Navigator.svelte +17 -17
- package/dist/navigation/page-stack/PageStack.svelte +160 -0
- package/dist/navigation/page-stack/PageStack.svelte.d.ts +24 -0
- package/dist/navigation/page-stack/PageStackContext.d.ts +25 -0
- package/dist/navigation/page-stack/PageStackContext.js +12 -0
- package/dist/navigation/page-stack/PageStackFrame.svelte +24 -0
- package/dist/navigation/page-stack/PageStackFrame.svelte.d.ts +11 -0
- package/dist/navigation/page-stack/README.md +154 -0
- package/dist/navigation/page-stack/README_CN.md +154 -0
- package/dist/navigation/page-stack/index.d.ts +6 -0
- package/dist/navigation/page-stack/index.js +4 -0
- package/dist/navigation/pagination/Pagination.svelte +114 -14
- package/dist/navigation/progress_step_bar/ProgressStepBlock.svelte +1 -5
- package/dist/navigation/tabs/Tabs.svelte +42 -10
- package/dist/navigation/tabs/Tabs.svelte.d.ts +2 -2
- package/dist/overlay/common/FloatingPanel.svelte +3 -17
- package/dist/overlay/common/FullscreenOverlay.svelte +27 -3
- package/dist/overlay/common/FullscreenOverlay.svelte.d.ts +6 -27
- package/dist/overlay/common/ModalPopover.svelte +18 -2
- package/dist/overlay/common/Popover.svelte +61 -57
- package/dist/overlay/common/Popover.svelte.d.ts +1 -5
- package/dist/overlay/common/escapeClose.d.ts +28 -0
- package/dist/overlay/common/escapeClose.js +47 -0
- package/dist/overlay/common/focusTrap.d.ts +8 -0
- package/dist/overlay/common/focusTrap.js +83 -0
- package/dist/overlay/common/mountSingleton.d.ts +27 -0
- package/dist/overlay/common/mountSingleton.js +45 -0
- package/dist/overlay/common/outsideClick.d.ts +28 -0
- package/dist/overlay/common/outsideClick.js +20 -0
- package/dist/overlay/common/scrollLock.d.ts +8 -0
- package/dist/overlay/common/scrollLock.js +49 -0
- package/dist/overlay/common/uniface-utils.js +0 -1
- package/dist/overlay/context-menu/ContextMenu.svelte.js +2 -15
- package/dist/overlay/context-menu/ContextMenuPanel.svelte +27 -3
- package/dist/overlay/dialog/Dialog.svelte +48 -32
- package/dist/overlay/dialog/DialogManager.svelte.js +7 -9
- package/dist/overlay/dialog/DialogWrapper.svelte +5 -2
- package/dist/overlay/drawer/Drawer.svelte +30 -3
- package/dist/overlay/indicator/Indicator.svelte.js +2 -15
- package/dist/overlay/indicator/IndicatorPanel.svelte +4 -1
- package/dist/overlay/message-box/MessageBox.svelte.js +2 -15
- package/dist/overlay/message-box/MessageBoxPanel.svelte +19 -3
- package/dist/overlay/toast/Toast.svelte.js +2 -15
- package/dist/overlay/toast/ToastPanel.svelte +1 -1
- package/dist/overlay/tooltip/Tooltip.svelte +1 -1
- package/dist/ticatec-uniface-web.css +128 -13
- package/dist/types.d.ts +4 -3
- package/dist/utils/prefixFilter.d.ts +3 -3
- package/dist/utils/prefixFilter.js +3 -5
- package/docs/components/README.md +133 -0
- package/docs/components/accordion/README.md +60 -0
- package/docs/components/accordion/example.svelte +7 -0
- package/docs/components/action-bar/README.md +114 -0
- package/docs/components/action-bar/example.svelte +7 -0
- package/docs/components/app-top-bar/README.md +60 -0
- package/docs/components/app-top-bar/example.svelte +9 -0
- package/docs/components/attachment-files/README.md +332 -0
- package/docs/components/attachment-files/example.svelte +16 -0
- package/docs/components/box/README.md +63 -0
- package/docs/components/box/example.svelte +10 -0
- package/docs/components/breadcrumbs/README.md +86 -0
- package/docs/components/breadcrumbs/example.svelte +11 -0
- package/docs/components/button/README.md +103 -0
- package/docs/components/button/example.svelte +10 -0
- package/docs/components/card/README.md +113 -0
- package/docs/components/card/example.svelte +10 -0
- package/docs/components/cascade-options-select/README.md +162 -0
- package/docs/components/cascade-options-select/example.svelte +18 -0
- package/docs/components/checkbox/README.md +103 -0
- package/docs/components/checkbox/example.svelte +15 -0
- package/docs/components/classic-layout/README.md +76 -0
- package/docs/components/classic-layout/example.svelte +16 -0
- package/docs/components/color-picker/README.md +132 -0
- package/docs/components/color-picker/example.svelte +16 -0
- package/docs/components/columns-layout/README.md +70 -0
- package/docs/components/columns-layout/example.svelte +12 -0
- package/docs/components/common-dialog/README.md +109 -0
- package/docs/components/common-dialog/example.svelte +12 -0
- package/docs/components/concise-data-table/README.md +307 -0
- package/docs/components/concise-data-table/example.svelte +16 -0
- package/docs/components/context-menu/README.md +99 -0
- package/docs/components/context-menu/example.svelte +10 -0
- package/docs/components/criteria-field/README.md +69 -0
- package/docs/components/criteria-field/example.svelte +9 -0
- package/docs/components/data-table/README.md +365 -0
- package/docs/components/data-table/example.svelte +23 -0
- package/docs/components/date-picker/README.md +136 -0
- package/docs/components/date-picker/example.svelte +16 -0
- package/docs/components/date-range/README.md +122 -0
- package/docs/components/date-range/example.svelte +15 -0
- package/docs/components/date-time-picker/README.md +142 -0
- package/docs/components/date-time-picker/example.svelte +16 -0
- package/docs/components/dialog/README.md +174 -0
- package/docs/components/dialog/example.svelte +13 -0
- package/docs/components/dialog-board/README.md +41 -0
- package/docs/components/dialog-board/example.svelte +5 -0
- package/docs/components/drawer/README.md +70 -0
- package/docs/components/drawer/example.svelte +12 -0
- package/docs/components/flex-form/README.md +55 -0
- package/docs/components/flex-form/example.svelte +7 -0
- package/docs/components/flex-row-form/README.md +56 -0
- package/docs/components/flex-row-form/example.svelte +7 -0
- package/docs/components/form-field/README.md +84 -0
- package/docs/components/form-field/example.svelte +10 -0
- package/docs/components/full-screen-overlay/README.md +66 -0
- package/docs/components/full-screen-overlay/example.svelte +11 -0
- package/docs/components/grid-form/README.md +75 -0
- package/docs/components/grid-form/example.svelte +9 -0
- package/docs/components/group-check-box/README.md +147 -0
- package/docs/components/group-check-box/example.svelte +21 -0
- package/docs/components/group-radio-box/README.md +144 -0
- package/docs/components/group-radio-box/example.svelte +21 -0
- package/docs/components/header-layout/README.md +65 -0
- package/docs/components/header-layout/example.svelte +12 -0
- package/docs/components/icon/README.md +87 -0
- package/docs/components/icon/example.svelte +9 -0
- package/docs/components/icon-button/README.md +91 -0
- package/docs/components/icon-button/example.svelte +10 -0
- package/docs/components/image-files/README.md +174 -0
- package/docs/components/image-files/example.svelte +19 -0
- package/docs/components/indicator/README.md +53 -0
- package/docs/components/indicator/example.svelte +14 -0
- package/docs/components/input-options-select/README.md +163 -0
- package/docs/components/input-options-select/example.svelte +16 -0
- package/docs/components/list-box/ListItem.svelte +14 -0
- package/docs/components/list-box/README.md +221 -0
- package/docs/components/list-box/example.svelte +61 -0
- package/docs/components/lookup-editor/README.md +137 -0
- package/docs/components/lookup-editor/example.svelte +16 -0
- package/docs/components/memo-editor/README.md +143 -0
- package/docs/components/memo-editor/example.svelte +16 -0
- package/docs/components/message-box/README.md +68 -0
- package/docs/components/message-box/example.svelte +10 -0
- package/docs/components/navigator/README.md +75 -0
- package/docs/components/navigator/example.svelte +13 -0
- package/docs/components/navigator-menu/README.md +113 -0
- package/docs/components/navigator-menu/example.svelte +10 -0
- package/docs/components/number-editor/README.md +144 -0
- package/docs/components/number-editor/example.svelte +16 -0
- package/docs/components/number-range/README.md +116 -0
- package/docs/components/number-range/example.svelte +15 -0
- package/docs/components/options-multi-select/README.md +161 -0
- package/docs/components/options-multi-select/example.svelte +20 -0
- package/docs/components/options-select/README.md +160 -0
- package/docs/components/options-select/example.svelte +21 -0
- package/docs/components/page/README.md +77 -0
- package/docs/components/page/example.svelte +10 -0
- package/docs/components/pagination/README.md +88 -0
- package/docs/components/pagination/example.svelte +10 -0
- package/docs/components/pagination-panel/README.md +120 -0
- package/docs/components/pagination-panel/example.svelte +16 -0
- package/docs/components/popup-hint/README.md +44 -0
- package/docs/components/popup-hint/example.svelte +5 -0
- package/docs/components/progress-bar/README.md +64 -0
- package/docs/components/progress-bar/example.svelte +8 -0
- package/docs/components/progress-step-bar/README.md +93 -0
- package/docs/components/progress-step-bar/example.svelte +7 -0
- package/docs/components/prompts-text-editor/README.md +146 -0
- package/docs/components/prompts-text-editor/example.svelte +17 -0
- package/docs/components/radio-button/README.md +121 -0
- package/docs/components/radio-button/example.svelte +18 -0
- package/docs/components/rows-layout/README.md +70 -0
- package/docs/components/rows-layout/example.svelte +12 -0
- package/docs/components/search-box/README.md +136 -0
- package/docs/components/search-box/example.svelte +16 -0
- package/docs/components/separator/README.md +44 -0
- package/docs/components/separator/example.svelte +7 -0
- package/docs/components/sidebar-layout/README.md +65 -0
- package/docs/components/sidebar-layout/example.svelte +12 -0
- package/docs/components/split/README.md +48 -0
- package/docs/components/split/example.svelte +8 -0
- package/docs/components/switch/README.md +77 -0
- package/docs/components/switch/example.svelte +11 -0
- package/docs/components/tabs/README.md +127 -0
- package/docs/components/tabs/example.svelte +22 -0
- package/docs/components/tag/README.md +63 -0
- package/docs/components/tag/example.svelte +8 -0
- package/docs/components/text-button/README.md +90 -0
- package/docs/components/text-button/example.svelte +9 -0
- package/docs/components/text-editor/README.md +147 -0
- package/docs/components/text-editor/example.svelte +16 -0
- package/docs/components/time-editor/README.md +130 -0
- package/docs/components/time-editor/example.svelte +16 -0
- package/docs/components/toast/README.md +52 -0
- package/docs/components/toast/example.svelte +9 -0
- package/docs/components/tooltip/README.md +44 -0
- package/docs/components/tooltip/example.svelte +5 -0
- package/docs/components/transfer/README.md +109 -0
- package/docs/components/transfer/example.svelte +13 -0
- package/docs/components/tree-view/README.md +163 -0
- package/docs/components/tree-view/example.svelte +26 -0
- package/docs/components/unit-number-editor/README.md +192 -0
- package/docs/components/unit-number-editor/example.svelte +18 -0
- package/package.json +15 -7
|
@@ -15,6 +15,10 @@ interface Props {
|
|
|
15
15
|
selectedList?: Array<any>;
|
|
16
16
|
class?: string;
|
|
17
17
|
item$props?: any;
|
|
18
|
+
onchange?: OnSelectChange;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated 请使用 onchange;仍受支持以兼容旧调用。
|
|
21
|
+
*/
|
|
18
22
|
onSelectChange?: OnSelectChange;
|
|
19
23
|
onItemDblClick?: OnItemDblClick;
|
|
20
24
|
onItemClick?: OnItemClick;
|
|
@@ -68,25 +68,41 @@
|
|
|
68
68
|
await onNodeSelectionChange(node);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
const handleRowKeyDown = async (e: KeyboardEvent) => {
|
|
72
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
await handleRowClick();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const handleIconKeyDown = async (e: KeyboardEvent) => {
|
|
79
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
await onToggle();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
71
86
|
const handleContextMenu = (event: MouseEvent) => {
|
|
72
87
|
onContextMenu?.(event, node);
|
|
73
88
|
}
|
|
74
89
|
</script>
|
|
75
90
|
|
|
76
91
|
<div class="tree-node" class:expanded style="padding-left: {node.level * 16}px">
|
|
77
|
-
<div class="node-item" class:selected={isSelected} onclick={handleRowClick}
|
|
78
|
-
oncontextmenu={handleContextMenu}
|
|
92
|
+
<div class="node-item" class:selected={isSelected} onclick={handleRowClick} onkeydown={handleRowKeyDown}
|
|
93
|
+
oncontextmenu={handleContextMenu} role="treeitem" tabindex="0" aria-selected={isSelected}
|
|
94
|
+
aria-expanded={isBranch ? expanded : undefined}>
|
|
79
95
|
|
|
80
96
|
<div class="item-chevron">
|
|
81
97
|
{#if isBranch}
|
|
82
98
|
{#if loading}
|
|
83
99
|
<img alt="loading" class="chevron-img" src={iconLoading}/>
|
|
84
100
|
{:else if chevronIcon}
|
|
85
|
-
<span
|
|
101
|
+
<span role="button" tabindex="0" aria-label={expanded ? 'Collapse' : 'Expand'} onclick={handleIconClick} onkeydown={handleIconKeyDown} class="chevron-btn">
|
|
86
102
|
{@render chevronIcon({ expanded, loading })}
|
|
87
103
|
</span>
|
|
88
104
|
{:else}
|
|
89
|
-
<span
|
|
105
|
+
<span role="button" tabindex="0" aria-label={expanded ? 'Collapse' : 'Expand'} onclick={handleIconClick} onkeydown={handleIconKeyDown} class="chevron-btn default-arrow">
|
|
90
106
|
{expanded ? '▾' : '▸'}
|
|
91
107
|
</span>
|
|
92
108
|
{/if}
|
|
@@ -202,6 +218,11 @@
|
|
|
202
218
|
color: var(--uniface-treeview-item-selected-color, #0061FF);
|
|
203
219
|
font-weight: 600;
|
|
204
220
|
}
|
|
221
|
+
|
|
222
|
+
&:focus-visible {
|
|
223
|
+
outline: 2px solid var(--uniface-primary-border-color, #298DFF);
|
|
224
|
+
outline-offset: -2px;
|
|
225
|
+
}
|
|
205
226
|
}
|
|
206
227
|
}
|
|
207
228
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts" generics="T = any">
|
|
2
2
|
import ContentPanel from "./parts/ContentPanel.svelte";
|
|
3
3
|
import type DataColumn from "./lib/DataColumn";
|
|
4
4
|
import type ActionsColumn from "./lib/ActionsColumn";
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
columns: Array<DataColumn>;
|
|
17
|
-
actionsColumn?: ActionsColumn | null;
|
|
17
|
+
actionsColumn?: ActionsColumn<T> | null;
|
|
18
18
|
indicatorColumn?: IndicatorColumn | null;
|
|
19
19
|
rowHeight?: number;
|
|
20
20
|
headerHeight?: number;
|
|
21
|
-
list: Array<
|
|
22
|
-
selectedRows?: Array<
|
|
21
|
+
list: Array<T>;
|
|
22
|
+
selectedRows?: Array<T>;
|
|
23
23
|
inlineRowHeight?: number;
|
|
24
24
|
rowBorder?: boolean;
|
|
25
25
|
colBorder?: boolean;
|
|
26
26
|
emptyIndicator?: string;
|
|
27
|
-
getRowFontStyle?: GetRowFontStyle
|
|
27
|
+
getRowFontStyle?: GetRowFontStyle<T>;
|
|
28
28
|
style?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -2,21 +2,41 @@ import type DataColumn from "./lib/DataColumn";
|
|
|
2
2
|
import type ActionsColumn from "./lib/ActionsColumn";
|
|
3
3
|
import type IndicatorColumn from "./lib/IndicatorColumn";
|
|
4
4
|
import type { GetRowFontStyle } from "../types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
declare function $$render<T = any>(): {
|
|
6
|
+
props: {
|
|
7
|
+
columns: Array<DataColumn>;
|
|
8
|
+
actionsColumn?: ActionsColumn<T> | null;
|
|
9
|
+
indicatorColumn?: IndicatorColumn | null;
|
|
10
|
+
rowHeight?: number;
|
|
11
|
+
headerHeight?: number;
|
|
12
|
+
list: Array<T>;
|
|
13
|
+
selectedRows?: Array<T>;
|
|
14
|
+
inlineRowHeight?: number;
|
|
15
|
+
rowBorder?: boolean;
|
|
16
|
+
colBorder?: boolean;
|
|
17
|
+
emptyIndicator?: string;
|
|
18
|
+
getRowFontStyle?: GetRowFontStyle<T>;
|
|
19
|
+
style?: string;
|
|
20
|
+
};
|
|
21
|
+
exports: {};
|
|
22
|
+
bindings: "inlineRowHeight" | "selectedRows";
|
|
23
|
+
slots: {};
|
|
24
|
+
events: {};
|
|
25
|
+
};
|
|
26
|
+
declare class __sveltets_Render<T = any> {
|
|
27
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
28
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
29
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
30
|
+
bindings(): "inlineRowHeight" | "selectedRows";
|
|
31
|
+
exports(): {};
|
|
19
32
|
}
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
interface $$IsomorphicComponent {
|
|
34
|
+
new <T = any>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
35
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
36
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
37
|
+
<T = any>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
38
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
39
|
+
}
|
|
40
|
+
declare const DataTable: $$IsomorphicComponent;
|
|
41
|
+
type DataTable<T = any> = InstanceType<typeof DataTable<T>>;
|
|
22
42
|
export default DataTable;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GetRowActions } from "./RowAction";
|
|
2
|
-
export default interface ActionsColumn {
|
|
2
|
+
export default interface ActionsColumn<T = any> {
|
|
3
3
|
/**
|
|
4
4
|
* 宽度
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ export default interface ActionsColumn {
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
getActions: GetRowActions
|
|
10
|
+
getActions: GetRowActions<T>;
|
|
11
11
|
/**
|
|
12
12
|
* 对齐方式,默认靠左对齐
|
|
13
13
|
*/
|
|
@@ -33,7 +33,13 @@ export default interface DataColumn {
|
|
|
33
33
|
*/
|
|
34
34
|
formatter?: FormatCell;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* 是否将单元格内容作为可信 HTML 渲染({@html}),而非纯文本转义。
|
|
37
|
+
* 仅当 field/formatter 输出为可信标记时才应设为 true。
|
|
38
|
+
*/
|
|
39
|
+
renderHTML?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated 请使用 renderHTML;名称容易被误读为"转义 HTML",
|
|
42
|
+
* 实际含义相反——设为 true 会把内容作为可信 HTML 渲染。仍受支持以兼容旧调用。
|
|
37
43
|
*/
|
|
38
44
|
escapeHTML?: boolean;
|
|
39
45
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @template T Row data type. Defaults to `any` so existing untyped usage keeps compiling.
|
|
3
3
|
*/
|
|
4
|
-
export type ActionFunction = (item:
|
|
4
|
+
export type ActionFunction<T = any> = (item: T) => void;
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export default interface RowAction {
|
|
8
|
+
export default interface RowAction<T = any> {
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
@@ -21,9 +21,9 @@ export default interface RowAction {
|
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
callback: ActionFunction
|
|
24
|
+
callback: ActionFunction<T>;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
|
-
export type GetRowActions = (item:
|
|
29
|
+
export type GetRowActions<T = any> = (item: T) => Array<RowAction<T>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export function clickOutside(node) {
|
|
2
2
|
const handleClick = (event) => {
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
node.dispatchEvent(
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const target = event.target;
|
|
4
|
+
if (target instanceof Node && !node.contains(target) && !event.defaultPrevented) {
|
|
5
|
+
node.dispatchEvent(new CustomEvent('outerClick', {
|
|
6
|
+
bubbles: true,
|
|
7
|
+
detail: { originalEvent: event }
|
|
8
|
+
}));
|
|
8
9
|
}
|
|
9
10
|
};
|
|
10
11
|
document.addEventListener('click', handleClick, true);
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
let startWidth = $state(0);
|
|
61
61
|
|
|
62
62
|
const handleResizeMouseDown = (col: DataColumn) => (event: MouseEvent) => {
|
|
63
|
-
console.log("handleResizeMouseDown", col, event);
|
|
64
63
|
if (col.resizable) {
|
|
65
64
|
resizeCol = col;
|
|
66
65
|
startX = event.clientX;
|
|
@@ -89,6 +88,13 @@
|
|
|
89
88
|
window.removeEventListener('mousemove', onMouseMove);
|
|
90
89
|
window.removeEventListener('mouseup', onMouseUp);
|
|
91
90
|
}
|
|
91
|
+
|
|
92
|
+
const handleHeaderKeyDown = (column: DataColumn) => (e: KeyboardEvent) => {
|
|
93
|
+
if (column.compareFunction != null && (e.key === 'Enter' || e.key === ' ')) {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
handleCellClick?.(column);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
92
98
|
</script>
|
|
93
99
|
|
|
94
100
|
<div class="header-row" style="height: {headerHeight}px">
|
|
@@ -110,10 +116,18 @@
|
|
|
110
116
|
{/if}
|
|
111
117
|
{#each columns as column, index (index)}
|
|
112
118
|
<div class="fz_col-{index} data-cell" class:sortable={column.compareFunction != null} style="text-align: center">
|
|
119
|
+
<!-- role/tabindex are only ever both set together (sortable columns);
|
|
120
|
+
svelte-check can't verify that pairing statically across the ternary. -->
|
|
121
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
113
122
|
<div
|
|
114
123
|
class:sortable={column.compareFunction != null}
|
|
115
124
|
onclick={() => handleCellClick?.(column)}
|
|
116
|
-
|
|
125
|
+
onkeydown={handleHeaderKeyDown(column)}
|
|
126
|
+
role={column.compareFunction != null ? 'button' : undefined}
|
|
127
|
+
tabindex={column.compareFunction != null ? 0 : undefined}
|
|
128
|
+
aria-sort={column.field === orderColumn?.field
|
|
129
|
+
? (orderDirection === OrderDirection.Ascending ? 'ascending' : 'descending')
|
|
130
|
+
: undefined}
|
|
117
131
|
class="vertical-center"
|
|
118
132
|
>
|
|
119
133
|
<span>{column.text}</span>
|
|
@@ -129,7 +143,8 @@
|
|
|
129
143
|
<div
|
|
130
144
|
class="header-cell-divider"
|
|
131
145
|
class:resizer={column.resizable}
|
|
132
|
-
|
|
146
|
+
role={column.resizable ? 'separator' : undefined}
|
|
147
|
+
aria-orientation={column.resizable ? 'vertical' : undefined}
|
|
133
148
|
onmousedown={handleResizeMouseDown(column)}
|
|
134
149
|
></div>
|
|
135
150
|
</div>
|
|
@@ -45,6 +45,14 @@
|
|
|
45
45
|
e.stopPropagation();
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
const handleExpandKeyDown = (e: KeyboardEvent) => {
|
|
49
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
handleRowExpand?.(row);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
48
56
|
const handleSelectChange = (e: Event) => {
|
|
49
57
|
const checked = (e.target as HTMLInputElement).checked;
|
|
50
58
|
handleRowSelectChange?.(rowIndex, checked);
|
|
@@ -66,8 +74,9 @@
|
|
|
66
74
|
<div class="expand-icon" style="flex: 0 0 auto">
|
|
67
75
|
<i
|
|
68
76
|
class={row == expandRow ? 'icon_google_folder' : 'icon_google_folder_open'}
|
|
69
|
-
aria-
|
|
77
|
+
role="button" tabindex="0" aria-label={row == expandRow ? 'Collapse row' : 'Expand row'}
|
|
70
78
|
onclick={showInlineData}
|
|
79
|
+
onkeydown={handleExpandKeyDown}
|
|
71
80
|
></i>
|
|
72
81
|
</div>
|
|
73
82
|
{/if}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{#if typeof item == 'string'}
|
|
21
21
|
<span>{item}</span>
|
|
22
22
|
{:else}
|
|
23
|
-
<button class="link-style" onclick={(e) => { e.preventDefault(); item.action(); }}>{item.text}</button>
|
|
23
|
+
<button type="button" class="link-style" onclick={(e) => { e.preventDefault(); item.action(); }}>{item.text}</button>
|
|
24
24
|
{/if}
|
|
25
25
|
{/each}
|
|
26
26
|
</div>
|
|
@@ -60,16 +60,31 @@
|
|
|
60
60
|
window.removeEventListener('mousemove', onMouseMove);
|
|
61
61
|
window.removeEventListener('mouseup', onMouseUp);
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
const handleHeaderKeyDown = (col: DataColumn) => (e: KeyboardEvent) => {
|
|
65
|
+
if (col.compareFunction != null && (e.key === 'Enter' || e.key === ' ')) {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
handleCellClick?.(col);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
63
70
|
</script>
|
|
64
71
|
|
|
65
72
|
<div class="header-row" style="height: {headerHeight}px">
|
|
66
73
|
<div style="left: {-scrollLeft}px; width: {width}px">
|
|
67
74
|
{#each dataCols ?? [] as col, index (index)}
|
|
68
75
|
<div class="col-{index} data-cell" class:sortable={col.compareFunction != null} class:whitespace={hasWhitespace}>
|
|
76
|
+
<!-- role/tabindex are only ever both set together (sortable columns);
|
|
77
|
+
svelte-check can't verify that pairing statically across the ternary. -->
|
|
78
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
69
79
|
<div
|
|
70
80
|
class:sortable={col.compareFunction != null}
|
|
71
81
|
onclick={() => handleCellClick?.(col)}
|
|
72
|
-
|
|
82
|
+
onkeydown={handleHeaderKeyDown(col)}
|
|
83
|
+
role={col.compareFunction != null ? 'button' : undefined}
|
|
84
|
+
tabindex={col.compareFunction != null ? 0 : undefined}
|
|
85
|
+
aria-sort={col.field === orderColumn?.field
|
|
86
|
+
? (orderDirection === OrderDirection.Ascending ? 'ascending' : 'descending')
|
|
87
|
+
: undefined}
|
|
73
88
|
class="vertical-center"
|
|
74
89
|
>
|
|
75
90
|
<span>{col.text}</span>
|
|
@@ -85,7 +100,8 @@
|
|
|
85
100
|
<div
|
|
86
101
|
class="header-cell-divider"
|
|
87
102
|
class:resizer={col.resizable}
|
|
88
|
-
|
|
103
|
+
role={col.resizable ? 'separator' : undefined}
|
|
104
|
+
aria-orientation={col.resizable ? 'vertical' : undefined}
|
|
89
105
|
onmousedown={handleResizeMouseDown(col)}
|
|
90
106
|
></div>
|
|
91
107
|
</div>
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
return value ?? '';
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
let
|
|
20
|
+
let renderAsHtml = $derived((column.renderHTML ?? column.escapeHTML) == true);
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
|
-
{#if
|
|
23
|
+
{#if renderAsHtml == true}
|
|
24
24
|
{@html text}
|
|
25
25
|
{:else}
|
|
26
26
|
<span>{text}</span>
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
let showUpload = $state(false);
|
|
49
49
|
|
|
50
50
|
const handleFocus = (event: FocusEvent) => {
|
|
51
|
+
if (containerElement?.contains(event.relatedTarget as Node | null)) return;
|
|
51
52
|
if (!hasFocus) {
|
|
52
53
|
hasFocus = true;
|
|
53
54
|
onfocus?.(event);
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
const handleBlur = (event: FocusEvent) => {
|
|
59
|
+
if (containerElement?.contains(event.relatedTarget as Node | null)) return;
|
|
58
60
|
if (hasFocus && !showUpload) {
|
|
59
61
|
hasFocus = false;
|
|
60
62
|
onblur?.(event);
|
|
@@ -101,7 +103,9 @@
|
|
|
101
103
|
});
|
|
102
104
|
|
|
103
105
|
export function focus() {
|
|
104
|
-
containerElement
|
|
106
|
+
containerElement
|
|
107
|
+
?.querySelector<HTMLElement>('button, a[href], input:not([tabindex="-1"])')
|
|
108
|
+
?.focus();
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
const canUpload = $derived(!disabled && !readonly && (onUpload != null || uploadFile != null));
|
|
@@ -111,21 +115,19 @@
|
|
|
111
115
|
<div
|
|
112
116
|
bind:this={containerElement}
|
|
113
117
|
class="uniface-attachment-editor"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
onblur={handleBlur}
|
|
118
|
+
onfocusin={handleFocus}
|
|
119
|
+
onfocusout={handleBlur}
|
|
117
120
|
>
|
|
118
|
-
<input tabindex="-1" style="position: relative; left: -1px; width: 1px;"/>
|
|
119
121
|
<div class="files-field">
|
|
120
122
|
{#each files as file (file)}
|
|
121
123
|
<FileRender {file} {readonly} onRemove={removeFile}/>
|
|
122
124
|
{/each}
|
|
125
|
+
{#if canUpload}
|
|
126
|
+
<button type="button" class="editor-action-icon" aria-label="Upload file" onclick={triggerUpload}>
|
|
127
|
+
<i class="icon_google_file_upload" aria-hidden="true"></i>
|
|
128
|
+
</button>
|
|
129
|
+
{/if}
|
|
123
130
|
</div>
|
|
124
|
-
{#if canUpload}
|
|
125
|
-
<div class="editor-action-icon" onclick={triggerUpload}>
|
|
126
|
-
<i class="icon_google_file_upload" aria-hidden="true"></i>
|
|
127
|
-
</div>
|
|
128
|
-
{/if}
|
|
129
131
|
</div>
|
|
130
132
|
</FormEditor>
|
|
131
133
|
|
|
@@ -144,31 +146,34 @@
|
|
|
144
146
|
<style>
|
|
145
147
|
.uniface-attachment-editor {
|
|
146
148
|
display: flex;
|
|
147
|
-
flex-direction: row;
|
|
148
|
-
align-items: center;
|
|
149
149
|
width: 100%;
|
|
150
150
|
outline: none;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.files-field {
|
|
154
|
-
flex: 1 1 auto;
|
|
155
154
|
display: flex;
|
|
156
155
|
flex-direction: column;
|
|
157
156
|
gap: 4px;
|
|
157
|
+
width: 100%;
|
|
158
158
|
min-width: 0;
|
|
159
|
+
height: 96px;
|
|
160
|
+
overflow-y: auto;
|
|
161
|
+
box-sizing: border-box;
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
.editor-action-icon {
|
|
162
165
|
flex: 0 0 auto;
|
|
163
166
|
cursor: pointer;
|
|
164
167
|
padding: 4px;
|
|
165
|
-
margin-right: 8px;
|
|
166
168
|
border-radius: 4px;
|
|
167
169
|
display: flex;
|
|
168
170
|
align-items: center;
|
|
171
|
+
border: 0;
|
|
172
|
+
background: transparent;
|
|
173
|
+
color: inherit;
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
.editor-action-icon:hover {
|
|
172
177
|
background-color: rgba(0, 0, 0, 0.05);
|
|
173
178
|
}
|
|
174
|
-
</style>
|
|
179
|
+
</style>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
{/if}
|
|
45
45
|
</div>
|
|
46
46
|
{#if !readonly}
|
|
47
|
-
<button class="remove-btn" onclick={removeFile} aria-label="remove file">
|
|
47
|
+
<button type="button" class="remove-btn" onclick={removeFile} aria-label="remove file">
|
|
48
48
|
<i class="icon_google_delete" aria-hidden="true"></i>
|
|
49
49
|
</button>
|
|
50
50
|
{/if}
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
removeFile: (file: any) => void;
|
|
13
13
|
} = $props();
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// The upload object owns subsequent status updates. This value is only the
|
|
16
|
+
// initial snapshot before the effect installs its update callback.
|
|
17
|
+
const getInitialStatus = () => file?.status ?? ProgressStatus.progressing;
|
|
18
|
+
let status: ProgressStatus = $state(getInitialStatus());
|
|
16
19
|
let progress: number = $state(0);
|
|
17
20
|
|
|
18
21
|
let cancelLabel: string = i18nRes.common.btnCancel.toString();
|
|
@@ -60,4 +63,4 @@
|
|
|
60
63
|
<TextButton size="small" label={removeLabel} onclick={removeUploadFile}/>
|
|
61
64
|
{/if}
|
|
62
65
|
</div>
|
|
63
|
-
</div>
|
|
66
|
+
</div>
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
let btnPickup = i18nRes.upload.btnPickup.toString();
|
|
30
30
|
|
|
31
31
|
let files: Array<UploadFile> = $state([]);
|
|
32
|
-
let dropZone: any;
|
|
33
32
|
let fileInput: any;
|
|
34
33
|
let interval: any;
|
|
35
34
|
let busy: boolean = $state(false);
|
|
35
|
+
let dragActive = $state(false);
|
|
36
36
|
let canClose: boolean = $state(false);
|
|
37
37
|
|
|
38
38
|
$effect(() => {
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
const handleDragOver = (e: DragEvent) => {
|
|
61
61
|
e.preventDefault();
|
|
62
62
|
busy = true;
|
|
63
|
-
|
|
63
|
+
dragActive = true;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const handleDragLeave = (e: DragEvent) => {
|
|
67
67
|
e.preventDefault();
|
|
68
68
|
busy = false;
|
|
69
|
-
|
|
69
|
+
dragActive = false;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
const handleDrop = (e: DragEvent) => {
|
|
73
73
|
e.preventDefault();
|
|
74
|
-
|
|
74
|
+
dragActive = false;
|
|
75
75
|
handleFiles(e.dataTransfer?.files);
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -117,8 +117,12 @@
|
|
|
117
117
|
});
|
|
118
118
|
</script>
|
|
119
119
|
<ModalPopover {canClose} {theme} bind:visible>
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
<!-- onclick only stops propagation to the modal's outside-click handler; the
|
|
121
|
+
real controls (Button, file input) inside carry their own semantics. -->
|
|
122
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
123
|
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
124
|
+
<div class="uniface-file-upload-panel" class:highlight={dragActive} ondragover={handleDragOver} ondragleave={handleDragLeave}
|
|
125
|
+
ondrop={handleDrop} onclick={handleMouseClick} role="group" aria-label={btnPickup}>
|
|
122
126
|
<div class="file-upload-contents">
|
|
123
127
|
<div style="position: absolute; top: 0; width: 0; overflow: hidden">
|
|
124
128
|
<input bind:this={fileInput} type="file" {accept} multiple={maxFiles > 1} onchange={handleFilePickup}/>
|
|
@@ -154,70 +158,4 @@
|
|
|
154
158
|
}
|
|
155
159
|
.uniface-file-upload-panel.highlight {
|
|
156
160
|
background-color: var(--uniface-upload-panel-highlight-bg, #b3d8ff);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.uniface-attachment-display > div {
|
|
160
|
-
width: 100%;
|
|
161
|
-
box-sizing: border-box;
|
|
162
|
-
line-height: 1.1em;
|
|
163
|
-
overflow: hidden;
|
|
164
|
-
text-overflow: ellipsis;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.uniface-attachment-field {
|
|
168
|
-
display: inline-block;
|
|
169
|
-
position: relative;
|
|
170
|
-
width: 100%;
|
|
171
|
-
}
|
|
172
|
-
.uniface-attachment-field .uniface-common-editor {
|
|
173
|
-
height: 120px;
|
|
174
|
-
}
|
|
175
|
-
.uniface-attachment-field > div {
|
|
176
|
-
display: flex;
|
|
177
|
-
flex-direction: row;
|
|
178
|
-
justify-items: center;
|
|
179
|
-
}
|
|
180
|
-
.uniface-attachment-field .files-field {
|
|
181
|
-
flex: 1 1 auto;
|
|
182
|
-
height: 100%;
|
|
183
|
-
overflow: hidden;
|
|
184
|
-
text-overflow: ellipsis;
|
|
185
|
-
display: flex;
|
|
186
|
-
flex-direction: row;
|
|
187
|
-
justify-items: flex-start;
|
|
188
|
-
overflow-x: auto;
|
|
189
|
-
}
|
|
190
|
-
.uniface-attachment-field .files-field .file-icon {
|
|
191
|
-
position: relative;
|
|
192
|
-
}
|
|
193
|
-
.uniface-attachment-field .files-field .file-icon img {
|
|
194
|
-
width: 64px;
|
|
195
|
-
height: 64px;
|
|
196
|
-
}
|
|
197
|
-
.uniface-attachment-field .files-field .file-icon .action-icon {
|
|
198
|
-
position: absolute;
|
|
199
|
-
display: none;
|
|
200
|
-
left: 50%;
|
|
201
|
-
transform: translateX(-50%);
|
|
202
|
-
cursor: pointer;
|
|
203
|
-
}
|
|
204
|
-
.uniface-attachment-field .files-field .file-icon .action-icon i:active {
|
|
205
|
-
position: relative;
|
|
206
|
-
top: 1px;
|
|
207
|
-
}
|
|
208
|
-
.uniface-attachment-field .files-field .file-icon:hover .action-icon {
|
|
209
|
-
display: inline-block;
|
|
210
|
-
}
|
|
211
|
-
.uniface-attachment-field .action-dropdown {
|
|
212
|
-
box-sizing: border-box;
|
|
213
|
-
margin-top: 4px;
|
|
214
|
-
margin-right: 4px;
|
|
215
|
-
line-height: 22px;
|
|
216
|
-
margin-left: 8px;
|
|
217
|
-
color: var(--uniface-dropdown-color, #e1e1e1);
|
|
218
|
-
align-self: flex-start;
|
|
219
|
-
cursor: pointer;
|
|
220
|
-
}
|
|
221
|
-
.uniface-attachment-field .filled .action-dropdown {
|
|
222
|
-
color: var(--uniface-secondary-dropdown-color, #b9b9b9);
|
|
223
|
-
}</style>
|
|
161
|
+
}</style>
|
|
@@ -65,7 +65,14 @@
|
|
|
65
65
|
}, 50);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
// Previously a flat "width: 400px" regardless of how many cascade levels
|
|
69
|
+
// (columns) were actually open — with box$style unset (columns had no
|
|
70
|
+
// default width of their own before this fix) or with 3+ levels open,
|
|
71
|
+
// that either squeezed columns illegibly narrow or clipped/scrolled
|
|
72
|
+
// content that didn't need to. Let the popover grow to fit however many
|
|
73
|
+
// columns are currently shown, capped so a very deep hierarchy still
|
|
74
|
+
// scrolls instead of overflowing the viewport.
|
|
75
|
+
const mh = $derived(`width: max-content; max-width: min(90vw, 700px); height: ${menu$height}px`);
|
|
69
76
|
const textValue = $derived(
|
|
70
77
|
selectedItems.length > 0
|
|
71
78
|
? selectedItems[selectedItems.length - 1][textField]
|
|
@@ -129,7 +136,8 @@
|
|
|
129
136
|
bind:isOpen
|
|
130
137
|
{theme} {value} {mandatory}
|
|
131
138
|
clear={cleanData}
|
|
132
|
-
{onfocus} {onblur}
|
|
139
|
+
{onfocus} {onblur}
|
|
140
|
+
autoFit={false}>
|
|
133
141
|
{#snippet popupLayer()}
|
|
134
142
|
<div class="cascade-options-popover" style={mh}>
|
|
135
143
|
<div style="height: 100%; position: relative">
|