Skip to content

Commit

Permalink
default display block
Browse files Browse the repository at this point in the history
  • Loading branch information
jogibear9988 committed Apr 28, 2024
1 parent 3b40e21 commit 05f25a4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/js/webcomponent/DockSpawnTsWebcomponent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export declare class DockSpawnTsWebcomponent extends HTMLElement {
private observer;
private initialized;
private elementContainerMap;
static style: CSSStyleSheet;
constructor();
private initDockspawn;
getElementInSlot(slot: HTMLSlotElement): HTMLElement;
Expand Down
11 changes: 10 additions & 1 deletion lib/js/webcomponent/DockSpawnTsWebcomponent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/js/webcomponent/DockSpawnTsWebcomponent.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dock-spawn-ts",
"version": "3.0.0",
"version": "3.0.1",
"description": "DockSpawn Typescript Version",
"license": "MIT",
"author": "[email protected]",
Expand Down
13 changes: 12 additions & 1 deletion src/webcomponent/DockSpawnTsWebcomponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import style1 from "../../../lib/css/dock-manager-style.css" with { type : 'css'
//@ts-ignore
import style2 from "../../../lib/css/dock-manager.css" with { type : 'css'}

const css = function (strings: TemplateStringsArray, ...values: any[]): CSSStyleSheet {
const cssStyleSheet = new CSSStyleSheet();
//@ts-ignore
cssStyleSheet.replaceSync(toParString(strings, values));
return cssStyleSheet;
};

export class DockSpawnTsWebcomponent extends HTMLElement {
public dockManager: DockManager;
private slotId: number = 0;
Expand All @@ -16,11 +23,15 @@ export class DockSpawnTsWebcomponent extends HTMLElement {
private initialized = false;
private elementContainerMap: Map<HTMLElement, PanelContainer> = new Map();

static style = css`:host {
display: block;
}`;

constructor() {
super();

const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.adoptedStyleSheets = [style1, style2];
shadowRoot.adoptedStyleSheets = [DockSpawnTsWebcomponent.style, style1, style2];

this.windowResizedBound = this.windowResized.bind(this);
this.slotElementMap = new WeakMap();
Expand Down

0 comments on commit 05f25a4

Please sign in to comment.