@fluxo-dev/shell 0.0.40 → 0.0.42

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.
@@ -0,0 +1,108 @@
1
+ import { d as defineComponent, S as r, bz as useAttrs, a5 as nanoid, r as ref, bA as useTextareaAutosize, k as onMounted, U as openBlock, V as createElementBlock, Z as createBaseVNode, $ as createBlock, aj as mergeProps, G as unref, a4 as x, a8 as withKeys, bf as resolveDynamicComponent, a3 as normalizeClass, X as normalizeStyle, ab as toDisplayString, a2 as createCommentVNode, _ as renderSlot, a1 as c, ad as createTextVNode, bB as s } from './index.esm2.js';
2
+
3
+ const P = { class: "scalar-input-container relative" }, R = ["for"], j = { class: "icon-slot cursor-pointer text-c-ghost hover:text-c-1 !empty:flex !empty:w-7 !empty:items-center !empty:pr-3" }, Q = /* @__PURE__ */ defineComponent({
4
+ __name: "ScalarTextField",
5
+ props: {
6
+ modelValue: {},
7
+ placeholder: {},
8
+ label: {},
9
+ labelShadowColor: { default: "var(--scalar-background-1)" },
10
+ error: { type: Boolean },
11
+ isMultiline: { type: Boolean },
12
+ helperText: {},
13
+ emitOnBlur: { type: Boolean, default: !0 },
14
+ handleFieldSubmit: {},
15
+ handleFieldChange: {},
16
+ disableTrim: { type: Boolean, default: !1 }
17
+ },
18
+ emits: ["submit", "update:modelValue"],
19
+ setup(w, { emit: S }) {
20
+ const t = w, p = S, B = r({
21
+ base: "scalar-input-wrapper relative flex items-center rounded border border-solid border-border",
22
+ variants: {
23
+ focus: {
24
+ true: "scalar-input-wrapper-focus border-c-3 has-actv-btn:border has-actv-btn:border-border"
25
+ },
26
+ error: { true: "scalar-input-wrapper-error border-red" }
27
+ }
28
+ }), c$1 = useAttrs(), m = c$1.id || `id-${nanoid()}`, a = ref(), n = ref(!1);
29
+ let f;
30
+ if (t.isMultiline) {
31
+ const { triggerResize: e } = useTextareaAutosize({
32
+ element: a,
33
+ input: t.modelValue
34
+ });
35
+ f = e;
36
+ }
37
+ function C(e) {
38
+ const r = e.target.value;
39
+ t.isMultiline && f(), t.handleFieldChange ? t.handleFieldChange(r) : p("update:modelValue", r);
40
+ }
41
+ function b(e) {
42
+ const r = e.target, i = t.disableTrim || t.isMultiline ? r.value : r.value.trim();
43
+ t.handleFieldSubmit ? t.handleFieldSubmit(i) : p("submit", i);
44
+ }
45
+ function F(e) {
46
+ n.value = !1, t.emitOnBlur && t.modelValue && b(e);
47
+ }
48
+ return onMounted(() => {
49
+ var e;
50
+ Object.prototype.hasOwnProperty.call(c$1, "autofocus") && ((e = a.value) == null || e.focus());
51
+ }), (e, r) => (openBlock(), createElementBlock("div", P, [
52
+ createBaseVNode("div", {
53
+ class: normalizeClass(unref(B)({ error: e.error, focus: n.value }))
54
+ }, [
55
+ (openBlock(), createBlock(resolveDynamicComponent(e.isMultiline ? "textarea" : "input"), mergeProps({ id: unref(m) }, e.$attrs, {
56
+ ref_key: "input",
57
+ ref: a,
58
+ class: [
59
+ "scalar-input",
60
+ unref(x)(
61
+ { "min-h-[77px]": e.isMultiline },
62
+ "z-10 w-full resize-none appearance-none border-0 bg-transparent p-3 text-sm text-c-1",
63
+ "outline-none transition-opacity"
64
+ )
65
+ ],
66
+ placeholder: e.placeholder,
67
+ value: e.modelValue,
68
+ onBlur: F,
69
+ onFocus: r[0] || (r[0] = (i) => n.value = !0),
70
+ onInput: C,
71
+ onKeydown: withKeys(b, ["enter"])
72
+ }), null, 16, ["id", "class", "placeholder", "value"])),
73
+ e.label ? (openBlock(), createElementBlock("label", {
74
+ key: 0,
75
+ class: normalizeClass(
76
+ unref(x)(
77
+ "scalar-input-label pointer-events-none absolute left-0 top-0 mx-2 my-3 px-1 text-sm",
78
+ "z-10 origin-top-left rounded text-c-3 shadow-current transition-transform"
79
+ )
80
+ ),
81
+ for: unref(m),
82
+ style: normalizeStyle({
83
+ "box-shadow": `0 0 4px 4px ${e.labelShadowColor}`,
84
+ "background-color": e.labelShadowColor
85
+ })
86
+ }, toDisplayString(e.label), 15, R)) : createCommentVNode("", !0),
87
+ createBaseVNode("div", j, [
88
+ renderSlot(e.$slots, "default", {}, void 0, !0)
89
+ ])
90
+ ], 2),
91
+ e.helperText ? (openBlock(), createElementBlock("span", {
92
+ key: 0,
93
+ class: normalizeClass(["helper-text mt-1.5 flex items-center gap-1 text-sm", e.error ? "font-medium text-red" : "text-c-2"])
94
+ }, [
95
+ e.error ? (openBlock(), createBlock(unref(c), {
96
+ key: 0,
97
+ icon: "Error",
98
+ size: "sm"
99
+ })) : createCommentVNode("", !0),
100
+ createTextVNode(" " + toDisplayString(e.helperText), 1)
101
+ ], 2)) : createCommentVNode("", !0)
102
+ ]));
103
+ }
104
+ });
105
+
106
+ const m = /* @__PURE__ */ s(Q, [["__scopeId", "data-v-4de7a24e"]]);
107
+
108
+ export { m };
@@ -0,0 +1,151 @@
1
+ import { d as defineComponent, ap as w, aq as Te, aX as useRoute, c as computed, U as openBlock, V as createElementBlock, F as Fragment, W as createVNode, $ as createBlock, a2 as createCommentVNode, ar as useRouter, ac as withCtx, G as unref, Z as createBaseVNode, aa as renderList, ad as createTextVNode, b3 as serverSchema } from './index.esm2.js';
2
+ import { e as m, g } from './SidebarButton.vue.esm.js';
3
+ import { a, b as a$1 } from './SidebarListElement.vue.esm.js';
4
+ import { x, a as a$2 } from './ViewLayoutContent.vue.esm.js';
5
+ import { E } from './Form.vue.esm.js';
6
+ import 'react/jsx-runtime';
7
+ import 'react';
8
+ import 'react-redux';
9
+ import 'react-router-dom';
10
+ import '@fluxo-dev/ui-components';
11
+ import '@fluxo-dev/shell-mfe';
12
+ import '@mantine/core';
13
+ import '@fluxo-dev/shell-ravify';
14
+ import '@fluxo-dev/state';
15
+ import '@mantine/hooks';
16
+ import '@mantine/spotlight';
17
+ import '@fluxo-dev/api-client-base';
18
+ import '@mantine/notifications';
19
+ import 'react-dom';
20
+ import '@mantine/form';
21
+ import '@mantine/dates';
22
+ import '@mantine/dropzone';
23
+ import '@fluxo-dev/shell-reporting';
24
+ import '@fluxo-dev/shell-workflow';
25
+ import '@fluxo-dev/shell-bi';
26
+ import '@fluxo-dev/shell-hub';
27
+ import '@fluxo-dev/shell-printing';
28
+ import 'node:crypto';
29
+ import 'util';
30
+ import './DataTableInput.vue.esm.js';
31
+
32
+ const B = { class: "w-full" }, N = /* @__PURE__ */ defineComponent({
33
+ __name: "ServerForm",
34
+ setup(C) {
35
+ const { activeCollection: a } = w(), { servers: v, serverMutators: u } = Te(), f = [
36
+ { label: "URL", key: "url", placeholder: "https://void.scalar.com/api" },
37
+ {
38
+ label: "Label",
39
+ key: "description",
40
+ placeholder: "Production"
41
+ }
42
+ ], c = useRoute(), o = computed(
43
+ () => {
44
+ var e, t;
45
+ return v[a.value && c.params.server === "default" ? (e = a.value) == null ? void 0 : e.servers[0] : ((t = a.value) == null ? void 0 : t.servers.find(
46
+ (r) => r === c.params.server
47
+ )) ?? ""];
48
+ }
49
+ ), _ = (e, t) => {
50
+ a.value && u.edit(o.value.uid, e, t);
51
+ }, k = (e, t) => {
52
+ a.value && u.edit(o.value.uid, `variables.${e}.value`, t);
53
+ }, h = computed(
54
+ () => {
55
+ var e;
56
+ return Object.entries(((e = o.value) == null ? void 0 : e.variables) ?? {}).map(
57
+ ([t, r]) => {
58
+ var s;
59
+ return {
60
+ key: t,
61
+ label: t,
62
+ placeholder: (r.default ?? ((s = r == null ? void 0 : r.enum) == null ? void 0 : s[0]) ?? "").toString()
63
+ };
64
+ }
65
+ );
66
+ }
67
+ ), i = computed(
68
+ () => Object.entries(o.value.variables ?? {}).reduce((e, [t, r]) => {
69
+ var s;
70
+ return e[t] = (r.default ?? ((s = r == null ? void 0 : r.enum) == null ? void 0 : s[0]) ?? "").toString(), e;
71
+ }, {})
72
+ );
73
+ return (e, t) => (openBlock(), createElementBlock("div", B, [
74
+ o.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
75
+ createVNode(E, {
76
+ data: o.value,
77
+ onUpdate: _,
78
+ options: f,
79
+ title: "Server"
80
+ }, null, 8, ["data"]),
81
+ Object.keys(i.value).length ? (openBlock(), createBlock(E, {
82
+ key: 0,
83
+ data: i.value,
84
+ onUpdate: k,
85
+ options: h.value,
86
+ title: "Variables"
87
+ }, null, 8, ["data", "options"])) : createCommentVNode("", !0)
88
+ ], 64)) : createCommentVNode("", !0)
89
+ ]));
90
+ }
91
+ });
92
+
93
+ const $ = { class: "flex-1" }, J = /* @__PURE__ */ defineComponent({
94
+ __name: "Servers",
95
+ setup(g$1) {
96
+ const { activeCollection: t } = w(), { servers: u, serverMutators: c } = Te(), { push: f } = useRouter(), p = () => {
97
+ if (!t.value) return;
98
+ const o = serverSchema.parse({ url: "http://localhost" });
99
+ c.add(o, t.value.uid), f({
100
+ name: "servers",
101
+ params: {
102
+ server: o.uid
103
+ }
104
+ });
105
+ };
106
+ return (o, i) => (openBlock(), createBlock(a$2, null, {
107
+ default: withCtx(() => [
108
+ createVNode(unref(m), { title: "Servers" }, {
109
+ content: withCtx(() => [
110
+ createBaseVNode("div", $, [
111
+ createVNode(a, null, {
112
+ default: withCtx(() => {
113
+ var l;
114
+ return [
115
+ (openBlock(!0), createElementBlock(Fragment, null, renderList((l = unref(t)) == null ? void 0 : l.servers, (s) => (openBlock(), createBlock(a$1, {
116
+ key: s,
117
+ class: "text-xs",
118
+ variable: {
119
+ name: unref(u)[s].url ?? "",
120
+ uid: s
121
+ }
122
+ }, null, 8, ["variable"]))), 128))
123
+ ];
124
+ }),
125
+ _: 1
126
+ })
127
+ ])
128
+ ]),
129
+ button: withCtx(() => [
130
+ createVNode(g, { click: p }, {
131
+ title: withCtx(() => i[0] || (i[0] = [
132
+ createTextVNode("Add Server")
133
+ ])),
134
+ _: 1
135
+ })
136
+ ]),
137
+ _: 1
138
+ }),
139
+ createVNode(x, { class: "flex-1" }, {
140
+ default: withCtx(() => [
141
+ createVNode(N)
142
+ ]),
143
+ _: 1
144
+ })
145
+ ]),
146
+ _: 1
147
+ }));
148
+ }
149
+ });
150
+
151
+ export { J as default };