ngx-nz-formly 0.0.3 → 0.0.4

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/lib/components/{formly-button/formly-button.component.ts → nz-formly-button/nz-formly-button.component.ts} +4 -4
  3. package/src/lib/components/{formly-field-checkbox/formly-field-checkbox.component.ts → nz-formly-field-checkbox/nz-formly-field-checkbox.component.ts} +4 -4
  4. package/src/lib/components/{formly-field-input/formly-field-input.component.ts → nz-formly-field-input/nz-formly-field-input.component.ts} +4 -4
  5. package/src/lib/components/{formly-field-radio/formly-field-radio.component.ts → nz-formly-field-radio/nz-formly-field-radio.component.ts} +4 -4
  6. package/src/lib/components/{formly-field-select/formly-field-select.component.ts → nz-formly-field-select/nz-formly-field-select.component.ts} +4 -4
  7. package/src/lib/components/{formly-field-switch/formly-field-switch.component.ts → nz-formly-field-switch/nz-formly-field-switch.component.ts} +4 -4
  8. package/src/lib/ngx-nz-formly-props.model.ts +5 -5
  9. package/src/lib/ngx-nz-formly-validators.ts +7 -7
  10. package/src/lib/ngx-nz-formly.module.ts +24 -24
  11. package/src/lib/wrappers/{formly-default-wrapper/formly-default-wrapper.component.ts → nz-formly-default-wrapper/nz-formly-default-wrapper.component.ts} +4 -4
  12. package/src/lib/wrappers/{formly-label-wrapper/formly-label-wrapper.component.ts → nz-formly-label-wrapper/nz-formly-label-wrapper.component.ts} +4 -4
  13. /package/src/lib/components/{formly-button/formly-button.component.html → nz-formly-button/nz-formly-button.component.html} +0 -0
  14. /package/src/lib/components/{formly-button/formly-button.component.scss → nz-formly-button/nz-formly-button.component.scss} +0 -0
  15. /package/src/lib/components/{formly-field-checkbox/formly-field-checkbox.component.html → nz-formly-field-checkbox/nz-formly-field-checkbox.component.html} +0 -0
  16. /package/src/lib/components/{formly-field-checkbox/formly-field-checkbox.component.scss → nz-formly-field-checkbox/nz-formly-field-checkbox.component.scss} +0 -0
  17. /package/src/lib/components/{formly-field-input/formly-field-input.component.html → nz-formly-field-input/nz-formly-field-input.component.html} +0 -0
  18. /package/src/lib/components/{formly-field-input/formly-field-input.component.scss → nz-formly-field-input/nz-formly-field-input.component.scss} +0 -0
  19. /package/src/lib/components/{formly-field-input → nz-formly-field-input}/phone-mask.config.ts +0 -0
  20. /package/src/lib/components/{formly-field-radio/formly-field-radio.component.html → nz-formly-field-radio/nz-formly-field-radio.component.html} +0 -0
  21. /package/src/lib/components/{formly-field-radio/formly-field-radio.component.scss → nz-formly-field-radio/nz-formly-field-radio.component.scss} +0 -0
  22. /package/src/lib/components/{formly-field-select/formly-field-select.component.html → nz-formly-field-select/nz-formly-field-select.component.html} +0 -0
  23. /package/src/lib/components/{formly-field-select/formly-field-select.component.scss → nz-formly-field-select/nz-formly-field-select.component.scss} +0 -0
  24. /package/src/lib/components/{formly-field-switch/formly-field-switch.component.html → nz-formly-field-switch/nz-formly-field-switch.component.html} +0 -0
  25. /package/src/lib/components/{formly-field-switch/formly-field-switch.component.scss → nz-formly-field-switch/nz-formly-field-switch.component.scss} +0 -0
  26. /package/src/lib/wrappers/{formly-default-wrapper/formly-default-wrapper.component.html → nz-formly-default-wrapper/nz-formly-default-wrapper.component.html} +0 -0
  27. /package/src/lib/wrappers/{formly-default-wrapper/formly-default-wrapper.component.scss → nz-formly-default-wrapper/nz-formly-default-wrapper.component.scss} +0 -0
  28. /package/src/lib/wrappers/{formly-label-wrapper/formly-label-wrapper.component.html → nz-formly-label-wrapper/nz-formly-label-wrapper.component.html} +0 -0
  29. /package/src/lib/wrappers/{formly-label-wrapper/formly-label-wrapper.component.scss → nz-formly-label-wrapper/nz-formly-label-wrapper.component.scss} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-nz-formly",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.2.0",
6
6
  "@angular/core": "^16.2.0",
@@ -3,11 +3,11 @@ import { FieldType, FormlyFieldConfig } from "@ngx-formly/core";
3
3
  import { NzFormlyButtonProps } from "../../ngx-nz-formly-props.model";
4
4
 
5
5
  @Component({
6
- selector: "app-formly-button",
7
- templateUrl: "./formly-button.component.html",
8
- styleUrls: ["./formly-button.component.scss"],
6
+ selector: "app-nz-formly-button",
7
+ templateUrl: "./nz-formly-button.component.html",
8
+ styleUrls: ["./nz-formly-button.component.scss"],
9
9
  })
10
- export class FormlyButtonComponent extends FieldType<
10
+ export class NzFormlyButtonComponent extends FieldType<
11
11
  FormlyFieldConfig<NzFormlyButtonProps>
12
12
  > {
13
13
  onClick() {
@@ -4,11 +4,11 @@ import { NzFormlyCheckboxProps } from "../../ngx-nz-formly-props.model";
4
4
  import { Subject, takeUntil, tap } from "rxjs";
5
5
 
6
6
  @Component({
7
- selector: "app-formly-field-checkbox",
8
- templateUrl: "./formly-field-checkbox.component.html",
9
- styleUrls: ["./formly-field-checkbox.component.scss"],
7
+ selector: "app-nz-formly-field-checkbox",
8
+ templateUrl: "./nz-formly-field-checkbox.component.html",
9
+ styleUrls: ["./nz-formly-field-checkbox.component.scss"],
10
10
  })
11
- export class FormlyFieldCheckboxComponent
11
+ export class NzFormlyFieldCheckboxComponent
12
12
  extends FieldType<FieldTypeConfig<NzFormlyCheckboxProps>>
13
13
  implements OnInit, OnDestroy
14
14
  {
@@ -11,11 +11,11 @@ const DefaultPhoneMask: CountryCodeMask = {
11
11
  };
12
12
 
13
13
  @Component({
14
- selector: "app-formly-field-input",
15
- templateUrl: "./formly-field-input.component.html",
16
- styleUrls: ["./formly-field-input.component.scss"],
14
+ selector: "app-nz-formly-field-input",
15
+ templateUrl: "./nz-formly-field-input.component.html",
16
+ styleUrls: ["./nz-formly-field-input.component.scss"],
17
17
  })
18
- export class FormlyFieldInputComponent
18
+ export class NzFormlyFieldInputComponent
19
19
  extends FieldType<FieldTypeConfig<NzFormlyInputProps>>
20
20
  implements AfterViewInit, OnDestroy
21
21
  {
@@ -4,11 +4,11 @@ import { NzFormlyRadioProps } from "../../ngx-nz-formly-props.model";
4
4
  import { Subject, takeUntil, tap } from "rxjs";
5
5
 
6
6
  @Component({
7
- selector: "app-formly-field-radio",
8
- templateUrl: "./formly-field-radio.component.html",
9
- styleUrls: ["./formly-field-radio.component.scss"],
7
+ selector: "app-nz-formly-field-radio",
8
+ templateUrl: "./nz-formly-field-radio.component.html",
9
+ styleUrls: ["./nz-formly-field-radio.component.scss"],
10
10
  })
11
- export class FormlyFieldRadioComponent
11
+ export class NzFormlyFieldRadioComponent
12
12
  extends FieldType<FieldTypeConfig<NzFormlyRadioProps>>
13
13
  implements OnInit, OnDestroy
14
14
  {
@@ -4,11 +4,11 @@ import { NzFormlySelectProps } from "../../ngx-nz-formly-props.model";
4
4
  import { Subject, takeUntil, tap } from "rxjs";
5
5
 
6
6
  @Component({
7
- selector: "app-formly-field-select",
8
- templateUrl: "./formly-field-select.component.html",
9
- styleUrls: ["./formly-field-select.component.scss"],
7
+ selector: "app-nz-formly-field-select",
8
+ templateUrl: "./nz-formly-field-select.component.html",
9
+ styleUrls: ["./nz-formly-field-select.component.scss"],
10
10
  })
11
- export class FormlyFieldSelectComponent
11
+ export class NzFormlyFieldSelectComponent
12
12
  extends FieldType<FieldTypeConfig<NzFormlySelectProps>>
13
13
  implements OnInit, OnDestroy
14
14
  {
@@ -4,11 +4,11 @@ import { NzFormlySwitchProps } from "../../ngx-nz-formly-props.model";
4
4
  import { Subject, takeUntil, tap } from "rxjs";
5
5
 
6
6
  @Component({
7
- selector: "app-formly-field-switch",
8
- templateUrl: "./formly-field-switch.component.html",
9
- styleUrls: ["./formly-field-switch.component.scss"],
7
+ selector: "app-nz-formly-field-switch",
8
+ templateUrl: "./nz-formly-field-switch.component.html",
9
+ styleUrls: ["./nz-formly-field-switch.component.scss"],
10
10
  })
11
- export class FormlyFieldSwitchComponent
11
+ export class NzFormlyFieldSwitchComponent
12
12
  extends FieldType<FieldTypeConfig<NzFormlySwitchProps>>
13
13
  implements OnInit, OnDestroy
14
14
  {
@@ -77,7 +77,7 @@ export interface NzFormlySwitchProps extends NzFormlyCommonProps {
77
77
  }
78
78
 
79
79
  export interface NzFormlyRadioProps extends NzFormlyCommonProps {
80
- nzOptions: nzRadioOptionType[];
80
+ nzOptions: NzRadioOptionType[];
81
81
  nzName?: string;
82
82
  nzSize?: NzSizeDSType;
83
83
  nzType?: "nz-radio" | "nz-radio-button";
@@ -116,8 +116,8 @@ export interface NzFormlySelectProps extends NzFormlyCommonProps {
116
116
  nzLoading?: boolean;
117
117
  nzLoadingObs?: Observable<boolean>;
118
118
  nzMaxTagCount?: number; // does it really work
119
- nzOptions?: nzSelectOptionType[];
120
- nzOptionsObs?: Observable<nzSelectOptionType[]>;
119
+ nzOptions?: NzSelectOptionType[];
120
+ nzOptionsObs?: Observable<NzSelectOptionType[]>;
121
121
  nzMaxTagPlaceholder?: TemplateRef<{ $implicit: any[] }>;
122
122
  nzOptionHeightPx?: number;
123
123
  nzOptionOverflowSize?: number;
@@ -127,7 +127,7 @@ export interface NzFormlySelectProps extends NzFormlyCommonProps {
127
127
  nzOnSearch?: (event: string) => void;
128
128
  }
129
129
 
130
- type nzSelectOptionType = {
130
+ type NzSelectOptionType = {
131
131
  label: string | number;
132
132
  value: NzSafeAny;
133
133
  disabled?: boolean;
@@ -135,7 +135,7 @@ type nzSelectOptionType = {
135
135
  nzCustomContent?: string | TemplateRef<NzSafeAny>;
136
136
  };
137
137
 
138
- type nzRadioOptionType = {
138
+ type NzRadioOptionType = {
139
139
  value: NzSafeAny;
140
140
  disabled?: boolean;
141
141
  } & (
@@ -2,7 +2,7 @@ import { AbstractControl } from "@angular/forms";
2
2
  import { FormlyFieldConfig } from "@ngx-formly/core";
3
3
  import { NzFormlyInputProps } from "./ngx-nz-formly-props.model";
4
4
 
5
- export type validatorNames = {
5
+ export type NzFormlyValidatorNames = {
6
6
  [key in
7
7
  | "required"
8
8
  | "minLen"
@@ -16,7 +16,7 @@ export type validatorNames = {
16
16
  export function minLengthValidator(
17
17
  control: AbstractControl,
18
18
  field: FormlyFieldConfig<NzFormlyInputProps>,
19
- ): validatorNames | null {
19
+ ): NzFormlyValidatorNames | null {
20
20
  if (field.props?.minLen)
21
21
  return control.value?.length < field.props?.minLen
22
22
  ? { minLen: true }
@@ -31,7 +31,7 @@ export function minLengthMessage(field: FormlyFieldConfig<NzFormlyInputProps>) {
31
31
  export function maxLengthValidator(
32
32
  control: AbstractControl,
33
33
  field: FormlyFieldConfig<NzFormlyInputProps>,
34
- ): validatorNames | null {
34
+ ): NzFormlyValidatorNames | null {
35
35
  if (field.props?.maxLen)
36
36
  return control.value?.length > field.props?.maxLen
37
37
  ? { maxLen: true }
@@ -46,7 +46,7 @@ export function maxLengthMessage(field: FormlyFieldConfig<NzFormlyInputProps>) {
46
46
  export function minValueValidator(
47
47
  control: AbstractControl,
48
48
  field: FormlyFieldConfig<NzFormlyInputProps>,
49
- ): validatorNames | null {
49
+ ): NzFormlyValidatorNames | null {
50
50
  if (field.props?.minValue && control.value != null)
51
51
  return Number(control.value) < field.props.minValue
52
52
  ? { minValue: false }
@@ -61,7 +61,7 @@ export function minValueMessage(field: FormlyFieldConfig<NzFormlyInputProps>) {
61
61
  export function maxValueValidator(
62
62
  control: AbstractControl,
63
63
  field: FormlyFieldConfig<NzFormlyInputProps>,
64
- ): validatorNames | null {
64
+ ): NzFormlyValidatorNames | null {
65
65
  if (field.props?.maxValue && control.value != null)
66
66
  return Number(control.value) > field.props.maxValue
67
67
  ? { maxValue: true }
@@ -75,7 +75,7 @@ export function maxValueMessage(field: FormlyFieldConfig<NzFormlyInputProps>) {
75
75
 
76
76
  export function emailValidator(
77
77
  control: AbstractControl,
78
- ): validatorNames | null {
78
+ ): NzFormlyValidatorNames | null {
79
79
  let REGEX = /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/;
80
80
  return REGEX.test(control.value) ? null : { email: true };
81
81
  }
@@ -83,7 +83,7 @@ export function emailValidator(
83
83
  export function passwordValidator(
84
84
  control: AbstractControl,
85
85
  field: FormlyFieldConfig<NzFormlyInputProps>,
86
- ): validatorNames | null {
86
+ ): NzFormlyValidatorNames | null {
87
87
  if (field.props?.type === "password") {
88
88
  let REGEX = /^(?=.*[A-Z])(?=.*\d)(?=.*[\W_])[A-Za-z\d\W_]{8,}$/;
89
89
  return REGEX.test(control.value) ? null : { password: true };
@@ -1,12 +1,12 @@
1
1
  import { NgModule } from "@angular/core";
2
- import { FormlyFieldInputComponent } from "./components/formly-field-input/formly-field-input.component";
3
- import { FormlyFieldCheckboxComponent } from "./components/formly-field-checkbox/formly-field-checkbox.component";
4
- import { FormlyButtonComponent } from "./components/formly-button/formly-button.component";
5
- import { FormlyFieldSelectComponent } from "./components/formly-field-select/formly-field-select.component";
6
- import { FormlyFieldSwitchComponent } from "./components/formly-field-switch/formly-field-switch.component";
7
- import { FormlyFieldRadioComponent } from "./components/formly-field-radio/formly-field-radio.component";
8
- import { FormlyLabelWrapperComponent } from "./wrappers/formly-label-wrapper/formly-label-wrapper.component";
9
- import { FormlyDefaultWrapperComponent } from "./wrappers/formly-default-wrapper/formly-default-wrapper.component";
2
+ import { NzFormlyFieldInputComponent } from "./components/nz-formly-field-input/nz-formly-field-input.component";
3
+ import { NzFormlyFieldCheckboxComponent } from "./components/nz-formly-field-checkbox/nz-formly-field-checkbox.component";
4
+ import { NzFormlyButtonComponent } from "./components/nz-formly-button/nz-formly-button.component";
5
+ import { NzFormlyFieldSelectComponent } from "./components/nz-formly-field-select/nz-formly-field-select.component";
6
+ import { NzFormlyFieldSwitchComponent } from "./components/nz-formly-field-switch/nz-formly-field-switch.component";
7
+ import { NzFormlyFieldRadioComponent } from "./components/nz-formly-field-radio/nz-formly-field-radio.component";
8
+ import { NzFormlyLabelWrapperComponent } from "./wrappers/nz-formly-label-wrapper/nz-formly-label-wrapper.component";
9
+ import { NzFormlyDefaultWrapperComponent } from "./wrappers/nz-formly-default-wrapper/nz-formly-default-wrapper.component";
10
10
  import {
11
11
  ConfigOption,
12
12
  FormlyFieldConfig,
@@ -52,7 +52,7 @@ export const NzFormlyForRoot: ConfigOption = {
52
52
  types: [
53
53
  {
54
54
  name: "input",
55
- component: FormlyFieldInputComponent,
55
+ component: NzFormlyFieldInputComponent,
56
56
  wrappers: ["default-wrapper", "label-wrapper"],
57
57
  defaultOptions: <FormlyFieldConfig<NzFormlyInputProps>>{
58
58
  props: {
@@ -65,7 +65,7 @@ export const NzFormlyForRoot: ConfigOption = {
65
65
  },
66
66
  {
67
67
  name: "checkbox",
68
- component: FormlyFieldCheckboxComponent,
68
+ component: NzFormlyFieldCheckboxComponent,
69
69
  wrappers: [],
70
70
  defaultOptions: <FormlyFieldConfig<NzFormlyCheckboxProps>>{
71
71
  props: {
@@ -76,7 +76,7 @@ export const NzFormlyForRoot: ConfigOption = {
76
76
  },
77
77
  {
78
78
  name: "switch",
79
- component: FormlyFieldSwitchComponent,
79
+ component: NzFormlyFieldSwitchComponent,
80
80
  wrappers: ["default-wrapper", "label-wrapper"],
81
81
  defaultOptions: <FormlyFieldConfig<NzFormlySwitchProps>>{
82
82
  props: {
@@ -89,7 +89,7 @@ export const NzFormlyForRoot: ConfigOption = {
89
89
  },
90
90
  {
91
91
  name: "radio",
92
- component: FormlyFieldRadioComponent,
92
+ component: NzFormlyFieldRadioComponent,
93
93
  wrappers: ["default-wrapper", "label-wrapper"],
94
94
  defaultOptions: <FormlyFieldConfig<NzFormlyRadioProps>>{
95
95
  props: {
@@ -102,7 +102,7 @@ export const NzFormlyForRoot: ConfigOption = {
102
102
  },
103
103
  {
104
104
  name: "select",
105
- component: FormlyFieldSelectComponent,
105
+ component: NzFormlyFieldSelectComponent,
106
106
  wrappers: ["default-wrapper", "label-wrapper"],
107
107
  defaultOptions: <FormlyFieldConfig<NzFormlySelectProps>>{
108
108
  props: {
@@ -132,7 +132,7 @@ export const NzFormlyForRoot: ConfigOption = {
132
132
  },
133
133
  {
134
134
  name: "button",
135
- component: FormlyButtonComponent,
135
+ component: NzFormlyButtonComponent,
136
136
  wrappers: ["default-wrapper"],
137
137
  defaultOptions: <FormlyFieldConfig<NzFormlyButtonProps>>{
138
138
  props: {
@@ -151,11 +151,11 @@ export const NzFormlyForRoot: ConfigOption = {
151
151
  wrappers: [
152
152
  {
153
153
  name: "default-wrapper",
154
- component: FormlyDefaultWrapperComponent,
154
+ component: NzFormlyDefaultWrapperComponent,
155
155
  },
156
156
  {
157
157
  name: "label-wrapper",
158
- component: FormlyLabelWrapperComponent,
158
+ component: NzFormlyLabelWrapperComponent,
159
159
  },
160
160
  ],
161
161
  validators: [
@@ -232,14 +232,14 @@ export const NzFormlyForRoot: ConfigOption = {
232
232
 
233
233
  @NgModule({
234
234
  declarations: [
235
- FormlyFieldInputComponent,
236
- FormlyFieldCheckboxComponent,
237
- FormlyFieldSwitchComponent,
238
- FormlyFieldSelectComponent,
239
- FormlyButtonComponent,
240
- FormlyFieldRadioComponent,
241
- FormlyLabelWrapperComponent,
242
- FormlyDefaultWrapperComponent
235
+ NzFormlyFieldInputComponent,
236
+ NzFormlyFieldCheckboxComponent,
237
+ NzFormlyFieldSwitchComponent,
238
+ NzFormlyFieldSelectComponent,
239
+ NzFormlyButtonComponent,
240
+ NzFormlyFieldRadioComponent,
241
+ NzFormlyLabelWrapperComponent,
242
+ NzFormlyDefaultWrapperComponent
243
243
  ],
244
244
  imports: [
245
245
  CommonModule,
@@ -4,9 +4,9 @@ import { animate, style, transition, trigger } from "@angular/animations";
4
4
  import { NzFormlyCommonProps } from "../../ngx-nz-formly-props.model";
5
5
 
6
6
  @Component({
7
- selector: "app-formly-default-wrapper",
8
- templateUrl: "./formly-default-wrapper.component.html",
9
- styleUrls: ["./formly-default-wrapper.component.scss"],
7
+ selector: "app-nz-formly-default-wrapper",
8
+ templateUrl: "./nz-formly-default-wrapper.component.html",
9
+ styleUrls: ["./nz-formly-default-wrapper.component.scss"],
10
10
  animations: [
11
11
  trigger("myAnimation", [
12
12
  transition(":enter", [
@@ -20,6 +20,6 @@ import { NzFormlyCommonProps } from "../../ngx-nz-formly-props.model";
20
20
  ]),
21
21
  ],
22
22
  })
23
- export class FormlyDefaultWrapperComponent extends FieldWrapper<
23
+ export class NzFormlyDefaultWrapperComponent extends FieldWrapper<
24
24
  FieldTypeConfig<NzFormlyCommonProps>
25
25
  > {}
@@ -3,10 +3,10 @@ import { FieldTypeConfig, FieldWrapper } from "@ngx-formly/core";
3
3
  import { NzFormlyCommonProps } from "../../ngx-nz-formly-props.model";
4
4
 
5
5
  @Component({
6
- selector: "app-formly-label-wrapper",
7
- templateUrl: "./formly-label-wrapper.component.html",
8
- styleUrls: ["./formly-label-wrapper.component.scss"],
6
+ selector: "app-nz-formly-label-wrapper",
7
+ templateUrl: "./nz-formly-label-wrapper.component.html",
8
+ styleUrls: ["./nz-formly-label-wrapper.component.scss"],
9
9
  })
10
- export class FormlyLabelWrapperComponent extends FieldWrapper<
10
+ export class NzFormlyLabelWrapperComponent extends FieldWrapper<
11
11
  FieldTypeConfig<NzFormlyCommonProps>
12
12
  > {}