my-react-lib-prashant 1.0.6 → 1.0.7

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.
@@ -18693,12 +18693,8 @@ function ne(e) {
18693
18693
  value: t,
18694
18694
  placeholder: e.placeholder || "Enter text",
18695
18695
  onChange: (t) => {
18696
- n(t.target.value), e.onChange && e.onChange(t.target.value);
18697
- },
18698
- style: {
18699
- padding: "8px",
18700
- width: "250px",
18701
- marginTop: "5px"
18696
+ let r = t.target.value;
18697
+ n(r), e.onChange && e.onChange(r), window.dispatchEvent(new CustomEvent("textbox-change", { detail: r }));
18702
18698
  }
18703
18699
  })] });
18704
18700
  }
@@ -168,4 +168,4 @@ Check the top-level render call using <`+n+`>.`)}return t}function Xe(e,t){if(!(
168
168
  <%s {...props} />
169
169
  React keys must be passed directly to JSX without using spread:
170
170
  let props = %s;
171
- <%s key={someKey} {...props} />`,_,h,g.length>0?`{`+g.join(`: ..., `)+`: ...}`:`{}`,h),et[h+_]=!0)}return e===i?$e(f):Qe(f),f}function nt(e,t,n){return tt(e,t,n,!0)}function rt(e,t,n){return tt(e,t,n,!1)}var it=rt,at=nt;e.Fragment=i,e.jsx=it,e.jsxs=at})()})),te=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=P():t.exports=ee()}))();function ne(e){let[t,n]=(0,y.useState)(``);return(0,te.jsxs)(`div`,{children:[(0,te.jsxs)(`label`,{children:[e.label||`Textbox`,`:`]}),(0,te.jsx)(`input`,{type:`text`,value:t,placeholder:e.placeholder||`Enter text`,onChange:t=>{n(t.target.value),e.onChange&&e.onChange(t.target.value)},style:{padding:`8px`,width:`250px`,marginTop:`5px`}})]})}var re=N(ne,y.default,b.default,{props:{label:`string`,placeholder:`string`}});customElements.define(`my-textbox`,re)});
171
+ <%s key={someKey} {...props} />`,_,h,g.length>0?`{`+g.join(`: ..., `)+`: ...}`:`{}`,h),et[h+_]=!0)}return e===i?$e(f):Qe(f),f}function nt(e,t,n){return tt(e,t,n,!0)}function rt(e,t,n){return tt(e,t,n,!1)}var it=rt,at=nt;e.Fragment=i,e.jsx=it,e.jsxs=at})()})),te=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=P():t.exports=ee()}))();function ne(e){let[t,n]=(0,y.useState)(``);return(0,te.jsxs)(`div`,{children:[(0,te.jsxs)(`label`,{children:[e.label||`Textbox`,`:`]}),(0,te.jsx)(`input`,{type:`text`,value:t,placeholder:e.placeholder||`Enter text`,onChange:t=>{let r=t.target.value;n(r),e.onChange&&e.onChange(r),window.dispatchEvent(new CustomEvent(`textbox-change`,{detail:r}))}})]})}var re=N(ne,y.default,b.default,{props:{label:`string`,placeholder:`string`}});customElements.define(`my-textbox`,re)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-react-lib-prashant",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "dist/my-react-lib-prashant.js",
5
5
  "module": "dist/my-react-lib-prashant.js",
6
6
  "type": "module",
@@ -4,11 +4,18 @@ export default function TextBox(props) {
4
4
  const [value, setValue] = useState("");
5
5
 
6
6
  const handleChange = (e) => {
7
- setValue(e.target.value);
7
+ const newValue = e.target.value;
8
+ setValue(newValue);
8
9
 
9
10
  if (props.onChange) {
10
- props.onChange(e.target.value);
11
+ props.onChange(newValue);
11
12
  }
13
+
14
+ window.dispatchEvent(
15
+ new CustomEvent("textbox-change", {
16
+ detail: newValue
17
+ })
18
+ );
12
19
  };
13
20
 
14
21
  return (
@@ -19,11 +26,6 @@ export default function TextBox(props) {
19
26
  value={value}
20
27
  placeholder={props.placeholder || "Enter text"}
21
28
  onChange={handleChange}
22
- style={{
23
- padding: "8px",
24
- width: "250px",
25
- marginTop: "5px"
26
- }}
27
29
  />
28
30
  </div>
29
31
  );