dynamicformdjx-react 0.0.2 → 0.0.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.
@@ -0,0 +1,17 @@
1
+ import { ValueType, DyRandomFun, DyBtnConfig, DyListConfig, DyCasConfig, DyCasFormItem, ExposeType } from '../types';
2
+ type DynamicCascadeInputProps = {
3
+ depth?: number;
4
+ value: ValueType;
5
+ isController?: boolean;
6
+ dyCls?: string;
7
+ randomFun?: DyRandomFun;
8
+ newChildTxt?: (it: DyCasFormItem) => string;
9
+ onChange: (v: ValueType) => void;
10
+ onReset?: () => void;
11
+ onMerge?: (v: ValueType, ori: DyCasFormItem[]) => void;
12
+ btnConfigs?: DyBtnConfig;
13
+ configs?: DyCasConfig;
14
+ dyListConfigs?: DyListConfig;
15
+ };
16
+ declare const DynamicCascadeInput: import('react').ForwardRefExoticComponent<DynamicCascadeInputProps & import('react').RefAttributes<ExposeType>>;
17
+ export default DynamicCascadeInput;
@@ -1,5 +1,5 @@
1
1
  import { ExposeType, FSize, ValueType, DyRandomFun, DyBtnConfig, DyListConfig, DyConfig, DyCFormItem } from '../types';
2
- type DynamicFormProps = {
2
+ type DynamicInputProps = {
3
3
  size?: FSize;
4
4
  value: ValueType;
5
5
  isController?: boolean;
@@ -9,8 +9,8 @@ type DynamicFormProps = {
9
9
  onReset?: () => void;
10
10
  onMerge?: (v: ValueType, ori: DyCFormItem[]) => void;
11
11
  btnConfigs?: DyBtnConfig;
12
- config?: DyConfig;
12
+ configs?: DyConfig;
13
13
  dyListConfigs?: DyListConfig;
14
14
  };
15
- declare const DynamicInput: import('react').ForwardRefExoticComponent<DynamicFormProps & import('react').RefAttributes<ExposeType>>;
15
+ declare const DynamicInput: import('react').ForwardRefExoticComponent<DynamicInputProps & import('react').RefAttributes<ExposeType>>;
16
16
  export default DynamicInput;
@@ -1,8 +1,10 @@
1
- import { ValueType, DyCFormItem, DyRandomFun } from '../types';
1
+ import { ValueType, DyCFormItem, DyRandomFun, DyCasFormItem } from '../types';
2
2
  declare const tranArr: (obj: ValueType, arrayFun: DyRandomFun, splitSymbol: string) => DyCFormItem[];
3
3
  declare const resetObj: (arr: DyCFormItem[], splitSymbol: string) => ValueType;
4
4
  declare const parseValue: (value: string, isArray?: boolean, isNumber?: boolean, splitSym?: string) => any;
5
5
  declare const formatNumberInput: (val: string, isArray?: boolean, splitSymbol?: string) => string;
6
6
  declare const getDepthColor: (depth: number) => string;
7
7
  declare const saferRepairColor: (colors: string[], i: number) => string;
8
- export { tranArr, resetObj, parseValue, formatNumberInput, getDepthColor, saferRepairColor };
8
+ declare function updateArrayAtPath(items: DyCasFormItem[], path: number[], // 指向某个 item(最后一个数字是下标)
9
+ updater: (arr: DyCasFormItem[], index: number) => DyCasFormItem[]): DyCasFormItem[];
10
+ export { tranArr, resetObj, parseValue, formatNumberInput, getDepthColor, saferRepairColor, updateArrayAtPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamicformdjx-react",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "author": "xczcdjx",
6
6
  "license": "MIT",
@@ -41,8 +41,8 @@
41
41
  "preview": "vite preview"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": "^18.0.0",
45
- "react-dom": "^18.0.0"
44
+ "react": ">=17",
45
+ "react-dom": ">=17"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@eslint/js": "^9.39.1",