Giter Club home page Giter Club logo

rxweb's People

Contributors

ajayojha avatar alizedebray avatar aurelijusrozenas avatar branchjoshua avatar dependabot[bot] avatar donalfenwick avatar inloox-dev avatar lucasvanhalst avatar luchidalgo avatar nivrith369 avatar pranavirabatti avatar radixwb avatar rxcontributorone avatar rxcontributortwo avatar rxdotnetdev40 avatar rxwebteam avatar sahofmann avatar shahishani06 avatar technicalarchitectrx avatar ushmidave avatar xzxzxc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rxweb's Issues

add feature of textarea rows validation

Description

I want to restrict user to enter after specified rows value in textarea.

Describe the solution you'd like

The framework should error message if the user exceeds the row limit of textarea or user should not able to enter further value.

less than equal to working example is not visible.

Describe the bug

less than equal to working example is not visible. A blank screen is there.

Expected Behavior

Working example should properly load.

To Reproduce

Go to https://rxweb.github.io/reactive-form-validators/import-modules.html and click on the lessThanEqualTo validator link.

Url

https://rxweb.github.io/reactive-form-validators/validation-decorators/lessThanEqualTo.html?tabs=basic-validation-on-User-add-form%2Ccomplete-user%2Cdynamic-user

Package Version

@rxweb/@

Browser

Any Browser

How to handle nested object arrays?

Describe the bug

Not a bug

Expected Behavior

Let say I have an app to manage books and author.
I want a form to add books to an author.
Let say I'm loading an existing author with 3 books in his collection.
My Author.ts would be like

id : number
@required()
name : String
 @propObject(Book)
books : Books[]

And my Book.ts

id : number
@required()
name : string

I then have a form :

<form [formGroup]="authorForm">
  <mat-form-field >
    <input matInput formControlName="name" />
  </mat-form-field>
 ???
...
</form>

In the place of the ??? I tried with

<div formArrayName="books" >
    <div *ngFor="let book of author.books">
      <mat-form-field>
        <input matInput  formControlName="name"  />
      </mat-form-field>
  </div>
</div>

Fields are correctly generated but input fields for book's names are empty although books do have a name. If I add a {{book.name}} in the loop I'm able to see it.
Do I miss something?
Thx!

Package Version

@rxweb/[email protected]

Browser

Chrome

Additional Info

minFiles not working properly in file validator

Describe the bug

minFiles is not working properly in file validator
Example : if minFiles is set upto 5 files , it does not validate 6 files.

Expected Behavior

minFiles should work properly in the file validator, if it is set to 5 files then entering 6 files in that field should be valid.

To Reproduce

Url (stackblitz or plunker or other)

https://stackblitz.com/angular/bqxayrxvboo

Package Version

@rxweb/@
@rxweb/reactive-form-validators 1.4.5

americanexpress Type and dinersClub Type is not getting validated in creditCard validation

Describe the bug

creditCard types(American Express, Diners Club) are showing invalid when user enters correct value.
Example :
371449635398431 in American Express shows invalid.
30569309025904 in Diners Club shows invalid.

Expected Behavior

creditCard types(American Express, Diners Club) should be valid when correct value is entered.

To Reproduce

Url (stackblitz or plunker or other)

https://stackblitz.com/angular/krndqoaygrm

Package Version

@rxweb/reactive-form-validators 1.4.5

MaxDate validator is not working in proper format

Current Behavior

MaxDate Validator is not working while user enters incorrect values.
Example
According to the MaxDate validator functionality, dates for example '15/7/2019' and '31/07/2018' should not be accepted but it is showing valid.

Expected Behavior

MaxDate Validator should take valid user input in proper format

URL

https://stackblitz.com/github/rxweb/rxweb/tree/dev/docs/examples/reactive-form-validators/maxDate/complete-rxweb-maxDate-validation-add-angular-reactive-form

Browser

Any Browser

add async validation decorator

Description

I have a User Model with 5 properties and I have applied respective validation decorators on properties. But I want to validate unique username from server.

Describe the solution you'd like

The framework should allow to validate the value from server also.

URL validator not working

Current Behavior

URL validation decorator is valid in alternate characters.
Example
If i am entering https://www.google.com, then it is accepting. But when i am entering https://www.google.co or https://www.google.comm, it is not accepting. Similarly https://www.google.com.gfh is also accepting.

Expected Behavior

It should be valid, if user enters correct URL in the correct format only, otherwise it will be invalid.

Url

https://stackblitz.com/github/rxweb/rxweb/tree/dev/docs/examples/reactive-form-validators/url/complete-rxweb-url-validation-add-angular-reactive-form

Browser

Any Browser

notempty validator feature

Description

Currently there is no validator available, which invalidate when only space value in the FormControl .

Describe the solution you'd like

It should invalidate if the FormControl persist only space value.

It's not compatible with Angular 5.x

It's not compatible with Angular 5.x

Description

ERROR in node_modules/@rxweb/reactive-form-validators/services/rx-form-group.d.ts(1,51): error TS2305: Module '"/Users/mestrump/projects/work/MW_Credendo_Extranet/client/node_modules/@angular/forms/forms"' has no exported member 'AbstractControlOptions'.

AbstractControlOptions is an interface that is present in Angular since version 6.

Whitespace is allowed in email validation

Describe the bug

In email validation, whitespace is allowed.
Example
If I am entering "[email protected] 4444" as an input in email validation, It is accepting such inputs.

Expected Behavior

Email validator should not accept whitespace.

To Reproduce

Go to https://rxweb.github.io/reactive-form-validators/import-modules.html and click on the email validator link.

Url

https://stackblitz.com/edit/rxweb-email-validation-edit-angular-reactive-form?file=src%2Fapp%2Fapp.component.html

Package Version

@rxweb/@

Browser

Any Browser

how to add new element to a form with propArray

Describe the problem statement?

In yous example for propArray() you have address decorated with propArray(). I need to have multiple addresses that user can add with "Add Address" button. I found examples of how to implement it with Angular form builder, but I can't figure out or find example how to do it with RxFormBuilder. Is it even possible? Can you provide an example?

The expected solution you would like

Sample of code to add multiple addresses on form built with RxFormBuilder.

Url

Package version

@rxweb/

MinDate error

Describe the bug

deadlineDate: ['', Validators.required, RxwebValidators.minDate({value:new Date(7,7,2019)})]
core.js:12301 ERROR TypeError: Cannot read property 'seperator' of undefined
    at DateProvider.push../node_modules/@rxweb/reactive-form-validators/@rxweb/reactive-form-validators.es5.js.DateProvider.isValid (reactive-form-validators.es5.js:1056)
    at reactive-form-validators.es5.js:1175
    at rxwebValidator (reactive-form-validators.es5.js:4202)
    at forms.js:605
    at Array.map (<anonymous>)
    at _executeAsyncValidators (forms.js:605)
    at FormControl.asyncValidator (forms.js:585)
    at FormControl.push../node_modules/@angular/forms/fesm5/forms.js.AbstractControl._runAsyncValidator (forms.js:2516)
    at FormControl.push../node_modules/@angular/forms/fesm5/forms.js.AbstractControl.updateValueAndValidity (forms.js:2489)
    at FormControl.push../node_modules/@angular/forms/fesm5/forms.js.FormControl.setValue (forms.js:2828)

Expected Behavior

No Errors

Reproduce

Enter a date into the form field using mm/dd/yyyy format

Package Version

"@rxweb/reactive-form-validators": "^1.4.1",

Unique validator not working as expected

Describe the bug

When I enter the value of 'Angular' in zero index textbox and again the same value in one index but the first letter is small like 'angular'. The FormControl is valid after entering the same value in two textbox of FormArray, which is incorrect behaviour.

Expected Behavior

FormControl should be invalid. because the values are the same.

Url (stackblitz or plunker or other)

https://stackblitz.com/edit/unique-value-validation-in-formarray-reactive-forms-angular?file=src%2Fapp%2Fapp.component.ts

Package Version

@rxweb/[email protected]

remove prop decorator in the model example

Please refer alpha decorator example . go to the basic alpha validation example, if you see the model example of alpha which imports 'prop' decorator but that's not used in the model. if it's nowhere used then remove it because it creates confusion.

Current:
image
Expected:
image

The same has been repeated in every decorator example.

Angular 4.2.3 compability

When I try to use 1.1.5 version of your package I got:
ERROR in Error: Metadata version mismatch for module .../node_modules/@rxweb/reactive-form-validators/rxweb-reactive-form-validators.d.ts, found version 4, expected 3, resolving symbol UiModule in /src/app/ui/ui.module.ts, resolving symbol UiModule in /src/app/ui/ui.module.ts ...

Can you point what can be wrong. Is it really incompatible with ng4?
ps. RxReactiveFormsModule is exported from submodule but when I import it directly in the AppRootModule it works.

inherit BaseConfig interface in ComposeConfig

Description

As discussed with @bruceauyeung on our gitter channel. Compose validator should have own message property. Where user clubs the validators and wants to show a single validation message.

As @bruceauyeung scenario :

A username required, only letters, digits,underscores are allowed and at most 50 characters, i wanna give the user a message 'only letters, digits,underscores are allowed and at most 50 characters are allowed'

@bruceauyeung feel free to add more if I missed something.

input box value 0 is showing required while composing the validation.

Describe the bug

I have created a form with below configuration userInfoFormGroup: FormGroup = this.formBuilder.group({ time: [1, RxwebValidators.compose({ validators: [ RxwebValidators.required(), RxwebValidators.numeric({ acceptValue: NumericValueType.PositiveNumber, allowDecimal: false }) ] })] });

Now I am setting the form value with form REST method. For now I am doing this in onInit event. you may assume this will happen after any http response.

So if I am setting the value 0 is is showing me the error like.

this field is require

. If I set the value grater than 0 it is working as expected.

Expected Behavior

It should not show the field is required.

Url (stackblitz or plunker or other)

https://stackblitz.com/edit/angular-ztqn7k?file=src%2Fapp%2Fapp.component.ts

Package Version

@rxweb/@

Abstraction is not possible in model class

Bug report or Feature request
Abstraction is not possible.
I created a class with common attributes and exteded it in other more specific classes, as you can see bellow:

// user.model.ts
class Contact {
  @required()
  type: string;

  @required()
  primary: boolean;
}

export class PhoneNumber extends Contact {
  @required()
  phoneNumber: string;
}

export class Email extends Contact {
  @required()
  @email()
  email: string;
}

export class User {
  @required()
  usernamename: string;

  @propArray(PhoneNumber)
  phoneNumbers: PhoneNumber[];

  @propArray(Email)
  emails: Email[];
}
// app.component.ts
...
export class AppComponent implements OnInit {
  userForm: FormGroup;

  constructor(private fb: RxFormBuilder) { }

  ngOnInit() {
    const user = new User();
    const phoneNumber = new PhoneNumber();
    const email = new Email();

    user.phoneNumbers = new Array<PhoneNumber>();
    user.phoneNumbers.push(phoneNumber);

    user.emails = new Array<Email>();
    user.emails.push(email);

    this.userForm = this.fb.formGroup(user);
  }

  ...
}

Expected Behavior

I expected that the type and primary controls would be present in the phoneNumber group object, but they are not. Only the attribute defined in PhoneNumber class is part of the phoneNumber group, the same happens with Email class and email group.

To Reproduce

You can see the console in the example app I built in SlackBlitz.

Url (stackblitz or plunker or other)

https://stackblitz.com/edit/angular-7ubjvp

Package Version

@rxweb/[email protected]

Password Validator not working properly

Current Behavior

Password Validator Example not working properly. it gives console error of Error: Cannot read property 'message' of undefined when entering input value.

Expected Behavior

It should be working properly, if user enters correct password based on validation property,

Url

https://stackblitz.com/github/rxweb/rxweb/tree/dev/docs/examples/reactive-form-validators/password/complete-rxweb-password-validation-add-angular-reactive-form

Browser

Any Browser

Add Support to Accessor Decorators

Describe the bug

Accessor decorators not work.

Expected Behavior

Allow the use of external classes with accessor decorators or other manner.

To Reproduce

class ClassName {
    private _classProperty: ExternalClass;

    set classProperty(property: string | ExternalClass) {
      if (property instanceof ExternalClass) {
        this._classProperty = property;
      } else {
        this._classProperty = ExternalClass.convert(property);
      }
    }

    get classProperty() {
      return this._classProperty;
    }
  }

Motivation

This can expande the use of the validators and the library itself.

Package Version

@rxweb/[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.