@oneplatformdev/ui 0.1.10-94 → 0.1.10-95

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.1.10-95 (2025-11-25)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated @oneplatformdev/utils to 0.1.1-144
6
+ - Updated @oneplatformdev/hooks to 0.1.0-130
7
+ - Updated @oneplatformdev/tokens to 0.0.1-117
8
+
1
9
  ## 0.1.10-94 (2025-11-25)
2
10
 
3
11
  ### 🧱 Updated Dependencies
@@ -1 +1 @@
1
- {"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../src/FormInput/FormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAc,YAAY,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AAsGjE,eAAO,MAAM,SAAS,EAAiC,CAAC,IAAI,SAAS,WAAW,EAC9E,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAC1D,YAAY,CAAC"}
1
+ {"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../src/FormInput/FormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAc,YAAY,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AAuGjE,eAAO,MAAM,SAAS,EAAiC,CAAC,IAAI,SAAS,WAAW,EAC9E,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAC1D,YAAY,CAAC"}
@@ -1,46 +1,49 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { FormControl as x } from "../Form/Form.js";
3
- import { FormRenderControl as C } from "../Form/FormRenderControl.js";
4
- import { Input as D } from "../Input/Input.js";
5
- import { forwardRef as F } from "react";
6
- function I(l, e) {
7
- const { form: a, label: s, name: u, onChange: c, onBlur: m, onPaste: p, style: i, ...f } = l;
8
- return /* @__PURE__ */ r(
9
- C,
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { FormControl as D } from "../Form/Form.js";
3
+ import { FormRenderControl as F } from "../Form/FormRenderControl.js";
4
+ import { Input as I } from "../Input/Input.js";
5
+ import { forwardRef as P } from "react";
6
+ function y(c, e) {
7
+ const { form: u, label: m, name: l, onChange: p, onBlur: i, onPaste: f, style: h, onPastePrepare: s, ...v } = c;
8
+ return /* @__PURE__ */ a(
9
+ F,
10
10
  {
11
- form: a,
12
- name: u,
13
- label: s,
14
- render: ({ field: o }) => /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(
15
- D,
11
+ form: u,
12
+ name: l,
13
+ label: m,
14
+ render: ({ field: n }) => /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(
15
+ I,
16
16
  {
17
- ...o,
18
- ...f,
17
+ ...n,
18
+ ...v,
19
19
  ref: (t) => {
20
- o.ref(t), typeof e == "function" ? e(t) : e && (e.current = t);
20
+ n.ref(t), typeof e == "function" ? e(t) : e && (e.current = t);
21
21
  },
22
- style: i,
23
- value: o.value || "",
22
+ style: h,
23
+ value: n.value || "",
24
24
  onChange: (...t) => {
25
- o.onChange?.(...t), c?.(...t);
25
+ n.onChange?.(...t), p?.(...t);
26
26
  },
27
27
  onPaste: (t) => {
28
- const h = t.clipboardData.getData("text"), n = t.currentTarget, v = n.selectionStart ?? n.value.length, g = n.selectionEnd ?? n.value.length, d = n.value.slice(0, v) + h + n.value.slice(g);
29
- t.preventDefault(), a.setValue(u, d, {
28
+ const g = t.clipboardData.getData("text"), o = t.currentTarget, d = o.selectionStart ?? o.value.length, C = o.selectionEnd ?? o.value.length;
29
+ let r = o.value.slice(0, d) + g + o.value.slice(C);
30
+ s && (r = s(r, t));
31
+ const x = r;
32
+ t.preventDefault(), u.setValue(l, x, {
30
33
  shouldDirty: !0,
31
34
  shouldTouch: !0
32
- }), p?.(t);
35
+ }), f?.(t);
33
36
  },
34
37
  onBlur: (...t) => {
35
- o.onBlur?.(), m?.(...t);
38
+ n.onBlur?.(), i?.(...t);
36
39
  }
37
40
  }
38
41
  ) })
39
42
  }
40
43
  );
41
44
  }
42
- const j = F(I);
45
+ const w = P(y);
43
46
  export {
44
- j as FormInput
47
+ w as FormInput
45
48
  };
46
49
  //# sourceMappingURL=FormInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormInput.js","sources":["../../src/FormInput/FormInput.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Input } from '../Input';\nimport { FormInputProps } from './FormInput.types';\nimport { FieldValues, Path, PathValue } from 'react-hook-form';\nimport { forwardRef, ReactElement, Ref, RefObject } from 'react';\n\n// TODO: add description\n// export const FormInput = <Data extends FieldValues>(\n// props: FormInputProps<Data> & { inputRef?: Ref<HTMLInputElement> }\n// ) => {\n// const { inputRef, form, label, name, onChange, onBlur, style, ...rest } =\n// props;\n// return (\n// <FormRenderControl\n// form={form}\n// name={name}\n// label={label}\n// render={({ field }) => (\n// <FormControl>\n// <Input\n// {...field}\n// {...rest}\n// ref={(el) => {\n// field.ref(el);\n// if (typeof inputRef === 'function') {\n// inputRef(el);\n// } else if (inputRef) {\n// (inputRef as RefObject<HTMLInputElement | null>).current = el;\n// }\n// }}\n// style={style}\n// value={field.value || ''}\n// onChange={(...rest) => {\n// field.onChange?.(...rest);\n// onChange?.(...rest);\n// }}\n// onBlur={(...rest) => {\n// field.onBlur?.();\n// onBlur?.(...rest);\n// }}\n// />\n// </FormControl>\n// )}\n// />\n// );\n// };\n\nfunction FormInputInner<Data extends FieldValues>(\n props: FormInputProps<Data>,\n ref: Ref<HTMLInputElement>\n) {\n const { form, label, name, onChange, onBlur, onPaste, style, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n render={({ field }) => (\n <FormControl>\n <Input\n {...field}\n {...rest}\n ref={(el) => {\n field.ref(el);\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as RefObject<HTMLInputElement | null>).current = el;\n }\n }}\n style={style}\n value={field.value || ''}\n onChange={(...rest) => {\n field.onChange?.(...rest);\n onChange?.(...rest);\n }}\n onPaste={(e) => {\n const pasted = e.clipboardData.getData('text');\n const t = e.currentTarget;\n\n const start = t.selectionStart ?? t.value.length;\n const end = t.selectionEnd ?? t.value.length;\n\n const next = t.value.slice(0, start) + pasted + t.value.slice(end);\n const value = next as unknown as PathValue<Data, Path<Data>>;\n\n e.preventDefault();\n\n form.setValue(name, value, {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onPaste?.(e);\n }}\n onBlur={(...rest) => {\n field.onBlur?.();\n onBlur?.(...rest);\n }}\n />\n </FormControl>\n )}\n />\n );\n}\n\nexport const FormInput = forwardRef(FormInputInner) as <Data extends FieldValues>(\n props: FormInputProps<Data> & { ref?: Ref<HTMLInputElement> }\n) => ReactElement;\n"],"names":["FormInputInner","props","ref","form","label","name","onChange","onBlur","onPaste","style","rest","jsx","FormRenderControl","field","FormControl","Input","el","e","pasted","t","start","end","value","FormInput","forwardRef"],"mappings":";;;;;AA+CA,SAASA,EACPC,GACAC,GACA;AACA,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,GAAGC,EAAA,IAAST;AACzE,SACE,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAT;AAAA,MACA,MAAAE;AAAA,MACA,OAAAD;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAS,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACE,GAAGF;AAAA,UACH,GAAGH;AAAA,UACJ,KAAK,CAACM,MAAO;AACX,YAAAH,EAAM,IAAIG,CAAE,GACR,OAAOd,KAAQ,aACjBA,EAAIc,CAAE,IACGd,MACRA,EAA2C,UAAUc;AAAA,UAE1D;AAAA,UACA,OAAAP;AAAA,UACA,OAAOI,EAAM,SAAS;AAAA,UACtB,UAAU,IAAIH,MAAS;AACrB,YAAAG,EAAM,WAAW,GAAGH,CAAI,GACxBJ,IAAW,GAAGI,CAAI;AAAA,UACpB;AAAA,UACA,SAAS,CAACO,MAAM;AACd,kBAAMC,IAASD,EAAE,cAAc,QAAQ,MAAM,GACvCE,IAAIF,EAAE,eAENG,IAAQD,EAAE,kBAAkBA,EAAE,MAAM,QACpCE,IAAMF,EAAE,gBAAgBA,EAAE,MAAM,QAGhCG,IADOH,EAAE,MAAM,MAAM,GAAGC,CAAK,IAAIF,IAASC,EAAE,MAAM,MAAME,CAAG;AAGjE,YAAAJ,EAAE,eAAA,GAEFd,EAAK,SAASE,GAAMiB,GAAO;AAAA,cACzB,aAAa;AAAA,cACb,aAAa;AAAA,YAAA,CACd,GAEDd,IAAUS,CAAC;AAAA,UACb;AAAA,UACA,QAAQ,IAAIP,MAAS;AACnB,YAAAG,EAAM,SAAA,GACNN,IAAS,GAAGG,CAAI;AAAA,UAClB;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAIR;AAEO,MAAMa,IAAYC,EAAWxB,CAAc;"}
1
+ {"version":3,"file":"FormInput.js","sources":["../../src/FormInput/FormInput.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Input } from '../Input';\nimport { FormInputProps } from './FormInput.types';\nimport { FieldValues, Path, PathValue } from 'react-hook-form';\nimport { forwardRef, ReactElement, Ref, RefObject } from 'react';\n\n// TODO: add description\n// export const FormInput = <Data extends FieldValues>(\n// props: FormInputProps<Data> & { inputRef?: Ref<HTMLInputElement> }\n// ) => {\n// const { inputRef, form, label, name, onChange, onBlur, style, ...rest } =\n// props;\n// return (\n// <FormRenderControl\n// form={form}\n// name={name}\n// label={label}\n// render={({ field }) => (\n// <FormControl>\n// <Input\n// {...field}\n// {...rest}\n// ref={(el) => {\n// field.ref(el);\n// if (typeof inputRef === 'function') {\n// inputRef(el);\n// } else if (inputRef) {\n// (inputRef as RefObject<HTMLInputElement | null>).current = el;\n// }\n// }}\n// style={style}\n// value={field.value || ''}\n// onChange={(...rest) => {\n// field.onChange?.(...rest);\n// onChange?.(...rest);\n// }}\n// onBlur={(...rest) => {\n// field.onBlur?.();\n// onBlur?.(...rest);\n// }}\n// />\n// </FormControl>\n// )}\n// />\n// );\n// };\n\nfunction FormInputInner<Data extends FieldValues>(\n props: FormInputProps<Data>,\n ref: Ref<HTMLInputElement>\n) {\n const { form, label, name, onChange, onBlur, onPaste, style, onPastePrepare, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n render={({ field }) => (\n <FormControl>\n <Input\n {...field}\n {...rest}\n ref={(el) => {\n field.ref(el);\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as RefObject<HTMLInputElement | null>).current = el;\n }\n }}\n style={style}\n value={field.value || ''}\n onChange={(...rest) => {\n field.onChange?.(...rest);\n onChange?.(...rest);\n }}\n onPaste={(e) => {\n const pasted = e.clipboardData.getData('text');\n const t = e.currentTarget;\n\n const start = t.selectionStart ?? t.value.length;\n const end = t.selectionEnd ?? t.value.length;\n\n let next = t.value.slice(0, start) + pasted + t.value.slice(end);\n if(onPastePrepare) next = onPastePrepare(next, e);\n const value = next as unknown as PathValue<Data, Path<Data>>;\n\n e.preventDefault();\n\n form.setValue(name, value, {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onPaste?.(e);\n }}\n onBlur={(...rest) => {\n field.onBlur?.();\n onBlur?.(...rest);\n }}\n />\n </FormControl>\n )}\n />\n );\n}\n\nexport const FormInput = forwardRef(FormInputInner) as <Data extends FieldValues>(\n props: FormInputProps<Data> & { ref?: Ref<HTMLInputElement> }\n) => ReactElement;\n"],"names":["FormInputInner","props","ref","form","label","name","onChange","onBlur","onPaste","style","onPastePrepare","rest","jsx","FormRenderControl","field","FormControl","Input","el","e","pasted","t","start","end","next","value","FormInput","forwardRef"],"mappings":";;;;;AA+CA,SAASA,EACPC,GACAC,GACA;AACA,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,gBAAAC,GAAgB,GAAGC,EAAA,IAASV;AACzF,SACE,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAV;AAAA,MACA,MAAAE;AAAA,MACA,OAAAD;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAU,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACE,GAAGF;AAAA,UACH,GAAGH;AAAA,UACJ,KAAK,CAACM,MAAO;AACX,YAAAH,EAAM,IAAIG,CAAE,GACR,OAAOf,KAAQ,aACjBA,EAAIe,CAAE,IACGf,MACRA,EAA2C,UAAUe;AAAA,UAE1D;AAAA,UACA,OAAAR;AAAA,UACA,OAAOK,EAAM,SAAS;AAAA,UACtB,UAAU,IAAIH,MAAS;AACrB,YAAAG,EAAM,WAAW,GAAGH,CAAI,GACxBL,IAAW,GAAGK,CAAI;AAAA,UACpB;AAAA,UACA,SAAS,CAACO,MAAM;AACd,kBAAMC,IAASD,EAAE,cAAc,QAAQ,MAAM,GACvCE,IAAIF,EAAE,eAENG,IAAQD,EAAE,kBAAkBA,EAAE,MAAM,QACpCE,IAAMF,EAAE,gBAAgBA,EAAE,MAAM;AAEtC,gBAAIG,IAAOH,EAAE,MAAM,MAAM,GAAGC,CAAK,IAAIF,IAASC,EAAE,MAAM,MAAME,CAAG;AAC/D,YAAGZ,MAAgBa,IAAOb,EAAea,GAAML,CAAC;AAChD,kBAAMM,IAAQD;AAEd,YAAAL,EAAE,eAAA,GAEFf,EAAK,SAASE,GAAMmB,GAAO;AAAA,cACzB,aAAa;AAAA,cACb,aAAa;AAAA,YAAA,CACd,GAEDhB,IAAUU,CAAC;AAAA,UACb;AAAA,UACA,QAAQ,IAAIP,MAAS;AACnB,YAAAG,EAAM,SAAA,GACNP,IAAS,GAAGI,CAAI;AAAA,UAClB;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAIR;AAEO,MAAMc,IAAYC,EAAW1B,CAAc;"}
@@ -13,5 +13,7 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>,
13
13
  slotProps?: InputSlotProps;
14
14
  /** func transform event.target.value before onChange event call*/
15
15
  onTransform?: (value: string, event: ChangeEvent<HTMLInputElement>) => string;
16
+ /** func transform pasted value before set to input */
17
+ onPastePrepare?: (value: string, event: React.ClipboardEvent<HTMLInputElement>) => string;
16
18
  }
17
19
  //# sourceMappingURL=Input.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.types.d.ts","sourceRoot":"","sources":["../../src/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,wBAAwB,EACxB,cAAc,EACd,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,WAAW,mBACf,SAAQ,wBAAwB,CAAC,OAAO,SAAS,CAAC;IAClD,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,cAAc,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,CAAC,KAAK,MAAM,CAAC;CAC3F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.1.10-94",
3
+ "version": "0.1.10-95",
4
4
  "description": "UI component library for OnePlatform",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [
@@ -105,8 +105,8 @@
105
105
  "recharts": "^3.2.0",
106
106
  "sonner": "^2.0.7",
107
107
  "vaul": "^1.1.2",
108
- "@oneplatformdev/tokens": "^0.0.1-116",
109
- "@oneplatformdev/utils": "^0.1.1-143",
110
- "@oneplatformdev/hooks": "^0.1.0-129"
108
+ "@oneplatformdev/tokens": "^0.0.1-117",
109
+ "@oneplatformdev/hooks": "^0.1.0-130",
110
+ "@oneplatformdev/utils": "^0.1.1-144"
111
111
  }
112
112
  }