Skip to content

Commit

Permalink
fix(formfield): add brain form-field and forms into the generator CLI (
Browse files Browse the repository at this point in the history
…#369)

* fix(form-field): add form field brain into peerDependencies (#365,#358,#351)

- remove unused code
- change docs from form-field to formfield
- add ui-form-field-brain and ui-forms-brain into supported ui libraries

* fix(form-field): run linter

* fix(form-field): update supported UI libraries

- form field brain and forms brain

* feat(form-field): add UI form field test
  • Loading branch information
cjosue15 authored Sep 9, 2024
1 parent 7e43099 commit 5863f81
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export const routeMeta: RouteMeta = {
<spartan-section-sub-heading id="installation">Installation</spartan-section-sub-heading>
<spartan-cli-tabs
class="mt-4"
nxCode="npx nx g @spartan-ng/cli:ui form-field"
ngCode="ng g @spartan-ng/cli:ui form-field"
nxCode="npx nx g @spartan-ng/cli:ui formfield"
ngCode="ng g @spartan-ng/cli:ui formfield"
/>
<spartan-section-sub-heading id="usage">Usage</spartan-section-sub-heading>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ describe('Hlm Form Field Component', () => {
expect(error()?.textContent?.trim()).toBe(TEXT_ERROR);
});
});
});
});

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions libs/cli/src/generators/ui/libs/ui-form-field/generator.ts

This file was deleted.

10 changes: 8 additions & 2 deletions libs/cli/src/generators/ui/supported-ui-libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@
"@angular/core": "^18.0.0",
"@spartan-ng/ui-core": "0.0.1-alpha.353",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1"
"clsx": "^1.2.1",
"@spartan-ng/ui-form-field-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-forms-brain": "0.0.1-alpha.353"
}
},
"label": {
Expand Down Expand Up @@ -304,6 +306,9 @@
"@angular/core": "^18.0.0",
"@spartan-ng/ui-core": "0.0.1-alpha.353",
"@spartan-ng/ui-select-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-label-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-form-field-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-forms-brain": "0.0.1-alpha.353",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1"
}
Expand Down Expand Up @@ -332,7 +337,8 @@
"@angular/core": "^18.0.0",
"@spartan-ng/ui-core": "0.0.1-alpha.353",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1"
"clsx": "^1.2.1",
"@spartan-ng/ui-form-field-brain": "0.0.1-alpha.353"
}
}
}
1 change: 1 addition & 0 deletions libs/ui/form-field/helm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"@angular/core": "^18.0.0",
"@spartan-ng/ui-core": "0.0.1-alpha.353",
"class-variance-authority": "^0.6.0",
"@spartan-ng/ui-form-field-brain": "0.0.1-alpha.353",
"clsx": "^1.2.1"
},
"dependencies": {},
Expand Down
2 changes: 2 additions & 0 deletions libs/ui/input/helm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"@angular/core": "^18.0.0",
"@spartan-ng/ui-core": "0.0.1-alpha.353",
"class-variance-authority": "^0.6.0",
"@spartan-ng/ui-forms-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-form-field-brain": "0.0.1-alpha.353",
"clsx": "^1.2.1"
},
"dependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/input/helm/src/lib/hlm-input.directive.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Directive, type DoCheck, Inject, Injector, Input, computed, effect, inject, input, signal } from '@angular/core';
import { Directive, type DoCheck, Injector, Input, computed, effect, inject, input, signal } from '@angular/core';
import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
import { hlm } from '@spartan-ng/ui-core';
import { BrnFormFieldControl } from '@spartan-ng/ui-form-field-brain';
Expand Down
4 changes: 3 additions & 1 deletion libs/ui/select/brain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"@angular/cdk": "^18.0.0",
"@angular/forms": "^18.0.0",
"@spartan-ng/ui-core": "0.0.1-alpha.353",
"@spartan-ng/ui-label-brain": "0.0.1-alpha.353"
"@spartan-ng/ui-label-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-form-field-brain": "0.0.1-alpha.353",
"@spartan-ng/ui-forms-brain": "0.0.1-alpha.353"
},
"dependencies": {},
"sideEffects": false,
Expand Down
4 changes: 2 additions & 2 deletions libs/ui/slider/brain/src/lib/brn-slider-input.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
InjectionToken,
PLATFORM_ID,
Renderer2,
type Signal,
computed,
effect,
inject,
signal,
type Signal,
} from '@angular/core';
import { NG_VALUE_ACCESSOR, type ControlValueAccessor } from '@angular/forms';
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { BRN_SLIDER } from './brn-slider.directive';

export const BRN_SLIDER_INPUT = new InjectionToken<BrnSliderInput>('BrnSliderInput');
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/slider/brain/src/lib/brn-slider-thumb.directive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isPlatformBrowser } from '@angular/common';
import { Directive, ElementRef, PLATFORM_ID, computed, effect, inject, type Signal } from '@angular/core';
import { Directive, ElementRef, PLATFORM_ID, type Signal, computed, effect, inject } from '@angular/core';
import { BRN_SLIDER } from './brn-slider.directive';

export interface BrnSliderThumb {
Expand Down
4 changes: 2 additions & 2 deletions libs/ui/slider/brain/src/lib/brn-slider-track.directive.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { SharedResizeObserver } from '@angular/cdk/observers/private';
import { isPlatformBrowser } from '@angular/common';
import {
type AfterViewInit,
Directive,
ElementRef,
InjectionToken,
PLATFORM_ID,
type Signal,
computed,
contentChild,
forwardRef,
inject,
signal,
type AfterViewInit,
type Signal,
} from '@angular/core';
import { Subject, debounceTime, takeUntil, tap } from 'rxjs';
import { BRN_SLIDER_INPUT, type BrnSliderInput } from './brn-slider-input.directive';
Expand Down
10 changes: 5 additions & 5 deletions libs/ui/slider/brain/src/lib/brn-slider.directive.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Directionality, type Direction } from '@angular/cdk/bidi';
import { type Direction, Directionality } from '@angular/cdk/bidi';
import { isPlatformBrowser } from '@angular/common';
import {
type AfterViewInit,
Directive,
InjectionToken,
Injector,
type OnDestroy,
PLATFORM_ID,
type Signal,
type WritableSignal,
contentChild,
inject,
input,
model,
signal,
type AfterViewInit,
type OnDestroy,
type Signal,
type WritableSignal,
} from '@angular/core';
import { toObservable } from '@angular/core/rxjs-interop';
import type { BrnLabelDirective } from '@spartan-ng/ui-label-brain';
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/slider/slider.stories.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Direction } from '@angular/cdk/bidi';
import { signal } from '@angular/core';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { argsToTemplate, moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
import { type Meta, type StoryObj, argsToTemplate, moduleMetadata } from '@storybook/angular';
import { BrnSliderImports } from './brain/src';
import { HlmSliderImports } from './helm/src';

Expand Down

0 comments on commit 5863f81

Please sign in to comment.