@ticatec/uniface-element 0.1.14 → 0.1.16
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/action-bar/ActionBar.svelte +2 -2
- package/dist/attachment-files/FileUploadBar.svelte +1 -1
- package/dist/attachment-files/FileUploadPanel.svelte +1 -1
- package/dist/base-calendar/CalendarBase.svelte +7 -3
- package/dist/base-calendar/CalendarBase.svelte.d.ts +0 -3
- package/dist/base-calendar/DateContext.d.ts +0 -9
- package/dist/base-calendar/DateContext.js +7 -68
- package/dist/base-calendar/index.d.ts +2 -2
- package/dist/base-calendar/index.js +2 -2
- package/dist/box/Box.svelte +11 -7
- package/dist/box/Box.svelte.d.ts +8 -3
- package/dist/checkbox/CheckBox.svelte +16 -7
- package/dist/checkbox/CheckBox.svelte.d.ts +1 -1
- package/dist/common/CommonPicker.svelte +14 -8
- package/dist/common/CommonPicker.svelte.d.ts +1 -1
- package/dist/common-editor/CommonEditor.svelte +17 -9
- package/dist/common-editor/CommonEditor.svelte.d.ts +2 -0
- package/dist/common-range-editor/CommonRangeEditor.svelte +8 -9
- package/dist/common-range-editor/CommonRangeEditor.svelte.d.ts +0 -2
- package/dist/concise-data-table/Column.d.ts +9 -0
- package/dist/concise-data-table/Column.js +1 -0
- package/dist/concise-data-table/ConciseListTable.svelte +154 -0
- package/dist/concise-data-table/ConciseListTable.svelte.d.ts +26 -0
- package/dist/concise-data-table/DataCell.svelte +22 -0
- package/dist/{data-table/parts/LinkButton.svelte.d.ts → concise-data-table/DataCell.svelte.d.ts} +7 -6
- package/dist/concise-data-table/DataRow.svelte +15 -0
- package/dist/concise-data-table/DataRow.svelte.d.ts +25 -0
- package/dist/concise-data-table/TableOptions.d.ts +11 -0
- package/dist/concise-data-table/TableOptions.js +1 -0
- package/dist/concise-data-table/index.d.ts +5 -0
- package/dist/concise-data-table/index.js +2 -0
- package/dist/concise-data-table/utils.d.ts +6 -0
- package/dist/concise-data-table/utils.js +38 -0
- package/dist/criteria-field/CriteriaField.svelte +3 -2
- package/dist/criteria-field/CriteriaField.svelte.d.ts +1 -0
- package/dist/data-table/DataTable.svelte +2 -0
- package/dist/data-table/lib/ActionsColumn.d.ts +0 -4
- package/dist/data-table/lib/HrefLink.d.ts +1 -1
- package/dist/data-table/parts/ActionsPanel.svelte +2 -2
- package/dist/data-table/parts/ContentPanel.svelte +6 -2
- package/dist/data-table/parts/DataCell.svelte +1 -1
- package/dist/data-table/parts/FixedHeaderPanel.svelte +1 -1
- package/dist/data-table/parts/HrefCell.svelte +8 -10
- package/dist/data-table/parts/TextCell.svelte +6 -9
- package/dist/date-picker/DateTimePicker.svelte +3 -7
- package/dist/date-range/DateRangeEditor.svelte +2 -2
- package/dist/dialog/Dialog.svelte +1 -1
- package/dist/form-field/FormField.svelte +9 -11
- package/dist/form-field/FormField.svelte.d.ts +2 -1
- package/dist/i18n_resources/index.d.ts +3 -0
- package/dist/i18n_resources/index.js +3 -0
- package/dist/i18n_resources/uniface_cn_resource.d.ts +29 -0
- package/dist/i18n_resources/uniface_cn_resource.js +37 -0
- package/dist/i18n_resources/uniface_en_resource.d.ts +29 -0
- package/dist/i18n_resources/uniface_en_resource.js +37 -0
- package/dist/input-options-select/InputOptionsSelect.svelte +105 -28
- package/dist/input-options-select/InputOptionsSelect.svelte.d.ts +2 -4
- package/dist/list-box/ListBox.svelte +81 -47
- package/dist/list-box/ListBox.svelte.d.ts +10 -16
- package/dist/message-box/IMessageBox.js +1 -1
- package/dist/nav-menu/NavigatorMenuItem.svelte +1 -1
- package/dist/options-multi-select/OptionsMultiSelect.svelte +1 -1
- package/dist/property-editor/PropertyEditor.svelte +1 -1
- package/dist/search-box/SearchBox.svelte +19 -12
- package/dist/search-box/SearchBox.svelte.d.ts +6 -2
- package/dist/text-editor/TextEditor.svelte +2 -3
- package/dist/ticatec-uniface-web.css +738 -652
- package/dist/tree-view/TreeNodeView.svelte +6 -8
- package/dist/tree-view/TreeUtils.js +2 -2
- package/package.json +12 -7
- package/dist/UnifaceResource.d.ts +0 -43
- package/dist/UnifaceResource.js +0 -57
- package/dist/assets/arrow_down.svg +0 -1
- package/dist/assets/arrow_up.svg +0 -1
- package/dist/assets/calendar_icon.svg +0 -1
- package/dist/assets/delete_icon.svg +0 -1
- package/dist/assets/icon-dropdown.svg +0 -1
- package/dist/assets/icon_left.svg +0 -1
- package/dist/assets/icon_right.svg +0 -1
- package/dist/assets/pickup-options.svg +0 -1
- package/dist/assets/retry.png +0 -0
- package/dist/data-table/parts/LinkButton.svelte +0 -19
- package/dist/i18nContext.d.ts +0 -21
- package/dist/i18nContext.js +0 -29
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import {onMount, onDestroy, tick} from 'svelte';
|
|
4
|
+
import DataRow from "./DataRow.svelte";
|
|
5
|
+
import {type RowClickHandler, type TableOptions} from "./TableOptions";
|
|
6
|
+
import utils from "./utils";
|
|
7
|
+
|
|
8
|
+
// list array to display
|
|
9
|
+
export let list: Array<any>;
|
|
10
|
+
// Column definitions with configuration
|
|
11
|
+
export let columns: Array<Column>;
|
|
12
|
+
// Enable auto-scroll feature
|
|
13
|
+
export let autoScroll: boolean = false;
|
|
14
|
+
// Milliseconds between each scroll step
|
|
15
|
+
export let scrollInterval: number = 2000;
|
|
16
|
+
export let rowClickHandler: RowClickHandler | null = null;
|
|
17
|
+
//行高
|
|
18
|
+
|
|
19
|
+
// Height of the component in pixels
|
|
20
|
+
//table background color
|
|
21
|
+
export let options: TableOptions;
|
|
22
|
+
|
|
23
|
+
let tabOptions: TableOptions;
|
|
24
|
+
|
|
25
|
+
$: tabOptions = {headerHeight: 36, rowHeight: 32, ...options}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
let id = (new Date().getTime() * 1000 + Math.floor(Math.random() * 1000)).toString(36);
|
|
29
|
+
let tableStyle: string = '';
|
|
30
|
+
let tableContainer: any;
|
|
31
|
+
let viewPanel: any;
|
|
32
|
+
let headerRow: any;
|
|
33
|
+
let scrollTimer: any;
|
|
34
|
+
let currentScrollIndex: number = 0;
|
|
35
|
+
let visibleRowCount: number = 0;
|
|
36
|
+
|
|
37
|
+
$: totalWeight = columns.reduce((sum, col) => sum + (col.weight || 0), 0);
|
|
38
|
+
|
|
39
|
+
let rowHeight: number;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
let clonedRows: Array<any> = []; // 用于无缝滚动的克隆行
|
|
43
|
+
let viewWidth = 0;
|
|
44
|
+
let viewHeight = 0;
|
|
45
|
+
let resizeObserver: any;
|
|
46
|
+
|
|
47
|
+
onMount(async () => {
|
|
48
|
+
resizeObserver = new ResizeObserver(() => {
|
|
49
|
+
viewWidth = Math.round(viewPanel?.clientWidth) - 1;
|
|
50
|
+
viewHeight = Math.round(viewPanel?.clientHeight) - 1;
|
|
51
|
+
});
|
|
52
|
+
resizeObserver.observe(viewPanel);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
onDestroy(() => {
|
|
56
|
+
resizeObserver.disconnect();
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const setupAutoScroll = async () => {
|
|
61
|
+
if (autoScroll && tableContainer && list.length > 0) {
|
|
62
|
+
await tick();
|
|
63
|
+
const tableBody = tableContainer.querySelector('.table-body');
|
|
64
|
+
if (tableBody && tableBody.children.length > 0) {
|
|
65
|
+
rowHeight = tableBody.children[0].offsetHeight;
|
|
66
|
+
visibleRowCount = Math.floor((tableContainer.offsetHeight - headerRow.offsetHeight) / rowHeight);
|
|
67
|
+
if (list.length <= visibleRowCount) return;
|
|
68
|
+
clonedRows = [...list];
|
|
69
|
+
startAutoScroll();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const startAutoScroll = () => {
|
|
75
|
+
// Clear any existing timer
|
|
76
|
+
if (scrollTimer) clearInterval(scrollTimer);
|
|
77
|
+
|
|
78
|
+
currentScrollIndex = 0;
|
|
79
|
+
|
|
80
|
+
scrollTimer = setInterval(() => {
|
|
81
|
+
currentScrollIndex++;
|
|
82
|
+
const tableBody = tableContainer.querySelector('.table-body');
|
|
83
|
+
if (tableBody) {
|
|
84
|
+
tableBody.style.transform = `translateY(-${currentScrollIndex * rowHeight}px)`;
|
|
85
|
+
if (currentScrollIndex >= list.length) {
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
tableBody.style.transition = 'none';
|
|
88
|
+
tableBody.style.transform = `translateY(0)`;
|
|
89
|
+
currentScrollIndex = 0;
|
|
90
|
+
|
|
91
|
+
// 恢复过渡效果
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
tableBody.style.transition = 'transform 2s ease';
|
|
94
|
+
}, 50);
|
|
95
|
+
}, 50);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, scrollInterval);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const stopAutoScroll = () => {
|
|
102
|
+
if (scrollTimer) {
|
|
103
|
+
clearInterval(scrollTimer);
|
|
104
|
+
scrollTimer = null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
onMount(async () => {
|
|
109
|
+
await setupAutoScroll();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
onDestroy(() => {
|
|
113
|
+
stopAutoScroll();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
$: if (list || autoScroll || scrollInterval) {
|
|
117
|
+
stopAutoScroll();
|
|
118
|
+
setupAutoScroll();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
$: tableStyle = utils.generateTableStyle(id, columns, tabOptions, viewWidth);
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<div id="tab_{id}" class="uniface-concise-datatable">
|
|
127
|
+
{@html tableStyle}
|
|
128
|
+
<div class="table-container" bind:this={tableContainer}>
|
|
129
|
+
<!-- Fixed header -->
|
|
130
|
+
<div class="table-header">
|
|
131
|
+
<div class="table-row" bind:this={headerRow}>
|
|
132
|
+
{#each columns as column, idx}
|
|
133
|
+
<div class="data-cell col_{idx}">
|
|
134
|
+
{column.title ?? ''}
|
|
135
|
+
</div>
|
|
136
|
+
{/each}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<!-- Scrollable body -->
|
|
141
|
+
<div class="table-body-container" bind:this={viewPanel} class:auto-scroll={autoScroll}>
|
|
142
|
+
<div class="table-body" style="transition: transform {autoScroll ? '2s' : '0s'} ease;">
|
|
143
|
+
{#each list as row, rowIndex}
|
|
144
|
+
<DataRow data={row} {columns} showAlternative={rowIndex % 2 == 1} on:click={rowClickHandler?.(row)}/>
|
|
145
|
+
{/each}
|
|
146
|
+
{#if autoScroll && list.length > visibleRowCount}
|
|
147
|
+
{#each list.slice(0, visibleRowCount) as row, rowIndex}
|
|
148
|
+
<DataRow data={row} {columns} showAlternative={rowIndex % 2 == 1} on:click={rowClickHandler?.(row)}/>
|
|
149
|
+
{/each}
|
|
150
|
+
{/if}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RowClickHandler, type TableOptions } from "./TableOptions";
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const ConciseListTable: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
list: Array<any>;
|
|
17
|
+
columns: Array<Column>;
|
|
18
|
+
autoScroll?: boolean;
|
|
19
|
+
scrollInterval?: number;
|
|
20
|
+
rowClickHandler?: RowClickHandler | null;
|
|
21
|
+
options: TableOptions;
|
|
22
|
+
}, {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {}, {}, string>;
|
|
25
|
+
type ConciseListTable = InstanceType<typeof ConciseListTable>;
|
|
26
|
+
export default ConciseListTable;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type Column from "./Column";
|
|
3
|
+
|
|
4
|
+
export let column: Column;
|
|
5
|
+
export let idx: number;
|
|
6
|
+
|
|
7
|
+
export let data: any;
|
|
8
|
+
|
|
9
|
+
let text: string;
|
|
10
|
+
let escapeHTML: boolean = false;
|
|
11
|
+
|
|
12
|
+
$: text = column.formatter ? column.formatter(data[column.field]) : data[column.field];
|
|
13
|
+
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div class="data-cell col_{idx}">
|
|
17
|
+
{#if escapeHTML}
|
|
18
|
+
{@html text}
|
|
19
|
+
{:else }
|
|
20
|
+
<span>{text}</span>
|
|
21
|
+
{/if}
|
|
22
|
+
</div>
|
package/dist/{data-table/parts/LinkButton.svelte.d.ts → concise-data-table/DataCell.svelte.d.ts}
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type Column from "./Column";
|
|
1
2
|
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> {
|
|
2
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
4
|
$$bindings?: Bindings;
|
|
@@ -11,12 +12,12 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
11
12
|
};
|
|
12
13
|
z_$$bindings?: Bindings;
|
|
13
14
|
}
|
|
14
|
-
declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
declare const DataCell: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
column: Column;
|
|
17
|
+
idx: number;
|
|
18
|
+
data: any;
|
|
18
19
|
}, {
|
|
19
20
|
[evt: string]: CustomEvent<any>;
|
|
20
21
|
}, {}, {}, string>;
|
|
21
|
-
type
|
|
22
|
-
export default
|
|
22
|
+
type DataCell = InstanceType<typeof DataCell>;
|
|
23
|
+
export default DataCell;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type Column from "./Column";
|
|
3
|
+
import DataCell from "./DataCell.svelte";
|
|
4
|
+
|
|
5
|
+
export let columns: Array<Column>;
|
|
6
|
+
export let data: any;
|
|
7
|
+
|
|
8
|
+
export let showAlternative: boolean;
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="table-row" class:alternative={showAlternative} on:click>
|
|
12
|
+
{#each columns as column, idx}
|
|
13
|
+
<DataCell {idx} {column} {data}/>
|
|
14
|
+
{/each}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type Column from "./Column";
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const DataRow: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
columns: Array<Column>;
|
|
17
|
+
data: any;
|
|
18
|
+
showAlternative: boolean;
|
|
19
|
+
}, {
|
|
20
|
+
click: MouseEvent;
|
|
21
|
+
} & {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
}, {}, {}, string>;
|
|
24
|
+
type DataRow = InstanceType<typeof DataRow>;
|
|
25
|
+
export default DataRow;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TableOptions {
|
|
2
|
+
backgroundColor?: string;
|
|
3
|
+
color?: string;
|
|
4
|
+
headerHeight?: number;
|
|
5
|
+
headerBackgroundColor?: string;
|
|
6
|
+
headerColor?: string;
|
|
7
|
+
alternativeBackgroundColor?: string;
|
|
8
|
+
alternativeColor?: string;
|
|
9
|
+
rowHeight?: number;
|
|
10
|
+
}
|
|
11
|
+
export type RowClickHandler = (row: any) => (event: MouseEvent) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const generateBlockStyle = (prefix, options, keys) => {
|
|
2
|
+
let style = '';
|
|
3
|
+
keys.forEach(key => {
|
|
4
|
+
if (options[key.code]) {
|
|
5
|
+
style += `${key.attr}: ${options[key.code]}${key.suffix ?? ''};\n`;
|
|
6
|
+
}
|
|
7
|
+
});
|
|
8
|
+
if (style.length > 0) {
|
|
9
|
+
return `${prefix} { ${style} }`;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param id
|
|
18
|
+
* @param columns
|
|
19
|
+
* @param options
|
|
20
|
+
* @param viewWidth
|
|
21
|
+
*/
|
|
22
|
+
const generateTableStyle = (id, columns, options, viewWidth) => {
|
|
23
|
+
let style = '';
|
|
24
|
+
if (options && columns) {
|
|
25
|
+
style += generateBlockStyle(`#tab_${id}`, options, [{ code: 'backgroundColor', attr: 'background-color' }, { code: 'color', attr: 'color' }]);
|
|
26
|
+
style += generateBlockStyle(`#tab_${id} .table-row.alternative `, options, [{ code: 'alternativeBackgroundColor', attr: 'background-color' }, { code: 'alternativeColor', attr: 'color' }]);
|
|
27
|
+
style += generateBlockStyle(`#tab_${id} .table-header .table-row `, options, [{ code: 'headerBackgroundColor', attr: 'background-color' }, { code: 'headerColor', attr: 'color' }, { code: 'headerHeight', attr: 'height', suffix: 'px' }]);
|
|
28
|
+
style += generateBlockStyle(`#tab_${id} .table-body .table-row`, options, [{ code: 'headerHeight', attr: 'height', suffix: 'px' }]);
|
|
29
|
+
let totalWeight = columns.reduce((sum, col) => sum + (col.weight || 0), 0);
|
|
30
|
+
let tabWidth = columns.reduce((sum, col) => sum + col.width, 0);
|
|
31
|
+
let diff = (viewWidth - tabWidth) / totalWeight;
|
|
32
|
+
columns.forEach((col, idx) => {
|
|
33
|
+
style += `#tab_${id} .col_${idx} {\n width: ${col.width + (col.weight ?? 0) * diff}px; \n text-align: ${col.align ?? 'left'};} \n`;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return `<style>${style}</style>`;
|
|
37
|
+
};
|
|
38
|
+
export default { generateTableStyle };
|
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
export let label$style: string = '';
|
|
7
7
|
export let arrangement: 'vertical' | 'horizontal' = 'vertical' ;
|
|
8
8
|
export let size: '' | 'x15' | 'x20' | 'x25' | 'x30' | 'x35' | 'x40' = '';
|
|
9
|
+
export let labelSuffix: string = ':';
|
|
9
10
|
|
|
10
11
|
let className: string = '';
|
|
11
12
|
|
|
12
13
|
</script>
|
|
13
14
|
<div class="uniface-filter-field {size} {arrangement} {className}" {style} >
|
|
14
|
-
<div>
|
|
15
|
+
<div class="field-container">
|
|
15
16
|
<div class="field-label" style={label$style}>
|
|
16
|
-
<span>{label}</span>
|
|
17
|
+
<span>{label}{labelSuffix}</span>
|
|
17
18
|
</div>
|
|
18
19
|
<div class="field">
|
|
19
20
|
<slot/>
|
|
@@ -23,6 +23,7 @@ declare const CriteriaField: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_P
|
|
|
23
23
|
label$style?: string;
|
|
24
24
|
arrangement?: "vertical" | "horizontal";
|
|
25
25
|
size?: "" | "x15" | "x20" | "x25" | "x30" | "x35" | "x40";
|
|
26
|
+
labelSuffix?: string;
|
|
26
27
|
}, {
|
|
27
28
|
default: {};
|
|
28
29
|
}>, {
|
|
@@ -4,7 +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 "
|
|
7
|
+
import i18n from "@ticatec/i18n";
|
|
8
8
|
|
|
9
9
|
export let actionsColumn: ActionsColumn;
|
|
10
10
|
export let scrollTop: number = 0;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
resizeObserver.disconnect();
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
let actionText = i18n.getText('uniface.
|
|
46
|
+
let actionText = i18n.getText('uniface.dataTable.actions', 'Actions');
|
|
47
47
|
|
|
48
48
|
</script>
|
|
49
49
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import DataRow from "./DataRow.svelte";
|
|
4
4
|
import type DataColumn from "../lib/DataColumn";
|
|
5
5
|
import type TableRow from "./TableRow";
|
|
6
|
-
import {onMount} from "svelte";
|
|
6
|
+
import {onDestroy, onMount} from "svelte";
|
|
7
7
|
import TableHeaderPanel from "./TableHeaderPanel.svelte";
|
|
8
8
|
import UniDataTable, {type TableEventHandler} from "../UniDataTable";
|
|
9
9
|
import {OrderDirection} from "../lib/OrderDirection";
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
resizeObserver.observe(viewPanel);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
+
onDestroy(()=>{
|
|
56
|
+
resizeObserver.disconnect();
|
|
57
|
+
})
|
|
58
|
+
|
|
55
59
|
const handleDataTableScroll = (e: Event) => {
|
|
56
60
|
if (showVerticalScroll) {
|
|
57
61
|
scrollTop = e.target?.scrollTop;
|
|
@@ -121,7 +125,7 @@
|
|
|
121
125
|
<div class="expand-data-row" bind:clientHeight={inlineRowHeight}
|
|
122
126
|
style="position: relative; box-sizing: content-box; width: 100%; height: auto">
|
|
123
127
|
<div class="inline-panel">
|
|
124
|
-
<svelte:component this={inlineComponent} data={row}/>
|
|
128
|
+
<svelte:component this={inlineComponent} data={row.data}/>
|
|
125
129
|
</div>
|
|
126
130
|
</div>
|
|
127
131
|
{/if}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {type SelectionEventHandler, SelectionMode, type TableEventHandler} from "../UniDataTable";
|
|
6
6
|
import utils from "../../common/utils";
|
|
7
7
|
import {OrderDirection} from "../lib/OrderDirection";
|
|
8
|
-
import i18n from "
|
|
8
|
+
import i18n from "@ticatec/i18n";
|
|
9
9
|
|
|
10
10
|
export let columns: Array<DataColumn>;
|
|
11
11
|
export let indicatorColumn: IndicatorColumn | null;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type HrefLink from "../lib/HrefLink";
|
|
2
3
|
import type {HrefBuilder} from "../lib/HrefLink";
|
|
3
4
|
|
|
4
5
|
export let data;
|
|
5
6
|
export let href: HrefBuilder;
|
|
6
7
|
|
|
7
|
-
let
|
|
8
|
-
|
|
8
|
+
let list: Array<HrefLink> = [];
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
$: {
|
|
11
12
|
let h = href(data);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} else {
|
|
15
|
-
text = h.text;
|
|
16
|
-
action = h.action;
|
|
17
|
-
}
|
|
13
|
+
list = Array.isArray(h) ? h : [h];
|
|
18
14
|
}
|
|
19
15
|
</script>
|
|
20
|
-
<div>
|
|
21
|
-
|
|
16
|
+
<div style="display: flex; flex-direction: row; gap: 8px; justify-content: center">
|
|
17
|
+
{#each list as item, idx}
|
|
18
|
+
<a href="javascript:void(0)" on:click={()=>item.action()}>{item.text}</a>
|
|
19
|
+
{/each}
|
|
22
20
|
</div>
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
let escapeHTML: boolean = false;
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
13
|
$: {
|
|
16
14
|
let value = tableUtils.extractFieldValue(data, column.field);
|
|
17
15
|
if (column.formatter) {
|
|
@@ -26,10 +24,9 @@
|
|
|
26
24
|
|
|
27
25
|
</script>
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>
|
|
27
|
+
|
|
28
|
+
{#if escapeHTML == true}
|
|
29
|
+
{@html text}
|
|
30
|
+
{:else}
|
|
31
|
+
<span>{text}</span>
|
|
32
|
+
{/if}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import {TextButton} from "../button";
|
|
10
10
|
import type {OnChangeHandler} from "../common/OnChangeHandler";
|
|
11
11
|
import CommonPicker from "../common/CommonPicker.svelte";
|
|
12
|
+
import i18nContext from "@ticatec/i18n";
|
|
12
13
|
|
|
13
14
|
export let disabled: boolean = false;
|
|
14
15
|
export let readonly: boolean = false;
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
export let mandatory: boolean = false;
|
|
25
26
|
export let onChange: OnChangeHandler<Date> = null as unknown as OnChangeHandler<Date>;
|
|
26
27
|
|
|
27
|
-
let confirmText =
|
|
28
|
+
let confirmText = i18nContext.getText('uniface.calendar.confirmText');
|
|
28
29
|
let textValue: string;
|
|
29
30
|
let editor: any;
|
|
30
31
|
let oldValue: Date = dateUtils.toDayjs(value)?.toDate();
|
|
@@ -44,11 +45,6 @@
|
|
|
44
45
|
|
|
45
46
|
})
|
|
46
47
|
|
|
47
|
-
const extractDisplayTime = () => {
|
|
48
|
-
displayTime = dateUtils.formatDate(value, format);
|
|
49
|
-
editor && editor.focus();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
48
|
const openPopup = () => {
|
|
53
49
|
displayTime = dateUtils.formatDate(currentValue, format);
|
|
54
50
|
showPopup = true;
|
|
@@ -136,7 +132,7 @@
|
|
|
136
132
|
<span>{displayTime}</span>
|
|
137
133
|
</div>
|
|
138
134
|
<div style="flex: 0 0 auto;">
|
|
139
|
-
<TextButton label={confirmText} disabled={btnDisabled} onClick={confirm}/>
|
|
135
|
+
<TextButton label={confirmText} type="primary" disabled={btnDisabled} onClick={confirm}/>
|
|
140
136
|
</div>
|
|
141
137
|
</div>
|
|
142
138
|
</div>
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
<svelte:fragment slot="to">
|
|
66
66
|
<input style="width: 100%; text-align: center" readonly on:click={showPopover} value={textTo}/>
|
|
67
67
|
</svelte:fragment>
|
|
68
|
-
<svelte:fragment
|
|
69
|
-
<i class="uniface-icon-calendar
|
|
68
|
+
<svelte:fragment>
|
|
69
|
+
<i class="uniface-icon-calendar action-icon" aria-hidden="true" on:click={showPopover}></i>
|
|
70
70
|
</svelte:fragment>
|
|
71
71
|
</CommonRangeEditor>
|
|
72
72
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {fade} from "svelte/transition";
|
|
4
4
|
import type {DialogCloseConfirm} from "./DialogCloseConfirm";
|
|
5
5
|
import ActionBar, {type ButtonActions} from "../action-bar";
|
|
6
|
-
import i18n from "
|
|
6
|
+
import i18n from "@ticatec/i18n";
|
|
7
7
|
import {onMount} from "svelte";
|
|
8
8
|
|
|
9
9
|
export let title: string = null as unknown as string;
|
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
export {className as class}
|
|
6
6
|
export let label: string = "Label:"
|
|
7
7
|
export let style: string = '';
|
|
8
|
-
export let label$style: string =
|
|
8
|
+
export let label$style: string | null = null;
|
|
9
9
|
export let required: boolean = false;
|
|
10
10
|
export let error: string = '';
|
|
11
11
|
export let arrangement: 'vertical' | 'horizontal' = 'vertical';
|
|
12
12
|
export let labelSuffix: string = ':';
|
|
13
13
|
|
|
14
|
+
export let label$alignment: 'center' | 'top' = 'center'
|
|
15
|
+
|
|
14
16
|
let className: string = '';
|
|
15
17
|
|
|
16
18
|
</script>
|
|
17
19
|
<div class="uniface-form-field {arrangement} {className}" {style}>
|
|
18
20
|
<div class="form-content" style="width: 100%">
|
|
19
|
-
<div class="field-label" style=
|
|
21
|
+
<div class="field-label" style={label$style} class:vert-top={arrangement== 'horizontal' && label$alignment=='top'}>
|
|
20
22
|
{#if required}
|
|
21
23
|
<span class="required-indicator">*</span>
|
|
22
24
|
{/if}
|
|
@@ -25,14 +27,10 @@
|
|
|
25
27
|
<div class="field">
|
|
26
28
|
<slot/>
|
|
27
29
|
</div>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<div class="form-content" style="width: 100%">
|
|
31
|
-
{#if arrangement == "horizontal"}
|
|
32
|
-
<div class="field-label" style={label$style}>
|
|
33
|
-
</div>
|
|
34
|
-
{/if}
|
|
30
|
+
{#if !utils.isEmpty(error)}
|
|
31
|
+
<div class="empty-field"></div>
|
|
35
32
|
<div class="field-hint"><span>{error}</span></div>
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
{/if}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
38
36
|
</div>
|
|
@@ -20,11 +20,12 @@ declare const FormField: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Props
|
|
|
20
20
|
class?: string;
|
|
21
21
|
label?: string;
|
|
22
22
|
style?: string;
|
|
23
|
-
label$style?: string;
|
|
23
|
+
label$style?: string | null;
|
|
24
24
|
required?: boolean;
|
|
25
25
|
error?: string;
|
|
26
26
|
arrangement?: "vertical" | "horizontal";
|
|
27
27
|
labelSuffix?: string;
|
|
28
|
+
label$alignment?: "center" | "top";
|
|
28
29
|
}, {
|
|
29
30
|
default: {};
|
|
30
31
|
}>, {
|