@enki-tek/fms-web-components 0.0.40 → 0.0.41
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/Header/Brand.svelte +635 -0
- package/components/Header/Brand.svelte.d.ts +25 -0
- package/components/Header/Header.svelte +23 -53
- package/components/Header/Header.svelte.d.ts +10 -8
- package/components/Header/HeaderItem.svelte +625 -0
- package/components/Header/HeaderItem.svelte.d.ts +23 -0
- package/components/Header/UserAvthar.svelte +634 -0
- package/components/Header/UserAvthar.svelte.d.ts +27 -0
- package/index.d.ts +4 -1
- package/index.js +4 -1
- package/package.json +4 -1
@@ -1,57 +1,27 @@
|
|
1
|
-
<script
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
NavItem,
|
9
|
-
NavLink,
|
10
|
-
Icon
|
11
|
-
} from 'sveltestrap';
|
12
|
-
|
13
|
-
let defaultImage = 'https://i.postimg.cc/76TBTD1g/illustration-businessman-53876-5856.avif'
|
14
|
-
export let userImage ='https://i.postimg.cc/QCHcWMkm/userprofile.png'; //https://i.postimg.cc/QCHcWMkm/userprofile.png - hosted image
|
15
|
-
export let userName = 'John Doe';
|
16
|
-
export let userRole = 'Administrator';
|
17
|
-
let isOpen = false;
|
18
|
-
|
19
|
-
const imageURLVerification = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g
|
20
|
-
let result = userImage.match(imageURLVerification);
|
21
|
-
if(result == null)
|
22
|
-
userImage = defaultImage;
|
23
|
-
|
1
|
+
<script>
|
2
|
+
import {
|
3
|
+
Collapse,
|
4
|
+
NavbarToggler,
|
5
|
+
Nav,
|
6
|
+
Navbar,
|
7
|
+
} from 'sveltestrap';
|
24
8
|
|
25
|
-
|
26
|
-
isOpen = event.detail.isOpen;
|
27
|
-
}
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<Navbar expand="md" class='bg-white'> <!-- container='md' - for container look -->
|
31
|
-
<NavbarBrand href="/" class='efs-small headerLogo' style='font-weight:300;'>
|
32
|
-
<img src="https://i.postimg.cc/QCTH3KJ2/logo.png" alt="ENKITEK" >
|
33
|
-
Farm Management System
|
34
|
-
</NavbarBrand>
|
35
|
-
<NavbarToggler class='border border-success text-success' on:click={() => (isOpen = !isOpen)} />
|
36
|
-
<Collapse {isOpen} navbar expand="md" on:update={handleUpdate}>
|
37
|
-
<Nav class="ms-auto d-flex align-items-center" navbar>
|
38
|
-
<NavItem class='me-3'>
|
39
|
-
<NavLink href="#components/" class='headerIcons'><Icon name='bell'></Icon></NavLink>
|
40
|
-
</NavItem>
|
41
|
-
<NavItem class='me-3'>
|
42
|
-
<NavLink href="#components/" class='headerIcons'><Icon name='gear'></Icon></NavLink>
|
43
|
-
</NavItem>
|
44
|
-
<NavbarBrand href="/" class='userProfile'>
|
45
|
-
<div class="userProfileBox">
|
46
|
-
<p class="m-0 efs-small etext-black text-capitalize">{userName}</p>
|
47
|
-
<p class="m-0 efs-small text-capitalize">{userRole}</p>
|
48
|
-
</div>
|
49
|
-
<img src="{userImage}" alt="PROFILE" >
|
50
|
-
</NavbarBrand>
|
51
|
-
</Nav>
|
52
|
-
</Collapse>
|
53
|
-
</Navbar>
|
9
|
+
let isOpen = false;
|
54
10
|
|
11
|
+
function handleUpdate(event) {
|
12
|
+
isOpen = event.detail.isOpen;
|
13
|
+
}
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<Navbar expand="md" class="bg-white">
|
17
|
+
<slot name="brand" />
|
18
|
+
<NavbarToggler class="border border-success text-success" on:click={() => (isOpen = !isOpen)} />
|
19
|
+
<Collapse {isOpen} navbar expand="md" on:update={handleUpdate}>
|
20
|
+
<Nav class="ms-auto d-flex align-items-center" navbar>
|
21
|
+
<slot />
|
22
|
+
</Nav>
|
23
|
+
</Collapse>
|
24
|
+
</Navbar>
|
55
25
|
|
56
26
|
<style>@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
|
57
27
|
@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");
|
@@ -664,4 +634,4 @@
|
|
664
634
|
font-style: normal;
|
665
635
|
font-weight: 400;
|
666
636
|
line-height: normal;
|
667
|
-
}</style>
|
637
|
+
}</style>
|
@@ -2,12 +2,13 @@
|
|
2
2
|
/** @typedef {typeof __propDef.events} HeaderEvents */
|
3
3
|
/** @typedef {typeof __propDef.slots} HeaderSlots */
|
4
4
|
export default class Header extends SvelteComponentTyped<{
|
5
|
-
|
6
|
-
userName?: string | undefined;
|
7
|
-
userRole?: string | undefined;
|
5
|
+
[x: string]: never;
|
8
6
|
}, {
|
9
7
|
[evt: string]: CustomEvent<any>;
|
10
|
-
}, {
|
8
|
+
}, {
|
9
|
+
brand: {};
|
10
|
+
default: {};
|
11
|
+
}> {
|
11
12
|
}
|
12
13
|
export type HeaderProps = typeof __propDef.props;
|
13
14
|
export type HeaderEvents = typeof __propDef.events;
|
@@ -15,13 +16,14 @@ export type HeaderSlots = typeof __propDef.slots;
|
|
15
16
|
import { SvelteComponentTyped } from "svelte";
|
16
17
|
declare const __propDef: {
|
17
18
|
props: {
|
18
|
-
|
19
|
-
userName?: string | undefined;
|
20
|
-
userRole?: string | undefined;
|
19
|
+
[x: string]: never;
|
21
20
|
};
|
22
21
|
events: {
|
23
22
|
[evt: string]: CustomEvent<any>;
|
24
23
|
};
|
25
|
-
slots: {
|
24
|
+
slots: {
|
25
|
+
brand: {};
|
26
|
+
default: {};
|
27
|
+
};
|
26
28
|
};
|
27
29
|
export {};
|