How to use the vuelidate/lib/validators.not function in vuelidate

To help you get started, we’ve selected a few vuelidate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SUSE / Portus / app / assets / javascripts / modules / namespaces / components / transfer-modal.vue View on Github external
data() {
      return {
        mixinAttr: 'namespaceParams',
        namespaceParams: {
          team: null,
        },
        close: false,
      };
    },

    validations: {
      namespaceParams: {
        team: {
          required,
          notSameAsTeam: not(sameAs(function () { return this.namespace.team.name; })),
        },
      },
    },

    methods: {
      onEnter() {
        this.$refs.modal.$el.focus();
      },

      onSubmit() {
        const params = { namespace: this.namespaceParams };

        NamespacesService.update(this.namespace.id, params).then((response) => {
          const namespace = response.data;

          this.$bus.$emit('namespaceUpdated', namespace);
github phamhongphuc / uit.hotel / uit.hotel.client / modules / validator / src / helper / dateValidator.ts View on Github external
export const startingDate: RuleDecl = {
    validDate,
    notBefore(value: string) {
        const { input } = (this as any) as HasBirthdate;

        if (!input) return false;

        return !beforeDate(moment(input.birthdate))(value);
    },
};

export const bookCheckInTime: RuleDecl = {
    required,
    validDate,
    beforeDateTime: not(beforeDateTime()),
};

interface HasBookCheckInTime {
    bookCheckInTime: string;
}

export const bookCheckOutTime = {
    required,
    validDate,
    beforeDateTime(value: string) {
        const { bookCheckInTime } = (this as any) as HasBookCheckInTime;

        if (!bookCheckInTime) return false;

        return !beforeDateTime(moment(bookCheckInTime))(value);
    },
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / receipt / popup-receipt-add.vue View on Github external
import { DataMixin, PopupMixin } from '~/components/mixins';
import { ReceiptCreateInput, GetBills } from '~/graphql/types';
import { createReceipt } from '~/graphql/documents';
import { optional, currency } from '~/modules/validator';

type PopupMixinType = PopupMixin<{ bill: GetBills.Bills }, ReceiptCreateInput>;

@Component({
    name: 'popup-receipt-add-',
    validations: {
        input: {
            money: currency,
            bankAccountNumber: {
                or: or(
                    and(numeric, minLength(6), maxLength(20)),
                    not(required),
                ),
            },
        },
    },
})
export default class extends mixins(
    PopupMixin,
    DataMixin({ createReceipt, optional }),
) {
    onOpen() {
        this.input = {
            money: 0,
            bankAccountNumber: '',
            bill: {
                id: this.data.bill.id,
            },
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / bill / popup-book-and-check-in.vue View on Github external
@Component({
    name: 'popup-booking-and-check-in-',
    validations: {
        input: {
            bill: {
                patron: included('patron'),
            },
            bookings: {
                required,
            },
        },
        bookCheckOutTime: {
            required,
            validDate,
            beforeDateTime: not(beforeDateTime()),
        },
    },
})
export default class extends mixins(
    PopupMixin,
    DataMixin({ bookAndCheckIn, getPatrons, getRoom }),
) {
    bookCheckOutTime: string = moment()
        .add(3, 'day')
        .set({
            hour: 11,
            minute: 0,
            second: 0,
        })
        .format();