|
|
@ -12,8 +12,6 @@ Complex animated column editor for the table edit page |
|
|
|
<th :style="tdWidthStyle('name')">Name</th> |
|
|
|
<th :style="tdWidthStyle('name')">Name</th> |
|
|
|
<th :style="tdWidthStyle('type')">Type</th> |
|
|
|
<th :style="tdWidthStyle('type')">Type</th> |
|
|
|
<th :style="tdWidthStyle('title')">Title</th> |
|
|
|
<th :style="tdWidthStyle('title')">Title</th> |
|
|
|
<th v-if="!newTable"></th> |
|
|
|
|
|
|
|
<th></th> |
|
|
|
|
|
|
|
<th></th> |
|
|
|
<th></th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
@ -74,27 +72,22 @@ Complex animated column editor for the table edit page |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<td v-if="!newTable"> |
|
|
|
<td class="text-nowrap"><!-- |
|
|
|
<!-- Save button --> |
|
|
|
Save button |
|
|
|
<a href="" :class="['btn','btn-outline-secondary',{'disabled': col._remove}]" |
|
|
|
--><a href="" :class="['mr-1','btn','btn-outline-secondary',{'disabled': col._remove}]" |
|
|
|
|
|
|
|
v-if="!newTable" |
|
|
|
@click.prevent="toggleColEditing(col)"> |
|
|
|
@click.prevent="toggleColEditing(col)"> |
|
|
|
<v-icon :class="col._editing ? 'fa-save' : 'fa-pencil'" |
|
|
|
<v-icon :class="col._editing ? 'fa-save' : 'fa-pencil'" |
|
|
|
:alt="col._editing ? 'Save' : 'Edit'" /> |
|
|
|
:alt="col._editing ? 'Save' : 'Edit'" /> |
|
|
|
</a> |
|
|
|
</a><!-- |
|
|
|
</td> |
|
|
|
Delete button |
|
|
|
|
|
|
|
--><button type="button" :class="delBtnClass(col)" |
|
|
|
<td> |
|
|
|
|
|
|
|
<!-- Delete button --> |
|
|
|
|
|
|
|
<button type="button" :class="delBtnClass(col)" |
|
|
|
|
|
|
|
@click.prevent="toggleColDelete(col)"> |
|
|
|
@click.prevent="toggleColDelete(col)"> |
|
|
|
<v-icon :class="col._remove ? 'fa-undo' : 'fa-trash-o'" |
|
|
|
<v-icon :class="col._remove ? 'fa-undo' : 'fa-trash-o'" |
|
|
|
:alt="col._remove ? 'Undo Remove' : 'Remove'" /> |
|
|
|
:alt="col._remove ? 'Undo Remove' : 'Remove'" /> |
|
|
|
</button> |
|
|
|
</button><!-- |
|
|
|
</td> |
|
|
|
Add button |
|
|
|
|
|
|
|
--><button type="button" :class="['x-add-btn', 'btn', 'btn-outline-secondary']" |
|
|
|
<td> |
|
|
|
|
|
|
|
<!-- Add button --> |
|
|
|
|
|
|
|
<button type="button" :class="['btn', 'btn-outline-secondary']" |
|
|
|
|
|
|
|
v-if="i === columns.length - 1" |
|
|
|
v-if="i === columns.length - 1" |
|
|
|
@click.prevent="addCol()"> |
|
|
|
@click.prevent="addCol()"> |
|
|
|
<v-icon class="fa-plus" alt="Add Column" /> |
|
|
|
<v-icon class="fa-plus" alt="Add Column" /> |
|
|
@ -151,6 +144,7 @@ Complex animated column editor for the table edit page |
|
|
|
// approximate position of delete button |
|
|
|
// approximate position of delete button |
|
|
|
clip-path: circle(calc(100% + 5em) at calc(100% - 4em) 50%); |
|
|
|
clip-path: circle(calc(100% + 5em) at calc(100% - 4em) 50%); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.col-list-leave-active .delete-btn { |
|
|
|
.col-list-leave-active .delete-btn { |
|
|
|
animation: col-list-leave-delete-btn .3s forwards; |
|
|
|
animation: col-list-leave-delete-btn .3s forwards; |
|
|
|
} |
|
|
|
} |
|
|
@ -312,6 +306,7 @@ export default { |
|
|
|
/** Compute classes for the column's delete button */ |
|
|
|
/** Compute classes for the column's delete button */ |
|
|
|
delBtnClass(col) { |
|
|
|
delBtnClass(col) { |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
|
|
|
|
'mr-1', |
|
|
|
'btn', |
|
|
|
'btn', |
|
|
|
'btn-outline-danger', |
|
|
|
'btn-outline-danger', |
|
|
|
'delete-btn', |
|
|
|
'delete-btn', |
|
|
|