@frui.ts/htmlcontrols
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-rc.1
@@ -5,4 +5,4 @@ import type { BindingTarget, TypedBindingProperty } from "@frui.ts/helpers"; | ||
export declare class Checkbox<TRestriction extends boolean | undefined, TTarget extends BindingTarget, TProperty extends TypedBindingProperty<TTarget, TRestriction>> extends BindingComponent<React.ComponentPropsWithoutRef<"input">, TRestriction, TTarget, TProperty> { | ||
render(): JSX.Element; | ||
render(): React.JSX.Element; | ||
protected handleValueChanged(e: React.ChangeEvent<HTMLInputElement>): void; | ||
} |
import type { BindingTarget, TypedBindingProperty } from "@frui.ts/helpers"; | ||
import type { WithBindingProps } from "@frui.ts/views"; | ||
import type { ComponentPropsWithoutRef } from "react"; | ||
import React from "react"; | ||
type CollectionCheckboxProps<TItem> = { | ||
value: TItem; | ||
}; | ||
declare function collectionCheckbox<TItem, TRestriction extends TItem[] | Set<TItem> | undefined, TTarget extends BindingTarget, TProperty extends TypedBindingProperty<TTarget, TRestriction>>(props: WithBindingProps<CollectionCheckboxProps<TItem> & ComponentPropsWithoutRef<"input">, TRestriction, TTarget, TProperty>): JSX.Element; | ||
declare function collectionCheckbox<TItem, TRestriction extends TItem[] | Set<TItem> | undefined, TTarget extends BindingTarget, TProperty extends TypedBindingProperty<TTarget, TRestriction>>(props: WithBindingProps<CollectionCheckboxProps<TItem> & ComponentPropsWithoutRef<"input">, TRestriction, TTarget, TProperty>): React.JSX.Element; | ||
declare const CollectionCheckbox: typeof collectionCheckbox & { | ||
@@ -9,0 +10,0 @@ displayName: string; |
import type { BindingTarget, TypedBindingProperty } from "@frui.ts/helpers"; | ||
import type { WithBindingProps } from "@frui.ts/views"; | ||
import type { ComponentPropsWithoutRef } from "react"; | ||
declare function textbox<TRestriction extends string, TTarget extends BindingTarget, TProperty extends TypedBindingProperty<TTarget, TRestriction>>(props: WithBindingProps<ComponentPropsWithoutRef<"input">, TRestriction, TTarget, TProperty>): JSX.Element; | ||
import React from "react"; | ||
declare function textbox<TRestriction extends string, TTarget extends BindingTarget, TProperty extends TypedBindingProperty<TTarget, TRestriction>>(props: WithBindingProps<ComponentPropsWithoutRef<"input">, TRestriction, TTarget, TProperty>): React.JSX.Element; | ||
declare const Textbox: typeof textbox & { | ||
@@ -6,0 +7,0 @@ displayName: string; |
@@ -13,8 +13,3 @@ import { bound as u, isSet as d } from "@frui.ts/helpers"; | ||
render() { | ||
return /* @__PURE__ */ l.createElement(m, null, () => /* @__PURE__ */ l.createElement("input", { | ||
...this.inheritedProps, | ||
type: "checkbox", | ||
checked: !!this.value, | ||
onChange: this.handleValueChanged | ||
})); | ||
return /* @__PURE__ */ l.createElement(m, null, () => /* @__PURE__ */ l.createElement("input", { ...this.inheritedProps, type: "checkbox", checked: !!this.value, onChange: this.handleValueChanged })); | ||
} | ||
@@ -40,8 +35,3 @@ handleValueChanged(e) { | ||
const [e, t] = k(n), { value: c, ...o } = i(n); | ||
return /* @__PURE__ */ l.createElement("input", { | ||
...o, | ||
type: "checkbox", | ||
checked: !!e, | ||
onChange: t | ||
}); | ||
return /* @__PURE__ */ l.createElement("input", { ...o, type: "checkbox", checked: !!e, onChange: t }); | ||
} | ||
@@ -51,8 +41,3 @@ const B = h(y); | ||
const [e, t] = f(n), c = (o) => t(o.target.value); | ||
return /* @__PURE__ */ l.createElement("input", { | ||
type: "text", | ||
...i(n), | ||
value: e || "", | ||
onChange: c | ||
}); | ||
return /* @__PURE__ */ l.createElement("input", { type: "text", ...i(n), value: e || "", onChange: c }); | ||
} | ||
@@ -59,0 +44,0 @@ const j = h(P); |
@@ -1,2 +0,2 @@ | ||
(function(r,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@frui.ts/helpers"),require("@frui.ts/views"),require("mobx-react-lite"),require("react"),require("mobx")):typeof define=="function"&&define.amd?define(["exports","@frui.ts/helpers","@frui.ts/views","mobx-react-lite","react","mobx"],i):(r=typeof globalThis<"u"?globalThis:r||self,i(r["fruits-htmlcontrols"]={},r.helpers,r.views,r.mobxReactLite,r.React,r.mobx))})(this,function(r,i,l,a,p,h){"use strict";const s=(t=>t&&typeof t=="object"&&"default"in t?t:{default:t})(p);var g=Object.defineProperty,x=Object.getOwnPropertyDescriptor,b=(t,e,n,c)=>{for(var o=c>1?void 0:c?x(e,n):e,u=t.length-1,d;u>=0;u--)(d=t[u])&&(o=(c?d(e,n,o):d(o))||o);return c&&o&&g(e,n,o),o};class f extends l.BindingComponent{render(){return s.default.createElement(a.Observer,null,()=>s.default.createElement("input",{...this.inheritedProps,type:"checkbox",checked:!!this.value,onChange:this.handleValueChanged}))}handleValueChanged(e){this.setValue(e.target.checked)}}b([i.bound],f.prototype,"handleValueChanged",1);function v(t){const e=l.getValue(t.target,t.property);if(!e)throw new Error("The target value must be an array or a Set");const n=t.value;if(i.isSet(e)){const c=e.has(n),o=()=>e.has(n)?e.delete(n):e.add(n);return[c,h.action(o)]}else{const c=e.includes(n),o=()=>{const u=e.indexOf(n);u>=0?e.splice(u,1):e.push(n)};return[c,h.action(o)]}}function C(t){const[e,n]=v(t),{value:c,...o}=l.omitBindingProps(t);return s.default.createElement("input",{...o,type:"checkbox",checked:!!e,onChange:n})}const m=a.observer(C);function y(t){const[e,n]=l.useBinding(t),c=o=>n(o.target.value);return s.default.createElement("input",{type:"text",...l.omitBindingProps(t),value:e||"",onChange:c})}const _=a.observer(y);r.Checkbox=f,r.CollectionCheckbox=m,r.Textbox=_,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(r,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@frui.ts/helpers"),require("@frui.ts/views"),require("mobx-react-lite"),require("react"),require("mobx")):typeof define=="function"&&define.amd?define(["exports","@frui.ts/helpers","@frui.ts/views","mobx-react-lite","react","mobx"],i):(r=typeof globalThis<"u"?globalThis:r||self,i(r["fruits-htmlcontrols"]={},r.helpers,r.views,r.mobxReactLite,r.React,r.mobx))})(this,function(r,i,u,a,l,d){"use strict";var p=Object.defineProperty,x=Object.getOwnPropertyDescriptor,g=(o,e,t,c)=>{for(var n=c>1?void 0:c?x(e,t):e,s=o.length-1,h;s>=0;s--)(h=o[s])&&(n=(c?h(e,t,n):h(n))||n);return c&&n&&p(e,t,n),n};class f extends u.BindingComponent{render(){return l.createElement(a.Observer,null,()=>l.createElement("input",{...this.inheritedProps,type:"checkbox",checked:!!this.value,onChange:this.handleValueChanged}))}handleValueChanged(e){this.setValue(e.target.checked)}}g([i.bound],f.prototype,"handleValueChanged",1);function b(o){const e=u.getValue(o.target,o.property);if(!e)throw new Error("The target value must be an array or a Set");const t=o.value;if(i.isSet(e)){const c=e.has(t),n=()=>e.has(t)?e.delete(t):e.add(t);return[c,d.action(n)]}else{const c=e.includes(t),n=()=>{const s=e.indexOf(t);s>=0?e.splice(s,1):e.push(t)};return[c,d.action(n)]}}function C(o){const[e,t]=b(o),{value:c,...n}=u.omitBindingProps(o);return l.createElement("input",{...n,type:"checkbox",checked:!!e,onChange:t})}const v=a.observer(C);function m(o){const[e,t]=u.useBinding(o),c=n=>t(n.target.value);return l.createElement("input",{type:"text",...u.omitBindingProps(o),value:e||"",onChange:c})}const y=a.observer(m);r.Checkbox=f,r.CollectionCheckbox=v,r.Textbox=y,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}); | ||
//# sourceMappingURL=fruits-htmlcontrols.umd.js.map |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-rc.1", | ||
"description": "Plain HTML controls ready for Frui.ts integration", | ||
@@ -43,8 +43,8 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/react": "^18.0.25" | ||
"@types/react": "^18.2.11" | ||
}, | ||
"dependencies": { | ||
"@frui.ts/helpers": "^1.0.0-beta.6", | ||
"@frui.ts/views": "^1.0.0-beta.6", | ||
"mobx-react-lite": "3" | ||
"@frui.ts/helpers": "^1.0.0-rc.1", | ||
"@frui.ts/views": "^1.0.0-rc.1", | ||
"mobx-react-lite": "3.4.3" | ||
}, | ||
@@ -55,3 +55,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "adf52b1d60660fc686182547cca34af079bdecf4" | ||
"gitHead": "c17e77c7246207827d09d34cadbb54b07ebbd82e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19881
88
Updated@frui.ts/helpers@^1.0.0-rc.1
Updated@frui.ts/views@^1.0.0-rc.1
Updatedmobx-react-lite@3.4.3