@enki-tek/fms-web-components 0.1.53 → 0.1.55

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.
@@ -89,7 +89,7 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
89
89
  }
90
90
  .box {
91
91
  width: 100% !important;
92
- height: 48px;
92
+ min-height: 48px;
93
93
  border-radius: 5px;
94
94
  }
95
95
  .box a {
@@ -102,7 +102,7 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
102
102
  }
103
103
  .box {
104
104
  width: 100% !important;
105
- height: 48px;
105
+ min-height: 48px;
106
106
  border-radius: 5px;
107
107
  }
108
108
  .box a {
@@ -112,7 +112,7 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
112
112
  }
113
113
  .box {
114
114
  width: 100% !important;
115
- height: 48px;
115
+ min-height: 48px;
116
116
  border-radius: 5px;
117
117
  }
118
118
  .box a {
@@ -128,7 +128,7 @@ ul {
128
128
 
129
129
  .box {
130
130
  width: 100% !important;
131
- height: 48px;
131
+ min-height: 48px;
132
132
  border-radius: 5px;
133
133
  }
134
134
 
@@ -165,7 +165,7 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
165
165
  }
166
166
  .box {
167
167
  width: 100% !important;
168
- height: 48px;
168
+ min-height: 48px;
169
169
  border-radius: 5px;
170
170
  }
171
171
  .box a {
@@ -1,12 +1,15 @@
1
1
  <script>
2
+ import { onDestroy, onMount } from 'svelte';
2
3
  import { Col, Row } from 'sveltestrap';
3
4
  export let title;
4
5
  export let resizable = false;
5
6
  export let widthOnly = true;
6
7
  export let resizeQuotient = 2;
7
8
  export let cardLength = 3;
9
+ export let minMaximizebleWidth = 992;
8
10
  let maximized = false;
9
11
  let element = null;
12
+ let isMobileDevice = false;
10
13
  const toggleMaximize = () => {
11
14
  maximized = !maximized;
12
15
  if (maximized) {
@@ -26,6 +29,24 @@
26
29
  }
27
30
  return `col-md-12 col-sm-12 col-lg-${cardLength} col-xl-${cardLength}`;
28
31
  };
32
+
33
+ const isMobile = () => {
34
+ return window.innerWidth >= minMaximizebleWidth; // Example threshold for mobile (you can adjust this value)
35
+ };
36
+
37
+ const handleResize = () => {
38
+ isMobileDevice = isMobile();
39
+ };
40
+
41
+ onMount(() => {
42
+ isMobileDevice = isMobile();
43
+
44
+ window.addEventListener('resize', handleResize);
45
+ });
46
+
47
+ onDestroy(() => {
48
+ window.removeEventListener('resize', handleResize);
49
+ });
29
50
  </script>
30
51
 
31
52
  {#key cardLength}
@@ -36,7 +57,7 @@
36
57
  <Col md="10">
37
58
  <div {title} class="text-truncate title fw-normal">{title}</div>
38
59
  </Col>
39
- {#if resizable}
60
+ {#if resizable && isMobileDevice}
40
61
  <Col md="2">
41
62
  <div class="float-end">
42
63
  <i on:click={toggleMaximize} class="material-icons cursor-pointer"
@@ -249,4 +270,7 @@ input:checked + .slider:before {
249
270
  }
250
271
  input:checked + .slider:after {
251
272
  transform: translateX(36px);
273
+ }
274
+ .cursor-pointer {
275
+ cursor: pointer !important;
252
276
  }</style>
@@ -8,6 +8,7 @@ export default class WidgetCard extends SvelteComponentTyped<{
8
8
  widthOnly?: boolean | undefined;
9
9
  resizeQuotient?: number | undefined;
10
10
  cardLength?: number | undefined;
11
+ minMaximizebleWidth?: number | undefined;
11
12
  }, {
12
13
  [evt: string]: CustomEvent<any>;
13
14
  }, {
@@ -26,6 +27,7 @@ declare const __propDef: {
26
27
  widthOnly?: boolean | undefined;
27
28
  resizeQuotient?: number | undefined;
28
29
  cardLength?: number | undefined;
30
+ minMaximizebleWidth?: number | undefined;
29
31
  };
30
32
  events: {
31
33
  [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.53",
3
+ "version": "0.1.55",
4
4
  "devDependencies": {
5
5
  "@storybook/addon-essentials": "^7.6.14",
6
6
  "@storybook/addon-interactions": "^7.6.14",