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

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.
Files changed (40) hide show
  1. package/components/Accordion/Accordion.svelte +0 -1
  2. package/components/Accordion/AccordionItem.svelte +0 -1
  3. package/components/Badge/Badge.svelte +0 -1
  4. package/components/Breadcrumb/Breadcrumb.svelte +0 -1
  5. package/components/Button/Button.svelte +0 -1
  6. package/components/CardIcon/CardIcon.svelte +0 -1
  7. package/components/CardIcon/CardiconBody.svelte +0 -1
  8. package/components/CardIcon/CardiconSubtitle.svelte +0 -1
  9. package/components/CardIcon/CardiconTitle.svelte +0 -1
  10. package/components/CheckBox/Checkbox.svelte +0 -1
  11. package/components/Dropdown/Dropdown.svelte +0 -1
  12. package/components/Dropdown/DropdownItem.svelte +0 -1
  13. package/components/EnkiSidbar/EnkiSidebar.svelte +0 -1
  14. package/components/EnkiSidbar/NavIcon.svelte +0 -1
  15. package/components/EnkiSidbar/NavItem.svelte +0 -1
  16. package/components/EnkiSidbar/NavLink.svelte +0 -1
  17. package/components/Header/Brand.svelte +0 -1
  18. package/components/Header/Header.svelte +0 -1
  19. package/components/Header/HeaderItem.svelte +0 -1
  20. package/components/Header/UserAvatar.svelte +0 -1
  21. package/components/ModalWindow/Modal.svelte +0 -1
  22. package/components/ModalWindow/ModalBody.svelte +0 -1
  23. package/components/ModalWindow/ModalFooter.svelte +0 -1
  24. package/components/ModalWindow/ModalHeader.svelte +0 -1
  25. package/components/NotFound/NotFound.svelte +0 -1
  26. package/components/Pagination/Pagination.svelte +0 -1
  27. package/components/RadioButton/RadioButton.svelte +0 -1
  28. package/components/Sidebar/MenuGroup.svelte +10 -0
  29. package/components/Sidebar/MenuItem.svelte +10 -0
  30. package/components/Sidebar/SideBarMenu.svelte +60 -2
  31. package/components/Sidebar/Sidebar.scss +11 -0
  32. package/components/Sidebar/Sidebar.svelte +10 -1
  33. package/components/Switches/Switch.svelte +0 -1
  34. package/components/Tab/Tab.svelte +0 -1
  35. package/components/TextField/TextField.svelte +0 -1
  36. package/components/Toast/Toast.svelte +0 -1
  37. package/components/Tooltip/Tooltip.svelte +0 -1
  38. package/components/WidgetCard/WidgetCard.svelte +11 -4
  39. package/components/common.scss +1 -1
  40. package/package.json +1 -1
@@ -596,7 +596,6 @@ export let stayOpen = true;
596
596
  transition: transform 0.3s ease;
597
597
  }
598
598
  .main-content {
599
- margin-left: 315px;
600
599
  /* Width of the sidebar */
601
600
  flex: 1;
602
601
  overflow-y: auto;
@@ -597,7 +597,6 @@ export let header;
597
597
  transition: transform 0.3s ease;
598
598
  }
599
599
  .main-content {
600
- margin-left: 315px;
601
600
  /* Width of the sidebar */
602
601
  flex: 1;
603
602
  overflow-y: auto;
@@ -602,7 +602,6 @@ if (badgeConfig.hasOwnProperty(config)) {
602
602
  transition: transform 0.3s ease;
603
603
  }
604
604
  .main-content {
605
- margin-left: 315px;
606
605
  /* Width of the sidebar */
607
606
  flex: 1;
608
607
  overflow-y: auto;
@@ -612,7 +612,6 @@ let length = newBreadcrumbs.length;
612
612
  transition: transform 0.3s ease;
613
613
  }
614
614
  .main-content {
615
- margin-left: 315px;
616
615
  /* Width of the sidebar */
617
616
  flex: 1;
618
617
  overflow-y: auto;
@@ -1348,7 +1348,6 @@
1348
1348
  transition: transform 0.3s ease;
1349
1349
  }
1350
1350
  .main-content {
1351
- margin-left: 315px;
1352
1351
  /* Width of the sidebar */
1353
1352
  flex: 1;
1354
1353
  overflow-y: auto;
@@ -679,7 +679,6 @@ if (titleConfig.includes(titleLocation)) {
679
679
  transition: transform 0.3s ease;
680
680
  }
681
681
  .main-content {
682
- margin-left: 315px;
683
682
  /* Width of the sidebar */
684
683
  flex: 1;
685
684
  overflow-y: auto;
@@ -674,7 +674,6 @@
674
674
  transition: transform 0.3s ease;
675
675
  }
676
676
  .main-content {
677
- margin-left: 315px;
678
677
  /* Width of the sidebar */
679
678
  flex: 1;
680
679
  overflow-y: auto;
@@ -683,7 +683,6 @@
683
683
  transition: transform 0.3s ease;
684
684
  }
685
685
  .main-content {
686
- margin-left: 315px;
687
686
  /* Width of the sidebar */
688
687
  flex: 1;
689
688
  overflow-y: auto;
@@ -683,7 +683,6 @@
683
683
  transition: transform 0.3s ease;
684
684
  }
685
685
  .main-content {
686
- margin-left: 315px;
687
686
  /* Width of the sidebar */
688
687
  flex: 1;
689
688
  overflow-y: auto;
@@ -632,7 +632,6 @@
632
632
  transition: transform 0.3s ease;
633
633
  }
634
634
  .main-content {
635
- margin-left: 315px;
636
635
  /* Width of the sidebar */
637
636
  flex: 1;
638
637
  overflow-y: auto;
@@ -657,7 +657,6 @@ export let title = "Dropdowns";
657
657
  transition: transform 0.3s ease;
658
658
  }
659
659
  .main-content {
660
- margin-left: 315px;
661
660
  /* Width of the sidebar */
662
661
  flex: 1;
663
662
  overflow-y: auto;
@@ -650,7 +650,6 @@ export let disabled = false;
650
650
  transition: transform 0.3s ease;
651
651
  }
652
652
  .main-content {
653
- margin-left: 315px;
654
653
  /* Width of the sidebar */
655
654
  flex: 1;
656
655
  overflow-y: auto;
@@ -727,7 +727,6 @@ li.icons:hover {
727
727
  transition: transform 0.3s ease;
728
728
  }
729
729
  .main-content {
730
- margin-left: 315px;
731
730
  /* Width of the sidebar */
732
731
  flex: 1;
733
732
  overflow-y: auto;
@@ -670,7 +670,6 @@ li.icons:hover {
670
670
  transition: transform 0.3s ease;
671
671
  }
672
672
  .main-content {
673
- margin-left: 315px;
674
673
  /* Width of the sidebar */
675
674
  flex: 1;
676
675
  overflow-y: auto;
@@ -668,7 +668,6 @@ li.icons:hover {
668
668
  transition: transform 0.3s ease;
669
669
  }
670
670
  .main-content {
671
- margin-left: 315px;
672
671
  /* Width of the sidebar */
673
672
  flex: 1;
674
673
  overflow-y: auto;
@@ -677,7 +677,6 @@ li.icons:hover {
677
677
  transition: transform 0.3s ease;
678
678
  }
679
679
  .main-content {
680
- margin-left: 315px;
681
680
  /* Width of the sidebar */
682
681
  flex: 1;
683
682
  overflow-y: auto;
@@ -660,7 +660,6 @@
660
660
  transition: transform 0.3s ease;
661
661
  }
662
662
  .main-content {
663
- margin-left: 315px;
664
663
  /* Width of the sidebar */
665
664
  flex: 1;
666
665
  overflow-y: auto;
@@ -659,7 +659,6 @@
659
659
  transition: transform 0.3s ease;
660
660
  }
661
661
  .main-content {
662
- margin-left: 315px;
663
662
  /* Width of the sidebar */
664
663
  flex: 1;
665
664
  overflow-y: auto;
@@ -661,7 +661,6 @@
661
661
  transition: transform 0.3s ease;
662
662
  }
663
663
  .main-content {
664
- margin-left: 315px;
665
664
  /* Width of the sidebar */
666
665
  flex: 1;
667
666
  overflow-y: auto;
@@ -659,7 +659,6 @@
659
659
  transition: transform 0.3s ease;
660
660
  }
661
661
  .main-content {
662
- margin-left: 315px;
663
662
  /* Width of the sidebar */
664
663
  flex: 1;
665
664
  overflow-y: auto;
@@ -598,7 +598,6 @@
598
598
  transition: transform 0.3s ease;
599
599
  }
600
600
  .main-content {
601
- margin-left: 315px;
602
601
  /* Width of the sidebar */
603
602
  flex: 1;
604
603
  overflow-y: auto;
@@ -596,7 +596,6 @@
596
596
  transition: transform 0.3s ease;
597
597
  }
598
598
  .main-content {
599
- margin-left: 315px;
600
599
  /* Width of the sidebar */
601
600
  flex: 1;
602
601
  overflow-y: auto;
@@ -594,7 +594,6 @@
594
594
  transition: transform 0.3s ease;
595
595
  }
596
596
  .main-content {
597
- margin-left: 315px;
598
597
  /* Width of the sidebar */
599
598
  flex: 1;
600
599
  overflow-y: auto;
@@ -599,7 +599,6 @@
599
599
  transition: transform 0.3s ease;
600
600
  }
601
601
  .main-content {
602
- margin-left: 315px;
603
602
  /* Width of the sidebar */
604
603
  flex: 1;
605
604
  overflow-y: auto;
@@ -634,7 +634,6 @@
634
634
  transition: transform 0.3s ease;
635
635
  }
636
636
  .main-content {
637
- margin-left: 315px;
638
637
  /* Width of the sidebar */
639
638
  flex: 1;
640
639
  overflow-y: auto;
@@ -732,7 +732,6 @@ function nextPage() {
732
732
  transition: transform 0.3s ease;
733
733
  }
734
734
  .main-content {
735
- margin-left: 315px;
736
735
  /* Width of the sidebar */
737
736
  flex: 1;
738
737
  overflow-y: auto;
@@ -614,7 +614,6 @@
614
614
  transition: transform 0.3s ease;
615
615
  }
616
616
  .main-content {
617
- margin-left: 315px;
618
617
  /* Width of the sidebar */
619
618
  flex: 1;
620
619
  overflow-y: auto;
@@ -109,4 +109,14 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
109
109
  #sidebarMenu {
110
110
  height: calc(100vh - 146px);
111
111
  overflow: auto;
112
+ }
113
+ #icon {
114
+ margin-left: 270px;
115
+ z-index: 1000;
116
+ position: fixed;
117
+ top: 90px;
118
+ }
119
+ #margin-alignment {
120
+ height: calc(100vh - 146px);
121
+ width: 315px;
112
122
  }</style>
@@ -122,5 +122,15 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
122
122
  #sidebarMenu {
123
123
  height: calc(100vh - 146px);
124
124
  overflow: auto;
125
+ }
126
+ #icon {
127
+ margin-left: 270px;
128
+ z-index: 1000;
129
+ position: fixed;
130
+ top: 90px;
131
+ }
132
+ #margin-alignment {
133
+ height: calc(100vh - 146px);
134
+ width: 315px;
125
135
  }</style>
126
136
 
@@ -1,11 +1,51 @@
1
1
  <script>
2
+ import { onDestroy, onMount } from 'svelte';
2
3
  import MenuGroup from './MenuGroup.svelte';
3
4
  import MenuItem from './MenuItem.svelte';
4
5
 
5
6
  export let companyName = 'EnkiTek';
7
+ let sidebarFlag = true;
8
+ let hideSidebar = false;
9
+ let iconName = 'bi-chevron-double-left';
10
+ function styleChange() {
11
+ sidebarFlag = !sidebarFlag;
12
+
13
+ const sidebar = document?.getElementById('sidebar');
14
+ const icon = document?.getElementById('icon');
15
+ const margin = document?.getElementById('margin-alignment');
16
+ if (sidebar && icon && margin && !sidebarFlag) {
17
+ sidebar.style.display = 'none';
18
+ icon.style.marginLeft = '0px';
19
+ margin.style.width = '35px';
20
+ iconName = 'bi-chevron-double-right';
21
+ } else if (sidebar && icon && margin) {
22
+ sidebar.style.display = 'block';
23
+ icon.style.marginLeft = '270px';
24
+ margin.style.width = '315px';
25
+ iconName = 'bi-chevron-double-left';
26
+ }
27
+ }
28
+ function checkScreenSize() {
29
+ if (window.innerWidth < 768) {
30
+ hideSidebar = true;
31
+ } else {
32
+ hideSidebar = false;
33
+ }
34
+ }
35
+ onMount(() => {
36
+ if (typeof window !== 'undefined') {
37
+ window.addEventListener('resize', checkScreenSize);
38
+ }
39
+ });
40
+
41
+ onDestroy(() => {
42
+ if (typeof window !== 'undefined') {
43
+ window.removeEventListener('resize', checkScreenSize);
44
+ }
45
+ });
6
46
  </script>
7
47
 
8
- <div class="sidebar pe-0">
48
+ <div class="sidebar pe-0" id="sidebar">
9
49
  <div
10
50
  class="offcanvas-md offcanvas-end bg-white rounded-3"
11
51
  tabindex="-1"
@@ -24,11 +64,19 @@
24
64
  aria-label="Close"
25
65
  />
26
66
  </div>
27
- <div class="offcanvas-body d-md-flex flex-column p-0 pt-3 overflow-y-auto m-3">
67
+ <div class="offcanvas-body d-md-flex flex-column p-0 pt-3 m-3">
28
68
  <slot />
29
69
  </div>
30
70
  </div>
31
71
  </div>
72
+ {#if !hideSidebar}
73
+ <div id="icon">
74
+ <button class="btn btn-secondary btn-sm" on:click={styleChange}>
75
+ <i class={iconName} />
76
+ </button>
77
+ </div>
78
+ <div id="margin-alignment" />
79
+ {/if}
32
80
 
33
81
  <style>@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
34
82
  @import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
@@ -133,6 +181,16 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
133
181
  height: calc(100vh - 146px);
134
182
  overflow: auto;
135
183
  }
184
+ #icon {
185
+ margin-left: 270px;
186
+ z-index: 1000;
187
+ position: fixed;
188
+ top: 90px;
189
+ }
190
+ #margin-alignment {
191
+ height: calc(100vh - 146px);
192
+ width: 315px;
193
+ }
136
194
  @media (min-width: 768px) {
137
195
  .sidebar .offcanvas-lg {
138
196
  position: -webkit-sticky;
@@ -153,4 +153,15 @@ ul {
153
153
  #sidebarMenu {
154
154
  height: calc(100vh - 146px);
155
155
  overflow: auto;
156
+ }
157
+ #icon {
158
+ margin-left: 270px;
159
+ z-index: 1000 ;
160
+ position: fixed ;
161
+ top: 90px ;
162
+ }
163
+
164
+ #margin-alignment {
165
+ height: calc(100vh - 146px);
166
+ width: 315px
156
167
  }
@@ -186,6 +186,16 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
186
186
  height: calc(100vh - 146px);
187
187
  overflow: auto;
188
188
  }
189
+ #icon {
190
+ margin-left: 270px;
191
+ z-index: 1000;
192
+ position: fixed;
193
+ top: 90px;
194
+ }
195
+ #margin-alignment {
196
+ height: calc(100vh - 146px);
197
+ width: 315px;
198
+ }
189
199
  :global(.ebg-none) {
190
200
  background-color: #ffffff !important;
191
201
  }
@@ -760,7 +770,6 @@ ul, .icon-sidebar-content ul li, .icon-sidebar-content .toggle-button {
760
770
  transition: transform 0.3s ease;
761
771
  }
762
772
  .main-content {
763
- margin-left: 315px;
764
773
  /* Width of the sidebar */
765
774
  flex: 1;
766
775
  overflow-y: auto;
@@ -605,7 +605,6 @@
605
605
  transition: transform 0.3s ease;
606
606
  }
607
607
  .main-content {
608
- margin-left: 315px;
609
608
  /* Width of the sidebar */
610
609
  flex: 1;
611
610
  overflow-y: auto;
@@ -625,7 +625,6 @@ export let tabs = [
625
625
  transition: transform 0.3s ease;
626
626
  }
627
627
  .main-content {
628
- margin-left: 315px;
629
628
  /* Width of the sidebar */
630
629
  flex: 1;
631
630
  overflow-y: auto;
@@ -633,7 +633,6 @@
633
633
  transition: transform 0.3s ease;
634
634
  }
635
635
  .main-content {
636
- margin-left: 315px;
637
636
  /* Width of the sidebar */
638
637
  flex: 1;
639
638
  overflow-y: auto;
@@ -670,7 +670,6 @@
670
670
  transition: transform 0.3s ease;
671
671
  }
672
672
  .main-content {
673
- margin-left: 315px;
674
673
  /* Width of the sidebar */
675
674
  flex: 1;
676
675
  overflow-y: auto;
@@ -612,7 +612,6 @@ const textAligns = {
612
612
  transition: transform 0.3s ease;
613
613
  }
614
614
  .main-content {
615
- margin-left: 315px;
616
615
  /* Width of the sidebar */
617
616
  flex: 1;
618
617
  overflow-y: auto;
@@ -31,7 +31,11 @@
31
31
  };
32
32
 
33
33
  const isMobile = () => {
34
- return window.innerWidth >= minMaximizebleWidth; // Example threshold for mobile (you can adjust this value)
34
+ if (typeof window !== 'undefined') {
35
+ return window.innerWidth >= minMaximizebleWidth; // Example threshold for mobile (you can adjust this value)
36
+ }
37
+
38
+ return false;
35
39
  };
36
40
 
37
41
  const handleResize = () => {
@@ -40,12 +44,15 @@
40
44
 
41
45
  onMount(() => {
42
46
  isMobileDevice = isMobile();
43
-
44
- window.addEventListener('resize', handleResize);
47
+ if (typeof window !== 'undefined') {
48
+ window.addEventListener('resize', handleResize);
49
+ }
45
50
  });
46
51
 
47
52
  onDestroy(() => {
48
- window.removeEventListener('resize', handleResize);
53
+ if (typeof window !== 'undefined') {
54
+ window.removeEventListener('resize', handleResize);
55
+ }
49
56
  });
50
57
  </script>
51
58
 
@@ -802,7 +802,7 @@
802
802
  }
803
803
 
804
804
  .main-content {
805
- margin-left: 315px;
805
+ // margin-left: 315px;
806
806
  /* Width of the sidebar */
807
807
  flex: 1;
808
808
  overflow-y: auto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enki-tek/fms-web-components",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "devDependencies": {
5
5
  "@storybook/addon-essentials": "^7.6.14",
6
6
  "@storybook/addon-interactions": "^7.6.14",