@pageboard/html 0.10.19 → 0.10.21
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/grid.js +1 -1
- package/elements/image.js +5 -3
- package/elements/input-date.js +6 -1
- package/elements/input-property.js +39 -2
- package/elements/inputs.js +10 -5
- package/elements/layout.js +4 -1
- package/package.json +1 -1
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/grid.js
CHANGED
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',
|
package/elements/input-date.js
CHANGED
|
@@ -52,8 +52,13 @@ exports.input_date_time = {
|
|
|
52
52
|
title: 'Step',
|
|
53
53
|
description: 'rounding/increment in seconds',
|
|
54
54
|
type: 'integer',
|
|
55
|
-
|
|
55
|
+
default: null,
|
|
56
56
|
anyOf: [{
|
|
57
|
+
const: null,
|
|
58
|
+
title: '1 minute'
|
|
59
|
+
}, {
|
|
60
|
+
const: 60
|
|
61
|
+
}, {
|
|
57
62
|
const: 60 * 5,
|
|
58
63
|
title: '5 minutes'
|
|
59
64
|
}, {
|
|
@@ -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/elements/inputs.js
CHANGED
|
@@ -156,8 +156,8 @@ exports.input_text = {
|
|
|
156
156
|
nodes: 'inline*'
|
|
157
157
|
},
|
|
158
158
|
patterns: {
|
|
159
|
-
tel: /^(\(\d+\))? *\d+([
|
|
160
|
-
email: /^[\w.!#$%&'
|
|
159
|
+
tel: /^(\(\d+\))? *\d+([ .-]?\d+)*$/.source,
|
|
160
|
+
email: /^[\w.!#$%&'*+/=?^`{|}~-]+@\w(?:[\w-]{0,61}\w)?(?:\.\w(?:[\w-]{0,61}\w)?)*$/.source
|
|
161
161
|
},
|
|
162
162
|
html: `<div class="[width|num: wide] field [type|eq:hidden:hidden:]">
|
|
163
163
|
<label block-content="label">Label</label>
|
|
@@ -233,7 +233,7 @@ exports.input_range = {
|
|
|
233
233
|
menu: "form",
|
|
234
234
|
group: "block",
|
|
235
235
|
context: 'form//',
|
|
236
|
-
properties: Object.assign({
|
|
236
|
+
properties: Object.assign({}, exports.input_number.properties, {
|
|
237
237
|
multiple: {
|
|
238
238
|
title: 'Multiple',
|
|
239
239
|
type: 'boolean',
|
|
@@ -242,9 +242,14 @@ exports.input_range = {
|
|
|
242
242
|
pips: {
|
|
243
243
|
title: 'Pips',
|
|
244
244
|
type: 'boolean',
|
|
245
|
-
default:
|
|
245
|
+
default: false
|
|
246
|
+
},
|
|
247
|
+
step: {
|
|
248
|
+
title: 'Step',
|
|
249
|
+
type: "number",
|
|
250
|
+
default: 10
|
|
246
251
|
}
|
|
247
|
-
}
|
|
252
|
+
}),
|
|
248
253
|
contents: {
|
|
249
254
|
id: 'label',
|
|
250
255
|
nodes: 'inline*'
|
package/elements/layout.js
CHANGED
|
@@ -57,8 +57,10 @@ exports.layout = {
|
|
|
57
57
|
},
|
|
58
58
|
width: {
|
|
59
59
|
title: 'Width',
|
|
60
|
-
default: "full",
|
|
61
60
|
anyOf: [{
|
|
61
|
+
type: "null",
|
|
62
|
+
title: "None"
|
|
63
|
+
}, {
|
|
62
64
|
const: "full",
|
|
63
65
|
title: "Full"
|
|
64
66
|
}, {
|
|
@@ -125,6 +127,7 @@ exports.layout = {
|
|
|
125
127
|
crop: {
|
|
126
128
|
title: 'Crop and scale',
|
|
127
129
|
type: "object",
|
|
130
|
+
nullable: true,
|
|
128
131
|
properties: {
|
|
129
132
|
x: {
|
|
130
133
|
type: "number",
|