vuetable-next 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuetable-next.js +3 -2
- package/dist/vuetable-next.js.map +1 -1
- package/dist/vuetable-next.umd.cjs +1 -1
- package/dist/vuetable-next.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Vuetable.vue +2 -16
- package/test/Vuetable.Components.test.ts +27 -0
- package/test/__snapshots__/Vuetable.Components.test.ts.snap +11 -0
package/package.json
CHANGED
|
@@ -330,7 +330,7 @@ const instanceFetch = ref<Promise<AxiosResponse>>();
|
|
|
330
330
|
|
|
331
331
|
const $_css = reactive({ ...CssSemanticUI.table, ...css });
|
|
332
332
|
|
|
333
|
-
const dataIsAvailable = computed(() => tableData.value?.length
|
|
333
|
+
const dataIsAvailable = computed(() => !tableData.value?.length ? false : tableData.value?.length > 0);
|
|
334
334
|
const useDetailRow = computed(() => dataIsAvailable.value && detailRowComponent !== "");
|
|
335
335
|
const hasRowIdentifier = computed(() => tableData.value && typeof tableData.value[0][trackBy] !== "undefined");
|
|
336
336
|
const countVisibleFields = computed(() => tableFields.value.filter(field => field.visible).length);
|
|
@@ -439,6 +439,7 @@ provide("vuetable", {
|
|
|
439
439
|
scrollBarWidth: unref(scrollBarWidth),
|
|
440
440
|
sortOrder,
|
|
441
441
|
trackBy,
|
|
442
|
+
perPage,
|
|
442
443
|
showSortIcons,
|
|
443
444
|
css: toRefs($_css),
|
|
444
445
|
isFieldSlot,
|
|
@@ -466,21 +467,6 @@ provide("vuetable", {
|
|
|
466
467
|
getObjectValue,
|
|
467
468
|
isSelectedRow
|
|
468
469
|
});
|
|
469
|
-
// provide("tableData", tableData);
|
|
470
|
-
// provide("tableFields", tableFields);
|
|
471
|
-
// provide("scrollBarWidth", scrollBarWidth);
|
|
472
|
-
// provide("sortOrder", sortOrder);
|
|
473
|
-
// provide("$_css", $_css);
|
|
474
|
-
// provide("fieldPrefix", fieldPrefix);
|
|
475
|
-
// provide("showSortIcons", showSortIcons);
|
|
476
|
-
// provide("trackBy", trackBy);
|
|
477
|
-
// provide("isSortable", isSortable);
|
|
478
|
-
// provide("onHeaderEvent", onHeaderEvent);
|
|
479
|
-
// provide("orderBy", orderBy);
|
|
480
|
-
// provide("onCheckboxToggled", onCheckboxToggled);
|
|
481
|
-
// provide("onCheckboxToggledAll", onCheckboxToggledAll);
|
|
482
|
-
// provide("isSelectedRow", isSelectedRow);
|
|
483
|
-
// provide("perPage", isSelectedRow);
|
|
484
470
|
|
|
485
471
|
function getScrollBarWidth () {
|
|
486
472
|
const outer = document.createElement("div");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils";
|
|
2
|
+
import VuetableFieldCheckbox from "../src/components/VuetableFieldCheckbox.vue";
|
|
3
|
+
import Vuetable from "../src/components/Vuetable.vue";
|
|
4
|
+
|
|
5
|
+
describe("Vuetable - Components", () => {
|
|
6
|
+
it("render VuetableFieldCheckbox", () => {
|
|
7
|
+
const root = mount(Vuetable, {
|
|
8
|
+
propsData: {
|
|
9
|
+
apiMode: false,
|
|
10
|
+
fields: [
|
|
11
|
+
{ name: "code", titleClass: "foo-bar" }
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const wrapper = mount(VuetableFieldCheckbox, {
|
|
16
|
+
propsData: {
|
|
17
|
+
rowData: ["code"]
|
|
18
|
+
},
|
|
19
|
+
global: {
|
|
20
|
+
provide: {
|
|
21
|
+
vuetable: root.vm
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
});
|