@dappworks/kit 0.4.123 → 0.4.125
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/{PromiseState-yojg0WLR.d.ts → PromiseState-b0cc408e.d.ts} +3 -3
- package/dist/aiem.d.mts +1 -1
- package/dist/aiem.mjs +21 -5
- package/dist/{chunk-R4SQKVDQ.mjs → chunk-6F7H4PAA.mjs} +1 -1
- package/dist/{chunk-SVPD6PC6.mjs → chunk-7FF4BCFW.mjs} +4 -4
- package/dist/{chunk-WS43BV7Y.mjs → chunk-DZMNL4BZ.mjs} +2 -2
- package/dist/{chunk-XJMRAPHI.mjs → chunk-HRWHDF2F.mjs} +7 -7
- package/dist/{chunk-XJMRAPHI.mjs.map → chunk-HRWHDF2F.mjs.map} +1 -1
- package/dist/{chunk-QWHU3HBK.mjs → chunk-PPYYRQDD.mjs} +2 -2
- package/dist/{chunk-HRYH37UI.mjs → chunk-WT2ARRCR.mjs} +2 -2
- package/dist/{chunk-AIZ7XDNV.mjs → chunk-WYGQ3Y4R.mjs} +14 -14
- package/dist/chunk-WYGQ3Y4R.mjs.map +1 -0
- package/dist/dev.d.mts +1 -1
- package/dist/dev.mjs +2 -2
- package/dist/experimental.d.mts +2 -2
- package/dist/experimental.mjs +3 -3
- package/dist/form.d.mts +5 -4
- package/dist/form.mjs +117 -24
- package/dist/form.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +5 -5
- package/dist/inspector.d.mts +1 -1
- package/dist/inspector.mjs +1 -1
- package/dist/jsontable.d.mts +2 -2
- package/dist/jsontable.mjs +4 -4
- package/dist/metrics.d.mts +1 -1
- package/dist/metrics.mjs +5 -5
- package/dist/metrics.mjs.map +1 -1
- package/dist/plugins.d.mts +2 -2
- package/dist/plugins.mjs +10 -6
- package/dist/plugins.mjs.map +1 -1
- package/dist/{root-C3lZnoCI.d.ts → root-766ae985.d.ts} +1 -1
- package/dist/ui.mjs +3 -3
- package/dist/utils.d.mts +3 -8
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-AIZ7XDNV.mjs.map +0 -1
- /package/dist/{PaginationState-Bmrrw0ky.d.ts → PaginationState-c19e621a.d.ts} +0 -0
- /package/dist/{chunk-R4SQKVDQ.mjs.map → chunk-6F7H4PAA.mjs.map} +0 -0
- /package/dist/{chunk-SVPD6PC6.mjs.map → chunk-7FF4BCFW.mjs.map} +0 -0
- /package/dist/{chunk-WS43BV7Y.mjs.map → chunk-DZMNL4BZ.mjs.map} +0 -0
- /package/dist/{chunk-QWHU3HBK.mjs.map → chunk-PPYYRQDD.mjs.map} +0 -0
- /package/dist/{chunk-HRYH37UI.mjs.map → chunk-WT2ARRCR.mjs.map} +0 -0
package/dist/form.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useStore } from './chunk-
|
|
2
|
-
import { RootStore } from './chunk-
|
|
1
|
+
import { useStore } from './chunk-DZMNL4BZ.mjs';
|
|
2
|
+
import { RootStore } from './chunk-HRWHDF2F.mjs';
|
|
3
3
|
import { helper } from './chunk-Q3AD5RHQ.mjs';
|
|
4
4
|
import { _ } from './chunk-MGU3KYGC.mjs';
|
|
5
|
-
import { cn } from './chunk-
|
|
6
|
-
import { __objRest, __spreadValues, __spreadProps } from './chunk-
|
|
7
|
-
import React7, { useEffect, useMemo, useState,
|
|
5
|
+
import { cn } from './chunk-WYGQ3Y4R.mjs';
|
|
6
|
+
import { __objRest, __spreadValues, __spreadProps } from './chunk-6F7H4PAA.mjs';
|
|
7
|
+
import React7, { useEffect, useMemo, useState, useRef, useCallback, createRef } from 'react';
|
|
8
8
|
import { Modal, ModalContent, ModalHeader, ModalBody, Checkbox, Input, Select, SelectItem, Button, Textarea, DatePicker, Chip, Card, Tabs, Tab } from '@nextui-org/react';
|
|
9
9
|
import { Check, ChevronUp, ChevronDown } from 'lucide-react';
|
|
10
10
|
import MonacoEditor from '@monaco-editor/react';
|
|
@@ -25,7 +25,16 @@ function CheckboxWidget({
|
|
|
25
25
|
disabled,
|
|
26
26
|
uiSchema
|
|
27
27
|
}) {
|
|
28
|
-
const {
|
|
28
|
+
const {
|
|
29
|
+
className,
|
|
30
|
+
nextuiClassNames = {
|
|
31
|
+
base: "m-0 flex items-center justify-start w-full cursor-pointer rounded-lg gap-2 p-[13px] bg-transparent border dark:border-[#2c2c2c]"
|
|
32
|
+
},
|
|
33
|
+
size = "sm",
|
|
34
|
+
color = "primary",
|
|
35
|
+
description,
|
|
36
|
+
descriptionClassName
|
|
37
|
+
} = options;
|
|
29
38
|
const { validate } = uiSchema;
|
|
30
39
|
const [errMsg, setErrMsg] = useState("");
|
|
31
40
|
const isInvalid = !!errMsg;
|
|
@@ -33,9 +42,7 @@ function CheckboxWidget({
|
|
|
33
42
|
Checkbox,
|
|
34
43
|
{
|
|
35
44
|
className: cn("w-full", className),
|
|
36
|
-
classNames:
|
|
37
|
-
base: cn("m-0 flex items-center justify-start w-full", "cursor-pointer rounded-lg gap-2 p-[13px] bg-content2 border-1 border-transparent", nextuiClassNames.base, value ? `border-${color}` : "")
|
|
38
|
-
}),
|
|
45
|
+
classNames: nextuiClassNames,
|
|
39
46
|
defaultSelected: value,
|
|
40
47
|
isDisabled: disabled,
|
|
41
48
|
icon: /* @__PURE__ */ React7.createElement(Check, { className: "bg-white dark:bg-black" }),
|
|
@@ -60,9 +67,24 @@ function CheckboxWidget({
|
|
|
60
67
|
function InputWidget(props) {
|
|
61
68
|
var _a;
|
|
62
69
|
const { onChange, options, label, value, required, disabled, uiSchema } = props;
|
|
63
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
className,
|
|
72
|
+
nextuiClassNames = {
|
|
73
|
+
inputWrapper: "rounded-lg shadow-none border dark:border-[#2c2c2c] !bg-transparent data-[hover=true]:!bg-default-50 group-data-[focus=true]:!bg-transparent"
|
|
74
|
+
},
|
|
75
|
+
labelPlacement = "inside",
|
|
76
|
+
size = "sm",
|
|
77
|
+
inputType = "text",
|
|
78
|
+
color,
|
|
79
|
+
variant,
|
|
80
|
+
radius,
|
|
81
|
+
startContent,
|
|
82
|
+
endContent,
|
|
83
|
+
description
|
|
84
|
+
} = options;
|
|
64
85
|
const { requiredErrMsg, validate } = uiSchema;
|
|
65
86
|
const placeholder = (_a = uiSchema["ui:options"]) == null ? void 0 : _a.placeholder;
|
|
87
|
+
const isFirstChecked = useRef(true);
|
|
66
88
|
return /* @__PURE__ */ React7.createElement(
|
|
67
89
|
Input,
|
|
68
90
|
{
|
|
@@ -84,6 +106,10 @@ function InputWidget(props) {
|
|
|
84
106
|
endContent,
|
|
85
107
|
onChange: (e) => onChange(e.target.value),
|
|
86
108
|
validate: () => {
|
|
109
|
+
if (isFirstChecked.current) {
|
|
110
|
+
isFirstChecked.current = false;
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
87
113
|
if (value === "" && required) {
|
|
88
114
|
return requiredErrMsg || "This field is required";
|
|
89
115
|
}
|
|
@@ -102,7 +128,8 @@ function SelectWidget(props) {
|
|
|
102
128
|
const {
|
|
103
129
|
className,
|
|
104
130
|
nextuiClassNames = {
|
|
105
|
-
|
|
131
|
+
trigger: "rounded-lg bg-transparent shadow-none border dark:border-[#2c2c2c] data-[hover=true]:bg-default-50",
|
|
132
|
+
popoverContent: "rounded-lg shadow-md border border-[#F4F4F5] dark:border-[#3e3e3e]"
|
|
106
133
|
},
|
|
107
134
|
listboxProps = {
|
|
108
135
|
itemClasses: {
|
|
@@ -175,7 +202,20 @@ function MultipleSelectWidget(props) {
|
|
|
175
202
|
var _a;
|
|
176
203
|
const { onChange, options, label, value, required, uiSchema = {} } = props;
|
|
177
204
|
const { selectOptions = [], requiredErrMsg, validate } = uiSchema;
|
|
178
|
-
const {
|
|
205
|
+
const {
|
|
206
|
+
className,
|
|
207
|
+
nextuiClassNames = {
|
|
208
|
+
base: "w-full",
|
|
209
|
+
trigger: "min-h-12 py-1 rounded-lg bg-transparent shadow-none border dark:border-[#2c2c2c] data-[hover=true]:bg-default-50",
|
|
210
|
+
popoverContent: "rounded-lg shadow-md border dark:border-[#3e3e3e]"
|
|
211
|
+
},
|
|
212
|
+
labelPlacement = "inside",
|
|
213
|
+
listboxProps = {},
|
|
214
|
+
size = "sm",
|
|
215
|
+
color,
|
|
216
|
+
description,
|
|
217
|
+
renderValue = DefaultRenderValue
|
|
218
|
+
} = options;
|
|
179
219
|
const placeholder = ((_a = uiSchema["ui:options"]) == null ? void 0 : _a.placeholder) || "Select an option";
|
|
180
220
|
const selectedKeys = useMemo(() => {
|
|
181
221
|
return value ? value.split(",") : [];
|
|
@@ -215,11 +255,7 @@ function MultipleSelectWidget(props) {
|
|
|
215
255
|
checkValue(_v);
|
|
216
256
|
},
|
|
217
257
|
items: selectOptions,
|
|
218
|
-
classNames:
|
|
219
|
-
base: "w-full",
|
|
220
|
-
trigger: "min-h-12 py-1",
|
|
221
|
-
popoverContent: "rounded-lg shadow-md border dark:border-[#3e3e3e]"
|
|
222
|
-
}, nextuiClassNames),
|
|
258
|
+
classNames: nextuiClassNames,
|
|
223
259
|
listboxProps: __spreadValues({
|
|
224
260
|
itemClasses: {
|
|
225
261
|
base: [
|
|
@@ -289,7 +325,7 @@ var EditorWidget = ({ label, options = {}, value, required, uiSchema, disabled,
|
|
|
289
325
|
languageSelectorOptions.map((item) => {
|
|
290
326
|
return /* @__PURE__ */ React7.createElement("option", { key: item.value, value: item.value }, item.label);
|
|
291
327
|
})
|
|
292
|
-
)), description && /* @__PURE__ */ React7.createElement("div", { className: cn("mb-2 text-xs text-[#A1A1A9] dark:text-[#717179]", descriptionClassName) }, description), /* @__PURE__ */ React7.createElement("div", { className: cn("rounded-lg overflow-hidden relative", editorBoxClassName) }, /* @__PURE__ */ React7.createElement(
|
|
328
|
+
)), description && /* @__PURE__ */ React7.createElement("div", { className: cn("mb-2 text-xs text-[#A1A1A9] dark:text-[#717179]", descriptionClassName) }, description), /* @__PURE__ */ React7.createElement("div", { className: cn("rounded-lg overflow-hidden relative border dark:border-[#2c2c2c]", editorBoxClassName) }, /* @__PURE__ */ React7.createElement(
|
|
293
329
|
MonacoEditor,
|
|
294
330
|
{
|
|
295
331
|
options: { readOnly: readOnly || disabled, minimap: { enabled: false } },
|
|
@@ -307,6 +343,15 @@ var EditorWidget = ({ label, options = {}, value, required, uiSchema, disabled,
|
|
|
307
343
|
const json = helper.json.safeParse(value);
|
|
308
344
|
editor.setValue(JSON.stringify(json, null, jsonStrSpace));
|
|
309
345
|
}
|
|
346
|
+
monaco.editor.defineTheme("myCustomTheme", {
|
|
347
|
+
base: "vs-dark",
|
|
348
|
+
inherit: true,
|
|
349
|
+
rules: [],
|
|
350
|
+
colors: {
|
|
351
|
+
"editor.background": "#09090B"
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
monaco.editor.setTheme("myCustomTheme");
|
|
310
355
|
}
|
|
311
356
|
}
|
|
312
357
|
)), isInvalid && /* @__PURE__ */ React7.createElement("div", { className: cn("mt-2 text-xs text-[#DF3562]", errMsgClassName) }, errMsg), onRun && /* @__PURE__ */ React7.createElement(
|
|
@@ -893,11 +938,11 @@ var CollapsibleBox = ({ formKey, title, titleBoxCss, formState, submitButtonProp
|
|
|
893
938
|
return /* @__PURE__ */ React7.createElement("div", { id: `form-${formKey}` }, /* @__PURE__ */ React7.createElement(
|
|
894
939
|
"div",
|
|
895
940
|
{
|
|
896
|
-
className: "mt-5 mb-[10px] flex justify-between items-center cursor-pointer border-t-[1px solid #E5E5EA] py-[5px]
|
|
941
|
+
className: "mt-5 mb-[10px] flex justify-between items-center cursor-pointer border-t-[1px solid #E5E5EA] py-[5px]",
|
|
897
942
|
onClick: () => setOpened((o) => !o)
|
|
898
943
|
},
|
|
899
944
|
/* @__PURE__ */ React7.createElement("div", { className: cn("text-gray-900 dark:text-gray-100 font-bold text-base", titleBoxCss) }, title),
|
|
900
|
-
opened ? /* @__PURE__ */ React7.createElement(ChevronUp,
|
|
945
|
+
opened ? /* @__PURE__ */ React7.createElement(ChevronUp, { size: 18, className: "text-[#717179] dark:text-[#A1A1A9]" }) : /* @__PURE__ */ React7.createElement(ChevronDown, { size: 18, className: "text-[#717179] dark:text-[#A1A1A9]" })
|
|
901
946
|
), /* @__PURE__ */ React7.createElement("div", { className: cn("mt-2", opened ? "block" : "hidden") }, /* @__PURE__ */ React7.createElement(JSONSchemaForm, { formState }, submitButtonProps && /* @__PURE__ */ React7.createElement(SubmitButton, { formKey, formState, buttonProps: submitButtonProps }), customButtonProps && /* @__PURE__ */ React7.createElement(CustomButton, { formKey, formState, buttonProps: customButtonProps }))));
|
|
902
947
|
};
|
|
903
948
|
var ListLayout = (props) => {
|
|
@@ -1006,9 +1051,25 @@ var JSONForm = (props) => {
|
|
|
1006
1051
|
function TextareaWidget(props) {
|
|
1007
1052
|
var _a;
|
|
1008
1053
|
const { onChange, options, label, value, required, disabled, uiSchema } = props;
|
|
1009
|
-
const {
|
|
1054
|
+
const {
|
|
1055
|
+
className,
|
|
1056
|
+
nextuiClassNames = {
|
|
1057
|
+
inputWrapper: "rounded-lg shadow-none border dark:border-[#2c2c2c] !bg-transparent data-[hover=true]:!bg-default-50 group-data-[focus=true]:!bg-transparent"
|
|
1058
|
+
},
|
|
1059
|
+
labelPlacement = "inside",
|
|
1060
|
+
size = "md",
|
|
1061
|
+
minRows = 3,
|
|
1062
|
+
maxRows = 8,
|
|
1063
|
+
color,
|
|
1064
|
+
variant,
|
|
1065
|
+
radius,
|
|
1066
|
+
startContent,
|
|
1067
|
+
endContent,
|
|
1068
|
+
description
|
|
1069
|
+
} = options;
|
|
1010
1070
|
const { requiredErrMsg, validate } = uiSchema;
|
|
1011
1071
|
const placeholder = (_a = uiSchema["ui:options"]) == null ? void 0 : _a.placeholder;
|
|
1072
|
+
const isFirstChecked = useRef(true);
|
|
1012
1073
|
return /* @__PURE__ */ React7.createElement(
|
|
1013
1074
|
Textarea,
|
|
1014
1075
|
{
|
|
@@ -1031,6 +1092,10 @@ function TextareaWidget(props) {
|
|
|
1031
1092
|
endContent,
|
|
1032
1093
|
onChange: (e) => onChange(e.target.value),
|
|
1033
1094
|
validate: () => {
|
|
1095
|
+
if (isFirstChecked.current) {
|
|
1096
|
+
isFirstChecked.current = false;
|
|
1097
|
+
return true;
|
|
1098
|
+
}
|
|
1034
1099
|
if (value === "" && required) {
|
|
1035
1100
|
return requiredErrMsg || "This field is required";
|
|
1036
1101
|
}
|
|
@@ -1044,9 +1109,22 @@ function TextareaWidget(props) {
|
|
|
1044
1109
|
);
|
|
1045
1110
|
}
|
|
1046
1111
|
function DatePickerWidget({ label, options, value, required, disabled, uiSchema, onChange }) {
|
|
1047
|
-
const {
|
|
1112
|
+
const {
|
|
1113
|
+
className,
|
|
1114
|
+
nextuiClassNames = { calendarContent: "min-w-fit" },
|
|
1115
|
+
dateInputClassNames = {
|
|
1116
|
+
inputWrapper: "rounded-lg bg-transparent border dark:border-[#2c2c2c] hover:bg-default-50"
|
|
1117
|
+
},
|
|
1118
|
+
labelPlacement = "inside",
|
|
1119
|
+
size = "sm",
|
|
1120
|
+
granularity = "day",
|
|
1121
|
+
color = "default",
|
|
1122
|
+
description,
|
|
1123
|
+
variant
|
|
1124
|
+
} = options;
|
|
1048
1125
|
const [date, setDate] = useState();
|
|
1049
1126
|
const { requiredErrMsg, validate } = uiSchema;
|
|
1127
|
+
const isFirstChecked = useRef(true);
|
|
1050
1128
|
useEffect(() => {
|
|
1051
1129
|
if (value) {
|
|
1052
1130
|
try {
|
|
@@ -1070,6 +1148,7 @@ function DatePickerWidget({ label, options, value, required, disabled, uiSchema,
|
|
|
1070
1148
|
labelPlacement,
|
|
1071
1149
|
color,
|
|
1072
1150
|
granularity,
|
|
1151
|
+
variant,
|
|
1073
1152
|
value: date,
|
|
1074
1153
|
isRequired: required,
|
|
1075
1154
|
description: description || "",
|
|
@@ -1081,6 +1160,10 @@ function DatePickerWidget({ label, options, value, required, disabled, uiSchema,
|
|
|
1081
1160
|
}
|
|
1082
1161
|
},
|
|
1083
1162
|
validate: () => {
|
|
1163
|
+
if (isFirstChecked.current) {
|
|
1164
|
+
isFirstChecked.current = false;
|
|
1165
|
+
return true;
|
|
1166
|
+
}
|
|
1084
1167
|
if (value === "" && required) {
|
|
1085
1168
|
return requiredErrMsg || "This field is required";
|
|
1086
1169
|
}
|
|
@@ -1166,6 +1249,9 @@ var ComplexFormModalStore = class {
|
|
|
1166
1249
|
this.isOpen = false;
|
|
1167
1250
|
this.title = "";
|
|
1168
1251
|
this.className = "";
|
|
1252
|
+
this.classNames = {
|
|
1253
|
+
base: "dark:bg-[#09090B] border dark:border-[#2c2c2c] rounded-lg shadow-md"
|
|
1254
|
+
};
|
|
1169
1255
|
this.modalSize = "md";
|
|
1170
1256
|
this.scrollBehavior = "normal";
|
|
1171
1257
|
this.isDismissable = true;
|
|
@@ -1183,7 +1269,9 @@ var ComplexFormModalStore = class {
|
|
|
1183
1269
|
this.formConfig = void 0;
|
|
1184
1270
|
this.layoutConfig = void 0;
|
|
1185
1271
|
this.className = "";
|
|
1186
|
-
this.classNames =
|
|
1272
|
+
this.classNames = {
|
|
1273
|
+
base: "dark:bg-[#09090B] border dark:border-[#2c2c2c] rounded-lg shadow-md"
|
|
1274
|
+
};
|
|
1187
1275
|
this.modalSize = "md";
|
|
1188
1276
|
this.scrollBehavior = "normal";
|
|
1189
1277
|
this.isDismissable = true;
|
|
@@ -1250,6 +1338,9 @@ var FormModalStore = class {
|
|
|
1250
1338
|
this.title = "";
|
|
1251
1339
|
this.form = null;
|
|
1252
1340
|
this.className = "";
|
|
1341
|
+
this.classNames = {
|
|
1342
|
+
base: "dark:bg-[#09090B] border dark:border-[#2c2c2c] rounded-lg shadow-md"
|
|
1343
|
+
};
|
|
1253
1344
|
this.modalSize = "md";
|
|
1254
1345
|
this.scrollBehavior = "normal";
|
|
1255
1346
|
this.closeOnOverlayClick = false;
|
|
@@ -1265,7 +1356,9 @@ var FormModalStore = class {
|
|
|
1265
1356
|
this.title = "";
|
|
1266
1357
|
this.form = null;
|
|
1267
1358
|
this.className = "";
|
|
1268
|
-
this.classNames =
|
|
1359
|
+
this.classNames = {
|
|
1360
|
+
base: "dark:bg-[#09090B] border dark:border-[#2c2c2c] rounded-lg shadow-md"
|
|
1361
|
+
};
|
|
1269
1362
|
this.modalSize = "md";
|
|
1270
1363
|
this.scrollBehavior = "normal";
|
|
1271
1364
|
this.closeOnOverlayClick = false;
|