-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
b2b20a5
commit ed748bc
Showing
5 changed files
with
95 additions
and
8 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
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,72 @@ | ||
<template> | ||
<div class="order-value-form"> | ||
<div class="condition-form__row"> | ||
<switch-input v-model="form.on_sale" :disabled="disabled"> | ||
<template #title> | ||
{{ $t('form.on_sale') }} | ||
<info-tooltip>{{ $t('tooltips.on_sale') }}</info-tooltip> | ||
</template> | ||
</switch-input> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<i18n lang="json"> | ||
{ | ||
"en": { | ||
"form": { | ||
"on_sale": "Only for non-priced products" | ||
}, | ||
"tooltips": { | ||
"on_sale": "If checked, this code will only apply to products that are not discounted" | ||
} | ||
}, | ||
"pl": { | ||
"form": { | ||
"on_sale": "Tylko dla produktów nieprzecenionych" | ||
}, | ||
"tooltips": { | ||
"on_sale": "Jeżeli zaznaczone, kod ten będzie miał zastosowanie tylko dla produktów nieprzecenionych" | ||
} | ||
} | ||
} | ||
</i18n> | ||
|
||
<script lang="ts"> | ||
/* eslint-disable camelcase */ | ||
import { defineComponent, PropType } from 'vue' | ||
import { DiscountConditionType } from '@heseya/store-core' | ||
import SwitchInput from '@/components/form/SwitchInput.vue' | ||
type OnSaleForm = { | ||
type: DiscountConditionType | ||
on_sale: boolean | ||
} | ||
export default defineComponent({ | ||
components: { SwitchInput }, | ||
props: { | ||
value: { type: Object as PropType<OnSaleForm>, required: true }, | ||
type: { type: String as PropType<DiscountConditionType>, required: true }, | ||
disabled: { type: Boolean, default: false }, | ||
}, | ||
computed: { | ||
DiscountConditionType(): typeof DiscountConditionType { | ||
return DiscountConditionType | ||
}, | ||
formId(): string { | ||
// @ts-ignore // ? Unofficial Vue api | ||
return this._uid | ||
}, | ||
form: { | ||
get(): OnSaleForm { | ||
return this.value | ||
}, | ||
set(v: OnSaleForm) { | ||
this.$emit('input', v) | ||
}, | ||
}, | ||
}, | ||
}) | ||
</script> |
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