dynamicformdjx 0.3.2 → 0.3.4

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.
@@ -1,8 +1,10 @@
1
1
  import { ValueType, DyCFormItem, DyRandomFun } from '../types';
2
+ import { Ref } from 'vue';
2
3
  declare const tranArr: (obj: ValueType, arrayFun: DyRandomFun, splitSymbol: string) => DyCFormItem[];
3
4
  declare const resetObj: (arr: DyCFormItem[], splitSymbol: string) => ValueType;
4
5
  declare const parseValue: (value: string, isArray?: boolean, isNumber?: boolean, splitSym?: string) => any;
5
6
  declare const formatNumberInput: (val: string, isArray?: boolean, splitSymbol?: string) => string;
6
7
  declare const getDepthColor: (depth: number) => string;
7
8
  declare const saferRepairColor: (colors: string[], i: number) => string;
8
- export { tranArr, resetObj, parseValue, formatNumberInput, getDepthColor, saferRepairColor };
9
+ declare function ensureRef(v: any): Ref<any>;
10
+ export { tranArr, resetObj, parseValue, formatNumberInput, getDepthColor, saferRepairColor, ensureRef };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamicformdjx",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "author": "xczcdjx",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- "use strict";require('./index.css');const l=(r,s,n)=>Object.keys(r).map((t,e)=>{const i=r[t],a=Array.isArray(i),u=a?i.every(c=>typeof c=="number"):typeof i=="number";return{rId:s(e),key:t,value:a?i.join(n):i,isArray:a||void 0,isNumber:u||void 0}}),f=(r,s)=>r.reduce((n,t)=>(t.key.trim()&&(n[t.key]=o(t.value,t.isArray,t.isNumber,s)),n),{}),o=(r,s,n,t=",")=>{let e;return s?n?e=String(r).split(t).map(Number).filter(i=>!Number.isNaN(i)):e=String(r).split(t):n?e=parseFloat(r):e=r.toString(),e},p=(r,s,n=",")=>{const t=e=>{e=e.replace(/[^\d.-]/g,"");let i=!1;e.startsWith("-")&&(i=!0),e=e.replace(/-/g,"");const a=e.indexOf(".");return a!==-1&&(e=e.slice(0,a+1)+e.slice(a+1).replace(/\./g,"")),(i?"-":"")+e};return s?r.split(n).map(e=>t(e)).join(n):t(r)},m=r=>`hsl(${r*35%360}, 60%, 65%)`,g=(r,s)=>r[s-1]??m(s);exports.formatNumberInput=p;exports.parseValue=o;exports.resetObj=f;exports.saferRepairColor=g;exports.tranArr=l;
@@ -1,29 +0,0 @@
1
- import './index.css';const f = (r, n, s) => Object.keys(r).map((t, e) => {
2
- const i = r[t], a = Array.isArray(i), o = a ? i.every((c) => typeof c == "number") : typeof i == "number";
3
- return {
4
- rId: n(e),
5
- key: t,
6
- value: a ? i.join(s) : i,
7
- isArray: a || void 0,
8
- isNumber: o || void 0
9
- };
10
- }), p = (r, n) => r.reduce((s, t) => (t.key.trim() && (s[t.key] = u(t.value, t.isArray, t.isNumber, n)), s), {}), u = (r, n, s, t = ",") => {
11
- let e;
12
- return n ? s ? e = String(r).split(t).map(Number).filter((i) => !Number.isNaN(i)) : e = String(r).split(t) : s ? e = parseFloat(r) : e = r.toString(), e;
13
- }, g = (r, n, s = ",") => {
14
- const t = (e) => {
15
- e = e.replace(/[^\d.-]/g, "");
16
- let i = !1;
17
- e.startsWith("-") && (i = !0), e = e.replace(/-/g, "");
18
- const a = e.indexOf(".");
19
- return a !== -1 && (e = e.slice(0, a + 1) + e.slice(a + 1).replace(/\./g, "")), (i ? "-" : "") + e;
20
- };
21
- return n ? r.split(s).map((e) => t(e)).join(s) : t(r);
22
- }, l = (r) => `hsl(${r * 35 % 360}, 60%, 65%)`, m = (r, n) => r[n - 1] ?? l(n);
23
- export {
24
- g as f,
25
- u as p,
26
- p as r,
27
- m as s,
28
- f as t
29
- };