@mintplayer/vue-bootstrap 3.22.0 → 3.23.0
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/datatable/index.mjs +33 -25
- package/datatable/src/BsDatatable.vue.d.ts +19 -1
- package/package.json +2 -2
package/datatable/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as w, ref as y, onMounted as m, onBeforeUnmount as b, watch as l, openBlock as g, createElementBlock as C, mergeProps as I } from "vue";
|
|
2
2
|
import "@mintplayer/web-components/datatable";
|
|
3
|
-
const
|
|
3
|
+
const k = /* @__PURE__ */ w({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "BsDatatable",
|
|
6
6
|
props: {
|
|
@@ -17,48 +17,56 @@ const I = /* @__PURE__ */ f({
|
|
|
17
17
|
selectionMode: {},
|
|
18
18
|
selectionStrategy: {},
|
|
19
19
|
selectedIds: {},
|
|
20
|
+
selectedRows: {},
|
|
21
|
+
rowLabel: { type: [Function, null] },
|
|
20
22
|
distincts: { type: [Function, null] },
|
|
21
23
|
labels: {}
|
|
22
24
|
},
|
|
23
25
|
emits: ["update:expandedIds", "update:selectedIds", "rowExpand", "rowCollapse", "sortChange", "selectionChange", "rowClick", "rowDblClick", "rowContextMenu", "pageChange", "perPageChange", "filterChange"],
|
|
24
|
-
setup(
|
|
25
|
-
const e =
|
|
26
|
-
a.value && (a.value.columns = e.columns ?? [], e.fetch != null ? a.value.fetch = e.fetch : (a.value.fetch = null, a.value.data = e.data ?? []), e.rowKey !== void 0 && (a.value.rowKey = e.rowKey), e.rowRenderer !== void 0 && (a.value.rowRenderer = e.rowRenderer), e.tree !== void 0 && (a.value.tree = e.tree), e.idKey !== void 0 && (a.value.idKey = e.idKey), e.childCountKey !== void 0 && (a.value.childCountKey = e.childCountKey), e.treeIndent !== void 0 && (a.value.treeIndent = e.treeIndent), e.
|
|
27
|
-
}, s = {
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
setup(p, { expose: u, emit: v }) {
|
|
27
|
+
const e = p, n = v, a = y(null), d = () => {
|
|
28
|
+
a.value && (a.value.columns = e.columns ?? [], e.fetch != null ? a.value.fetch = e.fetch : (a.value.fetch = null, a.value.data = e.data ?? []), e.rowKey !== void 0 && (a.value.rowKey = e.rowKey), e.rowRenderer !== void 0 && (a.value.rowRenderer = e.rowRenderer), e.tree !== void 0 && (a.value.tree = e.tree), e.idKey !== void 0 && (a.value.idKey = e.idKey), e.childCountKey !== void 0 && (a.value.childCountKey = e.childCountKey), e.treeIndent !== void 0 && (a.value.treeIndent = e.treeIndent), e.selectionMode !== void 0 && (a.value.selectionMode = e.selectionMode), e.selectionStrategy !== void 0 && (a.value.selectionStrategy = e.selectionStrategy), e.distincts !== void 0 && (a.value.distincts = e.distincts), e.labels !== void 0 && (a.value.labels = e.labels ?? void 0), e.rowLabel !== void 0 && (a.value.rowLabel = e.rowLabel));
|
|
29
|
+
}, s = () => {
|
|
30
|
+
!a.value || e.expandedIds === void 0 || (a.value.expandedIds = new Set(e.expandedIds));
|
|
31
|
+
}, i = () => {
|
|
32
|
+
!a.value || e.selectedIds === void 0 || (a.value.selectedIds = [...e.selectedIds]);
|
|
33
|
+
}, r = () => {
|
|
34
|
+
!a.value || e.selectedRows === void 0 || (a.value.selectedRows = [...e.selectedRows]);
|
|
35
|
+
}, c = {
|
|
36
|
+
"mp-datatable-row-expand": (t) => n("rowExpand", t.detail),
|
|
37
|
+
"mp-datatable-row-collapse": (t) => n("rowCollapse", t.detail),
|
|
30
38
|
"mp-datatable-expanded-ids-change": (t) => {
|
|
31
39
|
const o = t.detail;
|
|
32
|
-
|
|
40
|
+
n("update:expandedIds", new Set(o.expandedIds));
|
|
33
41
|
},
|
|
34
|
-
"mp-datatable-sort-change": (t) =>
|
|
42
|
+
"mp-datatable-sort-change": (t) => n("sortChange", t.detail),
|
|
35
43
|
"mp-datatable-selection-change": (t) => {
|
|
36
44
|
const o = t.detail;
|
|
37
|
-
|
|
45
|
+
n("selectionChange", o), n("update:selectedIds", [...o.selectedIds]);
|
|
38
46
|
},
|
|
39
|
-
"mp-datatable-row-click": (t) =>
|
|
40
|
-
"mp-datatable-row-dblclick": (t) =>
|
|
41
|
-
"mp-datatable-row-contextmenu": (t) =>
|
|
42
|
-
"mp-datatable-page-change": (t) =>
|
|
43
|
-
"mp-datatable-per-page-change": (t) =>
|
|
44
|
-
"mp-datatable-filter-change": (t) =>
|
|
45
|
-
},
|
|
47
|
+
"mp-datatable-row-click": (t) => n("rowClick", t.detail),
|
|
48
|
+
"mp-datatable-row-dblclick": (t) => n("rowDblClick", t.detail),
|
|
49
|
+
"mp-datatable-row-contextmenu": (t) => n("rowContextMenu", t.detail),
|
|
50
|
+
"mp-datatable-page-change": (t) => n("pageChange", t.detail),
|
|
51
|
+
"mp-datatable-per-page-change": (t) => n("perPageChange", t.detail),
|
|
52
|
+
"mp-datatable-filter-change": (t) => n("filterChange", t.detail)
|
|
53
|
+
}, f = () => {
|
|
46
54
|
if (a.value)
|
|
47
|
-
for (const [t, o] of Object.entries(
|
|
55
|
+
for (const [t, o] of Object.entries(c))
|
|
48
56
|
a.value.addEventListener(t, o);
|
|
49
|
-
},
|
|
57
|
+
}, h = () => {
|
|
50
58
|
if (a.value)
|
|
51
|
-
for (const [t, o] of Object.entries(
|
|
59
|
+
for (const [t, o] of Object.entries(c))
|
|
52
60
|
a.value.removeEventListener(t, o);
|
|
53
61
|
};
|
|
54
|
-
return
|
|
55
|
-
d(),
|
|
56
|
-
}),
|
|
62
|
+
return m(() => {
|
|
63
|
+
d(), s(), i(), r(), f();
|
|
64
|
+
}), b(h), l(() => e.columns, d, { deep: !1 }), l(() => e.data, d, { deep: !1 }), l(() => e.fetch, d), l(() => e.rowKey, d), l(() => e.tree, d), l(() => e.idKey, d), l(() => e.childCountKey, d), l(() => e.treeIndent, d), l(() => e.selectionMode, d), l(() => e.selectionStrategy, d), l(() => e.distincts, d), l(() => e.labels, d, { deep: !1 }), l(() => e.rowLabel, d), l(() => e.expandedIds, s, { deep: !1 }), l(() => e.selectedIds, i, { deep: !1 }), l(() => e.selectedRows, r, { deep: !1 }), u({ el: a, reload: (t) => a.value?.reload(t), applyFetchState: (t) => a.value?.applyFetchState(t) }), (t, o) => (g(), C("mp-datatable", I({
|
|
57
65
|
ref_key: "el",
|
|
58
66
|
ref: a
|
|
59
67
|
}, t.$attrs), null, 16));
|
|
60
68
|
}
|
|
61
69
|
});
|
|
62
70
|
export {
|
|
63
|
-
|
|
71
|
+
k as BsDatatable
|
|
64
72
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MpDatatable, DatatableColumnDef, DatatableFetch, RowKey, RowRenderer, DatatableSelectionMode, TreeIdKey, TreeSelectionStrategy, TreeRowExpandDetail, RowEventDetail, SortChangeEventDetail, SelectionChangeEventDetail, DatatableDistincts, DatatableLabels, FilterChangeDetail } from '@mintplayer/web-components/datatable';
|
|
1
|
+
import { MpDatatable, DatatableColumnDef, DatatableFetch, DatatableFetchState, DatatableReloadOptions, RowKey, RowRenderer, DatatableSelectionMode, TreeIdKey, TreeSelectionStrategy, TreeRowExpandDetail, RowEventDetail, SortChangeEventDetail, SelectionChangeEventDetail, DatatableDistincts, DatatableLabels, FilterChangeDetail } from '@mintplayer/web-components/datatable';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
columns?: DatatableColumnDef[];
|
|
4
4
|
data?: unknown[];
|
|
@@ -16,9 +16,25 @@ type __VLS_Props = {
|
|
|
16
16
|
childCountKey?: string | null;
|
|
17
17
|
treeIndent?: number;
|
|
18
18
|
expandedIds?: Set<unknown> | ReadonlyArray<unknown>;
|
|
19
|
+
/** `'none' | 'single' | 'multiple' | 'checkbox'` (`'checkbox'`: selection only through the checkbox column). */
|
|
19
20
|
selectionMode?: DatatableSelectionMode;
|
|
20
21
|
selectionStrategy?: TreeSelectionStrategy;
|
|
22
|
+
/** The selected keys; `v-model:selectedIds`. Authoritative. */
|
|
21
23
|
selectedIds?: string[] | ReadonlyArray<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Seeds the selection with row objects: REPLACES it, deriving the keys
|
|
26
|
+
* through `rowKey` and remembering the rows, so rows that are not loaded
|
|
27
|
+
* (another page, not fetched yet) are still reported in
|
|
28
|
+
* `selectionChange`'s `detail.selectedRows`. One-way: it is pushed when it
|
|
29
|
+
* changes, and takes precedence over `selectedIds` when both change at once.
|
|
30
|
+
* Read the selection back from `selectionChange` / `v-model:selectedIds`.
|
|
31
|
+
*/
|
|
32
|
+
selectedRows?: unknown[] | ReadonlyArray<unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Names a row for its selection checkbox ("Select {label}"). Defaults to the
|
|
35
|
+
* text of the row's first cell, then the row number.
|
|
36
|
+
*/
|
|
37
|
+
rowLabel?: ((row: unknown) => string) | null;
|
|
22
38
|
/**
|
|
23
39
|
* Source of distinct values for the filter panels. Required whenever the
|
|
24
40
|
* element does not hold every row -- with `fetch`, external paging, or a tree
|
|
@@ -31,6 +47,8 @@ type __VLS_Props = {
|
|
|
31
47
|
};
|
|
32
48
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
33
49
|
el: import('vue').Ref<MpDatatable | null, MpDatatable | null>;
|
|
50
|
+
reload: (options?: DatatableReloadOptions) => void | undefined;
|
|
51
|
+
applyFetchState: (state: DatatableFetchState) => void | undefined;
|
|
34
52
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
35
53
|
"update:expandedIds": (value: Set<unknown>) => any;
|
|
36
54
|
"update:selectedIds": (value: string[]) => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/vue-bootstrap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0",
|
|
4
4
|
"description": "Vue 3.5 SFC adapters around @mintplayer/web-components. Each sub-entry maps one-to-one with a WC sub-entry and exposes typed Vue components with v-model support for input WCs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
},
|
|
182
182
|
"peerDependencies": {
|
|
183
183
|
"vue": "^3.5.0",
|
|
184
|
-
"@mintplayer/web-components": "^2.
|
|
184
|
+
"@mintplayer/web-components": "^2.18.0"
|
|
185
185
|
},
|
|
186
186
|
"dependencies": {
|
|
187
187
|
"tslib": "^2.3.0"
|