barsa-user-workspace 2.3.21 → 2.3.24
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/fesm2022/barsa-user-workspace.mjs +106 -107
- package/fesm2022/barsa-user-workspace.mjs.map +1 -1
- package/index.d.ts +472 -3
- package/package.json +3 -3
- package/lib/barsa-user-workspace.module.d.ts +0 -34
- package/lib/coercion/boolean-property.d.ts +0 -7
- package/lib/coercion/number-property.d.ts +0 -9
- package/lib/directives/drag-handle.d.ts +0 -15
- package/lib/directives/placeholder.d.ts +0 -17
- package/lib/directives/resize-handle.d.ts +0 -15
- package/lib/grid/grid.component.d.ts +0 -147
- package/lib/grid-item/grid-item.component.d.ts +0 -83
- package/lib/grid.definitions.d.ts +0 -61
- package/lib/grid.service.d.ts +0 -15
- package/lib/layout-container/layout-container.component.d.ts +0 -79
- package/lib/layout-grid-mapper.pipe.d.ts +0 -9
- package/lib/nav-container/nav-container.component.d.ts +0 -10
- package/lib/report-grid-layout/report-grid-layout.component.d.ts +0 -7
- package/lib/utils/client-rect.d.ts +0 -36
- package/lib/utils/grid.utils.d.ts +0 -45
- package/lib/utils/operators.d.ts +0 -6
- package/lib/utils/passive-listeners.d.ts +0 -12
- package/lib/utils/pointer.utils.d.ts +0 -29
- package/lib/utils/react-grid-layout.utils.d.ts +0 -177
- package/lib/utils/scroll.d.ts +0 -28
- package/lib/utils/transition-duration.d.ts +0 -6
- package/lib/utils.d.ts +0 -6
- package/public-api.d.ts +0 -12
- package/types.d.ts +0 -3
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTANT:
|
|
3
|
-
* This utils are taken from the project: https://github.com/STRML/react-grid-layout.
|
|
4
|
-
* The code should be as less modified as possible for easy maintenance.
|
|
5
|
-
*/
|
|
6
|
-
export type LayoutItem = {
|
|
7
|
-
w: number;
|
|
8
|
-
h: number;
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
id: string;
|
|
12
|
-
minW?: number;
|
|
13
|
-
minH?: number;
|
|
14
|
-
maxW?: number;
|
|
15
|
-
maxH?: number;
|
|
16
|
-
moved?: boolean;
|
|
17
|
-
static?: boolean;
|
|
18
|
-
isDraggable?: boolean | null | undefined;
|
|
19
|
-
isResizable?: boolean | null | undefined;
|
|
20
|
-
};
|
|
21
|
-
export type Layout = Array<LayoutItem>;
|
|
22
|
-
export type Position = {
|
|
23
|
-
left: number;
|
|
24
|
-
top: number;
|
|
25
|
-
width: number;
|
|
26
|
-
height: number;
|
|
27
|
-
};
|
|
28
|
-
export type ReactDraggableCallbackData = {
|
|
29
|
-
node: HTMLElement;
|
|
30
|
-
x?: number;
|
|
31
|
-
y?: number;
|
|
32
|
-
deltaX: number;
|
|
33
|
-
deltaY: number;
|
|
34
|
-
lastX?: number;
|
|
35
|
-
lastY?: number;
|
|
36
|
-
};
|
|
37
|
-
export type PartialPosition = {
|
|
38
|
-
left: number;
|
|
39
|
-
top: number;
|
|
40
|
-
};
|
|
41
|
-
export type DroppingPosition = {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
e: Event;
|
|
45
|
-
};
|
|
46
|
-
export type Size = {
|
|
47
|
-
width: number;
|
|
48
|
-
height: number;
|
|
49
|
-
};
|
|
50
|
-
export type GridDragEvent = {
|
|
51
|
-
e: Event;
|
|
52
|
-
node: HTMLElement;
|
|
53
|
-
newPosition: PartialPosition;
|
|
54
|
-
};
|
|
55
|
-
export type GridResizeEvent = {
|
|
56
|
-
e: Event;
|
|
57
|
-
node: HTMLElement;
|
|
58
|
-
size: Size;
|
|
59
|
-
};
|
|
60
|
-
export type DragOverEvent = MouseEvent & {
|
|
61
|
-
nativeEvent: {
|
|
62
|
-
layerX: number;
|
|
63
|
-
layerY: number;
|
|
64
|
-
target: {
|
|
65
|
-
className: String;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export type EventCallback = (arg0: Layout, oldItem: LayoutItem | null | undefined, newItem: LayoutItem | null | undefined, placeholder: LayoutItem | null | undefined, arg4: Event, arg5: HTMLElement | null | undefined) => void;
|
|
70
|
-
export type CompactType = ('horizontal' | 'vertical') | null | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Return the bottom coordinate of the layout.
|
|
73
|
-
*
|
|
74
|
-
* @param {Array} layout Layout array.
|
|
75
|
-
* @return {Number} Bottom coordinate.
|
|
76
|
-
*/
|
|
77
|
-
export declare function bottom(layout: Layout): number;
|
|
78
|
-
export declare function cloneLayout(layout: Layout): Layout;
|
|
79
|
-
/** NOTE: This code has been modified from the original source */
|
|
80
|
-
export declare function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem;
|
|
81
|
-
/**
|
|
82
|
-
* Given two layoutitems, check if they collide.
|
|
83
|
-
*/
|
|
84
|
-
export declare function collides(l1: LayoutItem, l2: LayoutItem): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Given a layout, compact it. This involves going down each y coordinate and removing gaps
|
|
87
|
-
* between items.
|
|
88
|
-
*
|
|
89
|
-
* @param {Array} layout Layout.
|
|
90
|
-
* @param {Boolean} verticalCompact Whether or not to compact the layout
|
|
91
|
-
* vertically.
|
|
92
|
-
* @return {Array} Compacted Layout.
|
|
93
|
-
*/
|
|
94
|
-
export declare function compact(layout: Layout, compactType: CompactType, cols: number): Layout;
|
|
95
|
-
/**
|
|
96
|
-
* Compact an item in the layout.
|
|
97
|
-
*/
|
|
98
|
-
export declare function compactItem(compareWith: Layout, l: LayoutItem, compactType: CompactType, cols: number, fullLayout: Layout): LayoutItem;
|
|
99
|
-
/**
|
|
100
|
-
* Given a layout, make sure all elements fit within its bounds.
|
|
101
|
-
*
|
|
102
|
-
* @param {Array} layout Layout array.
|
|
103
|
-
* @param {Number} bounds Number of columns.
|
|
104
|
-
*/
|
|
105
|
-
export declare function correctBounds(layout: Layout, bounds: {
|
|
106
|
-
cols: number;
|
|
107
|
-
}): Layout;
|
|
108
|
-
/**
|
|
109
|
-
* Get a layout item by ID. Used so we can override later on if necessary.
|
|
110
|
-
*
|
|
111
|
-
* @param {Array} layout Layout array.
|
|
112
|
-
* @param {String} id ID
|
|
113
|
-
* @return {LayoutItem} Item at ID.
|
|
114
|
-
*/
|
|
115
|
-
export declare function getLayoutItem(layout: Layout, id: string): LayoutItem | null | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* Returns the first item this layout collides with.
|
|
118
|
-
* It doesn't appear to matter which order we approach this from, although
|
|
119
|
-
* perhaps that is the wrong thing to do.
|
|
120
|
-
*
|
|
121
|
-
* @param {Object} layoutItem Layout item.
|
|
122
|
-
* @return {Object|undefined} A colliding layout item, or undefined.
|
|
123
|
-
*/
|
|
124
|
-
export declare function getFirstCollision(layout: Layout, layoutItem: LayoutItem): LayoutItem | null | undefined;
|
|
125
|
-
export declare function getAllCollisions(layout: Layout, layoutItem: LayoutItem): Array<LayoutItem>;
|
|
126
|
-
/**
|
|
127
|
-
* Get all static elements.
|
|
128
|
-
* @param {Array} layout Array of layout objects.
|
|
129
|
-
* @return {Array} Array of static layout items..
|
|
130
|
-
*/
|
|
131
|
-
export declare function getStatics(layout: Layout): Array<LayoutItem>;
|
|
132
|
-
/**
|
|
133
|
-
* Move an element. Responsible for doing cascading movements of other elements.
|
|
134
|
-
*
|
|
135
|
-
* @param {Array} layout Full layout to modify.
|
|
136
|
-
* @param {LayoutItem} l element to move.
|
|
137
|
-
* @param {Number} [x] X position in grid units.
|
|
138
|
-
* @param {Number} [y] Y position in grid units.
|
|
139
|
-
*/
|
|
140
|
-
export declare function moveElement(layout: Layout, l: LayoutItem, x: number | null | undefined, y: number | null | undefined, isUserAction: boolean | null | undefined, preventCollision: boolean | null | undefined, compactType: CompactType, cols: number): Layout;
|
|
141
|
-
/**
|
|
142
|
-
* This is where the magic needs to happen - given a collision, move an element away from the collision.
|
|
143
|
-
* We attempt to move it up if there's room, otherwise it goes below.
|
|
144
|
-
*
|
|
145
|
-
* @param {Array} layout Full layout to modify.
|
|
146
|
-
* @param {LayoutItem} collidesWith Layout item we're colliding with.
|
|
147
|
-
* @param {LayoutItem} itemToMove Layout item we're moving.
|
|
148
|
-
*/
|
|
149
|
-
export declare function moveElementAwayFromCollision(layout: Layout, collidesWith: LayoutItem, itemToMove: LayoutItem, isUserAction: boolean | null | undefined, compactType: CompactType, cols: number): Layout;
|
|
150
|
-
/**
|
|
151
|
-
* Helper to convert a number to a percentage string.
|
|
152
|
-
*
|
|
153
|
-
* @param {Number} num Any number
|
|
154
|
-
* @return {String} That number as a percentage.
|
|
155
|
-
*/
|
|
156
|
-
export declare function perc(num: number): string;
|
|
157
|
-
export declare function setTransform({ top, left, width, height }: Position): Object;
|
|
158
|
-
export declare function setTopLeft({ top, left, width, height }: Position): Object;
|
|
159
|
-
/**
|
|
160
|
-
* Get layout items sorted from top left to right and down.
|
|
161
|
-
*
|
|
162
|
-
* @return {Array} Array of layout objects.
|
|
163
|
-
* @return {Array} Layout, sorted static items first.
|
|
164
|
-
*/
|
|
165
|
-
export declare function sortLayoutItems(layout: Layout, compactType: CompactType): Layout;
|
|
166
|
-
export declare function sortLayoutItemsByRowCol(layout: Layout): Layout;
|
|
167
|
-
export declare function sortLayoutItemsByColRow(layout: Layout): Layout;
|
|
168
|
-
/**
|
|
169
|
-
* Validate a layout. Throws errors.
|
|
170
|
-
*
|
|
171
|
-
* @param {Array} layout Array of layout items.
|
|
172
|
-
* @param {String} [contextName] Context name for errors.
|
|
173
|
-
* @throw {Error} Validation error.
|
|
174
|
-
*/
|
|
175
|
-
export declare function validateLayout(layout: Layout, contextName?: string): void;
|
|
176
|
-
export declare function autoBindHandlers(el: Object, fns: Array<string>): void;
|
|
177
|
-
export declare const noop: () => void;
|
package/lib/utils/scroll.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
export interface KtdScrollPosition {
|
|
3
|
-
top: number;
|
|
4
|
-
left: number;
|
|
5
|
-
}
|
|
6
|
-
export interface KtdScrollIfNearElementOptions {
|
|
7
|
-
scrollStep?: number;
|
|
8
|
-
disableVertical?: boolean;
|
|
9
|
-
disableHorizontal?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Given a source$ observable with pointer location, scroll the scrollNode if the pointer is near to it.
|
|
13
|
-
* This observable doesn't emit, it just performs a 'scroll' side effect.
|
|
14
|
-
* @param scrollableParent, parent node in which the scroll would be performed.
|
|
15
|
-
* @param options, configuration options.
|
|
16
|
-
*/
|
|
17
|
-
export declare function ktdScrollIfNearElementClientRect$(scrollableParent: HTMLElement | Document, options?: KtdScrollIfNearElementOptions): (source$: Observable<{
|
|
18
|
-
pointerX: number;
|
|
19
|
-
pointerY: number;
|
|
20
|
-
}>) => Observable<any>;
|
|
21
|
-
/**
|
|
22
|
-
* Emits on EVERY scroll event and returns the accumulated scroll offset relative to the initial scroll position.
|
|
23
|
-
* @param scrollableParent, node in which scroll events would be listened.
|
|
24
|
-
*/
|
|
25
|
-
export declare function ktdGetScrollTotalRelativeDifference$(scrollableParent: HTMLElement | Document): Observable<{
|
|
26
|
-
top: number;
|
|
27
|
-
left: number;
|
|
28
|
-
}>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transition duration utilities.
|
|
3
|
-
* This file is taken from Angular Material repository.
|
|
4
|
-
*/
|
|
5
|
-
/** Gets the transform transition duration, including the delay, of an element in milliseconds. */
|
|
6
|
-
export declare function getTransformTransitionDurationInMs(element: HTMLElement): number;
|
package/lib/utils.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Removes and item from an array. Returns a new array instance (it doesn't mutate the source array).
|
|
3
|
-
* @param array source array to be returned without the element to remove
|
|
4
|
-
* @param condition function that will return true for the item that we want to remove
|
|
5
|
-
*/
|
|
6
|
-
export declare function ktdArrayRemoveItem<T>(array: T[], condition: (item: T) => boolean): any;
|
package/public-api.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { ktdGridCompact, ktdTrackById } from './lib/utils/grid.utils';
|
|
2
|
-
export { KtdClientRect } from './lib/utils/client-rect';
|
|
3
|
-
export * from './lib/directives/drag-handle';
|
|
4
|
-
export * from './lib/directives/resize-handle';
|
|
5
|
-
export * from './lib/directives/placeholder';
|
|
6
|
-
export * from './lib/grid-item/grid-item.component';
|
|
7
|
-
export * from './lib/grid.definitions';
|
|
8
|
-
export * from './lib/grid/grid.component';
|
|
9
|
-
export * from './lib/nav-container/nav-container.component';
|
|
10
|
-
export * from './lib/layout-container/layout-container.component';
|
|
11
|
-
export * from './lib/report-grid-layout/report-grid-layout.component';
|
|
12
|
-
export * from './lib/barsa-user-workspace.module';
|
package/types.d.ts
DELETED