@enki-tek/fms-web-components 0.1.7 → 0.1.10
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/Charts/Barchart.svelte +42 -72
- package/components/Charts/Barchart.svelte.d.ts +8 -2
- package/components/Charts/DoughnutChart.svelte +3 -36
- package/components/Charts/LineChart.svelte +7 -26
- package/components/Charts/LineChart.svelte.d.ts +6 -0
- package/components/Charts/PieChart.svelte +6 -35
- package/components/Charts/chartOptions.d.ts +32 -0
- package/components/Charts/chartOptions.js +43 -0
- package/components/Icon/ActionInconGroup.svelte +2 -2
- package/components/Icon/ActionInconGroup.svelte.d.ts +2 -2
- package/components/Layout/Footer.svelte +1 -3
- package/components/Layout/Page.svelte +1 -1
- package/components/Sidebar/MenuGroup.svelte +4 -1
- package/components/Sidebar/MenuItem.svelte +5 -2
- package/components/Sidebar/SideBarMenu.svelte +4 -1
- package/components/Sidebar/Sidebar.scss +6 -1
- package/components/Sidebar/Sidebar.svelte +4 -1
- package/components/WidgetCard/Card.scss +2 -2
- package/components/WidgetCard/SensorStatusCard.svelte +2 -2
- package/components/WidgetCard/StateCard.svelte +4 -4
- package/components/WidgetCard/WidgetCard.svelte +5 -18
- package/components/WidgetCard/WidgetCardBody.svelte +6 -1
- package/components/WidgetCard/WidgetCardBody.svelte.d.ts +2 -2
- package/package.json +2 -1
@@ -1,74 +1,44 @@
|
|
1
1
|
<!-- src/BarChart.svelte -->
|
2
2
|
<script>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
beginAtZero: true,
|
46
|
-
},
|
47
|
-
},
|
48
|
-
};
|
49
|
-
|
50
|
-
onMount(() => {
|
51
|
-
const ctx = canvas.getContext('2d');
|
52
|
-
chart = new Chart(ctx, {
|
53
|
-
type: 'bar', // Set chart type to 'bar'
|
54
|
-
data: chartData,
|
55
|
-
options: chartOptions,
|
56
|
-
});
|
57
|
-
});
|
58
|
-
|
59
|
-
onDestroy(() => {
|
60
|
-
if (chart) {
|
61
|
-
chart.destroy();
|
62
|
-
}
|
63
|
-
});
|
64
|
-
</script>
|
65
|
-
|
66
|
-
<canvas bind:this={canvas} width="400" height="200" />
|
67
|
-
|
68
|
-
<style>
|
69
|
-
canvas {
|
70
|
-
max-width: 100%;
|
71
|
-
height: 100%; /* Ensures the canvas takes the full height of the container */
|
72
|
-
}
|
73
|
-
</style>
|
74
|
-
|
3
|
+
import { Chart, registerables } from 'chart.js';
|
4
|
+
import { onDestroy, onMount } from 'svelte';
|
5
|
+
import {
|
6
|
+
chartOptions,
|
7
|
+
getChartData
|
8
|
+
} from './chartOptions';
|
9
|
+
|
10
|
+
export let data = {};
|
11
|
+
export let label = '';
|
12
|
+
export let width = 200;
|
13
|
+
export let height = 200;
|
14
|
+
|
15
|
+
// Register all necessary components
|
16
|
+
Chart.register(...registerables);
|
17
|
+
|
18
|
+
let chart;
|
19
|
+
let canvas;
|
20
|
+
|
21
|
+
onMount(() => {
|
22
|
+
const ctx = canvas.getContext('2d');
|
23
|
+
chart = new Chart(ctx, {
|
24
|
+
type: 'bar', // Set chart type to 'bar'
|
25
|
+
data: getChartData({ data, label }),
|
26
|
+
options: chartOptions
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
onDestroy(() => {
|
31
|
+
if (chart) {
|
32
|
+
chart.destroy();
|
33
|
+
}
|
34
|
+
});
|
35
|
+
</script>
|
36
|
+
|
37
|
+
<canvas bind:this={canvas} {width} {height} />
|
38
|
+
|
39
|
+
<style>
|
40
|
+
canvas {
|
41
|
+
max-width: 100%;
|
42
|
+
height: 100%; /* Ensures the canvas takes the full height of the container */
|
43
|
+
}
|
44
|
+
</style>
|
@@ -2,7 +2,10 @@
|
|
2
2
|
/** @typedef {typeof __propDef.events} BarchartEvents */
|
3
3
|
/** @typedef {typeof __propDef.slots} BarchartSlots */
|
4
4
|
export default class Barchart extends SvelteComponentTyped<{
|
5
|
-
|
5
|
+
label?: string | undefined;
|
6
|
+
width?: number | undefined;
|
7
|
+
height?: number | undefined;
|
8
|
+
data?: {} | undefined;
|
6
9
|
}, {
|
7
10
|
[evt: string]: CustomEvent<any>;
|
8
11
|
}, {}> {
|
@@ -13,7 +16,10 @@ export type BarchartSlots = typeof __propDef.slots;
|
|
13
16
|
import { SvelteComponentTyped } from "svelte";
|
14
17
|
declare const __propDef: {
|
15
18
|
props: {
|
16
|
-
|
19
|
+
label?: string | undefined;
|
20
|
+
width?: number | undefined;
|
21
|
+
height?: number | undefined;
|
22
|
+
data?: {} | undefined;
|
17
23
|
};
|
18
24
|
events: {
|
19
25
|
[evt: string]: CustomEvent<any>;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<!-- src/PieChart.svelte -->
|
2
2
|
<script>
|
3
|
-
import { onMount, onDestroy } from 'svelte';
|
4
3
|
import { Chart, registerables } from 'chart.js';
|
4
|
+
import { onDestroy, onMount } from 'svelte';
|
5
|
+
import { chartOptions, getChartData } from './chartOptions';
|
5
6
|
|
6
7
|
export let data = {};
|
7
8
|
export let label = '';
|
@@ -13,45 +14,11 @@
|
|
13
14
|
let chart;
|
14
15
|
let canvas;
|
15
16
|
|
16
|
-
// Chart configuration
|
17
|
-
const chartData = {
|
18
|
-
labels: Object.keys(data),
|
19
|
-
datasets: [
|
20
|
-
{
|
21
|
-
label: label,
|
22
|
-
data: Object.values(data)
|
23
|
-
}
|
24
|
-
]
|
25
|
-
};
|
26
|
-
|
27
|
-
const chartOptions = {
|
28
|
-
plugins: {
|
29
|
-
legend: {
|
30
|
-
position: 'bottom' // Set legend position to bottom
|
31
|
-
},
|
32
|
-
datalabels: {
|
33
|
-
anchor: 'center',
|
34
|
-
align: 'end',
|
35
|
-
clamp: true,
|
36
|
-
font: {
|
37
|
-
size: 16, // Set the font size here
|
38
|
-
weight: 'bold', // Optional: set font weight
|
39
|
-
family: 'Roboto', // Set the font family to Roboto
|
40
|
-
},
|
41
|
-
formatter: (value) => {
|
42
|
-
return value; // Show the value directly
|
43
|
-
}
|
44
|
-
}
|
45
|
-
},
|
46
|
-
responsive: true,
|
47
|
-
maintainAspectRatio: false // Allows the chart to resize freely
|
48
|
-
};
|
49
|
-
|
50
17
|
onMount(() => {
|
51
18
|
const ctx = canvas.getContext('2d');
|
52
19
|
chart = new Chart(ctx, {
|
53
20
|
type: 'doughnut',
|
54
|
-
data:
|
21
|
+
data: getChartData({ data, label }),
|
55
22
|
options: chartOptions
|
56
23
|
});
|
57
24
|
});
|
@@ -1,9 +1,13 @@
|
|
1
1
|
<!-- src/MyChart.svelte -->
|
2
2
|
<script>
|
3
|
-
import { onMount, onDestroy } from 'svelte';
|
4
3
|
import { Chart, registerables } from 'chart.js';
|
4
|
+
import { onDestroy, onMount } from 'svelte';
|
5
|
+
import { chartOptions } from './chartOptions';
|
5
6
|
|
6
7
|
export let data = {};
|
8
|
+
export let label = '';
|
9
|
+
export let width = 200;
|
10
|
+
export let height = 200;
|
7
11
|
|
8
12
|
// Register all necessary components
|
9
13
|
Chart.register(...registerables);
|
@@ -11,35 +15,12 @@
|
|
11
15
|
let chart;
|
12
16
|
let canvas;
|
13
17
|
|
14
|
-
// Chart configuration
|
15
|
-
const chartData = {
|
16
|
-
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
17
|
-
datasets: [
|
18
|
-
{
|
19
|
-
label: 'My First dataset',
|
20
|
-
backgroundColor: 'rgba(75, 192, 192, 0.2)',
|
21
|
-
borderColor: 'rgba(75, 192, 192, 1)',
|
22
|
-
borderWidth: 1,
|
23
|
-
data: [40, 30, 20, 50, 60, 70, 80]
|
24
|
-
}
|
25
|
-
]
|
26
|
-
};
|
27
|
-
|
28
|
-
const chartOptions = {
|
29
|
-
responsive: true,
|
30
|
-
maintainAspectRatio: false, // Allows the chart to resize without maintaining aspect ratio
|
31
|
-
scales: {
|
32
|
-
y: {
|
33
|
-
beginAtZero: true
|
34
|
-
}
|
35
|
-
}
|
36
|
-
};
|
37
18
|
|
38
19
|
onMount(() => {
|
39
20
|
const ctx = canvas.getContext('2d');
|
40
21
|
chart = new Chart(ctx, {
|
41
22
|
type: 'line', // Change this to 'bar' for a bar chart
|
42
|
-
data:
|
23
|
+
data: getChartData({ data, label }),
|
43
24
|
options: chartOptions
|
44
25
|
});
|
45
26
|
});
|
@@ -52,7 +33,7 @@
|
|
52
33
|
});
|
53
34
|
</script>
|
54
35
|
|
55
|
-
<canvas bind:this={canvas} />
|
36
|
+
<canvas bind:this={canvas} {width} {height} />
|
56
37
|
|
57
38
|
<style>
|
58
39
|
canvas {
|
@@ -2,6 +2,9 @@
|
|
2
2
|
/** @typedef {typeof __propDef.events} LineChartEvents */
|
3
3
|
/** @typedef {typeof __propDef.slots} LineChartSlots */
|
4
4
|
export default class LineChart extends SvelteComponentTyped<{
|
5
|
+
label?: string | undefined;
|
6
|
+
width?: number | undefined;
|
7
|
+
height?: number | undefined;
|
5
8
|
data?: {} | undefined;
|
6
9
|
}, {
|
7
10
|
[evt: string]: CustomEvent<any>;
|
@@ -13,6 +16,9 @@ export type LineChartSlots = typeof __propDef.slots;
|
|
13
16
|
import { SvelteComponentTyped } from "svelte";
|
14
17
|
declare const __propDef: {
|
15
18
|
props: {
|
19
|
+
label?: string | undefined;
|
20
|
+
width?: number | undefined;
|
21
|
+
height?: number | undefined;
|
16
22
|
data?: {} | undefined;
|
17
23
|
};
|
18
24
|
events: {
|
@@ -1,8 +1,12 @@
|
|
1
1
|
<!-- src/PieChart.svelte -->
|
2
2
|
<script>
|
3
|
-
import { onMount, onDestroy } from 'svelte';
|
4
3
|
import { Chart, registerables } from 'chart.js';
|
5
4
|
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
5
|
+
import { onDestroy, onMount } from 'svelte';
|
6
|
+
import {
|
7
|
+
chartOptions,
|
8
|
+
getChartData
|
9
|
+
} from './chartOptions';
|
6
10
|
|
7
11
|
export let data = {};
|
8
12
|
export let label = '';
|
@@ -14,46 +18,13 @@
|
|
14
18
|
let chart;
|
15
19
|
let canvas;
|
16
20
|
|
17
|
-
// Chart configuration
|
18
|
-
const chartData = {
|
19
|
-
labels: Object.keys(data),
|
20
|
-
datasets: [
|
21
|
-
{
|
22
|
-
label: label,
|
23
|
-
data: Object.values(data)
|
24
|
-
}
|
25
|
-
]
|
26
|
-
};
|
27
|
-
|
28
|
-
const chartOptions = {
|
29
|
-
plugins: {
|
30
|
-
legend: {
|
31
|
-
position: 'bottom' // Set legend position to bottom
|
32
|
-
},
|
33
|
-
datalabels: {
|
34
|
-
anchor: 'center',
|
35
|
-
align: 'end',
|
36
|
-
clamp: true,
|
37
|
-
font: {
|
38
|
-
size: 16, // Set the font size here
|
39
|
-
weight: 'bold', // Optional: set font weight
|
40
|
-
family: 'Roboto', // Set the font family to Roboto
|
41
|
-
},
|
42
|
-
formatter: (value) => {
|
43
|
-
return value; // Show the value directly
|
44
|
-
}
|
45
|
-
}
|
46
|
-
},
|
47
|
-
responsive: true,
|
48
|
-
maintainAspectRatio: false // Allows the chart to resize freely
|
49
|
-
};
|
50
21
|
|
51
22
|
onMount(() => {
|
52
23
|
// console.log(chartData);
|
53
24
|
const ctx = canvas.getContext('2d');
|
54
25
|
chart = new Chart(ctx, {
|
55
26
|
type: 'pie', // Set chart type to 'pie'
|
56
|
-
data:
|
27
|
+
data: getChartData({ data, label }),
|
57
28
|
options: chartOptions
|
58
29
|
});
|
59
30
|
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
export namespace chartOptions {
|
2
|
+
namespace plugins {
|
3
|
+
namespace legend {
|
4
|
+
const position: string;
|
5
|
+
}
|
6
|
+
namespace datalabels {
|
7
|
+
const anchor: string;
|
8
|
+
const align: string;
|
9
|
+
const clamp: boolean;
|
10
|
+
namespace font {
|
11
|
+
const size: number;
|
12
|
+
const weight: string;
|
13
|
+
const family: string;
|
14
|
+
}
|
15
|
+
function formatter(value: any): any;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
const responsive: boolean;
|
19
|
+
const maintainAspectRatio: boolean;
|
20
|
+
}
|
21
|
+
export function getChartLabelsFromData(data: any): string[];
|
22
|
+
export function getChartValuesFromData(data: any): any[];
|
23
|
+
export function getChartData({ data, label }: {
|
24
|
+
data: any;
|
25
|
+
label: any;
|
26
|
+
}): {
|
27
|
+
labels: string[];
|
28
|
+
datasets: {
|
29
|
+
label: any;
|
30
|
+
data: any[];
|
31
|
+
}[];
|
32
|
+
};
|
@@ -0,0 +1,43 @@
|
|
1
|
+
export const chartOptions = {
|
2
|
+
plugins: {
|
3
|
+
legend: {
|
4
|
+
position: 'bottom' // Set legend position to bottom
|
5
|
+
},
|
6
|
+
datalabels: {
|
7
|
+
anchor: 'center',
|
8
|
+
align: 'end',
|
9
|
+
clamp: true,
|
10
|
+
font: {
|
11
|
+
size: 16, // Set the font size here
|
12
|
+
weight: 'bold', // Optional: set font weight
|
13
|
+
family: 'Roboto', // Set the font family to Roboto
|
14
|
+
},
|
15
|
+
formatter: (value) => {
|
16
|
+
return value; // Show the value directly
|
17
|
+
}
|
18
|
+
}
|
19
|
+
},
|
20
|
+
responsive: true,
|
21
|
+
maintainAspectRatio: false // Allows the chart to resize freely
|
22
|
+
};
|
23
|
+
|
24
|
+
export const getChartLabelsFromData = (data) => {
|
25
|
+
return Object.keys(data)
|
26
|
+
}
|
27
|
+
|
28
|
+
export const getChartValuesFromData = (data) => {
|
29
|
+
return Object.values(data);
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
export const getChartData = ({ data, label }) => {
|
34
|
+
return {
|
35
|
+
labels: getChartLabelsFromData(data),
|
36
|
+
datasets: [
|
37
|
+
{
|
38
|
+
label: label,
|
39
|
+
data: getChartValuesFromData(data)
|
40
|
+
}
|
41
|
+
]
|
42
|
+
};
|
43
|
+
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/** @typedef {typeof __propDef.events} ActionInconGroupEvents */
|
3
3
|
/** @typedef {typeof __propDef.slots} ActionInconGroupSlots */
|
4
4
|
export default class ActionInconGroup extends SvelteComponentTyped<{
|
5
|
-
|
5
|
+
className?: string | undefined;
|
6
6
|
}, {
|
7
7
|
[evt: string]: CustomEvent<any>;
|
8
8
|
}, {
|
@@ -15,7 +15,7 @@ export type ActionInconGroupSlots = typeof __propDef.slots;
|
|
15
15
|
import { SvelteComponentTyped } from "svelte";
|
16
16
|
declare const __propDef: {
|
17
17
|
props: {
|
18
|
-
|
18
|
+
className?: string | undefined;
|
19
19
|
};
|
20
20
|
events: {
|
21
21
|
[evt: string]: CustomEvent<any>;
|
@@ -1,12 +1,10 @@
|
|
1
1
|
<script>
|
2
|
-
// import { i18nInit } from '../i18n/i18n';
|
3
2
|
import ShiftLanguage from '../i18n/ShiftLanguage.svelte';
|
4
3
|
|
5
4
|
import { _ } from 'svelte-i18n';
|
6
|
-
// i18nInit();
|
7
5
|
</script>
|
8
6
|
|
9
|
-
<footer class="main-footer p-10 d-flex flex-row align-items-center justify-content-between ">
|
7
|
+
<footer class="main-footer p-10 d-flex flex-row align-items-center justify-content-between position-fixed bottom-0">
|
10
8
|
<div class="copy-right">
|
11
9
|
{$_({id: 'Common.rightReserved', default: 'All rights reserved.'})}
|
12
10
|
<i class="ml-2 text-secondary ">{$_({id: 'Common.Version', default:'Version'})} 0.0.2</i>
|
@@ -99,10 +99,13 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
|
|
99
99
|
.box a {
|
100
100
|
color: #ffffff;
|
101
101
|
}
|
102
|
+
.active {
|
103
|
+
background-color: #3A736D !important;
|
104
|
+
}
|
102
105
|
}
|
103
106
|
.active {
|
104
107
|
background-color: #ddf9f6;
|
105
108
|
}
|
106
109
|
#sidebarMenu {
|
107
|
-
min-height: calc(100vh -
|
110
|
+
min-height: calc(100vh - 130px);
|
108
111
|
}</style>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<li class="nav-item p-2 box {active ? "active" : ""}">
|
10
10
|
<a
|
11
|
-
class="nav-link d-flex align-items-center gap-2"
|
11
|
+
class="nav-link d-flex align-items-center gap-2 flex-grow-1"
|
12
12
|
aria-current="page"
|
13
13
|
href={link}
|
14
14
|
on:click
|
@@ -112,11 +112,14 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
|
|
112
112
|
.box a {
|
113
113
|
color: #ffffff;
|
114
114
|
}
|
115
|
+
.active {
|
116
|
+
background-color: #3A736D !important;
|
117
|
+
}
|
115
118
|
}
|
116
119
|
.active {
|
117
120
|
background-color: #ddf9f6;
|
118
121
|
}
|
119
122
|
#sidebarMenu {
|
120
|
-
min-height: calc(100vh -
|
123
|
+
min-height: calc(100vh - 130px);
|
121
124
|
}</style>
|
122
125
|
|
@@ -122,12 +122,15 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
|
|
122
122
|
.box a {
|
123
123
|
color: #ffffff;
|
124
124
|
}
|
125
|
+
.active {
|
126
|
+
background-color: #3A736D !important;
|
127
|
+
}
|
125
128
|
}
|
126
129
|
.active {
|
127
130
|
background-color: #ddf9f6;
|
128
131
|
}
|
129
132
|
#sidebarMenu {
|
130
|
-
min-height: calc(100vh -
|
133
|
+
min-height: calc(100vh - 130px);
|
131
134
|
}
|
132
135
|
@media (min-width: 768px) {
|
133
136
|
.sidebar .offcanvas-lg {
|
@@ -138,10 +138,15 @@ ul {
|
|
138
138
|
.box a{
|
139
139
|
color: #ffffff;
|
140
140
|
}
|
141
|
+
|
142
|
+
.active{
|
143
|
+
background-color: #3A736D !important;
|
144
|
+
}
|
141
145
|
}
|
146
|
+
|
142
147
|
.active{
|
143
148
|
background-color: #ddf9f6;
|
144
149
|
}
|
145
150
|
#sidebarMenu{
|
146
|
-
min-height: calc(100vh -
|
151
|
+
min-height: calc(100vh - 130px);
|
147
152
|
}
|
@@ -175,12 +175,15 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
|
|
175
175
|
.box a {
|
176
176
|
color: #ffffff;
|
177
177
|
}
|
178
|
+
.active {
|
179
|
+
background-color: #3A736D !important;
|
180
|
+
}
|
178
181
|
}
|
179
182
|
.active {
|
180
183
|
background-color: #ddf9f6;
|
181
184
|
}
|
182
185
|
#sidebarMenu {
|
183
|
-
min-height: calc(100vh -
|
186
|
+
min-height: calc(100vh - 130px);
|
184
187
|
}
|
185
188
|
:global(.ebg-none) {
|
186
189
|
background-color: #ffffff !important;
|
@@ -92,13 +92,13 @@
|
|
92
92
|
.statecardtitle {
|
93
93
|
font-weight: 400;
|
94
94
|
float: right;
|
95
|
-
width:
|
95
|
+
width: 50%;
|
96
96
|
}
|
97
97
|
.subtitle {
|
98
98
|
float: left;
|
99
99
|
font-size: 16px;
|
100
100
|
font-weight: 400;
|
101
|
-
width:
|
101
|
+
width: 100%;
|
102
102
|
}
|
103
103
|
.time {
|
104
104
|
float: right;
|
@@ -16,13 +16,13 @@
|
|
16
16
|
</Col>
|
17
17
|
<Col>
|
18
18
|
<div class="content">
|
19
|
-
<div class="statecardtitle">{title}</div>
|
19
|
+
<div class="statecardtitle text-truncate">{title}</div>
|
20
20
|
</div>
|
21
21
|
</Col>
|
22
22
|
</Row>
|
23
23
|
<Row>
|
24
24
|
<Col>
|
25
|
-
<div class="subtitle">{subtitle}</div>
|
25
|
+
<div class="subtitle text-truncate">{subtitle}</div>
|
26
26
|
</Col>
|
27
27
|
<Col> <div class="time mt-1">{time}</div>
|
28
28
|
</Col>
|
@@ -95,13 +95,13 @@
|
|
95
95
|
.statecardtitle {
|
96
96
|
font-weight: 400;
|
97
97
|
float: right;
|
98
|
-
width:
|
98
|
+
width: 50%;
|
99
99
|
}
|
100
100
|
.subtitle {
|
101
101
|
float: left;
|
102
102
|
font-size: 16px;
|
103
103
|
font-weight: 400;
|
104
|
-
width:
|
104
|
+
width: 100%;
|
105
105
|
}
|
106
106
|
.time {
|
107
107
|
float: right;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
<script>
|
2
|
-
import { onMount } from 'svelte';
|
3
2
|
import { Col, Row } from 'sveltestrap';
|
4
3
|
export let title;
|
5
4
|
export let resizable = false;
|
@@ -17,18 +16,6 @@
|
|
17
16
|
cardLength /= 2;
|
18
17
|
console.log(cardLength);
|
19
18
|
}
|
20
|
-
// if (!maximized) {
|
21
|
-
// element.style.width = element.getBoundingClientRect().width / resizeQuotient + 'px';
|
22
|
-
// if (!widthOnly) {
|
23
|
-
// element.style.height = element.getBoundingClientRect().height / resizeQuotient + 'px';
|
24
|
-
// }
|
25
|
-
|
26
|
-
// return;
|
27
|
-
// }
|
28
|
-
// element.style.width = element.getBoundingClientRect().width * resizeQuotient + 'px';
|
29
|
-
// if (!widthOnly) {
|
30
|
-
// element.style.height = element.getBoundingClientRect().height * resizeQuotient + 'px';
|
31
|
-
// }
|
32
19
|
};
|
33
20
|
</script>
|
34
21
|
|
@@ -37,11 +24,11 @@
|
|
37
24
|
<div bind:this={element}>
|
38
25
|
<div class="m-2 card">
|
39
26
|
<Row>
|
40
|
-
<Col>
|
27
|
+
<Col md=10>
|
41
28
|
<div class="title fw-normal">{title}</div>
|
42
29
|
</Col>
|
43
30
|
{#if resizable}
|
44
|
-
<Col>
|
31
|
+
<Col md=2>
|
45
32
|
<div class="float-end">
|
46
33
|
<i on:click={toggleMaximize} class="material-icons"
|
47
34
|
>{!maximized ? 'zoom_out_map' : 'zoom_in_map'}</i
|
@@ -125,13 +112,13 @@
|
|
125
112
|
.statecardtitle {
|
126
113
|
font-weight: 400;
|
127
114
|
float: right;
|
128
|
-
width:
|
115
|
+
width: 50%;
|
129
116
|
}
|
130
117
|
.subtitle {
|
131
118
|
float: left;
|
132
119
|
font-size: 16px;
|
133
120
|
font-weight: 400;
|
134
|
-
width:
|
121
|
+
width: 100%;
|
135
122
|
}
|
136
123
|
.time {
|
137
124
|
float: right;
|
@@ -150,4 +137,4 @@
|
|
150
137
|
color: #c9443a;
|
151
138
|
padding: 5px 10px;
|
152
139
|
border-radius: 5px;
|
153
|
-
}</style>
|
140
|
+
}</style>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<script>
|
2
|
+
export let className = "";
|
2
3
|
</script>
|
3
4
|
|
4
|
-
<div class="widget-card-body">
|
5
|
+
<div class="widget-card-body card-height {className}">
|
5
6
|
<slot />
|
6
7
|
</div>
|
7
8
|
|
@@ -10,4 +11,8 @@
|
|
10
11
|
width: 100%;
|
11
12
|
position: relative;
|
12
13
|
}
|
14
|
+
.card-height {
|
15
|
+
height: 350px;
|
16
|
+
overflow: auto;
|
17
|
+
}
|
13
18
|
</style>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/** @typedef {typeof __propDef.events} WidgetCardBodyEvents */
|
3
3
|
/** @typedef {typeof __propDef.slots} WidgetCardBodySlots */
|
4
4
|
export default class WidgetCardBody extends SvelteComponentTyped<{
|
5
|
-
|
5
|
+
className?: string | undefined;
|
6
6
|
}, {
|
7
7
|
[evt: string]: CustomEvent<any>;
|
8
8
|
}, {
|
@@ -15,7 +15,7 @@ export type WidgetCardBodySlots = typeof __propDef.slots;
|
|
15
15
|
import { SvelteComponentTyped } from "svelte";
|
16
16
|
declare const __propDef: {
|
17
17
|
props: {
|
18
|
-
|
18
|
+
className?: string | undefined;
|
19
19
|
};
|
20
20
|
events: {
|
21
21
|
[evt: string]: CustomEvent<any>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@enki-tek/fms-web-components",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.10",
|
4
4
|
"devDependencies": {
|
5
5
|
"@storybook/addon-essentials": "^7.6.14",
|
6
6
|
"@storybook/addon-interactions": "^7.6.14",
|
@@ -81,6 +81,7 @@
|
|
81
81
|
"./components/Charts/DoughnutChart.svelte": "./components/Charts/DoughnutChart.svelte",
|
82
82
|
"./components/Charts/LineChart.svelte": "./components/Charts/LineChart.svelte",
|
83
83
|
"./components/Charts/PieChart.svelte": "./components/Charts/PieChart.svelte",
|
84
|
+
"./components/Charts/chartOptions": "./components/Charts/chartOptions.js",
|
84
85
|
"./components/CheckBox/Checkbox.scss": "./components/CheckBox/Checkbox.scss",
|
85
86
|
"./components/CheckBox/Checkbox.stories": "./components/CheckBox/Checkbox.stories.js",
|
86
87
|
"./components/CheckBox/Checkbox.svelte": "./components/CheckBox/Checkbox.svelte",
|