@frui.ts/htmlcontrols
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
@@ -1,3 +0,4 @@ | ||
import { BindingTarget } from "@frui.ts/helpers"; | ||
import { BindingComponent, IBindingProps } from "@frui.ts/views"; | ||
import type { BindingTarget } from "@frui.ts/helpers"; | ||
import type { IBindingProps } from "@frui.ts/views"; | ||
import { BindingComponent } from "@frui.ts/views"; | ||
import React from "react"; | ||
@@ -4,0 +5,0 @@ declare type CheckboxProps<TTarget extends BindingTarget> = IBindingProps<TTarget> & React.InputHTMLAttributes<HTMLInputElement>; |
@@ -10,2 +10,4 @@ "use strict"; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -12,0 +14,0 @@ function __() { this.constructor = d; } |
@@ -1,3 +0,3 @@ | ||
import { BindingProperty, BindingTarget } from "@frui.ts/helpers"; | ||
import { IBindingProps } from "@frui.ts/views"; | ||
import type { BindingProperty, BindingTarget } from "@frui.ts/helpers"; | ||
import type { IBindingProps } from "@frui.ts/views"; | ||
declare type SetOrArrayInnerType<TTarget, TProperty extends keyof TTarget> = TTarget[TProperty] extends Set<infer TSetValue> ? TSetValue : TTarget[TProperty] extends Array<infer TArrayValue> ? TArrayValue : never; | ||
@@ -4,0 +4,0 @@ export interface CollectionCheckboxProps<TTarget extends BindingTarget, TProperty extends BindingProperty<TTarget>> extends IBindingProps<TTarget, TProperty> { |
@@ -50,3 +50,3 @@ "use strict"; | ||
function useCollection(props) { | ||
var collection = views_1.getValue(props.target, props.property); | ||
var collection = (0, views_1.getValue)(props.target, props.property); | ||
if (!collection) { | ||
@@ -56,6 +56,6 @@ throw new Error("The target value must be an array or a Set"); | ||
var key = props.value; | ||
if (helpers_1.isSet(collection)) { | ||
if ((0, helpers_1.isSet)(collection)) { | ||
var checked = collection.has(key); | ||
var toggle = function () { return (collection.has(key) ? collection.delete(key) : collection.add(key)); }; | ||
return [checked, mobx_1.action(toggle)]; | ||
return [checked, (0, mobx_1.action)(toggle)]; | ||
} | ||
@@ -74,3 +74,3 @@ else { | ||
}; | ||
return [checked, mobx_1.action(toggle)]; | ||
return [checked, (0, mobx_1.action)(toggle)]; | ||
} | ||
@@ -80,7 +80,7 @@ } | ||
var _a = __read(useCollection(props), 2), checked = _a[0], toggle = _a[1]; | ||
var _b = views_1.omitBindingProps(props), value = _b.value, restProps = __rest(_b, ["value"]); | ||
var _b = (0, views_1.omitBindingProps)(props), value = _b.value, restProps = __rest(_b, ["value"]); | ||
return react_1.default.createElement("input", __assign({}, restProps, { type: "checkbox", checked: !!checked, onChange: toggle })); | ||
} | ||
var CollectionCheckbox = mobx_react_lite_1.observer(collectionCheckbox); | ||
var CollectionCheckbox = (0, mobx_react_lite_1.observer)(collectionCheckbox); | ||
exports.default = CollectionCheckbox; | ||
//# sourceMappingURL=collectionCheckbox.js.map |
@@ -1,3 +0,3 @@ | ||
import { BindingProperty, BindingTarget } from "@frui.ts/helpers"; | ||
import { IBindingProps } from "@frui.ts/views"; | ||
import type { BindingProperty, BindingTarget } from "@frui.ts/helpers"; | ||
import type { IBindingProps } from "@frui.ts/views"; | ||
import React from "react"; | ||
@@ -4,0 +4,0 @@ declare type TextboxProps<TTarget extends BindingTarget, TProperty extends BindingProperty<TTarget>> = IBindingProps<TTarget, TProperty, string> & React.InputHTMLAttributes<HTMLInputElement>; |
@@ -26,8 +26,8 @@ "use strict"; | ||
function textbox(props) { | ||
var _a = __read(views_1.useBinding(props), 2), value = _a[0], setValue = _a[1]; | ||
var _a = __read((0, views_1.useBinding)(props), 2), value = _a[0], setValue = _a[1]; | ||
var handleValueChanged = function (e) { return setValue(e.target.value); }; | ||
return react_1.default.createElement("input", { type: "text", value: value || "", onChange: handleValueChanged }); | ||
} | ||
var Textbox = mobx_react_lite_1.observer(textbox); | ||
var Textbox = (0, mobx_react_lite_1.observer)(textbox); | ||
exports.default = Textbox; | ||
//# sourceMappingURL=textbox.js.map |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Plain HTML controls ready for Frui.ts integration", | ||
@@ -39,13 +39,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/react": "^16.14.2" | ||
"@types/react": "^17.0.33" | ||
}, | ||
"dependencies": { | ||
"@frui.ts/helpers": "^1.0.0-alpha.1", | ||
"@frui.ts/views": "^1.0.0-alpha.1", | ||
"@frui.ts/helpers": "^1.0.0-alpha.2", | ||
"@frui.ts/views": "^1.0.0-alpha.2", | ||
"mobx-react-lite": "^2.2.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.13.0" | ||
"react": "^17.0.2" | ||
}, | ||
"gitHead": "debcc8b7993b1b0708853dddb9d29dc2a5727477" | ||
"gitHead": "99546362efd91f923e743ed07477bb6ef0b1caa3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20460
219
+ Addedreact@17.0.2(transitive)