@enki-tek/fms-web-components 0.0.89 → 0.1.0
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/Accordion/Accordion.svelte +3 -0
- package/components/Accordion/AccordionItem.svelte +3 -0
- package/components/Badge/Badge.svelte +3 -0
- package/components/Breadcrumb/Breadcrumb.svelte +3 -0
- package/components/Button/Button.svelte +3 -0
- package/components/CardIcon/CardIcon.svelte +3 -0
- package/components/CardIcon/CardiconBody.svelte +3 -0
- package/components/CardIcon/CardiconSubtitle.svelte +3 -0
- package/components/CardIcon/CardiconTitle.svelte +3 -0
- package/components/Charts/Barchart.svelte +74 -0
- package/components/Charts/Barchart.svelte.d.ts +23 -0
- package/components/Charts/DoughnutChart.svelte +73 -0
- package/components/Charts/DoughnutChart.svelte.d.ts +29 -0
- package/components/Charts/LineChart.svelte +62 -0
- package/components/Charts/LineChart.svelte.d.ts +23 -0
- package/components/Charts/PieChart.svelte +75 -0
- package/components/Charts/PieChart.svelte.d.ts +29 -0
- package/components/CheckBox/Checkbox.svelte +3 -0
- package/components/Dropdown/Dropdown.svelte +3 -0
- package/components/Dropdown/DropdownItem.svelte +3 -0
- package/components/EnkiSidbar/EnkiSidebar.svelte +3 -0
- package/components/EnkiSidbar/NavIcon.svelte +3 -0
- package/components/EnkiSidbar/NavItem.svelte +3 -0
- package/components/EnkiSidbar/NavLink.svelte +3 -0
- package/components/Header/Brand.svelte +25 -16
- package/components/Header/Header.scss +40 -34
- package/components/Header/Header.svelte +26 -20
- package/components/Header/Header.svelte.d.ts +6 -2
- package/components/Header/HeaderDropDownLink.svelte +11 -0
- package/components/Header/HeaderDropDownLink.svelte.d.ts +29 -0
- package/components/Header/HeaderDropDownLinkItem.svelte +9 -0
- package/components/Header/HeaderDropDownLinkItem.svelte.d.ts +31 -0
- package/components/Header/HeaderItem.svelte +9 -0
- package/components/Header/HeaderLink.svelte +9 -0
- package/components/Header/HeaderLink.svelte.d.ts +31 -0
- package/components/Header/HeaderLinks.svelte +9 -0
- package/components/Header/HeaderLinks.svelte.d.ts +27 -0
- package/components/Header/UserAvatar.svelte +12 -3
- package/components/Layout/Content.svelte +9 -0
- package/components/Layout/Content.svelte.d.ts +29 -0
- package/components/Layout/Footer.svelte +2 -0
- package/components/Layout/Layout.svelte +6 -0
- package/components/Layout/Layout.svelte.d.ts +27 -0
- package/components/Layout/Page.svelte +35 -9
- package/components/Layout/Page.svelte.d.ts +6 -2
- package/components/Layout/SortableGrid.svelte +28 -0
- package/components/Layout/SortableGrid.svelte.d.ts +27 -0
- package/components/ModalWindow/Modal.svelte +3 -0
- package/components/ModalWindow/ModalBody.svelte +3 -0
- package/components/ModalWindow/ModalFooter.svelte +3 -0
- package/components/ModalWindow/ModalHeader.svelte +3 -0
- package/components/NotFound/NotFound.svelte +3 -0
- package/components/Pagination/Pagination.svelte +3 -0
- package/components/RadioButton/RadioButton.svelte +3 -0
- package/components/Sidebar/MenuGroup.svelte +108 -0
- package/components/Sidebar/MenuGroup.svelte.d.ts +29 -0
- package/components/Sidebar/MenuItem.svelte +122 -0
- package/components/Sidebar/MenuItem.svelte.d.ts +35 -0
- package/components/Sidebar/SideBarMenu.svelte +148 -0
- package/components/Sidebar/SideBarMenu.svelte.d.ts +27 -0
- package/components/Sidebar/Sidebar.scss +29 -0
- package/components/Sidebar/Sidebar.svelte +29 -0
- package/components/StatusCard/StatusCard.scss +35 -0
- package/components/StatusCard/StatusCard.svelte +42 -0
- package/components/StatusCard/StatusCard.svelte.d.ts +27 -0
- package/components/StatusCard/StatusCardBody.svelte +57 -0
- package/components/StatusCard/StatusCardBody.svelte.d.ts +31 -0
- package/components/StatusCard/StatusCardTitle.svelte +47 -0
- package/components/StatusCard/StatusCardTitle.svelte.d.ts +29 -0
- package/components/Switches/Switch.svelte +3 -0
- package/components/Tab/Tab.svelte +3 -0
- package/components/TextField/TextField.svelte +3 -0
- package/components/Toast/Toast.scss +0 -2
- package/components/Toast/Toast.svelte +7 -6
- package/components/Tooltip/Tooltip.svelte +3 -0
- package/components/WidgetCard/Card.scss +108 -0
- package/components/WidgetCard/SensorStatusCard.svelte +130 -0
- package/components/WidgetCard/SensorStatusCard.svelte.d.ts +27 -0
- package/components/WidgetCard/StateCard.svelte +133 -0
- package/components/WidgetCard/StateCard.svelte.d.ts +29 -0
- package/components/WidgetCard/WidgetCard.svelte +152 -0
- package/components/WidgetCard/WidgetCard.svelte.d.ts +35 -0
- package/components/WidgetCard/WidgetCardBody.svelte +13 -0
- package/components/WidgetCard/WidgetCardBody.svelte.d.ts +27 -0
- package/components/common.scss +4 -0
- package/components/variable.scss +13 -3
- package/package.json +30 -2
| @@ -0,0 +1,74 @@ | |
| 1 | 
            +
            <!-- src/BarChart.svelte -->
         | 
| 2 | 
            +
            <script>
         | 
| 3 | 
            +
                import { onMount, onDestroy } from 'svelte';
         | 
| 4 | 
            +
                import { Chart, registerables } from 'chart.js';
         | 
| 5 | 
            +
              
         | 
| 6 | 
            +
                // Register all necessary components
         | 
| 7 | 
            +
                Chart.register(...registerables);
         | 
| 8 | 
            +
              
         | 
| 9 | 
            +
                let chart;
         | 
| 10 | 
            +
                let canvas;
         | 
| 11 | 
            +
              
         | 
| 12 | 
            +
                // Chart configuration
         | 
| 13 | 
            +
                const chartData = {
         | 
| 14 | 
            +
                  labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
         | 
| 15 | 
            +
                  datasets: [
         | 
| 16 | 
            +
                    {
         | 
| 17 | 
            +
                      label: '# of Votes',
         | 
| 18 | 
            +
                      backgroundColor: [
         | 
| 19 | 
            +
                        'rgba(255, 99, 132, 0.2)',
         | 
| 20 | 
            +
                        'rgba(54, 162, 235, 0.2)',
         | 
| 21 | 
            +
                        'rgba(255, 206, 86, 0.2)',
         | 
| 22 | 
            +
                        'rgba(75, 192, 192, 0.2)',
         | 
| 23 | 
            +
                        'rgba(153, 102, 255, 0.2)',
         | 
| 24 | 
            +
                        'rgba(255, 159, 64, 0.2)',
         | 
| 25 | 
            +
                      ],
         | 
| 26 | 
            +
                      borderColor: [
         | 
| 27 | 
            +
                        'rgba(255, 99, 132, 1)',
         | 
| 28 | 
            +
                        'rgba(54, 162, 235, 1)',
         | 
| 29 | 
            +
                        'rgba(255, 206, 86, 1)',
         | 
| 30 | 
            +
                        'rgba(75, 192, 192, 1)',
         | 
| 31 | 
            +
                        'rgba(153, 102, 255, 1)',
         | 
| 32 | 
            +
                        'rgba(255, 159, 64, 1)',
         | 
| 33 | 
            +
                      ],
         | 
| 34 | 
            +
                      borderWidth: 1,
         | 
| 35 | 
            +
                      data: [12, 19, 3, 5, 2, 3],
         | 
| 36 | 
            +
                    },
         | 
| 37 | 
            +
                  ],
         | 
| 38 | 
            +
                };
         | 
| 39 | 
            +
              
         | 
| 40 | 
            +
                const chartOptions = {
         | 
| 41 | 
            +
                  responsive: true,
         | 
| 42 | 
            +
                  maintainAspectRatio: false, // Allows the chart to resize freely
         | 
| 43 | 
            +
                  scales: {
         | 
| 44 | 
            +
                    y: {
         | 
| 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 | 
            +
              
         | 
| @@ -0,0 +1,23 @@ | |
| 1 | 
            +
            /** @typedef {typeof __propDef.props}  BarchartProps */
         | 
| 2 | 
            +
            /** @typedef {typeof __propDef.events}  BarchartEvents */
         | 
| 3 | 
            +
            /** @typedef {typeof __propDef.slots}  BarchartSlots */
         | 
| 4 | 
            +
            export default class Barchart extends SvelteComponentTyped<{
         | 
| 5 | 
            +
                [x: string]: never;
         | 
| 6 | 
            +
            }, {
         | 
| 7 | 
            +
                [evt: string]: CustomEvent<any>;
         | 
| 8 | 
            +
            }, {}> {
         | 
| 9 | 
            +
            }
         | 
| 10 | 
            +
            export type BarchartProps = typeof __propDef.props;
         | 
| 11 | 
            +
            export type BarchartEvents = typeof __propDef.events;
         | 
| 12 | 
            +
            export type BarchartSlots = typeof __propDef.slots;
         | 
| 13 | 
            +
            import { SvelteComponentTyped } from "svelte";
         | 
| 14 | 
            +
            declare const __propDef: {
         | 
| 15 | 
            +
                props: {
         | 
| 16 | 
            +
                    [x: string]: never;
         | 
| 17 | 
            +
                };
         | 
| 18 | 
            +
                events: {
         | 
| 19 | 
            +
                    [evt: string]: CustomEvent<any>;
         | 
| 20 | 
            +
                };
         | 
| 21 | 
            +
                slots: {};
         | 
| 22 | 
            +
            };
         | 
| 23 | 
            +
            export {};
         | 
| @@ -0,0 +1,73 @@ | |
| 1 | 
            +
            <!-- src/PieChart.svelte -->
         | 
| 2 | 
            +
            <script>
         | 
| 3 | 
            +
            	import { onMount, onDestroy } from 'svelte';
         | 
| 4 | 
            +
            	import { Chart, registerables } from 'chart.js';
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            	export let data = {};
         | 
| 7 | 
            +
            	export let label = '';
         | 
| 8 | 
            +
            	export let width = 200;
         | 
| 9 | 
            +
            	export let height = 200;
         | 
| 10 | 
            +
            	// Register all necessary components
         | 
| 11 | 
            +
            	Chart.register(...registerables);
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            	let chart;
         | 
| 14 | 
            +
            	let canvas;
         | 
| 15 | 
            +
             | 
| 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 | 
            +
            	onMount(() => {
         | 
| 51 | 
            +
            		const ctx = canvas.getContext('2d');
         | 
| 52 | 
            +
            		chart = new Chart(ctx, {
         | 
| 53 | 
            +
            			type: 'doughnut',
         | 
| 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} {height} />
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            <style>
         | 
| 69 | 
            +
            	canvas {
         | 
| 70 | 
            +
            		max-width: 100%;
         | 
| 71 | 
            +
            		height: auto; /* Ensures the canvas takes the full height of the container */
         | 
| 72 | 
            +
            	}
         | 
| 73 | 
            +
            </style>
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            /** @typedef {typeof __propDef.props}  DoughnutChartProps */
         | 
| 2 | 
            +
            /** @typedef {typeof __propDef.events}  DoughnutChartEvents */
         | 
| 3 | 
            +
            /** @typedef {typeof __propDef.slots}  DoughnutChartSlots */
         | 
| 4 | 
            +
            export default class DoughnutChart extends SvelteComponentTyped<{
         | 
| 5 | 
            +
                label?: string | undefined;
         | 
| 6 | 
            +
                width?: number | undefined;
         | 
| 7 | 
            +
                data?: {} | undefined;
         | 
| 8 | 
            +
                height?: number | undefined;
         | 
| 9 | 
            +
            }, {
         | 
| 10 | 
            +
                [evt: string]: CustomEvent<any>;
         | 
| 11 | 
            +
            }, {}> {
         | 
| 12 | 
            +
            }
         | 
| 13 | 
            +
            export type DoughnutChartProps = typeof __propDef.props;
         | 
| 14 | 
            +
            export type DoughnutChartEvents = typeof __propDef.events;
         | 
| 15 | 
            +
            export type DoughnutChartSlots = typeof __propDef.slots;
         | 
| 16 | 
            +
            import { SvelteComponentTyped } from "svelte";
         | 
| 17 | 
            +
            declare const __propDef: {
         | 
| 18 | 
            +
                props: {
         | 
| 19 | 
            +
                    label?: string | undefined;
         | 
| 20 | 
            +
                    width?: number | undefined;
         | 
| 21 | 
            +
                    data?: {} | undefined;
         | 
| 22 | 
            +
                    height?: number | undefined;
         | 
| 23 | 
            +
                };
         | 
| 24 | 
            +
                events: {
         | 
| 25 | 
            +
                    [evt: string]: CustomEvent<any>;
         | 
| 26 | 
            +
                };
         | 
| 27 | 
            +
                slots: {};
         | 
| 28 | 
            +
            };
         | 
| 29 | 
            +
            export {};
         | 
| @@ -0,0 +1,62 @@ | |
| 1 | 
            +
            <!-- src/MyChart.svelte -->
         | 
| 2 | 
            +
            <script>
         | 
| 3 | 
            +
            	import { onMount, onDestroy } from 'svelte';
         | 
| 4 | 
            +
            	import { Chart, registerables } from 'chart.js';
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            	export let data = {};
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            	// Register all necessary components
         | 
| 9 | 
            +
            	Chart.register(...registerables);
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            	let chart;
         | 
| 12 | 
            +
            	let canvas;
         | 
| 13 | 
            +
             | 
| 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 | 
            +
             | 
| 38 | 
            +
            	onMount(() => {
         | 
| 39 | 
            +
            		const ctx = canvas.getContext('2d');
         | 
| 40 | 
            +
            		chart = new Chart(ctx, {
         | 
| 41 | 
            +
            			type: 'line', // Change this to 'bar' for a bar chart
         | 
| 42 | 
            +
            			data: chartData,
         | 
| 43 | 
            +
            			options: chartOptions
         | 
| 44 | 
            +
            		});
         | 
| 45 | 
            +
            	});
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            	// Cleanup when component is destroyed
         | 
| 48 | 
            +
            	onDestroy(() => {
         | 
| 49 | 
            +
            		if (chart) {
         | 
| 50 | 
            +
            			chart.destroy();
         | 
| 51 | 
            +
            		}
         | 
| 52 | 
            +
            	});
         | 
| 53 | 
            +
            </script>
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            <canvas bind:this={canvas} />
         | 
| 56 | 
            +
             | 
| 57 | 
            +
            <style>
         | 
| 58 | 
            +
            	canvas {
         | 
| 59 | 
            +
            		max-width: 100%;
         | 
| 60 | 
            +
            		height: auto;
         | 
| 61 | 
            +
            	}
         | 
| 62 | 
            +
            </style>
         | 
| @@ -0,0 +1,23 @@ | |
| 1 | 
            +
            /** @typedef {typeof __propDef.props}  LineChartProps */
         | 
| 2 | 
            +
            /** @typedef {typeof __propDef.events}  LineChartEvents */
         | 
| 3 | 
            +
            /** @typedef {typeof __propDef.slots}  LineChartSlots */
         | 
| 4 | 
            +
            export default class LineChart extends SvelteComponentTyped<{
         | 
| 5 | 
            +
                data?: {} | undefined;
         | 
| 6 | 
            +
            }, {
         | 
| 7 | 
            +
                [evt: string]: CustomEvent<any>;
         | 
| 8 | 
            +
            }, {}> {
         | 
| 9 | 
            +
            }
         | 
| 10 | 
            +
            export type LineChartProps = typeof __propDef.props;
         | 
| 11 | 
            +
            export type LineChartEvents = typeof __propDef.events;
         | 
| 12 | 
            +
            export type LineChartSlots = typeof __propDef.slots;
         | 
| 13 | 
            +
            import { SvelteComponentTyped } from "svelte";
         | 
| 14 | 
            +
            declare const __propDef: {
         | 
| 15 | 
            +
                props: {
         | 
| 16 | 
            +
                    data?: {} | undefined;
         | 
| 17 | 
            +
                };
         | 
| 18 | 
            +
                events: {
         | 
| 19 | 
            +
                    [evt: string]: CustomEvent<any>;
         | 
| 20 | 
            +
                };
         | 
| 21 | 
            +
                slots: {};
         | 
| 22 | 
            +
            };
         | 
| 23 | 
            +
            export {};
         | 
| @@ -0,0 +1,75 @@ | |
| 1 | 
            +
            <!-- src/PieChart.svelte -->
         | 
| 2 | 
            +
            <script>
         | 
| 3 | 
            +
            	import { onMount, onDestroy } from 'svelte';
         | 
| 4 | 
            +
            	import { Chart, registerables } from 'chart.js';
         | 
| 5 | 
            +
            	import ChartDataLabels from 'chartjs-plugin-datalabels';
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            	export let data = {};
         | 
| 8 | 
            +
            	export let label = '';
         | 
| 9 | 
            +
            	export let width = 300;
         | 
| 10 | 
            +
            	export let height = 300;
         | 
| 11 | 
            +
            	// Register all necessary components
         | 
| 12 | 
            +
            	Chart.register(...registerables);
         | 
| 13 | 
            +
            	Chart.register(ChartDataLabels);
         | 
| 14 | 
            +
            	let chart;
         | 
| 15 | 
            +
            	let canvas;
         | 
| 16 | 
            +
             | 
| 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 | 
            +
             | 
| 51 | 
            +
            	onMount(() => {
         | 
| 52 | 
            +
            		// console.log(chartData);
         | 
| 53 | 
            +
            		const ctx = canvas.getContext('2d');
         | 
| 54 | 
            +
            		chart = new Chart(ctx, {
         | 
| 55 | 
            +
            			type: 'pie', // Set chart type to 'pie'
         | 
| 56 | 
            +
            			data: chartData,
         | 
| 57 | 
            +
            			options: chartOptions
         | 
| 58 | 
            +
            		});
         | 
| 59 | 
            +
            	});
         | 
| 60 | 
            +
             | 
| 61 | 
            +
            	onDestroy(() => {
         | 
| 62 | 
            +
            		if (chart) {
         | 
| 63 | 
            +
            			chart.destroy();
         | 
| 64 | 
            +
            		}
         | 
| 65 | 
            +
            	});
         | 
| 66 | 
            +
            </script>
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            <canvas bind:this={canvas} {width} {height} />
         | 
| 69 | 
            +
             | 
| 70 | 
            +
            <style>
         | 
| 71 | 
            +
            	canvas {
         | 
| 72 | 
            +
            		max-width: 100%;
         | 
| 73 | 
            +
            		height: auto; /* Ensures the canvas takes the full height of the container */
         | 
| 74 | 
            +
            	}
         | 
| 75 | 
            +
            </style>
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            /** @typedef {typeof __propDef.props}  PieChartProps */
         | 
| 2 | 
            +
            /** @typedef {typeof __propDef.events}  PieChartEvents */
         | 
| 3 | 
            +
            /** @typedef {typeof __propDef.slots}  PieChartSlots */
         | 
| 4 | 
            +
            export default class PieChart extends SvelteComponentTyped<{
         | 
| 5 | 
            +
                label?: string | undefined;
         | 
| 6 | 
            +
                width?: number | undefined;
         | 
| 7 | 
            +
                data?: {} | undefined;
         | 
| 8 | 
            +
                height?: number | undefined;
         | 
| 9 | 
            +
            }, {
         | 
| 10 | 
            +
                [evt: string]: CustomEvent<any>;
         | 
| 11 | 
            +
            }, {}> {
         | 
| 12 | 
            +
            }
         | 
| 13 | 
            +
            export type PieChartProps = typeof __propDef.props;
         | 
| 14 | 
            +
            export type PieChartEvents = typeof __propDef.events;
         | 
| 15 | 
            +
            export type PieChartSlots = typeof __propDef.slots;
         | 
| 16 | 
            +
            import { SvelteComponentTyped } from "svelte";
         | 
| 17 | 
            +
            declare const __propDef: {
         | 
| 18 | 
            +
                props: {
         | 
| 19 | 
            +
                    label?: string | undefined;
         | 
| 20 | 
            +
                    width?: number | undefined;
         | 
| 21 | 
            +
                    data?: {} | undefined;
         | 
| 22 | 
            +
                    height?: number | undefined;
         | 
| 23 | 
            +
                };
         | 
| 24 | 
            +
                events: {
         | 
| 25 | 
            +
                    [evt: string]: CustomEvent<any>;
         | 
| 26 | 
            +
                };
         | 
| 27 | 
            +
                slots: {};
         | 
| 28 | 
            +
            };
         | 
| 29 | 
            +
            export {};
         | 
| @@ -1,24 +1,24 @@ | |
| 1 1 | 
             
            <script>
         | 
| 2 | 
            -
            	import {
         | 
| 3 | 
            -
            		NavbarBrand,
         | 
| 4 | 
            -
            	} from 'sveltestrap';
         | 
| 2 | 
            +
            	import { NavbarBrand } from 'sveltestrap';
         | 
| 5 3 |  | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 4 | 
            +
            	let defaultBrandImage = 'https://i.postimg.cc/QCTH3KJ2/logo.png';
         | 
| 5 | 
            +
            	export let brandImage = 'https://i.postimg.cc/QCTH3KJ2/logo.png';
         | 
| 6 | 
            +
            	export let brandName = 'Farm Management System';
         | 
| 9 7 |  | 
| 8 | 
            +
            	const verifyImage = (brandImage) => {
         | 
| 9 | 
            +
            		const imageURLVerification =
         | 
| 10 | 
            +
            			/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g;
         | 
| 11 | 
            +
            		return brandImage.match(imageURLVerification);
         | 
| 12 | 
            +
            	};
         | 
| 10 13 |  | 
| 11 | 
            -
             | 
| 12 | 
            -
            		 | 
| 13 | 
            -
            	 | 
| 14 | 
            -
            	if (result == null) {
         | 
| 15 | 
            -
                    brandImage = defaultBrandImage;
         | 
| 16 | 
            -
                }    
         | 
| 14 | 
            +
            	if (!verifyImage(brandImage)) {
         | 
| 15 | 
            +
            		brandImage = defaultBrandImage;
         | 
| 16 | 
            +
            	}
         | 
| 17 17 | 
             
            </script>
         | 
| 18 18 |  | 
| 19 | 
            -
            <NavbarBrand href="/" class= | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 19 | 
            +
            <NavbarBrand href="/" class="efs-small headerLogo" style="font-weight:300;">
         | 
| 20 | 
            +
            	<img src={brandImage} alt="ENKITEK" />
         | 
| 21 | 
            +
            	{brandName}
         | 
| 22 22 | 
             
            </NavbarBrand>
         | 
| 23 23 |  | 
| 24 24 | 
             
            <style>@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
         | 
| @@ -31,11 +31,17 @@ | |
| 31 31 | 
             
              display: flex;
         | 
| 32 32 | 
             
              flex-direction: column;
         | 
| 33 33 | 
             
              color: #000000;
         | 
| 34 | 
            +
              filter: grayscale(100%) brightness(0) invert(1);
         | 
| 34 35 | 
             
            }
         | 
| 35 36 | 
             
            :global(.headerLogo img) {
         | 
| 36 37 | 
             
              width: 144px;
         | 
| 37 38 | 
             
              height: 34px;
         | 
| 38 39 | 
             
            }
         | 
| 40 | 
            +
            .bi {
         | 
| 41 | 
            +
              display: inline-block;
         | 
| 42 | 
            +
              width: 1rem;
         | 
| 43 | 
            +
              height: 1rem;
         | 
| 44 | 
            +
            }
         | 
| 39 45 | 
             
            :global(.headerIcons) {
         | 
| 40 46 | 
             
              display: flex;
         | 
| 41 47 | 
             
              align-items: center;
         | 
| @@ -640,4 +646,7 @@ | |
| 640 646 | 
             
              font-style: normal;
         | 
| 641 647 | 
             
              font-weight: 400;
         | 
| 642 648 | 
             
              line-height: normal;
         | 
| 643 | 
            -
            } | 
| 649 | 
            +
            }
         | 
| 650 | 
            +
            :global(.bg-dark) {
         | 
| 651 | 
            +
              background-color: #05445E !important;
         | 
| 652 | 
            +
            }</style>
         |