@affino/datagrid-vue-app 0.1.18 → 0.1.20
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 +40 -0
- package/dist/DataGrid.d.ts +20 -0
- package/dist/DataGridTableStage.vue.d.ts +9 -0
- package/dist/advanced-filter.js +1 -1
- package/dist/advancedFilterDraftClauses.d.ts +6 -0
- package/dist/chunks/{DataGridAdvancedFilterPopover-CabJ-Ztk.js → DataGridAdvancedFilterPopover-CRd9hbEZ.js} +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-x-cfVm5j.js → DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DhdOikY0.js} +10 -8
- package/dist/chunks/{DataGridAggregationsPopover-DfQ3-UV4.js → DataGridAggregationsPopover-Bu7nZX7u.js} +6 -4
- package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-BPU8WkWd.js +373 -0
- package/dist/chunks/DataGridFindReplacePopover-DCuFy-bD.js +4 -0
- package/dist/chunks/DataGridFindReplacePopover.vue_vue_type_script_setup_true_lang-DfHFHhUf.js +171 -0
- package/dist/chunks/DataGridGanttStageEntry-BbSAXYrL.js +8404 -0
- package/dist/chunks/dataGridOverlayThemeVars-vzY74EIz.js +33 -0
- package/dist/chunks/useDataGridAppRowModel-Cq1nWBYl.js +3498 -0
- package/dist/config/dataGridFindReplace.d.ts +9 -0
- package/dist/config/dataGridGridLines.d.ts +16 -0
- package/dist/dataGridGridLines.d.ts +1 -0
- package/dist/find-replace.d.ts +2 -0
- package/dist/find-replace.js +4 -0
- package/dist/gantt.js +1 -1
- package/dist/gestures/dataGridTouchPanGuard.d.ts +13 -0
- package/dist/host/DataGridDefaultRenderer.d.ts +29 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +437 -366
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +19 -17
- package/dist/overlays/DataGridFindReplacePopover.vue.d.ts +74 -0
- package/dist/stage/DataGridTableStage.vue.d.ts +9 -0
- package/dist/stage/dataGridTableStage.types.d.ts +3 -0
- package/dist/stage/useDataGridTableStageCellIo.d.ts +1 -0
- package/dist/stage/useDataGridTableStageHistory.d.ts +3 -1
- package/dist/stage/useDataGridTableStageRuntime.d.ts +17 -2
- package/dist/stage/useDataGridTableStageScrollSync.d.ts +1 -1
- package/dist/useDataGridAppFindReplace.d.ts +54 -0
- package/package.json +7 -3
- package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-_1TDQseN.js +0 -399
- package/dist/chunks/DataGridGanttStageEntry-CS2wpBnj.js +0 -7815
- package/dist/chunks/useDataGridAppRowModel-RrE_k6tK.js +0 -3008
package/dist/chunks/DataGridFindReplacePopover.vue_vue_type_script_setup_true_lang-DfHFHhUf.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { defineComponent as O, inject as P, ref as _, computed as r, watch as p, nextTick as g, openBlock as u, createElementBlock as v, Fragment as B, createElementVNode as e, mergeProps as m, unref as b, toDisplayString as y, createBlock as S, Teleport as $, withKeys as E, withModifiers as I, createCommentVNode as K } from "vue";
|
|
2
|
+
import { usePopoverController as V, useFloatingPopover as A } from "@affino/popover-vue";
|
|
3
|
+
import { d as D, r as G } from "./dataGridOverlayThemeVars-vzY74EIz.js";
|
|
4
|
+
const L = { class: "datagrid-find-replace__header" }, M = /* @__PURE__ */ e("div", null, [
|
|
5
|
+
/* @__PURE__ */ e("div", { class: "datagrid-find-replace__eyebrow" }, "Find / replace"),
|
|
6
|
+
/* @__PURE__ */ e("h3", { class: "datagrid-find-replace__title" }, "Search visible cells and apply batched edits")
|
|
7
|
+
], -1), N = { class: "datagrid-find-replace__grid" }, j = { class: "datagrid-find-replace__field" }, q = /* @__PURE__ */ e("span", { class: "datagrid-find-replace__label" }, "Find", -1), z = ["value", "onKeydown"], U = { class: "datagrid-find-replace__field" }, H = /* @__PURE__ */ e("span", { class: "datagrid-find-replace__label" }, "Replace", -1), J = ["value"], Q = { class: "datagrid-find-replace__toggle" }, W = ["checked"], X = /* @__PURE__ */ e("span", null, "Match case", -1), Y = ["data-has-message"], Z = { class: "datagrid-find-replace__footer" }, ee = { class: "datagrid-find-replace__footer-actions" }, te = ["disabled"], ae = ["disabled"], ne = { class: "datagrid-find-replace__footer-actions" }, oe = ["disabled"], le = ["disabled"], ie = /* @__PURE__ */ O({
|
|
8
|
+
__name: "DataGridFindReplacePopover",
|
|
9
|
+
props: {
|
|
10
|
+
isOpen: { type: Boolean },
|
|
11
|
+
findText: {},
|
|
12
|
+
replaceText: {},
|
|
13
|
+
matchCase: { type: Boolean },
|
|
14
|
+
statusText: { default: "" },
|
|
15
|
+
buttonLabel: { default: "Find / replace" },
|
|
16
|
+
active: { type: Boolean, default: !1 },
|
|
17
|
+
canFind: { type: Boolean, default: !1 },
|
|
18
|
+
canReplaceCurrent: { type: Boolean, default: !1 },
|
|
19
|
+
canReplaceAll: { type: Boolean, default: !1 }
|
|
20
|
+
},
|
|
21
|
+
emits: ["open", "cancel", "update-find-text", "update-replace-text", "update-match-case", "find-next", "find-previous", "replace-current", "replace-all"],
|
|
22
|
+
setup(h, { emit: T }) {
|
|
23
|
+
const s = h, n = T, f = P(D, _(null)), i = _({}), o = V(
|
|
24
|
+
{
|
|
25
|
+
id: "find-replace",
|
|
26
|
+
role: "dialog",
|
|
27
|
+
closeOnEscape: !0,
|
|
28
|
+
// Excel-style find/replace should stay open while the grid selection moves.
|
|
29
|
+
closeOnInteractOutside: !1
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
onOpen: () => {
|
|
33
|
+
s.isOpen || n("open"), c();
|
|
34
|
+
},
|
|
35
|
+
onClose: () => {
|
|
36
|
+
s.isOpen && n("cancel");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
), d = A(o, {
|
|
40
|
+
placement: "bottom",
|
|
41
|
+
align: "start",
|
|
42
|
+
gutter: 10,
|
|
43
|
+
viewportPadding: 12,
|
|
44
|
+
zIndex: 180,
|
|
45
|
+
lockScroll: !1,
|
|
46
|
+
returnFocus: !0
|
|
47
|
+
}), C = r(() => o.getTriggerProps({ role: "dialog" })), x = r(() => o.getContentProps({ role: "dialog", tabIndex: -1 })), F = r(() => o.state.value.open), k = r(() => d.contentStyle.value), R = r(() => d.teleportTarget.value);
|
|
48
|
+
p(
|
|
49
|
+
() => s.isOpen,
|
|
50
|
+
async (a) => {
|
|
51
|
+
if (a) {
|
|
52
|
+
c(), o.state.value.open || o.open("programmatic"), await g(), d.contentRef.value?.querySelector('[data-find-replace-autofocus="true"]')?.focus({ preventScroll: !0 }), await d.updatePosition();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
o.state.value.open && o.close("programmatic");
|
|
56
|
+
},
|
|
57
|
+
{ immediate: !0 }
|
|
58
|
+
), p(f, () => {
|
|
59
|
+
o.state.value.open && c();
|
|
60
|
+
}), p(
|
|
61
|
+
() => `${s.findText}:${s.replaceText}:${s.statusText}:${s.matchCase ? "1" : "0"}`,
|
|
62
|
+
async () => {
|
|
63
|
+
o.state.value.open && (await g(), await d.updatePosition());
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
function c() {
|
|
67
|
+
i.value = G(f.value);
|
|
68
|
+
}
|
|
69
|
+
function w(a) {
|
|
70
|
+
if (a.shiftKey) {
|
|
71
|
+
n("find-previous");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
n("find-next");
|
|
75
|
+
}
|
|
76
|
+
return (a, t) => (u(), v(B, null, [
|
|
77
|
+
e("button", m({
|
|
78
|
+
ref: b(d).triggerRef,
|
|
79
|
+
type: "button",
|
|
80
|
+
class: ["datagrid-app-toolbar__button", { "datagrid-app-toolbar__button--active": a.active }],
|
|
81
|
+
"data-datagrid-toolbar-action": "find-replace",
|
|
82
|
+
style: i.value
|
|
83
|
+
}, C.value), y(a.buttonLabel), 17),
|
|
84
|
+
(u(), S($, { to: R.value }, [
|
|
85
|
+
F.value ? (u(), v("section", m({
|
|
86
|
+
key: 0,
|
|
87
|
+
ref: b(d).contentRef,
|
|
88
|
+
class: "datagrid-find-replace",
|
|
89
|
+
"data-datagrid-overlay-surface": "true",
|
|
90
|
+
style: [k.value, i.value]
|
|
91
|
+
}, x.value), [
|
|
92
|
+
e("header", L, [
|
|
93
|
+
M,
|
|
94
|
+
e("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
class: "datagrid-find-replace__ghost",
|
|
97
|
+
onClick: t[0] || (t[0] = (l) => n("cancel"))
|
|
98
|
+
}, " Close ")
|
|
99
|
+
]),
|
|
100
|
+
e("div", N, [
|
|
101
|
+
e("label", j, [
|
|
102
|
+
q,
|
|
103
|
+
e("input", {
|
|
104
|
+
"data-find-replace-autofocus": "true",
|
|
105
|
+
value: a.findText,
|
|
106
|
+
type: "text",
|
|
107
|
+
placeholder: "Search text",
|
|
108
|
+
onInput: t[1] || (t[1] = (l) => n("update-find-text", l.target.value)),
|
|
109
|
+
onKeydown: E(I(w, ["prevent"]), ["enter"])
|
|
110
|
+
}, null, 40, z)
|
|
111
|
+
]),
|
|
112
|
+
e("label", U, [
|
|
113
|
+
H,
|
|
114
|
+
e("input", {
|
|
115
|
+
value: a.replaceText,
|
|
116
|
+
type: "text",
|
|
117
|
+
placeholder: "Replacement",
|
|
118
|
+
onInput: t[2] || (t[2] = (l) => n("update-replace-text", l.target.value))
|
|
119
|
+
}, null, 40, J)
|
|
120
|
+
])
|
|
121
|
+
]),
|
|
122
|
+
e("label", Q, [
|
|
123
|
+
e("input", {
|
|
124
|
+
checked: a.matchCase,
|
|
125
|
+
type: "checkbox",
|
|
126
|
+
onChange: t[3] || (t[3] = (l) => n("update-match-case", l.target.checked))
|
|
127
|
+
}, null, 40, W),
|
|
128
|
+
X
|
|
129
|
+
]),
|
|
130
|
+
e("div", {
|
|
131
|
+
class: "datagrid-find-replace__status",
|
|
132
|
+
"data-has-message": a.statusText.length > 0 ? "true" : "false"
|
|
133
|
+
}, y(a.statusText || "Use Enter for Find next and Shift+Enter for Find previous."), 9, Y),
|
|
134
|
+
e("footer", Z, [
|
|
135
|
+
e("div", ee, [
|
|
136
|
+
e("button", {
|
|
137
|
+
type: "button",
|
|
138
|
+
class: "datagrid-find-replace__secondary",
|
|
139
|
+
disabled: !a.canFind,
|
|
140
|
+
onClick: t[4] || (t[4] = (l) => n("find-previous"))
|
|
141
|
+
}, " Find previous ", 8, te),
|
|
142
|
+
e("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
class: "datagrid-find-replace__secondary",
|
|
145
|
+
disabled: !a.canFind,
|
|
146
|
+
onClick: t[5] || (t[5] = (l) => n("find-next"))
|
|
147
|
+
}, " Find next ", 8, ae)
|
|
148
|
+
]),
|
|
149
|
+
e("div", ne, [
|
|
150
|
+
e("button", {
|
|
151
|
+
type: "button",
|
|
152
|
+
class: "datagrid-find-replace__secondary",
|
|
153
|
+
disabled: !a.canReplaceCurrent,
|
|
154
|
+
onClick: t[6] || (t[6] = (l) => n("replace-current"))
|
|
155
|
+
}, " Replace ", 8, oe),
|
|
156
|
+
e("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
class: "datagrid-find-replace__primary",
|
|
159
|
+
disabled: !a.canReplaceAll,
|
|
160
|
+
onClick: t[7] || (t[7] = (l) => n("replace-all"))
|
|
161
|
+
}, " Replace all ", 8, le)
|
|
162
|
+
])
|
|
163
|
+
])
|
|
164
|
+
], 16)) : K("", !0)
|
|
165
|
+
], 8, ["to"]))
|
|
166
|
+
], 64));
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
export {
|
|
170
|
+
ie as _
|
|
171
|
+
};
|