@haiilo/catalyst-angular 1.0.0 → 1.0.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/esm2020/haiilo-catalyst-angular.mjs +5 -0
- package/esm2020/lib/catalyst.module.mjs +74 -0
- package/esm2020/lib/directives/angular-component-lib/utils.mjs +53 -0
- package/esm2020/lib/directives/boolean-value-accessor.mjs +38 -0
- package/esm2020/lib/directives/proxies.mjs +595 -0
- package/esm2020/lib/directives/radio-value-accessor.mjs +35 -0
- package/esm2020/lib/directives/select-value-accessor.mjs +35 -0
- package/esm2020/lib/directives/text-value-accessor.mjs +35 -0
- package/esm2020/lib/directives/value-accessor.mjs +40 -0
- package/esm2020/public-api.mjs +8 -0
- package/fesm2015/haiilo-catalyst-angular.mjs +860 -0
- package/fesm2015/haiilo-catalyst-angular.mjs.map +1 -0
- package/fesm2020/haiilo-catalyst-angular.mjs +860 -0
- package/fesm2020/haiilo-catalyst-angular.mjs.map +1 -0
- package/haiilo-catalyst-angular.d.ts +5 -0
- package/lib/catalyst.module.d.ts +16 -0
- package/lib/directives/angular-component-lib/utils.d.ts +9 -0
- package/lib/directives/boolean-value-accessor.d.ts +9 -0
- package/lib/directives/proxies.d.ts +334 -0
- package/lib/directives/radio-value-accessor.d.ts +8 -0
- package/lib/directives/select-value-accessor.d.ts +8 -0
- package/lib/directives/text-value-accessor.d.ts +8 -0
- package/lib/directives/value-accessor.d.ts +18 -0
- package/package.json +24 -7
- package/{src/public-api.ts → public-api.d.ts} +0 -0
- package/CHANGELOG.md +0 -89
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -10
- package/src/index.ts +0 -1
- package/src/lib/catalyst.module.ts +0 -65
- package/src/lib/directives/angular-component-lib/utils.ts +0 -63
- package/src/lib/directives/boolean-value-accessor.ts +0 -27
- package/src/lib/directives/proxies.ts +0 -650
- package/src/lib/directives/radio-value-accessor.ts +0 -24
- package/src/lib/directives/select-value-accessor.ts +0 -24
- package/src/lib/directives/text-value-accessor.ts +0 -24
- package/src/lib/directives/value-accessor.ts +0 -39
- package/src/test.ts +0 -28
- package/tsconfig.lib.json +0 -20
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -1,24 +0,0 @@
|
|
|
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-input, cat-textarea',
|
|
9
|
-
host: {
|
|
10
|
-
'(catChange)': 'handleChangeEvent($event.target.value)'
|
|
11
|
-
},
|
|
12
|
-
providers: [
|
|
13
|
-
{
|
|
14
|
-
provide: NG_VALUE_ACCESSOR,
|
|
15
|
-
useExisting: TextValueAccessor,
|
|
16
|
-
multi: true
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
})
|
|
20
|
-
export class TextValueAccessor extends ValueAccessor {
|
|
21
|
-
constructor(el: ElementRef) {
|
|
22
|
-
super(el);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Directive, ElementRef, HostListener } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Directive({})
|
|
5
|
-
export class ValueAccessor implements ControlValueAccessor {
|
|
6
|
-
|
|
7
|
-
private onChange: (value: any) => void = () => {/**/};
|
|
8
|
-
private onTouched: () => void = () => {/**/};
|
|
9
|
-
protected lastValue: any;
|
|
10
|
-
|
|
11
|
-
constructor(protected el: ElementRef) {}
|
|
12
|
-
|
|
13
|
-
writeValue(value: any) {
|
|
14
|
-
this.el.nativeElement.value = this.lastValue = value == null ? '' : value;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
handleChangeEvent(value: any) {
|
|
18
|
-
if (value !== this.lastValue) {
|
|
19
|
-
this.lastValue = value;
|
|
20
|
-
this.onChange(value);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@HostListener('focusout')
|
|
25
|
-
_handleBlurEvent() {
|
|
26
|
-
this.onTouched();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
registerOnChange(fn: (value: any) => void) {
|
|
30
|
-
this.onChange = fn;
|
|
31
|
-
}
|
|
32
|
-
registerOnTouched(fn: () => void) {
|
|
33
|
-
this.onTouched = fn;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
setDisabledState(isDisabled: boolean) {
|
|
37
|
-
this.el.nativeElement.disabled = isDisabled;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/src/test.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js';
|
|
4
|
-
import 'zone.js/testing';
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import {
|
|
7
|
-
BrowserDynamicTestingModule,
|
|
8
|
-
platformBrowserDynamicTesting
|
|
9
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
-
|
|
11
|
-
declare const require: {
|
|
12
|
-
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
-
keys(): string[];
|
|
14
|
-
<T>(id: string): T;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// First, initialize the Angular testing environment.
|
|
19
|
-
getTestBed().initTestEnvironment(
|
|
20
|
-
BrowserDynamicTestingModule,
|
|
21
|
-
platformBrowserDynamicTesting(),
|
|
22
|
-
{ teardown: { destroyAfterEach: true }},
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
// Then we find all the tests.
|
|
26
|
-
const context = require.context('./', true, /\.spec\.ts$/);
|
|
27
|
-
// And load the modules.
|
|
28
|
-
context.keys().map(context);
|
package/tsconfig.lib.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"target": "es2015",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"declarationMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"types": [],
|
|
11
|
-
"lib": [
|
|
12
|
-
"dom",
|
|
13
|
-
"es2018"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"exclude": [
|
|
17
|
-
"src/test.ts",
|
|
18
|
-
"**/*.spec.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"src/test.ts"
|
|
12
|
-
],
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.d.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|