-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
apps/demo/src/app/modules/doc/modules/form/container/value.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './number.field'; | ||
export * from './number.field.module'; |
10 changes: 10 additions & 0 deletions
10
packages/dbx-form/src/lib/formly/field/value/number/number.field.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { FormlyMaterialModule } from '@ngx-formly/material'; | ||
import { NgModule } from '@angular/core'; | ||
import { DbxFormFormlyWrapperModule } from '../../wrapper/form.wrapper.module'; | ||
|
||
@NgModule({ | ||
imports: [FormlyMaterialModule], | ||
declarations: [], | ||
exports: [DbxFormFormlyWrapperModule] | ||
}) | ||
export class DbxFormFormlyNumberFieldModule {} |
26 changes: 26 additions & 0 deletions
26
packages/dbx-form/src/lib/formly/field/value/number/number.field.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { FormlyFieldConfig } from '@ngx-formly/core'; | ||
import { AttributesFieldConfig, LabeledFieldConfig, formlyField, propsForFieldConfig, DescriptionFieldConfig } from '../../field'; | ||
|
||
export interface NumberFieldLengthConfig { | ||
min?: number; | ||
max?: number; | ||
} | ||
|
||
export type NumberFieldInputType = 'number'; | ||
|
||
export interface NumberFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, NumberFieldLengthConfig, AttributesFieldConfig { | ||
inputType?: NumberFieldInputType; | ||
} | ||
|
||
export function numberField(config: NumberFieldConfig): FormlyFieldConfig { | ||
const { key, min, max, inputType: type = 'number' } = config; | ||
return formlyField({ | ||
key, | ||
type: 'input', | ||
...propsForFieldConfig(config, { | ||
type, | ||
min, | ||
max | ||
}) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters