@worktile/theia 15.0.14 → 15.0.15
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/esm2020/plugins/table/components/table.component.mjs +9 -3
- package/esm2020/services/context.service.mjs +16 -6
- package/fesm2015/worktile-theia.mjs +31 -14
- package/fesm2015/worktile-theia.mjs.map +1 -1
- package/fesm2020/worktile-theia.mjs +23 -7
- package/fesm2020/worktile-theia.mjs.map +1 -1
- package/package.json +1 -1
- package/services/context.service.d.ts +8 -0
|
@@ -26,7 +26,7 @@ import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
|
26
26
|
import * as i8$1 from 'ngx-tethys/divider';
|
|
27
27
|
import { ThyDividerComponent, ThyDividerModule } from 'ngx-tethys/divider';
|
|
28
28
|
import { mixinUnsubscribe, MixinBase, ScrollToService } from 'ngx-tethys/core';
|
|
29
|
-
import { isKeyHotkey
|
|
29
|
+
import { isKeyHotkey } from 'is-hotkey';
|
|
30
30
|
import { Subject, fromEvent, timer, combineLatest, Observable, BehaviorSubject, merge, ReplaySubject } from 'rxjs';
|
|
31
31
|
import { takeUntil, debounceTime, take, delay, map as map$1, filter, startWith, distinctUntilChanged, skip, share, mapTo, pairwise } from 'rxjs/operators';
|
|
32
32
|
import * as i5 from 'ngx-tethys/input';
|
|
@@ -3161,6 +3161,7 @@ class TheContextService {
|
|
|
3161
3161
|
this.containerScrolled$ = new Subject();
|
|
3162
3162
|
this.uploadingStatus$ = new Subject();
|
|
3163
3163
|
this.containerResized$ = new Subject();
|
|
3164
|
+
this.theEditorResized$ = new Subject();
|
|
3164
3165
|
this.windowResized$ = new Subject();
|
|
3165
3166
|
this.ngZone.runOutsideAngular(() => {
|
|
3166
3167
|
this.onMouseUp$ = fromEvent(window, `mouseup`).pipe(takeUntil(this.destroy$));
|
|
@@ -3170,19 +3171,21 @@ class TheContextService {
|
|
|
3170
3171
|
}
|
|
3171
3172
|
initialize(options) {
|
|
3172
3173
|
this.options = options;
|
|
3174
|
+
this.containerElement =
|
|
3175
|
+
this.options.nativeElement.closest(this.options.theOptions?.scrollContainer) ||
|
|
3176
|
+
this.options.nativeElement.querySelector(this.options.theOptions?.scrollContainer);
|
|
3173
3177
|
this.rebindContainerScroll();
|
|
3174
3178
|
this.bindContainerResize();
|
|
3179
|
+
this.bindTheEditorResize();
|
|
3175
3180
|
this.bindWindowResize();
|
|
3176
3181
|
}
|
|
3177
3182
|
rebindContainerScroll() {
|
|
3178
3183
|
this.scrollSubscription?.unsubscribe();
|
|
3179
3184
|
if (this.options.theOptions?.scrollContainer) {
|
|
3180
|
-
|
|
3181
|
-
this.options.nativeElement.querySelector(this.options.theOptions?.scrollContainer);
|
|
3182
|
-
if (containerElement) {
|
|
3185
|
+
if (this.containerElement) {
|
|
3183
3186
|
this.ngZone.runOutsideAngular(() => {
|
|
3184
3187
|
let previousContainerScroll = { x: 0, y: 0 };
|
|
3185
|
-
this.scrollSubscription = fromEvent(containerElement, 'scroll').subscribe(event => {
|
|
3188
|
+
this.scrollSubscription = fromEvent(this.containerElement, 'scroll').subscribe(event => {
|
|
3186
3189
|
const entires = { event, direction: ScrollDirection.Y };
|
|
3187
3190
|
const target = event.target;
|
|
3188
3191
|
const [x, y] = [target.scrollLeft, target.scrollTop];
|
|
@@ -3200,7 +3203,12 @@ class TheContextService {
|
|
|
3200
3203
|
}
|
|
3201
3204
|
}
|
|
3202
3205
|
bindContainerResize() {
|
|
3203
|
-
|
|
3206
|
+
if (this.containerElement) {
|
|
3207
|
+
this.containerResizeObserver = this.elementResize(this.containerElement, this.containerResized$);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
bindTheEditorResize() {
|
|
3211
|
+
this.theEditorResizeObserver = this.elementResize(this.options.nativeElement, this.theEditorResized$);
|
|
3204
3212
|
}
|
|
3205
3213
|
bindWindowResize() {
|
|
3206
3214
|
this.windowResizeObserver = this.elementResize(document.documentElement, this.windowResized$);
|
|
@@ -3251,8 +3259,10 @@ class TheContextService {
|
|
|
3251
3259
|
ngOnDestroy() {
|
|
3252
3260
|
this.uploadingStatus$.complete();
|
|
3253
3261
|
this.containerScrolled$?.complete();
|
|
3262
|
+
this.theEditorResized$?.complete();
|
|
3254
3263
|
this.containerResized$?.complete();
|
|
3255
3264
|
this.containerResizeObserver?.disconnect();
|
|
3265
|
+
this.theEditorResizeObserver?.disconnect();
|
|
3256
3266
|
this.windowResized$?.complete();
|
|
3257
3267
|
this.windowResizeObserver?.disconnect();
|
|
3258
3268
|
this.scrollSubscription?.unsubscribe();
|
|
@@ -12898,9 +12908,15 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12898
12908
|
this.tableRectLeft = left;
|
|
12899
12909
|
this.subscribeScrollContainerScroll();
|
|
12900
12910
|
this.contextService.containerResized$.pipe(takeUntil(this.destroy$)).subscribe(result => {
|
|
12911
|
+
if (result.widthChanged) {
|
|
12912
|
+
this.setHeaderRowLeftStyle();
|
|
12913
|
+
}
|
|
12914
|
+
});
|
|
12915
|
+
this.contextService.theEditorResized$.pipe(takeUntil(this.destroy$)).subscribe(result => {
|
|
12901
12916
|
if (result.widthChanged) {
|
|
12902
12917
|
this.setGridColumnsStyle();
|
|
12903
12918
|
this.setStickyRowStyle();
|
|
12919
|
+
this.setHeaderRowShadow();
|
|
12904
12920
|
this.bindTableScrollingShadow();
|
|
12905
12921
|
}
|
|
12906
12922
|
});
|
|
@@ -13451,7 +13467,7 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
13451
13467
|
fromEvent(document, 'keydown')
|
|
13452
13468
|
.pipe(takeUntil(this.destroy$), filter((e) => !!e))
|
|
13453
13469
|
.subscribe((event) => {
|
|
13454
|
-
if (
|
|
13470
|
+
if (isKeyHotkey('mod', event) && !this.readonly) {
|
|
13455
13471
|
this.tableStore.pointerSelection = true;
|
|
13456
13472
|
const cell = this.tbodyElement.nativeElement.querySelector('.focused-cell');
|
|
13457
13473
|
cell && this.tableStore.selectCellStart(cell, this.editor);
|