igniteui-cli 15.2.2-alpha.3 → 15.3.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/lib/PromptSession.js +1 -1
- package/lib/commands/ai-config.d.ts +9 -2
- package/lib/commands/ai-config.js +49 -14
- package/lib/commands/build.js +7 -12
- package/lib/commands/new.js +4 -1
- package/package.json +4 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +0 -5
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +3 -1
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +7 -35
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +1 -54
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +0 -38
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +0 -68
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +1 -124
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +0 -62
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +29 -6
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +2 -2
- package/templates/react/igr-ts/accordion/default/index.js +2 -1
- package/templates/react/igr-ts/avatar/default/index.js +2 -1
- package/templates/react/igr-ts/badge/default/index.js +2 -1
- package/templates/react/igr-ts/banner/default/index.js +2 -1
- package/templates/react/igr-ts/button/default/index.js +2 -1
- package/templates/react/igr-ts/button-group/default/index.js +2 -1
- package/templates/react/igr-ts/calendar/default/index.js +2 -1
- package/templates/react/igr-ts/card/default/index.js +2 -1
- package/templates/react/igr-ts/checkbox/default/index.js +2 -1
- package/templates/react/igr-ts/chip/default/index.js +2 -1
- package/templates/react/igr-ts/circular-progress/default/index.js +2 -1
- package/templates/react/igr-ts/constants.d.ts +2 -0
- package/templates/react/igr-ts/constants.js +5 -0
- package/templates/react/igr-ts/custom-templates/subscription-form/index.js +2 -1
- package/templates/react/igr-ts/date-picker/default/index.js +2 -1
- package/templates/react/igr-ts/divider/default/index.js +2 -1
- package/templates/react/igr-ts/dropdown/default/index.js +2 -1
- package/templates/react/igr-ts/expansion-panel/default/index.js +2 -1
- package/templates/react/igr-ts/form/default/index.js +2 -1
- package/templates/react/igr-ts/grid/basic/index.js +2 -1
- package/templates/react/igr-ts/icon/default/index.js +2 -1
- package/templates/react/igr-ts/icon-button/default/index.js +2 -1
- package/templates/react/igr-ts/input/default/index.js +2 -1
- package/templates/react/igr-ts/linear-progress/default/index.js +2 -1
- package/templates/react/igr-ts/list/default/index.js +2 -1
- package/templates/react/igr-ts/navbar/default/index.js +2 -1
- package/templates/react/igr-ts/projects/_base/files/package.json +2 -1
- package/templates/react/igr-ts/projects/_base/files/src/app/app.tsx +4 -2
- package/templates/react/igr-ts/projects/_base/files/src/setupTests.ts +12 -0
- package/templates/react/igr-ts/projects/_base/files/styles.css +6 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/index.html +2 -1
- package/templates/react/igr-ts/projects/_base_with_home/files/src/app/home/home.tsx +60 -10
- package/templates/react/igr-ts/projects/_base_with_home/files/src/app/home/style.module.css +79 -20
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +0 -8
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +6 -36
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +8 -142
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +2 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +7 -14
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +2 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -8
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +2 -2
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +60 -74
- package/templates/react/igr-ts/projects/empty/index.js +2 -2
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app-routes.tsx +5 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app.css +82 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app.tsx +104 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/home/home.tsx +69 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/home/style.module.css +105 -0
- package/templates/react/igr-ts/projects/{top-nav → side-nav}/index.d.ts +2 -2
- package/templates/react/igr-ts/projects/{top-nav → side-nav}/index.js +7 -7
- package/templates/react/igr-ts/projects/side-nav-auth/files/index.html +19 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app-routes.tsx +24 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.css +84 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.tsx +124 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/AuthContext.tsx +73 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/AuthGuard.tsx +14 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Login.module.css +93 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Login.tsx +69 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginBar.module.css +42 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginBar.tsx +44 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginDialog.module.css +14 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginDialog.tsx +49 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Register.module.css +74 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Register.tsx +67 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/external-login.ts +10 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/login.ts +4 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/register-info.ts +6 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/user.ts +19 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/Profile.module.css +87 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/Profile.tsx +42 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectFacebook.tsx +44 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectGoogle.tsx +40 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectMicrosoft.tsx +40 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/authentication.ts +37 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/external-auth-config.ts +44 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/externalAuth.ts +272 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/fakeBackend.ts +88 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/jwtUtil.ts +10 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/pkce.ts +29 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/userStore.ts +39 -0
- package/templates/react/igr-ts/projects/side-nav-auth/index.d.ts +15 -0
- package/templates/react/igr-ts/projects/side-nav-auth/index.js +46 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app-routes.tsx +5 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.css +109 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.test.tsx +20 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.tsx +81 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/home/home.tsx +69 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/home/style.module.css +105 -0
- package/templates/react/igr-ts/projects/side-nav-mini/index.d.ts +15 -0
- package/templates/react/igr-ts/projects/side-nav-mini/index.js +46 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.css +106 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.tsx +101 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/index.d.ts +15 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/index.js +50 -0
- package/templates/react/igr-ts/radio-group/default/index.js +2 -1
- package/templates/react/igr-ts/rating/default/index.js +2 -1
- package/templates/react/igr-ts/ripple/default/index.js +2 -1
- package/templates/react/igr-ts/slider/default/index.js +2 -1
- package/templates/react/igr-ts/switch/default/index.js +2 -1
- package/templates/react/igr-ts/tabs/default/index.js +2 -1
- package/templates/react/igr-ts/text-area/default/index.js +2 -1
- package/templates/react/igr-ts/tree/default/index.js +2 -1
- package/templates/webcomponents/igc-ts/grid/default/index.js +1 -1
- package/templates/webcomponents/igc-ts/grid/grid-editing/index.js +1 -1
- package/templates/webcomponents/igc-ts/grid/grid-summaries/index.js +1 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +6 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +1 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +2 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +2 -2
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/app/home/home.ts +103 -9
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/assets/wc.png +0 -0
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-choose-components/SKILL.md +122 -160
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-customize-component-theme/SKILL.md +83 -311
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-customize-component-theme/references/mcp-setup.md +69 -0
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/SKILL.md +4 -1
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/references/component-mapping.md +60 -61
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +15 -11
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-optimize-bundle-size/SKILL.md +23 -274
- package/templates/webcomponents/igc-ts/projects/empty/index.js +1 -1
- package/templates/webcomponents/igc-ts/projects/side-nav/files/index.html +21 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app-routing.ts +9 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +192 -22
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/home/home.ts +175 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/index.js +1 -1
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/index.html +25 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/app-routing.ts +37 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/app.ts +251 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts +124 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-dialog/login-dialog.ts +253 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/external-login.ts +10 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/login.ts +4 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/register-info.ts +6 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/user.ts +19 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/authentication.ts +37 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/external-auth-config.ts +44 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/externalAuth.ts +272 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/fakeBackend.ts +88 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/jwtUtil.ts +10 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/pkce.ts +29 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/userStore.ts +39 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/profile/profile.ts +142 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/redirect/redirect-facebook.ts +57 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/redirect/redirect-google.ts +53 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/redirect/redirect-microsoft.ts +53 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/index.d.ts +15 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/index.js +46 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/files/src/app/app-routing.ts +13 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/files/src/app/app.ts +238 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/index.d.ts +14 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/index.js +45 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/files/src/app/app.ts +258 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/index.d.ts +15 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/index.js +50 -0
- package/templates/webcomponents/igc-ts/tree/default/index.js +1 -1
- package/templates/react/igr-ts/projects/top-nav/files/src/app/app.css +0 -62
- package/templates/react/igr-ts/projects/top-nav/files/src/app/app.tsx +0 -18
- package/templates/react/igr-ts/projects/top-nav/files/src/components/navigation-header/index.tsx +0 -19
- /package/templates/react/igr-ts/projects/{top-nav → side-nav}/files/src/app/app.test.tsx +0 -0
|
@@ -1,58 +1,228 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Router } from '@vaadin/router';
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
3
4
|
import {
|
|
4
5
|
defineComponents,
|
|
6
|
+
IgcIconComponent,
|
|
5
7
|
IgcNavDrawerComponent,
|
|
6
|
-
|
|
8
|
+
IgcNavDrawerItemComponent,
|
|
9
|
+
registerIcon,
|
|
7
10
|
} from 'igniteui-webcomponents';
|
|
8
|
-
import { Router } from '@vaadin/router';
|
|
9
11
|
import { routes } from './app-routing.js';
|
|
10
12
|
|
|
13
|
+
type AppRoute = {
|
|
14
|
+
path: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
11
19
|
defineComponents(
|
|
20
|
+
IgcIconComponent,
|
|
12
21
|
IgcNavDrawerComponent,
|
|
13
|
-
|
|
22
|
+
IgcNavDrawerItemComponent,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const materialIcons = [
|
|
26
|
+
['home', 'action/svg/production/ic_home_24px.svg'],
|
|
27
|
+
['menu', 'navigation/svg/production/ic_menu_24px.svg'],
|
|
28
|
+
['apps', 'navigation/svg/production/ic_apps_24px.svg'],
|
|
29
|
+
['code', 'action/svg/production/ic_code_24px.svg'],
|
|
30
|
+
['build', 'action/svg/production/ic_build_24px.svg'],
|
|
31
|
+
['palette', 'image/svg/production/ic_palette_24px.svg'],
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
materialIcons.forEach(([name, path]) =>
|
|
35
|
+
registerIcon(name, `https://unpkg.com/material-design-icons@3.0.1/${path}`, 'material')
|
|
14
36
|
);
|
|
15
37
|
|
|
16
38
|
@customElement('app-root')
|
|
17
39
|
export default class App extends LitElement {
|
|
40
|
+
@state()
|
|
41
|
+
private drawerOpen = true;
|
|
42
|
+
|
|
43
|
+
@state()
|
|
44
|
+
private drawerPosition: 'relative' | 'start' = 'relative';
|
|
45
|
+
|
|
46
|
+
@state()
|
|
47
|
+
private currentPath = window.location.pathname;
|
|
48
|
+
|
|
49
|
+
private mediaQuery?: MediaQueryList;
|
|
50
|
+
|
|
18
51
|
static styles = css`
|
|
19
52
|
:host {
|
|
20
53
|
display: flex;
|
|
21
54
|
height: 100%;
|
|
22
55
|
}
|
|
23
56
|
|
|
24
|
-
|
|
25
|
-
height: 100%;
|
|
26
|
-
width: 100%;
|
|
57
|
+
.app {
|
|
27
58
|
display: flex;
|
|
28
|
-
text-align: center;
|
|
29
59
|
flex-flow: column nowrap;
|
|
30
|
-
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.app__navbar {
|
|
66
|
+
display: flex;
|
|
31
67
|
align-items: center;
|
|
32
|
-
|
|
68
|
+
flex: 0 0 auto;
|
|
69
|
+
height: 56px;
|
|
70
|
+
padding: 0 16px;
|
|
71
|
+
background: #239ef0;
|
|
72
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, .24);
|
|
33
73
|
box-sizing: border-box;
|
|
34
74
|
}
|
|
75
|
+
|
|
76
|
+
.app__menu-button {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
width: 40px;
|
|
81
|
+
height: 40px;
|
|
82
|
+
padding: 0;
|
|
83
|
+
color: #000;
|
|
84
|
+
border: 0;
|
|
85
|
+
background: transparent;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.app__menu-button igc-icon {
|
|
90
|
+
font-size: 24px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.app__title {
|
|
94
|
+
margin: 0 0 0 16px;
|
|
95
|
+
color: #000;
|
|
96
|
+
font-size: 1.25rem;
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
line-height: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.app__body {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex: 1 1 auto;
|
|
104
|
+
min-height: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.app__drawer {
|
|
108
|
+
flex: 0 0 auto;
|
|
109
|
+
height: 100%;
|
|
110
|
+
--menu-full-width: 280px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
igc-nav-drawer-item::part(base) {
|
|
114
|
+
min-height: 48px;
|
|
115
|
+
color: #2d2d2d;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
igc-nav-drawer-item[active]::part(base) {
|
|
119
|
+
background: #e0f2ff;
|
|
120
|
+
color: #0075d2;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
igc-nav-drawer-item[active] igc-icon {
|
|
124
|
+
color: #0075d2;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
igc-nav-drawer-item:not([active]) igc-icon {
|
|
128
|
+
color: #2d2d2d;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
router-outlet {
|
|
132
|
+
flex: 1 1 auto;
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: stretch;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
min-width: 0;
|
|
137
|
+
overflow: auto;
|
|
138
|
+
}
|
|
35
139
|
`;
|
|
36
140
|
|
|
37
141
|
render() {
|
|
142
|
+
const visibleRoutes = (routes as AppRoute[]).filter((route) => route.name);
|
|
143
|
+
|
|
38
144
|
return html`
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
145
|
+
<div class="app">
|
|
146
|
+
<header class="app__navbar">
|
|
147
|
+
<button
|
|
148
|
+
class="app__menu-button"
|
|
149
|
+
type="button"
|
|
150
|
+
aria-label="Toggle navigation"
|
|
151
|
+
@click=${this.toggleDrawer}
|
|
152
|
+
>
|
|
153
|
+
<igc-icon name="menu" collection="material"></igc-icon>
|
|
154
|
+
</button>
|
|
155
|
+
<h1 class="app__title">$(name)</h1>
|
|
156
|
+
</header>
|
|
157
|
+
<div class="app__body">
|
|
158
|
+
<igc-nav-drawer
|
|
159
|
+
class="app__drawer"
|
|
160
|
+
?open=${this.drawerOpen}
|
|
161
|
+
position=${this.drawerPosition}
|
|
162
|
+
>
|
|
163
|
+
${visibleRoutes.map((route) => html`
|
|
164
|
+
<igc-nav-drawer-item
|
|
165
|
+
?active=${this.currentPath === route.path}
|
|
166
|
+
@click=${() => this.navigate(route.path)}
|
|
167
|
+
>
|
|
168
|
+
<igc-icon
|
|
169
|
+
slot="icon"
|
|
170
|
+
name=${route.icon || 'home'}
|
|
171
|
+
collection="material"
|
|
172
|
+
></igc-icon>
|
|
173
|
+
<span slot="content">${route.name}</span>
|
|
174
|
+
</igc-nav-drawer-item>
|
|
175
|
+
`)}
|
|
176
|
+
</igc-nav-drawer>
|
|
177
|
+
<router-outlet></router-outlet>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
50
180
|
`;
|
|
51
181
|
}
|
|
52
182
|
|
|
183
|
+
connectedCallback() {
|
|
184
|
+
super.connectedCallback();
|
|
185
|
+
|
|
186
|
+
this.mediaQuery = window.matchMedia('(min-width: 1025px)');
|
|
187
|
+
this.updateDrawerState();
|
|
188
|
+
this.mediaQuery.addEventListener('change', this.updateDrawerState);
|
|
189
|
+
window.addEventListener('popstate', this.updateCurrentPath);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
disconnectedCallback() {
|
|
193
|
+
this.mediaQuery?.removeEventListener('change', this.updateDrawerState);
|
|
194
|
+
window.removeEventListener('popstate', this.updateCurrentPath);
|
|
195
|
+
|
|
196
|
+
super.disconnectedCallback();
|
|
197
|
+
}
|
|
198
|
+
|
|
53
199
|
firstUpdated() {
|
|
54
200
|
const outlet = this.shadowRoot?.querySelector('router-outlet');
|
|
55
201
|
const router = new Router(outlet);
|
|
56
202
|
router.setRoutes(routes);
|
|
57
203
|
}
|
|
204
|
+
|
|
205
|
+
private toggleDrawer = () => {
|
|
206
|
+
this.drawerOpen = !this.drawerOpen;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
private navigate(path: string) {
|
|
210
|
+
this.currentPath = path;
|
|
211
|
+
Router.go(path);
|
|
212
|
+
|
|
213
|
+
if (!this.mediaQuery?.matches) {
|
|
214
|
+
this.drawerOpen = false;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
private updateDrawerState = () => {
|
|
219
|
+
const pinned = Boolean(this.mediaQuery?.matches);
|
|
220
|
+
|
|
221
|
+
this.drawerOpen = pinned;
|
|
222
|
+
this.drawerPosition = pinned ? 'relative' : 'start';
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
private updateCurrentPath = () => {
|
|
226
|
+
this.currentPath = window.location.pathname;
|
|
227
|
+
};
|
|
58
228
|
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import {
|
|
4
|
+
defineComponents,
|
|
5
|
+
IgcIconComponent,
|
|
6
|
+
} from 'igniteui-webcomponents';
|
|
7
|
+
|
|
8
|
+
defineComponents(IgcIconComponent);
|
|
9
|
+
|
|
10
|
+
@customElement('app-home')
|
|
11
|
+
export class HomeComponent extends LitElement {
|
|
12
|
+
static styles = css`
|
|
13
|
+
:host {
|
|
14
|
+
display: flex;
|
|
15
|
+
width: 100%;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.home {
|
|
20
|
+
width: 100%;
|
|
21
|
+
max-width: 920px;
|
|
22
|
+
margin: auto;
|
|
23
|
+
padding: 48px 24px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
font-family: "Titillium Web", "Segoe UI", Arial, sans-serif;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.home__intro {
|
|
29
|
+
max-width: 720px;
|
|
30
|
+
margin: 0 auto 24px;
|
|
31
|
+
text-align: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
h1 {
|
|
35
|
+
margin: 0 0 12px;
|
|
36
|
+
color: #09f;
|
|
37
|
+
font-size: 3rem;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
line-height: 1.2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.home__description {
|
|
43
|
+
margin: 0;
|
|
44
|
+
color: #000;
|
|
45
|
+
font-size: 1.125rem;
|
|
46
|
+
line-height: 1.5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.home__image {
|
|
50
|
+
display: block;
|
|
51
|
+
width: 500px;
|
|
52
|
+
height: 350px;
|
|
53
|
+
margin: 0 auto 28px;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
object-fit: contain;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.home__resources {
|
|
59
|
+
display: grid;
|
|
60
|
+
grid-template-columns: repeat(2, 300px);
|
|
61
|
+
justify-content: center;
|
|
62
|
+
margin: 0 auto;
|
|
63
|
+
gap: 12px 64px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.home__resource {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
min-height: 64px;
|
|
70
|
+
padding: 6px 0;
|
|
71
|
+
color: rgba(0, 0, 0, .74);
|
|
72
|
+
text-align: left;
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.home__resource:hover strong {
|
|
77
|
+
text-decoration: underline;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.home__resource igc-icon {
|
|
81
|
+
flex: 0 0 28px;
|
|
82
|
+
margin-right: 16px;
|
|
83
|
+
color: #09f;
|
|
84
|
+
font-size: 28px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.home__resource strong,
|
|
88
|
+
.home__resource small {
|
|
89
|
+
display: block;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.home__resource strong {
|
|
93
|
+
margin-bottom: 2px;
|
|
94
|
+
color: #731963;
|
|
95
|
+
font-size: 1rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.home__resource small {
|
|
99
|
+
color: #000;
|
|
100
|
+
font-size: 0.875rem;
|
|
101
|
+
line-height: 1.4;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (max-width: 768px) {
|
|
105
|
+
.home {
|
|
106
|
+
padding: 32px 16px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
h1 {
|
|
110
|
+
font-size: 2.25rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.home__image {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 240px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.home__resources {
|
|
119
|
+
grid-template-columns: minmax(0, 300px);
|
|
120
|
+
justify-content: center;
|
|
121
|
+
gap: 4px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
|
|
126
|
+
render() {
|
|
127
|
+
return html`
|
|
128
|
+
<main class="home">
|
|
129
|
+
<div class="home__intro">
|
|
130
|
+
<h1>Welcome to Ignite UI for Web Components!</h1>
|
|
131
|
+
<p class="home__description">
|
|
132
|
+
A routed application shell with a responsive side navigation drawer and curated Ignite UI resources.
|
|
133
|
+
</p>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<img
|
|
137
|
+
src="./src/assets/astronaut-components.svg"
|
|
138
|
+
class="home__image"
|
|
139
|
+
alt="Ignite UI for Web Components"
|
|
140
|
+
>
|
|
141
|
+
|
|
142
|
+
<div class="home__resources" role="navigation" aria-label="Ignite UI resources">
|
|
143
|
+
<a class="home__resource" href="https://www.infragistics.com/products/ignite-ui-web-components" target="_blank" rel="noopener noreferrer">
|
|
144
|
+
<igc-icon name="apps" collection="material"></igc-icon>
|
|
145
|
+
<span>
|
|
146
|
+
<strong>Component Demos</strong>
|
|
147
|
+
<small>Browse Web Components demos and examples</small>
|
|
148
|
+
</span>
|
|
149
|
+
</a>
|
|
150
|
+
<a class="home__resource" href="https://github.com/IgniteUI/igniteui-webcomponents" target="_blank" rel="noopener noreferrer">
|
|
151
|
+
<igc-icon name="code" collection="material"></igc-icon>
|
|
152
|
+
<span>
|
|
153
|
+
<strong>Web Components Repository</strong>
|
|
154
|
+
<small>Explore Ignite UI for Web Components on GitHub</small>
|
|
155
|
+
</span>
|
|
156
|
+
</a>
|
|
157
|
+
<a class="home__resource" href="https://github.com/IgniteUI/igniteui-cli" target="_blank" rel="noopener noreferrer">
|
|
158
|
+
<igc-icon name="build" collection="material"></igc-icon>
|
|
159
|
+
<span>
|
|
160
|
+
<strong>Ignite UI CLI</strong>
|
|
161
|
+
<small>Review the CLI source and project tooling</small>
|
|
162
|
+
</span>
|
|
163
|
+
</a>
|
|
164
|
+
<a class="home__resource" href="https://www.figma.com/@infragistics" target="_blank" rel="noopener noreferrer">
|
|
165
|
+
<igc-icon name="palette" collection="material"></igc-icon>
|
|
166
|
+
<span>
|
|
167
|
+
<strong>Figma UI Kit</strong>
|
|
168
|
+
<small>Open Infragistics design resources</small>
|
|
169
|
+
</span>
|
|
170
|
+
</a>
|
|
171
|
+
</div>
|
|
172
|
+
</main>
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -30,7 +30,7 @@ class SideNavProject extends _base_with_home_1.BaseWithHomeIgcProject {
|
|
|
30
30
|
constructor() {
|
|
31
31
|
super(...arguments);
|
|
32
32
|
this.id = "side-nav";
|
|
33
|
-
this.name = "
|
|
33
|
+
this.name = "Side navigation default";
|
|
34
34
|
this.description = "Project structure with side navigation drawer";
|
|
35
35
|
this.framework = "webcomponents";
|
|
36
36
|
this.projectType = "igc-ts";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<title>Ignite UI for Web Components</title>
|
|
9
|
+
<link rel="icon" type="image/png" href="./src/assets/wc.png">
|
|
10
|
+
<link href="https://fonts.googleapis.com/css?family=Titillium+Web:300,400,600,700" rel="stylesheet">
|
|
11
|
+
<link rel="stylesheet" href="./node_modules/igniteui-webcomponents/themes/light/material.css">
|
|
12
|
+
<link rel="stylesheet" href="./styles.css">
|
|
13
|
+
<!-- Facebook JS SDK — required only when facebook is configured in external-auth-config.ts.
|
|
14
|
+
Remove this script if you are not using Facebook login. -->
|
|
15
|
+
<script async defer crossorigin="anonymous"
|
|
16
|
+
src="https://connect.facebook.net/en_US/sdk.js"></script>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body class="ig-scrollbar">
|
|
20
|
+
<app-root></app-root>
|
|
21
|
+
|
|
22
|
+
<script type="module" src="./src/index.ts"></script>
|
|
23
|
+
</body>
|
|
24
|
+
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Route } from '@vaadin/router';
|
|
2
|
+
import { UserStore } from './authentication/services/userStore.js';
|
|
3
|
+
import './home/home.js';
|
|
4
|
+
import './not-found/not-found.js';
|
|
5
|
+
import './profile/profile.js';
|
|
6
|
+
import './redirect/redirect-google.js';
|
|
7
|
+
import './redirect/redirect-microsoft.js';
|
|
8
|
+
import './redirect/redirect-facebook.js';
|
|
9
|
+
|
|
10
|
+
export interface AppRoute extends Route {
|
|
11
|
+
icon?: string;
|
|
12
|
+
requiresAuth?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function authGuard(_context: any, commands: any) {
|
|
16
|
+
if (!UserStore.getUser()) {
|
|
17
|
+
return commands.redirect('/');
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const routes: AppRoute[] = [
|
|
23
|
+
{ path: '/', component: 'app-home', name: 'Home', icon: 'home' },
|
|
24
|
+
{
|
|
25
|
+
path: '/auth/profile',
|
|
26
|
+
component: 'app-profile',
|
|
27
|
+
name: 'Profile',
|
|
28
|
+
icon: 'account_circle',
|
|
29
|
+
requiresAuth: true,
|
|
30
|
+
action: authGuard,
|
|
31
|
+
},
|
|
32
|
+
{ path: '/auth/redirect-google', component: 'app-redirect-google' },
|
|
33
|
+
{ path: '/auth/redirect-microsoft', component: 'app-redirect-microsoft' },
|
|
34
|
+
{ path: '/auth/redirect-facebook', component: 'app-redirect-facebook' },
|
|
35
|
+
// The fallback route should always be after other alternatives.
|
|
36
|
+
{ path: '(.*)', component: 'app-not-found' },
|
|
37
|
+
];
|