@duetds/cli 4.1.4 → 4.1.6

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 (64) hide show
  1. package/package.json +2 -2
  2. package/templates/angular/18.1.0-standalone/.browserlistrc +16 -0
  3. package/templates/angular/18.1.0-standalone/.depcheckrc +2 -0
  4. package/templates/angular/18.1.0-standalone/.editorconfig +16 -0
  5. package/templates/angular/18.1.0-standalone/.eslintrc.json +52 -0
  6. package/templates/angular/18.1.0-standalone/.prettierignore +3 -0
  7. package/templates/angular/18.1.0-standalone/.prettierrc +14 -0
  8. package/templates/angular/18.1.0-standalone/LICENSE.md +29 -0
  9. package/templates/angular/18.1.0-standalone/README.md +32 -0
  10. package/templates/angular/18.1.0-standalone/angular.json +138 -0
  11. package/templates/angular/18.1.0-standalone/config/jest.base.ts +17 -0
  12. package/templates/angular/18.1.0-standalone/config/jest.setup.ts +24 -0
  13. package/templates/angular/18.1.0-standalone/package.file +59 -0
  14. package/templates/angular/18.1.0-standalone/playwright.config.ts +26 -0
  15. package/templates/angular/18.1.0-standalone/src/app/agreement.model.ts +3 -0
  16. package/templates/angular/18.1.0-standalone/src/app/app-routing.module.ts +11 -0
  17. package/templates/angular/18.1.0-standalone/src/app/app.component.html +5 -0
  18. package/templates/angular/18.1.0-standalone/src/app/app.component.scss +0 -0
  19. package/templates/angular/18.1.0-standalone/src/app/app.component.ts +25 -0
  20. package/templates/angular/18.1.0-standalone/src/app/currency-formatter.service.ts +12 -0
  21. package/templates/angular/18.1.0-standalone/src/app/footer/footer.component.html +22 -0
  22. package/templates/angular/18.1.0-standalone/src/app/footer/footer.component.scss +0 -0
  23. package/templates/angular/18.1.0-standalone/src/app/footer/footer.component.ts +12 -0
  24. package/templates/angular/18.1.0-standalone/src/app/header/header.component.html +1 -0
  25. package/templates/angular/18.1.0-standalone/src/app/header/header.component.scss +0 -0
  26. package/templates/angular/18.1.0-standalone/src/app/header/header.component.ts +12 -0
  27. package/templates/angular/18.1.0-standalone/src/app/index-page/index-page.component.html +49 -0
  28. package/templates/angular/18.1.0-standalone/src/app/index-page/index-page.component.scss +0 -0
  29. package/templates/angular/18.1.0-standalone/src/app/index-page/index-page.component.ts +74 -0
  30. package/templates/angular/18.1.0-standalone/src/app/investment-amount/investment-amount.component.html +87 -0
  31. package/templates/angular/18.1.0-standalone/src/app/investment-amount/investment-amount.component.scss +0 -0
  32. package/templates/angular/18.1.0-standalone/src/app/investment-amount/investment-amount.component.ts +41 -0
  33. package/templates/angular/18.1.0-standalone/src/app/investment-origin/investment-origin.component.html +12 -0
  34. package/templates/angular/18.1.0-standalone/src/app/investment-origin/investment-origin.component.scss +0 -0
  35. package/templates/angular/18.1.0-standalone/src/app/investment-origin/investment-origin.component.ts +35 -0
  36. package/templates/angular/18.1.0-standalone/src/app/summary/summary.component.html +74 -0
  37. package/templates/angular/18.1.0-standalone/src/app/summary/summary.component.scss +0 -0
  38. package/templates/angular/18.1.0-standalone/src/app/summary/summary.component.ts +24 -0
  39. package/templates/angular/18.1.0-standalone/src/app/value-accessors.ts +156 -0
  40. package/templates/angular/18.1.0-standalone/src/assets/.gitkeep +0 -0
  41. package/templates/angular/18.1.0-standalone/src/assets/img/android-chrome-192x192.png +0 -0
  42. package/templates/angular/18.1.0-standalone/src/assets/img/apple-touch-icon-180x180.png +0 -0
  43. package/templates/angular/18.1.0-standalone/src/assets/img/splash-screen-icon-512x512.png +0 -0
  44. package/templates/angular/18.1.0-standalone/src/environments/environment.prod.ts +3 -0
  45. package/templates/angular/18.1.0-standalone/src/environments/environment.ts +16 -0
  46. package/templates/angular/18.1.0-standalone/src/favicon.ico +0 -0
  47. package/templates/angular/18.1.0-standalone/src/index.html +24 -0
  48. package/templates/angular/18.1.0-standalone/src/main.ts +35 -0
  49. package/templates/angular/18.1.0-standalone/src/manifest.json +19 -0
  50. package/templates/angular/18.1.0-standalone/src/polyfills.ts +62 -0
  51. package/templates/angular/18.1.0-standalone/src/styles.scss +3 -0
  52. package/templates/angular/18.1.0-standalone/src/tests/app.test.ts +13 -0
  53. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts +54 -0
  54. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts-snapshots/angular-1-chromium-darwin.png +0 -0
  55. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts-snapshots/angular-2-chromium-darwin.png +0 -0
  56. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts-snapshots/angular-3-chromium-darwin.png +0 -0
  57. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts-snapshots/angular-4-chromium-darwin.png +0 -0
  58. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts-snapshots/angular-5-chromium-darwin.png +0 -0
  59. package/templates/angular/18.1.0-standalone/src/tests/playwright/playwright.test.ts-snapshots/code-chromium-darwin.json +16 -0
  60. package/templates/angular/18.1.0-standalone/src/utils/string.utils.ts +1 -0
  61. package/templates/angular/18.1.0-standalone/tsconfig.app.json +9 -0
  62. package/templates/angular/18.1.0-standalone/tsconfig.base.json +17 -0
  63. package/templates/angular/18.1.0-standalone/tsconfig.json +9 -0
  64. package/templates/angular/18.1.0-standalone/tsconfig.spec.json +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duetds/cli",
3
- "version": "4.1.4",
3
+ "version": "4.1.6",
4
4
  "description": "This package includes Duet Design System CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "LocalTapiola Services Ltd <duetdesignsystem@lahitapiola.fi>",
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "53dac3e035ca7621ab8f900e17a2436171499bcd"
36
+ "gitHead": "62e2b72cd77caf936b5369be8766865e4ad89dc3"
37
37
  }
@@ -0,0 +1,16 @@
1
+ # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2
+ # For additional information regarding the format and rule options, please see:
3
+ # https://github.com/browserslist/browserslist#queries
4
+
5
+ # For the full list of supported browsers by the Angular framework, please see:
6
+ # https://angular.io/guide/browser-support
7
+
8
+ # You can see what browsers were selected by your queries by running:
9
+ # npx browserslist
10
+
11
+ last 1 Chrome version
12
+ last 1 Firefox version
13
+ last 2 Edge major versions
14
+ last 2 Safari major versions
15
+ last 2 iOS major versions
16
+ Firefox ESR
@@ -0,0 +1,2 @@
1
+ ignores: ["eslint*", "@angular-eslint/*","ngx-toastr","@types/*","husky","prettier", " @typescript-eslint/*"]
2
+ skip-missing: true
@@ -0,0 +1,16 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.ts]
12
+ quote_type = single
13
+
14
+ [*.md]
15
+ max_line_length = off
16
+ trim_trailing_whitespace = false
@@ -0,0 +1,52 @@
1
+ {
2
+ "root": true,
3
+ "ignorePatterns": [
4
+ "projects/**/*"
5
+ ],
6
+ "overrides": [
7
+ {
8
+ "files": [
9
+ "*.ts"
10
+ ],
11
+ "parserOptions": {
12
+ "parser": "@typescript-eslint/parser",
13
+ "project": [
14
+ "./tsconfig.json"
15
+ ],
16
+ "createDefaultProgram": true
17
+ },
18
+ "extends": [
19
+ "plugin:@angular-eslint/recommended",
20
+ "plugin:@angular-eslint/template/process-inline-templates"
21
+ ],
22
+ "rules": {
23
+ "@angular-eslint/directive-selector": [
24
+ "error",
25
+ {
26
+ "type": "attribute",
27
+ "prefix": "app",
28
+ "style": "camelCase"
29
+ }
30
+ ],
31
+ "@angular-eslint/component-selector": [
32
+ "error",
33
+ {
34
+ "type": "element",
35
+ "prefix": "app",
36
+ "style": "kebab-case"
37
+ }
38
+ ],
39
+ "@angular-eslint/no-empty-lifecycle-method": "off"
40
+ }
41
+ },
42
+ {
43
+ "files": [
44
+ "*.html"
45
+ ],
46
+ "extends": [
47
+ "plugin:@angular-eslint/template/recommended"
48
+ ],
49
+ "rules": {}
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,3 @@
1
+ package.json
2
+ package-lock.json
3
+ node_modules/**/*
@@ -0,0 +1,14 @@
1
+ {
2
+ "printWidth": 120,
3
+ "singleQuote": false,
4
+ "trailingComma": "none",
5
+ "bracketSpacing": true,
6
+ "jsxBracketSameLine": false,
7
+ "semi": false,
8
+ "requirePragma": false,
9
+ "insertPragma": false,
10
+ "useTabs": false,
11
+ "tabWidth": 2,
12
+ "arrowParens": "avoid",
13
+ "proseWrap": "preserve"
14
+ }
@@ -0,0 +1,29 @@
1
+ # License
2
+
3
+ ## Authorization to access
4
+
5
+ Subject to these terms of use, LocalTapiola Services Ltd, on behalf of itself and the companies belonging to the same financial conglomerate (hereafter, individually and collectively, “LocalTapiola”) hereby grants you a limited, non-exclusive, revocable license to access and use the Duet Design System (the “Package”) solely for the purpose of performing your duties for and on behalf of LocalTapiola (the “Purpose”).
6
+
7
+ Except for the Purpose, you may not access or use the Package or reproduce, retransmit, disseminate, sell, publish, broadcast or use any of the information, content or materials available through it for any reason.
8
+
9
+ By accessing and using this Package, you agree to be bound by these terms of use.
10
+
11
+ ## Copyright
12
+
13
+ LocalTapiola reserves all copyrights, trademarks and other intellectual property rights in and to the Package and all content on the Package, as well as to any information or materials derived from them. All content and material available through the Package are the copyrighted property of LocalTapiola.
14
+
15
+ ## Trademarks
16
+
17
+ “Duet Design System” is a registered trademark of LocalTapiola. All other marks, whether registered or not, that are associated with any LocalTapiola or Turva product or service are trademarks or service marks of LocalTapiola Services Ltd. All non-LocalTapiola names or marks, if any, appearing in the Package are the property of their respective owners.
18
+
19
+ ## Disclaimer
20
+
21
+ The use of the Package is at the sole responsibility of the user. The Package is provided “as is” and “as available” without express or implied warranty or condition of any kind. LocalTapiola may at any time make changes to the Package or any of its features or functionalities. LocalTapiola also reserves the right to modify or discontinue, temporarily or permanently, functions and features of the Package, with or without notice, all without liability to you, except where prohibited by law, for any interruption, modification, or discontinuation of the Package or any of its features or functionalities.
22
+
23
+ ## Limitation of liability
24
+
25
+ To the fullest extent permitted by law, LocalTapiola accepts no liability to user or any third party for any damages, including without limitation, indirect or consequential damages or any damages whatsoever arising from use or loss of use of the Package or its content.
26
+
27
+ ## Governing law
28
+
29
+ These Terms and your use of the Package shall be governed by and construed in accordance with the substantive laws of Finland.
@@ -0,0 +1,32 @@
1
+ # Duet Angular Example
2
+
3
+ An example app built with [@duetds/angular](https://www.npmjs.com/package/@duetds/angular), demonstrating basic form handling.
4
+
5
+ ## Features
6
+
7
+ - Comes with [Duet Web Components](https://www.duetds.com/components/).
8
+ - Supports [Duet Design Tokens](https://www.duetds.com/tokens/) in SCSS without additional configuration.
9
+ - Comes with automated build and deploy steps for prototyping.
10
+ - Additionally comes with [Duet Fonts](https://www.duetds.com/typography/) and [Duet CSS Framework](https://www.duetds.com/css-framework/) preconfigured.
11
+
12
+ ## Development server
13
+
14
+ Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
15
+
16
+ ## Code scaffolding
17
+
18
+ Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
19
+
20
+ ## Build
21
+
22
+ Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
23
+
24
+ ## Notes
25
+ This has been tested using latest node at version 17.6.0, you may need to use `npm i --legacy-peer-deps` in order to complete installation
26
+ ## Further help
27
+
28
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
29
+
30
+ ## Copyright
31
+
32
+ Copyright © 2020 LocalTapiola Services Ltd. For license, please see LICENSE.md.
@@ -0,0 +1,138 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "cli": {
6
+ "cache": {
7
+ "enabled": false
8
+ }
9
+ },
10
+ "projects": {
11
+ "duet-angular-template": {
12
+ "projectType": "application",
13
+ "schematics": {
14
+ "@schematics/angular:component": {
15
+ "style": "scss",
16
+ "skipTests": true
17
+ },
18
+ "@schematics/angular:class": {
19
+ "skipTests": true
20
+ },
21
+ "@schematics/angular:directive": {
22
+ "skipTests": true
23
+ },
24
+ "@schematics/angular:guard": {
25
+ "skipTests": true
26
+ },
27
+ "@schematics/angular:interceptor": {
28
+ "skipTests": true
29
+ },
30
+ "@schematics/angular:module": {
31
+ "skipTests": true
32
+ },
33
+ "@schematics/angular:pipe": {
34
+ "skipTests": true
35
+ },
36
+ "@schematics/angular:service": {
37
+ "skipTests": true
38
+ }
39
+ },
40
+ "root": "",
41
+ "sourceRoot": "src",
42
+ "prefix": "app",
43
+ "architect": {
44
+ "build": {
45
+ "builder": "@angular-devkit/build-angular:browser",
46
+ "options": {
47
+ "outputPath": "dist/duet-angular-template",
48
+ "index": "src/index.html",
49
+ "main": "src/main.ts",
50
+ "polyfills": "src/polyfills.ts",
51
+ "tsConfig": "tsconfig.app.json",
52
+ "aot": true,
53
+ "assets": ["src/favicon.ico", "src/assets", "src/manifest.json"],
54
+ "styles": ["src/styles.scss"],
55
+ "scripts": []
56
+ },
57
+ "configurations": {
58
+ "production": {
59
+ "fileReplacements": [
60
+ {
61
+ "replace": "src/environments/environment.ts",
62
+ "with": "src/environments/environment.prod.ts"
63
+ }
64
+ ],
65
+ "optimization": true,
66
+ "outputHashing": "all",
67
+ "sourceMap": false,
68
+ "extractCss": true,
69
+ "namedChunks": false,
70
+ "extractLicenses": true,
71
+ "vendorChunk": false,
72
+ "buildOptimizer": true,
73
+ "budgets": [
74
+ {
75
+ "type": "initial",
76
+ "maximumWarning": "2mb",
77
+ "maximumError": "5mb"
78
+ },
79
+ {
80
+ "type": "anyComponentStyle",
81
+ "maximumWarning": "6kb",
82
+ "maximumError": "10kb"
83
+ }
84
+ ]
85
+ },
86
+ "development": {
87
+ "buildOptimizer": false,
88
+ "optimization": false,
89
+ "vendorChunk": true,
90
+ "extractLicenses": false,
91
+ "sourceMap": true,
92
+ "namedChunks": true
93
+ }
94
+ }
95
+ },
96
+ "serve": {
97
+ "builder": "@angular-devkit/build-angular:dev-server",
98
+ "options": {
99
+ "browserTarget": "duet-angular-template:build",
100
+ "port": 4200
101
+ },
102
+ "configurations": {
103
+ "production": {
104
+ "browserTarget": "duet-angular-template:build:production"
105
+ },
106
+ "development": {
107
+ "browserTarget": "duet-angular-template:build:development"
108
+ }
109
+ }
110
+ },
111
+ "extract-i18n": {
112
+ "builder": "@angular-devkit/build-angular:extract-i18n",
113
+ "options": {
114
+ "browserTarget": "duet-angular-template:build"
115
+ }
116
+ },
117
+ "lint": {
118
+ "builder": "@angular-eslint/builder:lint",
119
+ "options": {
120
+ "lintFilePatterns": [
121
+ "src/**/*.ts",
122
+ "src/**/*.html"
123
+ ]
124
+ }
125
+ },
126
+ "test": {
127
+ "builder": "@angular-builders/jest:run",
128
+ "options": {
129
+ "tsConfig": "tsconfig.spec.json",
130
+ "configPath" : "config/jest.base.ts",
131
+ "globalMocks": ["getComputedStyle", "doctype", "styleTransform", "matchMedia"]
132
+ }
133
+ }
134
+ }
135
+ }
136
+ },
137
+ "defaultProject": "duet-angular-template"
138
+ }
@@ -0,0 +1,17 @@
1
+ const { pathsToModuleNameMapper } = require('ts-jest');
2
+ const { compilerOptions } = require('../tsconfig.spec.json');
3
+
4
+ module.exports = {
5
+ preset: 'jest-preset-angular',
6
+ roots: ['<rootDir>/src/'],
7
+ setupFilesAfterEnv: ["<rootDir>/config/jest.setup.ts"],
8
+ collectCoverage: true,
9
+ coverageReporters: ['html'],
10
+ coverageDirectory: 'coverage/my-app',
11
+ moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths || {}, {
12
+ prefix: '<rootDir>/'
13
+ }),
14
+ testPathIgnorePatterns : [
15
+ "<rootDir>/src/tests/playwright/"
16
+ ]
17
+ };
@@ -0,0 +1,24 @@
1
+ import 'jest-preset-angular/setup-jest';
2
+
3
+
4
+ Object.defineProperty(window, 'CSS', {value: null});
5
+ Object.defineProperty(window, 'getComputedStyle', {
6
+ value: () => {
7
+ return {
8
+ display: 'none',
9
+ appearance: ['-webkit-appearance']
10
+ };
11
+ }
12
+ });
13
+
14
+ Object.defineProperty(document, 'doctype', {
15
+ value: '<!DOCTYPE html>'
16
+ });
17
+ Object.defineProperty(document.body.style, 'transform', {
18
+ value: () => {
19
+ return {
20
+ enumerable: true,
21
+ configurable: true
22
+ };
23
+ }
24
+ });
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "duet-angular-template",
3
+ "version": "18.1.0",
4
+ "scripts": {
5
+ "ng": "ng",
6
+ "start": "ng lint; npm run serve",
7
+ "serve": "ng serve --host=0.0.0.0 --poll 500 -c development",
8
+ "serve:daemon": "ng serve --host=0.0.0.0 --poll 500 &",
9
+ "build": "ng build",
10
+ "test": "ng test --watch=true",
11
+ "test:ci": "DEBUG=pw:webserver npx playwright test",
12
+ "lint": "ng lint"
13
+ },
14
+ "private": true,
15
+ "dependencies": {
16
+ "@angular/animations": "^18.1.0",
17
+ "@angular/common": "^18.1.0",
18
+ "@angular/compiler": "^18.1.0",
19
+ "@angular/core": "^18.1.0",
20
+ "@angular/forms": "^18.1.0",
21
+ "@angular/platform-browser": "^18.1.0",
22
+ "@angular/platform-browser-dynamic": "^18.1.0",
23
+ "@angular/router": "^18.1.0",
24
+ "@duetds/components": "latest",
25
+ "@duetds/css": "latest",
26
+ "@duetds/icons": "latest",
27
+ "@duetds/tokens": "latest",
28
+ "rxjs": "~7.8.0",
29
+ "tslib": "^2.3.0",
30
+ "zone.js": "~0.14.2"
31
+ },
32
+ "devDependencies": {
33
+ "@angular-builders/jest": "18.0.0",
34
+ "@angular-devkit/build-angular": "^18.1.0",
35
+ "@angular-eslint/builder": "^18.1.0",
36
+ "@angular-eslint/eslint-plugin": "^18.1.0",
37
+ "@angular-eslint/eslint-plugin-template": "^18.1.0",
38
+ "@angular-eslint/schematics": "^18.1.0",
39
+ "@angular-eslint/template-parser": "^18.1.0",
40
+ "@angular/cli": "^18.1.0",
41
+ "@angular/compiler-cli": "^18.1.0",
42
+ "@playwright/test": "1.25.0",
43
+ "@types/jest": "^29.5.0",
44
+ "@types/node": "18.11.9",
45
+ "@typescript-eslint/eslint-plugin": "6.13.2",
46
+ "@typescript-eslint/parser": "6.13.2",
47
+ "angular-eslint": "0.0.1-alpha.0",
48
+ "codelyzer": "6.0.2",
49
+ "eslint": "8.57.0",
50
+ "eslint-config-prettier": "8.5.0",
51
+ "eslint-plugin-import": "2.26.0",
52
+ "eslint-plugin-prefer-arrow": "1.2.3",
53
+ "eslint-plugin-prettier": "4.2.1",
54
+ "eslint-plugin-unused-imports": "3.0.0",
55
+ "jest": "^29.5.0",
56
+ "ts-node": "10.9.0",
57
+ "typescript": "5.5.4"
58
+ }
59
+ }
@@ -0,0 +1,26 @@
1
+ // playwright.config.ts
2
+ import { PlaywrightTestConfig, devices } from '@playwright/test';
3
+
4
+ const config: PlaywrightTestConfig = {
5
+ testDir:"src/tests/playwright",
6
+ retries: process.env.CI ? 2 : 0,
7
+ use: {
8
+ trace: 'on-first-retry',
9
+ viewport: { width: 2080, height: 2020 },
10
+ ignoreHTTPSErrors: true,
11
+ video: 'on-first-retry'
12
+ },
13
+ webServer: {
14
+ command: 'npx ng serve',
15
+ url:"http://localhost:4200/#/",
16
+ timeout: 120 * 1000,
17
+ reuseExistingServer: false
18
+ },
19
+ projects: [
20
+ {
21
+ name: 'chromium',
22
+ use: { ...devices['Desktop Chrome'] },
23
+ }
24
+ ],
25
+ };
26
+ export default config;
@@ -0,0 +1,3 @@
1
+ export class Agreement {
2
+ constructor(public readonly label: string, public readonly price: number) {}
3
+ }
@@ -0,0 +1,11 @@
1
+ import { NgModule } from "@angular/core"
2
+ import { Routes, RouterModule } from "@angular/router"
3
+ import { IndexPageComponent } from "./index-page/index-page.component"
4
+
5
+ export const routes: Routes = [{ path: "", component: IndexPageComponent }]
6
+
7
+ @NgModule({
8
+ imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: "enabled", useHash: true })],
9
+ exports: [RouterModule]
10
+ })
11
+ export class AppRoutingModule {}
@@ -0,0 +1,5 @@
1
+ <app-header></app-header>
2
+ <div class="duet-sticky-content">
3
+ <router-outlet></router-outlet>
4
+ </div>
5
+ <app-footer></app-footer>
@@ -0,0 +1,25 @@
1
+ import { Component, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"
2
+ import { RouterOutlet } from "@angular/router"
3
+ import { HeaderComponent } from "./header/header.component"
4
+ import { FooterComponent } from "./footer/footer.component"
5
+ import { IndexPageComponent } from "./index-page/index-page.component"
6
+ import { FormsModule, ReactiveFormsModule } from "@angular/forms"
7
+
8
+ @Component({
9
+ standalone: true,
10
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
11
+ selector: "app-root",
12
+ templateUrl: "./app.component.html",
13
+ imports: [
14
+ RouterOutlet,
15
+ HeaderComponent,
16
+ FooterComponent,
17
+ IndexPageComponent,
18
+ FormsModule,
19
+ ReactiveFormsModule,
20
+ ],
21
+ styleUrls: ["./app.component.scss"]
22
+ })
23
+ export class AppComponent {
24
+ constructor() {}
25
+ }
@@ -0,0 +1,12 @@
1
+ import { Injectable } from "@angular/core"
2
+ import { currencyFormatFI } from "../utils/string.utils"
3
+
4
+ @Injectable({
5
+ providedIn: "root"
6
+ })
7
+ export class CurrencyFormatterService {
8
+
9
+ format(value: number) {
10
+ return currencyFormatFI.format(value)
11
+ }
12
+ }
@@ -0,0 +1,22 @@
1
+ <duet-footer
2
+ variation="simple"
3
+ language="fi"
4
+ [menu]="[
5
+ {
6
+ label: 'Turvallisuus ja käyttöehdot',
7
+ href: '#',
8
+ external: 'true'
9
+ },
10
+ {
11
+ label: 'Evästeet',
12
+ href: '#',
13
+ external: 'true'
14
+ },
15
+ {
16
+ label: 'Henkilötietojen käsittely',
17
+ href: '#',
18
+ external: 'true'
19
+ }
20
+ ]"
21
+ >
22
+ </duet-footer>
@@ -0,0 +1,12 @@
1
+ import { Component, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"
2
+
3
+ @Component({
4
+ standalone: true,
5
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
6
+ selector: "app-footer",
7
+ templateUrl: "./footer.component.html",
8
+ styleUrls: ["./footer.component.scss"]
9
+ })
10
+ export class FooterComponent {
11
+ constructor() {}
12
+ }
@@ -0,0 +1 @@
1
+ <duet-header logo-href="" [back]="{ label: 'Takaisin', href: '/' }"></duet-header>
@@ -0,0 +1,12 @@
1
+ import { Component, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"
2
+
3
+ @Component({
4
+ standalone: true,
5
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
6
+ selector: "app-header",
7
+ templateUrl: "./header.component.html",
8
+ styleUrls: ["./header.component.scss"]
9
+ })
10
+ export class HeaderComponent {
11
+ constructor() {}
12
+ }
@@ -0,0 +1,49 @@
1
+ <duet-layout center>
2
+ <div slot="top" role="region">
3
+ <duet-spacer breakpoint="large" size="x-large"></duet-spacer>
4
+ <duet-heading level="h1" visual-level="h2">Pääotsikko</duet-heading>
5
+ <duet-spacer></duet-spacer>
6
+ </div>
7
+ <div slot="main">
8
+ <form [formGroup]="form" (ngSubmit)="handleSubmit($event)">
9
+ <duet-stepper [selected]="currentStep" (duetStepChange)="handleStepChange($event)">
10
+ <duet-step heading="Perustiedot" formGroupName="investmentAmount">
11
+ <duet-paragraph>
12
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore etdolore
13
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
14
+ </duet-paragraph>
15
+ <app-investment-amount
16
+ [form]="form.get('investmentAmount')"
17
+ [agreements]="agreements"
18
+ ></app-investment-amount>
19
+ <duet-spacer></duet-spacer>
20
+ <duet-button margin="none" variation="primary" (click)="handleNextClick($event)" [disabled]="form.invalid"
21
+ id="step1">Seuraava</duet-button
22
+ >
23
+ </duet-step>
24
+
25
+ <duet-step heading="Tarkemmat tiedot" formGroupName="investmentOrigin">
26
+ <duet-paragraph>
27
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore etdolore
28
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
29
+ </duet-paragraph>
30
+ <app-investment-origin [form]="form.get('investmentOrigin')"></app-investment-origin>
31
+ <duet-spacer></duet-spacer>
32
+ <duet-button margin="none" variation="primary" (click)="handleNextClick($event)" [disabled]="form.invalid" id="step2">
33
+ Seuraava
34
+ </duet-button>
35
+ </duet-step>
36
+
37
+ <duet-step heading="Yhteenveto">
38
+ <duet-spacer></duet-spacer>
39
+ <app-summary [agreement]="selectedAgreement"></app-summary>
40
+ <duet-spacer></duet-spacer>
41
+ <duet-button submit margin="none" variation="primary" expand [disabled]="form.invalid" id="step3"> Lähetä </duet-button>
42
+ </duet-step>
43
+ </duet-stepper>
44
+ </form>
45
+ </div>
46
+ </duet-layout>
47
+ <duet-modal [active]="completed" heading="You entered the following data:">
48
+ <pre><code>{{ form.value | json }}</code></pre>
49
+ </duet-modal>