@pageboard/html 0.10.18 → 0.10.20
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/elements/form.js +7 -3
- package/elements/image.js +5 -3
- package/elements/input-property.js +39 -2
- package/package.json +1 -1
- package/ui/menu.css +1 -0
package/elements/form.js
CHANGED
|
@@ -66,6 +66,7 @@ exports.api_form = {
|
|
|
66
66
|
group: 'block form',
|
|
67
67
|
menu: "form",
|
|
68
68
|
required: ["action"],
|
|
69
|
+
expressions: true,
|
|
69
70
|
$lock: {
|
|
70
71
|
'data.action.parameters': 'webmaster'
|
|
71
72
|
},
|
|
@@ -131,7 +132,8 @@ exports.api_form = {
|
|
|
131
132
|
properties: {
|
|
132
133
|
parameters: {
|
|
133
134
|
title: 'Parameters',
|
|
134
|
-
type: "object"
|
|
135
|
+
type: "object",
|
|
136
|
+
nullable: true
|
|
135
137
|
}
|
|
136
138
|
},
|
|
137
139
|
nullable: true
|
|
@@ -142,7 +144,8 @@ exports.api_form = {
|
|
|
142
144
|
properties: {
|
|
143
145
|
parameters: {
|
|
144
146
|
title: 'Parameters',
|
|
145
|
-
type: "object"
|
|
147
|
+
type: "object",
|
|
148
|
+
nullable: true
|
|
146
149
|
}
|
|
147
150
|
},
|
|
148
151
|
nullable: true
|
|
@@ -153,7 +156,8 @@ exports.api_form = {
|
|
|
153
156
|
properties: {
|
|
154
157
|
parameters: {
|
|
155
158
|
title: 'Parameters',
|
|
156
|
-
type: "object"
|
|
159
|
+
type: "object",
|
|
160
|
+
nullable: true
|
|
157
161
|
}
|
|
158
162
|
},
|
|
159
163
|
nullable: true
|
package/elements/image.js
CHANGED
|
@@ -132,7 +132,7 @@ exports.image = {
|
|
|
132
132
|
class="[display.fit|or:none] [display.horizontal|or:] [display.vertical|or:]"
|
|
133
133
|
alt="[alt]"
|
|
134
134
|
data-src="[url|or:[$element.resources.empty]]"
|
|
135
|
-
data-crop="[crop.x];[crop.y];[crop.width];[crop.height];[crop.zoom]"
|
|
135
|
+
data-crop="[crop.x|or:50];[crop.y|or:50];[crop.width|or:100];[crop.height|or:100];[crop.zoom|or:100]"
|
|
136
136
|
>
|
|
137
137
|
<div block-content="legend"></div>
|
|
138
138
|
</element-image>`,
|
|
@@ -180,11 +180,12 @@ exports.inlineImage = {
|
|
|
180
180
|
display: {
|
|
181
181
|
title: 'Display options',
|
|
182
182
|
type: 'object',
|
|
183
|
+
nullable: true,
|
|
183
184
|
properties: {
|
|
184
185
|
avatar: {
|
|
185
186
|
title: 'avatar',
|
|
186
187
|
type: 'boolean',
|
|
187
|
-
default:
|
|
188
|
+
default: false
|
|
188
189
|
},
|
|
189
190
|
rounded: {
|
|
190
191
|
title: 'rounded',
|
|
@@ -212,7 +213,8 @@ exports.inlineImage = {
|
|
|
212
213
|
}, {
|
|
213
214
|
const: "right",
|
|
214
215
|
title: "right"
|
|
215
|
-
}]
|
|
216
|
+
}],
|
|
217
|
+
default: ""
|
|
216
218
|
},
|
|
217
219
|
align: {
|
|
218
220
|
title: 'align',
|
|
@@ -41,6 +41,7 @@ exports.input_property = {
|
|
|
41
41
|
fuse: function(node, d, scope) {
|
|
42
42
|
const view = scope.$view;
|
|
43
43
|
const doc = scope.$doc;
|
|
44
|
+
const dateFormats = ["date", "time", "date-time"];
|
|
44
45
|
let name = d.name;
|
|
45
46
|
if (!name) {
|
|
46
47
|
return node;
|
|
@@ -67,10 +68,14 @@ exports.input_property = {
|
|
|
67
68
|
name = list.slice(0, i - 1).concat(list.slice(i + 1)).join('.');
|
|
68
69
|
cases = null;
|
|
69
70
|
} else {
|
|
71
|
+
if (prop.type == "array" && prop.items && !Array.isArray(prop.items)) {
|
|
72
|
+
prop = prop.items;
|
|
73
|
+
}
|
|
70
74
|
if (prop.select && prop.select.$data == `0/${propKey}`) {
|
|
71
75
|
cases = prop.selectCases;
|
|
72
76
|
}
|
|
73
|
-
|
|
77
|
+
if (prop.properties) prop = prop.properties;
|
|
78
|
+
prop = prop[propKey];
|
|
74
79
|
}
|
|
75
80
|
if (prop == null) break;
|
|
76
81
|
}
|
|
@@ -227,8 +232,40 @@ exports.input_property = {
|
|
|
227
232
|
label: prop.title
|
|
228
233
|
}
|
|
229
234
|
}));
|
|
230
|
-
} else if (propType.type == "
|
|
235
|
+
} else if (propType.type == "object" && Object.keys(propType.properties).sort().join(' ') == "end start" && dateFormats.includes(propType.properties.start.format) && dateFormats.includes(propType.properties.end.format)) {
|
|
231
236
|
node.appendChild(view.render({
|
|
237
|
+
id,
|
|
238
|
+
type: 'input_date_slot',
|
|
239
|
+
data: {
|
|
240
|
+
nameStart: name,
|
|
241
|
+
nameEnd: name,
|
|
242
|
+
format: propType.properties.start.format.replace('-', ''),
|
|
243
|
+
disabled: d.disabled,
|
|
244
|
+
required: required,
|
|
245
|
+
step: propType.properties.start.step
|
|
246
|
+
},
|
|
247
|
+
content: {
|
|
248
|
+
label: prop.title
|
|
249
|
+
}
|
|
250
|
+
}));
|
|
251
|
+
} else if (propType.type == "string" && dateFormats.includes(propType.format)) {
|
|
252
|
+
if (d.multiple) node.appendChild(view.render({
|
|
253
|
+
id,
|
|
254
|
+
type: 'input_date_slot',
|
|
255
|
+
data: {
|
|
256
|
+
nameStart: name,
|
|
257
|
+
nameEnd: name,
|
|
258
|
+
format: propType.format.replace('-', ''),
|
|
259
|
+
default: propType.default,
|
|
260
|
+
disabled: d.disabled,
|
|
261
|
+
required: required,
|
|
262
|
+
step: propType.step
|
|
263
|
+
},
|
|
264
|
+
content: {
|
|
265
|
+
label: prop.title
|
|
266
|
+
}
|
|
267
|
+
}));
|
|
268
|
+
else node.appendChild(view.render({
|
|
232
269
|
id,
|
|
233
270
|
type: 'input_date_time',
|
|
234
271
|
data: {
|
package/package.json
CHANGED