@sunggang/ui-lib 0.4.7 → 0.4.8
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/BaseCkeditor.cjs.js +0 -1
- package/BaseCkeditor.esm.js +0 -1
- package/CkEditor.cjs.js +0 -1
- package/CkEditor.esm.js +0 -1
- package/Form.cjs.js +0 -1
- package/Form.esm.js +0 -1
- package/baseSwitch.cjs.js +387 -68
- package/baseSwitch.esm.js +387 -67
- package/index.cjs.css +3 -0
- package/index.cjs.js +0 -1
- package/index.esm.css +3 -0
- package/index.esm.js +0 -1
- package/package.json +1 -1
- package/src/lib/Form/DynamicLoader.d.ts +10 -0
- package/src/lib/Form/demo-test.d.ts +66 -0
- package/src/lib/Form/index.d.ts +5 -2
package/index.cjs.css
CHANGED
package/index.cjs.js
CHANGED
|
@@ -25,7 +25,6 @@ var CustomSelect = require('./CustomSelect.cjs.js');
|
|
|
25
25
|
require('@radix-ui/react-slot');
|
|
26
26
|
require('class-variance-authority');
|
|
27
27
|
require('tailwind-merge');
|
|
28
|
-
require('next/dynamic');
|
|
29
28
|
require('./setPrototypeOf.cjs.js');
|
|
30
29
|
require('./memoize-one.esm.cjs.js');
|
|
31
30
|
require('@emotion/react');
|
package/index.esm.css
CHANGED
package/index.esm.js
CHANGED
|
@@ -23,7 +23,6 @@ export { C as CustomSelect } from './CustomSelect.esm.js';
|
|
|
23
23
|
import '@radix-ui/react-slot';
|
|
24
24
|
import 'class-variance-authority';
|
|
25
25
|
import 'tailwind-merge';
|
|
26
|
-
import 'next/dynamic';
|
|
27
26
|
import './setPrototypeOf.esm.js';
|
|
28
27
|
import './memoize-one.esm.esm.js';
|
|
29
28
|
import '@emotion/react';
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormItem } from './types';
|
|
3
|
+
type ComponentType = React.ComponentType<any>;
|
|
4
|
+
export declare function analyzeUsedTypes(formConfig: FormItem[][]): Set<string>;
|
|
5
|
+
export declare function useDynamicComponents(formConfig: FormItem[][]): {
|
|
6
|
+
loadedComponents: Record<string, ComponentType>;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function createDynamicComponent(type: string, loadedComponents: Record<string, ComponentType>): ComponentType | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FormItem } from './types';
|
|
2
|
+
export declare const Regex: {
|
|
3
|
+
phone: RegExp;
|
|
4
|
+
};
|
|
5
|
+
export declare const checkboxConfig: FormItem;
|
|
6
|
+
export declare const checkboxGroupConfig: FormItem;
|
|
7
|
+
export declare const radioConfig: FormItem;
|
|
8
|
+
export declare const configWithoutCkEditor: (getValues: (name: string) => unknown) => FormItem[][];
|
|
9
|
+
export declare const config: (getValues: (name: string) => unknown) => (FormItem[] | ({
|
|
10
|
+
type: string;
|
|
11
|
+
name: string;
|
|
12
|
+
label: string;
|
|
13
|
+
validateOption: {
|
|
14
|
+
required: string;
|
|
15
|
+
};
|
|
16
|
+
icon: string;
|
|
17
|
+
flatpickrOptions: {
|
|
18
|
+
mode: string;
|
|
19
|
+
time_24hr: boolean;
|
|
20
|
+
enableTime: boolean;
|
|
21
|
+
dateFormat: string;
|
|
22
|
+
};
|
|
23
|
+
option?: undefined;
|
|
24
|
+
placeholder?: undefined;
|
|
25
|
+
noDataText?: undefined;
|
|
26
|
+
hiddenText?: undefined;
|
|
27
|
+
hiddenSearch?: undefined;
|
|
28
|
+
dropStyle?: undefined;
|
|
29
|
+
className?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
type: string;
|
|
32
|
+
name: string;
|
|
33
|
+
label: string;
|
|
34
|
+
option: {
|
|
35
|
+
name: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[];
|
|
38
|
+
validateOption: {
|
|
39
|
+
required: string;
|
|
40
|
+
};
|
|
41
|
+
placeholder: string;
|
|
42
|
+
noDataText: string;
|
|
43
|
+
hiddenText: boolean;
|
|
44
|
+
hiddenSearch: boolean;
|
|
45
|
+
dropStyle: {
|
|
46
|
+
bgClass: string;
|
|
47
|
+
hoverClass: string;
|
|
48
|
+
selectedClass: string;
|
|
49
|
+
borderColor: string;
|
|
50
|
+
textColor: string;
|
|
51
|
+
};
|
|
52
|
+
className: string;
|
|
53
|
+
icon?: undefined;
|
|
54
|
+
flatpickrOptions?: undefined;
|
|
55
|
+
})[] | {
|
|
56
|
+
type: string;
|
|
57
|
+
name: string;
|
|
58
|
+
label: string;
|
|
59
|
+
imageStyleType: string;
|
|
60
|
+
noticeLabel: string;
|
|
61
|
+
errorText: string;
|
|
62
|
+
validateOption: {
|
|
63
|
+
required: boolean;
|
|
64
|
+
};
|
|
65
|
+
limitSize: number;
|
|
66
|
+
}[])[];
|
package/src/lib/Form/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { FormItem, FormType } from './types';
|
|
3
4
|
export interface FormModule {
|
|
4
5
|
Fields: FC<{
|
|
@@ -6,6 +7,7 @@ export interface FormModule {
|
|
|
6
7
|
}>;
|
|
7
8
|
Row: FC<{
|
|
8
9
|
rowItems: FormItem[];
|
|
10
|
+
loadedComponents?: Record<string, React.ComponentType<any>>;
|
|
9
11
|
}>;
|
|
10
12
|
TextField: FC<{
|
|
11
13
|
item: FormItem;
|
|
@@ -39,7 +41,7 @@ export interface FormModule {
|
|
|
39
41
|
}>;
|
|
40
42
|
BaseCkeditor: FC<{
|
|
41
43
|
item: FormItem;
|
|
42
|
-
config
|
|
44
|
+
config?: any;
|
|
43
45
|
}>;
|
|
44
46
|
BaseSelect: FC<{
|
|
45
47
|
item: FormItem;
|
|
@@ -64,7 +66,8 @@ export declare const Fields: ({ formConfig, fieldsClass }: {
|
|
|
64
66
|
export declare const CustomUploadField: ({ item }: {
|
|
65
67
|
item: any;
|
|
66
68
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
67
|
-
export declare const Row: ({ rowItems }: {
|
|
69
|
+
export declare const Row: ({ rowItems, loadedComponents }: {
|
|
68
70
|
rowItems: any;
|
|
71
|
+
loadedComponents?: {} | undefined;
|
|
69
72
|
}) => any;
|
|
70
73
|
export declare const Form: FormModule;
|