@sme.up/ketchup 4.0.0 → 4.1.0
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/cjs/{cell-utils-1f89a299.js → cell-utils-841a7769.js} +2 -2
- package/dist/cjs/{f-chip-2d58c8f7.js → f-chip-b9f489ff.js} +7 -5
- package/dist/cjs/{f-image-5f4f29ca.js → f-image-0c3e6aa7.js} +3 -4
- package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/kup-autocomplete_29.cjs.entry.js +1014 -1103
- package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
- package/dist/cjs/kup-dash-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-dash_2.cjs.entry.js +106 -62
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
- package/dist/cjs/kup-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
- package/dist/cjs/kup-magic-box.cjs.entry.js +21 -30
- package/dist/cjs/{kup-manager-59ad8bdc.js → kup-manager-828bd598.js} +599 -519
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -4
- package/dist/cjs/{kup-objects-59ea949c.js → kup-objects-89f38d6a.js} +7 -29
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-2af73538.js → utils-5192ee20.js} +1 -1
- package/dist/collection/assets/data-table.js +1 -0
- package/dist/collection/collection-manifest.json +2 -3
- package/dist/collection/components/kup-accordion/kup-accordion.js +14 -14
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +9 -0
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +20 -23
- package/dist/collection/components/kup-badge/kup-badge.js +12 -12
- package/dist/collection/components/kup-box/kup-box.css +30 -30
- package/dist/collection/components/kup-box/kup-box.js +181 -171
- package/dist/collection/components/kup-button/kup-button.css +8 -5
- package/dist/collection/components/kup-button/kup-button.js +26 -26
- package/dist/collection/components/kup-button-list/kup-button-list.css +8 -5
- package/dist/collection/components/kup-button-list/kup-button-list.js +18 -18
- package/dist/collection/components/kup-calendar/kup-calendar.css +8 -6
- package/dist/collection/components/kup-calendar/kup-calendar.js +30 -30
- package/dist/collection/components/kup-card/kup-card-helper.js +2 -1
- package/dist/collection/components/kup-card/kup-card.css +20 -1
- package/dist/collection/components/kup-card/kup-card.js +26 -26
- package/dist/collection/components/kup-chart/kup-chart.js +40 -40
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +18 -18
- package/dist/collection/components/kup-chip/kup-chip.css +0 -1
- package/dist/collection/components/kup-chip/kup-chip.js +14 -14
- package/dist/collection/components/kup-color-picker/kup-color-picker.css +6 -9
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +32 -40
- package/dist/collection/components/kup-combobox/kup-combobox.css +9 -0
- package/dist/collection/components/kup-combobox/kup-combobox.js +20 -23
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +2 -2
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -0
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +25 -46
- package/dist/collection/components/kup-data-table/kup-data-table.css +83 -87
- package/dist/collection/components/kup-data-table/kup-data-table.js +364 -531
- package/dist/collection/components/kup-date-picker/kup-date-picker.css +2373 -5
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +72 -104
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -8
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +13 -5
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +38 -43
- package/dist/collection/components/kup-field/kup-field.js +20 -20
- package/dist/collection/components/kup-gauge/kup-gauge.js +16 -16
- package/dist/collection/components/kup-grid/kup-grid.css +2 -1
- package/dist/collection/components/kup-grid/kup-grid.js +12 -12
- package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
- package/dist/collection/components/kup-image/kup-image.js +24 -24
- package/dist/collection/components/kup-lazy/kup-lazy.js +16 -16
- package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
- package/dist/collection/components/kup-list/kup-list.css +4 -0
- package/dist/collection/components/kup-list/kup-list.js +38 -47
- package/dist/collection/components/kup-magic-box/kup-magic-box.css +11 -6
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +27 -36
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +10 -10
- package/dist/collection/components/kup-paginator/kup-paginator.css +8 -5
- package/dist/collection/components/kup-probe/kup-probe.js +8 -8
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +20 -20
- package/dist/collection/components/kup-radio/kup-radio.js +16 -16
- package/dist/collection/components/kup-rating/kup-rating.js +14 -14
- package/dist/collection/components/kup-spinner/kup-spinner.js +22 -22
- package/dist/collection/components/kup-switch/kup-switch.js +16 -16
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +12 -12
- package/dist/collection/components/kup-text-field/kup-text-field.js +48 -48
- package/dist/collection/components/kup-time-picker/kup-time-picker.css +2376 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +50 -83
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +18 -12
- package/dist/collection/components/kup-tree/kup-tree.css +10 -10
- package/dist/collection/components/kup-tree/kup-tree.js +96 -66
- package/dist/collection/f-components/f-button/f-button.js +4 -2
- package/dist/collection/f-components/f-image/f-image.js +1 -2
- package/dist/collection/f-components/f-text-field/f-text-field.js +8 -6
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +11 -3
- package/dist/collection/utils/kup-debug/kup-debug.js +25 -27
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +3 -5
- package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
- package/dist/collection/utils/kup-interact/kup-interact.js +362 -0
- package/dist/collection/utils/kup-manager/kup-manager.js +18 -6
- package/dist/collection/utils/kup-objects/kup-objects.js +7 -29
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
- package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
- package/dist/esm/{cell-utils-cb612463.js → cell-utils-de384721.js} +2 -2
- package/dist/esm/{f-chip-125d5dd6.js → f-chip-d585b63e.js} +7 -5
- package/dist/esm/{f-image-68b34fab.js → f-image-23548d00.js} +3 -4
- package/dist/esm/{index-bf2824a6.js → index-51694018.js} +73 -64
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +5 -5
- package/dist/esm/kup-autocomplete_29.entry.js +818 -907
- package/dist/esm/kup-calendar.entry.js +8 -8
- package/dist/esm/kup-dash-list.entry.js +6 -6
- package/dist/esm/kup-dash_2.entry.js +106 -62
- package/dist/esm/kup-drawer.entry.js +4 -4
- package/dist/esm/kup-field.entry.js +3 -3
- package/dist/esm/kup-iframe.entry.js +4 -4
- package/dist/esm/kup-lazy.entry.js +4 -4
- package/dist/esm/kup-magic-box.entry.js +21 -30
- package/dist/esm/{kup-manager-e7d7b353.js → kup-manager-583f2815.js} +595 -520
- package/dist/esm/kup-nav-bar.entry.js +4 -4
- package/dist/esm/{kup-objects-d38d2fa2.js → kup-objects-5968aefd.js} +7 -29
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-13dd007a.js → utils-a1dd14c3.js} +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-64ea7e37.entry.js → p-0e91c9c9.entry.js} +1 -1
- package/dist/ketchup/{p-0320e24e.entry.js → p-0f2b6a24.entry.js} +1 -1
- package/dist/ketchup/{p-a5424073.js → p-361d9431.js} +1 -1
- package/dist/ketchup/p-565785ce.js +1 -0
- package/dist/ketchup/{p-7896031c.entry.js → p-57eb45ac.entry.js} +1 -1
- package/dist/ketchup/{p-08c7a092.js → p-6f5d8830.js} +1 -1
- package/dist/ketchup/{p-9c858a38.entry.js → p-802d8906.entry.js} +1 -1
- package/dist/ketchup/p-850b9e67.entry.js +1 -0
- package/dist/ketchup/{p-a12a5690.entry.js → p-88a5787a.entry.js} +1 -1
- package/dist/ketchup/p-8ed2b7bf.entry.js +1 -0
- package/dist/ketchup/{p-ee89966f.entry.js → p-90a0c2b7.entry.js} +2 -2
- package/dist/ketchup/{p-876da4c2.entry.js → p-94c0dd8c.entry.js} +1 -1
- package/dist/ketchup/p-9ec3c377.entry.js +45 -0
- package/dist/ketchup/p-b30f34d8.js +1 -0
- package/dist/ketchup/p-b6a47512.entry.js +1 -0
- package/dist/ketchup/p-bfaf8a82.js +1 -0
- package/dist/ketchup/{p-940ab57a.entry.js → p-ca0ebdcc.entry.js} +1 -1
- package/dist/ketchup/p-d5a3a4ed.js +1 -0
- package/dist/ketchup/{p-c7ee1fbc.js → p-ee7b190c.js} +1 -1
- package/dist/ketchup/{p-b0724035.entry.js → p-f6b54fa1.entry.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +11 -2
- package/dist/types/components/kup-box/kup-box.d.ts +8 -4
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +0 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +12 -4
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +0 -2
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +16 -49
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -14
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +0 -4
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
- package/dist/types/components/kup-list/kup-list.d.ts +2 -3
- package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +7 -11
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
- package/dist/types/components/kup-tree/kup-tree.d.ts +3 -0
- package/dist/types/components.d.ts +84 -121
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
- package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
- package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +21 -4
- package/dist/types/utils/kup-manager/kup-manager.d.ts +2 -2
- package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
- package/package.json +3 -3
- package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
- package/dist/cjs/kup-grid.cjs.entry.js +0 -130
- package/dist/collection/assets/images/drag-multiple.js +0 -1
- package/dist/collection/components/kup-layout/kup-layout.css +0 -53
- package/dist/collection/components/kup-layout/kup-layout.js +0 -156
- package/dist/collection/utils/drag-and-drop.js +0 -109
- package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
- package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
- package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
- package/dist/esm/kup-grid.entry.js +0 -126
- package/dist/ketchup/p-00fe1e3e.js +0 -1
- package/dist/ketchup/p-1165f4ea.entry.js +0 -1
- package/dist/ketchup/p-170d3cba.js +0 -1
- package/dist/ketchup/p-18cb3ba3.js +0 -1
- package/dist/ketchup/p-23541a97.entry.js +0 -45
- package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
- package/dist/ketchup/p-b14e77f0.js +0 -1
- package/dist/ketchup/p-d24cfdea.entry.js +0 -1
- package/dist/ketchup/p-fcd2fd8f.js +0 -1
- package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
- package/dist/types/assets/images/drag-multiple.d.ts +0 -1
- package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
- package/dist/types/utils/drag-and-drop.d.ts +0 -53
- package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
- package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
|
@@ -29,9 +29,9 @@ export declare class KupDynamicPosition {
|
|
|
29
29
|
/**
|
|
30
30
|
* Changes the anchor point of the given element.
|
|
31
31
|
* @param {KupDynamicPositionElement} elements - Dynamically positioned element previously registered.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {KupDynamicPositionAnchor} anchorEl - New anchor point.
|
|
33
33
|
*/
|
|
34
|
-
changeAnchor(el: KupDynamicPositionElement, anchorEl:
|
|
34
|
+
changeAnchor(el: KupDynamicPositionElement, anchorEl: KupDynamicPositionAnchor): void;
|
|
35
35
|
/**
|
|
36
36
|
* Removes the element from dynamic position management.
|
|
37
37
|
* @param {KupDynamicPositionElement[]} elements - Elements to remove from the managed elements set.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { DropEvent, InteractEvent } from '@interactjs/types/index';
|
|
2
|
+
import type { ResizeEvent } from '@interactjs/actions/resize/plugin';
|
|
3
|
+
import { KupBoxRow } from '../../components/kup-box/kup-box-declarations';
|
|
4
|
+
import { Cell, Column, Row } from '../../components/kup-data-table/kup-data-table-declarations';
|
|
5
|
+
/**
|
|
6
|
+
* HTML Attribute attached to dialogs.
|
|
7
|
+
* Referenced by kup-theme.css
|
|
8
|
+
*/
|
|
9
|
+
export declare const kupDialogAttribute = "kup-dialog";
|
|
10
|
+
/**
|
|
11
|
+
* CSS class attached to resizable dialogs.
|
|
12
|
+
* Referenced by kup-theme.css
|
|
13
|
+
*/
|
|
14
|
+
export declare const kupDialogResizableClass = "kup-resizable";
|
|
15
|
+
/**
|
|
16
|
+
* Drag & drop variables.
|
|
17
|
+
*/
|
|
18
|
+
export declare const kupDropEvent: string;
|
|
19
|
+
export declare const kupDragActiveAttr: string;
|
|
20
|
+
export declare const kupDragOverAttr: string;
|
|
21
|
+
export declare const kupDraggableAttr: string;
|
|
22
|
+
export declare const kupDraggableCellAttr: string;
|
|
23
|
+
export declare const kupDraggableColumnAttr: string;
|
|
24
|
+
export declare const kupDraggableRowAttr: string;
|
|
25
|
+
/**
|
|
26
|
+
* Interface for drag & drop elements.
|
|
27
|
+
*/
|
|
28
|
+
export interface KupDraggableElement extends HTMLElement {
|
|
29
|
+
kupDragDrop: KupDraggablePayload;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Drag and drop data transfer.
|
|
33
|
+
*/
|
|
34
|
+
export interface KupDraggablePayload extends KupDropEventSource {
|
|
35
|
+
ghostImage?: HTMLElement;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Available effects fro dragging.
|
|
39
|
+
*/
|
|
40
|
+
export declare enum KupDragEffect {
|
|
41
|
+
BADGE = "badge",
|
|
42
|
+
CLONE = "clone",
|
|
43
|
+
MOVE = "move",
|
|
44
|
+
NONE = "none"
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Supported types of pointer events.
|
|
48
|
+
*/
|
|
49
|
+
export declare enum KupPointerEventTypes {
|
|
50
|
+
DOUBLETAP = "doubletap",
|
|
51
|
+
HOLD = "hold",
|
|
52
|
+
TAP = "tap"
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Additional callbacks to be made when the related drag event fires.
|
|
56
|
+
*/
|
|
57
|
+
export interface KupDragCallbacks {
|
|
58
|
+
end?: (e?: InteractEvent) => void;
|
|
59
|
+
move?: (e?: InteractEvent) => void;
|
|
60
|
+
start?: (e?: InteractEvent) => void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Additional callbacks to be made when the related drop event fires.
|
|
64
|
+
*/
|
|
65
|
+
export interface KupDropCallbacks {
|
|
66
|
+
drop?: (e?: DropEvent) => void;
|
|
67
|
+
enter?: (e?: DropEvent) => void;
|
|
68
|
+
leave?: (e?: DropEvent) => void;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Additional callbacks to be made when the related resize event fires.
|
|
72
|
+
*/
|
|
73
|
+
export interface KupResizeCallbacks {
|
|
74
|
+
move?: (e?: ResizeEvent) => void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Defines the additional data of the drag event.
|
|
78
|
+
*/
|
|
79
|
+
export declare type KupDragDataTransferCallback = (e?: InteractEvent) => KupDropEventSource;
|
|
80
|
+
export interface KupDragEventData {
|
|
81
|
+
callback?: KupDragDataTransferCallback;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Defines the additional data of the drop event.
|
|
85
|
+
*/
|
|
86
|
+
export declare type KupDropDataTransferCallback = (e?: DropEvent) => KupDropEventTarget;
|
|
87
|
+
export interface KupDropEventData {
|
|
88
|
+
callback?: KupDropDataTransferCallback;
|
|
89
|
+
dispatcher: HTMLElement;
|
|
90
|
+
type: KupDropEventTypes;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Supported types of drop event.
|
|
94
|
+
*/
|
|
95
|
+
export declare enum KupDropEventTypes {
|
|
96
|
+
BOX = "text/kup-box-drag",
|
|
97
|
+
DATATABLE = "text/kup-data-table-row-drag",
|
|
98
|
+
MAGICBOX = "text/kup-magic-box-drag"
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Drop event payload.
|
|
102
|
+
*/
|
|
103
|
+
export interface KupDropEventPayload {
|
|
104
|
+
dataType: KupDropEventTypes;
|
|
105
|
+
sourceElement: KupDropEventSource;
|
|
106
|
+
targetElement: KupDropEventTarget;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Source of the drop event payload.
|
|
110
|
+
*/
|
|
111
|
+
export interface KupDropEventSource {
|
|
112
|
+
cell?: Cell;
|
|
113
|
+
column?: Column;
|
|
114
|
+
id?: string;
|
|
115
|
+
multiple?: boolean;
|
|
116
|
+
row?: Row | KupBoxRow;
|
|
117
|
+
selectedRows?: Row[] | KupBoxRow[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Target of the drop event payload.
|
|
121
|
+
*/
|
|
122
|
+
export interface KupDropEventTarget {
|
|
123
|
+
id?: string;
|
|
124
|
+
row?: Row | KupBoxRow;
|
|
125
|
+
cell?: Cell;
|
|
126
|
+
column?: Column;
|
|
127
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Interaction } from '@interactjs/core/Interaction';
|
|
2
|
+
import type { ActionMap } from '@interactjs/core/scope';
|
|
3
|
+
import type { DraggableOptions, DropzoneOptions, ListenersArg, Point, RectResolvable, ResizableOptions } from '@interactjs/types/index';
|
|
4
|
+
import { KupDragCallbacks, KupDragEffect, KupDragEventData, KupDropCallbacks, KupDropEventData, KupPointerEventTypes, KupResizeCallbacks } from './kup-interact-declarations';
|
|
5
|
+
/**
|
|
6
|
+
* This class handles elements as dialogs, making them resizable and movable.
|
|
7
|
+
* @module KupInteract
|
|
8
|
+
*/
|
|
9
|
+
export declare class KupInteract {
|
|
10
|
+
container: HTMLElement;
|
|
11
|
+
managedElements: Set<HTMLElement>;
|
|
12
|
+
restrictContainer: RectResolvable<[
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
Interaction<keyof ActionMap>
|
|
16
|
+
]>;
|
|
17
|
+
zIndex: number;
|
|
18
|
+
/**
|
|
19
|
+
* Initializes KupInteract.
|
|
20
|
+
* @param {number} zIndex - The starting z-index assigned to dialogs.
|
|
21
|
+
* @param {RectResolvable<[number, number, Interaction<keyof ActionMap>]>} restrictContainer - The container setting the restriction's boundary.
|
|
22
|
+
*/
|
|
23
|
+
constructor(zIndex?: number, restrictContainer?: RectResolvable<[
|
|
24
|
+
number,
|
|
25
|
+
number,
|
|
26
|
+
Interaction<keyof ActionMap>
|
|
27
|
+
]>);
|
|
28
|
+
/**
|
|
29
|
+
* Sets up a new draggable element.
|
|
30
|
+
* @param {HTMLElement} el - The draggable element.
|
|
31
|
+
* @param {Partial<DraggableOptions>} options - Options of the draggable element.
|
|
32
|
+
* @param {KupDragEventData} eventData - Property used to transfer data for the drop event. The callback is used to return information of the starting item - such as cell, column and row info.
|
|
33
|
+
* @param {KupDragEffect} effect - Visual effect of the drag action.
|
|
34
|
+
* @param {KupDragCallbacks} callbacks - Additional callbacks to invoke.
|
|
35
|
+
* @see https://interactjs.io/docs/action-options/ For more options
|
|
36
|
+
*/
|
|
37
|
+
draggable(el: HTMLElement, options?: Partial<DraggableOptions>, eventData?: KupDragEventData, effect?: KupDragEffect, callbacks?: KupDragCallbacks): void;
|
|
38
|
+
/**
|
|
39
|
+
* Sets up a new dropzone.
|
|
40
|
+
* @param {HTMLElement} el - The dropzone element.
|
|
41
|
+
* @param {DropzoneOptions} options - Options of the dropzone.
|
|
42
|
+
* @param {KupDropEventData} eventData - Argument used to transfer data for the drop event. The callback is used to return information of the receiving item - such as cell, column and row info.
|
|
43
|
+
* @param {KupDropCallbacks} callbacks - Additional callbacks to invoke.
|
|
44
|
+
* @see https://interactjs.io/docs/action-options/ For more options
|
|
45
|
+
*/
|
|
46
|
+
dropzone(el: HTMLElement, options?: DropzoneOptions, eventData?: KupDropEventData, callbacks?: KupDropCallbacks): void;
|
|
47
|
+
/**
|
|
48
|
+
* Sets up a new resizable element.
|
|
49
|
+
* @param {HTMLElement} el - The resizable element.
|
|
50
|
+
* @param {Partial<ResizableOptions>} options - Options of the resize action.
|
|
51
|
+
* @param {KupResizeCallbacks} callbacks - Additional callbacks to invoke.
|
|
52
|
+
* @param {boolean} moveOnResize - When true, the element will be moved when resizing in order to keep its position.
|
|
53
|
+
* @see https://interactjs.io/docs/action-options/ For more options
|
|
54
|
+
*/
|
|
55
|
+
resizable(el: HTMLElement, options?: Partial<ResizableOptions>, callbacks?: KupResizeCallbacks, moveOnResize?: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Adds a new interact.js event listener to the given argument.
|
|
58
|
+
* @param {HTMLElement} el - The element on which the event listener will be added.
|
|
59
|
+
* @param {KupPointerEventTypes} event - Supported events.
|
|
60
|
+
* @param {KupResizeCallbacks} callback - Callback to invoke when the event fires.
|
|
61
|
+
*/
|
|
62
|
+
on(el: HTMLElement, event: KupPointerEventTypes, callback: ListenersArg): void;
|
|
63
|
+
/**
|
|
64
|
+
* This method checks whether the element is breaking the viewport boundaries.
|
|
65
|
+
* @param {HTMLElement} el - Element to check.
|
|
66
|
+
* @param {string} oldTransform - Previously set transform, used to rollback in case element breaks viewport boundaries.
|
|
67
|
+
* @param {Point} delta - X and Y delta values of the last movement.
|
|
68
|
+
*/
|
|
69
|
+
isInViewport(el: HTMLElement, oldTransform: string, delta: Point): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* This method treats the given element as a dialog, by activating moving-on-drag and, optionally, its resize.
|
|
72
|
+
* @param {HTMLElement} el - Dialog element.
|
|
73
|
+
* @param {HTMLElement} handleEl - Element that must be dragged in order to trigger movement. When not provided, dragging anywhere on "el" will move it.
|
|
74
|
+
* @param {boolean} unresizable - When true, the dialog can't be resized.
|
|
75
|
+
* @param {RectResolvable<[number, number, Interaction<keyof ActionMap>]>} restrictContainer - When present, it will set the constraint of "el": it can't be moved outside this container.
|
|
76
|
+
*/
|
|
77
|
+
dialogify(el: HTMLElement, handleEl?: HTMLElement, unresizable?: boolean, restrictContainer?: RectResolvable<[
|
|
78
|
+
number,
|
|
79
|
+
number,
|
|
80
|
+
Interaction<keyof ActionMap>
|
|
81
|
+
]>): void;
|
|
82
|
+
/**
|
|
83
|
+
* Removes the elements from the MoveOnDrag class watchlist.
|
|
84
|
+
* @param {HTMLElement[]} elements - Elements to remove.
|
|
85
|
+
*/
|
|
86
|
+
unregister(elements: HTMLElement[]): void;
|
|
87
|
+
/**
|
|
88
|
+
* Returns whether an element was previously registered or not.
|
|
89
|
+
* @param {HTMLElement} el - Element to test.
|
|
90
|
+
* @returns {boolean} True if the element was registered.
|
|
91
|
+
*/
|
|
92
|
+
isRegistered(el: HTMLElement): boolean;
|
|
93
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { Interaction } from '@interactjs/core/Interaction';
|
|
2
|
+
import type { ActionMap } from '@interactjs/core/scope';
|
|
3
|
+
import type { RectResolvable } from '@interactjs/types/index';
|
|
1
4
|
import type { KupDates } from '../kup-dates/kup-dates';
|
|
2
5
|
import type { KupDebug } from '../kup-debug/kup-debug';
|
|
3
|
-
import type { KupDialog } from '../kup-dialog/kup-dialog';
|
|
4
6
|
import type { KupDynamicPosition } from '../kup-dynamic-position/kup-dynamic-position';
|
|
7
|
+
import type { KupInteract } from '../kup-interact/kup-interact';
|
|
5
8
|
import type { KupLanguage } from '../kup-language/kup-language';
|
|
6
9
|
import type { KupLanguageJSON } from '../kup-language/kup-language-declarations';
|
|
7
10
|
import type { KupObjects } from '../kup-objects/kup-objects';
|
|
@@ -24,8 +27,8 @@ export interface KupDom extends HTMLHtmlElement {
|
|
|
24
27
|
export interface KupManager {
|
|
25
28
|
dates: KupDates;
|
|
26
29
|
debug: KupDebug;
|
|
27
|
-
dialog: KupDialog;
|
|
28
30
|
dynamicPosition: KupDynamicPosition;
|
|
31
|
+
interact: KupInteract;
|
|
29
32
|
language: KupLanguage;
|
|
30
33
|
magicBox: HTMLKupMagicBoxElement;
|
|
31
34
|
objects: KupObjects;
|
|
@@ -46,6 +49,15 @@ export interface KupManager {
|
|
|
46
49
|
export interface KupManagerUtilities {
|
|
47
50
|
lastPointerDownPath?: EventTarget[];
|
|
48
51
|
lastPointerDownString?: string;
|
|
52
|
+
pointerDownCallbacks?: Set<KupManagerPointerDownCb>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Interface to declare callbacks automatically invoked on pointer down events.
|
|
56
|
+
*/
|
|
57
|
+
export interface KupManagerPointerDownCb {
|
|
58
|
+
cb: () => unknown;
|
|
59
|
+
onlyOnce?: boolean;
|
|
60
|
+
el?: HTMLElement;
|
|
49
61
|
}
|
|
50
62
|
/**
|
|
51
63
|
* Interface for the KupManager override settings.
|
|
@@ -53,7 +65,7 @@ export interface KupManagerUtilities {
|
|
|
53
65
|
export interface KupManagerInitialization {
|
|
54
66
|
dates?: KupManagerDatesSettings;
|
|
55
67
|
debug?: KupManagerDebugSettings;
|
|
56
|
-
|
|
68
|
+
interact?: KupManagerInteractSettings;
|
|
57
69
|
language?: KupManagerLanguageSettings;
|
|
58
70
|
objects?: KupManagerObjectsSettings;
|
|
59
71
|
scrollOnHover?: KupManagerScrollOnHoverSettings;
|
|
@@ -76,7 +88,12 @@ export interface KupManagerDebugSettings {
|
|
|
76
88
|
/**
|
|
77
89
|
* KupDialog initialization settings.
|
|
78
90
|
*/
|
|
79
|
-
export interface
|
|
91
|
+
export interface KupManagerInteractSettings {
|
|
92
|
+
restrictContainer?: RectResolvable<[
|
|
93
|
+
number,
|
|
94
|
+
number,
|
|
95
|
+
Interaction<keyof ActionMap>
|
|
96
|
+
]>;
|
|
80
97
|
zIndex?: number;
|
|
81
98
|
}
|
|
82
99
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { KupManagerInitialization, KupManagerUtilities } from './kup-manager-declarations';
|
|
2
2
|
import { KupDebug } from '../kup-debug/kup-debug';
|
|
3
|
-
import { KupDialog } from '../kup-dialog/kup-dialog';
|
|
4
3
|
import { KupDynamicPosition } from '../kup-dynamic-position/kup-dynamic-position';
|
|
4
|
+
import { KupInteract } from '../kup-interact/kup-interact';
|
|
5
5
|
import { KupLanguage } from '../kup-language/kup-language';
|
|
6
6
|
import { KupObjects } from '../kup-objects/kup-objects';
|
|
7
7
|
import { KupScrollOnHover } from '../kup-scroll-on-hover/kup-scroll-on-hover';
|
|
@@ -17,8 +17,8 @@ import { KupDatesLocales } from '../kup-dates/kup-dates-declarations';
|
|
|
17
17
|
export declare class KupManager {
|
|
18
18
|
dates: KupDates;
|
|
19
19
|
debug: KupDebug;
|
|
20
|
-
dialog: KupDialog;
|
|
21
20
|
dynamicPosition: KupDynamicPosition;
|
|
21
|
+
interact: KupInteract;
|
|
22
22
|
language: KupLanguage;
|
|
23
23
|
magicBox: HTMLKupMagicBoxElement;
|
|
24
24
|
objects: KupObjects;
|
|
@@ -29,12 +29,6 @@ export declare class KupObjects {
|
|
|
29
29
|
* @returns {boolean} True when the object has extra columns.
|
|
30
30
|
*/
|
|
31
31
|
canObjHaveExtraColumns(obj: KupObj): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Checks whether the object can have a related tooltip or not.
|
|
34
|
-
* @param {KupObj} obj - Object to check.
|
|
35
|
-
* @returns {boolean} True when the object can have a related tooltip.
|
|
36
|
-
*/
|
|
37
|
-
hasTooltip(obj: KupObj): boolean;
|
|
38
32
|
/**
|
|
39
33
|
* Checks whether the object represents a bar or not.
|
|
40
34
|
* @param {KupObj} obj - Object to check.
|
|
@@ -166,7 +160,7 @@ export declare class KupObjects {
|
|
|
166
160
|
* @param {KupObj} obj - Object to check.
|
|
167
161
|
* @returns {boolean} True when the object is null or empty.
|
|
168
162
|
*/
|
|
169
|
-
|
|
163
|
+
isEmptyKupObj(obj: KupObj): boolean;
|
|
170
164
|
/**
|
|
171
165
|
* Parses a date depending on the object's type.
|
|
172
166
|
* @param {KupObj} obj - Object to check.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sme.up/ketchup",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"smeup",
|
|
6
6
|
"KetchUP",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@fullcalendar/interaction": "^5.9.0",
|
|
41
41
|
"@fullcalendar/list": "^5.9.0",
|
|
42
42
|
"@fullcalendar/timegrid": "^5.9.0",
|
|
43
|
-
"@justinribeiro/html5-dragdroptouch-shim": "^0.1.2",
|
|
44
43
|
"@material/form-field": "^11.0.0",
|
|
45
44
|
"@material/ripple": "^11.0.0",
|
|
46
45
|
"@material/textfield": "^11.0.0",
|
|
47
46
|
"d3-shape": "^1.3.7",
|
|
48
47
|
"dayjs": "^1.10.6",
|
|
49
48
|
"diagram-js": "^5.0.0",
|
|
49
|
+
"interactjs": "^1.10.11",
|
|
50
50
|
"jquery": "^3.3.1",
|
|
51
51
|
"lodash": "^4.17.19",
|
|
52
52
|
"numeral": "^2.0.6",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"vanilla-picker": "^2.11.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@stencil/core": "^2.
|
|
57
|
+
"@stencil/core": "^2.10.0",
|
|
58
58
|
"@stencil/sass": "^1.4.1",
|
|
59
59
|
"@types/d3-shape": "^2.1.0",
|
|
60
60
|
"@types/jest": "^26.0.24",
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Props of the kup-data-table component.
|
|
5
|
-
* Used to export every prop in an object.
|
|
6
|
-
*/
|
|
7
|
-
exports.KupDataTableProps = void 0;
|
|
8
|
-
(function (KupDataTableProps) {
|
|
9
|
-
KupDataTableProps["customStyle"] = "Custom style of the component.";
|
|
10
|
-
KupDataTableProps["data"] = "The data of the table.";
|
|
11
|
-
KupDataTableProps["density"] = "The density of the rows, defaults at 'medium' and can be also set to 'large' or 'small'.";
|
|
12
|
-
KupDataTableProps["dragEnabled"] = "Enables drag.";
|
|
13
|
-
KupDataTableProps["dropEnabled"] = "Enables drop.";
|
|
14
|
-
KupDataTableProps["editableData"] = "When set to true, editable cells will be rendered using input components.";
|
|
15
|
-
KupDataTableProps["emptyDataLabel"] = "Defines the label to show when the table is empty.";
|
|
16
|
-
KupDataTableProps["enableExtraColumns"] = "Enables adding extra columns.";
|
|
17
|
-
KupDataTableProps["enableSortableColumns"] = "Enables the sorting of columns by dragging them into different columns.";
|
|
18
|
-
KupDataTableProps["expandGroups"] = "Expands groups when set to true.";
|
|
19
|
-
KupDataTableProps["filters"] = "List of filters set by the user.";
|
|
20
|
-
KupDataTableProps["fixedColumns"] = "Fixes the given number of columns so that they stay visible when horizontally scrolling the data-table. If grouping is active or the value of the prop is <= 0, this prop will have no effect. Can be combined with fixedRows.";
|
|
21
|
-
KupDataTableProps["fixedRows"] = "Fixes the given number of rows so that they stay visible when vertically scrolling the data-table. If grouping is active or the value of the prop is <= 0, this prop will have no effect. Can be combined with fixedColumns.";
|
|
22
|
-
KupDataTableProps["forceOneLine"] = "Forces cells with long text and a fixed column size to have an ellipsis set on their text. The reflect attribute is mandatory to allow styling.";
|
|
23
|
-
KupDataTableProps["globalFilter"] = "When set to true it activates the global filter.";
|
|
24
|
-
KupDataTableProps["globalFilterValue"] = "The value of the global filter.";
|
|
25
|
-
KupDataTableProps["groupLabelDisplay"] = "How the label of a group must be displayed. For available values";
|
|
26
|
-
KupDataTableProps["groups"] = "The list of groups.";
|
|
27
|
-
KupDataTableProps["headerIsPersistent"] = "When set to true the header will stick on top of the table when scrolling.";
|
|
28
|
-
KupDataTableProps["isFocusable"] = "When set to true, clicked-on rows will have a visual feedback.";
|
|
29
|
-
KupDataTableProps["lazyLoadRows"] = "When set to true, extra rows will be automatically loaded once the last row enters the viewport. When groups are present, the number of rows is referred to groups and not to their content. Paginator is disabled.";
|
|
30
|
-
KupDataTableProps["lineBreakCharacter"] = "Defines the placeholder character which will be replaced by a line break inside table header cells, normal or sticky.";
|
|
31
|
-
KupDataTableProps["loadMoreLimit"] = "Sets a maximum limit of new records which can be required by the load more functionality.";
|
|
32
|
-
KupDataTableProps["loadMoreMode"] = "Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.";
|
|
33
|
-
KupDataTableProps["loadMoreStep"] = "The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.";
|
|
34
|
-
KupDataTableProps["multiSelection"] = "When set to true enables rows multi selection.";
|
|
35
|
-
KupDataTableProps["pageSelected"] = "Current selected page set on component load";
|
|
36
|
-
KupDataTableProps["paginatorPos"] = "Sets the position of the paginator. Available positions: top, bottom or both.";
|
|
37
|
-
KupDataTableProps["removableColumns"] = "Sets the possibility to remove the selected column.";
|
|
38
|
-
KupDataTableProps["rowActions"] = "Sets the actions of the rows.";
|
|
39
|
-
KupDataTableProps["rowsPerPage"] = "Sets the number of rows per page to display.";
|
|
40
|
-
KupDataTableProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
41
|
-
KupDataTableProps["selectRow"] = "Selects the row at the specified rendered rows prosition (base 1).";
|
|
42
|
-
KupDataTableProps["selectRowsById"] = "Semicolon separated rows id to select.";
|
|
43
|
-
KupDataTableProps["showCustomization"] = "If set to true, displays the button to open the customization panel.";
|
|
44
|
-
KupDataTableProps["showFilters"] = "When set to true enables the column filters.";
|
|
45
|
-
KupDataTableProps["showFooter"] = "When set to true shows the footer.";
|
|
46
|
-
KupDataTableProps["showGrid"] = "Can be used to customize the grid view of the table.";
|
|
47
|
-
KupDataTableProps["showGroups"] = "When set to true enables the column grouping.";
|
|
48
|
-
KupDataTableProps["showHeader"] = "Enables rendering of the table header.";
|
|
49
|
-
KupDataTableProps["showLoadMore"] = "If set to true, displays the button to load more records.";
|
|
50
|
-
KupDataTableProps["showTooltipOnRightClick"] = "If set to true, displays tooltip on right click; if set to false, displays tooltip on mouseOver.";
|
|
51
|
-
KupDataTableProps["sort"] = "Defines the current sorting options.";
|
|
52
|
-
KupDataTableProps["stateId"] = "";
|
|
53
|
-
KupDataTableProps["store"] = "";
|
|
54
|
-
KupDataTableProps["sortableColumnsMutateData"] = "If set to true, when a column is dragged to be sorted, the component directly mutates the data.columns property and then fires the event";
|
|
55
|
-
KupDataTableProps["sortEnabled"] = "When set to true enables the sorting of the columns by clicking on the column header.";
|
|
56
|
-
KupDataTableProps["tableHeight"] = "Sets the height of the table.";
|
|
57
|
-
KupDataTableProps["tableWidth"] = "Sets the width of the table.";
|
|
58
|
-
KupDataTableProps["tooltipDetailTimeout"] = "Defines the timeout for tooltip detail";
|
|
59
|
-
KupDataTableProps["tooltipEnabled"] = "Enable show tooltip";
|
|
60
|
-
KupDataTableProps["totals"] = "Defines the current totals options.";
|
|
61
|
-
})(exports.KupDataTableProps || (exports.KupDataTableProps = {}));
|
|
62
|
-
exports.SortMode = void 0;
|
|
63
|
-
(function (SortMode) {
|
|
64
|
-
SortMode["A"] = "A";
|
|
65
|
-
SortMode["D"] = "D";
|
|
66
|
-
})(exports.SortMode || (exports.SortMode = {}));
|
|
67
|
-
exports.TotalMode = void 0;
|
|
68
|
-
(function (TotalMode) {
|
|
69
|
-
TotalMode["COUNT"] = "Count";
|
|
70
|
-
TotalMode["SUM"] = "Sum";
|
|
71
|
-
TotalMode["MIN"] = "Min";
|
|
72
|
-
TotalMode["MAX"] = "Max";
|
|
73
|
-
TotalMode["DISTINCT"] = "Distinct";
|
|
74
|
-
TotalMode["AVERAGE"] = "Average";
|
|
75
|
-
TotalMode["MATH"] = "MATH";
|
|
76
|
-
})(exports.TotalMode || (exports.TotalMode = {}));
|
|
77
|
-
exports.TotalLabel = void 0;
|
|
78
|
-
(function (TotalLabel) {
|
|
79
|
-
TotalLabel["COUNT"] = "Count";
|
|
80
|
-
TotalLabel["SUM"] = "Sum";
|
|
81
|
-
TotalLabel["MIN"] = "Min";
|
|
82
|
-
TotalLabel["MAX"] = "Max";
|
|
83
|
-
TotalLabel["DISTINCT"] = "Distinct";
|
|
84
|
-
TotalLabel["AVERAGE"] = "Average";
|
|
85
|
-
TotalLabel["MATH"] = "Formula";
|
|
86
|
-
TotalLabel["CANC"] = "Cancel";
|
|
87
|
-
TotalLabel["CALC"] = "Calculate";
|
|
88
|
-
})(exports.TotalLabel || (exports.TotalLabel = {}));
|
|
89
|
-
exports.PaginatorPos = void 0;
|
|
90
|
-
(function (PaginatorPos) {
|
|
91
|
-
PaginatorPos["TOP"] = "Top";
|
|
92
|
-
PaginatorPos["BOTTOM"] = "Bottom";
|
|
93
|
-
PaginatorPos["BOTH"] = "Both";
|
|
94
|
-
})(exports.PaginatorPos || (exports.PaginatorPos = {}));
|
|
95
|
-
exports.ShowGrid = void 0;
|
|
96
|
-
(function (ShowGrid) {
|
|
97
|
-
ShowGrid["NONE"] = "None";
|
|
98
|
-
ShowGrid["ROW"] = "Row";
|
|
99
|
-
ShowGrid["COL"] = "Col";
|
|
100
|
-
ShowGrid["COMPLETE"] = "Complete";
|
|
101
|
-
})(exports.ShowGrid || (exports.ShowGrid = {}));
|
|
102
|
-
// export enum RowActionType {
|
|
103
|
-
// DEFAULT = 'Default',
|
|
104
|
-
// VARIABLE = 'Variable',
|
|
105
|
-
// }
|
|
106
|
-
//---- *NEXT functionality AKA load more ----
|
|
107
|
-
exports.LoadMoreMode = void 0;
|
|
108
|
-
(function (LoadMoreMode) {
|
|
109
|
-
LoadMoreMode["CONSTANT"] = "constant";
|
|
110
|
-
LoadMoreMode["CONSTANT_INCREMENT"] = "constant_increment";
|
|
111
|
-
LoadMoreMode["PROGRESSIVE_THRESHOLD"] = "progressive_threshold";
|
|
112
|
-
})(exports.LoadMoreMode || (exports.LoadMoreMode = {}));
|
|
113
|
-
//---- Sortable Columns Functionality ----
|
|
114
|
-
const KupDataTableColumnDragType = 'text/kup-data-table-column-drag';
|
|
115
|
-
const KupDataTableColumnDragRemoveType = 'text/kup-data-table-column-drag-remove';
|
|
116
|
-
const KupDataTableColumnDragGroupType = 'text/kup-data-table-column-drag-group';
|
|
117
|
-
const KupDataTableRowDragType = 'text/kup-data-table-row-drag';
|
|
118
|
-
//---- Group label display functionality ----
|
|
119
|
-
/**
|
|
120
|
-
* The possible values the display property can have.
|
|
121
|
-
* @enum
|
|
122
|
-
* @property {string} BOTH - Shows both the column label and the value. This is the default.
|
|
123
|
-
* @property {string} LABEL - Shows only the columns label.
|
|
124
|
-
* @property {string} VALUE - Shows only the value.
|
|
125
|
-
* @readonly
|
|
126
|
-
*/
|
|
127
|
-
exports.GroupLabelDisplayMode = void 0;
|
|
128
|
-
(function (GroupLabelDisplayMode) {
|
|
129
|
-
GroupLabelDisplayMode["BOTH"] = "Both";
|
|
130
|
-
GroupLabelDisplayMode["LABEL"] = "Label";
|
|
131
|
-
GroupLabelDisplayMode["VALUE"] = "Value";
|
|
132
|
-
})(exports.GroupLabelDisplayMode || (exports.GroupLabelDisplayMode = {}));
|
|
133
|
-
//---- Fixed rows and cells classes ----
|
|
134
|
-
const FixedCellsClasses = {
|
|
135
|
-
columns: 'fixed-column',
|
|
136
|
-
rows: 'fixed-row',
|
|
137
|
-
};
|
|
138
|
-
const FixedCellsCSSVarsBase = {
|
|
139
|
-
columns: '--ddt_column-left-',
|
|
140
|
-
rows: '--ddt_row-top-',
|
|
141
|
-
};
|
|
142
|
-
const totalMenuOpenID = 'TOMEOPID';
|
|
143
|
-
/**
|
|
144
|
-
* Constants for mocked/premade columns created by data mutations.
|
|
145
|
-
*/
|
|
146
|
-
const fieldColumn = 'Field';
|
|
147
|
-
const iconColumn = 'Icon';
|
|
148
|
-
const keyColumn = 'Key';
|
|
149
|
-
exports.SelectionMode = void 0;
|
|
150
|
-
(function (SelectionMode) {
|
|
151
|
-
SelectionMode["SINGLE"] = "single";
|
|
152
|
-
SelectionMode["MULTIPLE_CHECKBOX"] = "multiple-checkbox";
|
|
153
|
-
SelectionMode["MULTIPLE"] = "multiple";
|
|
154
|
-
SelectionMode["NONE"] = "none";
|
|
155
|
-
})(exports.SelectionMode || (exports.SelectionMode = {}));
|
|
156
|
-
|
|
157
|
-
// TODO: [feat-1]: if acceptedDataTypesFound must be passed to all drag event handler but the dragStart event.a
|
|
158
|
-
// This could possibly simplify the analysis of the e.dataTransfer.types
|
|
159
|
-
// TODO: PayloadStructure to implement or remove (implement the TypeScript type lika a generic)
|
|
160
|
-
const dragDropPayloadHolder = {
|
|
161
|
-
// fields used only by the D&D wrapper
|
|
162
|
-
// [...]
|
|
163
|
-
// The holder of the payload data
|
|
164
|
-
dragPayload: undefined,
|
|
165
|
-
};
|
|
166
|
-
// payload getter
|
|
167
|
-
function getDragDropPayload() {
|
|
168
|
-
return dragDropPayloadHolder.dragPayload;
|
|
169
|
-
}
|
|
170
|
-
// payload setter
|
|
171
|
-
function setDragDropPayload(dragPayload) {
|
|
172
|
-
dragDropPayloadHolder.dragPayload = dragPayload;
|
|
173
|
-
}
|
|
174
|
-
// playload cleaner
|
|
175
|
-
function _cleanDragDropPayload() {
|
|
176
|
-
dragDropPayloadHolder.dragPayload = undefined;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
*
|
|
180
|
-
*/
|
|
181
|
-
function setKetchupDraggable(handlers, data, image) {
|
|
182
|
-
const onDragStart = (e) => {
|
|
183
|
-
// clean the DragDropPlayload
|
|
184
|
-
_cleanDragDropPayload();
|
|
185
|
-
// Sets drag data, the type of drag action, and the image
|
|
186
|
-
Object.keys(data).forEach((key) => {
|
|
187
|
-
e.dataTransfer.setData(key, typeof data[key] === 'string'
|
|
188
|
-
? data[key]
|
|
189
|
-
: JSON.stringify(data[key]));
|
|
190
|
-
});
|
|
191
|
-
// manage the dragImage
|
|
192
|
-
if (image) {
|
|
193
|
-
e.dataTransfer.setDragImage(image.img, image.offsetX, image.offsetY);
|
|
194
|
-
}
|
|
195
|
-
// Executes the given handler for custom behavior
|
|
196
|
-
handlers.onDragStart(e);
|
|
197
|
-
};
|
|
198
|
-
let onDragOver = undefined;
|
|
199
|
-
if (handlers.onDragOver) {
|
|
200
|
-
onDragOver = (e) => {
|
|
201
|
-
if (handlers.onDragOver(e)) {
|
|
202
|
-
// this is mandatory in order to launch the onDrop method
|
|
203
|
-
e.preventDefault();
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
// remember that onDragOver and onDragLeave can be replaced by the same methods in DropHandlers (if the component is both draggable and droppable)
|
|
208
|
-
// in this scenario it's possible to merge the logic in the DropHandlers only
|
|
209
|
-
return Object.assign(Object.assign(Object.assign({ draggable: true, onDragStart }, (handlers.onDragLeave ? { onDragLeave: handlers.onDragLeave } : {})), (onDragOver ? { onDragOver } : {})), (handlers.onDragEnd ? { onDragEnd: handlers.onDragEnd } : {}));
|
|
210
|
-
}
|
|
211
|
-
function setKetchupDroppable(handlers, acceptedDataTypes, dispatcherElement, targetElement) {
|
|
212
|
-
const onDrop = (e) => {
|
|
213
|
-
// Searches for accepted data types
|
|
214
|
-
const acceptedDataTypesFound = acceptedDataTypes.filter((dataType) => hasDragDataType(e, dataType));
|
|
215
|
-
// If not accepted data types have been found, we stop the drop operation
|
|
216
|
-
let processedDataType = '';
|
|
217
|
-
if (acceptedDataTypesFound.length >= 1 &&
|
|
218
|
-
!!(processedDataType = handlers.onDrop(e, acceptedDataTypesFound))) {
|
|
219
|
-
let sourceElement;
|
|
220
|
-
try {
|
|
221
|
-
sourceElement = JSON.parse(e.dataTransfer.getData('kup-drag-source-element'));
|
|
222
|
-
}
|
|
223
|
-
catch (error) {
|
|
224
|
-
console.log('Managed error during the kup-drop-source-element parsing', error);
|
|
225
|
-
sourceElement = e.dataTransfer.getData('kup-drag-source-element');
|
|
226
|
-
}
|
|
227
|
-
// dataType: identifier of Drag & Drop
|
|
228
|
-
// sourceElement: applicative dragged object
|
|
229
|
-
// targetElement: applicative dropped object
|
|
230
|
-
const ketchupDropEvent = new CustomEvent('kup-drop', {
|
|
231
|
-
bubbles: true,
|
|
232
|
-
cancelable: true,
|
|
233
|
-
detail: {
|
|
234
|
-
dataType: processedDataType,
|
|
235
|
-
sourceElement,
|
|
236
|
-
targetElement,
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
console.log('kup-drop event', ketchupDropEvent);
|
|
240
|
-
dispatcherElement.dispatchEvent(ketchupDropEvent);
|
|
241
|
-
// this is mandatory
|
|
242
|
-
e.preventDefault();
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
let onDragOver = undefined;
|
|
246
|
-
if (handlers.onDragOver) {
|
|
247
|
-
onDragOver = (e) => {
|
|
248
|
-
if (handlers.onDragOver(e)) {
|
|
249
|
-
// this is mandatory
|
|
250
|
-
e.preventDefault();
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
// remember that onDragOver and onDragLeave can be replace the same methods in DragHandlers (if the component is both draggable and droppable)
|
|
255
|
-
// in this scenario it's possible to merge the logic in the DropHandlers only
|
|
256
|
-
return Object.assign(Object.assign(Object.assign({}, (onDragOver ? { onDragOver } : {})), (handlers.onDragLeave ? { onDragLeave: handlers.onDragLeave } : {})), { onDrop });
|
|
257
|
-
}
|
|
258
|
-
// utility that set the drag effect allowed
|
|
259
|
-
function setDragEffectAllowed(e, effectAllowed = 'move') {
|
|
260
|
-
e.dataTransfer.effectAllowed = effectAllowed;
|
|
261
|
-
}
|
|
262
|
-
// utility that simply check the drag data type
|
|
263
|
-
function hasDragDataType(e, dataType) {
|
|
264
|
-
return e.dataTransfer.types.indexOf(dataType) >= 0;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
exports.FixedCellsCSSVarsBase = FixedCellsCSSVarsBase;
|
|
268
|
-
exports.FixedCellsClasses = FixedCellsClasses;
|
|
269
|
-
exports.KupDataTableColumnDragGroupType = KupDataTableColumnDragGroupType;
|
|
270
|
-
exports.KupDataTableColumnDragRemoveType = KupDataTableColumnDragRemoveType;
|
|
271
|
-
exports.KupDataTableColumnDragType = KupDataTableColumnDragType;
|
|
272
|
-
exports.KupDataTableRowDragType = KupDataTableRowDragType;
|
|
273
|
-
exports.fieldColumn = fieldColumn;
|
|
274
|
-
exports.getDragDropPayload = getDragDropPayload;
|
|
275
|
-
exports.iconColumn = iconColumn;
|
|
276
|
-
exports.keyColumn = keyColumn;
|
|
277
|
-
exports.setDragDropPayload = setDragDropPayload;
|
|
278
|
-
exports.setDragEffectAllowed = setDragEffectAllowed;
|
|
279
|
-
exports.setKetchupDraggable = setKetchupDraggable;
|
|
280
|
-
exports.setKetchupDroppable = setKetchupDroppable;
|
|
281
|
-
exports.totalMenuOpenID = totalMenuOpenID;
|