How to use the nuxt-property-decorator.mixins function in nuxt-property-decorator

To help you get started, we’ve selected a few nuxt-property-decorator 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 phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / room-kind / popup-room-kind-add.vue View on Github external
amountOfPeople,
    numberOfBeds,
    roomKindName,
} from '~/modules/validator';

@Component({
    name: 'popup-room-kind-add-',
    validations: {
        input: {
            name: roomKindName,
            numberOfBeds,
            amountOfPeople,
        },
    },
})
export default class extends mixins>(
    PopupMixin,
    DataMixin({ createRoomKind }),
) {
    onOpen() {
        this.input = {
            name: '',
            numberOfBeds: 1,
            amountOfPeople: 1,
        };
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / special / horizontal-timeline / horizontal-timeline.vue View on Github external
import _ from 'lodash';
import { getBounding } from './horizontal-timeline.helper';
import { toDateTime, toMoney } from '~/utils';
import { GetBooking } from '~/graphql/types';
import { DataMixin } from '~/components/mixins';
import {
    bookingStatusMap,
    bookingStatusColorMap,
    BookingObject,
    PriceItemRender,
} from '~/modules/model';

@Component({
    name: 'horizontal-timeline-',
})
export default class extends mixins(DataMixin({ toDateTime, toMoney })) {
    @Prop({ required: true })
    booking!: GetBooking.Booking;

    dayWidth = 4;

    get bookingObject() {
        return new BookingObject(this.booking);
    }

    get status() {
        return bookingStatusMap[this.booking.status];
    }

    get statusColor() {
        return bookingStatusColorMap[this.booking.status];
    }
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / bill / popup-bill-update-discount.vue View on Github external
name: 'popup-bill-update-discount-',
    validations: {
        input: {
            discount: {
                ...currency,
                lessThanTotalPrice(value: string | number) {
                    const self = this as PopupBillUpdateDiscount;
                    return self.data
                        ? toNumber(value) < self.data.bill.totalPrice
                        : true;
                },
            },
        },
    },
})
export default class PopupBillUpdateDiscount extends mixins(
    PopupMixin,
    DataMixin({ updateBillDiscount, toMoney, toPercent }),
) {
    roomName = '';

    onOpen() {
        this.input = {
            id: this.data.bill.id,
            discount: this.data.bill.discount,
        };
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / room / popup-room-update.vue View on Github external
floor: GetFloors.Floors;
    },
    RoomUpdateInput
>;

@Component({
    name: 'popup-room-add-',
    validations: {
        input: {
            name: floorRoomName,
            floor: included('floor'),
            roomKind: included('roomKind'),
        },
    },
})
export default class extends mixins(
    PopupMixin,
    DataMixin({ updateRoom, getRoomKinds, getFloors }),
) {
    onOpen() {
        const {
            room: { id, name },
        } = this.data;

        this.input = {
            id,
            name,
            floor: { id: -1 },
            roomKind: { id: -1 },
        };
    }
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / employee / popup-employee-add.vue View on Github external
id,
            name,
            password,
            identityCard,
            startingDate,
            gender,
            phoneNumber: { phoneNumber, required },
            address,
            email: requiredEmail,
            birthdate,
            position: included('position'),
        },
        rePassword,
    },
})
export default class PopupEmployeeAdd extends mixins<
    PopupMixin
>(PopupMixin, DataMixin({ createEmployee, getPositions })) {
    rePassword = '';
    onOpen() {
        this.input = {
            id: '',
            password: '',
            name: '',
            identityCard: '',
            phoneNumber: '',
            address: '',
            email: '',
            birthdate: '',
            gender: true,
            startingDate: moment()
                .set({ hour: 0, minute: 0, second: 0 })
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / patron-kind / popup-patron-kind-add.vue View on Github external
import { Component, mixins } from 'nuxt-property-decorator';
import { PopupMixin, DataMixin } from '~/components/mixins';
import { PatronKindCreateInput } from '~/graphql/types';
import { createPatronKind } from '~/graphql/documents';
import { patronKindDescription, patronKindName } from '~/modules/validator';

@Component({
    name: 'popup-patron-kind-add-',
    validations: {
        input: {
            name: patronKindName,
            description: patronKindDescription,
        },
    },
})
export default class extends mixins>(
    PopupMixin,
    DataMixin({ createPatronKind }),
) {
    onOpen() {
        this.input = {
            name: '',
            description: '',
        };
    }
}