@adapttable/naive-ui 0.1.3 → 0.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/README.md +14 -0
- package/dist/{NaiveFilterSurface-BMG3PDjK.cjs → NaiveFilterSurface-BXsgCRMO.cjs} +2 -2
- package/dist/{NaiveFilterSurface-BMG3PDjK.cjs.map → NaiveFilterSurface-BXsgCRMO.cjs.map} +1 -1
- package/dist/{NaiveFilterSurface-BnlW8DFz.js → NaiveFilterSurface-BwJ-D-EB.js} +2 -2
- package/dist/{NaiveFilterSurface-BnlW8DFz.js.map → NaiveFilterSurface-BwJ-D-EB.js.map} +1 -1
- package/dist/assistant-C5NcmK_X.cjs +380 -0
- package/dist/assistant-C5NcmK_X.cjs.map +1 -0
- package/dist/assistant-CEXAPOyL.js +357 -0
- package/dist/assistant-CEXAPOyL.js.map +1 -0
- package/dist/assistant.cjs +5 -358
- package/dist/assistant.js +1 -354
- package/dist/batch-editing.cjs +1 -1
- package/dist/batch-editing.js +1 -1
- package/dist/cell-navigation.cjs +1 -1
- package/dist/cell-navigation.js +1 -1
- package/dist/{column-menu-kVdaXqiU.js → column-menu-Bb6BOjdI.js} +2 -2
- package/dist/{column-menu-kVdaXqiU.js.map → column-menu-Bb6BOjdI.js.map} +1 -1
- package/dist/{column-menu-Dh3hU7Vp.cjs → column-menu-CDtaqm4z.cjs} +2 -2
- package/dist/{column-menu-Dh3hU7Vp.cjs.map → column-menu-CDtaqm4z.cjs.map} +1 -1
- package/dist/column-menu-DdWVP1hz.d.cts +23 -0
- package/dist/column-menu-DdWVP1hz.d.cts.map +1 -0
- package/dist/column-menu-DdWVP1hz.d.ts +23 -0
- package/dist/column-menu-DdWVP1hz.d.ts.map +1 -0
- package/dist/column-menu.cjs +1 -1
- package/dist/column-menu.d.cts +2 -23
- package/dist/column-menu.d.ts +2 -23
- package/dist/column-menu.js +1 -1
- package/dist/command-palette-D396WFrI.cjs +117 -0
- package/dist/command-palette-D396WFrI.cjs.map +1 -0
- package/dist/command-palette-ZSFMOROm.js +112 -0
- package/dist/command-palette-ZSFMOROm.js.map +1 -0
- package/dist/command-palette.cjs +2 -112
- package/dist/command-palette.js +1 -111
- package/dist/context-menu-BbhrjTZr.cjs +145 -0
- package/dist/context-menu-BbhrjTZr.cjs.map +1 -0
- package/dist/context-menu-DjYIQXhY.js +140 -0
- package/dist/context-menu-DjYIQXhY.js.map +1 -0
- package/dist/context-menu.cjs +2 -140
- package/dist/context-menu.js +1 -139
- package/dist/{controls-CovJN7Di.cjs → controls-B-6fs9jq.cjs} +2 -2
- package/dist/{controls-CovJN7Di.cjs.map → controls-B-6fs9jq.cjs.map} +1 -1
- package/dist/{controls-BbSp1__U.js → controls-CUzK34ER.js} +2 -2
- package/dist/{controls-BbSp1__U.js.map → controls-CUzK34ER.js.map} +1 -1
- package/dist/{editing-BZFBs7GP.js → editing-C7QHX-gq.js} +2 -2
- package/dist/{editing-BZFBs7GP.js.map → editing-C7QHX-gq.js.map} +1 -1
- package/dist/{editing-CbNASsOY.cjs → editing-DR4w-oKB.cjs} +2 -2
- package/dist/{editing-CbNASsOY.cjs.map → editing-DR4w-oKB.cjs.map} +1 -1
- package/dist/editing.cjs +1 -1
- package/dist/editing.js +1 -1
- package/dist/features.cjs +217 -0
- package/dist/features.d.cts +40 -0
- package/dist/features.d.ts +40 -0
- package/dist/features.js +36 -0
- package/dist/filters-BJ48GzqJ.d.ts +66 -0
- package/dist/filters-BJ48GzqJ.d.ts.map +1 -0
- package/dist/filters-C6DvAZ_T.d.cts +66 -0
- package/dist/filters-C6DvAZ_T.d.cts.map +1 -0
- package/dist/{filters-CCiha_tj.cjs → filters-Ce9485--.cjs} +3 -3
- package/dist/{filters-CCiha_tj.cjs.map → filters-Ce9485--.cjs.map} +1 -1
- package/dist/{filters-CV7NPw4D.js → filters-w5iJExiN.js} +3 -3
- package/dist/{filters-CV7NPw4D.js.map → filters-w5iJExiN.js.map} +1 -1
- package/dist/filters.cjs +2 -2
- package/dist/filters.d.cts +2 -66
- package/dist/filters.d.ts +2 -66
- package/dist/filters.js +2 -2
- package/dist/find-in-table.cjs +1 -1
- package/dist/find-in-table.js +1 -1
- package/dist/grouping-panel-BPaPG49S.cjs +151 -0
- package/dist/grouping-panel-BPaPG49S.cjs.map +1 -0
- package/dist/grouping-panel-CYUPSa0u.js +146 -0
- package/dist/grouping-panel-CYUPSa0u.js.map +1 -0
- package/dist/grouping-panel.cjs +3 -146
- package/dist/grouping-panel.js +2 -145
- package/dist/{header-filters-Dc94qhxq.cjs → header-filters-B5_gSabO.cjs} +3 -3
- package/dist/{header-filters-Dc94qhxq.cjs.map → header-filters-B5_gSabO.cjs.map} +1 -1
- package/dist/header-filters-CQg6clum.d.cts +52 -0
- package/dist/header-filters-CQg6clum.d.cts.map +1 -0
- package/dist/header-filters-CQg6clum.d.ts +52 -0
- package/dist/header-filters-CQg6clum.d.ts.map +1 -0
- package/dist/{header-filters-vT9O5T_C.js → header-filters-DmgFtg_F.js} +3 -3
- package/dist/{header-filters-vT9O5T_C.js.map → header-filters-DmgFtg_F.js.map} +1 -1
- package/dist/header-filters.cjs +1 -1
- package/dist/header-filters.d.cts +2 -52
- package/dist/header-filters.d.ts +2 -52
- package/dist/header-filters.js +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{input-DPQy4L2b.cjs → input-DZV2IoAG.cjs} +2 -1
- package/dist/input-DZV2IoAG.cjs.map +1 -0
- package/dist/{input-DZI_oY9v.js → input-YgQ2d8K9.js} +2 -1
- package/dist/input-YgQ2d8K9.js.map +1 -0
- package/dist/{mobile-Dlwq8dB7.js → mobile-BHOtdPjL.js} +15 -4
- package/dist/mobile-BHOtdPjL.js.map +1 -0
- package/dist/{mobile-Bc3-31-b.cjs → mobile-DvFNwZq-.cjs} +14 -3
- package/dist/mobile-DvFNwZq-.cjs.map +1 -0
- package/dist/preset.cjs +7 -7
- package/dist/preset.js +7 -7
- package/dist/renderers.cjs +1 -1
- package/dist/renderers.d.cts.map +1 -1
- package/dist/renderers.d.ts.map +1 -1
- package/dist/renderers.js +1 -1
- package/dist/row-reorder-BNYYEL8w.js +186 -0
- package/dist/row-reorder-BNYYEL8w.js.map +1 -0
- package/dist/row-reorder-BRySq2FF.cjs +191 -0
- package/dist/row-reorder-BRySq2FF.cjs.map +1 -0
- package/dist/row-reorder.cjs +2 -185
- package/dist/row-reorder.js +1 -185
- package/dist/{saved-views-BSZ9y-_E.cjs → saved-views-DLuxKH_r.cjs} +2 -2
- package/dist/{saved-views-BSZ9y-_E.cjs.map → saved-views-DLuxKH_r.cjs.map} +1 -1
- package/dist/{saved-views-CdJjkWzt.js → saved-views-hTIhkbu0.js} +2 -2
- package/dist/{saved-views-CdJjkWzt.js.map → saved-views-hTIhkbu0.js.map} +1 -1
- package/dist/saved-views.cjs +1 -1
- package/dist/saved-views.js +1 -1
- package/dist/side-panel-Bf4zBlYZ.cjs +64 -0
- package/dist/side-panel-Bf4zBlYZ.cjs.map +1 -0
- package/dist/side-panel-CLTgXUnb.js +59 -0
- package/dist/side-panel-CLTgXUnb.js.map +1 -0
- package/dist/side-panel.cjs +2 -59
- package/dist/side-panel.js +1 -58
- package/dist/status-bar.cjs +1 -1
- package/dist/status-bar.js +1 -1
- package/dist/styles.css +114 -39
- package/package.json +14 -3
- package/dist/assistant.cjs.map +0 -1
- package/dist/assistant.js.map +0 -1
- package/dist/column-menu.d.cts.map +0 -1
- package/dist/column-menu.d.ts.map +0 -1
- package/dist/command-palette.cjs.map +0 -1
- package/dist/command-palette.js.map +0 -1
- package/dist/context-menu.cjs.map +0 -1
- package/dist/context-menu.js.map +0 -1
- package/dist/filters.d.cts.map +0 -1
- package/dist/filters.d.ts.map +0 -1
- package/dist/grouping-panel.cjs.map +0 -1
- package/dist/grouping-panel.js.map +0 -1
- package/dist/header-filters.d.cts.map +0 -1
- package/dist/header-filters.d.ts.map +0 -1
- package/dist/input-DPQy4L2b.cjs.map +0 -1
- package/dist/input-DZI_oY9v.js.map +0 -1
- package/dist/mobile-Bc3-31-b.cjs.map +0 -1
- package/dist/mobile-Dlwq8dB7.js.map +0 -1
- package/dist/row-reorder.cjs.map +0 -1
- package/dist/row-reorder.js.map +0 -1
- package/dist/side-panel.cjs.map +0 -1
- package/dist/side-panel.js.map +0 -1
package/dist/row-reorder.cjs
CHANGED
|
@@ -1,193 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_select = require("./select-C8UKnsWO.cjs");
|
|
4
|
-
const require_modalEscape = require("./modalEscape-aYoIK8OW.cjs");
|
|
2
|
+
const require_row_reorder = require("./row-reorder-BRySq2FF.cjs");
|
|
5
3
|
let _adapttable_vue = require("@adapttable/vue");
|
|
6
|
-
|
|
7
|
-
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
8
|
-
let vue = require("vue");
|
|
9
|
-
let naive_ui = require("naive-ui");
|
|
10
|
-
//#region src/reorder/NaiveRowMoveMenu.ts
|
|
11
|
-
const NaiveRowMoveMenu = /*#__PURE__*/ (0, vue.defineComponent)((props) => {
|
|
12
|
-
const active = (0, _adapttable_vue_adapter.useScopeActivity)();
|
|
13
|
-
const container = (0, vue.shallowRef)(null);
|
|
14
|
-
const trigger = (0, vue.shallowRef)(null);
|
|
15
|
-
const card = (0, vue.shallowRef)(null);
|
|
16
|
-
const escape = require_modalEscape.useNaiveModalEscape(() => card.value ? require_button.htmlRoot(card.value) : null);
|
|
17
|
-
const descriptionId = (0, vue.useId)();
|
|
18
|
-
let revision = 0;
|
|
19
|
-
(0, vue.watch)([
|
|
20
|
-
active,
|
|
21
|
-
() => props.items,
|
|
22
|
-
() => props.confirmation
|
|
23
|
-
], () => {
|
|
24
|
-
revision++;
|
|
25
|
-
}, { flush: "sync" });
|
|
26
|
-
const restore = () => {
|
|
27
|
-
(0, vue.nextTick)(() => {
|
|
28
|
-
if (active.value && !props.confirmation && trigger.value?.isConnected) trigger.value.focus();
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
return () => {
|
|
32
|
-
const ticket = revision;
|
|
33
|
-
const live = active.value;
|
|
34
|
-
const current = () => live && active.value && ticket === revision;
|
|
35
|
-
const confirmation = props.confirmation;
|
|
36
|
-
const finish = (accept) => {
|
|
37
|
-
if (!current() || !confirmation || props.confirmation !== confirmation) return;
|
|
38
|
-
if (accept) confirmation.onConfirm();
|
|
39
|
-
else confirmation.onCancel();
|
|
40
|
-
restore();
|
|
41
|
-
};
|
|
42
|
-
const content = confirmation ? [
|
|
43
|
-
(0, vue.h)("p", { id: descriptionId }, confirmation.description),
|
|
44
|
-
require_button.naiveButton({
|
|
45
|
-
"data-adapttable-part": "row-move-cancel",
|
|
46
|
-
onClick: () => finish(false)
|
|
47
|
-
}, confirmation.cancelLabel),
|
|
48
|
-
require_button.naiveButton({
|
|
49
|
-
"data-adapttable-part": "row-move-confirm",
|
|
50
|
-
onClick: () => finish(true)
|
|
51
|
-
}, confirmation.confirmLabel)
|
|
52
|
-
] : [];
|
|
53
|
-
return (0, vue.h)("span", {
|
|
54
|
-
"data-adapttable-part": "row-move-menu",
|
|
55
|
-
ref: (0, _adapttable_vue_adapter.elementRef)((element) => {
|
|
56
|
-
container.value = element;
|
|
57
|
-
})
|
|
58
|
-
}, [(0, vue.h)("span", { "data-adapttable-part": "row-move-menu-content" }, [require_select.naiveSelect({
|
|
59
|
-
attrs: {
|
|
60
|
-
ref: (element) => {
|
|
61
|
-
trigger.value = element;
|
|
62
|
-
},
|
|
63
|
-
"aria-label": props.label,
|
|
64
|
-
placeholder: props.label,
|
|
65
|
-
"data-adapttable-part": "row-move-menu-trigger",
|
|
66
|
-
disabled: props.items.every((item) => item.disabled)
|
|
67
|
-
},
|
|
68
|
-
value: "",
|
|
69
|
-
optionPart: "row-move-menu-item",
|
|
70
|
-
virtualScroll: false,
|
|
71
|
-
options: props.items.map((item) => ({
|
|
72
|
-
value: item.id,
|
|
73
|
-
label: item.label,
|
|
74
|
-
disabled: item.disabled,
|
|
75
|
-
title: item.disabledReason
|
|
76
|
-
})),
|
|
77
|
-
onChange: (key) => {
|
|
78
|
-
if (!current()) return;
|
|
79
|
-
const item = props.items.find((entry) => entry.id === key);
|
|
80
|
-
if (item && !item.disabled) item.onSelect();
|
|
81
|
-
}
|
|
82
|
-
})]), confirmation && container.value ? (0, vue.h)(naive_ui.NModal, {
|
|
83
|
-
show: live,
|
|
84
|
-
to: container.value,
|
|
85
|
-
autoFocus: true,
|
|
86
|
-
trapFocus: true,
|
|
87
|
-
maskClosable: false,
|
|
88
|
-
"onUpdate:show": (show) => {
|
|
89
|
-
if (!show && escape.allow()) finish(false);
|
|
90
|
-
}
|
|
91
|
-
}, { default: () => (0, vue.h)(naive_ui.NCard, {
|
|
92
|
-
ref: card,
|
|
93
|
-
role: "alertdialog",
|
|
94
|
-
onKeydownCapture: escape.capture,
|
|
95
|
-
"aria-modal": true,
|
|
96
|
-
"aria-label": confirmation.title,
|
|
97
|
-
"aria-describedby": descriptionId,
|
|
98
|
-
"data-adapttable-part": "row-move-confirmation",
|
|
99
|
-
title: confirmation.title,
|
|
100
|
-
style: { width: "min(28rem,calc(100vw - 2rem))" }
|
|
101
|
-
}, { default: () => content }) }) : null]);
|
|
102
|
-
};
|
|
103
|
-
}, {
|
|
104
|
-
name: "NaiveRowMoveMenu",
|
|
105
|
-
props: {
|
|
106
|
-
label: { type: String },
|
|
107
|
-
items: { type: Array },
|
|
108
|
-
confirmation: { type: Object }
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/reorder/naiveReorderControls.ts
|
|
113
|
-
const naiveReorderControls = {
|
|
114
|
-
Handle: ({ label, pressed, dragging, disabled, dragProps, onKeyDown, className }) => require_button.naiveButton({
|
|
115
|
-
type: "button",
|
|
116
|
-
"aria-label": label,
|
|
117
|
-
"aria-pressed": pressed,
|
|
118
|
-
"data-dragging": dragging ? "" : void 0,
|
|
119
|
-
"data-adapttable-part": "row-reorder-handle",
|
|
120
|
-
"data-adapttable-grip": "",
|
|
121
|
-
class: className,
|
|
122
|
-
disabled,
|
|
123
|
-
draggable: dragProps.draggable,
|
|
124
|
-
onDragstart: (event) => {
|
|
125
|
-
if (event.dataTransfer) dragProps.onDragStart({
|
|
126
|
-
...event,
|
|
127
|
-
dataTransfer: event.dataTransfer,
|
|
128
|
-
clientY: event.clientY,
|
|
129
|
-
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
130
|
-
preventDefault: () => event.preventDefault()
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
onDragend: dragProps.onDragEnd,
|
|
134
|
-
onKeydown: (event) => onKeyDown({
|
|
135
|
-
key: event.key,
|
|
136
|
-
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
137
|
-
preventDefault: () => event.preventDefault()
|
|
138
|
-
})
|
|
139
|
-
}, "↕"),
|
|
140
|
-
Button: ({ label, part, disabled, onClick, className }) => require_button.naiveButton({
|
|
141
|
-
type: "button",
|
|
142
|
-
"aria-label": label,
|
|
143
|
-
"data-adapttable-part": part,
|
|
144
|
-
class: className,
|
|
145
|
-
disabled,
|
|
146
|
-
onClick
|
|
147
|
-
}, label),
|
|
148
|
-
Menu: (props) => (0, vue.h)(NaiveRowMoveMenu, props)
|
|
149
|
-
};
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/reorder/NaiveRowReorder.vue
|
|
152
|
-
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
153
|
-
__name: "NaiveRowReorder",
|
|
154
|
-
props: {
|
|
155
|
-
model: {},
|
|
156
|
-
labels: {},
|
|
157
|
-
mobile: { type: Boolean },
|
|
158
|
-
classNames: {},
|
|
159
|
-
rowId: {},
|
|
160
|
-
localIndex: {},
|
|
161
|
-
row: {},
|
|
162
|
-
windowStart: {},
|
|
163
|
-
rowCount: {}
|
|
164
|
-
},
|
|
165
|
-
setup(__props) {
|
|
166
|
-
const props = __props;
|
|
167
|
-
const names = (0, _adapttable_vue_adapter.useDataTableClassNames)();
|
|
168
|
-
const Render = () => (0, _adapttable_vue_adapter.RowReorderChrome)({
|
|
169
|
-
...props,
|
|
170
|
-
classNames: { ...names.value },
|
|
171
|
-
slots: naiveReorderControls
|
|
172
|
-
});
|
|
173
|
-
Render.props = [];
|
|
174
|
-
return (_ctx, _cache) => {
|
|
175
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)(Render);
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/row-reorder.ts
|
|
181
|
-
function rowReorder(onRowReorder, options) {
|
|
182
|
-
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.rowReorder)(onRowReorder, options), [(0, _adapttable_vue_adapter.slotRender)((0, _adapttable_vue_adapter.rowReorderControlKey)(), (props) => (0, vue.h)(_sfc_main, { ...props }))]);
|
|
183
|
-
}
|
|
184
|
-
//#endregion
|
|
185
|
-
exports.rowReorder = rowReorder;
|
|
4
|
+
exports.rowReorder = require_row_reorder.rowReorder;
|
|
186
5
|
Object.defineProperty(exports, "useRowReorder", {
|
|
187
6
|
enumerable: true,
|
|
188
7
|
get: function() {
|
|
189
8
|
return _adapttable_vue.useRowReorder;
|
|
190
9
|
}
|
|
191
10
|
});
|
|
192
|
-
|
|
193
|
-
//# sourceMappingURL=row-reorder.cjs.map
|
package/dist/row-reorder.js
CHANGED
|
@@ -1,186 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as naiveSelect } from "./select-Bgc5ttop.js";
|
|
3
|
-
import { t as useNaiveModalEscape } from "./modalEscape-CP6_uqjE.js";
|
|
4
|
-
import { useRowReorder } from "@adapttable/vue";
|
|
5
|
-
import { RowReorderChrome, elementRef, extendFeature, rowReorderControlKey, slotRender, useDataTableClassNames, useScopeActivity } from "@adapttable/vue/adapter";
|
|
6
|
-
import { rowReorder as rowReorder$1 } from "@adapttable/vue/features";
|
|
7
|
-
import { createBlock, defineComponent, h, nextTick, openBlock, shallowRef, useId, watch } from "vue";
|
|
8
|
-
import { NCard, NModal } from "naive-ui";
|
|
9
|
-
//#region src/reorder/NaiveRowMoveMenu.ts
|
|
10
|
-
const NaiveRowMoveMenu = /*#__PURE__*/ defineComponent((props) => {
|
|
11
|
-
const active = useScopeActivity();
|
|
12
|
-
const container = shallowRef(null);
|
|
13
|
-
const trigger = shallowRef(null);
|
|
14
|
-
const card = shallowRef(null);
|
|
15
|
-
const escape = useNaiveModalEscape(() => card.value ? htmlRoot(card.value) : null);
|
|
16
|
-
const descriptionId = useId();
|
|
17
|
-
let revision = 0;
|
|
18
|
-
watch([
|
|
19
|
-
active,
|
|
20
|
-
() => props.items,
|
|
21
|
-
() => props.confirmation
|
|
22
|
-
], () => {
|
|
23
|
-
revision++;
|
|
24
|
-
}, { flush: "sync" });
|
|
25
|
-
const restore = () => {
|
|
26
|
-
nextTick(() => {
|
|
27
|
-
if (active.value && !props.confirmation && trigger.value?.isConnected) trigger.value.focus();
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
return () => {
|
|
31
|
-
const ticket = revision;
|
|
32
|
-
const live = active.value;
|
|
33
|
-
const current = () => live && active.value && ticket === revision;
|
|
34
|
-
const confirmation = props.confirmation;
|
|
35
|
-
const finish = (accept) => {
|
|
36
|
-
if (!current() || !confirmation || props.confirmation !== confirmation) return;
|
|
37
|
-
if (accept) confirmation.onConfirm();
|
|
38
|
-
else confirmation.onCancel();
|
|
39
|
-
restore();
|
|
40
|
-
};
|
|
41
|
-
const content = confirmation ? [
|
|
42
|
-
h("p", { id: descriptionId }, confirmation.description),
|
|
43
|
-
naiveButton({
|
|
44
|
-
"data-adapttable-part": "row-move-cancel",
|
|
45
|
-
onClick: () => finish(false)
|
|
46
|
-
}, confirmation.cancelLabel),
|
|
47
|
-
naiveButton({
|
|
48
|
-
"data-adapttable-part": "row-move-confirm",
|
|
49
|
-
onClick: () => finish(true)
|
|
50
|
-
}, confirmation.confirmLabel)
|
|
51
|
-
] : [];
|
|
52
|
-
return h("span", {
|
|
53
|
-
"data-adapttable-part": "row-move-menu",
|
|
54
|
-
ref: elementRef((element) => {
|
|
55
|
-
container.value = element;
|
|
56
|
-
})
|
|
57
|
-
}, [h("span", { "data-adapttable-part": "row-move-menu-content" }, [naiveSelect({
|
|
58
|
-
attrs: {
|
|
59
|
-
ref: (element) => {
|
|
60
|
-
trigger.value = element;
|
|
61
|
-
},
|
|
62
|
-
"aria-label": props.label,
|
|
63
|
-
placeholder: props.label,
|
|
64
|
-
"data-adapttable-part": "row-move-menu-trigger",
|
|
65
|
-
disabled: props.items.every((item) => item.disabled)
|
|
66
|
-
},
|
|
67
|
-
value: "",
|
|
68
|
-
optionPart: "row-move-menu-item",
|
|
69
|
-
virtualScroll: false,
|
|
70
|
-
options: props.items.map((item) => ({
|
|
71
|
-
value: item.id,
|
|
72
|
-
label: item.label,
|
|
73
|
-
disabled: item.disabled,
|
|
74
|
-
title: item.disabledReason
|
|
75
|
-
})),
|
|
76
|
-
onChange: (key) => {
|
|
77
|
-
if (!current()) return;
|
|
78
|
-
const item = props.items.find((entry) => entry.id === key);
|
|
79
|
-
if (item && !item.disabled) item.onSelect();
|
|
80
|
-
}
|
|
81
|
-
})]), confirmation && container.value ? h(NModal, {
|
|
82
|
-
show: live,
|
|
83
|
-
to: container.value,
|
|
84
|
-
autoFocus: true,
|
|
85
|
-
trapFocus: true,
|
|
86
|
-
maskClosable: false,
|
|
87
|
-
"onUpdate:show": (show) => {
|
|
88
|
-
if (!show && escape.allow()) finish(false);
|
|
89
|
-
}
|
|
90
|
-
}, { default: () => h(NCard, {
|
|
91
|
-
ref: card,
|
|
92
|
-
role: "alertdialog",
|
|
93
|
-
onKeydownCapture: escape.capture,
|
|
94
|
-
"aria-modal": true,
|
|
95
|
-
"aria-label": confirmation.title,
|
|
96
|
-
"aria-describedby": descriptionId,
|
|
97
|
-
"data-adapttable-part": "row-move-confirmation",
|
|
98
|
-
title: confirmation.title,
|
|
99
|
-
style: { width: "min(28rem,calc(100vw - 2rem))" }
|
|
100
|
-
}, { default: () => content }) }) : null]);
|
|
101
|
-
};
|
|
102
|
-
}, {
|
|
103
|
-
name: "NaiveRowMoveMenu",
|
|
104
|
-
props: {
|
|
105
|
-
label: { type: String },
|
|
106
|
-
items: { type: Array },
|
|
107
|
-
confirmation: { type: Object }
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/reorder/naiveReorderControls.ts
|
|
112
|
-
const naiveReorderControls = {
|
|
113
|
-
Handle: ({ label, pressed, dragging, disabled, dragProps, onKeyDown, className }) => naiveButton({
|
|
114
|
-
type: "button",
|
|
115
|
-
"aria-label": label,
|
|
116
|
-
"aria-pressed": pressed,
|
|
117
|
-
"data-dragging": dragging ? "" : void 0,
|
|
118
|
-
"data-adapttable-part": "row-reorder-handle",
|
|
119
|
-
"data-adapttable-grip": "",
|
|
120
|
-
class: className,
|
|
121
|
-
disabled,
|
|
122
|
-
draggable: dragProps.draggable,
|
|
123
|
-
onDragstart: (event) => {
|
|
124
|
-
if (event.dataTransfer) dragProps.onDragStart({
|
|
125
|
-
...event,
|
|
126
|
-
dataTransfer: event.dataTransfer,
|
|
127
|
-
clientY: event.clientY,
|
|
128
|
-
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
129
|
-
preventDefault: () => event.preventDefault()
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
onDragend: dragProps.onDragEnd,
|
|
133
|
-
onKeydown: (event) => onKeyDown({
|
|
134
|
-
key: event.key,
|
|
135
|
-
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
136
|
-
preventDefault: () => event.preventDefault()
|
|
137
|
-
})
|
|
138
|
-
}, "↕"),
|
|
139
|
-
Button: ({ label, part, disabled, onClick, className }) => naiveButton({
|
|
140
|
-
type: "button",
|
|
141
|
-
"aria-label": label,
|
|
142
|
-
"data-adapttable-part": part,
|
|
143
|
-
class: className,
|
|
144
|
-
disabled,
|
|
145
|
-
onClick
|
|
146
|
-
}, label),
|
|
147
|
-
Menu: (props) => h(NaiveRowMoveMenu, props)
|
|
148
|
-
};
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/reorder/NaiveRowReorder.vue
|
|
151
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
152
|
-
__name: "NaiveRowReorder",
|
|
153
|
-
props: {
|
|
154
|
-
model: {},
|
|
155
|
-
labels: {},
|
|
156
|
-
mobile: { type: Boolean },
|
|
157
|
-
classNames: {},
|
|
158
|
-
rowId: {},
|
|
159
|
-
localIndex: {},
|
|
160
|
-
row: {},
|
|
161
|
-
windowStart: {},
|
|
162
|
-
rowCount: {}
|
|
163
|
-
},
|
|
164
|
-
setup(__props) {
|
|
165
|
-
const props = __props;
|
|
166
|
-
const names = useDataTableClassNames();
|
|
167
|
-
const Render = () => RowReorderChrome({
|
|
168
|
-
...props,
|
|
169
|
-
classNames: { ...names.value },
|
|
170
|
-
slots: naiveReorderControls
|
|
171
|
-
});
|
|
172
|
-
Render.props = [];
|
|
173
|
-
return (_ctx, _cache) => {
|
|
174
|
-
return openBlock(), createBlock(Render);
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region src/row-reorder.ts
|
|
180
|
-
function rowReorder(onRowReorder, options) {
|
|
181
|
-
return extendFeature(rowReorder$1(onRowReorder, options), [slotRender(rowReorderControlKey(), (props) => h(_sfc_main, { ...props }))]);
|
|
182
|
-
}
|
|
183
|
-
//#endregion
|
|
1
|
+
import { n as useRowReorder, t as rowReorder } from "./row-reorder-BNYYEL8w.js";
|
|
184
2
|
export { rowReorder, useRowReorder };
|
|
185
|
-
|
|
186
|
-
//# sourceMappingURL=row-reorder.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_button = require("./button-CaakTzYM.cjs");
|
|
2
|
-
const require_input = require("./input-
|
|
2
|
+
const require_input = require("./input-DZV2IoAG.cjs");
|
|
3
3
|
const require_NaiveManagedPopover = require("./NaiveManagedPopover-DhLEXdew.cjs");
|
|
4
4
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
5
5
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
@@ -140,4 +140,4 @@ Object.defineProperty(exports, "savedViews", {
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
-
//# sourceMappingURL=saved-views-
|
|
143
|
+
//# sourceMappingURL=saved-views-DLuxKH_r.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-views-BSZ9y-_E.cjs","names":["h","naiveButton","NTag","naiveInput","managedOverlayPanel","NaiveManagedPopover","NCard","NText","NFlex","h","SavedViewsPanelChrome","extendFeature","bindingSavedViews","slotRender","SAVED_VIEWS_CONTROL","SavedViewsMenuChrome"],"sources":["../src/views/controls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NFlex, NTag, NText } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { NaiveManagedPopover } from \"../columns/NaiveManagedPopover\";\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport type { DataTableClassNames } from \"../types\";\n\ntype Row = Parameters<SavedViewsPanelSlots[\"Row\"]>[0];\nfunction caption(props: Row, names: DataTableClassNames) {\n return h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : naiveButton(\n {\n title: props.applyLabel,\n class: names.viewsItem,\n onClick: props.onApply,\n },\n props.name\n ),\n props.isDefault\n ? h(\n NTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n NTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n );\n}\nfunction controls(props: Row, names: DataTableClassNames) {\n return h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n naiveButton(\n {\n key: control.key,\n class: names.viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n control.icon\n )\n )\n );\n}\nexport const naiveSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => naiveButton(attrs, label),\n Button: ({ attrs, label }) => naiveButton(attrs, label),\n Input: naiveInput,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\nexport function naiveSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n NCard,\n {\n tag: \"section\",\n size: \"small\",\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n {\n header: () =>\n h(\n NText,\n { \"data-adapttable-part\": \"saved-views-title\" },\n { default: () => props.title }\n ),\n default: () => props.children,\n footer: props.footer\n ? () =>\n h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : undefined,\n }\n ),\n Row: (props) =>\n h(\n NFlex,\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n { default: () => [caption(props, names()), controls(props, names())] }\n ),\n Input: (props) =>\n naiveInput({\n value: props.value,\n onChange: props.onChange,\n attrs: {\n ref: props.ref,\n class: names().viewsInput,\n \"aria-label\": props.label,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n props.onCancel();\n }\n },\n },\n }),\n Empty: ({ message }) => h(NText, { depth: 3 }, { default: () => message }),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n naiveSavedViewsMenuSlots,\n naiveSavedViewsPanelSlots,\n} from \"./views/controls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Naive management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = /*#__PURE__*/ defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = naiveSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: naiveSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;AAcA,SAAS,QAAQ,OAAY,OAA4B;CACvD,QAAA,GAAOA,IAAAA,EAAAA,CACL,OACA;EACE,wBAAwB;EACxB,OAAO,MAAM,OAAO;CACtB,GACA;EACE,MAAM,YACF,MAAM,OACNC,eAAAA,YACE;GACE,OAAO,MAAM;GACb,OAAO,MAAM;GACb,SAAS,MAAM;EACjB,GACA,MAAM,IACR;EACJ,MAAM,aAAA,GACFD,IAAAA,EAAAA,CACEE,SAAAA,MACA,EAAE,wBAAwB,qBAAqB,GAC/C,EAAE,eAAe,MAAM,aAAa,CACtC,IACA;EACJ,MAAM,YAAA,GACFF,IAAAA,EAAAA,CACEE,SAAAA,MACA,EAAE,wBAAwB,sBAAsB,GAChD,EAAE,eAAe,MAAM,cAAc,CACvC,IACA;CACN,CACF;AACF;AACA,SAAS,SAAS,OAAY,OAA4B;CACxD,QAAA,GAAOF,IAAAA,EAAAA,CACL,OACA;EACE,wBAAwB;EACxB,OAAO,MAAM,OAAO;CACtB,GACA,MAAM,SAAS,KAAK,YAClBC,eAAAA,YACE;EACE,KAAK,QAAQ;EACb,OAAO,MAAM;EACb,OAAO,Q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,wBAAAA,sBAAsB,WAAA,GAC/BL,IAAAA,EAAAA,CAAEM,wBAAAA,sBAAsB;EAAE,GAAG;EAAO,OAAO;CAAyB,CAAC,CACvE,CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"saved-views-DLuxKH_r.cjs","names":["h","naiveButton","NTag","naiveInput","managedOverlayPanel","NaiveManagedPopover","NCard","NText","NFlex","h","SavedViewsPanelChrome","extendFeature","bindingSavedViews","slotRender","SAVED_VIEWS_CONTROL","SavedViewsMenuChrome"],"sources":["../src/views/controls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NFlex, NTag, NText } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { NaiveManagedPopover } from \"../columns/NaiveManagedPopover\";\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport type { DataTableClassNames } from \"../types\";\n\ntype Row = Parameters<SavedViewsPanelSlots[\"Row\"]>[0];\nfunction caption(props: Row, names: DataTableClassNames) {\n return h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : naiveButton(\n {\n title: props.applyLabel,\n class: names.viewsItem,\n onClick: props.onApply,\n },\n props.name\n ),\n props.isDefault\n ? h(\n NTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n NTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n );\n}\nfunction controls(props: Row, names: DataTableClassNames) {\n return h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n naiveButton(\n {\n key: control.key,\n class: names.viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n control.icon\n )\n )\n );\n}\nexport const naiveSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => naiveButton(attrs, label),\n Button: ({ attrs, label }) => naiveButton(attrs, label),\n Input: naiveInput,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\nexport function naiveSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n NCard,\n {\n tag: \"section\",\n size: \"small\",\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n {\n header: () =>\n h(\n NText,\n { \"data-adapttable-part\": \"saved-views-title\" },\n { default: () => props.title }\n ),\n default: () => props.children,\n footer: props.footer\n ? () =>\n h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : undefined,\n }\n ),\n Row: (props) =>\n h(\n NFlex,\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n { default: () => [caption(props, names()), controls(props, names())] }\n ),\n Input: (props) =>\n naiveInput({\n value: props.value,\n onChange: props.onChange,\n attrs: {\n ref: props.ref,\n class: names().viewsInput,\n \"aria-label\": props.label,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n props.onCancel();\n }\n },\n },\n }),\n Empty: ({ message }) => h(NText, { depth: 3 }, { default: () => message }),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n naiveSavedViewsMenuSlots,\n naiveSavedViewsPanelSlots,\n} from \"./views/controls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Naive management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = /*#__PURE__*/ defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = naiveSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: naiveSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;AAcA,SAAS,QAAQ,OAAY,OAA4B;CACvD,QAAA,GAAOA,IAAAA,EAAAA,CACL,OACA;EACE,wBAAwB;EACxB,OAAO,MAAM,OAAO;CACtB,GACA;EACE,MAAM,YACF,MAAM,OACNC,eAAAA,YACE;GACE,OAAO,MAAM;GACb,OAAO,MAAM;GACb,SAAS,MAAM;EACjB,GACA,MAAM,IACR;EACJ,MAAM,aAAA,GACFD,IAAAA,EAAAA,CACEE,SAAAA,MACA,EAAE,wBAAwB,qBAAqB,GAC/C,EAAE,eAAe,MAAM,aAAa,CACtC,IACA;EACJ,MAAM,YAAA,GACFF,IAAAA,EAAAA,CACEE,SAAAA,MACA,EAAE,wBAAwB,sBAAsB,GAChD,EAAE,eAAe,MAAM,cAAc,CACvC,IACA;CACN,CACF;AACF;AACA,SAAS,SAAS,OAAY,OAA4B;CACxD,QAAA,GAAOF,IAAAA,EAAAA,CACL,OACA;EACE,wBAAwB;EACxB,OAAO,MAAM,OAAO;CACtB,GACA,MAAM,SAAS,KAAK,YAClBC,eAAAA,YACE;EACE,KAAK,QAAQ;EACb,OAAO,MAAM;EACb,OAAO,QAAQ;EACf,cAAc,QAAQ;EACtB,gBAAgB,QAAQ;EACxB,UAAU,CAAC,QAAQ;EACnB,SAAS,QAAQ;EACjB,OAAO,MAAM,OAAO;CACtB,GACA,QAAQ,IACV,CACF,CACF;AACF;AACA,MAAa,2BAAgD;CAC3D,UAAU,EAAE,OAAO,YAAYA,eAAAA,YAAY,OAAO,KAAK;CACvD,SAAS,EAAE,OAAO,YAAYA,eAAAA,YAAY,OAAO,KAAK;CACtD,OAAOE,cAAAA;CACP,QAAA,GAAOC,wBAAAA,oBAAAA,EAAqB,aAAA,GAAYJ,IAAAA,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AAgC,eAAA,GAAA,IAAA,gBAAA,EAC1C,UAAgC;CAC/B,MAAM,QAAQ,gCAAgC,MAAM,cAAc,CAAC,CAAC;CACpE,aAAa;EACX,MAAM,EAAE,YAAY,GAAG,eAAe;EACtC,QAAA,GAAOE,IAAAA,EAAAA,CAAEC,wBAAAA,uBAAuB;GAC9B,GAAG;GACH,WAAW,CAAC,MAAM,WAAW,YAAY,UAAU,CAAC,CACjD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GACX;EACF,CAAC;CACH;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAiD;EAChE,SAAS,EAAE,MAAM,SAAsD;EACvE,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,SAAqD;EACrE,cAAc,EACZ,MAAM,SACR;EACA,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,OAAmD;EACnE,QAAQ;GACN,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAG7C,SAAS,KAAA;EACX;EACA,WAAW,EACT,MAAM,OACR;EACA,YAAY,EACV,MAAM,OACR;CACF;AACF,CACF;;AAGA,SAAgB,WACd,SACoB;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,WAAAA,CAAkB,OAAO,GAAG,EAAA,GAC/CC,wBAAAA,WAAAA,CAAWC,wBAAAA,sBAAsB,WAAA,GAC/BL,IAAAA,EAAAA,CAAEM,wBAAAA,sBAAsB;EAAE,GAAG;EAAO,OAAO;CAAyB,CAAC,CACvE,CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as naiveButton } from "./button-BxXdDW7A.js";
|
|
2
|
-
import { t as naiveInput } from "./input-
|
|
2
|
+
import { t as naiveInput } from "./input-YgQ2d8K9.js";
|
|
3
3
|
import { t as NaiveManagedPopover } from "./NaiveManagedPopover-XhOSQEWC.js";
|
|
4
4
|
import { SAVED_VIEWS_CONTROL, SavedViewsMenuChrome, SavedViewsPanelChrome, extendFeature, managedOverlayPanel, slotRender } from "@adapttable/vue/adapter";
|
|
5
5
|
import { savedViews } from "@adapttable/vue/features";
|
|
@@ -129,4 +129,4 @@ function savedViews$1(options) {
|
|
|
129
129
|
//#endregion
|
|
130
130
|
export { savedViews$1 as n, SavedViewsPanel as t };
|
|
131
131
|
|
|
132
|
-
//# sourceMappingURL=saved-views-
|
|
132
|
+
//# sourceMappingURL=saved-views-hTIhkbu0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-views-
|
|
1
|
+
{"version":3,"file":"saved-views-hTIhkbu0.js","names":["savedViews","bindingSavedViews"],"sources":["../src/views/controls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NFlex, NTag, NText } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { NaiveManagedPopover } from \"../columns/NaiveManagedPopover\";\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport type { DataTableClassNames } from \"../types\";\n\ntype Row = Parameters<SavedViewsPanelSlots[\"Row\"]>[0];\nfunction caption(props: Row, names: DataTableClassNames) {\n return h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : naiveButton(\n {\n title: props.applyLabel,\n class: names.viewsItem,\n onClick: props.onApply,\n },\n props.name\n ),\n props.isDefault\n ? h(\n NTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n NTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n );\n}\nfunction controls(props: Row, names: DataTableClassNames) {\n return h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n naiveButton(\n {\n key: control.key,\n class: names.viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n control.icon\n )\n )\n );\n}\nexport const naiveSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => naiveButton(attrs, label),\n Button: ({ attrs, label }) => naiveButton(attrs, label),\n Input: naiveInput,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\nexport function naiveSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n NCard,\n {\n tag: \"section\",\n size: \"small\",\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n {\n header: () =>\n h(\n NText,\n { \"data-adapttable-part\": \"saved-views-title\" },\n { default: () => props.title }\n ),\n default: () => props.children,\n footer: props.footer\n ? () =>\n h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : undefined,\n }\n ),\n Row: (props) =>\n h(\n NFlex,\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n { default: () => [caption(props, names()), controls(props, names())] }\n ),\n Input: (props) =>\n naiveInput({\n value: props.value,\n onChange: props.onChange,\n attrs: {\n ref: props.ref,\n class: names().viewsInput,\n \"aria-label\": props.label,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n props.onCancel();\n }\n },\n },\n }),\n Empty: ({ message }) => h(NText, { depth: 3 }, { default: () => message }),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n naiveSavedViewsMenuSlots,\n naiveSavedViewsPanelSlots,\n} from \"./views/controls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Naive management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = /*#__PURE__*/ defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = naiveSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: naiveSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;AAcA,SAAS,QAAQ,OAAY,OAA4B;CACvD,OAAO,EACL,OACA;EACE,wBAAwB;EACxB,OAAO,MAAM,OAAO;CACtB,GACA;EACE,MAAM,YACF,MAAM,OACN,YACE;GACE,OAAO,MAAM;GACb,OAAO,MAAM;GACb,SAAS,MAAM;EACjB,GACA,MAAM,IACR;EACJ,MAAM,YACF,EACE,MACA,EAAE,wBAAwB,qBAAqB,GAC/C,EAAE,eAAe,MAAM,aAAa,CACtC,IACA;EACJ,MAAM,WACF,EACE,MACA,EAAE,wBAAwB,sBAAsB,GAChD,EAAE,eAAe,MAAM,cAAc,CACvC,IACA;CACN,CACF;AACF;AACA,SAAS,SAAS,OAAY,OAA4B;CACxD,OAAO,EACL,OACA;EACE,wBAAwB;EACxB,OAAO,MAAM,OAAO;CACtB,GACA,MAAM,SAAS,KAAK,YAClB,YACE;EACE,KAAK,QAAQ;EACb,OAAO,MAAM;EACb,OAAO,QAAQ;EACf,cAAc,QAAQ;EACtB,gBAAgB,QAAQ;EACxB,UAAU,CAAC,QAAQ;EACnB,SAAS,QAAQ;EACjB,OAAO,MAAM,OAAO;CACtB,GACA,QAAQ,IACV,CACF,CACF;AACF;AACA,MAAa,2BAAgD;CAC3D,UAAU,EAAE,OAAO,YAAY,YAAY,OAAO,KAAK;CACvD,SAAS,EAAE,OAAO,YAAY,YAAY,OAAO,KAAK;CACtD,OAAO;CACP,OAAO,qBAAqB,YAAY,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAC7E;AACA,SAAgB,0BACd,OACsB;CACt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GAAG;GACX;EACF,CAAC;CACH;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAiD;EAChE,SAAS,EAAE,MAAM,SAAsD;EACvE,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,SAAqD;EACrE,cAAc,EACZ,MAAM,SACR;EACA,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,OAAmD;EACnE,QAAQ;GACN,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAG7C,SAAS,KAAA;EACX;EACA,WAAW,EACT,MAAM,OACR;EACA,YAAY,EACV,MAAM,OACR;CACF;AACF,CACF;;AAGA,SAAgBA,aACd,SACoB;CACpB,OAAO,cAAcC,WAAkB,OAAO,GAAG,CAC/C,WAAW,sBAAsB,UAC/B,EAAE,sBAAsB;EAAE,GAAG;EAAO,OAAO;CAAyB,CAAC,CACvE,CACF,CAAC;AACH"}
|
package/dist/saved-views.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_saved_views = require("./saved-views-
|
|
2
|
+
const require_saved_views = require("./saved-views-DLuxKH_r.cjs");
|
|
3
3
|
exports.SavedViewsPanel = require_saved_views.SavedViewsPanel;
|
|
4
4
|
exports.savedViews = require_saved_views.savedViews;
|
package/dist/saved-views.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as savedViews, t as SavedViewsPanel } from "./saved-views-
|
|
1
|
+
import { n as savedViews, t as SavedViewsPanel } from "./saved-views-hTIhkbu0.js";
|
|
2
2
|
export { SavedViewsPanel, savedViews };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const require_button = require("./button-CaakTzYM.cjs");
|
|
2
|
+
require("@adapttable/vue");
|
|
3
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
4
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
5
|
+
let vue = require("vue");
|
|
6
|
+
let naive_ui = require("naive-ui");
|
|
7
|
+
//#region src/actions/sidePanelControls.ts
|
|
8
|
+
const naiveSidePanelSlots = (names = {}) => ({
|
|
9
|
+
Frame: (props) => (0, vue.h)(naive_ui.NCard, {
|
|
10
|
+
tag: "aside",
|
|
11
|
+
size: "small",
|
|
12
|
+
"data-adapttable-part": "side-panel",
|
|
13
|
+
class: props.className,
|
|
14
|
+
"data-side": props.side,
|
|
15
|
+
style: {
|
|
16
|
+
minWidth: "min(18rem,100%)",
|
|
17
|
+
maxWidth: "100%"
|
|
18
|
+
}
|
|
19
|
+
}, { default: () => props.children }),
|
|
20
|
+
Tab: (props) => require_button.naiveButton({
|
|
21
|
+
...(0, _adapttable_vue_adapter.toVueAttrs)(props.buttonProps),
|
|
22
|
+
class: names.sidePanelTab
|
|
23
|
+
}, props.panel.label),
|
|
24
|
+
Close: (props) => require_button.naiveButton({
|
|
25
|
+
"aria-label": props.label,
|
|
26
|
+
"data-adapttable-part": "side-panel-close",
|
|
27
|
+
class: names.sidePanelClose,
|
|
28
|
+
onClick: props.onClose
|
|
29
|
+
}, props.label)
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/side-panel.ts
|
|
33
|
+
const NaiveSidePanel = /*#__PURE__*/ (0, vue.defineComponent)((props) => {
|
|
34
|
+
const slots = {
|
|
35
|
+
Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),
|
|
36
|
+
Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),
|
|
37
|
+
Close: (control) => naiveSidePanelSlots(props.classNames).Close(control)
|
|
38
|
+
};
|
|
39
|
+
return () => (0, vue.h)(_adapttable_vue_adapter.SidePanelChrome, {
|
|
40
|
+
...props,
|
|
41
|
+
slots
|
|
42
|
+
});
|
|
43
|
+
}, {
|
|
44
|
+
name: "NaiveSidePanel",
|
|
45
|
+
props: {
|
|
46
|
+
model: { type: Object },
|
|
47
|
+
labels: { type: Object },
|
|
48
|
+
dir: { type: String },
|
|
49
|
+
classNames: { type: Object },
|
|
50
|
+
container: { type: Object }
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
function sidePanel(options) {
|
|
54
|
+
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.sidePanel)(options), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.SIDE_PANEL_CONTROL, (props) => (0, vue.h)(NaiveSidePanel, { ...props }))]);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
Object.defineProperty(exports, "sidePanel", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function() {
|
|
60
|
+
return sidePanel;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=side-panel-Bf4zBlYZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-Bf4zBlYZ.cjs","names":["h","NCard","naiveButton","toVueAttrs","h","SidePanelChrome","extendFeature","bindingSidePanel","slotRender","SIDE_PANEL_CONTROL"],"sources":["../src/actions/sidePanelControls.ts","../src/side-panel.ts"],"sourcesContent":["import { type SidePanelSlots, toVueAttrs } from \"@adapttable/vue/adapter\";\nimport { NCard } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport const naiveSidePanelSlots = (\n names: Readonly<Record<string, string | undefined>> = {}\n): SidePanelSlots => ({\n Frame: (props) =>\n h(\n NCard,\n {\n tag: \"aside\",\n size: \"small\",\n \"data-adapttable-part\": \"side-panel\",\n class: props.className,\n \"data-side\": props.side,\n style: { minWidth: \"min(18rem,100%)\", maxWidth: \"100%\" },\n },\n { default: () => props.children }\n ),\n Tab: (props) =>\n naiveButton(\n { ...toVueAttrs(props.buttonProps), class: names.sidePanelTab },\n props.panel.label\n ),\n Close: (props) =>\n naiveButton(\n {\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"side-panel-close\",\n class: names.sidePanelClose,\n onClick: props.onClose,\n },\n props.label\n ),\n});\n","import { type StaticTableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SIDE_PANEL_CONTROL,\n SidePanelChrome,\n type SidePanelChromeProps,\n type SidePanelSlots,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { sidePanel as bindingSidePanel } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { naiveSidePanelSlots } from \"./actions/sidePanelControls\";\nconst NaiveSidePanel = /*#__PURE__*/ defineComponent(\n (props: Omit<SidePanelChromeProps, \"slots\" | \"presentation\">) => {\n const slots: SidePanelSlots = {\n Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),\n Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),\n Close: (control) => naiveSidePanelSlots(props.classNames).Close(control),\n };\n return () => h(SidePanelChrome, { ...props, slots });\n },\n {\n name: \"NaiveSidePanel\",\n props: {\n model: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"dir\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"classNames\"]\n >,\n },\n container: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"container\"]\n >,\n },\n },\n }\n);\nexport function sidePanel(\n options: Parameters<typeof bindingSidePanel>[0]\n): StaticTableFeature {\n return extendFeature(bindingSidePanel(options), [\n slotRender(SIDE_PANEL_CONTROL, (props) => h(NaiveSidePanel, { ...props })),\n ]);\n}\nexport type {\n SidePanelOptions,\n SidePanelPanel,\n} from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;AAMA,MAAa,uBACX,QAAsD,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,EAAE,GAAG,MAAM,CAAC,CAAC,CAC3E,CAAC;AACH"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as naiveButton } from "./button-BxXdDW7A.js";
|
|
2
|
+
import "@adapttable/vue";
|
|
3
|
+
import { SIDE_PANEL_CONTROL, SidePanelChrome, extendFeature, slotRender, toVueAttrs } from "@adapttable/vue/adapter";
|
|
4
|
+
import { sidePanel } from "@adapttable/vue/features";
|
|
5
|
+
import { defineComponent, h } from "vue";
|
|
6
|
+
import { NCard } from "naive-ui";
|
|
7
|
+
//#region src/actions/sidePanelControls.ts
|
|
8
|
+
const naiveSidePanelSlots = (names = {}) => ({
|
|
9
|
+
Frame: (props) => h(NCard, {
|
|
10
|
+
tag: "aside",
|
|
11
|
+
size: "small",
|
|
12
|
+
"data-adapttable-part": "side-panel",
|
|
13
|
+
class: props.className,
|
|
14
|
+
"data-side": props.side,
|
|
15
|
+
style: {
|
|
16
|
+
minWidth: "min(18rem,100%)",
|
|
17
|
+
maxWidth: "100%"
|
|
18
|
+
}
|
|
19
|
+
}, { default: () => props.children }),
|
|
20
|
+
Tab: (props) => naiveButton({
|
|
21
|
+
...toVueAttrs(props.buttonProps),
|
|
22
|
+
class: names.sidePanelTab
|
|
23
|
+
}, props.panel.label),
|
|
24
|
+
Close: (props) => naiveButton({
|
|
25
|
+
"aria-label": props.label,
|
|
26
|
+
"data-adapttable-part": "side-panel-close",
|
|
27
|
+
class: names.sidePanelClose,
|
|
28
|
+
onClick: props.onClose
|
|
29
|
+
}, props.label)
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/side-panel.ts
|
|
33
|
+
const NaiveSidePanel = /*#__PURE__*/ defineComponent((props) => {
|
|
34
|
+
const slots = {
|
|
35
|
+
Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),
|
|
36
|
+
Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),
|
|
37
|
+
Close: (control) => naiveSidePanelSlots(props.classNames).Close(control)
|
|
38
|
+
};
|
|
39
|
+
return () => h(SidePanelChrome, {
|
|
40
|
+
...props,
|
|
41
|
+
slots
|
|
42
|
+
});
|
|
43
|
+
}, {
|
|
44
|
+
name: "NaiveSidePanel",
|
|
45
|
+
props: {
|
|
46
|
+
model: { type: Object },
|
|
47
|
+
labels: { type: Object },
|
|
48
|
+
dir: { type: String },
|
|
49
|
+
classNames: { type: Object },
|
|
50
|
+
container: { type: Object }
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
function sidePanel$1(options) {
|
|
54
|
+
return extendFeature(sidePanel(options), [slotRender(SIDE_PANEL_CONTROL, (props) => h(NaiveSidePanel, { ...props }))]);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { sidePanel$1 as t };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=side-panel-CLTgXUnb.js.map
|