@ticatec/uniface-element 0.1.12 → 0.1.14
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/dist/app-layout/ClassicLayout.svelte +1 -1
- package/dist/box/Box.svelte +8 -0
- package/dist/box/Box.svelte.d.ts +3 -0
- package/dist/card/Card.svelte +3 -2
- package/dist/card/CardAction.d.ts +1 -0
- package/dist/card/CommonCardActionBar.svelte +3 -3
- package/dist/checkbox/CheckBox.svelte +1 -1
- package/dist/data-table/DataTable.svelte +83 -54
- package/dist/data-table/DataTable.svelte.d.ts +7 -5
- package/dist/data-table/UniDataTable.d.ts +4 -2
- package/dist/data-table/UniDataTable.js +8 -7
- package/dist/data-table/lib/IndicatorColumn.d.ts +2 -11
- package/dist/data-table/parts/ActionsPanel.svelte +9 -2
- package/dist/data-table/parts/ActionsPanel.svelte.d.ts +1 -1
- package/dist/data-table/parts/ActionsRow.svelte +3 -3
- package/dist/data-table/parts/ContentPanel.svelte +65 -77
- package/dist/data-table/parts/ContentPanel.svelte.d.ts +15 -8
- package/dist/data-table/parts/DataCell.svelte +2 -2
- package/dist/data-table/parts/DataRow.svelte +2 -4
- package/dist/data-table/parts/FixedColumnsPanel.svelte +52 -13
- package/dist/data-table/parts/FixedColumnsPanel.svelte.d.ts +12 -5
- package/dist/data-table/parts/FixedHeaderPanel.svelte +74 -11
- package/dist/data-table/parts/FixedHeaderPanel.svelte.d.ts +8 -2
- package/dist/data-table/parts/FixedRow.svelte +30 -17
- package/dist/data-table/parts/FixedRow.svelte.d.ts +6 -3
- package/dist/data-table/parts/TableHeaderPanel.svelte +32 -63
- package/dist/data-table/parts/TableHeaderPanel.svelte.d.ts +6 -10
- package/dist/data-table/parts/TableRow.d.ts +0 -10
- package/dist/data-table/parts/TableRow.js +0 -29
- package/dist/data-table/parts/TableRows.d.ts +0 -2
- package/dist/data-table/parts/TableRows.js +0 -2
- package/dist/data-table/parts/TreeRootCell.svelte +3 -0
- package/dist/{list-box/ListViewItem.svelte.d.ts → data-table/parts/TreeRootCell.svelte.d.ts} +3 -3
- package/dist/date-picker/DatePicker.svelte +5 -0
- package/dist/date-picker/DateTimePicker.svelte +6 -1
- package/dist/dialog/Dialog.svelte +0 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/list-box/index.d.ts +1 -2
- package/dist/message-box/IMessageBox.d.ts +4 -4
- package/dist/message-box/IMessageBox.js +10 -10
- package/dist/message-box/MessageBoxBoard.svelte +3 -3
- package/dist/message-box/index.d.ts +2 -2
- package/dist/message-box/index.js +2 -2
- package/dist/number-range/NumberRange.svelte +3 -2
- package/dist/number-range/NumberRange.svelte.d.ts +1 -0
- package/dist/options-multi-select/OptionsMultiSelect.svelte +19 -3
- package/dist/options-multi-select/OptionsMultiSelect.svelte.d.ts +1 -0
- package/dist/options-select/OptionsSelect.svelte +8 -2
- package/dist/pagination-panel/PaginationPanel.svelte +1 -1
- package/dist/pagination-panel/PaginationPanel.svelte.d.ts +1 -1
- package/dist/split/Split.svelte +14 -2
- package/dist/split/Split.svelte.d.ts +1 -0
- package/dist/text-editor/TextEditor.svelte +7 -1
- package/dist/text-editor/TextEditor.svelte.d.ts +1 -0
- package/dist/ticatec-uniface-web.css +172 -208
- package/package.json +1 -1
- package/dist/list-box/ListViewItem.svelte +0 -6
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</div>
|
|
61
61
|
{#if $$slots['right-sidebar']}
|
|
62
62
|
{#if sidebarResize}
|
|
63
|
-
<Split direction="vertical" bindingPanel={rightBar}/>
|
|
63
|
+
<Split direction="vertical" bindingPanel={rightBar} reverse/>
|
|
64
64
|
{/if}
|
|
65
65
|
<div bind:this={rightBar} style="width: 100%; flex: 0 0 auto; overflow: auto; width: {rightBarWidth}; {rightMinWidth} {rightMaxWidth}">
|
|
66
66
|
<slot name="right-sidebar"></slot>
|
package/dist/box/Box.svelte
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export let round: boolean = false;
|
|
6
6
|
|
|
7
7
|
export let content$style: string = '';
|
|
8
|
+
export let fonter$style: string = '';
|
|
8
9
|
|
|
9
10
|
</script>
|
|
10
11
|
|
|
@@ -21,4 +22,11 @@
|
|
|
21
22
|
<div class="box-content" style={content$style}>
|
|
22
23
|
<slot></slot>
|
|
23
24
|
</div>
|
|
25
|
+
{#if $$slots['footer']}
|
|
26
|
+
<div class="box-footer" style={fonter$style}>
|
|
27
|
+
<slot name="footer">
|
|
28
|
+
|
|
29
|
+
</slot>
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
24
32
|
</div>
|
package/dist/box/Box.svelte.d.ts
CHANGED
|
@@ -21,14 +21,17 @@ declare const Box: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithCh
|
|
|
21
21
|
title?: string;
|
|
22
22
|
round?: boolean;
|
|
23
23
|
content$style?: string;
|
|
24
|
+
fonter$style?: string;
|
|
24
25
|
}, {
|
|
25
26
|
header: {};
|
|
26
27
|
default: {};
|
|
28
|
+
footer: {};
|
|
27
29
|
}>, {
|
|
28
30
|
[evt: string]: CustomEvent<any>;
|
|
29
31
|
}, {
|
|
30
32
|
header: {};
|
|
31
33
|
default: {};
|
|
34
|
+
footer: {};
|
|
32
35
|
}, {}, string>;
|
|
33
36
|
type Box = InstanceType<typeof Box>;
|
|
34
37
|
export default Box;
|
package/dist/card/Card.svelte
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
|
|
3
|
-
import CardHeader from "./CardHeader.svelte";
|
|
4
3
|
import type CardAction from "./CardAction";
|
|
5
4
|
import CommonCardActionBar from "./CommonCardActionBar.svelte";
|
|
6
5
|
|
|
@@ -15,7 +14,9 @@
|
|
|
15
14
|
<div class="uniface-card" class:shadowBox={variant=='3d'}>
|
|
16
15
|
<div {style}>
|
|
17
16
|
{#if title}
|
|
18
|
-
<
|
|
17
|
+
<div class="card-header simple">
|
|
18
|
+
<span>{title}</span>
|
|
19
|
+
</div>
|
|
19
20
|
{:else if $$slots['header-bar']}
|
|
20
21
|
<div class="card-header">
|
|
21
22
|
<slot name="header-bar"/>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
let clickEnable = true;
|
|
9
9
|
|
|
10
10
|
const handleActionClick = (action: CardAction) => async (e: MouseEvent) => {
|
|
11
|
-
if (clickEnable) {
|
|
11
|
+
if (clickEnable && !action.disabled) {
|
|
12
12
|
clickEnable = false;
|
|
13
13
|
action.callback?.();
|
|
14
14
|
await utils.sleep(0.5);
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
<div class="card-action-bar simple">
|
|
22
22
|
{#each actions as action}
|
|
23
|
-
<div class="action-item">
|
|
24
|
-
<i class={action.icon} on:click={handleActionClick(action)}></i>
|
|
23
|
+
<div class:disabled={action.disabled} class="action-item">
|
|
24
|
+
<i class={action.icon} aria-hidden="true" on:click={handleActionClick(action)}></i>
|
|
25
25
|
</div>
|
|
26
26
|
{/each}
|
|
27
27
|
</div>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
</script>
|
|
43
43
|
<div class="uniface-checkbox" class:disabled class:compact {style}>
|
|
44
|
-
<label on:click={handleClickEvent}
|
|
44
|
+
<label on:click={handleClickEvent} >
|
|
45
45
|
<input bind:this={checkbox} type="checkbox" bind:checked={value} {readonly} {disabled}/>
|
|
46
46
|
<span>{label}</span>
|
|
47
47
|
</label>
|
|
@@ -1,91 +1,120 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import TableHeaderPanel from "./parts/TableHeaderPanel.svelte";
|
|
5
3
|
import ContentPanel from "./parts/ContentPanel.svelte";
|
|
6
4
|
import type DataColumn from "./lib/DataColumn";
|
|
7
5
|
import type ActionsColumn from "./lib/ActionsColumn";
|
|
8
6
|
import type IndicatorColumn from "./lib/IndicatorColumn";
|
|
9
7
|
import type TableRow from "./parts/TableRow";
|
|
8
|
+
import UniDataTable from "./UniDataTable";
|
|
9
|
+
import {onMount} from "svelte";
|
|
10
|
+
import FixedColumnsPanel from "./parts/FixedColumnsPanel.svelte";
|
|
11
|
+
import ActionPanel from "./parts/ActionsPanel.svelte";
|
|
12
|
+
import {OrderDirection} from "./lib/OrderDirection";
|
|
10
13
|
import type {CompareFunction} from "./lib/CompareFunction";
|
|
11
|
-
import UniDataTable, {SelectionMode} from "./UniDataTable";
|
|
12
|
-
import {onMount, tick} from "svelte";
|
|
13
14
|
|
|
14
15
|
export let columns: Array<DataColumn>;
|
|
15
|
-
export let actionsColumn: ActionsColumn | null;
|
|
16
|
-
export let indicatorColumn: IndicatorColumn;
|
|
17
|
-
export let rowHeight: number =
|
|
18
|
-
export let list
|
|
16
|
+
export let actionsColumn: ActionsColumn | null = null;
|
|
17
|
+
export let indicatorColumn: IndicatorColumn | null = null;
|
|
18
|
+
export let rowHeight: number = 42; //{ rowHeight}
|
|
19
|
+
export let list: Array<any>;
|
|
19
20
|
export let selectedRows: Array<any> = [];
|
|
21
|
+
export let inlineRowHeight: number = 80;
|
|
22
|
+
export let rowBorder: boolean = false;
|
|
23
|
+
export let colBorder: boolean = false;
|
|
24
|
+
|
|
25
|
+
export let style: string = '';
|
|
20
26
|
|
|
21
|
-
let dataColumns: Array<DataColumn
|
|
27
|
+
let dataColumns: Array<DataColumn>;
|
|
22
28
|
|
|
23
|
-
let colStyle: string = '';
|
|
24
|
-
let scrollLeft: number = 0;
|
|
25
29
|
let rows: Array<TableRow>;
|
|
26
30
|
let table: UniDataTable = null as unknown as UniDataTable;
|
|
27
|
-
|
|
31
|
+
let tabStyle: string = '';
|
|
28
32
|
|
|
29
|
-
let id: string =
|
|
33
|
+
let id: string = (new Date()).getTime().toString(36);
|
|
30
34
|
|
|
31
35
|
onMount(() => {
|
|
32
|
-
table = new UniDataTable(id, indicatorColumn
|
|
36
|
+
table = new UniDataTable(id, indicatorColumn?.width);
|
|
37
|
+
selectedRows = selectedRows ?? [];
|
|
38
|
+
initializeTable();
|
|
33
39
|
})
|
|
34
|
-
const sortRows = (compareFun: CompareFunction, descending: boolean) => {
|
|
35
|
-
let oList = list.sort(compareFun);
|
|
36
|
-
displayList = descending ? oList.reverse() : oList;
|
|
37
|
-
rows = table.rows;
|
|
38
|
-
}
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
await tick();
|
|
44
|
-
selectionMode = value ? SelectionMode.All : SelectionMode.None;
|
|
45
|
-
rows = [...rows];
|
|
46
|
-
}
|
|
41
|
+
let expandRow: TableRow | null = null;
|
|
42
|
+
let fixedCols: Array<DataColumn>;
|
|
43
|
+
let scrollTop: number;
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
const initializeTable = () => {
|
|
46
|
+
table.setColumns(columns);
|
|
47
|
+
rows = table.rows;
|
|
48
|
+
dataColumns = table.columns;
|
|
49
|
+
fixedCols = table.frozenColumns;
|
|
50
|
+
tabStyle = table.generateTemplateStyle();
|
|
51
|
+
tabWidth = table.width;
|
|
52
|
+
frozenWidth = table.frozenWidth;
|
|
53
|
+
}
|
|
49
54
|
|
|
50
|
-
$: displayList = [...list];
|
|
51
55
|
|
|
52
|
-
$: {
|
|
53
|
-
|
|
54
|
-
table.setColumns(columns)
|
|
55
|
-
table.data = displayList;
|
|
56
|
-
rows = table.rows;
|
|
57
|
-
dataColumns = table.columns;
|
|
58
|
-
colStyle = table.generateTemplateStyle();
|
|
59
|
-
tabWidth = table.width;
|
|
60
|
-
}
|
|
56
|
+
$: if (table && columns) {
|
|
57
|
+
initializeTable();
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
let tabWidth: number;
|
|
64
|
-
|
|
61
|
+
let frozenWidth: number;
|
|
65
62
|
const handleWidthChange = () => {
|
|
66
|
-
|
|
63
|
+
tabStyle = table.generateTemplateStyle();
|
|
67
64
|
tabWidth = table.width;
|
|
65
|
+
frozenWidth = table.frozenWidth;
|
|
68
66
|
}
|
|
69
67
|
|
|
68
|
+
let orderColumn: DataColumn = null as unknown as DataColumn;
|
|
69
|
+
let orderDirection: OrderDirection = OrderDirection.Ascending;
|
|
70
|
+
const sortRows = (compareFun: CompareFunction, descending: boolean) => {
|
|
71
|
+
expandRow = null;
|
|
72
|
+
let oList = list.sort(compareFun);
|
|
73
|
+
table.data = descending ? oList.reverse() : oList;
|
|
74
|
+
rows = table.rows;
|
|
75
|
+
}
|
|
76
|
+
const handleCellClick = (col: DataColumn) => (e: MouseEvent) => {
|
|
77
|
+
if (col.compareFunction != null) {
|
|
78
|
+
if (col == orderColumn) {
|
|
79
|
+
orderDirection = orderDirection == OrderDirection.Ascending ? OrderDirection.Descending : OrderDirection.Ascending;
|
|
80
|
+
} else {
|
|
81
|
+
orderColumn = col;
|
|
82
|
+
orderDirection = OrderDirection.Ascending;
|
|
83
|
+
}
|
|
84
|
+
sortRows(col.compareFunction, orderDirection == OrderDirection.Descending);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
70
87
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
let inlineComponent: any;
|
|
89
|
+
const handleRowExpand = async (row: TableRow) => {
|
|
90
|
+
if (row == expandRow) {
|
|
91
|
+
expandRow = null;
|
|
92
|
+
inlineComponent = null;
|
|
93
|
+
} else {
|
|
94
|
+
inlineComponent = await indicatorColumn?.buildInlineComponent?.(row.data);
|
|
95
|
+
expandRow = row;
|
|
96
|
+
}
|
|
74
97
|
}
|
|
75
98
|
|
|
76
99
|
</script>
|
|
77
100
|
|
|
78
|
-
<div id="tab-{id}" class="uniface-data-table">
|
|
79
|
-
{@html
|
|
80
|
-
{#if table}
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
101
|
+
<div id="tab-{id}" {style} class="uniface-data-table" class:cell-border={colBorder} class:row-border={rowBorder}>
|
|
102
|
+
{@html tabStyle}
|
|
103
|
+
{#if table && dataColumns && fixedCols}
|
|
104
|
+
{#if indicatorColumn || fixedCols.length > 0}
|
|
105
|
+
<FixedColumnsPanel {handleRowExpand} bind:selectedRows {orderDirection} {orderColumn} {handleCellClick} {indicatorColumn}
|
|
106
|
+
bind:expandRow {table}
|
|
107
|
+
{rowHeight} {fixedCols} {inlineRowHeight} {rows} {handleWidthChange} width={frozenWidth}
|
|
108
|
+
bind:scrollTop/>
|
|
109
|
+
{/if}
|
|
110
|
+
|
|
111
|
+
<ContentPanel columns={dataColumns} {orderDirection} {orderColumn} {handleWidthChange} {handleCellClick} {tabWidth} bind:rows
|
|
112
|
+
bind:scrollTop {expandRow} {rowHeight} {list} {table} {inlineComponent} bind:inlineRowHeight
|
|
113
|
+
displayHorizontalScroll={actionsColumn!=null || indicatorColumn != null || fixedCols.length > 0}
|
|
114
|
+
showVerticalScroll={actionsColumn == null}/>
|
|
115
|
+
{/if}
|
|
116
|
+
|
|
117
|
+
{#if actionsColumn}
|
|
118
|
+
<ActionPanel {expandRow} {rowHeight} {actionsColumn} {rows} {inlineRowHeight} bind:scrollTop/>
|
|
90
119
|
{/if}
|
|
91
120
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type DataColumn from "./lib/DataColumn";
|
|
2
2
|
import type ActionsColumn from "./lib/ActionsColumn";
|
|
3
3
|
import type IndicatorColumn from "./lib/IndicatorColumn";
|
|
4
|
-
import { SelectionMode } from "./UniDataTable";
|
|
5
4
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
6
5
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
7
6
|
$$bindings?: Bindings;
|
|
@@ -17,12 +16,15 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
17
16
|
}
|
|
18
17
|
declare const DataTable: $$__sveltets_2_IsomorphicComponent<{
|
|
19
18
|
columns: Array<DataColumn>;
|
|
20
|
-
actionsColumn
|
|
21
|
-
indicatorColumn
|
|
19
|
+
actionsColumn?: ActionsColumn | null;
|
|
20
|
+
indicatorColumn?: IndicatorColumn | null;
|
|
22
21
|
rowHeight?: number;
|
|
23
|
-
list: any
|
|
22
|
+
list: Array<any>;
|
|
24
23
|
selectedRows?: Array<any>;
|
|
25
|
-
|
|
24
|
+
inlineRowHeight?: number;
|
|
25
|
+
rowBorder?: boolean;
|
|
26
|
+
colBorder?: boolean;
|
|
27
|
+
style?: string;
|
|
26
28
|
}, {
|
|
27
29
|
[evt: string]: CustomEvent<any>;
|
|
28
30
|
}, {}, {}, string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type DataColumn from "./lib/DataColumn";
|
|
2
2
|
import type TableRow from "./parts/TableRow";
|
|
3
3
|
export type RowEventHandler = (row: TableRow) => void;
|
|
4
|
+
export type RowSelectEventHandler = (row: TableRow, value: boolean) => void;
|
|
4
5
|
export type TableEventHandler = () => void;
|
|
5
6
|
export type SelectionEventHandler = (value: boolean) => void;
|
|
6
7
|
export declare enum SelectionMode {
|
|
@@ -16,7 +17,7 @@ export default class UniDataTable {
|
|
|
16
17
|
readonly id: string;
|
|
17
18
|
private _width;
|
|
18
19
|
private _frozenWidth;
|
|
19
|
-
constructor(id: string, indicatorWidth
|
|
20
|
+
constructor(id: string, indicatorWidth?: number);
|
|
20
21
|
set data(value: Array<any>);
|
|
21
22
|
get data(): Array<any>;
|
|
22
23
|
setColumns(columns: Array<DataColumn>): void;
|
|
@@ -24,5 +25,6 @@ export default class UniDataTable {
|
|
|
24
25
|
get width(): number;
|
|
25
26
|
get frozenWidth(): number;
|
|
26
27
|
get rows(): Array<TableRow>;
|
|
27
|
-
get columns(): DataColumn
|
|
28
|
+
get columns(): Array<DataColumn>;
|
|
29
|
+
get frozenColumns(): Array<DataColumn>;
|
|
28
30
|
}
|
|
@@ -15,7 +15,7 @@ export default class UniDataTable {
|
|
|
15
15
|
_frozenWidth = 0;
|
|
16
16
|
constructor(id, indicatorWidth) {
|
|
17
17
|
this.id = id;
|
|
18
|
-
this.indicatorWidth = indicatorWidth;
|
|
18
|
+
this.indicatorWidth = indicatorWidth ?? 0;
|
|
19
19
|
this.tableRows = new TableRows();
|
|
20
20
|
}
|
|
21
21
|
set data(value) {
|
|
@@ -25,12 +25,10 @@ export default class UniDataTable {
|
|
|
25
25
|
return this.tableRows.data;
|
|
26
26
|
}
|
|
27
27
|
setColumns(columns) {
|
|
28
|
-
let frozen = true;
|
|
29
28
|
this._frozenColumns = [];
|
|
30
29
|
this._columns = [];
|
|
31
30
|
(columns ?? []).forEach(col => {
|
|
32
|
-
|
|
33
|
-
if (frozen) {
|
|
31
|
+
if (col.frozen) {
|
|
34
32
|
this._frozenColumns.push(col);
|
|
35
33
|
}
|
|
36
34
|
else {
|
|
@@ -40,12 +38,12 @@ export default class UniDataTable {
|
|
|
40
38
|
}
|
|
41
39
|
generateTemplateStyle() {
|
|
42
40
|
this._width = 0;
|
|
43
|
-
this._frozenWidth =
|
|
41
|
+
this._frozenWidth = 0;
|
|
44
42
|
let colStyle = '';
|
|
45
43
|
let inv = 0;
|
|
46
44
|
this._frozenColumns.forEach((col, idx) => {
|
|
47
45
|
if (col.visible != false) {
|
|
48
|
-
this.
|
|
46
|
+
this._frozenWidth += col.width;
|
|
49
47
|
colStyle += `#tab-${this.id} .fz_col-${idx - inv} {width: ${col.width}px; ext-align: ${col.align ?? 'left'}}\n`;
|
|
50
48
|
}
|
|
51
49
|
else {
|
|
@@ -68,7 +66,7 @@ export default class UniDataTable {
|
|
|
68
66
|
return this._width;
|
|
69
67
|
}
|
|
70
68
|
get frozenWidth() {
|
|
71
|
-
return this._frozenWidth;
|
|
69
|
+
return this._frozenWidth + this.indicatorWidth;
|
|
72
70
|
}
|
|
73
71
|
get rows() {
|
|
74
72
|
return [...this.tableRows.rows];
|
|
@@ -76,4 +74,7 @@ export default class UniDataTable {
|
|
|
76
74
|
get columns() {
|
|
77
75
|
return this._columns;
|
|
78
76
|
}
|
|
77
|
+
get frozenColumns() {
|
|
78
|
+
return this._frozenColumns;
|
|
79
|
+
}
|
|
79
80
|
}
|
|
@@ -12,16 +12,7 @@ export default interface IndicatorColumn {
|
|
|
12
12
|
*/
|
|
13
13
|
buildInlineComponent?: (data: any) => Promise<any>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param ex
|
|
17
|
-
*/
|
|
18
|
-
getInlineError?: (ex: Error) => string;
|
|
19
|
-
/**
|
|
20
|
-
* 读取数据的指示信息
|
|
21
|
-
*/
|
|
22
|
-
loadingIndicator?: string;
|
|
23
|
-
/**
|
|
24
|
-
* 空数据指示信息
|
|
15
|
+
* 是否显示行号
|
|
25
16
|
*/
|
|
26
|
-
|
|
17
|
+
displayNo?: boolean;
|
|
27
18
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type ActionsColumn from "../lib/ActionsColumn";
|
|
5
5
|
import type TableRow from "./TableRow";
|
|
6
6
|
import {onDestroy, onMount} from "svelte";
|
|
7
|
+
import i18n from "../../i18nContext";
|
|
7
8
|
|
|
8
9
|
export let actionsColumn: ActionsColumn;
|
|
9
10
|
export let scrollTop: number = 0;
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
|
|
12
13
|
export let inlineRowHeight: number = 0;
|
|
13
14
|
|
|
14
|
-
export let expandRow: TableRow;
|
|
15
|
+
export let expandRow: TableRow | null;
|
|
15
16
|
|
|
16
17
|
export let rowHeight: number;
|
|
17
18
|
|
|
@@ -42,11 +43,17 @@
|
|
|
42
43
|
resizeObserver.disconnect();
|
|
43
44
|
});
|
|
44
45
|
|
|
46
|
+
let actionText = i18n.getText('uniface.element.tableActions', 'Actions');
|
|
45
47
|
|
|
46
48
|
</script>
|
|
47
49
|
|
|
48
50
|
<div class="action-panel" bind:this={panel} style="user-select: none; width: {actionsColumn.width}px;">
|
|
49
|
-
<div
|
|
51
|
+
<div class="header-row">
|
|
52
|
+
<div class="vertical-center">
|
|
53
|
+
<span>{actionText}</span>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div bind:this={scrollPanel} class="rows-container" style="overflow-y: auto" on:scroll|passive={handleActionPanelScroll}>
|
|
50
57
|
<div>
|
|
51
58
|
{#each rows as row, idx}
|
|
52
59
|
<ActionsRow {row} {rowHeight} parentRect={rect} alternative={idx % 2 == 1} width={actionsColumn.width}
|
|
@@ -18,7 +18,7 @@ declare const ActionsPanel: $$__sveltets_2_IsomorphicComponent<{
|
|
|
18
18
|
scrollTop?: number;
|
|
19
19
|
rows: Array<TableRow>;
|
|
20
20
|
inlineRowHeight?: number;
|
|
21
|
-
expandRow: TableRow;
|
|
21
|
+
expandRow: TableRow | null;
|
|
22
22
|
rowHeight: number;
|
|
23
23
|
}, {
|
|
24
24
|
[evt: string]: CustomEvent<any>;
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
$: style = rowHeight== null ? '' : `height: ${rowHeight}px`
|
|
85
85
|
|
|
86
86
|
</script>
|
|
87
|
-
<div class="
|
|
88
|
-
<div bind:this={cell}
|
|
89
|
-
style="
|
|
87
|
+
<div class="data-row" class:alternative style="position: relative; width: {width}px; display: block; {style}">
|
|
88
|
+
<div class="action-cell" bind:this={cell}
|
|
89
|
+
style="">
|
|
90
90
|
{#each actionList as action}
|
|
91
91
|
<TextButton style="flex-shrink: 0; top: 0" size="mini" type="primary" label={action.label} onClick={()=>action.callback(row.data)}/>
|
|
92
92
|
{/each}
|