@ghentcdh/json-forms-vue 0.8.5 → 0.8.6
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/index.js +19 -5
- package/index.mjs +19 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -215,6 +215,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
|
215
215
|
formEvents.dispatch({
|
|
216
216
|
event: "create",
|
|
217
217
|
type: control.value.path,
|
|
218
|
+
data: control.value.data,
|
|
218
219
|
onSuccess: (result) => {
|
|
219
220
|
handleChange(result);
|
|
220
221
|
}
|
|
@@ -238,18 +239,32 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
238
239
|
props: { ...vue$1.rendererProps() },
|
|
239
240
|
setup(__props) {
|
|
240
241
|
const props = __props;
|
|
241
|
-
const {
|
|
242
|
+
const {
|
|
243
|
+
control,
|
|
244
|
+
handleChange: _handleChange,
|
|
245
|
+
appliedOptions,
|
|
246
|
+
onFocus,
|
|
247
|
+
onBlur,
|
|
248
|
+
controlWrapper
|
|
249
|
+
} = useVanillaControlCustom(vue$1.useJsonFormsControl(props), (target) => {
|
|
250
|
+
if (!target.value) {
|
|
251
|
+
handleChange(false);
|
|
252
|
+
}
|
|
242
253
|
return Boolean(target.value) ?? false;
|
|
243
254
|
});
|
|
255
|
+
const handleChange = (result) => {
|
|
256
|
+
const { path } = control.value;
|
|
257
|
+
_handleChange(path, result);
|
|
258
|
+
};
|
|
244
259
|
return (_ctx, _cache) => {
|
|
245
260
|
return vue.openBlock(), vue.createBlock(vue.unref(ui.Checkbox), vue.mergeProps(vue.unref(controlWrapper), {
|
|
246
261
|
"model-value": vue.unref(control).data,
|
|
247
262
|
enabled: vue.unref(control).enabled,
|
|
248
263
|
config: vue.unref(appliedOptions),
|
|
249
|
-
onChange:
|
|
264
|
+
onChange: handleChange,
|
|
250
265
|
onFocus: vue.unref(onFocus),
|
|
251
266
|
onBlur: vue.unref(onBlur)
|
|
252
|
-
}), null, 16, ["model-value", "enabled", "config", "
|
|
267
|
+
}), null, 16, ["model-value", "enabled", "config", "onFocus", "onBlur"]);
|
|
253
268
|
};
|
|
254
269
|
}
|
|
255
270
|
});
|
|
@@ -8089,7 +8104,7 @@ const tailwindRenderers = [
|
|
|
8089
8104
|
...vueVanilla.vanillaRenderers,
|
|
8090
8105
|
...customRenderers
|
|
8091
8106
|
];
|
|
8092
|
-
const _hoisted_1$1 = ["id"
|
|
8107
|
+
const _hoisted_1$1 = ["id"];
|
|
8093
8108
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
8094
8109
|
__name: "form.component",
|
|
8095
8110
|
props: FormComponentProperties,
|
|
@@ -8139,7 +8154,6 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
8139
8154
|
return (_ctx, _cache) => {
|
|
8140
8155
|
return vue.openBlock(), vue.createElementBlock("form", {
|
|
8141
8156
|
id: _ctx.id,
|
|
8142
|
-
"aria-label": _ctx.name,
|
|
8143
8157
|
onSubmit: vue.withModifiers(onSubmit, ["prevent"])
|
|
8144
8158
|
}, [
|
|
8145
8159
|
(vue.openBlock(), vue.createBlock(vue.unref(vue$1.JsonForms), {
|
package/index.mjs
CHANGED
|
@@ -213,6 +213,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
213
213
|
formEvents.dispatch({
|
|
214
214
|
event: "create",
|
|
215
215
|
type: control.value.path,
|
|
216
|
+
data: control.value.data,
|
|
216
217
|
onSuccess: (result) => {
|
|
217
218
|
handleChange(result);
|
|
218
219
|
}
|
|
@@ -236,18 +237,32 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
236
237
|
props: { ...rendererProps() },
|
|
237
238
|
setup(__props) {
|
|
238
239
|
const props = __props;
|
|
239
|
-
const {
|
|
240
|
+
const {
|
|
241
|
+
control,
|
|
242
|
+
handleChange: _handleChange,
|
|
243
|
+
appliedOptions,
|
|
244
|
+
onFocus,
|
|
245
|
+
onBlur,
|
|
246
|
+
controlWrapper
|
|
247
|
+
} = useVanillaControlCustom(useJsonFormsControl(props), (target) => {
|
|
248
|
+
if (!target.value) {
|
|
249
|
+
handleChange(false);
|
|
250
|
+
}
|
|
240
251
|
return Boolean(target.value) ?? false;
|
|
241
252
|
});
|
|
253
|
+
const handleChange = (result) => {
|
|
254
|
+
const { path } = control.value;
|
|
255
|
+
_handleChange(path, result);
|
|
256
|
+
};
|
|
242
257
|
return (_ctx, _cache) => {
|
|
243
258
|
return openBlock(), createBlock(unref(Checkbox), mergeProps(unref(controlWrapper), {
|
|
244
259
|
"model-value": unref(control).data,
|
|
245
260
|
enabled: unref(control).enabled,
|
|
246
261
|
config: unref(appliedOptions),
|
|
247
|
-
onChange:
|
|
262
|
+
onChange: handleChange,
|
|
248
263
|
onFocus: unref(onFocus),
|
|
249
264
|
onBlur: unref(onBlur)
|
|
250
|
-
}), null, 16, ["model-value", "enabled", "config", "
|
|
265
|
+
}), null, 16, ["model-value", "enabled", "config", "onFocus", "onBlur"]);
|
|
251
266
|
};
|
|
252
267
|
}
|
|
253
268
|
});
|
|
@@ -8087,7 +8102,7 @@ const tailwindRenderers = [
|
|
|
8087
8102
|
...vanillaRenderers,
|
|
8088
8103
|
...customRenderers
|
|
8089
8104
|
];
|
|
8090
|
-
const _hoisted_1$1 = ["id"
|
|
8105
|
+
const _hoisted_1$1 = ["id"];
|
|
8091
8106
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
8092
8107
|
__name: "form.component",
|
|
8093
8108
|
props: FormComponentProperties,
|
|
@@ -8137,7 +8152,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8137
8152
|
return (_ctx, _cache) => {
|
|
8138
8153
|
return openBlock(), createElementBlock("form", {
|
|
8139
8154
|
id: _ctx.id,
|
|
8140
|
-
"aria-label": _ctx.name,
|
|
8141
8155
|
onSubmit: withModifiers(onSubmit, ["prevent"])
|
|
8142
8156
|
}, [
|
|
8143
8157
|
(openBlock(), createBlock(unref(JsonForms), {
|