igniteui-webcomponents 7.3.0 → 7.3.1
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/CHANGELOG.md +41 -0
- package/README.md +30 -0
- package/components/avatar/avatar.d.ts +1 -2
- package/components/avatar/avatar.js +4 -8
- package/components/avatar/avatar.js.map +1 -1
- package/components/badge/badge.d.ts +6 -1
- package/components/badge/badge.js +8 -5
- package/components/badge/badge.js.map +1 -1
- package/components/badge/themes/badge.base.css.js +1 -1
- package/components/badge/themes/badge.base.css.js.map +1 -1
- package/components/chip/chip.d.ts +30 -14
- package/components/chip/chip.js +54 -48
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/chip.base.css.js +1 -1
- package/components/chip/themes/chip.base.css.js.map +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/dark/chip.material.css.js +1 -1
- package/components/chip/themes/dark/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/light/chip.fluent.css.js +1 -1
- package/components/chip/themes/light/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/light/chip.indigo.css.js +1 -1
- package/components/chip/themes/light/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/light/chip.material.css.js +1 -1
- package/components/chip/themes/light/chip.material.css.js.map +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
- package/components/color-picker/color-picker.d.ts +2 -2
- package/components/color-picker/color-picker.js.map +1 -1
- package/components/color-picker/picker-canvas.js +2 -1
- package/components/color-picker/picker-canvas.js.map +1 -1
- package/components/textarea/textarea.d.ts +2 -15
- package/components/textarea/textarea.js +48 -93
- package/components/textarea/textarea.js.map +1 -1
- package/components/tile-manager/position.d.ts +2 -9
- package/components/tile-manager/position.js +27 -42
- package/components/tile-manager/position.js.map +1 -1
- package/components/tile-manager/resize-state.d.ts +11 -22
- package/components/tile-manager/resize-state.js +60 -119
- package/components/tile-manager/resize-state.js.map +1 -1
- package/components/tile-manager/resize-util.d.ts +3 -7
- package/components/tile-manager/resize-util.js +65 -72
- package/components/tile-manager/resize-util.js.map +1 -1
- package/components/tile-manager/serializer.d.ts +1 -1
- package/components/tile-manager/serializer.js +9 -10
- package/components/tile-manager/serializer.js.map +1 -1
- package/components/tile-manager/themes/shared/tile/tile.common.css.js +1 -1
- package/components/tile-manager/themes/shared/tile/tile.common.css.js.map +1 -1
- package/components/tile-manager/themes/tile.base.css.js +1 -1
- package/components/tile-manager/themes/tile.base.css.js.map +1 -1
- package/components/tile-manager/tile-ghost-util.js +16 -20
- package/components/tile-manager/tile-ghost-util.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +5 -2
- package/components/tile-manager/tile-manager.js +27 -23
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +32 -18
- package/components/tile-manager/tile.js +181 -161
- package/components/tile-manager/tile.js.map +1 -1
- package/components/tile-manager/types.d.ts +1 -5
- package/components/tile-manager/types.js.map +1 -1
- package/custom-elements.json +498 -853
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +1 -0
- package/index.js.map +1 -1
- package/internals/directives/drag.d.ts +144 -0
- package/internals/directives/drag.js +278 -0
- package/internals/directives/drag.js.map +1 -0
- package/internals/directives/resize.d.ts +109 -0
- package/internals/directives/resize.js +214 -0
- package/internals/directives/resize.js.map +1 -0
- package/internals/templates/input-shell.d.ts +12 -1
- package/internals/templates/input-shell.js +17 -10
- package/internals/templates/input-shell.js.map +1 -1
- package/internals/utils/dom.d.ts +2 -0
- package/internals/utils/dom.js +3 -0
- package/internals/utils/dom.js.map +1 -1
- package/internals/utils/events.d.ts +2 -0
- package/internals/utils/events.js +3 -0
- package/internals/utils/events.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +1 -0
- package/web-types.json +2 -2
- package/components/resize-container/default-ghost.d.ts +0 -5
- package/components/resize-container/default-ghost.js +0 -20
- package/components/resize-container/default-ghost.js.map +0 -1
- package/components/resize-container/resize-container.d.ts +0 -60
- package/components/resize-container/resize-container.js +0 -156
- package/components/resize-container/resize-container.js.map +0 -1
- package/components/resize-container/resize-controller.d.ts +0 -46
- package/components/resize-container/resize-controller.js +0 -195
- package/components/resize-container/resize-controller.js.map +0 -1
- package/components/resize-container/themes/dark/resize-indicator.bootstrap.css.d.ts +0 -1
- package/components/resize-container/themes/dark/resize-indicator.bootstrap.css.js +0 -3
- package/components/resize-container/themes/dark/resize-indicator.bootstrap.css.js.map +0 -1
- package/components/resize-container/themes/dark/resize-indicator.fluent.css.d.ts +0 -1
- package/components/resize-container/themes/dark/resize-indicator.fluent.css.js +0 -3
- package/components/resize-container/themes/dark/resize-indicator.fluent.css.js.map +0 -1
- package/components/resize-container/themes/dark/resize-indicator.indigo.css.d.ts +0 -1
- package/components/resize-container/themes/dark/resize-indicator.indigo.css.js +0 -3
- package/components/resize-container/themes/dark/resize-indicator.indigo.css.js.map +0 -1
- package/components/resize-container/themes/dark/resize-indicator.material.css.d.ts +0 -1
- package/components/resize-container/themes/dark/resize-indicator.material.css.js +0 -3
- package/components/resize-container/themes/dark/resize-indicator.material.css.js.map +0 -1
- package/components/resize-container/themes/dark/resize-indicator.shared.css.d.ts +0 -1
- package/components/resize-container/themes/dark/resize-indicator.shared.css.js +0 -3
- package/components/resize-container/themes/dark/resize-indicator.shared.css.js.map +0 -1
- package/components/resize-container/themes/light/resize-indicator.bootstrap.css.d.ts +0 -1
- package/components/resize-container/themes/light/resize-indicator.bootstrap.css.js +0 -3
- package/components/resize-container/themes/light/resize-indicator.bootstrap.css.js.map +0 -1
- package/components/resize-container/themes/light/resize-indicator.fluent.css.d.ts +0 -1
- package/components/resize-container/themes/light/resize-indicator.fluent.css.js +0 -3
- package/components/resize-container/themes/light/resize-indicator.fluent.css.js.map +0 -1
- package/components/resize-container/themes/light/resize-indicator.indigo.css.d.ts +0 -1
- package/components/resize-container/themes/light/resize-indicator.indigo.css.js +0 -3
- package/components/resize-container/themes/light/resize-indicator.indigo.css.js.map +0 -1
- package/components/resize-container/themes/light/resize-indicator.material.css.d.ts +0 -1
- package/components/resize-container/themes/light/resize-indicator.material.css.js +0 -3
- package/components/resize-container/themes/light/resize-indicator.material.css.js.map +0 -1
- package/components/resize-container/themes/light/resize-indicator.shared.css.d.ts +0 -1
- package/components/resize-container/themes/light/resize-indicator.shared.css.js +0 -3
- package/components/resize-container/themes/light/resize-indicator.shared.css.js.map +0 -1
- package/components/resize-container/themes/resize-container.base.css.d.ts +0 -1
- package/components/resize-container/themes/resize-container.base.css.js +0 -3
- package/components/resize-container/themes/resize-container.base.css.js.map +0 -1
- package/components/resize-container/themes/shared/resize-container.common.css.d.ts +0 -1
- package/components/resize-container/themes/shared/resize-container.common.css.js +0 -3
- package/components/resize-container/themes/shared/resize-container.common.css.js.map +0 -1
- package/components/resize-container/themes/themes.d.ts +0 -2
- package/components/resize-container/themes/themes.js +0 -47
- package/components/resize-container/themes/themes.js.map +0 -1
- package/components/resize-container/types.d.ts +0 -40
- package/components/resize-container/types.js +0 -2
- package/components/resize-container/types.js.map +0 -1
- package/internals/controllers/drag.d.ts +0 -166
- package/internals/controllers/drag.js +0 -283
- package/internals/controllers/drag.js.map +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { firstOf } from '#internals/utils/arrays.js';
|
|
2
2
|
import { asNumber } from '#internals/utils/math.js';
|
|
3
|
-
import {
|
|
3
|
+
import { calculatePosition, calculateResizedSpan, calculateSnappedDimension, } from './resize-util.js';
|
|
4
4
|
const CssValues = /(?<start>\d+)?\s*\/?\s*span\s*(?<span>\d+)?/gi;
|
|
5
|
+
function createAxisState(dimension = { entries: [], minSize: 0 }) {
|
|
6
|
+
return { dimension, prevDelta: 0, prevSnapped: 0 };
|
|
7
|
+
}
|
|
5
8
|
function parseTileGridRect(tile) {
|
|
6
9
|
const computed = getComputedStyle(tile);
|
|
7
10
|
const { gridColumn, gridRow } = computed;
|
|
@@ -20,18 +23,14 @@ function parseTileGridRect(tile) {
|
|
|
20
23
|
function parseTileParentGrid(gridContainer) {
|
|
21
24
|
const computed = getComputedStyle(gridContainer);
|
|
22
25
|
const { gap, gridTemplateColumns, gridTemplateRows } = computed;
|
|
23
|
-
const columns = gridTemplateColumns.split(' ').map(asNumber);
|
|
24
|
-
const rows = gridTemplateRows.split(' ').map(asNumber);
|
|
25
26
|
return {
|
|
26
27
|
gap: asNumber(gap),
|
|
27
28
|
columns: {
|
|
28
|
-
|
|
29
|
-
entries: columns,
|
|
29
|
+
entries: gridTemplateColumns.split(' ').map(asNumber),
|
|
30
30
|
minSize: asNumber(computed.getPropertyValue('--min-col-width')),
|
|
31
31
|
},
|
|
32
32
|
rows: {
|
|
33
|
-
|
|
34
|
-
entries: rows,
|
|
33
|
+
entries: gridTemplateRows.split(' ').map(asNumber),
|
|
35
34
|
minSize: asNumber(computed.getPropertyValue('--min-row-height')),
|
|
36
35
|
},
|
|
37
36
|
};
|
|
@@ -39,138 +38,80 @@ function parseTileParentGrid(gridContainer) {
|
|
|
39
38
|
class TileResizeState {
|
|
40
39
|
constructor() {
|
|
41
40
|
this._gap = 0;
|
|
42
|
-
this._prevDeltaX = 0;
|
|
43
|
-
this._prevDeltaY = 0;
|
|
44
|
-
this._prevSnappedWidth = 0;
|
|
45
|
-
this._prevSnappedHeight = 0;
|
|
46
41
|
this._position = {
|
|
47
42
|
column: { start: 0, span: 0 },
|
|
48
43
|
row: { start: 0, span: 0 },
|
|
49
44
|
};
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
minSize: 0,
|
|
54
|
-
};
|
|
55
|
-
this._rows = {
|
|
56
|
-
count: 0,
|
|
57
|
-
entries: [],
|
|
58
|
-
minSize: 0,
|
|
45
|
+
this._axes = {
|
|
46
|
+
column: createAxisState(),
|
|
47
|
+
row: createAxisState(),
|
|
59
48
|
};
|
|
60
|
-
this.resizedDimensions = {
|
|
61
|
-
width: null,
|
|
62
|
-
height: null,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
get gap() {
|
|
66
|
-
return this._gap;
|
|
67
|
-
}
|
|
68
|
-
get position() {
|
|
69
|
-
return structuredClone(this._position);
|
|
70
|
-
}
|
|
71
|
-
get columns() {
|
|
72
|
-
return structuredClone(this._columns);
|
|
73
|
-
}
|
|
74
|
-
get rows() {
|
|
75
|
-
return structuredClone(this._rows);
|
|
76
49
|
}
|
|
77
50
|
calculateSnappedWidth(state) {
|
|
78
|
-
|
|
79
|
-
const snappedDimension = this._resizeUtil.calculateSnappedDimension(resizeProps);
|
|
80
|
-
this._prevDeltaX = snappedDimension.newDelta;
|
|
81
|
-
this._prevSnappedWidth = snappedDimension.snappedSize;
|
|
82
|
-
return snappedDimension.snappedSize;
|
|
51
|
+
return this._calculateSnappedSize('column', state.deltaX, state.current.width);
|
|
83
52
|
}
|
|
84
53
|
calculateSnappedHeight(state) {
|
|
85
|
-
|
|
86
|
-
const snappedDimension = this._resizeUtil.calculateSnappedDimension(resizeProps);
|
|
87
|
-
this._prevDeltaY = snappedDimension.newDelta;
|
|
88
|
-
this._prevSnappedHeight = snappedDimension.snappedSize;
|
|
89
|
-
return snappedDimension.snappedSize;
|
|
54
|
+
return this._calculateSnappedSize('row', state.deltaY, state.current.height);
|
|
90
55
|
}
|
|
91
56
|
updateState(tileRect, tile, grid) {
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
57
|
+
this._initState(grid, tile);
|
|
58
|
+
this._calculateTileStartPosition(grid, tileRect);
|
|
94
59
|
}
|
|
95
60
|
calculateResizedGridPosition(rect) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
61
|
+
const { column, row } = this._position;
|
|
62
|
+
column.span = calculateResizedSpan({
|
|
63
|
+
targetSize: rect.width,
|
|
64
|
+
tilePosition: column,
|
|
65
|
+
tileGridDimension: this._axes.column.dimension,
|
|
66
|
+
gap: this._gap,
|
|
67
|
+
isRow: false,
|
|
68
|
+
});
|
|
69
|
+
row.span = calculateResizedSpan({
|
|
70
|
+
targetSize: rect.height,
|
|
71
|
+
tilePosition: row,
|
|
72
|
+
tileGridDimension: this._axes.row.dimension,
|
|
73
|
+
gap: this._gap,
|
|
74
|
+
isRow: true,
|
|
75
|
+
});
|
|
76
|
+
return { colSpan: column.span, rowSpan: row.span };
|
|
105
77
|
}
|
|
106
|
-
|
|
78
|
+
_calculateSnappedSize(axis, currentDelta, currentSize) {
|
|
79
|
+
const axisState = this._axes[axis];
|
|
80
|
+
const { snappedSize, newDelta } = calculateSnappedDimension({
|
|
81
|
+
currentDelta,
|
|
82
|
+
currentSize,
|
|
83
|
+
prevDelta: axisState.prevDelta,
|
|
84
|
+
prevSnapped: axisState.prevSnapped,
|
|
85
|
+
gridEntries: axisState.dimension.entries,
|
|
86
|
+
startIndex: this._position[axis].start,
|
|
87
|
+
gap: this._gap,
|
|
88
|
+
});
|
|
89
|
+
axisState.prevDelta = newDelta;
|
|
90
|
+
axisState.prevSnapped = snappedSize;
|
|
91
|
+
return snappedSize;
|
|
92
|
+
}
|
|
93
|
+
_initState(grid, tile) {
|
|
107
94
|
const { gap, columns, rows } = parseTileParentGrid(grid);
|
|
108
|
-
this._resizeUtil = new ResizeUtil(gap);
|
|
109
|
-
this._initialPosition = parseTileGridRect(tile);
|
|
110
|
-
this._position = structuredClone(this._initialPosition);
|
|
111
95
|
this._gap = gap;
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this._prevSnappedHeight = 0;
|
|
96
|
+
this._position = parseTileGridRect(tile);
|
|
97
|
+
this._axes = {
|
|
98
|
+
column: createAxisState(columns),
|
|
99
|
+
row: createAxisState(rows),
|
|
100
|
+
};
|
|
118
101
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
102
|
+
_calculateTileStartPosition(grid, tileRect) {
|
|
103
|
+
const { column, row } = this._position;
|
|
104
|
+
if (column.start >= 0 && row.start >= 0) {
|
|
105
|
+
return;
|
|
123
106
|
}
|
|
124
|
-
if (this._position.row.start < 0) {
|
|
125
|
-
const offsetY = this.getGridOffset(grid, 'vertical');
|
|
126
|
-
this._position.row.start = this._resizeUtil.calculatePosition(tileRect.top + window.scrollY - offsetY, this._rows.entries);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
getGridOffset(grid, axis) {
|
|
130
107
|
const gridRect = grid.getBoundingClientRect();
|
|
131
108
|
const computed = getComputedStyle(grid);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
getResizeProps(state, isRow = false) {
|
|
140
|
-
return isRow
|
|
141
|
-
? {
|
|
142
|
-
currentDelta: state.deltaY,
|
|
143
|
-
currentSize: state.current.height,
|
|
144
|
-
prevDelta: this._prevDeltaY,
|
|
145
|
-
gridEntries: this._rows.entries,
|
|
146
|
-
startIndex: this._position.row.start,
|
|
147
|
-
prevSnapped: this._prevSnappedHeight,
|
|
148
|
-
}
|
|
149
|
-
: {
|
|
150
|
-
currentDelta: state.deltaX,
|
|
151
|
-
currentSize: state.current.width,
|
|
152
|
-
prevDelta: this._prevDeltaX,
|
|
153
|
-
gridEntries: this._columns.entries,
|
|
154
|
-
startIndex: this._position.column.start,
|
|
155
|
-
prevSnapped: this._prevSnappedWidth,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
getResizeSpanProps(rect, isRow = false) {
|
|
159
|
-
return isRow
|
|
160
|
-
? {
|
|
161
|
-
targetSize: rect.height,
|
|
162
|
-
tilePosition: this.position.row,
|
|
163
|
-
tileGridDimension: this.rows,
|
|
164
|
-
gap: this.gap,
|
|
165
|
-
isRow,
|
|
166
|
-
}
|
|
167
|
-
: {
|
|
168
|
-
targetSize: rect.width,
|
|
169
|
-
tilePosition: this.position.column,
|
|
170
|
-
tileGridDimension: this.columns,
|
|
171
|
-
gap: this.gap,
|
|
172
|
-
isRow,
|
|
173
|
-
};
|
|
109
|
+
if (column.start < 0) {
|
|
110
|
+
column.start = calculatePosition(tileRect.left - gridRect.left - Number.parseFloat(computed.paddingLeft), this._axes.column.dimension.entries, this._gap);
|
|
111
|
+
}
|
|
112
|
+
if (row.start < 0) {
|
|
113
|
+
row.start = calculatePosition(tileRect.top - gridRect.top - Number.parseFloat(computed.paddingTop), this._axes.row.dimension.entries, this._gap);
|
|
114
|
+
}
|
|
174
115
|
}
|
|
175
116
|
}
|
|
176
117
|
export function createTileResizeState() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize-state.js","sourceRoot":"","sources":["../../../src/components/tile-manager/resize-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,MAAM,SAAS,GAAG,+CAA+C,CAAC;AAElE,SAAS,iBAAiB,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K,CAAC,OAAO;gBAC/B,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK;gBACpC,WAAW,EAAE,IAAI,CAAC,kBAAkB;aACrC;YACH,CAAC,CAAC;gBACE,YAAY,EAAE,KAAK,CAAC,MAAM;gBAC1B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;gBAChC,SAAS,EAAE,IAAI,CAAC,WAAW;gBAC3B,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;gBAClC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK;gBACvC,WAAW,EAAE,IAAI,CAAC,iBAAiB;aACpC,CAAC;IACR,CAAC;IAEO,kBAAkB,CAAC,IAAa,EAAE,KAAK,GAAG,KAAK;QACrD,OAAO,KAAK;YACV,CAAC,CAAC;gBACE,UAAU,EAAE,IAAI,CAAC,MAAM;gBACvB,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG;gBAC/B,iBAAiB,EAAE,IAAI,CAAC,IAAI;gBAC5B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,KAAK;aACN;YACH,CAAC,CAAC;gBACE,UAAU,EAAE,IAAI,CAAC,KAAK;gBACtB,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM;gBAClC,iBAAiB,EAAE,IAAI,CAAC,OAAO;gBAC/B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,KAAK;aACN,CAAC;IACR,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,eAAe,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["import { firstOf } from '#internals/utils/arrays.js';\nimport { asNumber } from '#internals/utils/math.js';\nimport type { ResizeState } from '../resize-container/types.js';\nimport { ResizeUtil } from './resize-util.js';\nimport type IgcTileComponent from './tile.js';\nimport type {\n ResizeProps,\n ResizeSpanProps,\n TileGridDimension,\n TileGridPosition,\n TileResizeDimensions,\n} from './types.js';\n\nconst CssValues = /(?<start>\\d+)?\\s*\\/?\\s*span\\s*(?<span>\\d+)?/gi;\n\nfunction parseTileGridRect(tile: IgcTileComponent): TileGridPosition {\n const computed = getComputedStyle(tile);\n const { gridColumn, gridRow } = computed;\n\n const [column, row] = [\n firstOf(Array.from(gridColumn.matchAll(CssValues))).groups!,\n firstOf(Array.from(gridRow.matchAll(CssValues))).groups!,\n ];\n\n return {\n column: {\n start: asNumber(column.start, -1),\n span: asNumber(column.span, -1),\n },\n row: { start: asNumber(row.start, -1), span: asNumber(row.span, -1) },\n };\n}\n\nfunction parseTileParentGrid(gridContainer: HTMLElement) {\n const computed = getComputedStyle(gridContainer);\n const { gap, gridTemplateColumns, gridTemplateRows } = computed;\n\n const columns = gridTemplateColumns.split(' ').map(asNumber);\n const rows = gridTemplateRows.split(' ').map(asNumber);\n\n return {\n gap: asNumber(gap),\n columns: {\n count: columns.length,\n entries: columns,\n minSize: asNumber(computed.getPropertyValue('--min-col-width')),\n },\n rows: {\n count: rows.length,\n entries: rows,\n minSize: asNumber(computed.getPropertyValue('--min-row-height')),\n },\n };\n}\n\nclass TileResizeState {\n private _initialPosition!: TileGridPosition;\n private _resizeUtil!: ResizeUtil;\n\n protected _gap = 0;\n protected _prevDeltaX = 0;\n protected _prevDeltaY = 0;\n\n protected _prevSnappedWidth = 0;\n protected _prevSnappedHeight = 0;\n\n protected _position: TileGridPosition = {\n column: { start: 0, span: 0 },\n row: { start: 0, span: 0 },\n };\n\n protected _columns: TileGridDimension = {\n count: 0,\n entries: [],\n minSize: 0,\n };\n\n protected _rows: TileGridDimension = {\n count: 0,\n entries: [],\n minSize: 0,\n };\n\n public resizedDimensions: TileResizeDimensions = {\n width: null,\n height: null,\n };\n\n public get gap(): number {\n return this._gap;\n }\n\n public get position(): TileGridPosition {\n return structuredClone(this._position);\n }\n\n public get columns(): TileGridDimension {\n return structuredClone(this._columns);\n }\n\n public get rows(): TileGridDimension {\n return structuredClone(this._rows);\n }\n\n public calculateSnappedWidth(state: ResizeState): number {\n const resizeProps = this.getResizeProps(state);\n const snappedDimension =\n this._resizeUtil.calculateSnappedDimension(resizeProps);\n\n this._prevDeltaX = snappedDimension.newDelta;\n this._prevSnappedWidth = snappedDimension.snappedSize;\n return snappedDimension.snappedSize;\n }\n\n public calculateSnappedHeight(state: ResizeState): number {\n const resizeProps = this.getResizeProps(state, true);\n const snappedDimension =\n this._resizeUtil.calculateSnappedDimension(resizeProps);\n\n this._prevDeltaY = snappedDimension.newDelta;\n this._prevSnappedHeight = snappedDimension.snappedSize;\n return snappedDimension.snappedSize;\n }\n\n public updateState(\n tileRect: DOMRect,\n tile: IgcTileComponent,\n grid: HTMLElement\n ): void {\n this.initState(grid, tile);\n this.calculateTileStartPosition(grid, tileRect);\n }\n\n /**\n * Calculates and returns the CSS column and row properties of a tile after resizing,\n * based on its new dimensions and starting position.\n */\n public calculateResizedGridPosition(rect: DOMRect) {\n const colProps = this.getResizeSpanProps(rect);\n const rowProps = this.getResizeSpanProps(rect, true);\n\n // REVIEW pass col minSize and allowOverflow?\n this._position.column.span =\n this._resizeUtil.calculateResizedSpan(colProps);\n this._position.row.span = this._resizeUtil.calculateResizedSpan(rowProps);\n\n return {\n colSpan: this._position.column.span,\n rowSpan: this._position.row.span,\n };\n }\n\n private initState(grid: HTMLElement, tile: IgcTileComponent): void {\n const { gap, columns, rows } = parseTileParentGrid(grid);\n\n this._resizeUtil = new ResizeUtil(gap);\n this._initialPosition = parseTileGridRect(tile);\n this._position = structuredClone(this._initialPosition);\n\n this._gap = gap;\n this._columns = columns;\n this._rows = rows;\n this._prevDeltaX = 0;\n this._prevDeltaY = 0;\n this._prevSnappedWidth = 0;\n this._prevSnappedHeight = 0;\n }\n\n private calculateTileStartPosition(\n grid: HTMLElement,\n tileRect: DOMRect\n ): void {\n if (this._position.column.start < 0) {\n const offsetX = this.getGridOffset(grid, 'horizontal');\n\n this._position.column.start = this._resizeUtil.calculatePosition(\n tileRect.left + window.scrollX + grid.scrollLeft - offsetX,\n this._columns.entries\n );\n }\n\n if (this._position.row.start < 0) {\n const offsetY = this.getGridOffset(grid, 'vertical');\n\n this._position.row.start = this._resizeUtil.calculatePosition(\n tileRect.top + window.scrollY - offsetY,\n this._rows.entries\n );\n }\n }\n\n private getGridOffset(\n grid: HTMLElement,\n axis: 'horizontal' | 'vertical'\n ): number {\n const gridRect = grid.getBoundingClientRect();\n const computed = getComputedStyle(grid);\n\n return axis === 'horizontal'\n ? gridRect.left +\n window.scrollX +\n grid.scrollLeft +\n Number.parseFloat(computed.paddingLeft)\n : gridRect.top + window.scrollY + Number.parseFloat(computed.paddingTop);\n }\n\n private getResizeProps(state: ResizeState, isRow = false): ResizeProps {\n return isRow\n ? {\n currentDelta: state.deltaY,\n currentSize: state.current.height,\n prevDelta: this._prevDeltaY,\n gridEntries: this._rows.entries,\n startIndex: this._position.row.start,\n prevSnapped: this._prevSnappedHeight,\n }\n : {\n currentDelta: state.deltaX,\n currentSize: state.current.width,\n prevDelta: this._prevDeltaX,\n gridEntries: this._columns.entries,\n startIndex: this._position.column.start,\n prevSnapped: this._prevSnappedWidth,\n };\n }\n\n private getResizeSpanProps(rect: DOMRect, isRow = false): ResizeSpanProps {\n return isRow\n ? {\n targetSize: rect.height,\n tilePosition: this.position.row,\n tileGridDimension: this.rows,\n gap: this.gap,\n isRow,\n }\n : {\n targetSize: rect.width,\n tilePosition: this.position.column,\n tileGridDimension: this.columns,\n gap: this.gap,\n isRow,\n };\n }\n}\n\nexport function createTileResizeState(): TileResizeState {\n return new TileResizeState();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"resize-state.js","sourceRoot":"","sources":["../../../src/components/tile-manager/resize-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAI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AAG,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,EACpE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,EAChC,IAAI,CAAC,IAAI,CACV,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,eAAe,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["import type { ResizeState } from '#internals/directives/resize.js';\nimport { firstOf } from '#internals/utils/arrays.js';\nimport { asNumber } from '#internals/utils/math.js';\nimport {\n calculatePosition,\n calculateResizedSpan,\n calculateSnappedDimension,\n} from './resize-util.js';\nimport type IgcTileComponent from './tile.js';\nimport type { TileGridDimension, TileGridPosition } from './types.js';\n\nconst CssValues = /(?<start>\\d+)?\\s*\\/?\\s*span\\s*(?<span>\\d+)?/gi;\n\ntype ResizeAxis = 'column' | 'row';\n\ntype ResizeAxisState = {\n dimension: TileGridDimension;\n prevDelta: number;\n prevSnapped: number;\n};\n\nfunction createAxisState(\n dimension: TileGridDimension = { entries: [], minSize: 0 }\n): ResizeAxisState {\n return { dimension, prevDelta: 0, prevSnapped: 0 };\n}\n\nfunction parseTileGridRect(tile: IgcTileComponent): TileGridPosition {\n const computed = getComputedStyle(tile);\n const { gridColumn, gridRow } = computed;\n\n const [column, row] = [\n firstOf(Array.from(gridColumn.matchAll(CssValues))).groups!,\n firstOf(Array.from(gridRow.matchAll(CssValues))).groups!,\n ];\n\n return {\n column: {\n start: asNumber(column.start, -1),\n span: asNumber(column.span, -1),\n },\n row: { start: asNumber(row.start, -1), span: asNumber(row.span, -1) },\n };\n}\n\nfunction parseTileParentGrid(gridContainer: HTMLElement) {\n const computed = getComputedStyle(gridContainer);\n const { gap, gridTemplateColumns, gridTemplateRows } = computed;\n\n return {\n gap: asNumber(gap),\n columns: {\n entries: gridTemplateColumns.split(' ').map(asNumber),\n minSize: asNumber(computed.getPropertyValue('--min-col-width')),\n },\n rows: {\n entries: gridTemplateRows.split(' ').map(asNumber),\n minSize: asNumber(computed.getPropertyValue('--min-row-height')),\n },\n };\n}\n\nclass TileResizeState {\n private _gap = 0;\n\n private _position: TileGridPosition = {\n column: { start: 0, span: 0 },\n row: { start: 0, span: 0 },\n };\n\n private _axes: Record<ResizeAxis, ResizeAxisState> = {\n column: createAxisState(),\n row: createAxisState(),\n };\n\n public calculateSnappedWidth(state: ResizeState): number {\n return this._calculateSnappedSize(\n 'column',\n state.deltaX,\n state.current.width\n );\n }\n\n public calculateSnappedHeight(state: ResizeState): number {\n return this._calculateSnappedSize(\n 'row',\n state.deltaY,\n state.current.height\n );\n }\n\n public updateState(\n tileRect: DOMRect,\n tile: IgcTileComponent,\n grid: HTMLElement\n ): void {\n this._initState(grid, tile);\n this._calculateTileStartPosition(grid, tileRect);\n }\n\n /**\n * Calculates and returns the CSS column and row properties of a tile after resizing,\n * based on its new dimensions and starting position.\n */\n public calculateResizedGridPosition(rect: DOMRect) {\n const { column, row } = this._position;\n\n // REVIEW pass col minSize and allowOverflow?\n column.span = calculateResizedSpan({\n targetSize: rect.width,\n tilePosition: column,\n tileGridDimension: this._axes.column.dimension,\n gap: this._gap,\n isRow: false,\n });\n\n row.span = calculateResizedSpan({\n targetSize: rect.height,\n tilePosition: row,\n tileGridDimension: this._axes.row.dimension,\n gap: this._gap,\n isRow: true,\n });\n\n return { colSpan: column.span, rowSpan: row.span };\n }\n\n private _calculateSnappedSize(\n axis: ResizeAxis,\n currentDelta: number,\n currentSize: number\n ): number {\n const axisState = this._axes[axis];\n\n const { snappedSize, newDelta } = calculateSnappedDimension({\n currentDelta,\n currentSize,\n prevDelta: axisState.prevDelta,\n prevSnapped: axisState.prevSnapped,\n gridEntries: axisState.dimension.entries,\n startIndex: this._position[axis].start,\n gap: this._gap,\n });\n\n axisState.prevDelta = newDelta;\n axisState.prevSnapped = snappedSize;\n return snappedSize;\n }\n\n private _initState(grid: HTMLElement, tile: IgcTileComponent): void {\n const { gap, columns, rows } = parseTileParentGrid(grid);\n\n this._gap = gap;\n this._position = parseTileGridRect(tile);\n this._axes = {\n column: createAxisState(columns),\n row: createAxisState(rows),\n };\n }\n\n /**\n * Resolves the tile's implicit grid start lines from its offset inside the\n * grid container when the tile has no explicit `colStart`/`rowStart`.\n */\n private _calculateTileStartPosition(\n grid: HTMLElement,\n tileRect: DOMRect\n ): void {\n const { column, row } = this._position;\n\n if (column.start >= 0 && row.start >= 0) {\n return;\n }\n\n const gridRect = grid.getBoundingClientRect();\n const computed = getComputedStyle(grid);\n\n if (column.start < 0) {\n column.start = calculatePosition(\n tileRect.left - gridRect.left - Number.parseFloat(computed.paddingLeft),\n this._axes.column.dimension.entries,\n this._gap\n );\n }\n\n if (row.start < 0) {\n row.start = calculatePosition(\n tileRect.top - gridRect.top - Number.parseFloat(computed.paddingTop),\n this._axes.row.dimension.entries,\n this._gap\n );\n }\n }\n}\n\nexport function createTileResizeState(): TileResizeState {\n return new TileResizeState();\n}\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { ResizeProps, ResizeSpanProps, SnappedDimension } from './types.js';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
calculateSnappedDimension(resizeProps: ResizeProps): SnappedDimension;
|
|
6
|
-
calculateResizedSpan(props: ResizeSpanProps): number;
|
|
7
|
-
calculatePosition(targetPosition: number, sizes: number[]): number;
|
|
8
|
-
}
|
|
2
|
+
export declare function calculateSnappedDimension(props: ResizeProps): SnappedDimension;
|
|
3
|
+
export declare function calculateResizedSpan(props: ResizeSpanProps): number;
|
|
4
|
+
export declare function calculatePosition(targetPosition: number, sizes: number[], gap: number): number;
|
|
@@ -1,84 +1,77 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function calculateSnappedDimension(props) {
|
|
2
|
+
const { currentDelta, prevDelta, currentSize, gridEntries, startIndex, prevSnapped, gap, } = props;
|
|
3
|
+
const effectiveDelta = currentDelta - prevDelta;
|
|
4
|
+
let snappedSize = currentSize;
|
|
5
|
+
if (Math.trunc(currentSize) < gridEntries[startIndex - 1]) {
|
|
6
|
+
return {
|
|
7
|
+
snappedSize: gridEntries[startIndex - 1],
|
|
8
|
+
newDelta: currentDelta,
|
|
9
|
+
};
|
|
4
10
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (let i = startIndex - 1; i < gridEntries.length; i++) {
|
|
20
|
-
const currentEntry = gridEntries[i];
|
|
21
|
-
const nextEntry = gridEntries[i + 1] ?? currentEntry;
|
|
22
|
-
const prevEntry = i > 0 ? gridEntries[i - 1] : currentEntry;
|
|
23
|
-
const halfwayExpand = accumulated + currentEntry + this.gap + nextEntry / 2;
|
|
24
|
-
const halfwayShrink = accumulated + prevEntry / 2;
|
|
25
|
-
const entryEnd = accumulated + currentEntry + this.gap;
|
|
26
|
-
if (effectiveDelta > 0) {
|
|
27
|
-
if (currentSize >= halfwayExpand &&
|
|
28
|
-
currentSize <= entryEnd + nextEntry) {
|
|
29
|
-
snappedSize = entryEnd + nextEntry;
|
|
30
|
-
}
|
|
11
|
+
if (effectiveDelta === 0 && prevSnapped) {
|
|
12
|
+
return { snappedSize: prevSnapped, newDelta: currentDelta };
|
|
13
|
+
}
|
|
14
|
+
let accumulated = 0;
|
|
15
|
+
for (let i = startIndex - 1; i < gridEntries.length; i++) {
|
|
16
|
+
const currentEntry = gridEntries[i];
|
|
17
|
+
const nextEntry = gridEntries[i + 1] ?? currentEntry;
|
|
18
|
+
const prevEntry = i > 0 ? gridEntries[i - 1] : currentEntry;
|
|
19
|
+
const halfwayExpand = accumulated + currentEntry + gap + nextEntry / 2;
|
|
20
|
+
const halfwayShrink = accumulated + prevEntry / 2;
|
|
21
|
+
const entryEnd = accumulated + currentEntry + gap;
|
|
22
|
+
if (effectiveDelta > 0) {
|
|
23
|
+
if (currentSize >= halfwayExpand && currentSize <= entryEnd + nextEntry) {
|
|
24
|
+
snappedSize = entryEnd + nextEntry;
|
|
31
25
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
26
|
+
}
|
|
27
|
+
else if (effectiveDelta < 0) {
|
|
28
|
+
if (currentSize <= halfwayShrink && currentSize > accumulated - gap) {
|
|
29
|
+
snappedSize = accumulated - gap;
|
|
37
30
|
}
|
|
38
|
-
accumulated += currentEntry + this.gap;
|
|
39
31
|
}
|
|
40
|
-
|
|
32
|
+
accumulated += currentEntry + gap;
|
|
41
33
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
return { snappedSize, newDelta: currentDelta };
|
|
35
|
+
}
|
|
36
|
+
export function calculateResizedSpan(props) {
|
|
37
|
+
const { targetSize, tilePosition, tileGridDimension, gap, isRow } = props;
|
|
38
|
+
const { entries, minSize } = tileGridDimension;
|
|
39
|
+
let accumulatedSize = 0;
|
|
40
|
+
let newSpan = tilePosition.span;
|
|
41
|
+
const sizesAfterStart = entries.slice(tilePosition.start - 1);
|
|
42
|
+
const availableSize = sizesAfterStart.reduce((sum, s) => sum + s, 0) +
|
|
43
|
+
(sizesAfterStart.length - 1) * gap;
|
|
44
|
+
if (targetSize <= sizesAfterStart[0] + gap) {
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
47
|
+
if (Math.trunc(targetSize) > Math.trunc(availableSize)) {
|
|
48
|
+
const remainingSize = targetSize - availableSize;
|
|
49
|
+
const additionalSpan = Math.ceil(remainingSize / (minSize + gap));
|
|
50
|
+
newSpan = sizesAfterStart.length + additionalSpan;
|
|
51
|
+
return isRow ? newSpan : Math.min(entries.length, newSpan);
|
|
52
|
+
}
|
|
53
|
+
for (let i = tilePosition.start - 1; i < entries.length; i++) {
|
|
54
|
+
const currentSize = entries[i];
|
|
55
|
+
const nextSize = entries[i + 1] ?? currentSize;
|
|
56
|
+
const halfwayPoint = accumulatedSize + currentSize + gap + nextSize / 2;
|
|
57
|
+
if (targetSize > halfwayPoint) {
|
|
58
|
+
newSpan = i + 3 - tilePosition.start;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const nextSize = entries[i + 1] ?? currentSize;
|
|
62
|
-
const halfwayPoint = accumulatedSize + currentSize + gap + nextSize / 2;
|
|
63
|
-
if (targetSize > halfwayPoint) {
|
|
64
|
-
newSpan = i + 3 - tilePosition.start;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
accumulatedSize += currentSize + gap;
|
|
60
|
+
else {
|
|
61
|
+
break;
|
|
70
62
|
}
|
|
71
|
-
|
|
63
|
+
accumulatedSize += currentSize + gap;
|
|
72
64
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
return newSpan;
|
|
66
|
+
}
|
|
67
|
+
export function calculatePosition(targetPosition, sizes, gap) {
|
|
68
|
+
let accumulatedSize = 0;
|
|
69
|
+
for (const [i, size] of sizes.entries()) {
|
|
70
|
+
accumulatedSize += size + gap;
|
|
71
|
+
if (Math.trunc(targetPosition) < Math.trunc(accumulatedSize - gap)) {
|
|
72
|
+
return i + 1;
|
|
80
73
|
}
|
|
81
|
-
return 1;
|
|
82
74
|
}
|
|
75
|
+
return 1;
|
|
83
76
|
}
|
|
84
77
|
//# sourceMappingURL=resize-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize-util.js","sourceRoot":"","sources":["../../../src/components/tile-manager/resize-util.ts"],"names":[],"mappings":"AAMA,MAAM,
|
|
1
|
+
{"version":3,"file":"resize-util.js","sourceRoot":"","sources":["../../../src/components/tile-manager/resize-util.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,yBAAyB,CACvC,KAAkB;IAElB,MAAM,EACJ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACX,GAAG,GACJ,GAAG,KAAK,CAAC;IAEV,MAAM,cAAc,GAAG,YAAY,GAAG,SAAS,CAAC;IAChD,IAAI,WAAW,GAAG,WAAW,CAAC;IAG9B,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC;QAC1D,OAAO;YACL,WAAW,EAAE,WAAW,CAAC,UAAU,GAAG,CAAC,CAAC;YACxC,QAAQ,EAAE,YAAY;SACvB,CAAC;IACJ,CAAC;IAGD,IAAI,cAAc,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC;QACxC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;IAC9D,CAAC;IAED,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzD,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC;QACrD,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;QAG5D,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,GAAG,GAAG,SAAS,GAAG,CAAC,CAAC;QACvE,MAAM,aA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AAI,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACxC,eAAe,IAAI,IAAI,GAAG,GAAG,CAAC;QAE9B,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,EAAE,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import type {\n ResizeProps,\n ResizeSpanProps,\n SnappedDimension,\n} from './types.js';\n\nexport function calculateSnappedDimension(\n props: ResizeProps\n): SnappedDimension {\n const {\n currentDelta,\n prevDelta,\n currentSize,\n gridEntries,\n startIndex,\n prevSnapped,\n gap,\n } = props;\n\n const effectiveDelta = currentDelta - prevDelta;\n let snappedSize = currentSize;\n\n // If current size is below minimum, force to the size of the starting cell.\n if (Math.trunc(currentSize) < gridEntries[startIndex - 1]) {\n return {\n snappedSize: gridEntries[startIndex - 1],\n newDelta: currentDelta,\n };\n }\n\n // If no change in delta and we have a snapped value, reuse it.\n if (effectiveDelta === 0 && prevSnapped) {\n return { snappedSize: prevSnapped, newDelta: currentDelta };\n }\n\n let accumulated = 0;\n for (let i = startIndex - 1; i < gridEntries.length; i++) {\n const currentEntry = gridEntries[i];\n const nextEntry = gridEntries[i + 1] ?? currentEntry;\n const prevEntry = i > 0 ? gridEntries[i - 1] : currentEntry;\n\n // Thresholds for snapping to the next or previous tile boundary.\n const halfwayExpand = accumulated + currentEntry + gap + nextEntry / 2;\n const halfwayShrink = accumulated + prevEntry / 2;\n const entryEnd = accumulated + currentEntry + gap;\n\n if (effectiveDelta > 0) {\n // Expanding: snap when passing the halfway threshold.\n if (currentSize >= halfwayExpand && currentSize <= entryEnd + nextEntry) {\n snappedSize = entryEnd + nextEntry;\n }\n } else if (effectiveDelta < 0) {\n // Shrinking: snap when falling below the halfway threshold.\n if (currentSize <= halfwayShrink && currentSize > accumulated - gap) {\n snappedSize = accumulated - gap;\n }\n }\n\n accumulated += currentEntry + gap;\n }\n\n return { snappedSize, newDelta: currentDelta };\n}\n\nexport function calculateResizedSpan(props: ResizeSpanProps): number {\n const { targetSize, tilePosition, tileGridDimension, gap, isRow } = props;\n const { entries, minSize } = tileGridDimension;\n\n let accumulatedSize = 0;\n let newSpan = tilePosition.span;\n\n const sizesAfterStart = entries.slice(tilePosition.start - 1);\n const availableSize =\n sizesAfterStart.reduce((sum, s) => sum + s, 0) +\n (sizesAfterStart.length - 1) * gap;\n\n if (targetSize <= sizesAfterStart[0] + gap) {\n return 1;\n }\n\n if (Math.trunc(targetSize) > Math.trunc(availableSize)) {\n const remainingSize = targetSize - availableSize;\n\n const additionalSpan = Math.ceil(remainingSize / (minSize + gap));\n newSpan = sizesAfterStart.length + additionalSpan;\n return isRow ? newSpan : Math.min(entries.length, newSpan);\n }\n\n for (let i = tilePosition.start - 1; i < entries.length; i++) {\n const currentSize = entries[i];\n const nextSize = entries[i + 1] ?? currentSize;\n\n const halfwayPoint = accumulatedSize + currentSize + gap + nextSize / 2;\n\n if (targetSize > halfwayPoint) {\n newSpan = i + 3 - tilePosition.start;\n } else {\n break;\n }\n\n accumulatedSize += currentSize + gap;\n }\n\n return newSpan;\n}\n\nexport function calculatePosition(\n targetPosition: number,\n sizes: number[],\n gap: number\n): number {\n let accumulatedSize = 0;\n\n for (const [i, size] of sizes.entries()) {\n accumulatedSize += size + gap;\n\n if (Math.trunc(targetPosition) < Math.trunc(accumulatedSize - gap)) {\n return i + 1;\n }\n }\n\n return 1;\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export interface SerializedTile {
|
|
|
12
12
|
id: string | null;
|
|
13
13
|
}
|
|
14
14
|
declare class TileManagerSerializer {
|
|
15
|
-
|
|
15
|
+
private readonly _tileManager;
|
|
16
16
|
constructor(tileManager: IgcTileManagerComponent);
|
|
17
17
|
save(): SerializedTile[];
|
|
18
18
|
saveAsJSON(): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
class TileManagerSerializer {
|
|
2
2
|
constructor(tileManager) {
|
|
3
|
-
this.
|
|
3
|
+
this._tileManager = tileManager;
|
|
4
4
|
}
|
|
5
5
|
save() {
|
|
6
|
-
return this.
|
|
6
|
+
return this._tileManager.tiles.map((tile) => {
|
|
7
7
|
return {
|
|
8
8
|
colSpan: tile.colSpan,
|
|
9
9
|
colStart: tile.colStart,
|
|
@@ -23,18 +23,17 @@ class TileManagerSerializer {
|
|
|
23
23
|
}
|
|
24
24
|
load(tiles) {
|
|
25
25
|
const mapped = new Map(tiles.map((tile) => [tile.id, tile]));
|
|
26
|
-
for (const tile of this.
|
|
27
|
-
if (!mapped.has(tile.id)) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
26
|
+
for (const tile of this._tileManager.tiles) {
|
|
30
27
|
const serialized = mapped.get(tile.id);
|
|
31
|
-
|
|
28
|
+
if (serialized) {
|
|
29
|
+
Object.assign(tile, serialized);
|
|
30
|
+
}
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
loadFromJSON(data) {
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
if (data) {
|
|
35
|
+
this.load(JSON.parse(data));
|
|
36
|
+
}
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
export function createSerializer(host) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/components/tile-manager/serializer.ts"],"names":[],"mappings":"AAeA,MAAM,qBAAqB;IAGzB,YAAY,WAAoC;QAC9C,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/components/tile-manager/serializer.ts"],"names":[],"mappings":"AAeA,MAAM,qBAAqB;IAGzB,YAAY,WAAoC;QAC9C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,C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IAA6B;IAC5D,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import type IgcTileManagerComponent from './tile-manager.js';\n\nexport interface SerializedTile {\n colSpan: number;\n colStart: number | null;\n disableFullscreen: boolean;\n disableMaximize: boolean;\n disableResize: boolean;\n maximized: boolean;\n position: number;\n rowSpan: number;\n rowStart: number | null;\n id: string | null;\n}\n\nclass TileManagerSerializer {\n private readonly _tileManager: IgcTileManagerComponent;\n\n constructor(tileManager: IgcTileManagerComponent) {\n this._tileManager = tileManager;\n }\n\n public save(): SerializedTile[] {\n return this._tileManager.tiles.map((tile) => {\n return {\n colSpan: tile.colSpan,\n colStart: tile.colStart,\n disableFullscreen: tile.disableFullscreen,\n disableMaximize: tile.disableMaximize,\n disableResize: tile.disableResize,\n maximized: tile.maximized,\n position: tile.position,\n rowSpan: tile.rowSpan,\n rowStart: tile.rowStart,\n id: tile.id,\n };\n });\n }\n\n public saveAsJSON(): string {\n return JSON.stringify(this.save());\n }\n\n public load(tiles: SerializedTile[]): void {\n const mapped = new Map(tiles.map((tile) => [tile.id, tile]));\n\n for (const tile of this._tileManager.tiles) {\n const serialized = mapped.get(tile.id);\n\n if (serialized) {\n Object.assign(tile, serialized);\n }\n }\n }\n\n public loadFromJSON(data: string): void {\n if (data) {\n this.load(JSON.parse(data));\n }\n }\n}\n\nexport function createSerializer(host: IgcTileManagerComponent) {\n return new TileManagerSerializer(host);\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `[part~=drag-over]::after,[part~=base]::after{content:"";position:absolute;pointer-events:none;inset:0;width:100%;height:100%;border-radius:inherit}:host{--component-size: var(--ig-size, var(--default-size));--_border-radius: var(--border-radius)}[part~=base]{background:var(--tile-background);border-radius:var(--_border-radius);box-shadow:var(--resting-elevation)}[part~=base]::after{border:.0625rem solid var(--border-color)}[part~=base]:not([part~=resizable]):hover::after{border:.0625rem solid var(--hover-border-color)}:host([part=resizing]),:host([part=dragging]){border-radius:var(--border-radius)}:host([part=dragging]){background:var(--placeholder-background);border:.0625rem solid var(--ghost-border)}[part~=base][part~=resizing]{opacity:.3}[part=content-container]{background:var(--content-background);color:var(--content-color)}[part=ghost]{border-radius:var(--border-radius);border:.0625rem solid var(--ghost-border);background:var(--overlay-background)}[part~=drag-over]::after{z-index:1000;border:.0625rem solid var(--ghost-border);background:var(--overlay-background)}[part=header]{background:var(--header-background);border-top-left-radius:var(--_border-radius);border-top-right-radius:var(--_border-radius)}[part=title]{color:var(--title-color)}igc-divider{--color: var(--divider-color)}
|
|
2
|
+
export const styles = css `[part~=active]::after,[part~=drag-over]::after,[part~=base]::after{content:"";position:absolute;pointer-events:none;inset:0;width:100%;height:100%;border-radius:inherit}:host{--component-size: var(--ig-size, var(--default-size));--_border-radius: var(--border-radius)}[part~=base]{background:var(--tile-background);border-radius:var(--_border-radius);box-shadow:var(--resting-elevation)}[part~=base]::after{border:.0625rem solid var(--border-color)}[part~=base]:not([part~=resizable]):hover::after{border:.0625rem solid var(--hover-border-color)}:host([part=resizing]),:host([part=dragging]){border-radius:var(--border-radius)}:host([part=dragging]){background:var(--placeholder-background);border:.0625rem solid var(--ghost-border)}[part~=base][part~=resizing]{opacity:.3}[part=content-container]{background:var(--content-background);color:var(--content-color)}[part=ghost]{border-radius:var(--border-radius);border:.0625rem solid var(--ghost-border);background:var(--overlay-background)}[part~=drag-over]::after{z-index:1000;border:.0625rem solid var(--ghost-border);background:var(--overlay-background)}[part=header]{background:var(--header-background);border-top-left-radius:var(--_border-radius);border-top-right-radius:var(--_border-radius)}[part=title]{color:var(--title-color)}igc-divider{--color: var(--divider-color)}[part~=active]::after{border-radius:var(--_border-radius);border:.0625rem solid var(--ghost-border)}[part~=trigger-side],[part~=trigger],[part~=trigger-bottom]{width:var(--_size);aspect-ratio:1;border-radius:50%;z-index:11111;background-color:var(--ghost-border)}[part~=custom]{background-color:rgba(0,0,0,0)}[part~=trigger-side][part~=custom],[part~=trigger][part~=custom]{right:0}[part~=trigger][part~=custom],[part~=trigger-bottom][part~=custom]{bottom:0}`;
|
|
3
3
|
//# sourceMappingURL=tile.common.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile.common.css.js","sourceRoot":"","sources":["../../../../../../src/components/tile-manager/themes/shared/tile/tile.common.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"tile.common.css.js","sourceRoot":"","sources":["../../../../../../src/components/tile-manager/themes/shared/tile/tile.common.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,2vDAA2vD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`[part~=active]::after,[part~=drag-over]::after,[part~=base]::after{content:\"\";position:absolute;pointer-events:none;inset:0;width:100%;height:100%;border-radius:inherit}:host{--component-size: var(--ig-size, var(--default-size));--_border-radius: var(--border-radius)}[part~=base]{background:var(--tile-background);border-radius:var(--_border-radius);box-shadow:var(--resting-elevation)}[part~=base]::after{border:.0625rem solid var(--border-color)}[part~=base]:not([part~=resizable]):hover::after{border:.0625rem solid var(--hover-border-color)}:host([part=resizing]),:host([part=dragging]){border-radius:var(--border-radius)}:host([part=dragging]){background:var(--placeholder-background);border:.0625rem solid var(--ghost-border)}[part~=base][part~=resizing]{opacity:.3}[part=content-container]{background:var(--content-background);color:var(--content-color)}[part=ghost]{border-radius:var(--border-radius);border:.0625rem solid var(--ghost-border);background:var(--overlay-background)}[part~=drag-over]::after{z-index:1000;border:.0625rem solid var(--ghost-border);background:var(--overlay-background)}[part=header]{background:var(--header-background);border-top-left-radius:var(--_border-radius);border-top-right-radius:var(--_border-radius)}[part=title]{color:var(--title-color)}igc-divider{--color: var(--divider-color)}[part~=active]::after{border-radius:var(--_border-radius);border:.0625rem solid var(--ghost-border)}[part~=trigger-side],[part~=trigger],[part~=trigger-bottom]{width:var(--_size);aspect-ratio:1;border-radius:50%;z-index:11111;background-color:var(--ghost-border)}[part~=custom]{background-color:rgba(0,0,0,0)}[part~=trigger-side][part~=custom],[part~=trigger][part~=custom]{right:0}[part~=trigger][part~=custom],[part~=trigger-bottom][part~=custom]{bottom:0}`;\n "]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{--pad-block: max(var(--is-large, 1) * max(0.8125rem, -1 * 0.8125rem), var(--is-medium, 1) * max(0.8125rem, -1 * 0.8125rem), var(--is-small, 1) * max(0.5rem, -1 * 0.5rem));--pad-inline: max(var(--is-large, 1) * max(1.25rem, -1 * 1.25rem), var(--is-medium, 1) * max(1rem, -1 * 1rem), var(--is-small, 1) * max(0.75rem, -1 * 0.75rem));display:block;position:relative;grid-column:var(--ig-col-start, auto)/span var(--ig-col-span, 1);grid-row:var(--ig-row-start, auto)/span var(--ig-row-span, 1)}:host([part=resizing])
|
|
2
|
+
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{--pad-block: max(var(--is-large, 1) * max(0.8125rem, -1 * 0.8125rem), var(--is-medium, 1) * max(0.8125rem, -1 * 0.8125rem), var(--is-small, 1) * max(0.5rem, -1 * 0.5rem));--pad-inline: max(var(--is-large, 1) * max(1.25rem, -1 * 1.25rem), var(--is-medium, 1) * max(1rem, -1 * 1rem), var(--is-small, 1) * max(0.75rem, -1 * 0.75rem));display:block;position:relative;grid-column:var(--ig-col-start, auto)/span var(--ig-col-span, 1);grid-row:var(--ig-row-start, auto)/span var(--ig-row-span, 1)}:host([part=resizing]) [part~=trigger-side],:host([part=resizing]) [part~=trigger],:host([part=resizing]) [part~=trigger-bottom],:host([part=dragging]) [part~=trigger-side],:host([part=dragging]) [part~=trigger],:host([part=dragging]) [part~=trigger-bottom]{visibility:hidden}:host([part=resizing]) [part~=active]::after,:host([part=dragging]) [part~=active]::after{border:none}[part~=tile-container]{position:relative;width:100%;height:100%}[part~=trigger-side],[part~=trigger],[part~=trigger-bottom]{--_size: 0.6875rem;display:inline-flex;position:absolute;z-index:1}[part~=trigger-side]{top:calc(50% - var(--_size));right:calc(var(--_size)/2*-1);cursor:e-resize}[part~=trigger]{bottom:calc(var(--_size)/2*-1);right:calc(var(--_size)/2*-1);cursor:se-resize}[part~=trigger-bottom]{left:calc(50% - var(--_size));bottom:calc(var(--_size)/2*-1);cursor:s-resize}[part~=trigger]:focus{outline:none}[part~=base]{width:100%;height:100%;overflow:hidden}[part=content-container]{display:block;border-radius:inherit}[part=content-container] ::slotted(*){font-family:var(--ig-body-1-font-family, var(--ig-font-family));font-size:var(--ig-body-1-font-size);font-weight:var(--ig-body-1-font-weight);font-style:var(--ig-body-1-font-style);line-height:var(--ig-body-1-line-height);letter-spacing:var(--ig-body-1-letter-spacing);text-transform:var(--ig-body-1-text-transform);margin-top:var(--ig-body-1-margin-top);margin-bottom:var(--ig-body-1-margin-bottom);margin:0}:host([maximized]){position:absolute;inset:0;width:100%;height:100%;z-index:10;grid-column:unset;grid-row:unset}:host([maximized]) [part~=base]{width:100%;height:100%}[part=ghost]{position:absolute;top:0;left:0;width:100%;height:100%;transform:scale(0);z-index:10}[part=header]{display:flex;align-items:center;gap:max(var(--is-large, 1)*max(1rem, -1 * 1rem),var(--is-medium, 1)*max(1rem, -1 * 1rem),var(--is-small, 1)*max(0.75rem, -1 * 0.75rem));width:100%;padding-block:var(--pad-block);padding-inline:var(--pad-inline)}:host([disable-fullscreen][disable-maximize]) igc-divider{display:none}[part=title]{display:flex;flex-direction:column;justify-content:center;flex:1 0 0%;overflow:hidden;min-width:2ch}::slotted([slot=title]){font-family:var(--ig-h6-font-family, var(--ig-font-family));font-size:var(--ig-h6-font-size);font-weight:var(--ig-h6-font-weight);font-style:var(--ig-h6-font-style);line-height:var(--ig-h6-line-height);letter-spacing:var(--ig-h6-letter-spacing);text-transform:var(--ig-h6-text-transform);margin-top:var(--ig-h6-margin-top);margin-bottom:var(--ig-h6-margin-bottom);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%;min-width:2ch;margin-bottom:0;display:block}[part=actions]{display:flex;gap:.5rem;margin-inline-start:auto;flex-shrink:0}`;
|
|
3
3
|
//# sourceMappingURL=tile.base.css.js.map
|