blockly-fluid 1.3.6 → 1.3.9
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 +12 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -127,6 +127,16 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
127
127
|
...(field.validator) ? [field.validator] : []
|
|
128
128
|
]), token);
|
|
129
129
|
|
|
130
|
+
break;
|
|
131
|
+
case "number":
|
|
132
|
+
dummy.appendField(new Blockly.FieldNumber(...[
|
|
133
|
+
translate((typeof field.default === "function") ? field.default() : (field.default || 0)),
|
|
134
|
+
(typeof field.minimum === "function") ? field.minimum() : (field.minimum || null),
|
|
135
|
+
(typeof field.maximum === "function") ? field.maximum() : (field.maximum || null),
|
|
136
|
+
(typeof field.stepSize === "function") ? field.stepSize() : (field.stepSize || null),
|
|
137
|
+
...(field.validator) ? [field.validator] : []
|
|
138
|
+
]), token);
|
|
139
|
+
|
|
130
140
|
break;
|
|
131
141
|
case "multiline":
|
|
132
142
|
if (!Blockly.FieldMultilineInput) require("./fields/FieldMultilineInput.js")(Blockly);
|
|
@@ -315,14 +325,8 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
315
325
|
layout: "NUMBER",
|
|
316
326
|
fields: {
|
|
317
327
|
NUMBER: {
|
|
318
|
-
type: "
|
|
319
|
-
default:
|
|
320
|
-
validator: (value) => {
|
|
321
|
-
if (!value) return "0";
|
|
322
|
-
if (/^-?\d*\.?\d*$/.test(value)) return value;
|
|
323
|
-
|
|
324
|
-
return "0";
|
|
325
|
-
}
|
|
328
|
+
type: "number",
|
|
329
|
+
default: 0
|
|
326
330
|
}
|
|
327
331
|
},
|
|
328
332
|
output: Number,
|