@mantine-vue/table 2.2.2 → 2.3.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/cjs/index.cjs +10 -22
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +11 -23
- package/esm/index.mjs.map +1 -1
- package/lib/mantine.types.d.ts +3 -27
- package/lib/types.d.ts +1 -1
- package/package.json +4 -4
package/cjs/index.cjs
CHANGED
|
@@ -2032,13 +2032,7 @@ var MVT_BottomToolbar = (0, vue.defineComponent)({
|
|
|
2032
2032
|
required: true
|
|
2033
2033
|
} },
|
|
2034
2034
|
setup(props, { attrs }) {
|
|
2035
|
-
const isMobile = (0,
|
|
2036
|
-
(0, vue.onMounted)(() => {
|
|
2037
|
-
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
2038
|
-
const mql = window.matchMedia("(max-width: 720px)");
|
|
2039
|
-
isMobile.value = mql.matches;
|
|
2040
|
-
mql.addEventListener("change", (e) => isMobile.value = e.matches);
|
|
2041
|
-
});
|
|
2035
|
+
const isMobile = (0, _mantine_vue_hooks.useMediaQuery)("(max-width: 720px)");
|
|
2042
2036
|
return () => {
|
|
2043
2037
|
const { table } = props;
|
|
2044
2038
|
const { getState, options: { enablePagination, mantineBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions }, refs: { bottomToolbarRef } } = table;
|
|
@@ -2742,16 +2736,6 @@ var MVT_TopToolbar_module_default = {
|
|
|
2742
2736
|
};
|
|
2743
2737
|
//#endregion
|
|
2744
2738
|
//#region src/components/toolbar/MVT_TopToolbar.ts
|
|
2745
|
-
var useMedia = (query) => {
|
|
2746
|
-
const matches = (0, vue.ref)(false);
|
|
2747
|
-
(0, vue.onMounted)(() => {
|
|
2748
|
-
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
2749
|
-
const mql = window.matchMedia(query);
|
|
2750
|
-
matches.value = mql.matches;
|
|
2751
|
-
mql.addEventListener("change", (e) => matches.value = e.matches);
|
|
2752
|
-
});
|
|
2753
|
-
return matches;
|
|
2754
|
-
};
|
|
2755
2739
|
var MVT_TopToolbar = (0, vue.defineComponent)({
|
|
2756
2740
|
name: "MVTTopToolbar",
|
|
2757
2741
|
inheritAttrs: false,
|
|
@@ -2760,8 +2744,8 @@ var MVT_TopToolbar = (0, vue.defineComponent)({
|
|
|
2760
2744
|
required: true
|
|
2761
2745
|
} },
|
|
2762
2746
|
setup(props, { attrs }) {
|
|
2763
|
-
const isMobile =
|
|
2764
|
-
const isTablet =
|
|
2747
|
+
const isMobile = (0, _mantine_vue_hooks.useMediaQuery)("(max-width: 720px)");
|
|
2748
|
+
const isTablet = (0, _mantine_vue_hooks.useMediaQuery)("(max-width: 1024px)");
|
|
2765
2749
|
return () => {
|
|
2766
2750
|
const { table } = props;
|
|
2767
2751
|
const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, mantineTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions }, refs: { topToolbarRef } } = table;
|
|
@@ -2771,7 +2755,10 @@ var MVT_TopToolbar = (0, vue.defineComponent)({
|
|
|
2771
2755
|
...attrs
|
|
2772
2756
|
};
|
|
2773
2757
|
const stackAlertBanner = isMobile.value || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet.value;
|
|
2774
|
-
const globalFilterProps = {
|
|
2758
|
+
const globalFilterProps = {
|
|
2759
|
+
style: !isTablet.value ? { zIndex: 3 } : void 0,
|
|
2760
|
+
table
|
|
2761
|
+
};
|
|
2775
2762
|
return (0, vue.h)(_mantine_vue_core.Box, {
|
|
2776
2763
|
...toolbarProps,
|
|
2777
2764
|
class: (0, clsx.default)(common_styles_module_default["common-toolbar-styles"], MVT_TopToolbar_module_default["root"], isFullScreen && MVT_TopToolbar_module_default["root-fullscreen"], toolbarProps?.class),
|
|
@@ -2788,7 +2775,7 @@ var MVT_TopToolbar = (0, vue.defineComponent)({
|
|
|
2788
2775
|
table
|
|
2789
2776
|
}),
|
|
2790
2777
|
["both", "top"].includes(positionToolbarDropZone ?? "") && (0, vue.h)(MVT_ToolbarDropZone, { table }),
|
|
2791
|
-
(0, vue.h)(_mantine_vue_core.Flex, { class:
|
|
2778
|
+
(0, vue.h)(_mantine_vue_core.Flex, { class: [MVT_TopToolbar_module_default["actions-container"], stackAlertBanner ? MVT_TopToolbar_module_default["actions-container-stack-alert"] : void 0] }, () => [
|
|
2792
2779
|
enableGlobalFilter && positionGlobalFilter === "left" && (0, vue.h)(MVT_GlobalFilterTextInput, globalFilterProps),
|
|
2793
2780
|
parseFromValuesOrFunc(renderTopToolbarCustomActions, { table }) ?? (0, vue.h)("span"),
|
|
2794
2781
|
enableToolbarInternalActions ? (0, vue.h)(_mantine_vue_core.Flex, {
|
|
@@ -2825,6 +2812,7 @@ var MVT_EditRowModal = (0, vue.defineComponent)({
|
|
|
2825
2812
|
},
|
|
2826
2813
|
emits: { close: () => true },
|
|
2827
2814
|
setup(props, { attrs, emit, slots }) {
|
|
2815
|
+
const mvtSlots = useMVT_Slots();
|
|
2828
2816
|
return () => {
|
|
2829
2817
|
const { table } = props;
|
|
2830
2818
|
const state = table.getState();
|
|
@@ -2862,7 +2850,7 @@ var MVT_EditRowModal = (0, vue.defineComponent)({
|
|
|
2862
2850
|
modalProps.onClose?.();
|
|
2863
2851
|
emit("close");
|
|
2864
2852
|
};
|
|
2865
|
-
const custom = (state.creatingRow ? slots.create ?? slots.default : slots.edit ?? slots.default)?.({
|
|
2853
|
+
const custom = (state.creatingRow ? slots.create ?? mvtSlots.createRowModalContent ?? slots.default : slots.edit ?? mvtSlots.editRowModalContent ?? slots.default)?.({
|
|
2866
2854
|
internalEditComponents,
|
|
2867
2855
|
row,
|
|
2868
2856
|
table
|