Merge branch 'master' into preorderstatus-neu
This commit is contained in:
@@ -327,3 +327,8 @@ td {
|
||||
height: 21px;
|
||||
grid-column-start: 3;
|
||||
}
|
||||
|
||||
.tt-table-header {
|
||||
vertical-align: top !important;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
* For 'iconSelect', an additional 'icon' property (CSS class for the icon) is required.
|
||||
* @property {boolean} [sortable=true] - (Optional) Indicates whether the column is sortable. Default is true.
|
||||
* @property {string} [class] - (Optional) Additional CSS classes to apply to the column.
|
||||
* @property {string} [headerClass] - (Optional) Additional CSS classes to apply to the column header.
|
||||
* @property {string} [suffix] - (Optional) Additional CSS classes to apply to the column.
|
||||
* @property {string} [prefix] - (Optional) Additional CSS classes to apply to the column.
|
||||
* */
|
||||
@@ -144,26 +145,26 @@ Vue.component('tt-table', {
|
||||
<tr>
|
||||
<th scope="col" v-for="column in columns"
|
||||
:ref="'table_header_'+column.key"
|
||||
:class="column.headerClass ? column.headerClass : 'tt-table-header'"
|
||||
v-if="!hiddenColumns.includes(column.key)"
|
||||
:style="'vertical-align: top; text-align: center;' +
|
||||
(column.filter === 'dateRange' ? 'min-width: 260px;' : '') +
|
||||
:style="(column.filter === 'dateRange' ? 'min-width: 260px;' : '') +
|
||||
(originalColumnWidths[column.key] ? 'width: ' + originalColumnWidths[column.key] + 'px;' : '')"
|
||||
>
|
||||
<div style="text-align:center; white-space: nowrap;word-break: keep-all;user-select: none;"
|
||||
<div
|
||||
style="white-space: nowrap;word-break: keep-all;user-select: none;"
|
||||
:style="{ 'cursor': column.sortable ? 'pointer' : 'default' }"
|
||||
@click="column.sortable ? setOrder(column.key) : undefined">
|
||||
@click="column.sortable && !disableFiltering ? setOrder(column.key) : undefined">
|
||||
{{ column.text }}
|
||||
<i
|
||||
v-if="column.sortable"
|
||||
<i v-if="column.sortable && !disableFiltering"
|
||||
:class="getSortIconClass(column.key)"></i>
|
||||
</div>
|
||||
<!-- @formatter:off -->
|
||||
<tt-input v-if="column.filter === 'search'" v-model="filters[column.key]" sm/>
|
||||
<tt-icon-select v-else-if="column.filter === 'iconSelect'" :options="column.filterOptions" v-model="filters[column.key]" sm/>
|
||||
<tt-number-range v-else-if="column.filter === 'numberRange'" :returnText="!ssr" v-model="filters[column.key]" sm/>
|
||||
<tt-select v-else-if="column.filter === 'select'" :options="[{text: 'Alle', value: undefined}, ...column.filterOptions]" v-model="filters[column.key]" sm/>
|
||||
<tt-autocomplete v-else-if="column.filter === 'autocomplete'" :items="[{text: 'Alle', value: undefined}, ...column.filterOptions]" v-model="filters[column.key]" sm/>
|
||||
<tt-date-picker v-else-if="column.filter === 'date'" v-model="filters[column.key]"/>
|
||||
<tt-input v-if="column.filter === 'search' && !disableFiltering" v-model="filters[column.key]" sm/>
|
||||
<tt-icon-select v-else-if="column.filter === 'iconSelect' && !disableFiltering" :options="column.filterOptions" v-model="filters[column.key]" sm/>
|
||||
<tt-number-range v-else-if="column.filter === 'numberRange' && !disableFiltering" :returnText="!ssr" v-model="filters[column.key]" sm/>
|
||||
<tt-select v-else-if="column.filter === 'select' && !disableFiltering" :options="[{text: 'Alle', value: undefined}, ...column.filterOptions]" v-model="filters[column.key]" sm/>
|
||||
<tt-autocomplete v-else-if="column.filter === 'autocomplete' && !disableFiltering" :items="[{text: 'Alle', value: undefined}, ...column.filterOptions]" v-model="filters[column.key]" sm/>
|
||||
<tt-date-picker v-else-if="column.filter === 'date' && !disableFiltering" v-model="filters[column.key]"/>
|
||||
<!-- @formatter:on -->
|
||||
</th>
|
||||
</tr>
|
||||
@@ -264,7 +265,8 @@ Vue.component('tt-table', {
|
||||
excelExport: {type: Boolean, default: false},
|
||||
config: {type: Object, default: () => ({}), required: true},
|
||||
ssr: {type: Boolean, default: false},
|
||||
disableInitialFetch: {type: Boolean, default: false}
|
||||
disableInitialFetch: {type: Boolean, default: false},
|
||||
disableFiltering: {type: Boolean, default: false}
|
||||
}, data() {
|
||||
return {
|
||||
window: window,
|
||||
@@ -595,6 +597,7 @@ Vue.component('tt-table', {
|
||||
filterOptions: column.filterOptions || undefined,
|
||||
sortable: column.sortable !== undefined ? column.sortable : true,
|
||||
class: column.class !== undefined ? column.class : '',
|
||||
headerClass: column.headerClass || false,
|
||||
prefix: column.prefix || '',
|
||||
suffix: column.suffix || '',
|
||||
priority: column.priority + 100 || i--
|
||||
|
||||
Reference in New Issue
Block a user