@ticatec/uniface-element 0.1.52 → 0.1.54
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/dialog/CommonDialog.svelte +2 -2
- package/dist/dialog/CommonDialog.svelte.d.ts +1 -1
- package/dist/i18n_resources/uniface_en_resource.d.ts +3 -0
- package/dist/i18n_resources/uniface_en_resource.js +3 -0
- package/dist/list-box/ListBox.svelte +1 -1
- package/dist/message-box/MessageBoxBoard.svelte +1 -1
- package/dist/ticatec-uniface-web.css +17 -12
- package/dist/transfer/Transfer.svelte +65 -0
- package/dist/{transfer-field/TransferField.svelte.d.ts → transfer/Transfer.svelte.d.ts} +12 -17
- package/dist/transfer/index.d.ts +4 -0
- package/dist/transfer/index.js +2 -0
- package/dist/transfer/types.d.ts +1 -0
- package/package.json +5 -1
- package/dist/transfer-field/TransferField.svelte +0 -91
- package/dist/transfer-field/index.d.ts +0 -2
- package/dist/transfer-field/index.js +0 -2
- package/dist/transfer-field/types.d.ts +0 -6
- /package/dist/{transfer-field → transfer}/README.md +0 -0
- /package/dist/{transfer-field → transfer}/types.js +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import Dialog from "./Dialog.svelte";
|
|
4
4
|
import type {ButtonAction, ButtonActions} from "../action-bar";
|
|
5
|
-
import type {DialogCloseConfirm, MouseClickHandler} from "..";
|
|
6
5
|
import i18n from "@ticatec/i18n";
|
|
6
|
+
import type {DialogCloseConfirm} from "./DialogCloseConfirm";
|
|
7
7
|
|
|
8
8
|
export let title: string;
|
|
9
9
|
export let closeConfirm: DialogCloseConfirm | null = null;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
let actions: ButtonActions = [confirmAction];
|
|
30
30
|
|
|
31
31
|
$: {
|
|
32
|
-
confirmAction.disabled = confirmHandler==null
|
|
32
|
+
confirmAction.disabled = confirmHandler==null || !enableConfirm;
|
|
33
33
|
actions = [...actions];
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DialogCloseConfirm } from "
|
|
1
|
+
import type { DialogCloseConfirm } from "./DialogCloseConfirm";
|
|
2
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
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
4
|
$$bindings?: Bindings;
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
{#each filteredList as item}
|
|
189
189
|
{#if selectMode === "multiple"}
|
|
190
190
|
<div class="listview-item" style="display: flex; flex-direction: row; align-items: center; gap: 8px">
|
|
191
|
-
<CheckBox style="flex: 0 0 auto" {readonly} value={selectedList.indexOf(item) > -1}
|
|
191
|
+
<CheckBox style="flex: 0 0 auto; margin-left: 8px" {readonly} value={selectedList.indexOf(item) > -1}
|
|
192
192
|
onChange={handleSelectionChanged(item)}/>
|
|
193
193
|
<div style="flex: 1 1 auto; cursor: pointer" aria-hidden="true" on:click={handleSelectionChanged(item)}>
|
|
194
194
|
<svelte:component this={itemRender} {readonly} {item} {...item$props}/>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
buttons = _buttons;
|
|
46
|
-
iconType = _type == null ? '
|
|
46
|
+
iconType = _type == null ? 'icon_google_warning' : _type == 'info' ? 'icon_google_info' : 'icon_google_help';
|
|
47
47
|
type = _type ?? "info";
|
|
48
48
|
visible = true;
|
|
49
49
|
return new Promise<any>(r => {
|
|
@@ -2736,25 +2736,30 @@ root {
|
|
|
2736
2736
|
padding-left: 1em;
|
|
2737
2737
|
}
|
|
2738
2738
|
|
|
2739
|
-
.container {
|
|
2739
|
+
.uniface-transfer-container {
|
|
2740
2740
|
height: 100%;
|
|
2741
2741
|
width: 100%;
|
|
2742
|
-
display:
|
|
2743
|
-
|
|
2742
|
+
display: grid;
|
|
2743
|
+
grid-auto-columns: 1fr 60px 1fr;
|
|
2744
|
+
column-gap: 16px;
|
|
2744
2745
|
}
|
|
2745
|
-
.container .header-container {
|
|
2746
|
+
.uniface-transfer-container .header-container {
|
|
2746
2747
|
margin: 10px auto 10px 10px;
|
|
2747
2748
|
}
|
|
2748
|
-
.container .list-container {
|
|
2749
|
-
height:
|
|
2750
|
-
|
|
2751
|
-
overflow:
|
|
2752
|
-
border: 1px solid
|
|
2749
|
+
.uniface-transfer-container .list-container {
|
|
2750
|
+
height: 100%;
|
|
2751
|
+
flex: 1 1 auto;
|
|
2752
|
+
overflow: hidden;
|
|
2753
|
+
border: 1px solid var(--uniface-inside-border-color);
|
|
2753
2754
|
box-sizing: border-box;
|
|
2754
|
-
border-radius:
|
|
2755
|
+
border-radius: 8px;
|
|
2755
2756
|
}
|
|
2756
|
-
.container .icon-button-container {
|
|
2757
|
-
|
|
2757
|
+
.uniface-transfer-container .icon-button-container {
|
|
2758
|
+
display: flex;
|
|
2759
|
+
row-gap: 24px;
|
|
2760
|
+
flex-direction: column;
|
|
2761
|
+
justify-content: center;
|
|
2762
|
+
align-items: center;
|
|
2758
2763
|
}
|
|
2759
2764
|
|
|
2760
2765
|
:root {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ListBox from "../list-box";
|
|
3
|
+
import IconButton from "../button/IconButton.svelte";
|
|
4
|
+
|
|
5
|
+
import type {FunFilter} from "../list-box";
|
|
6
|
+
import type {TransferData} from "./types";
|
|
7
|
+
import i18n from "@ticatec/i18n";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export let style: string = '';
|
|
12
|
+
export let sourceList:Array<any>;
|
|
13
|
+
export let sourceTitle: string;
|
|
14
|
+
export let targetList:Array<any>;
|
|
15
|
+
export let targetTitle: string;
|
|
16
|
+
|
|
17
|
+
export let itemRender: any = null;
|
|
18
|
+
export let filter: FunFilter = null;
|
|
19
|
+
export let transferData: TransferData = null;
|
|
20
|
+
export let header$style: string = '';
|
|
21
|
+
export let footer$style: string = 'width: 100%; background-color: #f0f0f0; padding: 2px 6px; text-align: right; box-sizing: border-box';
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
let sourceSelectedList = [];
|
|
25
|
+
let targetSelectedList = [];
|
|
26
|
+
|
|
27
|
+
const moveToTarget = async () => {
|
|
28
|
+
if (sourceSelectedList.length > 0 && await transferData?.(sourceSelectedList, "right")) {
|
|
29
|
+
targetList = [...targetList, ...sourceSelectedList];
|
|
30
|
+
sourceList = sourceList.filter(item => sourceSelectedList.indexOf(item) === -1);
|
|
31
|
+
sourceSelectedList = [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const moveToSource = async () => {
|
|
36
|
+
if (targetSelectedList.length > 0 && await transferData?.(targetSelectedList, "left")) {
|
|
37
|
+
sourceList = [...sourceList, ...targetSelectedList];
|
|
38
|
+
targetList = targetList.filter(item => targetSelectedList.indexOf(item) === -1);
|
|
39
|
+
targetSelectedList = [];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div class="uniface-transfer-container">
|
|
45
|
+
<ListBox class="list-container" title={sourceTitle} {filter} style="{style}; grid-column: 1/2" list={sourceList} selectMode="multiple"
|
|
46
|
+
bind:selectedList={sourceSelectedList} {itemRender}>
|
|
47
|
+
<div slot="footer" style={footer$style}>
|
|
48
|
+
<span>{i18n.getText('uniface.transfer.selectIndicator', {selected: sourceSelectedList.length, total: sourceList.length})}</span>
|
|
49
|
+
</div>
|
|
50
|
+
</ListBox>
|
|
51
|
+
<div class="icon-button-container" style="grid-column: 2/3;">
|
|
52
|
+
<IconButton onClick={moveToSource} type="primary" disabled={targetSelectedList.length === 0}>
|
|
53
|
+
<i class="icon_google_navigate_before"></i>
|
|
54
|
+
</IconButton>
|
|
55
|
+
<IconButton onClick={moveToTarget} type="primary" disabled={sourceSelectedList.length === 0}>
|
|
56
|
+
<i class="icon_google_navigate_next"></i>
|
|
57
|
+
</IconButton>
|
|
58
|
+
</div>
|
|
59
|
+
<ListBox class="list-container" title={targetTitle} style="{style}; grid-column: 3/4" {filter} list={targetList} selectMode="multiple"
|
|
60
|
+
bind:selectedList={targetSelectedList} {itemRender} }>
|
|
61
|
+
<div slot="footer" style={footer$style}>
|
|
62
|
+
<span>{i18n.getText('uniface.transfer.selectIndicator', {selected: targetSelectedList.length, total: targetList.length})}</span>
|
|
63
|
+
</div>
|
|
64
|
+
</ListBox>
|
|
65
|
+
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { FunFilter } from "../list-box";
|
|
2
|
+
import type { TransferData } from "./types";
|
|
3
3
|
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> {
|
|
4
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
5
|
$$bindings?: Bindings;
|
|
@@ -13,24 +13,19 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
13
13
|
};
|
|
14
14
|
z_$$bindings?: Bindings;
|
|
15
15
|
}
|
|
16
|
-
declare const
|
|
17
|
-
height?: string;
|
|
18
|
-
width?: string;
|
|
16
|
+
declare const Transfer: $$__sveltets_2_IsomorphicComponent<{
|
|
19
17
|
style?: string;
|
|
20
|
-
sourceList
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
sourceList: Array<any>;
|
|
19
|
+
sourceTitle: string;
|
|
20
|
+
targetList: Array<any>;
|
|
21
|
+
targetTitle: string;
|
|
22
|
+
itemRender?: any;
|
|
23
23
|
filter?: FunFilter;
|
|
24
|
-
|
|
24
|
+
transferData?: TransferData;
|
|
25
25
|
header$style?: string;
|
|
26
26
|
footer$style?: string;
|
|
27
|
-
echoValue?: any[];
|
|
28
|
-
echoData: () => void;
|
|
29
27
|
}, {
|
|
30
28
|
[evt: string]: CustomEvent<any>;
|
|
31
|
-
}, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, {}, string>;
|
|
35
|
-
type TransferField = InstanceType<typeof TransferField>;
|
|
36
|
-
export default TransferField;
|
|
29
|
+
}, {}, {}, string>;
|
|
30
|
+
type Transfer = InstanceType<typeof Transfer>;
|
|
31
|
+
export default Transfer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TransferData = (list: Array<any>, direction: "left" | "right") => Promise<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ticatec/uniface-element",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.54",
|
|
4
4
|
"description": "uniface web elements",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -320,6 +320,10 @@
|
|
|
320
320
|
"types": "./dist/time-editor/index.d.ts",
|
|
321
321
|
"import": "./dist/time-editor/index.js"
|
|
322
322
|
},
|
|
323
|
+
"./Transfer": {
|
|
324
|
+
"types": "./dist/transfer/index.d.ts",
|
|
325
|
+
"import": "./dist/transfer/index.js"
|
|
326
|
+
},
|
|
323
327
|
"./UnitNumberEditor": {
|
|
324
328
|
"types": "./dist/unit-number-editor/index.d.ts",
|
|
325
329
|
"import": "./dist/unit-number-editor/index.js"
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import ListBox from "../list-box";
|
|
3
|
-
import IconButton from "../button";
|
|
4
|
-
import {onMount, SvelteComponent} from "svelte";
|
|
5
|
-
import type {FunFilter} from "./types";
|
|
6
|
-
|
|
7
|
-
export let height: string = '';
|
|
8
|
-
export let width: string = '';
|
|
9
|
-
export let style: string = '';
|
|
10
|
-
export let sourceList = [];
|
|
11
|
-
export let disabled: boolean = false;
|
|
12
|
-
export let itemRender: SvelteComponent = null;
|
|
13
|
-
export let filter: FunFilter = null;
|
|
14
|
-
export let sourceSelectedList = [];
|
|
15
|
-
export let header$style: string = '';
|
|
16
|
-
export let footer$style: string = 'width: 100%; background-color: #f0f0f0; padding: 2px 6px; text-align: right; box-sizing: border-box';
|
|
17
|
-
export let echoValue = [];
|
|
18
|
-
export let echoData: () => void;
|
|
19
|
-
|
|
20
|
-
let targetList = [];
|
|
21
|
-
let targetSelectedList = [];
|
|
22
|
-
let sourceSelectedItem = null;
|
|
23
|
-
let targetSelectedItem = null;
|
|
24
|
-
|
|
25
|
-
const moveToTarget = () => {
|
|
26
|
-
if (sourceSelectedList.length > 0) {
|
|
27
|
-
targetList = [...targetList, ...sourceSelectedList];
|
|
28
|
-
sourceList = sourceList.filter(item => sourceSelectedList.indexOf(item) === -1);
|
|
29
|
-
sourceSelectedList = [];
|
|
30
|
-
} else if (sourceSelectedItem) {
|
|
31
|
-
targetList = [...targetList, sourceSelectedItem];
|
|
32
|
-
sourceList = sourceList.filter(item => item !== sourceSelectedItem);
|
|
33
|
-
sourceSelectedItem = null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const moveToSource = () => {
|
|
38
|
-
if (targetSelectedList.length > 0) {
|
|
39
|
-
sourceList = [...sourceList, ...targetSelectedList];
|
|
40
|
-
targetList = targetList.filter(item => targetSelectedList.indexOf(item) === -1);
|
|
41
|
-
targetSelectedList = [];
|
|
42
|
-
} else if (targetSelectedItem) {
|
|
43
|
-
sourceList = [...sourceList, targetSelectedItem];
|
|
44
|
-
targetList = targetList.filter(item => item !== targetSelectedItem);
|
|
45
|
-
targetSelectedItem = null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
onMount(() => {
|
|
50
|
-
if (echoValue.length > 0) {
|
|
51
|
-
targetList = [...targetList, ...echoValue];
|
|
52
|
-
sourceList = sourceList.filter(item => echoValue.indexOf(item) === -1);
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
$: {
|
|
57
|
-
if (echoData) {
|
|
58
|
-
echoData();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<div class="container" style="height: {height}px; width: {width}px">
|
|
65
|
-
<ListBox class="list-container" {filter} {style} list={sourceList} selectMode="multiple" bind:selectedList={sourceSelectedList}
|
|
66
|
-
{itemRender} bind:selectedItem={sourceSelectedItem}>
|
|
67
|
-
<div slot="header" style={header$style}>
|
|
68
|
-
<slot name="sourceHeader"></slot>
|
|
69
|
-
</div>
|
|
70
|
-
<div slot="footer" style={footer$style}>
|
|
71
|
-
<span>选中:{sourceSelectedList.length}/{sourceList.length}</span>
|
|
72
|
-
</div>
|
|
73
|
-
</ListBox>
|
|
74
|
-
<div class="icon-button-container">
|
|
75
|
-
<IconButton on:click={moveToSource} type="primary" disabled={targetSelectedList.length === 0}>
|
|
76
|
-
<i class="uniface-icon-chevron-left"></i>
|
|
77
|
-
</IconButton>
|
|
78
|
-
<IconButton on:click={moveToTarget} type="primary" disabled={sourceSelectedList.length === 0}>
|
|
79
|
-
<i class="uniface-icon-chevron-right"></i>
|
|
80
|
-
</IconButton>
|
|
81
|
-
</div>
|
|
82
|
-
<ListBox class="list-container" {style} {filter} list={targetList} selectMode="multiple" bind:selectedList={targetSelectedList}
|
|
83
|
-
{itemRender} bind:selectedItem={targetSelectedItem}>
|
|
84
|
-
<div slot="header" style={header$style}>
|
|
85
|
-
<slot name="targetHeader"></slot>
|
|
86
|
-
</div>
|
|
87
|
-
<div slot="footer" style={footer$style}>
|
|
88
|
-
<span>选中:{targetSelectedList.length}/{targetList.length}</span>
|
|
89
|
-
</div>
|
|
90
|
-
</ListBox>
|
|
91
|
-
</div>
|
|
File without changes
|
|
File without changes
|