@structured-field/widget-editor 1.0.3 → 1.1.0
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/structured-widget-editor.css +1 -1
- package/dist/structured-widget-editor.esm.js +344 -100
- package/dist/structured-widget-editor.esm.js.map +1 -1
- package/dist/structured-widget-editor.iife.js +5 -5
- package/dist/structured-widget-editor.js +4 -4
- package/dist/structured-widget-editor.js.map +1 -1
- package/package.json +5 -1
- package/src/editors/ArrayEditor.vue +68 -7
- package/src/editors/NullableEditor.vue +4 -2
- package/src/editors/ObjectEditor.vue +34 -3
- package/src/editors/RelationEditor.vue +5 -3
- package/src/editors/SchemaEditor.vue +13 -0
- package/src/editors/SfIcon.vue +45 -0
- package/src/scss/components/editors.scss +92 -0
- package/src/scss/components/form.scss +6 -1
- package/src/scss/main.scss +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var script$
|
|
1
|
+
var script$c = {
|
|
2
2
|
name: 'StringEditor',
|
|
3
3
|
props: {
|
|
4
4
|
schema: { type: Object, required: true },
|
|
@@ -5586,6 +5586,11 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5586
5586
|
function createTextVNode(text = " ", flag = 0) {
|
|
5587
5587
|
return createVNode(Text, null, text, flag);
|
|
5588
5588
|
}
|
|
5589
|
+
function createStaticVNode(content, numberOfNodes) {
|
|
5590
|
+
const vnode = createVNode(Static, null, content);
|
|
5591
|
+
vnode.staticCount = numberOfNodes;
|
|
5592
|
+
return vnode;
|
|
5593
|
+
}
|
|
5589
5594
|
function createCommentVNode(text = "", asBlock = false) {
|
|
5590
5595
|
return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
|
|
5591
5596
|
}
|
|
@@ -6690,7 +6695,7 @@ class VueElement extends BaseClass {
|
|
|
6690
6695
|
_update() {
|
|
6691
6696
|
const vnode = this._createVNode();
|
|
6692
6697
|
if (this._app) vnode.appContext = this._app._context;
|
|
6693
|
-
render$
|
|
6698
|
+
render$d(vnode, this._root);
|
|
6694
6699
|
}
|
|
6695
6700
|
_createVNode() {
|
|
6696
6701
|
const baseProps = {};
|
|
@@ -6957,7 +6962,7 @@ let renderer;
|
|
|
6957
6962
|
function ensureRenderer() {
|
|
6958
6963
|
return renderer || (renderer = createRenderer(rendererOptions));
|
|
6959
6964
|
}
|
|
6960
|
-
const render$
|
|
6965
|
+
const render$d = ((...args) => {
|
|
6961
6966
|
ensureRenderer().render(...args);
|
|
6962
6967
|
});
|
|
6963
6968
|
const createApp = ((...args) => {
|
|
@@ -6998,14 +7003,14 @@ function normalizeContainer(container) {
|
|
|
6998
7003
|
return container;
|
|
6999
7004
|
}
|
|
7000
7005
|
|
|
7001
|
-
const _hoisted_1$
|
|
7002
|
-
const _hoisted_2$
|
|
7003
|
-
const _hoisted_3$
|
|
7006
|
+
const _hoisted_1$b = ["value", "placeholder"];
|
|
7007
|
+
const _hoisted_2$9 = ["value", "placeholder"];
|
|
7008
|
+
const _hoisted_3$8 = {
|
|
7004
7009
|
key: 2,
|
|
7005
7010
|
class: "errorlist"
|
|
7006
7011
|
};
|
|
7007
7012
|
|
|
7008
|
-
function render$
|
|
7013
|
+
function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7009
7014
|
return (openBlock(), createElementBlock("div", {
|
|
7010
7015
|
class: normalizeClass(["sf-field", { errors: $options.fieldErrors.length }])
|
|
7011
7016
|
}, [
|
|
@@ -7020,7 +7025,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7020
7025
|
value: $props.modelValue,
|
|
7021
7026
|
placeholder: $props.schema.placeholder || '',
|
|
7022
7027
|
onInput: _cache[0] || (_cache[0] = $event => (_ctx.$emit('update:modelValue', $event.target.value)))
|
|
7023
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$
|
|
7028
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$b))
|
|
7024
7029
|
: (openBlock(), createElementBlock("input", {
|
|
7025
7030
|
key: 1,
|
|
7026
7031
|
type: "text",
|
|
@@ -7028,9 +7033,9 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7028
7033
|
value: $props.modelValue != null ? String($props.modelValue) : '',
|
|
7029
7034
|
placeholder: $props.schema.placeholder || '',
|
|
7030
7035
|
onInput: _cache[1] || (_cache[1] = $event => (_ctx.$emit('update:modelValue', $event.target.value)))
|
|
7031
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
7036
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$9)),
|
|
7032
7037
|
($options.fieldErrors.length)
|
|
7033
|
-
? (openBlock(), createElementBlock("ul", _hoisted_3$
|
|
7038
|
+
? (openBlock(), createElementBlock("ul", _hoisted_3$8, [
|
|
7034
7039
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
|
|
7035
7040
|
return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
|
|
7036
7041
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -7039,10 +7044,10 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7039
7044
|
], 2 /* CLASS */))
|
|
7040
7045
|
}
|
|
7041
7046
|
|
|
7042
|
-
script$
|
|
7043
|
-
script$
|
|
7047
|
+
script$c.render = render$c;
|
|
7048
|
+
script$c.__file = "src/editors/StringEditor.vue";
|
|
7044
7049
|
|
|
7045
|
-
var script$
|
|
7050
|
+
var script$b = {
|
|
7046
7051
|
name: 'NumberEditor',
|
|
7047
7052
|
props: {
|
|
7048
7053
|
schema: { type: Object, required: true },
|
|
@@ -7083,13 +7088,13 @@ var script$a = {
|
|
|
7083
7088
|
},
|
|
7084
7089
|
};
|
|
7085
7090
|
|
|
7086
|
-
const _hoisted_1$
|
|
7087
|
-
const _hoisted_2$
|
|
7091
|
+
const _hoisted_1$a = ["step", "min", "max", "value"];
|
|
7092
|
+
const _hoisted_2$8 = {
|
|
7088
7093
|
key: 0,
|
|
7089
7094
|
class: "errorlist"
|
|
7090
7095
|
};
|
|
7091
7096
|
|
|
7092
|
-
function render$
|
|
7097
|
+
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7093
7098
|
return (openBlock(), createElementBlock("div", {
|
|
7094
7099
|
class: normalizeClass(["sf-field", { errors: $options.fieldErrors.length }])
|
|
7095
7100
|
}, [
|
|
@@ -7104,9 +7109,9 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7104
7109
|
max: $props.schema.maximum != null ? String($props.schema.maximum) : undefined,
|
|
7105
7110
|
value: $props.modelValue != null ? $props.modelValue : '',
|
|
7106
7111
|
onInput: _cache[0] || (_cache[0] = (...args) => ($options.onInput && $options.onInput(...args)))
|
|
7107
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$
|
|
7112
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$a),
|
|
7108
7113
|
($options.fieldErrors.length)
|
|
7109
|
-
? (openBlock(), createElementBlock("ul", _hoisted_2$
|
|
7114
|
+
? (openBlock(), createElementBlock("ul", _hoisted_2$8, [
|
|
7110
7115
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
|
|
7111
7116
|
return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
|
|
7112
7117
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -7115,10 +7120,10 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7115
7120
|
], 2 /* CLASS */))
|
|
7116
7121
|
}
|
|
7117
7122
|
|
|
7118
|
-
script$
|
|
7119
|
-
script$
|
|
7123
|
+
script$b.render = render$b;
|
|
7124
|
+
script$b.__file = "src/editors/NumberEditor.vue";
|
|
7120
7125
|
|
|
7121
|
-
var script$
|
|
7126
|
+
var script$a = {
|
|
7122
7127
|
name: 'BooleanEditor',
|
|
7123
7128
|
props: {
|
|
7124
7129
|
schema: { type: Object, required: true },
|
|
@@ -7144,28 +7149,28 @@ var script$9 = {
|
|
|
7144
7149
|
},
|
|
7145
7150
|
};
|
|
7146
7151
|
|
|
7147
|
-
const _hoisted_1$
|
|
7148
|
-
const _hoisted_2$
|
|
7149
|
-
const _hoisted_3$
|
|
7152
|
+
const _hoisted_1$9 = { class: "sf-checkbox-label" };
|
|
7153
|
+
const _hoisted_2$7 = ["checked"];
|
|
7154
|
+
const _hoisted_3$7 = {
|
|
7150
7155
|
key: 0,
|
|
7151
7156
|
class: "errorlist"
|
|
7152
7157
|
};
|
|
7153
7158
|
|
|
7154
|
-
function render$
|
|
7159
|
+
function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7155
7160
|
return (openBlock(), createElementBlock("div", {
|
|
7156
7161
|
class: normalizeClass(["sf-field sf-field-boolean", { errors: $options.fieldErrors.length }])
|
|
7157
7162
|
}, [
|
|
7158
|
-
createBaseVNode("label", _hoisted_1$
|
|
7163
|
+
createBaseVNode("label", _hoisted_1$9, [
|
|
7159
7164
|
createBaseVNode("input", {
|
|
7160
7165
|
type: "checkbox",
|
|
7161
7166
|
class: "sf-checkbox",
|
|
7162
7167
|
checked: !!$props.modelValue,
|
|
7163
7168
|
onChange: _cache[0] || (_cache[0] = $event => (_ctx.$emit('update:modelValue', $event.target.checked)))
|
|
7164
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
7169
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$7),
|
|
7165
7170
|
createTextVNode(" " + toDisplayString($options.title), 1 /* TEXT */)
|
|
7166
7171
|
]),
|
|
7167
7172
|
($options.fieldErrors.length)
|
|
7168
|
-
? (openBlock(), createElementBlock("ul", _hoisted_3$
|
|
7173
|
+
? (openBlock(), createElementBlock("ul", _hoisted_3$7, [
|
|
7169
7174
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
|
|
7170
7175
|
return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
|
|
7171
7176
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -7174,10 +7179,10 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7174
7179
|
], 2 /* CLASS */))
|
|
7175
7180
|
}
|
|
7176
7181
|
|
|
7177
|
-
script$
|
|
7178
|
-
script$
|
|
7182
|
+
script$a.render = render$a;
|
|
7183
|
+
script$a.__file = "src/editors/BooleanEditor.vue";
|
|
7179
7184
|
|
|
7180
|
-
var script$
|
|
7185
|
+
var script$9 = {
|
|
7181
7186
|
name: 'SelectEditor',
|
|
7182
7187
|
props: {
|
|
7183
7188
|
schema: { type: Object, required: true },
|
|
@@ -7210,14 +7215,14 @@ var script$8 = {
|
|
|
7210
7215
|
},
|
|
7211
7216
|
};
|
|
7212
7217
|
|
|
7213
|
-
const _hoisted_1$
|
|
7214
|
-
const _hoisted_2$
|
|
7215
|
-
const _hoisted_3$
|
|
7218
|
+
const _hoisted_1$8 = ["value"];
|
|
7219
|
+
const _hoisted_2$6 = ["value"];
|
|
7220
|
+
const _hoisted_3$6 = {
|
|
7216
7221
|
key: 0,
|
|
7217
7222
|
class: "errorlist"
|
|
7218
7223
|
};
|
|
7219
7224
|
|
|
7220
|
-
function render$
|
|
7225
|
+
function render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7221
7226
|
return (openBlock(), createElementBlock("div", {
|
|
7222
7227
|
class: normalizeClass(["sf-field", { errors: $options.fieldErrors.length }])
|
|
7223
7228
|
}, [
|
|
@@ -7233,11 +7238,11 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7233
7238
|
return (openBlock(), createElementBlock("option", {
|
|
7234
7239
|
key: opt,
|
|
7235
7240
|
value: String(opt)
|
|
7236
|
-
}, toDisplayString(opt), 9 /* TEXT, PROPS */, _hoisted_2$
|
|
7241
|
+
}, toDisplayString(opt), 9 /* TEXT, PROPS */, _hoisted_2$6))
|
|
7237
7242
|
}), 128 /* KEYED_FRAGMENT */))
|
|
7238
|
-
], 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$
|
|
7243
|
+
], 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$8),
|
|
7239
7244
|
($options.fieldErrors.length)
|
|
7240
|
-
? (openBlock(), createElementBlock("ul", _hoisted_3$
|
|
7245
|
+
? (openBlock(), createElementBlock("ul", _hoisted_3$6, [
|
|
7241
7246
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
|
|
7242
7247
|
return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
|
|
7243
7248
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -7246,10 +7251,10 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7246
7251
|
], 2 /* CLASS */))
|
|
7247
7252
|
}
|
|
7248
7253
|
|
|
7249
|
-
script$
|
|
7250
|
-
script$
|
|
7254
|
+
script$9.render = render$9;
|
|
7255
|
+
script$9.__file = "src/editors/SelectEditor.vue";
|
|
7251
7256
|
|
|
7252
|
-
var script$
|
|
7257
|
+
var script$8 = {
|
|
7253
7258
|
name: 'HiddenEditor',
|
|
7254
7259
|
props: {
|
|
7255
7260
|
schema: { type: Object, required: true },
|
|
@@ -7277,20 +7282,116 @@ var script$7 = {
|
|
|
7277
7282
|
},
|
|
7278
7283
|
};
|
|
7279
7284
|
|
|
7280
|
-
const _hoisted_1$
|
|
7285
|
+
const _hoisted_1$7 = { style: {"display":"none"} };
|
|
7286
|
+
|
|
7287
|
+
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7288
|
+
return (openBlock(), createElementBlock("div", _hoisted_1$7))
|
|
7289
|
+
}
|
|
7290
|
+
|
|
7291
|
+
script$8.render = render$8;
|
|
7292
|
+
script$8.__file = "src/editors/HiddenEditor.vue";
|
|
7293
|
+
|
|
7294
|
+
var script$7 = {
|
|
7295
|
+
name: 'SfIcon',
|
|
7296
|
+
props: {
|
|
7297
|
+
name: { type: String, required: true },
|
|
7298
|
+
size: { type: [Number, String], default: 14 },
|
|
7299
|
+
},
|
|
7300
|
+
};
|
|
7301
|
+
|
|
7302
|
+
const _hoisted_1$6 = ["width", "height"];
|
|
7303
|
+
const _hoisted_2$5 = {
|
|
7304
|
+
key: 4,
|
|
7305
|
+
points: "6 9 12 15 18 9"
|
|
7306
|
+
};
|
|
7307
|
+
const _hoisted_3$5 = {
|
|
7308
|
+
key: 5,
|
|
7309
|
+
points: "18 15 12 9 6 15"
|
|
7310
|
+
};
|
|
7281
7311
|
|
|
7282
7312
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7283
|
-
return (openBlock(), createElementBlock("
|
|
7313
|
+
return (openBlock(), createElementBlock("svg", {
|
|
7314
|
+
class: "sf-icon",
|
|
7315
|
+
width: $props.size,
|
|
7316
|
+
height: $props.size,
|
|
7317
|
+
viewBox: "0 0 24 24",
|
|
7318
|
+
fill: "none",
|
|
7319
|
+
stroke: "currentColor",
|
|
7320
|
+
"stroke-width": "2.5",
|
|
7321
|
+
"stroke-linecap": "round",
|
|
7322
|
+
"stroke-linejoin": "round"
|
|
7323
|
+
}, [
|
|
7324
|
+
($props.name === 'plus')
|
|
7325
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
7326
|
+
_cache[0] || (_cache[0] = createBaseVNode("line", {
|
|
7327
|
+
x1: "12",
|
|
7328
|
+
y1: "5",
|
|
7329
|
+
x2: "12",
|
|
7330
|
+
y2: "19"
|
|
7331
|
+
}, null, -1 /* CACHED */)),
|
|
7332
|
+
_cache[1] || (_cache[1] = createBaseVNode("line", {
|
|
7333
|
+
x1: "5",
|
|
7334
|
+
y1: "12",
|
|
7335
|
+
x2: "19",
|
|
7336
|
+
y2: "12"
|
|
7337
|
+
}, null, -1 /* CACHED */))
|
|
7338
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
7339
|
+
: ($props.name === 'times')
|
|
7340
|
+
? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
7341
|
+
_cache[2] || (_cache[2] = createBaseVNode("line", {
|
|
7342
|
+
x1: "6",
|
|
7343
|
+
y1: "6",
|
|
7344
|
+
x2: "18",
|
|
7345
|
+
y2: "18"
|
|
7346
|
+
}, null, -1 /* CACHED */)),
|
|
7347
|
+
_cache[3] || (_cache[3] = createBaseVNode("line", {
|
|
7348
|
+
x1: "6",
|
|
7349
|
+
y1: "18",
|
|
7350
|
+
x2: "18",
|
|
7351
|
+
y2: "6"
|
|
7352
|
+
}, null, -1 /* CACHED */))
|
|
7353
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
7354
|
+
: ($props.name === 'arrow-up')
|
|
7355
|
+
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
7356
|
+
_cache[4] || (_cache[4] = createBaseVNode("line", {
|
|
7357
|
+
x1: "12",
|
|
7358
|
+
y1: "19",
|
|
7359
|
+
x2: "12",
|
|
7360
|
+
y2: "5"
|
|
7361
|
+
}, null, -1 /* CACHED */)),
|
|
7362
|
+
_cache[5] || (_cache[5] = createBaseVNode("polyline", { points: "5 12 12 5 19 12" }, null, -1 /* CACHED */))
|
|
7363
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
7364
|
+
: ($props.name === 'arrow-down')
|
|
7365
|
+
? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
7366
|
+
_cache[6] || (_cache[6] = createBaseVNode("line", {
|
|
7367
|
+
x1: "12",
|
|
7368
|
+
y1: "5",
|
|
7369
|
+
x2: "12",
|
|
7370
|
+
y2: "19"
|
|
7371
|
+
}, null, -1 /* CACHED */)),
|
|
7372
|
+
_cache[7] || (_cache[7] = createBaseVNode("polyline", { points: "19 12 12 19 5 12" }, null, -1 /* CACHED */))
|
|
7373
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
7374
|
+
: ($props.name === 'chevron-down')
|
|
7375
|
+
? (openBlock(), createElementBlock("polyline", _hoisted_2$5))
|
|
7376
|
+
: ($props.name === 'chevron-up')
|
|
7377
|
+
? (openBlock(), createElementBlock("polyline", _hoisted_3$5))
|
|
7378
|
+
: ($props.name === 'grip')
|
|
7379
|
+
? (openBlock(), createElementBlock(Fragment, { key: 6 }, [
|
|
7380
|
+
_cache[8] || (_cache[8] = createStaticVNode("<circle cx=\"9\" cy=\"7\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"15\" cy=\"7\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"9\" cy=\"12\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"15\" cy=\"12\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"9\" cy=\"17\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"15\" cy=\"17\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle>", 6))
|
|
7381
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
7382
|
+
: createCommentVNode("v-if", true)
|
|
7383
|
+
], 8 /* PROPS */, _hoisted_1$6))
|
|
7284
7384
|
}
|
|
7285
7385
|
|
|
7286
7386
|
script$7.render = render$7;
|
|
7287
|
-
script$7.__file = "src/editors/
|
|
7387
|
+
script$7.__file = "src/editors/SfIcon.vue";
|
|
7288
7388
|
|
|
7289
7389
|
var script$6 = {
|
|
7290
7390
|
name: 'ObjectEditor',
|
|
7291
7391
|
beforeCreate() {
|
|
7292
7392
|
if (!this.$options.components) this.$options.components = {};
|
|
7293
7393
|
this.$options.components.SchemaEditor = script$1;
|
|
7394
|
+
this.$options.components.SfIcon = script$7;
|
|
7294
7395
|
},
|
|
7295
7396
|
props: {
|
|
7296
7397
|
schema: { type: Object, required: true },
|
|
@@ -7299,6 +7400,11 @@ var script$6 = {
|
|
|
7299
7400
|
form: { type: Object, required: true },
|
|
7300
7401
|
},
|
|
7301
7402
|
emits: ['update:modelValue'],
|
|
7403
|
+
data() {
|
|
7404
|
+
return {
|
|
7405
|
+
collapsed: false,
|
|
7406
|
+
};
|
|
7407
|
+
},
|
|
7302
7408
|
computed: {
|
|
7303
7409
|
isRoot() {
|
|
7304
7410
|
return this.path.length === 0;
|
|
@@ -7306,12 +7412,30 @@ var script$6 = {
|
|
|
7306
7412
|
title() {
|
|
7307
7413
|
return this.schema.title || this.humanize(this.path[this.path.length - 1]) || '';
|
|
7308
7414
|
},
|
|
7415
|
+
summary() {
|
|
7416
|
+
const val = this.modelValue || {};
|
|
7417
|
+
const parts = [];
|
|
7418
|
+
for (const key of Object.keys(this.schema.properties || {})) {
|
|
7419
|
+
if (parts.length >= 3) break;
|
|
7420
|
+
const v = val[key];
|
|
7421
|
+
if (v !== null && v !== undefined && v !== '' && typeof v !== 'object') {
|
|
7422
|
+
parts.push(String(v));
|
|
7423
|
+
}
|
|
7424
|
+
}
|
|
7425
|
+
return parts.join(' · ');
|
|
7426
|
+
},
|
|
7309
7427
|
},
|
|
7310
7428
|
methods: {
|
|
7311
7429
|
humanize(str) {
|
|
7312
7430
|
if (!str) return '';
|
|
7313
7431
|
return str.replace(/_/g, ' ').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/^./, s => s.toUpperCase());
|
|
7314
7432
|
},
|
|
7433
|
+
collapse() {
|
|
7434
|
+
this.collapsed = true;
|
|
7435
|
+
},
|
|
7436
|
+
expand() {
|
|
7437
|
+
this.collapsed = false;
|
|
7438
|
+
},
|
|
7315
7439
|
onChildChange(key, value) {
|
|
7316
7440
|
const newVal = { ...(this.modelValue || {}), [key]: value };
|
|
7317
7441
|
this.$emit('update:modelValue', newVal);
|
|
@@ -7324,20 +7448,22 @@ const _hoisted_1$5 = {
|
|
|
7324
7448
|
class: "sf-object sf-object-root"
|
|
7325
7449
|
};
|
|
7326
7450
|
const _hoisted_2$4 = { class: "sf-object-fields" };
|
|
7327
|
-
const _hoisted_3$4 = {
|
|
7328
|
-
|
|
7329
|
-
|
|
7451
|
+
const _hoisted_3$4 = { class: "sf-object-title" };
|
|
7452
|
+
const _hoisted_4$3 = ["aria-label"];
|
|
7453
|
+
const _hoisted_5$3 = { class: "sf-object-title-text" };
|
|
7454
|
+
const _hoisted_6$3 = {
|
|
7455
|
+
key: 0,
|
|
7456
|
+
class: "sf-object-summary"
|
|
7330
7457
|
};
|
|
7331
|
-
const
|
|
7332
|
-
const _hoisted_5$3 = { class: "sf-object-fields" };
|
|
7458
|
+
const _hoisted_7$2 = { class: "sf-object-fields" };
|
|
7333
7459
|
|
|
7334
7460
|
function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7335
7461
|
const _component_SchemaEditor = resolveComponent("SchemaEditor");
|
|
7462
|
+
const _component_SfIcon = resolveComponent("SfIcon");
|
|
7336
7463
|
|
|
7337
7464
|
return ($options.isRoot)
|
|
7338
7465
|
? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
7339
7466
|
createBaseVNode("div", _hoisted_2$4, [
|
|
7340
|
-
createCommentVNode(" {{ schema.properties }}\n <span v-for=\"(propSchema, key) in schema.properties\" :key=\"key\">\n {{ key }}: {{ form.resolveSchema(propSchema) }}\n </span> "),
|
|
7341
7467
|
(openBlock(true), createElementBlock(Fragment, null, renderList(($props.schema.properties || {}), (propSchema, key) => {
|
|
7342
7468
|
return (openBlock(), createBlock(_component_SchemaEditor, {
|
|
7343
7469
|
key: key,
|
|
@@ -7350,9 +7476,28 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7350
7476
|
}), 128 /* KEYED_FRAGMENT */))
|
|
7351
7477
|
])
|
|
7352
7478
|
]))
|
|
7353
|
-
: (openBlock(), createElementBlock("fieldset",
|
|
7354
|
-
|
|
7355
|
-
|
|
7479
|
+
: (openBlock(), createElementBlock("fieldset", {
|
|
7480
|
+
key: 1,
|
|
7481
|
+
class: normalizeClass(["sf-object", { 'sf-object-collapsed': $data.collapsed }])
|
|
7482
|
+
}, [
|
|
7483
|
+
createBaseVNode("legend", _hoisted_3$4, [
|
|
7484
|
+
createBaseVNode("button", {
|
|
7485
|
+
type: "button",
|
|
7486
|
+
class: "sf-collapse-btn",
|
|
7487
|
+
"aria-label": $data.collapsed ? 'Expand' : 'Collapse',
|
|
7488
|
+
onClick: _cache[0] || (_cache[0] = $event => ($data.collapsed = !$data.collapsed))
|
|
7489
|
+
}, [
|
|
7490
|
+
createVNode(_component_SfIcon, {
|
|
7491
|
+
name: $data.collapsed ? 'chevron-down' : 'chevron-up',
|
|
7492
|
+
size: 12
|
|
7493
|
+
}, null, 8 /* PROPS */, ["name"])
|
|
7494
|
+
], 8 /* PROPS */, _hoisted_4$3),
|
|
7495
|
+
createBaseVNode("span", _hoisted_5$3, toDisplayString($options.title), 1 /* TEXT */),
|
|
7496
|
+
($data.collapsed && $options.summary)
|
|
7497
|
+
? (openBlock(), createElementBlock("span", _hoisted_6$3, toDisplayString($options.summary), 1 /* TEXT */))
|
|
7498
|
+
: createCommentVNode("v-if", true)
|
|
7499
|
+
]),
|
|
7500
|
+
withDirectives(createBaseVNode("div", _hoisted_7$2, [
|
|
7356
7501
|
(openBlock(true), createElementBlock(Fragment, null, renderList(($props.schema.properties || {}), (propSchema, key) => {
|
|
7357
7502
|
return (openBlock(), createBlock(_component_SchemaEditor, {
|
|
7358
7503
|
key: key,
|
|
@@ -7363,8 +7508,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7363
7508
|
"onUpdate:modelValue": $event => ($options.onChildChange(key, $event))
|
|
7364
7509
|
}, null, 8 /* PROPS */, ["schema", "model-value", "path", "form", "onUpdate:modelValue"]))
|
|
7365
7510
|
}), 128 /* KEYED_FRAGMENT */))
|
|
7511
|
+
], 512 /* NEED_PATCH */), [
|
|
7512
|
+
[vShow, !$data.collapsed]
|
|
7366
7513
|
])
|
|
7367
|
-
]))
|
|
7514
|
+
], 2 /* CLASS */))
|
|
7368
7515
|
}
|
|
7369
7516
|
|
|
7370
7517
|
script$6.render = render$6;
|
|
@@ -7416,6 +7563,7 @@ var script$5 = {
|
|
|
7416
7563
|
beforeCreate() {
|
|
7417
7564
|
if (!this.$options.components) this.$options.components = {};
|
|
7418
7565
|
this.$options.components.SchemaEditor = script$1;
|
|
7566
|
+
this.$options.components.SfIcon = script$7;
|
|
7419
7567
|
},
|
|
7420
7568
|
props: {
|
|
7421
7569
|
schema: { type: Object, required: true },
|
|
@@ -7428,6 +7576,9 @@ var script$5 = {
|
|
|
7428
7576
|
const arr = Array.isArray(this.modelValue) ? this.modelValue : [];
|
|
7429
7577
|
return {
|
|
7430
7578
|
items: arr.map(v => ({ _key: keyCounter++, value: v })),
|
|
7579
|
+
dragSourceIndex: null,
|
|
7580
|
+
dragOverIndex: null,
|
|
7581
|
+
allCollapsed: false,
|
|
7431
7582
|
};
|
|
7432
7583
|
},
|
|
7433
7584
|
computed: {
|
|
@@ -7468,6 +7619,44 @@ var script$5 = {
|
|
|
7468
7619
|
this.items[index].value = value;
|
|
7469
7620
|
this.emitValue();
|
|
7470
7621
|
},
|
|
7622
|
+
onDragStart(index, event) {
|
|
7623
|
+
this.dragSourceIndex = index;
|
|
7624
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
7625
|
+
event.dataTransfer.setData('text/plain', String(index));
|
|
7626
|
+
},
|
|
7627
|
+
onDragOver(index) {
|
|
7628
|
+
if (this.dragSourceIndex !== null && index !== this.dragSourceIndex) {
|
|
7629
|
+
this.dragOverIndex = index;
|
|
7630
|
+
}
|
|
7631
|
+
},
|
|
7632
|
+
onDragLeave(index) {
|
|
7633
|
+
if (this.dragOverIndex === index) {
|
|
7634
|
+
this.dragOverIndex = null;
|
|
7635
|
+
}
|
|
7636
|
+
},
|
|
7637
|
+
onDrop(index) {
|
|
7638
|
+
if (this.dragSourceIndex === null || this.dragSourceIndex === index) return;
|
|
7639
|
+
const moved = this.items.splice(this.dragSourceIndex, 1)[0];
|
|
7640
|
+
this.items.splice(index, 0, moved);
|
|
7641
|
+
this.dragSourceIndex = null;
|
|
7642
|
+
this.dragOverIndex = null;
|
|
7643
|
+
this.emitValue();
|
|
7644
|
+
},
|
|
7645
|
+
onDragEnd() {
|
|
7646
|
+
this.dragSourceIndex = null;
|
|
7647
|
+
this.dragOverIndex = null;
|
|
7648
|
+
},
|
|
7649
|
+
toggleCollapseAll() {
|
|
7650
|
+
this.allCollapsed = !this.allCollapsed;
|
|
7651
|
+
const editors = this.$refs.itemEditors;
|
|
7652
|
+
if (!editors) return;
|
|
7653
|
+
const list = Array.isArray(editors) ? editors : [editors];
|
|
7654
|
+
if (this.allCollapsed) {
|
|
7655
|
+
list.forEach(editor => editor?.collapseAll?.());
|
|
7656
|
+
} else {
|
|
7657
|
+
list.forEach(editor => editor?.expandAll?.());
|
|
7658
|
+
}
|
|
7659
|
+
},
|
|
7471
7660
|
emitValue() {
|
|
7472
7661
|
this.$emit('update:modelValue', this.items.map(i => i.value));
|
|
7473
7662
|
},
|
|
@@ -7477,20 +7666,28 @@ var script$5 = {
|
|
|
7477
7666
|
const _hoisted_1$4 = { class: "sf-array-header" };
|
|
7478
7667
|
const _hoisted_2$3 = { class: "sf-label" };
|
|
7479
7668
|
const _hoisted_3$3 = { class: "sf-array-count" };
|
|
7480
|
-
const _hoisted_4$2 =
|
|
7481
|
-
const _hoisted_5$2 = { class: "sf-array-
|
|
7482
|
-
const _hoisted_6$2 =
|
|
7483
|
-
const _hoisted_7$1 = { class: "sf-array-item-
|
|
7484
|
-
const _hoisted_8$1 =
|
|
7485
|
-
const _hoisted_9$1 =
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7669
|
+
const _hoisted_4$2 = ["title"];
|
|
7670
|
+
const _hoisted_5$2 = { class: "sf-array-items" };
|
|
7671
|
+
const _hoisted_6$2 = ["onDragstart", "onDragover", "onDragleave", "onDrop"];
|
|
7672
|
+
const _hoisted_7$1 = { class: "sf-array-item-header" };
|
|
7673
|
+
const _hoisted_8$1 = { class: "sf-array-item-left" };
|
|
7674
|
+
const _hoisted_9$1 = {
|
|
7675
|
+
class: "sf-drag-handle",
|
|
7676
|
+
title: "Drag to reorder"
|
|
7677
|
+
};
|
|
7678
|
+
const _hoisted_10$1 = { class: "sf-array-item-index" };
|
|
7679
|
+
const _hoisted_11 = { class: "sf-array-item-actions" };
|
|
7680
|
+
const _hoisted_12 = ["onClick"];
|
|
7681
|
+
const _hoisted_13 = ["onClick"];
|
|
7682
|
+
const _hoisted_14 = ["onClick"];
|
|
7683
|
+
const _hoisted_15 = ["onDrop"];
|
|
7684
|
+
const _hoisted_16 = {
|
|
7489
7685
|
key: 0,
|
|
7490
7686
|
class: "errorlist"
|
|
7491
7687
|
};
|
|
7492
7688
|
|
|
7493
7689
|
function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7690
|
+
const _component_SfIcon = resolveComponent("SfIcon");
|
|
7494
7691
|
const _component_SchemaEditor = resolveComponent("SchemaEditor");
|
|
7495
7692
|
|
|
7496
7693
|
return (openBlock(), createElementBlock("div", {
|
|
@@ -7503,60 +7700,89 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7503
7700
|
type: "button",
|
|
7504
7701
|
class: "sf-btn sf-btn-add",
|
|
7505
7702
|
onClick: _cache[0] || (_cache[0] = $event => ($options.addItem()))
|
|
7506
|
-
}, [
|
|
7507
|
-
|
|
7508
|
-
createTextVNode(" Add ", -1 /* CACHED */)
|
|
7509
|
-
])
|
|
7703
|
+
}, [
|
|
7704
|
+
createVNode(_component_SfIcon, { name: "plus" }),
|
|
7705
|
+
_cache[4] || (_cache[4] = createTextVNode(" Add ", -1 /* CACHED */))
|
|
7706
|
+
]),
|
|
7707
|
+
($data.items.length)
|
|
7708
|
+
? (openBlock(), createElementBlock("span", {
|
|
7709
|
+
key: 0,
|
|
7710
|
+
class: "sf-array-collapse-toggle",
|
|
7711
|
+
title: $data.allCollapsed ? 'Expand all' : 'Collapse all',
|
|
7712
|
+
onClick: _cache[1] || (_cache[1] = (...args) => ($options.toggleCollapseAll && $options.toggleCollapseAll(...args)))
|
|
7713
|
+
}, [
|
|
7714
|
+
createVNode(_component_SfIcon, {
|
|
7715
|
+
name: $data.allCollapsed ? 'chevron-down' : 'chevron-up'
|
|
7716
|
+
}, null, 8 /* PROPS */, ["name"])
|
|
7717
|
+
], 8 /* PROPS */, _hoisted_4$2))
|
|
7718
|
+
: createCommentVNode("v-if", true)
|
|
7510
7719
|
]),
|
|
7511
|
-
createBaseVNode("div",
|
|
7720
|
+
createBaseVNode("div", _hoisted_5$2, [
|
|
7512
7721
|
(openBlock(true), createElementBlock(Fragment, null, renderList($data.items, (item, index) => {
|
|
7513
7722
|
return (openBlock(), createElementBlock("div", {
|
|
7514
7723
|
key: item._key,
|
|
7515
|
-
class: "sf-array-item"
|
|
7724
|
+
class: normalizeClass(["sf-array-item", { 'sf-drag-over': $data.dragOverIndex === index, 'sf-dragging': $data.dragSourceIndex === index }]),
|
|
7725
|
+
draggable: "true",
|
|
7726
|
+
onDragstart: $event => ($options.onDragStart(index, $event)),
|
|
7727
|
+
onDragover: withModifiers($event => ($options.onDragOver(index)), ["prevent"]),
|
|
7728
|
+
onDragleave: $event => ($options.onDragLeave(index)),
|
|
7729
|
+
onDrop: withModifiers($event => ($options.onDrop(index)), ["prevent"]),
|
|
7730
|
+
onDragend: _cache[3] || (_cache[3] = (...args) => ($options.onDragEnd && $options.onDragEnd(...args)))
|
|
7516
7731
|
}, [
|
|
7517
|
-
createBaseVNode("div",
|
|
7518
|
-
createBaseVNode("
|
|
7519
|
-
|
|
7732
|
+
createBaseVNode("div", _hoisted_7$1, [
|
|
7733
|
+
createBaseVNode("div", _hoisted_8$1, [
|
|
7734
|
+
createBaseVNode("span", _hoisted_9$1, [
|
|
7735
|
+
createVNode(_component_SfIcon, { name: "grip" })
|
|
7736
|
+
]),
|
|
7737
|
+
createBaseVNode("span", _hoisted_10$1, "#" + toDisplayString(index + 1), 1 /* TEXT */)
|
|
7738
|
+
]),
|
|
7739
|
+
createBaseVNode("div", _hoisted_11, [
|
|
7520
7740
|
(index > 0)
|
|
7521
7741
|
? (openBlock(), createElementBlock("button", {
|
|
7522
7742
|
key: 0,
|
|
7523
7743
|
type: "button",
|
|
7524
7744
|
class: "sf-btn sf-btn-sm",
|
|
7525
7745
|
onClick: $event => ($options.moveItem(index, -1))
|
|
7526
|
-
}, [
|
|
7527
|
-
|
|
7528
|
-
]
|
|
7746
|
+
}, [
|
|
7747
|
+
createVNode(_component_SfIcon, { name: "arrow-up" })
|
|
7748
|
+
], 8 /* PROPS */, _hoisted_12))
|
|
7529
7749
|
: createCommentVNode("v-if", true),
|
|
7530
7750
|
createBaseVNode("button", {
|
|
7531
7751
|
type: "button",
|
|
7532
7752
|
class: "sf-btn sf-btn-sm",
|
|
7533
7753
|
onClick: $event => ($options.moveItem(index, 1))
|
|
7534
|
-
}, [
|
|
7535
|
-
|
|
7536
|
-
]
|
|
7754
|
+
}, [
|
|
7755
|
+
createVNode(_component_SfIcon, { name: "arrow-down" })
|
|
7756
|
+
], 8 /* PROPS */, _hoisted_13),
|
|
7537
7757
|
createBaseVNode("button", {
|
|
7538
7758
|
type: "button",
|
|
7539
7759
|
class: "sf-btn sf-btn-sm sf-btn-danger",
|
|
7540
7760
|
onClick: $event => ($options.removeItem(index))
|
|
7541
|
-
}, [
|
|
7542
|
-
|
|
7543
|
-
]
|
|
7761
|
+
}, [
|
|
7762
|
+
createVNode(_component_SfIcon, { name: "times" })
|
|
7763
|
+
], 8 /* PROPS */, _hoisted_14)
|
|
7544
7764
|
])
|
|
7545
7765
|
]),
|
|
7546
|
-
createBaseVNode("div",
|
|
7766
|
+
createBaseVNode("div", {
|
|
7767
|
+
class: "sf-array-item-body",
|
|
7768
|
+
onDragover: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
|
|
7769
|
+
onDrop: withModifiers($event => ($options.onDrop(index)), ["prevent"])
|
|
7770
|
+
}, [
|
|
7547
7771
|
createVNode(_component_SchemaEditor, {
|
|
7772
|
+
ref_for: true,
|
|
7773
|
+
ref: "itemEditors",
|
|
7548
7774
|
schema: $options.itemSchema,
|
|
7549
7775
|
"model-value": item.value,
|
|
7550
7776
|
path: [...$props.path, String(index)],
|
|
7551
7777
|
form: $props.form,
|
|
7552
7778
|
"onUpdate:modelValue": $event => ($options.onItemChange(index, $event))
|
|
7553
7779
|
}, null, 8 /* PROPS */, ["schema", "model-value", "path", "form", "onUpdate:modelValue"])
|
|
7554
|
-
])
|
|
7555
|
-
]))
|
|
7780
|
+
], 40 /* PROPS, NEED_HYDRATION */, _hoisted_15)
|
|
7781
|
+
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_6$2))
|
|
7556
7782
|
}), 128 /* KEYED_FRAGMENT */))
|
|
7557
7783
|
]),
|
|
7558
7784
|
($options.fieldErrors.length)
|
|
7559
|
-
? (openBlock(), createElementBlock("ul",
|
|
7785
|
+
? (openBlock(), createElementBlock("ul", _hoisted_16, [
|
|
7560
7786
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
|
|
7561
7787
|
return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
|
|
7562
7788
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -7573,6 +7799,7 @@ var script$4 = {
|
|
|
7573
7799
|
beforeCreate() {
|
|
7574
7800
|
if (!this.$options.components) this.$options.components = {};
|
|
7575
7801
|
this.$options.components.SchemaEditor = script$1;
|
|
7802
|
+
this.$options.components.SfIcon = script$7;
|
|
7576
7803
|
},
|
|
7577
7804
|
props: {
|
|
7578
7805
|
schema: { type: Object, required: true },
|
|
@@ -7640,6 +7867,7 @@ const _hoisted_3$2 = {
|
|
|
7640
7867
|
};
|
|
7641
7868
|
|
|
7642
7869
|
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7870
|
+
const _component_SfIcon = resolveComponent("SfIcon");
|
|
7643
7871
|
const _component_SchemaEditor = resolveComponent("SchemaEditor");
|
|
7644
7872
|
|
|
7645
7873
|
return (openBlock(), createElementBlock("div", {
|
|
@@ -7656,12 +7884,12 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7656
7884
|
}, [
|
|
7657
7885
|
($data.isNull)
|
|
7658
7886
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
7659
|
-
|
|
7660
|
-
_cache[
|
|
7887
|
+
createVNode(_component_SfIcon, { name: "plus" }),
|
|
7888
|
+
_cache[2] || (_cache[2] = createTextVNode(" Add ", -1 /* CACHED */))
|
|
7661
7889
|
], 64 /* STABLE_FRAGMENT */))
|
|
7662
7890
|
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
7663
|
-
|
|
7664
|
-
_cache[
|
|
7891
|
+
createVNode(_component_SfIcon, { name: "times" }),
|
|
7892
|
+
_cache[3] || (_cache[3] = createTextVNode(" Remove ", -1 /* CACHED */))
|
|
7665
7893
|
], 64 /* STABLE_FRAGMENT */))
|
|
7666
7894
|
], 2 /* CLASS */)
|
|
7667
7895
|
]),
|
|
@@ -7795,6 +8023,7 @@ script$3.__file = "src/editors/UnionEditor.vue";
|
|
|
7795
8023
|
|
|
7796
8024
|
var script$2 = {
|
|
7797
8025
|
name: 'RelationEditor',
|
|
8026
|
+
components: { SfIcon: script$7 },
|
|
7798
8027
|
props: {
|
|
7799
8028
|
schema: { type: Object, required: true },
|
|
7800
8029
|
modelValue: { default: null },
|
|
@@ -7846,8 +8075,8 @@ var script$2 = {
|
|
|
7846
8075
|
return this.form.getErrorsForPath(this.path);
|
|
7847
8076
|
},
|
|
7848
8077
|
filteredResults() {
|
|
7849
|
-
const selectedIds = new Set(this.selected.map(
|
|
7850
|
-
return this.searchResults.filter(item => !selectedIds.has(
|
|
8078
|
+
const selectedIds = new Set(this.selected.map(item => this.itemKey(item)));
|
|
8079
|
+
return this.searchResults.filter(item => !selectedIds.has(this.itemKey(item)));
|
|
7851
8080
|
},
|
|
7852
8081
|
},
|
|
7853
8082
|
created() {
|
|
@@ -7978,6 +8207,8 @@ const _hoisted_10 = {
|
|
|
7978
8207
|
};
|
|
7979
8208
|
|
|
7980
8209
|
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8210
|
+
const _component_SfIcon = resolveComponent("SfIcon");
|
|
8211
|
+
|
|
7981
8212
|
return (openBlock(), createElementBlock("div", {
|
|
7982
8213
|
class: normalizeClass(["sf-field sf-relation", { errors: $options.fieldErrors.length }]),
|
|
7983
8214
|
ref: "root"
|
|
@@ -8001,9 +8232,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8001
8232
|
type: "button",
|
|
8002
8233
|
class: "sf-relation-tag-remove",
|
|
8003
8234
|
onClick: withModifiers($event => ($options.removeItem(item)), ["stop"])
|
|
8004
|
-
}, [
|
|
8005
|
-
|
|
8006
|
-
]
|
|
8235
|
+
}, [
|
|
8236
|
+
createVNode(_component_SfIcon, { name: "times" })
|
|
8237
|
+
], 8 /* PROPS */, _hoisted_4))
|
|
8007
8238
|
: createCommentVNode("v-if", true)
|
|
8008
8239
|
]))
|
|
8009
8240
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -8068,11 +8299,11 @@ const MAX_DEPTH = 12;
|
|
|
8068
8299
|
var script$1 = {
|
|
8069
8300
|
name: 'SchemaEditor',
|
|
8070
8301
|
components: {
|
|
8071
|
-
StringEditor: script$
|
|
8072
|
-
NumberEditor: script$
|
|
8073
|
-
BooleanEditor: script$
|
|
8074
|
-
SelectEditor: script$
|
|
8075
|
-
HiddenEditor: script$
|
|
8302
|
+
StringEditor: script$c,
|
|
8303
|
+
NumberEditor: script$b,
|
|
8304
|
+
BooleanEditor: script$a,
|
|
8305
|
+
SelectEditor: script$9,
|
|
8306
|
+
HiddenEditor: script$8,
|
|
8076
8307
|
ObjectEditor: script$6,
|
|
8077
8308
|
ArrayEditor: script$5,
|
|
8078
8309
|
NullableEditor: script$4,
|
|
@@ -8086,6 +8317,18 @@ var script$1 = {
|
|
|
8086
8317
|
form: { type: Object, required: true },
|
|
8087
8318
|
},
|
|
8088
8319
|
emits: ['update:modelValue'],
|
|
8320
|
+
methods: {
|
|
8321
|
+
collapseAll() {
|
|
8322
|
+
const editor = this.$refs.editor;
|
|
8323
|
+
if (editor?.collapse) editor.collapse();
|
|
8324
|
+
if (editor?.collapseAll) editor.collapseAll();
|
|
8325
|
+
},
|
|
8326
|
+
expandAll() {
|
|
8327
|
+
const editor = this.$refs.editor;
|
|
8328
|
+
if (editor?.expand) editor.expand();
|
|
8329
|
+
if (editor?.expandAll) editor.expandAll();
|
|
8330
|
+
},
|
|
8331
|
+
},
|
|
8089
8332
|
computed: {
|
|
8090
8333
|
editorComponent() {
|
|
8091
8334
|
const schema = this.schema;
|
|
@@ -8110,6 +8353,7 @@ var script$1 = {
|
|
|
8110
8353
|
|
|
8111
8354
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8112
8355
|
return (openBlock(), createBlock(resolveDynamicComponent($options.editorComponent), {
|
|
8356
|
+
ref: "editor",
|
|
8113
8357
|
schema: $props.schema,
|
|
8114
8358
|
"model-value": $props.modelValue,
|
|
8115
8359
|
path: $props.path,
|
|
@@ -8280,5 +8524,5 @@ function registerCustomElement(tagName = 'schema-form') {
|
|
|
8280
8524
|
}
|
|
8281
8525
|
}
|
|
8282
8526
|
|
|
8283
|
-
export { script$5 as ArrayEditor, script$
|
|
8527
|
+
export { script$5 as ArrayEditor, script$a as BooleanEditor, script$8 as HiddenEditor, script$4 as NullableEditor, script$b as NumberEditor, script$6 as ObjectEditor, script$2 as RelationEditor, script$1 as SchemaEditor, script as SchemaForm, SchemaFormElement, script$9 as SelectEditor, script$c as StringEditor, script$3 as UnionEditor, registerCustomElement };
|
|
8284
8528
|
//# sourceMappingURL=structured-widget-editor.esm.js.map
|