@worktile/theia 15.0.2 → 15.0.3
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/components/color-select/color-select.component.scss +20 -21
- package/components/column-resize/column-resize.scss +10 -10
- package/components/contextmenu/contextmenu.component.scss +1 -1
- package/components/conversion-hint/conversion-hint.component.scss +1 -1
- package/components/index.scss +1 -1
- package/components/inline-toolbar/inline-toolbar.component.scss +3 -3
- package/components/plugin-menu/plugin-menu.component.scss +5 -3
- package/components/table-select/table-select.component.scss +3 -3
- package/components/toolbar/toolbar.component.scss +5 -5
- package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +1 -3
- package/components/toolbar-dropdown/toolbar-dropdown.component.scss +5 -5
- package/esm2020/components/listbox/listbox.mjs +1 -1
- package/esm2020/components/toolbar-dropdown/toolbar-dropdown.component.mjs +3 -5
- package/esm2020/editor.component.mjs +2 -2
- package/esm2020/plugins/code/code.component.mjs +1 -1
- package/esm2020/plugins/common/auto-insert-data..mjs +10 -11
- package/esm2020/plugins/table/components/table.component.mjs +72 -17
- package/esm2020/plugins/table/components/td/td.component.mjs +1 -1
- package/esm2020/plugins/table/table.types.mjs +5 -1
- package/esm2020/services/context.service.mjs +1 -1
- package/esm2020/utils/dom.mjs +2 -2
- package/fesm2015/worktile-theia.mjs +91 -33
- package/fesm2015/worktile-theia.mjs.map +1 -1
- package/fesm2020/worktile-theia.mjs +87 -31
- package/fesm2020/worktile-theia.mjs.map +1 -1
- package/package.json +1 -1
- package/plugins/code/code.component.scss +29 -27
- package/plugins/image/image.component.scss +32 -32
- package/plugins/inline-code/inline-code.component.scss +13 -13
- package/plugins/link/link.component.scss +1 -1
- package/plugins/quick-insert/components/quick-insert.component.scss +2 -2
- package/plugins/table/components/mixins.scss +16 -17
- package/plugins/table/components/table.component.d.ts +10 -0
- package/plugins/table/components/table.component.scss +128 -100
- package/plugins/table/table.types.d.ts +4 -0
- package/plugins/todo-item/todo-item.component.scss +3 -3
- package/styles/editor.scss +15 -15
- package/styles/mixins.scss +1 -1
- package/styles/typo.scss +34 -34
- package/styles/variables.scss +5 -2
|
@@ -2240,7 +2240,7 @@ function coercePixelsFromCssValue(cssValue) {
|
|
|
2240
2240
|
function getElementWidth(element) {
|
|
2241
2241
|
// Optimization: Check style.width first as we probably set it already before reading
|
|
2242
2242
|
// offsetWidth which triggers layout.
|
|
2243
|
-
return coercePixelsFromCssValue(element.style.width) || element.
|
|
2243
|
+
return coercePixelsFromCssValue(element.style.width) || element.getBoundingClientRect().width;
|
|
2244
2244
|
}
|
|
2245
2245
|
function getElementHeight(element) {
|
|
2246
2246
|
return element.getBoundingClientRect().height;
|
|
@@ -2802,15 +2802,13 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
|
|
|
2802
2802
|
}
|
|
2803
2803
|
}
|
|
2804
2804
|
TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2$1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
2805
|
-
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown",
|
|
2805
|
+
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode\"\n thyAction\n [thyActionIcon]=\"activeIcon\"\n [thyActionActive]=\"activeDropdown\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon *ngIf=\"!toolbarItem.isHideDropdownActionIcon\" class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n class=\"d-flex justify-content-between text-secondary\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"activeKeys.includes(menu.key)\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <div class=\"d-flex align-items-center\">\n <thy-icon\n class=\"text-secondary\"\n *ngIf=\"menu?.icon && mode === dropdownMode.icon\"\n thyDropdownMenuItemIcon\n [thyIconName]=\"menu.icon\"\n ></thy-icon>\n <span class=\"text-body\" *ngIf=\"menu?.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </div>\n <div class=\"menu-item-right font-size-sm text-muted\" *ngIf=\"menu?.shortcutKey\">{{ menu.shortcutKey }}</div>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i6.ThyDropdownMenuDividerComponent, selector: "thy-dropdown-menu-divider" }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: i6.ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: i6.ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }] });
|
|
2806
2806
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: TheToolbarDropdownComponent, decorators: [{
|
|
2807
2807
|
type: Component,
|
|
2808
2808
|
args: [{ selector: 'the-toolbar-dropdown', template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode\"\n thyAction\n [thyActionIcon]=\"activeIcon\"\n [thyActionActive]=\"activeDropdown\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon *ngIf=\"!toolbarItem.isHideDropdownActionIcon\" class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n class=\"d-flex justify-content-between text-secondary\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"activeKeys.includes(menu.key)\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <div class=\"d-flex align-items-center\">\n <thy-icon\n class=\"text-secondary\"\n *ngIf=\"menu?.icon && mode === dropdownMode.icon\"\n thyDropdownMenuItemIcon\n [thyIconName]=\"menu.icon\"\n ></thy-icon>\n <span class=\"text-body\" *ngIf=\"menu?.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </div>\n <div class=\"menu-item-right font-size-sm text-muted\" *ngIf=\"menu?.shortcutKey\">{{ menu.shortcutKey }}</div>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n" }]
|
|
2809
2809
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2$1.Overlay }]; }, propDecorators: { className: [{
|
|
2810
2810
|
type: HostBinding,
|
|
2811
2811
|
args: ['class']
|
|
2812
|
-
}], itemMousedownHandle: [{
|
|
2813
|
-
type: Input
|
|
2814
2812
|
}], iconModeTemplate: [{
|
|
2815
2813
|
type: ViewChild,
|
|
2816
2814
|
args: ['iconModeTemplate', { static: true }]
|
|
@@ -3380,6 +3378,10 @@ var TableOperations;
|
|
|
3380
3378
|
const BASE_CELL_HEIGHT = 41; // min height
|
|
3381
3379
|
const BASE_FILL_HEIGHT = 2 * 8 + 1; // padding * 2 + border 1
|
|
3382
3380
|
const BASE_CELL_INNER_HEIGHT = BASE_CELL_HEIGHT - BASE_FILL_HEIGHT; // 24
|
|
3381
|
+
const TABLE_INSERT_MASK$1 = 19;
|
|
3382
|
+
const TABLE_BORDER$1 = 1;
|
|
3383
|
+
const TABLE_PADDING$1 = 8;
|
|
3384
|
+
const TABLE_CONTROL = 11;
|
|
3383
3385
|
const TableWithStickyRowClass = 'the-table-with-sticky-row';
|
|
3384
3386
|
class TableOptions {
|
|
3385
3387
|
constructor(options) {
|
|
@@ -7053,7 +7055,7 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
7053
7055
|
}
|
|
7054
7056
|
}
|
|
7055
7057
|
TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$2.ThyNotifyService }, { token: TheContextService }, { token: i0.NgZone }, { token: THE_MODE_TOKEN }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2$1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
7056
|
-
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, read: TemplateRef, static: true }, { propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdownComponent", first: true, predicate: TheToolbarDropdownComponent, descendants: true, read: TheToolbarDropdownComponent }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readOnly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsedAndNonReadonly\"></thy-resize-handle>\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (click)=\"onCopy($event)\"></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { kind: "component", type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "component", type: i10$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i7.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: i13.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "options", "delayRefreshTime"], outputs: ["focusChange"] }, { kind: "component", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown"
|
|
7058
|
+
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, read: TemplateRef, static: true }, { propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdownComponent", first: true, predicate: TheToolbarDropdownComponent, descendants: true, read: TheToolbarDropdownComponent }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readOnly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsedAndNonReadonly\"></thy-resize-handle>\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (click)=\"onCopy($event)\"></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { kind: "component", type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "component", type: i10$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i7.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: i13.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "options", "delayRefreshTime"], outputs: ["focusChange"] }, { kind: "component", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown" }, { kind: "directive", type: ThePreventDefaultDirective, selector: "[thePreventDefault]", exportAs: ["thePreventDefault"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7057
7059
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: TheCodeComponent, decorators: [{
|
|
7058
7060
|
type: Component,
|
|
7059
7061
|
args: [{ selector: 'div[theCode]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readOnly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsedAndNonReadonly\"></thy-resize-handle>\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (click)=\"onCopy($event)\"></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n" }]
|
|
@@ -7285,7 +7287,7 @@ const withAutoInsertData = (editor) => {
|
|
|
7285
7287
|
});
|
|
7286
7288
|
return;
|
|
7287
7289
|
}
|
|
7288
|
-
const [
|
|
7290
|
+
const [, anchorBlockPath] = anchorBlockEntry(editor);
|
|
7289
7291
|
const nextPath = Path.next([anchorBlockPath[0]]);
|
|
7290
7292
|
Transforms.insertNodes(editor, fragment, { at: nextPath });
|
|
7291
7293
|
Transforms.select(editor, Editor.start(editor, nextPath));
|
|
@@ -7296,15 +7298,14 @@ const withAutoInsertData = (editor) => {
|
|
|
7296
7298
|
const isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
|
|
7297
7299
|
const emptyPath = Path.parent(editor.selection.anchor.path);
|
|
7298
7300
|
Transforms.insertNodes(editor, fragment);
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
}
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
}
|
|
7301
|
+
isEmptyParagraph$1 && Transforms.delete(editor, { at: emptyPath });
|
|
7302
|
+
const lastPath = emptyPath.pop();
|
|
7303
|
+
const currentPath = [...emptyPath, lastPath + fragment.length - (isEmptyParagraph$1 ? 1 : 0)];
|
|
7304
|
+
const nextPath = Path.next(currentPath);
|
|
7305
|
+
const [nextNode] = findNode(editor, { at: nextPath });
|
|
7306
|
+
const isBlockCard = editor.isBlockCard(nextNode);
|
|
7307
|
+
const leftCursorPath = { path: nextPath, offset: isBlockCard ? -1 : 0 };
|
|
7308
|
+
Transforms.select(editor, leftCursorPath);
|
|
7308
7309
|
AngularEditor.focus(editor);
|
|
7309
7310
|
Transforms.collapse(editor, { edge: 'end' });
|
|
7310
7311
|
});
|
|
@@ -12664,6 +12665,7 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12664
12665
|
});
|
|
12665
12666
|
this.getIsInTable();
|
|
12666
12667
|
this.getColControls();
|
|
12668
|
+
this.setHeaderRowShadow();
|
|
12667
12669
|
}
|
|
12668
12670
|
this.headerRow = this.getHeaderRow();
|
|
12669
12671
|
}
|
|
@@ -12685,6 +12687,40 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12685
12687
|
this.destroy$ = new Subject();
|
|
12686
12688
|
this.rowControls = [];
|
|
12687
12689
|
this.colControls = [];
|
|
12690
|
+
/* 给标题行的左/右加阴影 */
|
|
12691
|
+
this.setHeaderRowShadow = () => {
|
|
12692
|
+
// 固定标题行遮盖
|
|
12693
|
+
this.tableWrapper.nativeElement.style.zIndex = this.isStickyTop ? '3' : '0';
|
|
12694
|
+
const headerRowRightShadow = this.headerRowRightShadow.nativeElement;
|
|
12695
|
+
const headerRowLeftShadow = this.headerRowLeftShadow.nativeElement;
|
|
12696
|
+
if (this.isLeftShadow || this.isRightShadow) {
|
|
12697
|
+
let { height, top } = this.calcHeaderRowShadow();
|
|
12698
|
+
let { left, width } = this.tableWrapper.nativeElement.getBoundingClientRect();
|
|
12699
|
+
if (this.isRightShadow) {
|
|
12700
|
+
headerRowRightShadow.style.height = height + 'px';
|
|
12701
|
+
headerRowRightShadow.style.top = top + 'px';
|
|
12702
|
+
headerRowRightShadow.style.left = left + width - 8 + 'px';
|
|
12703
|
+
}
|
|
12704
|
+
if (this.isLeftShadow) {
|
|
12705
|
+
headerRowLeftShadow.style.height = height + 'px';
|
|
12706
|
+
headerRowLeftShadow.style.top = top + 'px';
|
|
12707
|
+
const rowControl = this.elementRef.nativeElement.querySelector('.the-table-row-controls-wrapper');
|
|
12708
|
+
rowControl.style.zIndex = this.isCollapsedAndNonReadonly ? '4' : '1';
|
|
12709
|
+
}
|
|
12710
|
+
}
|
|
12711
|
+
};
|
|
12712
|
+
this.calcHeaderRowShadow = () => {
|
|
12713
|
+
const headerRowHeight = this.calculateRowControls()[0]?.height;
|
|
12714
|
+
let height = headerRowHeight;
|
|
12715
|
+
// 默认(没有聚焦)的 top 值:滚动容器高度 + 表格的padding(8)
|
|
12716
|
+
let top = this.scrollContainerTop + TABLE_PADDING$1;
|
|
12717
|
+
// 聚焦状态下: 高度 + control(11),top 加一个 mask(19)
|
|
12718
|
+
if (this.isCollapsedAndNonReadonly) {
|
|
12719
|
+
height = height + TABLE_CONTROL;
|
|
12720
|
+
top = top + TABLE_INSERT_MASK$1 - 1;
|
|
12721
|
+
}
|
|
12722
|
+
return { height, top };
|
|
12723
|
+
};
|
|
12688
12724
|
}
|
|
12689
12725
|
ngOnInit() {
|
|
12690
12726
|
super.ngOnInit();
|
|
@@ -12840,10 +12876,8 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12840
12876
|
}
|
|
12841
12877
|
setHeaderRowStyle() {
|
|
12842
12878
|
this.setGridColumnsStyle();
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
this.setStickyRowStyle();
|
|
12846
|
-
});
|
|
12879
|
+
this.setStickyRowStyle();
|
|
12880
|
+
this.setHeaderRowShadow();
|
|
12847
12881
|
}
|
|
12848
12882
|
setGridColumnsStyle() {
|
|
12849
12883
|
const colControl = this.columnControlsWrapper.nativeElement;
|
|
@@ -12856,7 +12890,7 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12856
12890
|
tableWidth = this.element.options?.numberedColumn ? tableWidth - tablePadding : tableWidth;
|
|
12857
12891
|
const colgroup = this.nativeElement.querySelector('colgroup');
|
|
12858
12892
|
let cellElements;
|
|
12859
|
-
if (colgroup) {
|
|
12893
|
+
if (colgroup && !this.tableStore.isFullscreen) {
|
|
12860
12894
|
cellElements = [...this.nativeElement.querySelector('colgroup').children];
|
|
12861
12895
|
}
|
|
12862
12896
|
else {
|
|
@@ -12875,18 +12909,18 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12875
12909
|
setStickyRowStyle() {
|
|
12876
12910
|
const colControl = this.columnControlsWrapper.nativeElement;
|
|
12877
12911
|
const headerRow = this.nativeElement.querySelector('tbody tr');
|
|
12878
|
-
const rowControlButton = this.rowControlsButtonWrapper.first?.nativeElement;
|
|
12879
12912
|
const rowControlInner = this.rowControlsInner.nativeElement;
|
|
12880
12913
|
const tableCornerBtn = this.cornerControl.nativeElement;
|
|
12881
12914
|
const headerRowHeight = this.calculateRowControls()[0]?.height;
|
|
12915
|
+
const numberedColumn = this.element.options?.numberedColumn;
|
|
12882
12916
|
if (this.isStickyTop) {
|
|
12883
12917
|
this.renderer.addClass(this.nativeElement, TableWithStickyRowClass);
|
|
12884
12918
|
this.updateStickyRowScrollLeft();
|
|
12885
|
-
const numberedColumn = this.element.options?.numberedColumn;
|
|
12886
12919
|
const top = this.isInTable ? this.scrollContainerTop + 36 : this.scrollContainerTop;
|
|
12887
12920
|
this.renderer.setStyle(headerRow, 'top', top + 'px');
|
|
12921
|
+
this.renderer.setStyle(headerRow, 'height', `${headerRowHeight}px`);
|
|
12888
12922
|
if (this.isInTable || numberedColumn) {
|
|
12889
|
-
[colControl, tableCornerBtn
|
|
12923
|
+
[colControl, tableCornerBtn].map(item => {
|
|
12890
12924
|
item && this.renderer.setStyle(item, 'top', this.scrollContainerTop + 'px');
|
|
12891
12925
|
});
|
|
12892
12926
|
}
|
|
@@ -12897,25 +12931,37 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12897
12931
|
}
|
|
12898
12932
|
else {
|
|
12899
12933
|
this.renderer.removeClass(this.nativeElement, TableWithStickyRowClass);
|
|
12900
|
-
[headerRow, colControl, tableCornerBtn
|
|
12934
|
+
[headerRow, colControl, tableCornerBtn].map(item => {
|
|
12901
12935
|
item && this.renderer.setStyle(item, 'top', null);
|
|
12902
12936
|
});
|
|
12903
12937
|
this.renderer.setStyle(this.theTableElement.nativeElement, 'padding-top', null);
|
|
12904
12938
|
this.renderer.setStyle(rowControlInner, 'padding-top', null);
|
|
12905
12939
|
}
|
|
12940
|
+
// setTimeout: 需要等待 rowControls 在 dom 中渲染完毕后才能获取到 rowControlButton
|
|
12941
|
+
setTimeout(() => {
|
|
12942
|
+
const rowControlButton = this.rowControlsButtonWrapper.first?.nativeElement;
|
|
12943
|
+
if (this.isStickyTop) {
|
|
12944
|
+
if ((this.isInTable || numberedColumn) && rowControlButton) {
|
|
12945
|
+
this.renderer.setStyle(rowControlButton, 'top', this.scrollContainerTop + 'px');
|
|
12946
|
+
}
|
|
12947
|
+
}
|
|
12948
|
+
else {
|
|
12949
|
+
rowControlButton && this.renderer.setStyle(rowControlButton, 'top', null);
|
|
12950
|
+
}
|
|
12951
|
+
});
|
|
12906
12952
|
}
|
|
12907
12953
|
bindTableScrollingShadow() {
|
|
12908
12954
|
const nativeElement = this.tableWrapper.nativeElement;
|
|
12909
12955
|
const scrollLeft = nativeElement.scrollLeft;
|
|
12910
12956
|
const scrollWidth = nativeElement.scrollWidth;
|
|
12911
12957
|
const clientWidth = nativeElement.clientWidth;
|
|
12912
|
-
|
|
12913
|
-
|
|
12958
|
+
this.isLeftShadow = scrollLeft > 0;
|
|
12959
|
+
this.isRightShadow = scrollLeft + clientWidth < scrollWidth;
|
|
12914
12960
|
const rows = nativeElement.querySelectorAll(`tr`);
|
|
12915
12961
|
const stickyCells = Array.from(rows).map(item => item.querySelector('th') || item.querySelector('td'));
|
|
12916
12962
|
const isColumnHeader = this.freezeColumnPipe.transform(this.element, this.tablePluginOptions);
|
|
12917
12963
|
const elements = isColumnHeader ? stickyCells : [nativeElement.parentElement];
|
|
12918
|
-
if (isLeftShadow) {
|
|
12964
|
+
if (this.isLeftShadow) {
|
|
12919
12965
|
elements.forEach(element => {
|
|
12920
12966
|
element.classList.add('the-table-left-shadow');
|
|
12921
12967
|
});
|
|
@@ -12925,7 +12971,7 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
12925
12971
|
item.classList.remove('the-table-left-shadow');
|
|
12926
12972
|
});
|
|
12927
12973
|
}
|
|
12928
|
-
if (isRightShadow) {
|
|
12974
|
+
if (this.isRightShadow) {
|
|
12929
12975
|
nativeElement.parentElement.classList.add('the-table-right-shadow');
|
|
12930
12976
|
}
|
|
12931
12977
|
else {
|
|
@@ -13272,6 +13318,7 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
13272
13318
|
.subscribe(() => {
|
|
13273
13319
|
this.bindTableScrollingShadow();
|
|
13274
13320
|
this.updateStickyRowScrollLeft();
|
|
13321
|
+
this.setHeaderRowShadow();
|
|
13275
13322
|
});
|
|
13276
13323
|
}
|
|
13277
13324
|
updateStickyRowScrollLeft() {
|
|
@@ -13309,7 +13356,7 @@ TheTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
13309
13356
|
provide: THE_TABLE_COMPONENT_TOKEN,
|
|
13310
13357
|
useExisting: TheTableComponent
|
|
13311
13358
|
}
|
|
13312
|
-
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: ElementRef, static: true }, { propertyName: "columnControlsWrapper", first: true, predicate: ["columnControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "cornerControl", first: true, predicate: ["cornerControl"], descendants: true, read: ElementRef }, { propertyName: "rowControlsInner", first: true, predicate: ["rowControlsInner"], descendants: true, read: ElementRef }, { propertyName: "rowControlsButtonWrapper", predicate: ["rowControlsButtonWrapper"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"the-table-container\" theColumnResize>\n <div class=\"the-table-row-controls-wrapper\">\n <div\n class=\"the-table-corner-controls the-sticky-corner-controls\"\n #cornerControl\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\" *ngIf=\"!headerRow\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\" *ngIf=\"!element.options?.headerColumn\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n <div\n class=\"the-table-row-controls-button-wrap\"\n #rowControlsButtonWrapper\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowControls\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && (isInTable || tableStore.isRightClicking) && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ headerRow && i === 0 ? '' : headerRow ? i : i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n <th\n #colControl\n class=\"the-table-col-controls\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColControls\"\n [ngClass]=\"{\n 'the-sticky-cell': i === 0 && element | freezeColumn : tablePluginOptions,\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMousedown($event, i)\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable || tableStore.isRightClicking\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n [parentElement]=\"colControl\"\n >\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "directive", type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { kind: "component", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore", "parentElement"] }, { kind: "pipe", type: TableFreezeColumnPipe, name: "freezeColumn" }] });
|
|
13359
|
+
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: ElementRef, static: true }, { propertyName: "columnControlsWrapper", first: true, predicate: ["columnControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "cornerControl", first: true, predicate: ["cornerControl"], descendants: true, read: ElementRef }, { propertyName: "rowControlsInner", first: true, predicate: ["rowControlsInner"], descendants: true, read: ElementRef }, { propertyName: "tableRowControlsWrapper", first: true, predicate: ["tableRowControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "headerRowLeftShadow", first: true, predicate: ["headerRowLeftShadow"], descendants: true, read: ElementRef }, { propertyName: "headerRowRightShadow", first: true, predicate: ["headerRowRightShadow"], descendants: true, read: ElementRef }, { propertyName: "rowControlsButtonWrapper", predicate: ["rowControlsButtonWrapper"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"the-table-container\" theColumnResize>\n <div class=\"the-table-row-controls-wrapper\" #tableRowControlsWrapper>\n <div\n class=\"the-table-corner-controls the-sticky-corner-controls\"\n #cornerControl\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\" *ngIf=\"!headerRow\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\" *ngIf=\"!element.options?.headerColumn\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n <div\n class=\"the-table-row-controls-button-wrap\"\n #rowControlsButtonWrapper\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowControls\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && (isInTable || tableStore.isRightClicking) && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ headerRow && i === 0 ? '' : headerRow ? i : i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n <th\n #colControl\n class=\"the-table-col-controls\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColControls\"\n [ngClass]=\"{\n 'the-sticky-cell': i === 0 && element | freezeColumn : tablePluginOptions,\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMousedown($event, i)\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable || tableStore.isRightClicking\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n [parentElement]=\"colControl\"\n >\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n <div class=\"header-row-shadow header-row-left-shadow\" #headerRowLeftShadow contenteditable=\"false\"></div>\n <div class=\"header-row-shadow header-row-right-shadow\" #headerRowRightShadow contenteditable=\"false\"></div>\n </table>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "directive", type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { kind: "component", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore", "parentElement"] }, { kind: "pipe", type: TableFreezeColumnPipe, name: "freezeColumn" }] });
|
|
13313
13360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: TheTableComponent, decorators: [{
|
|
13314
13361
|
type: Component,
|
|
13315
13362
|
args: [{ selector: 'the-table, [theTable]', providers: [
|
|
@@ -13329,7 +13376,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
13329
13376
|
'[class.the-table-with-sticky-column]': 'element?.options?.headerColumn',
|
|
13330
13377
|
'[class.the-numberd-table]': 'element?.options?.numberedColumn',
|
|
13331
13378
|
'[class.the-table-selection-hide]': 'tableStore.isCellSelecting || tableStore.isRightClicking'
|
|
13332
|
-
}, template: "<div class=\"the-table-container\" theColumnResize>\n <div class=\"the-table-row-controls-wrapper\">\n <div\n class=\"the-table-corner-controls the-sticky-corner-controls\"\n #cornerControl\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\" *ngIf=\"!headerRow\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\" *ngIf=\"!element.options?.headerColumn\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n <div\n class=\"the-table-row-controls-button-wrap\"\n #rowControlsButtonWrapper\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowControls\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && (isInTable || tableStore.isRightClicking) && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ headerRow && i === 0 ? '' : headerRow ? i : i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n <th\n #colControl\n class=\"the-table-col-controls\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColControls\"\n [ngClass]=\"{\n 'the-sticky-cell': i === 0 && element | freezeColumn : tablePluginOptions,\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMousedown($event, i)\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable || tableStore.isRightClicking\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n [parentElement]=\"colControl\"\n >\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n" }]
|
|
13379
|
+
}, template: "<div class=\"the-table-container\" theColumnResize>\n <div class=\"the-table-row-controls-wrapper\" #tableRowControlsWrapper>\n <div\n class=\"the-table-corner-controls the-sticky-corner-controls\"\n #cornerControl\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\" *ngIf=\"!headerRow\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\" *ngIf=\"!element.options?.headerColumn\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n <div\n class=\"the-table-row-controls-button-wrap\"\n #rowControlsButtonWrapper\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowControls\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && (isInTable || tableStore.isRightClicking) && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ headerRow && i === 0 ? '' : headerRow ? i : i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n <th\n #colControl\n class=\"the-table-col-controls\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColControls\"\n [ngClass]=\"{\n 'the-sticky-cell': i === 0 && element | freezeColumn : tablePluginOptions,\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMousedown($event, i)\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable || tableStore.isRightClicking\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n [parentElement]=\"colControl\"\n >\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n <div class=\"header-row-shadow header-row-left-shadow\" #headerRowLeftShadow contenteditable=\"false\"></div>\n <div class=\"header-row-shadow header-row-right-shadow\" #headerRowRightShadow contenteditable=\"false\"></div>\n </table>\n </div>\n</div>\n" }]
|
|
13333
13380
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: TableCellEventDispatcher }, { type: ColumnResizeNotifierSource }, { type: TableStore }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: TableService }, { type: TheTableContextMenuService }, { type: TableFreezeColumnPipe }, { type: TableFreezeRowPipe }, { type: i0.Renderer2 }, { type: TheContextService }]; }, propDecorators: { tableWrapper: [{
|
|
13334
13381
|
type: ViewChild,
|
|
13335
13382
|
args: ['tableWrapper', { read: ElementRef, static: true }]
|
|
@@ -13348,6 +13395,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
13348
13395
|
}], rowControlsInner: [{
|
|
13349
13396
|
type: ViewChild,
|
|
13350
13397
|
args: ['rowControlsInner', { read: ElementRef, static: false }]
|
|
13398
|
+
}], tableRowControlsWrapper: [{
|
|
13399
|
+
type: ViewChild,
|
|
13400
|
+
args: ['tableRowControlsWrapper', { read: ElementRef, static: false }]
|
|
13401
|
+
}], headerRowLeftShadow: [{
|
|
13402
|
+
type: ViewChild,
|
|
13403
|
+
args: ['headerRowLeftShadow', { read: ElementRef, static: false }]
|
|
13404
|
+
}], headerRowRightShadow: [{
|
|
13405
|
+
type: ViewChild,
|
|
13406
|
+
args: ['headerRowRightShadow', { read: ElementRef, static: false }]
|
|
13351
13407
|
}], rowControlsButtonWrapper: [{
|
|
13352
13408
|
type: ViewChildren,
|
|
13353
13409
|
args: ['rowControlsButtonWrapper', { read: ElementRef }]
|
|
@@ -15724,7 +15780,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
15724
15780
|
valueChange(value) {
|
|
15725
15781
|
this.theGlobalToolbarInstance?.selectionChange(this.editor);
|
|
15726
15782
|
const { neededScrollIntoView } = this.theOptions;
|
|
15727
|
-
neededScrollIntoView(this.editor) && this.scrollToView(this.editor);
|
|
15783
|
+
neededScrollIntoView?.(this.editor) && this.scrollToView(this.editor);
|
|
15728
15784
|
if (this.editorValue === value) {
|
|
15729
15785
|
return;
|
|
15730
15786
|
}
|