@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
|
@@ -1,41 +1,36 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
|
|
3
3
|
import {OrderDirection} from "../lib/OrderDirection";
|
|
4
|
-
import type
|
|
5
|
-
import type ActionsColumn from "../lib/ActionsColumn";
|
|
6
|
-
import type {CompareFunction} from "../lib/CompareFunction";
|
|
7
|
-
import {type SelectionEventHandler, SelectionMode, type TableEventHandler} from "../UniDataTable";
|
|
8
|
-
import FixedHeaderPanel from "./FixedHeaderPanel.svelte";
|
|
4
|
+
import {type TableEventHandler} from "../UniDataTable";
|
|
9
5
|
import type DataColumn from "../lib/DataColumn";
|
|
10
6
|
|
|
11
|
-
export let actionsColumn: ActionsColumn | null;
|
|
12
|
-
export let indicatorColumn: IndicatorColumn;
|
|
13
7
|
export let scrollLeft: number = 0;
|
|
14
|
-
export let handleToggleSelectAll: SelectionEventHandler;
|
|
15
8
|
export let handleWidthChange: TableEventHandler;
|
|
16
|
-
export let sortData: (compareFun: CompareFunction, descending: boolean) => void;
|
|
17
9
|
export let dataCols: Array<any>;
|
|
18
|
-
export let frozenCols: Array<DataColumn> = [];
|
|
19
|
-
export let selectionMode: SelectionMode;
|
|
20
|
-
|
|
21
10
|
export let width: number = 0;
|
|
11
|
+
export let hasWhitespace: boolean = false;
|
|
12
|
+
export let handleCellClick: (col: DataColumn) => any;
|
|
13
|
+
export let orderColumn: DataColumn ;
|
|
14
|
+
export let orderDirection: OrderDirection;
|
|
22
15
|
|
|
23
16
|
let resizeCol: any;
|
|
24
|
-
|
|
25
|
-
let orderDirection: OrderDirection = OrderDirection.Ascending;
|
|
17
|
+
|
|
26
18
|
|
|
27
19
|
let startX: number = 0;
|
|
28
20
|
let startWidth: number = 0;
|
|
29
21
|
|
|
30
22
|
|
|
31
23
|
const handleResizeMouseDown = (col: DataColumn) => (event: MouseEvent) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
if (col.resizable) {
|
|
25
|
+
resizeCol = col;
|
|
26
|
+
startX = event.clientX;
|
|
27
|
+
startWidth = resizeCol.width;
|
|
28
|
+
|
|
29
|
+
document.body.style.cursor = 'col-resize';
|
|
30
|
+
// 绑定鼠标移动和松开事件
|
|
31
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
32
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
33
|
+
}
|
|
39
34
|
}
|
|
40
35
|
|
|
41
36
|
const onMouseMove = (event: MouseEvent) => {
|
|
@@ -53,57 +48,31 @@
|
|
|
53
48
|
// 结束拖动
|
|
54
49
|
function onMouseUp() {
|
|
55
50
|
resizeCol = null;
|
|
51
|
+
document.body.style.cursor = 'default';
|
|
56
52
|
window.removeEventListener('mousemove', onMouseMove);
|
|
57
53
|
window.removeEventListener('mouseup', onMouseUp);
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
if (col.compareFunction != null) {
|
|
63
|
-
if (col == orderColumn) {
|
|
64
|
-
orderDirection = orderDirection == OrderDirection.Ascending ? OrderDirection.Descending : OrderDirection.Ascending;
|
|
65
|
-
} else {
|
|
66
|
-
orderColumn = col;
|
|
67
|
-
orderDirection = OrderDirection.Ascending;
|
|
68
|
-
}
|
|
69
|
-
sortData?.(col.compareFunction, orderDirection == OrderDirection.Descending);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
57
|
+
|
|
72
58
|
|
|
73
59
|
|
|
74
60
|
</script>
|
|
75
|
-
<div class="
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class={orderDirection===OrderDirection.Ascending ? 'uniface-icon-chevron-up' : 'uniface-icon-chevron-down'}></i>
|
|
86
|
-
{/if}
|
|
87
|
-
</div>
|
|
88
|
-
<div class="header-cell-divider" class:resizer={col.resizable} aria-hidden="true"
|
|
89
|
-
on:mousedown={handleResizeMouseDown(col)}></div>
|
|
61
|
+
<div class="header-row">
|
|
62
|
+
<div style="left: {-scrollLeft}px; width: {width}px">
|
|
63
|
+
{#each dataCols ?? [] as col, index}
|
|
64
|
+
<div class="col-{index} data-cell" class:sortable={col.compareFunction!=null} class:whitespace={hasWhitespace}>
|
|
65
|
+
<div class:sortable={col.compareFunction != null} on:click={handleCellClick(col)} aria-hidden="true" class="vertical-center">
|
|
66
|
+
<span>{col.text}</span>
|
|
67
|
+
{#if col === orderColumn}
|
|
68
|
+
<i style="margin-left: 2px; font-size: 12px; position: absolute; top: 0; right: 4px"
|
|
69
|
+
class={orderDirection===OrderDirection.Ascending ? 'uniface-icon-chevron-up' : 'uniface-icon-chevron-down'}></i>
|
|
70
|
+
{/if}
|
|
90
71
|
</div>
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
<div class="header-cell-divider" class:resizer={col.resizable} aria-hidden="true"
|
|
73
|
+
on:mousedown={handleResizeMouseDown(col)}></div>
|
|
74
|
+
|
|
93
75
|
</div>
|
|
94
|
-
|
|
76
|
+
{/each}
|
|
95
77
|
</div>
|
|
96
|
-
{#if actionsColumn}
|
|
97
|
-
<div class="header-actions" style="width: {actionsColumn.width}px">
|
|
98
|
-
<div>
|
|
99
|
-
<span>{actionsColumn.title ?? ''}</span>
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
</div>
|
|
103
|
-
{/if}
|
|
104
78
|
</div>
|
|
105
|
-
|
|
106
|
-
<style>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
</style>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
3
|
-
import type { CompareFunction } from "../lib/CompareFunction";
|
|
4
|
-
import { type SelectionEventHandler, SelectionMode, type TableEventHandler } from "../UniDataTable";
|
|
1
|
+
import { OrderDirection } from "../lib/OrderDirection";
|
|
2
|
+
import { type TableEventHandler } from "../UniDataTable";
|
|
5
3
|
import type DataColumn from "../lib/DataColumn";
|
|
6
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> {
|
|
7
5
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -17,16 +15,14 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
17
15
|
z_$$bindings?: Bindings;
|
|
18
16
|
}
|
|
19
17
|
declare const TableHeaderPanel: $$__sveltets_2_IsomorphicComponent<{
|
|
20
|
-
actionsColumn: ActionsColumn | null;
|
|
21
|
-
indicatorColumn: IndicatorColumn;
|
|
22
18
|
scrollLeft?: number;
|
|
23
|
-
handleToggleSelectAll: SelectionEventHandler;
|
|
24
19
|
handleWidthChange: TableEventHandler;
|
|
25
|
-
sortData: (compareFun: CompareFunction, descending: boolean) => void;
|
|
26
20
|
dataCols: Array<any>;
|
|
27
|
-
frozenCols?: Array<DataColumn>;
|
|
28
|
-
selectionMode: SelectionMode;
|
|
29
21
|
width?: number;
|
|
22
|
+
hasWhitespace?: boolean;
|
|
23
|
+
handleCellClick: (col: DataColumn) => any;
|
|
24
|
+
orderColumn: DataColumn;
|
|
25
|
+
orderDirection: OrderDirection;
|
|
30
26
|
}, {
|
|
31
27
|
[evt: string]: CustomEvent<any>;
|
|
32
28
|
}, {}, {}, string>;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
export default class TableRow {
|
|
2
|
-
private _expand;
|
|
3
|
-
private _height;
|
|
4
2
|
readonly data: any;
|
|
5
|
-
private _isBusy;
|
|
6
|
-
selected: boolean;
|
|
7
3
|
constructor(data: any);
|
|
8
|
-
get height(): number;
|
|
9
|
-
set height(value: number);
|
|
10
|
-
get expand(): boolean;
|
|
11
|
-
set expand(value: boolean);
|
|
12
|
-
get isBusy(): boolean;
|
|
13
|
-
set isBusy(value: boolean);
|
|
14
4
|
}
|
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
export default class TableRow {
|
|
2
|
-
_expand = false;
|
|
3
|
-
_height = 0;
|
|
4
2
|
data;
|
|
5
|
-
_isBusy = false;
|
|
6
|
-
selected = false;
|
|
7
3
|
constructor(data) {
|
|
8
4
|
this.data = data;
|
|
9
5
|
}
|
|
10
|
-
get height() {
|
|
11
|
-
return this._height;
|
|
12
|
-
}
|
|
13
|
-
set height(value) {
|
|
14
|
-
this._height = value;
|
|
15
|
-
}
|
|
16
|
-
get expand() {
|
|
17
|
-
return this._expand;
|
|
18
|
-
}
|
|
19
|
-
set expand(value) {
|
|
20
|
-
this._expand = value;
|
|
21
|
-
}
|
|
22
|
-
// get selected(): boolean {
|
|
23
|
-
// return this._selected;
|
|
24
|
-
// }
|
|
25
|
-
//
|
|
26
|
-
// set selected(value: boolean) {
|
|
27
|
-
// this._selected = value;
|
|
28
|
-
// }
|
|
29
|
-
get isBusy() {
|
|
30
|
-
return this._isBusy;
|
|
31
|
-
}
|
|
32
|
-
set isBusy(value) {
|
|
33
|
-
this._isBusy = value;
|
|
34
|
-
}
|
|
35
6
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { CompareFunction } from "../lib/CompareFunction";
|
|
2
1
|
import TableRow from "./TableRow";
|
|
3
2
|
export default class TableRows {
|
|
4
3
|
private _rows;
|
|
5
4
|
constructor();
|
|
6
5
|
set data(list: Array<any>);
|
|
7
6
|
get rows(): Array<TableRow>;
|
|
8
|
-
sort(compareFun: CompareFunction, descending: boolean): void;
|
|
9
7
|
}
|
package/dist/{list-box/ListViewItem.svelte.d.ts → data-table/parts/TreeRootCell.svelte.d.ts}
RENAMED
|
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
11
11
|
};
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
|
-
declare const
|
|
14
|
+
declare const TreeRootCell: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
16
16
|
}, {}, {}, string>;
|
|
17
|
-
type
|
|
18
|
-
export default
|
|
17
|
+
type TreeRootCell = InstanceType<typeof TreeRootCell>;
|
|
18
|
+
export default TreeRootCell;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
let textValue: string;
|
|
29
29
|
let editor: any;
|
|
30
30
|
let oldValue: Date = dateUtils.toDayjs(value)?.toDate();
|
|
31
|
-
let currentValue
|
|
31
|
+
let currentValue: dayjs.Dayjs;
|
|
32
32
|
|
|
33
33
|
const dateFmts = {
|
|
34
34
|
"H": "YYYY-MM-DD HH:mm",
|
|
@@ -64,6 +64,11 @@
|
|
|
64
64
|
if (e.key == 'Backspace' || e.key == 'Delete') {
|
|
65
65
|
value = null;
|
|
66
66
|
showPopup = false;
|
|
67
|
+
} else if (e.key == 'Tab') {
|
|
68
|
+
if (showPopup) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
}
|
|
67
72
|
} else if (e.key == 'Escape') {
|
|
68
73
|
showPopup = false;
|
|
69
74
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import type {DialogCloseConfirm} from "./DialogCloseConfirm";
|
|
5
5
|
import ActionBar, {type ButtonActions} from "../action-bar";
|
|
6
6
|
import i18n from "../i18nContext";
|
|
7
|
-
import type ButtonAction from "../action-bar/ButtonAction";
|
|
8
7
|
import {onMount} from "svelte";
|
|
9
8
|
|
|
10
9
|
export let title: string = null as unknown as string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateContext } from "./base-calendar";
|
|
2
2
|
import type CardAction from "./card/CardAction";
|
|
3
3
|
import type { DialogCloseConfirm, IDialog } from './dialog';
|
|
4
|
-
import { type IMessageBox,
|
|
4
|
+
import { type IMessageBox, ModalResult } from "./message-box";
|
|
5
5
|
import type { Toast } from "./toast";
|
|
6
6
|
import type { Indicator } from "./indicator";
|
|
7
7
|
import type { UnitOption } from "./unit-number-editor";
|
|
@@ -10,7 +10,7 @@ import type { FunFilter, LazyLoader, LoadResult } from "./list-box";
|
|
|
10
10
|
import type { ActionsColumn, FormatCell, CellHint, IndicatorColumn, RowAction, GetRowActions, ActionFunction, DataColumn } from "./data-table";
|
|
11
11
|
import type { ContextMenuItem, OnContextMenu, ActionCallback } from "./context-menu";
|
|
12
12
|
import type { MouseClickHandler } from "./common/MouseClickHandler";
|
|
13
|
-
export { DateContext,
|
|
13
|
+
export { DateContext, ModalResult, DisplayMode };
|
|
14
14
|
declare global {
|
|
15
15
|
interface Window {
|
|
16
16
|
Indicator: Indicator;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DateContext } from "./base-calendar";
|
|
2
|
-
import {
|
|
2
|
+
import { ModalResult } from "./message-box";
|
|
3
3
|
import { DisplayMode } from "./common/DisplayMode.js";
|
|
4
|
-
export { DateContext,
|
|
4
|
+
export { DateContext, ModalResult, DisplayMode };
|
package/dist/list-box/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ListBox from "./ListBox.svelte";
|
|
2
|
-
import type { FunFilter } from "./types";
|
|
3
|
-
import type { LazyLoader, LoadResult } from "./types";
|
|
2
|
+
import type { LazyLoader, LoadResult, FunFilter } from "./types";
|
|
4
3
|
export default ListBox;
|
|
5
4
|
export type { LazyLoader, FunFilter, LoadResult };
|
|
@@ -4,7 +4,7 @@ export default interface IMessageBox {
|
|
|
4
4
|
showInfo: ShowFun;
|
|
5
5
|
showConfirm: ShowConfirmFun;
|
|
6
6
|
}
|
|
7
|
-
declare enum
|
|
7
|
+
declare enum ModalResult {
|
|
8
8
|
MR_OK = 1,
|
|
9
9
|
MR_CANCEL = 2,
|
|
10
10
|
MR_CLOSE = 3
|
|
@@ -12,12 +12,12 @@ declare enum ModuleResult {
|
|
|
12
12
|
declare const InfoButtons: {
|
|
13
13
|
label: string;
|
|
14
14
|
type: string;
|
|
15
|
-
result:
|
|
15
|
+
result: ModalResult;
|
|
16
16
|
}[];
|
|
17
17
|
declare const ConfirmButtons: {
|
|
18
18
|
label: string;
|
|
19
19
|
type: string;
|
|
20
|
-
result:
|
|
20
|
+
result: ModalResult;
|
|
21
21
|
}[];
|
|
22
22
|
declare const initialize: (showInfo: any, showConfirm: any) => void;
|
|
23
|
-
export { initialize,
|
|
23
|
+
export { initialize, ModalResult, InfoButtons, ConfirmButtons };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import i18n from "../i18nContext";
|
|
2
2
|
;
|
|
3
|
-
var
|
|
4
|
-
(function (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(
|
|
3
|
+
var ModalResult;
|
|
4
|
+
(function (ModalResult) {
|
|
5
|
+
ModalResult[ModalResult["MR_OK"] = 1] = "MR_OK";
|
|
6
|
+
ModalResult[ModalResult["MR_CANCEL"] = 2] = "MR_CANCEL";
|
|
7
|
+
ModalResult[ModalResult["MR_CLOSE"] = 3] = "MR_CLOSE";
|
|
8
|
+
})(ModalResult || (ModalResult = {}));
|
|
9
9
|
const InfoButtons = [
|
|
10
|
-
{ label: i18n.getText('uniface.btnClose', 'Close'), type: 'primary', result:
|
|
10
|
+
{ label: i18n.getText('uniface.btnClose', 'Close'), type: 'primary', result: ModalResult.MR_OK }
|
|
11
11
|
];
|
|
12
12
|
const ConfirmButtons = [
|
|
13
|
-
{ label: i18n.getText('uniface.btnCancel', 'Cancel'), type: 'default', result:
|
|
14
|
-
{ label: i18n.getText('uniface.btnConfirm', 'OK'), type: 'primary', result:
|
|
13
|
+
{ label: i18n.getText('uniface.btnCancel', 'Cancel'), type: 'default', result: ModalResult.MR_CANCEL },
|
|
14
|
+
{ label: i18n.getText('uniface.btnConfirm', 'OK'), type: 'primary', result: ModalResult.MR_OK }
|
|
15
15
|
];
|
|
16
16
|
const initialize = (showInfo, showConfirm) => {
|
|
17
17
|
window.MessageBox = {
|
|
@@ -19,4 +19,4 @@ const initialize = (showInfo, showConfirm) => {
|
|
|
19
19
|
showConfirm
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
export { initialize,
|
|
22
|
+
export { initialize, ModalResult, InfoButtons, ConfirmButtons };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
|
|
3
3
|
import {onDestroy, onMount} from "svelte";
|
|
4
|
-
import {initialize, ConfirmButtons,
|
|
4
|
+
import {initialize, ConfirmButtons, ModalResult} from "./IMessageBox";
|
|
5
5
|
import Button from "../button";
|
|
6
6
|
import {fade} from "svelte/transition";
|
|
7
7
|
import utils from "../common/utils";
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
startMove = false;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const handleButtonClick = (mr:
|
|
83
|
+
const handleButtonClick = (mr: ModalResult) => (e: MouseEvent) => {
|
|
84
84
|
if (resolve != null) {
|
|
85
85
|
resolve(mr);
|
|
86
86
|
resolve = null;
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
const handleCloseClick = (e: MouseEvent) => {
|
|
92
92
|
if (resolve != null) {
|
|
93
|
-
resolve(
|
|
93
|
+
resolve(ModalResult.MR_CANCEL);
|
|
94
94
|
resolve = null;
|
|
95
95
|
visible = false;
|
|
96
96
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import MessageBoxBoard from "./MessageBoxBoard.svelte";
|
|
2
2
|
import type IMessageBox from "./IMessageBox";
|
|
3
|
-
import {
|
|
3
|
+
import { ModalResult } from "./IMessageBox";
|
|
4
4
|
export default MessageBoxBoard;
|
|
5
|
-
export {
|
|
5
|
+
export { ModalResult, type IMessageBox };
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export let max: number | null = null;
|
|
12
12
|
export let fromValue: number = null as unknown as number;
|
|
13
13
|
export let toValue: number = null as unknown as number;
|
|
14
|
+
export let allowNegative: boolean = false;
|
|
14
15
|
|
|
15
16
|
let className: string = '';
|
|
16
17
|
let showActionIcon: boolean = true;
|
|
@@ -27,9 +28,9 @@
|
|
|
27
28
|
</script>
|
|
28
29
|
<CommonRangeEditor {compact} class="{className}" {style} {variant} {showActionIcon} clean={cleanValue}>
|
|
29
30
|
<svelte:fragment slot="from">
|
|
30
|
-
<NumberInput bind:this={editor} style="width: 100%; text-align: center" placeholder="" {min} max={toValue} bind:value={fromValue}/>
|
|
31
|
+
<NumberInput bind:this={editor} style="width: 100%; text-align: center" {allowNegative} placeholder="" {min} max={toValue} bind:value={fromValue}/>
|
|
31
32
|
</svelte:fragment>
|
|
32
33
|
<svelte:fragment slot="to">
|
|
33
|
-
<NumberInput style="width: 100%; text-align: center" placeholder="" {max} min={fromValue} bind:value={toValue}/>
|
|
34
|
+
<NumberInput style="width: 100%; text-align: center" {allowNegative} placeholder="" {max} min={fromValue} bind:value={toValue}/>
|
|
34
35
|
</svelte:fragment>
|
|
35
36
|
</CommonRangeEditor>
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
export let keyField: string = "code";
|
|
20
20
|
export let textField: string = "text";
|
|
21
21
|
export let placeholder: string = '';
|
|
22
|
+
export let emptyText: string = '';
|
|
22
23
|
export let disableOptions: Array<string> = [];
|
|
23
24
|
export let hideOptions: Array<string> = [];
|
|
24
25
|
export let displayMode: DisplayMode = DisplayMode.Edit;
|
|
@@ -43,7 +44,9 @@
|
|
|
43
44
|
} else {
|
|
44
45
|
removeSelectCode(key);
|
|
45
46
|
}
|
|
46
|
-
onChange?.(selectedList)
|
|
47
|
+
onChange?.(selectedList);
|
|
48
|
+
editor.focus();
|
|
49
|
+
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
const getOptionItem = (code: string) => {
|
|
@@ -76,6 +79,12 @@
|
|
|
76
79
|
e.preventDefault();
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
83
|
+
if (event.key=='Tab') {
|
|
84
|
+
showPopup = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
const cleanData = () => {
|
|
80
89
|
value = '';
|
|
81
90
|
onChange?.([])
|
|
@@ -87,21 +96,28 @@
|
|
|
87
96
|
$: mh = `height: ${menu$height > 0 ? menu$height + 'px' : 'auto'}`;
|
|
88
97
|
$: textValue = generateTextValue(selectedList);
|
|
89
98
|
|
|
99
|
+
let editor: any;
|
|
100
|
+
|
|
101
|
+
$: if (showPopup) {
|
|
102
|
+
editor.focus();
|
|
103
|
+
}
|
|
104
|
+
|
|
90
105
|
</script>
|
|
91
106
|
|
|
92
107
|
<CommonPicker {displayMode} {variant} {style} {compact} className="multiple" dropDownIcon="uniface-icon-chevron-down"
|
|
93
108
|
bind:showPopup canClean={value!=null} autoFit clean={cleanData} {textValue} {readonly} {disabled}>
|
|
94
109
|
|
|
95
110
|
<div class="option-field" aria-hidden="true" on:click={()=>{showPopup = true}}>
|
|
111
|
+
<input bind:this={editor} style="position: absolute; left: 1px; width: 1px" on:keydown={handleKeyDown}/>
|
|
96
112
|
<div style="width: 100%; overflow: hidden; display: flex; flex-direction: row; gap: 6px">
|
|
97
113
|
{#if selectedList.length > 0 }
|
|
98
114
|
{#each selectedList as code}
|
|
99
115
|
<Tag style="flex-shrink: 0" color={tagColor} variant={tagVariant} text={getOptionItem(code)}
|
|
100
116
|
removable={!readonly && !disabled} removeHandler={removeOption(code)}/>
|
|
101
117
|
{/each}
|
|
102
|
-
{:else if placeholder != null}
|
|
118
|
+
{:else if emptyText != null || placeholder != null}
|
|
103
119
|
<div class:readonly={readonly || disabled}>
|
|
104
|
-
<span
|
|
120
|
+
<span>{emptyText ?? placeholder}</span>
|
|
105
121
|
</div>
|
|
106
122
|
{/if}
|
|
107
123
|
</div>
|
|
@@ -66,13 +66,19 @@
|
|
|
66
66
|
editor.focus();
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
70
|
+
if (event.key=='Tab') {
|
|
71
|
+
showPopup = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
69
75
|
</script>
|
|
70
76
|
|
|
71
77
|
<CommonPicker {displayMode} {variant} {style} {compact} dropDownIcon="uniface-icon-chevron-down"
|
|
72
78
|
bind:showPopup canClean={!mandatory && value!=null} autoFit clean={cleanData} {textValue} {readonly} {disabled}>
|
|
73
79
|
|
|
74
|
-
<input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder}
|
|
75
|
-
class="text-editor" bind:value={textValue} on:blur on:focus/>
|
|
80
|
+
<input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder} readonly
|
|
81
|
+
class="text-editor" bind:value={textValue} on:blur on:focus on:keydown={handleKeyDown}/>
|
|
76
82
|
|
|
77
83
|
<div class="options-popover" style={mh} slot="popup-panel">
|
|
78
84
|
{#each options as op}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
export let big: boolean = false;
|
|
14
14
|
export let rowsSet: Array<number> = [25, 50, 100];
|
|
15
15
|
export let total: number = null as unknown as number;
|
|
16
|
-
export let generateInfo: GenerateTotalInfo;
|
|
16
|
+
export let generateInfo: GenerateTotalInfo | null = null;
|
|
17
17
|
export let rowCount: number = 25;
|
|
18
18
|
export let rowCountLabel: string = 'Rows/Page';
|
|
19
19
|
export let align: 'left' | 'right' | '' = '';
|
|
@@ -22,7 +22,7 @@ declare const PaginationPanel: $$__sveltets_2_IsomorphicComponent<{
|
|
|
22
22
|
big?: boolean;
|
|
23
23
|
rowsSet?: Array<number>;
|
|
24
24
|
total?: number;
|
|
25
|
-
generateInfo
|
|
25
|
+
generateInfo?: GenerateTotalInfo | null;
|
|
26
26
|
rowCount?: number;
|
|
27
27
|
rowCountLabel?: string;
|
|
28
28
|
align?: "left" | "right" | "";
|
package/dist/split/Split.svelte
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
export let width: number = 2;
|
|
5
5
|
export let bindingPanel: any = null;
|
|
6
6
|
|
|
7
|
+
export let reverse: boolean = false;
|
|
8
|
+
|
|
7
9
|
let fixed: boolean = true;
|
|
8
10
|
|
|
9
11
|
let style: string;
|
|
@@ -18,24 +20,34 @@
|
|
|
18
20
|
isDragging = true;
|
|
19
21
|
document.addEventListener("mousemove", onDrag);
|
|
20
22
|
document.addEventListener("mouseup", stopDrag);
|
|
23
|
+
document.body.style.cursor = direction == "horizontal" ? 'row-resize' : 'col-resize'
|
|
21
24
|
} else {
|
|
22
25
|
event.preventDefault();
|
|
23
26
|
event.stopPropagation();
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
const calculateHeight = (event: MouseEvent) => {
|
|
31
|
+
reverse ? Math.max(5, bindingPanel.clientHeight - event.movementY) : Math.max(5, bindingPanel.clientHeight + event.movementY)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const calculateWidth = (event: MouseEvent) => {
|
|
35
|
+
return reverse ? Math.max(5, bindingPanel.clientWidth - event.movementX) : Math.max(5, bindingPanel.clientWidth + event.movementX)
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
const onDrag = (event: MouseEvent) => {
|
|
28
39
|
if (isDragging && bindingPanel) {
|
|
29
40
|
if (direction === "horizontal") {
|
|
30
|
-
bindingPanel.style.height = `${
|
|
41
|
+
bindingPanel.style.height = `${calculateHeight(event)}px`;
|
|
31
42
|
} else {
|
|
32
|
-
bindingPanel.style.width = `${
|
|
43
|
+
bindingPanel.style.width = `${calculateWidth(event)}px`;
|
|
33
44
|
}
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
47
|
|
|
37
48
|
const stopDrag = () => {
|
|
38
49
|
isDragging = false;
|
|
50
|
+
document.body.style.cursor = 'default';
|
|
39
51
|
document.removeEventListener("mousemove", onDrag);
|
|
40
52
|
document.removeEventListener("mouseup", stopDrag);
|
|
41
53
|
}
|