diff --git a/projects/integration/src/app/api-tests/ng-core.spec.ts b/projects/integration/src/app/api-tests/ng-core.spec.ts index e7da7fa0..13492130 100644 --- a/projects/integration/src/app/api-tests/ng-core.spec.ts +++ b/projects/integration/src/app/api-tests/ng-core.spec.ts @@ -18,7 +18,7 @@ import { keys } from '@s-libs/micro-dash'; import * as ngCore from '@s-libs/ng-core'; import { DirectiveSuperclass, - FormControlSuperclass, + FormComponentSuperclass, InjectableSuperclass, mixInInjectableSuperclass, provideValueAccessor, @@ -34,8 +34,8 @@ describe('ng-core', () => { expect(DirectiveSuperclass).toBeDefined(); }); - it('has FormControlSuperclass', () => { - expect(FormControlSuperclass).toBeDefined(); + it('has FormComponentSuperclass', () => { + expect(FormComponentSuperclass).toBeDefined(); }); it('has InjectableSuperclass', () => { @@ -301,7 +301,7 @@ describe('ng-core', () => { }); it('knows where to find micro-dash', () => { - // FormControlSuperclass uses micro-dash. This is one of its tests + // FormComponentSuperclass uses micro-dash. This is one of its tests @Component({ template: ` @@ -331,7 +331,7 @@ describe('ng-core', () => { providers: [provideValueAccessor(CounterComponent)], changeDetection: ChangeDetectionStrategy.OnPush, }) - class CounterComponent extends FormControlSuperclass { + class CounterComponent extends FormComponentSuperclass { counter = 0; constructor(injector: Injector) { diff --git a/projects/micro-dash/src/lib/collection/partition.spec.ts b/projects/micro-dash/src/lib/collection/partition.spec.ts index 1f587ba0..32b75c6b 100644 --- a/projects/micro-dash/src/lib/collection/partition.spec.ts +++ b/projects/micro-dash/src/lib/collection/partition.spec.ts @@ -209,7 +209,7 @@ describe('partition', () => { // stolen from https://github.com/lodash/lodash // - var array = [1, 0, 1]; + const array = [1, 0, 1]; it('should split elements into two groups by `predicate`', () => { expect(partition([], identity)).toEqual([[], []]); diff --git a/projects/ng-core/src/lib/form-control-superclass.spec.ts b/projects/ng-core/src/lib/form-component-superclass.spec.ts similarity index 94% rename from projects/ng-core/src/lib/form-control-superclass.spec.ts rename to projects/ng-core/src/lib/form-component-superclass.spec.ts index 615580b1..b6c89195 100644 --- a/projects/ng-core/src/lib/form-control-superclass.spec.ts +++ b/projects/ng-core/src/lib/form-component-superclass.spec.ts @@ -6,9 +6,9 @@ import { ComponentContext } from '@s-libs/ng-dev'; import { click, find, findButton } from '../test-helpers'; import { DirectiveSuperclass } from './directive-superclass'; import { - FormControlSuperclass, + FormComponentSuperclass, provideValueAccessor, -} from './form-control-superclass'; +} from './form-component-superclass'; import { InjectableSuperclass } from './injectable-superclass'; @Component({ @@ -35,7 +35,7 @@ class TestComponent { providers: [provideValueAccessor(CounterComponent)], changeDetection: ChangeDetectionStrategy.OnPush, }) -class CounterComponent extends FormControlSuperclass { +class CounterComponent extends FormComponentSuperclass { counter = 0; handleIncomingValue(value: number): void { @@ -48,7 +48,7 @@ class CounterComponent extends FormControlSuperclass { } } -describe('FormControlSuperclass', () => { +describe('FormComponentSuperclass', () => { let ctx: ComponentContext; beforeEach(() => { ctx = new ComponentContext(TestComponent, { diff --git a/projects/ng-core/src/lib/form-control-superclass.ts b/projects/ng-core/src/lib/form-component-superclass.ts similarity index 95% rename from projects/ng-core/src/lib/form-control-superclass.ts rename to projects/ng-core/src/lib/form-component-superclass.ts index ef673bf9..51f1962c 100644 --- a/projects/ng-core/src/lib/form-control-superclass.ts +++ b/projects/ng-core/src/lib/form-component-superclass.ts @@ -32,7 +32,7 @@ export function provideValueAccessor(type: Type): Provider { * `, * providers: [provideValueAccessor(CounterComponent)], * }) - * class CounterComponent extends FormControlSuperclass { + * class CounterComponent extends FormComponentSuperclass { * counter = 0; * * handleIncomingValue(value: number) { @@ -46,7 +46,7 @@ export function provideValueAccessor(type: Type): Provider { * } * ``` */ -export abstract class FormControlSuperclass +export abstract class FormComponentSuperclass extends DirectiveSuperclass implements ControlValueAccessor { diff --git a/projects/ng-core/src/lib/wrapped-form-control-superclass.spec.ts b/projects/ng-core/src/lib/wrapped-form-control-superclass.spec.ts index 00b3de49..69dc81f5 100644 --- a/projects/ng-core/src/lib/wrapped-form-control-superclass.spec.ts +++ b/projects/ng-core/src/lib/wrapped-form-control-superclass.spec.ts @@ -16,9 +16,9 @@ import { filter, map } from 'rxjs/operators'; import { click, find, findButton, setValue } from '../test-helpers'; import { DirectiveSuperclass } from './directive-superclass'; import { - FormControlSuperclass, + FormComponentSuperclass, provideValueAccessor, -} from './form-control-superclass'; +} from './form-component-superclass'; import { InjectableSuperclass } from './injectable-superclass'; import { WrappedFormControlSuperclass } from './wrapped-form-control-superclass'; @@ -267,7 +267,7 @@ describe('WrappedFormControlSuperclass tests using an old style fixture', () => ).componentInstance; expect(component instanceof InjectableSuperclass).toBe(true); expect(component instanceof DirectiveSuperclass).toBe(true); - expect(component instanceof FormControlSuperclass).toBe(true); + expect(component instanceof FormComponentSuperclass).toBe(true); }); }); }); diff --git a/projects/ng-core/src/lib/wrapped-form-control-superclass.ts b/projects/ng-core/src/lib/wrapped-form-control-superclass.ts index 6623c5b6..aa8be6b9 100644 --- a/projects/ng-core/src/lib/wrapped-form-control-superclass.ts +++ b/projects/ng-core/src/lib/wrapped-form-control-superclass.ts @@ -3,7 +3,7 @@ import { FormControl } from '@angular/forms'; import { wrapMethod } from '@s-libs/js-core'; import { Observable, Subject } from 'rxjs'; import { map } from 'rxjs/operators'; -import { FormControlSuperclass } from './form-control-superclass'; +import { FormComponentSuperclass } from './form-component-superclass'; /** * Extend this when creating a form control that simply wraps an existing form control, to reduce a lot of boilerplate. **Warning:** You _must_ include a constructor in your subclass. @@ -50,7 +50,7 @@ import { FormControlSuperclass } from './form-control-superclass'; export abstract class WrappedFormControlSuperclass< OuterType, InnerType = OuterType, -> extends FormControlSuperclass { +> extends FormComponentSuperclass { /** Bind this to your inner form control to make all the magic happen. */ formControl = new FormControl(); diff --git a/projects/ng-core/src/public-api.ts b/projects/ng-core/src/public-api.ts index e9458700..05064539 100644 --- a/projects/ng-core/src/public-api.ts +++ b/projects/ng-core/src/public-api.ts @@ -4,9 +4,9 @@ export { DirectiveSuperclass } from './lib/directive-superclass'; export { - FormControlSuperclass, + FormComponentSuperclass, provideValueAccessor, -} from './lib/form-control-superclass'; +} from './lib/form-component-superclass'; export { InjectableSuperclass, mixInInjectableSuperclass, diff --git a/projects/ng-core/src/typing-tests/form-control-superclass.dts-spec.ts b/projects/ng-core/src/typing-tests/form-control-superclass.dts-spec.ts index 3b2c22f3..f40a2d28 100644 --- a/projects/ng-core/src/typing-tests/form-control-superclass.dts-spec.ts +++ b/projects/ng-core/src/typing-tests/form-control-superclass.dts-spec.ts @@ -1,6 +1,6 @@ -import { FormControlSuperclass } from '../public-api'; +import { FormComponentSuperclass } from '../public-api'; -class TestSubclass extends FormControlSuperclass { +class TestSubclass extends FormComponentSuperclass { handleIncomingValue(_value: Date): void {} }