Skip to content

Commit 20b43a8

Browse files
committed
feat: release bim charts
1 parent 6060c59 commit 20b43a8

73 files changed

Lines changed: 6350 additions & 309 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/core/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/ui",
33
"description": "Collection of web components (UI components) meant to be used, but not limited to, BIM applications.",
4-
"version": "3.2.4",
4+
"version": "3.3.0",
55
"author": "That Open Company",
66
"contributors": [
77
"Juan Hoyos (https://github.com/HoyosJuan)"
@@ -40,8 +40,10 @@
4040
},
4141
"dependencies": {
4242
"@floating-ui/dom": "1.6.3",
43-
"iconify-icon": "2.0.0",
44-
"lit": "3.1.2"
43+
"chart.js": "^4.5.0",
44+
"chartjs-plugin-datalabels": "^2.2.0",
45+
"iconify-icon": "3.0.1",
46+
"lit": "3.3.1"
4547
},
4648
"devDependencies": {
4749
"@types/node": "20.11.30",
@@ -60,4 +62,4 @@
6062
"vite": "5.1.6",
6163
"vite-plugin-dts": "3.7.3"
6264
}
63-
}
65+
}

packages/core/src/components/Button/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,20 @@ export class Button extends LitElement {
426426
private showContextMenu = () => {
427427
let contextMenu = this._contextMenu;
428428
if (this.contextMenuTemplate) {
429+
const previousDisabledValue = this.disabled
430+
this.disabled = true
429431
contextMenu = Component.create<ContextMenu>(() => {
430432
const element = Component.create(this.contextMenuTemplate!)
431433
if (element instanceof ContextMenu) return html`${element}`
432434
return html`
433435
<bim-context-menu>${element}</bim-context-menu>
434-
`
436+
`
435437
})
436438
this.append(contextMenu)
437439
contextMenu.addEventListener("hidden", () => {
438440
contextMenu?.remove()
439441
})
442+
this.disabled = previousDisabledValue
440443
}
441444
if (contextMenu) {
442445
const id = this.getAttribute("data-context-group");
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html lang="en" class="bim-ui-dark">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Chart</title>
8+
<style>
9+
* {
10+
box-sizing: border-box;
11+
}
12+
13+
html {
14+
font-family: sans-serif;
15+
}
16+
17+
body {
18+
background-color: var(--bim-ui_bg-base);
19+
height: 100vh;
20+
margin: 0;
21+
padding: 1rem;
22+
}
23+
24+
bim-pie-chart {
25+
padding: 2rem;
26+
border: 1px solid var(--bim-ui_bg-contrast-20);
27+
background-color: var(--bim-ui_bg-contrast-10);
28+
border-radius: 1rem;
29+
}
30+
</style>
31+
</head>
32+
33+
<body>
34+
<script type="module" src="./example.ts"></script>
35+
</body>
36+
37+
</html>

0 commit comments

Comments
 (0)