@ticatec/uniface-element 0.1.35 → 0.1.46
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 +1 -1
- package/dist/app-layout/ClassicLayout.svelte +7 -4
- package/dist/attachment-files/AttachmentFilesField.svelte +1 -1
- package/dist/attachment-files/FileRender.svelte +2 -2
- package/dist/attachment-files/FileUploadPanel.svelte +1 -1
- package/dist/box/Box.svelte +1 -1
- package/dist/box/Box.svelte.d.ts +2 -2
- package/dist/cascade-options-select/CascadeOptionSelect.svelte +1 -1
- package/dist/criteria-field/CriteriaField.svelte +1 -2
- package/dist/criteria-field/CriteriaField.svelte.d.ts +0 -1
- package/dist/data-table/lib/IndicatorColumn.d.ts +1 -1
- package/dist/data-table/parts/FixedHeaderPanel.svelte +1 -1
- package/dist/data-table/parts/FixedRow.svelte +1 -1
- package/dist/date-picker/ScrollBar.svelte +2 -2
- package/dist/dialog/Dialog.svelte +1 -1
- package/dist/form-field/FormField.svelte +6 -6
- package/dist/form-field/FormField.svelte.d.ts +0 -1
- package/dist/form-panel/flex-form/CellField.svelte +1 -2
- package/dist/form-panel/flex-form/CellField.svelte.d.ts +0 -1
- package/dist/form-panel/flex-form/FlexForm.svelte +3 -1
- package/dist/form-panel/flex-form/FlexForm.svelte.d.ts +1 -0
- package/dist/form-panel/flex-row-form/FormContainer.svelte +2 -1
- package/dist/form-panel/flex-row-form/FormContainer.svelte.d.ts +1 -0
- package/dist/form-panel/grid-form/GridField.svelte +8 -6
- package/dist/form-panel/grid-form/GridField.svelte.d.ts +4 -3
- package/dist/form-panel/grid-form/GridForm.svelte +9 -2
- package/dist/form-panel/grid-form/GridForm.svelte.d.ts +2 -0
- package/dist/image-files/ImageFilesField.svelte +1 -1
- package/dist/image-files/ImagePreview.svelte +3 -3
- package/dist/image-files/ImageRender.svelte +2 -2
- package/dist/lib/TreeNodes.d.ts +58 -0
- package/dist/lib/TreeNodes.js +172 -0
- package/dist/list-box/ListBox.svelte +17 -15
- package/dist/lookup-editor/LookupEditor.svelte +1 -1
- package/dist/message-box/MessageBoxBoard.svelte +1 -1
- package/dist/navigator/Navigator.svelte +2 -0
- package/dist/navigator/Navigator.svelte.d.ts +1 -0
- package/dist/search-box/SearchBox.svelte +2 -2
- package/dist/tabs/Tabs.svelte +24 -34
- package/dist/tabs/Tabs.svelte.d.ts +1 -0
- package/dist/tag/Tag.svelte +4 -2
- package/dist/text-editor/PasswordEditor.svelte +3 -3
- package/dist/ticatec-uniface-web.css +80 -75
- package/dist/tree-view/TreeNodeView.svelte +1 -1
- package/dist/tree-view/TreeNodeView.svelte.d.ts +1 -1
- package/dist/tree-view/TreeView.svelte +1 -1
- package/dist/tree-view/TreeView.svelte.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,9 +49,11 @@
|
|
|
49
49
|
<slot name="header"></slot>
|
|
50
50
|
</div>
|
|
51
51
|
<div style="height: 100%; flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: row; position: relative">
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
52
|
+
{#if sidebar}
|
|
53
|
+
<div bind:this={sidebar} style="width: 100%; flex: 0 0 auto; overflow: auto; width: {sidebarWidth}; {minWidth} {maxWidth}">
|
|
54
|
+
<slot name="sidebar"></slot>
|
|
55
|
+
</div>
|
|
56
|
+
{/if}
|
|
55
57
|
{#if sidebarResize}
|
|
56
58
|
<Split direction="vertical" bindingPanel={sidebar}/>
|
|
57
59
|
{/if}
|
|
@@ -62,7 +64,8 @@
|
|
|
62
64
|
{#if sidebarResize}
|
|
63
65
|
<Split direction="vertical" bindingPanel={rightBar} reverse/>
|
|
64
66
|
{/if}
|
|
65
|
-
<div bind:this={rightBar}
|
|
67
|
+
<div bind:this={rightBar}
|
|
68
|
+
style="width: 100%; flex: 0 0 auto; overflow: auto; width: {rightBarWidth}; {rightMinWidth} {rightMaxWidth}">
|
|
66
69
|
<slot name="right-sidebar"></slot>
|
|
67
70
|
</div>
|
|
68
71
|
{/if}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
{#if !disabled && !readonly}
|
|
69
69
|
<div class="editor-action-icon">
|
|
70
|
-
<i class="
|
|
70
|
+
<i class="icon_google_file_upload" aria-hidden="true" on:click={showDialog}></i>
|
|
71
71
|
</div>
|
|
72
72
|
{/if}
|
|
73
73
|
</div>
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
<div class="file-icon">
|
|
51
51
|
<img src={icon} width="64px" height="64px"/>
|
|
52
52
|
<div class="action-icon" style="top: 15px;">
|
|
53
|
-
<i class="
|
|
53
|
+
<i class="icon_google_file_download" ></i>
|
|
54
54
|
</div>
|
|
55
55
|
{#if !readonly}
|
|
56
56
|
<div class="action-icon" style="top: 35px;">
|
|
57
|
-
<i class="
|
|
57
|
+
<i class="icon_google_clear" aria-hidden="true" on:click={removeFile}></i>
|
|
58
58
|
</div>
|
|
59
59
|
{/if}
|
|
60
60
|
</div>
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<input bind:this={fileInput} type="file" {accept} multiple={maxFiles > 1} on:change={handleFilePickup}/>
|
|
118
118
|
</div>
|
|
119
119
|
<div style="margin-bottom: 8px; flex: 0 0 auto; text-align: center">
|
|
120
|
-
<Button type="primary" disabled={files.length >= maxFiles} icon="
|
|
120
|
+
<Button type="primary" disabled={files.length >= maxFiles} icon="icon_google_file_upload" label={btnPickup}
|
|
121
121
|
onClick={showFileDialog}></Button>
|
|
122
122
|
</div>
|
|
123
123
|
<div style="flex: 1 1 auto; overflow: auto; padding: 0 24px">
|
package/dist/box/Box.svelte
CHANGED
package/dist/box/Box.svelte.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare const Box: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithCh
|
|
|
23
23
|
content$style?: string | null;
|
|
24
24
|
header$style?: string | null;
|
|
25
25
|
footer$style?: string | null;
|
|
26
|
-
class?:
|
|
26
|
+
class?: string;
|
|
27
27
|
}, {
|
|
28
28
|
header: {};
|
|
29
29
|
default: {};
|
|
@@ -35,7 +35,7 @@ declare const Box: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithCh
|
|
|
35
35
|
default: {};
|
|
36
36
|
footer: {};
|
|
37
37
|
}, {
|
|
38
|
-
class:
|
|
38
|
+
class: string;
|
|
39
39
|
}, string>;
|
|
40
40
|
type Box = InstanceType<typeof Box>;
|
|
41
41
|
export default Box;
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
</script>
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
<CommonPicker {displayMode} {variant} {style} {compact} className="multiple" dropDownIcon="
|
|
115
|
+
<CommonPicker {displayMode} {variant} {style} {compact} className="multiple" dropDownIcon="icon_google_keyboard_arrow_down"
|
|
116
116
|
bind:showPopup canClean={!mandatory && text!=null} autoFit clean={cleanData} textValue={text??''} {readonly} {disabled}>
|
|
117
117
|
<input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder}
|
|
118
118
|
class="text-editor" bind:value={text} on:blur on:focus/>
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
export let label: string = "Label"
|
|
5
5
|
export let style: string = '';
|
|
6
6
|
export let label$style: string = '';
|
|
7
|
-
export let arrangement: 'vertical' | 'horizontal' = 'vertical' ;
|
|
8
7
|
export let size: '' | 'x15' | 'x20' | 'x25' | 'x30' | 'x35' | 'x40' = '';
|
|
9
8
|
export let labelSuffix: string = ':';
|
|
10
9
|
|
|
11
10
|
let className: string = '';
|
|
12
11
|
|
|
13
12
|
</script>
|
|
14
|
-
<div class="uniface-filter-field {size} {
|
|
13
|
+
<div class="uniface-filter-field {size} {className}" {style} >
|
|
15
14
|
<div class="field-container">
|
|
16
15
|
<div class="field-label" style={label$style}>
|
|
17
16
|
<span>{label}{labelSuffix}</span>
|
|
@@ -21,7 +21,6 @@ declare const CriteriaField: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_P
|
|
|
21
21
|
label?: string;
|
|
22
22
|
style?: string;
|
|
23
23
|
label$style?: string;
|
|
24
|
-
arrangement?: "vertical" | "horizontal";
|
|
25
24
|
size?: "" | "x15" | "x20" | "x25" | "x30" | "x35" | "x40";
|
|
26
25
|
labelSuffix?: string;
|
|
27
26
|
}, {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<span>{column.text}</span>
|
|
98
98
|
{#if column === orderColumn}
|
|
99
99
|
<i style="margin-left: 2px; font-size: 12px; position: absolute; top: 0; right: 4px"
|
|
100
|
-
class={orderDirection===OrderDirection.Ascending ? '
|
|
100
|
+
class={orderDirection===OrderDirection.Ascending ? 'icon_google_keyboard_arrow_up' : 'icon_google_keyboard_arrow_down'}></i>
|
|
101
101
|
{/if}
|
|
102
102
|
</div>
|
|
103
103
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
{#if expandable}
|
|
48
48
|
<div class="expand-icon" style="">
|
|
49
|
-
<i class={row == expandRow ? '
|
|
49
|
+
<i class={row == expandRow ? 'icon_google_folder' : "icon_google_folder_open"} aria-hidden="true" on:click={showInlineData}></i>
|
|
50
50
|
</div>
|
|
51
51
|
{/if}
|
|
52
52
|
{#if indicatorColumn.displayNo}
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<div class="scroll-bar" tabindex="1" on:wheel={handleMouseWheel}>
|
|
75
75
|
<div class="action-bar">
|
|
76
76
|
<div class="arrow-up" class:disabled={!enable}>
|
|
77
|
-
<i class="
|
|
77
|
+
<i class="icon_google_keyboard_arrow_up" on:click={decValue} on:dragstart={(e)=>{e.preventDefault()}}
|
|
78
78
|
on:mousedown={handleMouseDown(-1)} on:mouseup={handleMouseUp} on:mouseleave={handleMouseUp}></i>
|
|
79
79
|
</div>
|
|
80
80
|
</div>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
{/each}
|
|
84
84
|
<div class="action-bar">
|
|
85
85
|
<div class="arrow-down" class:disabled={!enable}>
|
|
86
|
-
<i class="
|
|
86
|
+
<i class="icon_google_keyboard_arrow_downn" on:click={incValue} on:dragstart={(e)=>{e.preventDefault()}}
|
|
87
87
|
on:mousedown={handleMouseDown(1)} on:mouseup={handleMouseUp} on:mouseleave={handleMouseUp}></i>
|
|
88
88
|
</div>
|
|
89
89
|
</div>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<div class="title-bar" on:mousedown={handleMouseDown} on:mouseup={handleMouseUp} aria-hidden="true">
|
|
62
62
|
<div style="flex: 1 1 auto"><span>{title ?? 'New window'}</span></div>
|
|
63
63
|
<div style="flex: 0 0 auto; padding-left: 12px">
|
|
64
|
-
<i class="
|
|
64
|
+
<i class="icon_google_clear dialog-action-button" aria-hidden="true" on:click={close}></i>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
<div class="dialog-content" style={content$style}>
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
export let label$style: string | null = null;
|
|
9
9
|
export let required: boolean = false;
|
|
10
10
|
export let error: string | null = null;
|
|
11
|
-
export let arrangement: 'vertical' | 'horizontal' = 'vertical';
|
|
12
11
|
export let labelSuffix: string = ':';
|
|
13
|
-
export let label$alignment: 'center' | 'top' = 'center'
|
|
12
|
+
export let label$alignment: 'center' | 'top' = 'center';
|
|
13
|
+
|
|
14
14
|
|
|
15
15
|
let className: string = '';
|
|
16
16
|
|
|
17
17
|
</script>
|
|
18
|
-
<div class="uniface-form-field {
|
|
19
|
-
<div class="form-content" style="width: 100
|
|
20
|
-
<div class="field-label" style={label$style} class:vert-top={
|
|
18
|
+
<div class="uniface-form-field {className}" {style}>
|
|
19
|
+
<div class="form-content" style="width: 100%;">
|
|
20
|
+
<div class="field-label" style={label$style} class:vert-top={label$alignment=='top'}>
|
|
21
21
|
{#if required}
|
|
22
22
|
<span class="required-indicator">*</span>
|
|
23
23
|
{/if}
|
|
24
24
|
<span>{label}{labelSuffix}</span>
|
|
25
25
|
</div>
|
|
26
|
-
<div class="field">
|
|
26
|
+
<div class="field" style="">
|
|
27
27
|
<slot/>
|
|
28
28
|
</div>
|
|
29
29
|
{#if !utils.isEmpty(error)}
|
|
@@ -23,7 +23,6 @@ declare const FormField: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Props
|
|
|
23
23
|
label$style?: string | null;
|
|
24
24
|
required?: boolean;
|
|
25
25
|
error?: string | null;
|
|
26
|
-
arrangement?: "vertical" | "horizontal";
|
|
27
26
|
labelSuffix?: string;
|
|
28
27
|
label$alignment?: "center" | "top";
|
|
29
28
|
}, {
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
export let label$style: string = '';
|
|
9
9
|
export let required: boolean = false;
|
|
10
10
|
export let error: string | null = null;
|
|
11
|
-
export let arrangement: 'vertical' | 'horizontal' = 'vertical' ;
|
|
12
11
|
export let labelSuffix: string = ':';
|
|
13
12
|
|
|
14
13
|
let cellCss: string = '';
|
|
@@ -25,6 +24,6 @@
|
|
|
25
24
|
$: cellCss = generateCss(span);
|
|
26
25
|
|
|
27
26
|
</script>
|
|
28
|
-
<FormField class="cell
|
|
27
|
+
<FormField class="form-cell" {label} {labelSuffix} style="{style}; {cellCss}" {label$style} {required} {error}>
|
|
29
28
|
<slot/>
|
|
30
29
|
</FormField>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
export let style: string = '';
|
|
3
|
+
export let fieldLayout: 'vertical' | 'horizontal' = 'vertical';
|
|
4
|
+
|
|
3
5
|
</script>
|
|
4
|
-
<div class="flex-form" {style}>
|
|
6
|
+
<div class="flex-form" class:field-layout-horizontal={fieldLayout=='horizontal'} {style}>
|
|
5
7
|
<div>
|
|
6
8
|
<slot/>
|
|
7
9
|
</div>
|
|
@@ -18,6 +18,7 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
18
18
|
} : {});
|
|
19
19
|
declare const FlexForm: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
20
|
style?: string;
|
|
21
|
+
fieldLayout?: "vertical" | "horizontal";
|
|
21
22
|
}, {
|
|
22
23
|
default: {};
|
|
23
24
|
}>, {
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
export {className as class };
|
|
4
4
|
export let style: string = '';
|
|
5
|
+
export let fieldLayout: 'vertical' | 'horizontal' = 'vertical';
|
|
5
6
|
|
|
6
7
|
let className: string = "";
|
|
7
8
|
|
|
8
9
|
</script>
|
|
9
|
-
<div class="flex-row-form" {style}>
|
|
10
|
+
<div class="flex-row-form" class:field-layout-horizontal={fieldLayout=='horizontal'} {style}>
|
|
10
11
|
<div>
|
|
11
12
|
<slot/>
|
|
12
13
|
</div>
|
|
@@ -19,6 +19,7 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
19
19
|
declare const FormContainer: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
20
|
class?: string;
|
|
21
21
|
style?: string;
|
|
22
|
+
fieldLayout?: "vertical" | "horizontal";
|
|
22
23
|
}, {
|
|
23
24
|
default: {};
|
|
24
25
|
}>, {
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
export let label: string = "Label:"
|
|
5
5
|
export let label$style: string = '';
|
|
6
6
|
export let required: boolean = false;
|
|
7
|
-
export let error: string = null;
|
|
7
|
+
export let error: string | null = null;
|
|
8
8
|
export let arrangement: 'vertical' | 'horizontal' = 'vertical' ;
|
|
9
9
|
export let rowSpan: number = 1;
|
|
10
10
|
export let colSpan: number = 1;
|
|
11
|
-
export let row: number = null;
|
|
12
|
-
export let col: number = null;
|
|
11
|
+
export let row: number | null = null;
|
|
12
|
+
export let col: number | null = null;
|
|
13
|
+
|
|
14
|
+
export let height: string | undefined = undefined;
|
|
13
15
|
|
|
14
16
|
export let labelSuffix: string = ':';
|
|
15
17
|
|
|
@@ -18,12 +20,12 @@
|
|
|
18
20
|
$: {
|
|
19
21
|
style = rowSpan > 1 ? `grid-row-end: span ${rowSpan};` : '';
|
|
20
22
|
style += colSpan > 1 ? `grid-column-end: span ${colSpan};` : '';
|
|
21
|
-
style += row != null ? `grid-row-start:
|
|
22
|
-
style += col != null ? `grid-column-start:
|
|
23
|
+
style += row != null ? `grid-row-start: ${row};` : '';
|
|
24
|
+
style += col != null ? `grid-column-start: ${col};` : '';
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
</script>
|
|
27
|
-
<FormField class="cell
|
|
29
|
+
<FormField class="form-cell" {label$style} {labelSuffix} {style} {label} {required} {error} {arrangement} {height}>
|
|
28
30
|
<slot/>
|
|
29
31
|
</FormField>
|
|
@@ -20,12 +20,13 @@ declare const GridField: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Props
|
|
|
20
20
|
label?: string;
|
|
21
21
|
label$style?: string;
|
|
22
22
|
required?: boolean;
|
|
23
|
-
error?: string;
|
|
23
|
+
error?: string | null;
|
|
24
24
|
arrangement?: "vertical" | "horizontal";
|
|
25
25
|
rowSpan?: number;
|
|
26
26
|
colSpan?: number;
|
|
27
|
-
row?: number;
|
|
28
|
-
col?: number;
|
|
27
|
+
row?: number | null;
|
|
28
|
+
col?: number | null;
|
|
29
|
+
height?: string | undefined;
|
|
29
30
|
labelSuffix?: string;
|
|
30
31
|
}, {
|
|
31
32
|
default: {};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
|
|
2
3
|
export let style: string = '';
|
|
4
|
+
export let columns: number = 6; //默认6列
|
|
5
|
+
export let fieldLayout: 'vertical' | 'horizontal' = 'vertical';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
$: gridStyle = `grid-template-columns: repeat(${columns}, 1fr)`
|
|
9
|
+
|
|
3
10
|
</script>
|
|
4
|
-
<div class="grid-form" {style}>
|
|
5
|
-
<div>
|
|
11
|
+
<div class="grid-form" class:field-layout-horizontal={fieldLayout=='horizontal'} {style}>
|
|
12
|
+
<div style="{gridStyle}">
|
|
6
13
|
<slot/>
|
|
7
14
|
</div>
|
|
8
15
|
</div>
|
|
@@ -18,6 +18,8 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
18
18
|
} : {});
|
|
19
19
|
declare const GridForm: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
20
|
style?: string;
|
|
21
|
+
columns?: number;
|
|
22
|
+
fieldLayout?: "vertical" | "horizontal";
|
|
21
23
|
}, {
|
|
22
24
|
default: {};
|
|
23
25
|
}>, {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</div>
|
|
81
81
|
{#if !disabled && !readonly}
|
|
82
82
|
<div class="editor-action-icon ">
|
|
83
|
-
<i class="
|
|
83
|
+
<i class="icon_google_file_upload" aria-hidden="true" on:click={showDialog}></i>
|
|
84
84
|
</div>
|
|
85
85
|
{/if}
|
|
86
86
|
</div>
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
</div>
|
|
90
90
|
<!-- 顶部工具栏 -->
|
|
91
91
|
<div class="toolbar" on:click|stopPropagation aria-hidden="true">
|
|
92
|
-
<IconButton icon="
|
|
93
|
-
<IconButton icon="
|
|
94
|
-
<IconButton icon="
|
|
92
|
+
<IconButton icon="icon_google_zoom_in" type="default" onClick={zoomIn}></IconButton>
|
|
93
|
+
<IconButton icon="icon_google_zoom_out" type="default" onClick={zoomOut}></IconButton>
|
|
94
|
+
<IconButton icon="icon_google_cancel" type="default" onClick={()=>{visible = false}}></IconButton>
|
|
95
95
|
</div>
|
|
96
96
|
</div>
|
|
97
97
|
</div>
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
<div class="img-overlay">
|
|
22
22
|
<div>
|
|
23
23
|
<div class="action-icon" style="top: 15px;">
|
|
24
|
-
<i class="
|
|
24
|
+
<i class="icon_google_remove_red_eye" aria-hidden="true" on:click={()=>{onPreview?.(file)}}></i>
|
|
25
25
|
</div>
|
|
26
26
|
{#if !readonly}
|
|
27
27
|
<div class="action-icon" style="top: 35px;">
|
|
28
|
-
<i class="
|
|
28
|
+
<i class="icon_google_delete" aria-hidden="true" on:click={removeFile}></i>
|
|
29
29
|
</div>
|
|
30
30
|
{/if}
|
|
31
31
|
</div>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare function compareNumber(a: number, b: number): 0 | 1 | -1;
|
|
2
|
+
export type TreeNode<T> = {
|
|
3
|
+
item: T;
|
|
4
|
+
expand: boolean;
|
|
5
|
+
children?: TreeNode<T>[];
|
|
6
|
+
};
|
|
7
|
+
export type CheckIsRoot<T> = (data: T) => boolean;
|
|
8
|
+
export type CompareFun<T> = (o1: T, o2: T) => number | undefined;
|
|
9
|
+
export type GetText<T> = (data: T) => string;
|
|
10
|
+
export interface TreeNodeOptions<T> {
|
|
11
|
+
keyField?: keyof T;
|
|
12
|
+
textField?: keyof T | GetText<T>;
|
|
13
|
+
parentKeyField?: keyof T;
|
|
14
|
+
checkIsRoot: CheckIsRoot<T>;
|
|
15
|
+
compareFun: CompareFun<T>;
|
|
16
|
+
expendDeep?: number;
|
|
17
|
+
}
|
|
18
|
+
export default class TreeNodes<T> {
|
|
19
|
+
#private;
|
|
20
|
+
protected readonly checkIsRoot: CheckIsRoot<T>;
|
|
21
|
+
protected readonly keyField: keyof T;
|
|
22
|
+
protected readonly parentKeyField: keyof T;
|
|
23
|
+
protected readonly textField: keyof T | GetText<T>;
|
|
24
|
+
protected nodeMap: Map<any, TreeNode<T>>;
|
|
25
|
+
protected compareFun: any;
|
|
26
|
+
protected expendDeep: number;
|
|
27
|
+
constructor(options: TreeNodeOptions<T>);
|
|
28
|
+
setData(list: Array<T>): void;
|
|
29
|
+
private appendNode;
|
|
30
|
+
private collectExpandedNodes;
|
|
31
|
+
/**
|
|
32
|
+
* 获取展开的展示列表
|
|
33
|
+
*/
|
|
34
|
+
getHierarchyList(): Array<TreeNode<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* 获取节点
|
|
37
|
+
*/
|
|
38
|
+
get nodes(): Array<TreeNode<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* 增加一个新节点
|
|
41
|
+
* @param item
|
|
42
|
+
*/
|
|
43
|
+
append(item: T): void;
|
|
44
|
+
/**
|
|
45
|
+
* 替换一个节点的数据
|
|
46
|
+
* @param item
|
|
47
|
+
*/
|
|
48
|
+
replace(item: T): void;
|
|
49
|
+
remove(item: T): void;
|
|
50
|
+
/**
|
|
51
|
+
* 将一个节点移动到另外一个节点下
|
|
52
|
+
* @param item
|
|
53
|
+
* @param parentId
|
|
54
|
+
*/
|
|
55
|
+
moveTo(item: T, parentId: string): void;
|
|
56
|
+
private extractChildrenDirectories;
|
|
57
|
+
extractDirectories(exclusiveValue: any): TreeNode<T>[];
|
|
58
|
+
}
|