@ongov/ontario-design-system-component-library-angular 7.0.0 → 8.0.0-alpha.1
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/README.md +58 -38
- package/dist/component-library/README.md +1 -1
- package/dist/component-library/fesm2022/angular-component-library.mjs +1019 -733
- package/dist/component-library/fesm2022/angular-component-library.mjs.map +1 -1
- package/dist/component-library/package.json +2 -4
- package/dist/component-library/{lib/stencil-generated/components.d.ts → types/angular-component-library.d.ts} +543 -482
- package/package.json +36 -21
- package/projects/component-library/README.md +1 -1
- package/projects/component-library/src/lib/stencil-generated/angular-component-lib/utils.ts +44 -44
- package/projects/component-library/src/lib/stencil-generated/components.ts +2388 -2767
- package/projects/component-library/src/lib/stencil-generated/index.ts +152 -151
- package/projects/component-library/src/public-api.ts +1 -1
- package/dist/component-library/esm2022/angular-component-library.mjs +0 -5
- package/dist/component-library/esm2022/lib/component-library.module.mjs +0 -20
- package/dist/component-library/esm2022/lib/stencil-generated/angular-component-lib/utils.mjs +0 -59
- package/dist/component-library/esm2022/lib/stencil-generated/components.mjs +0 -3796
- package/dist/component-library/esm2022/lib/stencil-generated/index.mjs +0 -155
- package/dist/component-library/esm2022/public-api.mjs +0 -8
- package/dist/component-library/index.d.ts +0 -5
- package/dist/component-library/lib/component-library.module.d.ts +0 -7
- package/dist/component-library/lib/stencil-generated/angular-component-lib/utils.d.ts +0 -9
- package/dist/component-library/lib/stencil-generated/index.d.ts +0 -2
- package/dist/component-library/public-api.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ongov/ontario-design-system-component-library-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
4
4
|
"description": "Angular specific wrapper for ontario-design-system-component-library",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"ng": "ng",
|
|
11
11
|
"start": "ng serve app-angular",
|
|
12
|
-
"build": "pnpm run build:component-lib && pnpm run
|
|
12
|
+
"build": "pnpm run build:component-lib && pnpm run docs:copy:readme",
|
|
13
13
|
"build:component-lib": "ng build component-library",
|
|
14
14
|
"build:app": "ng build app-angular",
|
|
15
15
|
"clean": "rm -rf build",
|
|
@@ -29,6 +29,16 @@
|
|
|
29
29
|
"module": "./dist/component-library/index.t.ts",
|
|
30
30
|
"types": "./dist/component-library/index.t.ts",
|
|
31
31
|
"styles": "./dist/component-library/styles/theme.scss",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/component-library/types/angular-component-library.d.ts",
|
|
35
|
+
"default": "./dist/component-library/fesm2022/angular-component-library.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./styles/theme.scss": "./dist/component-library/styles/theme.scss",
|
|
38
|
+
"./styles/theme": "./dist/component-library/styles/theme.scss",
|
|
39
|
+
"./styles/slotted-styles/*": "./dist/component-library/styles/slotted-styles/*",
|
|
40
|
+
"./styles/*": "./dist/component-library/styles/*"
|
|
41
|
+
},
|
|
32
42
|
"files": [
|
|
33
43
|
"dist/",
|
|
34
44
|
"projects/component-library/src",
|
|
@@ -36,31 +46,36 @@
|
|
|
36
46
|
"README.md"
|
|
37
47
|
],
|
|
38
48
|
"dependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"@angular/core": "^18.2.11",
|
|
43
|
-
"@angular/forms": "^18.2.11",
|
|
44
|
-
"@angular/platform-browser": "^18.2.11",
|
|
45
|
-
"@angular/platform-browser-dynamic": "^18.2.11",
|
|
46
|
-
"@angular/router": "^18.2.11",
|
|
47
|
-
"@ongov/ontario-design-system-component-library": "7.0.0",
|
|
48
|
-
"@ongov/ontario-design-system-global-styles": "7.0.0",
|
|
49
|
-
"copyfiles": "^2.4.1",
|
|
50
|
-
"rxjs": "~7.8.1",
|
|
51
|
-
"tslib": "^2.8.1"
|
|
49
|
+
"@ongov/ontario-design-system-component-library": "8.0.0-alpha.1",
|
|
50
|
+
"@ongov/ontario-design-system-global-styles": "8.0.0-alpha.1",
|
|
51
|
+
"copyfiles": "^2.4.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@angular-devkit/build-angular": "
|
|
55
|
-
"@angular/
|
|
56
|
-
"@angular/
|
|
54
|
+
"@angular-devkit/build-angular": "21.1.0",
|
|
55
|
+
"@angular/animations": "21.1.0",
|
|
56
|
+
"@angular/cli": "~21.1.0",
|
|
57
|
+
"@angular/common": "21.1.0",
|
|
58
|
+
"@angular/compiler": "21.1.0",
|
|
59
|
+
"@angular/compiler-cli": "21.1.0",
|
|
60
|
+
"@angular/core": "21.1.0",
|
|
61
|
+
"@angular/forms": "21.1.0",
|
|
62
|
+
"@angular/platform-browser": "21.1.0",
|
|
63
|
+
"@angular/platform-browser-dynamic": "21.1.0",
|
|
64
|
+
"@angular/router": "21.1.0",
|
|
57
65
|
"karma": "~6.4.4",
|
|
58
66
|
"karma-chrome-launcher": "~3.2.0",
|
|
59
67
|
"karma-coverage": "~2.2.1",
|
|
60
68
|
"karma-jasmine": "~5.1.0",
|
|
61
69
|
"karma-jasmine-html-reporter": "~2.1.0",
|
|
62
|
-
"ng-packagr": "^
|
|
63
|
-
"
|
|
70
|
+
"ng-packagr": "^21.1.0",
|
|
71
|
+
"rxjs": "~7.8.1",
|
|
72
|
+
"tslib": "^2.8.1",
|
|
73
|
+
"typescript": "5.9.3"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@angular/common": ">=18 <22",
|
|
77
|
+
"@angular/core": ">=18 <22",
|
|
78
|
+
"@angular/router": ">=18 <22"
|
|
64
79
|
},
|
|
65
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "c931cd40f92b5459964082abec17c0f83e176a72"
|
|
66
81
|
}
|
|
@@ -17,7 +17,7 @@ To use the Angular Component Library, follow these steps:
|
|
|
17
17
|
2. Import the `ComponentLibraryModule`, or whichever specific component you wish to use into your root module. The `ComponentLibraryModule` import will include all the Ontario Design System web components.
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import { ComponentLibraryModule } from '@ongov/ontario-design-system-component-library-angular
|
|
20
|
+
import { ComponentLibraryModule } from '@ongov/ontario-design-system-component-library-angular';
|
|
21
21
|
|
|
22
22
|
@NgModule({
|
|
23
23
|
imports: [ComponentLibraryModule],
|
|
@@ -3,63 +3,63 @@
|
|
|
3
3
|
import { fromEvent } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
export const proxyInputs = (Cmp: any, inputs: string[]) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
const Prototype = Cmp.prototype;
|
|
7
|
+
inputs.forEach((item) => {
|
|
8
|
+
Object.defineProperty(Prototype, item, {
|
|
9
|
+
get() {
|
|
10
|
+
return this.el[item];
|
|
11
|
+
},
|
|
12
|
+
set(val: any) {
|
|
13
|
+
this.z.runOutsideAngular(() => (this.el[item] = val));
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* In the event that proxyInputs is called
|
|
17
|
+
* multiple times re-defining these inputs
|
|
18
|
+
* will cause an error to be thrown. As a result
|
|
19
|
+
* we set configurable: true to indicate these
|
|
20
|
+
* properties can be changed.
|
|
21
|
+
*/
|
|
22
|
+
configurable: true,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export const proxyMethods = (Cmp: any, methods: string[]) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
const Prototype = Cmp.prototype;
|
|
29
|
+
methods.forEach((methodName) => {
|
|
30
|
+
Prototype[methodName] = function () {
|
|
31
|
+
const args = arguments;
|
|
32
|
+
return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export const proxyOutputs = (instance: any, el: any, events: string[]) => {
|
|
38
|
-
|
|
38
|
+
events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const defineCustomElement = (tagName: string, customElement: any) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
43
|
+
customElements.define(tagName, customElement);
|
|
44
|
+
}
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
// tslint:disable-next-line: only-arrow-functions
|
|
48
48
|
export function ProxyCmp(opts: { defineCustomElementFn?: () => void; inputs?: any; methods?: any }) {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const decorator = function (cls: any) {
|
|
50
|
+
const { defineCustomElementFn, inputs, methods } = opts;
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
if (defineCustomElementFn !== undefined) {
|
|
53
|
+
defineCustomElementFn();
|
|
54
|
+
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
if (inputs) {
|
|
57
|
+
proxyInputs(cls, inputs);
|
|
58
|
+
}
|
|
59
|
+
if (methods) {
|
|
60
|
+
proxyMethods(cls, methods);
|
|
61
|
+
}
|
|
62
|
+
return cls;
|
|
63
|
+
};
|
|
64
|
+
return decorator;
|
|
65
65
|
}
|