@rkmodules/rules 0.0.134 → 0.0.135
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/index.cjs.js +19 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -6112,6 +6112,24 @@ var InputText = React.memo(function (_a) {
|
|
|
6112
6112
|
}, [inner, value, onChange]);
|
|
6113
6113
|
return (React.createElement("textarea", { value: inner, onChange: function (e) { return setInner(e.target.value); }, onBlur: handleBlur, onKeyDown: handleKey, onMouseDown: function (e) { return e.stopPropagation(); }, rows: 4 }));
|
|
6114
6114
|
});
|
|
6115
|
+
var InputBoolean = React.memo(function (_a) {
|
|
6116
|
+
var value = _a.value, onChange = _a.onChange, allowEmpty = _a.allowEmpty;
|
|
6117
|
+
var inputRef = React.useRef(null);
|
|
6118
|
+
React.useEffect(function () {
|
|
6119
|
+
if (allowEmpty && inputRef.current) {
|
|
6120
|
+
console.log("setting indeterminate");
|
|
6121
|
+
inputRef.current.indeterminate = value === undefined;
|
|
6122
|
+
}
|
|
6123
|
+
}, [value]);
|
|
6124
|
+
var handleChange = function () {
|
|
6125
|
+
var next = !value;
|
|
6126
|
+
if (value === false && allowEmpty)
|
|
6127
|
+
next = undefined;
|
|
6128
|
+
console.log("setting next", next);
|
|
6129
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(next);
|
|
6130
|
+
};
|
|
6131
|
+
return (React.createElement("input", { ref: inputRef, type: "checkbox", checked: Boolean(value), onChange: handleChange }));
|
|
6132
|
+
});
|
|
6115
6133
|
function Control(_a) {
|
|
6116
6134
|
var _b;
|
|
6117
6135
|
var value = _a.value, vardef = _a.vardef, data = _a.data, onChange = _a.onChange;
|
|
@@ -6136,7 +6154,7 @@ function Control(_a) {
|
|
|
6136
6154
|
return (React.createElement(InputNumber, { value: value, onChange: onChange, step: vardef.step, min: vardef.min, max: vardef.max, inputMode: "numeric", onMouseDown: function (e) { return e.stopPropagation(); } }));
|
|
6137
6155
|
}
|
|
6138
6156
|
case "boolean":
|
|
6139
|
-
return (React.createElement(
|
|
6157
|
+
return (React.createElement(InputBoolean, { value: value, onChange: onChange, allowEmpty: vardef.allowEmpty }));
|
|
6140
6158
|
default:
|
|
6141
6159
|
return React.createElement("span", { className: styles$1.PortLabel },
|
|
6142
6160
|
"(",
|