@haiilo/catalyst-angular 0.15.3 → 1.0.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +10 -0
  4. package/package.json +7 -24
  5. package/src/index.ts +1 -0
  6. package/src/lib/catalyst.module.ts +65 -0
  7. package/src/lib/directives/angular-component-lib/utils.ts +63 -0
  8. package/src/lib/directives/boolean-value-accessor.ts +27 -0
  9. package/src/lib/directives/proxies.ts +650 -0
  10. package/src/lib/directives/radio-value-accessor.ts +24 -0
  11. package/src/lib/directives/select-value-accessor.ts +24 -0
  12. package/src/lib/directives/text-value-accessor.ts +24 -0
  13. package/src/lib/directives/value-accessor.ts +39 -0
  14. package/{public-api.d.ts → src/public-api.ts} +0 -0
  15. package/src/test.ts +28 -0
  16. package/tsconfig.lib.json +20 -0
  17. package/tsconfig.lib.prod.json +10 -0
  18. package/tsconfig.spec.json +17 -0
  19. package/esm2020/haiilo-catalyst-angular.mjs +0 -5
  20. package/esm2020/lib/catalyst.module.mjs +0 -75
  21. package/esm2020/lib/directives/angular-component-lib/utils.mjs +0 -53
  22. package/esm2020/lib/directives/boolean-value-accessor.mjs +0 -38
  23. package/esm2020/lib/directives/proxies.mjs +0 -621
  24. package/esm2020/lib/directives/radio-value-accessor.mjs +0 -35
  25. package/esm2020/lib/directives/select-value-accessor.mjs +0 -35
  26. package/esm2020/lib/directives/text-value-accessor.mjs +0 -35
  27. package/esm2020/lib/directives/value-accessor.mjs +0 -40
  28. package/esm2020/public-api.mjs +0 -8
  29. package/fesm2015/haiilo-catalyst-angular.mjs +0 -886
  30. package/fesm2015/haiilo-catalyst-angular.mjs.map +0 -1
  31. package/fesm2020/haiilo-catalyst-angular.mjs +0 -886
  32. package/fesm2020/haiilo-catalyst-angular.mjs.map +0 -1
  33. package/haiilo-catalyst-angular.d.ts +0 -5
  34. package/lib/catalyst.module.d.ts +0 -16
  35. package/lib/directives/angular-component-lib/utils.d.ts +0 -9
  36. package/lib/directives/boolean-value-accessor.d.ts +0 -9
  37. package/lib/directives/proxies.d.ts +0 -359
  38. package/lib/directives/radio-value-accessor.d.ts +0 -8
  39. package/lib/directives/select-value-accessor.d.ts +0 -8
  40. package/lib/directives/text-value-accessor.d.ts +0 -8
  41. package/lib/directives/value-accessor.d.ts +0 -18
package/CHANGELOG.md ADDED
@@ -0,0 +1,89 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [0.5.1](https://github.com/haiilo/catalyst/compare/v0.5.0...v0.5.1) (2022-05-02)
7
+
8
+ **Note:** Version bump only for package @haiilo/catalyst-angular
9
+
10
+
11
+
12
+
13
+
14
+ # [0.5.0](https://github.com/haiilo/catalyst/compare/v0.4.0...v0.5.0) (2022-05-02)
15
+
16
+
17
+ ### Features
18
+
19
+ * add radio button component ([642cff0](https://github.com/haiilo/catalyst/commit/642cff0d7f037202c5abf65f1bf8381970bcdd69))
20
+ * **core:** add card component ([3be7246](https://github.com/haiilo/catalyst/commit/3be724616b8fa924e719a73aa688aa29a9c2f891))
21
+ * **core:** add input component ([337649a](https://github.com/haiilo/catalyst/commit/337649a44001f908110372c3341963bbbd0167f9))
22
+ * **core:** add navigation styles ([6afb6e9](https://github.com/haiilo/catalyst/commit/6afb6e9017f0dafb2c0712d914f43f895b4b9124))
23
+ * **core:** add textarea component ([9f94637](https://github.com/haiilo/catalyst/commit/9f94637fddd03f4bf98b6d90fa93ce814341efdb))
24
+ * **core:** added checkbox & toggle component ([205b0d0](https://github.com/haiilo/catalyst/commit/205b0d0cc468d40fe742a22fb1608ef25525918f))
25
+
26
+
27
+
28
+
29
+
30
+ # [0.4.0](https://github.com/haiilo/catalyst/compare/v0.3.2...v0.4.0) (2022-04-26)
31
+
32
+
33
+ ### Features
34
+
35
+ * **core:** add tooltip component ([8134e98](https://github.com/haiilo/catalyst/commit/8134e98cde4f7b9e746c2179ffafdbfe8eff4128))
36
+
37
+
38
+
39
+
40
+
41
+ ## [0.3.2](https://github.com/haiilo/catalyst/compare/v0.3.1...v0.3.2) (2022-04-25)
42
+
43
+ **Note:** Version bump only for package @haiilo/catalyst-angular
44
+
45
+
46
+
47
+
48
+
49
+ ## 0.3.1 (2022-04-23)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * lerna integration ([ebab9a3](https://github.com/haiilo/catalyst/commit/ebab9a37748e11a33fd552502ed95bfec949c409))
55
+ * umd warning ([e678c5f](https://github.com/haiilo/catalyst/commit/e678c5fa6e8d89105323de0fcb90b9cfdba6222c))
56
+
57
+
58
+ ### Features
59
+
60
+ * **core:** add alert ([8cad923](https://github.com/haiilo/catalyst/commit/8cad92339ac74b142ca6a4a0ec143982c659b970))
61
+ * **core:** add badge ([d250eb8](https://github.com/haiilo/catalyst/commit/d250eb808f77c34a430b5406edba7c11e12cf4bd))
62
+ * **core:** add skeleton component ([561f7a6](https://github.com/haiilo/catalyst/commit/561f7a627770aaef6daadca0acc5c0c858261320))
63
+ * **core:** added scrollable component ([347886b](https://github.com/haiilo/catalyst/commit/347886b2782801e445da7afc2f768aa531862084))
64
+ * **core:** changes for coyo app integration ([7304886](https://github.com/haiilo/catalyst/commit/7304886e5a2a781adcb0db2b1a63ddc58eaa6ef8))
65
+ * **core:** changes for coyo app integration ([2b6cc05](https://github.com/haiilo/catalyst/commit/2b6cc057bbd813f328ff36374a514bc56d6a15bd))
66
+ * **core:** changes for coyo app integration ([101297d](https://github.com/haiilo/catalyst/commit/101297dde26a5e8ecd007cd535667d2d3e71441a))
67
+
68
+
69
+
70
+
71
+
72
+ ## 0.0.7 (2022-04-22)
73
+
74
+
75
+ ### Bug Fixes
76
+
77
+ * lerna integration ([ebab9a3](https://github.com/haiilo/catalyst/commit/ebab9a37748e11a33fd552502ed95bfec949c409))
78
+ * umd warning ([e678c5f](https://github.com/haiilo/catalyst/commit/e678c5fa6e8d89105323de0fcb90b9cfdba6222c))
79
+
80
+
81
+ ### Features
82
+
83
+ * **core:** add alert ([8cad923](https://github.com/haiilo/catalyst/commit/8cad92339ac74b142ca6a4a0ec143982c659b970))
84
+ * **core:** add badge ([d250eb8](https://github.com/haiilo/catalyst/commit/d250eb808f77c34a430b5406edba7c11e12cf4bd))
85
+ * **core:** add skeleton component ([561f7a6](https://github.com/haiilo/catalyst/commit/561f7a627770aaef6daadca0acc5c0c858261320))
86
+ * **core:** added scrollable component ([347886b](https://github.com/haiilo/catalyst/commit/347886b2782801e445da7afc2f768aa531862084))
87
+ * **core:** changes for coyo app integration ([7304886](https://github.com/haiilo/catalyst/commit/7304886e5a2a781adcb0db2b1a63ddc58eaa6ef8))
88
+ * **core:** changes for coyo app integration ([2b6cc05](https://github.com/haiilo/catalyst/commit/2b6cc057bbd813f328ff36374a514bc56d6a15bd))
89
+ * **core:** changes for coyo app integration ([101297d](https://github.com/haiilo/catalyst/commit/101297dde26a5e8ecd007cd535667d2d3e71441a))
package/karma.conf.js ADDED
@@ -0,0 +1,44 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function (config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ jasmine: {
17
+ // you can add configuration options for Jasmine here
18
+ // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
+ // for example, you can disable the random execution with `random: false`
20
+ // or set a specific seed with `seed: 4321`
21
+ },
22
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
23
+ },
24
+ jasmineHtmlReporter: {
25
+ suppressAll: true // removes the duplicated traces
26
+ },
27
+ coverageReporter: {
28
+ dir: require('path').join(__dirname, '../../coverage/catalyst'),
29
+ subdir: '.',
30
+ reporters: [
31
+ { type: 'html' },
32
+ { type: 'text-summary' }
33
+ ]
34
+ },
35
+ reporters: ['progress', 'kjhtml'],
36
+ port: 9876,
37
+ colors: true,
38
+ logLevel: config.LOG_INFO,
39
+ autoWatch: true,
40
+ browsers: ['Chrome'],
41
+ singleRun: false,
42
+ restartOnFileChange: true
43
+ });
44
+ };
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/catalyst",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ },
7
+ "allowedNonPeerDependencies": [
8
+ "@haiilo/catalyst"
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@haiilo/catalyst-angular",
3
- "version": "0.15.3",
3
+ "version": "1.0.0",
4
4
  "description": "Angular wrapper for Catalyst Design System",
5
5
  "license": "MIT",
6
+ "scripts": {
7
+ "reset": "rm -rf ./node_modules"
8
+ },
6
9
  "publishConfig": {
7
10
  "access": "public"
8
11
  },
@@ -11,27 +14,7 @@
11
14
  "rxjs": ">=6.6.0"
12
15
  },
13
16
  "dependencies": {
14
- "@haiilo/catalyst": "0.15.3",
17
+ "@haiilo/catalyst": "1.0.0",
15
18
  "tslib": "^2.3.0"
16
- },
17
- "module": "fesm2015/haiilo-catalyst-angular.mjs",
18
- "es2020": "fesm2020/haiilo-catalyst-angular.mjs",
19
- "esm2020": "esm2020/haiilo-catalyst-angular.mjs",
20
- "fesm2020": "fesm2020/haiilo-catalyst-angular.mjs",
21
- "fesm2015": "fesm2015/haiilo-catalyst-angular.mjs",
22
- "typings": "haiilo-catalyst-angular.d.ts",
23
- "exports": {
24
- "./package.json": {
25
- "default": "./package.json"
26
- },
27
- ".": {
28
- "types": "./haiilo-catalyst-angular.d.ts",
29
- "esm2020": "./esm2020/haiilo-catalyst-angular.mjs",
30
- "es2020": "./fesm2020/haiilo-catalyst-angular.mjs",
31
- "es2015": "./fesm2015/haiilo-catalyst-angular.mjs",
32
- "node": "./fesm2015/haiilo-catalyst-angular.mjs",
33
- "default": "./fesm2020/haiilo-catalyst-angular.mjs"
34
- }
35
- },
36
- "sideEffects": false
37
- }
19
+ }
20
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './public-api';
@@ -0,0 +1,65 @@
1
+ import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';
2
+ import { CatI18nRegistry, CatIconRegistry } from '@haiilo/catalyst';
3
+ import { defineCustomElements } from '@haiilo/catalyst/loader';
4
+ import * as Components from './directives/proxies';
5
+ import { TextValueAccessor } from "./directives/text-value-accessor";
6
+ import { SelectValueAccessor } from "./directives/select-value-accessor";
7
+ import { RadioValueAccessor } from "./directives/radio-value-accessor";
8
+ import { BooleanValueAccessor } from "./directives/boolean-value-accessor";
9
+
10
+ const CatComponents = [
11
+ Components.CatAlert,
12
+ Components.CatAvatar,
13
+ Components.CatBadge,
14
+ Components.CatButton,
15
+ Components.CatCard,
16
+ Components.CatCheckbox,
17
+ Components.CatIcon,
18
+ Components.CatInput,
19
+ Components.CatMenu,
20
+ Components.CatModal,
21
+ Components.CatRadio,
22
+ Components.CatRadioGroup,
23
+ Components.CatScrollable,
24
+ Components.CatSelect,
25
+ Components.CatSkeleton,
26
+ Components.CatSpinner,
27
+ Components.CatTab,
28
+ Components.CatTabs,
29
+ Components.CatTextarea,
30
+ Components.CatToggle,
31
+ Components.CatTooltip
32
+ ];
33
+
34
+ const CatDirectives = [
35
+ TextValueAccessor,
36
+ SelectValueAccessor,
37
+ RadioValueAccessor,
38
+ BooleanValueAccessor
39
+ ]
40
+
41
+ export const CAT_I18N_REGISTRY_TOKEN = new InjectionToken<CatI18nRegistry>('CAT_I18N_REGISTRY', {
42
+ providedIn: 'root',
43
+ factory: () => CatI18nRegistry.getInstance(),
44
+ });
45
+
46
+ export const CAT_ICON_REGISTRY_TOKEN = new InjectionToken<CatIconRegistry>('CAT_ICON_REGISTRY', {
47
+ providedIn: 'root',
48
+ factory: () => CatIconRegistry.getInstance(),
49
+ });
50
+
51
+ @NgModule({
52
+ imports: [],
53
+ declarations: [...CatComponents, ...CatDirectives],
54
+ exports: [...CatComponents, ...CatDirectives],
55
+ providers: []
56
+ })
57
+ export class CatalystModule {
58
+
59
+ static forRoot(): ModuleWithProviders<CatalystModule> {
60
+ defineCustomElements();
61
+ return {
62
+ ngModule: CatalystModule
63
+ };
64
+ }
65
+ }
@@ -0,0 +1,63 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ import { fromEvent } from 'rxjs';
4
+
5
+ export const proxyInputs = (Cmp: any, inputs: string[]) => {
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
+ });
17
+ };
18
+
19
+ export const proxyMethods = (Cmp: any, methods: string[]) => {
20
+ const Prototype = Cmp.prototype;
21
+ methods.forEach(methodName => {
22
+ Prototype[methodName] = function () {
23
+ const args = arguments;
24
+ return this.z.runOutsideAngular(() =>
25
+ this.el[methodName].apply(this.el, args)
26
+ );
27
+ };
28
+ });
29
+ };
30
+
31
+ export const proxyOutputs = (instance: any, el: any, events: string[]) => {
32
+ events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
33
+ }
34
+
35
+ export const defineCustomElement = (tagName: string, customElement: any) => {
36
+ if (
37
+ customElement !== undefined &&
38
+ typeof customElements !== 'undefined' &&
39
+ !customElements.get(tagName)
40
+ ) {
41
+ customElements.define(tagName, customElement);
42
+ }
43
+ }
44
+
45
+ // tslint:disable-next-line: only-arrow-functions
46
+ export function ProxyCmp(opts: { defineCustomElementFn?: () => void, inputs?: any; methods?: any }) {
47
+ const decorator = function (cls: any) {
48
+ const { defineCustomElementFn, inputs, methods } = opts;
49
+
50
+ if (defineCustomElementFn !== undefined) {
51
+ defineCustomElementFn();
52
+ }
53
+
54
+ if (inputs) {
55
+ proxyInputs(cls, inputs);
56
+ }
57
+ if (methods) {
58
+ proxyMethods(cls, methods);
59
+ }
60
+ return cls;
61
+ };
62
+ return decorator;
63
+ }
@@ -0,0 +1,27 @@
1
+ import { Directive, ElementRef } from '@angular/core';
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+
4
+ import { ValueAccessor } from './value-accessor';
5
+
6
+ @Directive({
7
+ /* tslint:disable-next-line:directive-selector */
8
+ selector: 'cat-checkbox, cat-toggle',
9
+ host: {
10
+ '(catChange)': 'handleChangeEvent($event.target.value)'
11
+ },
12
+ providers: [
13
+ {
14
+ provide: NG_VALUE_ACCESSOR,
15
+ useExisting: BooleanValueAccessor,
16
+ multi: true
17
+ }
18
+ ]
19
+ })
20
+ export class BooleanValueAccessor extends ValueAccessor {
21
+ constructor(el: ElementRef) {
22
+ super(el);
23
+ }
24
+ writeValue(value: any) {
25
+ this.el.nativeElement.checked = this.lastValue = value == null ? false : value;
26
+ }
27
+ }