Add support for Buefy 0.9.x

or: add hacks to continue supporting Buefy 0.8.x

..depending on your perspective
This commit is contained in:
Lance Edgar 2022-12-22 20:49:20 -06:00
parent 7ccd9ad896
commit 6fbc79fe5e
17 changed files with 753 additions and 119 deletions

View file

@ -866,16 +866,24 @@
paginated
per-page="5"
:debounce-search="1000">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column :label="productKeyLabel"
field="key"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.key }}
</b-table-column>
<b-table-column label="Brand"
field="brand_name"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.brand_name }}
@ -883,6 +891,9 @@
<b-table-column label="Description"
field="description"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.description }}
@ -891,12 +902,18 @@
<b-table-column label="Unit Price"
field="unit_price"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.unit_price_display }}
</b-table-column>
<b-table-column label="Sale Price"
field="sale_price"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
<span class="has-background-warning">
{{ props.row.sale_price_display }}
@ -905,6 +922,9 @@
<b-table-column label="Sale Ends"
field="sale_ends"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
<span class="has-background-warning">
{{ props.row.sale_ends_display }}
@ -913,6 +933,9 @@
<b-table-column label="Department"
field="department_name"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.department_name }}
@ -920,12 +943,17 @@
<b-table-column label="Vendor"
field="vendor_name"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.vendor_name }}
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<div class="content has-text-grey has-text-centered">
<p>
@ -961,33 +989,63 @@
<b-table v-if="items.length"
:data="items"
:row-class="(row, i) => row.product_uuid ? null : 'has-text-success'">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column :label="productKeyLabel">
<b-table-column :label="productKeyLabel"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_key }}
</b-table-column>
<b-table-column label="Brand">
<b-table-column label="Brand"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_brand }}
</b-table-column>
<b-table-column label="Description">
<b-table-column label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_description }}
</b-table-column>
<b-table-column label="Size">
<b-table-column label="Size"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_size }}
</b-table-column>
<b-table-column label="Department">
<b-table-column label="Department"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.department_display }}
</b-table-column>
<b-table-column label="Quantity">
<b-table-column label="Quantity"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.order_quantity_display"></span>
</b-table-column>
<b-table-column label="Unit Price">
<b-table-column label="Unit Price"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span
% if product_price_may_be_questionable:
:class="props.row.price_needs_confirmation ? 'has-background-warning' : ''"
@ -1000,12 +1058,20 @@
</b-table-column>
% if allow_item_discounts:
<b-table-column label="Discount">
<b-table-column label="Discount"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.discount_percent }}{{ props.row.discount_percent ? " %" : "" }}
</b-table-column>
% endif
<b-table-column label="Total">
<b-table-column label="Total"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span
% if product_price_may_be_questionable:
:class="props.row.price_needs_confirmation ? 'has-background-warning' : ''"
@ -1017,11 +1083,20 @@
</span>
</b-table-column>
<b-table-column label="Vendor">
<b-table-column label="Vendor"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.vendor_display }}
</b-table-column>
<b-table-column field="actions" label="Actions">
<b-table-column field="actions"
label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" class="grid-action"
@click.prevent="showEditItemDialog(props.row)">
<i class="fas fa-edit"></i>
@ -1037,7 +1112,9 @@
&nbsp;
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
</div>
</div>