@gurpreetmahi/easy.ui 0.2.0 → 0.2.1
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/index.cjs +1 -6
- package/dist/index.js +484 -678
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,436 +1,242 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}), d = /* @__PURE__ */ l(((e) => {
|
|
8
|
-
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
9
|
-
function r(e, n, r) {
|
|
10
|
-
var i = null;
|
|
11
|
-
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
12
|
-
else r = n;
|
|
13
|
-
return n = r.ref, {
|
|
14
|
-
$$typeof: t,
|
|
15
|
-
type: e,
|
|
16
|
-
key: i,
|
|
17
|
-
ref: n === void 0 ? null : n,
|
|
18
|
-
props: r
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
22
|
-
})), f = /* @__PURE__ */ l(((e) => {
|
|
23
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
24
|
-
function t(e) {
|
|
25
|
-
if (e == null) return null;
|
|
26
|
-
if (typeof e == "function") return e.$$typeof === A ? null : e.displayName || e.name || null;
|
|
27
|
-
if (typeof e == "string") return e;
|
|
28
|
-
switch (e) {
|
|
29
|
-
case v: return "Fragment";
|
|
30
|
-
case b: return "Profiler";
|
|
31
|
-
case y: return "StrictMode";
|
|
32
|
-
case w: return "Suspense";
|
|
33
|
-
case T: return "SuspenseList";
|
|
34
|
-
case O: return "Activity";
|
|
35
|
-
case k: return "ViewTransition";
|
|
36
|
-
}
|
|
37
|
-
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
38
|
-
case _: return "Portal";
|
|
39
|
-
case S: return e.displayName || "Context";
|
|
40
|
-
case x: return (e._context.displayName || "Context") + ".Consumer";
|
|
41
|
-
case C:
|
|
42
|
-
var n = e.render;
|
|
43
|
-
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
44
|
-
case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
45
|
-
case D:
|
|
46
|
-
n = e._payload, e = e._init;
|
|
47
|
-
try {
|
|
48
|
-
return t(e(n));
|
|
49
|
-
} catch {}
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
function n(e) {
|
|
54
|
-
return "" + e;
|
|
55
|
-
}
|
|
56
|
-
function r(e) {
|
|
57
|
-
try {
|
|
58
|
-
n(e);
|
|
59
|
-
var t = !1;
|
|
60
|
-
} catch {
|
|
61
|
-
t = !0;
|
|
62
|
-
}
|
|
63
|
-
if (t) {
|
|
64
|
-
t = console;
|
|
65
|
-
var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
66
|
-
return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function i(e) {
|
|
70
|
-
if (e === v) return "<>";
|
|
71
|
-
if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
|
|
72
|
-
try {
|
|
73
|
-
var n = t(e);
|
|
74
|
-
return n ? "<" + n + ">" : "<...>";
|
|
75
|
-
} catch {
|
|
76
|
-
return "<...>";
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function a() {
|
|
80
|
-
var e = j.A;
|
|
81
|
-
return e === null ? null : e.getOwner();
|
|
82
|
-
}
|
|
83
|
-
function o() {
|
|
84
|
-
return Error("react-stack-top-frame");
|
|
85
|
-
}
|
|
86
|
-
function s(e) {
|
|
87
|
-
if (M.call(e, "key")) {
|
|
88
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
89
|
-
if (t && t.isReactWarning) return !1;
|
|
90
|
-
}
|
|
91
|
-
return e.key !== void 0;
|
|
92
|
-
}
|
|
93
|
-
function c(e, t) {
|
|
94
|
-
function n() {
|
|
95
|
-
F || (F = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
96
|
-
}
|
|
97
|
-
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
98
|
-
get: n,
|
|
99
|
-
configurable: !0
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function l() {
|
|
103
|
-
var e = t(this.type);
|
|
104
|
-
return I[e] || (I[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
105
|
-
}
|
|
106
|
-
function d(e, t, n, r, i, a) {
|
|
107
|
-
var o = n.ref;
|
|
108
|
-
return e = {
|
|
109
|
-
$$typeof: g,
|
|
110
|
-
type: e,
|
|
111
|
-
key: t,
|
|
112
|
-
props: n,
|
|
113
|
-
_owner: r
|
|
114
|
-
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
115
|
-
enumerable: !1,
|
|
116
|
-
value: null
|
|
117
|
-
}) : Object.defineProperty(e, "ref", {
|
|
118
|
-
enumerable: !1,
|
|
119
|
-
get: l
|
|
120
|
-
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
121
|
-
configurable: !1,
|
|
122
|
-
enumerable: !1,
|
|
123
|
-
writable: !0,
|
|
124
|
-
value: 0
|
|
125
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
126
|
-
configurable: !1,
|
|
127
|
-
enumerable: !1,
|
|
128
|
-
writable: !0,
|
|
129
|
-
value: null
|
|
130
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
131
|
-
configurable: !1,
|
|
132
|
-
enumerable: !1,
|
|
133
|
-
writable: !0,
|
|
134
|
-
value: i
|
|
135
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
136
|
-
configurable: !1,
|
|
137
|
-
enumerable: !1,
|
|
138
|
-
writable: !0,
|
|
139
|
-
value: a
|
|
140
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
141
|
-
}
|
|
142
|
-
function f(e, n, i, o, l, u) {
|
|
143
|
-
var f = n.children;
|
|
144
|
-
if (f !== void 0) {
|
|
145
|
-
if (o) {
|
|
146
|
-
if (N(f)) {
|
|
147
|
-
for (o = 0; o < f.length; o++) p(f[o]);
|
|
148
|
-
Object.freeze && Object.freeze(f);
|
|
149
|
-
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
150
|
-
} else p(f);
|
|
151
|
-
}
|
|
152
|
-
if (M.call(n, "key")) {
|
|
153
|
-
f = t(e);
|
|
154
|
-
var m = Object.keys(n).filter(function(e) {
|
|
155
|
-
return e !== "key";
|
|
156
|
-
});
|
|
157
|
-
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", z[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), z[f + o] = !0);
|
|
158
|
-
}
|
|
159
|
-
if (f = null, i !== void 0 && (r(i), f = "" + i), s(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
160
|
-
else i = n;
|
|
161
|
-
return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(), l, u);
|
|
162
|
-
}
|
|
163
|
-
function p(e) {
|
|
164
|
-
m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
165
|
-
}
|
|
166
|
-
function m(e) {
|
|
167
|
-
return typeof e == "object" && !!e && e.$$typeof === g;
|
|
168
|
-
}
|
|
169
|
-
var h = u("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.view_transition"), A = Symbol.for("react.client.reference"), j = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, N = Array.isArray, P = console.createTask ? console.createTask : function() {
|
|
170
|
-
return null;
|
|
171
|
-
};
|
|
172
|
-
h = { react_stack_bottom_frame: function(e) {
|
|
173
|
-
return e();
|
|
174
|
-
} };
|
|
175
|
-
var F, I = {}, L = h.react_stack_bottom_frame.bind(h, o)(), R = P(i(o)), z = {};
|
|
176
|
-
e.Fragment = v, e.jsx = function(e, t, n) {
|
|
177
|
-
var r = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
178
|
-
if (r) {
|
|
179
|
-
var a = Error.stackTraceLimit;
|
|
180
|
-
Error.stackTraceLimit = 10;
|
|
181
|
-
var o = Error("react-stack-top-frame");
|
|
182
|
-
Error.stackTraceLimit = a;
|
|
183
|
-
} else o = L;
|
|
184
|
-
return f(e, t, n, !1, o, r ? P(i(e)) : R);
|
|
185
|
-
}, e.jsxs = function(e, t, n) {
|
|
186
|
-
var r = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
187
|
-
if (r) {
|
|
188
|
-
var a = Error.stackTraceLimit;
|
|
189
|
-
Error.stackTraceLimit = 10;
|
|
190
|
-
var o = Error("react-stack-top-frame");
|
|
191
|
-
Error.stackTraceLimit = a;
|
|
192
|
-
} else o = L;
|
|
193
|
-
return f(e, t, n, !0, o, r ? P(i(e)) : R);
|
|
194
|
-
};
|
|
195
|
-
})();
|
|
196
|
-
})), p = (/* @__PURE__ */ l(((e, t) => {
|
|
197
|
-
t.exports = process.env.NODE_ENV === "production" ? d() : f();
|
|
198
|
-
})))();
|
|
199
|
-
function m({ label: e, icon: t, size: n = "regular", className: r, ...i }) {
|
|
200
|
-
return /* @__PURE__ */ (0, p.jsxs)("button", {
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as r, useCallback as i, useContext as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
3
|
+
import { createPortal as d } from "react-dom";
|
|
4
|
+
// src/ribbon/RibbonButton.tsx
|
|
5
|
+
function f({ label: e, icon: r, size: i = "regular", className: a, ...o }) {
|
|
6
|
+
return /* @__PURE__ */ n("button", {
|
|
201
7
|
type: "button",
|
|
202
8
|
className: [
|
|
203
9
|
"ribbon-button",
|
|
204
|
-
`ribbon-button--${
|
|
205
|
-
|
|
10
|
+
`ribbon-button--${i}`,
|
|
11
|
+
a
|
|
206
12
|
].filter(Boolean).join(" "),
|
|
207
|
-
...
|
|
208
|
-
children: [
|
|
13
|
+
...o,
|
|
14
|
+
children: [r ? /* @__PURE__ */ t("span", {
|
|
209
15
|
className: "ribbon-button__icon",
|
|
210
16
|
"aria-hidden": "true",
|
|
211
|
-
children:
|
|
212
|
-
}) : null, /* @__PURE__ */ (
|
|
17
|
+
children: r
|
|
18
|
+
}) : null, /* @__PURE__ */ t("span", {
|
|
213
19
|
className: "ribbon-button__label",
|
|
214
20
|
children: e
|
|
215
21
|
})]
|
|
216
22
|
});
|
|
217
23
|
}
|
|
218
24
|
// src/ribbon/RibbonCarousel.tsx
|
|
219
|
-
function
|
|
220
|
-
let
|
|
221
|
-
parentId:
|
|
25
|
+
function p({ parents: e, activeParentId: r, defaultParentId: i, visibleItems: a = 3, onParentChange: o, onItemClick: s }) {
|
|
26
|
+
let c = Math.max(1, Math.floor(a)), l = e.filter((e) => !e.disabled), d = e.find((e) => !e.disabled), p = e.some((e) => e.id === i && !e.disabled) ? i : d?.id, [m, h] = u(p), [g, _] = u({
|
|
27
|
+
parentId: p,
|
|
222
28
|
index: 0
|
|
223
|
-
}),
|
|
224
|
-
function
|
|
225
|
-
|
|
29
|
+
}), v = r ?? m, y = e.find((e) => e.id === v && !e.disabled) ?? d, b = l.findIndex((e) => e.id === y?.id), x = l.length > 1, S = y?.children ?? [], C = Math.max(1, Math.ceil(S.length / c)), w = g.parentId === y?.id ? Math.min(g.index, C - 1) : 0, T = S.slice(w * c, (w + 1) * c);
|
|
30
|
+
function E(e) {
|
|
31
|
+
r === void 0 && h(e.id), _({
|
|
226
32
|
parentId: e.id,
|
|
227
33
|
index: 0
|
|
228
|
-
}),
|
|
34
|
+
}), o?.(e.id);
|
|
229
35
|
}
|
|
230
|
-
function
|
|
231
|
-
if (!
|
|
232
|
-
let t = Math.min(
|
|
233
|
-
n && n.id !==
|
|
36
|
+
function D(e) {
|
|
37
|
+
if (!x || b < 0) return;
|
|
38
|
+
let t = Math.min(l.length - 1, Math.max(0, b + e)), n = l[t];
|
|
39
|
+
n && n.id !== y?.id && E(n);
|
|
234
40
|
}
|
|
235
|
-
return e.length === 0 ? /* @__PURE__ */ (
|
|
41
|
+
return e.length === 0 ? /* @__PURE__ */ t("p", {
|
|
236
42
|
className: "ribbon-carousel__empty",
|
|
237
43
|
children: "No carousel parents available."
|
|
238
|
-
}) : /* @__PURE__ */ (
|
|
44
|
+
}) : /* @__PURE__ */ n("div", {
|
|
239
45
|
className: "ribbon-carousel",
|
|
240
46
|
children: [
|
|
241
|
-
/* @__PURE__ */ (
|
|
47
|
+
/* @__PURE__ */ n("div", {
|
|
242
48
|
className: "ribbon-carousel__parent-nav",
|
|
243
49
|
children: [
|
|
244
|
-
/* @__PURE__ */ (
|
|
50
|
+
/* @__PURE__ */ t("button", {
|
|
245
51
|
type: "button",
|
|
246
52
|
className: "ribbon-carousel__parent-arrow",
|
|
247
|
-
disabled: !
|
|
53
|
+
disabled: !x || b <= 0,
|
|
248
54
|
"aria-label": "Previous parent group",
|
|
249
|
-
onClick: () =>
|
|
55
|
+
onClick: () => D(-1),
|
|
250
56
|
children: "‹"
|
|
251
57
|
}),
|
|
252
|
-
/* @__PURE__ */ (
|
|
58
|
+
/* @__PURE__ */ t("div", {
|
|
253
59
|
className: "ribbon-carousel__parents",
|
|
254
60
|
role: "tablist",
|
|
255
61
|
"aria-label": "Carousel parents",
|
|
256
|
-
children: e.map((e) => /* @__PURE__ */ (
|
|
62
|
+
children: e.map((e) => /* @__PURE__ */ n("button", {
|
|
257
63
|
type: "button",
|
|
258
64
|
role: "tab",
|
|
259
|
-
className: ["ribbon-carousel__parent", e.id ===
|
|
65
|
+
className: ["ribbon-carousel__parent", e.id === y?.id ? "is-active" : ""].filter(Boolean).join(" "),
|
|
260
66
|
disabled: e.disabled,
|
|
261
|
-
"aria-selected": e.id ===
|
|
262
|
-
onClick: () =>
|
|
263
|
-
children: [e.icon ? /* @__PURE__ */ (
|
|
67
|
+
"aria-selected": e.id === y?.id,
|
|
68
|
+
onClick: () => E(e),
|
|
69
|
+
children: [e.icon ? /* @__PURE__ */ t("span", {
|
|
264
70
|
"aria-hidden": "true",
|
|
265
71
|
children: e.icon
|
|
266
|
-
}) : null, /* @__PURE__ */ (
|
|
72
|
+
}) : null, /* @__PURE__ */ t("span", { children: e.label })]
|
|
267
73
|
}, e.id))
|
|
268
74
|
}),
|
|
269
|
-
/* @__PURE__ */ (
|
|
75
|
+
/* @__PURE__ */ t("button", {
|
|
270
76
|
type: "button",
|
|
271
77
|
className: "ribbon-carousel__parent-arrow",
|
|
272
|
-
disabled: !
|
|
78
|
+
disabled: !x || b < 0 || b >= l.length - 1,
|
|
273
79
|
"aria-label": "Next parent group",
|
|
274
|
-
onClick: () =>
|
|
80
|
+
onClick: () => D(1),
|
|
275
81
|
children: "›"
|
|
276
82
|
})
|
|
277
83
|
]
|
|
278
84
|
}),
|
|
279
|
-
/* @__PURE__ */ (
|
|
85
|
+
/* @__PURE__ */ n("div", {
|
|
280
86
|
className: "ribbon-carousel__items-row",
|
|
281
87
|
children: [
|
|
282
|
-
/* @__PURE__ */ (
|
|
88
|
+
/* @__PURE__ */ t("button", {
|
|
283
89
|
type: "button",
|
|
284
90
|
className: "ribbon-carousel__arrow",
|
|
285
|
-
disabled:
|
|
91
|
+
disabled: w === 0,
|
|
286
92
|
"aria-label": "Previous carousel items",
|
|
287
|
-
onClick: () =>
|
|
288
|
-
parentId:
|
|
289
|
-
index: Math.max(0,
|
|
93
|
+
onClick: () => _({
|
|
94
|
+
parentId: y?.id,
|
|
95
|
+
index: Math.max(0, w - 1)
|
|
290
96
|
}),
|
|
291
97
|
children: "‹"
|
|
292
98
|
}),
|
|
293
|
-
/* @__PURE__ */ (
|
|
99
|
+
/* @__PURE__ */ n("div", {
|
|
294
100
|
className: "ribbon-carousel__items",
|
|
295
101
|
role: "tabpanel",
|
|
296
102
|
"aria-live": "polite",
|
|
297
|
-
children: [
|
|
103
|
+
children: [T.map((e) => /* @__PURE__ */ t(f, {
|
|
298
104
|
className: "ribbon-carousel__item",
|
|
299
105
|
label: e.label,
|
|
300
106
|
icon: e.icon,
|
|
301
107
|
size: e.size ?? "compact",
|
|
302
108
|
disabled: e.disabled,
|
|
303
109
|
onClick: () => {
|
|
304
|
-
e.onClick?.(e.id),
|
|
110
|
+
e.onClick?.(e.id), y && s?.(e, y.id);
|
|
305
111
|
}
|
|
306
|
-
}, `${
|
|
112
|
+
}, `${y?.id ?? "parent"}-${e.id}`)), T.length === 0 ? /* @__PURE__ */ t("span", {
|
|
307
113
|
className: "ribbon-carousel__empty",
|
|
308
114
|
children: "No items for this parent."
|
|
309
115
|
}) : null]
|
|
310
116
|
}),
|
|
311
|
-
/* @__PURE__ */ (
|
|
117
|
+
/* @__PURE__ */ t("button", {
|
|
312
118
|
type: "button",
|
|
313
119
|
className: "ribbon-carousel__arrow",
|
|
314
|
-
disabled:
|
|
120
|
+
disabled: w >= C - 1,
|
|
315
121
|
"aria-label": "Next carousel items",
|
|
316
|
-
onClick: () =>
|
|
317
|
-
parentId:
|
|
318
|
-
index: Math.min(
|
|
122
|
+
onClick: () => _({
|
|
123
|
+
parentId: y?.id,
|
|
124
|
+
index: Math.min(C - 1, w + 1)
|
|
319
125
|
}),
|
|
320
126
|
children: "›"
|
|
321
127
|
})
|
|
322
128
|
]
|
|
323
129
|
}),
|
|
324
|
-
/* @__PURE__ */ (
|
|
130
|
+
/* @__PURE__ */ n("div", {
|
|
325
131
|
className: "ribbon-carousel__status",
|
|
326
132
|
"aria-hidden": "true",
|
|
327
133
|
children: [
|
|
328
|
-
|
|
134
|
+
w + 1,
|
|
329
135
|
" / ",
|
|
330
|
-
|
|
136
|
+
C
|
|
331
137
|
]
|
|
332
138
|
})
|
|
333
139
|
]
|
|
334
140
|
});
|
|
335
141
|
}
|
|
336
142
|
// src/ribbon/RibbonDropdown.tsx
|
|
337
|
-
function
|
|
338
|
-
let [
|
|
143
|
+
function m({ label: e, icon: r, size: i = "regular", disabled: a, options: c, onSelect: f }) {
|
|
144
|
+
let [p, m] = u(!1), h = l(null), g = l(null), _ = l(null), [v, y] = u({
|
|
339
145
|
top: 0,
|
|
340
146
|
left: 0,
|
|
341
147
|
width: 170
|
|
342
|
-
}),
|
|
343
|
-
function
|
|
344
|
-
if (!
|
|
345
|
-
let e =
|
|
346
|
-
|
|
148
|
+
}), b = s();
|
|
149
|
+
function x() {
|
|
150
|
+
if (!g.current) return;
|
|
151
|
+
let e = g.current.getBoundingClientRect(), t = Math.max(e.width, 170), n = Math.max(44, c.length * 38 + 12), r = window.innerHeight - e.bottom < n && e.top > n ? e.top - n - 4 : e.bottom + 4;
|
|
152
|
+
y({
|
|
347
153
|
top: Math.max(8, r),
|
|
348
154
|
left: Math.max(8, Math.min(e.left, window.innerWidth - t - 8)),
|
|
349
155
|
width: t
|
|
350
156
|
});
|
|
351
157
|
}
|
|
352
|
-
return
|
|
158
|
+
return o(() => {
|
|
353
159
|
function e(e) {
|
|
354
|
-
if (!
|
|
355
|
-
let t = e.target, n =
|
|
356
|
-
!n && !r &&
|
|
160
|
+
if (!h.current) return;
|
|
161
|
+
let t = e.target, n = h.current.contains(t), r = _.current?.contains(t);
|
|
162
|
+
!n && !r && m(!1);
|
|
357
163
|
}
|
|
358
164
|
function t(e) {
|
|
359
|
-
e.key === "Escape" &&
|
|
165
|
+
e.key === "Escape" && m(!1);
|
|
360
166
|
}
|
|
361
167
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
362
168
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
363
169
|
};
|
|
364
|
-
}, []),
|
|
365
|
-
if (!
|
|
366
|
-
|
|
170
|
+
}, []), o(() => {
|
|
171
|
+
if (!p) return;
|
|
172
|
+
x();
|
|
367
173
|
function e() {
|
|
368
|
-
|
|
174
|
+
x();
|
|
369
175
|
}
|
|
370
176
|
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
371
177
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
372
178
|
};
|
|
373
|
-
}, [
|
|
374
|
-
ref:
|
|
179
|
+
}, [p, c.length]), /* @__PURE__ */ n("div", {
|
|
180
|
+
ref: h,
|
|
375
181
|
className: [
|
|
376
182
|
"ribbon-dropdown",
|
|
377
|
-
`ribbon-dropdown--${
|
|
378
|
-
|
|
183
|
+
`ribbon-dropdown--${i}`,
|
|
184
|
+
p ? "is-open" : ""
|
|
379
185
|
].filter(Boolean).join(" "),
|
|
380
|
-
children: [/* @__PURE__ */ (
|
|
381
|
-
ref:
|
|
186
|
+
children: [/* @__PURE__ */ n("button", {
|
|
187
|
+
ref: g,
|
|
382
188
|
type: "button",
|
|
383
189
|
className: [
|
|
384
190
|
"ribbon-button",
|
|
385
|
-
`ribbon-button--${
|
|
191
|
+
`ribbon-button--${i}`,
|
|
386
192
|
"ribbon-dropdown__trigger"
|
|
387
193
|
].filter(Boolean).join(" "),
|
|
388
194
|
disabled: a,
|
|
389
195
|
"aria-haspopup": "menu",
|
|
390
|
-
"aria-expanded":
|
|
391
|
-
"aria-controls":
|
|
392
|
-
onClick: () =>
|
|
393
|
-
children: [/* @__PURE__ */ (
|
|
196
|
+
"aria-expanded": p,
|
|
197
|
+
"aria-controls": b,
|
|
198
|
+
onClick: () => m((e) => !e),
|
|
199
|
+
children: [/* @__PURE__ */ n("span", {
|
|
394
200
|
className: "ribbon-dropdown__head",
|
|
395
|
-
children: [
|
|
201
|
+
children: [r ? /* @__PURE__ */ t("span", {
|
|
396
202
|
className: "ribbon-button__icon",
|
|
397
203
|
"aria-hidden": "true",
|
|
398
|
-
children:
|
|
399
|
-
}) : null, /* @__PURE__ */ (
|
|
204
|
+
children: r
|
|
205
|
+
}) : null, /* @__PURE__ */ t("span", {
|
|
400
206
|
className: "ribbon-button__label",
|
|
401
207
|
children: e
|
|
402
208
|
})]
|
|
403
|
-
}), /* @__PURE__ */ (
|
|
209
|
+
}), /* @__PURE__ */ t("span", {
|
|
404
210
|
className: "ribbon-dropdown__caret",
|
|
405
211
|
"aria-hidden": "true",
|
|
406
212
|
children: "▾"
|
|
407
213
|
})]
|
|
408
|
-
}),
|
|
409
|
-
id:
|
|
410
|
-
ref:
|
|
214
|
+
}), p ? d(/* @__PURE__ */ t("ul", {
|
|
215
|
+
id: b,
|
|
216
|
+
ref: _,
|
|
411
217
|
role: "menu",
|
|
412
218
|
className: "ribbon-dropdown__menu ribbon-dropdown__menu--portal",
|
|
413
219
|
"aria-label": `${e} options`,
|
|
414
220
|
style: {
|
|
415
|
-
top: `${
|
|
416
|
-
left: `${
|
|
417
|
-
width: `${
|
|
221
|
+
top: `${v.top}px`,
|
|
222
|
+
left: `${v.left}px`,
|
|
223
|
+
width: `${v.width}px`
|
|
418
224
|
},
|
|
419
|
-
children:
|
|
225
|
+
children: c.map((e) => /* @__PURE__ */ t("li", {
|
|
420
226
|
role: "none",
|
|
421
227
|
className: "ribbon-dropdown__menu-item",
|
|
422
|
-
children: /* @__PURE__ */ (
|
|
228
|
+
children: /* @__PURE__ */ n("button", {
|
|
423
229
|
type: "button",
|
|
424
230
|
role: "menuitem",
|
|
425
231
|
className: "ribbon-dropdown__option-button",
|
|
426
232
|
onClick: () => {
|
|
427
|
-
|
|
233
|
+
f(e.id), m(!1);
|
|
428
234
|
},
|
|
429
|
-
children: [/* @__PURE__ */ (
|
|
235
|
+
children: [/* @__PURE__ */ t("span", {
|
|
430
236
|
className: "ribbon-dropdown__option-icon",
|
|
431
237
|
"aria-hidden": "true",
|
|
432
238
|
children: e.icon ?? "•"
|
|
433
|
-
}), /* @__PURE__ */ (
|
|
239
|
+
}), /* @__PURE__ */ t("span", {
|
|
434
240
|
className: "ribbon-dropdown__option-label",
|
|
435
241
|
children: e.label
|
|
436
242
|
})]
|
|
@@ -440,55 +246,55 @@ function g({ label: e, icon: t, size: n = "regular", disabled: a, options: l, on
|
|
|
440
246
|
});
|
|
441
247
|
}
|
|
442
248
|
// src/ribbon/Ribbon.tsx
|
|
443
|
-
function
|
|
444
|
-
return /* @__PURE__ */ (
|
|
445
|
-
className: ["ribbon",
|
|
446
|
-
"aria-label":
|
|
447
|
-
children: [/* @__PURE__ */ (
|
|
249
|
+
function h({ tabs: e, groups: r, activeTabId: i, onTabChange: a, onItemClick: o, className: s, ariaLabel: c = "Application ribbon" }) {
|
|
250
|
+
return /* @__PURE__ */ n("section", {
|
|
251
|
+
className: ["ribbon", s].filter(Boolean).join(" "),
|
|
252
|
+
"aria-label": c,
|
|
253
|
+
children: [/* @__PURE__ */ t("nav", {
|
|
448
254
|
className: "ribbon__tabbar",
|
|
449
255
|
"aria-label": "Ribbon tabs",
|
|
450
|
-
children: e.map((e) => /* @__PURE__ */ (
|
|
256
|
+
children: e.map((e) => /* @__PURE__ */ t("button", {
|
|
451
257
|
type: "button",
|
|
452
|
-
className: e.id ===
|
|
453
|
-
onClick: () =>
|
|
454
|
-
"aria-selected": e.id ===
|
|
258
|
+
className: e.id === i ? "ribbon__tab is-active" : "ribbon__tab",
|
|
259
|
+
onClick: () => a(e.id),
|
|
260
|
+
"aria-selected": e.id === i,
|
|
455
261
|
role: "tab",
|
|
456
262
|
children: e.label
|
|
457
263
|
}, e.id))
|
|
458
|
-
}), /* @__PURE__ */ (
|
|
264
|
+
}), /* @__PURE__ */ t("div", {
|
|
459
265
|
className: "ribbon__surface",
|
|
460
266
|
role: "tabpanel",
|
|
461
|
-
"aria-label": `${
|
|
462
|
-
children:
|
|
267
|
+
"aria-label": `${i} commands`,
|
|
268
|
+
children: r.map((e) => /* @__PURE__ */ n("section", {
|
|
463
269
|
className: "ribbon__group",
|
|
464
270
|
"aria-label": e.title,
|
|
465
271
|
children: [
|
|
466
|
-
/* @__PURE__ */ (
|
|
272
|
+
/* @__PURE__ */ t("div", {
|
|
467
273
|
className: "ribbon__group-items",
|
|
468
|
-
children: (e.items ?? []).map((e) => e.options && e.options.length > 0 ? /* @__PURE__ */ (
|
|
274
|
+
children: (e.items ?? []).map((e) => e.options && e.options.length > 0 ? /* @__PURE__ */ t(m, {
|
|
469
275
|
label: e.label,
|
|
470
276
|
icon: e.icon,
|
|
471
277
|
size: e.size,
|
|
472
278
|
disabled: e.disabled,
|
|
473
279
|
options: e.options,
|
|
474
280
|
onSelect: (t) => {
|
|
475
|
-
e.onClick?.(e.id),
|
|
281
|
+
e.onClick?.(e.id), o?.(e, t);
|
|
476
282
|
}
|
|
477
|
-
}, e.id) : /* @__PURE__ */ (
|
|
283
|
+
}, e.id) : /* @__PURE__ */ t(f, {
|
|
478
284
|
label: e.label,
|
|
479
285
|
icon: e.icon,
|
|
480
286
|
size: e.size,
|
|
481
287
|
disabled: e.disabled,
|
|
482
288
|
onClick: () => {
|
|
483
|
-
e.onClick?.(e.id),
|
|
289
|
+
e.onClick?.(e.id), o?.(e);
|
|
484
290
|
}
|
|
485
291
|
}, e.id))
|
|
486
292
|
}),
|
|
487
|
-
e.carousel ? /* @__PURE__ */ (
|
|
293
|
+
e.carousel ? /* @__PURE__ */ t(p, {
|
|
488
294
|
...e.carousel,
|
|
489
|
-
onItemClick: (e, t) =>
|
|
295
|
+
onItemClick: (e, t) => o?.(e, void 0, t)
|
|
490
296
|
}) : null,
|
|
491
|
-
/* @__PURE__ */ (
|
|
297
|
+
/* @__PURE__ */ t("h3", {
|
|
492
298
|
className: "ribbon__group-title",
|
|
493
299
|
children: e.title
|
|
494
300
|
})
|
|
@@ -498,44 +304,44 @@ function _({ tabs: e, groups: t, activeTabId: n, onTabChange: r, onItemClick: i,
|
|
|
498
304
|
});
|
|
499
305
|
}
|
|
500
306
|
// src/ribbon/RibbonSplitButton.tsx
|
|
501
|
-
function
|
|
502
|
-
return /* @__PURE__ */ (
|
|
307
|
+
function g({ size: e = "regular", className: r, upperLabel: i, upperIcon: a, upperButtonProps: o, lowerLabel: s, lowerIcon: c, lowerButtonProps: l }) {
|
|
308
|
+
return /* @__PURE__ */ n("div", {
|
|
503
309
|
className: [
|
|
504
310
|
"ribbon-split-button",
|
|
505
311
|
`ribbon-split-button--${e}`,
|
|
506
|
-
|
|
312
|
+
r
|
|
507
313
|
].filter(Boolean).join(" "),
|
|
508
314
|
role: "group",
|
|
509
|
-
"aria-label": `${
|
|
510
|
-
children: [/* @__PURE__ */ (
|
|
315
|
+
"aria-label": `${i} and ${s}`,
|
|
316
|
+
children: [/* @__PURE__ */ n("button", {
|
|
511
317
|
type: "button",
|
|
512
318
|
className: "ribbon-split-button__half ribbon-split-button__half--upper",
|
|
513
|
-
...
|
|
514
|
-
children: [
|
|
319
|
+
...o,
|
|
320
|
+
children: [a ? /* @__PURE__ */ t("span", {
|
|
515
321
|
className: "ribbon-split-button__icon",
|
|
516
322
|
"aria-hidden": "true",
|
|
517
|
-
children:
|
|
518
|
-
}) : null, /* @__PURE__ */ (
|
|
323
|
+
children: a
|
|
324
|
+
}) : null, /* @__PURE__ */ t("span", {
|
|
519
325
|
className: "ribbon-split-button__label",
|
|
520
|
-
children:
|
|
326
|
+
children: i
|
|
521
327
|
})]
|
|
522
|
-
}), /* @__PURE__ */ (
|
|
328
|
+
}), /* @__PURE__ */ n("button", {
|
|
523
329
|
type: "button",
|
|
524
330
|
className: "ribbon-split-button__half ribbon-split-button__half--lower",
|
|
525
|
-
...
|
|
526
|
-
children: [
|
|
331
|
+
...l,
|
|
332
|
+
children: [c ? /* @__PURE__ */ t("span", {
|
|
527
333
|
className: "ribbon-split-button__icon",
|
|
528
334
|
"aria-hidden": "true",
|
|
529
|
-
children:
|
|
530
|
-
}) : null, /* @__PURE__ */ (
|
|
335
|
+
children: c
|
|
336
|
+
}) : null, /* @__PURE__ */ t("span", {
|
|
531
337
|
className: "ribbon-split-button__label",
|
|
532
|
-
children:
|
|
338
|
+
children: s
|
|
533
339
|
})]
|
|
534
340
|
})]
|
|
535
341
|
});
|
|
536
342
|
}
|
|
537
343
|
// src/easy-connectors/client.ts
|
|
538
|
-
var
|
|
344
|
+
var _ = class {
|
|
539
345
|
baseUrl;
|
|
540
346
|
apiKey;
|
|
541
347
|
constructor(e, t) {
|
|
@@ -591,26 +397,26 @@ var y = class {
|
|
|
591
397
|
}
|
|
592
398
|
if (r.status !== 204) return await r.json();
|
|
593
399
|
}
|
|
594
|
-
},
|
|
595
|
-
function
|
|
596
|
-
let
|
|
597
|
-
|
|
400
|
+
}, v = r(null);
|
|
401
|
+
function y({ baseUrl: e = "http://localhost:5088", apiKey: n, client: r, children: i }) {
|
|
402
|
+
let a = c(() => ({ client: r ?? new _(e, n) }), [
|
|
403
|
+
n,
|
|
598
404
|
e,
|
|
599
|
-
|
|
405
|
+
r
|
|
600
406
|
]);
|
|
601
|
-
return /* @__PURE__ */ (
|
|
602
|
-
value:
|
|
603
|
-
children:
|
|
407
|
+
return /* @__PURE__ */ t(v.Provider, {
|
|
408
|
+
value: a,
|
|
409
|
+
children: i
|
|
604
410
|
});
|
|
605
411
|
}
|
|
606
|
-
function
|
|
607
|
-
let e =
|
|
412
|
+
function b() {
|
|
413
|
+
let e = a(v);
|
|
608
414
|
if (!e) throw Error("useEasyConnectors must be used within EasyConnectorsProvider.");
|
|
609
415
|
return e;
|
|
610
416
|
}
|
|
611
417
|
// src/easy-connectors/ConnectorKindIcon.tsx
|
|
612
|
-
function
|
|
613
|
-
return /* @__PURE__ */ (
|
|
418
|
+
function x(e) {
|
|
419
|
+
return /* @__PURE__ */ t("svg", {
|
|
614
420
|
viewBox: "0 0 24 24",
|
|
615
421
|
fill: "none",
|
|
616
422
|
stroke: "currentColor",
|
|
@@ -621,65 +427,65 @@ function C(e) {
|
|
|
621
427
|
...e
|
|
622
428
|
});
|
|
623
429
|
}
|
|
624
|
-
function
|
|
625
|
-
return /* @__PURE__ */ (
|
|
430
|
+
function S() {
|
|
431
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M3.5 8.2h6.1l1.5 1.8h9.4" }), /* @__PURE__ */ t("path", { d: "M3.5 8.2v8.8a1.5 1.5 0 0 0 1.5 1.5h14a1.5 1.5 0 0 0 1.5-1.5V10a1.8 1.8 0 0 0-1.8-1.8H3.5Z" })] });
|
|
626
432
|
}
|
|
627
|
-
function
|
|
628
|
-
return /* @__PURE__ */ (
|
|
433
|
+
function C() {
|
|
434
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("rect", {
|
|
629
435
|
x: "4",
|
|
630
436
|
y: "5",
|
|
631
437
|
width: "16",
|
|
632
438
|
height: "14",
|
|
633
439
|
rx: "1.5"
|
|
634
|
-
}), /* @__PURE__ */ (
|
|
440
|
+
}), /* @__PURE__ */ t("path", { d: "M4 10h16M9.5 5v14M14.5 5v14" })] });
|
|
635
441
|
}
|
|
636
|
-
function
|
|
637
|
-
return /* @__PURE__ */ (
|
|
442
|
+
function w() {
|
|
443
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M9 12h6" }), /* @__PURE__ */ t("path", { d: "m13 9 3 3-3 3" })] });
|
|
638
444
|
}
|
|
639
|
-
function
|
|
640
|
-
return /* @__PURE__ */ (
|
|
445
|
+
function T() {
|
|
446
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("rect", {
|
|
641
447
|
x: "8",
|
|
642
448
|
y: "11",
|
|
643
449
|
width: "8",
|
|
644
450
|
height: "7",
|
|
645
451
|
rx: "1.2"
|
|
646
|
-
}), /* @__PURE__ */ (
|
|
452
|
+
}), /* @__PURE__ */ t("path", { d: "M10 11V9a2 2 0 1 1 4 0v2" })] });
|
|
647
453
|
}
|
|
648
|
-
function
|
|
649
|
-
return /* @__PURE__ */ (
|
|
650
|
-
className: ["ec-kind-icon",
|
|
651
|
-
...
|
|
454
|
+
function E({ kind: r, className: i, ...a }) {
|
|
455
|
+
return /* @__PURE__ */ n(x, {
|
|
456
|
+
className: ["ec-kind-icon", i].filter(Boolean).join(" "),
|
|
457
|
+
...a,
|
|
652
458
|
children: [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
/* @__PURE__ */ (
|
|
656
|
-
/* @__PURE__ */ (
|
|
657
|
-
/* @__PURE__ */ (
|
|
658
|
-
/* @__PURE__ */ (
|
|
459
|
+
r === "FolderToFolder" ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(S, {}), /* @__PURE__ */ t(w, {})] }) : null,
|
|
460
|
+
r === "FolderToTable" ? /* @__PURE__ */ n(e, { children: [
|
|
461
|
+
/* @__PURE__ */ t(S, {}),
|
|
462
|
+
/* @__PURE__ */ t(w, {}),
|
|
463
|
+
/* @__PURE__ */ t("path", { d: "M17 6.5h3" }),
|
|
464
|
+
/* @__PURE__ */ t("path", { d: "M18.5 5v3" })
|
|
659
465
|
] }) : null,
|
|
660
|
-
|
|
661
|
-
/* @__PURE__ */ (
|
|
662
|
-
/* @__PURE__ */ (
|
|
663
|
-
/* @__PURE__ */ (
|
|
664
|
-
/* @__PURE__ */ (
|
|
466
|
+
r === "TableToFolder" ? /* @__PURE__ */ n(e, { children: [
|
|
467
|
+
/* @__PURE__ */ t(C, {}),
|
|
468
|
+
/* @__PURE__ */ t("path", { d: "M7 12h10" }),
|
|
469
|
+
/* @__PURE__ */ t("path", { d: "m11 9-3 3 3 3" }),
|
|
470
|
+
/* @__PURE__ */ t(S, {})
|
|
665
471
|
] }) : null,
|
|
666
|
-
|
|
667
|
-
/* @__PURE__ */ (
|
|
668
|
-
/* @__PURE__ */ (
|
|
669
|
-
/* @__PURE__ */ (
|
|
472
|
+
r === "FolderToSftp" ? /* @__PURE__ */ n(e, { children: [
|
|
473
|
+
/* @__PURE__ */ t(S, {}),
|
|
474
|
+
/* @__PURE__ */ t(w, {}),
|
|
475
|
+
/* @__PURE__ */ t(T, {})
|
|
670
476
|
] }) : null,
|
|
671
|
-
|
|
672
|
-
/* @__PURE__ */ (
|
|
673
|
-
/* @__PURE__ */ (
|
|
674
|
-
/* @__PURE__ */ (
|
|
675
|
-
/* @__PURE__ */ (
|
|
477
|
+
r === "SftpToFolder" ? /* @__PURE__ */ n(e, { children: [
|
|
478
|
+
/* @__PURE__ */ t(T, {}),
|
|
479
|
+
/* @__PURE__ */ t("path", { d: "M8 12h6" }),
|
|
480
|
+
/* @__PURE__ */ t("path", { d: "m11 9-3 3 3 3" }),
|
|
481
|
+
/* @__PURE__ */ t(S, {})
|
|
676
482
|
] }) : null
|
|
677
483
|
]
|
|
678
484
|
});
|
|
679
485
|
}
|
|
680
486
|
// src/easy-connectors/EndpointKindIcon.tsx
|
|
681
|
-
function
|
|
682
|
-
return /* @__PURE__ */ (
|
|
487
|
+
function D(e) {
|
|
488
|
+
return /* @__PURE__ */ t("svg", {
|
|
683
489
|
viewBox: "0 0 24 24",
|
|
684
490
|
fill: "none",
|
|
685
491
|
stroke: "currentColor",
|
|
@@ -690,45 +496,45 @@ function k(e) {
|
|
|
690
496
|
...e
|
|
691
497
|
});
|
|
692
498
|
}
|
|
693
|
-
function
|
|
694
|
-
return /* @__PURE__ */ (
|
|
499
|
+
function O() {
|
|
500
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M3.5 8.2h6.1l1.5 1.8h9.4" }), /* @__PURE__ */ t("path", { d: "M3.5 8.2v8.8a1.5 1.5 0 0 0 1.5 1.5h14a1.5 1.5 0 0 0 1.5-1.5V10a1.8 1.8 0 0 0-1.8-1.8H3.5Z" })] });
|
|
695
501
|
}
|
|
696
|
-
function
|
|
697
|
-
return /* @__PURE__ */ (
|
|
502
|
+
function k() {
|
|
503
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("rect", {
|
|
698
504
|
x: "4",
|
|
699
505
|
y: "5",
|
|
700
506
|
width: "16",
|
|
701
507
|
height: "14",
|
|
702
508
|
rx: "1.5"
|
|
703
|
-
}), /* @__PURE__ */ (
|
|
509
|
+
}), /* @__PURE__ */ t("path", { d: "M4 10h16M9.5 5v14M14.5 5v14" })] });
|
|
704
510
|
}
|
|
705
|
-
function
|
|
706
|
-
return /* @__PURE__ */ (
|
|
707
|
-
/* @__PURE__ */ (
|
|
511
|
+
function A() {
|
|
512
|
+
return /* @__PURE__ */ n(e, { children: [
|
|
513
|
+
/* @__PURE__ */ t("rect", {
|
|
708
514
|
x: "8",
|
|
709
515
|
y: "11",
|
|
710
516
|
width: "8",
|
|
711
517
|
height: "7",
|
|
712
518
|
rx: "1.2"
|
|
713
519
|
}),
|
|
714
|
-
/* @__PURE__ */ (
|
|
715
|
-
/* @__PURE__ */ (
|
|
716
|
-
/* @__PURE__ */ (
|
|
520
|
+
/* @__PURE__ */ t("path", { d: "M10 11V9a2 2 0 1 1 4 0v2" }),
|
|
521
|
+
/* @__PURE__ */ t("path", { d: "M3 17h3" }),
|
|
522
|
+
/* @__PURE__ */ t("path", { d: "M18 17h3" })
|
|
717
523
|
] });
|
|
718
524
|
}
|
|
719
|
-
function
|
|
720
|
-
return /* @__PURE__ */ (
|
|
721
|
-
className: ["ec-endpoint-icon",
|
|
722
|
-
...
|
|
525
|
+
function j({ endpoint: e, className: r, ...i }) {
|
|
526
|
+
return /* @__PURE__ */ n(D, {
|
|
527
|
+
className: ["ec-endpoint-icon", r].filter(Boolean).join(" "),
|
|
528
|
+
...i,
|
|
723
529
|
children: [
|
|
724
|
-
e === "Folder" ? /* @__PURE__ */ (
|
|
725
|
-
e === "Table" ? /* @__PURE__ */ (
|
|
726
|
-
e === "Sftp" ? /* @__PURE__ */ (
|
|
530
|
+
e === "Folder" ? /* @__PURE__ */ t(O, {}) : null,
|
|
531
|
+
e === "Table" ? /* @__PURE__ */ t(k, {}) : null,
|
|
532
|
+
e === "Sftp" ? /* @__PURE__ */ t(A, {}) : null
|
|
727
533
|
]
|
|
728
534
|
});
|
|
729
535
|
}
|
|
730
536
|
// src/easy-connectors/connector-flow.ts
|
|
731
|
-
function
|
|
537
|
+
function M(e) {
|
|
732
538
|
switch (e) {
|
|
733
539
|
case "FolderToFolder": return {
|
|
734
540
|
source: "Folder",
|
|
@@ -757,125 +563,125 @@ function P(e) {
|
|
|
757
563
|
}
|
|
758
564
|
}
|
|
759
565
|
// src/easy-connectors/ConnectorBoard.tsx
|
|
760
|
-
function
|
|
761
|
-
let { client:
|
|
762
|
-
|
|
566
|
+
function N({ selectedConnectorId: e, refreshToken: r, onSelect: a, onCreate: s }) {
|
|
567
|
+
let { client: c } = b(), [l, d] = u([]), [f, p] = u(!1), [m, h] = u(null), g = i(async () => {
|
|
568
|
+
p(!0), h(null);
|
|
763
569
|
try {
|
|
764
|
-
|
|
570
|
+
d(await c.listConnectors());
|
|
765
571
|
} catch (e) {
|
|
766
|
-
|
|
572
|
+
h(e instanceof Error ? e.message : "Failed to load connectors.");
|
|
767
573
|
} finally {
|
|
768
|
-
|
|
574
|
+
p(!1);
|
|
769
575
|
}
|
|
770
|
-
}, [
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}, [
|
|
774
|
-
async function
|
|
775
|
-
|
|
576
|
+
}, [c]);
|
|
577
|
+
o(() => {
|
|
578
|
+
g();
|
|
579
|
+
}, [g, r]);
|
|
580
|
+
async function _(e) {
|
|
581
|
+
h(null);
|
|
776
582
|
try {
|
|
777
|
-
await e(), await
|
|
583
|
+
await e(), await g();
|
|
778
584
|
} catch (e) {
|
|
779
|
-
|
|
585
|
+
h(e instanceof Error ? e.message : "Action failed.");
|
|
780
586
|
}
|
|
781
587
|
}
|
|
782
|
-
return /* @__PURE__ */ (
|
|
588
|
+
return /* @__PURE__ */ n("section", {
|
|
783
589
|
className: "ec-board",
|
|
784
590
|
children: [
|
|
785
|
-
/* @__PURE__ */ (
|
|
591
|
+
/* @__PURE__ */ n("header", {
|
|
786
592
|
className: "ec-board__header",
|
|
787
|
-
children: [/* @__PURE__ */ (
|
|
593
|
+
children: [/* @__PURE__ */ t("h2", { children: "Connectors" }), /* @__PURE__ */ n("div", {
|
|
788
594
|
className: "ec-board__header-actions",
|
|
789
|
-
children: [/* @__PURE__ */ (
|
|
595
|
+
children: [/* @__PURE__ */ t("button", {
|
|
790
596
|
type: "button",
|
|
791
|
-
onClick:
|
|
597
|
+
onClick: g,
|
|
792
598
|
children: "Refresh"
|
|
793
|
-
}), /* @__PURE__ */ (
|
|
599
|
+
}), /* @__PURE__ */ t("button", {
|
|
794
600
|
type: "button",
|
|
795
601
|
className: "ec-primary",
|
|
796
|
-
onClick:
|
|
602
|
+
onClick: s,
|
|
797
603
|
children: "New"
|
|
798
604
|
})]
|
|
799
605
|
})]
|
|
800
606
|
}),
|
|
801
|
-
|
|
607
|
+
m ? /* @__PURE__ */ t("p", {
|
|
802
608
|
className: "ec-error",
|
|
803
|
-
children:
|
|
609
|
+
children: m
|
|
804
610
|
}) : null,
|
|
805
|
-
|
|
611
|
+
f ? /* @__PURE__ */ t("p", {
|
|
806
612
|
className: "ec-muted",
|
|
807
613
|
children: "Loading..."
|
|
808
614
|
}) : null,
|
|
809
|
-
/* @__PURE__ */ (
|
|
615
|
+
/* @__PURE__ */ t("ul", {
|
|
810
616
|
className: "ec-board__list",
|
|
811
|
-
children:
|
|
812
|
-
let
|
|
813
|
-
return /* @__PURE__ */ (
|
|
814
|
-
className: ["ec-board__item", e ===
|
|
815
|
-
children: [/* @__PURE__ */ (
|
|
617
|
+
children: l.map((r) => (() => {
|
|
618
|
+
let i = M(r.kind);
|
|
619
|
+
return /* @__PURE__ */ n("li", {
|
|
620
|
+
className: ["ec-board__item", e === r.id ? "is-selected" : ""].filter(Boolean).join(" "),
|
|
621
|
+
children: [/* @__PURE__ */ n("button", {
|
|
816
622
|
type: "button",
|
|
817
623
|
className: "ec-board__item-main",
|
|
818
|
-
onClick: () =>
|
|
624
|
+
onClick: () => r.id && a?.(r.id),
|
|
819
625
|
children: [
|
|
820
|
-
/* @__PURE__ */ (
|
|
626
|
+
/* @__PURE__ */ n("span", {
|
|
821
627
|
className: "ec-board__name-row",
|
|
822
|
-
children: [/* @__PURE__ */ (
|
|
628
|
+
children: [/* @__PURE__ */ t(E, { kind: r.kind }), /* @__PURE__ */ t("span", {
|
|
823
629
|
className: "ec-board__name",
|
|
824
|
-
children:
|
|
630
|
+
children: r.name
|
|
825
631
|
})]
|
|
826
632
|
}),
|
|
827
|
-
/* @__PURE__ */ (
|
|
633
|
+
/* @__PURE__ */ n("span", {
|
|
828
634
|
className: "ec-flow",
|
|
829
|
-
"aria-label": `Flow ${
|
|
635
|
+
"aria-label": `Flow ${i.source} to ${i.destination}`,
|
|
830
636
|
children: [
|
|
831
|
-
/* @__PURE__ */ (
|
|
637
|
+
/* @__PURE__ */ n("span", {
|
|
832
638
|
className: "ec-flow__node",
|
|
833
|
-
children: [/* @__PURE__ */ (
|
|
639
|
+
children: [/* @__PURE__ */ t(j, { endpoint: i.source }), /* @__PURE__ */ t("span", { children: i.source })]
|
|
834
640
|
}),
|
|
835
|
-
/* @__PURE__ */ (
|
|
641
|
+
/* @__PURE__ */ t("span", {
|
|
836
642
|
className: "ec-flow__arrow",
|
|
837
643
|
"aria-hidden": "true",
|
|
838
644
|
children: "->"
|
|
839
645
|
}),
|
|
840
|
-
/* @__PURE__ */ (
|
|
646
|
+
/* @__PURE__ */ n("span", {
|
|
841
647
|
className: "ec-flow__connector",
|
|
842
|
-
children: [/* @__PURE__ */ (
|
|
843
|
-
kind:
|
|
648
|
+
children: [/* @__PURE__ */ t(E, {
|
|
649
|
+
kind: r.kind,
|
|
844
650
|
className: "ec-kind-icon--chip"
|
|
845
|
-
}), /* @__PURE__ */ (
|
|
651
|
+
}), /* @__PURE__ */ t("span", { children: "Connector" })]
|
|
846
652
|
}),
|
|
847
|
-
/* @__PURE__ */ (
|
|
653
|
+
/* @__PURE__ */ t("span", {
|
|
848
654
|
className: "ec-flow__arrow",
|
|
849
655
|
"aria-hidden": "true",
|
|
850
656
|
children: "->"
|
|
851
657
|
}),
|
|
852
|
-
/* @__PURE__ */ (
|
|
658
|
+
/* @__PURE__ */ n("span", {
|
|
853
659
|
className: "ec-flow__node",
|
|
854
|
-
children: [/* @__PURE__ */ (
|
|
660
|
+
children: [/* @__PURE__ */ t(j, { endpoint: i.destination }), /* @__PURE__ */ t("span", { children: i.destination })]
|
|
855
661
|
})
|
|
856
662
|
]
|
|
857
663
|
}),
|
|
858
|
-
/* @__PURE__ */ (
|
|
859
|
-
className: `ec-status ec-status--${(
|
|
860
|
-
children:
|
|
664
|
+
/* @__PURE__ */ t("span", {
|
|
665
|
+
className: `ec-status ec-status--${(r.status ?? "Idle").toLowerCase()}`,
|
|
666
|
+
children: r.status ?? "Idle"
|
|
861
667
|
})
|
|
862
668
|
]
|
|
863
|
-
}), /* @__PURE__ */ (
|
|
669
|
+
}), /* @__PURE__ */ n("div", {
|
|
864
670
|
className: "ec-board__item-actions",
|
|
865
|
-
children: [/* @__PURE__ */ (
|
|
671
|
+
children: [/* @__PURE__ */ t("button", {
|
|
866
672
|
type: "button",
|
|
867
|
-
onClick: () =>
|
|
673
|
+
onClick: () => r.id && _(() => c.runConnector(r.id)),
|
|
868
674
|
children: "Run now"
|
|
869
|
-
}), /* @__PURE__ */ (
|
|
675
|
+
}), /* @__PURE__ */ t("button", {
|
|
870
676
|
type: "button",
|
|
871
|
-
onClick: () =>
|
|
872
|
-
children:
|
|
677
|
+
onClick: () => r.id && _(() => r.status === "Disabled" ? c.enableConnector(r.id) : c.disableConnector(r.id)),
|
|
678
|
+
children: r.status === "Disabled" ? "Enable" : "Disable"
|
|
873
679
|
})]
|
|
874
680
|
})]
|
|
875
|
-
},
|
|
681
|
+
}, r.id);
|
|
876
682
|
})())
|
|
877
683
|
}),
|
|
878
|
-
|
|
684
|
+
l.length === 0 && !f ? /* @__PURE__ */ t("p", {
|
|
879
685
|
className: "ec-muted",
|
|
880
686
|
children: "No connectors yet. Create one to start transferring."
|
|
881
687
|
}) : null
|
|
@@ -883,20 +689,20 @@ function F({ selectedConnectorId: e, refreshToken: n, onSelect: i, onCreate: a }
|
|
|
883
689
|
});
|
|
884
690
|
}
|
|
885
691
|
// src/easy-connectors/ConnectorForm.tsx
|
|
886
|
-
var
|
|
692
|
+
var P = [
|
|
887
693
|
"FolderToFolder",
|
|
888
694
|
"FolderToTable",
|
|
889
695
|
"TableToFolder",
|
|
890
696
|
"FolderToSftp",
|
|
891
697
|
"SftpToFolder"
|
|
892
|
-
],
|
|
698
|
+
], F = ["Copy", "Move"], I = [
|
|
893
699
|
"Manual",
|
|
894
700
|
"Interval",
|
|
895
701
|
"Daily",
|
|
896
702
|
"OnCreated",
|
|
897
703
|
"OnUpdated"
|
|
898
|
-
],
|
|
899
|
-
function
|
|
704
|
+
], L = ["Sqlite", "SqlServer"];
|
|
705
|
+
function R() {
|
|
900
706
|
return {
|
|
901
707
|
name: "New connector",
|
|
902
708
|
kind: "FolderToFolder",
|
|
@@ -913,33 +719,33 @@ function B() {
|
|
|
913
719
|
tableName: ""
|
|
914
720
|
};
|
|
915
721
|
}
|
|
916
|
-
function
|
|
917
|
-
let { client:
|
|
918
|
-
|
|
919
|
-
if (!
|
|
920
|
-
|
|
722
|
+
function z({ connectorId: r, onSaved: i }) {
|
|
723
|
+
let { client: a } = b(), [s, l] = u(R()), [d, f] = u(""), [p, m] = u(!1), [h, g] = u(!1), [_, v] = u(null), [y, x] = u(null);
|
|
724
|
+
o(() => {
|
|
725
|
+
if (!r) {
|
|
726
|
+
l(R()), f(""), v(null), x(null);
|
|
921
727
|
return;
|
|
922
728
|
}
|
|
923
|
-
let
|
|
924
|
-
return
|
|
925
|
-
|
|
926
|
-
}).catch((
|
|
927
|
-
|
|
729
|
+
let e = !1;
|
|
730
|
+
return m(!0), v(null), a.getConnector(r).then((t) => {
|
|
731
|
+
e || (l(t), f((t.keyColumns ?? []).join(", ")));
|
|
732
|
+
}).catch((t) => {
|
|
733
|
+
e || v(t instanceof Error ? t.message : "Failed to load connector.");
|
|
928
734
|
}).finally(() => {
|
|
929
|
-
|
|
735
|
+
e || m(!1);
|
|
930
736
|
}), () => {
|
|
931
|
-
|
|
737
|
+
e = !0;
|
|
932
738
|
};
|
|
933
|
-
}, [
|
|
934
|
-
let
|
|
935
|
-
function
|
|
936
|
-
|
|
739
|
+
}, [a, r]);
|
|
740
|
+
let S = c(() => M(s.kind), [s.kind]);
|
|
741
|
+
function C(e, t) {
|
|
742
|
+
l((n) => ({
|
|
937
743
|
...n,
|
|
938
744
|
[e]: t
|
|
939
745
|
}));
|
|
940
746
|
}
|
|
941
|
-
function
|
|
942
|
-
|
|
747
|
+
function w(e) {
|
|
748
|
+
l((t) => {
|
|
943
749
|
let n = t.triggers.includes(e) ? t.triggers.filter((t) => t !== e) : [...t.triggers, e];
|
|
944
750
|
return {
|
|
945
751
|
...t,
|
|
@@ -947,359 +753,359 @@ function V({ connectorId: e, onSaved: t }) {
|
|
|
947
753
|
};
|
|
948
754
|
});
|
|
949
755
|
}
|
|
950
|
-
async function
|
|
951
|
-
|
|
952
|
-
let
|
|
953
|
-
...
|
|
954
|
-
keyColumns:
|
|
756
|
+
async function T() {
|
|
757
|
+
g(!0), v(null), x(null);
|
|
758
|
+
let e = {
|
|
759
|
+
...s,
|
|
760
|
+
keyColumns: d.split(",").map((e) => e.trim()).filter(Boolean)
|
|
955
761
|
};
|
|
956
762
|
try {
|
|
957
|
-
let
|
|
958
|
-
|
|
763
|
+
let t = r ? await a.updateConnector(r, e) : await a.createConnector(e);
|
|
764
|
+
l(t), f((t.keyColumns ?? []).join(", ")), x("Connector saved."), i?.(t);
|
|
959
765
|
} catch (e) {
|
|
960
|
-
|
|
766
|
+
v(e instanceof Error ? e.message : "Save failed.");
|
|
961
767
|
} finally {
|
|
962
|
-
|
|
768
|
+
g(!1);
|
|
963
769
|
}
|
|
964
770
|
}
|
|
965
|
-
function
|
|
966
|
-
return
|
|
967
|
-
/* @__PURE__ */ (
|
|
968
|
-
value:
|
|
969
|
-
onChange: (e) =>
|
|
771
|
+
function D(r) {
|
|
772
|
+
return r === "source" ? /* @__PURE__ */ n(e, { children: [
|
|
773
|
+
/* @__PURE__ */ n("label", { children: ["Source path", /* @__PURE__ */ t("input", {
|
|
774
|
+
value: s.sourcePath ?? "",
|
|
775
|
+
onChange: (e) => C("sourcePath", e.target.value)
|
|
970
776
|
})] }),
|
|
971
|
-
/* @__PURE__ */ (
|
|
972
|
-
value:
|
|
973
|
-
onChange: (e) =>
|
|
777
|
+
/* @__PURE__ */ n("label", { children: ["Pattern", /* @__PURE__ */ t("input", {
|
|
778
|
+
value: s.pattern ?? "",
|
|
779
|
+
onChange: (e) => C("pattern", e.target.value)
|
|
974
780
|
})] }),
|
|
975
|
-
/* @__PURE__ */ (
|
|
781
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Recursive" }), /* @__PURE__ */ t("input", {
|
|
976
782
|
type: "checkbox",
|
|
977
|
-
checked:
|
|
978
|
-
onChange: (e) =>
|
|
783
|
+
checked: s.recursive ?? !1,
|
|
784
|
+
onChange: (e) => C("recursive", e.target.checked)
|
|
979
785
|
})] })
|
|
980
|
-
] }) : /* @__PURE__ */ (
|
|
981
|
-
value:
|
|
982
|
-
onChange: (e) =>
|
|
983
|
-
})] }), /* @__PURE__ */ (
|
|
786
|
+
] }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("label", { children: ["Destination path", /* @__PURE__ */ t("input", {
|
|
787
|
+
value: s.destinationPath ?? "",
|
|
788
|
+
onChange: (e) => C("destinationPath", e.target.value)
|
|
789
|
+
})] }), /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Overwrite" }), /* @__PURE__ */ t("input", {
|
|
984
790
|
type: "checkbox",
|
|
985
|
-
checked:
|
|
986
|
-
onChange: (e) =>
|
|
791
|
+
checked: s.overwrite ?? !1,
|
|
792
|
+
onChange: (e) => C("overwrite", e.target.checked)
|
|
987
793
|
})] })] });
|
|
988
794
|
}
|
|
989
|
-
function
|
|
990
|
-
return /* @__PURE__ */ (
|
|
991
|
-
/* @__PURE__ */ (
|
|
992
|
-
value:
|
|
993
|
-
onChange: (e) =>
|
|
994
|
-
children:
|
|
795
|
+
function O() {
|
|
796
|
+
return /* @__PURE__ */ n(e, { children: [
|
|
797
|
+
/* @__PURE__ */ n("label", { children: ["Provider", /* @__PURE__ */ t("select", {
|
|
798
|
+
value: s.provider ?? "SqlServer",
|
|
799
|
+
onChange: (e) => C("provider", e.target.value),
|
|
800
|
+
children: L.map((e) => /* @__PURE__ */ t("option", {
|
|
995
801
|
value: e,
|
|
996
802
|
children: e
|
|
997
803
|
}, e))
|
|
998
804
|
})] }),
|
|
999
|
-
/* @__PURE__ */ (
|
|
1000
|
-
value:
|
|
1001
|
-
onChange: (e) =>
|
|
805
|
+
/* @__PURE__ */ n("label", { children: ["Table name", /* @__PURE__ */ t("input", {
|
|
806
|
+
value: s.tableName ?? "",
|
|
807
|
+
onChange: (e) => C("tableName", e.target.value)
|
|
1002
808
|
})] }),
|
|
1003
|
-
/* @__PURE__ */ (
|
|
1004
|
-
value:
|
|
1005
|
-
onChange: (e) =>
|
|
809
|
+
/* @__PURE__ */ n("label", { children: ["Schema", /* @__PURE__ */ t("input", {
|
|
810
|
+
value: s.schema ?? "",
|
|
811
|
+
onChange: (e) => C("schema", e.target.value)
|
|
1006
812
|
})] }),
|
|
1007
|
-
/* @__PURE__ */ (
|
|
1008
|
-
value:
|
|
1009
|
-
onChange: (e) =>
|
|
813
|
+
/* @__PURE__ */ n("label", { children: ["Key columns (comma separated)", /* @__PURE__ */ t("input", {
|
|
814
|
+
value: d,
|
|
815
|
+
onChange: (e) => f(e.target.value)
|
|
1010
816
|
})] }),
|
|
1011
|
-
/* @__PURE__ */ (
|
|
817
|
+
/* @__PURE__ */ n("label", {
|
|
1012
818
|
className: "ec-grid__wide",
|
|
1013
|
-
children: ["Connection string", /* @__PURE__ */ (
|
|
1014
|
-
value:
|
|
1015
|
-
onChange: (e) =>
|
|
819
|
+
children: ["Connection string", /* @__PURE__ */ t("input", {
|
|
820
|
+
value: s.connectionString ?? "",
|
|
821
|
+
onChange: (e) => C("connectionString", e.target.value)
|
|
1016
822
|
})]
|
|
1017
823
|
}),
|
|
1018
|
-
/* @__PURE__ */ (
|
|
824
|
+
/* @__PURE__ */ n("label", {
|
|
1019
825
|
className: "ec-grid__wide",
|
|
1020
|
-
children: ["Where clause", /* @__PURE__ */ (
|
|
1021
|
-
value:
|
|
1022
|
-
onChange: (e) =>
|
|
826
|
+
children: ["Where clause", /* @__PURE__ */ t("input", {
|
|
827
|
+
value: s.whereClause ?? "",
|
|
828
|
+
onChange: (e) => C("whereClause", e.target.value)
|
|
1023
829
|
})]
|
|
1024
830
|
})
|
|
1025
831
|
] });
|
|
1026
832
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return /* @__PURE__ */ (
|
|
1029
|
-
/* @__PURE__ */ (
|
|
1030
|
-
value:
|
|
1031
|
-
onChange: (e) =>
|
|
833
|
+
function k(r) {
|
|
834
|
+
return /* @__PURE__ */ n(e, { children: [
|
|
835
|
+
/* @__PURE__ */ n("label", { children: ["SFTP host", /* @__PURE__ */ t("input", {
|
|
836
|
+
value: s.sftpHost ?? "",
|
|
837
|
+
onChange: (e) => C("sftpHost", e.target.value)
|
|
1032
838
|
})] }),
|
|
1033
|
-
/* @__PURE__ */ (
|
|
839
|
+
/* @__PURE__ */ n("label", { children: ["Port", /* @__PURE__ */ t("input", {
|
|
1034
840
|
type: "number",
|
|
1035
841
|
min: 1,
|
|
1036
|
-
value:
|
|
1037
|
-
onChange: (e) =>
|
|
842
|
+
value: s.sftpPort ?? 22,
|
|
843
|
+
onChange: (e) => C("sftpPort", Number(e.target.value) || 22)
|
|
1038
844
|
})] }),
|
|
1039
|
-
/* @__PURE__ */ (
|
|
1040
|
-
value:
|
|
1041
|
-
onChange: (e) =>
|
|
845
|
+
/* @__PURE__ */ n("label", { children: ["Remote path", /* @__PURE__ */ t("input", {
|
|
846
|
+
value: s.remotePath ?? "",
|
|
847
|
+
onChange: (e) => C("remotePath", e.target.value)
|
|
1042
848
|
})] }),
|
|
1043
|
-
/* @__PURE__ */ (
|
|
1044
|
-
value:
|
|
1045
|
-
onChange: (e) =>
|
|
849
|
+
/* @__PURE__ */ n("label", { children: ["Username", /* @__PURE__ */ t("input", {
|
|
850
|
+
value: s.sftpUsername ?? "",
|
|
851
|
+
onChange: (e) => C("sftpUsername", e.target.value)
|
|
1046
852
|
})] }),
|
|
1047
|
-
/* @__PURE__ */ (
|
|
853
|
+
/* @__PURE__ */ n("label", { children: ["Password", /* @__PURE__ */ t("input", {
|
|
1048
854
|
type: "password",
|
|
1049
|
-
value:
|
|
1050
|
-
onChange: (e) =>
|
|
855
|
+
value: s.sftpPassword ?? "",
|
|
856
|
+
onChange: (e) => C("sftpPassword", e.target.value)
|
|
1051
857
|
})] }),
|
|
1052
|
-
/* @__PURE__ */ (
|
|
1053
|
-
value:
|
|
1054
|
-
onChange: (e) =>
|
|
858
|
+
/* @__PURE__ */ n("label", { children: ["Private key path", /* @__PURE__ */ t("input", {
|
|
859
|
+
value: s.privateKeyPath ?? "",
|
|
860
|
+
onChange: (e) => C("privateKeyPath", e.target.value)
|
|
1055
861
|
})] }),
|
|
1056
|
-
/* @__PURE__ */ (
|
|
862
|
+
/* @__PURE__ */ n("label", {
|
|
1057
863
|
className: "ec-grid__wide",
|
|
1058
|
-
children: ["Host key SHA256", /* @__PURE__ */ (
|
|
1059
|
-
value:
|
|
1060
|
-
onChange: (e) =>
|
|
864
|
+
children: ["Host key SHA256", /* @__PURE__ */ t("input", {
|
|
865
|
+
value: s.hostKeySha256 ?? "",
|
|
866
|
+
onChange: (e) => C("hostKeySha256", e.target.value)
|
|
1061
867
|
})]
|
|
1062
868
|
}),
|
|
1063
|
-
/* @__PURE__ */ (
|
|
869
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Accept any host key" }), /* @__PURE__ */ t("input", {
|
|
1064
870
|
type: "checkbox",
|
|
1065
|
-
checked:
|
|
1066
|
-
onChange: (e) =>
|
|
871
|
+
checked: s.acceptAnyHostKey ?? !1,
|
|
872
|
+
onChange: (e) => C("acceptAnyHostKey", e.target.checked)
|
|
1067
873
|
})] }),
|
|
1068
|
-
|
|
874
|
+
r === "destination" ? /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Overwrite" }), /* @__PURE__ */ t("input", {
|
|
1069
875
|
type: "checkbox",
|
|
1070
|
-
checked:
|
|
1071
|
-
onChange: (e) =>
|
|
876
|
+
checked: s.overwrite ?? !1,
|
|
877
|
+
onChange: (e) => C("overwrite", e.target.checked)
|
|
1072
878
|
})] }) : null
|
|
1073
879
|
] });
|
|
1074
880
|
}
|
|
1075
|
-
function
|
|
1076
|
-
return e === "Folder" ?
|
|
881
|
+
function A(e, t) {
|
|
882
|
+
return e === "Folder" ? D(t) : e === "Table" ? O() : k(t);
|
|
1077
883
|
}
|
|
1078
|
-
function
|
|
884
|
+
function N(e) {
|
|
1079
885
|
return e === "Sftp" ? "SFTP" : e;
|
|
1080
886
|
}
|
|
1081
|
-
return /* @__PURE__ */ (
|
|
887
|
+
return /* @__PURE__ */ n("section", {
|
|
1082
888
|
className: "ec-form",
|
|
1083
889
|
children: [
|
|
1084
|
-
/* @__PURE__ */ (
|
|
890
|
+
/* @__PURE__ */ t("header", {
|
|
1085
891
|
className: "ec-form__header",
|
|
1086
|
-
children: /* @__PURE__ */ (
|
|
892
|
+
children: /* @__PURE__ */ t("h3", { children: r ? "Edit connector" : "Create connector" })
|
|
1087
893
|
}),
|
|
1088
|
-
|
|
894
|
+
p ? /* @__PURE__ */ t("p", {
|
|
1089
895
|
className: "ec-muted",
|
|
1090
896
|
children: "Loading connector..."
|
|
1091
897
|
}) : null,
|
|
1092
|
-
|
|
898
|
+
_ ? /* @__PURE__ */ t("p", {
|
|
1093
899
|
className: "ec-error",
|
|
1094
|
-
children:
|
|
900
|
+
children: _
|
|
1095
901
|
}) : null,
|
|
1096
|
-
|
|
902
|
+
y ? /* @__PURE__ */ t("p", {
|
|
1097
903
|
className: "ec-success",
|
|
1098
|
-
children:
|
|
904
|
+
children: y
|
|
1099
905
|
}) : null,
|
|
1100
|
-
/* @__PURE__ */ (
|
|
906
|
+
/* @__PURE__ */ n("div", {
|
|
1101
907
|
className: "ec-grid ec-grid--meta",
|
|
1102
908
|
children: [
|
|
1103
|
-
/* @__PURE__ */ (
|
|
1104
|
-
value:
|
|
1105
|
-
onChange: (e) =>
|
|
909
|
+
/* @__PURE__ */ n("label", { children: ["Name", /* @__PURE__ */ t("input", {
|
|
910
|
+
value: s.name,
|
|
911
|
+
onChange: (e) => C("name", e.target.value)
|
|
1106
912
|
})] }),
|
|
1107
|
-
/* @__PURE__ */ (
|
|
913
|
+
/* @__PURE__ */ n("label", { children: [
|
|
1108
914
|
"Kind",
|
|
1109
|
-
/* @__PURE__ */ (
|
|
1110
|
-
value:
|
|
1111
|
-
onChange: (e) =>
|
|
1112
|
-
children:
|
|
915
|
+
/* @__PURE__ */ t("select", {
|
|
916
|
+
value: s.kind,
|
|
917
|
+
onChange: (e) => C("kind", e.target.value),
|
|
918
|
+
children: P.map((e) => /* @__PURE__ */ t("option", {
|
|
1113
919
|
value: e,
|
|
1114
920
|
children: e
|
|
1115
921
|
}, e))
|
|
1116
922
|
}),
|
|
1117
|
-
/* @__PURE__ */ (
|
|
923
|
+
/* @__PURE__ */ n("span", {
|
|
1118
924
|
className: "ec-kind-preview",
|
|
1119
|
-
children: [/* @__PURE__ */ (
|
|
925
|
+
children: [/* @__PURE__ */ t(E, { kind: s.kind }), s.kind]
|
|
1120
926
|
}),
|
|
1121
|
-
/* @__PURE__ */ (
|
|
927
|
+
/* @__PURE__ */ n("span", {
|
|
1122
928
|
className: "ec-flow ec-flow--compact",
|
|
1123
|
-
"aria-label": `Flow ${
|
|
929
|
+
"aria-label": `Flow ${S.source} to ${S.destination}`,
|
|
1124
930
|
children: [
|
|
1125
|
-
/* @__PURE__ */ (
|
|
931
|
+
/* @__PURE__ */ n("span", {
|
|
1126
932
|
className: "ec-flow__node",
|
|
1127
|
-
children: [/* @__PURE__ */ (
|
|
933
|
+
children: [/* @__PURE__ */ t(j, { endpoint: S.source }), /* @__PURE__ */ t("span", { children: S.source })]
|
|
1128
934
|
}),
|
|
1129
|
-
/* @__PURE__ */ (
|
|
935
|
+
/* @__PURE__ */ t("span", {
|
|
1130
936
|
className: "ec-flow__arrow",
|
|
1131
937
|
"aria-hidden": "true",
|
|
1132
938
|
children: "->"
|
|
1133
939
|
}),
|
|
1134
|
-
/* @__PURE__ */ (
|
|
940
|
+
/* @__PURE__ */ n("span", {
|
|
1135
941
|
className: "ec-flow__connector",
|
|
1136
|
-
children: [/* @__PURE__ */ (
|
|
1137
|
-
kind:
|
|
942
|
+
children: [/* @__PURE__ */ t(E, {
|
|
943
|
+
kind: s.kind,
|
|
1138
944
|
className: "ec-kind-icon--chip"
|
|
1139
|
-
}), /* @__PURE__ */ (
|
|
945
|
+
}), /* @__PURE__ */ t("span", { children: "Connector" })]
|
|
1140
946
|
}),
|
|
1141
|
-
/* @__PURE__ */ (
|
|
947
|
+
/* @__PURE__ */ t("span", {
|
|
1142
948
|
className: "ec-flow__arrow",
|
|
1143
949
|
"aria-hidden": "true",
|
|
1144
950
|
children: "->"
|
|
1145
951
|
}),
|
|
1146
|
-
/* @__PURE__ */ (
|
|
952
|
+
/* @__PURE__ */ n("span", {
|
|
1147
953
|
className: "ec-flow__node",
|
|
1148
|
-
children: [/* @__PURE__ */ (
|
|
954
|
+
children: [/* @__PURE__ */ t(j, { endpoint: S.destination }), /* @__PURE__ */ t("span", { children: S.destination })]
|
|
1149
955
|
})
|
|
1150
956
|
]
|
|
1151
957
|
})
|
|
1152
958
|
] }),
|
|
1153
|
-
/* @__PURE__ */ (
|
|
1154
|
-
value:
|
|
1155
|
-
onChange: (e) =>
|
|
1156
|
-
children:
|
|
959
|
+
/* @__PURE__ */ n("label", { children: ["Mode", /* @__PURE__ */ t("select", {
|
|
960
|
+
value: s.mode,
|
|
961
|
+
onChange: (e) => C("mode", e.target.value),
|
|
962
|
+
children: F.map((e) => /* @__PURE__ */ t("option", {
|
|
1157
963
|
value: e,
|
|
1158
964
|
children: e
|
|
1159
965
|
}, e))
|
|
1160
966
|
})] })
|
|
1161
967
|
]
|
|
1162
968
|
}),
|
|
1163
|
-
/* @__PURE__ */ (
|
|
969
|
+
/* @__PURE__ */ n("div", {
|
|
1164
970
|
className: "ec-endpoint-grid",
|
|
1165
|
-
children: [/* @__PURE__ */ (
|
|
971
|
+
children: [/* @__PURE__ */ n("section", {
|
|
1166
972
|
className: "ec-endpoint-panel",
|
|
1167
|
-
children: [/* @__PURE__ */ (
|
|
973
|
+
children: [/* @__PURE__ */ n("header", {
|
|
1168
974
|
className: "ec-endpoint-panel__header",
|
|
1169
|
-
children: [/* @__PURE__ */ (
|
|
975
|
+
children: [/* @__PURE__ */ t(j, { endpoint: S.source }), /* @__PURE__ */ n("h4", { children: [
|
|
1170
976
|
"Source config (",
|
|
1171
|
-
|
|
977
|
+
N(S.source),
|
|
1172
978
|
")"
|
|
1173
979
|
] })]
|
|
1174
|
-
}), /* @__PURE__ */ (
|
|
980
|
+
}), /* @__PURE__ */ t("div", {
|
|
1175
981
|
className: "ec-grid ec-grid--endpoint",
|
|
1176
|
-
children:
|
|
982
|
+
children: A(S.source, "source")
|
|
1177
983
|
})]
|
|
1178
|
-
}), /* @__PURE__ */ (
|
|
984
|
+
}), /* @__PURE__ */ n("section", {
|
|
1179
985
|
className: "ec-endpoint-panel",
|
|
1180
|
-
children: [/* @__PURE__ */ (
|
|
986
|
+
children: [/* @__PURE__ */ n("header", {
|
|
1181
987
|
className: "ec-endpoint-panel__header",
|
|
1182
|
-
children: [/* @__PURE__ */ (
|
|
988
|
+
children: [/* @__PURE__ */ t(j, { endpoint: S.destination }), /* @__PURE__ */ n("h4", { children: [
|
|
1183
989
|
"Destination config (",
|
|
1184
|
-
|
|
990
|
+
N(S.destination),
|
|
1185
991
|
")"
|
|
1186
992
|
] })]
|
|
1187
|
-
}), /* @__PURE__ */ (
|
|
993
|
+
}), /* @__PURE__ */ t("div", {
|
|
1188
994
|
className: "ec-grid ec-grid--endpoint",
|
|
1189
|
-
children:
|
|
995
|
+
children: A(S.destination, "destination")
|
|
1190
996
|
})]
|
|
1191
997
|
})]
|
|
1192
998
|
}),
|
|
1193
|
-
/* @__PURE__ */ (
|
|
999
|
+
/* @__PURE__ */ n("fieldset", {
|
|
1194
1000
|
className: "ec-form__fieldset",
|
|
1195
|
-
children: [/* @__PURE__ */ (
|
|
1001
|
+
children: [/* @__PURE__ */ t("legend", { children: "Triggers" }), /* @__PURE__ */ t("div", {
|
|
1196
1002
|
className: "ec-check-row",
|
|
1197
|
-
children:
|
|
1003
|
+
children: I.map((e) => /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("input", {
|
|
1198
1004
|
type: "checkbox",
|
|
1199
|
-
checked:
|
|
1200
|
-
onChange: () =>
|
|
1005
|
+
checked: s.triggers.includes(e),
|
|
1006
|
+
onChange: () => w(e)
|
|
1201
1007
|
}), e] }, e))
|
|
1202
1008
|
})]
|
|
1203
1009
|
}),
|
|
1204
|
-
/* @__PURE__ */ (
|
|
1010
|
+
/* @__PURE__ */ n("fieldset", {
|
|
1205
1011
|
className: "ec-form__fieldset",
|
|
1206
|
-
children: [/* @__PURE__ */ (
|
|
1012
|
+
children: [/* @__PURE__ */ t("legend", { children: "Options" }), /* @__PURE__ */ n("div", {
|
|
1207
1013
|
className: "ec-check-row",
|
|
1208
1014
|
children: [
|
|
1209
|
-
/* @__PURE__ */ (
|
|
1015
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("input", {
|
|
1210
1016
|
type: "checkbox",
|
|
1211
|
-
checked:
|
|
1212
|
-
onChange: (e) =>
|
|
1017
|
+
checked: s.skipEmptyFiles ?? !1,
|
|
1018
|
+
onChange: (e) => C("skipEmptyFiles", e.target.checked)
|
|
1213
1019
|
}), "Skip empty files"] }),
|
|
1214
|
-
/* @__PURE__ */ (
|
|
1020
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("input", {
|
|
1215
1021
|
type: "checkbox",
|
|
1216
|
-
checked:
|
|
1217
|
-
onChange: (e) =>
|
|
1022
|
+
checked: s.continueOnError ?? !1,
|
|
1023
|
+
onChange: (e) => C("continueOnError", e.target.checked)
|
|
1218
1024
|
}), "Continue on error"] }),
|
|
1219
|
-
/* @__PURE__ */ (
|
|
1025
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("input", {
|
|
1220
1026
|
type: "number",
|
|
1221
1027
|
min: 1,
|
|
1222
|
-
value:
|
|
1223
|
-
onChange: (e) =>
|
|
1028
|
+
value: s.intervalMinutes ?? 15,
|
|
1029
|
+
onChange: (e) => C("intervalMinutes", Number(e.target.value) || 1)
|
|
1224
1030
|
}), "Interval minutes"] }),
|
|
1225
|
-
/* @__PURE__ */ (
|
|
1031
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("input", {
|
|
1226
1032
|
type: "time",
|
|
1227
|
-
value:
|
|
1228
|
-
onChange: (e) =>
|
|
1033
|
+
value: s.dailyTimeLocal ?? "",
|
|
1034
|
+
onChange: (e) => C("dailyTimeLocal", e.target.value)
|
|
1229
1035
|
}), "Daily time (local)"] })
|
|
1230
1036
|
]
|
|
1231
1037
|
})]
|
|
1232
1038
|
}),
|
|
1233
|
-
/* @__PURE__ */ (
|
|
1039
|
+
/* @__PURE__ */ t("footer", {
|
|
1234
1040
|
className: "ec-form__footer",
|
|
1235
|
-
children: /* @__PURE__ */ (
|
|
1041
|
+
children: /* @__PURE__ */ t("button", {
|
|
1236
1042
|
type: "button",
|
|
1237
1043
|
className: "ec-primary",
|
|
1238
|
-
onClick:
|
|
1239
|
-
disabled:
|
|
1240
|
-
children:
|
|
1044
|
+
onClick: T,
|
|
1045
|
+
disabled: h,
|
|
1046
|
+
children: h ? "Saving..." : "Save connector"
|
|
1241
1047
|
})
|
|
1242
1048
|
})
|
|
1243
1049
|
]
|
|
1244
1050
|
});
|
|
1245
1051
|
}
|
|
1246
1052
|
// src/easy-connectors/ConnectorRuns.tsx
|
|
1247
|
-
function
|
|
1248
|
-
let { client:
|
|
1249
|
-
return
|
|
1053
|
+
function B({ connectorId: e, take: r = 20 }) {
|
|
1054
|
+
let { client: i } = b(), [a, s] = u([]), [c, l] = u(null), [d, f] = u(!1);
|
|
1055
|
+
return o(() => {
|
|
1250
1056
|
if (!e) {
|
|
1251
|
-
|
|
1057
|
+
s([]);
|
|
1252
1058
|
return;
|
|
1253
1059
|
}
|
|
1254
|
-
let
|
|
1255
|
-
return
|
|
1256
|
-
|
|
1060
|
+
let t = !1;
|
|
1061
|
+
return f(!0), l(null), i.getRuns(e, r).then((e) => {
|
|
1062
|
+
t || s(e);
|
|
1257
1063
|
}).catch((e) => {
|
|
1258
|
-
|
|
1064
|
+
t || l(e instanceof Error ? e.message : "Failed to load runs.");
|
|
1259
1065
|
}).finally(() => {
|
|
1260
|
-
|
|
1066
|
+
t || f(!1);
|
|
1261
1067
|
}), () => {
|
|
1262
|
-
|
|
1068
|
+
t = !0;
|
|
1263
1069
|
};
|
|
1264
1070
|
}, [
|
|
1265
|
-
|
|
1071
|
+
i,
|
|
1266
1072
|
e,
|
|
1267
|
-
|
|
1268
|
-
]), /* @__PURE__ */ (
|
|
1073
|
+
r
|
|
1074
|
+
]), /* @__PURE__ */ n("section", {
|
|
1269
1075
|
className: "ec-runs",
|
|
1270
1076
|
children: [
|
|
1271
|
-
/* @__PURE__ */ (
|
|
1077
|
+
/* @__PURE__ */ t("header", {
|
|
1272
1078
|
className: "ec-runs__header",
|
|
1273
|
-
children: /* @__PURE__ */ (
|
|
1079
|
+
children: /* @__PURE__ */ t("h3", { children: "Recent runs" })
|
|
1274
1080
|
}),
|
|
1275
|
-
e ? null : /* @__PURE__ */ (
|
|
1081
|
+
e ? null : /* @__PURE__ */ t("p", {
|
|
1276
1082
|
className: "ec-muted",
|
|
1277
1083
|
children: "Select a connector to view run history."
|
|
1278
1084
|
}),
|
|
1279
|
-
|
|
1085
|
+
d ? /* @__PURE__ */ t("p", {
|
|
1280
1086
|
className: "ec-muted",
|
|
1281
1087
|
children: "Loading runs..."
|
|
1282
1088
|
}) : null,
|
|
1283
|
-
|
|
1089
|
+
c ? /* @__PURE__ */ t("p", {
|
|
1284
1090
|
className: "ec-error",
|
|
1285
|
-
children:
|
|
1091
|
+
children: c
|
|
1286
1092
|
}) : null,
|
|
1287
|
-
e &&
|
|
1093
|
+
e && a.length > 0 ? /* @__PURE__ */ t("div", {
|
|
1288
1094
|
className: "ec-table-wrap",
|
|
1289
|
-
children: /* @__PURE__ */ (
|
|
1095
|
+
children: /* @__PURE__ */ n("table", {
|
|
1290
1096
|
className: "ec-table",
|
|
1291
|
-
children: [/* @__PURE__ */ (
|
|
1292
|
-
/* @__PURE__ */ (
|
|
1293
|
-
/* @__PURE__ */ (
|
|
1294
|
-
/* @__PURE__ */ (
|
|
1295
|
-
/* @__PURE__ */ (
|
|
1296
|
-
/* @__PURE__ */ (
|
|
1297
|
-
] }) }), /* @__PURE__ */ (
|
|
1298
|
-
/* @__PURE__ */ (
|
|
1299
|
-
/* @__PURE__ */ (
|
|
1300
|
-
/* @__PURE__ */ (
|
|
1301
|
-
/* @__PURE__ */ (
|
|
1302
|
-
/* @__PURE__ */ (
|
|
1097
|
+
children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ n("tr", { children: [
|
|
1098
|
+
/* @__PURE__ */ t("th", { children: "Status" }),
|
|
1099
|
+
/* @__PURE__ */ t("th", { children: "Started" }),
|
|
1100
|
+
/* @__PURE__ */ t("th", { children: "Transferred" }),
|
|
1101
|
+
/* @__PURE__ */ t("th", { children: "Skipped" }),
|
|
1102
|
+
/* @__PURE__ */ t("th", { children: "Failed" })
|
|
1103
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: a.map((e) => /* @__PURE__ */ n("tr", { children: [
|
|
1104
|
+
/* @__PURE__ */ t("td", { children: e.status }),
|
|
1105
|
+
/* @__PURE__ */ t("td", { children: new Date(e.startedUtc).toLocaleString() }),
|
|
1106
|
+
/* @__PURE__ */ t("td", { children: e.transferred }),
|
|
1107
|
+
/* @__PURE__ */ t("td", { children: e.skipped }),
|
|
1108
|
+
/* @__PURE__ */ t("td", { children: e.failed })
|
|
1303
1109
|
] }, e.id)) })]
|
|
1304
1110
|
})
|
|
1305
1111
|
}) : null
|
|
@@ -1307,27 +1113,27 @@ function H({ connectorId: e, take: t = 20 }) {
|
|
|
1307
1113
|
});
|
|
1308
1114
|
}
|
|
1309
1115
|
// src/easy-connectors/EasyConnectorsApp.tsx
|
|
1310
|
-
function
|
|
1311
|
-
let [
|
|
1312
|
-
return /* @__PURE__ */ (
|
|
1116
|
+
function V({ className: e }) {
|
|
1117
|
+
let [r, i] = u(void 0), [a, o] = u(0);
|
|
1118
|
+
return /* @__PURE__ */ n("section", {
|
|
1313
1119
|
className: ["ec-app", e].filter(Boolean).join(" "),
|
|
1314
|
-
children: [/* @__PURE__ */ (
|
|
1120
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1315
1121
|
className: "ec-app__left",
|
|
1316
|
-
children: /* @__PURE__ */ (
|
|
1317
|
-
selectedConnectorId:
|
|
1318
|
-
onSelect:
|
|
1319
|
-
onCreate: () =>
|
|
1320
|
-
refreshToken:
|
|
1122
|
+
children: /* @__PURE__ */ t(N, {
|
|
1123
|
+
selectedConnectorId: r,
|
|
1124
|
+
onSelect: i,
|
|
1125
|
+
onCreate: () => i(void 0),
|
|
1126
|
+
refreshToken: a
|
|
1321
1127
|
})
|
|
1322
|
-
}), /* @__PURE__ */ (
|
|
1128
|
+
}), /* @__PURE__ */ n("div", {
|
|
1323
1129
|
className: "ec-app__right",
|
|
1324
|
-
children: [/* @__PURE__ */ (
|
|
1325
|
-
connectorId:
|
|
1130
|
+
children: [/* @__PURE__ */ t(z, {
|
|
1131
|
+
connectorId: r,
|
|
1326
1132
|
onSaved: (e) => {
|
|
1327
|
-
|
|
1133
|
+
i(e.id), o((e) => e + 1);
|
|
1328
1134
|
}
|
|
1329
|
-
}), /* @__PURE__ */ (
|
|
1135
|
+
}), /* @__PURE__ */ t(B, { connectorId: r })]
|
|
1330
1136
|
})]
|
|
1331
1137
|
});
|
|
1332
1138
|
}
|
|
1333
|
-
export {
|
|
1139
|
+
export { N as ConnectorBoard, z as ConnectorForm, E as ConnectorKindIcon, B as ConnectorRuns, V as EasyConnectorsApp, _ as EasyConnectorsClient, y as EasyConnectorsProvider, j as EndpointKindIcon, h as Ribbon, f as RibbonButton, p as RibbonCarousel, m as RibbonDropdown, g as RibbonSplitButton, M as getConnectorFlow, b as useEasyConnectors };
|