jb-textarea 3.7.0 → 3.7.1
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/README.md +3 -1
- package/package.json +1 -1
- package/react/dist/JBTextarea.cjs.js +1 -1
- package/react/dist/JBTextarea.cjs.js.map +1 -1
- package/react/dist/JBTextarea.d.ts +0 -2
- package/react/dist/JBTextarea.js +1 -1
- package/react/dist/JBTextarea.js.map +1 -1
- package/react/dist/JBTextarea.umd.js +1 -1
- package/react/dist/JBTextarea.umd.js.map +1 -1
- package/react/dist/attributes-hook.d.ts +1 -0
- package/react/lib/JBTextarea.tsx +1 -2
- package/react/lib/attributes-hook.ts +11 -0
- package/dist/lib/jb-textarea.d.ts +0 -37
- package/dist/lib/types.d.ts +0 -10
- package/dist/web-component/jb-textarea/lib/jb-textarea.d.ts +0 -37
- package/dist/web-component/jb-textarea/lib/types.d.ts +0 -10
- package/react/dist/common/hooks/use-event.d.ts +0 -3
- package/react/dist/common/hooks/useLazyRef.d.ts +0 -4
- package/react/dist/common/hooks/useMobx.d.ts +0 -4
- package/react/dist/common/scripts/device-detection.d.ts +0 -1
- package/react/dist/common/scripts/persian-helper.d.ts +0 -3
- package/react/dist/lib/JBTextarea.d.ts +0 -44
- package/react/dist/lib/events-hook.d.ts +0 -20
- package/react/dist/web-component/jb-textarea/react/lib/JBTextarea.d.ts +0 -44
- package/react/dist/web-component/jb-textarea/react/lib/events-hook.d.ts +0 -20
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ npm i jb-textarea
|
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
35
|
document.querySelector("jb-textarea").value;
|
|
36
|
-
//
|
|
36
|
+
// return inputted text
|
|
37
37
|
document.querySelector("jb-textarea").value = "salam";
|
|
38
38
|
set value to salam
|
|
39
39
|
```
|
|
@@ -73,6 +73,7 @@ const result = document.getElementByTagName('jb-textarea').validation.addValidat
|
|
|
73
73
|
### check validation
|
|
74
74
|
|
|
75
75
|
like any other jb design system you can access validation by `validation` property:
|
|
76
|
+
|
|
76
77
|
```js
|
|
77
78
|
//access validation module
|
|
78
79
|
document.getElementByTagName('jb-textarea').validation
|
|
@@ -105,6 +106,7 @@ the good point of set boundary with css variable is you can set different min or
|
|
|
105
106
|
|
|
106
107
|
in some cases in your project you need to change default style of web-component for example you need zero margin or different border-radius and etc.
|
|
107
108
|
if you want to set a custom style to this web-component all you need is to set css variable in parent scope of web-component
|
|
109
|
+
|
|
108
110
|
| css variable name | description |
|
|
109
111
|
| ------------- | ------------- |
|
|
110
112
|
| --jb-textarea-margin | web-component margin default is `0 12px` |
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,n=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n,o,
|
|
1
|
+
"use strict";var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,n=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n,o,c)=>{if(n&&"object"==typeof n||"function"==typeof n)for(var l,s=u(n),i=0,f=s.length;i<f;i++)l=s[i],a.call(e,l)||l===o||t(e,l,{get:(e=>n[e]).bind(null,l),enumerable:!(c=r(n,l))||c.enumerable});return e},c=(r,u,a)=>(a=null!=r?e(n(r)):{},o(!u&&r&&r.__esModule?a:t(a,"default",{value:r,enumerable:!0}),r));const l=c(require("react"));require("jb-textarea");const s=c(require("jb-core/react")),i=l.default.forwardRef((e,t)=>{{let r=(0,l.useRef)(null);return(0,l.useImperativeHandle)(t,()=>r?r.current:void 0,[r]),(0,l.useEffect)(()=>{let t=e.value||"";r.current&&(r.current.value=t)},[e.value]),(0,l.useEffect)(()=>{r.current&&(r.current.validation.list=e.validationList||[])},[e.validationList]),(0,l.useEffect)(()=>{r.current&&void 0!==e.required&&(e.required?r.current.setAttribute("required",""):r.current.removeAttribute("required"))},[e.required]),(0,l.useEffect)(()=>{r.current&&(r.current.autoHeight=e.autoHeight||!1)},[e.autoHeight]),(0,l.useEffect)(()=>{e.error?r?.current?.setAttribute("error",e.error):r?.current?.removeAttribute("error")},[e.error]),(0,l.useEffect)(()=>{e.name?r?.current?.setAttribute("name",e.name||""):r?.current?.removeAttribute("name")},[e.name]),(0,s.useEvent)(r,"load",e.onLoad,!0),(0,s.useEvent)(r,"init",e.onInit,!0),(0,s.useEvent)(r,"change",e.onChange),(0,s.useEvent)(r,"keydown",e.onKeyDown),(0,s.useEvent)(r,"input",e.onInput),(0,s.useEvent)(r,"keyup",e.onKeyUp),(0,s.useEvent)(r,"focus",e.onFocus),(0,s.useEvent)(r,"blur",e.onBlur),l.default.createElement("jb-textarea",{placeholder:e.placeholder,class:e.className,style:e.style,ref:r,label:e.label,message:e.message})}});exports.JBTextarea=i;
|
|
2
2
|
//# sourceMappingURL=JBTextarea.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JBTextarea.cjs.js","names":[],"sources":["../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBTextarea.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"JBTextarea.cjs.js","names":[],"sources":["../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBTextarea.tsx"],"sourcesContent":["","",""],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBM,SAAU,UAAU,SAA4C,OAAiB;AACrF,6BAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,6BAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,6BAAS,SAAS,UAAU,MAAM,SAAS;AAC3C,6BAAS,SAAS,WAAW,MAAM,UAAU;AAC7C,6BAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,6BAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,6BAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,6BAAS,SAAS,QAAQ,MAAM,OAAO;AACzC;;;;AClBM,SAAU,uBAAuB,SAA4C,OAA2B;AAE5G,sBAAU,MAAG;EACX,MAAM,QAAe,MAAM,SAAS;AACpC,MAAG,QAAQ,QACT,SAAQ,QAAQ,QAAQ;CAE3B,GAAE,CAEH,MAAU;sBAEN,MAAA;AACF,MAAA,QAAA,QACE,SAAM,QAAc,WAAE,OAAA,MAAA,kBAAA,CAAA;WAGtB;AAEJ,sBAAU,MAAA;AAEV,MAAA,QAAe,WAAA,MAAA,aAAA,UACV,OAAA,WAAgB,QAAA,QAAA,aAAA,YAAA,GAAA,GAAA,QAAA,QAAA,gBAAA,WAAA;KAGjB,MAAM,QAEV,EAAA;sBACM,MAAM;MACR,QAAO,QACT,SAAA,QAAA,aAAA,MAAA,cAAA;KAEA,MAAA,UACD,EAAA;AAEC,sBAAU,MAAG;AACb,MAAI,MAAM,MACR,UAAS,SAAS,aAAa,SAAQ,MAAM,MAAI;gBAC5C,SAAA,gBAAA,QAAA;KAGL,MAAM,KAEZ,EAAA;;;;;;;;;AChCA,MAAA,2BAAA,cAAA,WAAA,CAAA,OAAA,QAAA;CACA;EAEI,MAAA,UAAA,kBAAA,KAAA;AACA,iCAAgB,KAA+B,MAAK,UAAA,QAAA,UAAA,WAAA,CACpD,OAKA,EAAA;AACA,yBAAkB,SAAM,MAAA;AACxB,YACE,SAAA,MAAA;AAEJ,uBAAA,cAAA,cAAA,eAAA;GACA,aAAA,MAAA;GASM,OAAU,MAAC"}
|
|
@@ -23,7 +23,6 @@ declare const JBTextarea: React.ForwardRefExoticComponent<EventProps & JBTextare
|
|
|
23
23
|
className?: string;
|
|
24
24
|
message?: string;
|
|
25
25
|
style?: CSSProperties;
|
|
26
|
-
name?: string;
|
|
27
26
|
} & React.RefAttributes<unknown>>;
|
|
28
27
|
export type Props = EventProps & JBTextareaAttributes & {
|
|
29
28
|
label?: string;
|
|
@@ -31,6 +30,5 @@ export type Props = EventProps & JBTextareaAttributes & {
|
|
|
31
30
|
className?: string;
|
|
32
31
|
message?: string;
|
|
33
32
|
style?: CSSProperties;
|
|
34
|
-
name?: string;
|
|
35
33
|
};
|
|
36
34
|
export { JBTextarea };
|
package/react/dist/JBTextarea.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useEffect as r,useImperativeHandle as t,useRef as
|
|
1
|
+
import e,{useEffect as r,useImperativeHandle as t,useRef as a}from"react";import"jb-textarea";import{useEvent as n}from"jb-core/react";let o=e.forwardRef((o,u)=>{{var i;let l=a(null);return t(u,()=>l?l.current:void 0,[l]),r(()=>{let e=i.value||"";l.current&&(l.current.value=e)},[(i=o).value]),r(()=>{l.current&&(l.current.validation.list=i.validationList||[])},[i.validationList]),r(()=>{l.current&&void 0!==i.required&&(i.required?l.current.setAttribute("required",""):l.current.removeAttribute("required"))},[i.required]),r(()=>{l.current&&(l.current.autoHeight=i.autoHeight||!1)},[i.autoHeight]),r(()=>{i.error?l?.current?.setAttribute("error",i.error):l?.current?.removeAttribute("error")},[i.error]),r(()=>{i.name?l?.current?.setAttribute("name",i.name||""):l?.current?.removeAttribute("name")},[i.name]),n(l,"load",o.onLoad,!0),n(l,"init",o.onInit,!0),n(l,"change",o.onChange),n(l,"keydown",o.onKeyDown),n(l,"input",o.onInput),n(l,"keyup",o.onKeyUp),n(l,"focus",o.onFocus),n(l,"blur",o.onBlur),e.createElement("jb-textarea",{placeholder:o.placeholder,class:o.className,style:o.style,ref:l,label:o.label,message:o.message})}});export{o as JBTextarea};
|
|
2
2
|
//# sourceMappingURL=JBTextarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JBTextarea.js","names":[],"sources":["../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBTextarea.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"JBTextarea.js","names":[],"sources":["../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBTextarea.tsx"],"sourcesContent":["","",""],"mappings":";;;;;AAsBM,SAAU,UAAU,SAA4C,OAAiB;AACrF,UAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,UAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,UAAS,SAAS,UAAU,MAAM,SAAS;AAC3C,UAAS,SAAS,WAAW,MAAM,UAAU;AAC7C,UAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,UAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,UAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,UAAS,SAAS,QAAQ,MAAM,OAAO;AACzC;;;;AClBM,SAAU,uBAAuB,SAA4C,OAA2B;AAE5G,WAAU,MAAG;EACX,MAAM,QAAe,MAAM,SAAS;AACpC,MAAG,QAAQ,QACT,SAAQ,QAAQ,QAAQ;CAE3B,GAAE,CAEH,MAAU;WAEN,MAAA;AACF,MAAA,QAAA,QACE,SAAM,QAAc,WAAE,OAAA,MAAA,kBAAA,CAAA;WAGtB;AAEJ,WAAU,MAAA;AAEV,MAAA,QAAe,WAAA,MAAA,aAAA,UACV,OAAA,WAAgB,QAAA,QAAA,aAAA,YAAA,GAAA,GAAA,QAAA,QAAA,gBAAA,WAAA;KAGjB,MAAM,QAEV,EAAA;WACM,MAAM;MACR,QAAO,QACT,SAAA,QAAA,aAAA,MAAA,cAAA;KAEA,MAAA,UACD,EAAA;AAEC,WAAU,MAAG;AACb,MAAI,MAAM,MACR,UAAS,SAAS,aAAa,SAAQ,MAAM,MAAI;gBAC5C,SAAA,gBAAA,QAAA;KAGL,MAAM,KAEZ,EAAA;;;;;;;;;AChCA,MAAA,2BAAA,MAAA,WAAA,CAAA,OAAA,QAAA;CACA;EAEI,MAAA,UAAA,OAAA,KAAA;AACA,sBAAgB,KAA+B,MAAK,UAAA,QAAA,UAAA,WAAA,CACpD,OAKA,EAAA;AACA,yBAAkB,SAAM,MAAA;AACxB,YACE,SAAA,MAAA;AAEJ,uBAAA,MAAA,cAAA,eAAA;GACA,aAAA,MAAA;GASM,OAAU,MAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t;e=this,t=function(e,t,r,u){"use strict";var n=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,
|
|
1
|
+
var e,t;e=this,t=function(e,t,r,u){"use strict";var n=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,s=(e,t,r,u)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var n,l=c(t),s=0,f=l.length;s<f;s++)n=l[s],i.call(e,n)||n===r||a(e,n,{get:(e=>t[e]).bind(null,n),enumerable:!(u=o(t,n))||u.enumerable});return e},f=(e,t,r)=>(r=null!=e?n(l(e)):{},s(!t&&e&&e.__esModule?r:a(r,"default",{value:e,enumerable:!0}),e));t=f(t),u=f(u);let d=t.default.forwardRef((e,r)=>{{let n=(0,t.useRef)(null);return(0,t.useImperativeHandle)(r,()=>n?n.current:void 0,[n]),(0,t.useEffect)(()=>{let t=e.value||"";n.current&&(n.current.value=t)},[e.value]),(0,t.useEffect)(()=>{n.current&&(n.current.validation.list=e.validationList||[])},[e.validationList]),(0,t.useEffect)(()=>{n.current&&void 0!==e.required&&(e.required?n.current.setAttribute("required",""):n.current.removeAttribute("required"))},[e.required]),(0,t.useEffect)(()=>{n.current&&(n.current.autoHeight=e.autoHeight||!1)},[e.autoHeight]),(0,t.useEffect)(()=>{e.error?n?.current?.setAttribute("error",e.error):n?.current?.removeAttribute("error")},[e.error]),(0,t.useEffect)(()=>{e.name?n?.current?.setAttribute("name",e.name||""):n?.current?.removeAttribute("name")},[e.name]),(0,u.useEvent)(n,"load",e.onLoad,!0),(0,u.useEvent)(n,"init",e.onInit,!0),(0,u.useEvent)(n,"change",e.onChange),(0,u.useEvent)(n,"keydown",e.onKeyDown),(0,u.useEvent)(n,"input",e.onInput),(0,u.useEvent)(n,"keyup",e.onKeyUp),(0,u.useEvent)(n,"focus",e.onFocus),(0,u.useEvent)(n,"blur",e.onBlur),t.default.createElement("jb-textarea",{placeholder:e.placeholder,class:e.className,style:e.style,ref:n,label:e.label,message:e.message})}});e.JBTextarea=d},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("jb-textarea"),require("jb-core/react")):"function"==typeof define&&define.amd?define(["exports","react","jb-textarea","jb-core/react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JBTextareaReact={},e.React,e.JBTextarea,e.JBCoreReact);
|
|
2
2
|
//# sourceMappingURL=JBTextarea.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JBTextarea.umd.js","names":[],"sources":["../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBTextarea.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"JBTextarea.umd.js","names":[],"sources":["../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBTextarea.tsx"],"sourcesContent":["","",""],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBM,SAAU,UAAU,SAA4C,OAAiB;AACrF,6BAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,6BAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,6BAAS,SAAS,UAAU,MAAM,SAAS;AAC3C,6BAAS,SAAS,WAAW,MAAM,UAAU;AAC7C,6BAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,6BAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,6BAAS,SAAS,SAAS,MAAM,QAAQ;AACzC,6BAAS,SAAS,QAAQ,MAAM,OAAO;AACzC;;;;AClBM,SAAU,uBAAuB,SAA4C,OAA2B;AAE5G,sBAAU,MAAG;EACX,MAAM,QAAe,MAAM,SAAS;AACpC,MAAG,QAAQ,QACT,SAAQ,QAAQ,QAAQ;CAE3B,GAAE,CAEH,MAAU;sBAEN,MAAA;AACF,MAAA,QAAA,QACE,SAAM,QAAc,WAAE,OAAA,MAAA,kBAAA,CAAA;WAGtB;AAEJ,sBAAU,MAAA;AAEV,MAAA,QAAe,WAAA,MAAA,aAAA,UACV,OAAA,WAAgB,QAAA,QAAA,aAAA,YAAA,GAAA,GAAA,QAAA,QAAA,gBAAA,WAAA;KAGjB,MAAM,QAEV,EAAA;sBACM,MAAM;MACR,QAAO,QACT,SAAA,QAAA,aAAA,MAAA,cAAA;KAEA,MAAA,UACD,EAAA;AAEC,sBAAU,MAAG;AACb,MAAI,MAAM,MACR,UAAS,SAAS,aAAa,SAAQ,MAAM,MAAI;gBAC5C,SAAA,gBAAA,QAAA;KAGL,MAAM,KAEZ,EAAA;;;;;;;;;AChCA,MAAA,2BAAA,cAAA,WAAA,CAAA,OAAA,QAAA;CACA;EAEI,MAAA,UAAA,kBAAA,KAAA;AACA,iCAAgB,KAA+B,MAAK,UAAA,QAAA,UAAA,WAAA,CACpD,OAKA,EAAA;AACA,yBAAkB,SAAM,MAAA;AACxB,YACE,SAAA,MAAA;AAEJ,uBAAA,cAAA,cAAA,eAAA;GACA,aAAA,MAAA;GASM,OAAU,MAAC"}
|
package/react/lib/JBTextarea.tsx
CHANGED
|
@@ -34,7 +34,7 @@ const JBTextarea = React.forwardRef((props:Props, ref) => {
|
|
|
34
34
|
useJBTextareaAttribute(element, props);
|
|
35
35
|
useEvents(element,props);
|
|
36
36
|
return (
|
|
37
|
-
<jb-textarea placeholder={props.placeholder} class={props.className} style={props.style} ref={element} label={props.label} message={props.message}
|
|
37
|
+
<jb-textarea placeholder={props.placeholder} class={props.className} style={props.style} ref={element} label={props.label} message={props.message}></jb-textarea>
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -45,6 +45,5 @@ export type Props = EventProps & JBTextareaAttributes & {
|
|
|
45
45
|
className?: string,
|
|
46
46
|
message?:string,
|
|
47
47
|
style?:CSSProperties,
|
|
48
|
-
name?:string,
|
|
49
48
|
}
|
|
50
49
|
export {JBTextarea};
|
|
@@ -8,6 +8,8 @@ export type JBTextareaAttributes = {
|
|
|
8
8
|
autoHeight?: boolean,
|
|
9
9
|
required?:boolean
|
|
10
10
|
error?: string,
|
|
11
|
+
name?:string,
|
|
12
|
+
|
|
11
13
|
}
|
|
12
14
|
export function useJBTextareaAttribute(element: RefObject<JBTextareaWebComponent>, props: JBTextareaAttributes) {
|
|
13
15
|
|
|
@@ -42,4 +44,13 @@ export function useJBTextareaAttribute(element: RefObject<JBTextareaWebComponent
|
|
|
42
44
|
element?.current?.removeAttribute('error');
|
|
43
45
|
}
|
|
44
46
|
}, [props.error]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (props.name) {
|
|
50
|
+
element?.current?.setAttribute('name', props.name || '');
|
|
51
|
+
} else {
|
|
52
|
+
element?.current?.removeAttribute('name');
|
|
53
|
+
}
|
|
54
|
+
}, [props.name]);
|
|
55
|
+
|
|
45
56
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ShowValidationErrorInput, ValidationHelper, type WithValidation } from 'jb-validation';
|
|
2
|
-
import type { JBFormInputStandards } from 'jb-form';
|
|
3
|
-
export * from './types.js';
|
|
4
|
-
export declare class JBTextareaWebComponent extends HTMLElement implements WithValidation, JBFormInputStandards<string> {
|
|
5
|
-
#private;
|
|
6
|
-
static get formAssociated(): boolean;
|
|
7
|
-
get value(): string;
|
|
8
|
-
set value(value: string);
|
|
9
|
-
get isAutoValidationDisabled(): boolean;
|
|
10
|
-
set isAutoValidationDisabled(value: boolean);
|
|
11
|
-
get disabled(): boolean;
|
|
12
|
-
set disabled(value: boolean);
|
|
13
|
-
set required(value: boolean);
|
|
14
|
-
get required(): boolean;
|
|
15
|
-
get name(): string;
|
|
16
|
-
initialValue: string;
|
|
17
|
-
get isDirty(): boolean;
|
|
18
|
-
constructor();
|
|
19
|
-
autoHeight: boolean;
|
|
20
|
-
get validation(): ValidationHelper<string>;
|
|
21
|
-
static get observedAttributes(): string[];
|
|
22
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
23
|
-
showValidationError(error: ShowValidationErrorInput | string): void;
|
|
24
|
-
clearValidationError(): void;
|
|
25
|
-
get validationMessage(): string;
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
* @description this method used to check for validity but doesn't show error to user and just return the result
|
|
29
|
-
* this method used by #internal of component
|
|
30
|
-
*/
|
|
31
|
-
checkValidity(): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @public
|
|
34
|
-
* @description this method used to check for validity and show error to user
|
|
35
|
-
*/
|
|
36
|
-
reportValidity(): boolean;
|
|
37
|
-
}
|
package/dist/lib/types.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EventTypeWithTarget } from "jb-core";
|
|
2
|
-
import type { JBTextareaWebComponent } from "./jb-textarea";
|
|
3
|
-
export type JBTextareaElements = {
|
|
4
|
-
textarea: HTMLTextAreaElement;
|
|
5
|
-
label: HTMLLabelElement;
|
|
6
|
-
labelValue: HTMLSpanElement;
|
|
7
|
-
messageBox: HTMLDivElement;
|
|
8
|
-
};
|
|
9
|
-
export type ValidationValue = string;
|
|
10
|
-
export type JBTextareaEventType<TEvent> = EventTypeWithTarget<TEvent, JBTextareaWebComponent>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ShowValidationErrorInput, ValidationHelper, type WithValidation } from 'jb-validation';
|
|
2
|
-
import type { JBFormInputStandards } from 'jb-form';
|
|
3
|
-
export * from './types.js';
|
|
4
|
-
export declare class JBTextareaWebComponent extends HTMLElement implements WithValidation, JBFormInputStandards<string> {
|
|
5
|
-
#private;
|
|
6
|
-
static get formAssociated(): boolean;
|
|
7
|
-
get value(): string;
|
|
8
|
-
set value(value: string);
|
|
9
|
-
get isAutoValidationDisabled(): boolean;
|
|
10
|
-
set isAutoValidationDisabled(value: boolean);
|
|
11
|
-
get disabled(): boolean;
|
|
12
|
-
set disabled(value: boolean);
|
|
13
|
-
set required(value: boolean);
|
|
14
|
-
get required(): boolean;
|
|
15
|
-
get name(): string;
|
|
16
|
-
initialValue: string;
|
|
17
|
-
get isDirty(): boolean;
|
|
18
|
-
constructor();
|
|
19
|
-
autoHeight: boolean;
|
|
20
|
-
get validation(): ValidationHelper<string>;
|
|
21
|
-
static get observedAttributes(): string[];
|
|
22
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
23
|
-
showValidationError(error: ShowValidationErrorInput | string): void;
|
|
24
|
-
clearValidationError(): void;
|
|
25
|
-
get validationMessage(): string;
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
* @description this method used to check for validity but doesn't show error to user and just return the result
|
|
29
|
-
* this method used by #internal of component
|
|
30
|
-
*/
|
|
31
|
-
checkValidity(): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @public
|
|
34
|
-
* @description this method used to check for validity and show error to user
|
|
35
|
-
*/
|
|
36
|
-
reportValidity(): boolean;
|
|
37
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EventTypeWithTarget } from "jb-core";
|
|
2
|
-
import type { JBTextareaWebComponent } from "./jb-textarea";
|
|
3
|
-
export type JBTextareaElements = {
|
|
4
|
-
textarea: HTMLTextAreaElement;
|
|
5
|
-
label: HTMLLabelElement;
|
|
6
|
-
labelValue: HTMLSpanElement;
|
|
7
|
-
messageBox: HTMLDivElement;
|
|
8
|
-
};
|
|
9
|
-
export type ValidationValue = string;
|
|
10
|
-
export type JBTextareaEventType<TEvent> = EventTypeWithTarget<TEvent, JBTextareaWebComponent>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare function useEvent(dom: HTMLElement, event: any, handler: any, passive?: boolean): void;
|
|
3
|
-
export declare function useBindEvent<TRef extends React.MutableRefObject<any | null>, TEvent>(ref: TRef, event: string, handler: (e: TEvent) => void, passive?: boolean): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isMobile: () => boolean;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import 'jb-textarea';
|
|
3
|
-
import { JBTextareaWebComponent, type ValidationValue } from 'jb-textarea';
|
|
4
|
-
import { type ValidationItem } from "jb-validation";
|
|
5
|
-
import { EventProps } from './events-hook.js';
|
|
6
|
-
declare global {
|
|
7
|
-
namespace JSX {
|
|
8
|
-
interface IntrinsicElements {
|
|
9
|
-
'jb-textarea': JBTextareaType;
|
|
10
|
-
}
|
|
11
|
-
interface JBTextareaType extends React.DetailedHTMLProps<React.HTMLAttributes<JBTextareaWebComponent>, JBTextareaWebComponent> {
|
|
12
|
-
class?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
message?: string;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
declare const JBTextarea: React.ForwardRefExoticComponent<EventProps & {
|
|
21
|
-
label?: string;
|
|
22
|
-
value?: string | null | undefined;
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
className?: string;
|
|
25
|
-
style?: CSSProperties;
|
|
26
|
-
validationList?: ValidationItem<ValidationValue>[];
|
|
27
|
-
autoHeight?: boolean;
|
|
28
|
-
message?: string;
|
|
29
|
-
name?: string;
|
|
30
|
-
required?: boolean;
|
|
31
|
-
} & React.RefAttributes<unknown>>;
|
|
32
|
-
export type Props = EventProps & {
|
|
33
|
-
label?: string;
|
|
34
|
-
value?: string | null | undefined;
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
className?: string;
|
|
37
|
-
style?: CSSProperties;
|
|
38
|
-
validationList?: ValidationItem<ValidationValue>[];
|
|
39
|
-
autoHeight?: boolean;
|
|
40
|
-
message?: string;
|
|
41
|
-
name?: string;
|
|
42
|
-
required?: boolean;
|
|
43
|
-
};
|
|
44
|
-
export { JBTextarea };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
import type { JBTextareaWebComponent, JBTextareaEventType } from 'jb-textarea';
|
|
3
|
-
export type EventProps = {
|
|
4
|
-
/**
|
|
5
|
-
* when component loaded, in most cases component is already loaded before react mount so you dont need this but if you load web-component dynamically with lazy load it will be called after react mount
|
|
6
|
-
*/
|
|
7
|
-
onLoad?: (e: JBTextareaEventType<CustomEvent>) => void;
|
|
8
|
-
/**
|
|
9
|
-
* when all property set and ready to use, in most cases component is already loaded before react mount so you dont need this but if you load web-component dynamically with lazy load it will be called after react mount
|
|
10
|
-
*/
|
|
11
|
-
onInit?: (e: JBTextareaEventType<CustomEvent>) => void;
|
|
12
|
-
onChange?: (e: JBTextareaEventType<Event>) => void;
|
|
13
|
-
onFocus?: (e: JBTextareaEventType<FocusEvent>) => void;
|
|
14
|
-
onBlur?: (e: JBTextareaEventType<FocusEvent>) => void;
|
|
15
|
-
onKeyDown?: (e: JBTextareaEventType<KeyboardEvent>) => void;
|
|
16
|
-
onKeyUp?: (e: JBTextareaEventType<KeyboardEvent>) => void;
|
|
17
|
-
onInput?: (e: JBTextareaEventType<InputEvent>) => void;
|
|
18
|
-
onBeforeinput?: (e: JBTextareaEventType<InputEvent>) => void;
|
|
19
|
-
};
|
|
20
|
-
export declare function useEvents(element: RefObject<JBTextareaWebComponent>, props: EventProps): void;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import 'jb-textarea';
|
|
3
|
-
import { JBTextareaWebComponent, type ValidationValue } from 'jb-textarea';
|
|
4
|
-
import { type ValidationItem } from "jb-validation";
|
|
5
|
-
import { EventProps } from './events-hook.js';
|
|
6
|
-
declare global {
|
|
7
|
-
namespace JSX {
|
|
8
|
-
interface IntrinsicElements {
|
|
9
|
-
'jb-textarea': JBTextareaType;
|
|
10
|
-
}
|
|
11
|
-
interface JBTextareaType extends React.DetailedHTMLProps<React.HTMLAttributes<JBTextareaWebComponent>, JBTextareaWebComponent> {
|
|
12
|
-
class?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
message?: string;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
declare const JBTextarea: React.ForwardRefExoticComponent<EventProps & {
|
|
21
|
-
label?: string;
|
|
22
|
-
value?: string | null | undefined;
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
className?: string;
|
|
25
|
-
style?: CSSProperties;
|
|
26
|
-
validationList?: ValidationItem<ValidationValue>[];
|
|
27
|
-
autoHeight?: boolean;
|
|
28
|
-
message?: string;
|
|
29
|
-
name?: string;
|
|
30
|
-
required?: boolean;
|
|
31
|
-
} & React.RefAttributes<unknown>>;
|
|
32
|
-
export type Props = EventProps & {
|
|
33
|
-
label?: string;
|
|
34
|
-
value?: string | null | undefined;
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
className?: string;
|
|
37
|
-
style?: CSSProperties;
|
|
38
|
-
validationList?: ValidationItem<ValidationValue>[];
|
|
39
|
-
autoHeight?: boolean;
|
|
40
|
-
message?: string;
|
|
41
|
-
name?: string;
|
|
42
|
-
required?: boolean;
|
|
43
|
-
};
|
|
44
|
-
export { JBTextarea };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
import type { JBTextareaWebComponent, JBTextareaEventType } from 'jb-textarea';
|
|
3
|
-
export type EventProps = {
|
|
4
|
-
/**
|
|
5
|
-
* when component loaded, in most cases component is already loaded before react mount so you dont need this but if you load web-component dynamically with lazy load it will be called after react mount
|
|
6
|
-
*/
|
|
7
|
-
onLoad?: (e: JBTextareaEventType<CustomEvent>) => void;
|
|
8
|
-
/**
|
|
9
|
-
* when all property set and ready to use, in most cases component is already loaded before react mount so you dont need this but if you load web-component dynamically with lazy load it will be called after react mount
|
|
10
|
-
*/
|
|
11
|
-
onInit?: (e: JBTextareaEventType<CustomEvent>) => void;
|
|
12
|
-
onChange?: (e: JBTextareaEventType<Event>) => void;
|
|
13
|
-
onFocus?: (e: JBTextareaEventType<FocusEvent>) => void;
|
|
14
|
-
onBlur?: (e: JBTextareaEventType<FocusEvent>) => void;
|
|
15
|
-
onKeyDown?: (e: JBTextareaEventType<KeyboardEvent>) => void;
|
|
16
|
-
onKeyUp?: (e: JBTextareaEventType<KeyboardEvent>) => void;
|
|
17
|
-
onInput?: (e: JBTextareaEventType<InputEvent>) => void;
|
|
18
|
-
onBeforeinput?: (e: JBTextareaEventType<InputEvent>) => void;
|
|
19
|
-
};
|
|
20
|
-
export declare function useEvents(element: RefObject<JBTextareaWebComponent>, props: EventProps): void;
|