@ticatec/uniface-element 0.1.23 → 0.1.30
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/accordion/Accordion.svelte +9 -1
- package/dist/accordion/AccordionItemView.svelte +14 -4
- package/dist/accordion/AccordionItemView.svelte.d.ts +1 -0
- package/dist/app-layout/ColumnsLayout.svelte +61 -0
- package/dist/app-layout/ColumnsLayout.svelte.d.ts +42 -0
- package/dist/app-layout/RowsLayout.svelte +61 -0
- package/dist/app-layout/RowsLayout.svelte.d.ts +42 -0
- package/dist/app-top-bar/AppTopBar.svelte +9 -13
- package/dist/app-top-bar/AppTopBar.svelte.d.ts +1 -1
- package/dist/breadcrumbs/Breadcrumb.d.ts +4 -0
- package/dist/breadcrumbs/Breadcrumb.js +1 -0
- package/dist/breadcrumbs/Breadcrumbs.svelte +21 -0
- package/dist/breadcrumbs/Breadcrumbs.svelte.d.ts +24 -0
- package/dist/breadcrumbs/index.d.ts +4 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/button/Button.svelte +2 -2
- package/dist/card/Card.svelte +3 -1
- package/dist/card/Card.svelte.d.ts +1 -0
- package/dist/card/CommonCardActionBar.svelte +4 -2
- package/dist/card/CommonCardActionBar.svelte.d.ts +1 -0
- package/dist/common/CommonPicker.svelte +5 -2
- package/dist/common/Popover.svelte +9 -2
- package/dist/common-editor/CommonEditor.svelte +8 -7
- package/dist/common-range-editor/CommonRangeEditor.svelte +1 -5
- package/dist/date-picker/DatePicker.svelte +2 -2
- package/dist/date-picker/DateTimePicker.svelte +1 -1
- package/dist/date-range/DateRangeEditor.svelte +1 -1
- package/dist/drawer/Drawer.svelte +9 -17
- package/dist/drawer/Drawer.svelte.d.ts +3 -7
- package/dist/memo-editor/MemoEditor.svelte +1 -1
- package/dist/nav-menu/MenuItem.d.ts +1 -1
- package/dist/options-multi-select/OptionsMultiSelect.svelte +1 -1
- package/dist/options-select/OptionsSelect.svelte +1 -1
- package/dist/prompts-text-editor/PromptsTextEditor.svelte +9 -9
- package/dist/split/Split.svelte +1 -1
- package/dist/tabs/Tabs.svelte +2 -2
- package/dist/tag/Tag.svelte +1 -1
- package/dist/ticatec-uniface-web.css +178 -93
- package/dist/unit-number-editor/UnitNumberEditor.svelte +6 -5
- package/package.json +14 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type AccordionItem from "./AccordionItem";
|
|
4
4
|
import Accordion from "./AccordionItemView.svelte";
|
|
5
|
+
import {onMount} from "svelte";
|
|
5
6
|
|
|
6
7
|
export let style: string = '';
|
|
7
8
|
export {className as class};
|
|
@@ -14,6 +15,13 @@
|
|
|
14
15
|
|
|
15
16
|
let openSet: Set<AccordionItem> = new Set();
|
|
16
17
|
|
|
18
|
+
onMount(() => {
|
|
19
|
+
if (exclusive && activeItem == null) {
|
|
20
|
+
openSet.add(accordions[0]);
|
|
21
|
+
accordions = [...accordions];
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
|
|
17
25
|
const handleAccordionClick = (accordion: AccordionItem) => (event: MouseEvent) => {
|
|
18
26
|
if (exclusive) {
|
|
19
27
|
if (activeItem != accordion) {
|
|
@@ -36,7 +44,7 @@
|
|
|
36
44
|
|
|
37
45
|
<div class="uniface-accordion-panel {className}" {style} class:compact>
|
|
38
46
|
{#each accordions as accordion}
|
|
39
|
-
<Accordion title={accordion.title} isOpen={openSet.has(accordion)} onClick={handleAccordionClick(accordion)}>
|
|
47
|
+
<Accordion title={accordion.title} isOpen={openSet.has(accordion)} {exclusive} onClick={handleAccordionClick(accordion)}>
|
|
40
48
|
<svelte:component this={accordion.component} {...accordion.params}/>
|
|
41
49
|
</Accordion>
|
|
42
50
|
{/each}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
export let onClick: MouseClickHandler = null as unknown as MouseClickHandler;
|
|
7
7
|
export let header: any = null;
|
|
8
8
|
|
|
9
|
+
export let exclusive: boolean;
|
|
10
|
+
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<style>
|
|
@@ -16,14 +18,22 @@
|
|
|
16
18
|
<div class="accordion">
|
|
17
19
|
<div class="header" aria-hidden="true" on:click={onClick}>
|
|
18
20
|
{#if header}
|
|
19
|
-
<svelte:component this={header} {title} {isOpen}/>
|
|
21
|
+
<svelte:component this={header} {title} {isOpen}/> <!-- TODO 自定义每个条目的标题 -->
|
|
20
22
|
{:else}
|
|
21
|
-
<div style="flex: 0 0 auto; padding-right: 8px">
|
|
22
|
-
<i class="{isOpen ? 'uniface-icon-chevron-down' : 'uniface-icon-chevron-right'}"></i>
|
|
23
|
-
</div>
|
|
24
23
|
<div style="flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
|
|
25
24
|
<span>{title}</span>
|
|
26
25
|
</div>
|
|
26
|
+
{#if exclusive}
|
|
27
|
+
{#if isOpen}
|
|
28
|
+
<div style="flex: 0 0 auto;">
|
|
29
|
+
<i class="icon_google_folder_open"></i>
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
32
|
+
{:else}
|
|
33
|
+
<div style="flex: 0 0 auto;">
|
|
34
|
+
<i class="{isOpen ? 'icon_google_keyboard_arrow_up' : 'icon_google_keyboard_arrow_down'}"></i>
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
27
37
|
{/if}
|
|
28
38
|
</div>
|
|
29
39
|
{#if isOpen}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Split from "../split";
|
|
3
|
+
import {onMount} from "svelte";
|
|
4
|
+
|
|
5
|
+
export let width: string = '100%';
|
|
6
|
+
export let height: string = '100%';
|
|
7
|
+
|
|
8
|
+
export let leftWidth: string | null = null;
|
|
9
|
+
|
|
10
|
+
export let rightWidth: string | null = null;
|
|
11
|
+
|
|
12
|
+
export let leftMin: string | null = null;
|
|
13
|
+
|
|
14
|
+
export let leftMax: string | null = null;
|
|
15
|
+
|
|
16
|
+
export let rightMin: string | null = null;
|
|
17
|
+
|
|
18
|
+
export let rightMax: string | null = null;
|
|
19
|
+
|
|
20
|
+
export let leftResize: boolean = false;
|
|
21
|
+
|
|
22
|
+
export let rightResize: boolean = false;
|
|
23
|
+
|
|
24
|
+
$: colWidth = $$slots.right ? '25%' : '50%'
|
|
25
|
+
|
|
26
|
+
let leftPanel: any;
|
|
27
|
+
let rightPanel: any;
|
|
28
|
+
|
|
29
|
+
const generateStyle = (attr: string, v: string | null): string => {
|
|
30
|
+
return v ? `${attr}: ${v};` : ''
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let leftStyle: string;
|
|
34
|
+
let rightStyle: string;
|
|
35
|
+
|
|
36
|
+
onMount(()=> {
|
|
37
|
+
leftStyle = `${generateStyle('min-width', leftMin)} ${generateStyle('max-width', leftMax)} ${generateStyle('width', leftWidth ?? colWidth)}`;
|
|
38
|
+
rightStyle = `${generateStyle('min-width', rightMin)} ${generateStyle('max-width', rightMax)} ${generateStyle('width', rightWidth ?? colWidth)}`;
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
</script>
|
|
43
|
+
<div style="display: flex; flex-direction: row; flex-wrap: nowrap; width: {width}; height: {height}">
|
|
44
|
+
<div bind:this={leftPanel} style="flex: 0 0 auto; {leftStyle}">
|
|
45
|
+
<slot name="left"></slot>
|
|
46
|
+
</div>
|
|
47
|
+
{#if leftResize}
|
|
48
|
+
<Split bindingPanel={leftPanel}/>
|
|
49
|
+
{/if}
|
|
50
|
+
<div style="flex: 1 1 auto;">
|
|
51
|
+
<slot/>
|
|
52
|
+
</div>
|
|
53
|
+
{#if $$slots.right}
|
|
54
|
+
{#if rightResize}
|
|
55
|
+
<Split bindingPanel={rightPanel} reverse/>
|
|
56
|
+
{/if}
|
|
57
|
+
<div bind:this={rightPanel} style="flex: 0 0 auto; {rightStyle}">
|
|
58
|
+
<slot name="right"/>
|
|
59
|
+
</div>
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
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
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const ColumnsLayout: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
width?: string;
|
|
21
|
+
height?: string;
|
|
22
|
+
leftWidth?: string | null;
|
|
23
|
+
rightWidth?: string | null;
|
|
24
|
+
leftMin?: string | null;
|
|
25
|
+
leftMax?: string | null;
|
|
26
|
+
rightMin?: string | null;
|
|
27
|
+
rightMax?: string | null;
|
|
28
|
+
leftResize?: boolean;
|
|
29
|
+
rightResize?: boolean;
|
|
30
|
+
}, {
|
|
31
|
+
left: {};
|
|
32
|
+
default: {};
|
|
33
|
+
right: {};
|
|
34
|
+
}>, {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
}, {
|
|
37
|
+
left: {};
|
|
38
|
+
default: {};
|
|
39
|
+
right: {};
|
|
40
|
+
}, {}, string>;
|
|
41
|
+
type ColumnsLayout = InstanceType<typeof ColumnsLayout>;
|
|
42
|
+
export default ColumnsLayout;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Split from "../split";
|
|
3
|
+
import {onMount} from "svelte";
|
|
4
|
+
|
|
5
|
+
export let width: string = '100%';
|
|
6
|
+
export let height: string = '100%';
|
|
7
|
+
|
|
8
|
+
export let topHeight: string | null = null;
|
|
9
|
+
|
|
10
|
+
export let bottomHeight: string | null = null;
|
|
11
|
+
|
|
12
|
+
export let topMin: string | null = null;
|
|
13
|
+
|
|
14
|
+
export let topMax: string | null = null;
|
|
15
|
+
|
|
16
|
+
export let bottomMin: string | null = null;
|
|
17
|
+
|
|
18
|
+
export let bottomMax: string | null = null;
|
|
19
|
+
|
|
20
|
+
export let topResize: boolean = false;
|
|
21
|
+
|
|
22
|
+
export let bottomResize: boolean = false;
|
|
23
|
+
|
|
24
|
+
$: rowHeight = $$slots.bottom ? '25%' : '50%'
|
|
25
|
+
|
|
26
|
+
let topPanel: any;
|
|
27
|
+
let bottomPanel: any;
|
|
28
|
+
|
|
29
|
+
const generateStyle = (attr: string, v: string | null): string => {
|
|
30
|
+
return v ? `${attr}: ${v};` : ''
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let topStyle: string = '';
|
|
34
|
+
let bottomStyle: string = '';
|
|
35
|
+
|
|
36
|
+
onMount(() => {
|
|
37
|
+
topStyle = `${generateStyle('min-height', topMin)} ${generateStyle('max-height', topMax)} ${generateStyle('height', topHeight ?? rowHeight)}`;
|
|
38
|
+
bottomStyle = `${generateStyle('min-height', bottomMin)} ${generateStyle('max-height', bottomMax)} ${generateStyle('height', bottomHeight ?? rowHeight)}`;
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
</script>
|
|
43
|
+
<div style="display: flex; flex-direction: column; flex-wrap: nowrap; width: {width}; height: {height}">
|
|
44
|
+
<div bind:this={topPanel} style="flex: 0 0 auto; {topStyle}">
|
|
45
|
+
<slot name="top"></slot>
|
|
46
|
+
</div>
|
|
47
|
+
{#if topResize}
|
|
48
|
+
<Split bindingPanel={topPanel} direction="horizontal"/>
|
|
49
|
+
{/if}
|
|
50
|
+
<div style="flex: 1 1 auto;">
|
|
51
|
+
<slot/>
|
|
52
|
+
</div>
|
|
53
|
+
{#if $$slots.bottom}
|
|
54
|
+
{#if bottomResize}
|
|
55
|
+
<Split bindingPanel={bottomPanel} reverse direction="horizontal"/>
|
|
56
|
+
{/if}
|
|
57
|
+
<div bind:this={bottomPanel} style="flex: 0 0 auto; {bottomStyle}">
|
|
58
|
+
<slot name="bottom"/>
|
|
59
|
+
</div>
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
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
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const RowsLayout: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
width?: string;
|
|
21
|
+
height?: string;
|
|
22
|
+
topHeight?: string | null;
|
|
23
|
+
bottomHeight?: string | null;
|
|
24
|
+
topMin?: string | null;
|
|
25
|
+
topMax?: string | null;
|
|
26
|
+
bottomMin?: string | null;
|
|
27
|
+
bottomMax?: string | null;
|
|
28
|
+
topResize?: boolean;
|
|
29
|
+
bottomResize?: boolean;
|
|
30
|
+
}, {
|
|
31
|
+
top: {};
|
|
32
|
+
default: {};
|
|
33
|
+
bottom: {};
|
|
34
|
+
}>, {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
}, {
|
|
37
|
+
top: {};
|
|
38
|
+
default: {};
|
|
39
|
+
bottom: {};
|
|
40
|
+
}, {}, string>;
|
|
41
|
+
type RowsLayout = InstanceType<typeof RowsLayout>;
|
|
42
|
+
export default RowsLayout;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
export let title: string
|
|
2
|
+
export let title: string;
|
|
3
3
|
export let style: string = '';
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div class="uniface-
|
|
6
|
+
<div class="uniface-top-bar" {style}>
|
|
7
7
|
{#if $$slots['home']}
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
<div class="bar-home">
|
|
9
|
+
<slot name="home">
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
</slot>
|
|
12
|
+
</div>
|
|
13
13
|
{/if}
|
|
14
|
-
<div class="
|
|
14
|
+
<div class="main-content">
|
|
15
15
|
<slot>
|
|
16
16
|
<span>{title}</span>
|
|
17
17
|
</slot>
|
|
18
18
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<slot name="right">
|
|
22
|
-
</slot>
|
|
23
|
-
</div>
|
|
24
|
-
{/if}
|
|
19
|
+
<slot name="right">
|
|
20
|
+
</slot>
|
|
25
21
|
</div>
|
|
@@ -17,7 +17,7 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
17
17
|
children?: any;
|
|
18
18
|
} : {});
|
|
19
19
|
declare const AppTopBar: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
title
|
|
20
|
+
title: string;
|
|
21
21
|
style?: string;
|
|
22
22
|
}, {
|
|
23
23
|
home: {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// 定义组件属性
|
|
3
|
+
import type Breadcrumb from "./Breadcrumb";
|
|
4
|
+
|
|
5
|
+
export let items: Array<Breadcrumb> = []; //
|
|
6
|
+
export let separator: string = "/"; // 分隔符
|
|
7
|
+
export let onItemClick: (item: any) => (event: MouseEvent) => void;
|
|
8
|
+
|
|
9
|
+
export let style: string = '';
|
|
10
|
+
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
<div class="uniface-breadcrumbs" {style}>
|
|
15
|
+
{#each items as item}
|
|
16
|
+
<div>
|
|
17
|
+
<span>{separator}</span>
|
|
18
|
+
<span aria-hidden="true" class="breadcrumb" on:click={onItemClick(item.data)}>{item.label}</span>
|
|
19
|
+
</div>
|
|
20
|
+
{/each}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type Breadcrumb from "./Breadcrumb";
|
|
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 Breadcrumbs: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
items?: Array<Breadcrumb>;
|
|
17
|
+
separator?: string;
|
|
18
|
+
onItemClick: (item: any) => (event: MouseEvent) => void;
|
|
19
|
+
style?: string;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type Breadcrumbs = InstanceType<typeof Breadcrumbs>;
|
|
24
|
+
export default Breadcrumbs;
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
<div {style} class="uniface-button common-button {variant} {size} {type}" aria-hidden="true" class:disabled
|
|
31
31
|
on:click={handleClick}>
|
|
32
32
|
{#if icon != null}
|
|
33
|
-
<i
|
|
33
|
+
<i class={icon}></i>
|
|
34
34
|
{/if}
|
|
35
35
|
<slot>
|
|
36
36
|
{#if label != null && label.length > 0}
|
|
37
|
-
<span>{label}</span>
|
|
37
|
+
<span style="flex: 1 1 auto">{label}</span>
|
|
38
38
|
{/if}
|
|
39
39
|
</slot>
|
|
40
40
|
</div>
|
package/dist/card/Card.svelte
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export let actions: Array<CardAction> = [];
|
|
10
10
|
export let variant: 'plain' | '3d' = 'plain';
|
|
11
11
|
|
|
12
|
+
export let iconColor: string | null = null;
|
|
13
|
+
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
16
|
<div class="uniface-card" class:shadowBox={variant=='3d'}>
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
<slot/>
|
|
27
29
|
</div>
|
|
28
30
|
{#if actions && actions.length > 0}
|
|
29
|
-
<CommonCardActionBar {actions}/>
|
|
31
|
+
<CommonCardActionBar color={iconColor} {actions}/>
|
|
30
32
|
{:else }
|
|
31
33
|
{#if $$slots['action-bar']}
|
|
32
34
|
<div class="card-action-bar">
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import utils from "../common/utils";
|
|
4
4
|
|
|
5
5
|
export let actions: Array<CardAction>;
|
|
6
|
-
|
|
6
|
+
export let color: string | null = null;
|
|
7
7
|
|
|
8
8
|
let clickEnable = true;
|
|
9
9
|
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
$: fontColor = color ? `color: ${color}` : '';
|
|
20
|
+
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
|
-
<div class="card-action-bar simple">
|
|
23
|
+
<div class="card-action-bar simple" style="{fontColor}">
|
|
22
24
|
{#each actions as action}
|
|
23
25
|
<div class:disabled={action.disabled} class="action-item">
|
|
24
26
|
{#if action.icon}
|
|
@@ -14,6 +14,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
14
14
|
}
|
|
15
15
|
declare const CommonCardActionBar: $$__sveltets_2_IsomorphicComponent<{
|
|
16
16
|
actions: Array<CardAction>;
|
|
17
|
+
color?: string | null;
|
|
17
18
|
}, {
|
|
18
19
|
[evt: string]: CustomEvent<any>;
|
|
19
20
|
}, {}, {}, string>;
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
</script>
|
|
30
30
|
{#if displayMode === DisplayMode.View}
|
|
31
31
|
<div class="uniface-display-field">
|
|
32
|
-
<
|
|
32
|
+
<div class="content">
|
|
33
|
+
<span>{textValue}</span>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
33
36
|
</div>
|
|
34
37
|
{:else}
|
|
35
38
|
<div bind:this={editorElement} class="uniface-common-editor {variant} uniface-common-picker {className}" tabindex="-1" class:compact
|
|
@@ -41,7 +44,7 @@
|
|
|
41
44
|
<slot></slot>
|
|
42
45
|
{#if canClean && textValue && textValue.length > 0}
|
|
43
46
|
<div class="uniface-editor-clean-icon">
|
|
44
|
-
<i class="
|
|
47
|
+
<i class="icon_google_clear clickable " aria-hidden="true" on:click={clean}></i>
|
|
45
48
|
</div>
|
|
46
49
|
{/if}
|
|
47
50
|
</div>
|
|
@@ -74,9 +74,16 @@
|
|
|
74
74
|
window.addEventListener("resize", updatePosition);
|
|
75
75
|
document.addEventListener("scroll", updatePosition, {passive: false});
|
|
76
76
|
const interval = setInterval(checkPosition, 10); // 每 100ms 检测一次
|
|
77
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
78
|
+
for (let entry of entries) {
|
|
79
|
+
updatePosition();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
resizeObserver.observe(contentPanel);
|
|
77
83
|
return () => {
|
|
78
84
|
window.removeEventListener("resize", updatePosition);
|
|
79
85
|
document.removeEventListener("scroll", updatePosition);
|
|
86
|
+
resizeObserver.disconnect();
|
|
80
87
|
clearInterval(interval);
|
|
81
88
|
};
|
|
82
89
|
});
|
|
@@ -95,8 +102,8 @@
|
|
|
95
102
|
</script>
|
|
96
103
|
<svelte:window bind:innerWidth={w} bind:innerHeight={h}/>
|
|
97
104
|
<Portal target="body">
|
|
98
|
-
<div class="uniface-popover-wrapper" class:hidden style="{vertPos}; left: {position.left-margin}px; width: {position.width}px; ">
|
|
99
|
-
<div class="uniface-popover"
|
|
105
|
+
<div class="uniface-popover-wrapper" class:hidden style="{vertPos}; height: auto; left: {position.left-margin}px; width: {position.width}px; ">
|
|
106
|
+
<div class="uniface-popover" use:clickOutside
|
|
100
107
|
on:outerClick={close}>
|
|
101
108
|
<div bind:this={contentPanel} style="{horzPos}">
|
|
102
109
|
<div class="contents" style="{style}">
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
{:else}
|
|
44
44
|
<div class:compact class="uniface-common-editor {variant} {className}" tabindex="-1"
|
|
45
45
|
style="{style}">
|
|
46
|
-
{#if
|
|
47
|
-
<div class="editor-prefix" tabindex="-1" style="flex: 0 0 auto;">
|
|
48
|
-
<span>{prefix}</span>
|
|
49
|
-
</div>
|
|
50
|
-
{:else if $$slots['leading-icon'] && hasLeadingIcon}
|
|
46
|
+
{#if $$slots['leading-icon'] && hasLeadingIcon}
|
|
51
47
|
<div class="editor-embed-icon" style="flex: 0 0 auto;">
|
|
52
48
|
<slot name="leading-icon"/>
|
|
53
49
|
</div>
|
|
50
|
+
{:else if !utils.isEmpty(prefix)}
|
|
51
|
+
<div class="editor-prefix" tabindex="-1" style="flex: 0 0 auto;">
|
|
52
|
+
<span>{prefix}</span>
|
|
53
|
+
</div>
|
|
54
54
|
{/if}
|
|
55
55
|
{#if disabled || readonly}
|
|
56
56
|
<input style="flex: 1 1 auto" {value} {disabled} {readonly} {placeholder}>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<div style="position: relative; flex: 1 1 auto">
|
|
59
59
|
<slot/>
|
|
60
60
|
<div class="uniface-editor-clean-icon {showActionIcon ? '' : 'hidden'}">
|
|
61
|
-
<i class="
|
|
61
|
+
<i class="icon_google_clear clickable" aria-hidden="true" on:click={clean}></i>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
64
|
{/if}
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
<div class="editor-suffix" style="flex: 0 0 auto;">
|
|
67
67
|
<span>{suffix}</span>
|
|
68
68
|
</div>
|
|
69
|
-
{
|
|
69
|
+
{/if}
|
|
70
|
+
{#if $$slots['trailing-icon'] && hasTrailingIcon}
|
|
70
71
|
<div class="editor-embed-icon" style="flex: 0 0 auto;">
|
|
71
72
|
<slot name="trailing-icon"/>
|
|
72
73
|
</div>
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import utils from "../common/utils";
|
|
5
|
-
import Icon from "../icon";
|
|
6
|
-
|
|
7
3
|
export let variant: '' | 'plain' | 'outlined' | 'filled' = '';
|
|
8
4
|
export let compact: boolean = false;
|
|
9
5
|
export {className as class};
|
|
@@ -22,7 +18,7 @@
|
|
|
22
18
|
<div class="divider"></div>
|
|
23
19
|
<slot name="to"/>
|
|
24
20
|
<div class="uniface-editor-clean-icon {showActionIcon ? '' : 'hidden'}">
|
|
25
|
-
<i class="
|
|
21
|
+
<i class="icon_google_clear clickable" aria-hidden="true" on:click={clean}></i>
|
|
26
22
|
</div>
|
|
27
23
|
</div>
|
|
28
24
|
<slot/>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const handleCalendarSelect = (d: dayjs.Dayjs) => {
|
|
49
|
-
value = d;
|
|
49
|
+
value = d.toDate();
|
|
50
50
|
showPopup = false;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
</script>
|
|
80
80
|
|
|
81
|
-
<CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="
|
|
81
|
+
<CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="icon_google_event_available"
|
|
82
82
|
bind:showPopup canClean={!mandatory && value!=null} autoFit={false} clean={cleanData} {textValue} {readonly} {disabled}>
|
|
83
83
|
|
|
84
84
|
<input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder} on:keydown={handleKeyDown}
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
|
|
116
116
|
</script>
|
|
117
117
|
|
|
118
|
-
<CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="
|
|
118
|
+
<CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="icon_google_access_time"
|
|
119
119
|
bind:showPopup canClean={!mandatory && value!=null} autoFit={false} clean={cleanData} {textValue} {readonly} {disabled}>
|
|
120
120
|
|
|
121
121
|
<input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder} on:keydown={handleKeyDown}
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<input style="width: 100%; text-align: center" readonly on:click={showPopover} value={textTo}/>
|
|
67
67
|
</svelte:fragment>
|
|
68
68
|
<svelte:fragment>
|
|
69
|
-
<i class="
|
|
69
|
+
<i class="icon_google_event_note action-icon" aria-hidden="true" on:click={showPopover}></i>
|
|
70
70
|
</svelte:fragment>
|
|
71
71
|
</CommonRangeEditor>
|
|
72
72
|
|