Skip to content

Commit a71a249

Browse files
committed
fix missing function
1 parent 05f25a4 commit a71a249

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

lib/js/webcomponent/DockSpawnTsWebcomponent.js

+13-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/webcomponent/DockSpawnTsWebcomponent.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dock-spawn-ts",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"description": "DockSpawn Typescript Version",
55
"license": "MIT",
66
"author": "[email protected]",

src/webcomponent/DockSpawnTsWebcomponent.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ import style1 from "../../../lib/css/dock-manager-style.css" with { type : 'css'
77
//@ts-ignore
88
import style2 from "../../../lib/css/dock-manager.css" with { type : 'css'}
99

10+
function toParString(strings: TemplateStringsArray, values: any[]) {
11+
if (strings.length === 1)
12+
return strings.raw[0];
13+
else {
14+
let r = ''
15+
for (let i = 0; i < strings.length; i++) {
16+
r += strings[i] + (values[i] ?? '');
17+
}
18+
return r;
19+
}
20+
}
21+
1022
const css = function (strings: TemplateStringsArray, ...values: any[]): CSSStyleSheet {
1123
const cssStyleSheet = new CSSStyleSheet();
12-
//@ts-ignore
1324
cssStyleSheet.replaceSync(toParString(strings, values));
1425
return cssStyleSheet;
1526
};
@@ -23,7 +34,8 @@ export class DockSpawnTsWebcomponent extends HTMLElement {
2334
private initialized = false;
2435
private elementContainerMap: Map<HTMLElement, PanelContainer> = new Map();
2536

26-
static style = css`:host {
37+
static style = css`
38+
:host {
2739
display: block;
2840
}`;
2941

0 commit comments

Comments
 (0)