mirror of
https://github.com/beekeeper-studio/beekeeper-studio.git
synced 2026-03-13 10:12:54 +08:00
Merge pull request #2800 from beekeeper-studio/fix/tabulator-errors
Fix: tabulator errors in console
This commit is contained in:
@@ -90,8 +90,7 @@
|
||||
// Field Rows
|
||||
.tabulator-row {
|
||||
margin: $row-gutter 0;
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd){
|
||||
&.tabulator-row-even {
|
||||
background: rgba($theme-base, 0.05)!important;
|
||||
--row-bg-color: #{rgba($theme-base, 0.05)};
|
||||
}
|
||||
|
||||
@@ -272,8 +272,7 @@ $cell-success: $row-add;
|
||||
// Field Rows
|
||||
.tabulator-row {
|
||||
margin: $row-gutter 0;
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd){
|
||||
&.tabulator-row-even {
|
||||
--row-bg-color: #{rgba($theme-base, 0.05)};
|
||||
background: rgba($theme-base, 0.05)!important;
|
||||
}
|
||||
@@ -400,8 +399,7 @@ $cell-success: $row-add;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd){
|
||||
&.tabulator-row-even {
|
||||
&.inserted {
|
||||
--row-bg-color: #{$row-add};
|
||||
background-color: $row-add!important;
|
||||
|
||||
@@ -249,8 +249,7 @@ x-buttons {
|
||||
.tabulator-tableholder {
|
||||
.tabulator-table {
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
&.inserted,
|
||||
&.inserted:hover {
|
||||
background: $row-add!important;
|
||||
@@ -336,19 +335,13 @@ x-buttons {
|
||||
}
|
||||
}
|
||||
}
|
||||
.tabulator-row {
|
||||
&:nth-child(odd) {
|
||||
background: rgba($theme-base, 0.025);
|
||||
}
|
||||
}
|
||||
|
||||
// Table Builder
|
||||
// -------------------------
|
||||
.table-builder .table-builder-wrap,
|
||||
.table-properties .table-properties-wrap {
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
background: rgba($theme-base, 0.06);
|
||||
--row-bg-color: #{rgba($theme-base, 0.06)};
|
||||
}
|
||||
@@ -395,8 +388,7 @@ x-buttons {
|
||||
|
||||
// Field Rows
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
background: rgba($theme-base, 0.05);
|
||||
}
|
||||
.tabulator-cell {
|
||||
|
||||
@@ -249,8 +249,7 @@ x-buttons {
|
||||
// -------------------------------
|
||||
.tabulator-table {
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
&.inserted,
|
||||
&.inserted:hover {
|
||||
background: $row-add!important;
|
||||
@@ -324,19 +323,13 @@ x-buttons {
|
||||
}
|
||||
}
|
||||
}
|
||||
.tabulator-row {
|
||||
&:nth-child(odd) {
|
||||
background: rgba($theme-base, 0.025);
|
||||
}
|
||||
}
|
||||
|
||||
// Table Builder
|
||||
// -------------------------
|
||||
.table-builder .table-builder-wrap,
|
||||
.table-properties .table-properties-wrap {
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
background: rgba($theme-base, 0.06);
|
||||
}
|
||||
&.inserted {
|
||||
@@ -381,8 +374,7 @@ x-buttons {
|
||||
|
||||
// Field Rows
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
background: rgba($theme-base, 0.05);
|
||||
}
|
||||
.tabulator-cell {
|
||||
|
||||
@@ -39,6 +39,7 @@ export function tabulatorForTableData(
|
||||
movableColumns: true,
|
||||
height: "100%",
|
||||
editTriggerEvent: "dblclick",
|
||||
debugInvalidComponentFuncs: false,
|
||||
rowHeader: {
|
||||
field: rowHeaderField,
|
||||
resizable: false,
|
||||
|
||||
@@ -936,8 +936,6 @@ export default Vue.extend({
|
||||
this.rawTableKeys = await this.connection.getTableKeys(this.table.name, this.table.schema);
|
||||
const rawPrimaryKeys = await this.connection.getPrimaryKeys(this.table.name, this.table.schema);
|
||||
this.primaryKeys = rawPrimaryKeys.map((key) => key.columnName);
|
||||
this.tableFilters = getFilters(this.tab) || [createTableFilter(this.table.columns?.[0]?.columnName)]
|
||||
this.filters = normalizeFilters(this.tableFilters || [])
|
||||
|
||||
this.tabulator = tabulatorForTableData(this.$refs.table, {
|
||||
table: this.table.name,
|
||||
@@ -1017,6 +1015,9 @@ export default Vue.extend({
|
||||
// Tabulator range is reset after data is processed
|
||||
this.tabulator.on("dataProcessed", this.updateDetailView);
|
||||
|
||||
this.tableFilters = getFilters(this.tab) || [createTableFilter(this.table.columns?.[0]?.columnName)]
|
||||
this.filters = normalizeFilters(this.tableFilters || [])
|
||||
|
||||
this.updateSplit()
|
||||
},
|
||||
rowActionsMenu(range: RangeComponent) {
|
||||
|
||||
@@ -349,6 +349,13 @@ export default Vue.extend({
|
||||
|
||||
this.tabulator = tabulator
|
||||
|
||||
const unwatchTableColumns = this.$watch("tableColumns", () => {
|
||||
this.setColumns(this.tableColumns);
|
||||
});
|
||||
const unwatchData = this.$watch("data", () => {
|
||||
this.setData(this.data);
|
||||
})
|
||||
|
||||
tabulator.on("sortChanged", (sorters) => {
|
||||
this.$emit("bks-sorters-change", {
|
||||
sorters: sorters.map(({ field, dir }) => ({ field, dir }))
|
||||
@@ -362,6 +369,8 @@ export default Vue.extend({
|
||||
tabulator.on('dataProcessed', this.maybeScrollAndSetWidths);
|
||||
tabulator.on("tableDestroyed", () => {
|
||||
this.$refs.table.removeEventListener("keydown", this.keydown);
|
||||
unwatchTableColumns();
|
||||
unwatchData();
|
||||
})
|
||||
|
||||
this.$refs.table.addEventListener("keydown", this.keydown);
|
||||
|
||||
@@ -73,8 +73,7 @@ $columnResizeGuideColor: mix($query-editor-bg, $theme-base, 80%) !default;
|
||||
.tabulator-tableholder {
|
||||
.tabulator-table {
|
||||
.tabulator-row {
|
||||
&.tabulator-row-even,
|
||||
&:nth-child(odd) {
|
||||
&.tabulator-row-even {
|
||||
&.inserted,
|
||||
&.inserted:hover {
|
||||
background: $row-add;
|
||||
@@ -153,11 +152,6 @@ $columnResizeGuideColor: mix($query-editor-bg, $theme-base, 80%) !default;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tabulator-row {
|
||||
&:nth-child(odd) {
|
||||
background: rgba($theme-base, 0.025);
|
||||
}
|
||||
}
|
||||
|
||||
.tabulator-tableholder .tabulator-table {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user